From b69a90cbc78e5e1ae1429dcf13daada91f3fba97 Mon Sep 17 00:00:00 2001 From: Adolfo Panizo Date: Tue, 6 Mar 2018 16:00:53 +0100 Subject: [PATCH] Improving production build --- config/webpack.config.prod.js | 51 +- dist/index.html | 1 - dist/main.js | 159781 ------------------------------- dist/main.js.map | 1 - package.json | 1 + 5 files changed, 36 insertions(+), 159799 deletions(-) delete mode 100644 dist/index.html delete mode 100644 dist/main.js delete mode 100644 dist/main.js.map diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 3cfe0470..e36665e5 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -2,6 +2,7 @@ const autoprefixer = require('autoprefixer'); const cssvars = require('postcss-simple-vars'); const webpack = require('webpack'); +const UglifyJSPlugin = require('uglifyjs-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ManifestPlugin = require('webpack-manifest-plugin'); @@ -74,8 +75,40 @@ module.exports = { // You can exclude the *.map files from the build during deployment. devtool: 'source-map', // In production, we only want to load the polyfills and the app code. + optimization: { + minimizer: [ + // we specify a custom UglifyJsPlugin here to get source maps in production + new UglifyJSPlugin({ + uglifyOptions: { + output: { + comments: false + }, + compress: { + unsafe_comps: true, + properties: true, + keep_fargs: false, + pure_getters: true, + collapse_vars: true, + warnings: false, + sequences: true, + dead_code: true, + drop_debugger: true, + comparisons: true, + conditionals: true, + evaluate: true, + booleans: true, + loops: true, + unused: true, + hoist_funs: true, + if_return: true, + join_vars: true, + drop_console: true + } + } + }) + ] + }, entry: [ - "babel-polyfill", require.resolve('./polyfills'), paths.appIndexJs ], @@ -107,7 +140,7 @@ module.exports = { rules: [ { test: /\.(js|jsx)$/, - exclude: /node_modules/, + include: paths.appSrc, use: { loader: "babel-loader" } @@ -135,20 +168,6 @@ module.exports = { ], }) }, - // JSON is not enabled by default in Webpack but both Node and Browserify - // allow it implicitly so we also enable it. - { - test: /\.json$/, - loader: 'json-loader' - }, - // "file" loader for svg - { - test: /\.svg$/, - loader: 'file-loader', - query: { - name: 'static/media/[name].[hash:8].[ext]' - } - }, ] }, plugins: [ diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 0d854030..00000000 --- a/dist/index.html +++ /dev/null @@ -1 +0,0 @@ - Multisig Safe
\ No newline at end of file diff --git a/dist/main.js b/dist/main.js deleted file mode 100644 index db92e108..00000000 --- a/dist/main.js +++ /dev/null @@ -1,159781 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ function hotDisposeChunk(chunkId) { -/******/ delete installedChunks[chunkId]; -/******/ } -/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; -/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars -/******/ function webpackHotUpdateCallback(chunkId, moreModules) { -/******/ hotAddUpdateChunk(chunkId, moreModules); -/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); -/******/ } ; -/******/ -/******/ // eslint-disable-next-line no-unused-vars -/******/ function hotDownloadUpdateChunk(chunkId) { -/******/ var head = document.getElementsByTagName("head")[0]; -/******/ var script = document.createElement("script"); -/******/ script.charset = "utf-8"; -/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; -/******/ ; -/******/ head.appendChild(script); -/******/ } -/******/ -/******/ // eslint-disable-next-line no-unused-vars -/******/ function hotDownloadManifest(requestTimeout) { -/******/ requestTimeout = requestTimeout || 10000; -/******/ return new Promise(function(resolve, reject) { -/******/ if (typeof XMLHttpRequest === "undefined") -/******/ return reject(new Error("No browser support")); -/******/ try { -/******/ var request = new XMLHttpRequest(); -/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; -/******/ request.open("GET", requestPath, true); -/******/ request.timeout = requestTimeout; -/******/ request.send(null); -/******/ } catch (err) { -/******/ return reject(err); -/******/ } -/******/ request.onreadystatechange = function() { -/******/ if (request.readyState !== 4) return; -/******/ if (request.status === 0) { -/******/ // timeout -/******/ reject( -/******/ new Error("Manifest request to " + requestPath + " timed out.") -/******/ ); -/******/ } else if (request.status === 404) { -/******/ // no update available -/******/ resolve(); -/******/ } else if (request.status !== 200 && request.status !== 304) { -/******/ // other failure -/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); -/******/ } else { -/******/ // success -/******/ try { -/******/ var update = JSON.parse(request.responseText); -/******/ } catch (e) { -/******/ reject(e); -/******/ return; -/******/ } -/******/ resolve(update); -/******/ } -/******/ }; -/******/ }); -/******/ } -/******/ -/******/ var hotApplyOnUpdate = true; -/******/ var hotCurrentHash = "2d4e0a0c1e355481b1c5"; // eslint-disable-line no-unused-vars -/******/ var hotRequestTimeout = 10000; -/******/ var hotCurrentModuleData = {}; -/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars -/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars -/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars -/******/ -/******/ // eslint-disable-next-line no-unused-vars -/******/ function hotCreateRequire(moduleId) { -/******/ var me = installedModules[moduleId]; -/******/ if (!me) return __webpack_require__; -/******/ var fn = function(request) { -/******/ if (me.hot.active) { -/******/ if (installedModules[request]) { -/******/ if (!installedModules[request].parents.includes(moduleId)) -/******/ installedModules[request].parents.push(moduleId); -/******/ } else { -/******/ hotCurrentParents = [moduleId]; -/******/ hotCurrentChildModule = request; -/******/ } -/******/ if (!me.children.includes(request)) me.children.push(request); -/******/ } else { -/******/ console.warn( -/******/ "[HMR] unexpected require(" + -/******/ request + -/******/ ") from disposed module " + -/******/ moduleId -/******/ ); -/******/ hotCurrentParents = []; -/******/ } -/******/ return __webpack_require__(request); -/******/ }; -/******/ var ObjectFactory = function ObjectFactory(name) { -/******/ return { -/******/ configurable: true, -/******/ enumerable: true, -/******/ get: function() { -/******/ return __webpack_require__[name]; -/******/ }, -/******/ set: function(value) { -/******/ __webpack_require__[name] = value; -/******/ } -/******/ }; -/******/ }; -/******/ for (var name in __webpack_require__) { -/******/ if ( -/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) && -/******/ name !== "e" -/******/ ) { -/******/ Object.defineProperty(fn, name, ObjectFactory(name)); -/******/ } -/******/ } -/******/ fn.e = function(chunkId) { -/******/ if (hotStatus === "ready") hotSetStatus("prepare"); -/******/ hotChunksLoading++; -/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { -/******/ finishChunkLoading(); -/******/ throw err; -/******/ }); -/******/ -/******/ function finishChunkLoading() { -/******/ hotChunksLoading--; -/******/ if (hotStatus === "prepare") { -/******/ if (!hotWaitingFilesMap[chunkId]) { -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ } -/******/ }; -/******/ return fn; -/******/ } -/******/ -/******/ // eslint-disable-next-line no-unused-vars -/******/ function hotCreateModule(moduleId) { -/******/ var hot = { -/******/ // private stuff -/******/ _acceptedDependencies: {}, -/******/ _declinedDependencies: {}, -/******/ _selfAccepted: false, -/******/ _selfDeclined: false, -/******/ _disposeHandlers: [], -/******/ _main: hotCurrentChildModule !== moduleId, -/******/ -/******/ // Module API -/******/ active: true, -/******/ accept: function(dep, callback) { -/******/ if (typeof dep === "undefined") hot._selfAccepted = true; -/******/ else if (typeof dep === "function") hot._selfAccepted = dep; -/******/ else if (typeof dep === "object") -/******/ for (var i = 0; i < dep.length; i++) -/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; -/******/ else hot._acceptedDependencies[dep] = callback || function() {}; -/******/ }, -/******/ decline: function(dep) { -/******/ if (typeof dep === "undefined") hot._selfDeclined = true; -/******/ else if (typeof dep === "object") -/******/ for (var i = 0; i < dep.length; i++) -/******/ hot._declinedDependencies[dep[i]] = true; -/******/ else hot._declinedDependencies[dep] = true; -/******/ }, -/******/ dispose: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ addDisposeHandler: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ removeDisposeHandler: function(callback) { -/******/ var idx = hot._disposeHandlers.indexOf(callback); -/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ // Management API -/******/ check: hotCheck, -/******/ apply: hotApply, -/******/ status: function(l) { -/******/ if (!l) return hotStatus; -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ addStatusHandler: function(l) { -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ removeStatusHandler: function(l) { -/******/ var idx = hotStatusHandlers.indexOf(l); -/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ //inherit from previous dispose call -/******/ data: hotCurrentModuleData[moduleId] -/******/ }; -/******/ hotCurrentChildModule = undefined; -/******/ return hot; -/******/ } -/******/ -/******/ var hotStatusHandlers = []; -/******/ var hotStatus = "idle"; -/******/ -/******/ function hotSetStatus(newStatus) { -/******/ hotStatus = newStatus; -/******/ for (var i = 0; i < hotStatusHandlers.length; i++) -/******/ hotStatusHandlers[i].call(null, newStatus); -/******/ } -/******/ -/******/ // while downloading -/******/ var hotWaitingFiles = 0; -/******/ var hotChunksLoading = 0; -/******/ var hotWaitingFilesMap = {}; -/******/ var hotRequestedFilesMap = {}; -/******/ var hotAvailableFilesMap = {}; -/******/ var hotDeferred; -/******/ -/******/ // The update info -/******/ var hotUpdate, hotUpdateNewHash; -/******/ -/******/ function toModuleId(id) { -/******/ var isNumber = +id + "" === id; -/******/ return isNumber ? +id : id; -/******/ } -/******/ -/******/ function hotCheck(apply) { -/******/ if (hotStatus !== "idle") -/******/ throw new Error("check() is only allowed in idle status"); -/******/ hotApplyOnUpdate = apply; -/******/ hotSetStatus("check"); -/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { -/******/ if (!update) { -/******/ hotSetStatus("idle"); -/******/ return null; -/******/ } -/******/ hotRequestedFilesMap = {}; -/******/ hotWaitingFilesMap = {}; -/******/ hotAvailableFilesMap = update.c; -/******/ hotUpdateNewHash = update.h; -/******/ -/******/ hotSetStatus("prepare"); -/******/ var promise = new Promise(function(resolve, reject) { -/******/ hotDeferred = { -/******/ resolve: resolve, -/******/ reject: reject -/******/ }; -/******/ }); -/******/ hotUpdate = {}; -/******/ var chunkId = "main"; -/******/ { -/******/ // eslint-disable-line no-lone-blocks -/******/ /*globals chunkId */ -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if ( -/******/ hotStatus === "prepare" && -/******/ hotChunksLoading === 0 && -/******/ hotWaitingFiles === 0 -/******/ ) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ return promise; -/******/ }); -/******/ } -/******/ -/******/ // eslint-disable-next-line no-unused-vars -/******/ function hotAddUpdateChunk(chunkId, moreModules) { -/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) -/******/ return; -/******/ hotRequestedFilesMap[chunkId] = false; -/******/ for (var moduleId in moreModules) { -/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ hotUpdate[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ -/******/ function hotEnsureUpdateChunk(chunkId) { -/******/ if (!hotAvailableFilesMap[chunkId]) { -/******/ hotWaitingFilesMap[chunkId] = true; -/******/ } else { -/******/ hotRequestedFilesMap[chunkId] = true; -/******/ hotWaitingFiles++; -/******/ hotDownloadUpdateChunk(chunkId); -/******/ } -/******/ } -/******/ -/******/ function hotUpdateDownloaded() { -/******/ hotSetStatus("ready"); -/******/ var deferred = hotDeferred; -/******/ hotDeferred = null; -/******/ if (!deferred) return; -/******/ if (hotApplyOnUpdate) { -/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to -/******/ // avoid triggering uncaught exception warning in Chrome. -/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 -/******/ Promise.resolve() -/******/ .then(function() { -/******/ return hotApply(hotApplyOnUpdate); -/******/ }) -/******/ .then( -/******/ function(result) { -/******/ deferred.resolve(result); -/******/ }, -/******/ function(err) { -/******/ deferred.reject(err); -/******/ } -/******/ ); -/******/ } else { -/******/ var outdatedModules = []; -/******/ for (var id in hotUpdate) { -/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ outdatedModules.push(toModuleId(id)); -/******/ } -/******/ } -/******/ deferred.resolve(outdatedModules); -/******/ } -/******/ } -/******/ -/******/ function hotApply(options) { -/******/ if (hotStatus !== "ready") -/******/ throw new Error("apply() is only allowed in ready status"); -/******/ options = options || {}; -/******/ -/******/ var cb; -/******/ var i; -/******/ var j; -/******/ var module; -/******/ var moduleId; -/******/ -/******/ function getAffectedStuff(updateModuleId) { -/******/ var outdatedModules = [updateModuleId]; -/******/ var outdatedDependencies = {}; -/******/ -/******/ var queue = outdatedModules.slice().map(function(id) { -/******/ return { -/******/ chain: [id], -/******/ id: id -/******/ }; -/******/ }); -/******/ while (queue.length > 0) { -/******/ var queueItem = queue.pop(); -/******/ var moduleId = queueItem.id; -/******/ var chain = queueItem.chain; -/******/ module = installedModules[moduleId]; -/******/ if (!module || module.hot._selfAccepted) continue; -/******/ if (module.hot._selfDeclined) { -/******/ return { -/******/ type: "self-declined", -/******/ chain: chain, -/******/ moduleId: moduleId -/******/ }; -/******/ } -/******/ if (module.hot._main) { -/******/ return { -/******/ type: "unaccepted", -/******/ chain: chain, -/******/ moduleId: moduleId -/******/ }; -/******/ } -/******/ for (var i = 0; i < module.parents.length; i++) { -/******/ var parentId = module.parents[i]; -/******/ var parent = installedModules[parentId]; -/******/ if (!parent) continue; -/******/ if (parent.hot._declinedDependencies[moduleId]) { -/******/ return { -/******/ type: "declined", -/******/ chain: chain.concat([parentId]), -/******/ moduleId: moduleId, -/******/ parentId: parentId -/******/ }; -/******/ } -/******/ if (outdatedModules.includes(parentId)) continue; -/******/ if (parent.hot._acceptedDependencies[moduleId]) { -/******/ if (!outdatedDependencies[parentId]) -/******/ outdatedDependencies[parentId] = []; -/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); -/******/ continue; -/******/ } -/******/ delete outdatedDependencies[parentId]; -/******/ outdatedModules.push(parentId); -/******/ queue.push({ -/******/ chain: chain.concat([parentId]), -/******/ id: parentId -/******/ }); -/******/ } -/******/ } -/******/ -/******/ return { -/******/ type: "accepted", -/******/ moduleId: updateModuleId, -/******/ outdatedModules: outdatedModules, -/******/ outdatedDependencies: outdatedDependencies -/******/ }; -/******/ } -/******/ -/******/ function addAllToSet(a, b) { -/******/ for (var i = 0; i < b.length; i++) { -/******/ var item = b[i]; -/******/ if (!a.includes(item)) a.push(item); -/******/ } -/******/ } -/******/ -/******/ // at begin all updates modules are outdated -/******/ // the "outdated" status can propagate to parents if they don't accept the children -/******/ var outdatedDependencies = {}; -/******/ var outdatedModules = []; -/******/ var appliedUpdate = {}; -/******/ -/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { -/******/ console.warn( -/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module" -/******/ ); -/******/ }; -/******/ -/******/ for (var id in hotUpdate) { -/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ moduleId = toModuleId(id); -/******/ var result; -/******/ if (hotUpdate[id]) { -/******/ result = getAffectedStuff(moduleId); -/******/ } else { -/******/ result = { -/******/ type: "disposed", -/******/ moduleId: id -/******/ }; -/******/ } -/******/ var abortError = false; -/******/ var doApply = false; -/******/ var doDispose = false; -/******/ var chainInfo = ""; -/******/ if (result.chain) { -/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); -/******/ } -/******/ switch (result.type) { -/******/ case "self-declined": -/******/ if (options.onDeclined) options.onDeclined(result); -/******/ if (!options.ignoreDeclined) -/******/ abortError = new Error( -/******/ "Aborted because of self decline: " + -/******/ result.moduleId + -/******/ chainInfo -/******/ ); -/******/ break; -/******/ case "declined": -/******/ if (options.onDeclined) options.onDeclined(result); -/******/ if (!options.ignoreDeclined) -/******/ abortError = new Error( -/******/ "Aborted because of declined dependency: " + -/******/ result.moduleId + -/******/ " in " + -/******/ result.parentId + -/******/ chainInfo -/******/ ); -/******/ break; -/******/ case "unaccepted": -/******/ if (options.onUnaccepted) options.onUnaccepted(result); -/******/ if (!options.ignoreUnaccepted) -/******/ abortError = new Error( -/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo -/******/ ); -/******/ break; -/******/ case "accepted": -/******/ if (options.onAccepted) options.onAccepted(result); -/******/ doApply = true; -/******/ break; -/******/ case "disposed": -/******/ if (options.onDisposed) options.onDisposed(result); -/******/ doDispose = true; -/******/ break; -/******/ default: -/******/ throw new Error("Unexception type " + result.type); -/******/ } -/******/ if (abortError) { -/******/ hotSetStatus("abort"); -/******/ return Promise.reject(abortError); -/******/ } -/******/ if (doApply) { -/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; -/******/ addAllToSet(outdatedModules, result.outdatedModules); -/******/ for (moduleId in result.outdatedDependencies) { -/******/ if ( -/******/ Object.prototype.hasOwnProperty.call( -/******/ result.outdatedDependencies, -/******/ moduleId -/******/ ) -/******/ ) { -/******/ if (!outdatedDependencies[moduleId]) -/******/ outdatedDependencies[moduleId] = []; -/******/ addAllToSet( -/******/ outdatedDependencies[moduleId], -/******/ result.outdatedDependencies[moduleId] -/******/ ); -/******/ } -/******/ } -/******/ } -/******/ if (doDispose) { -/******/ addAllToSet(outdatedModules, [result.moduleId]); -/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Store self accepted outdated modules to require them later by the module system -/******/ var outdatedSelfAcceptedModules = []; -/******/ for (i = 0; i < outdatedModules.length; i++) { -/******/ moduleId = outdatedModules[i]; -/******/ if ( -/******/ installedModules[moduleId] && -/******/ installedModules[moduleId].hot._selfAccepted -/******/ ) -/******/ outdatedSelfAcceptedModules.push({ -/******/ module: moduleId, -/******/ errorHandler: installedModules[moduleId].hot._selfAccepted -/******/ }); -/******/ } -/******/ -/******/ // Now in "dispose" phase -/******/ hotSetStatus("dispose"); -/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { -/******/ if (hotAvailableFilesMap[chunkId] === false) { -/******/ hotDisposeChunk(chunkId); -/******/ } -/******/ }); -/******/ -/******/ var idx; -/******/ var queue = outdatedModules.slice(); -/******/ while (queue.length > 0) { -/******/ moduleId = queue.pop(); -/******/ module = installedModules[moduleId]; -/******/ if (!module) continue; -/******/ -/******/ var data = {}; -/******/ -/******/ // Call dispose handlers -/******/ var disposeHandlers = module.hot._disposeHandlers; -/******/ for (j = 0; j < disposeHandlers.length; j++) { -/******/ cb = disposeHandlers[j]; -/******/ cb(data); -/******/ } -/******/ hotCurrentModuleData[moduleId] = data; -/******/ -/******/ // disable module (this disables requires from this module) -/******/ module.hot.active = false; -/******/ -/******/ // remove module from cache -/******/ delete installedModules[moduleId]; -/******/ -/******/ // when disposing there is no need to call dispose handler -/******/ delete outdatedDependencies[moduleId]; -/******/ -/******/ // remove "parents" references from all children -/******/ for (j = 0; j < module.children.length; j++) { -/******/ var child = installedModules[module.children[j]]; -/******/ if (!child) continue; -/******/ idx = child.parents.indexOf(moduleId); -/******/ if (idx >= 0) { -/******/ child.parents.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ -/******/ // remove outdated dependency from module children -/******/ var dependency; -/******/ var moduleOutdatedDependencies; -/******/ for (moduleId in outdatedDependencies) { -/******/ if ( -/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) -/******/ ) { -/******/ module = installedModules[moduleId]; -/******/ if (module) { -/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { -/******/ dependency = moduleOutdatedDependencies[j]; -/******/ idx = module.children.indexOf(dependency); -/******/ if (idx >= 0) module.children.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Not in "apply" phase -/******/ hotSetStatus("apply"); -/******/ -/******/ hotCurrentHash = hotUpdateNewHash; -/******/ -/******/ // insert new code -/******/ for (moduleId in appliedUpdate) { -/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { -/******/ modules[moduleId] = appliedUpdate[moduleId]; -/******/ } -/******/ } -/******/ -/******/ // call accept handlers -/******/ var error = null; -/******/ for (moduleId in outdatedDependencies) { -/******/ if ( -/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) -/******/ ) { -/******/ module = installedModules[moduleId]; -/******/ if (module) { -/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ var callbacks = []; -/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) { -/******/ dependency = moduleOutdatedDependencies[i]; -/******/ cb = module.hot._acceptedDependencies[dependency]; -/******/ if (cb) { -/******/ if (callbacks.includes(cb)) continue; -/******/ callbacks.push(cb); -/******/ } -/******/ } -/******/ for (i = 0; i < callbacks.length; i++) { -/******/ cb = callbacks[i]; -/******/ try { -/******/ cb(moduleOutdatedDependencies); -/******/ } catch (err) { -/******/ if (options.onErrored) { -/******/ options.onErrored({ -/******/ type: "accept-errored", -/******/ moduleId: moduleId, -/******/ dependencyId: moduleOutdatedDependencies[i], -/******/ error: err -/******/ }); -/******/ } -/******/ if (!options.ignoreErrored) { -/******/ if (!error) error = err; -/******/ } -/******/ } -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Load self accepted modules -/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { -/******/ var item = outdatedSelfAcceptedModules[i]; -/******/ moduleId = item.module; -/******/ hotCurrentParents = [moduleId]; -/******/ try { -/******/ __webpack_require__(moduleId); -/******/ } catch (err) { -/******/ if (typeof item.errorHandler === "function") { -/******/ try { -/******/ item.errorHandler(err); -/******/ } catch (err2) { -/******/ if (options.onErrored) { -/******/ options.onErrored({ -/******/ type: "self-accept-error-handler-errored", -/******/ moduleId: moduleId, -/******/ error: err2, -/******/ originalError: err -/******/ }); -/******/ } -/******/ if (!options.ignoreErrored) { -/******/ if (!error) error = err2; -/******/ } -/******/ if (!error) error = err; -/******/ } -/******/ } else { -/******/ if (options.onErrored) { -/******/ options.onErrored({ -/******/ type: "self-accept-errored", -/******/ moduleId: moduleId, -/******/ error: err -/******/ }); -/******/ } -/******/ if (!options.ignoreErrored) { -/******/ if (!error) error = err; -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // handle errors in accept handlers and self accepted module load -/******/ if (error) { -/******/ hotSetStatus("fail"); -/******/ return Promise.reject(error); -/******/ } -/******/ -/******/ hotSetStatus("idle"); -/******/ return new Promise(function(resolve) { -/******/ resolve(outdatedModules); -/******/ }); -/******/ } -/******/ -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {}, -/******/ hot: hotCreateModule(moduleId), -/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), -/******/ children: [] -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // __webpack_hash__ -/******/ __webpack_require__.h = function() { return hotCurrentHash; }; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return hotCreateRequire("./src/index.js")(__webpack_require__.s = "./src/index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./gnosis-safe-contracts/build/contracts/GnosisSafe.json": -/*!***************************************************************!*\ - !*** ./gnosis-safe-contracts/build/contracts/GnosisSafe.json ***! - \***************************************************************/ -/*! exports provided: contractName, abi, bytecode, deployedBytecode, sourceMap, deployedSourceMap, source, sourcePath, ast, legacyAST, compiler, networks, schemaVersion, updatedAt, default */ -/***/ (function(module) { - -module.exports = {"contractName":"GnosisSafe","abi":[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"owners","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"threshold","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"}],"name":"isConfirmed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"NAME","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nonce","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"extensions","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isExtension","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VERSION","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_owners","type":"address[]"},{"name":"_threshold","type":"uint8"},{"name":"to","type":"address"},{"name":"data","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"}],"name":"ContractCreation","type":"event"},{"constant":false,"inputs":[{"name":"_owners","type":"address[]"},{"name":"_threshold","type":"uint8"},{"name":"to","type":"address"},{"name":"data","type":"bytes"}],"name":"setup","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_masterCopy","type":"address"}],"name":"changeMasterCopy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"},{"name":"_threshold","type":"uint8"}],"name":"addOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"ownerIndex","type":"uint256"},{"name":"owner","type":"address"},{"name":"_threshold","type":"uint8"}],"name":"removeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"oldOwnerIndex","type":"uint256"},{"name":"oldOwner","type":"address"},{"name":"newOwner","type":"address"}],"name":"replaceOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_threshold","type":"uint8"}],"name":"changeThreshold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"extension","type":"address"}],"name":"addExtension","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"extensionIndex","type":"uint256"},{"name":"extension","type":"address"}],"name":"removeExtension","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"data","type":"bytes"},{"name":"operation","type":"uint8"},{"name":"_nonce","type":"uint256"}],"name":"confirmTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"data","type":"bytes"},{"name":"operation","type":"uint8"},{"name":"v","type":"uint8[]"},{"name":"r","type":"bytes32[]"},{"name":"s","type":"bytes32[]"},{"name":"_owners","type":"address[]"},{"name":"indices","type":"uint256[]"}],"name":"executeTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"data","type":"bytes"},{"name":"operation","type":"uint8"},{"name":"extension","type":"address"}],"name":"executeExtension","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"data","type":"bytes"},{"name":"operation","type":"uint8"},{"name":"_nonce","type":"uint256"}],"name":"getTransactionHash","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getOwners","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getExtensions","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"transactionHash","type":"bytes32"}],"name":"getConfirmationCount","outputs":[{"name":"confirmationCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"transactionHash","type":"bytes32"}],"name":"getConfirmingOwners","outputs":[{"name":"confirmingOwners","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"}],"bytecode":"0x606060405234156200001057600080fd5b60405162002d6738038062002d67833981016040528080518201919060200180519060200190919080519060200190919080518201919050506200006b84848484620000756401000000000262001b33176401000000009004565b5050505062000374565b600080600060149054906101000a900460ff1660ff161415156200009857600080fd5b84518460ff1611151515620000ac57600080fd5b60018460ff1610151515620000c057600080fd5b600090505b8451811015620001fe5760008582815181101515620000e057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16141515156200010e57600080fd5b6004600086838151811015156200012157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156200018057600080fd5b60016004600087848151811015156200019557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050620000c5565b8460029080519060200190620002169291906200029f565b5083600060146101000a81548160ff021916908360ff16021790555060008373ffffffffffffffffffffffffffffffffffffffff161415156200028057620002738383620002876401000000000262002698176401000000009004565b15156200027f57600080fd5b5b5050505050565b600080600083516020850186600019f4905092915050565b8280548282559060005260206000209081019282156200031b579160200282015b828111156200031a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620002c0565b5b5090506200032a91906200032e565b5090565b6200037191905b808211156200036d57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010162000335565b5090565b90565b6129e380620003846000396000f300606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461014b57806307fa7017146101ae5780630e5229b0146101f0578063113642e514610235578063170ff3e1146102705780632b500041146102a95780632b5b1f821461035f5780632f54bf6e146103f957806342cde4e81461044a57806354e99c6e146104795780637b0519f3146104da5780637de7edef1461053857806383b7db6314610571578063842b954e146105db578063a04222e114610629578063a0e67e2b146106f1578063a3f4df7e1461075b578063affed0e0146107e9578063b6a9002e14610812578063b7f3358d146108c2578063c676920a146108e8578063db85d59c14610964578063f6d3fd86146109c7578063f847ed4814610b98578063ffa1ad7414610be9575b005b341561015657600080fd5b61016c6004808035906020019091905050610c77565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b957600080fd5b6101ee600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cb6565b005b34156101fb57600080fd5b610233600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050610e71565b005b341561024057600080fd5b61025a600480803560001916906020019091905050611011565b6040518082815260200191505060405180910390f35b341561027b57600080fd5b6102a7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e7565b005b34156102b457600080fd5b610341600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803590602001909190505061125e565b60405180826000191660001916815260200191505060405180910390f35b341561036a57600080fd5b6103f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803590602001909190505061140b565b005b341561040457600080fd5b610430600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611561565b604051808215151515815260200191505060405180910390f35b341561045557600080fd5b61045d611581565b604051808260ff1660ff16815260200191505060405180910390f35b341561048457600080fd5b6104d8600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611594565b005b34156104e557600080fd5b61051e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035600019169060200190919050506117cf565b604051808215151515815260200191505060405180910390f35b341561054357600080fd5b61056f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117fe565b005b341561057c57600080fd5b6105846118a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105c75780820151818401526020810190506105ac565b505050509050019250505060405180910390f35b34156105e657600080fd5b610627600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050611935565b005b341561063457600080fd5b6106ef60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611b33565b005b34156106fc57600080fd5b610704611d21565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074757808201518184015260208101905061072c565b505050509050019250505060405180910390f35b341561076657600080fd5b61076e611db5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107ae578082015181840152602081019050610793565b50505050905090810190601f1680156107db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107f457600080fd5b6107fc611dee565b6040518082815260200191505060405180910390f35b341561081d57600080fd5b6108c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611df4565b005b34156108cd57600080fd5b6108e6600480803560ff16906020019091905050611fe7565b005b34156108f357600080fd5b61090d600480803560001916906020019091905050612069565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610950578082015181840152602081019050610935565b505050509050019250505060405180910390f35b341561096f57600080fd5b61098560048080359060200190919050506121fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109d257600080fd5b610b96600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff16906020019091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061223c565b005b3415610ba357600080fd5b610bcf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061263f565b604051808215151515815260200191505060405180910390f35b3415610bf457600080fd5b610bfc61265f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c3c578082015181840152602081019050610c21565b50505050905090810190601f168015610c695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600281815481101515610c8657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cf057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600383815481101515610d1657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d6457600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003600160038054905003815481101515610dd357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610e0e57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480919060019003610e6c91906127ed565b505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610ed157600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f2a57600080fd5b60028054806001018281610f3e9190612819565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060ff16600060149054906101000a900460ff1660ff1614151561100d5761100c81611fe7565b5b5050565b600080600090505b6002805490508110156110e1576006600060028381548110151561103957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846000191660001916815260200190815260200160002060009054906101000a900460ff16156110d45781806001019250505b8080600101915050611019565b50919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112157600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561114757600080fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156111a057600080fd5b600380548060010182816111b49190612845565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060197f01000000000000000000000000000000000000000000000000000000000000000230878787878760405180887effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140185815260200184805190602001908083835b602083101515611391578051825260208201915060208101905060208303925061136c565b6001836020036101000a0380198251168184511680821785525050505050509050018360028111156113bf57fe5b60ff167f01000000000000000000000000000000000000000000000000000000000000000281526001018281526020019750505050505050506040518091039020905095945050505050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561146557600080fd5b6114748686868660015461125e565b9050600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515156114e857600080fd5b6001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550505050505050565b60046020528060005260406000206000915054906101000a900460ff1681565b600060149054906101000a900460ff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ce57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156115f457600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561164d57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1660028481548110151561167357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156116c157600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060028481548110151561178157fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b60066020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183857600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561185e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6118a9612871565b600380548060200260200160405190810160405280929190818152602001828054801561192b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116118e1575b5050505050905090565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196f57600080fd5b8060ff166001600280549050031015151561198957600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166002848154811015156119af57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119fd57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506002600160028054905003815481101515611a6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600284815481101515611aa757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002805480919060019003611b059190612885565b508060ff16600060149054906101000a900460ff1660ff16141515611b2e57611b2d81611fe7565b5b505050565b600080600060149054906101000a900460ff1660ff16141515611b5557600080fd5b84518460ff1611151515611b6857600080fd5b60018460ff1610151515611b7b57600080fd5b600090505b8451811015611cb25760008582815181101515611b9957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611bc657600080fd5b600460008683815181101515611bd857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c3657600080fd5b6001600460008784815181101515611c4a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b80565b8460029080519060200190611cc89291906128b1565b5083600060146101000a81548160ff021916908360ff16021790555060008373ffffffffffffffffffffffffffffffffffffffff16141515611d1a57611d0e8383612698565b1515611d1957600080fd5b5b5050505050565b611d2961293b565b6002805480602002602001604051908101604052809291908181526020018280548015611dab57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611d61575b5050505050905090565b6040805190810160405280600b81526020017f476e6f736973205361666500000000000000000000000000000000000000000081525081565b60015481565b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e4c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663cde09ca933878787876000604051602001526040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001836002811115611f1f57fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b83811015611f5f578082015181840152602081019050611f44565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b1515611fae57600080fd5b6102c65a03f11515611fbf57600080fd5b505050604051805190501515611fd457600080fd5b611fe0858585856126b0565b5050505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561202157600080fd5b6002805490508160ff161115151561203857600080fd5b60018160ff161015151561204b57600080fd5b80600060146101000a81548160ff021916908360ff16021790555050565b61207161293b565b60008061207d84611011565b91508160405180591061208d5750595b9080825280602002602001820160405250925060009150600090505b6002805490508110156121f657600660006002838154811015156120c957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000856000191660001916815260200190815260200160002060009054906101000a900460ff16156121e95760028181548110151561216a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156121a457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081806001019250505b80806001019150506120a9565b5050919050565b60038181548110151561220c57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060006122538e8e8e8e60015461125e565b94506000935060009050600091505b600060149054906101000a900460ff1660ff16821015612518578086511180156122a25750858181518110151561229557fe5b9060200190602002015182145b156123a15786818151811015156122b557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612371575060066000888381518110151561230557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000866000191660001916815260200190815260200160002060009054906101000a900460ff165b151561237c57600080fd5b868181518110151561238a57fe5b906020019060200201519250600181019050612476565b6001858b8385038151811015156123b457fe5b906020019060200201518b8486038151811015156123ce57fe5b906020019060200201518b8587038151811015156123e857fe5b90602001906020020151604051600081526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001945050505050602060405160208103908084039060008661646e5a03f1151561246a57600080fd5b50506020604051035192505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156124ce57600080fd5b8373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1611151561250857600080fd5b8293508180600101925050612262565b60008751111561261357600091505b865182101561261257868281518110151561253e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561260557600060066000898581518110151561259057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000876000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8180600101925050612527565b5b6001806000828254019250508190555061262f8e8e8e8e6126b0565b5050505050505050505050505050565b60056020528060005260406000206000915054906101000a900460ff1681565b6040805190810160405280600581526020017f302e302e3100000000000000000000000000000000000000000000000000000081525081565b600080600083516020850186600019f4905092915050565b60008060028111156126be57fe5b8260028111156126ca57fe5b14156126eb576126db8585856127c1565b15156126e657600080fd5b6127ba565b600160028111156126f857fe5b82600281111561270457fe5b1415612724576127148584612698565b151561271f57600080fd5b6127b9565b61272d836127db565b905060008173ffffffffffffffffffffffffffffffffffffffff161415151561275557600080fd5b7f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51181604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5b5050505050565b60008060008351602085018688600019f190509392505050565b60008151602083016000f09050919050565b81548183558181151161281457818360005260206000209182019101612813919061294f565b5b505050565b8154818355818115116128405781836000526020600020918201910161283f919061294f565b5b505050565b81548183558181151161286c5781836000526020600020918201910161286b919061294f565b5b505050565b602060405190810160405280600081525090565b8154818355818115116128ac578183600052602060002091820191016128ab919061294f565b5b505050565b82805482825590600052602060002090810192821561292a579160200282015b828111156129295782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906128d1565b5b5090506129379190612974565b5090565b602060405190810160405280600081525090565b61297191905b8082111561296d576000816000905550600101612955565b5090565b90565b6129b491905b808211156129b057600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010161297a565b5090565b905600a165627a7a72305820d9fa9b3e6169e8f89baad932031423ed3c1c574105ff91b299c1641d6eb0a8fc0029","deployedBytecode":"0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461014b57806307fa7017146101ae5780630e5229b0146101f0578063113642e514610235578063170ff3e1146102705780632b500041146102a95780632b5b1f821461035f5780632f54bf6e146103f957806342cde4e81461044a57806354e99c6e146104795780637b0519f3146104da5780637de7edef1461053857806383b7db6314610571578063842b954e146105db578063a04222e114610629578063a0e67e2b146106f1578063a3f4df7e1461075b578063affed0e0146107e9578063b6a9002e14610812578063b7f3358d146108c2578063c676920a146108e8578063db85d59c14610964578063f6d3fd86146109c7578063f847ed4814610b98578063ffa1ad7414610be9575b005b341561015657600080fd5b61016c6004808035906020019091905050610c77565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b957600080fd5b6101ee600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cb6565b005b34156101fb57600080fd5b610233600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050610e71565b005b341561024057600080fd5b61025a600480803560001916906020019091905050611011565b6040518082815260200191505060405180910390f35b341561027b57600080fd5b6102a7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e7565b005b34156102b457600080fd5b610341600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803590602001909190505061125e565b60405180826000191660001916815260200191505060405180910390f35b341561036a57600080fd5b6103f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803590602001909190505061140b565b005b341561040457600080fd5b610430600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611561565b604051808215151515815260200191505060405180910390f35b341561045557600080fd5b61045d611581565b604051808260ff1660ff16815260200191505060405180910390f35b341561048457600080fd5b6104d8600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611594565b005b34156104e557600080fd5b61051e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035600019169060200190919050506117cf565b604051808215151515815260200191505060405180910390f35b341561054357600080fd5b61056f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117fe565b005b341561057c57600080fd5b6105846118a1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105c75780820151818401526020810190506105ac565b505050509050019250505060405180910390f35b34156105e657600080fd5b610627600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050611935565b005b341561063457600080fd5b6106ef60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611b33565b005b34156106fc57600080fd5b610704611d21565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074757808201518184015260208101905061072c565b505050509050019250505060405180910390f35b341561076657600080fd5b61076e611db5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107ae578082015181840152602081019050610793565b50505050905090810190601f1680156107db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107f457600080fd5b6107fc611dee565b6040518082815260200191505060405180910390f35b341561081d57600080fd5b6108c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611df4565b005b34156108cd57600080fd5b6108e6600480803560ff16906020019091905050611fe7565b005b34156108f357600080fd5b61090d600480803560001916906020019091905050612069565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610950578082015181840152602081019050610935565b505050509050019250505060405180910390f35b341561096f57600080fd5b61098560048080359060200190919050506121fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109d257600080fd5b610b96600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff16906020019091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061223c565b005b3415610ba357600080fd5b610bcf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061263f565b604051808215151515815260200191505060405180910390f35b3415610bf457600080fd5b610bfc61265f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c3c578082015181840152602081019050610c21565b50505050905090810190601f168015610c695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600281815481101515610c8657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cf057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600383815481101515610d1657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d6457600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003600160038054905003815481101515610dd357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610e0e57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480919060019003610e6c91906127ed565b505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610ed157600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f2a57600080fd5b60028054806001018281610f3e9190612819565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060ff16600060149054906101000a900460ff1660ff1614151561100d5761100c81611fe7565b5b5050565b600080600090505b6002805490508110156110e1576006600060028381548110151561103957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846000191660001916815260200190815260200160002060009054906101000a900460ff16156110d45781806001019250505b8080600101915050611019565b50919050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112157600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561114757600080fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156111a057600080fd5b600380548060010182816111b49190612845565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060197f01000000000000000000000000000000000000000000000000000000000000000230878787878760405180887effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140185815260200184805190602001908083835b602083101515611391578051825260208201915060208101905060208303925061136c565b6001836020036101000a0380198251168184511680821785525050505050509050018360028111156113bf57fe5b60ff167f01000000000000000000000000000000000000000000000000000000000000000281526001018281526020019750505050505050506040518091039020905095945050505050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561146557600080fd5b6114748686868660015461125e565b9050600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515156114e857600080fd5b6001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550505050505050565b60046020528060005260406000206000915054906101000a900460ff1681565b600060149054906101000a900460ff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ce57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156115f457600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561164d57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1660028481548110151561167357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156116c157600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060028481548110151561178157fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b60066020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183857600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561185e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6118a9612871565b600380548060200260200160405190810160405280929190818152602001828054801561192b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116118e1575b5050505050905090565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196f57600080fd5b8060ff166001600280549050031015151561198957600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166002848154811015156119af57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119fd57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506002600160028054905003815481101515611a6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600284815481101515611aa757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002805480919060019003611b059190612885565b508060ff16600060149054906101000a900460ff1660ff16141515611b2e57611b2d81611fe7565b5b505050565b600080600060149054906101000a900460ff1660ff16141515611b5557600080fd5b84518460ff1611151515611b6857600080fd5b60018460ff1610151515611b7b57600080fd5b600090505b8451811015611cb25760008582815181101515611b9957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611bc657600080fd5b600460008683815181101515611bd857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c3657600080fd5b6001600460008784815181101515611c4a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b80565b8460029080519060200190611cc89291906128b1565b5083600060146101000a81548160ff021916908360ff16021790555060008373ffffffffffffffffffffffffffffffffffffffff16141515611d1a57611d0e8383612698565b1515611d1957600080fd5b5b5050505050565b611d2961293b565b6002805480602002602001604051908101604052809291908181526020018280548015611dab57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611d61575b5050505050905090565b6040805190810160405280600b81526020017f476e6f736973205361666500000000000000000000000000000000000000000081525081565b60015481565b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e4c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663cde09ca933878787876000604051602001526040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001836002811115611f1f57fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b83811015611f5f578082015181840152602081019050611f44565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b1515611fae57600080fd5b6102c65a03f11515611fbf57600080fd5b505050604051805190501515611fd457600080fd5b611fe0858585856126b0565b5050505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561202157600080fd5b6002805490508160ff161115151561203857600080fd5b60018160ff161015151561204b57600080fd5b80600060146101000a81548160ff021916908360ff16021790555050565b61207161293b565b60008061207d84611011565b91508160405180591061208d5750595b9080825280602002602001820160405250925060009150600090505b6002805490508110156121f657600660006002838154811015156120c957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000856000191660001916815260200190815260200160002060009054906101000a900460ff16156121e95760028181548110151561216a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156121a457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081806001019250505b80806001019150506120a9565b5050919050565b60038181548110151561220c57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060006122538e8e8e8e60015461125e565b94506000935060009050600091505b600060149054906101000a900460ff1660ff16821015612518578086511180156122a25750858181518110151561229557fe5b9060200190602002015182145b156123a15786818151811015156122b557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612371575060066000888381518110151561230557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000866000191660001916815260200190815260200160002060009054906101000a900460ff165b151561237c57600080fd5b868181518110151561238a57fe5b906020019060200201519250600181019050612476565b6001858b8385038151811015156123b457fe5b906020019060200201518b8486038151811015156123ce57fe5b906020019060200201518b8587038151811015156123e857fe5b90602001906020020151604051600081526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001945050505050602060405160208103908084039060008661646e5a03f1151561246a57600080fd5b50506020604051035192505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156124ce57600080fd5b8373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1611151561250857600080fd5b8293508180600101925050612262565b60008751111561261357600091505b865182101561261257868281518110151561253e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561260557600060066000898581518110151561259057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000876000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8180600101925050612527565b5b6001806000828254019250508190555061262f8e8e8e8e6126b0565b5050505050505050505050505050565b60056020528060005260406000206000915054906101000a900460ff1681565b6040805190810160405280600581526020017f302e302e3100000000000000000000000000000000000000000000000000000081525081565b600080600083516020850186600019f4905092915050565b60008060028111156126be57fe5b8260028111156126ca57fe5b14156126eb576126db8585856127c1565b15156126e657600080fd5b6127ba565b600160028111156126f857fe5b82600281111561270457fe5b1415612724576127148584612698565b151561271f57600080fd5b6127b9565b61272d836127db565b905060008173ffffffffffffffffffffffffffffffffffffffff161415151561275557600080fd5b7f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51181604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5b5050505050565b60008060008351602085018688600019f190509392505050565b60008151602083016000f09050919050565b81548183558181151161281457818360005260206000209182019101612813919061294f565b5b505050565b8154818355818115116128405781836000526020600020918201910161283f919061294f565b5b505050565b81548183558181151161286c5781836000526020600020918201910161286b919061294f565b5b505050565b602060405190810160405280600081525090565b8154818355818115116128ac578183600052602060002091820191016128ab919061294f565b5b505050565b82805482825590600052602060002090810192821561292a579160200282015b828111156129295782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906128d1565b5b5090506129379190612974565b5090565b602060405190810160405280600081525090565b61297191905b8082111561296d576000816000905550600101612955565b5090565b90565b6129b491905b808211156129b057600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010161297a565b5090565b905600a165627a7a72305820d9fa9b3e6169e8f89baad932031423ed3c1c574105ff91b299c1641d6eb0a8fc0029","sourceMap":"218:14623:1:-;;;1567:153;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1677:36;1683:7;1692:10;1704:2;1708:4;1677:5;;;;;:36;;;:::i;:::-;1567:153;;;;218:14623;;2039:1141;2550:9;2289:1;2276:9;;;;;;;;;;;:14;;;2268:23;;;;;;;;2397:7;:14;2383:10;:28;;;;2375:37;;;;;;;;2496:1;2482:10;:15;;;;2474:24;;;;;;;;2562:1;2550:13;;2545:266;2569:7;:14;2565:1;:18;2545:266;;;2671:1;2657:7;2665:1;2657:10;;;;;;;;;;;;;;;;;;:15;;;;2649:24;;;;;;;;2740:7;:19;2748:7;2756:1;2748:10;;;;;;;;;;;;;;;;;;2740:19;;;;;;;;;;;;;;;;;;;;;;;;;2739:20;2731:29;;;;;;;;2796:4;2774:7;:19;2782:7;2790:1;2782:10;;;;;;;;;;;;;;;;;;2774:19;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2585:3;;;;;;;2545:266;;;2829:7;2820:6;:16;;;;;;;;;;;;:::i;:::-;;2858:10;2846:9;;:22;;;;;;;;;;;;;;;;;;3048:1;3042:2;:7;;;;3038:135;;;3143:29;3163:2;3167:4;3143:19;;;;;:29;;;:::i;:::-;3135:38;;;;;;;;3038:135;2039:1141;;;;;:::o;12356:225::-;12443:12;12563:1;12560;12553:4;12547:5;12540:4;12534;12530:3;12526:2;12522:1;12518:3;12505:12;12494:71;;12480:95;;;;:::o;218:14623::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;","deployedSourceMap":"218:14623:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;472:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7264:384;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3786:431;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13870:290;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6656:336;;;;;;;;;;;;;;;;;;;;;;;;;;;;13076:249;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7979:506;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;607:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;418:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5468:502;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;892:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3326:220;;;;;;;;;;;;;;;;;;;;;;;;;;;;13603:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;4548:599:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2039:1141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13407:111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;295:43:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;446:20:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11178:464;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6159:320;;;;;;;;;;;;;;;;;;;;;;;;;;;;14301:538;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;501:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9222:1531;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;729:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;344:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;472:23:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7264:384::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;7490:9;7460:39;;:10;7471:14;7460:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;:39;;;7452:48;;;;;;;;7535:5;7510:11;:22;7522:9;7510:22;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;;;;;;;7579:10;7610:1;7590:10;:17;;;;:21;7579:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;7550:10;7561:14;7550:26;;;;;;;;;;;;;;;;;;;:62;;;;;;;;;;;;;;;;;;7622:10;:19;;;;;;;;;;;;:::i;:::-;;7264:384;;:::o;3786:431::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;3943:1;3934:5;:10;;;;3926:19;;;;;;;;4004:7;:14;4012:5;4004:14;;;;;;;;;;;;;;;;;;;;;;;;;4003:15;3995:24;;;;;;;;4029:6;:18;;;;;;;;;;;:::i;:::-;;;;;;;;;;4041:5;4029:18;;;;;;;;;;;;;;;;;;;;;;;4074:4;4057:7;:14;4065:5;4057:14;;;;;;;;;;;;;;;;:21;;;;;;;;;;;;;;;;;;4159:10;4146:23;;:9;;;;;;;;;;;:23;;;;4142:68;;;4183:27;4199:10;4183:15;:27::i;:::-;4142:68;3786:431;;:::o;13870:290::-;13970:22;14013:6;14022:1;14013:10;;14008:146;14029:6;:13;;;;14025:1;:17;14008:146;;;14067:11;:22;14079:6;14086:1;14079:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;14067:22;;;;;;;;;;;;;;;:39;14090:15;14067:39;;;;;;;;;;;;;;;;;;;;;;;;;;;14063:80;;;14124:19;;;;;;;14063:80;14044:3;;;;;;;14008:146;;;13870:290;;;;:::o;6656:336::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;6822:1;6808:9;6800:23;;;;6792:32;;;;;;;;6887:11;:22;6899:9;6887:22;;;;;;;;;;;;;;;;;;;;;;;;;6886:23;6878:32;;;;;;;;6920:10;:26;;;;;;;;;;;:::i;:::-;;;;;;;;;;6936:9;6920:26;;;;;;;;;;;;;;;;;;;;;;;6981:4;6956:11;:22;6968:9;6956:22;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;6656:336;:::o;13076:249::-;13225:7;13270:4;13265:10;;13277:4;13283:2;13287:5;13294:4;13300:9;13311:6;13255:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13248:70:1;;13076:249;;;;;;;:::o;7979:506::-;8220:23;8190:7;:19;8198:10;8190:19;;;;;;;;;;;;;;;;;;;;;;;;;8182:28;;;;;;;;8246:53;8265:2;8269:5;8276:4;8282:9;8293:5;;8246:18;:53::i;:::-;8220:79;;8380:11;:23;8392:10;8380:23;;;;;;;;;;;;;;;:40;8404:15;8380:40;;;;;;;;;;;;;;;;;;;;;;;;;;;8379:41;8371:50;;;;;;;;8474:4;8431:11;:23;8443:10;8431:23;;;;;;;;;;;;;;;:40;8455:15;8431:40;;;;;;;;;;;;;;;;;;:47;;;;;;;;;;;;;;;;;;7979:506;;;;;;:::o;607:40::-;;;;;;;;;;;;;;;;;;;;;;:::o;418:22::-;;;;;;;;;;;;;:::o;5468:502::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;5658:1;5646:8;:13;;;;5638:22;;;;;;;;5719:7;:17;5727:8;5719:17;;;;;;;;;;;;;;;;;;;;;;;;;5718:18;5710:27;;;;;;;;5842:8;5817:33;;:6;5824:13;5817:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;:33;;;5809:42;;;;;;;;5881:5;5861:7;:17;5869:8;5861:17;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;5917:4;5896:7;:17;5904:8;5896:17;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;5955:8;5931:6;5938:13;5931:21;;;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;;;;;;;5468:502;;;:::o;892:65::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3326:220::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;3503:1;3487:11;3479:25;;;;3471:34;;;;;;;;3528:11;3515:10;;:24;;;;;;;;;;;;;;;;;;3326:220;:::o;13603:121::-;13673:11;;:::i;:::-;13707:10;13700:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13603:121;:::o;4548:599::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;4776:10;4755:31;;4771:1;4755:6;:13;;;;:17;:31;;4747:40;;;;;;;;4889:5;4867:27;;:6;4874:10;4867:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;:27;;;4859:36;;;;;;;;4922:5;4905:7;:14;4913:5;4905:14;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;;;;;;;4958:6;4981:1;4965:6;:13;;;;:17;4958:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;4937:6;4944:10;4937:18;;;;;;;;;;;;;;;;;;;:46;;;;;;;;;;;;;;;;;;4993:6;:15;;;;;;;;;;;;:::i;:::-;;5089:10;5076:23;;:9;;;;;;;;;;;:23;;;;5072:68;;;5113:27;5129:10;5113:15;:27::i;:::-;5072:68;4548:599;;;:::o;2039:1141::-;2550:9;2289:1;2276:9;;;;;;;;;;;:14;;;2268:23;;;;;;;;2397:7;:14;2383:10;:28;;;;2375:37;;;;;;;;2496:1;2482:10;:15;;;;2474:24;;;;;;;;2562:1;2550:13;;2545:266;2569:7;:14;2565:1;:18;2545:266;;;2671:1;2657:7;2665:1;2657:10;;;;;;;;;;;;;;;;;;:15;;;;2649:24;;;;;;;;2740:7;:19;2748:7;2756:1;2748:10;;;;;;;;;;;;;;;;;;2740:19;;;;;;;;;;;;;;;;;;;;;;;;;2739:20;2731:29;;;;;;;;2796:4;2774:7;:19;2782:7;2790:1;2782:10;;;;;;;;;;;;;;;;;;2774:19;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2585:3;;;;;;;2545:266;;;2829:7;2820:6;:16;;;;;;;;;;;;:::i;:::-;;2858:10;2846:9;;:22;;;;;;;;;;;;;;;;;;3048:1;3042:2;:7;;;;3038:135;;;3143:29;3163:2;3167:4;3143:19;:29::i;:::-;3135:38;;;;;;;;3038:135;2039:1141;;;;;:::o;13407:111::-;13473:9;;:::i;:::-;13505:6;13498:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13407:111;:::o;295:43::-;;;;;;;;;;;;;;;;;;;;:::o;446:20::-;;;;:::o;11178:464::-;11374:11;:22;11386:9;11374:22;;;;;;;;;;;;;;;;;;;;;;;;;11366:31;;;;;;;;11464:9;:22;;;11487:10;11499:2;11503:5;11510:4;11516:9;11464:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11456:71:1;;;;;;;;11600:35;11608:2;11612:5;11619:4;11625:9;11600:7;:35::i;:::-;11178:464;;;;;:::o;6159:320::-;1105:4;1083:27;;:10;:27;;;1075:36;;;;;;;;6340:6;:13;;;;6326:10;:27;;;;6318:36;;;;;;;;6438:1;6424:10;:15;;;;6416:24;;;;;;;;6462:10;6450:9;;:22;;;;;;;;;;;;;;;;;;6159:320;:::o;14301:538::-;14400:26;;:::i;:::-;14442:22;14611:6;14467:37;14488:15;14467:20;:37::i;:::-;14442:62;;14547:17;14533:32;;;;;;;;;;;;;;;;;;;;;;;;14514:51;;14595:1;14575:21;;14620:1;14611:10;;14606:227;14627:6;:13;;;;14623:1;:17;14606:227;;;14665:11;:22;14677:6;14684:1;14677:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;14665:22;;;;;;;;;;;;;;;:39;14688:15;14665:39;;;;;;;;;;;;;;;;;;;;;;;;;;;14661:162;;;14762:6;14769:1;14762:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;14724:16;14741:17;14724:35;;;;;;;;;;;;;;;;;:47;;;;;;;;;;;14789:19;;;;;;;14661:162;14642:3;;;;;;;14606:227;;;14301:538;;;;;:::o;501:29::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;9222:1531::-;9414:23;9555:17;9595:20;9625:9;9644;9440:53;9459:2;9463:5;9470:4;9476:9;9487:5;;9440:18;:53::i;:::-;9414:79;;9583:1;9555:30;;9656:1;9644:13;;9718:1;9714:5;;9709:651;9725:9;;;;;;;;;;;9721:13;;:1;:13;9709:651;;;9860:1;9843:7;:14;:18;:37;;;;;9870:7;9878:1;9870:10;;;;;;;;;;;;;;;;;;9865:1;:15;9843:37;9839:381;;;9922:7;9930:1;9922:10;;;;;;;;;;;;;;;;;;9908:24;;:10;:24;;;:68;;;;9936:11;:23;9948:7;9956:1;9948:10;;;;;;;;;;;;;;;;;;9936:23;;;;;;;;;;;;;;;:40;9960:15;9936:40;;;;;;;;;;;;;;;;;;;;;;;;;;;9908:68;9900:77;;;;;;;;10010:7;10018:1;10010:10;;;;;;;;;;;;;;;;;;9995:25;;10043:1;10038:6;;;;9839:381;;;10170:50;10180:15;10197:1;10201;10199;:3;10197:6;;;;;;;;;;;;;;;;;;10205:1;10209;10207;:3;10205:6;;;;;;;;;;;;;;;;;;10213:1;10217;10215;:3;10213:6;;;;;;;;;;;;;;;;;;10170:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10155:65;;9839:381;10242:7;:21;10250:12;10242:21;;;;;;;;;;;;;;;;;;;;;;;;;10234:30;;;;;;;;10301:9;10286:24;;:12;:24;;;10278:33;;;;;;;;10337:12;10325:24;;9736:3;;;;;;;9709:651;;;10436:1;10419:7;:14;:18;10415:216;;;10462:1;10458:5;;10453:168;10469:7;:14;10465:1;:18;10453:168;;;10526:7;10534:1;10526:10;;;;;;;;;;;;;;;;;;10512:24;;:10;:24;;;;10508:98;;;10601:5;10558:11;:23;10570:7;10578:1;10570:10;;;;;;;;;;;;;;;;;;10558:23;;;;;;;;;;;;;;;:40;10582:15;10558:40;;;;;;;;;;;;;;;;;;:48;;;;;;;;;;;;;;;;;;10508:98;10485:3;;;;;;;10453:168;;;10415:216;10700:1;10691:5;;:10;;;;;;;;;;;10711:35;10719:2;10723:5;10730:4;10736:9;10711:7;:35::i;:::-;9222:1531;;;;;;;;;;;;;;:::o;729:44::-;;;;;;;;;;;;;;;;;;;;;;:::o;344:40::-;;;;;;;;;;;;;;;;;;;;:::o;12356:225::-;12443:12;12563:1;12560;12553:4;12547:5;12540:4;12534;12530:3;12526:2;12522:1;12518:3;12505:12;12494:71;;12480:95;;;;:::o;11648:465::-;11973:19;11773:14;11760:27;;;;;;;;:9;:27;;;;;;;;;11756:351;;;11809:28;11821:2;11825:5;11832:4;11809:11;:28::i;:::-;11801:37;;;;;;;;11756:351;;;11870:22;11857:35;;;;;;;;:9;:35;;;;;;;;;11853:254;;;11914:29;11934:2;11938:4;11914:19;:29::i;:::-;11906:38;;;;;;;;11853:254;;;11995:19;12009:4;11995:13;:19::i;:::-;11973:41;;12051:1;12036:11;:16;;;;12028:25;;;;;;;;12067:29;12084:11;12067:29;;;;;;;;;;;;;;;;;;;;;;11853:254;11756:351;11648:465;;;;;:::o;12119:231::-;12213:12;12332:1;12329;12322:4;12316:5;12309:4;12303;12299:3;12292:5;12288:2;12284:1;12280:3;12275:4;12264:70;;12250:94;;;;;:::o;12587:197::-;12656:19;12762:4;12756:5;12749:4;12743;12739:3;12736:1;12729:6;12714:54;;12700:78;;;:::o;218:14623::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o","source":"pragma solidity 0.4.19;\nimport \"./Extension.sol\";\n\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \ncontract GnosisSafe {\n\n event ContractCreation(address newContract);\n\n string public constant NAME = \"Gnosis Safe\";\n string public constant VERSION = \"0.0.1\";\n\n GnosisSafe masterCopy;\n uint8 public threshold;\n uint256 public nonce;\n address[] public owners;\n Extension[] public extensions;\n\n // isOwner mapping allows to check if an address is a Safe owner.\n mapping (address => bool) public isOwner;\n // isExtension mapping allows to check if an extension was whitelisted.\n mapping (address => bool) public isExtension;\n // isConfirmed mapping allows to check if a transaction was confirmed by an owner via a confirm transaction.\n mapping (address => mapping (bytes32 => bool)) public isConfirmed;\n\n enum Operation {\n Call,\n DelegateCall,\n Create\n }\n\n modifier onlyWallet() {\n require(msg.sender == address(this));\n _;\n }\n\n /// @dev Fallback function accepts Ether transactions.\n function ()\n external\n payable\n {\n\n }\n\n /// @dev Constructor function triggers setup function.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n function GnosisSafe(address[] _owners, uint8 _threshold, address to, bytes data)\n public\n {\n setup(_owners, _threshold, to, data);\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n function setup(address[] _owners, uint8 _threshold, address to, bytes data)\n public\n {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0);\n // Validate that threshold is smaller than numbr of added owners.\n require(_threshold <= _owners.length);\n // There has to be at least one Safe owner.\n require(_threshold >= 1);\n // Initializing Safe owners.\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n require(_owners[i] != 0);\n // No duplicate owners allowed.\n require(!isOwner[_owners[i]]);\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n threshold = _threshold;\n // If a to address is set, an additional delegate call is executed.\n // This call allows further contract setup steps, like adding an extension.\n if (to != 0)\n // Setup has to complete successfully or transaction fails.\n require(executeDelegateCall(to, data));\n }\n\n /// @dev Allows to upgrade the contract. This can only be done via a Safe transaction.\n /// @param _masterCopy New contract address.\n function changeMasterCopy(GnosisSafe _masterCopy)\n public\n onlyWallet\n {\n // Master copy address cannot be null.\n require(address(_masterCopy) != 0);\n masterCopy = _masterCopy;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwner(address owner, uint8 _threshold)\n public\n onlyWallet\n {\n // Owner address cannot be null.\n require(owner != 0);\n // No duplicate owners allowed.\n require(!isOwner[owner]);\n owners.push(owner);\n isOwner[owner] = true;\n // Change threshold if threshold was changed.\n if (threshold != _threshold)\n changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @param ownerIndex Array index position of owner address to be removed.\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(uint256 ownerIndex, address owner, uint8 _threshold)\n public\n onlyWallet\n {\n // Only allow to remove an owner, if threshold can still be reached.\n require(owners.length - 1 >= _threshold);\n // Validate owner address corresponds to owner index.\n require(owners[ownerIndex] == owner);\n isOwner[owner] = false;\n owners[ownerIndex] = owners[owners.length - 1];\n owners.length--;\n // Change threshold if threshold was changed.\n if (threshold != _threshold)\n changeThreshold(_threshold);\n }\n\n /// @dev Allows to replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @param oldOwnerIndex Array index position of owner address to be replaced.\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function replaceOwner(uint256 oldOwnerIndex, address oldOwner, address newOwner)\n public\n onlyWallet\n {\n // Owner address cannot be null.\n require(newOwner != 0);\n // No duplicate owners allowed.\n require(!isOwner[newOwner]);\n // Validate owner address corresponds to owner index.\n require(owners[oldOwnerIndex] == oldOwner);\n isOwner[oldOwner] = false;\n isOwner[newOwner] = true;\n owners[oldOwnerIndex] = newOwner;\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @param _threshold New threshold.\n function changeThreshold(uint8 _threshold)\n public\n onlyWallet\n {\n // Validate that threshold is smaller than numbr of owners.\n require(_threshold <= owners.length);\n // There has to be at least one Safe owner.\n require(_threshold >= 1);\n threshold = _threshold;\n }\n\n /// @dev Allows to add an extension to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @param extension Extension to be whitelisted.\n function addExtension(Extension extension)\n public\n onlyWallet\n {\n // Extension address cannot be null.\n require(address(extension) != 0);\n // Extension cannot be added twice.\n require(!isExtension[extension]);\n extensions.push(extension);\n isExtension[extension] = true;\n }\n\n /// @dev Allows to remove an extension from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @param extensionIndex Array index position of extension to be removed from whitelist.\n /// @param extension Extension to be removed.\n function removeExtension(uint256 extensionIndex, Extension extension)\n public\n onlyWallet\n {\n // Validate extension address corresponds to extension index.\n require(extensions[extensionIndex] == extension);\n isExtension[extension] = false;\n extensions[extensionIndex] = extensions[extensions.length - 1];\n extensions.length--;\n }\n\n /// @dev Allows to confirm a Safe transaction with a regular transaction.\n /// This can only be done from an owner address.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param _nonce Transaction nonce.\n function confirmTransaction(address to, uint256 value, bytes data, Operation operation, uint256 _nonce)\n public\n {\n // Only Safe owners are allowed to confirm Safe transactions.\n require(isOwner[msg.sender]);\n bytes32 transactionHash = getTransactionHash(to, value, data, operation, nonce);\n // It is only possible to confirm a transaction once.\n require(!isConfirmed[msg.sender][transactionHash]);\n isConfirmed[msg.sender][transactionHash] = true;\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param v Array of signature V values sorted by owner addresses.\n /// @param r Array of signature R values sorted by owner addresses.\n /// @param s Array of signature S values sorted by owner addresses.\n /// @param _owners List of Safe owners confirming via regular transactions sorted by owner addresses.\n /// @param indices List of indeces of Safe owners confirming via regular transactions.\n function executeTransaction(address to, uint256 value, bytes data, Operation operation, uint8[] v, bytes32[] r, bytes32[] s, address[] _owners, uint256[] indices)\n public\n {\n bytes32 transactionHash = getTransactionHash(to, value, data, operation, nonce);\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint256 i;\n uint256 j = 0;\n // Validate threshold is reached.\n for (i = 0; i < threshold; i++) {\n // Check confirmations done with regular transactions or by msg.sender.\n if (indices.length > j && i == indices[j]) {\n require(msg.sender == _owners[j] || isConfirmed[_owners[j]][transactionHash]);\n currentOwner = _owners[j];\n j += 1;\n }\n // Check confirmations done with signed messages.\n else\n currentOwner = ecrecover(transactionHash, v[i-j], r[i-j], s[i-j]);\n require(isOwner[currentOwner]);\n require(currentOwner > lastOwner);\n lastOwner = currentOwner;\n }\n // Delete storage to receive refunds.\n if (_owners.length > 0) {\n for (i = 0; i < _owners.length; i++) {\n if (msg.sender != _owners[i])\n isConfirmed[_owners[i]][transactionHash] = false;\n }\n }\n // Increase nonce and execute transaction.\n nonce += 1;\n execute(to, value, data, operation);\n }\n\n /// @dev Allows to execute a Safe transaction via an extension without any further confirmations.\n /// @param to Destination address of extension transaction.\n /// @param value Ether value of extension transaction.\n /// @param data Data payload of extension transaction.\n /// @param operation Operation type of extension transaction.\n /// @param extension Extension address of extension transaction.\n function executeExtension(address to, uint256 value, bytes data, Operation operation, Extension extension)\n public\n {\n // Only whitelisted extensions are allowed.\n require(isExtension[extension]);\n // Extension has to confirm transaction.\n require(extension.isExecutable(msg.sender, to, value, data, operation));\n // Exectute transaction without further confirmations.\n execute(to, value, data, operation);\n }\n\n function execute(address to, uint256 value, bytes data, Operation operation)\n internal\n {\n if (operation == Operation.Call)\n require(executeCall(to, value, data));\n else if (operation == Operation.DelegateCall)\n require(executeDelegateCall(to, data));\n else {\n address newContract = executeCreate(data);\n require(newContract != 0);\n ContractCreation(newContract);\n }\n }\n\n function executeCall(address to, uint256 value, bytes data)\n internal\n returns (bool success)\n {\n assembly {\n success := call(not(0), to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n\n function executeDelegateCall(address to, bytes data)\n internal\n returns (bool success)\n {\n assembly {\n success := delegatecall(not(0), to, add(data, 0x20), mload(data), 0, 0)\n }\n }\n\n function executeCreate(bytes data)\n internal\n returns (address newContract)\n {\n assembly {\n newContract := create(0, add(data, 0x20), mload(data))\n }\n }\n\n /// @dev Returns transactions hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(address to, uint256 value, bytes data, Operation operation, uint256 _nonce)\n public\n view\n returns (bytes32)\n {\n return keccak256(byte(0x19), this, to, value, data, operation, _nonce);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners()\n public\n view\n returns (address[])\n {\n return owners;\n }\n\n /// @dev Returns array of extensions.\n /// @return Array of extensions.\n function getExtensions()\n public\n view\n returns (Extension[])\n {\n return extensions;\n }\n\n /// @dev Returns a the count of owners that have confirmed the given transaction.\n /// @param transactionHash Safe transaction hash.\n function getConfirmationCount(bytes32 transactionHash)\n public\n view\n returns (uint confirmationCount)\n {\n for (uint i = 0; i < owners.length; i++) {\n if (isConfirmed[owners[i]][transactionHash])\n confirmationCount++;\n }\n }\n\n /// @dev Returns a list of owners that have confirmed the given transaction.\n /// @param transactionHash Safe transaction hash.\n function getConfirmingOwners(bytes32 transactionHash)\n public\n view\n returns (address[] confirmingOwners)\n {\n uint confirmationCount = getConfirmationCount(transactionHash);\n confirmingOwners = new address[](confirmationCount);\n confirmationCount = 0;\n for (uint i = 0; i < owners.length; i++) {\n if (isConfirmed[owners[i]][transactionHash]) {\n confirmingOwners[confirmationCount] = owners[i];\n confirmationCount++;\n }\n }\n }\n}\n","sourcePath":"/Users/apanizo/git/gnosis/gnosis-team-safe/gnosis-safe-contracts/contracts/GnosisSafe.sol","ast":{"absolutePath":"/Users/apanizo/git/gnosis/gnosis-team-safe/gnosis-safe-contracts/contracts/GnosisSafe.sol","exportedSymbols":{"GnosisSafe":[963]},"id":964,"nodeType":"SourceUnit","nodes":[{"id":20,"literals":["solidity","0.4",".19"],"nodeType":"PragmaDirective","src":"0:23:1"},{"absolutePath":"/Users/apanizo/git/gnosis/gnosis-team-safe/gnosis-safe-contracts/contracts/Extension.sol","file":"./Extension.sol","id":21,"nodeType":"ImportDirective","scope":964,"sourceUnit":19,"src":"24:25:1","symbolAliases":[],"unitAlias":""},{"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":"@title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n @author Stefan George - ","fullyImplemented":true,"id":963,"linearizedBaseContracts":[963],"name":"GnosisSafe","nodeType":"ContractDefinition","nodes":[{"anonymous":false,"id":25,"name":"ContractCreation","nodeType":"EventDefinition","parameters":{"id":24,"nodeType":"ParameterList","parameters":[{"constant":false,"id":23,"indexed":false,"name":"newContract","nodeType":"VariableDeclaration","scope":25,"src":"268:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":22,"name":"address","nodeType":"ElementaryTypeName","src":"268:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"267:21:1"},"src":"245:44:1"},{"constant":true,"id":28,"name":"NAME","nodeType":"VariableDeclaration","scope":963,"src":"295:43:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string memory"},"typeName":{"id":26,"name":"string","nodeType":"ElementaryTypeName","src":"295:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string storage pointer"}},"value":{"argumentTypes":null,"hexValue":"476e6f7369732053616665","id":27,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"325:13:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_72ec6775392f699e8ffd72b7c600556d49bdc746bf22bce93d3ae6019cdaff63","typeString":"literal_string \"Gnosis Safe\""},"value":"Gnosis Safe"},"visibility":"public"},{"constant":true,"id":31,"name":"VERSION","nodeType":"VariableDeclaration","scope":963,"src":"344:40:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string memory"},"typeName":{"id":29,"name":"string","nodeType":"ElementaryTypeName","src":"344:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string storage pointer"}},"value":{"argumentTypes":null,"hexValue":"302e302e31","id":30,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"377:7:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_ae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc199163811885","typeString":"literal_string \"0.0.1\""},"value":"0.0.1"},"visibility":"public"},{"constant":false,"id":33,"name":"masterCopy","nodeType":"VariableDeclaration","scope":963,"src":"391:21:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},"typeName":{"contractScope":null,"id":32,"name":"GnosisSafe","nodeType":"UserDefinedTypeName","referencedDeclaration":963,"src":"391:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"value":null,"visibility":"internal"},{"constant":false,"id":35,"name":"threshold","nodeType":"VariableDeclaration","scope":963,"src":"418:22:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":34,"name":"uint8","nodeType":"ElementaryTypeName","src":"418:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"public"},{"constant":false,"id":37,"name":"nonce","nodeType":"VariableDeclaration","scope":963,"src":"446:20:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint256","nodeType":"ElementaryTypeName","src":"446:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"public"},{"constant":false,"id":40,"name":"owners","nodeType":"VariableDeclaration","scope":963,"src":"472:23:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"},"typeName":{"baseType":{"id":38,"name":"address","nodeType":"ElementaryTypeName","src":"472:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":39,"length":null,"nodeType":"ArrayTypeName","src":"472:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"public"},{"constant":false,"id":43,"name":"extensions","nodeType":"VariableDeclaration","scope":963,"src":"501:29:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"},"typeName":{"baseType":{"contractScope":null,"id":41,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"501:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":42,"length":null,"nodeType":"ArrayTypeName","src":"501:11:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage_ptr","typeString":"contract Extension[] storage pointer"}},"value":null,"visibility":"public"},{"constant":false,"id":47,"name":"isOwner","nodeType":"VariableDeclaration","scope":963,"src":"607:40:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"typeName":{"id":46,"keyType":{"id":44,"name":"address","nodeType":"ElementaryTypeName","src":"616:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"607:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"valueType":{"id":45,"name":"bool","nodeType":"ElementaryTypeName","src":"627:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"value":null,"visibility":"public"},{"constant":false,"id":51,"name":"isExtension","nodeType":"VariableDeclaration","scope":963,"src":"729:44:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"typeName":{"id":50,"keyType":{"id":48,"name":"address","nodeType":"ElementaryTypeName","src":"738:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"729:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"valueType":{"id":49,"name":"bool","nodeType":"ElementaryTypeName","src":"749:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"value":null,"visibility":"public"},{"constant":false,"id":57,"name":"isConfirmed","nodeType":"VariableDeclaration","scope":963,"src":"892:65:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"},"typeName":{"id":56,"keyType":{"id":52,"name":"address","nodeType":"ElementaryTypeName","src":"901:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"892:46:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"},"valueType":{"id":55,"keyType":{"id":53,"name":"bytes32","nodeType":"ElementaryTypeName","src":"921:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Mapping","src":"912:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"},"valueType":{"id":54,"name":"bool","nodeType":"ElementaryTypeName","src":"932:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}}},"value":null,"visibility":"public"},{"canonicalName":"GnosisSafe.Operation","id":61,"members":[{"id":58,"name":"Call","nodeType":"EnumValue","src":"989:4:1"},{"id":59,"name":"DelegateCall","nodeType":"EnumValue","src":"1003:12:1"},{"id":60,"name":"Create","nodeType":"EnumValue","src":"1025:6:1"}],"name":"Operation","nodeType":"EnumDefinition","src":"964:73:1"},{"body":{"id":73,"nodeType":"Block","src":"1065:64:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":69,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":64,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"1083:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":65,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1083:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":67,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"1105:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}],"id":66,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1097:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":68,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1097:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"1083:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":63,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"1075:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":70,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1075:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":71,"nodeType":"ExpressionStatement","src":"1075:36:1"},{"id":72,"nodeType":"PlaceholderStatement","src":"1121:1:1"}]},"id":74,"name":"onlyWallet","nodeType":"ModifierDefinition","parameters":{"id":62,"nodeType":"ParameterList","parameters":[],"src":"1062:2:1"},"src":"1043:86:1","visibility":"internal"},{"body":{"id":77,"nodeType":"Block","src":"1243:8:1","statements":[]},"id":78,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[],"src":"1203:2:1"},"payable":true,"returnParameters":{"id":76,"nodeType":"ParameterList","parameters":[],"src":"1243:0:1"},"scope":963,"src":"1194:57:1","stateMutability":"payable","superFunction":null,"visibility":"external"},{"body":{"id":97,"nodeType":"Block","src":"1667:53:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":91,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":81,"src":"1683:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},{"argumentTypes":null,"id":92,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":83,"src":"1692:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"argumentTypes":null,"id":93,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":85,"src":"1704:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":94,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":87,"src":"1708:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":90,"name":"setup","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":187,"src":"1677:5:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint8_$_t_address_$_t_bytes_memory_ptr_$returns$__$","typeString":"function (address[] memory,uint8,address,bytes memory)"}},"id":95,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1677:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":96,"nodeType":"ExpressionStatement","src":"1677:36:1"}]},"id":98,"implemented":true,"isConstructor":true,"isDeclaredConst":false,"modifiers":[],"name":"GnosisSafe","nodeType":"FunctionDefinition","parameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":81,"name":"_owners","nodeType":"VariableDeclaration","scope":98,"src":"1587:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":79,"name":"address","nodeType":"ElementaryTypeName","src":"1587:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":80,"length":null,"nodeType":"ArrayTypeName","src":"1587:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":83,"name":"_threshold","nodeType":"VariableDeclaration","scope":98,"src":"1606:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":82,"name":"uint8","nodeType":"ElementaryTypeName","src":"1606:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"},{"constant":false,"id":85,"name":"to","nodeType":"VariableDeclaration","scope":98,"src":"1624:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":84,"name":"address","nodeType":"ElementaryTypeName","src":"1624:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":87,"name":"data","nodeType":"VariableDeclaration","scope":98,"src":"1636:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":86,"name":"bytes","nodeType":"ElementaryTypeName","src":"1636:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"1586:61:1"},"payable":false,"returnParameters":{"id":89,"nodeType":"ParameterList","parameters":[],"src":"1667:0:1"},"scope":963,"src":"1567:153:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":186,"nodeType":"Block","src":"2134:1046:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":113,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":111,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"2276:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"hexValue":"30","id":112,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2289:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"2276:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":110,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2268:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":114,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2268:23:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":115,"nodeType":"ExpressionStatement","src":"2268:23:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":120,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":117,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2383:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":118,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2397:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":119,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2397:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2383:28:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":116,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2375:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":121,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2375:37:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":122,"nodeType":"ExpressionStatement","src":"2375:37:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":126,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":124,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2482:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"hexValue":"31","id":125,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2496:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"2482:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":123,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2474:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":127,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2474:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":128,"nodeType":"ExpressionStatement","src":"2474:24:1"},{"body":{"id":165,"nodeType":"Block","src":"2590:221:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":145,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":141,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2657:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":143,"indexExpression":{"argumentTypes":null,"id":142,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2665:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2657:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":144,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2671:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"2657:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":140,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2649:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":146,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2649:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":147,"nodeType":"ExpressionStatement","src":"2649:24:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":154,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"2739:20:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":149,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"2740:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":153,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":150,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2748:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":152,"indexExpression":{"argumentTypes":null,"id":151,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2756:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2748:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2740:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":148,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2731:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":155,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2731:29:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":156,"nodeType":"ExpressionStatement","src":"2731:29:1"},{"expression":{"argumentTypes":null,"id":163,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":157,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"2774:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":161,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":158,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2782:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":160,"indexExpression":{"argumentTypes":null,"id":159,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2790:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2782:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2774:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":162,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"2796:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"2774:26:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":164,"nodeType":"ExpressionStatement","src":"2774:26:1"}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":136,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":133,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2565:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":134,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2569:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":135,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2569:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2565:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":166,"initializationExpression":{"assignments":[130],"declarations":[{"constant":false,"id":130,"name":"i","nodeType":"VariableDeclaration","scope":187,"src":"2550:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":129,"name":"uint256","nodeType":"ElementaryTypeName","src":"2550:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":132,"initialValue":{"argumentTypes":null,"hexValue":"30","id":131,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2562:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"2550:13:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":138,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"2585:3:1","subExpression":{"argumentTypes":null,"id":137,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2585:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":139,"nodeType":"ExpressionStatement","src":"2585:3:1"},"nodeType":"ForStatement","src":"2545:266:1"},{"expression":{"argumentTypes":null,"id":169,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":167,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"2820:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":168,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2829:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"src":"2820:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":170,"nodeType":"ExpressionStatement","src":"2820:16:1"},{"expression":{"argumentTypes":null,"id":173,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":171,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"2846:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":172,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2858:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"2846:22:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":174,"nodeType":"ExpressionStatement","src":"2846:22:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":177,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":175,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":105,"src":"3042:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":176,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3048:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3042:7:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":185,"nodeType":"IfStatement","src":"3038:135:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":180,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":105,"src":"3163:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":181,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":107,"src":"3167:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":179,"name":"executeDelegateCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":815,"src":"3143:19:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,bytes memory) returns (bool)"}},"id":182,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3143:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":178,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3135:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":183,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3135:38:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":184,"nodeType":"ExpressionStatement","src":"3135:38:1"}}]},"id":187,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"setup","nodeType":"FunctionDefinition","parameters":{"id":108,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"name":"_owners","nodeType":"VariableDeclaration","scope":187,"src":"2054:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":99,"name":"address","nodeType":"ElementaryTypeName","src":"2054:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":100,"length":null,"nodeType":"ArrayTypeName","src":"2054:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":103,"name":"_threshold","nodeType":"VariableDeclaration","scope":187,"src":"2073:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":102,"name":"uint8","nodeType":"ElementaryTypeName","src":"2073:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"},{"constant":false,"id":105,"name":"to","nodeType":"VariableDeclaration","scope":187,"src":"2091:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":104,"name":"address","nodeType":"ElementaryTypeName","src":"2091:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":107,"name":"data","nodeType":"VariableDeclaration","scope":187,"src":"2103:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":106,"name":"bytes","nodeType":"ElementaryTypeName","src":"2103:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"2053:61:1"},"payable":false,"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[],"src":"2134:0:1"},"scope":963,"src":"2039:1141:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":206,"nodeType":"Block","src":"3414:132:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":199,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":196,"name":"_masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":189,"src":"3487:11:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}],"id":195,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"3479:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":197,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3479:20:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":198,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3503:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3479:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":194,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3471:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":200,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3471:34:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":201,"nodeType":"ExpressionStatement","src":"3471:34:1"},{"expression":{"argumentTypes":null,"id":204,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":202,"name":"masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":33,"src":"3515:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":203,"name":"_masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":189,"src":"3528:11:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"src":"3515:24:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"id":205,"nodeType":"ExpressionStatement","src":"3515:24:1"}]},"id":207,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":192,"modifierName":{"argumentTypes":null,"id":191,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"3399:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"3399:10:1"}],"name":"changeMasterCopy","nodeType":"FunctionDefinition","parameters":{"id":190,"nodeType":"ParameterList","parameters":[{"constant":false,"id":189,"name":"_masterCopy","nodeType":"VariableDeclaration","scope":207,"src":"3352:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},"typeName":{"contractScope":null,"id":188,"name":"GnosisSafe","nodeType":"UserDefinedTypeName","referencedDeclaration":963,"src":"3352:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"value":null,"visibility":"internal"}],"src":"3351:24:1"},"payable":false,"returnParameters":{"id":193,"nodeType":"ParameterList","parameters":[],"src":"3414:0:1"},"scope":963,"src":"3326:220:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":249,"nodeType":"Block","src":"3875:342:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":219,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":217,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"3934:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":218,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3943:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3934:10:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":216,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3926:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":220,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3926:19:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":221,"nodeType":"ExpressionStatement","src":"3926:19:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":226,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"4003:15:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":223,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4004:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":225,"indexExpression":{"argumentTypes":null,"id":224,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4012:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4004:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":222,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3995:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":227,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3995:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":228,"nodeType":"ExpressionStatement","src":"3995:24:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":232,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4041:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"expression":{"argumentTypes":null,"id":229,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4029:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":231,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"push","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4029:11:1","typeDescriptions":{"typeIdentifier":"t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$","typeString":"function (address) returns (uint256)"}},"id":233,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4029:18:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":234,"nodeType":"ExpressionStatement","src":"4029:18:1"},{"expression":{"argumentTypes":null,"id":239,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":235,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4057:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":237,"indexExpression":{"argumentTypes":null,"id":236,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4065:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4057:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":238,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"4074:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"4057:21:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":240,"nodeType":"ExpressionStatement","src":"4057:21:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":243,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":241,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"4146:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"id":242,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":211,"src":"4159:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"4146:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":248,"nodeType":"IfStatement","src":"4142:68:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":245,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":211,"src":"4199:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":244,"name":"changeThreshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":385,"src":"4183:15:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_uint8_$returns$__$","typeString":"function (uint8)"}},"id":246,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4183:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":247,"nodeType":"ExpressionStatement","src":"4183:27:1"}}]},"id":250,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":214,"modifierName":{"argumentTypes":null,"id":213,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"3860:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"3860:10:1"}],"name":"addOwner","nodeType":"FunctionDefinition","parameters":{"id":212,"nodeType":"ParameterList","parameters":[{"constant":false,"id":209,"name":"owner","nodeType":"VariableDeclaration","scope":250,"src":"3804:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":208,"name":"address","nodeType":"ElementaryTypeName","src":"3804:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":211,"name":"_threshold","nodeType":"VariableDeclaration","scope":250,"src":"3819:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":210,"name":"uint8","nodeType":"ElementaryTypeName","src":"3819:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"3803:33:1"},"payable":false,"returnParameters":{"id":215,"nodeType":"ParameterList","parameters":[],"src":"3875:0:1"},"scope":963,"src":"3786:431:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":308,"nodeType":"Block","src":"4660:487:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":267,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":265,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":262,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4755:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":263,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4755:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":264,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4771:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"4755:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"id":266,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"4776:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"4755:31:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":261,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"4747:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":268,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4747:40:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":269,"nodeType":"ExpressionStatement","src":"4747:40:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":275,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":271,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4867:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":273,"indexExpression":{"argumentTypes":null,"id":272,"name":"ownerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":252,"src":"4874:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4867:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":274,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":254,"src":"4889:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4867:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":270,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"4859:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":276,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4859:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":277,"nodeType":"ExpressionStatement","src":"4859:36:1"},{"expression":{"argumentTypes":null,"id":282,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":278,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4905:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":280,"indexExpression":{"argumentTypes":null,"id":279,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":254,"src":"4913:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4905:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":281,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"4922:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"4905:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":283,"nodeType":"ExpressionStatement","src":"4905:22:1"},{"expression":{"argumentTypes":null,"id":293,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":284,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4937:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":286,"indexExpression":{"argumentTypes":null,"id":285,"name":"ownerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":252,"src":"4944:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4937:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":287,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4958:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":292,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":291,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":288,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4965:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":289,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4965:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":290,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4981:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"4965:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4958:25:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4937:46:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":294,"nodeType":"ExpressionStatement","src":"4937:46:1"},{"expression":{"argumentTypes":null,"id":298,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"--","prefix":false,"src":"4993:15:1","subExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":295,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4993:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":297,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4993:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":299,"nodeType":"ExpressionStatement","src":"4993:15:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":302,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":300,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"5076:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"id":301,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"5089:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"5076:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":307,"nodeType":"IfStatement","src":"5072:68:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":304,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"5129:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":303,"name":"changeThreshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":385,"src":"5113:15:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_uint8_$returns$__$","typeString":"function (uint8)"}},"id":305,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5113:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":306,"nodeType":"ExpressionStatement","src":"5113:27:1"}}]},"id":309,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":259,"modifierName":{"argumentTypes":null,"id":258,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"4645:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"4645:10:1"}],"name":"removeOwner","nodeType":"FunctionDefinition","parameters":{"id":257,"nodeType":"ParameterList","parameters":[{"constant":false,"id":252,"name":"ownerIndex","nodeType":"VariableDeclaration","scope":309,"src":"4569:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":251,"name":"uint256","nodeType":"ElementaryTypeName","src":"4569:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":254,"name":"owner","nodeType":"VariableDeclaration","scope":309,"src":"4589:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":253,"name":"address","nodeType":"ElementaryTypeName","src":"4589:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":256,"name":"_threshold","nodeType":"VariableDeclaration","scope":309,"src":"4604:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":255,"name":"uint8","nodeType":"ElementaryTypeName","src":"4604:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"4568:53:1"},"payable":false,"returnParameters":{"id":260,"nodeType":"ParameterList","parameters":[],"src":"4660:0:1"},"scope":963,"src":"4548:599:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":359,"nodeType":"Block","src":"5587:383:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":323,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":321,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5646:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":322,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"5658:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"5646:13:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":320,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5638:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":324,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5638:22:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":325,"nodeType":"ExpressionStatement","src":"5638:22:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":330,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"5718:18:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":327,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5719:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":329,"indexExpression":{"argumentTypes":null,"id":328,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5727:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"5719:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":326,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5710:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":331,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5710:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":332,"nodeType":"ExpressionStatement","src":"5710:27:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":338,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":334,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"5817:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":336,"indexExpression":{"argumentTypes":null,"id":335,"name":"oldOwnerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":311,"src":"5824:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"5817:21:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":337,"name":"oldOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":313,"src":"5842:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"5817:33:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":333,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5809:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":339,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5809:42:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":340,"nodeType":"ExpressionStatement","src":"5809:42:1"},{"expression":{"argumentTypes":null,"id":345,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":341,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5861:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":343,"indexExpression":{"argumentTypes":null,"id":342,"name":"oldOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":313,"src":"5869:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5861:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":344,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"5881:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"5861:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":346,"nodeType":"ExpressionStatement","src":"5861:25:1"},{"expression":{"argumentTypes":null,"id":351,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":347,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5896:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":349,"indexExpression":{"argumentTypes":null,"id":348,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5904:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5896:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":350,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"5917:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"5896:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":352,"nodeType":"ExpressionStatement","src":"5896:25:1"},{"expression":{"argumentTypes":null,"id":357,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":353,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"5931:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":355,"indexExpression":{"argumentTypes":null,"id":354,"name":"oldOwnerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":311,"src":"5938:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5931:21:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":356,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5955:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"5931:32:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":358,"nodeType":"ExpressionStatement","src":"5931:32:1"}]},"id":360,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":318,"modifierName":{"argumentTypes":null,"id":317,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"5572:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"5572:10:1"}],"name":"replaceOwner","nodeType":"FunctionDefinition","parameters":{"id":316,"nodeType":"ParameterList","parameters":[{"constant":false,"id":311,"name":"oldOwnerIndex","nodeType":"VariableDeclaration","scope":360,"src":"5490:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":310,"name":"uint256","nodeType":"ElementaryTypeName","src":"5490:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":313,"name":"oldOwner","nodeType":"VariableDeclaration","scope":360,"src":"5513:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":312,"name":"address","nodeType":"ElementaryTypeName","src":"5513:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":315,"name":"newOwner","nodeType":"VariableDeclaration","scope":360,"src":"5531:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":314,"name":"address","nodeType":"ElementaryTypeName","src":"5531:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"5489:59:1"},"payable":false,"returnParameters":{"id":319,"nodeType":"ParameterList","parameters":[],"src":"5587:0:1"},"scope":963,"src":"5468:502:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":384,"nodeType":"Block","src":"6240:239:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":371,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":368,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6326:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":369,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"6340:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":370,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"6340:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6326:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":367,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6318:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":372,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6318:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":373,"nodeType":"ExpressionStatement","src":"6318:36:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":377,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":375,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6424:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"hexValue":"31","id":376,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6438:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"6424:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":374,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6416:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":378,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6416:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":379,"nodeType":"ExpressionStatement","src":"6416:24:1"},{"expression":{"argumentTypes":null,"id":382,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":380,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"6450:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":381,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6462:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"6450:22:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":383,"nodeType":"ExpressionStatement","src":"6450:22:1"}]},"id":385,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":365,"modifierName":{"argumentTypes":null,"id":364,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"6225:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"6225:10:1"}],"name":"changeThreshold","nodeType":"FunctionDefinition","parameters":{"id":363,"nodeType":"ParameterList","parameters":[{"constant":false,"id":362,"name":"_threshold","nodeType":"VariableDeclaration","scope":385,"src":"6184:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":361,"name":"uint8","nodeType":"ElementaryTypeName","src":"6184:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"6183:18:1"},"payable":false,"returnParameters":{"id":366,"nodeType":"ParameterList","parameters":[],"src":"6240:0:1"},"scope":963,"src":"6159:320:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":419,"nodeType":"Block","src":"6737:255:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":397,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":394,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6808:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}],"id":393,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"6800:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":395,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6800:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":396,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6822:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"6800:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":392,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6792:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":398,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6792:32:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":399,"nodeType":"ExpressionStatement","src":"6792:32:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":404,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"6886:23:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":401,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"6887:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":403,"indexExpression":{"argumentTypes":null,"id":402,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6899:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"6887:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":400,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6878:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":405,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6878:32:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":406,"nodeType":"ExpressionStatement","src":"6878:32:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":410,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6936:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}],"expression":{"argumentTypes":null,"id":407,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"6920:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":409,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"push","nodeType":"MemberAccess","referencedDeclaration":null,"src":"6920:15:1","typeDescriptions":{"typeIdentifier":"t_function_arraypush_nonpayable$_t_contract$_Extension_$18_$returns$_t_uint256_$","typeString":"function (contract Extension) returns (uint256)"}},"id":411,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6920:26:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":412,"nodeType":"ExpressionStatement","src":"6920:26:1"},{"expression":{"argumentTypes":null,"id":417,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":413,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"6956:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":415,"indexExpression":{"argumentTypes":null,"id":414,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6968:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"6956:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":416,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"6981:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"6956:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":418,"nodeType":"ExpressionStatement","src":"6956:29:1"}]},"id":420,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":390,"modifierName":{"argumentTypes":null,"id":389,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"6722:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"6722:10:1"}],"name":"addExtension","nodeType":"FunctionDefinition","parameters":{"id":388,"nodeType":"ParameterList","parameters":[{"constant":false,"id":387,"name":"extension","nodeType":"VariableDeclaration","scope":420,"src":"6678:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":386,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"6678:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"6677:21:1"},"payable":false,"returnParameters":{"id":391,"nodeType":"ParameterList","parameters":[],"src":"6737:0:1"},"scope":963,"src":"6656:336:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":459,"nodeType":"Block","src":"7372:276:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"id":434,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":430,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7460:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":432,"indexExpression":{"argumentTypes":null,"id":431,"name":"extensionIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":422,"src":"7471:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7460:26:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":433,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":424,"src":"7490:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"src":"7460:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":429,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"7452:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":435,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7452:48:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":436,"nodeType":"ExpressionStatement","src":"7452:48:1"},{"expression":{"argumentTypes":null,"id":441,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":437,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"7510:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":439,"indexExpression":{"argumentTypes":null,"id":438,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":424,"src":"7522:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7510:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":440,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"7535:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"7510:30:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":442,"nodeType":"ExpressionStatement","src":"7510:30:1"},{"expression":{"argumentTypes":null,"id":452,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":443,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7550:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":445,"indexExpression":{"argumentTypes":null,"id":444,"name":"extensionIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":422,"src":"7561:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7550:26:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":446,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7579:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":451,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":450,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":447,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7590:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":448,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"7590:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":449,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"7610:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"7590:21:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7579:33:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"src":"7550:62:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":453,"nodeType":"ExpressionStatement","src":"7550:62:1"},{"expression":{"argumentTypes":null,"id":457,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"--","prefix":false,"src":"7622:19:1","subExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":454,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7622:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":456,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"7622:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":458,"nodeType":"ExpressionStatement","src":"7622:19:1"}]},"id":460,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":427,"modifierName":{"argumentTypes":null,"id":426,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"7357:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"7357:10:1"}],"name":"removeExtension","nodeType":"FunctionDefinition","parameters":{"id":425,"nodeType":"ParameterList","parameters":[{"constant":false,"id":422,"name":"extensionIndex","nodeType":"VariableDeclaration","scope":460,"src":"7289:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":421,"name":"uint256","nodeType":"ElementaryTypeName","src":"7289:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":424,"name":"extension","nodeType":"VariableDeclaration","scope":460,"src":"7313:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":423,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"7313:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"7288:45:1"},"payable":false,"returnParameters":{"id":428,"nodeType":"ParameterList","parameters":[],"src":"7372:0:1"},"scope":963,"src":"7264:384:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":509,"nodeType":"Block","src":"8102:383:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":474,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"8190:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":477,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":475,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8198:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":476,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8198:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8190:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":473,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"8182:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":478,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8182:28:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":479,"nodeType":"ExpressionStatement","src":"8182:28:1"},{"assignments":[481],"declarations":[{"constant":false,"id":481,"name":"transactionHash","nodeType":"VariableDeclaration","scope":510,"src":"8220:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":480,"name":"bytes32","nodeType":"ElementaryTypeName","src":"8220:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"id":489,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":483,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":462,"src":"8265:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":484,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":464,"src":"8269:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":485,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":466,"src":"8276:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":486,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":468,"src":"8282:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":487,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"8293:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":482,"name":"getTransactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":852,"src":"8246:18:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation,uint256) view returns (bytes32)"}},"id":488,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8246:53:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"8220:79:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":497,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"8379:41:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":491,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"8380:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":494,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":492,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8392:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":493,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8392:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8380:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":496,"indexExpression":{"argumentTypes":null,"id":495,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":481,"src":"8404:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8380:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":490,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"8371:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":498,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8371:50:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":499,"nodeType":"ExpressionStatement","src":"8371:50:1"},{"expression":{"argumentTypes":null,"id":507,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":500,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"8431:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":504,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":501,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8443:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":502,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8443:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8431:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":505,"indexExpression":{"argumentTypes":null,"id":503,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":481,"src":"8455:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"8431:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":506,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"8474:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"8431:47:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":508,"nodeType":"ExpressionStatement","src":"8431:47:1"}]},"id":510,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"confirmTransaction","nodeType":"FunctionDefinition","parameters":{"id":471,"nodeType":"ParameterList","parameters":[{"constant":false,"id":462,"name":"to","nodeType":"VariableDeclaration","scope":510,"src":"8007:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":461,"name":"address","nodeType":"ElementaryTypeName","src":"8007:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":464,"name":"value","nodeType":"VariableDeclaration","scope":510,"src":"8019:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":463,"name":"uint256","nodeType":"ElementaryTypeName","src":"8019:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":466,"name":"data","nodeType":"VariableDeclaration","scope":510,"src":"8034:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":465,"name":"bytes","nodeType":"ElementaryTypeName","src":"8034:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":468,"name":"operation","nodeType":"VariableDeclaration","scope":510,"src":"8046:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":467,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"8046:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":470,"name":"_nonce","nodeType":"VariableDeclaration","scope":510,"src":"8067:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":469,"name":"uint256","nodeType":"ElementaryTypeName","src":"8067:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"8006:76:1"},"payable":false,"returnParameters":{"id":472,"nodeType":"ParameterList","parameters":[],"src":"8102:0:1"},"scope":963,"src":"7979:506:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":697,"nodeType":"Block","src":"9404:1349:1","statements":[{"assignments":[537],"declarations":[{"constant":false,"id":537,"name":"transactionHash","nodeType":"VariableDeclaration","scope":698,"src":"9414:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":536,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9414:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"id":545,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":539,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"9459:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":540,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":514,"src":"9463:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":541,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":516,"src":"9470:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":542,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":518,"src":"9476:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":543,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"9487:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":538,"name":"getTransactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":852,"src":"9440:18:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation,uint256) view returns (bytes32)"}},"id":544,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9440:53:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"9414:79:1"},{"assignments":[547],"declarations":[{"constant":false,"id":547,"name":"lastOwner","nodeType":"VariableDeclaration","scope":698,"src":"9555:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":546,"name":"address","nodeType":"ElementaryTypeName","src":"9555:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":551,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"30","id":549,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9583:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":548,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"9575:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":550,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9575:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"VariableDeclarationStatement","src":"9555:30:1"},{"assignments":[],"declarations":[{"constant":false,"id":553,"name":"currentOwner","nodeType":"VariableDeclaration","scope":698,"src":"9595:20:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":552,"name":"address","nodeType":"ElementaryTypeName","src":"9595:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":554,"initialValue":null,"nodeType":"VariableDeclarationStatement","src":"9595:20:1"},{"assignments":[],"declarations":[{"constant":false,"id":556,"name":"i","nodeType":"VariableDeclaration","scope":698,"src":"9625:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":555,"name":"uint256","nodeType":"ElementaryTypeName","src":"9625:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":557,"initialValue":null,"nodeType":"VariableDeclarationStatement","src":"9625:9:1"},{"assignments":[559],"declarations":[{"constant":false,"id":559,"name":"j","nodeType":"VariableDeclaration","scope":698,"src":"9644:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":558,"name":"uint256","nodeType":"ElementaryTypeName","src":"9644:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":561,"initialValue":{"argumentTypes":null,"hexValue":"30","id":560,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9656:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"9644:13:1"},{"body":{"id":648,"nodeType":"Block","src":"9741:619:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":581,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":575,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":572,"name":"indices","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":533,"src":"9843:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"}},"id":573,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"9843:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"id":574,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9860:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9843:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"&&","rightExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":580,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":576,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9865:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":577,"name":"indices","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":533,"src":"9870:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"}},"id":579,"indexExpression":{"argumentTypes":null,"id":578,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9878:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9870:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9865:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"9843:37:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"expression":{"argumentTypes":null,"id":629,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":610,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10155:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":612,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"10180:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":613,"name":"v","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":521,"src":"10197:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_memory_ptr","typeString":"uint8[] memory"}},"id":617,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":616,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":614,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10199:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":615,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10201:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10199:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10197:6:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":618,"name":"r","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":524,"src":"10205:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"}},"id":622,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":621,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":619,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10207:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":620,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10209:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10207:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10205:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":623,"name":"s","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":527,"src":"10213:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"}},"id":627,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":626,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":624,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10215:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":625,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10217:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10215:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10213:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":611,"name":"ecrecover","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2082,"src":"10170:9:1","typeDescriptions":{"typeIdentifier":"t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32,uint8,bytes32,bytes32) pure returns (address)"}},"id":628,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10170:50:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10155:65:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":630,"nodeType":"ExpressionStatement","src":"10155:65:1"},"id":631,"nodeType":"IfStatement","src":"9839:381:1","trueBody":{"id":609,"nodeType":"Block","src":"9882:177:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":596,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":588,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":583,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"9908:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":584,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"9908:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":585,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"9922:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":587,"indexExpression":{"argumentTypes":null,"id":586,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9930:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9922:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"9908:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"||","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":589,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"9936:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":593,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":590,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"9948:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":592,"indexExpression":{"argumentTypes":null,"id":591,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9956:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9948:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9936:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":595,"indexExpression":{"argumentTypes":null,"id":594,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"9960:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9936:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"9908:68:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":582,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"9900:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":597,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9900:77:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":598,"nodeType":"ExpressionStatement","src":"9900:77:1"},{"expression":{"argumentTypes":null,"id":603,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":599,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"9995:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":600,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10010:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":602,"indexExpression":{"argumentTypes":null,"id":601,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10018:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10010:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"9995:25:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":604,"nodeType":"ExpressionStatement","src":"9995:25:1"},{"expression":{"argumentTypes":null,"id":607,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":605,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10038:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"hexValue":"31","id":606,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10043:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"10038:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":608,"nodeType":"ExpressionStatement","src":"10038:6:1"}]}},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":633,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"10242:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":635,"indexExpression":{"argumentTypes":null,"id":634,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10250:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10242:21:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":632,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"10234:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":636,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10234:30:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":637,"nodeType":"ExpressionStatement","src":"10234:30:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":641,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":639,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10286:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"id":640,"name":"lastOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":547,"src":"10301:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10286:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":638,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"10278:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":642,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10278:33:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":643,"nodeType":"ExpressionStatement","src":"10278:33:1"},{"expression":{"argumentTypes":null,"id":646,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":644,"name":"lastOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":547,"src":"10325:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":645,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10337:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10325:24:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":647,"nodeType":"ExpressionStatement","src":"10325:24:1"}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":568,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":566,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9721:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"id":567,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"9725:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"9721:13:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":649,"initializationExpression":{"expression":{"argumentTypes":null,"id":564,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":562,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9714:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":563,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9718:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"9714:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":565,"nodeType":"ExpressionStatement","src":"9714:5:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":570,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"9736:3:1","subExpression":{"argumentTypes":null,"id":569,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9736:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":571,"nodeType":"ExpressionStatement","src":"9736:3:1"},"nodeType":"ForStatement","src":"9709:651:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":653,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":650,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10419:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":651,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10419:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"hexValue":"30","id":652,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10436:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"10419:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":685,"nodeType":"IfStatement","src":"10415:216:1","trueBody":{"id":684,"nodeType":"Block","src":"10439:192:1","statements":[{"body":{"id":682,"nodeType":"Block","src":"10490:131:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":670,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":665,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"10512:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":666,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10512:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":667,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10526:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":669,"indexExpression":{"argumentTypes":null,"id":668,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10534:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10526:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10512:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":681,"nodeType":"IfStatement","src":"10508:98:1","trueBody":{"expression":{"argumentTypes":null,"id":679,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":671,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"10558:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":676,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":672,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10570:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":674,"indexExpression":{"argumentTypes":null,"id":673,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10578:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10570:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10558:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":677,"indexExpression":{"argumentTypes":null,"id":675,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"10582:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"10558:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":678,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"10601:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"10558:48:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":680,"nodeType":"ExpressionStatement","src":"10558:48:1"}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":661,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":658,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10465:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":659,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10469:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":660,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10469:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10465:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":683,"initializationExpression":{"expression":{"argumentTypes":null,"id":656,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":654,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10458:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":655,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10462:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"10458:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":657,"nodeType":"ExpressionStatement","src":"10458:5:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":663,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"10485:3:1","subExpression":{"argumentTypes":null,"id":662,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10485:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":664,"nodeType":"ExpressionStatement","src":"10485:3:1"},"nodeType":"ForStatement","src":"10453:168:1"}]}},{"expression":{"argumentTypes":null,"id":688,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":686,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"10691:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"hexValue":"31","id":687,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10700:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"10691:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":689,"nodeType":"ExpressionStatement","src":"10691:10:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":691,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"10719:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":692,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":514,"src":"10723:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":693,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":516,"src":"10730:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":694,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":518,"src":"10736:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"id":690,"name":"execute","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":791,"src":"10711:7:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$__$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation)"}},"id":695,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10711:35:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":696,"nodeType":"ExpressionStatement","src":"10711:35:1"}]},"id":698,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeTransaction","nodeType":"FunctionDefinition","parameters":{"id":534,"nodeType":"ParameterList","parameters":[{"constant":false,"id":512,"name":"to","nodeType":"VariableDeclaration","scope":698,"src":"9250:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":511,"name":"address","nodeType":"ElementaryTypeName","src":"9250:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":514,"name":"value","nodeType":"VariableDeclaration","scope":698,"src":"9262:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":513,"name":"uint256","nodeType":"ElementaryTypeName","src":"9262:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":516,"name":"data","nodeType":"VariableDeclaration","scope":698,"src":"9277:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":515,"name":"bytes","nodeType":"ElementaryTypeName","src":"9277:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":518,"name":"operation","nodeType":"VariableDeclaration","scope":698,"src":"9289:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":517,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"9289:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":521,"name":"v","nodeType":"VariableDeclaration","scope":698,"src":"9310:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_memory_ptr","typeString":"uint8[] memory"},"typeName":{"baseType":{"id":519,"name":"uint8","nodeType":"ElementaryTypeName","src":"9310:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":520,"length":null,"nodeType":"ArrayTypeName","src":"9310:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_storage_ptr","typeString":"uint8[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":524,"name":"r","nodeType":"VariableDeclaration","scope":698,"src":"9321:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"},"typeName":{"baseType":{"id":522,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9321:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":523,"length":null,"nodeType":"ArrayTypeName","src":"9321:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_storage_ptr","typeString":"bytes32[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":527,"name":"s","nodeType":"VariableDeclaration","scope":698,"src":"9334:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"},"typeName":{"baseType":{"id":525,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9334:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":526,"length":null,"nodeType":"ArrayTypeName","src":"9334:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_storage_ptr","typeString":"bytes32[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":530,"name":"_owners","nodeType":"VariableDeclaration","scope":698,"src":"9347:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":528,"name":"address","nodeType":"ElementaryTypeName","src":"9347:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":529,"length":null,"nodeType":"ArrayTypeName","src":"9347:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":533,"name":"indices","nodeType":"VariableDeclaration","scope":698,"src":"9366:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"},"typeName":{"baseType":{"id":531,"name":"uint256","nodeType":"ElementaryTypeName","src":"9366:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":532,"length":null,"nodeType":"ArrayTypeName","src":"9366:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_storage_ptr","typeString":"uint256[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"9249:135:1"},"payable":false,"returnParameters":{"id":535,"nodeType":"ParameterList","parameters":[],"src":"9404:0:1"},"scope":963,"src":"9222:1531:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":736,"nodeType":"Block","src":"11304:338:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":712,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"11374:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":714,"indexExpression":{"argumentTypes":null,"id":713,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":708,"src":"11386:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"11374:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":711,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11366:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":715,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11366:31:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":716,"nodeType":"ExpressionStatement","src":"11366:31:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":720,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"11487:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":721,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11487:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":722,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":700,"src":"11499:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":723,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":702,"src":"11503:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":724,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":704,"src":"11510:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":725,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":706,"src":"11516:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"expression":{"argumentTypes":null,"id":718,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":708,"src":"11464:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":719,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"isExecutable","nodeType":"MemberAccess","referencedDeclaration":17,"src":"11464:22:1","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$_t_bool_$","typeString":"function (address,address,uint256,bytes memory,enum GnosisSafe.Operation) external returns (bool)"}},"id":726,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11464:62:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":717,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11456:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":727,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11456:71:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":728,"nodeType":"ExpressionStatement","src":"11456:71:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":730,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":700,"src":"11608:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":731,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":702,"src":"11612:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":732,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":704,"src":"11619:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":733,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":706,"src":"11625:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"id":729,"name":"execute","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":791,"src":"11600:7:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$__$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation)"}},"id":734,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11600:35:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":735,"nodeType":"ExpressionStatement","src":"11600:35:1"}]},"id":737,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeExtension","nodeType":"FunctionDefinition","parameters":{"id":709,"nodeType":"ParameterList","parameters":[{"constant":false,"id":700,"name":"to","nodeType":"VariableDeclaration","scope":737,"src":"11204:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":699,"name":"address","nodeType":"ElementaryTypeName","src":"11204:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":702,"name":"value","nodeType":"VariableDeclaration","scope":737,"src":"11216:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":701,"name":"uint256","nodeType":"ElementaryTypeName","src":"11216:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":704,"name":"data","nodeType":"VariableDeclaration","scope":737,"src":"11231:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":703,"name":"bytes","nodeType":"ElementaryTypeName","src":"11231:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":706,"name":"operation","nodeType":"VariableDeclaration","scope":737,"src":"11243:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":705,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"11243:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":708,"name":"extension","nodeType":"VariableDeclaration","scope":737,"src":"11264:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":707,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"11264:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"11203:81:1"},"payable":false,"returnParameters":{"id":710,"nodeType":"ParameterList","parameters":[],"src":"11304:0:1"},"scope":963,"src":"11178:464:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":790,"nodeType":"Block","src":"11746:367:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"id":751,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":748,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":745,"src":"11760:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":749,"name":"Operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":61,"src":"11773:9:1","typeDescriptions":{"typeIdentifier":"t_type$_t_enum$_Operation_$61_$","typeString":"type(enum GnosisSafe.Operation)"}},"id":750,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"Call","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11773:14:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"src":"11760:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"id":763,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":760,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":745,"src":"11857:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":761,"name":"Operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":61,"src":"11870:9:1","typeDescriptions":{"typeIdentifier":"t_type$_t_enum$_Operation_$61_$","typeString":"type(enum GnosisSafe.Operation)"}},"id":762,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"DelegateCall","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11870:22:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"src":"11857:35:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":787,"nodeType":"Block","src":"11959:148:1","statements":[{"assignments":[772],"declarations":[{"constant":false,"id":772,"name":"newContract","nodeType":"VariableDeclaration","scope":791,"src":"11973:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":771,"name":"address","nodeType":"ElementaryTypeName","src":"11973:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":776,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":774,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"12009:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":773,"name":"executeCreate","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":824,"src":"11995:13:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes_memory_ptr_$returns$_t_address_$","typeString":"function (bytes memory) returns (address)"}},"id":775,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11995:19:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"VariableDeclarationStatement","src":"11973:41:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":780,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":778,"name":"newContract","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":772,"src":"12036:11:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":779,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"12051:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"12036:16:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":777,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"12028:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":781,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12028:25:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":782,"nodeType":"ExpressionStatement","src":"12028:25:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":784,"name":"newContract","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":772,"src":"12084:11:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":783,"name":"ContractCreation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":25,"src":"12067:16:1","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$returns$__$","typeString":"function (address)"}},"id":785,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12067:29:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":786,"nodeType":"ExpressionStatement","src":"12067:29:1"}]},"id":788,"nodeType":"IfStatement","src":"11853:254:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":766,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":739,"src":"11934:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":767,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"11938:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":765,"name":"executeDelegateCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":815,"src":"11914:19:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,bytes memory) returns (bool)"}},"id":768,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11914:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":764,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11906:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":769,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11906:38:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":770,"nodeType":"ExpressionStatement","src":"11906:38:1"}},"id":789,"nodeType":"IfStatement","src":"11756:351:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":754,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":739,"src":"11821:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":755,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":741,"src":"11825:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":756,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"11832:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":753,"name":"executeCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":804,"src":"11809:11:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,uint256,bytes memory) returns (bool)"}},"id":757,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11809:28:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":752,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11801:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":758,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11801:37:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":759,"nodeType":"ExpressionStatement","src":"11801:37:1"}}]},"id":791,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"execute","nodeType":"FunctionDefinition","parameters":{"id":746,"nodeType":"ParameterList","parameters":[{"constant":false,"id":739,"name":"to","nodeType":"VariableDeclaration","scope":791,"src":"11665:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":738,"name":"address","nodeType":"ElementaryTypeName","src":"11665:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":741,"name":"value","nodeType":"VariableDeclaration","scope":791,"src":"11677:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":740,"name":"uint256","nodeType":"ElementaryTypeName","src":"11677:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":743,"name":"data","nodeType":"VariableDeclaration","scope":791,"src":"11692:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":742,"name":"bytes","nodeType":"ElementaryTypeName","src":"11692:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":745,"name":"operation","nodeType":"VariableDeclaration","scope":791,"src":"11704:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":744,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"11704:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"}],"src":"11664:60:1"},"payable":false,"returnParameters":{"id":747,"nodeType":"ParameterList","parameters":[],"src":"11746:0:1"},"scope":963,"src":"11648:465:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":803,"nodeType":"Block","src":"12231:119:1","statements":[{"externalReferences":[{"data":{"declaration":797,"isOffset":false,"isSlot":false,"src":"12303:4:1","valueSize":1}},{"data":{"declaration":797,"isOffset":false,"isSlot":false,"src":"12322:4:1","valueSize":1}},{"success":{"declaration":800,"isOffset":false,"isSlot":false,"src":"12264:7:1","valueSize":1}},{"to":{"declaration":793,"isOffset":false,"isSlot":false,"src":"12288:2:1","valueSize":1}},{"value":{"declaration":795,"isOffset":false,"isSlot":false,"src":"12292:5:1","valueSize":1}}],"id":802,"nodeType":"InlineAssembly","operations":"{\n success := call(not(0), to, value, add(data, 0x20), mload(data), 0, 0)\n}","src":"12241:109:1"}]},"id":804,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeCall","nodeType":"FunctionDefinition","parameters":{"id":798,"nodeType":"ParameterList","parameters":[{"constant":false,"id":793,"name":"to","nodeType":"VariableDeclaration","scope":804,"src":"12140:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":792,"name":"address","nodeType":"ElementaryTypeName","src":"12140:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":795,"name":"value","nodeType":"VariableDeclaration","scope":804,"src":"12152:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":794,"name":"uint256","nodeType":"ElementaryTypeName","src":"12152:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":797,"name":"data","nodeType":"VariableDeclaration","scope":804,"src":"12167:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":796,"name":"bytes","nodeType":"ElementaryTypeName","src":"12167:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12139:39:1"},"payable":false,"returnParameters":{"id":801,"nodeType":"ParameterList","parameters":[{"constant":false,"id":800,"name":"success","nodeType":"VariableDeclaration","scope":804,"src":"12213:12:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":799,"name":"bool","nodeType":"ElementaryTypeName","src":"12213:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"12212:14:1"},"scope":963,"src":"12119:231:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":814,"nodeType":"Block","src":"12461:120:1","statements":[{"externalReferences":[{"data":{"declaration":808,"isOffset":false,"isSlot":false,"src":"12534:4:1","valueSize":1}},{"data":{"declaration":808,"isOffset":false,"isSlot":false,"src":"12553:4:1","valueSize":1}},{"success":{"declaration":811,"isOffset":false,"isSlot":false,"src":"12494:7:1","valueSize":1}},{"to":{"declaration":806,"isOffset":false,"isSlot":false,"src":"12526:2:1","valueSize":1}}],"id":813,"nodeType":"InlineAssembly","operations":"{\n success := delegatecall(not(0), to, add(data, 0x20), mload(data), 0, 0)\n}","src":"12471:110:1"}]},"id":815,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeDelegateCall","nodeType":"FunctionDefinition","parameters":{"id":809,"nodeType":"ParameterList","parameters":[{"constant":false,"id":806,"name":"to","nodeType":"VariableDeclaration","scope":815,"src":"12385:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":805,"name":"address","nodeType":"ElementaryTypeName","src":"12385:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":808,"name":"data","nodeType":"VariableDeclaration","scope":815,"src":"12397:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":807,"name":"bytes","nodeType":"ElementaryTypeName","src":"12397:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12384:24:1"},"payable":false,"returnParameters":{"id":812,"nodeType":"ParameterList","parameters":[{"constant":false,"id":811,"name":"success","nodeType":"VariableDeclaration","scope":815,"src":"12443:12:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":810,"name":"bool","nodeType":"ElementaryTypeName","src":"12443:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"12442:14:1"},"scope":963,"src":"12356:225:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":823,"nodeType":"Block","src":"12681:103:1","statements":[{"externalReferences":[{"data":{"declaration":817,"isOffset":false,"isSlot":false,"src":"12762:4:1","valueSize":1}},{"newContract":{"declaration":820,"isOffset":false,"isSlot":false,"src":"12714:11:1","valueSize":1}},{"data":{"declaration":817,"isOffset":false,"isSlot":false,"src":"12743:4:1","valueSize":1}}],"id":822,"nodeType":"InlineAssembly","operations":"{\n newContract := create(0, add(data, 0x20), mload(data))\n}","src":"12691:93:1"}]},"id":824,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeCreate","nodeType":"FunctionDefinition","parameters":{"id":818,"nodeType":"ParameterList","parameters":[{"constant":false,"id":817,"name":"data","nodeType":"VariableDeclaration","scope":824,"src":"12610:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":816,"name":"bytes","nodeType":"ElementaryTypeName","src":"12610:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12609:12:1"},"payable":false,"returnParameters":{"id":821,"nodeType":"ParameterList","parameters":[{"constant":false,"id":820,"name":"newContract","nodeType":"VariableDeclaration","scope":824,"src":"12656:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":819,"name":"address","nodeType":"ElementaryTypeName","src":"12656:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"12655:21:1"},"scope":963,"src":"12587:197:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":851,"nodeType":"Block","src":"13238:87:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"30783139","id":841,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"13270:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_25_by_1","typeString":"int_const 25"},"value":"0x19"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_25_by_1","typeString":"int_const 25"}],"id":840,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"13265:4:1","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes1_$","typeString":"type(bytes1)"},"typeName":"byte"},"id":842,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"13265:10:1","typeDescriptions":{"typeIdentifier":"t_bytes1","typeString":"bytes1"}},{"argumentTypes":null,"id":843,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"13277:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},{"argumentTypes":null,"id":844,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":826,"src":"13283:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":845,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":828,"src":"13287:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":846,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":830,"src":"13294:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":847,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":832,"src":"13300:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":848,"name":"_nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":834,"src":"13311:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes1","typeString":"bytes1"},{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":839,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2083,"src":"13255:9:1","typeDescriptions":{"typeIdentifier":"t_function_sha3_pure$__$returns$_t_bytes32_$","typeString":"function () pure returns (bytes32)"}},"id":849,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"13255:63:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":838,"id":850,"nodeType":"Return","src":"13248:70:1"}]},"id":852,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getTransactionHash","nodeType":"FunctionDefinition","parameters":{"id":835,"nodeType":"ParameterList","parameters":[{"constant":false,"id":826,"name":"to","nodeType":"VariableDeclaration","scope":852,"src":"13104:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":825,"name":"address","nodeType":"ElementaryTypeName","src":"13104:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":828,"name":"value","nodeType":"VariableDeclaration","scope":852,"src":"13116:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":827,"name":"uint256","nodeType":"ElementaryTypeName","src":"13116:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":830,"name":"data","nodeType":"VariableDeclaration","scope":852,"src":"13131:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":829,"name":"bytes","nodeType":"ElementaryTypeName","src":"13131:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":832,"name":"operation","nodeType":"VariableDeclaration","scope":852,"src":"13143:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":831,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"13143:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":834,"name":"_nonce","nodeType":"VariableDeclaration","scope":852,"src":"13164:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":833,"name":"uint256","nodeType":"ElementaryTypeName","src":"13164:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"13103:76:1"},"payable":false,"returnParameters":{"id":838,"nodeType":"ParameterList","parameters":[{"constant":false,"id":837,"name":"","nodeType":"VariableDeclaration","scope":852,"src":"13225:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":836,"name":"bytes32","nodeType":"ElementaryTypeName","src":"13225:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"13224:9:1"},"scope":963,"src":"13076:249:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":860,"nodeType":"Block","src":"13488:30:1","statements":[{"expression":{"argumentTypes":null,"id":858,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"13505:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"functionReturnParameters":857,"id":859,"nodeType":"Return","src":"13498:13:1"}]},"id":861,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getOwners","nodeType":"FunctionDefinition","parameters":{"id":853,"nodeType":"ParameterList","parameters":[],"src":"13425:2:1"},"payable":false,"returnParameters":{"id":857,"nodeType":"ParameterList","parameters":[{"constant":false,"id":856,"name":"","nodeType":"VariableDeclaration","scope":861,"src":"13473:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":854,"name":"address","nodeType":"ElementaryTypeName","src":"13473:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":855,"length":null,"nodeType":"ArrayTypeName","src":"13473:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"13472:11:1"},"scope":963,"src":"13407:111:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":869,"nodeType":"Block","src":"13690:34:1","statements":[{"expression":{"argumentTypes":null,"id":867,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"13707:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"functionReturnParameters":866,"id":868,"nodeType":"Return","src":"13700:17:1"}]},"id":870,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getExtensions","nodeType":"FunctionDefinition","parameters":{"id":862,"nodeType":"ParameterList","parameters":[],"src":"13625:2:1"},"payable":false,"returnParameters":{"id":866,"nodeType":"ParameterList","parameters":[{"constant":false,"id":865,"name":"","nodeType":"VariableDeclaration","scope":870,"src":"13673:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_memory_ptr","typeString":"contract Extension[] memory"},"typeName":{"baseType":{"contractScope":null,"id":863,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"13673:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":864,"length":null,"nodeType":"ArrayTypeName","src":"13673:11:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage_ptr","typeString":"contract Extension[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"13672:13:1"},"scope":963,"src":"13603:121:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":901,"nodeType":"Block","src":"13998:162:1","statements":[{"body":{"id":899,"nodeType":"Block","src":"14049:105:1","statements":[{"condition":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":888,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"14067:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":892,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":889,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14079:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":891,"indexExpression":{"argumentTypes":null,"id":890,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14086:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14079:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14067:22:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":894,"indexExpression":{"argumentTypes":null,"id":893,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":872,"src":"14090:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14067:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":898,"nodeType":"IfStatement","src":"14063:80:1","trueBody":{"expression":{"argumentTypes":null,"id":896,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14124:19:1","subExpression":{"argumentTypes":null,"id":895,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":875,"src":"14124:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":897,"nodeType":"ExpressionStatement","src":"14124:19:1"}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":884,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":881,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14025:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":882,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14029:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":883,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"14029:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"14025:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":900,"initializationExpression":{"assignments":[878],"declarations":[{"constant":false,"id":878,"name":"i","nodeType":"VariableDeclaration","scope":902,"src":"14013:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":877,"name":"uint","nodeType":"ElementaryTypeName","src":"14013:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":880,"initialValue":{"argumentTypes":null,"hexValue":"30","id":879,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14022:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"14013:10:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":886,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14044:3:1","subExpression":{"argumentTypes":null,"id":885,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14044:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":887,"nodeType":"ExpressionStatement","src":"14044:3:1"},"nodeType":"ForStatement","src":"14008:146:1"}]},"id":902,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getConfirmationCount","nodeType":"FunctionDefinition","parameters":{"id":873,"nodeType":"ParameterList","parameters":[{"constant":false,"id":872,"name":"transactionHash","nodeType":"VariableDeclaration","scope":902,"src":"13900:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":871,"name":"bytes32","nodeType":"ElementaryTypeName","src":"13900:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"13899:25:1"},"payable":false,"returnParameters":{"id":876,"nodeType":"ParameterList","parameters":[{"constant":false,"id":875,"name":"confirmationCount","nodeType":"VariableDeclaration","scope":902,"src":"13970:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":874,"name":"uint","nodeType":"ElementaryTypeName","src":"13970:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"13969:24:1"},"scope":963,"src":"13870:290:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":961,"nodeType":"Block","src":"14432:407:1","statements":[{"assignments":[911],"declarations":[{"constant":false,"id":911,"name":"confirmationCount","nodeType":"VariableDeclaration","scope":962,"src":"14442:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":910,"name":"uint","nodeType":"ElementaryTypeName","src":"14442:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":915,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":913,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":904,"src":"14488:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":912,"name":"getConfirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":902,"src":"14467:20:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$returns$_t_uint256_$","typeString":"function (bytes32) view returns (uint256)"}},"id":914,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"14467:37:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"14442:62:1"},{"expression":{"argumentTypes":null,"id":922,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":916,"name":"confirmingOwners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":908,"src":"14514:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":920,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14547:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":919,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"NewExpression","src":"14533:13:1","typeDescriptions":{"typeIdentifier":"t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_$","typeString":"function (uint256) pure returns (address[] memory)"},"typeName":{"baseType":{"id":917,"name":"address","nodeType":"ElementaryTypeName","src":"14537:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":918,"length":null,"nodeType":"ArrayTypeName","src":"14537:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}}},"id":921,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"14533:32:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory","typeString":"address[] memory"}},"src":"14514:51:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":923,"nodeType":"ExpressionStatement","src":"14514:51:1"},{"expression":{"argumentTypes":null,"id":926,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":924,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14575:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":925,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14595:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"14575:21:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":927,"nodeType":"ExpressionStatement","src":"14575:21:1"},{"body":{"id":959,"nodeType":"Block","src":"14647:186:1","statements":[{"condition":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":939,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"14665:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":943,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":940,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14677:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":942,"indexExpression":{"argumentTypes":null,"id":941,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14684:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14677:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14665:22:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":945,"indexExpression":{"argumentTypes":null,"id":944,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":904,"src":"14688:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14665:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":958,"nodeType":"IfStatement","src":"14661:162:1","trueBody":{"id":957,"nodeType":"Block","src":"14706:117:1","statements":[{"expression":{"argumentTypes":null,"id":952,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":946,"name":"confirmingOwners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":908,"src":"14724:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":948,"indexExpression":{"argumentTypes":null,"id":947,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14741:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"14724:35:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":949,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14762:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":951,"indexExpression":{"argumentTypes":null,"id":950,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14769:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14762:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"14724:47:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":953,"nodeType":"ExpressionStatement","src":"14724:47:1"},{"expression":{"argumentTypes":null,"id":955,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14789:19:1","subExpression":{"argumentTypes":null,"id":954,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14789:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":956,"nodeType":"ExpressionStatement","src":"14789:19:1"}]}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":935,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":932,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14623:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":933,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14627:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":934,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"14627:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"14623:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":960,"initializationExpression":{"assignments":[929],"declarations":[{"constant":false,"id":929,"name":"i","nodeType":"VariableDeclaration","scope":962,"src":"14611:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":928,"name":"uint","nodeType":"ElementaryTypeName","src":"14611:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":931,"initialValue":{"argumentTypes":null,"hexValue":"30","id":930,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14620:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"14611:10:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":937,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14642:3:1","subExpression":{"argumentTypes":null,"id":936,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14642:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":938,"nodeType":"ExpressionStatement","src":"14642:3:1"},"nodeType":"ForStatement","src":"14606:227:1"}]},"id":962,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getConfirmingOwners","nodeType":"FunctionDefinition","parameters":{"id":905,"nodeType":"ParameterList","parameters":[{"constant":false,"id":904,"name":"transactionHash","nodeType":"VariableDeclaration","scope":962,"src":"14330:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":903,"name":"bytes32","nodeType":"ElementaryTypeName","src":"14330:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"14329:25:1"},"payable":false,"returnParameters":{"id":909,"nodeType":"ParameterList","parameters":[{"constant":false,"id":908,"name":"confirmingOwners","nodeType":"VariableDeclaration","scope":962,"src":"14400:26:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":906,"name":"address","nodeType":"ElementaryTypeName","src":"14400:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":907,"length":null,"nodeType":"ArrayTypeName","src":"14400:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"14399:28:1"},"scope":963,"src":"14301:538:1","stateMutability":"view","superFunction":null,"visibility":"public"}],"scope":964,"src":"218:14623:1"}],"src":"0:14842:1"},"legacyAST":{"absolutePath":"/Users/apanizo/git/gnosis/gnosis-team-safe/gnosis-safe-contracts/contracts/GnosisSafe.sol","exportedSymbols":{"GnosisSafe":[963]},"id":964,"nodeType":"SourceUnit","nodes":[{"id":20,"literals":["solidity","0.4",".19"],"nodeType":"PragmaDirective","src":"0:23:1"},{"absolutePath":"/Users/apanizo/git/gnosis/gnosis-team-safe/gnosis-safe-contracts/contracts/Extension.sol","file":"./Extension.sol","id":21,"nodeType":"ImportDirective","scope":964,"sourceUnit":19,"src":"24:25:1","symbolAliases":[],"unitAlias":""},{"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":"@title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n @author Stefan George - ","fullyImplemented":true,"id":963,"linearizedBaseContracts":[963],"name":"GnosisSafe","nodeType":"ContractDefinition","nodes":[{"anonymous":false,"id":25,"name":"ContractCreation","nodeType":"EventDefinition","parameters":{"id":24,"nodeType":"ParameterList","parameters":[{"constant":false,"id":23,"indexed":false,"name":"newContract","nodeType":"VariableDeclaration","scope":25,"src":"268:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":22,"name":"address","nodeType":"ElementaryTypeName","src":"268:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"267:21:1"},"src":"245:44:1"},{"constant":true,"id":28,"name":"NAME","nodeType":"VariableDeclaration","scope":963,"src":"295:43:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string memory"},"typeName":{"id":26,"name":"string","nodeType":"ElementaryTypeName","src":"295:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string storage pointer"}},"value":{"argumentTypes":null,"hexValue":"476e6f7369732053616665","id":27,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"325:13:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_72ec6775392f699e8ffd72b7c600556d49bdc746bf22bce93d3ae6019cdaff63","typeString":"literal_string \"Gnosis Safe\""},"value":"Gnosis Safe"},"visibility":"public"},{"constant":true,"id":31,"name":"VERSION","nodeType":"VariableDeclaration","scope":963,"src":"344:40:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string memory"},"typeName":{"id":29,"name":"string","nodeType":"ElementaryTypeName","src":"344:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string storage pointer"}},"value":{"argumentTypes":null,"hexValue":"302e302e31","id":30,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"377:7:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_ae209a0b48f21c054280f2455d32cf309387644879d9acbd8ffc199163811885","typeString":"literal_string \"0.0.1\""},"value":"0.0.1"},"visibility":"public"},{"constant":false,"id":33,"name":"masterCopy","nodeType":"VariableDeclaration","scope":963,"src":"391:21:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},"typeName":{"contractScope":null,"id":32,"name":"GnosisSafe","nodeType":"UserDefinedTypeName","referencedDeclaration":963,"src":"391:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"value":null,"visibility":"internal"},{"constant":false,"id":35,"name":"threshold","nodeType":"VariableDeclaration","scope":963,"src":"418:22:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":34,"name":"uint8","nodeType":"ElementaryTypeName","src":"418:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"public"},{"constant":false,"id":37,"name":"nonce","nodeType":"VariableDeclaration","scope":963,"src":"446:20:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint256","nodeType":"ElementaryTypeName","src":"446:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"public"},{"constant":false,"id":40,"name":"owners","nodeType":"VariableDeclaration","scope":963,"src":"472:23:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"},"typeName":{"baseType":{"id":38,"name":"address","nodeType":"ElementaryTypeName","src":"472:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":39,"length":null,"nodeType":"ArrayTypeName","src":"472:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"public"},{"constant":false,"id":43,"name":"extensions","nodeType":"VariableDeclaration","scope":963,"src":"501:29:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"},"typeName":{"baseType":{"contractScope":null,"id":41,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"501:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":42,"length":null,"nodeType":"ArrayTypeName","src":"501:11:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage_ptr","typeString":"contract Extension[] storage pointer"}},"value":null,"visibility":"public"},{"constant":false,"id":47,"name":"isOwner","nodeType":"VariableDeclaration","scope":963,"src":"607:40:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"typeName":{"id":46,"keyType":{"id":44,"name":"address","nodeType":"ElementaryTypeName","src":"616:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"607:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"valueType":{"id":45,"name":"bool","nodeType":"ElementaryTypeName","src":"627:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"value":null,"visibility":"public"},{"constant":false,"id":51,"name":"isExtension","nodeType":"VariableDeclaration","scope":963,"src":"729:44:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"typeName":{"id":50,"keyType":{"id":48,"name":"address","nodeType":"ElementaryTypeName","src":"738:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"729:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"valueType":{"id":49,"name":"bool","nodeType":"ElementaryTypeName","src":"749:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"value":null,"visibility":"public"},{"constant":false,"id":57,"name":"isConfirmed","nodeType":"VariableDeclaration","scope":963,"src":"892:65:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"},"typeName":{"id":56,"keyType":{"id":52,"name":"address","nodeType":"ElementaryTypeName","src":"901:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"892:46:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"},"valueType":{"id":55,"keyType":{"id":53,"name":"bytes32","nodeType":"ElementaryTypeName","src":"921:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Mapping","src":"912:25:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"},"valueType":{"id":54,"name":"bool","nodeType":"ElementaryTypeName","src":"932:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}}},"value":null,"visibility":"public"},{"canonicalName":"GnosisSafe.Operation","id":61,"members":[{"id":58,"name":"Call","nodeType":"EnumValue","src":"989:4:1"},{"id":59,"name":"DelegateCall","nodeType":"EnumValue","src":"1003:12:1"},{"id":60,"name":"Create","nodeType":"EnumValue","src":"1025:6:1"}],"name":"Operation","nodeType":"EnumDefinition","src":"964:73:1"},{"body":{"id":73,"nodeType":"Block","src":"1065:64:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":69,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":64,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"1083:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":65,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1083:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":67,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"1105:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}],"id":66,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1097:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":68,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1097:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"1083:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":63,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"1075:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":70,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1075:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":71,"nodeType":"ExpressionStatement","src":"1075:36:1"},{"id":72,"nodeType":"PlaceholderStatement","src":"1121:1:1"}]},"id":74,"name":"onlyWallet","nodeType":"ModifierDefinition","parameters":{"id":62,"nodeType":"ParameterList","parameters":[],"src":"1062:2:1"},"src":"1043:86:1","visibility":"internal"},{"body":{"id":77,"nodeType":"Block","src":"1243:8:1","statements":[]},"id":78,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[],"src":"1203:2:1"},"payable":true,"returnParameters":{"id":76,"nodeType":"ParameterList","parameters":[],"src":"1243:0:1"},"scope":963,"src":"1194:57:1","stateMutability":"payable","superFunction":null,"visibility":"external"},{"body":{"id":97,"nodeType":"Block","src":"1667:53:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":91,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":81,"src":"1683:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},{"argumentTypes":null,"id":92,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":83,"src":"1692:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"argumentTypes":null,"id":93,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":85,"src":"1704:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":94,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":87,"src":"1708:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":90,"name":"setup","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":187,"src":"1677:5:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint8_$_t_address_$_t_bytes_memory_ptr_$returns$__$","typeString":"function (address[] memory,uint8,address,bytes memory)"}},"id":95,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1677:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":96,"nodeType":"ExpressionStatement","src":"1677:36:1"}]},"id":98,"implemented":true,"isConstructor":true,"isDeclaredConst":false,"modifiers":[],"name":"GnosisSafe","nodeType":"FunctionDefinition","parameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":81,"name":"_owners","nodeType":"VariableDeclaration","scope":98,"src":"1587:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":79,"name":"address","nodeType":"ElementaryTypeName","src":"1587:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":80,"length":null,"nodeType":"ArrayTypeName","src":"1587:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":83,"name":"_threshold","nodeType":"VariableDeclaration","scope":98,"src":"1606:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":82,"name":"uint8","nodeType":"ElementaryTypeName","src":"1606:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"},{"constant":false,"id":85,"name":"to","nodeType":"VariableDeclaration","scope":98,"src":"1624:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":84,"name":"address","nodeType":"ElementaryTypeName","src":"1624:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":87,"name":"data","nodeType":"VariableDeclaration","scope":98,"src":"1636:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":86,"name":"bytes","nodeType":"ElementaryTypeName","src":"1636:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"1586:61:1"},"payable":false,"returnParameters":{"id":89,"nodeType":"ParameterList","parameters":[],"src":"1667:0:1"},"scope":963,"src":"1567:153:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":186,"nodeType":"Block","src":"2134:1046:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":113,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":111,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"2276:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"hexValue":"30","id":112,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2289:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"2276:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":110,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2268:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":114,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2268:23:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":115,"nodeType":"ExpressionStatement","src":"2268:23:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":120,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":117,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2383:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":118,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2397:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":119,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2397:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2383:28:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":116,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2375:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":121,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2375:37:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":122,"nodeType":"ExpressionStatement","src":"2375:37:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":126,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":124,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2482:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"hexValue":"31","id":125,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2496:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"2482:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":123,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2474:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":127,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2474:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":128,"nodeType":"ExpressionStatement","src":"2474:24:1"},{"body":{"id":165,"nodeType":"Block","src":"2590:221:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":145,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":141,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2657:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":143,"indexExpression":{"argumentTypes":null,"id":142,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2665:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2657:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":144,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2671:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"2657:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":140,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2649:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":146,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2649:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":147,"nodeType":"ExpressionStatement","src":"2649:24:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":154,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"2739:20:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":149,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"2740:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":153,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":150,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2748:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":152,"indexExpression":{"argumentTypes":null,"id":151,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2756:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2748:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2740:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":148,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"2731:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":155,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2731:29:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":156,"nodeType":"ExpressionStatement","src":"2731:29:1"},{"expression":{"argumentTypes":null,"id":163,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":157,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"2774:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":161,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":158,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2782:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":160,"indexExpression":{"argumentTypes":null,"id":159,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2790:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2782:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2774:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":162,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"2796:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"2774:26:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":164,"nodeType":"ExpressionStatement","src":"2774:26:1"}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":136,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":133,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2565:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":134,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2569:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":135,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2569:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2565:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":166,"initializationExpression":{"assignments":[130],"declarations":[{"constant":false,"id":130,"name":"i","nodeType":"VariableDeclaration","scope":187,"src":"2550:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":129,"name":"uint256","nodeType":"ElementaryTypeName","src":"2550:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":132,"initialValue":{"argumentTypes":null,"hexValue":"30","id":131,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2562:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"2550:13:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":138,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"2585:3:1","subExpression":{"argumentTypes":null,"id":137,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":130,"src":"2585:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":139,"nodeType":"ExpressionStatement","src":"2585:3:1"},"nodeType":"ForStatement","src":"2545:266:1"},{"expression":{"argumentTypes":null,"id":169,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":167,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"2820:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":168,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2829:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"src":"2820:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":170,"nodeType":"ExpressionStatement","src":"2820:16:1"},{"expression":{"argumentTypes":null,"id":173,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":171,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"2846:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":172,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2858:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"2846:22:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":174,"nodeType":"ExpressionStatement","src":"2846:22:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":177,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":175,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":105,"src":"3042:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":176,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3048:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3042:7:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":185,"nodeType":"IfStatement","src":"3038:135:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":180,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":105,"src":"3163:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":181,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":107,"src":"3167:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":179,"name":"executeDelegateCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":815,"src":"3143:19:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,bytes memory) returns (bool)"}},"id":182,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3143:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":178,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3135:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":183,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3135:38:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":184,"nodeType":"ExpressionStatement","src":"3135:38:1"}}]},"id":187,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"setup","nodeType":"FunctionDefinition","parameters":{"id":108,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"name":"_owners","nodeType":"VariableDeclaration","scope":187,"src":"2054:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":99,"name":"address","nodeType":"ElementaryTypeName","src":"2054:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":100,"length":null,"nodeType":"ArrayTypeName","src":"2054:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":103,"name":"_threshold","nodeType":"VariableDeclaration","scope":187,"src":"2073:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":102,"name":"uint8","nodeType":"ElementaryTypeName","src":"2073:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"},{"constant":false,"id":105,"name":"to","nodeType":"VariableDeclaration","scope":187,"src":"2091:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":104,"name":"address","nodeType":"ElementaryTypeName","src":"2091:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":107,"name":"data","nodeType":"VariableDeclaration","scope":187,"src":"2103:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":106,"name":"bytes","nodeType":"ElementaryTypeName","src":"2103:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"2053:61:1"},"payable":false,"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[],"src":"2134:0:1"},"scope":963,"src":"2039:1141:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":206,"nodeType":"Block","src":"3414:132:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":199,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":196,"name":"_masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":189,"src":"3487:11:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}],"id":195,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"3479:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":197,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3479:20:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":198,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3503:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3479:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":194,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3471:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":200,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3471:34:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":201,"nodeType":"ExpressionStatement","src":"3471:34:1"},{"expression":{"argumentTypes":null,"id":204,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":202,"name":"masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":33,"src":"3515:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":203,"name":"_masterCopy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":189,"src":"3528:11:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"src":"3515:24:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"id":205,"nodeType":"ExpressionStatement","src":"3515:24:1"}]},"id":207,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":192,"modifierName":{"argumentTypes":null,"id":191,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"3399:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"3399:10:1"}],"name":"changeMasterCopy","nodeType":"FunctionDefinition","parameters":{"id":190,"nodeType":"ParameterList","parameters":[{"constant":false,"id":189,"name":"_masterCopy","nodeType":"VariableDeclaration","scope":207,"src":"3352:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},"typeName":{"contractScope":null,"id":188,"name":"GnosisSafe","nodeType":"UserDefinedTypeName","referencedDeclaration":963,"src":"3352:10:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},"value":null,"visibility":"internal"}],"src":"3351:24:1"},"payable":false,"returnParameters":{"id":193,"nodeType":"ParameterList","parameters":[],"src":"3414:0:1"},"scope":963,"src":"3326:220:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":249,"nodeType":"Block","src":"3875:342:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":219,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":217,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"3934:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":218,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3943:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"3934:10:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":216,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3926:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":220,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3926:19:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":221,"nodeType":"ExpressionStatement","src":"3926:19:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":226,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"4003:15:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":223,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4004:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":225,"indexExpression":{"argumentTypes":null,"id":224,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4012:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4004:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":222,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"3995:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":227,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3995:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":228,"nodeType":"ExpressionStatement","src":"3995:24:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":232,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4041:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"expression":{"argumentTypes":null,"id":229,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4029:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":231,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"push","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4029:11:1","typeDescriptions":{"typeIdentifier":"t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$","typeString":"function (address) returns (uint256)"}},"id":233,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4029:18:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":234,"nodeType":"ExpressionStatement","src":"4029:18:1"},{"expression":{"argumentTypes":null,"id":239,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":235,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4057:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":237,"indexExpression":{"argumentTypes":null,"id":236,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":209,"src":"4065:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4057:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":238,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"4074:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"4057:21:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":240,"nodeType":"ExpressionStatement","src":"4057:21:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":243,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":241,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"4146:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"id":242,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":211,"src":"4159:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"4146:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":248,"nodeType":"IfStatement","src":"4142:68:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":245,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":211,"src":"4199:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":244,"name":"changeThreshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":385,"src":"4183:15:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_uint8_$returns$__$","typeString":"function (uint8)"}},"id":246,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4183:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":247,"nodeType":"ExpressionStatement","src":"4183:27:1"}}]},"id":250,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":214,"modifierName":{"argumentTypes":null,"id":213,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"3860:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"3860:10:1"}],"name":"addOwner","nodeType":"FunctionDefinition","parameters":{"id":212,"nodeType":"ParameterList","parameters":[{"constant":false,"id":209,"name":"owner","nodeType":"VariableDeclaration","scope":250,"src":"3804:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":208,"name":"address","nodeType":"ElementaryTypeName","src":"3804:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":211,"name":"_threshold","nodeType":"VariableDeclaration","scope":250,"src":"3819:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":210,"name":"uint8","nodeType":"ElementaryTypeName","src":"3819:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"3803:33:1"},"payable":false,"returnParameters":{"id":215,"nodeType":"ParameterList","parameters":[],"src":"3875:0:1"},"scope":963,"src":"3786:431:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":308,"nodeType":"Block","src":"4660:487:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":267,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":265,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":262,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4755:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":263,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4755:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":264,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4771:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"4755:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"id":266,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"4776:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"4755:31:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":261,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"4747:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":268,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4747:40:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":269,"nodeType":"ExpressionStatement","src":"4747:40:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":275,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":271,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4867:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":273,"indexExpression":{"argumentTypes":null,"id":272,"name":"ownerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":252,"src":"4874:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4867:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":274,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":254,"src":"4889:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4867:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":270,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"4859:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":276,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4859:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":277,"nodeType":"ExpressionStatement","src":"4859:36:1"},{"expression":{"argumentTypes":null,"id":282,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":278,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"4905:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":280,"indexExpression":{"argumentTypes":null,"id":279,"name":"owner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":254,"src":"4913:5:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4905:14:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":281,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"4922:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"4905:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":283,"nodeType":"ExpressionStatement","src":"4905:22:1"},{"expression":{"argumentTypes":null,"id":293,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":284,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4937:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":286,"indexExpression":{"argumentTypes":null,"id":285,"name":"ownerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":252,"src":"4944:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"4937:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":287,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4958:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":292,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":291,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":288,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4965:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":289,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4965:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":290,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4981:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"4965:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4958:25:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"4937:46:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":294,"nodeType":"ExpressionStatement","src":"4937:46:1"},{"expression":{"argumentTypes":null,"id":298,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"--","prefix":false,"src":"4993:15:1","subExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":295,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"4993:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":297,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"4993:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":299,"nodeType":"ExpressionStatement","src":"4993:15:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":302,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":300,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"5076:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"id":301,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"5089:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"5076:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":307,"nodeType":"IfStatement","src":"5072:68:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":304,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":256,"src":"5129:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":303,"name":"changeThreshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":385,"src":"5113:15:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_uint8_$returns$__$","typeString":"function (uint8)"}},"id":305,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5113:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":306,"nodeType":"ExpressionStatement","src":"5113:27:1"}}]},"id":309,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":259,"modifierName":{"argumentTypes":null,"id":258,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"4645:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"4645:10:1"}],"name":"removeOwner","nodeType":"FunctionDefinition","parameters":{"id":257,"nodeType":"ParameterList","parameters":[{"constant":false,"id":252,"name":"ownerIndex","nodeType":"VariableDeclaration","scope":309,"src":"4569:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":251,"name":"uint256","nodeType":"ElementaryTypeName","src":"4569:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":254,"name":"owner","nodeType":"VariableDeclaration","scope":309,"src":"4589:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":253,"name":"address","nodeType":"ElementaryTypeName","src":"4589:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":256,"name":"_threshold","nodeType":"VariableDeclaration","scope":309,"src":"4604:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":255,"name":"uint8","nodeType":"ElementaryTypeName","src":"4604:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"4568:53:1"},"payable":false,"returnParameters":{"id":260,"nodeType":"ParameterList","parameters":[],"src":"4660:0:1"},"scope":963,"src":"4548:599:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":359,"nodeType":"Block","src":"5587:383:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":323,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":321,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5646:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":322,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"5658:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"5646:13:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":320,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5638:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":324,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5638:22:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":325,"nodeType":"ExpressionStatement","src":"5638:22:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":330,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"5718:18:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":327,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5719:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":329,"indexExpression":{"argumentTypes":null,"id":328,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5727:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"5719:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":326,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5710:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":331,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5710:27:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":332,"nodeType":"ExpressionStatement","src":"5710:27:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":338,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":334,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"5817:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":336,"indexExpression":{"argumentTypes":null,"id":335,"name":"oldOwnerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":311,"src":"5824:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"5817:21:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":337,"name":"oldOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":313,"src":"5842:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"5817:33:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":333,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"5809:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":339,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5809:42:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":340,"nodeType":"ExpressionStatement","src":"5809:42:1"},{"expression":{"argumentTypes":null,"id":345,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":341,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5861:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":343,"indexExpression":{"argumentTypes":null,"id":342,"name":"oldOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":313,"src":"5869:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5861:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":344,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"5881:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"5861:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":346,"nodeType":"ExpressionStatement","src":"5861:25:1"},{"expression":{"argumentTypes":null,"id":351,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":347,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"5896:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":349,"indexExpression":{"argumentTypes":null,"id":348,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5904:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5896:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":350,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"5917:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"5896:25:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":352,"nodeType":"ExpressionStatement","src":"5896:25:1"},{"expression":{"argumentTypes":null,"id":357,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":353,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"5931:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":355,"indexExpression":{"argumentTypes":null,"id":354,"name":"oldOwnerIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":311,"src":"5938:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"5931:21:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":356,"name":"newOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":315,"src":"5955:8:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"5931:32:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":358,"nodeType":"ExpressionStatement","src":"5931:32:1"}]},"id":360,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":318,"modifierName":{"argumentTypes":null,"id":317,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"5572:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"5572:10:1"}],"name":"replaceOwner","nodeType":"FunctionDefinition","parameters":{"id":316,"nodeType":"ParameterList","parameters":[{"constant":false,"id":311,"name":"oldOwnerIndex","nodeType":"VariableDeclaration","scope":360,"src":"5490:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":310,"name":"uint256","nodeType":"ElementaryTypeName","src":"5490:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":313,"name":"oldOwner","nodeType":"VariableDeclaration","scope":360,"src":"5513:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":312,"name":"address","nodeType":"ElementaryTypeName","src":"5513:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":315,"name":"newOwner","nodeType":"VariableDeclaration","scope":360,"src":"5531:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":314,"name":"address","nodeType":"ElementaryTypeName","src":"5531:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"5489:59:1"},"payable":false,"returnParameters":{"id":319,"nodeType":"ParameterList","parameters":[],"src":"5587:0:1"},"scope":963,"src":"5468:502:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":384,"nodeType":"Block","src":"6240:239:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":371,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":368,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6326:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":369,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"6340:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":370,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"6340:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6326:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":367,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6318:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":372,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6318:36:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":373,"nodeType":"ExpressionStatement","src":"6318:36:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":377,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":375,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6424:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"hexValue":"31","id":376,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6438:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"6424:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":374,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6416:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":378,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6416:24:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":379,"nodeType":"ExpressionStatement","src":"6416:24:1"},{"expression":{"argumentTypes":null,"id":382,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":380,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"6450:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":381,"name":"_threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":362,"src":"6462:10:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"6450:22:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":383,"nodeType":"ExpressionStatement","src":"6450:22:1"}]},"id":385,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":365,"modifierName":{"argumentTypes":null,"id":364,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"6225:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"6225:10:1"}],"name":"changeThreshold","nodeType":"FunctionDefinition","parameters":{"id":363,"nodeType":"ParameterList","parameters":[{"constant":false,"id":362,"name":"_threshold","nodeType":"VariableDeclaration","scope":385,"src":"6184:16:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":361,"name":"uint8","nodeType":"ElementaryTypeName","src":"6184:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":null,"visibility":"internal"}],"src":"6183:18:1"},"payable":false,"returnParameters":{"id":366,"nodeType":"ParameterList","parameters":[],"src":"6240:0:1"},"scope":963,"src":"6159:320:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":419,"nodeType":"Block","src":"6737:255:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":397,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":394,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6808:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}],"id":393,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"6800:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":395,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6800:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":396,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6822:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"6800:23:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":392,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6792:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":398,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6792:32:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":399,"nodeType":"ExpressionStatement","src":"6792:32:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":404,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"6886:23:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":401,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"6887:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":403,"indexExpression":{"argumentTypes":null,"id":402,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6899:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"6887:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":400,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"6878:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":405,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6878:32:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":406,"nodeType":"ExpressionStatement","src":"6878:32:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":410,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6936:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}],"expression":{"argumentTypes":null,"id":407,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"6920:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":409,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"push","nodeType":"MemberAccess","referencedDeclaration":null,"src":"6920:15:1","typeDescriptions":{"typeIdentifier":"t_function_arraypush_nonpayable$_t_contract$_Extension_$18_$returns$_t_uint256_$","typeString":"function (contract Extension) returns (uint256)"}},"id":411,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6920:26:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":412,"nodeType":"ExpressionStatement","src":"6920:26:1"},{"expression":{"argumentTypes":null,"id":417,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":413,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"6956:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":415,"indexExpression":{"argumentTypes":null,"id":414,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":387,"src":"6968:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"6956:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":416,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"6981:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"6956:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":418,"nodeType":"ExpressionStatement","src":"6956:29:1"}]},"id":420,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":390,"modifierName":{"argumentTypes":null,"id":389,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"6722:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"6722:10:1"}],"name":"addExtension","nodeType":"FunctionDefinition","parameters":{"id":388,"nodeType":"ParameterList","parameters":[{"constant":false,"id":387,"name":"extension","nodeType":"VariableDeclaration","scope":420,"src":"6678:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":386,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"6678:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"6677:21:1"},"payable":false,"returnParameters":{"id":391,"nodeType":"ParameterList","parameters":[],"src":"6737:0:1"},"scope":963,"src":"6656:336:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":459,"nodeType":"Block","src":"7372:276:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"id":434,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":430,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7460:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":432,"indexExpression":{"argumentTypes":null,"id":431,"name":"extensionIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":422,"src":"7471:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7460:26:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"id":433,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":424,"src":"7490:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"src":"7460:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":429,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"7452:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":435,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7452:48:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":436,"nodeType":"ExpressionStatement","src":"7452:48:1"},{"expression":{"argumentTypes":null,"id":441,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":437,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"7510:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":439,"indexExpression":{"argumentTypes":null,"id":438,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":424,"src":"7522:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7510:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":440,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"7535:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"7510:30:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":442,"nodeType":"ExpressionStatement","src":"7510:30:1"},{"expression":{"argumentTypes":null,"id":452,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":443,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7550:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":445,"indexExpression":{"argumentTypes":null,"id":444,"name":"extensionIndex","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":422,"src":"7561:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7550:26:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":446,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7579:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":451,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":450,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":447,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7590:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":448,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"7590:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"hexValue":"31","id":449,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"7610:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"7590:21:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7579:33:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"src":"7550:62:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":453,"nodeType":"ExpressionStatement","src":"7550:62:1"},{"expression":{"argumentTypes":null,"id":457,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"--","prefix":false,"src":"7622:19:1","subExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":454,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"7622:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"id":456,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"7622:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":458,"nodeType":"ExpressionStatement","src":"7622:19:1"}]},"id":460,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[{"arguments":[],"id":427,"modifierName":{"argumentTypes":null,"id":426,"name":"onlyWallet","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"7357:10:1","typeDescriptions":{"typeIdentifier":"t_modifier$__$","typeString":"modifier ()"}},"nodeType":"ModifierInvocation","src":"7357:10:1"}],"name":"removeExtension","nodeType":"FunctionDefinition","parameters":{"id":425,"nodeType":"ParameterList","parameters":[{"constant":false,"id":422,"name":"extensionIndex","nodeType":"VariableDeclaration","scope":460,"src":"7289:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":421,"name":"uint256","nodeType":"ElementaryTypeName","src":"7289:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":424,"name":"extension","nodeType":"VariableDeclaration","scope":460,"src":"7313:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":423,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"7313:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"7288:45:1"},"payable":false,"returnParameters":{"id":428,"nodeType":"ParameterList","parameters":[],"src":"7372:0:1"},"scope":963,"src":"7264:384:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":509,"nodeType":"Block","src":"8102:383:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":474,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"8190:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":477,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":475,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8198:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":476,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8198:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8190:19:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":473,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"8182:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":478,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8182:28:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":479,"nodeType":"ExpressionStatement","src":"8182:28:1"},{"assignments":[481],"declarations":[{"constant":false,"id":481,"name":"transactionHash","nodeType":"VariableDeclaration","scope":510,"src":"8220:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":480,"name":"bytes32","nodeType":"ElementaryTypeName","src":"8220:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"id":489,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":483,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":462,"src":"8265:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":484,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":464,"src":"8269:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":485,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":466,"src":"8276:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":486,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":468,"src":"8282:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":487,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"8293:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":482,"name":"getTransactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":852,"src":"8246:18:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation,uint256) view returns (bytes32)"}},"id":488,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8246:53:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"8220:79:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":497,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"8379:41:1","subExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":491,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"8380:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":494,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":492,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8392:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":493,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8392:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8380:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":496,"indexExpression":{"argumentTypes":null,"id":495,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":481,"src":"8404:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8380:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":490,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"8371:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":498,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8371:50:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":499,"nodeType":"ExpressionStatement","src":"8371:50:1"},{"expression":{"argumentTypes":null,"id":507,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":500,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"8431:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":504,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":501,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"8443:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":502,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"8443:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"8431:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":505,"indexExpression":{"argumentTypes":null,"id":503,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":481,"src":"8455:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"8431:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"74727565","id":506,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"8474:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"8431:47:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":508,"nodeType":"ExpressionStatement","src":"8431:47:1"}]},"id":510,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"confirmTransaction","nodeType":"FunctionDefinition","parameters":{"id":471,"nodeType":"ParameterList","parameters":[{"constant":false,"id":462,"name":"to","nodeType":"VariableDeclaration","scope":510,"src":"8007:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":461,"name":"address","nodeType":"ElementaryTypeName","src":"8007:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":464,"name":"value","nodeType":"VariableDeclaration","scope":510,"src":"8019:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":463,"name":"uint256","nodeType":"ElementaryTypeName","src":"8019:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":466,"name":"data","nodeType":"VariableDeclaration","scope":510,"src":"8034:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":465,"name":"bytes","nodeType":"ElementaryTypeName","src":"8034:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":468,"name":"operation","nodeType":"VariableDeclaration","scope":510,"src":"8046:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":467,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"8046:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":470,"name":"_nonce","nodeType":"VariableDeclaration","scope":510,"src":"8067:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":469,"name":"uint256","nodeType":"ElementaryTypeName","src":"8067:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"8006:76:1"},"payable":false,"returnParameters":{"id":472,"nodeType":"ParameterList","parameters":[],"src":"8102:0:1"},"scope":963,"src":"7979:506:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":697,"nodeType":"Block","src":"9404:1349:1","statements":[{"assignments":[537],"declarations":[{"constant":false,"id":537,"name":"transactionHash","nodeType":"VariableDeclaration","scope":698,"src":"9414:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":536,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9414:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"id":545,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":539,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"9459:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":540,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":514,"src":"9463:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":541,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":516,"src":"9470:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":542,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":518,"src":"9476:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":543,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"9487:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":538,"name":"getTransactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":852,"src":"9440:18:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation,uint256) view returns (bytes32)"}},"id":544,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9440:53:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"9414:79:1"},{"assignments":[547],"declarations":[{"constant":false,"id":547,"name":"lastOwner","nodeType":"VariableDeclaration","scope":698,"src":"9555:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":546,"name":"address","nodeType":"ElementaryTypeName","src":"9555:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":551,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"30","id":549,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9583:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":548,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"9575:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":550,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9575:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"VariableDeclarationStatement","src":"9555:30:1"},{"assignments":[],"declarations":[{"constant":false,"id":553,"name":"currentOwner","nodeType":"VariableDeclaration","scope":698,"src":"9595:20:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":552,"name":"address","nodeType":"ElementaryTypeName","src":"9595:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":554,"initialValue":null,"nodeType":"VariableDeclarationStatement","src":"9595:20:1"},{"assignments":[],"declarations":[{"constant":false,"id":556,"name":"i","nodeType":"VariableDeclaration","scope":698,"src":"9625:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":555,"name":"uint256","nodeType":"ElementaryTypeName","src":"9625:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":557,"initialValue":null,"nodeType":"VariableDeclarationStatement","src":"9625:9:1"},{"assignments":[559],"declarations":[{"constant":false,"id":559,"name":"j","nodeType":"VariableDeclaration","scope":698,"src":"9644:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":558,"name":"uint256","nodeType":"ElementaryTypeName","src":"9644:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":561,"initialValue":{"argumentTypes":null,"hexValue":"30","id":560,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9656:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"9644:13:1"},{"body":{"id":648,"nodeType":"Block","src":"9741:619:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":581,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":575,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":572,"name":"indices","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":533,"src":"9843:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"}},"id":573,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"9843:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"id":574,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9860:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9843:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"&&","rightExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":580,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":576,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9865:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":577,"name":"indices","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":533,"src":"9870:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"}},"id":579,"indexExpression":{"argumentTypes":null,"id":578,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9878:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9870:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9865:15:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"9843:37:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"expression":{"argumentTypes":null,"id":629,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":610,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10155:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":612,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"10180:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":613,"name":"v","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":521,"src":"10197:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_memory_ptr","typeString":"uint8[] memory"}},"id":617,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":616,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":614,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10199:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":615,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10201:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10199:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10197:6:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":618,"name":"r","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":524,"src":"10205:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"}},"id":622,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":621,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":619,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10207:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":620,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10209:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10207:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10205:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":623,"name":"s","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":527,"src":"10213:1:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"}},"id":627,"indexExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":626,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":624,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10215:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"argumentTypes":null,"id":625,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10217:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10215:3:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10213:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":611,"name":"ecrecover","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2082,"src":"10170:9:1","typeDescriptions":{"typeIdentifier":"t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32,uint8,bytes32,bytes32) pure returns (address)"}},"id":628,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10170:50:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10155:65:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":630,"nodeType":"ExpressionStatement","src":"10155:65:1"},"id":631,"nodeType":"IfStatement","src":"9839:381:1","trueBody":{"id":609,"nodeType":"Block","src":"9882:177:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":596,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":588,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":583,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"9908:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":584,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"9908:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":585,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"9922:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":587,"indexExpression":{"argumentTypes":null,"id":586,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9930:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9922:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"9908:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"||","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":589,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"9936:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":593,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":590,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"9948:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":592,"indexExpression":{"argumentTypes":null,"id":591,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"9956:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9948:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9936:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":595,"indexExpression":{"argumentTypes":null,"id":594,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"9960:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"9936:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"9908:68:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":582,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"9900:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":597,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9900:77:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":598,"nodeType":"ExpressionStatement","src":"9900:77:1"},{"expression":{"argumentTypes":null,"id":603,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":599,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"9995:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":600,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10010:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":602,"indexExpression":{"argumentTypes":null,"id":601,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10018:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10010:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"9995:25:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":604,"nodeType":"ExpressionStatement","src":"9995:25:1"},{"expression":{"argumentTypes":null,"id":607,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":605,"name":"j","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":559,"src":"10038:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"hexValue":"31","id":606,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10043:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"10038:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":608,"nodeType":"ExpressionStatement","src":"10038:6:1"}]}},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":633,"name":"isOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":47,"src":"10242:7:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":635,"indexExpression":{"argumentTypes":null,"id":634,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10250:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10242:21:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":632,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"10234:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":636,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10234:30:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":637,"nodeType":"ExpressionStatement","src":"10234:30:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":641,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":639,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10286:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"id":640,"name":"lastOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":547,"src":"10301:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10286:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":638,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"10278:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":642,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10278:33:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":643,"nodeType":"ExpressionStatement","src":"10278:33:1"},{"expression":{"argumentTypes":null,"id":646,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":644,"name":"lastOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":547,"src":"10325:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":645,"name":"currentOwner","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":553,"src":"10337:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10325:24:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":647,"nodeType":"ExpressionStatement","src":"10325:24:1"}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":568,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":566,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9721:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"id":567,"name":"threshold","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"9725:9:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"9721:13:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":649,"initializationExpression":{"expression":{"argumentTypes":null,"id":564,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":562,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9714:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":563,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9718:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"9714:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":565,"nodeType":"ExpressionStatement","src":"9714:5:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":570,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"9736:3:1","subExpression":{"argumentTypes":null,"id":569,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"9736:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":571,"nodeType":"ExpressionStatement","src":"9736:3:1"},"nodeType":"ForStatement","src":"9709:651:1"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":653,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":650,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10419:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":651,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10419:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"argumentTypes":null,"hexValue":"30","id":652,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10436:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"10419:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":685,"nodeType":"IfStatement","src":"10415:216:1","trueBody":{"id":684,"nodeType":"Block","src":"10439:192:1","statements":[{"body":{"id":682,"nodeType":"Block","src":"10490:131:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":670,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":665,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"10512:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":666,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10512:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":667,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10526:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":669,"indexExpression":{"argumentTypes":null,"id":668,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10534:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10526:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"10512:24:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":681,"nodeType":"IfStatement","src":"10508:98:1","trueBody":{"expression":{"argumentTypes":null,"id":679,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":671,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"10558:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":676,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":672,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10570:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":674,"indexExpression":{"argumentTypes":null,"id":673,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10578:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10570:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"10558:23:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":677,"indexExpression":{"argumentTypes":null,"id":675,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":537,"src":"10582:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"10558:40:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"66616c7365","id":678,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"10601:5:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"10558:48:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":680,"nodeType":"ExpressionStatement","src":"10558:48:1"}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":661,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":658,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10465:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":659,"name":"_owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":530,"src":"10469:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":660,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"10469:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"10465:18:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":683,"initializationExpression":{"expression":{"argumentTypes":null,"id":656,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":654,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10458:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":655,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10462:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"10458:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":657,"nodeType":"ExpressionStatement","src":"10458:5:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":663,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"10485:3:1","subExpression":{"argumentTypes":null,"id":662,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"10485:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":664,"nodeType":"ExpressionStatement","src":"10485:3:1"},"nodeType":"ForStatement","src":"10453:168:1"}]}},{"expression":{"argumentTypes":null,"id":688,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":686,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":37,"src":"10691:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"hexValue":"31","id":687,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"10700:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"10691:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":689,"nodeType":"ExpressionStatement","src":"10691:10:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":691,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"10719:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":692,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":514,"src":"10723:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":693,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":516,"src":"10730:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":694,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":518,"src":"10736:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"id":690,"name":"execute","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":791,"src":"10711:7:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$__$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation)"}},"id":695,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10711:35:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":696,"nodeType":"ExpressionStatement","src":"10711:35:1"}]},"id":698,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeTransaction","nodeType":"FunctionDefinition","parameters":{"id":534,"nodeType":"ParameterList","parameters":[{"constant":false,"id":512,"name":"to","nodeType":"VariableDeclaration","scope":698,"src":"9250:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":511,"name":"address","nodeType":"ElementaryTypeName","src":"9250:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":514,"name":"value","nodeType":"VariableDeclaration","scope":698,"src":"9262:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":513,"name":"uint256","nodeType":"ElementaryTypeName","src":"9262:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":516,"name":"data","nodeType":"VariableDeclaration","scope":698,"src":"9277:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":515,"name":"bytes","nodeType":"ElementaryTypeName","src":"9277:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":518,"name":"operation","nodeType":"VariableDeclaration","scope":698,"src":"9289:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":517,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"9289:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":521,"name":"v","nodeType":"VariableDeclaration","scope":698,"src":"9310:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_memory_ptr","typeString":"uint8[] memory"},"typeName":{"baseType":{"id":519,"name":"uint8","nodeType":"ElementaryTypeName","src":"9310:5:1","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"id":520,"length":null,"nodeType":"ArrayTypeName","src":"9310:7:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint8_$dyn_storage_ptr","typeString":"uint8[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":524,"name":"r","nodeType":"VariableDeclaration","scope":698,"src":"9321:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"},"typeName":{"baseType":{"id":522,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9321:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":523,"length":null,"nodeType":"ArrayTypeName","src":"9321:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_storage_ptr","typeString":"bytes32[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":527,"name":"s","nodeType":"VariableDeclaration","scope":698,"src":"9334:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_memory_ptr","typeString":"bytes32[] memory"},"typeName":{"baseType":{"id":525,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9334:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":526,"length":null,"nodeType":"ArrayTypeName","src":"9334:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_bytes32_$dyn_storage_ptr","typeString":"bytes32[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":530,"name":"_owners","nodeType":"VariableDeclaration","scope":698,"src":"9347:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":528,"name":"address","nodeType":"ElementaryTypeName","src":"9347:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":529,"length":null,"nodeType":"ArrayTypeName","src":"9347:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":533,"name":"indices","nodeType":"VariableDeclaration","scope":698,"src":"9366:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_memory_ptr","typeString":"uint256[] memory"},"typeName":{"baseType":{"id":531,"name":"uint256","nodeType":"ElementaryTypeName","src":"9366:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":532,"length":null,"nodeType":"ArrayTypeName","src":"9366:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_storage_ptr","typeString":"uint256[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"9249:135:1"},"payable":false,"returnParameters":{"id":535,"nodeType":"ParameterList","parameters":[],"src":"9404:0:1"},"scope":963,"src":"9222:1531:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":736,"nodeType":"Block","src":"11304:338:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":712,"name":"isExtension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":51,"src":"11374:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":714,"indexExpression":{"argumentTypes":null,"id":713,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":708,"src":"11386:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"11374:22:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":711,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11366:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":715,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11366:31:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":716,"nodeType":"ExpressionStatement","src":"11366:31:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":720,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2089,"src":"11487:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":721,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11487:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":722,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":700,"src":"11499:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":723,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":702,"src":"11503:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":724,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":704,"src":"11510:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":725,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":706,"src":"11516:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"expression":{"argumentTypes":null,"id":718,"name":"extension","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":708,"src":"11464:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":719,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"isExecutable","nodeType":"MemberAccess","referencedDeclaration":17,"src":"11464:22:1","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$_t_bool_$","typeString":"function (address,address,uint256,bytes memory,enum GnosisSafe.Operation) external returns (bool)"}},"id":726,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11464:62:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":717,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11456:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":727,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11456:71:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":728,"nodeType":"ExpressionStatement","src":"11456:71:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":730,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":700,"src":"11608:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":731,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":702,"src":"11612:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":732,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":704,"src":"11619:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":733,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":706,"src":"11625:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}],"id":729,"name":"execute","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":791,"src":"11600:7:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$61_$returns$__$","typeString":"function (address,uint256,bytes memory,enum GnosisSafe.Operation)"}},"id":734,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11600:35:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":735,"nodeType":"ExpressionStatement","src":"11600:35:1"}]},"id":737,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeExtension","nodeType":"FunctionDefinition","parameters":{"id":709,"nodeType":"ParameterList","parameters":[{"constant":false,"id":700,"name":"to","nodeType":"VariableDeclaration","scope":737,"src":"11204:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":699,"name":"address","nodeType":"ElementaryTypeName","src":"11204:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":702,"name":"value","nodeType":"VariableDeclaration","scope":737,"src":"11216:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":701,"name":"uint256","nodeType":"ElementaryTypeName","src":"11216:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":704,"name":"data","nodeType":"VariableDeclaration","scope":737,"src":"11231:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":703,"name":"bytes","nodeType":"ElementaryTypeName","src":"11231:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":706,"name":"operation","nodeType":"VariableDeclaration","scope":737,"src":"11243:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":705,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"11243:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":708,"name":"extension","nodeType":"VariableDeclaration","scope":737,"src":"11264:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"},"typeName":{"contractScope":null,"id":707,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"11264:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"value":null,"visibility":"internal"}],"src":"11203:81:1"},"payable":false,"returnParameters":{"id":710,"nodeType":"ParameterList","parameters":[],"src":"11304:0:1"},"scope":963,"src":"11178:464:1","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":790,"nodeType":"Block","src":"11746:367:1","statements":[{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"id":751,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":748,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":745,"src":"11760:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":749,"name":"Operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":61,"src":"11773:9:1","typeDescriptions":{"typeIdentifier":"t_type$_t_enum$_Operation_$61_$","typeString":"type(enum GnosisSafe.Operation)"}},"id":750,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"Call","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11773:14:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"src":"11760:27:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"id":763,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":760,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":745,"src":"11857:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":761,"name":"Operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":61,"src":"11870:9:1","typeDescriptions":{"typeIdentifier":"t_type$_t_enum$_Operation_$61_$","typeString":"type(enum GnosisSafe.Operation)"}},"id":762,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"DelegateCall","nodeType":"MemberAccess","referencedDeclaration":null,"src":"11870:22:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"src":"11857:35:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":787,"nodeType":"Block","src":"11959:148:1","statements":[{"assignments":[772],"declarations":[{"constant":false,"id":772,"name":"newContract","nodeType":"VariableDeclaration","scope":791,"src":"11973:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":771,"name":"address","nodeType":"ElementaryTypeName","src":"11973:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"id":776,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":774,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"12009:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":773,"name":"executeCreate","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":824,"src":"11995:13:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes_memory_ptr_$returns$_t_address_$","typeString":"function (bytes memory) returns (address)"}},"id":775,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11995:19:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"VariableDeclarationStatement","src":"11973:41:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":780,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":778,"name":"newContract","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":772,"src":"12036:11:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"hexValue":"30","id":779,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"12051:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"12036:16:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":777,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"12028:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":781,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12028:25:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":782,"nodeType":"ExpressionStatement","src":"12028:25:1"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":784,"name":"newContract","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":772,"src":"12084:11:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":783,"name":"ContractCreation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":25,"src":"12067:16:1","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$returns$__$","typeString":"function (address)"}},"id":785,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12067:29:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":786,"nodeType":"ExpressionStatement","src":"12067:29:1"}]},"id":788,"nodeType":"IfStatement","src":"11853:254:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":766,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":739,"src":"11934:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":767,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"11938:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":765,"name":"executeDelegateCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":815,"src":"11914:19:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,bytes memory) returns (bool)"}},"id":768,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11914:29:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":764,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11906:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":769,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11906:38:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":770,"nodeType":"ExpressionStatement","src":"11906:38:1"}},"id":789,"nodeType":"IfStatement","src":"11756:351:1","trueBody":{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":754,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":739,"src":"11821:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":755,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":741,"src":"11825:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":756,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"11832:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":753,"name":"executeCall","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":804,"src":"11809:11:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,uint256,bytes memory) returns (bool)"}},"id":757,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11809:28:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":752,"name":"require","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2092,"src":"11801:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":758,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11801:37:1","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":759,"nodeType":"ExpressionStatement","src":"11801:37:1"}}]},"id":791,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"execute","nodeType":"FunctionDefinition","parameters":{"id":746,"nodeType":"ParameterList","parameters":[{"constant":false,"id":739,"name":"to","nodeType":"VariableDeclaration","scope":791,"src":"11665:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":738,"name":"address","nodeType":"ElementaryTypeName","src":"11665:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":741,"name":"value","nodeType":"VariableDeclaration","scope":791,"src":"11677:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":740,"name":"uint256","nodeType":"ElementaryTypeName","src":"11677:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":743,"name":"data","nodeType":"VariableDeclaration","scope":791,"src":"11692:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":742,"name":"bytes","nodeType":"ElementaryTypeName","src":"11692:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":745,"name":"operation","nodeType":"VariableDeclaration","scope":791,"src":"11704:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":744,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"11704:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"}],"src":"11664:60:1"},"payable":false,"returnParameters":{"id":747,"nodeType":"ParameterList","parameters":[],"src":"11746:0:1"},"scope":963,"src":"11648:465:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":803,"nodeType":"Block","src":"12231:119:1","statements":[{"externalReferences":[{"data":{"declaration":797,"isOffset":false,"isSlot":false,"src":"12303:4:1","valueSize":1}},{"data":{"declaration":797,"isOffset":false,"isSlot":false,"src":"12322:4:1","valueSize":1}},{"success":{"declaration":800,"isOffset":false,"isSlot":false,"src":"12264:7:1","valueSize":1}},{"to":{"declaration":793,"isOffset":false,"isSlot":false,"src":"12288:2:1","valueSize":1}},{"value":{"declaration":795,"isOffset":false,"isSlot":false,"src":"12292:5:1","valueSize":1}}],"id":802,"nodeType":"InlineAssembly","operations":"{\n success := call(not(0), to, value, add(data, 0x20), mload(data), 0, 0)\n}","src":"12241:109:1"}]},"id":804,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeCall","nodeType":"FunctionDefinition","parameters":{"id":798,"nodeType":"ParameterList","parameters":[{"constant":false,"id":793,"name":"to","nodeType":"VariableDeclaration","scope":804,"src":"12140:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":792,"name":"address","nodeType":"ElementaryTypeName","src":"12140:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":795,"name":"value","nodeType":"VariableDeclaration","scope":804,"src":"12152:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":794,"name":"uint256","nodeType":"ElementaryTypeName","src":"12152:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":797,"name":"data","nodeType":"VariableDeclaration","scope":804,"src":"12167:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":796,"name":"bytes","nodeType":"ElementaryTypeName","src":"12167:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12139:39:1"},"payable":false,"returnParameters":{"id":801,"nodeType":"ParameterList","parameters":[{"constant":false,"id":800,"name":"success","nodeType":"VariableDeclaration","scope":804,"src":"12213:12:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":799,"name":"bool","nodeType":"ElementaryTypeName","src":"12213:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"12212:14:1"},"scope":963,"src":"12119:231:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":814,"nodeType":"Block","src":"12461:120:1","statements":[{"externalReferences":[{"data":{"declaration":808,"isOffset":false,"isSlot":false,"src":"12534:4:1","valueSize":1}},{"data":{"declaration":808,"isOffset":false,"isSlot":false,"src":"12553:4:1","valueSize":1}},{"success":{"declaration":811,"isOffset":false,"isSlot":false,"src":"12494:7:1","valueSize":1}},{"to":{"declaration":806,"isOffset":false,"isSlot":false,"src":"12526:2:1","valueSize":1}}],"id":813,"nodeType":"InlineAssembly","operations":"{\n success := delegatecall(not(0), to, add(data, 0x20), mload(data), 0, 0)\n}","src":"12471:110:1"}]},"id":815,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeDelegateCall","nodeType":"FunctionDefinition","parameters":{"id":809,"nodeType":"ParameterList","parameters":[{"constant":false,"id":806,"name":"to","nodeType":"VariableDeclaration","scope":815,"src":"12385:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":805,"name":"address","nodeType":"ElementaryTypeName","src":"12385:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":808,"name":"data","nodeType":"VariableDeclaration","scope":815,"src":"12397:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":807,"name":"bytes","nodeType":"ElementaryTypeName","src":"12397:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12384:24:1"},"payable":false,"returnParameters":{"id":812,"nodeType":"ParameterList","parameters":[{"constant":false,"id":811,"name":"success","nodeType":"VariableDeclaration","scope":815,"src":"12443:12:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":810,"name":"bool","nodeType":"ElementaryTypeName","src":"12443:4:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"12442:14:1"},"scope":963,"src":"12356:225:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":823,"nodeType":"Block","src":"12681:103:1","statements":[{"externalReferences":[{"data":{"declaration":817,"isOffset":false,"isSlot":false,"src":"12762:4:1","valueSize":1}},{"newContract":{"declaration":820,"isOffset":false,"isSlot":false,"src":"12714:11:1","valueSize":1}},{"data":{"declaration":817,"isOffset":false,"isSlot":false,"src":"12743:4:1","valueSize":1}}],"id":822,"nodeType":"InlineAssembly","operations":"{\n newContract := create(0, add(data, 0x20), mload(data))\n}","src":"12691:93:1"}]},"id":824,"implemented":true,"isConstructor":false,"isDeclaredConst":false,"modifiers":[],"name":"executeCreate","nodeType":"FunctionDefinition","parameters":{"id":818,"nodeType":"ParameterList","parameters":[{"constant":false,"id":817,"name":"data","nodeType":"VariableDeclaration","scope":824,"src":"12610:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":816,"name":"bytes","nodeType":"ElementaryTypeName","src":"12610:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"}],"src":"12609:12:1"},"payable":false,"returnParameters":{"id":821,"nodeType":"ParameterList","parameters":[{"constant":false,"id":820,"name":"newContract","nodeType":"VariableDeclaration","scope":824,"src":"12656:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":819,"name":"address","nodeType":"ElementaryTypeName","src":"12656:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"12655:21:1"},"scope":963,"src":"12587:197:1","stateMutability":"nonpayable","superFunction":null,"visibility":"internal"},{"body":{"id":851,"nodeType":"Block","src":"13238:87:1","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"30783139","id":841,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"13270:4:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_25_by_1","typeString":"int_const 25"},"value":"0x19"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_25_by_1","typeString":"int_const 25"}],"id":840,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"13265:4:1","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes1_$","typeString":"type(bytes1)"},"typeName":"byte"},"id":842,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"13265:10:1","typeDescriptions":{"typeIdentifier":"t_bytes1","typeString":"bytes1"}},{"argumentTypes":null,"id":843,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"13277:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"}},{"argumentTypes":null,"id":844,"name":"to","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":826,"src":"13283:2:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":845,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":828,"src":"13287:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"id":846,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":830,"src":"13294:4:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"argumentTypes":null,"id":847,"name":"operation","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":832,"src":"13300:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},{"argumentTypes":null,"id":848,"name":"_nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":834,"src":"13311:6:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes1","typeString":"bytes1"},{"typeIdentifier":"t_contract$_GnosisSafe_$963","typeString":"contract GnosisSafe"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":839,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2083,"src":"13255:9:1","typeDescriptions":{"typeIdentifier":"t_function_sha3_pure$__$returns$_t_bytes32_$","typeString":"function () pure returns (bytes32)"}},"id":849,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"13255:63:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":838,"id":850,"nodeType":"Return","src":"13248:70:1"}]},"id":852,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getTransactionHash","nodeType":"FunctionDefinition","parameters":{"id":835,"nodeType":"ParameterList","parameters":[{"constant":false,"id":826,"name":"to","nodeType":"VariableDeclaration","scope":852,"src":"13104:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":825,"name":"address","nodeType":"ElementaryTypeName","src":"13104:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":828,"name":"value","nodeType":"VariableDeclaration","scope":852,"src":"13116:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":827,"name":"uint256","nodeType":"ElementaryTypeName","src":"13116:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":830,"name":"data","nodeType":"VariableDeclaration","scope":852,"src":"13131:10:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},"typeName":{"id":829,"name":"bytes","nodeType":"ElementaryTypeName","src":"13131:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes storage pointer"}},"value":null,"visibility":"internal"},{"constant":false,"id":832,"name":"operation","nodeType":"VariableDeclaration","scope":852,"src":"13143:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"},"typeName":{"contractScope":null,"id":831,"name":"Operation","nodeType":"UserDefinedTypeName","referencedDeclaration":61,"src":"13143:9:1","typeDescriptions":{"typeIdentifier":"t_enum$_Operation_$61","typeString":"enum GnosisSafe.Operation"}},"value":null,"visibility":"internal"},{"constant":false,"id":834,"name":"_nonce","nodeType":"VariableDeclaration","scope":852,"src":"13164:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":833,"name":"uint256","nodeType":"ElementaryTypeName","src":"13164:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"13103:76:1"},"payable":false,"returnParameters":{"id":838,"nodeType":"ParameterList","parameters":[{"constant":false,"id":837,"name":"","nodeType":"VariableDeclaration","scope":852,"src":"13225:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":836,"name":"bytes32","nodeType":"ElementaryTypeName","src":"13225:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"13224:9:1"},"scope":963,"src":"13076:249:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":860,"nodeType":"Block","src":"13488:30:1","statements":[{"expression":{"argumentTypes":null,"id":858,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"13505:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"functionReturnParameters":857,"id":859,"nodeType":"Return","src":"13498:13:1"}]},"id":861,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getOwners","nodeType":"FunctionDefinition","parameters":{"id":853,"nodeType":"ParameterList","parameters":[],"src":"13425:2:1"},"payable":false,"returnParameters":{"id":857,"nodeType":"ParameterList","parameters":[{"constant":false,"id":856,"name":"","nodeType":"VariableDeclaration","scope":861,"src":"13473:9:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":854,"name":"address","nodeType":"ElementaryTypeName","src":"13473:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":855,"length":null,"nodeType":"ArrayTypeName","src":"13473:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"13472:11:1"},"scope":963,"src":"13407:111:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":869,"nodeType":"Block","src":"13690:34:1","statements":[{"expression":{"argumentTypes":null,"id":867,"name":"extensions","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":43,"src":"13707:10:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage","typeString":"contract Extension[] storage ref"}},"functionReturnParameters":866,"id":868,"nodeType":"Return","src":"13700:17:1"}]},"id":870,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getExtensions","nodeType":"FunctionDefinition","parameters":{"id":862,"nodeType":"ParameterList","parameters":[],"src":"13625:2:1"},"payable":false,"returnParameters":{"id":866,"nodeType":"ParameterList","parameters":[{"constant":false,"id":865,"name":"","nodeType":"VariableDeclaration","scope":870,"src":"13673:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_memory_ptr","typeString":"contract Extension[] memory"},"typeName":{"baseType":{"contractScope":null,"id":863,"name":"Extension","nodeType":"UserDefinedTypeName","referencedDeclaration":18,"src":"13673:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_Extension_$18","typeString":"contract Extension"}},"id":864,"length":null,"nodeType":"ArrayTypeName","src":"13673:11:1","typeDescriptions":{"typeIdentifier":"t_array$_t_contract$_Extension_$18_$dyn_storage_ptr","typeString":"contract Extension[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"13672:13:1"},"scope":963,"src":"13603:121:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":901,"nodeType":"Block","src":"13998:162:1","statements":[{"body":{"id":899,"nodeType":"Block","src":"14049:105:1","statements":[{"condition":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":888,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"14067:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":892,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":889,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14079:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":891,"indexExpression":{"argumentTypes":null,"id":890,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14086:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14079:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14067:22:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":894,"indexExpression":{"argumentTypes":null,"id":893,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":872,"src":"14090:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14067:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":898,"nodeType":"IfStatement","src":"14063:80:1","trueBody":{"expression":{"argumentTypes":null,"id":896,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14124:19:1","subExpression":{"argumentTypes":null,"id":895,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":875,"src":"14124:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":897,"nodeType":"ExpressionStatement","src":"14124:19:1"}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":884,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":881,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14025:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":882,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14029:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":883,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"14029:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"14025:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":900,"initializationExpression":{"assignments":[878],"declarations":[{"constant":false,"id":878,"name":"i","nodeType":"VariableDeclaration","scope":902,"src":"14013:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":877,"name":"uint","nodeType":"ElementaryTypeName","src":"14013:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":880,"initialValue":{"argumentTypes":null,"hexValue":"30","id":879,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14022:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"14013:10:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":886,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14044:3:1","subExpression":{"argumentTypes":null,"id":885,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":878,"src":"14044:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":887,"nodeType":"ExpressionStatement","src":"14044:3:1"},"nodeType":"ForStatement","src":"14008:146:1"}]},"id":902,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getConfirmationCount","nodeType":"FunctionDefinition","parameters":{"id":873,"nodeType":"ParameterList","parameters":[{"constant":false,"id":872,"name":"transactionHash","nodeType":"VariableDeclaration","scope":902,"src":"13900:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":871,"name":"bytes32","nodeType":"ElementaryTypeName","src":"13900:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"13899:25:1"},"payable":false,"returnParameters":{"id":876,"nodeType":"ParameterList","parameters":[{"constant":false,"id":875,"name":"confirmationCount","nodeType":"VariableDeclaration","scope":902,"src":"13970:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":874,"name":"uint","nodeType":"ElementaryTypeName","src":"13970:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"13969:24:1"},"scope":963,"src":"13870:290:1","stateMutability":"view","superFunction":null,"visibility":"public"},{"body":{"id":961,"nodeType":"Block","src":"14432:407:1","statements":[{"assignments":[911],"declarations":[{"constant":false,"id":911,"name":"confirmationCount","nodeType":"VariableDeclaration","scope":962,"src":"14442:22:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":910,"name":"uint","nodeType":"ElementaryTypeName","src":"14442:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":915,"initialValue":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":913,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":904,"src":"14488:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":912,"name":"getConfirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":902,"src":"14467:20:1","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$returns$_t_uint256_$","typeString":"function (bytes32) view returns (uint256)"}},"id":914,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"14467:37:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"14442:62:1"},{"expression":{"argumentTypes":null,"id":922,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":916,"name":"confirmingOwners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":908,"src":"14514:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":920,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14547:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":919,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"NewExpression","src":"14533:13:1","typeDescriptions":{"typeIdentifier":"t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_$","typeString":"function (uint256) pure returns (address[] memory)"},"typeName":{"baseType":{"id":917,"name":"address","nodeType":"ElementaryTypeName","src":"14537:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":918,"length":null,"nodeType":"ArrayTypeName","src":"14537:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}}},"id":921,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"14533:32:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory","typeString":"address[] memory"}},"src":"14514:51:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":923,"nodeType":"ExpressionStatement","src":"14514:51:1"},{"expression":{"argumentTypes":null,"id":926,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":924,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14575:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"hexValue":"30","id":925,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14595:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"14575:21:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":927,"nodeType":"ExpressionStatement","src":"14575:21:1"},{"body":{"id":959,"nodeType":"Block","src":"14647:186:1","statements":[{"condition":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":939,"name":"isConfirmed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":57,"src":"14665:11:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_bool_$_$","typeString":"mapping(address => mapping(bytes32 => bool))"}},"id":943,"indexExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":940,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14677:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":942,"indexExpression":{"argumentTypes":null,"id":941,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14684:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14677:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14665:22:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":945,"indexExpression":{"argumentTypes":null,"id":944,"name":"transactionHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":904,"src":"14688:15:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14665:39:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":958,"nodeType":"IfStatement","src":"14661:162:1","trueBody":{"id":957,"nodeType":"Block","src":"14706:117:1","statements":[{"expression":{"argumentTypes":null,"id":952,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":946,"name":"confirmingOwners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":908,"src":"14724:16:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"}},"id":948,"indexExpression":{"argumentTypes":null,"id":947,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14741:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"14724:35:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":949,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14762:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":951,"indexExpression":{"argumentTypes":null,"id":950,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14769:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"14762:9:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"14724:47:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":953,"nodeType":"ExpressionStatement","src":"14724:47:1"},{"expression":{"argumentTypes":null,"id":955,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14789:19:1","subExpression":{"argumentTypes":null,"id":954,"name":"confirmationCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":911,"src":"14789:17:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":956,"nodeType":"ExpressionStatement","src":"14789:19:1"}]}}]},"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":935,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":932,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14623:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":933,"name":"owners","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":40,"src":"14627:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage","typeString":"address[] storage ref"}},"id":934,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","referencedDeclaration":null,"src":"14627:13:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"14623:17:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":960,"initializationExpression":{"assignments":[929],"declarations":[{"constant":false,"id":929,"name":"i","nodeType":"VariableDeclaration","scope":962,"src":"14611:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":928,"name":"uint","nodeType":"ElementaryTypeName","src":"14611:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"id":931,"initialValue":{"argumentTypes":null,"hexValue":"30","id":930,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"14620:1:1","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"14611:10:1"},"loopExpression":{"expression":{"argumentTypes":null,"id":937,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"14642:3:1","subExpression":{"argumentTypes":null,"id":936,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":929,"src":"14642:1:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":938,"nodeType":"ExpressionStatement","src":"14642:3:1"},"nodeType":"ForStatement","src":"14606:227:1"}]},"id":962,"implemented":true,"isConstructor":false,"isDeclaredConst":true,"modifiers":[],"name":"getConfirmingOwners","nodeType":"FunctionDefinition","parameters":{"id":905,"nodeType":"ParameterList","parameters":[{"constant":false,"id":904,"name":"transactionHash","nodeType":"VariableDeclaration","scope":962,"src":"14330:23:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":903,"name":"bytes32","nodeType":"ElementaryTypeName","src":"14330:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":null,"visibility":"internal"}],"src":"14329:25:1"},"payable":false,"returnParameters":{"id":909,"nodeType":"ParameterList","parameters":[{"constant":false,"id":908,"name":"confirmingOwners","nodeType":"VariableDeclaration","scope":962,"src":"14400:26:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[] memory"},"typeName":{"baseType":{"id":906,"name":"address","nodeType":"ElementaryTypeName","src":"14400:7:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":907,"length":null,"nodeType":"ArrayTypeName","src":"14400:9:1","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[] storage pointer"}},"value":null,"visibility":"internal"}],"src":"14399:28:1"},"scope":963,"src":"14301:538:1","stateMutability":"view","superFunction":null,"visibility":"public"}],"scope":964,"src":"218:14623:1"}],"src":"0:14842:1"},"compiler":{"name":"solc","version":"0.4.19+commit.c4cbbb05.Emscripten.clang"},"networks":{},"schemaVersion":"2.0.0","updatedAt":"2018-03-06T07:55:49.248Z"}; - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1.js": -/*!******************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var asn1 = exports; - -asn1.bignum = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); - -asn1.define = __webpack_require__(/*! ./asn1/api */ "./node_modules/asn1.js/lib/asn1/api.js").define; -asn1.base = __webpack_require__(/*! ./asn1/base */ "./node_modules/asn1.js/lib/asn1/base/index.js"); -asn1.constants = __webpack_require__(/*! ./asn1/constants */ "./node_modules/asn1.js/lib/asn1/constants/index.js"); -asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ "./node_modules/asn1.js/lib/asn1/decoders/index.js"); -asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ "./node_modules/asn1.js/lib/asn1/encoders/index.js"); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/api.js": -/*!**********************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/api.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var asn1 = __webpack_require__(/*! ../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var api = exports; - -api.define = function define(name, body) { - return new Entity(name, body); -}; - -function Entity(name, body) { - this.name = name; - this.body = body; - - this.decoders = {}; - this.encoders = {}; -}; - -Entity.prototype._createNamed = function createNamed(base) { - var named; - try { - named = __webpack_require__(/*! vm */ "./node_modules/vm-browserify/index.js").runInThisContext( - '(function ' + this.name + '(entity) {\n' + - ' this._initNamed(entity);\n' + - '})' - ); - } catch (e) { - named = function (entity) { - this._initNamed(entity); - }; - } - inherits(named, base); - named.prototype._initNamed = function initnamed(entity) { - base.call(this, entity); - }; - - return new named(this); -}; - -Entity.prototype._getDecoder = function _getDecoder(enc) { - enc = enc || 'der'; - // Lazily create decoder - if (!this.decoders.hasOwnProperty(enc)) - this.decoders[enc] = this._createNamed(asn1.decoders[enc]); - return this.decoders[enc]; -}; - -Entity.prototype.decode = function decode(data, enc, options) { - return this._getDecoder(enc).decode(data, options); -}; - -Entity.prototype._getEncoder = function _getEncoder(enc) { - enc = enc || 'der'; - // Lazily create encoder - if (!this.encoders.hasOwnProperty(enc)) - this.encoders[enc] = this._createNamed(asn1.encoders[enc]); - return this.encoders[enc]; -}; - -Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { - return this._getEncoder(enc).encode(data, reporter); -}; - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/base/buffer.js": -/*!******************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Reporter = __webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").Reporter; -var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - -function DecoderBuffer(base, options) { - Reporter.call(this, options); - if (!Buffer.isBuffer(base)) { - this.error('Input not Buffer'); - return; - } - - this.base = base; - this.offset = 0; - this.length = base.length; -} -inherits(DecoderBuffer, Reporter); -exports.DecoderBuffer = DecoderBuffer; - -DecoderBuffer.prototype.save = function save() { - return { offset: this.offset, reporter: Reporter.prototype.save.call(this) }; -}; - -DecoderBuffer.prototype.restore = function restore(save) { - // Return skipped data - var res = new DecoderBuffer(this.base); - res.offset = save.offset; - res.length = this.offset; - - this.offset = save.offset; - Reporter.prototype.restore.call(this, save.reporter); - - return res; -}; - -DecoderBuffer.prototype.isEmpty = function isEmpty() { - return this.offset === this.length; -}; - -DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) { - if (this.offset + 1 <= this.length) - return this.base.readUInt8(this.offset++, true); - else - return this.error(fail || 'DecoderBuffer overrun'); -} - -DecoderBuffer.prototype.skip = function skip(bytes, fail) { - if (!(this.offset + bytes <= this.length)) - return this.error(fail || 'DecoderBuffer overrun'); - - var res = new DecoderBuffer(this.base); - - // Share reporter state - res._reporterState = this._reporterState; - - res.offset = this.offset; - res.length = this.offset + bytes; - this.offset += bytes; - return res; -} - -DecoderBuffer.prototype.raw = function raw(save) { - return this.base.slice(save ? save.offset : this.offset, this.length); -} - -function EncoderBuffer(value, reporter) { - if (Array.isArray(value)) { - this.length = 0; - this.value = value.map(function(item) { - if (!(item instanceof EncoderBuffer)) - item = new EncoderBuffer(item, reporter); - this.length += item.length; - return item; - }, this); - } else if (typeof value === 'number') { - if (!(0 <= value && value <= 0xff)) - return reporter.error('non-byte EncoderBuffer value'); - this.value = value; - this.length = 1; - } else if (typeof value === 'string') { - this.value = value; - this.length = Buffer.byteLength(value); - } else if (Buffer.isBuffer(value)) { - this.value = value; - this.length = value.length; - } else { - return reporter.error('Unsupported type: ' + typeof value); - } -} -exports.EncoderBuffer = EncoderBuffer; - -EncoderBuffer.prototype.join = function join(out, offset) { - if (!out) - out = new Buffer(this.length); - if (!offset) - offset = 0; - - if (this.length === 0) - return out; - - if (Array.isArray(this.value)) { - this.value.forEach(function(item) { - item.join(out, offset); - offset += item.length; - }); - } else { - if (typeof this.value === 'number') - out[offset] = this.value; - else if (typeof this.value === 'string') - out.write(this.value, offset); - else if (Buffer.isBuffer(this.value)) - this.value.copy(out, offset); - offset += this.length; - } - - return out; -}; - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/base/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var base = exports; - -base.Reporter = __webpack_require__(/*! ./reporter */ "./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter; -base.DecoderBuffer = __webpack_require__(/*! ./buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer; -base.EncoderBuffer = __webpack_require__(/*! ./buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").EncoderBuffer; -base.Node = __webpack_require__(/*! ./node */ "./node_modules/asn1.js/lib/asn1/base/node.js"); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/base/node.js": -/*!****************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Reporter = __webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").Reporter; -var EncoderBuffer = __webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").EncoderBuffer; -var DecoderBuffer = __webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").DecoderBuffer; -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -// Supported tags -var tags = [ - 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', - 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', - 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', - 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' -]; - -// Public methods list -var methods = [ - 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', - 'any', 'contains' -].concat(tags); - -// Overrided methods list -var overrided = [ - '_peekTag', '_decodeTag', '_use', - '_decodeStr', '_decodeObjid', '_decodeTime', - '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', - - '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', - '_encodeNull', '_encodeInt', '_encodeBool' -]; - -function Node(enc, parent) { - var state = {}; - this._baseState = state; - - state.enc = enc; - - state.parent = parent || null; - state.children = null; - - // State - state.tag = null; - state.args = null; - state.reverseArgs = null; - state.choice = null; - state.optional = false; - state.any = false; - state.obj = false; - state.use = null; - state.useDecoder = null; - state.key = null; - state['default'] = null; - state.explicit = null; - state.implicit = null; - state.contains = null; - - // Should create new instance on each method - if (!state.parent) { - state.children = []; - this._wrap(); - } -} -module.exports = Node; - -var stateProps = [ - 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', - 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', - 'implicit', 'contains' -]; - -Node.prototype.clone = function clone() { - var state = this._baseState; - var cstate = {}; - stateProps.forEach(function(prop) { - cstate[prop] = state[prop]; - }); - var res = new this.constructor(cstate.parent); - res._baseState = cstate; - return res; -}; - -Node.prototype._wrap = function wrap() { - var state = this._baseState; - methods.forEach(function(method) { - this[method] = function _wrappedMethod() { - var clone = new this.constructor(this); - state.children.push(clone); - return clone[method].apply(clone, arguments); - }; - }, this); -}; - -Node.prototype._init = function init(body) { - var state = this._baseState; - - assert(state.parent === null); - body.call(this); - - // Filter children - state.children = state.children.filter(function(child) { - return child._baseState.parent === this; - }, this); - assert.equal(state.children.length, 1, 'Root node can have only one child'); -}; - -Node.prototype._useArgs = function useArgs(args) { - var state = this._baseState; - - // Filter children and args - var children = args.filter(function(arg) { - return arg instanceof this.constructor; - }, this); - args = args.filter(function(arg) { - return !(arg instanceof this.constructor); - }, this); - - if (children.length !== 0) { - assert(state.children === null); - state.children = children; - - // Replace parent to maintain backward link - children.forEach(function(child) { - child._baseState.parent = this; - }, this); - } - if (args.length !== 0) { - assert(state.args === null); - state.args = args; - state.reverseArgs = args.map(function(arg) { - if (typeof arg !== 'object' || arg.constructor !== Object) - return arg; - - var res = {}; - Object.keys(arg).forEach(function(key) { - if (key == (key | 0)) - key |= 0; - var value = arg[key]; - res[value] = key; - }); - return res; - }); - } -}; - -// -// Overrided methods -// - -overrided.forEach(function(method) { - Node.prototype[method] = function _overrided() { - var state = this._baseState; - throw new Error(method + ' not implemented for encoding: ' + state.enc); - }; -}); - -// -// Public methods -// - -tags.forEach(function(tag) { - Node.prototype[tag] = function _tagMethod() { - var state = this._baseState; - var args = Array.prototype.slice.call(arguments); - - assert(state.tag === null); - state.tag = tag; - - this._useArgs(args); - - return this; - }; -}); - -Node.prototype.use = function use(item) { - assert(item); - var state = this._baseState; - - assert(state.use === null); - state.use = item; - - return this; -}; - -Node.prototype.optional = function optional() { - var state = this._baseState; - - state.optional = true; - - return this; -}; - -Node.prototype.def = function def(val) { - var state = this._baseState; - - assert(state['default'] === null); - state['default'] = val; - state.optional = true; - - return this; -}; - -Node.prototype.explicit = function explicit(num) { - var state = this._baseState; - - assert(state.explicit === null && state.implicit === null); - state.explicit = num; - - return this; -}; - -Node.prototype.implicit = function implicit(num) { - var state = this._baseState; - - assert(state.explicit === null && state.implicit === null); - state.implicit = num; - - return this; -}; - -Node.prototype.obj = function obj() { - var state = this._baseState; - var args = Array.prototype.slice.call(arguments); - - state.obj = true; - - if (args.length !== 0) - this._useArgs(args); - - return this; -}; - -Node.prototype.key = function key(newKey) { - var state = this._baseState; - - assert(state.key === null); - state.key = newKey; - - return this; -}; - -Node.prototype.any = function any() { - var state = this._baseState; - - state.any = true; - - return this; -}; - -Node.prototype.choice = function choice(obj) { - var state = this._baseState; - - assert(state.choice === null); - state.choice = obj; - this._useArgs(Object.keys(obj).map(function(key) { - return obj[key]; - })); - - return this; -}; - -Node.prototype.contains = function contains(item) { - var state = this._baseState; - - assert(state.use === null); - state.contains = item; - - return this; -}; - -// -// Decoding -// - -Node.prototype._decode = function decode(input, options) { - var state = this._baseState; - - // Decode root node - if (state.parent === null) - return input.wrapResult(state.children[0]._decode(input, options)); - - var result = state['default']; - var present = true; - - var prevKey = null; - if (state.key !== null) - prevKey = input.enterKey(state.key); - - // Check if tag is there - if (state.optional) { - var tag = null; - if (state.explicit !== null) - tag = state.explicit; - else if (state.implicit !== null) - tag = state.implicit; - else if (state.tag !== null) - tag = state.tag; - - if (tag === null && !state.any) { - // Trial and Error - var save = input.save(); - try { - if (state.choice === null) - this._decodeGeneric(state.tag, input, options); - else - this._decodeChoice(input, options); - present = true; - } catch (e) { - present = false; - } - input.restore(save); - } else { - present = this._peekTag(input, tag, state.any); - - if (input.isError(present)) - return present; - } - } - - // Push object on stack - var prevObj; - if (state.obj && present) - prevObj = input.enterObject(); - - if (present) { - // Unwrap explicit values - if (state.explicit !== null) { - var explicit = this._decodeTag(input, state.explicit); - if (input.isError(explicit)) - return explicit; - input = explicit; - } - - var start = input.offset; - - // Unwrap implicit and normal values - if (state.use === null && state.choice === null) { - if (state.any) - var save = input.save(); - var body = this._decodeTag( - input, - state.implicit !== null ? state.implicit : state.tag, - state.any - ); - if (input.isError(body)) - return body; - - if (state.any) - result = input.raw(save); - else - input = body; - } - - if (options && options.track && state.tag !== null) - options.track(input.path(), start, input.length, 'tagged'); - - if (options && options.track && state.tag !== null) - options.track(input.path(), input.offset, input.length, 'content'); - - // Select proper method for tag - if (state.any) - result = result; - else if (state.choice === null) - result = this._decodeGeneric(state.tag, input, options); - else - result = this._decodeChoice(input, options); - - if (input.isError(result)) - return result; - - // Decode children - if (!state.any && state.choice === null && state.children !== null) { - state.children.forEach(function decodeChildren(child) { - // NOTE: We are ignoring errors here, to let parser continue with other - // parts of encoded data - child._decode(input, options); - }); - } - - // Decode contained/encoded by schema, only in bit or octet strings - if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { - var data = new DecoderBuffer(result); - result = this._getUse(state.contains, input._reporterState.obj) - ._decode(data, options); - } - } - - // Pop object - if (state.obj && present) - result = input.leaveObject(prevObj); - - // Set key - if (state.key !== null && (result !== null || present === true)) - input.leaveKey(prevKey, state.key, result); - else if (prevKey !== null) - input.exitKey(prevKey); - - return result; -}; - -Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { - var state = this._baseState; - - if (tag === 'seq' || tag === 'set') - return null; - if (tag === 'seqof' || tag === 'setof') - return this._decodeList(input, tag, state.args[0], options); - else if (/str$/.test(tag)) - return this._decodeStr(input, tag, options); - else if (tag === 'objid' && state.args) - return this._decodeObjid(input, state.args[0], state.args[1], options); - else if (tag === 'objid') - return this._decodeObjid(input, null, null, options); - else if (tag === 'gentime' || tag === 'utctime') - return this._decodeTime(input, tag, options); - else if (tag === 'null_') - return this._decodeNull(input, options); - else if (tag === 'bool') - return this._decodeBool(input, options); - else if (tag === 'objDesc') - return this._decodeStr(input, tag, options); - else if (tag === 'int' || tag === 'enum') - return this._decodeInt(input, state.args && state.args[0], options); - - if (state.use !== null) { - return this._getUse(state.use, input._reporterState.obj) - ._decode(input, options); - } else { - return input.error('unknown tag: ' + tag); - } -}; - -Node.prototype._getUse = function _getUse(entity, obj) { - - var state = this._baseState; - // Create altered use decoder if implicit is set - state.useDecoder = this._use(entity, obj); - assert(state.useDecoder._baseState.parent === null); - state.useDecoder = state.useDecoder._baseState.children[0]; - if (state.implicit !== state.useDecoder._baseState.implicit) { - state.useDecoder = state.useDecoder.clone(); - state.useDecoder._baseState.implicit = state.implicit; - } - return state.useDecoder; -}; - -Node.prototype._decodeChoice = function decodeChoice(input, options) { - var state = this._baseState; - var result = null; - var match = false; - - Object.keys(state.choice).some(function(key) { - var save = input.save(); - var node = state.choice[key]; - try { - var value = node._decode(input, options); - if (input.isError(value)) - return false; - - result = { type: key, value: value }; - match = true; - } catch (e) { - input.restore(save); - return false; - } - return true; - }, this); - - if (!match) - return input.error('Choice not matched'); - - return result; -}; - -// -// Encoding -// - -Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { - return new EncoderBuffer(data, this.reporter); -}; - -Node.prototype._encode = function encode(data, reporter, parent) { - var state = this._baseState; - if (state['default'] !== null && state['default'] === data) - return; - - var result = this._encodeValue(data, reporter, parent); - if (result === undefined) - return; - - if (this._skipDefault(result, reporter, parent)) - return; - - return result; -}; - -Node.prototype._encodeValue = function encode(data, reporter, parent) { - var state = this._baseState; - - // Decode root node - if (state.parent === null) - return state.children[0]._encode(data, reporter || new Reporter()); - - var result = null; - - // Set reporter to share it with a child class - this.reporter = reporter; - - // Check if data is there - if (state.optional && data === undefined) { - if (state['default'] !== null) - data = state['default'] - else - return; - } - - // Encode children first - var content = null; - var primitive = false; - if (state.any) { - // Anything that was given is translated to buffer - result = this._createEncoderBuffer(data); - } else if (state.choice) { - result = this._encodeChoice(data, reporter); - } else if (state.contains) { - content = this._getUse(state.contains, parent)._encode(data, reporter); - primitive = true; - } else if (state.children) { - content = state.children.map(function(child) { - if (child._baseState.tag === 'null_') - return child._encode(null, reporter, data); - - if (child._baseState.key === null) - return reporter.error('Child should have a key'); - var prevKey = reporter.enterKey(child._baseState.key); - - if (typeof data !== 'object') - return reporter.error('Child expected, but input is not object'); - - var res = child._encode(data[child._baseState.key], reporter, data); - reporter.leaveKey(prevKey); - - return res; - }, this).filter(function(child) { - return child; - }); - content = this._createEncoderBuffer(content); - } else { - if (state.tag === 'seqof' || state.tag === 'setof') { - // TODO(indutny): this should be thrown on DSL level - if (!(state.args && state.args.length === 1)) - return reporter.error('Too many args for : ' + state.tag); - - if (!Array.isArray(data)) - return reporter.error('seqof/setof, but data is not Array'); - - var child = this.clone(); - child._baseState.implicit = null; - content = this._createEncoderBuffer(data.map(function(item) { - var state = this._baseState; - - return this._getUse(state.args[0], data)._encode(item, reporter); - }, child)); - } else if (state.use !== null) { - result = this._getUse(state.use, parent)._encode(data, reporter); - } else { - content = this._encodePrimitive(state.tag, data); - primitive = true; - } - } - - // Encode data itself - var result; - if (!state.any && state.choice === null) { - var tag = state.implicit !== null ? state.implicit : state.tag; - var cls = state.implicit === null ? 'universal' : 'context'; - - if (tag === null) { - if (state.use === null) - reporter.error('Tag could be omitted only for .use()'); - } else { - if (state.use === null) - result = this._encodeComposite(tag, primitive, cls, content); - } - } - - // Wrap in explicit - if (state.explicit !== null) - result = this._encodeComposite(state.explicit, false, 'context', result); - - return result; -}; - -Node.prototype._encodeChoice = function encodeChoice(data, reporter) { - var state = this._baseState; - - var node = state.choice[data.type]; - if (!node) { - assert( - false, - data.type + ' not found in ' + - JSON.stringify(Object.keys(state.choice))); - } - return node._encode(data.value, reporter); -}; - -Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { - var state = this._baseState; - - if (/str$/.test(tag)) - return this._encodeStr(data, tag); - else if (tag === 'objid' && state.args) - return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); - else if (tag === 'objid') - return this._encodeObjid(data, null, null); - else if (tag === 'gentime' || tag === 'utctime') - return this._encodeTime(data, tag); - else if (tag === 'null_') - return this._encodeNull(); - else if (tag === 'int' || tag === 'enum') - return this._encodeInt(data, state.args && state.reverseArgs[0]); - else if (tag === 'bool') - return this._encodeBool(data); - else if (tag === 'objDesc') - return this._encodeStr(data, tag); - else - throw new Error('Unsupported tag: ' + tag); -}; - -Node.prototype._isNumstr = function isNumstr(str) { - return /^[0-9 ]*$/.test(str); -}; - -Node.prototype._isPrintstr = function isPrintstr(str) { - return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); -}; - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/base/reporter.js": -/*!********************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -function Reporter(options) { - this._reporterState = { - obj: null, - path: [], - options: options || {}, - errors: [] - }; -} -exports.Reporter = Reporter; - -Reporter.prototype.isError = function isError(obj) { - return obj instanceof ReporterError; -}; - -Reporter.prototype.save = function save() { - var state = this._reporterState; - - return { obj: state.obj, pathLen: state.path.length }; -}; - -Reporter.prototype.restore = function restore(data) { - var state = this._reporterState; - - state.obj = data.obj; - state.path = state.path.slice(0, data.pathLen); -}; - -Reporter.prototype.enterKey = function enterKey(key) { - return this._reporterState.path.push(key); -}; - -Reporter.prototype.exitKey = function exitKey(index) { - var state = this._reporterState; - - state.path = state.path.slice(0, index - 1); -}; - -Reporter.prototype.leaveKey = function leaveKey(index, key, value) { - var state = this._reporterState; - - this.exitKey(index); - if (state.obj !== null) - state.obj[key] = value; -}; - -Reporter.prototype.path = function path() { - return this._reporterState.path.join('/'); -}; - -Reporter.prototype.enterObject = function enterObject() { - var state = this._reporterState; - - var prev = state.obj; - state.obj = {}; - return prev; -}; - -Reporter.prototype.leaveObject = function leaveObject(prev) { - var state = this._reporterState; - - var now = state.obj; - state.obj = prev; - return now; -}; - -Reporter.prototype.error = function error(msg) { - var err; - var state = this._reporterState; - - var inherited = msg instanceof ReporterError; - if (inherited) { - err = msg; - } else { - err = new ReporterError(state.path.map(function(elem) { - return '[' + JSON.stringify(elem) + ']'; - }).join(''), msg.message || msg, msg.stack); - } - - if (!state.options.partial) - throw err; - - if (!inherited) - state.errors.push(err); - - return err; -}; - -Reporter.prototype.wrapResult = function wrapResult(result) { - var state = this._reporterState; - if (!state.options.partial) - return result; - - return { - result: this.isError(result) ? null : result, - errors: state.errors - }; -}; - -function ReporterError(path, msg) { - this.path = path; - this.rethrow(msg); -}; -inherits(ReporterError, Error); - -ReporterError.prototype.rethrow = function rethrow(msg) { - this.message = msg + ' at: ' + (this.path || '(shallow)'); - if (Error.captureStackTrace) - Error.captureStackTrace(this, ReporterError); - - if (!this.stack) { - try { - // IE only adds stack when thrown - throw new Error(this.message); - } catch (e) { - this.stack = e.stack; - } - } - return this; -}; - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/constants/der.js": -/*!********************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var constants = __webpack_require__(/*! ../constants */ "./node_modules/asn1.js/lib/asn1/constants/index.js"); - -exports.tagClass = { - 0: 'universal', - 1: 'application', - 2: 'context', - 3: 'private' -}; -exports.tagClassByName = constants._reverse(exports.tagClass); - -exports.tag = { - 0x00: 'end', - 0x01: 'bool', - 0x02: 'int', - 0x03: 'bitstr', - 0x04: 'octstr', - 0x05: 'null_', - 0x06: 'objid', - 0x07: 'objDesc', - 0x08: 'external', - 0x09: 'real', - 0x0a: 'enum', - 0x0b: 'embed', - 0x0c: 'utf8str', - 0x0d: 'relativeOid', - 0x10: 'seq', - 0x11: 'set', - 0x12: 'numstr', - 0x13: 'printstr', - 0x14: 't61str', - 0x15: 'videostr', - 0x16: 'ia5str', - 0x17: 'utctime', - 0x18: 'gentime', - 0x19: 'graphstr', - 0x1a: 'iso646str', - 0x1b: 'genstr', - 0x1c: 'unistr', - 0x1d: 'charstr', - 0x1e: 'bmpstr' -}; -exports.tagByName = constants._reverse(exports.tag); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/constants/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var constants = exports; - -// Helper -constants._reverse = function reverse(map) { - var res = {}; - - Object.keys(map).forEach(function(key) { - // Convert key to integer if it is stringified - if ((key | 0) == key) - key = key | 0; - - var value = map[key]; - res[value] = key; - }); - - return res; -}; - -constants.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/constants/der.js"); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/decoders/der.js": -/*!*******************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var asn1 = __webpack_require__(/*! ../../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); -var base = asn1.base; -var bignum = asn1.bignum; - -// Import DER constants -var der = asn1.constants.der; - -function DERDecoder(entity) { - this.enc = 'der'; - this.name = entity.name; - this.entity = entity; - - // Construct base tree - this.tree = new DERNode(); - this.tree._init(entity.body); -}; -module.exports = DERDecoder; - -DERDecoder.prototype.decode = function decode(data, options) { - if (!(data instanceof base.DecoderBuffer)) - data = new base.DecoderBuffer(data, options); - - return this.tree._decode(data, options); -}; - -// Tree methods - -function DERNode(parent) { - base.Node.call(this, 'der', parent); -} -inherits(DERNode, base.Node); - -DERNode.prototype._peekTag = function peekTag(buffer, tag, any) { - if (buffer.isEmpty()) - return false; - - var state = buffer.save(); - var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"'); - if (buffer.isError(decodedTag)) - return decodedTag; - - buffer.restore(state); - - return decodedTag.tag === tag || decodedTag.tagStr === tag || - (decodedTag.tagStr + 'of') === tag || any; -}; - -DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { - var decodedTag = derDecodeTag(buffer, - 'Failed to decode tag of "' + tag + '"'); - if (buffer.isError(decodedTag)) - return decodedTag; - - var len = derDecodeLen(buffer, - decodedTag.primitive, - 'Failed to get length of "' + tag + '"'); - - // Failure - if (buffer.isError(len)) - return len; - - if (!any && - decodedTag.tag !== tag && - decodedTag.tagStr !== tag && - decodedTag.tagStr + 'of' !== tag) { - return buffer.error('Failed to match tag: "' + tag + '"'); - } - - if (decodedTag.primitive || len !== null) - return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); - - // Indefinite length... find END tag - var state = buffer.save(); - var res = this._skipUntilEnd( - buffer, - 'Failed to skip indefinite length body: "' + this.tag + '"'); - if (buffer.isError(res)) - return res; - - len = buffer.offset - state.offset; - buffer.restore(state); - return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); -}; - -DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) { - while (true) { - var tag = derDecodeTag(buffer, fail); - if (buffer.isError(tag)) - return tag; - var len = derDecodeLen(buffer, tag.primitive, fail); - if (buffer.isError(len)) - return len; - - var res; - if (tag.primitive || len !== null) - res = buffer.skip(len) - else - res = this._skipUntilEnd(buffer, fail); - - // Failure - if (buffer.isError(res)) - return res; - - if (tag.tagStr === 'end') - break; - } -}; - -DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, - options) { - var result = []; - while (!buffer.isEmpty()) { - var possibleEnd = this._peekTag(buffer, 'end'); - if (buffer.isError(possibleEnd)) - return possibleEnd; - - var res = decoder.decode(buffer, 'der', options); - if (buffer.isError(res) && possibleEnd) - break; - result.push(res); - } - return result; -}; - -DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { - if (tag === 'bitstr') { - var unused = buffer.readUInt8(); - if (buffer.isError(unused)) - return unused; - return { unused: unused, data: buffer.raw() }; - } else if (tag === 'bmpstr') { - var raw = buffer.raw(); - if (raw.length % 2 === 1) - return buffer.error('Decoding of string type: bmpstr length mismatch'); - - var str = ''; - for (var i = 0; i < raw.length / 2; i++) { - str += String.fromCharCode(raw.readUInt16BE(i * 2)); - } - return str; - } else if (tag === 'numstr') { - var numstr = buffer.raw().toString('ascii'); - if (!this._isNumstr(numstr)) { - return buffer.error('Decoding of string type: ' + - 'numstr unsupported characters'); - } - return numstr; - } else if (tag === 'octstr') { - return buffer.raw(); - } else if (tag === 'objDesc') { - return buffer.raw(); - } else if (tag === 'printstr') { - var printstr = buffer.raw().toString('ascii'); - if (!this._isPrintstr(printstr)) { - return buffer.error('Decoding of string type: ' + - 'printstr unsupported characters'); - } - return printstr; - } else if (/str$/.test(tag)) { - return buffer.raw().toString(); - } else { - return buffer.error('Decoding of string type: ' + tag + ' unsupported'); - } -}; - -DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) { - var result; - var identifiers = []; - var ident = 0; - while (!buffer.isEmpty()) { - var subident = buffer.readUInt8(); - ident <<= 7; - ident |= subident & 0x7f; - if ((subident & 0x80) === 0) { - identifiers.push(ident); - ident = 0; - } - } - if (subident & 0x80) - identifiers.push(ident); - - var first = (identifiers[0] / 40) | 0; - var second = identifiers[0] % 40; - - if (relative) - result = identifiers; - else - result = [first, second].concat(identifiers.slice(1)); - - if (values) { - var tmp = values[result.join(' ')]; - if (tmp === undefined) - tmp = values[result.join('.')]; - if (tmp !== undefined) - result = tmp; - } - - return result; -}; - -DERNode.prototype._decodeTime = function decodeTime(buffer, tag) { - var str = buffer.raw().toString(); - if (tag === 'gentime') { - var year = str.slice(0, 4) | 0; - var mon = str.slice(4, 6) | 0; - var day = str.slice(6, 8) | 0; - var hour = str.slice(8, 10) | 0; - var min = str.slice(10, 12) | 0; - var sec = str.slice(12, 14) | 0; - } else if (tag === 'utctime') { - var year = str.slice(0, 2) | 0; - var mon = str.slice(2, 4) | 0; - var day = str.slice(4, 6) | 0; - var hour = str.slice(6, 8) | 0; - var min = str.slice(8, 10) | 0; - var sec = str.slice(10, 12) | 0; - if (year < 70) - year = 2000 + year; - else - year = 1900 + year; - } else { - return buffer.error('Decoding ' + tag + ' time is not supported yet'); - } - - return Date.UTC(year, mon - 1, day, hour, min, sec, 0); -}; - -DERNode.prototype._decodeNull = function decodeNull(buffer) { - return null; -}; - -DERNode.prototype._decodeBool = function decodeBool(buffer) { - var res = buffer.readUInt8(); - if (buffer.isError(res)) - return res; - else - return res !== 0; -}; - -DERNode.prototype._decodeInt = function decodeInt(buffer, values) { - // Bigint, return as it is (assume big endian) - var raw = buffer.raw(); - var res = new bignum(raw); - - if (values) - res = values[res.toString(10)] || res; - - return res; -}; - -DERNode.prototype._use = function use(entity, obj) { - if (typeof entity === 'function') - entity = entity(obj); - return entity._getDecoder('der').tree; -}; - -// Utility methods - -function derDecodeTag(buf, fail) { - var tag = buf.readUInt8(fail); - if (buf.isError(tag)) - return tag; - - var cls = der.tagClass[tag >> 6]; - var primitive = (tag & 0x20) === 0; - - // Multi-octet tag - load - if ((tag & 0x1f) === 0x1f) { - var oct = tag; - tag = 0; - while ((oct & 0x80) === 0x80) { - oct = buf.readUInt8(fail); - if (buf.isError(oct)) - return oct; - - tag <<= 7; - tag |= oct & 0x7f; - } - } else { - tag &= 0x1f; - } - var tagStr = der.tag[tag]; - - return { - cls: cls, - primitive: primitive, - tag: tag, - tagStr: tagStr - }; -} - -function derDecodeLen(buf, primitive, fail) { - var len = buf.readUInt8(fail); - if (buf.isError(len)) - return len; - - // Indefinite form - if (!primitive && len === 0x80) - return null; - - // Definite form - if ((len & 0x80) === 0) { - // Short form - return len; - } - - // Long form - var num = len & 0x7f; - if (num > 4) - return buf.error('length octect is too long'); - - len = 0; - for (var i = 0; i < num; i++) { - len <<= 8; - var j = buf.readUInt8(fail); - if (buf.isError(j)) - return j; - len |= j; - } - - return len; -} - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/decoders/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var decoders = exports; - -decoders.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/decoders/der.js"); -decoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1/decoders/pem.js"); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/decoders/pem.js": -/*!*******************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - -var DERDecoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/decoders/der.js"); - -function PEMDecoder(entity) { - DERDecoder.call(this, entity); - this.enc = 'pem'; -}; -inherits(PEMDecoder, DERDecoder); -module.exports = PEMDecoder; - -PEMDecoder.prototype.decode = function decode(data, options) { - var lines = data.toString().split(/[\r\n]+/g); - - var label = options.label.toUpperCase(); - - var re = /^-----(BEGIN|END) ([^-]+)-----$/; - var start = -1; - var end = -1; - for (var i = 0; i < lines.length; i++) { - var match = lines[i].match(re); - if (match === null) - continue; - - if (match[2] !== label) - continue; - - if (start === -1) { - if (match[1] !== 'BEGIN') - break; - start = i; - } else { - if (match[1] !== 'END') - break; - end = i; - break; - } - } - if (start === -1 || end === -1) - throw new Error('PEM section not found for: ' + label); - - var base64 = lines.slice(start + 1, end).join(''); - // Remove excessive symbols - base64.replace(/[^a-z0-9\+\/=]+/gi, ''); - - var input = new Buffer(base64, 'base64'); - return DERDecoder.prototype.decode.call(this, input, options); -}; - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/encoders/der.js": -/*!*******************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - -var asn1 = __webpack_require__(/*! ../../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); -var base = asn1.base; - -// Import DER constants -var der = asn1.constants.der; - -function DEREncoder(entity) { - this.enc = 'der'; - this.name = entity.name; - this.entity = entity; - - // Construct base tree - this.tree = new DERNode(); - this.tree._init(entity.body); -}; -module.exports = DEREncoder; - -DEREncoder.prototype.encode = function encode(data, reporter) { - return this.tree._encode(data, reporter).join(); -}; - -// Tree methods - -function DERNode(parent) { - base.Node.call(this, 'der', parent); -} -inherits(DERNode, base.Node); - -DERNode.prototype._encodeComposite = function encodeComposite(tag, - primitive, - cls, - content) { - var encodedTag = encodeTag(tag, primitive, cls, this.reporter); - - // Short form - if (content.length < 0x80) { - var header = new Buffer(2); - header[0] = encodedTag; - header[1] = content.length; - return this._createEncoderBuffer([ header, content ]); - } - - // Long form - // Count octets required to store length - var lenOctets = 1; - for (var i = content.length; i >= 0x100; i >>= 8) - lenOctets++; - - var header = new Buffer(1 + 1 + lenOctets); - header[0] = encodedTag; - header[1] = 0x80 | lenOctets; - - for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) - header[i] = j & 0xff; - - return this._createEncoderBuffer([ header, content ]); -}; - -DERNode.prototype._encodeStr = function encodeStr(str, tag) { - if (tag === 'bitstr') { - return this._createEncoderBuffer([ str.unused | 0, str.data ]); - } else if (tag === 'bmpstr') { - var buf = new Buffer(str.length * 2); - for (var i = 0; i < str.length; i++) { - buf.writeUInt16BE(str.charCodeAt(i), i * 2); - } - return this._createEncoderBuffer(buf); - } else if (tag === 'numstr') { - if (!this._isNumstr(str)) { - return this.reporter.error('Encoding of string type: numstr supports ' + - 'only digits and space'); - } - return this._createEncoderBuffer(str); - } else if (tag === 'printstr') { - if (!this._isPrintstr(str)) { - return 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'); - } - return this._createEncoderBuffer(str); - } else if (/str$/.test(tag)) { - return this._createEncoderBuffer(str); - } else if (tag === 'objDesc') { - return this._createEncoderBuffer(str); - } else { - return this.reporter.error('Encoding of string type: ' + tag + - ' unsupported'); - } -}; - -DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { - if (typeof id === 'string') { - if (!values) - return this.reporter.error('string objid given, but no values map found'); - if (!values.hasOwnProperty(id)) - return this.reporter.error('objid not found in values map'); - id = values[id].split(/[\s\.]+/g); - for (var i = 0; i < id.length; i++) - id[i] |= 0; - } else if (Array.isArray(id)) { - id = id.slice(); - for (var i = 0; i < id.length; i++) - id[i] |= 0; - } - - if (!Array.isArray(id)) { - return this.reporter.error('objid() should be either array or string, ' + - 'got: ' + JSON.stringify(id)); - } - - if (!relative) { - if (id[1] >= 40) - return this.reporter.error('Second objid identifier OOB'); - id.splice(0, 2, id[0] * 40 + id[1]); - } - - // Count number of octets - var size = 0; - for (var i = 0; i < id.length; i++) { - var ident = id[i]; - for (size++; ident >= 0x80; ident >>= 7) - size++; - } - - var objid = new Buffer(size); - var offset = objid.length - 1; - for (var i = id.length - 1; i >= 0; i--) { - var ident = id[i]; - objid[offset--] = ident & 0x7f; - while ((ident >>= 7) > 0) - objid[offset--] = 0x80 | (ident & 0x7f); - } - - return this._createEncoderBuffer(objid); -}; - -function two(num) { - if (num < 10) - return '0' + num; - else - return num; -} - -DERNode.prototype._encodeTime = function encodeTime(time, tag) { - var str; - var date = new Date(time); - - if (tag === 'gentime') { - str = [ - two(date.getFullYear()), - two(date.getUTCMonth() + 1), - two(date.getUTCDate()), - two(date.getUTCHours()), - two(date.getUTCMinutes()), - two(date.getUTCSeconds()), - 'Z' - ].join(''); - } else if (tag === 'utctime') { - str = [ - two(date.getFullYear() % 100), - two(date.getUTCMonth() + 1), - two(date.getUTCDate()), - two(date.getUTCHours()), - two(date.getUTCMinutes()), - two(date.getUTCSeconds()), - 'Z' - ].join(''); - } else { - this.reporter.error('Encoding ' + tag + ' time is not supported yet'); - } - - return this._encodeStr(str, 'octstr'); -}; - -DERNode.prototype._encodeNull = function encodeNull() { - return this._createEncoderBuffer(''); -}; - -DERNode.prototype._encodeInt = function encodeInt(num, values) { - if (typeof num === 'string') { - if (!values) - return this.reporter.error('String int or enum given, but no values map'); - if (!values.hasOwnProperty(num)) { - return this.reporter.error('Values map doesn\'t contain: ' + - JSON.stringify(num)); - } - num = values[num]; - } - - // Bignum, assume big endian - if (typeof num !== 'number' && !Buffer.isBuffer(num)) { - var numArray = num.toArray(); - if (!num.sign && numArray[0] & 0x80) { - numArray.unshift(0); - } - num = new Buffer(numArray); - } - - if (Buffer.isBuffer(num)) { - var size = num.length; - if (num.length === 0) - size++; - - var out = new Buffer(size); - num.copy(out); - if (num.length === 0) - out[0] = 0 - return this._createEncoderBuffer(out); - } - - if (num < 0x80) - return this._createEncoderBuffer(num); - - if (num < 0x100) - return this._createEncoderBuffer([0, num]); - - var size = 1; - for (var i = num; i >= 0x100; i >>= 8) - size++; - - var out = new Array(size); - for (var i = out.length - 1; i >= 0; i--) { - out[i] = num & 0xff; - num >>= 8; - } - if(out[0] & 0x80) { - out.unshift(0); - } - - return this._createEncoderBuffer(new Buffer(out)); -}; - -DERNode.prototype._encodeBool = function encodeBool(value) { - return this._createEncoderBuffer(value ? 0xff : 0); -}; - -DERNode.prototype._use = function use(entity, obj) { - if (typeof entity === 'function') - entity = entity(obj); - return entity._getEncoder('der').tree; -}; - -DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) { - var state = this._baseState; - var i; - if (state['default'] === null) - return false; - - var data = dataBuffer.join(); - if (state.defaultBuffer === undefined) - state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join(); - - if (data.length !== state.defaultBuffer.length) - return false; - - for (i=0; i < data.length; i++) - if (data[i] !== state.defaultBuffer[i]) - return false; - - return true; -}; - -// Utility methods - -function encodeTag(tag, primitive, cls, reporter) { - var res; - - if (tag === 'seqof') - tag = 'seq'; - else if (tag === 'setof') - tag = 'set'; - - if (der.tagByName.hasOwnProperty(tag)) - res = der.tagByName[tag]; - else if (typeof tag === 'number' && (tag | 0) === tag) - res = tag; - else - return reporter.error('Unknown tag: ' + tag); - - if (res >= 0x1f) - return reporter.error('Multi-octet tag encoding unsupported'); - - if (!primitive) - res |= 0x20; - - res |= (der.tagClassByName[cls || 'universal'] << 6); - - return res; -} - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/encoders/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var encoders = exports; - -encoders.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/encoders/der.js"); -encoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1/encoders/pem.js"); - - -/***/ }), - -/***/ "./node_modules/asn1.js/lib/asn1/encoders/pem.js": -/*!*******************************************************!*\ - !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var DEREncoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/encoders/der.js"); - -function PEMEncoder(entity) { - DEREncoder.call(this, entity); - this.enc = 'pem'; -}; -inherits(PEMEncoder, DEREncoder); -module.exports = PEMEncoder; - -PEMEncoder.prototype.encode = function encode(data, options) { - var buf = DEREncoder.prototype.encode.call(this, data); - - var p = buf.toString('base64'); - var out = [ '-----BEGIN ' + options.label + '-----' ]; - for (var i = 0; i < p.length; i += 64) - out.push(p.slice(i, i + 64)); - out.push('-----END ' + options.label + '-----'); - return out.join('\n'); -}; - - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/array/from.js": -/*!**********************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/array/from.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/array/from */ "./node_modules/core-js/library/fn/array/from.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/map.js": -/*!***************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/map.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/map */ "./node_modules/core-js/library/fn/map.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/number/is-nan.js": -/*!*************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/number/is-nan.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/number/is-nan */ "./node_modules/core-js/library/fn/number/is-nan.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/number/min-safe-integer.js": -/*!***********************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/number/min-safe-integer.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/number/min-safe-integer */ "./node_modules/core-js/library/fn/number/min-safe-integer.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/assign.js": -/*!*************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/assign.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/assign */ "./node_modules/core-js/library/fn/object/assign.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/create.js": -/*!*************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/create.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/create */ "./node_modules/core-js/library/fn/object/create.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/define-property.js": -/*!**********************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/define-property.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/define-property */ "./node_modules/core-js/library/fn/object/define-property.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js": -/*!***********************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/get-prototype-of.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/get-prototype-of */ "./node_modules/core-js/library/fn/object/get-prototype-of.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/keys.js": -/*!***********************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/keys.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/keys */ "./node_modules/core-js/library/fn/object/keys.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/object/set-prototype-of.js": -/*!***********************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/object/set-prototype-of.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/set-prototype-of */ "./node_modules/core-js/library/fn/object/set-prototype-of.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/symbol.js": -/*!******************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/symbol.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/symbol */ "./node_modules/core-js/library/fn/symbol/index.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/core-js/symbol/iterator.js": -/*!***************************************************************!*\ - !*** ./node_modules/babel-runtime/core-js/symbol/iterator.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(/*! core-js/library/fn/symbol/iterator */ "./node_modules/core-js/library/fn/symbol/iterator.js"), __esModule: true }; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/classCallCheck.js": -/*!**************************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/classCallCheck.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -exports.default = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/createClass.js": -/*!***********************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/createClass.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _defineProperty = __webpack_require__(/*! ../core-js/object/define-property */ "./node_modules/babel-runtime/core-js/object/define-property.js"); - -var _defineProperty2 = _interopRequireDefault(_defineProperty); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - (0, _defineProperty2.default)(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/defineProperty.js": -/*!**************************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/defineProperty.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _defineProperty = __webpack_require__(/*! ../core-js/object/define-property */ "./node_modules/babel-runtime/core-js/object/define-property.js"); - -var _defineProperty2 = _interopRequireDefault(_defineProperty); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (obj, key, value) { - if (key in obj) { - (0, _defineProperty2.default)(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/extends.js": -/*!*******************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/extends.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(/*! ../core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/inherits.js": -/*!********************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/inherits.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _setPrototypeOf = __webpack_require__(/*! ../core-js/object/set-prototype-of */ "./node_modules/babel-runtime/core-js/object/set-prototype-of.js"); - -var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - -var _create = __webpack_require__(/*! ../core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); - -var _create2 = _interopRequireDefault(_create); - -var _typeof2 = __webpack_require__(/*! ../helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); - } - - subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js": -/*!***********************************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/objectWithoutProperties.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -exports.default = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js": -/*!*************************************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof2 = __webpack_require__(/*! ../helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/toConsumableArray.js": -/*!*****************************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/toConsumableArray.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _from = __webpack_require__(/*! ../core-js/array/from */ "./node_modules/babel-runtime/core-js/array/from.js"); - -var _from2 = _interopRequireDefault(_from); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return (0, _from2.default)(arr); - } -}; - -/***/ }), - -/***/ "./node_modules/babel-runtime/helpers/typeof.js": -/*!******************************************************!*\ - !*** ./node_modules/babel-runtime/helpers/typeof.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _iterator = __webpack_require__(/*! ../core-js/symbol/iterator */ "./node_modules/babel-runtime/core-js/symbol/iterator.js"); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _symbol = __webpack_require__(/*! ../core-js/symbol */ "./node_modules/babel-runtime/core-js/symbol.js"); - -var _symbol2 = _interopRequireDefault(_symbol); - -var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { - return typeof obj === "undefined" ? "undefined" : _typeof(obj); -} : function (obj) { - return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); -}; - -/***/ }), - -/***/ "./node_modules/base64-js/index.js": -/*!*****************************************!*\ - !*** ./node_modules/base64-js/index.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function placeHoldersCount (b64) { - var len = b64.length - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 -} - -function byteLength (b64) { - // base64 is 4/3 + up to two characters of the original data - return (b64.length * 3 / 4) - placeHoldersCount(b64) -} - -function toByteArray (b64) { - var i, l, tmp, placeHolders, arr - var len = b64.length - placeHolders = placeHoldersCount(b64) - - arr = new Arr((len * 3 / 4) - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len - - var L = 0 - - for (i = 0; i < l; i += 4) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] - arr[L++] = (tmp >> 16) & 0xFF - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[L++] = tmp & 0xFF - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var output = '' - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - output += lookup[tmp >> 2] - output += lookup[(tmp << 4) & 0x3F] - output += '==' - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) - output += lookup[tmp >> 10] - output += lookup[(tmp >> 4) & 0x3F] - output += lookup[(tmp << 2) & 0x3F] - output += '=' - } - - parts.push(output) - - return parts.join('') -} - - -/***/ }), - -/***/ "./node_modules/bignumber.js/bignumber.js": -/*!************************************************!*\ - !*** ./node_modules/bignumber.js/bignumber.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_RESULT__;/*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */ - -;(function (global) { - 'use strict'; - - /* - bignumber.js v2.0.7 - A JavaScript library for arbitrary-precision arithmetic. - https://github.com/MikeMcl/bignumber.js - Copyright (c) 2015 Michael Mclaughlin - MIT Expat Licence - */ - - - var BigNumber, crypto, parseNumeric, - isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, - mathceil = Math.ceil, - mathfloor = Math.floor, - notBool = ' not a boolean or binary digit', - roundingMode = 'rounding mode', - tooManyDigits = 'number type has more than 15 significant digits', - ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_', - BASE = 1e14, - LOG_BASE = 14, - MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 - // MAX_INT32 = 0x7fffffff, // 2^31 - 1 - POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], - SQRT_BASE = 1e7, - - /* - * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and - * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an - * exception is thrown (if ERRORS is true). - */ - MAX = 1E9; // 0 to MAX_INT32 - - - /* - * Create and return a BigNumber constructor. - */ - function another(configObj) { - var div, - - // id tracks the caller function, so its name can be included in error messages. - id = 0, - P = BigNumber.prototype, - ONE = new BigNumber(1), - - - /********************************* EDITABLE DEFAULTS **********************************/ - - - /* - * The default values below must be integers within the inclusive ranges stated. - * The values can also be changed at run-time using BigNumber.config. - */ - - // The maximum number of decimal places for operations involving division. - DECIMAL_PLACES = 20, // 0 to MAX - - /* - * The rounding mode used when rounding to the above decimal places, and when using - * toExponential, toFixed, toFormat and toPrecision, and round (default value). - * UP 0 Away from zero. - * DOWN 1 Towards zero. - * CEIL 2 Towards +Infinity. - * FLOOR 3 Towards -Infinity. - * HALF_UP 4 Towards nearest neighbour. If equidistant, up. - * HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. - * HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. - * HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. - * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. - */ - ROUNDING_MODE = 4, // 0 to 8 - - // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] - - // The exponent value at and beneath which toString returns exponential notation. - // Number type: -7 - TO_EXP_NEG = -7, // 0 to -MAX - - // The exponent value at and above which toString returns exponential notation. - // Number type: 21 - TO_EXP_POS = 21, // 0 to MAX - - // RANGE : [MIN_EXP, MAX_EXP] - - // The minimum exponent value, beneath which underflow to zero occurs. - // Number type: -324 (5e-324) - MIN_EXP = -1e7, // -1 to -MAX - - // The maximum exponent value, above which overflow to Infinity occurs. - // Number type: 308 (1.7976931348623157e+308) - // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. - MAX_EXP = 1e7, // 1 to MAX - - // Whether BigNumber Errors are ever thrown. - ERRORS = true, // true or false - - // Change to intValidatorNoErrors if ERRORS is false. - isValidInt = intValidatorWithErrors, // intValidatorWithErrors/intValidatorNoErrors - - // Whether to use cryptographically-secure random number generation, if available. - CRYPTO = false, // true or false - - /* - * The modulo mode used when calculating the modulus: a mod n. - * The quotient (q = a / n) is calculated according to the corresponding rounding mode. - * The remainder (r) is calculated as: r = a - n * q. - * - * UP 0 The remainder is positive if the dividend is negative, else is negative. - * DOWN 1 The remainder has the same sign as the dividend. - * This modulo mode is commonly known as 'truncated division' and is - * equivalent to (a % n) in JavaScript. - * FLOOR 3 The remainder has the same sign as the divisor (Python %). - * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. - * EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). - * The remainder is always positive. - * - * The truncated division, floored division, Euclidian division and IEEE 754 remainder - * modes are commonly used for the modulus operation. - * Although the other rounding modes can also be used, they may not give useful results. - */ - MODULO_MODE = 1, // 0 to 9 - - // The maximum number of significant digits of the result of the toPower operation. - // If POW_PRECISION is 0, there will be unlimited significant digits. - POW_PRECISION = 100, // 0 to MAX - - // The format specification used by the BigNumber.prototype.toFormat method. - FORMAT = { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: '\xA0', // non-breaking space - fractionGroupSize: 0 - }; - - - /******************************************************************************************/ - - - // CONSTRUCTOR - - - /* - * The BigNumber constructor and exported function. - * Create and return a new instance of a BigNumber object. - * - * n {number|string|BigNumber} A numeric value. - * [b] {number} The base of n. Integer, 2 to 64 inclusive. - */ - function BigNumber( n, b ) { - var c, e, i, num, len, str, - x = this; - - // Enable constructor usage without new. - if ( !( x instanceof BigNumber ) ) { - - // 'BigNumber() constructor call without new: {n}' - if (ERRORS) raise( 26, 'constructor call without new', n ); - return new BigNumber( n, b ); - } - - // 'new BigNumber() base not an integer: {b}' - // 'new BigNumber() base out of range: {b}' - if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) { - - // Duplicate. - if ( n instanceof BigNumber ) { - x.s = n.s; - x.e = n.e; - x.c = ( n = n.c ) ? n.slice() : n; - id = 0; - return; - } - - if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) { - x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1; - - // Fast path for integers. - if ( n === ~~n ) { - for ( e = 0, i = n; i >= 10; i /= 10, e++ ); - x.e = e; - x.c = [n]; - id = 0; - return; - } - - str = n + ''; - } else { - if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num ); - x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1; - } - } else { - b = b | 0; - str = n + ''; - - // Ensure return value is rounded to DECIMAL_PLACES as with other bases. - // Allow exponential notation to be used with base 10 argument. - if ( b == 10 ) { - x = new BigNumber( n instanceof BigNumber ? n : str ); - return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE ); - } - - // Avoid potential interpretation of Infinity and NaN as base 44+ values. - // Any number in exponential form will fail due to the [Ee][+-]. - if ( ( num = typeof n == 'number' ) && n * 0 != 0 || - !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) + - '(?:\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) { - return parseNumeric( x, str, num, b ); - } - - if (num) { - x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1; - - if ( ERRORS && str.replace( /^0\.0*|\./, '' ).length > 15 ) { - - // 'new BigNumber() number type has more than 15 significant digits: {n}' - raise( id, tooManyDigits, n ); - } - - // Prevent later check for length on converted number. - num = false; - } else { - x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1; - } - - str = convertBase( str, 10, b, x.s ); - } - - // Decimal point? - if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' ); - - // Exponential form? - if ( ( i = str.search( /e/i ) ) > 0 ) { - - // Determine exponent. - if ( e < 0 ) e = i; - e += +str.slice( i + 1 ); - str = str.substring( 0, i ); - } else if ( e < 0 ) { - - // Integer. - e = str.length; - } - - // Determine leading zeros. - for ( i = 0; str.charCodeAt(i) === 48; i++ ); - - // Determine trailing zeros. - for ( len = str.length; str.charCodeAt(--len) === 48; ); - str = str.slice( i, len + 1 ); - - if (str) { - len = str.length; - - // Disallow numbers with over 15 significant digits if number type. - // 'new BigNumber() number type has more than 15 significant digits: {n}' - if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n ); - - e = e - i - 1; - - // Overflow? - if ( e > MAX_EXP ) { - - // Infinity. - x.c = x.e = null; - - // Underflow? - } else if ( e < MIN_EXP ) { - - // Zero. - x.c = [ x.e = 0 ]; - } else { - x.e = e; - x.c = []; - - // Transform base - - // e is the base 10 exponent. - // i is where to slice str to get the first element of the coefficient array. - i = ( e + 1 ) % LOG_BASE; - if ( e < 0 ) i += LOG_BASE; - - if ( i < len ) { - if (i) x.c.push( +str.slice( 0, i ) ); - - for ( len -= LOG_BASE; i < len; ) { - x.c.push( +str.slice( i, i += LOG_BASE ) ); - } - - str = str.slice(i); - i = LOG_BASE - str.length; - } else { - i -= len; - } - - for ( ; i--; str += '0' ); - x.c.push( +str ); - } - } else { - - // Zero. - x.c = [ x.e = 0 ]; - } - - id = 0; - } - - - // CONSTRUCTOR PROPERTIES - - - BigNumber.another = another; - - BigNumber.ROUND_UP = 0; - BigNumber.ROUND_DOWN = 1; - BigNumber.ROUND_CEIL = 2; - BigNumber.ROUND_FLOOR = 3; - BigNumber.ROUND_HALF_UP = 4; - BigNumber.ROUND_HALF_DOWN = 5; - BigNumber.ROUND_HALF_EVEN = 6; - BigNumber.ROUND_HALF_CEIL = 7; - BigNumber.ROUND_HALF_FLOOR = 8; - BigNumber.EUCLID = 9; - - - /* - * Configure infrequently-changing library-wide settings. - * - * Accept an object or an argument list, with one or many of the following properties or - * parameters respectively: - * - * DECIMAL_PLACES {number} Integer, 0 to MAX inclusive - * ROUNDING_MODE {number} Integer, 0 to 8 inclusive - * EXPONENTIAL_AT {number|number[]} Integer, -MAX to MAX inclusive or - * [integer -MAX to 0 incl., 0 to MAX incl.] - * RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or - * [integer -MAX to -1 incl., integer 1 to MAX incl.] - * ERRORS {boolean|number} true, false, 1 or 0 - * CRYPTO {boolean|number} true, false, 1 or 0 - * MODULO_MODE {number} 0 to 9 inclusive - * POW_PRECISION {number} 0 to MAX inclusive - * FORMAT {object} See BigNumber.prototype.toFormat - * decimalSeparator {string} - * groupSeparator {string} - * groupSize {number} - * secondaryGroupSize {number} - * fractionGroupSeparator {string} - * fractionGroupSize {number} - * - * (The values assigned to the above FORMAT object properties are not checked for validity.) - * - * E.g. - * BigNumber.config(20, 4) is equivalent to - * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) - * - * Ignore properties/parameters set to null or undefined. - * Return an object with the properties current values. - */ - BigNumber.config = function () { - var v, p, - i = 0, - r = {}, - a = arguments, - o = a[0], - has = o && typeof o == 'object' - ? function () { if ( o.hasOwnProperty(p) ) return ( v = o[p] ) != null; } - : function () { if ( a.length > i ) return ( v = a[i++] ) != null; }; - - // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. - // 'config() DECIMAL_PLACES not an integer: {v}' - // 'config() DECIMAL_PLACES out of range: {v}' - if ( has( p = 'DECIMAL_PLACES' ) && isValidInt( v, 0, MAX, 2, p ) ) { - DECIMAL_PLACES = v | 0; - } - r[p] = DECIMAL_PLACES; - - // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. - // 'config() ROUNDING_MODE not an integer: {v}' - // 'config() ROUNDING_MODE out of range: {v}' - if ( has( p = 'ROUNDING_MODE' ) && isValidInt( v, 0, 8, 2, p ) ) { - ROUNDING_MODE = v | 0; - } - r[p] = ROUNDING_MODE; - - // EXPONENTIAL_AT {number|number[]} - // Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive]. - // 'config() EXPONENTIAL_AT not an integer: {v}' - // 'config() EXPONENTIAL_AT out of range: {v}' - if ( has( p = 'EXPONENTIAL_AT' ) ) { - - if ( isArray(v) ) { - if ( isValidInt( v[0], -MAX, 0, 2, p ) && isValidInt( v[1], 0, MAX, 2, p ) ) { - TO_EXP_NEG = v[0] | 0; - TO_EXP_POS = v[1] | 0; - } - } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) { - TO_EXP_NEG = -( TO_EXP_POS = ( v < 0 ? -v : v ) | 0 ); - } - } - r[p] = [ TO_EXP_NEG, TO_EXP_POS ]; - - // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or - // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. - // 'config() RANGE not an integer: {v}' - // 'config() RANGE cannot be zero: {v}' - // 'config() RANGE out of range: {v}' - if ( has( p = 'RANGE' ) ) { - - if ( isArray(v) ) { - if ( isValidInt( v[0], -MAX, -1, 2, p ) && isValidInt( v[1], 1, MAX, 2, p ) ) { - MIN_EXP = v[0] | 0; - MAX_EXP = v[1] | 0; - } - } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) { - if ( v | 0 ) MIN_EXP = -( MAX_EXP = ( v < 0 ? -v : v ) | 0 ); - else if (ERRORS) raise( 2, p + ' cannot be zero', v ); - } - } - r[p] = [ MIN_EXP, MAX_EXP ]; - - // ERRORS {boolean|number} true, false, 1 or 0. - // 'config() ERRORS not a boolean or binary digit: {v}' - if ( has( p = 'ERRORS' ) ) { - - if ( v === !!v || v === 1 || v === 0 ) { - id = 0; - isValidInt = ( ERRORS = !!v ) ? intValidatorWithErrors : intValidatorNoErrors; - } else if (ERRORS) { - raise( 2, p + notBool, v ); - } - } - r[p] = ERRORS; - - // CRYPTO {boolean|number} true, false, 1 or 0. - // 'config() CRYPTO not a boolean or binary digit: {v}' - // 'config() crypto unavailable: {crypto}' - if ( has( p = 'CRYPTO' ) ) { - - if ( v === !!v || v === 1 || v === 0 ) { - CRYPTO = !!( v && crypto && typeof crypto == 'object' ); - if ( v && !CRYPTO && ERRORS ) raise( 2, 'crypto unavailable', crypto ); - } else if (ERRORS) { - raise( 2, p + notBool, v ); - } - } - r[p] = CRYPTO; - - // MODULO_MODE {number} Integer, 0 to 9 inclusive. - // 'config() MODULO_MODE not an integer: {v}' - // 'config() MODULO_MODE out of range: {v}' - if ( has( p = 'MODULO_MODE' ) && isValidInt( v, 0, 9, 2, p ) ) { - MODULO_MODE = v | 0; - } - r[p] = MODULO_MODE; - - // POW_PRECISION {number} Integer, 0 to MAX inclusive. - // 'config() POW_PRECISION not an integer: {v}' - // 'config() POW_PRECISION out of range: {v}' - if ( has( p = 'POW_PRECISION' ) && isValidInt( v, 0, MAX, 2, p ) ) { - POW_PRECISION = v | 0; - } - r[p] = POW_PRECISION; - - // FORMAT {object} - // 'config() FORMAT not an object: {v}' - if ( has( p = 'FORMAT' ) ) { - - if ( typeof v == 'object' ) { - FORMAT = v; - } else if (ERRORS) { - raise( 2, p + ' not an object', v ); - } - } - r[p] = FORMAT; - - return r; - }; - - - /* - * Return a new BigNumber whose value is the maximum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.max = function () { return maxOrMin( arguments, P.lt ); }; - - - /* - * Return a new BigNumber whose value is the minimum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.min = function () { return maxOrMin( arguments, P.gt ); }; - - - /* - * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, - * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing - * zeros are produced). - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * - * 'random() decimal places not an integer: {dp}' - * 'random() decimal places out of range: {dp}' - * 'random() crypto unavailable: {crypto}' - */ - BigNumber.random = (function () { - var pow2_53 = 0x20000000000000; - - // Return a 53 bit integer n, where 0 <= n < 9007199254740992. - // Check if Math.random() produces more than 32 bits of randomness. - // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. - // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. - var random53bitInt = (Math.random() * pow2_53) & 0x1fffff - ? function () { return mathfloor( Math.random() * pow2_53 ); } - : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + - (Math.random() * 0x800000 | 0); }; - - return function (dp) { - var a, b, e, k, v, - i = 0, - c = [], - rand = new BigNumber(ONE); - - dp = dp == null || !isValidInt( dp, 0, MAX, 14 ) ? DECIMAL_PLACES : dp | 0; - k = mathceil( dp / LOG_BASE ); - - if (CRYPTO) { - - // Browsers supporting crypto.getRandomValues. - if ( crypto && crypto.getRandomValues ) { - - a = crypto.getRandomValues( new Uint32Array( k *= 2 ) ); - - for ( ; i < k; ) { - - // 53 bits: - // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) - // 11111 11111111 11111111 11111111 11100000 00000000 00000000 - // ((Math.pow(2, 32) - 1) >>> 11).toString(2) - // 11111 11111111 11111111 - // 0x20000 is 2^21. - v = a[i] * 0x20000 + (a[i + 1] >>> 11); - - // Rejection sampling: - // 0 <= v < 9007199254740992 - // Probability that v >= 9e15, is - // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 - if ( v >= 9e15 ) { - b = crypto.getRandomValues( new Uint32Array(2) ); - a[i] = b[0]; - a[i + 1] = b[1]; - } else { - - // 0 <= v <= 8999999999999999 - // 0 <= (v % 1e14) <= 99999999999999 - c.push( v % 1e14 ); - i += 2; - } - } - i = k / 2; - - // Node.js supporting crypto.randomBytes. - } else if ( crypto && crypto.randomBytes ) { - - // buffer - a = crypto.randomBytes( k *= 7 ); - - for ( ; i < k; ) { - - // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 - // 0x100000000 is 2^32, 0x1000000 is 2^24 - // 11111 11111111 11111111 11111111 11111111 11111111 11111111 - // 0 <= v < 9007199254740992 - v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) + - ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) + - ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6]; - - if ( v >= 9e15 ) { - crypto.randomBytes(7).copy( a, i ); - } else { - - // 0 <= (v % 1e14) <= 99999999999999 - c.push( v % 1e14 ); - i += 7; - } - } - i = k / 7; - } else if (ERRORS) { - raise( 14, 'crypto unavailable', crypto ); - } - } - - // Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false. - if (!i) { - - for ( ; i < k; ) { - v = random53bitInt(); - if ( v < 9e15 ) c[i++] = v % 1e14; - } - } - - k = c[--i]; - dp %= LOG_BASE; - - // Convert trailing digits to zeros according to dp. - if ( k && dp ) { - v = POWS_TEN[LOG_BASE - dp]; - c[i] = mathfloor( k / v ) * v; - } - - // Remove trailing elements which are zero. - for ( ; c[i] === 0; c.pop(), i-- ); - - // Zero? - if ( i < 0 ) { - c = [ e = 0 ]; - } else { - - // Remove leading elements which are zero and adjust exponent accordingly. - for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE); - - // Count the digits of the first element of c to determine leading zeros, and... - for ( i = 1, v = c[0]; v >= 10; v /= 10, i++); - - // adjust the exponent accordingly. - if ( i < LOG_BASE ) e -= LOG_BASE - i; - } - - rand.e = e; - rand.c = c; - return rand; - }; - })(); - - - // PRIVATE FUNCTIONS - - - // Convert a numeric string of baseIn to a numeric string of baseOut. - function convertBase( str, baseOut, baseIn, sign ) { - var d, e, k, r, x, xc, y, - i = str.indexOf( '.' ), - dp = DECIMAL_PLACES, - rm = ROUNDING_MODE; - - if ( baseIn < 37 ) str = str.toLowerCase(); - - // Non-integer. - if ( i >= 0 ) { - k = POW_PRECISION; - - // Unlimited precision. - POW_PRECISION = 0; - str = str.replace( '.', '' ); - y = new BigNumber(baseIn); - x = y.pow( str.length - i ); - POW_PRECISION = k; - - // Convert str as if an integer, then restore the fraction part by dividing the - // result by its base raised to a power. - y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut ); - y.e = y.c.length; - } - - // Convert the number as integer. - xc = toBaseOut( str, baseIn, baseOut ); - e = k = xc.length; - - // Remove trailing zeros. - for ( ; xc[--k] == 0; xc.pop() ); - if ( !xc[0] ) return '0'; - - if ( i < 0 ) { - --e; - } else { - x.c = xc; - x.e = e; - - // sign is needed for correct rounding. - x.s = sign; - x = div( x, y, dp, rm, baseOut ); - xc = x.c; - r = x.r; - e = x.e; - } - - d = e + dp + 1; - - // The rounding digit, i.e. the digit to the right of the digit that may be rounded up. - i = xc[d]; - k = baseOut / 2; - r = r || d < 0 || xc[d + 1] != null; - - r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) ) - : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 || - rm == ( x.s < 0 ? 8 : 7 ) ); - - if ( d < 1 || !xc[0] ) { - - // 1^-dp or 0. - str = r ? toFixedPoint( '1', -dp ) : '0'; - } else { - xc.length = d; - - if (r) { - - // Rounding up may mean the previous digit has to be rounded up and so on. - for ( --baseOut; ++xc[--d] > baseOut; ) { - xc[d] = 0; - - if ( !d ) { - ++e; - xc.unshift(1); - } - } - } - - // Determine trailing zeros. - for ( k = xc.length; !xc[--k]; ); - - // E.g. [4, 11, 15] becomes 4bf. - for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) ); - str = toFixedPoint( str, e ); - } - - // The caller will add the sign. - return str; - } - - - // Perform division in the specified base. Called by div and convertBase. - div = (function () { - - // Assume non-zero x and k. - function multiply( x, k, base ) { - var m, temp, xlo, xhi, - carry = 0, - i = x.length, - klo = k % SQRT_BASE, - khi = k / SQRT_BASE | 0; - - for ( x = x.slice(); i--; ) { - xlo = x[i] % SQRT_BASE; - xhi = x[i] / SQRT_BASE | 0; - m = khi * xlo + xhi * klo; - temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry; - carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi; - x[i] = temp % base; - } - - if (carry) x.unshift(carry); - - return x; - } - - function compare( a, b, aL, bL ) { - var i, cmp; - - if ( aL != bL ) { - cmp = aL > bL ? 1 : -1; - } else { - - for ( i = cmp = 0; i < aL; i++ ) { - - if ( a[i] != b[i] ) { - cmp = a[i] > b[i] ? 1 : -1; - break; - } - } - } - return cmp; - } - - function subtract( a, b, aL, base ) { - var i = 0; - - // Subtract b from a. - for ( ; aL--; ) { - a[aL] -= i; - i = a[aL] < b[aL] ? 1 : 0; - a[aL] = i * base + a[aL] - b[aL]; - } - - // Remove leading zeros. - for ( ; !a[0] && a.length > 1; a.shift() ); - } - - // x: dividend, y: divisor. - return function ( x, y, dp, rm, base ) { - var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, - yL, yz, - s = x.s == y.s ? 1 : -1, - xc = x.c, - yc = y.c; - - // Either NaN, Infinity or 0? - if ( !xc || !xc[0] || !yc || !yc[0] ) { - - return new BigNumber( - - // Return NaN if either NaN, or both Infinity or 0. - !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN : - - // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. - xc && xc[0] == 0 || !yc ? s * 0 : s / 0 - ); - } - - q = new BigNumber(s); - qc = q.c = []; - e = x.e - y.e; - s = dp + e + 1; - - if ( !base ) { - base = BASE; - e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE ); - s = s / LOG_BASE | 0; - } - - // Result exponent may be one less then the current value of e. - // The coefficients of the BigNumbers from convertBase may have trailing zeros. - for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ ); - if ( yc[i] > ( xc[i] || 0 ) ) e--; - - if ( s < 0 ) { - qc.push(1); - more = true; - } else { - xL = xc.length; - yL = yc.length; - i = 0; - s += 2; - - // Normalise xc and yc so highest order digit of yc is >= base / 2. - - n = mathfloor( base / ( yc[0] + 1 ) ); - - // Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1. - // if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) { - if ( n > 1 ) { - yc = multiply( yc, n, base ); - xc = multiply( xc, n, base ); - yL = yc.length; - xL = xc.length; - } - - xi = yL; - rem = xc.slice( 0, yL ); - remL = rem.length; - - // Add zeros to make remainder as long as divisor. - for ( ; remL < yL; rem[remL++] = 0 ); - yz = yc.slice(); - yz.unshift(0); - yc0 = yc[0]; - if ( yc[1] >= base / 2 ) yc0++; - // Not necessary, but to prevent trial digit n > base, when using base 3. - // else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15; - - do { - n = 0; - - // Compare divisor and remainder. - cmp = compare( yc, rem, yL, remL ); - - // If divisor < remainder. - if ( cmp < 0 ) { - - // Calculate trial digit, n. - - rem0 = rem[0]; - if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 ); - - // n is how many times the divisor goes into the current remainder. - n = mathfloor( rem0 / yc0 ); - - // Algorithm: - // 1. product = divisor * trial digit (n) - // 2. if product > remainder: product -= divisor, n-- - // 3. remainder -= product - // 4. if product was < remainder at 2: - // 5. compare new remainder and divisor - // 6. If remainder > divisor: remainder -= divisor, n++ - - if ( n > 1 ) { - - // n may be > base only when base is 3. - if (n >= base) n = base - 1; - - // product = divisor * trial digit. - prod = multiply( yc, n, base ); - prodL = prod.length; - remL = rem.length; - - // Compare product and remainder. - // If product > remainder. - // Trial digit n too high. - // n is 1 too high about 5% of the time, and is not known to have - // ever been more than 1 too high. - while ( compare( prod, rem, prodL, remL ) == 1 ) { - n--; - - // Subtract divisor from product. - subtract( prod, yL < prodL ? yz : yc, prodL, base ); - prodL = prod.length; - cmp = 1; - } - } else { - - // n is 0 or 1, cmp is -1. - // If n is 0, there is no need to compare yc and rem again below, - // so change cmp to 1 to avoid it. - // If n is 1, leave cmp as -1, so yc and rem are compared again. - if ( n == 0 ) { - - // divisor < remainder, so n must be at least 1. - cmp = n = 1; - } - - // product = divisor - prod = yc.slice(); - prodL = prod.length; - } - - if ( prodL < remL ) prod.unshift(0); - - // Subtract product from remainder. - subtract( rem, prod, remL, base ); - remL = rem.length; - - // If product was < remainder. - if ( cmp == -1 ) { - - // Compare divisor and new remainder. - // If divisor < new remainder, subtract divisor from remainder. - // Trial digit n too low. - // n is 1 too low about 5% of the time, and very rarely 2 too low. - while ( compare( yc, rem, yL, remL ) < 1 ) { - n++; - - // Subtract divisor from remainder. - subtract( rem, yL < remL ? yz : yc, remL, base ); - remL = rem.length; - } - } - } else if ( cmp === 0 ) { - n++; - rem = [0]; - } // else cmp === 1 and n will be 0 - - // Add the next digit, n, to the result array. - qc[i++] = n; - - // Update the remainder. - if ( rem[0] ) { - rem[remL++] = xc[xi] || 0; - } else { - rem = [ xc[xi] ]; - remL = 1; - } - } while ( ( xi++ < xL || rem[0] != null ) && s-- ); - - more = rem[0] != null; - - // Leading zero? - if ( !qc[0] ) qc.shift(); - } - - if ( base == BASE ) { - - // To calculate q.e, first get the number of digits of qc[0]. - for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ ); - round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more ); - - // Caller is convertBase. - } else { - q.e = e; - q.r = +more; - } - - return q; - }; - })(); - - - /* - * Return a string representing the value of BigNumber n in fixed-point or exponential - * notation rounded to the specified decimal places or significant digits. - * - * n is a BigNumber. - * i is the index of the last digit required (i.e. the digit that may be rounded up). - * rm is the rounding mode. - * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24. - */ - function format( n, i, rm, caller ) { - var c0, e, ne, len, str; - - rm = rm != null && isValidInt( rm, 0, 8, caller, roundingMode ) - ? rm | 0 : ROUNDING_MODE; - - if ( !n.c ) return n.toString(); - c0 = n.c[0]; - ne = n.e; - - if ( i == null ) { - str = coeffToString( n.c ); - str = caller == 19 || caller == 24 && ne <= TO_EXP_NEG - ? toExponential( str, ne ) - : toFixedPoint( str, ne ); - } else { - n = round( new BigNumber(n), i, rm ); - - // n.e may have changed if the value was rounded up. - e = n.e; - - str = coeffToString( n.c ); - len = str.length; - - // toPrecision returns exponential notation if the number of significant digits - // specified is less than the number of digits necessary to represent the integer - // part of the value in fixed-point notation. - - // Exponential notation. - if ( caller == 19 || caller == 24 && ( i <= e || e <= TO_EXP_NEG ) ) { - - // Append zeros? - for ( ; len < i; str += '0', len++ ); - str = toExponential( str, e ); - - // Fixed-point notation. - } else { - i -= ne; - str = toFixedPoint( str, e ); - - // Append zeros? - if ( e + 1 > len ) { - if ( --i > 0 ) for ( str += '.'; i--; str += '0' ); - } else { - i += e - len; - if ( i > 0 ) { - if ( e + 1 == len ) str += '.'; - for ( ; i--; str += '0' ); - } - } - } - } - - return n.s < 0 && c0 ? '-' + str : str; - } - - - // Handle BigNumber.max and BigNumber.min. - function maxOrMin( args, method ) { - var m, n, - i = 0; - - if ( isArray( args[0] ) ) args = args[0]; - m = new BigNumber( args[0] ); - - for ( ; ++i < args.length; ) { - n = new BigNumber( args[i] ); - - // If any number is NaN, return NaN. - if ( !n.s ) { - m = n; - break; - } else if ( method.call( m, n ) ) { - m = n; - } - } - - return m; - } - - - /* - * Return true if n is an integer in range, otherwise throw. - * Use for argument validation when ERRORS is true. - */ - function intValidatorWithErrors( n, min, max, caller, name ) { - if ( n < min || n > max || n != truncate(n) ) { - raise( caller, ( name || 'decimal places' ) + - ( n < min || n > max ? ' out of range' : ' not an integer' ), n ); - } - - return true; - } - - - /* - * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. - * Called by minus, plus and times. - */ - function normalise( n, c, e ) { - var i = 1, - j = c.length; - - // Remove trailing zeros. - for ( ; !c[--j]; c.pop() ); - - // Calculate the base 10 exponent. First get the number of digits of c[0]. - for ( j = c[0]; j >= 10; j /= 10, i++ ); - - // Overflow? - if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) { - - // Infinity. - n.c = n.e = null; - - // Underflow? - } else if ( e < MIN_EXP ) { - - // Zero. - n.c = [ n.e = 0 ]; - } else { - n.e = e; - n.c = c; - } - - return n; - } - - - // Handle values that fail the validity test in BigNumber. - parseNumeric = (function () { - var basePrefix = /^(-?)0([xbo])/i, - dotAfter = /^([^.]+)\.$/, - dotBefore = /^\.([^.]+)$/, - isInfinityOrNaN = /^-?(Infinity|NaN)$/, - whitespaceOrPlus = /^\s*\+|^\s+|\s+$/g; - - return function ( x, str, num, b ) { - var base, - s = num ? str : str.replace( whitespaceOrPlus, '' ); - - // No exception on ±Infinity or NaN. - if ( isInfinityOrNaN.test(s) ) { - x.s = isNaN(s) ? null : s < 0 ? -1 : 1; - } else { - if ( !num ) { - - // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i - s = s.replace( basePrefix, function ( m, p1, p2 ) { - base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8; - return !b || b == base ? p1 : m; - }); - - if (b) { - base = b; - - // E.g. '1.' to '1', '.1' to '0.1' - s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' ); - } - - if ( str != s ) return new BigNumber( s, base ); - } - - // 'new BigNumber() not a number: {n}' - // 'new BigNumber() not a base {b} number: {n}' - if (ERRORS) raise( id, 'not a' + ( b ? ' base ' + b : '' ) + ' number', str ); - x.s = null; - } - - x.c = x.e = null; - id = 0; - } - })(); - - - // Throw a BigNumber Error. - function raise( caller, msg, val ) { - var error = new Error( [ - 'new BigNumber', // 0 - 'cmp', // 1 - 'config', // 2 - 'div', // 3 - 'divToInt', // 4 - 'eq', // 5 - 'gt', // 6 - 'gte', // 7 - 'lt', // 8 - 'lte', // 9 - 'minus', // 10 - 'mod', // 11 - 'plus', // 12 - 'precision', // 13 - 'random', // 14 - 'round', // 15 - 'shift', // 16 - 'times', // 17 - 'toDigits', // 18 - 'toExponential', // 19 - 'toFixed', // 20 - 'toFormat', // 21 - 'toFraction', // 22 - 'pow', // 23 - 'toPrecision', // 24 - 'toString', // 25 - 'BigNumber' // 26 - ][caller] + '() ' + msg + ': ' + val ); - - error.name = 'BigNumber Error'; - id = 0; - throw error; - } - - - /* - * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. - * If r is truthy, it is known that there are more digits after the rounding digit. - */ - function round( x, sd, rm, r ) { - var d, i, j, k, n, ni, rd, - xc = x.c, - pows10 = POWS_TEN; - - // if x is not Infinity or NaN... - if (xc) { - - // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. - // n is a base 1e14 number, the value of the element of array x.c containing rd. - // ni is the index of n within x.c. - // d is the number of digits of n. - // i is the index of rd within n including leading zeros. - // j is the actual index of rd within n (if < 0, rd is a leading zero). - out: { - - // Get the number of digits of the first element of xc. - for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ ); - i = sd - d; - - // If the rounding digit is in the first element of xc... - if ( i < 0 ) { - i += LOG_BASE; - j = sd; - n = xc[ ni = 0 ]; - - // Get the rounding digit at index j of n. - rd = n / pows10[ d - j - 1 ] % 10 | 0; - } else { - ni = mathceil( ( i + 1 ) / LOG_BASE ); - - if ( ni >= xc.length ) { - - if (r) { - - // Needed by sqrt. - for ( ; xc.length <= ni; xc.push(0) ); - n = rd = 0; - d = 1; - i %= LOG_BASE; - j = i - LOG_BASE + 1; - } else { - break out; - } - } else { - n = k = xc[ni]; - - // Get the number of digits of n. - for ( d = 1; k >= 10; k /= 10, d++ ); - - // Get the index of rd within n. - i %= LOG_BASE; - - // Get the index of rd within n, adjusted for leading zeros. - // The number of leading zeros of n is given by LOG_BASE - d. - j = i - LOG_BASE + d; - - // Get the rounding digit at index j of n. - rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0; - } - } - - r = r || sd < 0 || - - // Are there any non-zero digits after the rounding digit? - // The expression n % pows10[ d - j - 1 ] returns all digits of n to the right - // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. - xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] ); - - r = rm < 4 - ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) ) - : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 && - - // Check whether the digit to the left of the rounding digit is odd. - ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 || - rm == ( x.s < 0 ? 8 : 7 ) ); - - if ( sd < 1 || !xc[0] ) { - xc.length = 0; - - if (r) { - - // Convert sd to decimal places. - sd -= x.e + 1; - - // 1, 0.1, 0.01, 0.001, 0.0001 etc. - xc[0] = pows10[ sd % LOG_BASE ]; - x.e = -sd || 0; - } else { - - // Zero. - xc[0] = x.e = 0; - } - - return x; - } - - // Remove excess digits. - if ( i == 0 ) { - xc.length = ni; - k = 1; - ni--; - } else { - xc.length = ni + 1; - k = pows10[ LOG_BASE - i ]; - - // E.g. 56700 becomes 56000 if 7 is the rounding digit. - // j > 0 means i > number of leading zeros of n. - xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0; - } - - // Round up? - if (r) { - - for ( ; ; ) { - - // If the digit to be rounded up is in the first element of xc... - if ( ni == 0 ) { - - // i will be the length of xc[0] before k is added. - for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ ); - j = xc[0] += k; - for ( k = 1; j >= 10; j /= 10, k++ ); - - // if i != k the length has increased. - if ( i != k ) { - x.e++; - if ( xc[0] == BASE ) xc[0] = 1; - } - - break; - } else { - xc[ni] += k; - if ( xc[ni] != BASE ) break; - xc[ni--] = 0; - k = 1; - } - } - } - - // Remove trailing zeros. - for ( i = xc.length; xc[--i] === 0; xc.pop() ); - } - - // Overflow? Infinity. - if ( x.e > MAX_EXP ) { - x.c = x.e = null; - - // Underflow? Zero. - } else if ( x.e < MIN_EXP ) { - x.c = [ x.e = 0 ]; - } - } - - return x; - } - - - // PROTOTYPE/INSTANCE METHODS - - - /* - * Return a new BigNumber whose value is the absolute value of this BigNumber. - */ - P.absoluteValue = P.abs = function () { - var x = new BigNumber(this); - if ( x.s < 0 ) x.s = 1; - return x; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole - * number in the direction of Infinity. - */ - P.ceil = function () { - return round( new BigNumber(this), this.e + 1, 2 ); - }; - - - /* - * Return - * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), - * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), - * 0 if they have the same value, - * or null if the value of either is NaN. - */ - P.comparedTo = P.cmp = function ( y, b ) { - id = 1; - return compare( this, new BigNumber( y, b ) ); - }; - - - /* - * Return the number of decimal places of the value of this BigNumber, or null if the value - * of this BigNumber is ±Infinity or NaN. - */ - P.decimalPlaces = P.dp = function () { - var n, v, - c = this.c; - - if ( !c ) return null; - n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE; - - // Subtract the number of trailing zeros of the last number. - if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- ); - if ( n < 0 ) n = 0; - - return n; - }; - - - /* - * n / 0 = I - * n / N = N - * n / I = 0 - * 0 / n = 0 - * 0 / 0 = N - * 0 / N = N - * 0 / I = 0 - * N / n = N - * N / 0 = N - * N / N = N - * N / I = N - * I / n = I - * I / 0 = I - * I / N = N - * I / I = N - * - * Return a new BigNumber whose value is the value of this BigNumber divided by the value of - * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.dividedBy = P.div = function ( y, b ) { - id = 3; - return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE ); - }; - - - /* - * Return a new BigNumber whose value is the integer part of dividing the value of this - * BigNumber by the value of BigNumber(y, b). - */ - P.dividedToIntegerBy = P.divToInt = function ( y, b ) { - id = 4; - return div( this, new BigNumber( y, b ), 0, 1 ); - }; - - - /* - * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), - * otherwise returns false. - */ - P.equals = P.eq = function ( y, b ) { - id = 5; - return compare( this, new BigNumber( y, b ) ) === 0; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole - * number in the direction of -Infinity. - */ - P.floor = function () { - return round( new BigNumber(this), this.e + 1, 3 ); - }; - - - /* - * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), - * otherwise returns false. - */ - P.greaterThan = P.gt = function ( y, b ) { - id = 6; - return compare( this, new BigNumber( y, b ) ) > 0; - }; - - - /* - * Return true if the value of this BigNumber is greater than or equal to the value of - * BigNumber(y, b), otherwise returns false. - */ - P.greaterThanOrEqualTo = P.gte = function ( y, b ) { - id = 7; - return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0; - - }; - - - /* - * Return true if the value of this BigNumber is a finite number, otherwise returns false. - */ - P.isFinite = function () { - return !!this.c; - }; - - - /* - * Return true if the value of this BigNumber is an integer, otherwise return false. - */ - P.isInteger = P.isInt = function () { - return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2; - }; - - - /* - * Return true if the value of this BigNumber is NaN, otherwise returns false. - */ - P.isNaN = function () { - return !this.s; - }; - - - /* - * Return true if the value of this BigNumber is negative, otherwise returns false. - */ - P.isNegative = P.isNeg = function () { - return this.s < 0; - }; - - - /* - * Return true if the value of this BigNumber is 0 or -0, otherwise returns false. - */ - P.isZero = function () { - return !!this.c && this.c[0] == 0; - }; - - - /* - * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), - * otherwise returns false. - */ - P.lessThan = P.lt = function ( y, b ) { - id = 8; - return compare( this, new BigNumber( y, b ) ) < 0; - }; - - - /* - * Return true if the value of this BigNumber is less than or equal to the value of - * BigNumber(y, b), otherwise returns false. - */ - P.lessThanOrEqualTo = P.lte = function ( y, b ) { - id = 9; - return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0; - }; - - - /* - * n - 0 = n - * n - N = N - * n - I = -I - * 0 - n = -n - * 0 - 0 = 0 - * 0 - N = N - * 0 - I = -I - * N - n = N - * N - 0 = N - * N - N = N - * N - I = N - * I - n = I - * I - 0 = I - * I - N = N - * I - I = N - * - * Return a new BigNumber whose value is the value of this BigNumber minus the value of - * BigNumber(y, b). - */ - P.minus = P.sub = function ( y, b ) { - var i, j, t, xLTy, - x = this, - a = x.s; - - id = 10; - y = new BigNumber( y, b ); - b = y.s; - - // Either NaN? - if ( !a || !b ) return new BigNumber(NaN); - - // Signs differ? - if ( a != b ) { - y.s = -b; - return x.plus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if ( !xe || !ye ) { - - // Either Infinity? - if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN ); - - // Either zero? - if ( !xc[0] || !yc[0] ) { - - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x : - - // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity - ROUNDING_MODE == 3 ? -0 : 0 ); - } - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Determine which is the bigger number. - if ( a = xe - ye ) { - - if ( xLTy = a < 0 ) { - a = -a; - t = xc; - } else { - ye = xe; - t = yc; - } - - t.reverse(); - - // Prepend zeros to equalise exponents. - for ( b = a; b--; t.push(0) ); - t.reverse(); - } else { - - // Exponents equal. Check digit by digit. - j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b; - - for ( a = b = 0; b < j; b++ ) { - - if ( xc[b] != yc[b] ) { - xLTy = xc[b] < yc[b]; - break; - } - } - } - - // x < y? Point xc to the array of the bigger number. - if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; - - b = ( j = yc.length ) - ( i = xc.length ); - - // Append zeros to xc if shorter. - // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. - if ( b > 0 ) for ( ; b--; xc[i++] = 0 ); - b = BASE - 1; - - // Subtract yc from xc. - for ( ; j > a; ) { - - if ( xc[--j] < yc[j] ) { - for ( i = j; i && !xc[--i]; xc[i] = b ); - --xc[i]; - xc[j] += BASE; - } - - xc[j] -= yc[j]; - } - - // Remove leading zeros and adjust exponent accordingly. - for ( ; xc[0] == 0; xc.shift(), --ye ); - - // Zero? - if ( !xc[0] ) { - - // Following IEEE 754 (2008) 6.3, - // n - n = +0 but n - n = -0 when rounding towards -Infinity. - y.s = ROUNDING_MODE == 3 ? -1 : 1; - y.c = [ y.e = 0 ]; - return y; - } - - // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity - // for finite x and y. - return normalise( y, xc, ye ); - }; - - - /* - * n % 0 = N - * n % N = N - * n % I = n - * 0 % n = 0 - * -0 % n = -0 - * 0 % 0 = N - * 0 % N = N - * 0 % I = 0 - * N % n = N - * N % 0 = N - * N % N = N - * N % I = N - * I % n = N - * I % 0 = N - * I % N = N - * I % I = N - * - * Return a new BigNumber whose value is the value of this BigNumber modulo the value of - * BigNumber(y, b). The result depends on the value of MODULO_MODE. - */ - P.modulo = P.mod = function ( y, b ) { - var q, s, - x = this; - - id = 11; - y = new BigNumber( y, b ); - - // Return NaN if x is Infinity or NaN, or y is NaN or zero. - if ( !x.c || !y.s || y.c && !y.c[0] ) { - return new BigNumber(NaN); - - // Return x if y is Infinity or x is zero. - } else if ( !y.c || x.c && !x.c[0] ) { - return new BigNumber(x); - } - - if ( MODULO_MODE == 9 ) { - - // Euclidian division: q = sign(y) * floor(x / abs(y)) - // r = x - qy where 0 <= r < abs(y) - s = y.s; - y.s = 1; - q = div( x, y, 0, 3 ); - y.s = s; - q.s *= s; - } else { - q = div( x, y, 0, MODULO_MODE ); - } - - return x.minus( q.times(y) ); - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber negated, - * i.e. multiplied by -1. - */ - P.negated = P.neg = function () { - var x = new BigNumber(this); - x.s = -x.s || null; - return x; - }; - - - /* - * n + 0 = n - * n + N = N - * n + I = I - * 0 + n = n - * 0 + 0 = 0 - * 0 + N = N - * 0 + I = I - * N + n = N - * N + 0 = N - * N + N = N - * N + I = N - * I + n = I - * I + 0 = I - * I + N = N - * I + I = I - * - * Return a new BigNumber whose value is the value of this BigNumber plus the value of - * BigNumber(y, b). - */ - P.plus = P.add = function ( y, b ) { - var t, - x = this, - a = x.s; - - id = 12; - y = new BigNumber( y, b ); - b = y.s; - - // Either NaN? - if ( !a || !b ) return new BigNumber(NaN); - - // Signs differ? - if ( a != b ) { - y.s = -b; - return x.minus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if ( !xe || !ye ) { - - // Return ±Infinity if either ±Infinity. - if ( !xc || !yc ) return new BigNumber( a / 0 ); - - // Either zero? - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 ); - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. - if ( a = xe - ye ) { - if ( a > 0 ) { - ye = xe; - t = yc; - } else { - a = -a; - t = xc; - } - - t.reverse(); - for ( ; a--; t.push(0) ); - t.reverse(); - } - - a = xc.length; - b = yc.length; - - // Point xc to the longer array, and b to the shorter length. - if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a; - - // Only start adding at yc.length - 1 as the further digits of xc can be ignored. - for ( a = 0; b; ) { - a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0; - xc[b] %= BASE; - } - - if (a) { - xc.unshift(a); - ++ye; - } - - // No need to check for zero, as +x + +y != 0 && -x + -y != 0 - // ye = MAX_EXP + 1 possible - return normalise( y, xc, ye ); - }; - - - /* - * Return the number of significant digits of the value of this BigNumber. - * - * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0. - */ - P.precision = P.sd = function (z) { - var n, v, - x = this, - c = x.c; - - // 'precision() argument not a boolean or binary digit: {z}' - if ( z != null && z !== !!z && z !== 1 && z !== 0 ) { - if (ERRORS) raise( 13, 'argument' + notBool, z ); - if ( z != !!z ) z = null; - } - - if ( !c ) return null; - v = c.length - 1; - n = v * LOG_BASE + 1; - - if ( v = c[v] ) { - - // Subtract the number of trailing zeros of the last element. - for ( ; v % 10 == 0; v /= 10, n-- ); - - // Add the number of digits of the first element. - for ( v = c[0]; v >= 10; v /= 10, n++ ); - } - - if ( z && x.e + 1 > n ) n = x.e + 1; - - return n; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of - * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if - * omitted. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'round() decimal places out of range: {dp}' - * 'round() decimal places not an integer: {dp}' - * 'round() rounding mode not an integer: {rm}' - * 'round() rounding mode out of range: {rm}' - */ - P.round = function ( dp, rm ) { - var n = new BigNumber(this); - - if ( dp == null || isValidInt( dp, 0, MAX, 15 ) ) { - round( n, ~~dp + this.e + 1, rm == null || - !isValidInt( rm, 0, 8, 15, roundingMode ) ? ROUNDING_MODE : rm | 0 ); - } - - return n; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber shifted by k places - * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. - * - * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. - * - * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity - * otherwise. - * - * 'shift() argument not an integer: {k}' - * 'shift() argument out of range: {k}' - */ - P.shift = function (k) { - var n = this; - return isValidInt( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 16, 'argument' ) - - // k < 1e+21, or truncate(k) will produce exponential notation. - ? n.times( '1e' + truncate(k) ) - : new BigNumber( n.c && n.c[0] && ( k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER ) - ? n.s * ( k < 0 ? 0 : 1 / 0 ) - : n ); - }; - - - /* - * sqrt(-n) = N - * sqrt( N) = N - * sqrt(-I) = N - * sqrt( I) = I - * sqrt( 0) = 0 - * sqrt(-0) = -0 - * - * Return a new BigNumber whose value is the square root of the value of this BigNumber, - * rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.squareRoot = P.sqrt = function () { - var m, n, r, rep, t, - x = this, - c = x.c, - s = x.s, - e = x.e, - dp = DECIMAL_PLACES + 4, - half = new BigNumber('0.5'); - - // Negative/NaN/Infinity/zero? - if ( s !== 1 || !c || !c[0] ) { - return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 ); - } - - // Initial estimate. - s = Math.sqrt( +x ); - - // Math.sqrt underflow/overflow? - // Pass x to Math.sqrt as integer, then adjust the exponent of the result. - if ( s == 0 || s == 1 / 0 ) { - n = coeffToString(c); - if ( ( n.length + e ) % 2 == 0 ) n += '0'; - s = Math.sqrt(n); - e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 ); - - if ( s == 1 / 0 ) { - n = '1e' + e; - } else { - n = s.toExponential(); - n = n.slice( 0, n.indexOf('e') + 1 ) + e; - } - - r = new BigNumber(n); - } else { - r = new BigNumber( s + '' ); - } - - // Check for zero. - // r could be zero if MIN_EXP is changed after the this value was created. - // This would cause a division by zero (x/t) and hence Infinity below, which would cause - // coeffToString to throw. - if ( r.c[0] ) { - e = r.e; - s = e + dp; - if ( s < 3 ) s = 0; - - // Newton-Raphson iteration. - for ( ; ; ) { - t = r; - r = half.times( t.plus( div( x, t, dp, 1 ) ) ); - - if ( coeffToString( t.c ).slice( 0, s ) === ( n = - coeffToString( r.c ) ).slice( 0, s ) ) { - - // The exponent of r may here be one less than the final result exponent, - // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits - // are indexed correctly. - if ( r.e < e ) --s; - n = n.slice( s - 3, s + 1 ); - - // The 4th rounding digit may be in error by -1 so if the 4 rounding digits - // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the - // iteration. - if ( n == '9999' || !rep && n == '4999' ) { - - // On the first iteration only, check to see if rounding up gives the - // exact result as the nines may infinitely repeat. - if ( !rep ) { - round( t, t.e + DECIMAL_PLACES + 2, 0 ); - - if ( t.times(t).eq(x) ) { - r = t; - break; - } - } - - dp += 4; - s += 4; - rep = 1; - } else { - - // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact - // result. If not, then there are further digits and m will be truthy. - if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) { - - // Truncate to the first rounding digit. - round( r, r.e + DECIMAL_PLACES + 2, 1 ); - m = !r.times(r).eq(x); - } - - break; - } - } - } - } - - return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m ); - }; - - - /* - * n * 0 = 0 - * n * N = N - * n * I = I - * 0 * n = 0 - * 0 * 0 = 0 - * 0 * N = N - * 0 * I = N - * N * n = N - * N * 0 = N - * N * N = N - * N * I = N - * I * n = I - * I * 0 = N - * I * N = N - * I * I = I - * - * Return a new BigNumber whose value is the value of this BigNumber times the value of - * BigNumber(y, b). - */ - P.times = P.mul = function ( y, b ) { - var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, - base, sqrtBase, - x = this, - xc = x.c, - yc = ( id = 17, y = new BigNumber( y, b ) ).c; - - // Either NaN, ±Infinity or ±0? - if ( !xc || !yc || !xc[0] || !yc[0] ) { - - // Return NaN if either is NaN, or one is 0 and the other is Infinity. - if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) { - y.c = y.e = y.s = null; - } else { - y.s *= x.s; - - // Return ±Infinity if either is ±Infinity. - if ( !xc || !yc ) { - y.c = y.e = null; - - // Return ±0 if either is ±0. - } else { - y.c = [0]; - y.e = 0; - } - } - - return y; - } - - e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE ); - y.s *= x.s; - xcL = xc.length; - ycL = yc.length; - - // Ensure xc points to longer array and xcL to its length. - if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; - - // Initialise the result array with zeros. - for ( i = xcL + ycL, zc = []; i--; zc.push(0) ); - - base = BASE; - sqrtBase = SQRT_BASE; - - for ( i = ycL; --i >= 0; ) { - c = 0; - ylo = yc[i] % sqrtBase; - yhi = yc[i] / sqrtBase | 0; - - for ( k = xcL, j = i + k; j > i; ) { - xlo = xc[--k] % sqrtBase; - xhi = xc[k] / sqrtBase | 0; - m = yhi * xlo + xhi * ylo; - xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c; - c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi; - zc[j--] = xlo % base; - } - - zc[j] = c; - } - - if (c) { - ++e; - } else { - zc.shift(); - } - - return normalise( y, zc, e ); - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of - * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'toDigits() precision out of range: {sd}' - * 'toDigits() precision not an integer: {sd}' - * 'toDigits() rounding mode not an integer: {rm}' - * 'toDigits() rounding mode out of range: {rm}' - */ - P.toDigits = function ( sd, rm ) { - var n = new BigNumber(this); - sd = sd == null || !isValidInt( sd, 1, MAX, 18, 'precision' ) ? null : sd | 0; - rm = rm == null || !isValidInt( rm, 0, 8, 18, roundingMode ) ? ROUNDING_MODE : rm | 0; - return sd ? round( n, sd, rm ) : n; - }; - - - /* - * Return a string representing the value of this BigNumber in exponential notation and - * rounded using ROUNDING_MODE to dp fixed decimal places. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'toExponential() decimal places not an integer: {dp}' - * 'toExponential() decimal places out of range: {dp}' - * 'toExponential() rounding mode not an integer: {rm}' - * 'toExponential() rounding mode out of range: {rm}' - */ - P.toExponential = function ( dp, rm ) { - return format( this, - dp != null && isValidInt( dp, 0, MAX, 19 ) ? ~~dp + 1 : null, rm, 19 ); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounding - * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', - * but e.g. (-0.00001).toFixed(0) is '-0'. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'toFixed() decimal places not an integer: {dp}' - * 'toFixed() decimal places out of range: {dp}' - * 'toFixed() rounding mode not an integer: {rm}' - * 'toFixed() rounding mode out of range: {rm}' - */ - P.toFixed = function ( dp, rm ) { - return format( this, dp != null && isValidInt( dp, 0, MAX, 20 ) - ? ~~dp + this.e + 1 : null, rm, 20 ); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounded - * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties - * of the FORMAT object (see BigNumber.config). - * - * FORMAT = { - * decimalSeparator : '.', - * groupSeparator : ',', - * groupSize : 3, - * secondaryGroupSize : 0, - * fractionGroupSeparator : '\xA0', // non-breaking space - * fractionGroupSize : 0 - * }; - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'toFormat() decimal places not an integer: {dp}' - * 'toFormat() decimal places out of range: {dp}' - * 'toFormat() rounding mode not an integer: {rm}' - * 'toFormat() rounding mode out of range: {rm}' - */ - P.toFormat = function ( dp, rm ) { - var str = format( this, dp != null && isValidInt( dp, 0, MAX, 21 ) - ? ~~dp + this.e + 1 : null, rm, 21 ); - - if ( this.c ) { - var i, - arr = str.split('.'), - g1 = +FORMAT.groupSize, - g2 = +FORMAT.secondaryGroupSize, - groupSeparator = FORMAT.groupSeparator, - intPart = arr[0], - fractionPart = arr[1], - isNeg = this.s < 0, - intDigits = isNeg ? intPart.slice(1) : intPart, - len = intDigits.length; - - if (g2) i = g1, g1 = g2, g2 = i, len -= i; - - if ( g1 > 0 && len > 0 ) { - i = len % g1 || g1; - intPart = intDigits.substr( 0, i ); - - for ( ; i < len; i += g1 ) { - intPart += groupSeparator + intDigits.substr( i, g1 ); - } - - if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i); - if (isNeg) intPart = '-' + intPart; - } - - str = fractionPart - ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize ) - ? fractionPart.replace( new RegExp( '\\d{' + g2 + '}\\B', 'g' ), - '$&' + FORMAT.fractionGroupSeparator ) - : fractionPart ) - : intPart; - } - - return str; - }; - - - /* - * Return a string array representing the value of this BigNumber as a simple fraction with - * an integer numerator and an integer denominator. The denominator will be a positive - * non-zero value less than or equal to the specified maximum denominator. If a maximum - * denominator is not specified, the denominator will be the lowest value necessary to - * represent the number exactly. - * - * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator. - * - * 'toFraction() max denominator not an integer: {md}' - * 'toFraction() max denominator out of range: {md}' - */ - P.toFraction = function (md) { - var arr, d0, d2, e, exp, n, n0, q, s, - k = ERRORS, - x = this, - xc = x.c, - d = new BigNumber(ONE), - n1 = d0 = new BigNumber(ONE), - d1 = n0 = new BigNumber(ONE); - - if ( md != null ) { - ERRORS = false; - n = new BigNumber(md); - ERRORS = k; - - if ( !( k = n.isInt() ) || n.lt(ONE) ) { - - if (ERRORS) { - raise( 22, - 'max denominator ' + ( k ? 'out of range' : 'not an integer' ), md ); - } - - // ERRORS is false: - // If md is a finite non-integer >= 1, round it to an integer and use it. - md = !k && n.c && round( n, n.e + 1, 1 ).gte(ONE) ? n : null; - } - } - - if ( !xc ) return x.toString(); - s = coeffToString(xc); - - // Determine initial denominator. - // d is a power of 10 and the minimum max denominator that specifies the value exactly. - e = d.e = s.length - x.e - 1; - d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ]; - md = !md || n.cmp(d) > 0 ? ( e > 0 ? d : n1 ) : n; - - exp = MAX_EXP; - MAX_EXP = 1 / 0; - n = new BigNumber(s); - - // n0 = d1 = 0 - n0.c[0] = 0; - - for ( ; ; ) { - q = div( n, d, 0, 1 ); - d2 = d0.plus( q.times(d1) ); - if ( d2.cmp(md) == 1 ) break; - d0 = d1; - d1 = d2; - n1 = n0.plus( q.times( d2 = n1 ) ); - n0 = d2; - d = n.minus( q.times( d2 = d ) ); - n = d2; - } - - d2 = div( md.minus(d0), d1, 0, 1 ); - n0 = n0.plus( d2.times(n1) ); - d0 = d0.plus( d2.times(d1) ); - n0.s = n1.s = x.s; - e *= 2; - - // Determine which fraction is closer to x, n0/d0 or n1/d1 - arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().cmp( - div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1 - ? [ n1.toString(), d1.toString() ] - : [ n0.toString(), d0.toString() ]; - - MAX_EXP = exp; - return arr; - }; - - - /* - * Return the value of this BigNumber converted to a number primitive. - */ - P.toNumber = function () { - var x = this; - - // Ensure zero has correct sign. - return +x || ( x.s ? x.s * 0 : NaN ); - }; - - - /* - * Return a BigNumber whose value is the value of this BigNumber raised to the power n. - * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. - * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE. - * - * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive. - * (Performs 54 loop iterations for n of 9007199254740992.) - * - * 'pow() exponent not an integer: {n}' - * 'pow() exponent out of range: {n}' - */ - P.toPower = P.pow = function (n) { - var k, y, - i = mathfloor( n < 0 ? -n : +n ), - x = this; - - // Pass ±Infinity to Math.pow if exponent is out of range. - if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) && - ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) || - parseFloat(n) != n && !( n = NaN ) ) ) { - return new BigNumber( Math.pow( +x, n ) ); - } - - // Truncating each coefficient array to a length of k after each multiplication equates - // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a - // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.) - k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0; - y = new BigNumber(ONE); - - for ( ; ; ) { - - if ( i % 2 ) { - y = y.times(x); - if ( !y.c ) break; - if ( k && y.c.length > k ) y.c.length = k; - } - - i = mathfloor( i / 2 ); - if ( !i ) break; - - x = x.times(x); - if ( k && x.c && x.c.length > k ) x.c.length = k; - } - - if ( n < 0 ) y = ONE.div(y); - return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y; - }; - - - /* - * Return a string representing the value of this BigNumber rounded to sd significant digits - * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits - * necessary to represent the integer part of the value in fixed-point notation, then use - * exponential notation. - * - * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * 'toPrecision() precision not an integer: {sd}' - * 'toPrecision() precision out of range: {sd}' - * 'toPrecision() rounding mode not an integer: {rm}' - * 'toPrecision() rounding mode out of range: {rm}' - */ - P.toPrecision = function ( sd, rm ) { - return format( this, sd != null && isValidInt( sd, 1, MAX, 24, 'precision' ) - ? sd | 0 : null, rm, 24 ); - }; - - - /* - * Return a string representing the value of this BigNumber in base b, or base 10 if b is - * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and - * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent - * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than - * TO_EXP_NEG, return exponential notation. - * - * [b] {number} Integer, 2 to 64 inclusive. - * - * 'toString() base not an integer: {b}' - * 'toString() base out of range: {b}' - */ - P.toString = function (b) { - var str, - n = this, - s = n.s, - e = n.e; - - // Infinity or NaN? - if ( e === null ) { - - if (s) { - str = 'Infinity'; - if ( s < 0 ) str = '-' + str; - } else { - str = 'NaN'; - } - } else { - str = coeffToString( n.c ); - - if ( b == null || !isValidInt( b, 2, 64, 25, 'base' ) ) { - str = e <= TO_EXP_NEG || e >= TO_EXP_POS - ? toExponential( str, e ) - : toFixedPoint( str, e ); - } else { - str = convertBase( toFixedPoint( str, e ), b | 0, 10, s ); - } - - if ( s < 0 && n.c[0] ) str = '-' + str; - } - - return str; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole - * number. - */ - P.truncated = P.trunc = function () { - return round( new BigNumber(this), this.e + 1, 1 ); - }; - - - - /* - * Return as toString, but do not accept a base argument. - */ - P.valueOf = P.toJSON = function () { - return this.toString(); - }; - - - // Aliases for BigDecimal methods. - //P.add = P.plus; // P.add included above - //P.subtract = P.minus; // P.sub included above - //P.multiply = P.times; // P.mul included above - //P.divide = P.div; - //P.remainder = P.mod; - //P.compareTo = P.cmp; - //P.negate = P.neg; - - - if ( configObj != null ) BigNumber.config(configObj); - - return BigNumber; - } - - - // PRIVATE HELPER FUNCTIONS - - - function bitFloor(n) { - var i = n | 0; - return n > 0 || n === i ? i : i - 1; - } - - - // Return a coefficient array as a string of base 10 digits. - function coeffToString(a) { - var s, z, - i = 1, - j = a.length, - r = a[0] + ''; - - for ( ; i < j; ) { - s = a[i++] + ''; - z = LOG_BASE - s.length; - for ( ; z--; s = '0' + s ); - r += s; - } - - // Determine trailing zeros. - for ( j = r.length; r.charCodeAt(--j) === 48; ); - return r.slice( 0, j + 1 || 1 ); - } - - - // Compare the value of BigNumbers x and y. - function compare( x, y ) { - var a, b, - xc = x.c, - yc = y.c, - i = x.s, - j = y.s, - k = x.e, - l = y.e; - - // Either NaN? - if ( !i || !j ) return null; - - a = xc && !xc[0]; - b = yc && !yc[0]; - - // Either zero? - if ( a || b ) return a ? b ? 0 : -j : i; - - // Signs differ? - if ( i != j ) return i; - - a = i < 0; - b = k == l; - - // Either Infinity? - if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1; - - // Compare exponents. - if ( !b ) return k > l ^ a ? 1 : -1; - - j = ( k = xc.length ) < ( l = yc.length ) ? k : l; - - // Compare digit by digit. - for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1; - - // Compare lengths. - return k == l ? 0 : k > l ^ a ? 1 : -1; - } - - - /* - * Return true if n is a valid number in range, otherwise false. - * Use for argument validation when ERRORS is false. - * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10. - */ - function intValidatorNoErrors( n, min, max ) { - return ( n = truncate(n) ) >= min && n <= max; - } - - - function isArray(obj) { - return Object.prototype.toString.call(obj) == '[object Array]'; - } - - - /* - * Convert string of baseIn to an array of numbers of baseOut. - * Eg. convertBase('255', 10, 16) returns [15, 15]. - * Eg. convertBase('ff', 16, 10) returns [2, 5, 5]. - */ - function toBaseOut( str, baseIn, baseOut ) { - var j, - arr = [0], - arrL, - i = 0, - len = str.length; - - for ( ; i < len; ) { - for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn ); - arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) ); - - for ( ; j < arr.length; j++ ) { - - if ( arr[j] > baseOut - 1 ) { - if ( arr[j + 1] == null ) arr[j + 1] = 0; - arr[j + 1] += arr[j] / baseOut | 0; - arr[j] %= baseOut; - } - } - } - - return arr.reverse(); - } - - - function toExponential( str, e ) { - return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) + - ( e < 0 ? 'e' : 'e+' ) + e; - } - - - function toFixedPoint( str, e ) { - var len, z; - - // Negative exponent? - if ( e < 0 ) { - - // Prepend zeros. - for ( z = '0.'; ++e; z += '0' ); - str = z + str; - - // Positive exponent - } else { - len = str.length; - - // Append zeros. - if ( ++e > len ) { - for ( z = '0', e -= len; --e; z += '0' ); - str += z; - } else if ( e < len ) { - str = str.slice( 0, e ) + '.' + str.slice(e); - } - } - - return str; - } - - - function truncate(n) { - n = parseFloat(n); - return n < 0 ? mathceil(n) : mathfloor(n); - } - - - // EXPORT - - - BigNumber = another(); - - // AMD. - if ( true ) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return BigNumber; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - // Node and other environments that support module.exports. - } else {} -})(this); - - -/***/ }), - -/***/ "./node_modules/bn.js/lib/bn.js": -/*!**************************************!*\ - !*** ./node_modules/bn.js/lib/bn.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = __webpack_require__(/*! buffer */ 0).Buffer; - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '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' - ]; - - var groupSizes = [ - 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 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) { - // No-op, we should not move anything at all - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - r.strip(); - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1).toRed(this); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(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); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(typeof module === 'undefined' || module, this); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/brcast/dist/brcast.es.js": -/*!***********************************************!*\ - !*** ./node_modules/brcast/dist/brcast.es.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -function createBroadcast (initialState) { - var listeners = {}; - var id = 1; - var _state = initialState; - - function getState () { - return _state - } - - function setState (state) { - _state = state; - var keys = Object.keys(listeners); - var i = 0; - var len = keys.length; - for (; i < len; i++) { - // if a listener gets unsubscribed during setState we just skip it - if (listeners[keys[i]]) { listeners[keys[i]](state); } - } - } - - // subscribe to changes and return the subscriptionId - function subscribe (listener) { - if (typeof listener !== 'function') { - throw new Error('listener must be a function.') - } - var currentId = id; - listeners[currentId] = listener; - id += 1; - return currentId - } - - // remove subscription by removing the listener function - function unsubscribe (id) { - listeners[id] = undefined; - } - - return { getState: getState, setState: setState, subscribe: subscribe, unsubscribe: unsubscribe } -} - -/* harmony default export */ __webpack_exports__["default"] = (createBroadcast); - - -/***/ }), - -/***/ "./node_modules/brorand/index.js": -/*!***************************************!*\ - !*** ./node_modules/brorand/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var r; - -module.exports = function rand(len) { - if (!r) - r = new Rand(null); - - return r.generate(len); -}; - -function Rand(rand) { - this.rand = rand; -} -module.exports.Rand = Rand; - -Rand.prototype.generate = function generate(len) { - return this._rand(len); -}; - -// Emulate crypto API using randy -Rand.prototype._rand = function _rand(n) { - if (this.rand.getBytes) - return this.rand.getBytes(n); - - var res = new Uint8Array(n); - for (var i = 0; i < res.length; i++) - res[i] = this.rand.getByte(); - return res; -}; - -if (typeof self === 'object') { - if (self.crypto && self.crypto.getRandomValues) { - // Modern browsers - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.crypto.getRandomValues(arr); - return arr; - }; - } else if (self.msCrypto && self.msCrypto.getRandomValues) { - // IE - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.msCrypto.getRandomValues(arr); - return arr; - }; - - // Safari's WebWorkers do not have `crypto` - } else if (typeof window === 'object') { - // Old junk - Rand.prototype._rand = function() { - throw new Error('Not implemented yet'); - }; - } -} else { - // Node.js or Web worker with no crypto support - try { - var crypto = __webpack_require__(/*! crypto */ 3); - if (typeof crypto.randomBytes !== 'function') - throw new Error('Not supported'); - - Rand.prototype._rand = function _rand(n) { - return crypto.randomBytes(n); - }; - } catch (e) { - } -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/aes.js": -/*!********************************************!*\ - !*** ./node_modules/browserify-aes/aes.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// based on the aes implimentation in triple sec -// https://github.com/keybase/triplesec -// which is in turn based on the one from crypto-js -// https://code.google.com/p/crypto-js/ - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer - -function asUInt32Array (buf) { - if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf) - - var len = (buf.length / 4) | 0 - var out = new Array(len) - - for (var i = 0; i < len; i++) { - out[i] = buf.readUInt32BE(i * 4) - } - - return out -} - -function scrubVec (v) { - for (var i = 0; i < v.length; v++) { - v[i] = 0 - } -} - -function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) { - var SUB_MIX0 = SUB_MIX[0] - var SUB_MIX1 = SUB_MIX[1] - var SUB_MIX2 = SUB_MIX[2] - var SUB_MIX3 = SUB_MIX[3] - - var s0 = M[0] ^ keySchedule[0] - var s1 = M[1] ^ keySchedule[1] - var s2 = M[2] ^ keySchedule[2] - var s3 = M[3] ^ keySchedule[3] - var t0, t1, t2, t3 - var ksRow = 4 - - for (var round = 1; round < nRounds; round++) { - t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++] - t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++] - t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++] - t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++] - s0 = t0 - s1 = t1 - s2 = t2 - s3 = t3 - } - - t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++] - t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++] - t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++] - t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++] - t0 = t0 >>> 0 - t1 = t1 >>> 0 - t2 = t2 >>> 0 - t3 = t3 >>> 0 - - return [t0, t1, t2, t3] -} - -// AES constants -var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36] -var G = (function () { - // Compute double table - var d = new Array(256) - for (var j = 0; j < 256; j++) { - if (j < 128) { - d[j] = j << 1 - } else { - d[j] = (j << 1) ^ 0x11b - } - } - - var SBOX = [] - var INV_SBOX = [] - var SUB_MIX = [[], [], [], []] - var INV_SUB_MIX = [[], [], [], []] - - // Walk GF(2^8) - var x = 0 - var xi = 0 - for (var i = 0; i < 256; ++i) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4) - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63 - SBOX[x] = sx - INV_SBOX[sx] = x - - // Compute multiplication - var x2 = d[x] - var x4 = d[x2] - var x8 = d[x4] - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100) - SUB_MIX[0][x] = (t << 24) | (t >>> 8) - SUB_MIX[1][x] = (t << 16) | (t >>> 16) - SUB_MIX[2][x] = (t << 8) | (t >>> 24) - SUB_MIX[3][x] = t - - // Compute inv sub bytes, inv mix columns tables - t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100) - INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8) - INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16) - INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24) - INV_SUB_MIX[3][sx] = t - - if (x === 0) { - x = xi = 1 - } else { - x = x2 ^ d[d[d[x8 ^ x2]]] - xi ^= d[d[xi]] - } - } - - return { - SBOX: SBOX, - INV_SBOX: INV_SBOX, - SUB_MIX: SUB_MIX, - INV_SUB_MIX: INV_SUB_MIX - } -})() - -function AES (key) { - this._key = asUInt32Array(key) - this._reset() -} - -AES.blockSize = 4 * 4 -AES.keySize = 256 / 8 -AES.prototype.blockSize = AES.blockSize -AES.prototype.keySize = AES.keySize -AES.prototype._reset = function () { - var keyWords = this._key - var keySize = keyWords.length - var nRounds = keySize + 6 - var ksRows = (nRounds + 1) * 4 - - var keySchedule = [] - for (var k = 0; k < keySize; k++) { - keySchedule[k] = keyWords[k] - } - - for (k = keySize; k < ksRows; k++) { - var t = keySchedule[k - 1] - - if (k % keySize === 0) { - t = (t << 8) | (t >>> 24) - t = - (G.SBOX[t >>> 24] << 24) | - (G.SBOX[(t >>> 16) & 0xff] << 16) | - (G.SBOX[(t >>> 8) & 0xff] << 8) | - (G.SBOX[t & 0xff]) - - t ^= RCON[(k / keySize) | 0] << 24 - } else if (keySize > 6 && k % keySize === 4) { - t = - (G.SBOX[t >>> 24] << 24) | - (G.SBOX[(t >>> 16) & 0xff] << 16) | - (G.SBOX[(t >>> 8) & 0xff] << 8) | - (G.SBOX[t & 0xff]) - } - - keySchedule[k] = keySchedule[k - keySize] ^ t - } - - var invKeySchedule = [] - for (var ik = 0; ik < ksRows; ik++) { - var ksR = ksRows - ik - var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)] - - if (ik < 4 || ksR <= 4) { - invKeySchedule[ik] = tt - } else { - invKeySchedule[ik] = - G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ - G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^ - G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^ - G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]] - } - } - - this._nRounds = nRounds - this._keySchedule = keySchedule - this._invKeySchedule = invKeySchedule -} - -AES.prototype.encryptBlockRaw = function (M) { - M = asUInt32Array(M) - return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds) -} - -AES.prototype.encryptBlock = function (M) { - var out = this.encryptBlockRaw(M) - var buf = Buffer.allocUnsafe(16) - buf.writeUInt32BE(out[0], 0) - buf.writeUInt32BE(out[1], 4) - buf.writeUInt32BE(out[2], 8) - buf.writeUInt32BE(out[3], 12) - return buf -} - -AES.prototype.decryptBlock = function (M) { - M = asUInt32Array(M) - - // swap - var m1 = M[1] - M[1] = M[3] - M[3] = m1 - - var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds) - var buf = Buffer.allocUnsafe(16) - buf.writeUInt32BE(out[0], 0) - buf.writeUInt32BE(out[3], 4) - buf.writeUInt32BE(out[2], 8) - buf.writeUInt32BE(out[1], 12) - return buf -} - -AES.prototype.scrub = function () { - scrubVec(this._keySchedule) - scrubVec(this._invKeySchedule) - scrubVec(this._key) -} - -module.exports.AES = AES - - -/***/ }), - -/***/ "./node_modules/browserify-aes/authCipher.js": -/*!***************************************************!*\ - !*** ./node_modules/browserify-aes/authCipher.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var aes = __webpack_require__(/*! ./aes */ "./node_modules/browserify-aes/aes.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var Transform = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var GHASH = __webpack_require__(/*! ./ghash */ "./node_modules/browserify-aes/ghash.js") -var xor = __webpack_require__(/*! buffer-xor */ "./node_modules/buffer-xor/index.js") -var incr32 = __webpack_require__(/*! ./incr32 */ "./node_modules/browserify-aes/incr32.js") - -function xorTest (a, b) { - var out = 0 - if (a.length !== b.length) out++ - - var len = Math.min(a.length, b.length) - for (var i = 0; i < len; ++i) { - out += (a[i] ^ b[i]) - } - - return out -} - -function calcIv (self, iv, ck) { - if (iv.length === 12) { - self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])]) - return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])]) - } - var ghash = new GHASH(ck) - var len = iv.length - var toPad = len % 16 - ghash.update(iv) - if (toPad) { - toPad = 16 - toPad - ghash.update(Buffer.alloc(toPad, 0)) - } - ghash.update(Buffer.alloc(8, 0)) - var ivBits = len * 8 - var tail = Buffer.alloc(8) - tail.writeUIntBE(ivBits, 0, 8) - ghash.update(tail) - self._finID = ghash.state - var out = Buffer.from(self._finID) - incr32(out) - return out -} -function StreamCipher (mode, key, iv, decrypt) { - Transform.call(this) - - var h = Buffer.alloc(4, 0) - - this._cipher = new aes.AES(key) - var ck = this._cipher.encryptBlock(h) - this._ghash = new GHASH(ck) - iv = calcIv(this, iv, ck) - - this._prev = Buffer.from(iv) - this._cache = Buffer.allocUnsafe(0) - this._secCache = Buffer.allocUnsafe(0) - this._decrypt = decrypt - this._alen = 0 - this._len = 0 - this._mode = mode - - this._authTag = null - this._called = false -} - -inherits(StreamCipher, Transform) - -StreamCipher.prototype._update = function (chunk) { - if (!this._called && this._alen) { - var rump = 16 - (this._alen % 16) - if (rump < 16) { - rump = Buffer.alloc(rump, 0) - this._ghash.update(rump) - } - } - - this._called = true - var out = this._mode.encrypt(this, chunk) - if (this._decrypt) { - this._ghash.update(chunk) - } else { - this._ghash.update(out) - } - this._len += chunk.length - return out -} - -StreamCipher.prototype._final = function () { - if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data') - - var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID)) - if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data') - - this._authTag = tag - this._cipher.scrub() -} - -StreamCipher.prototype.getAuthTag = function getAuthTag () { - if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state') - - return this._authTag -} - -StreamCipher.prototype.setAuthTag = function setAuthTag (tag) { - if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state') - - this._authTag = tag -} - -StreamCipher.prototype.setAAD = function setAAD (buf) { - if (this._called) throw new Error('Attempting to set AAD in unsupported state') - - this._ghash.update(buf) - this._alen += buf.length -} - -module.exports = StreamCipher - - -/***/ }), - -/***/ "./node_modules/browserify-aes/browser.js": -/*!************************************************!*\ - !*** ./node_modules/browserify-aes/browser.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var ciphers = __webpack_require__(/*! ./encrypter */ "./node_modules/browserify-aes/encrypter.js") -var deciphers = __webpack_require__(/*! ./decrypter */ "./node_modules/browserify-aes/decrypter.js") -var modes = __webpack_require__(/*! ./modes/list.json */ "./node_modules/browserify-aes/modes/list.json") - -function getCiphers () { - return Object.keys(modes) -} - -exports.createCipher = exports.Cipher = ciphers.createCipher -exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv -exports.createDecipher = exports.Decipher = deciphers.createDecipher -exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv -exports.listCiphers = exports.getCiphers = getCiphers - - -/***/ }), - -/***/ "./node_modules/browserify-aes/decrypter.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/decrypter.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var AuthCipher = __webpack_require__(/*! ./authCipher */ "./node_modules/browserify-aes/authCipher.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var MODES = __webpack_require__(/*! ./modes */ "./node_modules/browserify-aes/modes/index.js") -var StreamCipher = __webpack_require__(/*! ./streamCipher */ "./node_modules/browserify-aes/streamCipher.js") -var Transform = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var aes = __webpack_require__(/*! ./aes */ "./node_modules/browserify-aes/aes.js") -var ebtk = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function Decipher (mode, key, iv) { - Transform.call(this) - - this._cache = new Splitter() - this._last = void 0 - this._cipher = new aes.AES(key) - this._prev = Buffer.from(iv) - this._mode = mode - this._autopadding = true -} - -inherits(Decipher, Transform) - -Decipher.prototype._update = function (data) { - this._cache.add(data) - var chunk - var thing - var out = [] - while ((chunk = this._cache.get(this._autopadding))) { - thing = this._mode.decrypt(this, chunk) - out.push(thing) - } - return Buffer.concat(out) -} - -Decipher.prototype._final = function () { - var chunk = this._cache.flush() - if (this._autopadding) { - return unpad(this._mode.decrypt(this, chunk)) - } else if (chunk) { - throw new Error('data not multiple of block length') - } -} - -Decipher.prototype.setAutoPadding = function (setTo) { - this._autopadding = !!setTo - return this -} - -function Splitter () { - this.cache = Buffer.allocUnsafe(0) -} - -Splitter.prototype.add = function (data) { - this.cache = Buffer.concat([this.cache, data]) -} - -Splitter.prototype.get = function (autoPadding) { - var out - if (autoPadding) { - if (this.cache.length > 16) { - out = this.cache.slice(0, 16) - this.cache = this.cache.slice(16) - return out - } - } else { - if (this.cache.length >= 16) { - out = this.cache.slice(0, 16) - this.cache = this.cache.slice(16) - return out - } - } - - return null -} - -Splitter.prototype.flush = function () { - if (this.cache.length) return this.cache -} - -function unpad (last) { - var padded = last[15] - var i = -1 - while (++i < padded) { - if (last[(i + (16 - padded))] !== padded) { - throw new Error('unable to decrypt data') - } - } - if (padded === 16) return - - return last.slice(0, 16 - padded) -} - -function createDecipheriv (suite, password, iv) { - var config = MODES[suite.toLowerCase()] - if (!config) throw new TypeError('invalid suite type') - - if (typeof iv === 'string') iv = Buffer.from(iv) - if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length) - - if (typeof password === 'string') password = Buffer.from(password) - if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length) - - if (config.type === 'stream') { - return new StreamCipher(config.module, password, iv, true) - } else if (config.type === 'auth') { - return new AuthCipher(config.module, password, iv, true) - } - - return new Decipher(config.module, password, iv) -} - -function createDecipher (suite, password) { - var config = MODES[suite.toLowerCase()] - if (!config) throw new TypeError('invalid suite type') - - var keys = ebtk(password, false, config.key, config.iv) - return createDecipheriv(suite, keys.key, keys.iv) -} - -exports.createDecipher = createDecipher -exports.createDecipheriv = createDecipheriv - - -/***/ }), - -/***/ "./node_modules/browserify-aes/encrypter.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/encrypter.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var MODES = __webpack_require__(/*! ./modes */ "./node_modules/browserify-aes/modes/index.js") -var AuthCipher = __webpack_require__(/*! ./authCipher */ "./node_modules/browserify-aes/authCipher.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var StreamCipher = __webpack_require__(/*! ./streamCipher */ "./node_modules/browserify-aes/streamCipher.js") -var Transform = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var aes = __webpack_require__(/*! ./aes */ "./node_modules/browserify-aes/aes.js") -var ebtk = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function Cipher (mode, key, iv) { - Transform.call(this) - - this._cache = new Splitter() - this._cipher = new aes.AES(key) - this._prev = Buffer.from(iv) - this._mode = mode - this._autopadding = true -} - -inherits(Cipher, Transform) - -Cipher.prototype._update = function (data) { - this._cache.add(data) - var chunk - var thing - var out = [] - - while ((chunk = this._cache.get())) { - thing = this._mode.encrypt(this, chunk) - out.push(thing) - } - - return Buffer.concat(out) -} - -var PADDING = Buffer.alloc(16, 0x10) - -Cipher.prototype._final = function () { - var chunk = this._cache.flush() - if (this._autopadding) { - chunk = this._mode.encrypt(this, chunk) - this._cipher.scrub() - return chunk - } - - if (!chunk.equals(PADDING)) { - this._cipher.scrub() - throw new Error('data not multiple of block length') - } -} - -Cipher.prototype.setAutoPadding = function (setTo) { - this._autopadding = !!setTo - return this -} - -function Splitter () { - this.cache = Buffer.allocUnsafe(0) -} - -Splitter.prototype.add = function (data) { - this.cache = Buffer.concat([this.cache, data]) -} - -Splitter.prototype.get = function () { - if (this.cache.length > 15) { - var out = this.cache.slice(0, 16) - this.cache = this.cache.slice(16) - return out - } - return null -} - -Splitter.prototype.flush = function () { - var len = 16 - this.cache.length - var padBuff = Buffer.allocUnsafe(len) - - var i = -1 - while (++i < len) { - padBuff.writeUInt8(len, i) - } - - return Buffer.concat([this.cache, padBuff]) -} - -function createCipheriv (suite, password, iv) { - var config = MODES[suite.toLowerCase()] - if (!config) throw new TypeError('invalid suite type') - - if (typeof password === 'string') password = Buffer.from(password) - if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length) - - if (typeof iv === 'string') iv = Buffer.from(iv) - if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length) - - if (config.type === 'stream') { - return new StreamCipher(config.module, password, iv) - } else if (config.type === 'auth') { - return new AuthCipher(config.module, password, iv) - } - - return new Cipher(config.module, password, iv) -} - -function createCipher (suite, password) { - var config = MODES[suite.toLowerCase()] - if (!config) throw new TypeError('invalid suite type') - - var keys = ebtk(password, false, config.key, config.iv) - return createCipheriv(suite, keys.key, keys.iv) -} - -exports.createCipheriv = createCipheriv -exports.createCipher = createCipher - - -/***/ }), - -/***/ "./node_modules/browserify-aes/ghash.js": -/*!**********************************************!*\ - !*** ./node_modules/browserify-aes/ghash.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var ZEROES = Buffer.alloc(16, 0) - -function toArray (buf) { - return [ - buf.readUInt32BE(0), - buf.readUInt32BE(4), - buf.readUInt32BE(8), - buf.readUInt32BE(12) - ] -} - -function fromArray (out) { - var buf = Buffer.allocUnsafe(16) - buf.writeUInt32BE(out[0] >>> 0, 0) - buf.writeUInt32BE(out[1] >>> 0, 4) - buf.writeUInt32BE(out[2] >>> 0, 8) - buf.writeUInt32BE(out[3] >>> 0, 12) - return buf -} - -function GHASH (key) { - this.h = key - this.state = Buffer.alloc(16, 0) - this.cache = Buffer.allocUnsafe(0) -} - -// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html -// by Juho Vähä-Herttua -GHASH.prototype.ghash = function (block) { - var i = -1 - while (++i < block.length) { - this.state[i] ^= block[i] - } - this._multiply() -} - -GHASH.prototype._multiply = function () { - var Vi = toArray(this.h) - var Zi = [0, 0, 0, 0] - var j, xi, lsbVi - var i = -1 - while (++i < 128) { - xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0 - if (xi) { - // Z_i+1 = Z_i ^ V_i - Zi[0] ^= Vi[0] - Zi[1] ^= Vi[1] - Zi[2] ^= Vi[2] - Zi[3] ^= Vi[3] - } - - // Store the value of LSB(V_i) - lsbVi = (Vi[3] & 1) !== 0 - - // V_i+1 = V_i >> 1 - for (j = 3; j > 0; j--) { - Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31) - } - Vi[0] = Vi[0] >>> 1 - - // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R - if (lsbVi) { - Vi[0] = Vi[0] ^ (0xe1 << 24) - } - } - this.state = fromArray(Zi) -} - -GHASH.prototype.update = function (buf) { - this.cache = Buffer.concat([this.cache, buf]) - var chunk - while (this.cache.length >= 16) { - chunk = this.cache.slice(0, 16) - this.cache = this.cache.slice(16) - this.ghash(chunk) - } -} - -GHASH.prototype.final = function (abl, bl) { - if (this.cache.length) { - this.ghash(Buffer.concat([this.cache, ZEROES], 16)) - } - - this.ghash(fromArray([0, abl, 0, bl])) - return this.state -} - -module.exports = GHASH - - -/***/ }), - -/***/ "./node_modules/browserify-aes/incr32.js": -/*!***********************************************!*\ - !*** ./node_modules/browserify-aes/incr32.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -function incr32 (iv) { - var len = iv.length - var item - while (len--) { - item = iv.readUInt8(len) - if (item === 255) { - iv.writeUInt8(0, len) - } else { - item++ - iv.writeUInt8(item, len) - break - } - } -} -module.exports = incr32 - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/cbc.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/modes/cbc.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var xor = __webpack_require__(/*! buffer-xor */ "./node_modules/buffer-xor/index.js") - -exports.encrypt = function (self, block) { - var data = xor(block, self._prev) - - self._prev = self._cipher.encryptBlock(data) - return self._prev -} - -exports.decrypt = function (self, block) { - var pad = self._prev - - self._prev = block - var out = self._cipher.decryptBlock(block) - - return xor(out, pad) -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/cfb.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/modes/cfb.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var xor = __webpack_require__(/*! buffer-xor */ "./node_modules/buffer-xor/index.js") - -function encryptStart (self, data, decrypt) { - var len = data.length - var out = xor(data, self._cache) - self._cache = self._cache.slice(len) - self._prev = Buffer.concat([self._prev, decrypt ? data : out]) - return out -} - -exports.encrypt = function (self, data, decrypt) { - var out = Buffer.allocUnsafe(0) - var len - - while (data.length) { - if (self._cache.length === 0) { - self._cache = self._cipher.encryptBlock(self._prev) - self._prev = Buffer.allocUnsafe(0) - } - - if (self._cache.length <= data.length) { - len = self._cache.length - out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]) - data = data.slice(len) - } else { - out = Buffer.concat([out, encryptStart(self, data, decrypt)]) - break - } - } - - return out -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/cfb1.js": -/*!***************************************************!*\ - !*** ./node_modules/browserify-aes/modes/cfb1.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer - -function encryptByte (self, byteParam, decrypt) { - var pad - var i = -1 - var len = 8 - var out = 0 - var bit, value - while (++i < len) { - pad = self._cipher.encryptBlock(self._prev) - bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0 - value = pad[0] ^ bit - out += ((value & 0x80) >> (i % 8)) - self._prev = shiftIn(self._prev, decrypt ? bit : value) - } - return out -} - -function shiftIn (buffer, value) { - var len = buffer.length - var i = -1 - var out = Buffer.allocUnsafe(buffer.length) - buffer = Buffer.concat([buffer, Buffer.from([value])]) - - while (++i < len) { - out[i] = buffer[i] << 1 | buffer[i + 1] >> (7) - } - - return out -} - -exports.encrypt = function (self, chunk, decrypt) { - var len = chunk.length - var out = Buffer.allocUnsafe(len) - var i = -1 - - while (++i < len) { - out[i] = encryptByte(self, chunk[i], decrypt) - } - - return out -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/cfb8.js": -/*!***************************************************!*\ - !*** ./node_modules/browserify-aes/modes/cfb8.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer - -function encryptByte (self, byteParam, decrypt) { - var pad = self._cipher.encryptBlock(self._prev) - var out = pad[0] ^ byteParam - - self._prev = Buffer.concat([ - self._prev.slice(1), - Buffer.from([decrypt ? byteParam : out]) - ]) - - return out -} - -exports.encrypt = function (self, chunk, decrypt) { - var len = chunk.length - var out = Buffer.allocUnsafe(len) - var i = -1 - - while (++i < len) { - out[i] = encryptByte(self, chunk[i], decrypt) - } - - return out -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/ctr.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/modes/ctr.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var xor = __webpack_require__(/*! buffer-xor */ "./node_modules/buffer-xor/index.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var incr32 = __webpack_require__(/*! ../incr32 */ "./node_modules/browserify-aes/incr32.js") - -function getBlock (self) { - var out = self._cipher.encryptBlockRaw(self._prev) - incr32(self._prev) - return out -} - -var blockSize = 16 -exports.encrypt = function (self, chunk) { - var chunkNum = Math.ceil(chunk.length / blockSize) - var start = self._cache.length - self._cache = Buffer.concat([ - self._cache, - Buffer.allocUnsafe(chunkNum * blockSize) - ]) - for (var i = 0; i < chunkNum; i++) { - var out = getBlock(self) - var offset = start + i * blockSize - self._cache.writeUInt32BE(out[0], offset + 0) - self._cache.writeUInt32BE(out[1], offset + 4) - self._cache.writeUInt32BE(out[2], offset + 8) - self._cache.writeUInt32BE(out[3], offset + 12) - } - var pad = self._cache.slice(0, chunk.length) - self._cache = self._cache.slice(chunk.length) - return xor(chunk, pad) -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/ecb.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/modes/ecb.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.encrypt = function (self, block) { - return self._cipher.encryptBlock(block) -} - -exports.decrypt = function (self, block) { - return self._cipher.decryptBlock(block) -} - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/index.js": -/*!****************************************************!*\ - !*** ./node_modules/browserify-aes/modes/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var modeModules = { - ECB: __webpack_require__(/*! ./ecb */ "./node_modules/browserify-aes/modes/ecb.js"), - CBC: __webpack_require__(/*! ./cbc */ "./node_modules/browserify-aes/modes/cbc.js"), - CFB: __webpack_require__(/*! ./cfb */ "./node_modules/browserify-aes/modes/cfb.js"), - CFB8: __webpack_require__(/*! ./cfb8 */ "./node_modules/browserify-aes/modes/cfb8.js"), - CFB1: __webpack_require__(/*! ./cfb1 */ "./node_modules/browserify-aes/modes/cfb1.js"), - OFB: __webpack_require__(/*! ./ofb */ "./node_modules/browserify-aes/modes/ofb.js"), - CTR: __webpack_require__(/*! ./ctr */ "./node_modules/browserify-aes/modes/ctr.js"), - GCM: __webpack_require__(/*! ./ctr */ "./node_modules/browserify-aes/modes/ctr.js") -} - -var modes = __webpack_require__(/*! ./list.json */ "./node_modules/browserify-aes/modes/list.json") - -for (var key in modes) { - modes[key].module = modeModules[modes[key].mode] -} - -module.exports = modes - - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/list.json": -/*!*****************************************************!*\ - !*** ./node_modules/browserify-aes/modes/list.json ***! - \*****************************************************/ -/*! exports provided: aes-128-ecb, aes-192-ecb, aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc, aes128, aes192, aes256, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-cfb8, aes-192-cfb8, aes-256-cfb8, aes-128-cfb1, aes-192-cfb1, aes-256-cfb1, aes-128-ofb, aes-192-ofb, aes-256-ofb, aes-128-ctr, aes-192-ctr, aes-256-ctr, aes-128-gcm, aes-192-gcm, aes-256-gcm, default */ -/***/ (function(module) { - -module.exports = {"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}; - -/***/ }), - -/***/ "./node_modules/browserify-aes/modes/ofb.js": -/*!**************************************************!*\ - !*** ./node_modules/browserify-aes/modes/ofb.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ "./node_modules/buffer-xor/index.js") - -function getBlock (self) { - self._prev = self._cipher.encryptBlock(self._prev) - return self._prev -} - -exports.encrypt = function (self, chunk) { - while (self._cache.length < chunk.length) { - self._cache = Buffer.concat([self._cache, getBlock(self)]) - } - - var pad = self._cache.slice(0, chunk.length) - self._cache = self._cache.slice(chunk.length) - return xor(chunk, pad) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/browserify-aes/streamCipher.js": -/*!*****************************************************!*\ - !*** ./node_modules/browserify-aes/streamCipher.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var aes = __webpack_require__(/*! ./aes */ "./node_modules/browserify-aes/aes.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var Transform = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function StreamCipher (mode, key, iv, decrypt) { - Transform.call(this) - - this._cipher = new aes.AES(key) - this._prev = Buffer.from(iv) - this._cache = Buffer.allocUnsafe(0) - this._secCache = Buffer.allocUnsafe(0) - this._decrypt = decrypt - this._mode = mode -} - -inherits(StreamCipher, Transform) - -StreamCipher.prototype._update = function (chunk) { - return this._mode.encrypt(this, chunk, this._decrypt) -} - -StreamCipher.prototype._final = function () { - this._cipher.scrub() -} - -module.exports = StreamCipher - - -/***/ }), - -/***/ "./node_modules/browserify-cipher/browser.js": -/*!***************************************************!*\ - !*** ./node_modules/browserify-cipher/browser.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var ebtk = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js") -var aes = __webpack_require__(/*! browserify-aes/browser */ "./node_modules/browserify-aes/browser.js") -var DES = __webpack_require__(/*! browserify-des */ "./node_modules/browserify-des/index.js") -var desModes = __webpack_require__(/*! browserify-des/modes */ "./node_modules/browserify-des/modes.js") -var aesModes = __webpack_require__(/*! browserify-aes/modes */ "./node_modules/browserify-aes/modes/index.js") -function createCipher (suite, password) { - var keyLen, ivLen - suite = suite.toLowerCase() - if (aesModes[suite]) { - keyLen = aesModes[suite].key - ivLen = aesModes[suite].iv - } else if (desModes[suite]) { - keyLen = desModes[suite].key * 8 - ivLen = desModes[suite].iv - } else { - throw new TypeError('invalid suite type') - } - var keys = ebtk(password, false, keyLen, ivLen) - return createCipheriv(suite, keys.key, keys.iv) -} -function createDecipher (suite, password) { - var keyLen, ivLen - suite = suite.toLowerCase() - if (aesModes[suite]) { - keyLen = aesModes[suite].key - ivLen = aesModes[suite].iv - } else if (desModes[suite]) { - keyLen = desModes[suite].key * 8 - ivLen = desModes[suite].iv - } else { - throw new TypeError('invalid suite type') - } - var keys = ebtk(password, false, keyLen, ivLen) - return createDecipheriv(suite, keys.key, keys.iv) -} - -function createCipheriv (suite, key, iv) { - suite = suite.toLowerCase() - if (aesModes[suite]) { - return aes.createCipheriv(suite, key, iv) - } else if (desModes[suite]) { - return new DES({ - key: key, - iv: iv, - mode: suite - }) - } else { - throw new TypeError('invalid suite type') - } -} -function createDecipheriv (suite, key, iv) { - suite = suite.toLowerCase() - if (aesModes[suite]) { - return aes.createDecipheriv(suite, key, iv) - } else if (desModes[suite]) { - return new DES({ - key: key, - iv: iv, - mode: suite, - decrypt: true - }) - } else { - throw new TypeError('invalid suite type') - } -} -exports.createCipher = exports.Cipher = createCipher -exports.createCipheriv = exports.Cipheriv = createCipheriv -exports.createDecipher = exports.Decipher = createDecipher -exports.createDecipheriv = exports.Decipheriv = createDecipheriv -function getCiphers () { - return Object.keys(desModes).concat(aes.getCiphers()) -} -exports.listCiphers = exports.getCiphers = getCiphers - - -/***/ }), - -/***/ "./node_modules/browserify-des/index.js": -/*!**********************************************!*\ - !*** ./node_modules/browserify-des/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var CipherBase = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var des = __webpack_require__(/*! des.js */ "./node_modules/des.js/lib/des.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -var modes = { - 'des-ede3-cbc': des.CBC.instantiate(des.EDE), - 'des-ede3': des.EDE, - 'des-ede-cbc': des.CBC.instantiate(des.EDE), - 'des-ede': des.EDE, - 'des-cbc': des.CBC.instantiate(des.DES), - 'des-ecb': des.DES -} -modes.des = modes['des-cbc'] -modes.des3 = modes['des-ede3-cbc'] -module.exports = DES -inherits(DES, CipherBase) -function DES (opts) { - CipherBase.call(this) - var modeName = opts.mode.toLowerCase() - var mode = modes[modeName] - var type - if (opts.decrypt) { - type = 'decrypt' - } else { - type = 'encrypt' - } - var key = opts.key - if (modeName === 'des-ede' || modeName === 'des-ede-cbc') { - key = Buffer.concat([key, key.slice(0, 8)]) - } - var iv = opts.iv - this._des = mode.create({ - key: key, - iv: iv, - type: type - }) -} -DES.prototype._update = function (data) { - return new Buffer(this._des.update(data)) -} -DES.prototype._final = function () { - return new Buffer(this._des.final()) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/browserify-des/modes.js": -/*!**********************************************!*\ - !*** ./node_modules/browserify-des/modes.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports['des-ecb'] = { - key: 8, - iv: 0 -} -exports['des-cbc'] = exports.des = { - key: 8, - iv: 8 -} -exports['des-ede3-cbc'] = exports.des3 = { - key: 24, - iv: 8 -} -exports['des-ede3'] = { - key: 24, - iv: 0 -} -exports['des-ede-cbc'] = { - key: 16, - iv: 8 -} -exports['des-ede'] = { - key: 16, - iv: 0 -} - - -/***/ }), - -/***/ "./node_modules/browserify-rsa/index.js": -/*!**********************************************!*\ - !*** ./node_modules/browserify-rsa/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var randomBytes = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js"); -module.exports = crt; -function blind(priv) { - var r = getr(priv); - var blinder = r.toRed(bn.mont(priv.modulus)) - .redPow(new bn(priv.publicExponent)).fromRed(); - return { - blinder: blinder, - unblinder:r.invm(priv.modulus) - }; -} -function crt(msg, priv) { - var blinds = blind(priv); - var len = priv.modulus.byteLength(); - var mod = bn.mont(priv.modulus); - var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus); - var c1 = blinded.toRed(bn.mont(priv.prime1)); - var c2 = blinded.toRed(bn.mont(priv.prime2)); - var qinv = priv.coefficient; - var p = priv.prime1; - var q = priv.prime2; - var m1 = c1.redPow(priv.exponent1); - var m2 = c2.redPow(priv.exponent2); - m1 = m1.fromRed(); - m2 = m2.fromRed(); - var h = m1.isub(m2).imul(qinv).umod(p); - h.imul(q); - m2.iadd(h); - return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len)); -} -crt.getr = getr; -function getr(priv) { - var len = priv.modulus.byteLength(); - var r = new bn(randomBytes(len)); - while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) { - r = new bn(randomBytes(len)); - } - return r; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/browserify-sign/algos.js": -/*!***********************************************!*\ - !*** ./node_modules/browserify-sign/algos.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(/*! ./browser/algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json") - - -/***/ }), - -/***/ "./node_modules/browserify-sign/browser/algorithms.json": -/*!**************************************************************!*\ - !*** ./node_modules/browserify-sign/browser/algorithms.json ***! - \**************************************************************/ -/*! exports provided: sha224WithRSAEncryption, RSA-SHA224, sha256WithRSAEncryption, RSA-SHA256, sha384WithRSAEncryption, RSA-SHA384, sha512WithRSAEncryption, RSA-SHA512, RSA-SHA1, ecdsa-with-SHA1, sha256, sha224, sha384, sha512, DSA-SHA, DSA-SHA1, DSA, DSA-WITH-SHA224, DSA-SHA224, DSA-WITH-SHA256, DSA-SHA256, DSA-WITH-SHA384, DSA-SHA384, DSA-WITH-SHA512, DSA-SHA512, DSA-RIPEMD160, ripemd160WithRSA, RSA-RIPEMD160, md5WithRSAEncryption, RSA-MD5, default */ -/***/ (function(module) { - -module.exports = {"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}; - -/***/ }), - -/***/ "./node_modules/browserify-sign/browser/curves.json": -/*!**********************************************************!*\ - !*** ./node_modules/browserify-sign/browser/curves.json ***! - \**********************************************************/ -/*! exports provided: 1.3.132.0.10, 1.3.132.0.33, 1.2.840.10045.3.1.1, 1.2.840.10045.3.1.7, 1.3.132.0.34, 1.3.132.0.35, default */ -/***/ (function(module) { - -module.exports = {"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}; - -/***/ }), - -/***/ "./node_modules/browserify-sign/browser/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/browserify-sign/browser/index.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js") -var stream = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var sign = __webpack_require__(/*! ./sign */ "./node_modules/browserify-sign/browser/sign.js") -var verify = __webpack_require__(/*! ./verify */ "./node_modules/browserify-sign/browser/verify.js") - -var algorithms = __webpack_require__(/*! ./algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json") -Object.keys(algorithms).forEach(function (key) { - algorithms[key].id = new Buffer(algorithms[key].id, 'hex') - algorithms[key.toLowerCase()] = algorithms[key] -}) - -function Sign (algorithm) { - stream.Writable.call(this) - - var data = algorithms[algorithm] - if (!data) throw new Error('Unknown message digest') - - this._hashType = data.hash - this._hash = createHash(data.hash) - this._tag = data.id - this._signType = data.sign -} -inherits(Sign, stream.Writable) - -Sign.prototype._write = function _write (data, _, done) { - this._hash.update(data) - done() -} - -Sign.prototype.update = function update (data, enc) { - if (typeof data === 'string') data = new Buffer(data, enc) - - this._hash.update(data) - return this -} - -Sign.prototype.sign = function signMethod (key, enc) { - this.end() - var hash = this._hash.digest() - var sig = sign(hash, key, this._hashType, this._signType, this._tag) - - return enc ? sig.toString(enc) : sig -} - -function Verify (algorithm) { - stream.Writable.call(this) - - var data = algorithms[algorithm] - if (!data) throw new Error('Unknown message digest') - - this._hash = createHash(data.hash) - this._tag = data.id - this._signType = data.sign -} -inherits(Verify, stream.Writable) - -Verify.prototype._write = function _write (data, _, done) { - this._hash.update(data) - done() -} - -Verify.prototype.update = function update (data, enc) { - if (typeof data === 'string') data = new Buffer(data, enc) - - this._hash.update(data) - return this -} - -Verify.prototype.verify = function verifyMethod (key, sig, enc) { - if (typeof sig === 'string') sig = new Buffer(sig, enc) - - this.end() - var hash = this._hash.digest() - return verify(sig, hash, key, this._signType, this._tag) -} - -function createSign (algorithm) { - return new Sign(algorithm) -} - -function createVerify (algorithm) { - return new Verify(algorithm) -} - -module.exports = { - Sign: createSign, - Verify: createVerify, - createSign: createSign, - createVerify: createVerify -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/browserify-sign/browser/sign.js": -/*!******************************************************!*\ - !*** ./node_modules/browserify-sign/browser/sign.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js -var createHmac = __webpack_require__(/*! create-hmac */ "./node_modules/create-hmac/browser.js") -var crt = __webpack_require__(/*! browserify-rsa */ "./node_modules/browserify-rsa/index.js") -var EC = __webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js") -var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js") -var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json") - -function sign (hash, key, hashType, signType, tag) { - var priv = parseKeys(key) - if (priv.curve) { - // rsa keys can be interpreted as ecdsa ones in openssl - if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') - return ecSign(hash, priv) - } else if (priv.type === 'dsa') { - if (signType !== 'dsa') throw new Error('wrong private key type') - return dsaSign(hash, priv, hashType) - } else { - if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') - } - hash = Buffer.concat([tag, hash]) - var len = priv.modulus.byteLength() - var pad = [ 0, 1 ] - while (hash.length + pad.length + 1 < len) pad.push(0xff) - pad.push(0x00) - var i = -1 - while (++i < hash.length) pad.push(hash[i]) - - var out = crt(pad, priv) - return out -} - -function ecSign (hash, priv) { - var curveId = curves[priv.curve.join('.')] - if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.')) - - var curve = new EC(curveId) - var key = curve.keyFromPrivate(priv.privateKey) - var out = key.sign(hash) - - return new Buffer(out.toDER()) -} - -function dsaSign (hash, priv, algo) { - var x = priv.params.priv_key - var p = priv.params.p - var q = priv.params.q - var g = priv.params.g - var r = new BN(0) - var k - var H = bits2int(hash, q).mod(q) - var s = false - var kv = getKey(x, q, hash, algo) - while (s === false) { - k = makeKey(q, kv, algo) - r = makeR(g, k, p, q) - s = k.invm(q).imul(H.add(x.mul(r))).mod(q) - if (s.cmpn(0) === 0) { - s = false - r = new BN(0) - } - } - return toDER(r, s) -} - -function toDER (r, s) { - r = r.toArray() - s = s.toArray() - - // Pad values - if (r[0] & 0x80) r = [ 0 ].concat(r) - if (s[0] & 0x80) s = [ 0 ].concat(s) - - var total = r.length + s.length + 4 - var res = [ 0x30, total, 0x02, r.length ] - res = res.concat(r, [ 0x02, s.length ], s) - return new Buffer(res) -} - -function getKey (x, q, hash, algo) { - x = new Buffer(x.toArray()) - if (x.length < q.byteLength()) { - var zeros = new Buffer(q.byteLength() - x.length) - zeros.fill(0) - x = Buffer.concat([ zeros, x ]) - } - var hlen = hash.length - var hbits = bits2octets(hash, q) - var v = new Buffer(hlen) - v.fill(1) - var k = new Buffer(hlen) - k.fill(0) - k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest() - v = createHmac(algo, k).update(v).digest() - k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest() - v = createHmac(algo, k).update(v).digest() - return { k: k, v: v } -} - -function bits2int (obits, q) { - var bits = new BN(obits) - var shift = (obits.length << 3) - q.bitLength() - if (shift > 0) bits.ishrn(shift) - return bits -} - -function bits2octets (bits, q) { - bits = bits2int(bits, q) - bits = bits.mod(q) - var out = new Buffer(bits.toArray()) - if (out.length < q.byteLength()) { - var zeros = new Buffer(q.byteLength() - out.length) - zeros.fill(0) - out = Buffer.concat([ zeros, out ]) - } - return out -} - -function makeKey (q, kv, algo) { - var t - var k - - do { - t = new Buffer(0) - - while (t.length * 8 < q.bitLength()) { - kv.v = createHmac(algo, kv.k).update(kv.v).digest() - t = Buffer.concat([ t, kv.v ]) - } - - k = bits2int(t, q) - kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest() - kv.v = createHmac(algo, kv.k).update(kv.v).digest() - } while (k.cmp(q) !== -1) - - return k -} - -function makeR (g, k, p, q) { - return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q) -} - -module.exports = sign -module.exports.getKey = getKey -module.exports.makeKey = makeKey - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/browserify-sign/browser/verify.js": -/*!********************************************************!*\ - !*** ./node_modules/browserify-sign/browser/verify.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js") -var EC = __webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec -var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js") -var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json") - -function verify (sig, hash, key, signType, tag) { - var pub = parseKeys(key) - if (pub.type === 'ec') { - // rsa keys can be interpreted as ecdsa ones in openssl - if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') - return ecVerify(sig, hash, pub) - } else if (pub.type === 'dsa') { - if (signType !== 'dsa') throw new Error('wrong public key type') - return dsaVerify(sig, hash, pub) - } else { - if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') - } - hash = Buffer.concat([tag, hash]) - var len = pub.modulus.byteLength() - var pad = [ 1 ] - var padNum = 0 - while (hash.length + pad.length + 2 < len) { - pad.push(0xff) - padNum++ - } - pad.push(0x00) - var i = -1 - while (++i < hash.length) { - pad.push(hash[i]) - } - pad = new Buffer(pad) - var red = BN.mont(pub.modulus) - sig = new BN(sig).toRed(red) - - sig = sig.redPow(new BN(pub.publicExponent)) - sig = new Buffer(sig.fromRed().toArray()) - var out = padNum < 8 ? 1 : 0 - len = Math.min(sig.length, pad.length) - if (sig.length !== pad.length) out = 1 - - i = -1 - while (++i < len) out |= sig[i] ^ pad[i] - return out === 0 -} - -function ecVerify (sig, hash, pub) { - var curveId = curves[pub.data.algorithm.curve.join('.')] - if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')) - - var curve = new EC(curveId) - var pubkey = pub.data.subjectPrivateKey.data - - return curve.verify(hash, sig, pubkey) -} - -function dsaVerify (sig, hash, pub) { - var p = pub.data.p - var q = pub.data.q - var g = pub.data.g - var y = pub.data.pub_key - var unpacked = parseKeys.signature.decode(sig, 'der') - var s = unpacked.s - var r = unpacked.r - checkValue(s, q) - checkValue(r, q) - var montp = BN.mont(p) - var w = s.invm(q) - var v = g.toRed(montp) - .redPow(new BN(hash).mul(w).mod(q)) - .fromRed() - .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()) - .mod(p) - .mod(q) - return v.cmp(r) === 0 -} - -function checkValue (b, q) { - if (b.cmpn(0) <= 0) throw new Error('invalid sig') - if (b.cmp(q) >= q) throw new Error('invalid sig') -} - -module.exports = verify - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/buffer-xor/index.js": -/*!******************************************!*\ - !*** ./node_modules/buffer-xor/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) { - var length = Math.min(a.length, b.length) - var buffer = new Buffer(length) - - for (var i = 0; i < length; ++i) { - buffer[i] = a[i] ^ b[i] - } - - return buffer -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/buffer/index.js": -/*!**************************************!*\ - !*** ./node_modules/buffer/index.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - - - -var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") -var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") -var isArray = __webpack_require__(/*! isarray */ "./node_modules/buffer/node_modules/isarray/index.js") - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined - ? global.TYPED_ARRAY_SUPPORT - : typedArraySupport() - -/* - * Export kMaxLength after typed array support is determined. - */ -exports.kMaxLength = kMaxLength() - -function typedArraySupport () { - try { - var arr = new Uint8Array(1) - arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} - return arr.foo() === 42 && // typed array instances can be augmented - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false - } -} - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length) - } - that.length = length - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192 // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype - return arr -} - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -} - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array - if (typeof Symbol !== 'undefined' && Symbol.species && - Buffer[Symbol.species] === Buffer) { - // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true - }) - } -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -} - -function allocUnsafe (that, size) { - assertSize(size) - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0 - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -} - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) - - var actual = that.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual) - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - that = createBuffer(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array) - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset) - } else { - array = new Uint8Array(array, byteOffset, length) - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array) - } - return that -} - -function fromObject (that, obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - that = createBuffer(that, len) - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len) - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string - } - - var len = string.length - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '' -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end) - newBuf.__proto__ = Buffer.prototype - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start] - } - } - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - var i - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if (code < 256) { - val = code - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255 - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()) - var len = bytes.length - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/buffer/node_modules/isarray/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/buffer/node_modules/isarray/index.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - - -/***/ }), - -/***/ "./node_modules/cipher-base/index.js": -/*!*******************************************!*\ - !*** ./node_modules/cipher-base/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var Transform = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js").Transform -var StringDecoder = __webpack_require__(/*! string_decoder */ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js").StringDecoder -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function CipherBase (hashMode) { - Transform.call(this) - this.hashMode = typeof hashMode === 'string' - if (this.hashMode) { - this[hashMode] = this._finalOrDigest - } else { - this.final = this._finalOrDigest - } - if (this._final) { - this.__final = this._final - this._final = null - } - this._decoder = null - this._encoding = null -} -inherits(CipherBase, Transform) - -CipherBase.prototype.update = function (data, inputEnc, outputEnc) { - if (typeof data === 'string') { - data = Buffer.from(data, inputEnc) - } - - var outData = this._update(data) - if (this.hashMode) return this - - if (outputEnc) { - outData = this._toString(outData, outputEnc) - } - - return outData -} - -CipherBase.prototype.setAutoPadding = function () {} -CipherBase.prototype.getAuthTag = function () { - throw new Error('trying to get auth tag in unsupported state') -} - -CipherBase.prototype.setAuthTag = function () { - throw new Error('trying to set auth tag in unsupported state') -} - -CipherBase.prototype.setAAD = function () { - throw new Error('trying to set aad in unsupported state') -} - -CipherBase.prototype._transform = function (data, _, next) { - var err - try { - if (this.hashMode) { - this._update(data) - } else { - this.push(this._update(data)) - } - } catch (e) { - err = e - } finally { - next(err) - } -} -CipherBase.prototype._flush = function (done) { - var err - try { - this.push(this.__final()) - } catch (e) { - err = e - } - - done(err) -} -CipherBase.prototype._finalOrDigest = function (outputEnc) { - var outData = this.__final() || Buffer.alloc(0) - if (outputEnc) { - outData = this._toString(outData, outputEnc, true) - } - return outData -} - -CipherBase.prototype._toString = function (value, enc, fin) { - if (!this._decoder) { - this._decoder = new StringDecoder(enc) - this._encoding = enc - } - - if (this._encoding !== enc) throw new Error('can\'t switch encodings') - - var out = this._decoder.write(value) - if (fin) { - out += this._decoder.end() - } - - return out -} - -module.exports = CipherBase - - -/***/ }), - -/***/ "./node_modules/classnames/index.js": -/*!******************************************!*\ - !*** ./node_modules/classnames/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var hasOwn = {}.hasOwnProperty; - - function classNames () { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); - } - - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return classNames; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}()); - - -/***/ }), - -/***/ "./node_modules/co/index.js": -/*!**********************************!*\ - !*** ./node_modules/co/index.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - - -/** - * slice() reference. - */ - -var slice = Array.prototype.slice; - -/** - * Expose `co`. - */ - -module.exports = co['default'] = co.co = co; - -/** - * Wrap the given generator `fn` into a - * function that returns a promise. - * This is a separate function so that - * every `co()` call doesn't create a new, - * unnecessary closure. - * - * @param {GeneratorFunction} fn - * @return {Function} - * @api public - */ - -co.wrap = function (fn) { - createPromise.__generatorFunction__ = fn; - return createPromise; - function createPromise() { - return co.call(this, fn.apply(this, arguments)); - } -}; - -/** - * Execute the generator function or a generator - * and return a promise. - * - * @param {Function} fn - * @return {Promise} - * @api public - */ - -function co(gen) { - var ctx = this; - var args = slice.call(arguments, 1) - - // we wrap everything in a promise to avoid promise chaining, - // which leads to memory leak errors. - // see https://github.com/tj/co/issues/180 - return new Promise(function(resolve, reject) { - if (typeof gen === 'function') gen = gen.apply(ctx, args); - if (!gen || typeof gen.next !== 'function') return resolve(gen); - - onFulfilled(); - - /** - * @param {Mixed} res - * @return {Promise} - * @api private - */ - - function onFulfilled(res) { - var ret; - try { - ret = gen.next(res); - } catch (e) { - return reject(e); - } - next(ret); - } - - /** - * @param {Error} err - * @return {Promise} - * @api private - */ - - function onRejected(err) { - var ret; - try { - ret = gen.throw(err); - } catch (e) { - return reject(e); - } - next(ret); - } - - /** - * Get the next value in the generator, - * return a promise. - * - * @param {Object} ret - * @return {Promise} - * @api private - */ - - function next(ret) { - if (ret.done) return resolve(ret.value); - var value = toPromise.call(ctx, ret.value); - if (value && isPromise(value)) return value.then(onFulfilled, onRejected); - return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' - + 'but the following object was passed: "' + String(ret.value) + '"')); - } - }); -} - -/** - * Convert a `yield`ed value into a promise. - * - * @param {Mixed} obj - * @return {Promise} - * @api private - */ - -function toPromise(obj) { - if (!obj) return obj; - if (isPromise(obj)) return obj; - if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); - if ('function' == typeof obj) return thunkToPromise.call(this, obj); - if (Array.isArray(obj)) return arrayToPromise.call(this, obj); - if (isObject(obj)) return objectToPromise.call(this, obj); - return obj; -} - -/** - * Convert a thunk to a promise. - * - * @param {Function} - * @return {Promise} - * @api private - */ - -function thunkToPromise(fn) { - var ctx = this; - return new Promise(function (resolve, reject) { - fn.call(ctx, function (err, res) { - if (err) return reject(err); - if (arguments.length > 2) res = slice.call(arguments, 1); - resolve(res); - }); - }); -} - -/** - * Convert an array of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Array} obj - * @return {Promise} - * @api private - */ - -function arrayToPromise(obj) { - return Promise.all(obj.map(toPromise, this)); -} - -/** - * Convert an object of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Object} obj - * @return {Promise} - * @api private - */ - -function objectToPromise(obj){ - var results = new obj.constructor(); - var keys = Object.keys(obj); - var promises = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var promise = toPromise.call(this, obj[key]); - if (promise && isPromise(promise)) defer(promise, key); - else results[key] = obj[key]; - } - return Promise.all(promises).then(function () { - return results; - }); - - function defer(promise, key) { - // predefine the key in the result - results[key] = undefined; - promises.push(promise.then(function (res) { - results[key] = res; - })); - } -} - -/** - * Check if `obj` is a promise. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - -function isPromise(obj) { - return 'function' == typeof obj.then; -} - -/** - * Check if `obj` is a generator. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ - -function isGenerator(obj) { - return 'function' == typeof obj.next && 'function' == typeof obj.throw; -} - -/** - * Check if `obj` is a generator function. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ -function isGeneratorFunction(obj) { - var constructor = obj.constructor; - if (!constructor) return false; - if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; - return isGenerator(constructor.prototype); -} - -/** - * Check for plain object. - * - * @param {Mixed} val - * @return {Boolean} - * @api private - */ - -function isObject(val) { - return Object == val.constructor; -} - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/array/from.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/library/fn/array/from.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.string.iterator */ "./node_modules/core-js/library/modules/es6.string.iterator.js"); -__webpack_require__(/*! ../../modules/es6.array.from */ "./node_modules/core-js/library/modules/es6.array.from.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Array.from; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/map.js": -/*!************************************************!*\ - !*** ./node_modules/core-js/library/fn/map.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/core-js/library/modules/es6.object.to-string.js"); -__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/core-js/library/modules/es6.string.iterator.js"); -__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/core-js/library/modules/web.dom.iterable.js"); -__webpack_require__(/*! ../modules/es6.map */ "./node_modules/core-js/library/modules/es6.map.js"); -__webpack_require__(/*! ../modules/es7.map.to-json */ "./node_modules/core-js/library/modules/es7.map.to-json.js"); -__webpack_require__(/*! ../modules/es7.map.of */ "./node_modules/core-js/library/modules/es7.map.of.js"); -__webpack_require__(/*! ../modules/es7.map.from */ "./node_modules/core-js/library/modules/es7.map.from.js"); -module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Map; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/number/is-nan.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/fn/number/is-nan.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.number.is-nan */ "./node_modules/core-js/library/modules/es6.number.is-nan.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Number.isNaN; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/number/min-safe-integer.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/fn/number/min-safe-integer.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.number.min-safe-integer */ "./node_modules/core-js/library/modules/es6.number.min-safe-integer.js"); -module.exports = -0x1fffffffffffff; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/assign.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/assign.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.assign */ "./node_modules/core-js/library/modules/es6.object.assign.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object.assign; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/create.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/create.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.create */ "./node_modules/core-js/library/modules/es6.object.create.js"); -var $Object = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object; -module.exports = function create(P, D) { - return $Object.create(P, D); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/define-property.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/define-property.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.define-property */ "./node_modules/core-js/library/modules/es6.object.define-property.js"); -var $Object = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object; -module.exports = function defineProperty(it, key, desc) { - return $Object.defineProperty(it, key, desc); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/get-prototype-of.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/get-prototype-of.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.get-prototype-of */ "./node_modules/core-js/library/modules/es6.object.get-prototype-of.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object.getPrototypeOf; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/keys.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/keys.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.keys */ "./node_modules/core-js/library/modules/es6.object.keys.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object.keys; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/object/set-prototype-of.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/fn/object/set-prototype-of.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.object.set-prototype-of */ "./node_modules/core-js/library/modules/es6.object.set-prototype-of.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Object.setPrototypeOf; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/symbol/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/fn/symbol/index.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.symbol */ "./node_modules/core-js/library/modules/es6.symbol.js"); -__webpack_require__(/*! ../../modules/es6.object.to-string */ "./node_modules/core-js/library/modules/es6.object.to-string.js"); -__webpack_require__(/*! ../../modules/es7.symbol.async-iterator */ "./node_modules/core-js/library/modules/es7.symbol.async-iterator.js"); -__webpack_require__(/*! ../../modules/es7.symbol.observable */ "./node_modules/core-js/library/modules/es7.symbol.observable.js"); -module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/library/modules/_core.js").Symbol; - - -/***/ }), - -/***/ "./node_modules/core-js/library/fn/symbol/iterator.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/fn/symbol/iterator.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ../../modules/es6.string.iterator */ "./node_modules/core-js/library/modules/es6.string.iterator.js"); -__webpack_require__(/*! ../../modules/web.dom.iterable */ "./node_modules/core-js/library/modules/web.dom.iterable.js"); -module.exports = __webpack_require__(/*! ../../modules/_wks-ext */ "./node_modules/core-js/library/modules/_wks-ext.js").f('iterator'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_a-function.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_a-function.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_add-to-unscopables.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_add-to-unscopables.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function () { /* empty */ }; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_an-instance.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_an-instance.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it, Constructor, name, forbiddenField) { - if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { - throw TypeError(name + ': incorrect invocation!'); - } return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_an-object.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_an-object.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_array-from-iterable.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_array-from-iterable.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/library/modules/_for-of.js"); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_array-includes.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_array-includes.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); -var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/library/modules/_to-length.js"); -var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/library/modules/_to-absolute-index.js"); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_array-methods.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_array-methods.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/library/modules/_iobject.js"); -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/library/modules/_to-length.js"); -var asc = __webpack_require__(/*! ./_array-species-create */ "./node_modules/core-js/library/modules/_array-species-create.js"); -module.exports = function (TYPE, $create) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - var create = $create || asc; - return function ($this, callbackfn, that) { - var O = toObject($this); - var self = IObject(O); - var f = ctx(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var val, res; - for (;length > index; index++) if (NO_HOLES || index in self) { - val = self[index]; - res = f(val, index, O); - if (TYPE) { - if (IS_MAP) result[index] = res; // map - else if (res) switch (TYPE) { - case 3: return true; // some - case 5: return val; // find - case 6: return index; // findIndex - case 2: result.push(val); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_array-species-constructor.js": -/*!****************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_array-species-constructor.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/library/modules/_is-array.js"); -var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('species'); - -module.exports = function (original) { - var C; - if (isArray(original)) { - C = original.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return C === undefined ? Array : C; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_array-species-create.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_array-species-create.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(/*! ./_array-species-constructor */ "./node_modules/core-js/library/modules/_array-species-constructor.js"); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_classof.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_classof.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/library/modules/_cof.js"); -var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('toStringTag'); -// ES3 wrong here -var ARG = cof(function () { return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function (it, key) { - try { - return it[key]; - } catch (e) { /* empty */ } -}; - -module.exports = function (it) { - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_cof.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_cof.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_collection-strong.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_collection-strong.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f; -var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/library/modules/_object-create.js"); -var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/library/modules/_redefine-all.js"); -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/library/modules/_an-instance.js"); -var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/library/modules/_for-of.js"); -var $iterDefine = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/library/modules/_iter-define.js"); -var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/library/modules/_iter-step.js"); -var setSpecies = __webpack_require__(/*! ./_set-species */ "./node_modules/core-js/library/modules/_set-species.js"); -var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js"); -var fastKey = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/library/modules/_meta.js").fastKey; -var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/library/modules/_validate-collection.js"); -var SIZE = DESCRIPTORS ? '_s' : 'size'; - -var getEntry = function (that, key) { - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return that._i[index]; - // frozen object case - for (entry = that._f; entry; entry = entry.n) { - if (entry.k == key) return entry; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = create(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { - entry.r = true; - if (entry.p) entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = validate(this, NAME); - var entry = getEntry(that, key); - if (entry) { - var next = entry.n; - var prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if (prev) prev.n = next; - if (next) next.p = prev; - if (that._f == entry) that._f = next; - if (that._l == entry) that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - validate(this, NAME); - var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.n : this._f) { - f(entry.v, entry.k, this); - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(validate(this, NAME), key); - } - }); - if (DESCRIPTORS) dP(C.prototype, 'size', { - get: function () { - return validate(this, NAME)[SIZE]; - } - }); - return C; - }, - def: function (that, key, value) { - var entry = getEntry(that, key); - var prev, index; - // change existing entry - if (entry) { - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if (!that._f) that._f = entry; - if (prev) prev.n = entry; - that[SIZE]++; - // add to index - if (index !== 'F') that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function (C, NAME, IS_MAP) { - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - $iterDefine(C, NAME, function (iterated, kind) { - this._t = validate(iterated, NAME); // target - this._k = kind; // kind - this._l = undefined; // previous - }, function () { - var that = this; - var kind = that._k; - var entry = that._l; - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - // get next entry - if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { - // or finish the iteration - that._t = undefined; - return step(1); - } - // return step by kind - if (kind == 'keys') return step(0, entry.k); - if (kind == 'values') return step(0, entry.v); - return step(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(NAME); - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_collection-to-json.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_collection-to-json.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/library/modules/_classof.js"); -var from = __webpack_require__(/*! ./_array-from-iterable */ "./node_modules/core-js/library/modules/_array-from-iterable.js"); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_collection.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_collection.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/library/modules/_meta.js"); -var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js"); -var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); -var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/library/modules/_redefine-all.js"); -var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/library/modules/_for-of.js"); -var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/library/modules/_an-instance.js"); -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/library/modules/_set-to-string-tag.js"); -var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f; -var each = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/library/modules/_array-methods.js")(0); -var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js"); - -module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { - var Base = global[NAME]; - var C = Base; - var ADDER = IS_MAP ? 'set' : 'add'; - var proto = C && C.prototype; - var O = {}; - if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { - new C().entries().next(); - }))) { - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - redefineAll(C.prototype, methods); - meta.NEED = true; - } else { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME, '_c'); - target._c = new Base(); - if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); - }); - each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { - var IS_ADDER = KEY == 'add' || KEY == 'set'; - if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { - anInstance(this, C, KEY); - if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; - var result = this._c[KEY](a === 0 ? 0 : a, b); - return IS_ADDER ? this : result; - }); - }); - IS_WEAK || dP(C.prototype, 'size', { - get: function () { - return this._c.size; - } - }); - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F, O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_core.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_core.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.3' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_create-property.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_create-property.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js"); -var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/library/modules/_property-desc.js"); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_ctx.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_ctx.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/library/modules/_a-function.js"); -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_defined.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_defined.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_descriptors.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_descriptors.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js")(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_dom-create.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_dom-create.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js").document; -// typeof document.createElement is 'object' in old IE -var is = isObject(document) && isObject(document.createElement); -module.exports = function (it) { - return is ? document.createElement(it) : {}; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_enum-bug-keys.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_enum-bug-keys.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_enum-keys.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_enum-keys.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/library/modules/_object-keys.js"); -var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/library/modules/_object-gops.js"); -var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/library/modules/_object-pie.js"); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_export.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_export.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/library/modules/_core.js"); -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var IS_WRAP = type & $export.W; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE]; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; - var key, own, out; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if (own && key in exports) continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function (C) { - var F = function (a, b, c) { - if (this instanceof C) { - switch (arguments.length) { - case 0: return new C(); - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if (IS_PROTO) { - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); - } - } -}; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_fails.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_fails.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_for-of.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_for-of.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/core-js/library/modules/_iter-call.js"); -var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/library/modules/_is-array-iter.js"); -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/library/modules/_to-length.js"); -var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/library/modules/core.get-iterator-method.js"); -var BREAK = {}; -var RETURN = {}; -var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); - var f = ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = call(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_global.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_global.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_has.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_has.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_hide.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_hide.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js"); -var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/library/modules/_property-desc.js"); -module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js") ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_html.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_html.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js").document; -module.exports = document && document.documentElement; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_ie8-dom-define.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_ie8-dom-define.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js") && !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js")(function () { - return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/library/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iobject.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iobject.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/library/modules/_cof.js"); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_is-array-iter.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_is-array-iter.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/library/modules/_iterators.js"); -var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_is-array.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_is-array.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/library/modules/_cof.js"); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_is-object.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_is-object.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iter-call.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iter-call.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -module.exports = function (iterator, fn, value, entries) { - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) anObject(ret.call(iterator)); - throw e; - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iter-create.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iter-create.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/library/modules/_object-create.js"); -var descriptor = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/library/modules/_property-desc.js"); -var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/library/modules/_set-to-string-tag.js"); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js")(IteratorPrototype, __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iter-define.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iter-define.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/library/modules/_library.js"); -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/library/modules/_redefine.js"); -var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/library/modules/_iterators.js"); -var $iterCreate = __webpack_require__(/*! ./_iter-create */ "./node_modules/core-js/library/modules/_iter-create.js"); -var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/library/modules/_set-to-string-tag.js"); -var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/library/modules/_object-gpo.js"); -var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('iterator'); -var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` -var FF_ITERATOR = '@@iterator'; -var KEYS = 'keys'; -var VALUES = 'values'; - -var returnThis = function () { return this; }; - -module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - $iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = (!BUGGY && $native) || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iter-detect.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iter-detect.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('iterator'); -var SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); -} catch (e) { /* empty */ } - -module.exports = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iter-step.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iter-step.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_iterators.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_iterators.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_library.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_library.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = true; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_meta.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_meta.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/library/modules/_uid.js")('meta'); -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var setDesc = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js")(function () { - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); -}; -var fastKey = function (it, create) { - // return primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function (it, create) { - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-assign.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-assign.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/library/modules/_object-keys.js"); -var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/library/modules/_object-gops.js"); -var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/library/modules/_object-pie.js"); -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/library/modules/_iobject.js"); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js")(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = gOPS.f; - var isEnum = pIE.f; - while (aLen > index) { - var S = IObject(arguments[index++]); - var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-create.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-create.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var dPs = __webpack_require__(/*! ./_object-dps */ "./node_modules/core-js/library/modules/_object-dps.js"); -var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/library/modules/_enum-bug-keys.js"); -var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/library/modules/_dom-create.js")('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(/*! ./_html */ "./node_modules/core-js/library/modules/_html.js").appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-dp.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-dp.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/library/modules/_ie8-dom-define.js"); -var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/library/modules/_to-primitive.js"); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-dps.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-dps.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js"); -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/library/modules/_object-keys.js"); - -module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-gopd.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-gopd.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/library/modules/_object-pie.js"); -var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/library/modules/_property-desc.js"); -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); -var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/library/modules/_to-primitive.js"); -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/library/modules/_ie8-dom-define.js"); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-gopn-ext.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-gopn-ext.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); -var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/library/modules/_object-gopn.js").f; -var toString = {}.toString; - -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } -}; - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-gopn.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-gopn.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/library/modules/_object-keys-internal.js"); -var hiddenKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/library/modules/_enum-bug-keys.js").concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-gops.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-gops.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-gpo.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-gpo.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-keys-internal.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-keys-internal.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); -var arrayIndexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/library/modules/_array-includes.js")(false); -var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-keys.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-keys.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/library/modules/_object-keys-internal.js"); -var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/library/modules/_enum-bug-keys.js"); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-pie.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-pie.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_object-sap.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_object-sap.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/library/modules/_core.js"); -var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js"); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_property-desc.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_property-desc.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_redefine-all.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_redefine-all.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); -module.exports = function (target, src, safe) { - for (var key in src) { - if (safe && target[key]) target[key] = src[key]; - else hide(target, key, src[key]); - } return target; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_redefine.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_redefine.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_set-collection-from.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_set-collection-from.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/library/modules/_a-function.js"); -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/library/modules/_for-of.js"); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { - var mapFn = arguments[1]; - var mapping, A, n, cb; - aFunction(this); - mapping = mapFn !== undefined; - if (mapping) aFunction(mapFn); - if (source == undefined) return new this(); - A = []; - if (mapping) { - n = 0; - cb = ctx(mapFn, arguments[2], 2); - forOf(source, false, function (nextItem) { - A.push(cb(nextItem, n++)); - }); - } else { - forOf(source, false, A.push, A); - } - return new this(A); - } }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_set-collection-of.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_set-collection-of.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { of: function of() { - var length = arguments.length; - var A = new Array(length); - while (length--) A[length] = arguments[length]; - return new this(A); - } }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_set-proto.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_set-proto.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var check = function (O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js")(Function.call, __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/library/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_set-species.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_set-species.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/library/modules/_core.js"); -var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js"); -var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js"); -var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('species'); - -module.exports = function (KEY) { - var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_set-to-string-tag.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_set-to-string-tag.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f; -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_shared-key.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_shared-key.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/library/modules/_shared.js")('keys'); -var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/library/modules/_uid.js"); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_shared.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_shared.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); -module.exports = function (key) { - return store[key] || (store[key] = {}); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_string-at.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_string-at.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/library/modules/_to-integer.js"); -var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/library/modules/_defined.js"); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-absolute-index.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-absolute-index.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/library/modules/_to-integer.js"); -var max = Math.max; -var min = Math.min; -module.exports = function (index, length) { - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-integer.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-integer.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-iobject.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-iobject.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/library/modules/_iobject.js"); -var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/library/modules/_defined.js"); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-length.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-length.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/library/modules/_to-integer.js"); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-object.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-object.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/library/modules/_defined.js"); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_to-primitive.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_to-primitive.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function (it, S) { - if (!isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_uid.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_uid.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_validate-collection.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_validate-collection.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_wks-define.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/library/modules/_wks-define.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/library/modules/_core.js"); -var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/library/modules/_library.js"); -var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/library/modules/_wks-ext.js"); -var defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_wks-ext.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/library/modules/_wks-ext.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js"); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/_wks.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/library/modules/_wks.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/library/modules/_shared.js")('wks'); -var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/library/modules/_uid.js"); -var Symbol = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js").Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/core.get-iterator-method.js": -/*!**************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/core.get-iterator-method.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/library/modules/_classof.js"); -var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('iterator'); -var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/library/modules/_iterators.js"); -module.exports = __webpack_require__(/*! ./_core */ "./node_modules/core-js/library/modules/_core.js").getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.array.from.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.array.from.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/library/modules/_ctx.js"); -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/core-js/library/modules/_iter-call.js"); -var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/library/modules/_is-array-iter.js"); -var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/library/modules/_to-length.js"); -var createProperty = __webpack_require__(/*! ./_create-property */ "./node_modules/core-js/library/modules/_create-property.js"); -var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/library/modules/core.get-iterator-method.js"); - -$export($export.S + $export.F * !__webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/library/modules/_iter-detect.js")(function (iter) { Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var index = 0; - var iterFn = getIterFn(O); - var length, result, step, iterator; - if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.array.iterator.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.array.iterator.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/library/modules/_add-to-unscopables.js"); -var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/library/modules/_iter-step.js"); -var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/library/modules/_iterators.js"); -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); - -// 22.1.3.4 Array.prototype.entries() -// 22.1.3.13 Array.prototype.keys() -// 22.1.3.29 Array.prototype.values() -// 22.1.3.30 Array.prototype[@@iterator]() -module.exports = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/library/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind -// 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return step(1); - } - if (kind == 'keys') return step(0, index); - if (kind == 'values') return step(0, O[index]); - return step(0, [index, O[index]]); -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) -Iterators.Arguments = Iterators.Array; - -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.map.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.map.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(/*! ./_collection-strong */ "./node_modules/core-js/library/modules/_collection-strong.js"); -var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/library/modules/_validate-collection.js"); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/core-js/library/modules/_collection.js")(MAP, function (get) { - return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = strong.getEntry(validate(this, MAP), key); - return entry && entry.v; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); - } -}, strong, true); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.number.is-nan.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.number.is-nan.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.number.min-safe-integer.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.number.min-safe-integer.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.assign.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.assign.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(/*! ./_object-assign */ "./node_modules/core-js/library/modules/_object-assign.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.create.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.create.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/library/modules/_object-create.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.define-property.js": -/*!****************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.define-property.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js"), 'Object', { defineProperty: __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js").f }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.get-prototype-of.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.get-prototype-of.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var $getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/library/modules/_object-gpo.js"); - -__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/library/modules/_object-sap.js")('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.keys.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.keys.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/library/modules/_to-object.js"); -var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/library/modules/_object-keys.js"); - -__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/library/modules/_object-sap.js")('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.set-prototype-of.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.set-prototype-of.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(/*! ./_set-proto */ "./node_modules/core-js/library/modules/_set-proto.js").set }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.object.to-string.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.object.to-string.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.string.iterator.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.string.iterator.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/library/modules/_string-at.js")(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/library/modules/_iter-define.js")(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es6.symbol.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es6.symbol.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/library/modules/_has.js"); -var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/library/modules/_descriptors.js"); -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); -var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/library/modules/_redefine.js"); -var META = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/library/modules/_meta.js").KEY; -var $fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/library/modules/_fails.js"); -var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/library/modules/_shared.js"); -var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/library/modules/_set-to-string-tag.js"); -var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/library/modules/_uid.js"); -var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js"); -var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/library/modules/_wks-ext.js"); -var wksDefine = __webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/library/modules/_wks-define.js"); -var enumKeys = __webpack_require__(/*! ./_enum-keys */ "./node_modules/core-js/library/modules/_enum-keys.js"); -var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/library/modules/_is-array.js"); -var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/library/modules/_an-object.js"); -var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/library/modules/_is-object.js"); -var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/library/modules/_to-iobject.js"); -var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/library/modules/_to-primitive.js"); -var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/library/modules/_property-desc.js"); -var _create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/library/modules/_object-create.js"); -var gOPNExt = __webpack_require__(/*! ./_object-gopn-ext */ "./node_modules/core-js/library/modules/_object-gopn-ext.js"); -var $GOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/library/modules/_object-gopd.js"); -var $DP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/library/modules/_object-dp.js"); -var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/library/modules/_object-keys.js"); -var gOPD = $GOPD.f; -var dP = $DP.f; -var gOPN = gOPNExt.f; -var $Symbol = global.Symbol; -var $JSON = global.JSON; -var _stringify = $JSON && $JSON.stringify; -var PROTOTYPE = 'prototype'; -var HIDDEN = wks('_hidden'); -var TO_PRIMITIVE = wks('toPrimitive'); -var isEnum = {}.propertyIsEnumerable; -var SymbolRegistry = shared('symbol-registry'); -var AllSymbols = shared('symbols'); -var OPSymbols = shared('op-symbols'); -var ObjectProto = Object[PROTOTYPE]; -var USE_NATIVE = typeof $Symbol == 'function'; -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDesc = DESCRIPTORS && $fails(function () { - return _create(dP({}, 'a', { - get: function () { return dP(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (it, key, D) { - var protoDesc = gOPD(ObjectProto, key); - if (protoDesc) delete ObjectProto[key]; - dP(it, key, D); - if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); -} : dP; - -var wrap = function (tag) { - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; -}; - -var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return it instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto) $defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if (has(AllSymbols, key)) { - if (!D.enumerable) { - if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _create(D, { enumerable: createDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); -}; -var $defineProperties = function defineProperties(it, P) { - anObject(it); - var keys = enumKeys(P = toIObject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; -}; -var $create = function create(it, P) { - return P === undefined ? _create(it) : $defineProperties(_create(it), P); -}; -var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = toPrimitive(key, true)); - if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; -}; -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = toIObject(it); - key = toPrimitive(key, true); - if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; - var D = gOPD(it, key); - if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; -}; -var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN(toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; -}; -var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto; - var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); - } return result; -}; - -// 19.4.1.1 Symbol([description]) -if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto) $set.call(OPSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/library/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/library/modules/_object-pie.js").f = $propertyIsEnumerable; - __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/library/modules/_object-gops.js").f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(/*! ./_library */ "./node_modules/core-js/library/modules/_library.js")) { - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function (name) { - return wrap(wks(name)); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - -for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' -).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); - -for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); - -$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } -}); - -$export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// 24.3.2 JSON.stringify(value [, replacer [, space]]) -$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; -})), 'JSON', { - stringify: function stringify(it) { - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - $replacer = replacer = args[1]; - if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - if (!isArray(replacer)) replacer = function (key, value) { - if (typeof $replacer == 'function') value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } -}); - -// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) -$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -// 19.4.3.5 Symbol.prototype[@@toStringTag] -setToStringTag($Symbol, 'Symbol'); -// 20.2.1.9 Math[@@toStringTag] -setToStringTag(Math, 'Math', true); -// 24.3.3 JSON[@@toStringTag] -setToStringTag(global.JSON, 'JSON', true); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es7.map.from.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es7.map.from.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -__webpack_require__(/*! ./_set-collection-from */ "./node_modules/core-js/library/modules/_set-collection-from.js")('Map'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es7.map.of.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es7.map.of.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -__webpack_require__(/*! ./_set-collection-of */ "./node_modules/core-js/library/modules/_set-collection-of.js")('Map'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es7.map.to-json.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es7.map.to-json.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/library/modules/_export.js"); - -$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(/*! ./_collection-to-json */ "./node_modules/core-js/library/modules/_collection-to-json.js")('Map') }); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es7.symbol.async-iterator.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es7.symbol.async-iterator.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/library/modules/_wks-define.js")('asyncIterator'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/es7.symbol.observable.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/library/modules/es7.symbol.observable.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/library/modules/_wks-define.js")('observable'); - - -/***/ }), - -/***/ "./node_modules/core-js/library/modules/web.dom.iterable.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/library/modules/web.dom.iterable.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! ./es6.array.iterator */ "./node_modules/core-js/library/modules/es6.array.iterator.js"); -var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/library/modules/_global.js"); -var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/library/modules/_hide.js"); -var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/library/modules/_iterators.js"); -var TO_STRING_TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/library/modules/_wks.js")('toStringTag'); - -var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + - 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + - 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + - 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + - 'TextTrackList,TouchList').split(','); - -for (var i = 0; i < DOMIterables.length; i++) { - var NAME = DOMIterables[i]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; -} - - -/***/ }), - -/***/ "./node_modules/core-util-is/lib/util.js": -/*!***********************************************!*\ - !*** ./node_modules/core-util-is/lib/util.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/create-ecdh/browser.js": -/*!*********************************************!*\ - !*** ./node_modules/create-ecdh/browser.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); - -module.exports = function createECDH(curve) { - return new ECDH(curve); -}; - -var aliases = { - 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 - } -}; - -aliases.p224 = aliases.secp224r1; -aliases.p256 = aliases.secp256r1 = aliases.prime256v1; -aliases.p192 = aliases.secp192r1 = aliases.prime192v1; -aliases.p384 = aliases.secp384r1; -aliases.p521 = aliases.secp521r1; - -function ECDH(curve) { - this.curveType = aliases[curve]; - if (!this.curveType ) { - this.curveType = { - name: curve - }; - } - this.curve = new elliptic.ec(this.curveType.name); - this.keys = void 0; -} - -ECDH.prototype.generateKeys = function (enc, format) { - this.keys = this.curve.genKeyPair(); - return this.getPublicKey(enc, format); -}; - -ECDH.prototype.computeSecret = function (other, inenc, enc) { - inenc = inenc || 'utf8'; - if (!Buffer.isBuffer(other)) { - other = new Buffer(other, inenc); - } - var otherPub = this.curve.keyFromPublic(other).getPublic(); - var out = otherPub.mul(this.keys.getPrivate()).getX(); - return formatReturnValue(out, enc, this.curveType.byteLength); -}; - -ECDH.prototype.getPublicKey = function (enc, format) { - var key = this.keys.getPublic(format === 'compressed', true); - if (format === 'hybrid') { - if (key[key.length - 1] % 2) { - key[0] = 7; - } else { - key [0] = 6; - } - } - return formatReturnValue(key, enc); -}; - -ECDH.prototype.getPrivateKey = function (enc) { - return formatReturnValue(this.keys.getPrivate(), enc); -}; - -ECDH.prototype.setPublicKey = function (pub, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(pub)) { - pub = new Buffer(pub, enc); - } - this.keys._importPublic(pub); - return this; -}; - -ECDH.prototype.setPrivateKey = function (priv, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(priv)) { - priv = new Buffer(priv, enc); - } - var _priv = new BN(priv); - _priv = _priv.toString(16); - this.keys._importPrivate(_priv); - return this; -}; - -function formatReturnValue(bn, enc, len) { - if (!Array.isArray(bn)) { - bn = bn.toArray(); - } - var buf = new Buffer(bn); - if (len && buf.length < len) { - var zeros = new Buffer(len - buf.length); - zeros.fill(0); - buf = Buffer.concat([zeros, buf]); - } - if (!enc) { - return buf; - } else { - return buf.toString(enc); - } -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/create-hash/browser.js": -/*!*********************************************!*\ - !*** ./node_modules/create-hash/browser.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var md5 = __webpack_require__(/*! ./md5 */ "./node_modules/create-hash/md5.js") -var RIPEMD160 = __webpack_require__(/*! ripemd160 */ "./node_modules/ripemd160/index.js") -var sha = __webpack_require__(/*! sha.js */ "./node_modules/sha.js/index.js") - -var Base = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") - -function HashNoConstructor (hash) { - Base.call(this, 'digest') - - this._hash = hash - this.buffers = [] -} - -inherits(HashNoConstructor, Base) - -HashNoConstructor.prototype._update = function (data) { - this.buffers.push(data) -} - -HashNoConstructor.prototype._final = function () { - var buf = Buffer.concat(this.buffers) - var r = this._hash(buf) - this.buffers = null - - return r -} - -function Hash (hash) { - Base.call(this, 'digest') - - this._hash = hash -} - -inherits(Hash, Base) - -Hash.prototype._update = function (data) { - this._hash.update(data) -} - -Hash.prototype._final = function () { - return this._hash.digest() -} - -module.exports = function createHash (alg) { - alg = alg.toLowerCase() - if (alg === 'md5') return new HashNoConstructor(md5) - if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160()) - - return new Hash(sha(alg)) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/create-hash/make-hash.js": -/*!***********************************************!*\ - !*** ./node_modules/create-hash/make-hash.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { -var intSize = 4 -var zeroBuffer = new Buffer(intSize) -zeroBuffer.fill(0) - -var charSize = 8 -var hashSize = 16 - -function toArray (buf) { - if ((buf.length % intSize) !== 0) { - var len = buf.length + (intSize - (buf.length % intSize)) - buf = Buffer.concat([buf, zeroBuffer], len) - } - - var arr = new Array(buf.length >>> 2) - for (var i = 0, j = 0; i < buf.length; i += intSize, j++) { - arr[j] = buf.readInt32LE(i) - } - - return arr -} - -module.exports = function hash (buf, fn) { - var arr = fn(toArray(buf), buf.length * charSize) - buf = new Buffer(hashSize) - for (var i = 0; i < arr.length; i++) { - buf.writeInt32LE(arr[i], i << 2, true) - } - return buf -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/create-hash/md5.js": -/*!*****************************************!*\ - !*** ./node_modules/create-hash/md5.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/* - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ - -var makeHash = __webpack_require__(/*! ./make-hash */ "./node_modules/create-hash/make-hash.js") - -/* - * Calculate the MD5 of an array of little-endian words, and a bit length - */ -function core_md5 (x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << ((len) % 32) - x[(((len + 64) >>> 9) << 4) + 14] = len - - var a = 1732584193 - var b = -271733879 - var c = -1732584194 - var d = 271733878 - - for (var i = 0; i < x.length; i += 16) { - var olda = a - var oldb = b - var oldc = c - var oldd = d - - a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936) - d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586) - c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819) - b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330) - a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897) - d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426) - c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341) - b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983) - a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416) - d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417) - c = md5_ff(c, d, a, b, x[i + 10], 17, -42063) - b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162) - a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682) - d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101) - c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290) - b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329) - - a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510) - d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632) - c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713) - b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302) - a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691) - d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083) - c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335) - b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848) - a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438) - d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690) - c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961) - b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501) - a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467) - d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784) - c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473) - b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734) - - a = md5_hh(a, b, c, d, x[i + 5], 4, -378558) - d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463) - c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562) - b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556) - a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060) - d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353) - c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632) - b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640) - a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174) - d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222) - c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979) - b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189) - a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487) - d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835) - c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520) - b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651) - - a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844) - d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415) - c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905) - b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055) - a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571) - d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606) - c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523) - b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799) - a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359) - d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744) - c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380) - b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649) - a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070) - d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379) - c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259) - b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551) - - a = safe_add(a, olda) - b = safe_add(b, oldb) - c = safe_add(c, oldc) - d = safe_add(d, oldd) - } - - return [a, b, c, d] -} - -/* - * These functions implement the four basic operations the algorithm uses. - */ -function md5_cmn (q, a, b, x, s, t) { - return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) -} - -function md5_ff (a, b, c, d, x, s, t) { - return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t) -} - -function md5_gg (a, b, c, d, x, s, t) { - return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t) -} - -function md5_hh (a, b, c, d, x, s, t) { - return md5_cmn(b ^ c ^ d, a, b, x, s, t) -} - -function md5_ii (a, b, c, d, x, s, t) { - return md5_cmn(c ^ (b | (~d)), a, b, x, s, t) -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add (x, y) { - var lsw = (x & 0xFFFF) + (y & 0xFFFF) - var msw = (x >> 16) + (y >> 16) + (lsw >> 16) - return (msw << 16) | (lsw & 0xFFFF) -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function bit_rol (num, cnt) { - return (num << cnt) | (num >>> (32 - cnt)) -} - -module.exports = function md5 (buf) { - return makeHash(buf, core_md5) -} - - -/***/ }), - -/***/ "./node_modules/create-hmac/browser.js": -/*!*********************************************!*\ - !*** ./node_modules/create-hmac/browser.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var Legacy = __webpack_require__(/*! ./legacy */ "./node_modules/create-hmac/legacy.js") -var Base = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var md5 = __webpack_require__(/*! create-hash/md5 */ "./node_modules/create-hash/md5.js") -var RIPEMD160 = __webpack_require__(/*! ripemd160 */ "./node_modules/ripemd160/index.js") - -var sha = __webpack_require__(/*! sha.js */ "./node_modules/sha.js/index.js") - -var ZEROS = Buffer.alloc(128) - -function Hmac (alg, key) { - Base.call(this, 'digest') - if (typeof key === 'string') { - key = Buffer.from(key) - } - - var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 - - this._alg = alg - this._key = key - if (key.length > blocksize) { - var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) - key = hash.update(key).digest() - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = this._ipad = Buffer.allocUnsafe(blocksize) - var opad = this._opad = Buffer.allocUnsafe(blocksize) - - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) - this._hash.update(ipad) -} - -inherits(Hmac, Base) - -Hmac.prototype._update = function (data) { - this._hash.update(data) -} - -Hmac.prototype._final = function () { - var h = this._hash.digest() - var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg) - return hash.update(this._opad).update(h).digest() -} - -module.exports = function createHmac (alg, key) { - alg = alg.toLowerCase() - if (alg === 'rmd160' || alg === 'ripemd160') { - return new Hmac('rmd160', key) - } - if (alg === 'md5') { - return new Legacy(md5, key) - } - return new Hmac(alg, key) -} - - -/***/ }), - -/***/ "./node_modules/create-hmac/legacy.js": -/*!********************************************!*\ - !*** ./node_modules/create-hmac/legacy.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer - -var Base = __webpack_require__(/*! cipher-base */ "./node_modules/cipher-base/index.js") - -var ZEROS = Buffer.alloc(128) -var blocksize = 64 - -function Hmac (alg, key) { - Base.call(this, 'digest') - if (typeof key === 'string') { - key = Buffer.from(key) - } - - this._alg = alg - this._key = key - - if (key.length > blocksize) { - key = alg(key) - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = this._ipad = Buffer.allocUnsafe(blocksize) - var opad = this._opad = Buffer.allocUnsafe(blocksize) - - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - - this._hash = [ipad] -} - -inherits(Hmac, Base) - -Hmac.prototype._update = function (data) { - this._hash.push(data) -} - -Hmac.prototype._final = function () { - var h = this._alg(Buffer.concat(this._hash)) - return this._alg(Buffer.concat([this._opad, h])) -} -module.exports = Hmac - - -/***/ }), - -/***/ "./node_modules/crypto-browserify/index.js": -/*!*************************************************!*\ - !*** ./node_modules/crypto-browserify/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js") -exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js") -exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ "./node_modules/create-hmac/browser.js") - -var algos = __webpack_require__(/*! browserify-sign/algos */ "./node_modules/browserify-sign/algos.js") -var algoKeys = Object.keys(algos) -var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys) -exports.getHashes = function () { - return hashes -} - -var p = __webpack_require__(/*! pbkdf2 */ "./node_modules/pbkdf2/browser.js") -exports.pbkdf2 = p.pbkdf2 -exports.pbkdf2Sync = p.pbkdf2Sync - -var aes = __webpack_require__(/*! browserify-cipher */ "./node_modules/browserify-cipher/browser.js") - -exports.Cipher = aes.Cipher -exports.createCipher = aes.createCipher -exports.Cipheriv = aes.Cipheriv -exports.createCipheriv = aes.createCipheriv -exports.Decipher = aes.Decipher -exports.createDecipher = aes.createDecipher -exports.Decipheriv = aes.Decipheriv -exports.createDecipheriv = aes.createDecipheriv -exports.getCiphers = aes.getCiphers -exports.listCiphers = aes.listCiphers - -var dh = __webpack_require__(/*! diffie-hellman */ "./node_modules/diffie-hellman/browser.js") - -exports.DiffieHellmanGroup = dh.DiffieHellmanGroup -exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup -exports.getDiffieHellman = dh.getDiffieHellman -exports.createDiffieHellman = dh.createDiffieHellman -exports.DiffieHellman = dh.DiffieHellman - -var sign = __webpack_require__(/*! browserify-sign */ "./node_modules/browserify-sign/browser/index.js") - -exports.createSign = sign.createSign -exports.Sign = sign.Sign -exports.createVerify = sign.createVerify -exports.Verify = sign.Verify - -exports.createECDH = __webpack_require__(/*! create-ecdh */ "./node_modules/create-ecdh/browser.js") - -var publicEncrypt = __webpack_require__(/*! public-encrypt */ "./node_modules/public-encrypt/browser.js") - -exports.publicEncrypt = publicEncrypt.publicEncrypt -exports.privateEncrypt = publicEncrypt.privateEncrypt -exports.publicDecrypt = publicEncrypt.publicDecrypt -exports.privateDecrypt = publicEncrypt.privateDecrypt - -// the least I can do is make error messages for the rest of the node.js/crypto api. -// ;[ -// 'createCredentials' -// ].forEach(function (name) { -// exports[name] = function () { -// throw new Error([ -// 'sorry, ' + name + ' is not implemented yet', -// 'we accept pull requests', -// 'https://github.com/crypto-browserify/crypto-browserify' -// ].join('\n')) -// } -// }) - -var rf = __webpack_require__(/*! randomfill */ "./node_modules/randomfill/browser.js") - -exports.randomFill = rf.randomFill -exports.randomFillSync = rf.randomFillSync - -exports.createCredentials = function () { - throw new Error([ - 'sorry, createCredentials is not implemented yet', - 'we accept pull requests', - 'https://github.com/crypto-browserify/crypto-browserify' - ].join('\n')) -} - -exports.constants = { - 'DH_CHECK_P_NOT_SAFE_PRIME': 2, - 'DH_CHECK_P_NOT_PRIME': 1, - 'DH_UNABLE_TO_CHECK_GENERATOR': 4, - 'DH_NOT_SUITABLE_GENERATOR': 8, - 'NPN_ENABLED': 1, - 'ALPN_ENABLED': 1, - 'RSA_PKCS1_PADDING': 1, - 'RSA_SSLV23_PADDING': 2, - 'RSA_NO_PADDING': 3, - 'RSA_PKCS1_OAEP_PADDING': 4, - 'RSA_X931_PADDING': 5, - 'RSA_PKCS1_PSS_PADDING': 6, - 'POINT_CONVERSION_COMPRESSED': 2, - 'POINT_CONVERSION_UNCOMPRESSED': 4, - 'POINT_CONVERSION_HYBRID': 6 -} - - -/***/ }), - -/***/ "./node_modules/crypto-js/core.js": -/*!****************************************!*\ - !*** ./node_modules/crypto-js/core.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -;(function (root, factory) { - if (true) { - // CommonJS - module.exports = exports = factory(); - } - else {} -}(this, function () { - - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined) { - /* - * Local polyfil of Object.create - */ - var create = Object.create || (function () { - function F() {}; - - return function (obj) { - var subtype; - - F.prototype = obj; - - subtype = new F(); - - F.prototype = null; - - return subtype; - }; - }()) - - /** - * CryptoJS namespace. - */ - var C = {}; - - /** - * Library namespace. - */ - var C_lib = C.lib = {}; - - /** - * Base object for prototypal inheritance. - */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); - - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } - - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; - - // Reference supertype - subtype.$super = this; - - return subtype; - }, - - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); - - return instance; - }, - - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, - - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } - } - - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; - } - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); - } - }; - }()); - - /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } - }, - - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, - - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; - - // Clamp excess bits - this.clamp(); - - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var i = 0; i < thatSigBytes; i += 4) { - thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - var r = (function (m_w) { - var m_w = m_w; - var m_z = 0x3ade68b1; - var mask = 0xffffffff; - - return function () { - m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; - m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; - var result = ((m_z << 0x10) + m_w) & mask; - result /= 0x100000000; - result += 0.5; - return result * (Math.random() > .5 ? 1 : -1); - } - }); - - for (var i = 0, rcache; i < nBytes; i += 4) { - var _r = r((rcache || Math.random()) * 0x100000000); - - rcache = _r() * 0x3ade67b7; - words.push((_r() * 0x100000000) | 0); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - var processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512/32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - return CryptoJS; - -})); - -/***/ }), - -/***/ "./node_modules/crypto-js/sha3.js": -/*!****************************************!*\ - !*** ./node_modules/crypto-js/sha3.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); - } - else {} -}(this, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; - - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; - - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } - - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; - } - } - - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } - - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } - } - - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); - - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); - } - }()); - - /** - * SHA-3 hash algorithm. - */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ - /** - * Configuration options. - * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 - */ - cfg: Hasher.cfg.extend({ - outputLength: 512 - }), - - _doReset: function () { - var state = this._state = [] - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; - - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; - - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); - - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } - - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } - - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; - - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } - - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; - - // Rotate lanes - if (rhoOffset < 32) { - var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } - - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } - - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; - - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } - - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low;; - } - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; - - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; - - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); - - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } - - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, - - clone: function () { - var clone = Hasher.clone.call(this); - - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); - - - return CryptoJS.SHA3; - -})); - -/***/ }), - -/***/ "./node_modules/crypto-js/x64-core.js": -/*!********************************************!*\ - !*** ./node_modules/crypto-js/x64-core.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -;(function (root, factory) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); - } - else {} -}(this, function (CryptoJS) { - - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; - - /** - * x64 namespace. - */ - var C_x64 = C.x64 = {}; - - /** - * A 64-bit word. - */ - var X64Word = C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } - - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, - - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, - - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; - - // return X64Word.create(high, low); - // } - }); - - /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var X64WordArray = C_x64.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; - } - }, - - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { - // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, - - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - - // Clone "words" array - var words = clone.words = this.words.slice(0); - - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); - } - - return clone; - } - }); - }()); - - - return CryptoJS; - -})); - -/***/ }), - -/***/ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/App.scss": -/*!******************************************************************************************************!*\ - !*** ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./src/App.scss ***! - \******************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); -// imports - - -// module -exports.push([module.i, "body {\n font-family: 'Montserrat', sans-serif;\n color: #6b7c93;\n background-color: #f0f1f3;\n}\n\nh1, h2, h3 {\n font-family: 'Montserrat', sans-serif;\n}\n", ""]); - -// exports - - -/***/ }), - -/***/ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/Header/index.scss": -/*!**************************************************************************************************************************!*\ - !*** ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./src/components/Header/index.scss ***! - \**************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); -// imports - - -// module -exports.push([module.i, ".index__header___1UDpl {\n display: grid;\n grid-template-columns: auto auto;\n grid-column-gap: 20px;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin: 0 20px;\n}\n\n.index__subtitle___V9mZb {\n justify-self: center;\n}", ""]); - -// exports -exports.locals = { - "header": "index__header___1UDpl", - "subtitle": "index__subtitle___V9mZb" -}; - -/***/ }), - -/***/ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/Page/index.scss": -/*!*******************************************************************************************************************************!*\ - !*** ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./src/components/layout/Page/index.scss ***! - \*******************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); -// imports - - -// module -exports.push([module.i, ".index__page___1Tr0v {\n margin: 0px 30px;\n}", ""]); - -// exports -exports.locals = { - "page": "index__page___1Tr0v" -}; - -/***/ }), - -/***/ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/PageFrame/index.scss": -/*!************************************************************************************************************************************!*\ - !*** ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./src/components/layout/PageFrame/index.scss ***! - \************************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); -// imports - - -// module -exports.push([module.i, ".index__container___3ytmf {\n margin: 0px 20px;\n}", ""]); - -// exports -exports.locals = { - "container": "index__container___3ytmf" -}; - -/***/ }), - -/***/ "./node_modules/css-loader/lib/css-base.js": -/*!*************************************************!*\ - !*** ./node_modules/css-loader/lib/css-base.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function(useSourceMap) { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - if(item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' - }); - - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} - -// Adapted from convert-source-map (MIT) -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - - return '/*# ' + data + ' */'; -} - - -/***/ }), - -/***/ "./node_modules/css-vendor/lib/camelize.js": -/*!*************************************************!*\ - !*** ./node_modules/css-vendor/lib/camelize.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = camelize; -var regExp = /[-\s]+(.)?/g; - -/** - * Convert dash separated strings to camel cased. - * - * @param {String} str - * @return {String} - */ -function camelize(str) { - return str.replace(regExp, toUpper); -} - -function toUpper(match, c) { - return c ? c.toUpperCase() : ''; -} - -/***/ }), - -/***/ "./node_modules/css-vendor/lib/index.js": -/*!**********************************************!*\ - !*** ./node_modules/css-vendor/lib/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.supportedValue = exports.supportedProperty = exports.prefix = undefined; - -var _prefix = __webpack_require__(/*! ./prefix */ "./node_modules/css-vendor/lib/prefix.js"); - -var _prefix2 = _interopRequireDefault(_prefix); - -var _supportedProperty = __webpack_require__(/*! ./supported-property */ "./node_modules/css-vendor/lib/supported-property.js"); - -var _supportedProperty2 = _interopRequireDefault(_supportedProperty); - -var _supportedValue = __webpack_require__(/*! ./supported-value */ "./node_modules/css-vendor/lib/supported-value.js"); - -var _supportedValue2 = _interopRequireDefault(_supportedValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -exports['default'] = { - prefix: _prefix2['default'], - supportedProperty: _supportedProperty2['default'], - supportedValue: _supportedValue2['default'] -}; /** - * CSS Vendor prefix detection and property feature testing. - * - * @copyright Oleg Slobodskoi 2015 - * @website https://github.com/jsstyles/css-vendor - * @license MIT - */ - -exports.prefix = _prefix2['default']; -exports.supportedProperty = _supportedProperty2['default']; -exports.supportedValue = _supportedValue2['default']; - -/***/ }), - -/***/ "./node_modules/css-vendor/lib/prefix.js": -/*!***********************************************!*\ - !*** ./node_modules/css-vendor/lib/prefix.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isInBrowser = __webpack_require__(/*! is-in-browser */ "./node_modules/is-in-browser/dist/module.js"); - -var _isInBrowser2 = _interopRequireDefault(_isInBrowser); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var js = ''; /** - * Export javascript style and css style vendor prefixes. - * Based on "transform" support test. - */ - -var css = ''; - -// We should not do anything if required serverside. -if (_isInBrowser2['default']) { - // Order matters. We need to check Webkit the last one because - // other vendors use to add Webkit prefixes to some properties - var jsCssMap = { - Moz: '-moz-', - // IE did it wrong again ... - ms: '-ms-', - O: '-o-', - Webkit: '-webkit-' - }; - var style = document.createElement('p').style; - var testProp = 'Transform'; - - for (var key in jsCssMap) { - if (key + testProp in style) { - js = key; - css = jsCssMap[key]; - break; - } - } -} - -/** - * Vendor prefix string for the current browser. - * - * @type {{js: String, css: String}} - * @api public - */ -exports['default'] = { js: js, css: css }; - -/***/ }), - -/***/ "./node_modules/css-vendor/lib/supported-property.js": -/*!***********************************************************!*\ - !*** ./node_modules/css-vendor/lib/supported-property.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = supportedProperty; - -var _isInBrowser = __webpack_require__(/*! is-in-browser */ "./node_modules/is-in-browser/dist/module.js"); - -var _isInBrowser2 = _interopRequireDefault(_isInBrowser); - -var _prefix = __webpack_require__(/*! ./prefix */ "./node_modules/css-vendor/lib/prefix.js"); - -var _prefix2 = _interopRequireDefault(_prefix); - -var _camelize = __webpack_require__(/*! ./camelize */ "./node_modules/css-vendor/lib/camelize.js"); - -var _camelize2 = _interopRequireDefault(_camelize); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var el = void 0; -var cache = {}; - -if (_isInBrowser2['default']) { - el = document.createElement('p'); - - /** - * We test every property on vendor prefix requirement. - * Once tested, result is cached. It gives us up to 70% perf boost. - * http://jsperf.com/element-style-object-access-vs-plain-object - * - * Prefill cache with known css properties to reduce amount of - * properties we need to feature test at runtime. - * http://davidwalsh.name/vendor-prefix - */ - var computed = window.getComputedStyle(document.documentElement, ''); - for (var key in computed) { - if (!isNaN(key)) cache[computed[key]] = computed[key]; - } -} - -/** - * Test if a property is supported, returns supported property with vendor - * prefix if required. Returns `false` if not supported. - * - * @param {String} prop dash separated - * @return {String|Boolean} - * @api public - */ -function supportedProperty(prop) { - // For server-side rendering. - if (!el) return prop; - - // We have not tested this prop yet, lets do the test. - if (cache[prop] != null) return cache[prop]; - - // Camelization is required because we can't test using - // css syntax for e.g. in FF. - // Test if property is supported as it is. - if ((0, _camelize2['default'])(prop) in el.style) { - cache[prop] = prop; - } - // Test if property is supported with vendor prefix. - else if (_prefix2['default'].js + (0, _camelize2['default'])('-' + prop) in el.style) { - cache[prop] = _prefix2['default'].css + prop; - } else { - cache[prop] = false; - } - - return cache[prop]; -} - -/***/ }), - -/***/ "./node_modules/css-vendor/lib/supported-value.js": -/*!********************************************************!*\ - !*** ./node_modules/css-vendor/lib/supported-value.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = supportedValue; - -var _isInBrowser = __webpack_require__(/*! is-in-browser */ "./node_modules/is-in-browser/dist/module.js"); - -var _isInBrowser2 = _interopRequireDefault(_isInBrowser); - -var _prefix = __webpack_require__(/*! ./prefix */ "./node_modules/css-vendor/lib/prefix.js"); - -var _prefix2 = _interopRequireDefault(_prefix); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var cache = {}; -var el = void 0; - -if (_isInBrowser2['default']) el = document.createElement('p'); - -/** - * Returns prefixed value if needed. Returns `false` if value is not supported. - * - * @param {String} property - * @param {String} value - * @return {String|Boolean} - * @api public - */ -function supportedValue(property, value) { - // For server-side rendering. - if (!el) return value; - - // It is a string or a number as a string like '1'. - // We want only prefixable values here. - if (typeof value !== 'string' || !isNaN(parseInt(value, 10))) return value; - - var cacheKey = property + value; - - if (cache[cacheKey] != null) return cache[cacheKey]; - - // IE can even throw an error in some cases, for e.g. style.content = 'bar' - try { - // Test value as it is. - el.style[property] = value; - } catch (err) { - cache[cacheKey] = false; - return false; - } - - // Value is supported as it is. - if (el.style[property] !== '') { - cache[cacheKey] = value; - } else { - // Test value with vendor prefix. - value = _prefix2['default'].css + value; - - // Hardcode test to convert "flex" to "-ms-flexbox" for IE10. - if (value === '-ms-flex') value = '-ms-flexbox'; - - el.style[property] = value; - - // Value is supported with vendor prefix. - if (el.style[property] !== '') cache[cacheKey] = value; - } - - if (!cache[cacheKey]) cache[cacheKey] = false; - - // Reset style value. - el.style[property] = ''; - - return cache[cacheKey]; -} - -/***/ }), - -/***/ "./node_modules/decode-uri-component/index.js": -/*!****************************************************!*\ - !*** ./node_modules/decode-uri-component/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var token = '%[a-f0-9]{2}'; -var singleMatcher = new RegExp(token, 'gi'); -var multiMatcher = new RegExp('(' + token + ')+', 'gi'); - -function decodeComponents(components, split) { - try { - // Try to decode the entire string first - return decodeURIComponent(components.join('')); - } catch (err) { - // Do nothing - } - - if (components.length === 1) { - return components; - } - - split = split || 1; - - // Split the array in 2 parts - var left = components.slice(0, split); - var right = components.slice(split); - - return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); -} - -function decode(input) { - try { - return decodeURIComponent(input); - } catch (err) { - var tokens = input.match(singleMatcher); - - for (var i = 1; i < tokens.length; i++) { - input = decodeComponents(tokens, i).join(''); - - tokens = input.match(singleMatcher); - } - - return input; - } -} - -function customDecodeURIComponent(input) { - // Keep track of all the replacements and prefill the map with the `BOM` - var replaceMap = { - '%FE%FF': '\uFFFD\uFFFD', - '%FF%FE': '\uFFFD\uFFFD' - }; - - var match = multiMatcher.exec(input); - while (match) { - try { - // Decode as big chunks as possible - replaceMap[match[0]] = decodeURIComponent(match[0]); - } catch (err) { - var result = decode(match[0]); - - if (result !== match[0]) { - replaceMap[match[0]] = result; - } - } - - match = multiMatcher.exec(input); - } - - // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else - replaceMap['%C2'] = '\uFFFD'; - - var entries = Object.keys(replaceMap); - - for (var i = 0; i < entries.length; i++) { - // Replace all decoded components - var key = entries[i]; - input = input.replace(new RegExp(key, 'g'), replaceMap[key]); - } - - return input; -} - -module.exports = function (encodedURI) { - if (typeof encodedURI !== 'string') { - throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); - } - - try { - encodedURI = encodedURI.replace(/\+/g, ' '); - - // Try the built in decoder first - return decodeURIComponent(encodedURI); - } catch (err) { - // Fallback to a more advanced decoder - return customDecodeURIComponent(encodedURI); - } -}; - - -/***/ }), - -/***/ "./node_modules/deepmerge/dist/es.js": -/*!*******************************************!*\ - !*** ./node_modules/deepmerge/dist/es.js ***! - \*******************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var isMergeableObject = function isMergeableObject(value) { - return isNonNullObject(value) - && !isSpecial(value) -}; - -function isNonNullObject(value) { - return !!value && typeof value === 'object' -} - -function isSpecial(value) { - var stringValue = Object.prototype.toString.call(value); - - return stringValue === '[object RegExp]' - || stringValue === '[object Date]' - || isReactElement(value) -} - -// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 -var canUseSymbol = typeof Symbol === 'function' && Symbol.for; -var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; - -function isReactElement(value) { - return value.$$typeof === REACT_ELEMENT_TYPE -} - -function emptyTarget(val) { - return Array.isArray(val) ? [] : {} -} - -function cloneUnlessOtherwiseSpecified(value, optionsArgument) { - var clone = !optionsArgument || optionsArgument.clone !== false; - - return (clone && isMergeableObject(value)) - ? deepmerge(emptyTarget(value), value, optionsArgument) - : value -} - -function defaultArrayMerge(target, source, optionsArgument) { - return target.concat(source).map(function(element) { - return cloneUnlessOtherwiseSpecified(element, optionsArgument) - }) -} - -function mergeObject(target, source, optionsArgument) { - var destination = {}; - if (isMergeableObject(target)) { - Object.keys(target).forEach(function(key) { - destination[key] = cloneUnlessOtherwiseSpecified(target[key], optionsArgument); - }); - } - Object.keys(source).forEach(function(key) { - if (!isMergeableObject(source[key]) || !target[key]) { - destination[key] = cloneUnlessOtherwiseSpecified(source[key], optionsArgument); - } else { - destination[key] = deepmerge(target[key], source[key], optionsArgument); - } - }); - return destination -} - -function deepmerge(target, source, optionsArgument) { - var sourceIsArray = Array.isArray(source); - var targetIsArray = Array.isArray(target); - var options = optionsArgument || { arrayMerge: defaultArrayMerge }; - var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; - - if (!sourceAndTargetTypesMatch) { - return cloneUnlessOtherwiseSpecified(source, optionsArgument) - } else if (sourceIsArray) { - var arrayMerge = options.arrayMerge || defaultArrayMerge; - return arrayMerge(target, source, optionsArgument) - } else { - return mergeObject(target, source, optionsArgument) - } -} - -deepmerge.all = function deepmergeAll(array, optionsArgument) { - if (!Array.isArray(array)) { - throw new Error('first argument should be an array') - } - - return array.reduce(function(prev, next) { - return deepmerge(prev, next, optionsArgument) - }, {}) -}; - -var deepmerge_1 = deepmerge; - -/* harmony default export */ __webpack_exports__["default"] = (deepmerge_1); - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des.js": -/*!****************************************!*\ - !*** ./node_modules/des.js/lib/des.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.utils = __webpack_require__(/*! ./des/utils */ "./node_modules/des.js/lib/des/utils.js"); -exports.Cipher = __webpack_require__(/*! ./des/cipher */ "./node_modules/des.js/lib/des/cipher.js"); -exports.DES = __webpack_require__(/*! ./des/des */ "./node_modules/des.js/lib/des/des.js"); -exports.CBC = __webpack_require__(/*! ./des/cbc */ "./node_modules/des.js/lib/des/cbc.js"); -exports.EDE = __webpack_require__(/*! ./des/ede */ "./node_modules/des.js/lib/des/ede.js"); - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des/cbc.js": -/*!********************************************!*\ - !*** ./node_modules/des.js/lib/des/cbc.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var proto = {}; - -function CBCState(iv) { - assert.equal(iv.length, 8, 'Invalid IV length'); - - this.iv = new Array(8); - for (var i = 0; i < this.iv.length; i++) - this.iv[i] = iv[i]; -} - -function instantiate(Base) { - function CBC(options) { - Base.call(this, options); - this._cbcInit(); - } - inherits(CBC, Base); - - var keys = Object.keys(proto); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - CBC.prototype[key] = proto[key]; - } - - CBC.create = function create(options) { - return new CBC(options); - }; - - return CBC; -} - -exports.instantiate = instantiate; - -proto._cbcInit = function _cbcInit() { - var state = new CBCState(this.options.iv); - this._cbcState = state; -}; - -proto._update = function _update(inp, inOff, out, outOff) { - var state = this._cbcState; - var superProto = this.constructor.super_.prototype; - - var iv = state.iv; - if (this.type === 'encrypt') { - for (var i = 0; i < this.blockSize; i++) - iv[i] ^= inp[inOff + i]; - - superProto._update.call(this, iv, 0, out, outOff); - - for (var i = 0; i < this.blockSize; i++) - iv[i] = out[outOff + i]; - } else { - superProto._update.call(this, inp, inOff, out, outOff); - - for (var i = 0; i < this.blockSize; i++) - out[outOff + i] ^= iv[i]; - - for (var i = 0; i < this.blockSize; i++) - iv[i] = inp[inOff + i]; - } -}; - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des/cipher.js": -/*!***********************************************!*\ - !*** ./node_modules/des.js/lib/des/cipher.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -function Cipher(options) { - this.options = options; - - this.type = this.options.type; - this.blockSize = 8; - this._init(); - - this.buffer = new Array(this.blockSize); - this.bufferOff = 0; -} -module.exports = Cipher; - -Cipher.prototype._init = function _init() { - // Might be overrided -}; - -Cipher.prototype.update = function update(data) { - if (data.length === 0) - return []; - - if (this.type === 'decrypt') - return this._updateDecrypt(data); - else - return this._updateEncrypt(data); -}; - -Cipher.prototype._buffer = function _buffer(data, off) { - // Append data to buffer - var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); - for (var i = 0; i < min; i++) - this.buffer[this.bufferOff + i] = data[off + i]; - this.bufferOff += min; - - // Shift next - return min; -}; - -Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { - this._update(this.buffer, 0, out, off); - this.bufferOff = 0; - return this.blockSize; -}; - -Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { - var inputOff = 0; - var outputOff = 0; - - var count = ((this.bufferOff + data.length) / this.blockSize) | 0; - var out = new Array(count * this.blockSize); - - if (this.bufferOff !== 0) { - inputOff += this._buffer(data, inputOff); - - if (this.bufferOff === this.buffer.length) - outputOff += this._flushBuffer(out, outputOff); - } - - // Write blocks - var max = data.length - ((data.length - inputOff) % this.blockSize); - for (; inputOff < max; inputOff += this.blockSize) { - this._update(data, inputOff, out, outputOff); - outputOff += this.blockSize; - } - - // Queue rest - for (; inputOff < data.length; inputOff++, this.bufferOff++) - this.buffer[this.bufferOff] = data[inputOff]; - - return out; -}; - -Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { - var inputOff = 0; - var outputOff = 0; - - var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; - var out = new Array(count * this.blockSize); - - // TODO(indutny): optimize it, this is far from optimal - for (; count > 0; count--) { - inputOff += this._buffer(data, inputOff); - outputOff += this._flushBuffer(out, outputOff); - } - - // Buffer rest of the input - inputOff += this._buffer(data, inputOff); - - return out; -}; - -Cipher.prototype.final = function final(buffer) { - var first; - if (buffer) - first = this.update(buffer); - - var last; - if (this.type === 'encrypt') - last = this._finalEncrypt(); - else - last = this._finalDecrypt(); - - if (first) - return first.concat(last); - else - return last; -}; - -Cipher.prototype._pad = function _pad(buffer, off) { - if (off === 0) - return false; - - while (off < buffer.length) - buffer[off++] = 0; - - return true; -}; - -Cipher.prototype._finalEncrypt = function _finalEncrypt() { - if (!this._pad(this.buffer, this.bufferOff)) - return []; - - var out = new Array(this.blockSize); - this._update(this.buffer, 0, out, 0); - return out; -}; - -Cipher.prototype._unpad = function _unpad(buffer) { - return buffer; -}; - -Cipher.prototype._finalDecrypt = function _finalDecrypt() { - assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); - var out = new Array(this.blockSize); - this._flushBuffer(out, 0); - - return this._unpad(out); -}; - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des/des.js": -/*!********************************************!*\ - !*** ./node_modules/des.js/lib/des/des.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var des = __webpack_require__(/*! ../des */ "./node_modules/des.js/lib/des.js"); -var utils = des.utils; -var Cipher = des.Cipher; - -function DESState() { - this.tmp = new Array(2); - this.keys = null; -} - -function DES(options) { - Cipher.call(this, options); - - var state = new DESState(); - this._desState = state; - - this.deriveKeys(state, options.key); -} -inherits(DES, Cipher); -module.exports = DES; - -DES.create = function create(options) { - return new DES(options); -}; - -var shiftTable = [ - 1, 1, 2, 2, 2, 2, 2, 2, - 1, 2, 2, 2, 2, 2, 2, 1 -]; - -DES.prototype.deriveKeys = function deriveKeys(state, key) { - state.keys = new Array(16 * 2); - - assert.equal(key.length, this.blockSize, 'Invalid key length'); - - var kL = utils.readUInt32BE(key, 0); - var kR = utils.readUInt32BE(key, 4); - - utils.pc1(kL, kR, state.tmp, 0); - kL = state.tmp[0]; - kR = state.tmp[1]; - for (var i = 0; i < state.keys.length; i += 2) { - var shift = shiftTable[i >>> 1]; - kL = utils.r28shl(kL, shift); - kR = utils.r28shl(kR, shift); - utils.pc2(kL, kR, state.keys, i); - } -}; - -DES.prototype._update = function _update(inp, inOff, out, outOff) { - var state = this._desState; - - var l = utils.readUInt32BE(inp, inOff); - var r = utils.readUInt32BE(inp, inOff + 4); - - // Initial Permutation - utils.ip(l, r, state.tmp, 0); - l = state.tmp[0]; - r = state.tmp[1]; - - if (this.type === 'encrypt') - this._encrypt(state, l, r, state.tmp, 0); - else - this._decrypt(state, l, r, state.tmp, 0); - - l = state.tmp[0]; - r = state.tmp[1]; - - utils.writeUInt32BE(out, l, outOff); - utils.writeUInt32BE(out, r, outOff + 4); -}; - -DES.prototype._pad = function _pad(buffer, off) { - var value = buffer.length - off; - for (var i = off; i < buffer.length; i++) - buffer[i] = value; - - return true; -}; - -DES.prototype._unpad = function _unpad(buffer) { - var pad = buffer[buffer.length - 1]; - for (var i = buffer.length - pad; i < buffer.length; i++) - assert.equal(buffer[i], pad); - - return buffer.slice(0, buffer.length - pad); -}; - -DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { - var l = lStart; - var r = rStart; - - // Apply f() x16 times - for (var i = 0; i < state.keys.length; i += 2) { - var keyL = state.keys[i]; - var keyR = state.keys[i + 1]; - - // f(r, k) - utils.expand(r, state.tmp, 0); - - keyL ^= state.tmp[0]; - keyR ^= state.tmp[1]; - var s = utils.substitute(keyL, keyR); - var f = utils.permute(s); - - var t = r; - r = (l ^ f) >>> 0; - l = t; - } - - // Reverse Initial Permutation - utils.rip(r, l, out, off); -}; - -DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { - var l = rStart; - var r = lStart; - - // Apply f() x16 times - for (var i = state.keys.length - 2; i >= 0; i -= 2) { - var keyL = state.keys[i]; - var keyR = state.keys[i + 1]; - - // f(r, k) - utils.expand(l, state.tmp, 0); - - keyL ^= state.tmp[0]; - keyR ^= state.tmp[1]; - var s = utils.substitute(keyL, keyR); - var f = utils.permute(s); - - var t = l; - l = (r ^ f) >>> 0; - r = t; - } - - // Reverse Initial Permutation - utils.rip(l, r, out, off); -}; - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des/ede.js": -/*!********************************************!*\ - !*** ./node_modules/des.js/lib/des/ede.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -var des = __webpack_require__(/*! ../des */ "./node_modules/des.js/lib/des.js"); -var Cipher = des.Cipher; -var DES = des.DES; - -function EDEState(type, key) { - assert.equal(key.length, 24, 'Invalid key length'); - - var k1 = key.slice(0, 8); - var k2 = key.slice(8, 16); - var k3 = key.slice(16, 24); - - if (type === 'encrypt') { - this.ciphers = [ - DES.create({ type: 'encrypt', key: k1 }), - DES.create({ type: 'decrypt', key: k2 }), - DES.create({ type: 'encrypt', key: k3 }) - ]; - } else { - this.ciphers = [ - DES.create({ type: 'decrypt', key: k3 }), - DES.create({ type: 'encrypt', key: k2 }), - DES.create({ type: 'decrypt', key: k1 }) - ]; - } -} - -function EDE(options) { - Cipher.call(this, options); - - var state = new EDEState(this.type, this.options.key); - this._edeState = state; -} -inherits(EDE, Cipher); - -module.exports = EDE; - -EDE.create = function create(options) { - return new EDE(options); -}; - -EDE.prototype._update = function _update(inp, inOff, out, outOff) { - var state = this._edeState; - - state.ciphers[0]._update(inp, inOff, out, outOff); - state.ciphers[1]._update(out, outOff, out, outOff); - state.ciphers[2]._update(out, outOff, out, outOff); -}; - -EDE.prototype._pad = DES.prototype._pad; -EDE.prototype._unpad = DES.prototype._unpad; - - -/***/ }), - -/***/ "./node_modules/des.js/lib/des/utils.js": -/*!**********************************************!*\ - !*** ./node_modules/des.js/lib/des/utils.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.readUInt32BE = function readUInt32BE(bytes, off) { - var res = (bytes[0 + off] << 24) | - (bytes[1 + off] << 16) | - (bytes[2 + off] << 8) | - bytes[3 + off]; - return res >>> 0; -}; - -exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { - bytes[0 + off] = value >>> 24; - bytes[1 + off] = (value >>> 16) & 0xff; - bytes[2 + off] = (value >>> 8) & 0xff; - bytes[3 + off] = value & 0xff; -}; - -exports.ip = function ip(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - for (var i = 6; i >= 0; i -= 2) { - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >>> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inL >>> (j + i)) & 1; - } - } - - for (var i = 6; i >= 0; i -= 2) { - for (var j = 1; j <= 25; j += 8) { - outR <<= 1; - outR |= (inR >>> (j + i)) & 1; - } - for (var j = 1; j <= 25; j += 8) { - outR <<= 1; - outR |= (inL >>> (j + i)) & 1; - } - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.rip = function rip(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - for (var i = 0; i < 4; i++) { - for (var j = 24; j >= 0; j -= 8) { - outL <<= 1; - outL |= (inR >>> (j + i)) & 1; - outL <<= 1; - outL |= (inL >>> (j + i)) & 1; - } - } - for (var i = 4; i < 8; i++) { - for (var j = 24; j >= 0; j -= 8) { - outR <<= 1; - outR |= (inR >>> (j + i)) & 1; - outR <<= 1; - outR |= (inL >>> (j + i)) & 1; - } - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.pc1 = function pc1(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - // 7, 15, 23, 31, 39, 47, 55, 63 - // 6, 14, 22, 30, 39, 47, 55, 63 - // 5, 13, 21, 29, 39, 47, 55, 63 - // 4, 12, 20, 28 - for (var i = 7; i >= 5; i--) { - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inL >> (j + i)) & 1; - } - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >> (j + i)) & 1; - } - - // 1, 9, 17, 25, 33, 41, 49, 57 - // 2, 10, 18, 26, 34, 42, 50, 58 - // 3, 11, 19, 27, 35, 43, 51, 59 - // 36, 44, 52, 60 - for (var i = 1; i <= 3; i++) { - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inR >> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inL >> (j + i)) & 1; - } - } - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inL >> (j + i)) & 1; - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.r28shl = function r28shl(num, shift) { - return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); -}; - -var pc2table = [ - // inL => outL - 14, 11, 17, 4, 27, 23, 25, 0, - 13, 22, 7, 18, 5, 9, 16, 24, - 2, 20, 12, 21, 1, 8, 15, 26, - - // inR => outR - 15, 4, 25, 19, 9, 1, 26, 16, - 5, 11, 23, 8, 12, 7, 17, 0, - 22, 3, 10, 14, 6, 20, 27, 24 -]; - -exports.pc2 = function pc2(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - var len = pc2table.length >>> 1; - for (var i = 0; i < len; i++) { - outL <<= 1; - outL |= (inL >>> pc2table[i]) & 0x1; - } - for (var i = len; i < pc2table.length; i++) { - outR <<= 1; - outR |= (inR >>> pc2table[i]) & 0x1; - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.expand = function expand(r, out, off) { - var outL = 0; - var outR = 0; - - outL = ((r & 1) << 5) | (r >>> 27); - for (var i = 23; i >= 15; i -= 4) { - outL <<= 6; - outL |= (r >>> i) & 0x3f; - } - for (var i = 11; i >= 3; i -= 4) { - outR |= (r >>> i) & 0x3f; - outR <<= 6; - } - outR |= ((r & 0x1f) << 1) | (r >>> 31); - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -var sTable = [ - 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 -]; - -exports.substitute = function substitute(inL, inR) { - var out = 0; - for (var i = 0; i < 4; i++) { - var b = (inL >>> (18 - i * 6)) & 0x3f; - var sb = sTable[i * 0x40 + b]; - - out <<= 4; - out |= sb; - } - for (var i = 0; i < 4; i++) { - var b = (inR >>> (18 - i * 6)) & 0x3f; - var sb = sTable[4 * 0x40 + i * 0x40 + b]; - - out <<= 4; - out |= sb; - } - return out >>> 0; -}; - -var permuteTable = [ - 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 -]; - -exports.permute = function permute(num) { - var out = 0; - for (var i = 0; i < permuteTable.length; i++) { - out <<= 1; - out |= (num >>> permuteTable[i]) & 0x1; - } - return out >>> 0; -}; - -exports.padSplit = function padSplit(num, size, group) { - var str = num.toString(2); - while (str.length < size) - str = '0' + str; - - var out = []; - for (var i = 0; i < size; i += group) - out.push(str.slice(i, i + group)); - return out.join(' '); -}; - - -/***/ }), - -/***/ "./node_modules/diffie-hellman/browser.js": -/*!************************************************!*\ - !*** ./node_modules/diffie-hellman/browser.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ "./node_modules/diffie-hellman/lib/generatePrime.js") -var primes = __webpack_require__(/*! ./lib/primes.json */ "./node_modules/diffie-hellman/lib/primes.json") - -var DH = __webpack_require__(/*! ./lib/dh */ "./node_modules/diffie-hellman/lib/dh.js") - -function getDiffieHellman (mod) { - var prime = new Buffer(primes[mod].prime, 'hex') - var gen = new Buffer(primes[mod].gen, 'hex') - - return new DH(prime, gen) -} - -var ENCODINGS = { - 'binary': true, 'hex': true, 'base64': true -} - -function createDiffieHellman (prime, enc, generator, genc) { - if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) { - return createDiffieHellman(prime, 'binary', enc, generator) - } - - enc = enc || 'binary' - genc = genc || 'binary' - generator = generator || new Buffer([2]) - - if (!Buffer.isBuffer(generator)) { - generator = new Buffer(generator, genc) - } - - if (typeof prime === 'number') { - return new DH(generatePrime(prime, generator), generator, true) - } - - if (!Buffer.isBuffer(prime)) { - prime = new Buffer(prime, enc) - } - - return new DH(prime, generator, true) -} - -exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman -exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/diffie-hellman/lib/dh.js": -/*!***********************************************!*\ - !*** ./node_modules/diffie-hellman/lib/dh.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var MillerRabin = __webpack_require__(/*! miller-rabin */ "./node_modules/miller-rabin/lib/mr.js"); -var millerRabin = new MillerRabin(); -var TWENTYFOUR = new BN(24); -var ELEVEN = new BN(11); -var TEN = new BN(10); -var THREE = new BN(3); -var SEVEN = new BN(7); -var primes = __webpack_require__(/*! ./generatePrime */ "./node_modules/diffie-hellman/lib/generatePrime.js"); -var randomBytes = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js"); -module.exports = DH; - -function setPublicKey(pub, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(pub)) { - pub = new Buffer(pub, enc); - } - this._pub = new BN(pub); - return this; -} - -function setPrivateKey(priv, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(priv)) { - priv = new Buffer(priv, enc); - } - this._priv = new BN(priv); - return this; -} - -var primeCache = {}; -function checkPrime(prime, generator) { - var gen = generator.toString('hex'); - var hex = [gen, prime.toString(16)].join('_'); - if (hex in primeCache) { - return primeCache[hex]; - } - var error = 0; - - if (prime.isEven() || - !primes.simpleSieve || - !primes.fermatTest(prime) || - !millerRabin.test(prime)) { - //not a prime so +1 - error += 1; - - if (gen === '02' || gen === '05') { - // we'd be able to check the generator - // it would fail so +8 - error += 8; - } else { - //we wouldn't be able to test the generator - // so +4 - error += 4; - } - primeCache[hex] = error; - return error; - } - if (!millerRabin.test(prime.shrn(1))) { - //not a safe prime - error += 2; - } - var rem; - switch (gen) { - case '02': - if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { - // unsuidable generator - error += 8; - } - break; - case '05': - rem = prime.mod(TEN); - if (rem.cmp(THREE) && rem.cmp(SEVEN)) { - // prime mod 10 needs to equal 3 or 7 - error += 8; - } - break; - default: - error += 4; - } - primeCache[hex] = error; - return error; -} - -function DH(prime, generator, malleable) { - this.setGenerator(generator); - this.__prime = new BN(prime); - this._prime = BN.mont(this.__prime); - this._primeLen = prime.length; - this._pub = undefined; - this._priv = undefined; - this._primeCode = undefined; - if (malleable) { - this.setPublicKey = setPublicKey; - this.setPrivateKey = setPrivateKey; - } else { - this._primeCode = 8; - } -} -Object.defineProperty(DH.prototype, 'verifyError', { - enumerable: true, - get: function () { - if (typeof this._primeCode !== 'number') { - this._primeCode = checkPrime(this.__prime, this.__gen); - } - return this._primeCode; - } -}); -DH.prototype.generateKeys = function () { - if (!this._priv) { - this._priv = new BN(randomBytes(this._primeLen)); - } - this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); - return this.getPublicKey(); -}; - -DH.prototype.computeSecret = function (other) { - other = new BN(other); - other = other.toRed(this._prime); - var secret = other.redPow(this._priv).fromRed(); - var out = new Buffer(secret.toArray()); - var prime = this.getPrime(); - if (out.length < prime.length) { - var front = new Buffer(prime.length - out.length); - front.fill(0); - out = Buffer.concat([front, out]); - } - return out; -}; - -DH.prototype.getPublicKey = function getPublicKey(enc) { - return formatReturnValue(this._pub, enc); -}; - -DH.prototype.getPrivateKey = function getPrivateKey(enc) { - return formatReturnValue(this._priv, enc); -}; - -DH.prototype.getPrime = function (enc) { - return formatReturnValue(this.__prime, enc); -}; - -DH.prototype.getGenerator = function (enc) { - return formatReturnValue(this._gen, enc); -}; - -DH.prototype.setGenerator = function (gen, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(gen)) { - gen = new Buffer(gen, enc); - } - this.__gen = gen; - this._gen = new BN(gen); - return this; -}; - -function formatReturnValue(bn, enc) { - var buf = new Buffer(bn.toArray()); - if (!enc) { - return buf; - } else { - return buf.toString(enc); - } -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/diffie-hellman/lib/generatePrime.js": -/*!**********************************************************!*\ - !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var randomBytes = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js"); -module.exports = findPrime; -findPrime.simpleSieve = simpleSieve; -findPrime.fermatTest = fermatTest; -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var TWENTYFOUR = new BN(24); -var MillerRabin = __webpack_require__(/*! miller-rabin */ "./node_modules/miller-rabin/lib/mr.js"); -var millerRabin = new MillerRabin(); -var ONE = new BN(1); -var TWO = new BN(2); -var FIVE = new BN(5); -var SIXTEEN = new BN(16); -var EIGHT = new BN(8); -var TEN = new BN(10); -var THREE = new BN(3); -var SEVEN = new BN(7); -var ELEVEN = new BN(11); -var FOUR = new BN(4); -var TWELVE = new BN(12); -var primes = null; - -function _getPrimes() { - if (primes !== null) - return primes; - - var limit = 0x100000; - var res = []; - res[0] = 2; - for (var i = 1, k = 3; k < limit; k += 2) { - var sqrt = Math.ceil(Math.sqrt(k)); - for (var j = 0; j < i && res[j] <= sqrt; j++) - if (k % res[j] === 0) - break; - - if (i !== j && res[j] <= sqrt) - continue; - - res[i++] = k; - } - primes = res; - return res; -} - -function simpleSieve(p) { - var primes = _getPrimes(); - - for (var i = 0; i < primes.length; i++) - if (p.modn(primes[i]) === 0) { - if (p.cmpn(primes[i]) === 0) { - return true; - } else { - return false; - } - } - - return true; -} - -function fermatTest(p) { - var red = BN.mont(p); - return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; -} - -function findPrime(bits, gen) { - if (bits < 16) { - // this is what openssl does - if (gen === 2 || gen === 5) { - return new BN([0x8c, 0x7b]); - } else { - return new BN([0x8c, 0x27]); - } - } - gen = new BN(gen); - - var num, n2; - - while (true) { - num = new BN(randomBytes(Math.ceil(bits / 8))); - while (num.bitLength() > bits) { - num.ishrn(1); - } - if (num.isEven()) { - num.iadd(ONE); - } - if (!num.testn(1)) { - num.iadd(TWO); - } - if (!gen.cmp(TWO)) { - while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { - num.iadd(FOUR); - } - } else if (!gen.cmp(FIVE)) { - while (num.mod(TEN).cmp(THREE)) { - num.iadd(FOUR); - } - } - n2 = num.shrn(1); - if (simpleSieve(n2) && simpleSieve(num) && - fermatTest(n2) && fermatTest(num) && - millerRabin.test(n2) && millerRabin.test(num)) { - return num; - } - } - -} - - -/***/ }), - -/***/ "./node_modules/diffie-hellman/lib/primes.json": -/*!*****************************************************!*\ - !*** ./node_modules/diffie-hellman/lib/primes.json ***! - \*****************************************************/ -/*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */ -/***/ (function(module) { - -module.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"}}; - -/***/ }), - -/***/ "./node_modules/dom-helpers/activeElement.js": -/*!***************************************************!*\ - !*** ./node_modules/dom-helpers/activeElement.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = activeElement; - -var _ownerDocument = __webpack_require__(/*! ./ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function activeElement() { - var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)(); - - try { - return doc.activeElement; - } catch (e) {/* ie throws if no active element */} -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/ownerDocument.js": -/*!***************************************************!*\ - !*** ./node_modules/dom-helpers/ownerDocument.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ownerDocument; -function ownerDocument(node) { - return node && node.ownerDocument || document; -} -module.exports = exports["default"]; - -/***/ }), - -/***/ "./node_modules/dom-helpers/ownerWindow.js": -/*!*************************************************!*\ - !*** ./node_modules/dom-helpers/ownerWindow.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ownerWindow; - -var _ownerDocument = __webpack_require__(/*! ./ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownerWindow(node) { - var doc = (0, _ownerDocument2.default)(node); - return doc && doc.defaultView || doc.parentWindow; -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/query/contains.js": -/*!****************************************************!*\ - !*** ./node_modules/dom-helpers/query/contains.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _inDOM = __webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"); - -var _inDOM2 = _interopRequireDefault(_inDOM); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - // HTML DOM and SVG DOM may have different support levels, - // so we need to check on context instead of a document root element. - return _inDOM2.default ? function (context, node) { - if (context.contains) { - return context.contains(node); - } else if (context.compareDocumentPosition) { - return context === node || !!(context.compareDocumentPosition(node) & 16); - } else { - return fallback(context, node); - } - } : fallback; -}(); - -function fallback(context, node) { - if (node) do { - if (node === context) return true; - } while (node = node.parentNode); - - return false; -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/query/isWindow.js": -/*!****************************************************!*\ - !*** ./node_modules/dom-helpers/query/isWindow.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getWindow; -function getWindow(node) { - return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false; -} -module.exports = exports["default"]; - -/***/ }), - -/***/ "./node_modules/dom-helpers/style/getComputedStyle.js": -/*!************************************************************!*\ - !*** ./node_modules/dom-helpers/style/getComputedStyle.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _getComputedStyle; - -var _camelizeStyle = __webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"); - -var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var rposition = /^(top|right|bottom|left)$/; -var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i; - -function _getComputedStyle(node) { - if (!node) throw new TypeError('No Element passed to `getComputedStyle()`'); - var doc = node.ownerDocument; - - return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : { - //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72 - getPropertyValue: function getPropertyValue(prop) { - var style = node.style; - - prop = (0, _camelizeStyle2.default)(prop); - - if (prop == 'float') prop = 'styleFloat'; - - var current = node.currentStyle[prop] || null; - - if (current == null && style && style[prop]) current = style[prop]; - - if (rnumnonpx.test(current) && !rposition.test(prop)) { - // Remember the original values - var left = style.left; - var runStyle = node.runtimeStyle; - var rsLeft = runStyle && runStyle.left; - - // Put in the new values to get a computed value out - if (rsLeft) runStyle.left = node.currentStyle.left; - - style.left = prop === 'fontSize' ? '1em' : current; - current = style.pixelLeft + 'px'; - - // Revert the changed values - style.left = left; - if (rsLeft) runStyle.left = rsLeft; - } - - return current; - } - }; -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/style/index.js": -/*!*************************************************!*\ - !*** ./node_modules/dom-helpers/style/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = style; - -var _camelizeStyle = __webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"); - -var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle); - -var _hyphenateStyle = __webpack_require__(/*! ../util/hyphenateStyle */ "./node_modules/dom-helpers/util/hyphenateStyle.js"); - -var _hyphenateStyle2 = _interopRequireDefault(_hyphenateStyle); - -var _getComputedStyle2 = __webpack_require__(/*! ./getComputedStyle */ "./node_modules/dom-helpers/style/getComputedStyle.js"); - -var _getComputedStyle3 = _interopRequireDefault(_getComputedStyle2); - -var _removeStyle = __webpack_require__(/*! ./removeStyle */ "./node_modules/dom-helpers/style/removeStyle.js"); - -var _removeStyle2 = _interopRequireDefault(_removeStyle); - -var _properties = __webpack_require__(/*! ../transition/properties */ "./node_modules/dom-helpers/transition/properties.js"); - -var _isTransform = __webpack_require__(/*! ../transition/isTransform */ "./node_modules/dom-helpers/transition/isTransform.js"); - -var _isTransform2 = _interopRequireDefault(_isTransform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function style(node, property, value) { - var css = ''; - var transforms = ''; - var props = property; - - if (typeof property === 'string') { - if (value === undefined) { - return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2.default)(property)); - } else { - (props = {})[property] = value; - } - } - - Object.keys(props).forEach(function (key) { - var value = props[key]; - if (!value && value !== 0) { - (0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key)); - } else if ((0, _isTransform2.default)(key)) { - transforms += key + '(' + value + ') '; - } else { - css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';'; - } - }); - - if (transforms) { - css += _properties.transform + ': ' + transforms + ';'; - } - - node.style.cssText += ';' + css; -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/style/removeStyle.js": -/*!*******************************************************!*\ - !*** ./node_modules/dom-helpers/style/removeStyle.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeStyle; -function removeStyle(node, key) { - return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key); -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/transition/isTransform.js": -/*!************************************************************!*\ - !*** ./node_modules/dom-helpers/transition/isTransform.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isTransform; -var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i; - -function isTransform(property) { - return !!(property && supportedTransforms.test(property)); -} -module.exports = exports["default"]; - -/***/ }), - -/***/ "./node_modules/dom-helpers/transition/properties.js": -/*!***********************************************************!*\ - !*** ./node_modules/dom-helpers/transition/properties.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined; - -var _inDOM = __webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"); - -var _inDOM2 = _interopRequireDefault(_inDOM); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var transform = 'transform'; -var prefix = void 0, - transitionEnd = void 0, - animationEnd = void 0; -var transitionProperty = void 0, - transitionDuration = void 0, - transitionTiming = void 0, - transitionDelay = void 0; -var animationName = void 0, - animationDuration = void 0, - animationTiming = void 0, - animationDelay = void 0; - -if (_inDOM2.default) { - var _getTransitionPropert = getTransitionProperties(); - - prefix = _getTransitionPropert.prefix; - exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd; - exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd; - - - exports.transform = transform = prefix + '-' + transform; - exports.transitionProperty = transitionProperty = prefix + '-transition-property'; - exports.transitionDuration = transitionDuration = prefix + '-transition-duration'; - exports.transitionDelay = transitionDelay = prefix + '-transition-delay'; - exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function'; - - exports.animationName = animationName = prefix + '-animation-name'; - exports.animationDuration = animationDuration = prefix + '-animation-duration'; - exports.animationTiming = animationTiming = prefix + '-animation-delay'; - exports.animationDelay = animationDelay = prefix + '-animation-timing-function'; -} - -exports.transform = transform; -exports.transitionProperty = transitionProperty; -exports.transitionTiming = transitionTiming; -exports.transitionDelay = transitionDelay; -exports.transitionDuration = transitionDuration; -exports.transitionEnd = transitionEnd; -exports.animationName = animationName; -exports.animationDuration = animationDuration; -exports.animationTiming = animationTiming; -exports.animationDelay = animationDelay; -exports.animationEnd = animationEnd; -exports.default = { - transform: transform, - end: transitionEnd, - property: transitionProperty, - timing: transitionTiming, - delay: transitionDelay, - duration: transitionDuration -}; - - -function getTransitionProperties() { - var style = document.createElement('div').style; - - var vendorMap = { - O: function O(e) { - return 'o' + e.toLowerCase(); - }, - Moz: function Moz(e) { - return e.toLowerCase(); - }, - Webkit: function Webkit(e) { - return 'webkit' + e; - }, - ms: function ms(e) { - return 'MS' + e; - } - }; - - var vendors = Object.keys(vendorMap); - - var transitionEnd = void 0, - animationEnd = void 0; - var prefix = ''; - - for (var i = 0; i < vendors.length; i++) { - var vendor = vendors[i]; - - if (vendor + 'TransitionProperty' in style) { - prefix = '-' + vendor.toLowerCase(); - transitionEnd = vendorMap[vendor]('TransitionEnd'); - animationEnd = vendorMap[vendor]('AnimationEnd'); - break; - } - } - - if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend'; - - if (!animationEnd && 'animationName' in style) animationEnd = 'animationend'; - - style = null; - - return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix }; -} - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/camelize.js": -/*!***************************************************!*\ - !*** ./node_modules/dom-helpers/util/camelize.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = camelize; -var rHyphen = /-(.)/g; - -function camelize(string) { - return string.replace(rHyphen, function (_, chr) { - return chr.toUpperCase(); - }); -} -module.exports = exports["default"]; - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/camelizeStyle.js": -/*!********************************************************!*\ - !*** ./node_modules/dom-helpers/util/camelizeStyle.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = camelizeStyleName; - -var _camelize = __webpack_require__(/*! ./camelize */ "./node_modules/dom-helpers/util/camelize.js"); - -var _camelize2 = _interopRequireDefault(_camelize); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var msPattern = /^-ms-/; /** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js - */ -function camelizeStyleName(string) { - return (0, _camelize2.default)(string.replace(msPattern, 'ms-')); -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/hyphenate.js": -/*!****************************************************!*\ - !*** ./node_modules/dom-helpers/util/hyphenate.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = hyphenate; - -var rUpper = /([A-Z])/g; - -function hyphenate(string) { - return string.replace(rUpper, '-$1').toLowerCase(); -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/hyphenateStyle.js": -/*!*********************************************************!*\ - !*** ./node_modules/dom-helpers/util/hyphenateStyle.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = hyphenateStyleName; - -var _hyphenate = __webpack_require__(/*! ./hyphenate */ "./node_modules/dom-helpers/util/hyphenate.js"); - -var _hyphenate2 = _interopRequireDefault(_hyphenate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var msPattern = /^ms-/; /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js - */ - -function hyphenateStyleName(string) { - return (0, _hyphenate2.default)(string).replace(msPattern, '-ms-'); -} -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/inDOM.js": -/*!************************************************!*\ - !*** ./node_modules/dom-helpers/util/inDOM.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/dom-helpers/util/scrollbarSize.js": -/*!********************************************************!*\ - !*** ./node_modules/dom-helpers/util/scrollbarSize.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (recalc) { - if (!size && size !== 0 || recalc) { - if (_inDOM2.default) { - var scrollDiv = document.createElement('div'); - - scrollDiv.style.position = 'absolute'; - scrollDiv.style.top = '-9999px'; - scrollDiv.style.width = '50px'; - scrollDiv.style.height = '50px'; - scrollDiv.style.overflow = 'scroll'; - - document.body.appendChild(scrollDiv); - size = scrollDiv.offsetWidth - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - } - } - - return size; -}; - -var _inDOM = __webpack_require__(/*! ./inDOM */ "./node_modules/dom-helpers/util/inDOM.js"); - -var _inDOM2 = _interopRequireDefault(_inDOM); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var size = void 0; - -module.exports = exports['default']; - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic.js": -/*!***********************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elliptic = exports; - -elliptic.version = __webpack_require__(/*! ../package.json */ "./node_modules/elliptic/package.json").version; -elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ "./node_modules/elliptic/lib/elliptic/utils.js"); -elliptic.rand = __webpack_require__(/*! brorand */ "./node_modules/brorand/index.js"); -elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ "./node_modules/elliptic/lib/elliptic/curve/index.js"); -elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ "./node_modules/elliptic/lib/elliptic/curves.js"); - -// Protocols -elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ "./node_modules/elliptic/lib/elliptic/ec/index.js"); -elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ "./node_modules/elliptic/lib/elliptic/eddsa/index.js"); - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curve/base.js": -/*!**********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var getNAF = utils.getNAF; -var getJSF = utils.getJSF; -var assert = utils.assert; - -function BaseCurve(type, conf) { - this.type = type; - this.p = new BN(conf.p, 16); - - // Use Montgomery, when there is no fast reduction for the prime - this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); - - // Useful for many curves - this.zero = new BN(0).toRed(this.red); - this.one = new BN(1).toRed(this.red); - this.two = new BN(2).toRed(this.red); - - // Curve configuration, optional - this.n = conf.n && new BN(conf.n, 16); - this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); - - // Temporary arrays - this._wnafT1 = new Array(4); - this._wnafT2 = new Array(4); - this._wnafT3 = new Array(4); - this._wnafT4 = new Array(4); - - // Generalized Greg Maxwell's trick - var adjustCount = this.n && this.p.div(this.n); - if (!adjustCount || adjustCount.cmpn(100) > 0) { - this.redN = null; - } else { - this._maxwellTrick = true; - this.redN = this.n.toRed(this.red); - } -} -module.exports = BaseCurve; - -BaseCurve.prototype.point = function point() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype.validate = function validate() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { - assert(p.precomputed); - var doubles = p._getDoubles(); - - var naf = getNAF(k, 1); - var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); - I /= 3; - - // Translate into more windowed form - var repr = []; - for (var j = 0; j < naf.length; j += doubles.step) { - var nafW = 0; - for (var k = j + doubles.step - 1; k >= j; k--) - nafW = (nafW << 1) + naf[k]; - repr.push(nafW); - } - - var a = this.jpoint(null, null, null); - var b = this.jpoint(null, null, null); - for (var i = I; i > 0; i--) { - for (var j = 0; j < repr.length; j++) { - var nafW = repr[j]; - if (nafW === i) - b = b.mixedAdd(doubles.points[j]); - else if (nafW === -i) - b = b.mixedAdd(doubles.points[j].neg()); - } - a = a.add(b); - } - return a.toP(); -}; - -BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { - var w = 4; - - // Precompute window - var nafPoints = p._getNAFPoints(w); - w = nafPoints.wnd; - var wnd = nafPoints.points; - - // Get NAF form - var naf = getNAF(k, w); - - // Add `this`*(N+1) for every w-NAF index - var acc = this.jpoint(null, null, null); - for (var i = naf.length - 1; i >= 0; i--) { - // Count zeroes - for (var k = 0; i >= 0 && naf[i] === 0; i--) - k++; - if (i >= 0) - k++; - acc = acc.dblp(k); - - if (i < 0) - break; - var z = naf[i]; - assert(z !== 0); - if (p.type === 'affine') { - // J +- P - if (z > 0) - acc = acc.mixedAdd(wnd[(z - 1) >> 1]); - else - acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); - } else { - // J +- J - if (z > 0) - acc = acc.add(wnd[(z - 1) >> 1]); - else - acc = acc.add(wnd[(-z - 1) >> 1].neg()); - } - } - return p.type === 'affine' ? acc.toP() : acc; -}; - -BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, - points, - coeffs, - len, - jacobianResult) { - var wndWidth = this._wnafT1; - var wnd = this._wnafT2; - var naf = this._wnafT3; - - // Fill all arrays - var max = 0; - for (var i = 0; i < len; i++) { - var p = points[i]; - var nafPoints = p._getNAFPoints(defW); - wndWidth[i] = nafPoints.wnd; - wnd[i] = nafPoints.points; - } - - // Comb small window NAFs - for (var i = len - 1; i >= 1; i -= 2) { - var a = i - 1; - var b = i; - if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { - naf[a] = getNAF(coeffs[a], wndWidth[a]); - naf[b] = getNAF(coeffs[b], wndWidth[b]); - max = Math.max(naf[a].length, max); - max = Math.max(naf[b].length, max); - continue; - } - - var comb = [ - points[a], /* 1 */ - null, /* 3 */ - null, /* 5 */ - points[b] /* 7 */ - ]; - - // Try to avoid Projective points, if possible - if (points[a].y.cmp(points[b].y) === 0) { - comb[1] = points[a].add(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].add(points[b].neg()); - } else { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } - - var index = [ - -3, /* -1 -1 */ - -1, /* -1 0 */ - -5, /* -1 1 */ - -7, /* 0 -1 */ - 0, /* 0 0 */ - 7, /* 0 1 */ - 5, /* 1 -1 */ - 1, /* 1 0 */ - 3 /* 1 1 */ - ]; - - var jsf = getJSF(coeffs[a], coeffs[b]); - max = Math.max(jsf[0].length, max); - naf[a] = new Array(max); - naf[b] = new Array(max); - for (var j = 0; j < max; j++) { - var ja = jsf[0][j] | 0; - var jb = jsf[1][j] | 0; - - naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; - naf[b][j] = 0; - wnd[a] = comb; - } - } - - var acc = this.jpoint(null, null, null); - var tmp = this._wnafT4; - for (var i = max; i >= 0; i--) { - var k = 0; - - while (i >= 0) { - var zero = true; - for (var j = 0; j < len; j++) { - tmp[j] = naf[j][i] | 0; - if (tmp[j] !== 0) - zero = false; - } - if (!zero) - break; - k++; - i--; - } - if (i >= 0) - k++; - acc = acc.dblp(k); - if (i < 0) - break; - - for (var j = 0; j < len; j++) { - var z = tmp[j]; - var p; - if (z === 0) - continue; - else if (z > 0) - p = wnd[j][(z - 1) >> 1]; - else if (z < 0) - p = wnd[j][(-z - 1) >> 1].neg(); - - if (p.type === 'affine') - acc = acc.mixedAdd(p); - else - acc = acc.add(p); - } - } - // Zeroify references - for (var i = 0; i < len; i++) - wnd[i] = null; - - if (jacobianResult) - return acc; - else - return acc.toP(); -}; - -function BasePoint(curve, type) { - this.curve = curve; - this.type = type; - this.precomputed = null; -} -BaseCurve.BasePoint = BasePoint; - -BasePoint.prototype.eq = function eq(/*other*/) { - throw new Error('Not implemented'); -}; - -BasePoint.prototype.validate = function validate() { - return this.curve.validate(this); -}; - -BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - bytes = utils.toArray(bytes, enc); - - var len = this.p.byteLength(); - - // uncompressed, hybrid-odd, hybrid-even - if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && - bytes.length - 1 === 2 * len) { - if (bytes[0] === 0x06) - assert(bytes[bytes.length - 1] % 2 === 0); - else if (bytes[0] === 0x07) - assert(bytes[bytes.length - 1] % 2 === 1); - - var res = this.point(bytes.slice(1, 1 + len), - bytes.slice(1 + len, 1 + 2 * len)); - - return res; - } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && - bytes.length - 1 === len) { - return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); - } - throw new Error('Unknown point format'); -}; - -BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { - return this.encode(enc, true); -}; - -BasePoint.prototype._encode = function _encode(compact) { - var len = this.curve.p.byteLength(); - var x = this.getX().toArray('be', len); - - if (compact) - return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); - - return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ; -}; - -BasePoint.prototype.encode = function encode(enc, compact) { - return utils.encode(this._encode(compact), enc); -}; - -BasePoint.prototype.precompute = function precompute(power) { - if (this.precomputed) - return this; - - var precomputed = { - doubles: null, - naf: null, - beta: null - }; - precomputed.naf = this._getNAFPoints(8); - precomputed.doubles = this._getDoubles(4, power); - precomputed.beta = this._getBeta(); - this.precomputed = precomputed; - - return this; -}; - -BasePoint.prototype._hasDoubles = function _hasDoubles(k) { - if (!this.precomputed) - return false; - - var doubles = this.precomputed.doubles; - if (!doubles) - return false; - - return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); -}; - -BasePoint.prototype._getDoubles = function _getDoubles(step, power) { - if (this.precomputed && this.precomputed.doubles) - return this.precomputed.doubles; - - var doubles = [ this ]; - var acc = this; - for (var i = 0; i < power; i += step) { - for (var j = 0; j < step; j++) - acc = acc.dbl(); - doubles.push(acc); - } - return { - step: step, - points: doubles - }; -}; - -BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { - if (this.precomputed && this.precomputed.naf) - return this.precomputed.naf; - - var res = [ this ]; - var max = (1 << wnd) - 1; - var dbl = max === 1 ? null : this.dbl(); - for (var i = 1; i < max; i++) - res[i] = res[i - 1].add(dbl); - return { - wnd: wnd, - points: res - }; -}; - -BasePoint.prototype._getBeta = function _getBeta() { - return null; -}; - -BasePoint.prototype.dblp = function dblp(k) { - var r = this; - for (var i = 0; i < k; i++) - r = r.dbl(); - return r; -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curve/edwards.js": -/*!*************************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var curve = __webpack_require__(/*! ../curve */ "./node_modules/elliptic/lib/elliptic/curve/index.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Base = curve.base; - -var assert = elliptic.utils.assert; - -function EdwardsCurve(conf) { - // NOTE: Important as we are creating point in Base.call() - this.twisted = (conf.a | 0) !== 1; - this.mOneA = this.twisted && (conf.a | 0) === -1; - this.extended = this.mOneA; - - Base.call(this, 'edwards', conf); - - this.a = new BN(conf.a, 16).umod(this.red.m); - this.a = this.a.toRed(this.red); - this.c = new BN(conf.c, 16).toRed(this.red); - this.c2 = this.c.redSqr(); - this.d = new BN(conf.d, 16).toRed(this.red); - this.dd = this.d.redAdd(this.d); - - assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); - this.oneC = (conf.c | 0) === 1; -} -inherits(EdwardsCurve, Base); -module.exports = EdwardsCurve; - -EdwardsCurve.prototype._mulA = function _mulA(num) { - if (this.mOneA) - return num.redNeg(); - else - return this.a.redMul(num); -}; - -EdwardsCurve.prototype._mulC = function _mulC(num) { - if (this.oneC) - return num; - else - return this.c.redMul(num); -}; - -// Just for compatibility with Short curve -EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { - return this.point(x, y, z, t); -}; - -EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var x2 = x.redSqr(); - var rhs = this.c2.redSub(this.a.redMul(x2)); - var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); - - var y2 = rhs.redMul(lhs.redInvm()); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { - y = new BN(y, 16); - if (!y.red) - y = y.toRed(this.red); - - // x^2 = (y^2 - 1) / (d y^2 + 1) - var y2 = y.redSqr(); - var lhs = y2.redSub(this.one); - var rhs = y2.redMul(this.d).redAdd(this.one); - var x2 = lhs.redMul(rhs.redInvm()); - - if (x2.cmp(this.zero) === 0) { - if (odd) - throw new Error('invalid point'); - else - return this.point(this.zero, y); - } - - var x = x2.redSqrt(); - if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - if (x.isOdd() !== odd) - x = x.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve.prototype.validate = function validate(point) { - if (point.isInfinity()) - return true; - - // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) - point.normalize(); - - var x2 = point.x.redSqr(); - var y2 = point.y.redSqr(); - var lhs = x2.redMul(this.a).redAdd(y2); - var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); - - return lhs.cmp(rhs) === 0; -}; - -function Point(curve, x, y, z, t) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && y === null && z === null) { - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - this.z = z ? new BN(z, 16) : this.curve.one; - this.t = t && new BN(t, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - this.zOne = this.z === this.curve.one; - - // Use extended coordinates - if (this.curve.extended && !this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redMul(this.z.redInvm()); - } - } -} -inherits(Point, Base.BasePoint); - -EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point.fromJSON(this, obj); -}; - -EdwardsCurve.prototype.point = function point(x, y, z, t) { - return new Point(this, x, y, z, t); -}; - -Point.fromJSON = function fromJSON(curve, obj) { - return new Point(curve, obj[0], obj[1], obj[2]); -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.x.cmpn(0) === 0 && - this.y.cmp(this.z) === 0; -}; - -Point.prototype._extDbl = function _extDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #doubling-dbl-2008-hwcd - // 4M + 4S - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = 2 * Z1^2 - var c = this.z.redSqr(); - c = c.redIAdd(c); - // D = a * A - var d = this.curve._mulA(a); - // E = (X1 + Y1)^2 - A - B - var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - // G = D + B - var g = d.redAdd(b); - // F = G - C - var f = g.redSub(c); - // H = D - B - var h = d.redSub(b); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point.prototype._projDbl = function _projDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #doubling-dbl-2008-bbjlp - // #doubling-dbl-2007-bl - // and others - // Generally 3M + 4S or 2M + 4S - - // B = (X1 + Y1)^2 - var b = this.x.redAdd(this.y).redSqr(); - // C = X1^2 - var c = this.x.redSqr(); - // D = Y1^2 - var d = this.y.redSqr(); - - var nx; - var ny; - var nz; - if (this.curve.twisted) { - // E = a * C - var e = this.curve._mulA(c); - // F = E + D - var f = e.redAdd(d); - if (this.zOne) { - // X3 = (B - C - D) * (F - 2) - nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F^2 - 2 * F - nz = f.redSqr().redSub(f).redSub(f); - } else { - // H = Z1^2 - var h = this.z.redSqr(); - // J = F - 2 * H - var j = f.redSub(h).redISub(h); - // X3 = (B-C-D)*J - nx = b.redSub(c).redISub(d).redMul(j); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F * J - nz = f.redMul(j); - } - } else { - // E = C + D - var e = c.redAdd(d); - // H = (c * Z1)^2 - var h = this.curve._mulC(this.c.redMul(this.z)).redSqr(); - // J = E - 2 * H - var j = e.redSub(h).redSub(h); - // X3 = c * (B - E) * J - nx = this.curve._mulC(b.redISub(e)).redMul(j); - // Y3 = c * E * (C - D) - ny = this.curve._mulC(e).redMul(c.redISub(d)); - // Z3 = E * J - nz = e.redMul(j); - } - return this.curve.point(nx, ny, nz); -}; - -Point.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - // Double in extended coordinates - if (this.curve.extended) - return this._extDbl(); - else - return this._projDbl(); -}; - -Point.prototype._extAdd = function _extAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #addition-add-2008-hwcd-3 - // 8M - - // A = (Y1 - X1) * (Y2 - X2) - var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - // B = (Y1 + X1) * (Y2 + X2) - var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - // C = T1 * k * T2 - var c = this.t.redMul(this.curve.dd).redMul(p.t); - // D = Z1 * 2 * Z2 - var d = this.z.redMul(p.z.redAdd(p.z)); - // E = B - A - var e = b.redSub(a); - // F = D - C - var f = d.redSub(c); - // G = D + C - var g = d.redAdd(c); - // H = B + A - var h = b.redAdd(a); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point.prototype._projAdd = function _projAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #addition-add-2008-bbjlp - // #addition-add-2007-bl - // 10M + 1S - - // A = Z1 * Z2 - var a = this.z.redMul(p.z); - // B = A^2 - var b = a.redSqr(); - // C = X1 * X2 - var c = this.x.redMul(p.x); - // D = Y1 * Y2 - var d = this.y.redMul(p.y); - // E = d * C * D - var e = this.curve.d.redMul(c).redMul(d); - // F = B - E - var f = b.redSub(e); - // G = B + E - var g = b.redAdd(e); - // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) - var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); - var nx = a.redMul(f).redMul(tmp); - var ny; - var nz; - if (this.curve.twisted) { - // Y3 = A * G * (D - a * C) - ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); - // Z3 = F * G - nz = f.redMul(g); - } else { - // Y3 = A * G * (D - C) - ny = a.redMul(g).redMul(d.redSub(c)); - // Z3 = c * F * G - nz = this.curve._mulC(f).redMul(g); - } - return this.curve.point(nx, ny, nz); -}; - -Point.prototype.add = function add(p) { - if (this.isInfinity()) - return p; - if (p.isInfinity()) - return this; - - if (this.curve.extended) - return this._extAdd(p); - else - return this._projAdd(p); -}; - -Point.prototype.mul = function mul(k) { - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else - return this.curve._wnafMul(this, k); -}; - -Point.prototype.mulAdd = function mulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); -}; - -Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); -}; - -Point.prototype.normalize = function normalize() { - if (this.zOne) - return this; - - // Normalize coordinates - var zi = this.z.redInvm(); - this.x = this.x.redMul(zi); - this.y = this.y.redMul(zi); - if (this.t) - this.t = this.t.redMul(zi); - this.z = this.curve.one; - this.zOne = true; - return this; -}; - -Point.prototype.neg = function neg() { - return this.curve.point(this.x.redNeg(), - this.y, - this.z, - this.t && this.t.redNeg()); -}; - -Point.prototype.getX = function getX() { - this.normalize(); - return this.x.fromRed(); -}; - -Point.prototype.getY = function getY() { - this.normalize(); - return this.y.fromRed(); -}; - -Point.prototype.eq = function eq(other) { - return this === other || - this.getX().cmp(other.getX()) === 0 && - this.getY().cmp(other.getY()) === 0; -}; - -Point.prototype.eqXToP = function eqXToP(x) { - var rx = x.toRed(this.curve.red).redMul(this.z); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(this.z); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } - return false; -}; - -// Compatibility with BaseCurve -Point.prototype.toP = Point.prototype.normalize; -Point.prototype.mixedAdd = Point.prototype.add; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curve/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var curve = exports; - -curve.base = __webpack_require__(/*! ./base */ "./node_modules/elliptic/lib/elliptic/curve/base.js"); -curve.short = __webpack_require__(/*! ./short */ "./node_modules/elliptic/lib/elliptic/curve/short.js"); -curve.mont = __webpack_require__(/*! ./mont */ "./node_modules/elliptic/lib/elliptic/curve/mont.js"); -curve.edwards = __webpack_require__(/*! ./edwards */ "./node_modules/elliptic/lib/elliptic/curve/edwards.js"); - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curve/mont.js": -/*!**********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var curve = __webpack_require__(/*! ../curve */ "./node_modules/elliptic/lib/elliptic/curve/index.js"); -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Base = curve.base; - -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; - -function MontCurve(conf) { - Base.call(this, 'mont', conf); - - this.a = new BN(conf.a, 16).toRed(this.red); - this.b = new BN(conf.b, 16).toRed(this.red); - this.i4 = new BN(4).toRed(this.red).redInvm(); - this.two = new BN(2).toRed(this.red); - this.a24 = this.i4.redMul(this.a.redAdd(this.two)); -} -inherits(MontCurve, Base); -module.exports = MontCurve; - -MontCurve.prototype.validate = function validate(point) { - var x = point.normalize().x; - var x2 = x.redSqr(); - var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); - var y = rhs.redSqrt(); - - return y.redSqr().cmp(rhs) === 0; -}; - -function Point(curve, x, z) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && z === null) { - this.x = this.curve.one; - this.z = this.curve.zero; - } else { - this.x = new BN(x, 16); - this.z = new BN(z, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } -} -inherits(Point, Base.BasePoint); - -MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - return this.point(utils.toArray(bytes, enc), 1); -}; - -MontCurve.prototype.point = function point(x, z) { - return new Point(this, x, z); -}; - -MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point.fromJSON(this, obj); -}; - -Point.prototype.precompute = function precompute() { - // No-op -}; - -Point.prototype._encode = function _encode() { - return this.getX().toArray('be', this.curve.p.byteLength()); -}; - -Point.fromJSON = function fromJSON(curve, obj) { - return new Point(curve, obj[0], obj[1] || curve.one); -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; - -Point.prototype.dbl = function dbl() { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A - - // A = X1 + Z1 - var a = this.x.redAdd(this.z); - // AA = A^2 - var aa = a.redSqr(); - // B = X1 - Z1 - var b = this.x.redSub(this.z); - // BB = B^2 - var bb = b.redSqr(); - // C = AA - BB - var c = aa.redSub(bb); - // X3 = AA * BB - var nx = aa.redMul(bb); - // Z3 = C * (BB + A24 * C) - var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); - return this.curve.point(nx, nz); -}; - -Point.prototype.add = function add() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.diffAdd = function diffAdd(p, diff) { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 - // 4M + 2S + 6A - - // A = X2 + Z2 - var a = this.x.redAdd(this.z); - // B = X2 - Z2 - var b = this.x.redSub(this.z); - // C = X3 + Z3 - var c = p.x.redAdd(p.z); - // D = X3 - Z3 - var d = p.x.redSub(p.z); - // DA = D * A - var da = d.redMul(a); - // CB = C * B - var cb = c.redMul(b); - // X5 = Z1 * (DA + CB)^2 - var nx = diff.z.redMul(da.redAdd(cb).redSqr()); - // Z5 = X1 * (DA - CB)^2 - var nz = diff.x.redMul(da.redISub(cb).redSqr()); - return this.curve.point(nx, nz); -}; - -Point.prototype.mul = function mul(k) { - var t = k.clone(); - var a = this; // (N / 2) * Q + Q - var b = this.curve.point(null, null); // (N / 2) * Q - var c = this; // Q - - for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) - bits.push(t.andln(1)); - - for (var i = bits.length - 1; i >= 0; i--) { - if (bits[i] === 0) { - // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q - a = a.diffAdd(b, c); - // N * Q = 2 * ((N / 2) * Q + Q)) - b = b.dbl(); - } else { - // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) - b = a.diffAdd(b, c); - // N * Q + Q = 2 * ((N / 2) * Q + Q) - a = a.dbl(); - } - } - return b; -}; - -Point.prototype.mulAdd = function mulAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.jumlAdd = function jumlAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.eq = function eq(other) { - return this.getX().cmp(other.getX()) === 0; -}; - -Point.prototype.normalize = function normalize() { - this.x = this.x.redMul(this.z.redInvm()); - this.z = this.curve.one; - return this; -}; - -Point.prototype.getX = function getX() { - // Normalize coordinates - this.normalize(); - - return this.x.fromRed(); -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curve/short.js": -/*!***********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var curve = __webpack_require__(/*! ../curve */ "./node_modules/elliptic/lib/elliptic/curve/index.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -var Base = curve.base; - -var assert = elliptic.utils.assert; - -function ShortCurve(conf) { - Base.call(this, 'short', conf); - - this.a = new BN(conf.a, 16).toRed(this.red); - this.b = new BN(conf.b, 16).toRed(this.red); - this.tinv = this.two.redInvm(); - - this.zeroA = this.a.fromRed().cmpn(0) === 0; - this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; - - // If the curve is endomorphic, precalculate beta and lambda - this.endo = this._getEndomorphism(conf); - this._endoWnafT1 = new Array(4); - this._endoWnafT2 = new Array(4); -} -inherits(ShortCurve, Base); -module.exports = ShortCurve; - -ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { - // No efficient endomorphism - if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) - return; - - // Compute beta and lambda, that lambda * P = (beta * Px; Py) - var beta; - var lambda; - if (conf.beta) { - beta = new BN(conf.beta, 16).toRed(this.red); - } else { - var betas = this._getEndoRoots(this.p); - // Choose the smallest beta - beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; - beta = beta.toRed(this.red); - } - if (conf.lambda) { - lambda = new BN(conf.lambda, 16); - } else { - // Choose the lambda that is matching selected beta - var lambdas = this._getEndoRoots(this.n); - if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { - lambda = lambdas[0]; - } else { - lambda = lambdas[1]; - assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); - } - } - - // Get basis vectors, used for balanced length-two representation - var basis; - if (conf.basis) { - basis = conf.basis.map(function(vec) { - return { - a: new BN(vec.a, 16), - b: new BN(vec.b, 16) - }; - }); - } else { - basis = this._getEndoBasis(lambda); - } - - return { - beta: beta, - lambda: lambda, - basis: basis - }; -}; - -ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { - // Find roots of for x^2 + x + 1 in F - // Root = (-1 +- Sqrt(-3)) / 2 - // - var red = num === this.p ? this.red : BN.mont(num); - var tinv = new BN(2).toRed(red).redInvm(); - var ntinv = tinv.redNeg(); - - var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); - - var l1 = ntinv.redAdd(s).fromRed(); - var l2 = ntinv.redSub(s).fromRed(); - return [ l1, l2 ]; -}; - -ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { - // aprxSqrt >= sqrt(this.n) - var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); - - // 3.74 - // Run EGCD, until r(L + 1) < aprxSqrt - var u = lambda; - var v = this.n.clone(); - var x1 = new BN(1); - var y1 = new BN(0); - var x2 = new BN(0); - var y2 = new BN(1); - - // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) - var a0; - var b0; - // First vector - var a1; - var b1; - // Second vector - var a2; - var b2; - - var prevR; - var i = 0; - var r; - var x; - while (u.cmpn(0) !== 0) { - var q = v.div(u); - r = v.sub(q.mul(u)); - x = x2.sub(q.mul(x1)); - var y = y2.sub(q.mul(y1)); - - if (!a1 && r.cmp(aprxSqrt) < 0) { - a0 = prevR.neg(); - b0 = x1; - a1 = r.neg(); - b1 = x; - } else if (a1 && ++i === 2) { - break; - } - prevR = r; - - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - } - a2 = r.neg(); - b2 = x; - - var len1 = a1.sqr().add(b1.sqr()); - var len2 = a2.sqr().add(b2.sqr()); - if (len2.cmp(len1) >= 0) { - a2 = a0; - b2 = b0; - } - - // Normalize signs - if (a1.negative) { - a1 = a1.neg(); - b1 = b1.neg(); - } - if (a2.negative) { - a2 = a2.neg(); - b2 = b2.neg(); - } - - return [ - { a: a1, b: b1 }, - { a: a2, b: b2 } - ]; -}; - -ShortCurve.prototype._endoSplit = function _endoSplit(k) { - var basis = this.endo.basis; - var v1 = basis[0]; - var v2 = basis[1]; - - var c1 = v2.b.mul(k).divRound(this.n); - var c2 = v1.b.neg().mul(k).divRound(this.n); - - var p1 = c1.mul(v1.a); - var p2 = c2.mul(v2.a); - var q1 = c1.mul(v1.b); - var q2 = c2.mul(v2.b); - - // Calculate answer - var k1 = k.sub(p1).sub(p2); - var k2 = q1.add(q2).neg(); - return { k1: k1, k2: k2 }; -}; - -ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - // XXX Is there any way to tell if the number is odd without converting it - // to non-red form? - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -ShortCurve.prototype.validate = function validate(point) { - if (point.inf) - return true; - - var x = point.x; - var y = point.y; - - var ax = this.a.redMul(x); - var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); - return y.redSqr().redISub(rhs).cmpn(0) === 0; -}; - -ShortCurve.prototype._endoWnafMulAdd = - function _endoWnafMulAdd(points, coeffs, jacobianResult) { - var npoints = this._endoWnafT1; - var ncoeffs = this._endoWnafT2; - for (var i = 0; i < points.length; i++) { - var split = this._endoSplit(coeffs[i]); - var p = points[i]; - var beta = p._getBeta(); - - if (split.k1.negative) { - split.k1.ineg(); - p = p.neg(true); - } - if (split.k2.negative) { - split.k2.ineg(); - beta = beta.neg(true); - } - - npoints[i * 2] = p; - npoints[i * 2 + 1] = beta; - ncoeffs[i * 2] = split.k1; - ncoeffs[i * 2 + 1] = split.k2; - } - var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); - - // Clean-up references to points and coefficients - for (var j = 0; j < i * 2; j++) { - npoints[j] = null; - ncoeffs[j] = null; - } - return res; -}; - -function Point(curve, x, y, isRed) { - Base.BasePoint.call(this, curve, 'affine'); - if (x === null && y === null) { - this.x = null; - this.y = null; - this.inf = true; - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - // Force redgomery representation when loading from JSON - if (isRed) { - this.x.forceRed(this.curve.red); - this.y.forceRed(this.curve.red); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - this.inf = false; - } -} -inherits(Point, Base.BasePoint); - -ShortCurve.prototype.point = function point(x, y, isRed) { - return new Point(this, x, y, isRed); -}; - -ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { - return Point.fromJSON(this, obj, red); -}; - -Point.prototype._getBeta = function _getBeta() { - if (!this.curve.endo) - return; - - var pre = this.precomputed; - if (pre && pre.beta) - return pre.beta; - - var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); - if (pre) { - var curve = this.curve; - var endoMul = function(p) { - return curve.point(p.x.redMul(curve.endo.beta), p.y); - }; - pre.beta = beta; - beta.precomputed = { - beta: null, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(endoMul) - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(endoMul) - } - }; - } - return beta; -}; - -Point.prototype.toJSON = function toJSON() { - if (!this.precomputed) - return [ this.x, this.y ]; - - return [ 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) - } - } ]; -}; - -Point.fromJSON = function fromJSON(curve, obj, red) { - if (typeof obj === 'string') - obj = JSON.parse(obj); - var res = curve.point(obj[0], obj[1], red); - if (!obj[2]) - return res; - - function obj2point(obj) { - return curve.point(obj[0], obj[1], red); - } - - var pre = obj[2]; - res.precomputed = { - beta: null, - doubles: pre.doubles && { - step: pre.doubles.step, - points: [ res ].concat(pre.doubles.points.map(obj2point)) - }, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: [ res ].concat(pre.naf.points.map(obj2point)) - } - }; - return res; -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - return this.inf; -}; - -Point.prototype.add = function add(p) { - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P = 2P - if (this.eq(p)) - return this.dbl(); - - // P + (-P) = O - if (this.neg().eq(p)) - return this.curve.point(null, null); - - // P + Q = O - if (this.x.cmp(p.x) === 0) - return this.curve.point(null, null); - - var c = this.y.redSub(p.y); - if (c.cmpn(0) !== 0) - c = c.redMul(this.x.redSub(p.x).redInvm()); - var nx = c.redSqr().redISub(this.x).redISub(p.x); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point.prototype.dbl = function dbl() { - if (this.inf) - return this; - - // 2P = O - var ys1 = this.y.redAdd(this.y); - if (ys1.cmpn(0) === 0) - return this.curve.point(null, null); - - var a = this.curve.a; - - var x2 = this.x.redSqr(); - var dyinv = ys1.redInvm(); - var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); - - var nx = c.redSqr().redISub(this.x.redAdd(this.x)); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point.prototype.getX = function getX() { - return this.x.fromRed(); -}; - -Point.prototype.getY = function getY() { - return this.y.fromRed(); -}; - -Point.prototype.mul = function mul(k) { - k = new BN(k, 16); - - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else if (this.curve.endo) - return this.curve._endoWnafMulAdd([ this ], [ k ]); - else - return this.curve._wnafMul(this, k); -}; - -Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2); -}; - -Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs, true); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2, true); -}; - -Point.prototype.eq = function eq(p) { - return this === p || - this.inf === p.inf && - (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); -}; - -Point.prototype.neg = function neg(_precompute) { - if (this.inf) - return this; - - var res = this.curve.point(this.x, this.y.redNeg()); - if (_precompute && this.precomputed) { - var pre = this.precomputed; - var negate = function(p) { - return p.neg(); - }; - res.precomputed = { - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(negate) - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(negate) - } - }; - } - return res; -}; - -Point.prototype.toJ = function toJ() { - if (this.inf) - return this.curve.jpoint(null, null, null); - - var res = this.curve.jpoint(this.x, this.y, this.curve.one); - return res; -}; - -function JPoint(curve, x, y, z) { - Base.BasePoint.call(this, curve, 'jacobian'); - if (x === null && y === null && z === null) { - this.x = this.curve.one; - this.y = this.curve.one; - this.z = new BN(0); - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - this.z = new BN(z, 16); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z === this.curve.one; -} -inherits(JPoint, Base.BasePoint); - -ShortCurve.prototype.jpoint = function jpoint(x, y, z) { - return new JPoint(this, x, y, z); -}; - -JPoint.prototype.toP = function toP() { - if (this.isInfinity()) - return this.curve.point(null, null); - - var zinv = this.z.redInvm(); - var zinv2 = zinv.redSqr(); - var ax = this.x.redMul(zinv2); - var ay = this.y.redMul(zinv2).redMul(zinv); - - return this.curve.point(ax, ay); -}; - -JPoint.prototype.neg = function neg() { - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); -}; - -JPoint.prototype.add = function add(p) { - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // 12M + 4S + 7A - var pz2 = p.z.redSqr(); - var z2 = this.z.redSqr(); - var u1 = this.x.redMul(pz2); - var u2 = p.x.redMul(z2); - var s1 = this.y.redMul(pz2.redMul(p.z)); - var s2 = p.y.redMul(z2.redMul(this.z)); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.mixedAdd = function mixedAdd(p) { - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - // 8M + 3S + 7A - var z2 = this.z.redSqr(); - var u1 = this.x; - var u2 = p.x.redMul(z2); - var s1 = this.y; - var s2 = p.y.redMul(z2).redMul(this.z); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.dblp = function dblp(pow) { - if (pow === 0) - return this; - if (this.isInfinity()) - return this; - if (!pow) - return this.dbl(); - - if (this.curve.zeroA || this.curve.threeA) { - var r = this; - for (var i = 0; i < pow; i++) - r = r.dbl(); - return r; - } - - // 1M + 2S + 1A + N * (4S + 5M + 8A) - // N = 1 => 6M + 6S + 9A - var a = this.curve.a; - var tinv = this.curve.tinv; - - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - // Reuse results - var jyd = jy.redAdd(jy); - for (var i = 0; i < pow; i++) { - var jx2 = jx.redSqr(); - var jyd2 = jyd.redSqr(); - var jyd4 = jyd2.redSqr(); - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var t1 = jx.redMul(jyd2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - var dny = c.redMul(t2); - dny = dny.redIAdd(dny).redISub(jyd4); - var nz = jyd.redMul(jz); - if (i + 1 < pow) - jz4 = jz4.redMul(jyd4); - - jx = nx; - jz = nz; - jyd = dny; - } - - return this.curve.jpoint(jx, jyd.redMul(tinv), jz); -}; - -JPoint.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - if (this.curve.zeroA) - return this._zeroDbl(); - else if (this.curve.threeA) - return this._threeDbl(); - else - return this._dbl(); -}; - -JPoint.prototype._zeroDbl = function _zeroDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 14A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // T = M ^ 2 - 2*S - var t = m.redSqr().redISub(s).redISub(s); - - // 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2*Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-dbl-2009-l - // 2M + 5S + 13A - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = B^2 - var c = b.redSqr(); - // D = 2 * ((X1 + B)^2 - A - C) - var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); - d = d.redIAdd(d); - // E = 3 * A - var e = a.redAdd(a).redIAdd(a); - // F = E^2 - var f = e.redSqr(); - - // 8 * C - var c8 = c.redIAdd(c); - c8 = c8.redIAdd(c8); - c8 = c8.redIAdd(c8); - - // X3 = F - 2 * D - nx = f.redISub(d).redISub(d); - // Y3 = E * (D - X3) - 8 * C - ny = e.redMul(d.redISub(nx)).redISub(c8); - // Z3 = 2 * Y1 * Z1 - nz = this.y.redMul(this.z); - nz = nz.redIAdd(nz); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype._threeDbl = function _threeDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 15A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a - var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); - // T = M^2 - 2 * S - var t = m.redSqr().redISub(s).redISub(s); - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2 * Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S - - // delta = Z1^2 - var delta = this.z.redSqr(); - // gamma = Y1^2 - var gamma = this.y.redSqr(); - // beta = X1 * gamma - var beta = this.x.redMul(gamma); - // alpha = 3 * (X1 - delta) * (X1 + delta) - var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); - alpha = alpha.redAdd(alpha).redIAdd(alpha); - // X3 = alpha^2 - 8 * beta - var beta4 = beta.redIAdd(beta); - beta4 = beta4.redIAdd(beta4); - var beta8 = beta4.redAdd(beta4); - nx = alpha.redSqr().redISub(beta8); - // Z3 = (Y1 + Z1)^2 - gamma - delta - nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - var ggamma8 = gamma.redSqr(); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype._dbl = function _dbl() { - var a = this.curve.a; - - // 4M + 6S + 10A - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - var jx2 = jx.redSqr(); - var jy2 = jy.redSqr(); - - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var jxd4 = jx.redAdd(jx); - jxd4 = jxd4.redIAdd(jxd4); - var t1 = jxd4.redMul(jy2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - - var jyd8 = jy2.redSqr(); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - var ny = c.redMul(t2).redISub(jyd8); - var nz = jy.redAdd(jy).redMul(jz); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.trpl = function trpl() { - if (!this.curve.zeroA) - return this.dbl().add(this); - - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl - // 5M + 10S + ... - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // ZZ = Z1^2 - var zz = this.z.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // M = 3 * XX + a * ZZ2; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // MM = M^2 - var mm = m.redSqr(); - // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM - var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - e = e.redIAdd(e); - e = e.redAdd(e).redIAdd(e); - e = e.redISub(mm); - // EE = E^2 - var ee = e.redSqr(); - // T = 16*YYYY - var t = yyyy.redIAdd(yyyy); - t = t.redIAdd(t); - t = t.redIAdd(t); - t = t.redIAdd(t); - // U = (M + E)^2 - MM - EE - T - var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); - // X3 = 4 * (X1 * EE - 4 * YY * U) - var yyu4 = yy.redMul(u); - yyu4 = yyu4.redIAdd(yyu4); - yyu4 = yyu4.redIAdd(yyu4); - var nx = this.x.redMul(ee).redISub(yyu4); - nx = nx.redIAdd(nx); - nx = nx.redIAdd(nx); - // Y3 = 8 * Y1 * (U * (T - U) - E * EE) - var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - // Z3 = (Z1 + E)^2 - ZZ - EE - var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.mul = function mul(k, kbase) { - k = new BN(k, kbase); - - return this.curve._wnafMul(this, k); -}; - -JPoint.prototype.eq = function eq(p) { - if (p.type === 'affine') - return this.eq(p.toJ()); - - if (this === p) - return true; - - // x1 * z2^2 == x2 * z1^2 - var z2 = this.z.redSqr(); - var pz2 = p.z.redSqr(); - if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) - return false; - - // y1 * z2^3 == y2 * z1^3 - var z3 = z2.redMul(this.z); - var pz3 = pz2.redMul(p.z); - return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; -}; - -JPoint.prototype.eqXToP = function eqXToP(x) { - var zs = this.z.redSqr(); - var rx = x.toRed(this.curve.red).redMul(zs); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(zs); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } - return false; -}; - -JPoint.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -JPoint.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/curves.js": -/*!******************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/curves.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var curves = exports; - -var hash = __webpack_require__(/*! hash.js */ "./node_modules/hash.js/lib/hash.js"); -var elliptic = __webpack_require__(/*! ../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); - -var assert = elliptic.utils.assert; - -function PresetCurve(options) { - if (options.type === 'short') - this.curve = new elliptic.curve.short(options); - else if (options.type === 'edwards') - this.curve = new elliptic.curve.edwards(options); - else - this.curve = new elliptic.curve.mont(options); - this.g = this.curve.g; - this.n = this.curve.n; - this.hash = options.hash; - - assert(this.g.validate(), 'Invalid curve'); - assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); -} -curves.PresetCurve = PresetCurve; - -function defineCurve(name, options) { - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - get: function() { - var curve = new PresetCurve(options); - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - value: curve - }); - return curve; - } - }); -} - -defineCurve('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: hash.sha256, - gRed: false, - g: [ - '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', - '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' - ] -}); - -defineCurve('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: hash.sha256, - gRed: false, - g: [ - 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', - 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' - ] -}); - -defineCurve('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: hash.sha256, - gRed: false, - g: [ - '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' - ] -}); - -defineCurve('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: hash.sha384, - gRed: false, - 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' - ] -}); - -defineCurve('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: hash.sha512, - gRed: false, - 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' - ] -}); - -defineCurve('curve25519', { - type: 'mont', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '76d06', - b: '1', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '9' - ] -}); - -defineCurve('ed25519', { - type: 'edwards', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '-1', - c: '1', - // -121665 * (121666^(-1)) (mod P) - d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', - - // 4/5 - '6666666666666666666666666666666666666666666666666666666666666658' - ] -}); - -var pre; -try { - pre = __webpack_require__(/*! ./precomputed/secp256k1 */ "./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js"); -} catch (e) { - pre = undefined; -} - -defineCurve('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: hash.sha256, - - // Precomputed endomorphism - beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', - lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3' - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15' - } - ], - - gRed: false, - g: [ - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', - pre - ] -}); - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/ec/index.js": -/*!********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var HmacDRBG = __webpack_require__(/*! hmac-drbg */ "./node_modules/hmac-drbg/lib/hmac-drbg.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; - -var KeyPair = __webpack_require__(/*! ./key */ "./node_modules/elliptic/lib/elliptic/ec/key.js"); -var Signature = __webpack_require__(/*! ./signature */ "./node_modules/elliptic/lib/elliptic/ec/signature.js"); - -function EC(options) { - if (!(this instanceof EC)) - return new EC(options); - - // Shortcut `elliptic.ec(curve-name)` - if (typeof options === 'string') { - assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); - - options = elliptic.curves[options]; - } - - // Shortcut for `elliptic.ec(elliptic.curves.curveName)` - if (options instanceof elliptic.curves.PresetCurve) - options = { curve: options }; - - this.curve = options.curve.curve; - this.n = this.curve.n; - this.nh = this.n.ushrn(1); - this.g = this.curve.g; - - // Point on curve - this.g = options.curve.g; - this.g.precompute(options.curve.n.bitLength() + 1); - - // Hash for function for DRBG - this.hash = options.hash || options.curve.hash; -} -module.exports = EC; - -EC.prototype.keyPair = function keyPair(options) { - return new KeyPair(this, options); -}; - -EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { - return KeyPair.fromPrivate(this, priv, enc); -}; - -EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { - return KeyPair.fromPublic(this, pub, enc); -}; - -EC.prototype.genKeyPair = function genKeyPair(options) { - if (!options) - options = {}; - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG({ - hash: this.hash, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), - entropyEnc: options.entropy && options.entropyEnc || 'utf8', - nonce: this.n.toArray() - }); - - var bytes = this.n.byteLength(); - var ns2 = this.n.sub(new BN(2)); - do { - var priv = new BN(drbg.generate(bytes)); - if (priv.cmp(ns2) > 0) - continue; - - priv.iaddn(1); - return this.keyFromPrivate(priv); - } while (true); -}; - -EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { - var delta = msg.byteLength() * 8 - this.n.bitLength(); - if (delta > 0) - msg = msg.ushrn(delta); - if (!truncOnly && msg.cmp(this.n) >= 0) - return msg.sub(this.n); - else - return msg; -}; - -EC.prototype.sign = function sign(msg, key, enc, options) { - if (typeof enc === 'object') { - options = enc; - enc = null; - } - if (!options) - options = {}; - - key = this.keyFromPrivate(key, enc); - msg = this._truncateToN(new BN(msg, 16)); - - // Zero-extend key to provide enough entropy - var bytes = this.n.byteLength(); - var bkey = key.getPrivate().toArray('be', bytes); - - // Zero-extend nonce to have the same byte size as N - var nonce = msg.toArray('be', bytes); - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG({ - hash: this.hash, - entropy: bkey, - nonce: nonce, - pers: options.pers, - persEnc: options.persEnc || 'utf8' - }); - - // Number of bytes to generate - var ns1 = this.n.sub(new BN(1)); - - for (var iter = 0; true; iter++) { - var k = options.k ? - options.k(iter) : - new BN(drbg.generate(this.n.byteLength())); - k = this._truncateToN(k, true); - if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) - continue; - - var kp = this.g.mul(k); - if (kp.isInfinity()) - continue; - - var kpX = kp.getX(); - var r = kpX.umod(this.n); - if (r.cmpn(0) === 0) - continue; - - var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); - s = s.umod(this.n); - if (s.cmpn(0) === 0) - continue; - - var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | - (kpX.cmp(r) !== 0 ? 2 : 0); - - // Use complement of `s`, if it is > `n / 2` - if (options.canonical && s.cmp(this.nh) > 0) { - s = this.n.sub(s); - recoveryParam ^= 1; - } - - return new Signature({ r: r, s: s, recoveryParam: recoveryParam }); - } -}; - -EC.prototype.verify = function verify(msg, signature, key, enc) { - msg = this._truncateToN(new BN(msg, 16)); - key = this.keyFromPublic(key, enc); - signature = new Signature(signature, 'hex'); - - // Perform primitive values validation - var r = signature.r; - var s = signature.s; - if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) - return false; - if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) - return false; - - // Validate signature - var sinv = s.invm(this.n); - var u1 = sinv.mul(msg).umod(this.n); - var u2 = sinv.mul(r).umod(this.n); - - if (!this.curve._maxwellTrick) { - var p = this.g.mulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - return p.getX().umod(this.n).cmp(r) === 0; - } - - // NOTE: Greg Maxwell's trick, inspired by: - // https://git.io/vad3K - - var p = this.g.jmulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - // Compare `p.x` of Jacobian point with `r`, - // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the - // inverse of `p.z^2` - return p.eqXToP(r); -}; - -EC.prototype.recoverPubKey = function(msg, signature, j, enc) { - assert((3 & j) === j, 'The recovery param is more than two bits'); - signature = new Signature(signature, enc); - - var n = this.n; - var e = new BN(msg); - var r = signature.r; - var s = signature.s; - - // A set LSB signifies that the y-coordinate is odd - var isYOdd = j & 1; - var isSecondKey = j >> 1; - if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) - throw new Error('Unable to find sencond key candinate'); - - // 1.1. Let x = r + jn. - if (isSecondKey) - r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); - else - r = this.curve.pointFromX(r, isYOdd); - - var rInv = signature.r.invm(n); - var s1 = n.sub(e).mul(rInv).umod(n); - var s2 = s.mul(rInv).umod(n); - - // 1.6.1 Compute Q = r^-1 (sR - eG) - // Q = r^-1 (sR + -eG) - return this.g.mulAdd(s1, r, s2); -}; - -EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { - signature = new Signature(signature, enc); - if (signature.recoveryParam !== null) - return signature.recoveryParam; - - for (var i = 0; i < 4; i++) { - var Qprime; - try { - Qprime = this.recoverPubKey(e, signature, i); - } catch (e) { - continue; - } - - if (Qprime.eq(Q)) - return i; - } - throw new Error('Unable to find valid recovery factor'); -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/ec/key.js": -/*!******************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; - -function KeyPair(ec, options) { - this.ec = ec; - this.priv = null; - this.pub = null; - - // KeyPair(ec, { priv: ..., pub: ... }) - if (options.priv) - this._importPrivate(options.priv, options.privEnc); - if (options.pub) - this._importPublic(options.pub, options.pubEnc); -} -module.exports = KeyPair; - -KeyPair.fromPublic = function fromPublic(ec, pub, enc) { - if (pub instanceof KeyPair) - return pub; - - return new KeyPair(ec, { - pub: pub, - pubEnc: enc - }); -}; - -KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { - if (priv instanceof KeyPair) - return priv; - - return new KeyPair(ec, { - priv: priv, - privEnc: enc - }); -}; - -KeyPair.prototype.validate = function validate() { - var pub = this.getPublic(); - - if (pub.isInfinity()) - return { result: false, reason: 'Invalid public key' }; - if (!pub.validate()) - return { result: false, reason: 'Public key is not a point' }; - if (!pub.mul(this.ec.curve.n).isInfinity()) - return { result: false, reason: 'Public key * N != O' }; - - return { result: true, reason: null }; -}; - -KeyPair.prototype.getPublic = function getPublic(compact, enc) { - // compact is optional argument - if (typeof compact === 'string') { - enc = compact; - compact = null; - } - - if (!this.pub) - this.pub = this.ec.g.mul(this.priv); - - if (!enc) - return this.pub; - - return this.pub.encode(enc, compact); -}; - -KeyPair.prototype.getPrivate = function getPrivate(enc) { - if (enc === 'hex') - return this.priv.toString(16, 2); - else - return this.priv; -}; - -KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { - this.priv = new BN(key, enc || 16); - - // Ensure that the priv won't be bigger than n, otherwise we may fail - // in fixed multiplication method - this.priv = this.priv.umod(this.ec.curve.n); -}; - -KeyPair.prototype._importPublic = function _importPublic(key, enc) { - if (key.x || key.y) { - // Montgomery points only have an `x` coordinate. - // Weierstrass/Edwards points on the other hand have both `x` and - // `y` coordinates. - if (this.ec.curve.type === 'mont') { - assert(key.x, 'Need x coordinate'); - } else if (this.ec.curve.type === 'short' || - this.ec.curve.type === 'edwards') { - assert(key.x && key.y, 'Need both x and y coordinate'); - } - this.pub = this.ec.curve.point(key.x, key.y); - return; - } - this.pub = this.ec.curve.decodePoint(key, enc); -}; - -// ECDH -KeyPair.prototype.derive = function derive(pub) { - return pub.mul(this.priv).getX(); -}; - -// ECDSA -KeyPair.prototype.sign = function sign(msg, enc, options) { - return this.ec.sign(msg, this, enc, options); -}; - -KeyPair.prototype.verify = function verify(msg, signature) { - return this.ec.verify(msg, signature, this); -}; - -KeyPair.prototype.inspect = function inspect() { - return ''; -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/ec/signature.js": -/*!************************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); - -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; - -function Signature(options, enc) { - if (options instanceof Signature) - return options; - - if (this._importDER(options, enc)) - return; - - assert(options.r && options.s, 'Signature without r or s'); - this.r = new BN(options.r, 16); - this.s = new BN(options.s, 16); - if (options.recoveryParam === undefined) - this.recoveryParam = null; - else - this.recoveryParam = options.recoveryParam; -} -module.exports = Signature; - -function Position() { - this.place = 0; -} - -function getLength(buf, p) { - var initial = buf[p.place++]; - if (!(initial & 0x80)) { - return initial; - } - var octetLen = initial & 0xf; - var val = 0; - for (var i = 0, off = p.place; i < octetLen; i++, off++) { - val <<= 8; - val |= buf[off]; - } - p.place = off; - return val; -} - -function rmPadding(buf) { - var i = 0; - var len = buf.length - 1; - while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { - i++; - } - if (i === 0) { - return buf; - } - return buf.slice(i); -} - -Signature.prototype._importDER = function _importDER(data, enc) { - data = utils.toArray(data, enc); - var p = new Position(); - if (data[p.place++] !== 0x30) { - return false; - } - var len = getLength(data, p); - if ((len + p.place) !== data.length) { - return false; - } - if (data[p.place++] !== 0x02) { - return false; - } - var rlen = getLength(data, p); - var r = data.slice(p.place, rlen + p.place); - p.place += rlen; - if (data[p.place++] !== 0x02) { - return false; - } - var slen = getLength(data, p); - if (data.length !== slen + p.place) { - return false; - } - var s = data.slice(p.place, slen + p.place); - if (r[0] === 0 && (r[1] & 0x80)) { - r = r.slice(1); - } - if (s[0] === 0 && (s[1] & 0x80)) { - s = s.slice(1); - } - - this.r = new BN(r); - this.s = new BN(s); - this.recoveryParam = null; - - return true; -}; - -function constructLength(arr, len) { - if (len < 0x80) { - arr.push(len); - return; - } - var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); - arr.push(octets | 0x80); - while (--octets) { - arr.push((len >>> (octets << 3)) & 0xff); - } - arr.push(len); -} - -Signature.prototype.toDER = function toDER(enc) { - var r = this.r.toArray(); - var s = this.s.toArray(); - - // Pad values - if (r[0] & 0x80) - r = [ 0 ].concat(r); - // Pad values - if (s[0] & 0x80) - s = [ 0 ].concat(s); - - r = rmPadding(r); - s = rmPadding(s); - - while (!s[0] && !(s[1] & 0x80)) { - s = s.slice(1); - } - var arr = [ 0x02 ]; - constructLength(arr, r.length); - arr = arr.concat(r); - arr.push(0x02); - constructLength(arr, s.length); - var backHalf = arr.concat(s); - var res = [ 0x30 ]; - constructLength(res, backHalf.length); - res = res.concat(backHalf); - return utils.encode(res, enc); -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/eddsa/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var hash = __webpack_require__(/*! hash.js */ "./node_modules/hash.js/lib/hash.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; -var parseBytes = utils.parseBytes; -var KeyPair = __webpack_require__(/*! ./key */ "./node_modules/elliptic/lib/elliptic/eddsa/key.js"); -var Signature = __webpack_require__(/*! ./signature */ "./node_modules/elliptic/lib/elliptic/eddsa/signature.js"); - -function EDDSA(curve) { - assert(curve === 'ed25519', 'only tested with ed25519 so far'); - - if (!(this instanceof EDDSA)) - return new EDDSA(curve); - - var curve = elliptic.curves[curve].curve; - this.curve = curve; - this.g = curve.g; - this.g.precompute(curve.n.bitLength() + 1); - - this.pointClass = curve.point().constructor; - this.encodingLength = Math.ceil(curve.n.bitLength() / 8); - this.hash = hash.sha512; -} - -module.exports = EDDSA; - -/** -* @param {Array|String} message - message bytes -* @param {Array|String|KeyPair} secret - secret bytes or a keypair -* @returns {Signature} - signature -*/ -EDDSA.prototype.sign = function sign(message, secret) { - message = parseBytes(message); - var key = this.keyFromSecret(secret); - var r = this.hashInt(key.messagePrefix(), message); - var R = this.g.mul(r); - var Rencoded = this.encodePoint(R); - var s_ = this.hashInt(Rencoded, key.pubBytes(), message) - .mul(key.priv()); - var S = r.add(s_).umod(this.curve.n); - return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); -}; - -/** -* @param {Array} message - message bytes -* @param {Array|String|Signature} sig - sig bytes -* @param {Array|String|Point|KeyPair} pub - public key -* @returns {Boolean} - true if public key matches sig of message -*/ -EDDSA.prototype.verify = function verify(message, sig, pub) { - message = parseBytes(message); - sig = this.makeSignature(sig); - var key = this.keyFromPublic(pub); - var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); - var SG = this.g.mul(sig.S()); - var RplusAh = sig.R().add(key.pub().mul(h)); - return RplusAh.eq(SG); -}; - -EDDSA.prototype.hashInt = function hashInt() { - var hash = this.hash(); - for (var i = 0; i < arguments.length; i++) - hash.update(arguments[i]); - return utils.intFromLE(hash.digest()).umod(this.curve.n); -}; - -EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { - return KeyPair.fromPublic(this, pub); -}; - -EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { - return KeyPair.fromSecret(this, secret); -}; - -EDDSA.prototype.makeSignature = function makeSignature(sig) { - if (sig instanceof Signature) - return sig; - return new Signature(this, sig); -}; - -/** -* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 -* -* EDDSA defines methods for encoding and decoding points and integers. These are -* helper convenience methods, that pass along to utility functions implied -* parameters. -* -*/ -EDDSA.prototype.encodePoint = function encodePoint(point) { - var enc = point.getY().toArray('le', this.encodingLength); - enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; - return enc; -}; - -EDDSA.prototype.decodePoint = function decodePoint(bytes) { - bytes = utils.parseBytes(bytes); - - var lastIx = bytes.length - 1; - var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); - var xIsOdd = (bytes[lastIx] & 0x80) !== 0; - - var y = utils.intFromLE(normed); - return this.curve.pointFromY(y, xIsOdd); -}; - -EDDSA.prototype.encodeInt = function encodeInt(num) { - return num.toArray('le', this.encodingLength); -}; - -EDDSA.prototype.decodeInt = function decodeInt(bytes) { - return utils.intFromLE(bytes); -}; - -EDDSA.prototype.isPoint = function isPoint(val) { - return val instanceof this.pointClass; -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/eddsa/key.js": -/*!*********************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; -var parseBytes = utils.parseBytes; -var cachedProperty = utils.cachedProperty; - -/** -* @param {EDDSA} eddsa - instance -* @param {Object} params - public/private key parameters -* -* @param {Array} [params.secret] - secret seed bytes -* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) -* @param {Array} [params.pub] - public key point encoded as bytes -* -*/ -function KeyPair(eddsa, params) { - this.eddsa = eddsa; - this._secret = parseBytes(params.secret); - if (eddsa.isPoint(params.pub)) - this._pub = params.pub; - else - this._pubBytes = parseBytes(params.pub); -} - -KeyPair.fromPublic = function fromPublic(eddsa, pub) { - if (pub instanceof KeyPair) - return pub; - return new KeyPair(eddsa, { pub: pub }); -}; - -KeyPair.fromSecret = function fromSecret(eddsa, secret) { - if (secret instanceof KeyPair) - return secret; - return new KeyPair(eddsa, { secret: secret }); -}; - -KeyPair.prototype.secret = function secret() { - return this._secret; -}; - -cachedProperty(KeyPair, 'pubBytes', function pubBytes() { - return this.eddsa.encodePoint(this.pub()); -}); - -cachedProperty(KeyPair, 'pub', function pub() { - if (this._pubBytes) - return this.eddsa.decodePoint(this._pubBytes); - return this.eddsa.g.mul(this.priv()); -}); - -cachedProperty(KeyPair, 'privBytes', function privBytes() { - var eddsa = this.eddsa; - var hash = this.hash(); - var lastIx = eddsa.encodingLength - 1; - - var a = hash.slice(0, eddsa.encodingLength); - a[0] &= 248; - a[lastIx] &= 127; - a[lastIx] |= 64; - - return a; -}); - -cachedProperty(KeyPair, 'priv', function priv() { - return this.eddsa.decodeInt(this.privBytes()); -}); - -cachedProperty(KeyPair, 'hash', function hash() { - return this.eddsa.hash().update(this.secret()).digest(); -}); - -cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { - return this.hash().slice(this.eddsa.encodingLength); -}); - -KeyPair.prototype.sign = function sign(message) { - assert(this._secret, 'KeyPair can only verify'); - return this.eddsa.sign(message, this); -}; - -KeyPair.prototype.verify = function verify(message, sig) { - return this.eddsa.verify(message, sig, this); -}; - -KeyPair.prototype.getSecret = function getSecret(enc) { - assert(this._secret, 'KeyPair is public only'); - return utils.encode(this.secret(), enc); -}; - -KeyPair.prototype.getPublic = function getPublic(enc) { - return utils.encode(this.pubBytes(), enc); -}; - -module.exports = KeyPair; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/eddsa/signature.js": -/*!***************************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var elliptic = __webpack_require__(/*! ../../elliptic */ "./node_modules/elliptic/lib/elliptic.js"); -var utils = elliptic.utils; -var assert = utils.assert; -var cachedProperty = utils.cachedProperty; -var parseBytes = utils.parseBytes; - -/** -* @param {EDDSA} eddsa - eddsa instance -* @param {Array|Object} sig - -* @param {Array|Point} [sig.R] - R point as Point or bytes -* @param {Array|bn} [sig.S] - S scalar as bn or bytes -* @param {Array} [sig.Rencoded] - R point encoded -* @param {Array} [sig.Sencoded] - S scalar encoded -*/ -function Signature(eddsa, sig) { - this.eddsa = eddsa; - - if (typeof sig !== 'object') - sig = parseBytes(sig); - - if (Array.isArray(sig)) { - sig = { - R: sig.slice(0, eddsa.encodingLength), - S: sig.slice(eddsa.encodingLength) - }; - } - - assert(sig.R && sig.S, 'Signature without R or S'); - - if (eddsa.isPoint(sig.R)) - this._R = sig.R; - if (sig.S instanceof BN) - this._S = sig.S; - - this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; - this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; -} - -cachedProperty(Signature, 'S', function S() { - return this.eddsa.decodeInt(this.Sencoded()); -}); - -cachedProperty(Signature, 'R', function R() { - return this.eddsa.decodePoint(this.Rencoded()); -}); - -cachedProperty(Signature, 'Rencoded', function Rencoded() { - return this.eddsa.encodePoint(this.R()); -}); - -cachedProperty(Signature, 'Sencoded', function Sencoded() { - return this.eddsa.encodeInt(this.S()); -}); - -Signature.prototype.toBytes = function toBytes() { - return this.Rencoded().concat(this.Sencoded()); -}; - -Signature.prototype.toHex = function toHex() { - return utils.encode(this.toBytes(), 'hex').toUpperCase(); -}; - -module.exports = Signature; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js": -/*!*********************************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.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' - ] - ] - } -}; - - -/***/ }), - -/***/ "./node_modules/elliptic/lib/elliptic/utils.js": -/*!*****************************************************!*\ - !*** ./node_modules/elliptic/lib/elliptic/utils.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = exports; -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var minAssert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); -var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ "./node_modules/minimalistic-crypto-utils/lib/utils.js"); - -utils.assert = minAssert; -utils.toArray = minUtils.toArray; -utils.zero2 = minUtils.zero2; -utils.toHex = minUtils.toHex; -utils.encode = minUtils.encode; - -// Represent num in a w-NAF form -function getNAF(num, w) { - var naf = []; - var ws = 1 << (w + 1); - var k = num.clone(); - while (k.cmpn(1) >= 0) { - var z; - if (k.isOdd()) { - var mod = k.andln(ws - 1); - if (mod > (ws >> 1) - 1) - z = (ws >> 1) - mod; - else - z = mod; - k.isubn(z); - } else { - z = 0; - } - naf.push(z); - - // Optimization, shift by word if possible - var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; - for (var i = 1; i < shift; i++) - naf.push(0); - k.iushrn(shift); - } - - return naf; -} -utils.getNAF = getNAF; - -// Represent k1, k2 in a Joint Sparse Form -function getJSF(k1, k2) { - var jsf = [ - [], - [] - ]; - - k1 = k1.clone(); - k2 = k2.clone(); - var d1 = 0; - var d2 = 0; - while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { - - // First phase - var m14 = (k1.andln(3) + d1) & 3; - var m24 = (k2.andln(3) + d2) & 3; - if (m14 === 3) - m14 = -1; - if (m24 === 3) - m24 = -1; - var u1; - if ((m14 & 1) === 0) { - u1 = 0; - } else { - var m8 = (k1.andln(7) + d1) & 7; - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - jsf[0].push(u1); - - var u2; - if ((m24 & 1) === 0) { - u2 = 0; - } else { - var m8 = (k2.andln(7) + d2) & 7; - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - jsf[1].push(u2); - - // Second phase - if (2 * d1 === u1 + 1) - d1 = 1 - d1; - if (2 * d2 === u2 + 1) - d2 = 1 - d2; - k1.iushrn(1); - k2.iushrn(1); - } - - return jsf; -} -utils.getJSF = getJSF; - -function cachedProperty(obj, name, computer) { - var key = '_' + name; - obj.prototype[name] = function cachedProperty() { - return this[key] !== undefined ? this[key] : - this[key] = computer.call(this); - }; -} -utils.cachedProperty = cachedProperty; - -function parseBytes(bytes) { - return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : - bytes; -} -utils.parseBytes = parseBytes; - -function intFromLE(bytes) { - return new BN(bytes, 'hex', 'le'); -} -utils.intFromLE = intFromLE; - - - -/***/ }), - -/***/ "./node_modules/elliptic/package.json": -/*!********************************************!*\ - !*** ./node_modules/elliptic/package.json ***! - \********************************************/ -/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, dependencies, deprecated, description, devDependencies, files, homepage, keywords, license, main, name, repository, scripts, version, default */ -/***/ (function(module) { - -module.exports = {"_from":"elliptic@^6.0.0","_id":"elliptic@6.4.0","_inBundle":false,"_integrity":"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"elliptic@^6.0.0","name":"elliptic","escapedName":"elliptic","rawSpec":"^6.0.0","saveSpec":null,"fetchSpec":"^6.0.0"},"_requiredBy":["/browserify-sign","/create-ecdh"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz","_shasum":"cac9af8762c85836187003c8dfe193e5e2eae5df","_spec":"elliptic@^6.0.0","_where":"/Users/apanizo/git/gnosis/gnosis-team-safe/node_modules/browserify-sign","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},"deprecated":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^2.11.3","grunt":"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.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"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","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.4.0"}; - -/***/ }), - -/***/ "./node_modules/eth-lib/lib/array.js": -/*!*******************************************!*\ - !*** ./node_modules/eth-lib/lib/array.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var generate = function generate(num, fn) { - var a = []; - for (var i = 0; i < num; ++i) { - a.push(fn(i)); - }return a; -}; - -var replicate = function replicate(num, val) { - return generate(num, function () { - return val; - }); -}; - -var concat = function concat(a, b) { - return a.concat(b); -}; - -var flatten = function flatten(a) { - var r = []; - for (var j = 0, J = a.length; j < J; ++j) { - for (var i = 0, I = a[j].length; i < I; ++i) { - r.push(a[j][i]); - } - }return r; -}; - -var chunksOf = function chunksOf(n, a) { - var b = []; - for (var i = 0, l = a.length; i < l; i += n) { - b.push(a.slice(i, i + n)); - }return b; -}; - -module.exports = { - generate: generate, - replicate: replicate, - concat: concat, - flatten: flatten, - chunksOf: chunksOf -}; - -/***/ }), - -/***/ "./node_modules/eth-lib/lib/bytes.js": -/*!*******************************************!*\ - !*** ./node_modules/eth-lib/lib/bytes.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var A = __webpack_require__(/*! ./array.js */ "./node_modules/eth-lib/lib/array.js"); - -var at = function at(bytes, index) { - return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16); -}; - -var random = function random(bytes) { - var rnd = void 0; - if (typeof window !== "undefined" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(/*! crypto */ "./node_modules/crypto-browserify/index.js").randomBytes(bytes);else {} - var hex = "0x"; - for (var i = 0; i < bytes; ++i) { - hex += ("00" + rnd[i].toString(16)).slice(-2); - }return hex; -}; - -var length = function length(a) { - return (a.length - 2) / 2; -}; - -var flatten = function flatten(a) { - return "0x" + a.reduce(function (r, s) { - return r + s.slice(2); - }, ""); -}; - -var slice = function slice(i, j, bs) { - return "0x" + bs.slice(i * 2 + 2, j * 2 + 2); -}; - -var reverse = function reverse(hex) { - var rev = "0x"; - for (var i = 0, l = length(hex); i < l; ++i) { - rev += hex.slice((l - i) * 2, (l - i + 1) * 2); - } - return rev; -}; - -var pad = function pad(l, hex) { - return hex.length === l * 2 + 2 ? hex : pad(l, "0x" + "0" + hex.slice(2)); -}; - -var padRight = function padRight(l, hex) { - return hex.length === l * 2 + 2 ? hex : padRight(l, hex + "0"); -}; - -var toArray = function toArray(hex) { - var arr = []; - for (var i = 2, l = hex.length; i < l; i += 2) { - arr.push(parseInt(hex.slice(i, i + 2), 16)); - }return arr; -}; - -var fromArray = function fromArray(arr) { - var hex = "0x"; - for (var i = 0, l = arr.length; i < l; ++i) { - var b = arr[i]; - hex += (b < 16 ? "0" : "") + b.toString(16); - } - return hex; -}; - -var toUint8Array = function toUint8Array(hex) { - return new Uint8Array(toArray(hex)); -}; - -var fromUint8Array = function fromUint8Array(arr) { - return fromArray([].slice.call(arr, 0)); -}; - -var fromNumber = function fromNumber(num) { - var hex = num.toString(16); - return hex.length % 2 === 0 ? "0x" + hex : "0x0" + hex; -}; - -var toNumber = function toNumber(hex) { - return parseInt(hex.slice(2), 16); -}; - -var concat = function concat(a, b) { - return a.concat(b.slice(2)); -}; - -var fromNat = function fromNat(bn) { - return bn === "0x0" ? "0x" : bn.length % 2 === 0 ? bn : "0x0" + bn.slice(2); -}; - -var toNat = function toNat(bn) { - return bn[2] === "0" ? "0x" + bn.slice(3) : bn; -}; - -var fromAscii = function fromAscii(ascii) { - var hex = "0x"; - for (var i = 0; i < ascii.length; ++i) { - hex += ("00" + ascii.charCodeAt(i).toString(16)).slice(-2); - }return hex; -}; - -var toAscii = function toAscii(hex) { - var ascii = ""; - for (var i = 2; i < hex.length; i += 2) { - ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16)); - }return ascii; -}; - -// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330 -var fromString = function fromString(s) { - var makeByte = function makeByte(uint8) { - var b = uint8.toString(16); - return b.length < 2 ? "0" + b : b; - }; - var bytes = "0x"; - for (var ci = 0; ci != s.length; ci++) { - var c = s.charCodeAt(ci); - if (c < 128) { - bytes += makeByte(c); - continue; - } - if (c < 2048) { - bytes += makeByte(c >> 6 | 192); - } else { - if (c > 0xd7ff && c < 0xdc00) { - if (++ci == s.length) return null; - var c2 = s.charCodeAt(ci); - if (c2 < 0xdc00 || c2 > 0xdfff) return null; - c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - bytes += makeByte(c >> 18 | 240); - bytes += makeByte(c >> 12 & 63 | 128); - } else { - // c <= 0xffff - bytes += makeByte(c >> 12 | 224); - } - bytes += makeByte(c >> 6 & 63 | 128); - } - bytes += makeByte(c & 63 | 128); - } - return bytes; -}; - -var toString = function toString(bytes) { - var s = ''; - var i = 0; - var l = length(bytes); - while (i < l) { - var c = at(bytes, i++); - if (c > 127) { - if (c > 191 && c < 224) { - if (i >= l) return null; - c = (c & 31) << 6 | at(bytes, i) & 63; - } else if (c > 223 && c < 240) { - if (i + 1 >= l) return null; - c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63; - } else if (c > 239 && c < 248) { - if (i + 2 >= l) return null; - c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63; - } else return null; - ++i; - } - if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) { - c -= 0x10000; - s += String.fromCharCode(c >> 10 | 0xd800); - s += String.fromCharCode(c & 0x3FF | 0xdc00); - } else return null; - } - return s; -}; - -module.exports = { - random: random, - length: length, - concat: concat, - flatten: flatten, - slice: slice, - reverse: reverse, - pad: pad, - padRight: padRight, - fromAscii: fromAscii, - toAscii: toAscii, - fromString: fromString, - toString: toString, - fromNumber: fromNumber, - toNumber: toNumber, - fromNat: fromNat, - toNat: toNat, - fromArray: fromArray, - toArray: toArray, - fromUint8Array: fromUint8Array, - toUint8Array: toUint8Array -}; - -/***/ }), - -/***/ "./node_modules/eth-lib/lib/hash.js": -/*!******************************************!*\ - !*** ./node_modules/eth-lib/lib/hash.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// This was ported from https://github.com/emn178/js-sha3, with some minor -// modifications and pruning. It is licensed under MIT: -// -// Copyright 2015-2016 Chen, Yi-Cyuan -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -var HEX_CHARS = '0123456789abcdef'.split(''); -var KECCAK_PADDING = [1, 256, 65536, 16777216]; -var SHIFT = [0, 8, 16, 24]; -var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648]; - -var Keccak = function Keccak(bits) { - return { - blocks: [], - reset: true, - block: 0, - start: 0, - blockCount: 1600 - (bits << 1) >> 5, - outputBlocks: bits >> 5, - s: function (s) { - return [].concat(s, s, s, s, s); - }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) - }; -}; - -var update = function update(state, message) { - var length = message.length, - blocks = state.blocks, - byteCount = state.blockCount << 2, - blockCount = state.blockCount, - outputBlocks = state.outputBlocks, - s = state.s, - index = 0, - i, - code; - - // update - while (index < length) { - if (state.reset) { - state.reset = false; - blocks[0] = state.block; - for (i = 1; i < blockCount + 1; ++i) { - blocks[i] = 0; - } - } - if (typeof message !== "string") { - for (i = state.start; index < length && i < byteCount; ++index) { - blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; - } - } else { - for (i = state.start; index < length && i < byteCount; ++index) { - code = message.charCodeAt(index); - if (code < 0x80) { - blocks[i >> 2] |= code << SHIFT[i++ & 3]; - } else if (code < 0x800) { - blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; - } else if (code < 0xd800 || code >= 0xe000) { - blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; - } else { - code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff); - blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; - } - } - } - state.lastByteIndex = i; - if (i >= byteCount) { - state.start = i - byteCount; - state.block = blocks[blockCount]; - for (i = 0; i < blockCount; ++i) { - s[i] ^= blocks[i]; - } - f(s); - state.reset = true; - } else { - state.start = i; - } - } - - // finalize - i = state.lastByteIndex; - blocks[i >> 2] |= KECCAK_PADDING[i & 3]; - if (state.lastByteIndex === byteCount) { - blocks[0] = blocks[blockCount]; - for (i = 1; i < blockCount + 1; ++i) { - blocks[i] = 0; - } - } - blocks[blockCount - 1] |= 0x80000000; - for (i = 0; i < blockCount; ++i) { - s[i] ^= blocks[i]; - } - f(s); - - // toString - var hex = '', - i = 0, - j = 0, - block; - while (j < outputBlocks) { - for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { - block = s[i]; - hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F]; - } - if (j % blockCount === 0) { - f(s); - i = 0; - } - } - return "0x" + hex; -}; - -var f = function f(s) { - var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49; - - for (n = 0; n < 48; n += 2) { - c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; - c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; - c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; - c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; - c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; - c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; - c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; - c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; - c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; - c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; - - h = c8 ^ (c2 << 1 | c3 >>> 31); - l = c9 ^ (c3 << 1 | c2 >>> 31); - s[0] ^= h; - s[1] ^= l; - s[10] ^= h; - s[11] ^= l; - s[20] ^= h; - s[21] ^= l; - s[30] ^= h; - s[31] ^= l; - s[40] ^= h; - s[41] ^= l; - h = c0 ^ (c4 << 1 | c5 >>> 31); - l = c1 ^ (c5 << 1 | c4 >>> 31); - s[2] ^= h; - s[3] ^= l; - s[12] ^= h; - s[13] ^= l; - s[22] ^= h; - s[23] ^= l; - s[32] ^= h; - s[33] ^= l; - s[42] ^= h; - s[43] ^= l; - h = c2 ^ (c6 << 1 | c7 >>> 31); - l = c3 ^ (c7 << 1 | c6 >>> 31); - s[4] ^= h; - s[5] ^= l; - s[14] ^= h; - s[15] ^= l; - s[24] ^= h; - s[25] ^= l; - s[34] ^= h; - s[35] ^= l; - s[44] ^= h; - s[45] ^= l; - h = c4 ^ (c8 << 1 | c9 >>> 31); - l = c5 ^ (c9 << 1 | c8 >>> 31); - s[6] ^= h; - s[7] ^= l; - s[16] ^= h; - s[17] ^= l; - s[26] ^= h; - s[27] ^= l; - s[36] ^= h; - s[37] ^= l; - s[46] ^= h; - s[47] ^= l; - h = c6 ^ (c0 << 1 | c1 >>> 31); - l = c7 ^ (c1 << 1 | c0 >>> 31); - s[8] ^= h; - s[9] ^= l; - s[18] ^= h; - s[19] ^= l; - s[28] ^= h; - s[29] ^= l; - s[38] ^= h; - s[39] ^= l; - s[48] ^= h; - s[49] ^= l; - - b0 = s[0]; - b1 = s[1]; - b32 = s[11] << 4 | s[10] >>> 28; - b33 = s[10] << 4 | s[11] >>> 28; - b14 = s[20] << 3 | s[21] >>> 29; - b15 = s[21] << 3 | s[20] >>> 29; - b46 = s[31] << 9 | s[30] >>> 23; - b47 = s[30] << 9 | s[31] >>> 23; - b28 = s[40] << 18 | s[41] >>> 14; - b29 = s[41] << 18 | s[40] >>> 14; - b20 = s[2] << 1 | s[3] >>> 31; - b21 = s[3] << 1 | s[2] >>> 31; - b2 = s[13] << 12 | s[12] >>> 20; - b3 = s[12] << 12 | s[13] >>> 20; - b34 = s[22] << 10 | s[23] >>> 22; - b35 = s[23] << 10 | s[22] >>> 22; - b16 = s[33] << 13 | s[32] >>> 19; - b17 = s[32] << 13 | s[33] >>> 19; - b48 = s[42] << 2 | s[43] >>> 30; - b49 = s[43] << 2 | s[42] >>> 30; - b40 = s[5] << 30 | s[4] >>> 2; - b41 = s[4] << 30 | s[5] >>> 2; - b22 = s[14] << 6 | s[15] >>> 26; - b23 = s[15] << 6 | s[14] >>> 26; - b4 = s[25] << 11 | s[24] >>> 21; - b5 = s[24] << 11 | s[25] >>> 21; - b36 = s[34] << 15 | s[35] >>> 17; - b37 = s[35] << 15 | s[34] >>> 17; - b18 = s[45] << 29 | s[44] >>> 3; - b19 = s[44] << 29 | s[45] >>> 3; - b10 = s[6] << 28 | s[7] >>> 4; - b11 = s[7] << 28 | s[6] >>> 4; - b42 = s[17] << 23 | s[16] >>> 9; - b43 = s[16] << 23 | s[17] >>> 9; - b24 = s[26] << 25 | s[27] >>> 7; - b25 = s[27] << 25 | s[26] >>> 7; - b6 = s[36] << 21 | s[37] >>> 11; - b7 = s[37] << 21 | s[36] >>> 11; - b38 = s[47] << 24 | s[46] >>> 8; - b39 = s[46] << 24 | s[47] >>> 8; - b30 = s[8] << 27 | s[9] >>> 5; - b31 = s[9] << 27 | s[8] >>> 5; - b12 = s[18] << 20 | s[19] >>> 12; - b13 = s[19] << 20 | s[18] >>> 12; - b44 = s[29] << 7 | s[28] >>> 25; - b45 = s[28] << 7 | s[29] >>> 25; - b26 = s[38] << 8 | s[39] >>> 24; - b27 = s[39] << 8 | s[38] >>> 24; - b8 = s[48] << 14 | s[49] >>> 18; - b9 = s[49] << 14 | s[48] >>> 18; - - s[0] = b0 ^ ~b2 & b4; - s[1] = b1 ^ ~b3 & b5; - s[10] = b10 ^ ~b12 & b14; - s[11] = b11 ^ ~b13 & b15; - s[20] = b20 ^ ~b22 & b24; - s[21] = b21 ^ ~b23 & b25; - s[30] = b30 ^ ~b32 & b34; - s[31] = b31 ^ ~b33 & b35; - s[40] = b40 ^ ~b42 & b44; - s[41] = b41 ^ ~b43 & b45; - s[2] = b2 ^ ~b4 & b6; - s[3] = b3 ^ ~b5 & b7; - s[12] = b12 ^ ~b14 & b16; - s[13] = b13 ^ ~b15 & b17; - s[22] = b22 ^ ~b24 & b26; - s[23] = b23 ^ ~b25 & b27; - s[32] = b32 ^ ~b34 & b36; - s[33] = b33 ^ ~b35 & b37; - s[42] = b42 ^ ~b44 & b46; - s[43] = b43 ^ ~b45 & b47; - s[4] = b4 ^ ~b6 & b8; - s[5] = b5 ^ ~b7 & b9; - s[14] = b14 ^ ~b16 & b18; - s[15] = b15 ^ ~b17 & b19; - s[24] = b24 ^ ~b26 & b28; - s[25] = b25 ^ ~b27 & b29; - s[34] = b34 ^ ~b36 & b38; - s[35] = b35 ^ ~b37 & b39; - s[44] = b44 ^ ~b46 & b48; - s[45] = b45 ^ ~b47 & b49; - s[6] = b6 ^ ~b8 & b0; - s[7] = b7 ^ ~b9 & b1; - s[16] = b16 ^ ~b18 & b10; - s[17] = b17 ^ ~b19 & b11; - s[26] = b26 ^ ~b28 & b20; - s[27] = b27 ^ ~b29 & b21; - s[36] = b36 ^ ~b38 & b30; - s[37] = b37 ^ ~b39 & b31; - s[46] = b46 ^ ~b48 & b40; - s[47] = b47 ^ ~b49 & b41; - s[8] = b8 ^ ~b0 & b2; - s[9] = b9 ^ ~b1 & b3; - s[18] = b18 ^ ~b10 & b12; - s[19] = b19 ^ ~b11 & b13; - s[28] = b28 ^ ~b20 & b22; - s[29] = b29 ^ ~b21 & b23; - s[38] = b38 ^ ~b30 & b32; - s[39] = b39 ^ ~b31 & b33; - s[48] = b48 ^ ~b40 & b42; - s[49] = b49 ^ ~b41 & b43; - - s[0] ^= RC[n]; - s[1] ^= RC[n + 1]; - } -}; - -var keccak = function keccak(bits) { - return function (str) { - var msg; - if (str.slice(0, 2) === "0x") { - msg = []; - for (var i = 2, l = str.length; i < l; i += 2) { - msg.push(parseInt(str.slice(i, i + 2), 16)); - } - } else { - msg = str; - } - return update(Keccak(bits, bits), msg); - }; -}; - -module.exports = { - keccak256: keccak(256), - keccak512: keccak(512), - keccak256s: keccak(256), - keccak512s: keccak(512) -}; - -/***/ }), - -/***/ "./node_modules/ethjs-abi/lib/index.js": -/*!*********************************************!*\ - !*** ./node_modules/ethjs-abi/lib/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { - -/* eslint-disable */ - -var utils = __webpack_require__(/*! ./utils/index.js */ "./node_modules/ethjs-abi/lib/utils/index.js"); -var uint256Coder = utils.uint256Coder; -var coderBoolean = utils.coderBoolean; -var coderFixedBytes = utils.coderFixedBytes; -var coderAddress = utils.coderAddress; -var coderDynamicBytes = utils.coderDynamicBytes; -var coderString = utils.coderString; -var coderArray = utils.coderArray; -var paramTypePart = utils.paramTypePart; -var getParamCoder = utils.getParamCoder; - -function Result() {} - -function encodeParams(types, values) { - if (types.length !== values.length) { - throw new Error('[ethjs-abi] while encoding params, types/values mismatch, types length ' + types.length + ' should be ' + values.length); - } - - var parts = []; - - types.forEach(function (type, index) { - var coder = getParamCoder(type); - parts.push({ dynamic: coder.dynamic, value: coder.encode(values[index]) }); - }); - - function alignSize(size) { - return parseInt(32 * Math.ceil(size / 32)); - } - - var staticSize = 0, - dynamicSize = 0; - parts.forEach(function (part) { - if (part.dynamic) { - staticSize += 32; - dynamicSize += alignSize(part.value.length); - } else { - staticSize += alignSize(part.value.length); - } - }); - - var offset = 0, - dynamicOffset = staticSize; - var data = new Buffer(staticSize + dynamicSize); - - parts.forEach(function (part, index) { - if (part.dynamic) { - uint256Coder.encode(dynamicOffset).copy(data, offset); - offset += 32; - - part.value.copy(data, dynamicOffset); - dynamicOffset += alignSize(part.value.length); - } else { - part.value.copy(data, offset); - offset += alignSize(part.value.length); - } - }); - - return '0x' + data.toString('hex'); -} - -// decode bytecode data from output names and types -function decodeParams(names, types, data) { - // Names is optional, so shift over all the parameters if not provided - if (arguments.length < 3) { - data = types; - types = names; - names = []; - } - - data = utils.hexOrBuffer(data); - var values = new Result(); - - var offset = 0; - types.forEach(function (type, index) { - var coder = getParamCoder(type); - if (coder.dynamic) { - var dynamicOffset = uint256Coder.decode(data, offset); - var result = coder.decode(data, dynamicOffset.value.toNumber()); - offset += dynamicOffset.consumed; - } else { - var result = coder.decode(data, offset); - offset += result.consumed; - } - values[index] = result.value; - if (names[index]) { - values[names[index]] = result.value; - } - }); - return values; -} - -// encode method ABI object with values in an array, output bytecode -function encodeMethod(method, values) { - var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')'; - var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex'); - var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2); - - return '' + signatureEncoded + paramsEncoded; -} - -// decode method data bytecode, from method ABI object -function decodeMethod(method, data) { - var outputNames = utils.getKeys(method.outputs, 'name', true); - var outputTypes = utils.getKeys(method.outputs, 'type'); - - return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data)); -} - -// decode method data bytecode, from method ABI object -function encodeEvent(eventObject, values) { - return encodeMethod(eventObject, values); -} - -// decode method data bytecode, from method ABI object -function decodeEvent(eventObject, data) { - var inputNames = utils.getKeys(eventObject.inputs, 'name', true); - var inputTypes = utils.getKeys(eventObject.inputs, 'type'); - - return decodeParams(inputNames, inputTypes, utils.hexOrBuffer(data)); -} - -module.exports = { - encodeParams: encodeParams, - decodeParams: decodeParams, - encodeMethod: encodeMethod, - decodeMethod: decodeMethod, - encodeEvent: encodeEvent, - decodeEvent: decodeEvent -}; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/ethjs-abi/lib/utils/index.js": -/*!***************************************************!*\ - !*** ./node_modules/ethjs-abi/lib/utils/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/ethjs-abi/node_modules/bn.js/lib/bn.js"); -var numberToBN = __webpack_require__(/*! number-to-bn */ "./node_modules/number-to-bn/src/index.js"); -var keccak256 = __webpack_require__(/*! js-sha3 */ "./node_modules/ethjs-abi/node_modules/js-sha3/src/sha3.js").keccak_256; - -// from ethereumjs-util -function stripZeros(aInput) { - var a = aInput; // eslint-disable-line - var first = a[0]; // eslint-disable-line - while (a.length > 0 && first.toString() === '0') { - a = a.slice(1); - first = a[0]; - } - return a; -} - -function bnToBuffer(bnInput) { - var bn = bnInput; // eslint-disable-line - var hex = bn.toString(16); // eslint-disable-line - if (hex.length % 2) { - hex = '0' + hex; - } - return stripZeros(new Buffer(hex, 'hex')); -} - -function isHexString(value, length) { - if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (length && value.length !== 2 + 2 * length) { - return false; - } - return true; -} - -function hexOrBuffer(valueInput, name) { - var value = valueInput; // eslint-disable-line - if (!Buffer.isBuffer(value)) { - if (!isHexString(value)) { - var error = new Error(name ? '[ethjs-abi] invalid ' + name : '[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string'); - error.reason = '[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)'; - error.value = value; - throw error; - } - - value = value.substring(2); - if (value.length % 2) { - value = '0' + value; - } - value = new Buffer(value, 'hex'); - } - - return value; -} - -function hexlify(value) { - if (typeof value === 'number') { - return '0x' + bnToBuffer(new BN(value)).toString('hex'); - } else if (value.mod || value.modulo) { - return '0x' + bnToBuffer(value).toString('hex'); - } else { - // eslint-disable-line - return '0x' + hexOrBuffer(value).toString('hex'); - } -} - -// getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3] -function getKeys(params, key, allowEmpty) { - var result = []; // eslint-disable-line - - if (!Array.isArray(params)) { - throw new Error('[ethjs-abi] while getting keys, invalid params value ' + JSON.stringify(params)); - } - - for (var i = 0; i < params.length; i++) { - // eslint-disable-line - var value = params[i][key]; // eslint-disable-line - if (allowEmpty && !value) { - value = ''; - } else if (typeof value !== 'string') { - throw new Error('[ethjs-abi] while getKeys found invalid ABI data structure, type value not string'); - } - result.push(value); - } - - return result; -} - -function coderNumber(size, signed) { - return { - encode: function encodeNumber(valueInput) { - var value = valueInput; // eslint-disable-line - - if (typeof value === 'object' && value.toString && (value.toTwos || value.dividedToIntegerBy)) { - value = value.toString(10).split('.')[0]; - } - - if (typeof value === 'string' || typeof value === 'number') { - value = String(value).split('.')[0]; - } - - value = numberToBN(value); - value = value.toTwos(size * 8).maskn(size * 8); - if (signed) { - value = value.fromTwos(size * 8).toTwos(256); - } - return value.toArrayLike(Buffer, 'be', 32); - }, - decode: function decodeNumber(data, offset) { - var junkLength = 32 - size; // eslint-disable-line - var value = new BN(data.slice(offset + junkLength, offset + 32)); // eslint-disable-line - if (signed) { - value = value.fromTwos(size * 8); - } else { - value = value.maskn(size * 8); - } - return { - consumed: 32, - value: new BN(value.toString(10)) - }; - } - }; -} -var uint256Coder = coderNumber(32, false); - -var coderBoolean = { - encode: function encodeBoolean(value) { - return uint256Coder.encode(value ? 1 : 0); - }, - decode: function decodeBoolean(data, offset) { - var result = uint256Coder.decode(data, offset); // eslint-disable-line - return { - consumed: result.consumed, - value: !result.value.isZero() - }; - } -}; - -function coderFixedBytes(length) { - return { - encode: function encodeFixedBytes(valueInput) { - var value = valueInput; // eslint-disable-line - value = hexOrBuffer(value); - - if (value.length === 32) { - return value; - } - - var result = new Buffer(32); // eslint-disable-line - result.fill(0); - value.copy(result); - return result; - }, - decode: function decodeFixedBytes(data, offset) { - if (data.length < offset + 32) { - throw new Error('[ethjs-abi] while decoding fixed bytes, invalid bytes data length: ' + length); - } - - return { - consumed: 32, - value: '0x' + data.slice(offset, offset + length).toString('hex') - }; - } - }; -} - -var coderAddress = { - encode: function encodeAddress(valueInput) { - var value = valueInput; // eslint-disable-line - var result = new Buffer(32); // eslint-disable-line - if (!isHexString(value, 20)) { - throw new Error('[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string'); - } - value = hexOrBuffer(value); - result.fill(0); - value.copy(result, 12); - return result; - }, - decode: function decodeAddress(data, offset) { - if (data.length === 0) { - return { - consumed: 32, - value: '0x' - }; - } - if (data.length < offset + 32) { - throw new Error('[ethjs-abi] while decoding address data, invalid address data, invalid byte length ' + data.length); - } - return { - consumed: 32, - value: '0x' + data.slice(offset + 12, offset + 32).toString('hex') - }; - } -}; - -function encodeDynamicBytesHelper(value) { - var dataLength = parseInt(32 * Math.ceil(value.length / 32)); // eslint-disable-line - var padding = new Buffer(dataLength - value.length); // eslint-disable-line - padding.fill(0); - - return Buffer.concat([uint256Coder.encode(value.length), value, padding]); -} - -function decodeDynamicBytesHelper(data, offset) { - if (data.length < offset + 32) { - throw new Error('[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: ' + data.length + ' should be less than ' + (offset + 32)); - } - - var length = uint256Coder.decode(data, offset).value; // eslint-disable-line - length = length.toNumber(); - if (data.length < offset + 32 + length) { - throw new Error('[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: ' + data.length + ' should be less than ' + (offset + 32 + length)); - } - - return { - consumed: parseInt(32 + 32 * Math.ceil(length / 32), 10), - value: data.slice(offset + 32, offset + 32 + length) - }; -} - -var coderDynamicBytes = { - encode: function encodeDynamicBytes(value) { - return encodeDynamicBytesHelper(hexOrBuffer(value)); - }, - decode: function decodeDynamicBytes(data, offset) { - var result = decodeDynamicBytesHelper(data, offset); // eslint-disable-line - result.value = '0x' + result.value.toString('hex'); - return result; - }, - dynamic: true -}; - -var coderString = { - encode: function encodeString(value) { - return encodeDynamicBytesHelper(new Buffer(value, 'utf8')); - }, - decode: function decodeString(data, offset) { - var result = decodeDynamicBytesHelper(data, offset); // eslint-disable-line - result.value = result.value.toString('utf8'); - return result; - }, - dynamic: true -}; - -function coderArray(coder, lengthInput) { - return { - encode: function encodeArray(value) { - var result = new Buffer(0); // eslint-disable-line - var length = lengthInput; // eslint-disable-line - - if (!Array.isArray(value)) { - throw new Error('[ethjs-abi] while encoding array, invalid array data, not type Object (Array)'); - } - - if (length === -1) { - length = value.length; - result = uint256Coder.encode(length); - } - - if (length !== value.length) { - throw new Error('[ethjs-abi] while encoding array, size mismatch array length ' + length + ' does not equal ' + value.length); - } - - value.forEach(function (resultValue) { - result = Buffer.concat([result, coder.encode(resultValue)]); - }); - - return result; - }, - decode: function decodeArray(data, offsetInput) { - var length = lengthInput; // eslint-disable-line - var offset = offsetInput; // eslint-disable-line - // @TODO: - // if (data.length < offset + length * 32) { throw new Error('invalid array'); } - - var consumed = 0; // eslint-disable-line - var decodeResult; // eslint-disable-line - - if (length === -1) { - decodeResult = uint256Coder.decode(data, offset); - length = decodeResult.value.toNumber(); - consumed += decodeResult.consumed; - offset += decodeResult.consumed; - } - - var value = []; // eslint-disable-line - - for (var i = 0; i < length; i++) { - // eslint-disable-line - var loopResult = coder.decode(data, offset); - consumed += loopResult.consumed; - offset += loopResult.consumed; - value.push(loopResult.value); - } - - return { - consumed: consumed, - value: value - }; - }, - dynamic: lengthInput === -1 - }; -} - -// Break the type up into [staticType][staticArray]*[dynamicArray]? | [dynamicType] and -// build the coder up from its parts -var paramTypePart = new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/); - -function getParamCoder(typeInput) { - var type = typeInput; // eslint-disable-line - var coder = null; // eslint-disable-line - var invalidTypeErrorMessage = '[ethjs-abi] while getting param coder (getParamCoder) type value ' + JSON.stringify(type) + ' is either invalid or unsupported by ethjs-abi.'; - - while (type) { - var part = type.match(paramTypePart); // eslint-disable-line - if (!part) { - throw new Error(invalidTypeErrorMessage); - } - type = type.substring(part[0].length); - - var prefix = part[2] || part[4] || part[5]; // eslint-disable-line - switch (prefix) { - case 'int':case 'uint': - if (coder) { - throw new Error(invalidTypeErrorMessage); - } - var intSize = parseInt(part[3] || 256); // eslint-disable-line - if (intSize === 0 || intSize > 256 || intSize % 8 !== 0) { - throw new Error('[ethjs-abi] while getting param coder for type ' + type + ', invalid ' + prefix + ' width: ' + type); - } - - coder = coderNumber(intSize / 8, prefix === 'int'); - break; - - case 'bool': - if (coder) { - throw new Error(invalidTypeErrorMessage); - } - coder = coderBoolean; - break; - - case 'string': - if (coder) { - throw new Error(invalidTypeErrorMessage); - } - coder = coderString; - break; - - case 'bytes': - if (coder) { - throw new Error(invalidTypeErrorMessage); - } - if (part[3]) { - var size = parseInt(part[3]); // eslint-disable-line - if (size === 0 || size > 32) { - throw new Error('[ethjs-abi] while getting param coder for prefix bytes, invalid type ' + type + ', size ' + size + ' should be 0 or greater than 32'); - } - coder = coderFixedBytes(size); - } else { - coder = coderDynamicBytes; - } - break; - - case 'address': - if (coder) { - throw new Error(invalidTypeErrorMessage); - } - coder = coderAddress; - break; - - case '[]': - if (!coder || coder.dynamic) { - throw new Error(invalidTypeErrorMessage); - } - coder = coderArray(coder, -1); - break; - - // "[0-9+]" - default: - if (!coder || coder.dynamic) { - throw new Error(invalidTypeErrorMessage); - } - var defaultSize = parseInt(part[6]); // eslint-disable-line - coder = coderArray(coder, defaultSize); - } - } - - if (!coder) { - throw new Error(invalidTypeErrorMessage); - } - return coder; -} - -module.exports = { - BN: BN, - bnToBuffer: bnToBuffer, - isHexString: isHexString, - hexOrBuffer: hexOrBuffer, - hexlify: hexlify, - stripZeros: stripZeros, - - keccak256: keccak256, - - getKeys: getKeys, - numberToBN: numberToBN, - coderNumber: coderNumber, - uint256Coder: uint256Coder, - coderBoolean: coderBoolean, - coderFixedBytes: coderFixedBytes, - coderAddress: coderAddress, - coderDynamicBytes: coderDynamicBytes, - coderString: coderString, - coderArray: coderArray, - paramTypePart: paramTypePart, - getParamCoder: getParamCoder -}; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/ethjs-abi/node_modules/bn.js/lib/bn.js": -/*!*************************************************************!*\ - !*** ./node_modules/ethjs-abi/node_modules/bn.js/lib/bn.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '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' - ]; - - var groupSizes = [ - 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 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) { - // No-op, we should not move anything at all - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - r.strip(); - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(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); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(typeof module === 'undefined' || module, this); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/ethjs-abi/node_modules/js-sha3/src/sha3.js": -/*!*****************************************************************!*\ - !*** ./node_modules/ethjs-abi/node_modules/js-sha3/src/sha3.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, global) {/** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.5.5 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2016 - * @license MIT - */ -(function (root) { - 'use strict'; - - var NODE_JS = typeof process == 'object' && process.versions && process.versions.node; - if (NODE_JS) { - root = global; - } - var COMMON_JS = !root.JS_SHA3_TEST && typeof module == 'object' && module.exports; - var HEX_CHARS = '0123456789abcdef'.split(''); - var SHAKE_PADDING = [31, 7936, 2031616, 520093696]; - var KECCAK_PADDING = [1, 256, 65536, 16777216]; - var PADDING = [6, 1536, 393216, 100663296]; - var SHIFT = [0, 8, 16, 24]; - var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, - 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, - 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, - 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, - 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648]; - var BITS = [224, 256, 384, 512]; - var SHAKE_BITS = [128, 256]; - var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array']; - - var createOutputMethod = function (bits, padding, outputType) { - return function (message) { - return new Keccak(bits, padding, bits).update(message)[outputType](); - } - }; - - var createShakeOutputMethod = function (bits, padding, outputType) { - return function (message, outputBits) { - return new Keccak(bits, padding, outputBits).update(message)[outputType](); - } - }; - - var createMethod = function (bits, padding) { - var method = createOutputMethod(bits, padding, 'hex'); - method.create = function () { - return new Keccak(bits, padding, bits); - }; - method.update = function (message) { - return method.create().update(message); - }; - for (var i = 0;i < OUTPUT_TYPES.length;++i) { - var type = OUTPUT_TYPES[i]; - method[type] = createOutputMethod(bits, padding, type); - } - return method; - }; - - var createShakeMethod = function (bits, padding) { - var method = createShakeOutputMethod(bits, padding, 'hex'); - method.create = function (outputBits) { - return new Keccak(bits, padding, outputBits); - }; - method.update = function (message, outputBits) { - return method.create(outputBits).update(message); - }; - for (var i = 0;i < OUTPUT_TYPES.length;++i) { - var type = OUTPUT_TYPES[i]; - method[type] = createShakeOutputMethod(bits, padding, type); - } - return method; - }; - - var algorithms = [ - {name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod}, - {name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod}, - {name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod} - ]; - - var methods = {}; - - for (var i = 0;i < algorithms.length;++i) { - var algorithm = algorithms[i]; - var bits = algorithm.bits; - for (var j = 0;j < bits.length;++j) { - methods[algorithm.name +'_' + bits[j]] = algorithm.createMethod(bits[j], algorithm.padding); - } - } - - function Keccak(bits, padding, outputBits) { - this.blocks = []; - this.s = []; - this.padding = padding; - this.outputBits = outputBits; - this.reset = true; - this.block = 0; - this.start = 0; - this.blockCount = (1600 - (bits << 1)) >> 5; - this.byteCount = this.blockCount << 2; - this.outputBlocks = outputBits >> 5; - this.extraBytes = (outputBits & 31) >> 3; - - for (var i = 0;i < 50;++i) { - this.s[i] = 0; - } - }; - - Keccak.prototype.update = function (message) { - var notString = typeof message != 'string'; - if (notString && message.constructor == root.ArrayBuffer) { - message = new Uint8Array(message); - } - var length = message.length, blocks = this.blocks, byteCount = this.byteCount, - blockCount = this.blockCount, index = 0, s = this.s, i, code; - - while (index < length) { - if (this.reset) { - this.reset = false; - blocks[0] = this.block; - for (i = 1;i < blockCount + 1;++i) { - blocks[i] = 0; - } - } - if (notString) { - for (i = this.start;index < length && i < byteCount;++index) { - blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; - } - } else { - for (i = this.start;index < length && i < byteCount;++index) { - code = message.charCodeAt(index); - if (code < 0x80) { - blocks[i >> 2] |= code << SHIFT[i++ & 3]; - } else if (code < 0x800) { - blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } else if (code < 0xd800 || code >= 0xe000) { - blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } else { - code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); - blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } - } - } - this.lastByteIndex = i; - if (i >= byteCount) { - this.start = i - byteCount; - this.block = blocks[blockCount]; - for (i = 0;i < blockCount;++i) { - s[i] ^= blocks[i]; - } - f(s); - this.reset = true; - } else { - this.start = i; - } - } - return this; - }; - - Keccak.prototype.finalize = function () { - var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s; - blocks[i >> 2] |= this.padding[i & 3]; - if (this.lastByteIndex == this.byteCount) { - blocks[0] = blocks[blockCount]; - for (i = 1;i < blockCount + 1;++i) { - blocks[i] = 0; - } - } - blocks[blockCount - 1] |= 0x80000000; - for (i = 0;i < blockCount;++i) { - s[i] ^= blocks[i]; - } - f(s); - }; - - Keccak.prototype.toString = Keccak.prototype.hex = function () { - this.finalize(); - - var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, - extraBytes = this.extraBytes, i = 0, j = 0; - var hex = '', block; - while (j < outputBlocks) { - for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) { - block = s[i]; - hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] + - HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] + - HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] + - HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F]; - } - if (j % blockCount == 0) { - f(s); - i = 0; - } - } - if (extraBytes) { - block = s[i]; - if (extraBytes > 0) { - hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F]; - } - if (extraBytes > 1) { - hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F]; - } - if (extraBytes > 2) { - hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F]; - } - } - return hex; - }; - - Keccak.prototype.arrayBuffer = function () { - this.finalize(); - - var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, - extraBytes = this.extraBytes, i = 0, j = 0; - var bytes = this.outputBits >> 3; - var buffer; - if (extraBytes) { - buffer = new ArrayBuffer((outputBlocks + 1) << 2); - } else { - buffer = new ArrayBuffer(bytes); - } - var array = new Uint32Array(buffer); - while (j < outputBlocks) { - for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) { - array[j] = s[i]; - } - if (j % blockCount == 0) { - f(s); - } - } - if (extraBytes) { - array[i] = s[i]; - buffer = buffer.slice(0, bytes); - } - return buffer; - }; - - Keccak.prototype.buffer = Keccak.prototype.arrayBuffer; - - Keccak.prototype.digest = Keccak.prototype.array = function () { - this.finalize(); - - var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, - extraBytes = this.extraBytes, i = 0, j = 0; - var array = [], offset, block; - while (j < outputBlocks) { - for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) { - offset = j << 2; - block = s[i]; - array[offset] = block & 0xFF; - array[offset + 1] = (block >> 8) & 0xFF; - array[offset + 2] = (block >> 16) & 0xFF; - array[offset + 3] = (block >> 24) & 0xFF; - } - if (j % blockCount == 0) { - f(s); - } - } - if (extraBytes) { - offset = j << 2; - block = s[i]; - if (extraBytes > 0) { - array[offset] = block & 0xFF; - } - if (extraBytes > 1) { - array[offset + 1] = (block >> 8) & 0xFF; - } - if (extraBytes > 2) { - array[offset + 2] = (block >> 16) & 0xFF; - } - } - return array; - }; - - var f = function (s) { - var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, - b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, - b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, - b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49; - for (n = 0;n < 48;n += 2) { - c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; - c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; - c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; - c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; - c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; - c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; - c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; - c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; - c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; - c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; - - h = c8 ^ ((c2 << 1) | (c3 >>> 31)); - l = c9 ^ ((c3 << 1) | (c2 >>> 31)); - s[0] ^= h; - s[1] ^= l; - s[10] ^= h; - s[11] ^= l; - s[20] ^= h; - s[21] ^= l; - s[30] ^= h; - s[31] ^= l; - s[40] ^= h; - s[41] ^= l; - h = c0 ^ ((c4 << 1) | (c5 >>> 31)); - l = c1 ^ ((c5 << 1) | (c4 >>> 31)); - s[2] ^= h; - s[3] ^= l; - s[12] ^= h; - s[13] ^= l; - s[22] ^= h; - s[23] ^= l; - s[32] ^= h; - s[33] ^= l; - s[42] ^= h; - s[43] ^= l; - h = c2 ^ ((c6 << 1) | (c7 >>> 31)); - l = c3 ^ ((c7 << 1) | (c6 >>> 31)); - s[4] ^= h; - s[5] ^= l; - s[14] ^= h; - s[15] ^= l; - s[24] ^= h; - s[25] ^= l; - s[34] ^= h; - s[35] ^= l; - s[44] ^= h; - s[45] ^= l; - h = c4 ^ ((c8 << 1) | (c9 >>> 31)); - l = c5 ^ ((c9 << 1) | (c8 >>> 31)); - s[6] ^= h; - s[7] ^= l; - s[16] ^= h; - s[17] ^= l; - s[26] ^= h; - s[27] ^= l; - s[36] ^= h; - s[37] ^= l; - s[46] ^= h; - s[47] ^= l; - h = c6 ^ ((c0 << 1) | (c1 >>> 31)); - l = c7 ^ ((c1 << 1) | (c0 >>> 31)); - s[8] ^= h; - s[9] ^= l; - s[18] ^= h; - s[19] ^= l; - s[28] ^= h; - s[29] ^= l; - s[38] ^= h; - s[39] ^= l; - s[48] ^= h; - s[49] ^= l; - - b0 = s[0]; - b1 = s[1]; - b32 = (s[11] << 4) | (s[10] >>> 28); - b33 = (s[10] << 4) | (s[11] >>> 28); - b14 = (s[20] << 3) | (s[21] >>> 29); - b15 = (s[21] << 3) | (s[20] >>> 29); - b46 = (s[31] << 9) | (s[30] >>> 23); - b47 = (s[30] << 9) | (s[31] >>> 23); - b28 = (s[40] << 18) | (s[41] >>> 14); - b29 = (s[41] << 18) | (s[40] >>> 14); - b20 = (s[2] << 1) | (s[3] >>> 31); - b21 = (s[3] << 1) | (s[2] >>> 31); - b2 = (s[13] << 12) | (s[12] >>> 20); - b3 = (s[12] << 12) | (s[13] >>> 20); - b34 = (s[22] << 10) | (s[23] >>> 22); - b35 = (s[23] << 10) | (s[22] >>> 22); - b16 = (s[33] << 13) | (s[32] >>> 19); - b17 = (s[32] << 13) | (s[33] >>> 19); - b48 = (s[42] << 2) | (s[43] >>> 30); - b49 = (s[43] << 2) | (s[42] >>> 30); - b40 = (s[5] << 30) | (s[4] >>> 2); - b41 = (s[4] << 30) | (s[5] >>> 2); - b22 = (s[14] << 6) | (s[15] >>> 26); - b23 = (s[15] << 6) | (s[14] >>> 26); - b4 = (s[25] << 11) | (s[24] >>> 21); - b5 = (s[24] << 11) | (s[25] >>> 21); - b36 = (s[34] << 15) | (s[35] >>> 17); - b37 = (s[35] << 15) | (s[34] >>> 17); - b18 = (s[45] << 29) | (s[44] >>> 3); - b19 = (s[44] << 29) | (s[45] >>> 3); - b10 = (s[6] << 28) | (s[7] >>> 4); - b11 = (s[7] << 28) | (s[6] >>> 4); - b42 = (s[17] << 23) | (s[16] >>> 9); - b43 = (s[16] << 23) | (s[17] >>> 9); - b24 = (s[26] << 25) | (s[27] >>> 7); - b25 = (s[27] << 25) | (s[26] >>> 7); - b6 = (s[36] << 21) | (s[37] >>> 11); - b7 = (s[37] << 21) | (s[36] >>> 11); - b38 = (s[47] << 24) | (s[46] >>> 8); - b39 = (s[46] << 24) | (s[47] >>> 8); - b30 = (s[8] << 27) | (s[9] >>> 5); - b31 = (s[9] << 27) | (s[8] >>> 5); - b12 = (s[18] << 20) | (s[19] >>> 12); - b13 = (s[19] << 20) | (s[18] >>> 12); - b44 = (s[29] << 7) | (s[28] >>> 25); - b45 = (s[28] << 7) | (s[29] >>> 25); - b26 = (s[38] << 8) | (s[39] >>> 24); - b27 = (s[39] << 8) | (s[38] >>> 24); - b8 = (s[48] << 14) | (s[49] >>> 18); - b9 = (s[49] << 14) | (s[48] >>> 18); - - s[0] = b0 ^ (~b2 & b4); - s[1] = b1 ^ (~b3 & b5); - s[10] = b10 ^ (~b12 & b14); - s[11] = b11 ^ (~b13 & b15); - s[20] = b20 ^ (~b22 & b24); - s[21] = b21 ^ (~b23 & b25); - s[30] = b30 ^ (~b32 & b34); - s[31] = b31 ^ (~b33 & b35); - s[40] = b40 ^ (~b42 & b44); - s[41] = b41 ^ (~b43 & b45); - s[2] = b2 ^ (~b4 & b6); - s[3] = b3 ^ (~b5 & b7); - s[12] = b12 ^ (~b14 & b16); - s[13] = b13 ^ (~b15 & b17); - s[22] = b22 ^ (~b24 & b26); - s[23] = b23 ^ (~b25 & b27); - s[32] = b32 ^ (~b34 & b36); - s[33] = b33 ^ (~b35 & b37); - s[42] = b42 ^ (~b44 & b46); - s[43] = b43 ^ (~b45 & b47); - s[4] = b4 ^ (~b6 & b8); - s[5] = b5 ^ (~b7 & b9); - s[14] = b14 ^ (~b16 & b18); - s[15] = b15 ^ (~b17 & b19); - s[24] = b24 ^ (~b26 & b28); - s[25] = b25 ^ (~b27 & b29); - s[34] = b34 ^ (~b36 & b38); - s[35] = b35 ^ (~b37 & b39); - s[44] = b44 ^ (~b46 & b48); - s[45] = b45 ^ (~b47 & b49); - s[6] = b6 ^ (~b8 & b0); - s[7] = b7 ^ (~b9 & b1); - s[16] = b16 ^ (~b18 & b10); - s[17] = b17 ^ (~b19 & b11); - s[26] = b26 ^ (~b28 & b20); - s[27] = b27 ^ (~b29 & b21); - s[36] = b36 ^ (~b38 & b30); - s[37] = b37 ^ (~b39 & b31); - s[46] = b46 ^ (~b48 & b40); - s[47] = b47 ^ (~b49 & b41); - s[8] = b8 ^ (~b0 & b2); - s[9] = b9 ^ (~b1 & b3); - s[18] = b18 ^ (~b10 & b12); - s[19] = b19 ^ (~b11 & b13); - s[28] = b28 ^ (~b20 & b22); - s[29] = b29 ^ (~b21 & b23); - s[38] = b38 ^ (~b30 & b32); - s[39] = b39 ^ (~b31 & b33); - s[48] = b48 ^ (~b40 & b42); - s[49] = b49 ^ (~b41 & b43); - - s[0] ^= RC[n]; - s[1] ^= RC[n + 1]; - } - } - - if (COMMON_JS) { - module.exports = methods; - } else if (root) { - for (var key in methods) { - root[key] = methods[key]; - } - } -}(this)); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/ethjs-unit/lib/index.js": -/*!**********************************************!*\ - !*** ./node_modules/ethjs-unit/lib/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js"); -var numberToBN = __webpack_require__(/*! number-to-bn */ "./node_modules/number-to-bn/src/index.js"); - -var zero = new BN(0); -var negative1 = new BN(-1); - -// complete ethereum unit map -var unitMap = { - 'noether': '0', // eslint-disable-line - 'wei': '1', // eslint-disable-line - 'kwei': '1000', // eslint-disable-line - 'Kwei': '1000', // eslint-disable-line - 'babbage': '1000', // eslint-disable-line - 'femtoether': '1000', // eslint-disable-line - 'mwei': '1000000', // eslint-disable-line - 'Mwei': '1000000', // eslint-disable-line - 'lovelace': '1000000', // eslint-disable-line - 'picoether': '1000000', // eslint-disable-line - 'gwei': '1000000000', // eslint-disable-line - 'Gwei': '1000000000', // eslint-disable-line - 'shannon': '1000000000', // eslint-disable-line - 'nanoether': '1000000000', // eslint-disable-line - 'nano': '1000000000', // eslint-disable-line - 'szabo': '1000000000000', // eslint-disable-line - 'microether': '1000000000000', // eslint-disable-line - 'micro': '1000000000000', // eslint-disable-line - 'finney': '1000000000000000', // eslint-disable-line - 'milliether': '1000000000000000', // eslint-disable-line - 'milli': '1000000000000000', // eslint-disable-line - 'ether': '1000000000000000000', // eslint-disable-line - 'kether': '1000000000000000000000', // eslint-disable-line - 'grand': '1000000000000000000000', // eslint-disable-line - 'mether': '1000000000000000000000000', // eslint-disable-line - 'gether': '1000000000000000000000000000', // eslint-disable-line - 'tether': '1000000000000000000000000000000' }; - -/** - * Returns value of unit in Wei - * - * @method getValueOfUnit - * @param {String} unit the unit to convert to, default ether - * @returns {BigNumber} value of the unit (in Wei) - * @throws error if the unit is not correct:w - */ -function getValueOfUnit(unitInput) { - var unit = unitInput ? unitInput.toLowerCase() : 'ether'; - var unitValue = unitMap[unit]; // eslint-disable-line - - if (typeof unitValue !== 'string') { - throw new Error('[ethjs-unit] the unit provided ' + unitInput + ' doesn\'t exists, please use the one of the following units ' + JSON.stringify(unitMap, null, 2)); - } - - return new BN(unitValue, 10); -} - -function numberToString(arg) { - if (typeof arg === 'string') { - if (!arg.match(/^-?[0-9.]+$/)) { - throw new Error('while converting number to string, invalid number value \'' + arg + '\', should be a number matching (^-?[0-9.]+).'); - } - return arg; - } else if (typeof arg === 'number') { - return String(arg); - } else if (typeof arg === 'object' && arg.toString && (arg.toTwos || arg.dividedToIntegerBy)) { - if (arg.toPrecision) { - return String(arg.toPrecision()); - } else { - // eslint-disable-line - return arg.toString(10); - } - } - throw new Error('while converting number to string, invalid number value \'' + arg + '\' type ' + typeof arg + '.'); -} - -function fromWei(weiInput, unit, optionsInput) { - var wei = numberToBN(weiInput); // eslint-disable-line - var negative = wei.lt(zero); // eslint-disable-line - var base = getValueOfUnit(unit); - var baseLength = unitMap[unit].length - 1 || 1; - var options = optionsInput || {}; - - if (negative) { - wei = wei.mul(negative1); - } - - var fraction = wei.mod(base).toString(10); // eslint-disable-line - - while (fraction.length < baseLength) { - fraction = '0' + fraction; - } - - if (!options.pad) { - fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1]; - } - - var whole = wei.div(base).toString(10); // eslint-disable-line - - if (options.commify) { - whole = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ','); - } - - var value = '' + whole + (fraction == '0' ? '' : '.' + fraction); // eslint-disable-line - - if (negative) { - value = '-' + value; - } - - return value; -} - -function toWei(etherInput, unit) { - var ether = numberToString(etherInput); // eslint-disable-line - var base = getValueOfUnit(unit); - var baseLength = unitMap[unit].length - 1 || 1; - - // Is it negative? - var negative = ether.substring(0, 1) === '-'; // eslint-disable-line - if (negative) { - ether = ether.substring(1); - } - - if (ether === '.') { - throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, invalid value'); - } - - // Split it into a whole and fractional part - var comps = ether.split('.'); // eslint-disable-line - if (comps.length > 2) { - throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, too many decimal points'); - } - - var whole = comps[0], - fraction = comps[1]; // eslint-disable-line - - if (!whole) { - whole = '0'; - } - if (!fraction) { - fraction = '0'; - } - if (fraction.length > baseLength) { - throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, too many decimal places'); - } - - while (fraction.length < baseLength) { - fraction += '0'; - } - - whole = new BN(whole); - fraction = new BN(fraction); - var wei = whole.mul(base).add(fraction); // eslint-disable-line - - if (negative) { - wei = wei.mul(negative1); - } - - return new BN(wei.toString(10), 10); -} - -module.exports = { - unitMap: unitMap, - numberToString: numberToString, - getValueOfUnit: getValueOfUnit, - fromWei: fromWei, - toWei: toWei -}; - -/***/ }), - -/***/ "./node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js": -/*!**************************************************************!*\ - !*** ./node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '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' - ]; - - var groupSizes = [ - 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 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) { - // No-op, we should not move anything at all - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - r.strip(); - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(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); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(typeof module === 'undefined' || module, this); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/events/events.js": -/*!***************************************!*\ - !*** ./node_modules/events/events.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; -}; - -EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - - -/***/ }), - -/***/ "./node_modules/evp_bytestokey/index.js": -/*!**********************************************!*\ - !*** ./node_modules/evp_bytestokey/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var MD5 = __webpack_require__(/*! md5.js */ "./node_modules/md5.js/index.js") - -/* eslint-disable camelcase */ -function EVP_BytesToKey (password, salt, keyBits, ivLen) { - if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary') - if (salt) { - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary') - if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length') - } - - var keyLen = keyBits / 8 - var key = Buffer.alloc(keyLen) - var iv = Buffer.alloc(ivLen || 0) - var tmp = Buffer.alloc(0) - - while (keyLen > 0 || ivLen > 0) { - var hash = new MD5() - hash.update(tmp) - hash.update(password) - if (salt) hash.update(salt) - tmp = hash.digest() - - var used = 0 - - if (keyLen > 0) { - var keyStart = key.length - keyLen - used = Math.min(keyLen, tmp.length) - tmp.copy(key, keyStart, 0, used) - keyLen -= used - } - - if (used < tmp.length && ivLen > 0) { - var ivStart = iv.length - ivLen - var length = Math.min(ivLen, tmp.length - used) - tmp.copy(iv, ivStart, used, used + length) - ivLen -= length - } - } - - tmp.fill(0) - return { key: key, iv: iv } -} - -module.exports = EVP_BytesToKey - - -/***/ }), - -/***/ "./node_modules/fast-deep-equal/index.js": -/*!***********************************************!*\ - !*** ./node_modules/fast-deep-equal/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isArray = Array.isArray; -var keyList = Object.keys; -var hasProp = Object.prototype.hasOwnProperty; - -module.exports = function equal(a, b) { - if (a === b) return true; - - var arrA = isArray(a) - , arrB = isArray(b) - , i - , length - , key; - - if (arrA && arrB) { - length = a.length; - if (length != b.length) return false; - for (i = 0; i < length; i++) - if (!equal(a[i], b[i])) return false; - return true; - } - - if (arrA != arrB) return false; - - var dateA = a instanceof Date - , dateB = b instanceof Date; - if (dateA != dateB) return false; - if (dateA && dateB) return a.getTime() == b.getTime(); - - var regexpA = a instanceof RegExp - , regexpB = b instanceof RegExp; - if (regexpA != regexpB) return false; - if (regexpA && regexpB) return a.toString() == b.toString(); - - if (a instanceof Object && b instanceof Object) { - var keys = keyList(a); - length = keys.length; - - if (length !== keyList(b).length) - return false; - - for (i = 0; i < length; i++) - if (!hasProp.call(b, keys[i])) return false; - - for (i = 0; i < length; i++) { - key = keys[i]; - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - return false; -}; - - -/***/ }), - -/***/ "./node_modules/fast-json-stable-stringify/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/fast-json-stable-stringify/index.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (data, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; - - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - var seen = []; - return (function stringify (node) { - if (node && node.toJSON && typeof node.toJSON === 'function') { - node = node.toJSON(); - } - - if (node === undefined) return; - if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; - if (typeof node !== 'object') return JSON.stringify(node); - - var i, out; - if (Array.isArray(node)) { - out = '['; - for (i = 0; i < node.length; i++) { - if (i) out += ','; - out += stringify(node[i]) || 'null'; - } - return out + ']'; - } - - if (node === null) return 'null'; - - if (seen.indexOf(node) !== -1) { - if (cycles) return JSON.stringify('__cycle__'); - throw new TypeError('Converting circular structure to JSON'); - } - - var seenIndex = seen.push(node) - 1; - var keys = Object.keys(node).sort(cmp && cmp(node)); - out = ''; - for (i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = stringify(node[key]); - - if (!value) continue; - if (out) out += ','; - out += JSON.stringify(key) + ':' + value; - } - seen.splice(seenIndex, 1); - return '{' + out + '}'; - })(data); -}; - - -/***/ }), - -/***/ "./node_modules/fbjs/lib/EventListener.js": -/*!************************************************!*\ - !*** ./node_modules/fbjs/lib/EventListener.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var emptyFunction = __webpack_require__(/*! ./emptyFunction */ "./node_modules/fbjs/lib/emptyFunction.js"); - -/** - * Upstream version of event listener. Does not take into account specific - * nature of platform. - */ -var EventListener = { - /** - * Listen to DOM events during the bubble phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - listen: function listen(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, false); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, false); - } - }; - } else if (target.attachEvent) { - target.attachEvent('on' + eventType, callback); - return { - remove: function remove() { - target.detachEvent('on' + eventType, callback); - } - }; - } - }, - - /** - * Listen to DOM events during the capture phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - capture: function capture(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, true); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, true); - } - }; - } else { - if (true) { - console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); - } - return { - remove: emptyFunction - }; - } - }, - - registerDefault: function registerDefault() {} -}; - -module.exports = EventListener; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/ExecutionEnvironment.js": -/*!*******************************************************!*\ - !*** ./node_modules/fbjs/lib/ExecutionEnvironment.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -/** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ -var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen, - - isInWorker: !canUseDOM // For now, this is true - might change in the future. - -}; - -module.exports = ExecutionEnvironment; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/camelize.js": -/*!*******************************************!*\ - !*** ./node_modules/fbjs/lib/camelize.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var _hyphenPattern = /-(.)/g; - -/** - * Camelcases a hyphenated string, for example: - * - * > camelize('background-color') - * < "backgroundColor" - * - * @param {string} string - * @return {string} - */ -function camelize(string) { - return string.replace(_hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); -} - -module.exports = camelize; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/camelizeStyleName.js": -/*!****************************************************!*\ - !*** ./node_modules/fbjs/lib/camelizeStyleName.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -var camelize = __webpack_require__(/*! ./camelize */ "./node_modules/fbjs/lib/camelize.js"); - -var msPattern = /^-ms-/; - -/** - * Camelcases a hyphenated CSS property name, for example: - * - * > camelizeStyleName('background-color') - * < "backgroundColor" - * > camelizeStyleName('-moz-transition') - * < "MozTransition" - * > camelizeStyleName('-ms-transition') - * < "msTransition" - * - * As Andi Smith suggests - * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - * is converted to lowercase `ms`. - * - * @param {string} string - * @return {string} - */ -function camelizeStyleName(string) { - return camelize(string.replace(msPattern, 'ms-')); -} - -module.exports = camelizeStyleName; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/containsNode.js": -/*!***********************************************!*\ - !*** ./node_modules/fbjs/lib/containsNode.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -var isTextNode = __webpack_require__(/*! ./isTextNode */ "./node_modules/fbjs/lib/isTextNode.js"); - -/*eslint-disable no-bitwise */ - -/** - * Checks if a given DOM node contains or is another DOM node. - */ -function containsNode(outerNode, innerNode) { - if (!outerNode || !innerNode) { - return false; - } else if (outerNode === innerNode) { - return true; - } else if (isTextNode(outerNode)) { - return false; - } else if (isTextNode(innerNode)) { - return containsNode(outerNode, innerNode.parentNode); - } else if ('contains' in outerNode) { - return outerNode.contains(innerNode); - } else if (outerNode.compareDocumentPosition) { - return !!(outerNode.compareDocumentPosition(innerNode) & 16); - } else { - return false; - } -} - -module.exports = containsNode; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/emptyFunction.js": -/*!************************************************!*\ - !*** ./node_modules/fbjs/lib/emptyFunction.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/emptyObject.js": -/*!**********************************************!*\ - !*** ./node_modules/fbjs/lib/emptyObject.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyObject = {}; - -if (true) { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/focusNode.js": -/*!********************************************!*\ - !*** ./node_modules/fbjs/lib/focusNode.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * @param {DOMElement} node input/textarea to focus - */ - -function focusNode(node) { - // IE8 can throw "Can't move focus to the control because it is invisible, - // not enabled, or of a type that does not accept the focus." for all kinds of - // reasons that are too expensive and fragile to test. - try { - node.focus(); - } catch (e) {} -} - -module.exports = focusNode; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/getActiveElement.js": -/*!***************************************************!*\ - !*** ./node_modules/fbjs/lib/getActiveElement.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/* eslint-disable fb-www/typeof-undefined */ - -/** - * Same as document.activeElement but wraps in a try-catch block. In IE it is - * not safe to call document.activeElement if there is nothing focused. - * - * The activeElement will be null only if the document or document body is not - * yet defined. - * - * @param {?DOMDocument} doc Defaults to current document. - * @return {?DOMElement} - */ -function getActiveElement(doc) /*?DOMElement*/{ - doc = doc || (typeof document !== 'undefined' ? document : undefined); - if (typeof doc === 'undefined') { - return null; - } - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } -} - -module.exports = getActiveElement; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/hyphenate.js": -/*!********************************************!*\ - !*** ./node_modules/fbjs/lib/hyphenate.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var _uppercasePattern = /([A-Z])/g; - -/** - * Hyphenates a camelcased string, for example: - * - * > hyphenate('backgroundColor') - * < "background-color" - * - * For CSS style names, use `hyphenateStyleName` instead which works properly - * with all vendor prefixes, including `ms`. - * - * @param {string} string - * @return {string} - */ -function hyphenate(string) { - return string.replace(_uppercasePattern, '-$1').toLowerCase(); -} - -module.exports = hyphenate; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/hyphenateStyleName.js": -/*!*****************************************************!*\ - !*** ./node_modules/fbjs/lib/hyphenateStyleName.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -var hyphenate = __webpack_require__(/*! ./hyphenate */ "./node_modules/fbjs/lib/hyphenate.js"); - -var msPattern = /^ms-/; - -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - * - * @param {string} string - * @return {string} - */ -function hyphenateStyleName(string) { - return hyphenate(string).replace(msPattern, '-ms-'); -} - -module.exports = hyphenateStyleName; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/invariant.js": -/*!********************************************!*\ - !*** ./node_modules/fbjs/lib/invariant.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var validateFormat = function validateFormat(format) {}; - -if (true) { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/isNode.js": -/*!*****************************************!*\ - !*** ./node_modules/fbjs/lib/isNode.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/** - * @param {*} object The object to check. - * @return {boolean} Whether or not the object is a DOM node. - */ -function isNode(object) { - var doc = object ? object.ownerDocument || object : document; - var defaultView = doc.defaultView || window; - return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); -} - -module.exports = isNode; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/isTextNode.js": -/*!*********************************************!*\ - !*** ./node_modules/fbjs/lib/isTextNode.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var isNode = __webpack_require__(/*! ./isNode */ "./node_modules/fbjs/lib/isNode.js"); - -/** - * @param {*} object The object to check. - * @return {boolean} Whether or not the object is a DOM text node. - */ -function isTextNode(object) { - return isNode(object) && object.nodeType == 3; -} - -module.exports = isTextNode; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/shallowEqual.js": -/*!***********************************************!*\ - !*** ./node_modules/fbjs/lib/shallowEqual.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - * - */ - -/*eslint-disable no-self-compare */ - - - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} - -/** - * Performs equality by iterating through keys on an object and returning false - * when any key has values which are not strictly equal between the arguments. - * Returns true when the values of all keys are strictly equal. - */ -function shallowEqual(objA, objB) { - if (is(objA, objB)) { - return true; - } - - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); - - if (keysA.length !== keysB.length) { - return false; - } - - // Test for A's keys different from B. - for (var i = 0; i < keysA.length; i++) { - if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - - return true; -} - -module.exports = shallowEqual; - -/***/ }), - -/***/ "./node_modules/fbjs/lib/warning.js": -/*!******************************************!*\ - !*** ./node_modules/fbjs/lib/warning.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyFunction = __webpack_require__(/*! ./emptyFunction */ "./node_modules/fbjs/lib/emptyFunction.js"); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (true) { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; - -/***/ }), - -/***/ "./node_modules/final-form/dist/final-form.es.js": -/*!*******************************************************!*\ - !*** ./node_modules/final-form/dist/final-form.es.js ***! - \*******************************************************/ -/*! exports provided: createForm, FORM_ERROR, version, formSubscriptionItems, fieldSubscriptionItems, getIn, setIn */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createForm", function() { return createForm; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORM_ERROR", function() { return FORM_ERROR; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formSubscriptionItems", function() { return formSubscriptionItems; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fieldSubscriptionItems", function() { return fieldSubscriptionItems; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIn", function() { return getIn; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setIn", function() { return setIn; }); -// -var toPath = function toPath(key) { - if (key === null || key === undefined) { - return []; - } - if (typeof key !== 'string') { - throw new Error('toPath() expects a string'); - } - return key.length ? key.split(/[.[\]]+/).filter(Boolean) : []; -}; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; -}; - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -}; - -// - -var getIn = function getIn(state, complexKey) { - // Intentionally using iteration rather than recursion - var path = toPath(complexKey); - var current = state; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = path[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var key = _step.value; - - if (current === undefined || current === null || (typeof current === 'undefined' ? 'undefined' : _typeof(current)) !== 'object' || Array.isArray(current) && isNaN(key)) { - return undefined; - } - current = current[key]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return current; -}; - -// - -var setInRecursor = function setInRecursor(current, index, path, value) { - if (index >= path.length) { - // end of recursion - return value; - } - var key = path[index]; - - // determine type of key - if (isNaN(key)) { - // object set - if (current === undefined || current === null) { - // recurse - var _result2 = setInRecursor(undefined, index + 1, path, value); - - // delete or create an object - return _result2 === undefined ? undefined : defineProperty({}, key, _result2); - } - if (Array.isArray(current)) { - throw new Error('Cannot set a non-numeric property on an array'); - } - // current exists, so make a copy of all its values, and add/update the new one - var _result = setInRecursor(current[key], index + 1, path, value); - var numKeys = Object.keys(current).length; - if (_result === undefined) { - if (current[key] === undefined && numKeys === 0) { - // object was already empty - return undefined; - } - if (current[key] !== undefined && numKeys <= 1) { - // only key we had was the one we are deleting - if (!isNaN(path[index - 1])) { - // we are in an array, so return an empty object - return {}; - } else { - return undefined; - } - } - } - // set result in key - return _extends({}, current, defineProperty({}, key, _result)); - } - // array set - var numericKey = Number(key); - if (current === undefined || current === null) { - // recurse - var _result3 = setInRecursor(undefined, index + 1, path, value); - - // if nothing returned, delete it - if (_result3 === undefined) { - return undefined; - } - - // create an array - var _array = []; - _array[numericKey] = _result3; - return _array; - } - if (!Array.isArray(current)) { - throw new Error('Cannot set a numeric property on an object'); - } - // recurse - var existingValue = current[numericKey]; - var result = setInRecursor(existingValue, index + 1, path, value); - - // current exists, so make a copy of all its values, and add/update the new one - var array = [].concat(toConsumableArray(current)); - array[numericKey] = result; - return array; -}; - -var setIn = function setIn(state, key, value) { - if (state === undefined || state === null) { - throw new Error('Cannot call setIn() with ' + String(state) + ' state'); - } - if (key === undefined || key === null) { - throw new Error('Cannot call setIn() with ' + String(key) + ' key'); - } - // Recursive function needs to accept and return State, but public API should - // only deal with Objects - return setInRecursor(state, 0, toPath(key), value); -}; - -// - -/** - * Converts internal field state to published field state - */ -var publishFieldState = function publishFieldState(formState, field) { - var errors = formState.errors, - initialValues = formState.initialValues, - lastSubmittedValues = formState.lastSubmittedValues, - submitErrors = formState.submitErrors, - submitFailed = formState.submitFailed, - submitSucceeded = formState.submitSucceeded, - values = formState.values; - var active = field.active, - blur = field.blur, - change = field.change, - data = field.data, - focus = field.focus, - name = field.name, - touched = field.touched, - visited = field.visited; - - var value = getIn(values, name); - var error = getIn(errors, name); - var submitError = submitErrors && getIn(submitErrors, name); - var initial = initialValues && getIn(initialValues, name); - var pristine = field.isEqual(initial, value); - var dirtySinceLastSubmit = !!(lastSubmittedValues && !field.isEqual(getIn(lastSubmittedValues, name), value)); - var valid = !error && !submitError; - return { - active: active, - blur: blur, - change: change, - data: data, - dirty: !pristine, - dirtySinceLastSubmit: dirtySinceLastSubmit, - error: error, - focus: focus, - initial: initial, - invalid: !valid, - length: Array.isArray(value) ? value.length : undefined, - name: name, - pristine: pristine, - submitError: submitError, - submitFailed: submitFailed, - submitSucceeded: submitSucceeded, - touched: touched, - valid: valid, - value: value, - visited: visited - }; -}; - -// -var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'value', 'visited']; - -// - - -var shallowEqual = function shallowEqual(a, b) { - if (a === b) { - return true; - } - if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object' || !a || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) !== 'object' || !b) { - return false; - } - var keysA = Object.keys(a); - var keysB = Object.keys(b); - if (keysA.length !== keysB.length) { - return false; - } - var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(b); - for (var idx = 0; idx < keysA.length; idx++) { - var key = keysA[idx]; - if (!bHasOwnProperty(key) || a[key] !== b[key]) { - return false; - } - } - return true; -}; - -// -function subscriptionFilter (dest, src, previous, subscription, keys, shallowEqualKeys) { - var different = false; - keys.forEach(function (key) { - if (subscription[key]) { - dest[key] = src[key]; - if (!previous || (~shallowEqualKeys.indexOf(key) ? !shallowEqual(src[key], previous[key]) : src[key] !== previous[key])) { - different = true; - } - } - }); - return different; -} - -// - -var shallowEqualKeys = ['data']; - -/** - * Filters items in a FieldState based on a FieldSubscription - */ -var filterFieldState = function filterFieldState(state, previousState, subscription, force) { - var result = { - blur: state.blur, - change: state.change, - focus: state.focus, - name: state.name - }; - var different = subscriptionFilter(result, state, previousState, subscription, fieldSubscriptionItems, shallowEqualKeys) || !previousState; - return different || force ? result : undefined; -}; - -// -var formSubscriptionItems = ['active', 'dirty', 'dirtySinceLastSubmit', 'error', 'errors', 'initialValues', 'invalid', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited']; - -// - -var shallowEqualKeys$1 = ['touched', 'visited']; - -/** - * Filters items in a FormState based on a FormSubscription - */ -var filterFormState = function filterFormState(state, previousState, subscription, force) { - var result = {}; - var different = subscriptionFilter(result, state, previousState, subscription, formSubscriptionItems, shallowEqualKeys$1) || !previousState; - return different || force ? result : undefined; -}; - -// - -var memoize = function memoize(fn) { - var lastArgs = void 0; - var lastResult = void 0; - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (!lastArgs || args.length !== lastArgs.length || args.some(function (arg, index) { - return !shallowEqual(lastArgs[index], arg); - })) { - lastArgs = args; - lastResult = fn.apply(undefined, args); - } - return lastResult; - }; -}; - -var isPromise = (function (obj) { - return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; -}); - -// - -var FORM_ERROR = Symbol('form-error'); -var version = '4.2.0'; - -var tripleEquals = function tripleEquals(a, b) { - return a === b; -}; - -var convertToExternalFormState = function convertToExternalFormState(_ref) { - var active = _ref.active, - dirtySinceLastSubmit = _ref.dirtySinceLastSubmit, - error = _ref.error, - errors = _ref.errors, - initialValues = _ref.initialValues, - pristine = _ref.pristine, - submitting = _ref.submitting, - submitFailed = _ref.submitFailed, - submitSucceeded = _ref.submitSucceeded, - submitError = _ref.submitError, - submitErrors = _ref.submitErrors, - valid = _ref.valid, - validating = _ref.validating, - values = _ref.values; - return { - active: active, - dirty: !pristine, - dirtySinceLastSubmit: dirtySinceLastSubmit, - error: error, - errors: errors, - invalid: !valid, - initialValues: initialValues, - pristine: pristine, - submitting: submitting, - submitFailed: submitFailed, - submitSucceeded: submitSucceeded, - submitError: submitError, - submitErrors: submitErrors, - valid: valid, - validating: validating > 0, - values: values - }; -}; - -function notifySubscriber(subscriber, subscription, state, lastState, filter) { - var force = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; - - var notification = filter(state, lastState, subscription, force); - if (notification) { - subscriber(notification); - } -} - -function notify(_ref2, state, lastState, filter) { - var entries = _ref2.entries; - - Object.keys(entries).forEach(function (key) { - var _entries$Number = entries[Number(key)], - subscription = _entries$Number.subscription, - subscriber = _entries$Number.subscriber; - - notifySubscriber(subscriber, subscription, state, lastState, filter); - }); -} - -var createForm = function createForm(config) { - if (!config) { - throw new Error('No config specified'); - } - var debug = config.debug, - initialValues = config.initialValues, - mutators = config.mutators, - onSubmit = config.onSubmit, - validate = config.validate, - validateOnBlur = config.validateOnBlur; - - if (!onSubmit) { - throw new Error('No onSubmit function specified'); - } - - var state = { - subscribers: { index: 0, entries: {} }, - fieldSubscribers: {}, - fields: {}, - formState: { - dirtySinceLastSubmit: false, - errors: {}, - initialValues: initialValues && _extends({}, initialValues), - invalid: false, - pristine: true, - submitting: false, - submitFailed: false, - submitSucceeded: false, - valid: true, - validating: 0, - values: initialValues ? _extends({}, initialValues) : {} - }, - lastFormState: undefined - }; - var inBatch = false; - var validationPaused = false; - var validationBlocked = false; - var nextAsyncValidationKey = 0; - var asyncValidationPromises = {}; - var clearAsyncValidationPromise = function clearAsyncValidationPromise(key) { - return function (result) { - delete asyncValidationPromises[key]; - return result; - }; - }; - - var changeValue = function changeValue(state, name, mutate) { - if (state.fields[name]) { - var before = getIn(state.formState.values, name); - var after = mutate(before); - state.formState.values = setIn(state.formState.values, name, after) || {}; - } - }; - - // bind state to mutators - var mutatorsApi = mutators && Object.keys(mutators).reduce(function (result, key) { - result[key] = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var mutatableState = { - formState: state.formState, - fields: state.fields - }; - var returnValue = mutators[key](args, mutatableState, { - changeValue: changeValue, - getIn: getIn, - setIn: setIn, - shallowEqual: shallowEqual - }); - state.formState = mutatableState.formState; - state.fields = mutatableState.fields; - runValidation(undefined, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - return returnValue; - }; - return result; - }, {}) || {}; - - var runRecordLevelValidation = function runRecordLevelValidation(setErrors) { - var promises = []; - if (validate) { - var errorsOrPromise = validate(_extends({}, state.formState.values)); // clone to avoid writing - if (isPromise(errorsOrPromise)) { - var asyncValidationPromiseKey = nextAsyncValidationKey++; - var promise = errorsOrPromise.then(setErrors).then(clearAsyncValidationPromise(asyncValidationPromiseKey)); - promises.push(promise); - asyncValidationPromises[asyncValidationPromiseKey] = promise; - } else { - setErrors(errorsOrPromise); - } - } - return promises; - }; - - var getValidators = function getValidators(field) { - return Object.keys(field.validators).reduce(function (result, index) { - var validator = field.validators[Number(index)](); - if (validator) { - result.push(validator); - } - return result; - }, []); - }; - - var runFieldLevelValidation = function runFieldLevelValidation(field, setError) { - var promises = []; - var validators = getValidators(field); - if (validators.length) { - var error = void 0; - validators.forEach(function (validator) { - var errorOrPromise = validator(getIn(state.formState.values, field.name), state.formState.values); - if (errorOrPromise && isPromise(errorOrPromise)) { - var asyncValidationPromiseKey = nextAsyncValidationKey++; - var promise = errorOrPromise.then(setError).then(clearAsyncValidationPromise(asyncValidationPromiseKey)); - promises.push(promise); - asyncValidationPromises[asyncValidationPromiseKey] = promise; - } else if (!error) { - // first registered validator wins - error = errorOrPromise; - } - }); - setError(error); - } - return promises; - }; - - var runValidation = function runValidation(fieldChanged, callback) { - if (validationPaused) { - validationBlocked = true; - /* istanbul ignore next */ - if (callback) { - callback(); - } - return; - } - - var fields = state.fields, - formState = state.formState; - - var fieldKeys = Object.keys(fields); - if (!validate && !fieldKeys.some(function (key) { - return getValidators(fields[key]).length; - })) { - if (callback) { - callback(); - } - return; // no validation rules - } - - // pare down field keys to actually validate - if (fieldChanged) { - var validateFields = fields[fieldChanged].validateFields; - - if (validateFields) { - fieldKeys = validateFields.length ? validateFields.concat(fieldChanged) : [fieldChanged]; - } - } - - var recordLevelErrors = {}; - var fieldLevelErrors = {}; - var promises = [].concat(toConsumableArray(runRecordLevelValidation(function (errors) { - recordLevelErrors = errors || {}; - })), toConsumableArray(fieldKeys.reduce(function (result, name) { - return result.concat(runFieldLevelValidation(fields[name], function (error) { - fieldLevelErrors[name] = error; - })); - }, []))); - - var processErrors = function processErrors() { - var merged = _extends({}, recordLevelErrors); - fieldKeys.forEach(function (name) { - if (fields[name]) { - // make sure field is still registered - // field-level errors take precedent over record-level errors - var error = fieldLevelErrors[name] || getIn(recordLevelErrors, name); - if (error) { - merged = setIn(merged, name, error); - } - } - }); - if (!shallowEqual(formState.errors, merged)) { - formState.errors = merged; - } - formState.error = recordLevelErrors[FORM_ERROR]; - }; - - // process sync errors - processErrors(); - - if (promises.length) { - // sync errors have been set. notify listeners while we wait for others - state.formState.validating++; - if (callback) { - callback(); - } - - Promise.all(promises).then(function () { - state.formState.validating--; - processErrors(); - if (callback) { - callback(); - } - }); - } else if (callback) { - callback(); - } - }; - - var notifyFieldListeners = function notifyFieldListeners(force) { - if (inBatch) { - return; - } - var fields = state.fields, - fieldSubscribers = state.fieldSubscribers, - formState = state.formState; - - Object.keys(fields).forEach(function (name) { - var field = fields[name]; - var fieldState = publishFieldState(formState, field); - var lastFieldState = field.lastFieldState; - - if (!shallowEqual(fieldState, lastFieldState)) { - field.lastFieldState = fieldState; - notify(fieldSubscribers[name], fieldState, lastFieldState, filterFieldState); - } - }); - }; - - var hasSyncErrors = function hasSyncErrors() { - return !!(state.formState.error || Object.keys(state.formState.errors).length); - }; - - var calculateNextFormState = function calculateNextFormState() { - var fields = state.fields, - formState = state.formState, - lastFormState = state.lastFormState; - - var fieldKeys = Object.keys(fields); - - // calculate dirty/pristine - formState.pristine = fieldKeys.every(function (key) { - return fields[key].isEqual(getIn(formState.values, key), getIn(formState.initialValues || {}, key)); - }); - formState.dirtySinceLastSubmit = !!(formState.lastSubmittedValues && !fieldKeys.every(function (key) { - return fields[key].isEqual(getIn(formState.values, key), getIn(formState.lastSubmittedValues || {}, key) // || {} is for flow, but causes branch coverage complaint - ); - })); - - formState.valid = !formState.error && !formState.submitError && !Object.keys(formState.errors).length && !(formState.submitErrors && Object.keys(formState.submitErrors).length); - var nextFormState = convertToExternalFormState(formState); - - var _fieldKeys$reduce = fieldKeys.reduce(function (result, key) { - result.touched[key] = fields[key].touched; - result.visited[key] = fields[key].visited; - return result; - }, { touched: {}, visited: {} }), - touched = _fieldKeys$reduce.touched, - visited = _fieldKeys$reduce.visited; - - nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched; - nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited; - return lastFormState && shallowEqual(lastFormState, nextFormState) ? lastFormState : nextFormState; - }; - - var callDebug = function callDebug() { - return debug && "development" !== 'production' && debug(convertToExternalFormState(state.formState), Object.keys(state.fields).reduce(function (result, key) { - result[key] = state.fields[key]; - return result; - }, {})); - }; - - var notifyFormListeners = function notifyFormListeners() { - callDebug(); - if (inBatch) { - return; - } - var lastFormState = state.lastFormState; - - var nextFormState = calculateNextFormState(); - if (nextFormState !== lastFormState) { - state.lastFormState = nextFormState; - notify(state.subscribers, nextFormState, lastFormState, filterFormState); - } - }; - - // generate initial errors - runValidation(); - - var api = { - batch: function batch(fn) { - inBatch = true; - fn(); - inBatch = false; - notifyFieldListeners(); - notifyFormListeners(); - }, - - blur: function blur(name) { - var fields = state.fields, - formState = state.formState; - - var previous = fields[name]; - if (previous) { - // can only blur registered fields - delete formState.active; - fields[name] = _extends({}, previous, { - active: false, - touched: true - }); - if (validateOnBlur) { - runValidation(name, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - } else { - notifyFieldListeners(); - notifyFormListeners(); - } - } - }, - - change: function change(name, value) { - var fields = state.fields, - formState = state.formState; - - if (fields[name] && getIn(formState.values, name) !== value) { - changeValue(state, name, function () { - return value; - }); - if (validateOnBlur) { - notifyFieldListeners(); - notifyFormListeners(); - } else { - runValidation(name, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - } - } - }, - - focus: function focus(name) { - var field = state.fields[name]; - if (field && !field.active) { - state.formState.active = name; - field.active = true; - field.visited = true; - notifyFieldListeners(); - notifyFormListeners(); - } - }, - - mutators: mutatorsApi, - - getRegisteredFields: function getRegisteredFields() { - return Object.keys(state.fields); - }, - - getState: function getState() { - return convertToExternalFormState(state.formState); - }, - - initialize: function initialize(values) { - var fields = state.fields, - formState = state.formState; - - formState.initialValues = values; - formState.values = values; - Object.keys(fields).forEach(function (key) { - var field = fields[key]; - field.touched = false; - field.visited = false; - }); - runValidation(undefined, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - }, - - pauseValidation: function pauseValidation() { - validationPaused = true; - }, - - registerField: function registerField(name, subscriber) { - var subscription = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var fieldConfig = arguments[3]; - - if (!state.fieldSubscribers[name]) { - state.fieldSubscribers[name] = { index: 0, entries: {} }; - } - var index = state.fieldSubscribers[name].index++; - - // save field subscriber callback - state.fieldSubscribers[name].entries[index] = { - subscriber: memoize(subscriber), - subscription: subscription - }; - - if (!state.fields[name]) { - // create initial field state - var initial = state.formState.initialValues ? getIn(state.formState.initialValues, name) : undefined; - state.fields[name] = { - active: false, - blur: function blur() { - return api.blur(name); - }, - change: function change(value) { - return api.change(name, value); - }, - data: {}, - focus: function focus() { - return api.focus(name); - }, - initial: initial, - isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals, - lastFieldState: undefined, - name: name, - touched: false, - valid: true, - validateFields: fieldConfig && fieldConfig.validateFields, - validators: {}, - visited: false - }; - } - if (fieldConfig && fieldConfig.getValidator) { - state.fields[name].validators[index] = fieldConfig.getValidator; - } - - var sentFirstNotification = false; - var firstNotification = function firstNotification() { - var fieldState = publishFieldState(state.formState, state.fields[name]); - notifySubscriber(subscriber, subscription, fieldState, undefined, filterFieldState, true); - state.fields[name].lastFieldState = fieldState; - sentFirstNotification = true; - }; - - runValidation(undefined, function () { - notifyFormListeners(); - if (!sentFirstNotification) { - firstNotification(); - } - notifyFieldListeners(); - }); - - return function () { - delete state.fields[name].validators[index]; - delete state.fieldSubscribers[name].entries[index]; - if (!Object.keys(state.fieldSubscribers[name].entries).length) { - delete state.fieldSubscribers[name]; - delete state.fields[name]; - } - runValidation(undefined, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - }; - }, - - reset: function reset() { - state.formState.submitFailed = false; - state.formState.submitSucceeded = false; - delete state.formState.submitErrors; - delete state.formState.lastSubmittedValues; - api.initialize(state.formState.initialValues || {}); - }, - - resumeValidation: function resumeValidation() { - validationPaused = false; - if (validationBlocked) { - // validation was attempted while it was paused, so run it now - runValidation(undefined, function () { - notifyFieldListeners(); - notifyFormListeners(); - }); - } - validationBlocked = false; - }, - - submit: function submit() { - var formState = state.formState, - fields = state.fields; - - if (hasSyncErrors()) { - // mark all fields as touched - Object.keys(fields).forEach(function (key) { - fields[key].touched = true; - }); - state.formState.submitFailed = true; - notifyFormListeners(); - notifyFieldListeners(); - return; // no submit for you!! - } - var asyncValidationPromisesKeys = Object.keys(asyncValidationPromises); - if (asyncValidationPromisesKeys.length) { - // still waiting on async validation to complete... - Promise.all(asyncValidationPromisesKeys.reduce(function (result, key) { - result.push(asyncValidationPromises[Number(key)]); - return result; - }, [])).then(function () { - return api.submit(); - }); - return; - } - - var resolvePromise = void 0; - var completeCalled = false; - var complete = function complete(errors) { - formState.submitting = false; - if (errors && (Object.keys(errors).length || Object.getOwnPropertySymbols(errors).length)) { - formState.submitFailed = true; - formState.submitSucceeded = false; - formState.submitErrors = errors; - formState.submitError = errors[FORM_ERROR]; - } else { - delete formState.submitErrors; - delete formState.submitError; - formState.submitFailed = false; - formState.submitSucceeded = true; - } - notifyFormListeners(); - notifyFieldListeners(); - completeCalled = true; - if (resolvePromise) { - resolvePromise(); - } - }; - formState.submitting = true; - formState.submitFailed = false; - formState.submitSucceeded = false; - formState.lastSubmittedValues = _extends({}, formState.values); - if (onSubmit.length === 3) { - // onSubmit is expecting a callback, first try synchronously - onSubmit(formState.values, api, complete); - if (!completeCalled) { - // must be async, so we should return a Promise - notifyFormListeners(); // let everyone know we are submitting - return new Promise(function (resolve) { - resolvePromise = resolve; - }); - } - } else { - // onSubmit is either sync or async with a Promise - var result = onSubmit(formState.values, api); - if (result && isPromise(result)) { - // onSubmit is async with a Promise - notifyFormListeners(); // let everyone know we are submitting - return result.then(complete); - } else { - // onSubmit is sync - complete(result); - } - } - }, - - subscribe: function subscribe(subscriber, subscription) { - if (!subscriber) { - throw new Error('No callback given.'); - } - if (!subscription) { - throw new Error('No subscription provided. What values do you want to listen to?'); - } - var memoized = memoize(subscriber); - var subscribers = state.subscribers, - lastFormState = state.lastFormState; - - var index = subscribers.index++; - subscribers.entries[index] = { - subscriber: memoized, - subscription: subscription - }; - var nextFormState = calculateNextFormState(); - if (nextFormState !== lastFormState) { - state.lastFormState = nextFormState; - } - notifySubscriber(memoized, subscription, nextFormState, nextFormState, filterFormState, true); - return function () { - delete subscribers.entries[index]; - }; - } - }; - return api; -}; - -// - - - - -/***/ }), - -/***/ "./node_modules/for-each/index.js": -/*!****************************************!*\ - !*** ./node_modules/for-each/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isFunction = __webpack_require__(/*! is-function */ "./node_modules/is-function/index.js") - -module.exports = forEach - -var toString = Object.prototype.toString -var hasOwnProperty = Object.prototype.hasOwnProperty - -function forEach(list, iterator, context) { - if (!isFunction(iterator)) { - throw new TypeError('iterator must be a function') - } - - if (arguments.length < 3) { - context = this - } - - if (toString.call(list) === '[object Array]') - forEachArray(list, iterator, context) - else if (typeof list === 'string') - forEachString(list, iterator, context) - else - forEachObject(list, iterator, context) -} - -function forEachArray(array, iterator, context) { - for (var i = 0, len = array.length; i < len; i++) { - if (hasOwnProperty.call(array, i)) { - iterator.call(context, array[i], i, array) - } - } -} - -function forEachString(string, iterator, context) { - for (var i = 0, len = string.length; i < len; i++) { - // no such thing as a sparse string. - iterator.call(context, string.charAt(i), i, string) - } -} - -function forEachObject(object, iterator, context) { - for (var k in object) { - if (hasOwnProperty.call(object, k)) { - iterator.call(context, object[k], k, object) - } - } -} - - -/***/ }), - -/***/ "./node_modules/global/window.js": -/*!***************************************!*\ - !*** ./node_modules/global/window.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {var win; - -if (typeof window !== "undefined") { - win = window; -} else if (typeof global !== "undefined") { - win = global; -} else if (typeof self !== "undefined"){ - win = self; -} else { - win = {}; -} - -module.exports = win; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/hash-base/index.js": -/*!*****************************************!*\ - !*** ./node_modules/hash-base/index.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { -var Transform = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js").Transform -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function HashBase (blockSize) { - Transform.call(this) - - this._block = new Buffer(blockSize) - this._blockSize = blockSize - this._blockOffset = 0 - this._length = [0, 0, 0, 0] - - this._finalized = false -} - -inherits(HashBase, Transform) - -HashBase.prototype._transform = function (chunk, encoding, callback) { - var error = null - try { - if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding) - this.update(chunk) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype._flush = function (callback) { - var error = null - try { - this.push(this._digest()) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype.update = function (data, encoding) { - if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer') - if (this._finalized) throw new Error('Digest already called') - if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary') - - // consume data - var block = this._block - var offset = 0 - while (this._blockOffset + data.length - offset >= this._blockSize) { - for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] - this._update() - this._blockOffset = 0 - } - while (offset < data.length) block[this._blockOffset++] = data[offset++] - - // update length - for (var j = 0, carry = data.length * 8; carry > 0; ++j) { - this._length[j] += carry - carry = (this._length[j] / 0x0100000000) | 0 - if (carry > 0) this._length[j] -= 0x0100000000 * carry - } - - return this -} - -HashBase.prototype._update = function (data) { - throw new Error('_update is not implemented') -} - -HashBase.prototype.digest = function (encoding) { - if (this._finalized) throw new Error('Digest already called') - this._finalized = true - - var digest = this._digest() - if (encoding !== undefined) digest = digest.toString(encoding) - return digest -} - -HashBase.prototype._digest = function () { - throw new Error('_digest is not implemented') -} - -module.exports = HashBase - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash.js": -/*!******************************************!*\ - !*** ./node_modules/hash.js/lib/hash.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var hash = exports; - -hash.utils = __webpack_require__(/*! ./hash/utils */ "./node_modules/hash.js/lib/hash/utils.js"); -hash.common = __webpack_require__(/*! ./hash/common */ "./node_modules/hash.js/lib/hash/common.js"); -hash.sha = __webpack_require__(/*! ./hash/sha */ "./node_modules/hash.js/lib/hash/sha.js"); -hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ "./node_modules/hash.js/lib/hash/ripemd.js"); -hash.hmac = __webpack_require__(/*! ./hash/hmac */ "./node_modules/hash.js/lib/hash/hmac.js"); - -// Proxy hash functions to the main object -hash.sha1 = hash.sha.sha1; -hash.sha256 = hash.sha.sha256; -hash.sha224 = hash.sha.sha224; -hash.sha384 = hash.sha.sha384; -hash.sha512 = hash.sha.sha512; -hash.ripemd160 = hash.ripemd.ripemd160; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/common.js": -/*!*************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/common.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -function BlockHash() { - 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; -} -exports.BlockHash = BlockHash; - -BlockHash.prototype.update = function update(msg, enc) { - // Convert message to array, pad it, and join into 32bit blocks - msg = utils.toArray(msg, enc); - if (!this.pending) - this.pending = msg; - else - this.pending = this.pending.concat(msg); - this.pendingTotal += msg.length; - - // Enough data, try updating - if (this.pending.length >= this._delta8) { - msg = this.pending; - - // Process pending data in blocks - var r = msg.length % this._delta8; - this.pending = msg.slice(msg.length - r, msg.length); - if (this.pending.length === 0) - this.pending = null; - - msg = utils.join32(msg, 0, msg.length - r, this.endian); - for (var i = 0; i < msg.length; i += this._delta32) - this._update(msg, i, i + this._delta32); - } - - return this; -}; - -BlockHash.prototype.digest = function digest(enc) { - this.update(this._pad()); - assert(this.pending === null); - - return this._digest(enc); -}; - -BlockHash.prototype._pad = function pad() { - var len = this.pendingTotal; - var bytes = this._delta8; - var k = bytes - ((len + this.padLength) % bytes); - var res = new Array(k + this.padLength); - res[0] = 0x80; - for (var i = 1; i < k; i++) - res[i] = 0; - - // Append length - len <<= 3; - if (this.endian === 'big') { - for (var t = 8; t < this.padLength; t++) - res[i++] = 0; - - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = (len >>> 24) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = len & 0xff; - } else { - res[i++] = len & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 24) & 0xff; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - - for (t = 8; t < this.padLength; t++) - res[i++] = 0; - } - - return res; -}; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/hmac.js": -/*!***********************************************!*\ - !*** ./node_modules/hash.js/lib/hash/hmac.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -function Hmac(hash, key, enc) { - if (!(this instanceof Hmac)) - return new Hmac(hash, key, enc); - this.Hash = hash; - this.blockSize = hash.blockSize / 8; - this.outSize = hash.outSize / 8; - this.inner = null; - this.outer = null; - - this._init(utils.toArray(key, enc)); -} -module.exports = Hmac; - -Hmac.prototype._init = function init(key) { - // Shorten key, if needed - if (key.length > this.blockSize) - key = new this.Hash().update(key).digest(); - assert(key.length <= this.blockSize); - - // Add padding to key - for (var i = key.length; i < this.blockSize; i++) - key.push(0); - - for (i = 0; i < key.length; i++) - key[i] ^= 0x36; - this.inner = new this.Hash().update(key); - - // 0x36 ^ 0x5c = 0x6a - for (i = 0; i < key.length; i++) - key[i] ^= 0x6a; - this.outer = new this.Hash().update(key); -}; - -Hmac.prototype.update = function update(msg, enc) { - this.inner.update(msg, enc); - return this; -}; - -Hmac.prototype.digest = function digest(enc) { - this.outer.update(this.inner.digest()); - return this.outer.digest(enc); -}; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/ripemd.js": -/*!*************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/ripemd.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var common = __webpack_require__(/*! ./common */ "./node_modules/hash.js/lib/hash/common.js"); - -var rotl32 = utils.rotl32; -var sum32 = utils.sum32; -var sum32_3 = utils.sum32_3; -var sum32_4 = utils.sum32_4; -var BlockHash = common.BlockHash; - -function RIPEMD160() { - if (!(this instanceof RIPEMD160)) - return new RIPEMD160(); - - BlockHash.call(this); - - this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; - this.endian = 'little'; -} -utils.inherits(RIPEMD160, BlockHash); -exports.ripemd160 = RIPEMD160; - -RIPEMD160.blockSize = 512; -RIPEMD160.outSize = 160; -RIPEMD160.hmacStrength = 192; -RIPEMD160.padLength = 64; - -RIPEMD160.prototype._update = function update(msg, start) { - var A = this.h[0]; - var B = this.h[1]; - var C = this.h[2]; - var D = this.h[3]; - var E = this.h[4]; - var Ah = A; - var Bh = B; - var Ch = C; - var Dh = D; - var Eh = E; - for (var j = 0; j < 80; j++) { - var T = sum32( - rotl32( - sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), - s[j]), - E); - A = E; - E = D; - D = rotl32(C, 10); - C = B; - B = T; - T = sum32( - rotl32( - sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), - sh[j]), - Eh); - Ah = Eh; - Eh = Dh; - Dh = rotl32(Ch, 10); - Ch = Bh; - Bh = T; - } - T = sum32_3(this.h[1], C, Dh); - this.h[1] = sum32_3(this.h[2], D, Eh); - this.h[2] = sum32_3(this.h[3], E, Ah); - this.h[3] = sum32_3(this.h[4], A, Bh); - this.h[4] = sum32_3(this.h[0], B, Ch); - this.h[0] = T; -}; - -RIPEMD160.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'little'); - else - return utils.split32(this.h, 'little'); -}; - -function f(j, x, y, z) { - if (j <= 15) - return x ^ y ^ z; - else if (j <= 31) - return (x & y) | ((~x) & z); - else if (j <= 47) - return (x | (~y)) ^ z; - else if (j <= 63) - return (x & z) | (y & (~z)); - else - return x ^ (y | (~z)); -} - -function K(j) { - if (j <= 15) - return 0x00000000; - else if (j <= 31) - return 0x5a827999; - else if (j <= 47) - return 0x6ed9eba1; - else if (j <= 63) - return 0x8f1bbcdc; - else - return 0xa953fd4e; -} - -function Kh(j) { - if (j <= 15) - return 0x50a28be6; - else if (j <= 31) - return 0x5c4dd124; - else if (j <= 47) - return 0x6d703ef3; - else if (j <= 63) - return 0x7a6d76e9; - else - return 0x00000000; -} - -var r = [ - 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 -]; - -var rh = [ - 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 -]; - -var s = [ - 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 -]; - -var sh = [ - 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 -]; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha.js": -/*!**********************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.sha1 = __webpack_require__(/*! ./sha/1 */ "./node_modules/hash.js/lib/hash/sha/1.js"); -exports.sha224 = __webpack_require__(/*! ./sha/224 */ "./node_modules/hash.js/lib/hash/sha/224.js"); -exports.sha256 = __webpack_require__(/*! ./sha/256 */ "./node_modules/hash.js/lib/hash/sha/256.js"); -exports.sha384 = __webpack_require__(/*! ./sha/384 */ "./node_modules/hash.js/lib/hash/sha/384.js"); -exports.sha512 = __webpack_require__(/*! ./sha/512 */ "./node_modules/hash.js/lib/hash/sha/512.js"); - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/1.js": -/*!************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/1.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var common = __webpack_require__(/*! ../common */ "./node_modules/hash.js/lib/hash/common.js"); -var shaCommon = __webpack_require__(/*! ./common */ "./node_modules/hash.js/lib/hash/sha/common.js"); - -var rotl32 = utils.rotl32; -var sum32 = utils.sum32; -var sum32_5 = utils.sum32_5; -var ft_1 = shaCommon.ft_1; -var BlockHash = common.BlockHash; - -var sha1_K = [ - 0x5A827999, 0x6ED9EBA1, - 0x8F1BBCDC, 0xCA62C1D6 -]; - -function SHA1() { - if (!(this instanceof SHA1)) - return new SHA1(); - - BlockHash.call(this); - this.h = [ - 0x67452301, 0xefcdab89, 0x98badcfe, - 0x10325476, 0xc3d2e1f0 ]; - this.W = new Array(80); -} - -utils.inherits(SHA1, BlockHash); -module.exports = SHA1; - -SHA1.blockSize = 512; -SHA1.outSize = 160; -SHA1.hmacStrength = 80; -SHA1.padLength = 64; - -SHA1.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - - for(; i < W.length; i++) - W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - - for (i = 0; i < W.length; i++) { - var s = ~~(i / 20); - var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); - e = d; - d = c; - c = rotl32(b, 30); - b = a; - a = t; - } - - this.h[0] = sum32(this.h[0], a); - this.h[1] = sum32(this.h[1], b); - this.h[2] = sum32(this.h[2], c); - this.h[3] = sum32(this.h[3], d); - this.h[4] = sum32(this.h[4], e); -}; - -SHA1.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/224.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/224.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var SHA256 = __webpack_require__(/*! ./256 */ "./node_modules/hash.js/lib/hash/sha/256.js"); - -function SHA224() { - if (!(this instanceof SHA224)) - return new SHA224(); - - SHA256.call(this); - this.h = [ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; -} -utils.inherits(SHA224, SHA256); -module.exports = SHA224; - -SHA224.blockSize = 512; -SHA224.outSize = 224; -SHA224.hmacStrength = 192; -SHA224.padLength = 64; - -SHA224.prototype._digest = function digest(enc) { - // Just truncate output - if (enc === 'hex') - return utils.toHex32(this.h.slice(0, 7), 'big'); - else - return utils.split32(this.h.slice(0, 7), 'big'); -}; - - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/256.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/256.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var common = __webpack_require__(/*! ../common */ "./node_modules/hash.js/lib/hash/common.js"); -var shaCommon = __webpack_require__(/*! ./common */ "./node_modules/hash.js/lib/hash/sha/common.js"); -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -var sum32 = utils.sum32; -var sum32_4 = utils.sum32_4; -var sum32_5 = utils.sum32_5; -var ch32 = shaCommon.ch32; -var maj32 = shaCommon.maj32; -var s0_256 = shaCommon.s0_256; -var s1_256 = shaCommon.s1_256; -var g0_256 = shaCommon.g0_256; -var g1_256 = shaCommon.g1_256; - -var BlockHash = common.BlockHash; - -var sha256_K = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]; - -function SHA256() { - if (!(this instanceof SHA256)) - return new SHA256(); - - BlockHash.call(this); - this.h = [ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]; - this.k = sha256_K; - this.W = new Array(64); -} -utils.inherits(SHA256, BlockHash); -module.exports = SHA256; - -SHA256.blockSize = 512; -SHA256.outSize = 256; -SHA256.hmacStrength = 192; -SHA256.padLength = 64; - -SHA256.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - for (; i < W.length; i++) - W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - var f = this.h[5]; - var g = this.h[6]; - var h = this.h[7]; - - assert(this.k.length === W.length); - for (i = 0; i < W.length; i++) { - var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); - var T2 = sum32(s0_256(a), maj32(a, b, c)); - h = g; - g = f; - f = e; - e = sum32(d, T1); - d = c; - c = b; - b = a; - a = sum32(T1, T2); - } - - this.h[0] = sum32(this.h[0], a); - this.h[1] = sum32(this.h[1], b); - this.h[2] = sum32(this.h[2], c); - this.h[3] = sum32(this.h[3], d); - this.h[4] = sum32(this.h[4], e); - this.h[5] = sum32(this.h[5], f); - this.h[6] = sum32(this.h[6], g); - this.h[7] = sum32(this.h[7], h); -}; - -SHA256.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/384.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/384.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); - -var SHA512 = __webpack_require__(/*! ./512 */ "./node_modules/hash.js/lib/hash/sha/512.js"); - -function SHA384() { - if (!(this instanceof SHA384)) - return new SHA384(); - - SHA512.call(this); - this.h = [ - 0xcbbb9d5d, 0xc1059ed8, - 0x629a292a, 0x367cd507, - 0x9159015a, 0x3070dd17, - 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, - 0x8eb44a87, 0x68581511, - 0xdb0c2e0d, 0x64f98fa7, - 0x47b5481d, 0xbefa4fa4 ]; -} -utils.inherits(SHA384, SHA512); -module.exports = SHA384; - -SHA384.blockSize = 1024; -SHA384.outSize = 384; -SHA384.hmacStrength = 192; -SHA384.padLength = 128; - -SHA384.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h.slice(0, 12), 'big'); - else - return utils.split32(this.h.slice(0, 12), 'big'); -}; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/512.js": -/*!**************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/512.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var common = __webpack_require__(/*! ../common */ "./node_modules/hash.js/lib/hash/common.js"); -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -var rotr64_hi = utils.rotr64_hi; -var rotr64_lo = utils.rotr64_lo; -var shr64_hi = utils.shr64_hi; -var shr64_lo = utils.shr64_lo; -var sum64 = utils.sum64; -var sum64_hi = utils.sum64_hi; -var sum64_lo = utils.sum64_lo; -var sum64_4_hi = utils.sum64_4_hi; -var sum64_4_lo = utils.sum64_4_lo; -var sum64_5_hi = utils.sum64_5_hi; -var sum64_5_lo = utils.sum64_5_lo; - -var BlockHash = common.BlockHash; - -var sha512_K = [ - 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, - 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, - 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, - 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, - 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, - 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, - 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, - 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, - 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, - 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, - 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, - 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, - 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, - 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, - 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, - 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, - 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, - 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, - 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, - 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, - 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, - 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, - 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, - 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, - 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, - 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, - 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, - 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, - 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, - 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, - 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, - 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, - 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, - 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, - 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, - 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, - 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, - 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, - 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, - 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 -]; - -function SHA512() { - if (!(this instanceof SHA512)) - return new SHA512(); - - BlockHash.call(this); - this.h = [ - 0x6a09e667, 0xf3bcc908, - 0xbb67ae85, 0x84caa73b, - 0x3c6ef372, 0xfe94f82b, - 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, - 0x9b05688c, 0x2b3e6c1f, - 0x1f83d9ab, 0xfb41bd6b, - 0x5be0cd19, 0x137e2179 ]; - this.k = sha512_K; - this.W = new Array(160); -} -utils.inherits(SHA512, BlockHash); -module.exports = SHA512; - -SHA512.blockSize = 1024; -SHA512.outSize = 512; -SHA512.hmacStrength = 192; -SHA512.padLength = 128; - -SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { - var W = this.W; - - // 32 x 32bit words - for (var i = 0; i < 32; i++) - W[i] = msg[start + i]; - for (; i < W.length; i += 2) { - var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2 - var c0_lo = g1_512_lo(W[i - 4], W[i - 3]); - var c1_hi = W[i - 14]; // i - 7 - var c1_lo = W[i - 13]; - var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15 - var c2_lo = g0_512_lo(W[i - 30], W[i - 29]); - var c3_hi = W[i - 32]; // i - 16 - var c3_lo = W[i - 31]; - - W[i] = sum64_4_hi( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - W[i + 1] = sum64_4_lo( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - } -}; - -SHA512.prototype._update = function _update(msg, start) { - this._prepareBlock(msg, start); - - var W = this.W; - - var ah = this.h[0]; - var al = this.h[1]; - var bh = this.h[2]; - var bl = this.h[3]; - var ch = this.h[4]; - var cl = this.h[5]; - var dh = this.h[6]; - var dl = this.h[7]; - var eh = this.h[8]; - var el = this.h[9]; - var fh = this.h[10]; - var fl = this.h[11]; - var gh = this.h[12]; - var gl = this.h[13]; - var hh = this.h[14]; - var hl = this.h[15]; - - assert(this.k.length === W.length); - for (var i = 0; i < W.length; i += 2) { - var c0_hi = hh; - var c0_lo = hl; - var c1_hi = s1_512_hi(eh, el); - var c1_lo = s1_512_lo(eh, el); - var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); - var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); - var c3_hi = this.k[i]; - var c3_lo = this.k[i + 1]; - var c4_hi = W[i]; - var c4_lo = W[i + 1]; - - var T1_hi = sum64_5_hi( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - var T1_lo = sum64_5_lo( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - - c0_hi = s0_512_hi(ah, al); - c0_lo = s0_512_lo(ah, al); - c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); - c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); - - var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); - var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); - - hh = gh; - hl = gl; - - gh = fh; - gl = fl; - - fh = eh; - fl = el; - - eh = sum64_hi(dh, dl, T1_hi, T1_lo); - el = sum64_lo(dl, dl, T1_hi, T1_lo); - - dh = ch; - dl = cl; - - ch = bh; - cl = bl; - - bh = ah; - bl = al; - - ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); - al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); - } - - sum64(this.h, 0, ah, al); - sum64(this.h, 2, bh, bl); - sum64(this.h, 4, ch, cl); - sum64(this.h, 6, dh, dl); - sum64(this.h, 8, eh, el); - sum64(this.h, 10, fh, fl); - sum64(this.h, 12, gh, gl); - sum64(this.h, 14, hh, hl); -}; - -SHA512.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; - -function ch64_hi(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ ((~xh) & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function ch64_lo(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ ((~xl) & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_hi(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_lo(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 28); - var c1_hi = rotr64_hi(xl, xh, 2); // 34 - var c2_hi = rotr64_hi(xl, xh, 7); // 39 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 28); - var c1_lo = rotr64_lo(xl, xh, 2); // 34 - var c2_lo = rotr64_lo(xl, xh, 7); // 39 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 14); - var c1_hi = rotr64_hi(xh, xl, 18); - var c2_hi = rotr64_hi(xl, xh, 9); // 41 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 14); - var c1_lo = rotr64_lo(xh, xl, 18); - var c2_lo = rotr64_lo(xl, xh, 9); // 41 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 1); - var c1_hi = rotr64_hi(xh, xl, 8); - var c2_hi = shr64_hi(xh, xl, 7); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 1); - var c1_lo = rotr64_lo(xh, xl, 8); - var c2_lo = shr64_lo(xh, xl, 7); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 19); - var c1_hi = rotr64_hi(xl, xh, 29); // 61 - var c2_hi = shr64_hi(xh, xl, 6); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 19); - var c1_lo = rotr64_lo(xl, xh, 29); // 61 - var c2_lo = shr64_lo(xh, xl, 6); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/sha/common.js": -/*!*****************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/sha/common.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/hash.js/lib/hash/utils.js"); -var rotr32 = utils.rotr32; - -function ft_1(s, x, y, z) { - if (s === 0) - return ch32(x, y, z); - if (s === 1 || s === 3) - return p32(x, y, z); - if (s === 2) - return maj32(x, y, z); -} -exports.ft_1 = ft_1; - -function ch32(x, y, z) { - return (x & y) ^ ((~x) & z); -} -exports.ch32 = ch32; - -function maj32(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); -} -exports.maj32 = maj32; - -function p32(x, y, z) { - return x ^ y ^ z; -} -exports.p32 = p32; - -function s0_256(x) { - return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); -} -exports.s0_256 = s0_256; - -function s1_256(x) { - return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); -} -exports.s1_256 = s1_256; - -function g0_256(x) { - return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); -} -exports.g0_256 = g0_256; - -function g1_256(x) { - return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); -} -exports.g1_256 = g1_256; - - -/***/ }), - -/***/ "./node_modules/hash.js/lib/hash/utils.js": -/*!************************************************!*\ - !*** ./node_modules/hash.js/lib/hash/utils.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -exports.inherits = inherits; - -function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg === 'string') { - if (!enc) { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } else if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } - } else { - for (i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - } - return res; -} -exports.toArray = toArray; - -function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -exports.toHex = toHex; - -function htonl(w) { - var res = (w >>> 24) | - ((w >>> 8) & 0xff00) | - ((w << 8) & 0xff0000) | - ((w & 0xff) << 24); - return res >>> 0; -} -exports.htonl = htonl; - -function toHex32(msg, endian) { - var res = ''; - for (var i = 0; i < msg.length; i++) { - var w = msg[i]; - if (endian === 'little') - w = htonl(w); - res += zero8(w.toString(16)); - } - return res; -} -exports.toHex32 = toHex32; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -exports.zero2 = zero2; - -function zero8(word) { - if (word.length === 7) - return '0' + word; - else if (word.length === 6) - return '00' + word; - else if (word.length === 5) - return '000' + word; - else if (word.length === 4) - return '0000' + word; - else if (word.length === 3) - return '00000' + word; - else if (word.length === 2) - return '000000' + word; - else if (word.length === 1) - return '0000000' + word; - else - return word; -} -exports.zero8 = zero8; - -function join32(msg, start, end, endian) { - var len = end - start; - assert(len % 4 === 0); - var res = new Array(len / 4); - for (var i = 0, k = start; i < res.length; i++, k += 4) { - var w; - if (endian === 'big') - w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; - else - w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; - res[i] = w >>> 0; - } - return res; -} -exports.join32 = join32; - -function split32(msg, endian) { - var res = new Array(msg.length * 4); - for (var i = 0, k = 0; i < msg.length; i++, k += 4) { - var m = msg[i]; - if (endian === 'big') { - res[k] = m >>> 24; - res[k + 1] = (m >>> 16) & 0xff; - res[k + 2] = (m >>> 8) & 0xff; - res[k + 3] = m & 0xff; - } else { - res[k + 3] = m >>> 24; - res[k + 2] = (m >>> 16) & 0xff; - res[k + 1] = (m >>> 8) & 0xff; - res[k] = m & 0xff; - } - } - return res; -} -exports.split32 = split32; - -function rotr32(w, b) { - return (w >>> b) | (w << (32 - b)); -} -exports.rotr32 = rotr32; - -function rotl32(w, b) { - return (w << b) | (w >>> (32 - b)); -} -exports.rotl32 = rotl32; - -function sum32(a, b) { - return (a + b) >>> 0; -} -exports.sum32 = sum32; - -function sum32_3(a, b, c) { - return (a + b + c) >>> 0; -} -exports.sum32_3 = sum32_3; - -function sum32_4(a, b, c, d) { - return (a + b + c + d) >>> 0; -} -exports.sum32_4 = sum32_4; - -function sum32_5(a, b, c, d, e) { - return (a + b + c + d + e) >>> 0; -} -exports.sum32_5 = sum32_5; - -function sum64(buf, pos, ah, al) { - var bh = buf[pos]; - var bl = buf[pos + 1]; - - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - buf[pos] = hi >>> 0; - buf[pos + 1] = lo; -} -exports.sum64 = sum64; - -function sum64_hi(ah, al, bh, bl) { - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - return hi >>> 0; -} -exports.sum64_hi = sum64_hi; - -function sum64_lo(ah, al, bh, bl) { - var lo = al + bl; - return lo >>> 0; -} -exports.sum64_lo = sum64_lo; - -function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - - var hi = ah + bh + ch + dh + carry; - return hi >>> 0; -} -exports.sum64_4_hi = sum64_4_hi; - -function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { - var lo = al + bl + cl + dl; - return lo >>> 0; -} -exports.sum64_4_lo = sum64_4_lo; - -function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - lo = (lo + el) >>> 0; - carry += lo < el ? 1 : 0; - - var hi = ah + bh + ch + dh + eh + carry; - return hi >>> 0; -} -exports.sum64_5_hi = sum64_5_hi; - -function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var lo = al + bl + cl + dl + el; - - return lo >>> 0; -} -exports.sum64_5_lo = sum64_5_lo; - -function rotr64_hi(ah, al, num) { - var r = (al << (32 - num)) | (ah >>> num); - return r >>> 0; -} -exports.rotr64_hi = rotr64_hi; - -function rotr64_lo(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -exports.rotr64_lo = rotr64_lo; - -function shr64_hi(ah, al, num) { - return ah >>> num; -} -exports.shr64_hi = shr64_hi; - -function shr64_lo(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -exports.shr64_lo = shr64_lo; - - -/***/ }), - -/***/ "./node_modules/hmac-drbg/lib/hmac-drbg.js": -/*!*************************************************!*\ - !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var hash = __webpack_require__(/*! hash.js */ "./node_modules/hash.js/lib/hash.js"); -var utils = __webpack_require__(/*! minimalistic-crypto-utils */ "./node_modules/minimalistic-crypto-utils/lib/utils.js"); -var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); - -function HmacDRBG(options) { - if (!(this instanceof HmacDRBG)) - return new HmacDRBG(options); - this.hash = options.hash; - this.predResist = !!options.predResist; - - this.outLen = this.hash.outSize; - this.minEntropy = options.minEntropy || this.hash.hmacStrength; - - this._reseed = null; - this.reseedInterval = null; - this.K = null; - this.V = null; - - var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex'); - var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex'); - var pers = utils.toArray(options.pers, options.persEnc || 'hex'); - assert(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - this._init(entropy, nonce, pers); -} -module.exports = HmacDRBG; - -HmacDRBG.prototype._init = function init(entropy, nonce, pers) { - var seed = entropy.concat(nonce).concat(pers); - - 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] = 0x00; - this.V[i] = 0x01; - } - - this._update(seed); - this._reseed = 1; - this.reseedInterval = 0x1000000000000; // 2^48 -}; - -HmacDRBG.prototype._hmac = function hmac() { - return new hash.hmac(this.hash, this.K); -}; - -HmacDRBG.prototype._update = function update(seed) { - var kmac = this._hmac() - .update(this.V) - .update([ 0x00 ]); - if (seed) - kmac = kmac.update(seed); - this.K = kmac.digest(); - this.V = this._hmac().update(this.V).digest(); - if (!seed) - return; - - this.K = this._hmac() - .update(this.V) - .update([ 0x01 ]) - .update(seed) - .digest(); - this.V = this._hmac().update(this.V).digest(); -}; - -HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { - // Optional entropy enc - if (typeof entropyEnc !== 'string') { - addEnc = add; - add = entropyEnc; - entropyEnc = null; - } - - entropy = utils.toArray(entropy, entropyEnc); - add = utils.toArray(add, addEnc); - - assert(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - - this._update(entropy.concat(add || [])); - this._reseed = 1; -}; - -HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { - if (this._reseed > this.reseedInterval) - throw new Error('Reseed is required'); - - // Optional encoding - if (typeof enc !== 'string') { - addEnc = add; - add = enc; - enc = null; - } - - // Optional additional data - if (add) { - add = utils.toArray(add, addEnc || 'hex'); - this._update(add); - } - - var temp = []; - while (temp.length < len) { - this.V = this._hmac().update(this.V).digest(); - temp = temp.concat(this.V); - } - - var res = temp.slice(0, len); - this._update(add); - this._reseed++; - return utils.encode(res, enc); -}; - - -/***/ }), - -/***/ "./node_modules/hoist-non-react-statics/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/hoist-non-react-statics/index.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ -(function (global, factory) { - true ? module.exports = factory() : - undefined; -}(this, (function () { - 'use strict'; - - var REACT_STATICS = { - childContextTypes: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true - }; - - var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true - }; - - var defineProperty = Object.defineProperty; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var getPrototypeOf = Object.getPrototypeOf; - var objectPrototype = getPrototypeOf && getPrototypeOf(Object); - - return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { - if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components - - if (objectPrototype) { - var inheritedComponent = getPrototypeOf(sourceComponent); - if (inheritedComponent && inheritedComponent !== objectPrototype) { - hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); - } - } - - var keys = getOwnPropertyNames(sourceComponent); - - if (getOwnPropertySymbols) { - keys = keys.concat(getOwnPropertySymbols(sourceComponent)); - } - - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { - var descriptor = getOwnPropertyDescriptor(sourceComponent, key); - try { // Avoid failures from read-only properties - defineProperty(targetComponent, key, descriptor); - } catch (e) {} - } - } - - return targetComponent; - } - - return targetComponent; - }; -}))); - - -/***/ }), - -/***/ "./node_modules/hyphenate-style-name/index.js": -/*!****************************************************!*\ - !*** ./node_modules/hyphenate-style-name/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var uppercasePattern = /[A-Z]/g; -var msPattern = /^ms-/; -var cache = {}; - -function hyphenateStyleName(string) { - return string in cache - ? cache[string] - : cache[string] = string - .replace(uppercasePattern, '-$&') - .toLowerCase() - .replace(msPattern, '-ms-'); -} - -module.exports = hyphenateStyleName; - - -/***/ }), - -/***/ "./node_modules/ieee754/index.js": -/*!***************************************!*\ - !*** ./node_modules/ieee754/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - - -/***/ }), - -/***/ "./node_modules/indexof/index.js": -/*!***************************************!*\ - !*** ./node_modules/indexof/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - - -var indexOf = [].indexOf; - -module.exports = function(arr, obj){ - if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { - if (arr[i] === obj) return i; - } - return -1; -}; - -/***/ }), - -/***/ "./node_modules/inherits/inherits_browser.js": -/*!***************************************************!*\ - !*** ./node_modules/inherits/inherits_browser.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - - -/***/ }), - -/***/ "./node_modules/is-function/index.js": -/*!*******************************************!*\ - !*** ./node_modules/is-function/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = isFunction - -var toString = Object.prototype.toString - -function isFunction (fn) { - var string = toString.call(fn) - return string === '[object Function]' || - (typeof fn === 'function' && string !== '[object RegExp]') || - (typeof window !== 'undefined' && - // IE8 and below - (fn === window.setTimeout || - fn === window.alert || - fn === window.confirm || - fn === window.prompt)) -}; - - -/***/ }), - -/***/ "./node_modules/is-hex-prefixed/src/index.js": -/*!***************************************************!*\ - !*** ./node_modules/is-hex-prefixed/src/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Returns a `Boolean` on whether or not the a `String` starts with '0x' - * @param {String} str the string input value - * @return {Boolean} a boolean if it is or is not hex prefixed - * @throws if the str input is not a string - */ -module.exports = function isHexPrefixed(str) { - if (typeof str !== 'string') { - throw new Error("[is-hex-prefixed] value must be type 'string', is currently type " + (typeof str) + ", while checking isHexPrefixed."); - } - - return str.slice(0, 2) === '0x'; -} - - -/***/ }), - -/***/ "./node_modules/is-in-browser/dist/module.js": -/*!***************************************************!*\ - !*** ./node_modules/is-in-browser/dist/module.js ***! - \***************************************************/ -/*! exports provided: isBrowser, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return isBrowser; }); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9; - -/* harmony default export */ __webpack_exports__["default"] = (isBrowser); - - -/***/ }), - -/***/ "./node_modules/json-schema-traverse/index.js": -/*!****************************************************!*\ - !*** ./node_modules/json-schema-traverse/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var traverse = module.exports = function (schema, opts, cb) { - if (typeof opts == 'function') { - cb = opts; - opts = {}; - } - _traverse(opts, cb, schema, '', schema); -}; - - -traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true -}; - -traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true -}; - -traverse.propsKeywords = { - definitions: true, - properties: true, - patternProperties: true, - dependencies: true -}; - -traverse.skipKeywords = { - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true -}; - - -function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : {}; - - var camelCasedOptions = addCamelCasedVersion(options); - - function onProcessStyle(style, rule) { - if (rule.type !== 'style') return style; - - for (var prop in style) { - style[prop] = iterate(prop, style[prop], camelCasedOptions); - } - - return style; - } - - function onChangeValue(value, prop) { - return iterate(prop, value, camelCasedOptions); - } - - return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; -} - -/***/ }), - -/***/ "./node_modules/jss-global/lib/index.js": -/*!**********************************************!*\ - !*** ./node_modules/jss-global/lib/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports['default'] = jssGlobal; - -var _jss = __webpack_require__(/*! jss */ "./node_modules/jss/lib/index.js"); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var propKey = '@global'; -var prefixKey = '@global '; - -var GlobalContainerRule = function () { - function GlobalContainerRule(key, styles, options) { - _classCallCheck(this, GlobalContainerRule); - - this.type = 'global'; - - this.key = key; - this.options = options; - this.rules = new _jss.RuleList(_extends({}, options, { - parent: this - })); - - for (var selector in styles) { - this.rules.add(selector, styles[selector], { selector: selector }); - } - - this.rules.process(); - } - - /** - * Get a rule. - */ - - - _createClass(GlobalContainerRule, [{ - key: 'getRule', - value: function getRule(name) { - return this.rules.get(name); - } - - /** - * Create and register rule, run plugins. - */ - - }, { - key: 'addRule', - value: function addRule(name, style, options) { - var rule = this.rules.add(name, style, options); - this.options.jss.plugins.onProcessRule(rule); - return rule; - } - - /** - * Get index of a rule. - */ - - }, { - key: 'indexOf', - value: function indexOf(rule) { - return this.rules.indexOf(rule); - } - - /** - * Generates a CSS string. - */ - - }, { - key: 'toString', - value: function toString() { - return this.rules.toString(); - } - }]); - - return GlobalContainerRule; -}(); - -var GlobalPrefixedRule = function () { - function GlobalPrefixedRule(name, style, options) { - _classCallCheck(this, GlobalPrefixedRule); - - this.name = name; - this.options = options; - var selector = name.substr(prefixKey.length); - this.rule = options.jss.createRule(selector, style, _extends({}, options, { - parent: this, - selector: selector - })); - } - - _createClass(GlobalPrefixedRule, [{ - key: 'toString', - value: function toString(options) { - return this.rule.toString(options); - } - }]); - - return GlobalPrefixedRule; -}(); - -var separatorRegExp = /\s*,\s*/g; - -function addScope(selector, scope) { - var parts = selector.split(separatorRegExp); - var scoped = ''; - for (var i = 0; i < parts.length; i++) { - scoped += scope + ' ' + parts[i].trim(); - if (parts[i + 1]) scoped += ', '; - } - return scoped; -} - -function handleNestedGlobalContainerRule(rule) { - var options = rule.options, - style = rule.style; - - var rules = style[propKey]; - - if (!rules) return; - - for (var name in rules) { - options.sheet.addRule(name, rules[name], _extends({}, options, { - selector: addScope(name, rule.selector) - })); - } - - delete style[propKey]; -} - -function handlePrefixedGlobalRule(rule) { - var options = rule.options, - style = rule.style; - - for (var prop in style) { - if (prop.substr(0, propKey.length) !== propKey) continue; - - var selector = addScope(prop.substr(propKey.length), rule.selector); - options.sheet.addRule(selector, style[prop], _extends({}, options, { - selector: selector - })); - delete style[prop]; - } -} - -/** - * Convert nested rules to separate, remove them from original styles. - * - * @param {Rule} rule - * @api public - */ -function jssGlobal() { - function onCreateRule(name, styles, options) { - if (name === propKey) { - return new GlobalContainerRule(name, styles, options); - } - - if (name[0] === '@' && name.substr(0, prefixKey.length) === prefixKey) { - return new GlobalPrefixedRule(name, styles, options); - } - - var parent = options.parent; - - - if (parent) { - if (parent.type === 'global' || parent.options.parent.type === 'global') { - options.global = true; - } - } - - if (options.global) options.selector = name; - - return null; - } - - function onProcessRule(rule) { - if (rule.type !== 'style') return; - - handleNestedGlobalContainerRule(rule); - handlePrefixedGlobalRule(rule); - } - - return { onCreateRule: onCreateRule, onProcessRule: onProcessRule }; -} - -/***/ }), - -/***/ "./node_modules/jss-nested/lib/index.js": -/*!**********************************************!*\ - !*** ./node_modules/jss-nested/lib/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -exports.default = jssNested; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var separatorRegExp = /\s*,\s*/g; -var parentRegExp = /&/g; -var refRegExp = /\$([\w-]+)/g; - -/** - * Convert nested rules to separate, remove them from original styles. - * - * @param {Rule} rule - * @api public - */ -function jssNested() { - // Get a function to be used for $ref replacement. - function getReplaceRef(container) { - return function (match, key) { - var rule = container.getRule(key); - if (rule) return rule.selector; - (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container); - return key; - }; - } - - var hasAnd = function hasAnd(str) { - return str.indexOf('&') !== -1; - }; - - function replaceParentRefs(nestedProp, parentProp) { - var parentSelectors = parentProp.split(separatorRegExp); - var nestedSelectors = nestedProp.split(separatorRegExp); - - var result = ''; - - for (var i = 0; i < parentSelectors.length; i++) { - var parent = parentSelectors[i]; - - for (var j = 0; j < nestedSelectors.length; j++) { - var nested = nestedSelectors[j]; - if (result) result += ', '; - // Replace all & by the parent or prefix & with the parent. - result += hasAnd(nested) ? nested.replace(parentRegExp, parent) : parent + ' ' + nested; - } - } - - return result; - } - - function getOptions(rule, container, options) { - // Options has been already created, now we only increase index. - if (options) return _extends({}, options, { index: options.index + 1 }); - - var nestingLevel = rule.options.nestingLevel; - - nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1; - - return _extends({}, rule.options, { - nestingLevel: nestingLevel, - index: container.indexOf(rule) + 1 - }); - } - - function onProcessStyle(style, rule) { - if (rule.type !== 'style') return style; - var container = rule.options.parent; - var options = void 0; - var replaceRef = void 0; - for (var prop in style) { - var isNested = hasAnd(prop); - var isNestedConditional = prop[0] === '@'; - - if (!isNested && !isNestedConditional) continue; - - options = getOptions(rule, container, options); - - if (isNested) { - var selector = replaceParentRefs(prop, rule.selector - // Lazily create the ref replacer function just once for - // all nested rules within the sheet. - );if (!replaceRef) replaceRef = getReplaceRef(container - // Replace all $refs. - );selector = selector.replace(refRegExp, replaceRef); - - container.addRule(selector, style[prop], _extends({}, options, { selector: selector })); - } else if (isNestedConditional) { - container - // Place conditional right after the parent rule to ensure right ordering. - .addRule(prop, null, options).addRule(rule.key, style[prop], { selector: rule.selector }); - } - - delete style[prop]; - } - - return style; - } - - return { onProcessStyle: onProcessStyle }; -} - -/***/ }), - -/***/ "./node_modules/jss-props-sort/lib/index.js": -/*!**************************************************!*\ - !*** ./node_modules/jss-props-sort/lib/index.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = jssPropsSort; -/** - * Sort props by length. - */ -function jssPropsSort() { - function sort(prop0, prop1) { - return prop0.length - prop1.length; - } - - function onProcessStyle(style, rule) { - if (rule.type !== 'style') return style; - - var newStyle = {}; - var props = Object.keys(style).sort(sort); - for (var prop in props) { - newStyle[props[prop]] = style[props[prop]]; - } - return newStyle; - } - - return { onProcessStyle: onProcessStyle }; -} - -/***/ }), - -/***/ "./node_modules/jss-vendor-prefixer/lib/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/jss-vendor-prefixer/lib/index.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = jssVendorPrefixer; - -var _cssVendor = __webpack_require__(/*! css-vendor */ "./node_modules/css-vendor/lib/index.js"); - -var vendor = _interopRequireWildcard(_cssVendor); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - -/** - * Add vendor prefix to a property name when needed. - * - * @param {Rule} rule - * @api public - */ -function jssVendorPrefixer() { - function onProcessRule(rule) { - if (rule.type === 'keyframes') { - rule.key = '@' + vendor.prefix.css + rule.key.substr(1); - } - } - - function onProcessStyle(style, rule) { - if (rule.type !== 'style') return style; - - for (var prop in style) { - var value = style[prop]; - - var changeProp = false; - var supportedProp = vendor.supportedProperty(prop); - if (supportedProp && supportedProp !== prop) changeProp = true; - - var changeValue = false; - var supportedValue = vendor.supportedValue(supportedProp, value); - if (supportedValue && supportedValue !== value) changeValue = true; - - if (changeProp || changeValue) { - if (changeProp) delete style[prop]; - style[supportedProp || prop] = supportedValue || value; - } - } - - return style; - } - - function onChangeValue(value, prop) { - return vendor.supportedValue(prop, value); - } - - return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; -} - -/***/ }), - -/***/ "./node_modules/jss/lib/Jss.js": -/*!*************************************!*\ - !*** ./node_modules/jss/lib/Jss.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _isInBrowser = __webpack_require__(/*! is-in-browser */ "./node_modules/is-in-browser/dist/module.js"); - -var _isInBrowser2 = _interopRequireDefault(_isInBrowser); - -var _StyleSheet = __webpack_require__(/*! ./StyleSheet */ "./node_modules/jss/lib/StyleSheet.js"); - -var _StyleSheet2 = _interopRequireDefault(_StyleSheet); - -var _PluginsRegistry = __webpack_require__(/*! ./PluginsRegistry */ "./node_modules/jss/lib/PluginsRegistry.js"); - -var _PluginsRegistry2 = _interopRequireDefault(_PluginsRegistry); - -var _rules = __webpack_require__(/*! ./plugins/rules */ "./node_modules/jss/lib/plugins/rules.js"); - -var _rules2 = _interopRequireDefault(_rules); - -var _observables = __webpack_require__(/*! ./plugins/observables */ "./node_modules/jss/lib/plugins/observables.js"); - -var _observables2 = _interopRequireDefault(_observables); - -var _functions = __webpack_require__(/*! ./plugins/functions */ "./node_modules/jss/lib/plugins/functions.js"); - -var _functions2 = _interopRequireDefault(_functions); - -var _sheets = __webpack_require__(/*! ./sheets */ "./node_modules/jss/lib/sheets.js"); - -var _sheets2 = _interopRequireDefault(_sheets); - -var _StyleRule = __webpack_require__(/*! ./rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _createGenerateClassName = __webpack_require__(/*! ./utils/createGenerateClassName */ "./node_modules/jss/lib/utils/createGenerateClassName.js"); - -var _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName); - -var _createRule2 = __webpack_require__(/*! ./utils/createRule */ "./node_modules/jss/lib/utils/createRule.js"); - -var _createRule3 = _interopRequireDefault(_createRule2); - -var _DomRenderer = __webpack_require__(/*! ./renderers/DomRenderer */ "./node_modules/jss/lib/renderers/DomRenderer.js"); - -var _DomRenderer2 = _interopRequireDefault(_DomRenderer); - -var _VirtualRenderer = __webpack_require__(/*! ./renderers/VirtualRenderer */ "./node_modules/jss/lib/renderers/VirtualRenderer.js"); - -var _VirtualRenderer2 = _interopRequireDefault(_VirtualRenderer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var defaultPlugins = _rules2['default'].concat([_observables2['default'], _functions2['default']]); - -var instanceCounter = 0; - -var Jss = function () { - function Jss(options) { - _classCallCheck(this, Jss); - - this.id = instanceCounter++; - this.version = "9.8.0"; - this.plugins = new _PluginsRegistry2['default'](); - this.options = { - createGenerateClassName: _createGenerateClassName2['default'], - Renderer: _isInBrowser2['default'] ? _DomRenderer2['default'] : _VirtualRenderer2['default'], - plugins: [] - }; - this.generateClassName = (0, _createGenerateClassName2['default'])(); - - // eslint-disable-next-line prefer-spread - this.use.apply(this, defaultPlugins); - this.setup(options); - } - - _createClass(Jss, [{ - key: 'setup', - value: function setup() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (options.createGenerateClassName) { - this.options.createGenerateClassName = options.createGenerateClassName; - // $FlowFixMe - this.generateClassName = options.createGenerateClassName(); - } - - if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint; - if (options.virtual || options.Renderer) { - this.options.Renderer = options.Renderer || (options.virtual ? _VirtualRenderer2['default'] : _DomRenderer2['default']); - } - - // eslint-disable-next-line prefer-spread - if (options.plugins) this.use.apply(this, options.plugins); - - return this; - } - - /** - * Create a Style Sheet. - */ - - }, { - key: 'createStyleSheet', - value: function createStyleSheet(styles) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var index = options.index; - if (typeof index !== 'number') { - index = _sheets2['default'].index === 0 ? 0 : _sheets2['default'].index + 1; - } - var sheet = new _StyleSheet2['default'](styles, _extends({}, options, { - jss: this, - generateClassName: options.generateClassName || this.generateClassName, - insertionPoint: this.options.insertionPoint, - Renderer: this.options.Renderer, - index: index - })); - this.plugins.onProcessSheet(sheet); - - return sheet; - } - - /** - * Detach the Style Sheet and remove it from the registry. - */ - - }, { - key: 'removeStyleSheet', - value: function removeStyleSheet(sheet) { - sheet.detach(); - _sheets2['default'].remove(sheet); - return this; - } - - /** - * Create a rule without a Style Sheet. - */ - - }, { - key: 'createRule', - value: function createRule(name) { - var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - // Enable rule without name for inline styles. - if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { - options = style; - style = name; - name = undefined; - } - - // Cast from RuleFactoryOptions to RuleOptions - // https://stackoverflow.com/questions/41328728/force-casting-in-flow - var ruleOptions = options; - - ruleOptions.jss = this; - ruleOptions.Renderer = this.options.Renderer; - if (!ruleOptions.generateClassName) ruleOptions.generateClassName = this.generateClassName; - if (!ruleOptions.classes) ruleOptions.classes = {}; - var rule = (0, _createRule3['default'])(name, style, ruleOptions); - - if (!ruleOptions.selector && rule instanceof _StyleRule2['default']) { - rule.selector = '.' + ruleOptions.generateClassName(rule); - } - - this.plugins.onProcessRule(rule); - - return rule; - } - - /** - * Register plugin. Passed function will be invoked with a rule instance. - */ - - }, { - key: 'use', - value: function use() { - var _this = this; - - for (var _len = arguments.length, plugins = Array(_len), _key = 0; _key < _len; _key++) { - plugins[_key] = arguments[_key]; - } - - plugins.forEach(function (plugin) { - // Avoids applying same plugin twice, at least based on ref. - if (_this.options.plugins.indexOf(plugin) === -1) { - _this.options.plugins.push(plugin); - _this.plugins.use(plugin); - } - }); - - return this; - } - }]); - - return Jss; -}(); - -exports['default'] = Jss; - -/***/ }), - -/***/ "./node_modules/jss/lib/PluginsRegistry.js": -/*!*************************************************!*\ - !*** ./node_modules/jss/lib/PluginsRegistry.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var PluginsRegistry = function () { - function PluginsRegistry() { - _classCallCheck(this, PluginsRegistry); - - this.hooks = { - onCreateRule: [], - onProcessRule: [], - onProcessStyle: [], - onProcessSheet: [], - onChangeValue: [], - onUpdate: [] - - /** - * Call `onCreateRule` hooks and return an object if returned by a hook. - */ - }; - } - - _createClass(PluginsRegistry, [{ - key: 'onCreateRule', - value: function onCreateRule(name, decl, options) { - for (var i = 0; i < this.hooks.onCreateRule.length; i++) { - var rule = this.hooks.onCreateRule[i](name, decl, options); - if (rule) return rule; - } - return null; - } - - /** - * Call `onProcessRule` hooks. - */ - - }, { - key: 'onProcessRule', - value: function onProcessRule(rule) { - if (rule.isProcessed) return; - var sheet = rule.options.sheet; - - for (var i = 0; i < this.hooks.onProcessRule.length; i++) { - this.hooks.onProcessRule[i](rule, sheet); - } - - // $FlowFixMe - if (rule.style) this.onProcessStyle(rule.style, rule, sheet); - - rule.isProcessed = true; - } - - /** - * Call `onProcessStyle` hooks. - */ - - }, { - key: 'onProcessStyle', - value: function onProcessStyle(style, rule, sheet) { - var nextStyle = style; - - for (var i = 0; i < this.hooks.onProcessStyle.length; i++) { - nextStyle = this.hooks.onProcessStyle[i](nextStyle, rule, sheet); - // $FlowFixMe - rule.style = nextStyle; - } - } - - /** - * Call `onProcessSheet` hooks. - */ - - }, { - key: 'onProcessSheet', - value: function onProcessSheet(sheet) { - for (var i = 0; i < this.hooks.onProcessSheet.length; i++) { - this.hooks.onProcessSheet[i](sheet); - } - } - - /** - * Call `onUpdate` hooks. - */ - - }, { - key: 'onUpdate', - value: function onUpdate(data, rule, sheet) { - for (var i = 0; i < this.hooks.onUpdate.length; i++) { - this.hooks.onUpdate[i](data, rule, sheet); - } - } - - /** - * Call `onChangeValue` hooks. - */ - - }, { - key: 'onChangeValue', - value: function onChangeValue(value, prop, rule) { - var processedValue = value; - for (var i = 0; i < this.hooks.onChangeValue.length; i++) { - processedValue = this.hooks.onChangeValue[i](processedValue, prop, rule); - } - return processedValue; - } - - /** - * Register a plugin. - * If function is passed, it is a shortcut for `{onProcessRule}`. - */ - - }, { - key: 'use', - value: function use(plugin) { - for (var name in plugin) { - if (this.hooks[name]) this.hooks[name].push(plugin[name]);else (0, _warning2['default'])(false, '[JSS] Unknown hook "%s".', name); - } - } - }]); - - return PluginsRegistry; -}(); - -exports['default'] = PluginsRegistry; - -/***/ }), - -/***/ "./node_modules/jss/lib/RuleList.js": -/*!******************************************!*\ - !*** ./node_modules/jss/lib/RuleList.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _createRule = __webpack_require__(/*! ./utils/createRule */ "./node_modules/jss/lib/utils/createRule.js"); - -var _createRule2 = _interopRequireDefault(_createRule); - -var _linkRule = __webpack_require__(/*! ./utils/linkRule */ "./node_modules/jss/lib/utils/linkRule.js"); - -var _linkRule2 = _interopRequireDefault(_linkRule); - -var _StyleRule = __webpack_require__(/*! ./rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _escape = __webpack_require__(/*! ./utils/escape */ "./node_modules/jss/lib/utils/escape.js"); - -var _escape2 = _interopRequireDefault(_escape); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Contains rules objects and allows adding/removing etc. - * Is used for e.g. by `StyleSheet` or `ConditionalRule`. - */ -var RuleList = function () { - - // Original styles object. - function RuleList(options) { - _classCallCheck(this, RuleList); - - this.map = {}; - this.raw = {}; - this.index = []; - - this.options = options; - this.classes = options.classes; - } - - /** - * Create and register rule. - * - * Will not render after Style Sheet was rendered the first time. - */ - - - // Used to ensure correct rules order. - - // Rules registry for access by .get() method. - // It contains the same rule registered by name and by selector. - - - _createClass(RuleList, [{ - key: 'add', - value: function add(name, decl, options) { - var _options = this.options, - parent = _options.parent, - sheet = _options.sheet, - jss = _options.jss, - Renderer = _options.Renderer, - generateClassName = _options.generateClassName; - - - options = _extends({ - classes: this.classes, - parent: parent, - sheet: sheet, - jss: jss, - Renderer: Renderer, - generateClassName: generateClassName - }, options); - - if (!options.selector && this.classes[name]) { - options.selector = '.' + (0, _escape2['default'])(this.classes[name]); - } - - this.raw[name] = decl; - - var rule = (0, _createRule2['default'])(name, decl, options); - - var className = void 0; - - if (!options.selector && rule instanceof _StyleRule2['default']) { - className = generateClassName(rule, sheet); - rule.selector = '.' + (0, _escape2['default'])(className); - } - - this.register(rule, className); - - var index = options.index === undefined ? this.index.length : options.index; - this.index.splice(index, 0, rule); - - return rule; - } - - /** - * Get a rule. - */ - - }, { - key: 'get', - value: function get(name) { - return this.map[name]; - } - - /** - * Delete a rule. - */ - - }, { - key: 'remove', - value: function remove(rule) { - this.unregister(rule); - this.index.splice(this.indexOf(rule), 1); - } - - /** - * Get index of a rule. - */ - - }, { - key: 'indexOf', - value: function indexOf(rule) { - return this.index.indexOf(rule); - } - - /** - * Run `onProcessRule()` plugins on every rule. - */ - - }, { - key: 'process', - value: function process() { - var plugins = this.options.jss.plugins; - // We need to clone array because if we modify the index somewhere else during a loop - // we end up with very hard-to-track-down side effects. - - this.index.slice(0).forEach(plugins.onProcessRule, plugins); - } - - /** - * Register a rule in `.map` and `.classes` maps. - */ - - }, { - key: 'register', - value: function register(rule, className) { - this.map[rule.key] = rule; - if (rule instanceof _StyleRule2['default']) { - this.map[rule.selector] = rule; - if (className) this.classes[rule.key] = className; - } - } - - /** - * Unregister a rule. - */ - - }, { - key: 'unregister', - value: function unregister(rule) { - delete this.map[rule.key]; - if (rule instanceof _StyleRule2['default']) { - delete this.map[rule.selector]; - delete this.classes[rule.key]; - } - } - - /** - * Update the function values with a new data. - */ - - }, { - key: 'update', - value: function update(name, data) { - var _options2 = this.options, - plugins = _options2.jss.plugins, - sheet = _options2.sheet; - - if (typeof name === 'string') { - plugins.onUpdate(data, this.get(name), sheet); - return; - } - - for (var index = 0; index < this.index.length; index++) { - plugins.onUpdate(name, this.index[index], sheet); - } - } - - /** - * Link renderable rules with CSSRuleList. - */ - - }, { - key: 'link', - value: function link(cssRules) { - var map = this.options.sheet.renderer.getUnescapedKeysMap(this.index); - - for (var i = 0; i < cssRules.length; i++) { - var cssRule = cssRules[i]; - var _key = this.options.sheet.renderer.getKey(cssRule); - if (map[_key]) _key = map[_key]; - var rule = this.map[_key]; - if (rule) (0, _linkRule2['default'])(rule, cssRule); - } - } - - /** - * Convert rules to a CSS string. - */ - - }, { - key: 'toString', - value: function toString(options) { - var str = ''; - var sheet = this.options.sheet; - - var link = sheet ? sheet.options.link : false; - - for (var index = 0; index < this.index.length; index++) { - var rule = this.index[index]; - var css = rule.toString(options); - - // No need to render an empty rule. - if (!css && !link) continue; - - if (str) str += '\n'; - str += css; - } - - return str; - } - }]); - - return RuleList; -}(); - -exports['default'] = RuleList; - -/***/ }), - -/***/ "./node_modules/jss/lib/SheetsManager.js": -/*!***********************************************!*\ - !*** ./node_modules/jss/lib/SheetsManager.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * SheetsManager is like a WeakMap which is designed to count StyleSheet - * instances and attach/detach automatically. - */ -var SheetsManager = function () { - function SheetsManager() { - _classCallCheck(this, SheetsManager); - - this.sheets = []; - this.refs = []; - this.keys = []; - } - - _createClass(SheetsManager, [{ - key: 'get', - value: function get(key) { - var index = this.keys.indexOf(key); - return this.sheets[index]; - } - }, { - key: 'add', - value: function add(key, sheet) { - var sheets = this.sheets, - refs = this.refs, - keys = this.keys; - - var index = sheets.indexOf(sheet); - - if (index !== -1) return index; - - sheets.push(sheet); - refs.push(0); - keys.push(key); - - return sheets.length - 1; - } - }, { - key: 'manage', - value: function manage(key) { - var index = this.keys.indexOf(key); - var sheet = this.sheets[index]; - if (this.refs[index] === 0) sheet.attach(); - this.refs[index]++; - if (!this.keys[index]) this.keys.splice(index, 0, key); - return sheet; - } - }, { - key: 'unmanage', - value: function unmanage(key) { - var index = this.keys.indexOf(key); - if (index === -1) { - // eslint-ignore-next-line no-console - (0, _warning2['default'])(false, "SheetsManager: can't find sheet to unmanage"); - return; - } - if (this.refs[index] > 0) { - this.refs[index]--; - if (this.refs[index] === 0) this.sheets[index].detach(); - } - } - }, { - key: 'size', - get: function get() { - return this.keys.length; - } - }]); - - return SheetsManager; -}(); - -exports['default'] = SheetsManager; - -/***/ }), - -/***/ "./node_modules/jss/lib/SheetsRegistry.js": -/*!************************************************!*\ - !*** ./node_modules/jss/lib/SheetsRegistry.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Sheets registry to access them all at one place. - */ -var SheetsRegistry = function () { - function SheetsRegistry() { - _classCallCheck(this, SheetsRegistry); - - this.registry = []; - } - - _createClass(SheetsRegistry, [{ - key: 'add', - - - /** - * Register a Style Sheet. - */ - value: function add(sheet) { - var registry = this.registry; - var index = sheet.options.index; - - - if (registry.indexOf(sheet) !== -1) return; - - if (registry.length === 0 || index >= this.index) { - registry.push(sheet); - return; - } - - // Find a position. - for (var i = 0; i < registry.length; i++) { - if (registry[i].options.index > index) { - registry.splice(i, 0, sheet); - return; - } - } - } - - /** - * Reset the registry. - */ - - }, { - key: 'reset', - value: function reset() { - this.registry = []; - } - - /** - * Remove a Style Sheet. - */ - - }, { - key: 'remove', - value: function remove(sheet) { - var index = this.registry.indexOf(sheet); - this.registry.splice(index, 1); - } - - /** - * Convert all attached sheets to a CSS string. - */ - - }, { - key: 'toString', - value: function toString(options) { - return this.registry.filter(function (sheet) { - return sheet.attached; - }).map(function (sheet) { - return sheet.toString(options); - }).join('\n'); - } - }, { - key: 'index', - - - /** - * Current highest index number. - */ - get: function get() { - return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index; - } - }]); - - return SheetsRegistry; -}(); - -exports['default'] = SheetsRegistry; - -/***/ }), - -/***/ "./node_modules/jss/lib/StyleSheet.js": -/*!********************************************!*\ - !*** ./node_modules/jss/lib/StyleSheet.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _linkRule = __webpack_require__(/*! ./utils/linkRule */ "./node_modules/jss/lib/utils/linkRule.js"); - -var _linkRule2 = _interopRequireDefault(_linkRule); - -var _RuleList = __webpack_require__(/*! ./RuleList */ "./node_modules/jss/lib/RuleList.js"); - -var _RuleList2 = _interopRequireDefault(_RuleList); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var StyleSheet = function () { - function StyleSheet(styles, options) { - _classCallCheck(this, StyleSheet); - - this.attached = false; - this.deployed = false; - this.linked = false; - this.classes = {}; - this.options = _extends({}, options, { - sheet: this, - parent: this, - classes: this.classes - }); - this.renderer = new options.Renderer(this); - this.rules = new _RuleList2['default'](this.options); - - for (var name in styles) { - this.rules.add(name, styles[name]); - } - - this.rules.process(); - } - - /** - * Attach renderable to the render tree. - */ - - - _createClass(StyleSheet, [{ - key: 'attach', - value: function attach() { - if (this.attached) return this; - if (!this.deployed) this.deploy(); - this.renderer.attach(); - if (!this.linked && this.options.link) this.link(); - this.attached = true; - return this; - } - - /** - * Remove renderable from render tree. - */ - - }, { - key: 'detach', - value: function detach() { - if (!this.attached) return this; - this.renderer.detach(); - this.attached = false; - return this; - } - - /** - * Add a rule to the current stylesheet. - * Will insert a rule also after the stylesheet has been rendered first time. - */ - - }, { - key: 'addRule', - value: function addRule(name, decl, options) { - var queue = this.queue; - - // Plugins can create rules. - // In order to preserve the right order, we need to queue all `.addRule` calls, - // which happen after the first `rules.add()` call. - - if (this.attached && !queue) this.queue = []; - - var rule = this.rules.add(name, decl, options); - this.options.jss.plugins.onProcessRule(rule); - - if (this.attached) { - if (!this.deployed) return rule; - // Don't insert rule directly if there is no stringified version yet. - // It will be inserted all together when .attach is called. - if (queue) queue.push(rule);else { - this.insertRule(rule); - if (this.queue) { - this.queue.forEach(this.insertRule, this); - this.queue = undefined; - } - } - return rule; - } - - // We can't add rules to a detached style node. - // We will redeploy the sheet once user will attach it. - this.deployed = false; - - return rule; - } - - /** - * Insert rule into the StyleSheet - */ - - }, { - key: 'insertRule', - value: function insertRule(rule) { - var renderable = this.renderer.insertRule(rule); - if (renderable && this.options.link) (0, _linkRule2['default'])(rule, renderable); - } - - /** - * Create and add rules. - * Will render also after Style Sheet was rendered the first time. - */ - - }, { - key: 'addRules', - value: function addRules(styles, options) { - var added = []; - for (var name in styles) { - added.push(this.addRule(name, styles[name], options)); - } - return added; - } - - /** - * Get a rule by name. - */ - - }, { - key: 'getRule', - value: function getRule(name) { - return this.rules.get(name); - } - - /** - * Delete a rule by name. - * Returns `true`: if rule has been deleted from the DOM. - */ - - }, { - key: 'deleteRule', - value: function deleteRule(name) { - var rule = this.rules.get(name); - - if (!rule) return false; - - this.rules.remove(rule); - - if (this.attached && rule.renderable) { - return this.renderer.deleteRule(rule.renderable); - } - - return true; - } - - /** - * Get index of a rule. - */ - - }, { - key: 'indexOf', - value: function indexOf(rule) { - return this.rules.indexOf(rule); - } - - /** - * Deploy pure CSS string to a renderable. - */ - - }, { - key: 'deploy', - value: function deploy() { - this.renderer.deploy(); - this.deployed = true; - return this; - } - - /** - * Link renderable CSS rules from sheet with their corresponding models. - */ - - }, { - key: 'link', - value: function link() { - var cssRules = this.renderer.getRules(); - - // Is undefined when VirtualRenderer is used. - if (cssRules) this.rules.link(cssRules); - this.linked = true; - return this; - } - - /** - * Update the function values with a new data. - */ - - }, { - key: 'update', - value: function update(name, data) { - this.rules.update(name, data); - return this; - } - - /** - * Convert rules to a CSS string. - */ - - }, { - key: 'toString', - value: function toString(options) { - return this.rules.toString(options); - } - }]); - - return StyleSheet; -}(); - -exports['default'] = StyleSheet; - -/***/ }), - -/***/ "./node_modules/jss/lib/index.js": -/*!***************************************!*\ - !*** ./node_modules/jss/lib/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.create = exports.createGenerateClassName = exports.sheets = exports.RuleList = exports.SheetsManager = exports.SheetsRegistry = exports.toCssValue = exports.getDynamicStyles = undefined; - -var _getDynamicStyles = __webpack_require__(/*! ./utils/getDynamicStyles */ "./node_modules/jss/lib/utils/getDynamicStyles.js"); - -Object.defineProperty(exports, 'getDynamicStyles', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_getDynamicStyles)['default']; - } -}); - -var _toCssValue = __webpack_require__(/*! ./utils/toCssValue */ "./node_modules/jss/lib/utils/toCssValue.js"); - -Object.defineProperty(exports, 'toCssValue', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_toCssValue)['default']; - } -}); - -var _SheetsRegistry = __webpack_require__(/*! ./SheetsRegistry */ "./node_modules/jss/lib/SheetsRegistry.js"); - -Object.defineProperty(exports, 'SheetsRegistry', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_SheetsRegistry)['default']; - } -}); - -var _SheetsManager = __webpack_require__(/*! ./SheetsManager */ "./node_modules/jss/lib/SheetsManager.js"); - -Object.defineProperty(exports, 'SheetsManager', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_SheetsManager)['default']; - } -}); - -var _RuleList = __webpack_require__(/*! ./RuleList */ "./node_modules/jss/lib/RuleList.js"); - -Object.defineProperty(exports, 'RuleList', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_RuleList)['default']; - } -}); - -var _sheets = __webpack_require__(/*! ./sheets */ "./node_modules/jss/lib/sheets.js"); - -Object.defineProperty(exports, 'sheets', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_sheets)['default']; - } -}); - -var _createGenerateClassName = __webpack_require__(/*! ./utils/createGenerateClassName */ "./node_modules/jss/lib/utils/createGenerateClassName.js"); - -Object.defineProperty(exports, 'createGenerateClassName', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_createGenerateClassName)['default']; - } -}); - -var _Jss = __webpack_require__(/*! ./Jss */ "./node_modules/jss/lib/Jss.js"); - -var _Jss2 = _interopRequireDefault(_Jss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -/** - * Creates a new instance of Jss. - */ -var create = exports.create = function create(options) { - return new _Jss2['default'](options); -}; - -/** - * A global Jss instance. - */ -exports['default'] = create(); - -/***/ }), - -/***/ "./node_modules/jss/lib/plugins/functions.js": -/*!***************************************************!*\ - !*** ./node_modules/jss/lib/plugins/functions.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _RuleList = __webpack_require__(/*! ../RuleList */ "./node_modules/jss/lib/RuleList.js"); - -var _RuleList2 = _interopRequireDefault(_RuleList); - -var _StyleRule = __webpack_require__(/*! ../rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _createRule = __webpack_require__(/*! ../utils/createRule */ "./node_modules/jss/lib/utils/createRule.js"); - -var _createRule2 = _interopRequireDefault(_createRule); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -// A symbol replacement. -var now = Date.now(); - -var fnValuesNs = 'fnValues' + now; -var fnStyleNs = 'fnStyle' + ++now; - -exports['default'] = { - onCreateRule: function onCreateRule(name, decl, options) { - if (typeof decl !== 'function') return null; - var rule = (0, _createRule2['default'])(name, {}, options); - rule[fnStyleNs] = decl; - return rule; - }, - onProcessStyle: function onProcessStyle(style, rule) { - var fn = {}; - for (var prop in style) { - var value = style[prop]; - if (typeof value !== 'function') continue; - delete style[prop]; - fn[prop] = value; - } - rule = rule; - rule[fnValuesNs] = fn; - return style; - }, - onUpdate: function onUpdate(data, rule) { - // It is a rules container like for e.g. ConditionalRule. - if (rule.rules instanceof _RuleList2['default']) { - rule.rules.update(data); - return; - } - if (!(rule instanceof _StyleRule2['default'])) return; - - rule = rule; - - // If we have a fn values map, it is a rule with function values. - if (rule[fnValuesNs]) { - for (var prop in rule[fnValuesNs]) { - rule.prop(prop, rule[fnValuesNs][prop](data)); - } - } - - rule = rule; - - var fnStyle = rule[fnStyleNs]; - - // If we have a style function, the entire rule is dynamic and style object - // will be returned from that function. - if (fnStyle) { - var style = fnStyle(data); - for (var _prop in style) { - rule.prop(_prop, style[_prop]); - } - } - } -}; - -/***/ }), - -/***/ "./node_modules/jss/lib/plugins/observables.js": -/*!*****************************************************!*\ - !*** ./node_modules/jss/lib/plugins/observables.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _StyleRule = __webpack_require__(/*! ../rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _createRule = __webpack_require__(/*! ../utils/createRule */ "./node_modules/jss/lib/utils/createRule.js"); - -var _createRule2 = _interopRequireDefault(_createRule); - -var _isObservable = __webpack_require__(/*! ../utils/isObservable */ "./node_modules/jss/lib/utils/isObservable.js"); - -var _isObservable2 = _interopRequireDefault(_isObservable); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -exports['default'] = { - onCreateRule: function onCreateRule(name, decl, options) { - if (!(0, _isObservable2['default'])(decl)) return null; - - // Cast `decl` to `Observable`, since it passed the type guard. - var style$ = decl; - - var rule = (0, _createRule2['default'])(name, {}, options); - - // TODO - // Call `stream.subscribe()` returns a subscription, which should be explicitly - // unsubscribed from when we know this sheet is no longer needed. - style$.subscribe(function (style) { - for (var prop in style) { - rule.prop(prop, style[prop]); - } - }); - - return rule; - }, - onProcessRule: function onProcessRule(rule) { - if (!(rule instanceof _StyleRule2['default'])) return; - var styleRule = rule; - var style = styleRule.style; - - var _loop = function _loop(prop) { - var value = style[prop]; - if (!(0, _isObservable2['default'])(value)) return 'continue'; - delete style[prop]; - value.subscribe({ - next: function next(nextValue) { - styleRule.prop(prop, nextValue); - } - }); - }; - - for (var prop in style) { - var _ret = _loop(prop); - - if (_ret === 'continue') continue; - } - } -}; - -/***/ }), - -/***/ "./node_modules/jss/lib/plugins/rules.js": -/*!***********************************************!*\ - !*** ./node_modules/jss/lib/plugins/rules.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _SimpleRule = __webpack_require__(/*! ../rules/SimpleRule */ "./node_modules/jss/lib/rules/SimpleRule.js"); - -var _SimpleRule2 = _interopRequireDefault(_SimpleRule); - -var _KeyframesRule = __webpack_require__(/*! ../rules/KeyframesRule */ "./node_modules/jss/lib/rules/KeyframesRule.js"); - -var _KeyframesRule2 = _interopRequireDefault(_KeyframesRule); - -var _ConditionalRule = __webpack_require__(/*! ../rules/ConditionalRule */ "./node_modules/jss/lib/rules/ConditionalRule.js"); - -var _ConditionalRule2 = _interopRequireDefault(_ConditionalRule); - -var _FontFaceRule = __webpack_require__(/*! ../rules/FontFaceRule */ "./node_modules/jss/lib/rules/FontFaceRule.js"); - -var _FontFaceRule2 = _interopRequireDefault(_FontFaceRule); - -var _ViewportRule = __webpack_require__(/*! ../rules/ViewportRule */ "./node_modules/jss/lib/rules/ViewportRule.js"); - -var _ViewportRule2 = _interopRequireDefault(_ViewportRule); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var classes = { - '@charset': _SimpleRule2['default'], - '@import': _SimpleRule2['default'], - '@namespace': _SimpleRule2['default'], - '@keyframes': _KeyframesRule2['default'], - '@media': _ConditionalRule2['default'], - '@supports': _ConditionalRule2['default'], - '@font-face': _FontFaceRule2['default'], - '@viewport': _ViewportRule2['default'], - '@-ms-viewport': _ViewportRule2['default'] - - /** - * Generate plugins which will register all rules. - */ -}; -exports['default'] = Object.keys(classes).map(function (key) { - // https://jsperf.com/indexof-vs-substr-vs-regex-at-the-beginning-3 - var re = new RegExp('^' + key); - var onCreateRule = function onCreateRule(name, decl, options) { - return re.test(name) ? new classes[key](name, decl, options) : null; - }; - return { onCreateRule: onCreateRule }; -}); - -/***/ }), - -/***/ "./node_modules/jss/lib/renderers/DomRenderer.js": -/*!*******************************************************!*\ - !*** ./node_modules/jss/lib/renderers/DomRenderer.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _sheets = __webpack_require__(/*! ../sheets */ "./node_modules/jss/lib/sheets.js"); - -var _sheets2 = _interopRequireDefault(_sheets); - -var _StyleRule = __webpack_require__(/*! ../rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _toCssValue = __webpack_require__(/*! ../utils/toCssValue */ "./node_modules/jss/lib/utils/toCssValue.js"); - -var _toCssValue2 = _interopRequireDefault(_toCssValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Cache the value from the first time a function is called. - */ -var memoize = function memoize(fn) { - var value = void 0; - return function () { - if (!value) value = fn(); - return value; - }; -}; - -/** - * Get a style property value. - */ -function getPropertyValue(cssRule, prop) { - try { - return cssRule.style.getPropertyValue(prop); - } catch (err) { - // IE may throw if property is unknown. - return ''; - } -} - -/** - * Set a style property. - */ -function setProperty(cssRule, prop, value) { - try { - var cssValue = value; - - if (Array.isArray(value)) { - cssValue = (0, _toCssValue2['default'])(value, true); - - if (value[value.length - 1] === '!important') { - cssRule.style.setProperty(prop, cssValue, 'important'); - return true; - } - } - - cssRule.style.setProperty(prop, cssValue); - } catch (err) { - // IE may throw if property is unknown. - return false; - } - return true; -} - -/** - * Remove a style property. - */ -function removeProperty(cssRule, prop) { - try { - cssRule.style.removeProperty(prop); - } catch (err) { - (0, _warning2['default'])(false, '[JSS] DOMException "%s" was thrown. Tried to remove property "%s".', err.message, prop); - } -} - -var CSSRuleTypes = { - STYLE_RULE: 1, - KEYFRAMES_RULE: 7 - - /** - * Get the CSS Rule key. - */ - -};var getKey = function () { - var extractKey = function extractKey(cssText) { - var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - return cssText.substr(from, cssText.indexOf('{') - 1); - }; - - return function (cssRule) { - if (cssRule.type === CSSRuleTypes.STYLE_RULE) return cssRule.selectorText; - if (cssRule.type === CSSRuleTypes.KEYFRAMES_RULE) { - var name = cssRule.name; - - if (name) return '@keyframes ' + name; - - // There is no rule.name in the following browsers: - // - IE 9 - // - Safari 7.1.8 - // - Mobile Safari 9.0.0 - var cssText = cssRule.cssText; - - return '@' + extractKey(cssText, cssText.indexOf('keyframes')); - } - - // Conditionals. - return extractKey(cssRule.cssText); - }; -}(); - -/** - * Set the selector. - */ -function setSelector(cssRule, selectorText) { - cssRule.selectorText = selectorText; - - // Return false if setter was not successful. - // Currently works in chrome only. - return cssRule.selectorText === selectorText; -} - -/** - * Gets the `head` element upon the first call and caches it. - */ -var getHead = memoize(function () { - return document.head || document.getElementsByTagName('head')[0]; -}); - -/** - * Gets a map of rule keys, where the property is an unescaped key and value - * is a potentially escaped one. - * It is used to identify CSS rules and the corresponding JSS rules. As an identifier - * for CSSStyleRule we normally use `selectorText`. Though if original selector text - * contains escaped code points e.g. `:not(#\\20)`, CSSOM will compile it to `:not(# )` - * and so CSS rule's `selectorText` won't match JSS rule selector. - * - * https://www.w3.org/International/questions/qa-escapes#cssescapes - */ -var getUnescapedKeysMap = function () { - var style = void 0; - var isAttached = false; - - return function (rules) { - var map = {}; - // https://github.com/facebook/flow/issues/2696 - if (!style) style = document.createElement('style'); - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (!(rule instanceof _StyleRule2['default'])) continue; - var selector = rule.selector; - // Only unescape selector over CSSOM if it contains a back slash. - - if (selector && selector.indexOf('\\') !== -1) { - // Lazilly attach when needed. - if (!isAttached) { - getHead().appendChild(style); - isAttached = true; - } - style.textContent = selector + ' {}'; - var _style = style, - sheet = _style.sheet; - - if (sheet) { - var cssRules = sheet.cssRules; - - if (cssRules) map[cssRules[0].selectorText] = rule.key; - } - } - } - if (isAttached) { - getHead().removeChild(style); - isAttached = false; - } - return map; - }; -}(); - -/** - * Find attached sheet with an index higher than the passed one. - */ -function findHigherSheet(registry, options) { - for (var i = 0; i < registry.length; i++) { - var sheet = registry[i]; - if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) { - return sheet; - } - } - return null; -} - -/** - * Find attached sheet with the highest index. - */ -function findHighestSheet(registry, options) { - for (var i = registry.length - 1; i >= 0; i--) { - var sheet = registry[i]; - if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) { - return sheet; - } - } - return null; -} - -/** - * Find a comment with "jss" inside. - */ -function findCommentNode(text) { - var head = getHead(); - for (var i = 0; i < head.childNodes.length; i++) { - var node = head.childNodes[i]; - if (node.nodeType === 8 && node.nodeValue.trim() === text) { - return node; - } - } - return null; -} - -/** - * Find a node before which we can insert the sheet. - */ -function findPrevNode(options) { - var registry = _sheets2['default'].registry; - - - if (registry.length > 0) { - // Try to insert before the next higher sheet. - var sheet = findHigherSheet(registry, options); - if (sheet) return sheet.renderer.element; - - // Otherwise insert after the last attached. - sheet = findHighestSheet(registry, options); - if (sheet) return sheet.renderer.element.nextElementSibling; - } - - // Try to find a comment placeholder if registry is empty. - var insertionPoint = options.insertionPoint; - - if (insertionPoint && typeof insertionPoint === 'string') { - var comment = findCommentNode(insertionPoint); - if (comment) return comment.nextSibling; - // If user specifies an insertion point and it can't be found in the document - - // bad specificity issues may appear. - (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point "%s" not found.', insertionPoint); - } - - return null; -} - -/** - * Insert style element into the DOM. - */ -function insertStyle(style, options) { - var insertionPoint = options.insertionPoint; - - var prevNode = findPrevNode(options); - - if (prevNode) { - var parentNode = prevNode.parentNode; - - if (parentNode) parentNode.insertBefore(style, prevNode); - return; - } - - // Works with iframes and any node types. - if (insertionPoint && typeof insertionPoint.nodeType === 'number') { - // https://stackoverflow.com/questions/41328728/force-casting-in-flow - var insertionPointElement = insertionPoint; - var _parentNode = insertionPointElement.parentNode; - - if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.'); - return; - } - - getHead().insertBefore(style, prevNode); -} - -/** - * Read jss nonce setting from the page if the user has set it. - */ -var getNonce = memoize(function () { - var node = document.querySelector('meta[property="csp-nonce"]'); - return node ? node.getAttribute('content') : null; -}); - -var DomRenderer = function () { - function DomRenderer(sheet) { - _classCallCheck(this, DomRenderer); - - this.getPropertyValue = getPropertyValue; - this.setProperty = setProperty; - this.removeProperty = removeProperty; - this.setSelector = setSelector; - this.getKey = getKey; - this.getUnescapedKeysMap = getUnescapedKeysMap; - this.hasInsertedRules = false; - - // There is no sheet when the renderer is used from a standalone StyleRule. - if (sheet) _sheets2['default'].add(sheet); - - this.sheet = sheet; - - var _ref = this.sheet ? this.sheet.options : {}, - media = _ref.media, - meta = _ref.meta, - element = _ref.element; - - this.element = element || document.createElement('style'); - this.element.type = 'text/css'; - this.element.setAttribute('data-jss', ''); - if (media) this.element.setAttribute('media', media); - if (meta) this.element.setAttribute('data-meta', meta); - var nonce = getNonce(); - if (nonce) this.element.setAttribute('nonce', nonce); - } - - /** - * Insert style element into render tree. - */ - - - // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696 - - - _createClass(DomRenderer, [{ - key: 'attach', - value: function attach() { - // In the case the element node is external and it is already in the DOM. - if (this.element.parentNode || !this.sheet) return; - - // When rules are inserted using `insertRule` API, after `sheet.detach().attach()` - // browsers remove those rules. - // TODO figure out if its a bug and if it is known. - // Workaround is to redeploy the sheet before attaching as a string. - if (this.hasInsertedRules) { - this.deploy(); - this.hasInsertedRules = false; - } - - insertStyle(this.element, this.sheet.options); - } - - /** - * Remove style element from render tree. - */ - - }, { - key: 'detach', - value: function detach() { - this.element.parentNode.removeChild(this.element); - } - - /** - * Inject CSS string into element. - */ - - }, { - key: 'deploy', - value: function deploy() { - if (!this.sheet) return; - this.element.textContent = '\n' + this.sheet.toString() + '\n'; - } - - /** - * Insert a rule into element. - */ - - }, { - key: 'insertRule', - value: function insertRule(rule, index) { - var sheet = this.element.sheet; - var cssRules = sheet.cssRules; - - var str = rule.toString(); - if (!index) index = cssRules.length; - - if (!str) return false; - - try { - sheet.insertRule(str, index); - } catch (err) { - (0, _warning2['default'])(false, '[JSS] Can not insert an unsupported rule \n\r%s', rule); - return false; - } - this.hasInsertedRules = true; - - return cssRules[index]; - } - - /** - * Delete a rule. - */ - - }, { - key: 'deleteRule', - value: function deleteRule(cssRule) { - var sheet = this.element.sheet; - - var index = this.indexOf(cssRule); - if (index === -1) return false; - sheet.deleteRule(index); - return true; - } - - /** - * Get index of a CSS Rule. - */ - - }, { - key: 'indexOf', - value: function indexOf(cssRule) { - var cssRules = this.element.sheet.cssRules; - - for (var _index = 0; _index < cssRules.length; _index++) { - if (cssRule === cssRules[_index]) return _index; - } - return -1; - } - - /** - * Generate a new CSS rule and replace the existing one. - */ - - }, { - key: 'replaceRule', - value: function replaceRule(cssRule, rule) { - var index = this.indexOf(cssRule); - var newCssRule = this.insertRule(rule, index); - this.element.sheet.deleteRule(index); - return newCssRule; - } - - /** - * Get all rules elements. - */ - - }, { - key: 'getRules', - value: function getRules() { - return this.element.sheet.cssRules; - } - }]); - - return DomRenderer; -}(); - -exports['default'] = DomRenderer; - -/***/ }), - -/***/ "./node_modules/jss/lib/renderers/VirtualRenderer.js": -/*!***********************************************************!*\ - !*** ./node_modules/jss/lib/renderers/VirtualRenderer.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/* eslint-disable class-methods-use-this */ - -/** - * Rendering backend to do nothing in nodejs. - */ -var VirtualRenderer = function () { - function VirtualRenderer() { - _classCallCheck(this, VirtualRenderer); - } - - _createClass(VirtualRenderer, [{ - key: 'setProperty', - value: function setProperty() { - return true; - } - }, { - key: 'getPropertyValue', - value: function getPropertyValue() { - return ''; - } - }, { - key: 'removeProperty', - value: function removeProperty() {} - }, { - key: 'setSelector', - value: function setSelector() { - return true; - } - }, { - key: 'getKey', - value: function getKey() { - return ''; - } - }, { - key: 'attach', - value: function attach() {} - }, { - key: 'detach', - value: function detach() {} - }, { - key: 'deploy', - value: function deploy() {} - }, { - key: 'insertRule', - value: function insertRule() { - return false; - } - }, { - key: 'deleteRule', - value: function deleteRule() { - return true; - } - }, { - key: 'replaceRule', - value: function replaceRule() { - return false; - } - }, { - key: 'getRules', - value: function getRules() {} - }, { - key: 'indexOf', - value: function indexOf() { - return -1; - } - }]); - - return VirtualRenderer; -}(); - -exports['default'] = VirtualRenderer; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/ConditionalRule.js": -/*!*******************************************************!*\ - !*** ./node_modules/jss/lib/rules/ConditionalRule.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _RuleList = __webpack_require__(/*! ../RuleList */ "./node_modules/jss/lib/RuleList.js"); - -var _RuleList2 = _interopRequireDefault(_RuleList); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Conditional rule for @media, @supports - */ -var ConditionalRule = function () { - function ConditionalRule(key, styles, options) { - _classCallCheck(this, ConditionalRule); - - this.type = 'conditional'; - this.isProcessed = false; - - this.key = key; - this.options = options; - this.rules = new _RuleList2['default'](_extends({}, options, { parent: this })); - - for (var name in styles) { - this.rules.add(name, styles[name]); - } - - this.rules.process(); - } - - /** - * Get a rule. - */ - - - _createClass(ConditionalRule, [{ - key: 'getRule', - value: function getRule(name) { - return this.rules.get(name); - } - - /** - * Get index of a rule. - */ - - }, { - key: 'indexOf', - value: function indexOf(rule) { - return this.rules.indexOf(rule); - } - - /** - * Create and register rule, run plugins. - */ - - }, { - key: 'addRule', - value: function addRule(name, style, options) { - var rule = this.rules.add(name, style, options); - this.options.jss.plugins.onProcessRule(rule); - return rule; - } - - /** - * Generates a CSS string. - */ - - }, { - key: 'toString', - value: function toString() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { indent: 1 }; - - var inner = this.rules.toString(options); - return inner ? this.key + ' {\n' + inner + '\n}' : ''; - } - }]); - - return ConditionalRule; -}(); - -exports['default'] = ConditionalRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/FontFaceRule.js": -/*!****************************************************!*\ - !*** ./node_modules/jss/lib/rules/FontFaceRule.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _toCss = __webpack_require__(/*! ../utils/toCss */ "./node_modules/jss/lib/utils/toCss.js"); - -var _toCss2 = _interopRequireDefault(_toCss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var FontFaceRule = function () { - function FontFaceRule(key, style, options) { - _classCallCheck(this, FontFaceRule); - - this.type = 'font-face'; - this.isProcessed = false; - - this.key = key; - this.style = style; - this.options = options; - } - - /** - * Generates a CSS string. - */ - - - _createClass(FontFaceRule, [{ - key: 'toString', - value: function toString(options) { - if (Array.isArray(this.style)) { - var str = ''; - for (var index = 0; index < this.style.length; index++) { - str += (0, _toCss2['default'])(this.key, this.style[index]); - if (this.style[index + 1]) str += '\n'; - } - return str; - } - - return (0, _toCss2['default'])(this.key, this.style, options); - } - }]); - - return FontFaceRule; -}(); - -exports['default'] = FontFaceRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/KeyframesRule.js": -/*!*****************************************************!*\ - !*** ./node_modules/jss/lib/rules/KeyframesRule.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _RuleList = __webpack_require__(/*! ../RuleList */ "./node_modules/jss/lib/RuleList.js"); - -var _RuleList2 = _interopRequireDefault(_RuleList); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Rule for @keyframes - */ -var KeyframesRule = function () { - function KeyframesRule(key, frames, options) { - _classCallCheck(this, KeyframesRule); - - this.type = 'keyframes'; - this.isProcessed = false; - - this.key = key; - this.options = options; - this.rules = new _RuleList2['default'](_extends({}, options, { parent: this })); - - for (var name in frames) { - this.rules.add(name, frames[name], _extends({}, this.options, { - parent: this, - selector: name - })); - } - - this.rules.process(); - } - - /** - * Generates a CSS string. - */ - - - _createClass(KeyframesRule, [{ - key: 'toString', - value: function toString() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { indent: 1 }; - - var inner = this.rules.toString(options); - if (inner) inner += '\n'; - return this.key + ' {\n' + inner + '}'; - } - }]); - - return KeyframesRule; -}(); - -exports['default'] = KeyframesRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/SimpleRule.js": -/*!**************************************************!*\ - !*** ./node_modules/jss/lib/rules/SimpleRule.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var SimpleRule = function () { - function SimpleRule(key, value, options) { - _classCallCheck(this, SimpleRule); - - this.type = 'simple'; - this.isProcessed = false; - - this.key = key; - this.value = value; - this.options = options; - } - - /** - * Generates a CSS string. - */ - // eslint-disable-next-line no-unused-vars - - - _createClass(SimpleRule, [{ - key: 'toString', - value: function toString(options) { - if (Array.isArray(this.value)) { - var str = ''; - for (var index = 0; index < this.value.length; index++) { - str += this.key + ' ' + this.value[index] + ';'; - if (this.value[index + 1]) str += '\n'; - } - return str; - } - - return this.key + ' ' + this.value + ';'; - } - }]); - - return SimpleRule; -}(); - -exports['default'] = SimpleRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/StyleRule.js": -/*!*************************************************!*\ - !*** ./node_modules/jss/lib/rules/StyleRule.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _toCss = __webpack_require__(/*! ../utils/toCss */ "./node_modules/jss/lib/utils/toCss.js"); - -var _toCss2 = _interopRequireDefault(_toCss); - -var _toCssValue = __webpack_require__(/*! ../utils/toCssValue */ "./node_modules/jss/lib/utils/toCssValue.js"); - -var _toCssValue2 = _interopRequireDefault(_toCssValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var StyleRule = function () { - function StyleRule(key, style, options) { - _classCallCheck(this, StyleRule); - - this.type = 'style'; - this.isProcessed = false; - var sheet = options.sheet, - Renderer = options.Renderer, - selector = options.selector; - - this.key = key; - this.options = options; - this.style = style; - if (selector) this.selectorText = selector; - this.renderer = sheet ? sheet.renderer : new Renderer(); - } - - /** - * Set selector string. - * Attention: use this with caution. Most browsers didn't implement - * selectorText setter, so this may result in rerendering of entire Style Sheet. - */ - - - _createClass(StyleRule, [{ - key: 'prop', - - - /** - * Get or set a style property. - */ - value: function prop(name, value) { - // It's a getter. - if (value === undefined) return this.style[name]; - - // Don't do anything if the value has not changed. - if (this.style[name] === value) return this; - - value = this.options.jss.plugins.onChangeValue(value, name, this); - - var isEmpty = value == null || value === false; - var isDefined = name in this.style; - - // Value is empty and wasn't defined before. - if (isEmpty && !isDefined) return this; - - // We are going to remove this value. - var remove = isEmpty && isDefined; - - if (remove) delete this.style[name];else this.style[name] = value; - - // Renderable is defined if StyleSheet option `link` is true. - if (this.renderable) { - if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, value); - return this; - } - - var sheet = this.options.sheet; - - if (sheet && sheet.attached) { - (0, _warning2['default'])(false, 'Rule is not linked. Missing sheet option "link: true".'); - } - return this; - } - - /** - * Apply rule to an element inline. - */ - - }, { - key: 'applyTo', - value: function applyTo(renderable) { - var json = this.toJSON(); - for (var prop in json) { - this.renderer.setProperty(renderable, prop, json[prop]); - }return this; - } - - /** - * Returns JSON representation of the rule. - * Fallbacks are not supported. - * Useful for inline styles. - */ - - }, { - key: 'toJSON', - value: function toJSON() { - var json = {}; - for (var prop in this.style) { - var value = this.style[prop]; - if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = (0, _toCssValue2['default'])(value); - } - return json; - } - - /** - * Generates a CSS string. - */ - - }, { - key: 'toString', - value: function toString(options) { - var sheet = this.options.sheet; - - var link = sheet ? sheet.options.link : false; - var opts = link ? _extends({}, options, { allowEmpty: true }) : options; - return (0, _toCss2['default'])(this.selector, this.style, opts); - } - }, { - key: 'selector', - set: function set(selector) { - if (selector === this.selectorText) return; - - this.selectorText = selector; - - if (!this.renderable) return; - - var hasChanged = this.renderer.setSelector(this.renderable, selector); - - // If selector setter is not implemented, rerender the rule. - if (!hasChanged && this.renderable) { - var renderable = this.renderer.replaceRule(this.renderable, this); - if (renderable) this.renderable = renderable; - } - } - - /** - * Get selector string. - */ - , - get: function get() { - return this.selectorText; - } - }]); - - return StyleRule; -}(); - -exports['default'] = StyleRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/rules/ViewportRule.js": -/*!****************************************************!*\ - !*** ./node_modules/jss/lib/rules/ViewportRule.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _toCss = __webpack_require__(/*! ../utils/toCss */ "./node_modules/jss/lib/utils/toCss.js"); - -var _toCss2 = _interopRequireDefault(_toCss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var ViewportRule = function () { - function ViewportRule(key, style, options) { - _classCallCheck(this, ViewportRule); - - this.type = 'viewport'; - this.isProcessed = false; - - this.key = key; - this.style = style; - this.options = options; - } - - /** - * Generates a CSS string. - */ - - - _createClass(ViewportRule, [{ - key: 'toString', - value: function toString(options) { - return (0, _toCss2['default'])(this.key, this.style, options); - } - }]); - - return ViewportRule; -}(); - -exports['default'] = ViewportRule; - -/***/ }), - -/***/ "./node_modules/jss/lib/sheets.js": -/*!****************************************!*\ - !*** ./node_modules/jss/lib/sheets.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _SheetsRegistry = __webpack_require__(/*! ./SheetsRegistry */ "./node_modules/jss/lib/SheetsRegistry.js"); - -var _SheetsRegistry2 = _interopRequireDefault(_SheetsRegistry); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -/** - * This is a global sheets registry. Only DomRenderer will add sheets to it. - * On the server one should use an own SheetsRegistry instance and add the - * sheets to it, because you need to make sure to create a new registry for - * each request in order to not leak sheets across requests. - */ -exports['default'] = new _SheetsRegistry2['default'](); - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/cloneStyle.js": -/*!**************************************************!*\ - !*** ./node_modules/jss/lib/utils/cloneStyle.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports['default'] = cloneStyle; - -var _isObservable = __webpack_require__(/*! ./isObservable */ "./node_modules/jss/lib/utils/isObservable.js"); - -var _isObservable2 = _interopRequireDefault(_isObservable); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var isArray = Array.isArray; -function cloneStyle(style) { - // Support empty values in case user ends up with them by accident. - if (style == null) return style; - - // Support string value for SimpleRule. - var typeOfStyle = typeof style === 'undefined' ? 'undefined' : _typeof(style); - - if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') { - return style; - } - - // Support array for FontFaceRule. - if (isArray(style)) return style.map(cloneStyle); - - // Support Observable styles. Observables are immutable, so we don't need to - // copy them. - if ((0, _isObservable2['default'])(style)) return style; - - var newStyle = {}; - for (var name in style) { - var value = style[name]; - if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { - newStyle[name] = cloneStyle(value); - continue; - } - newStyle[name] = value; - } - - return newStyle; -} - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/createGenerateClassName.js": -/*!***************************************************************!*\ - !*** ./node_modules/jss/lib/utils/createGenerateClassName.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _StyleSheet = __webpack_require__(/*! ../StyleSheet */ "./node_modules/jss/lib/StyleSheet.js"); - -var _StyleSheet2 = _interopRequireDefault(_StyleSheet); - -var _moduleId = __webpack_require__(/*! ./moduleId */ "./node_modules/jss/lib/utils/moduleId.js"); - -var _moduleId2 = _interopRequireDefault(_moduleId); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var maxRules = 1e10; - - -var env = "development"; - -/** - * Returns a function which generates unique class names based on counters. - * When new generator function is created, rule counter is reseted. - * We need to reset the rule counter for SSR for each request. - */ - -exports['default'] = function () { - var ruleCounter = 0; - var defaultPrefix = env === 'production' ? 'c' : ''; - - return function (rule, sheet) { - ruleCounter += 1; - - if (ruleCounter > maxRules) { - (0, _warning2['default'])(false, '[JSS] You might have a memory leak. Rule counter is at %s.', ruleCounter); - } - - var prefix = defaultPrefix; - var jssId = ''; - - if (sheet) { - prefix = sheet.options.classNamePrefix || defaultPrefix; - if (sheet.options.jss.id != null) jssId += sheet.options.jss.id; - } - - if (env === 'production') { - return '' + prefix + _moduleId2['default'] + jssId + ruleCounter; - } - - return prefix + rule.key + '-' + _moduleId2['default'] + (jssId && '-' + jssId) + '-' + ruleCounter; - }; -}; - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/createRule.js": -/*!**************************************************!*\ - !*** ./node_modules/jss/lib/utils/createRule.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = createRule; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _StyleRule = __webpack_require__(/*! ../rules/StyleRule */ "./node_modules/jss/lib/rules/StyleRule.js"); - -var _StyleRule2 = _interopRequireDefault(_StyleRule); - -var _cloneStyle = __webpack_require__(/*! ../utils/cloneStyle */ "./node_modules/jss/lib/utils/cloneStyle.js"); - -var _cloneStyle2 = _interopRequireDefault(_cloneStyle); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -/** - * Create a rule instance. - */ -function createRule() { - var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed'; - var decl = arguments[1]; - var options = arguments[2]; - var jss = options.jss; - - var declCopy = (0, _cloneStyle2['default'])(decl); - - var rule = jss.plugins.onCreateRule(name, declCopy, options); - if (rule) return rule; - - // It is an at-rule and it has no instance. - if (name[0] === '@') { - (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name); - } - - return new _StyleRule2['default'](name, declCopy, options); -} - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/escape.js": -/*!**********************************************!*\ - !*** ./node_modules/jss/lib/utils/escape.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var CSS = global.CSS; - -var env = "development"; - -var escapeRegex = /([[\].#*$><+~=|^:(),"'`])/g; - -exports['default'] = function (str) { - // We don't need to escape it in production, because we are not using user's - // input for selectors, we are generating a valid selector. - if (env === 'production') return str; - - if (!CSS || !CSS.escape) { - return str.replace(escapeRegex, '\\$1'); - } - - return CSS.escape(str); -}; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/getDynamicStyles.js": -/*!********************************************************!*\ - !*** ./node_modules/jss/lib/utils/getDynamicStyles.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -/** - * Extracts a styles object with only props that contain function values. - */ -exports['default'] = function (styles) { - // eslint-disable-next-line no-shadow - function extract(styles) { - var to = null; - - for (var key in styles) { - var value = styles[key]; - var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); - - if (type === 'function') { - if (!to) to = {}; - to[key] = value; - } else if (type === 'object' && value !== null && !Array.isArray(value)) { - var extracted = extract(value); - if (extracted) { - if (!to) to = {}; - to[key] = extracted; - } - } - } - - return to; - } - - return extract(styles); -}; - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/isObservable.js": -/*!****************************************************!*\ - !*** ./node_modules/jss/lib/utils/isObservable.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _symbolObservable = __webpack_require__(/*! symbol-observable */ "./node_modules/jss/node_modules/symbol-observable/es/index.js"); - -var _symbolObservable2 = _interopRequireDefault(_symbolObservable); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -exports['default'] = function (value) { - return value && value[_symbolObservable2['default']] && value === value[_symbolObservable2['default']](); -}; - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/linkRule.js": -/*!************************************************!*\ - !*** ./node_modules/jss/lib/utils/linkRule.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = linkRule; -/** - * Link rule with CSSStyleRule and nested rules with corresponding nested cssRules if both exists. - */ -function linkRule(rule, cssRule) { - rule.renderable = cssRule; - if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules); -} - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/moduleId.js": -/*!************************************************!*\ - !*** ./node_modules/jss/lib/utils/moduleId.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ns = '2f1acc6c3a606b082e5eef5e54414ffb'; -if (global[ns] == null) global[ns] = 0; - -// Bundle may contain multiple JSS versions at the same time. In order to identify -// the current version with just one short number and use it for classes generation -// we use a counter. Also it is more accurate, because user can manually reevaluate -// the module. -exports['default'] = global[ns]++; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/toCss.js": -/*!*********************************************!*\ - !*** ./node_modules/jss/lib/utils/toCss.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = toCss; - -var _toCssValue = __webpack_require__(/*! ./toCssValue */ "./node_modules/jss/lib/utils/toCssValue.js"); - -var _toCssValue2 = _interopRequireDefault(_toCssValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -/** - * Indent a string. - * http://jsperf.com/array-join-vs-for - */ -function indentStr(str, indent) { - var result = ''; - for (var index = 0; index < indent; index++) { - result += ' '; - }return result + str; -} - -/** - * Converts a Rule to CSS string. - */ - -function toCss(selector, style) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var result = ''; - - if (!style) return result; - - var _options$indent = options.indent, - indent = _options$indent === undefined ? 0 : _options$indent; - var fallbacks = style.fallbacks; - - - indent++; - - // Apply fallbacks first. - if (fallbacks) { - // Array syntax {fallbacks: [{prop: value}]} - if (Array.isArray(fallbacks)) { - for (var index = 0; index < fallbacks.length; index++) { - var fallback = fallbacks[index]; - for (var prop in fallback) { - var value = fallback[prop]; - if (value != null) { - result += '\n' + indentStr(prop + ': ' + (0, _toCssValue2['default'])(value) + ';', indent); - } - } - } - } else { - // Object syntax {fallbacks: {prop: value}} - for (var _prop in fallbacks) { - var _value = fallbacks[_prop]; - if (_value != null) { - result += '\n' + indentStr(_prop + ': ' + (0, _toCssValue2['default'])(_value) + ';', indent); - } - } - } - } - - for (var _prop2 in style) { - var _value2 = style[_prop2]; - if (_value2 != null && _prop2 !== 'fallbacks') { - result += '\n' + indentStr(_prop2 + ': ' + (0, _toCssValue2['default'])(_value2) + ';', indent); - } - } - - // Allow empty style in this case, because properties will be added dynamically. - if (!result && !options.allowEmpty) return result; - - indent--; - result = indentStr(selector + ' {' + result + '\n', indent) + indentStr('}', indent); - - return result; -} - -/***/ }), - -/***/ "./node_modules/jss/lib/utils/toCssValue.js": -/*!**************************************************!*\ - !*** ./node_modules/jss/lib/utils/toCssValue.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = toCssValue; -var join = function join(value, by) { - var result = ''; - for (var i = 0; i < value.length; i++) { - // Remove !important from the value, it will be readded later. - if (value[i] === '!important') break; - if (result) result += by; - result += value[i]; - } - return result; -}; - -/** - * Converts array values to string. - * - * `margin: [['5px', '10px']]` > `margin: 5px 10px;` - * `border: ['1px', '2px']` > `border: 1px, 2px;` - * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;` - * `color: ['red', !important]` > `color: red !important;` - */ -function toCssValue(value) { - var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (!Array.isArray(value)) return value; - - var cssValue = ''; - - // Support space separated values via `[['5px', '10px']]`. - if (Array.isArray(value[0])) { - for (var i = 0; i < value.length; i++) { - if (value[i] === '!important') break; - if (cssValue) cssValue += ', '; - cssValue += join(value[i], ' '); - } - } else cssValue = join(value, ', '); - - // Add !important, because it was ignored. - if (!ignoreImportant && value[value.length - 1] === '!important') { - cssValue += ' !important'; - } - - return cssValue; -} - -/***/ }), - -/***/ "./node_modules/jss/node_modules/symbol-observable/es/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/jss/node_modules/symbol-observable/es/index.js ***! - \*********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ponyfill.js */ "./node_modules/jss/node_modules/symbol-observable/es/ponyfill.js"); -/* global window */ - - -var root; - -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (true) { - root = module; -} else {} - -var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(root); -/* harmony default export */ __webpack_exports__["default"] = (result); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../../../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module))) - -/***/ }), - -/***/ "./node_modules/jss/node_modules/symbol-observable/es/ponyfill.js": -/*!************************************************************************!*\ - !*** ./node_modules/jss/node_modules/symbol-observable/es/ponyfill.js ***! - \************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return symbolObservablePonyfill; }); -function symbolObservablePonyfill(root) { - var result; - var Symbol = root.Symbol; - - if (typeof Symbol === 'function') { - if (Symbol.observable) { - result = Symbol.observable; - } else { - result = Symbol('observable'); - Symbol.observable = result; - } - } else { - result = '@@observable'; - } - - return result; -}; - - -/***/ }), - -/***/ "./node_modules/keycode/index.js": -/*!***************************************!*\ - !*** ./node_modules/keycode/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// Source: http://jsfiddle.net/vWx8V/ -// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes - -/** - * Conenience method returns corresponding value for given keyName or keyCode. - * - * @param {Mixed} keyCode {Number} or keyName {String} - * @return {Mixed} - * @api public - */ - -exports = module.exports = function(searchInput) { - // Keyboard Events - if (searchInput && 'object' === typeof searchInput) { - var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode - if (hasKeyCode) searchInput = hasKeyCode - } - - // Numbers - if ('number' === typeof searchInput) return names[searchInput] - - // Everything else (cast to string) - var search = String(searchInput) - - // check codes - var foundNamedKey = codes[search.toLowerCase()] - if (foundNamedKey) return foundNamedKey - - // check aliases - var foundNamedKey = aliases[search.toLowerCase()] - if (foundNamedKey) return foundNamedKey - - // weird character? - if (search.length === 1) return search.charCodeAt(0) - - return undefined -} - -/** - * Get by name - * - * exports.code['enter'] // => 13 - */ - -var codes = exports.code = exports.codes = { - 'backspace': 8, - 'tab': 9, - 'enter': 13, - 'shift': 16, - 'ctrl': 17, - 'alt': 18, - 'pause/break': 19, - 'caps lock': 20, - 'esc': 27, - 'space': 32, - 'page up': 33, - 'page down': 34, - 'end': 35, - 'home': 36, - 'left': 37, - 'up': 38, - 'right': 39, - 'down': 40, - 'insert': 45, - 'delete': 46, - 'command': 91, - 'left command': 91, - 'right command': 93, - 'numpad *': 106, - 'numpad +': 107, - 'numpad -': 109, - 'numpad .': 110, - 'numpad /': 111, - 'num lock': 144, - 'scroll lock': 145, - 'my computer': 182, - 'my calculator': 183, - ';': 186, - '=': 187, - ',': 188, - '-': 189, - '.': 190, - '/': 191, - '`': 192, - '[': 219, - '\\': 220, - ']': 221, - "'": 222 -} - -// Helper aliases - -var aliases = exports.aliases = { - 'windows': 91, - '⇧': 16, - '⌥': 18, - '⌃': 17, - '⌘': 91, - 'ctl': 17, - 'control': 17, - 'option': 18, - 'pause': 19, - 'break': 19, - 'caps': 20, - 'return': 13, - 'escape': 27, - 'spc': 32, - 'pgup': 33, - 'pgdn': 34, - 'ins': 45, - 'del': 46, - 'cmd': 91 -} - - -/*! - * Programatically add the following - */ - -// lower case chars -for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32 - -// numbers -for (var i = 48; i < 58; i++) codes[i - 48] = i - -// function keys -for (i = 1; i < 13; i++) codes['f'+i] = i + 111 - -// numpad keys -for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96 - -/** - * Get by code - * - * exports.name[13] // => 'Enter' - */ - -var names = exports.names = exports.title = {} // title for backward compat - -// Create reverse mapping -for (i in codes) names[codes[i]] = i - -// Add aliases -for (var alias in aliases) { - codes[alias] = aliases[alias] -} - - -/***/ }), - -/***/ "./node_modules/lodash/_Symbol.js": -/*!****************************************!*\ - !*** ./node_modules/lodash/_Symbol.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; - - -/***/ }), - -/***/ "./node_modules/lodash/_baseGetTag.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_baseGetTag.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), - getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), - objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -module.exports = baseGetTag; - - -/***/ }), - -/***/ "./node_modules/lodash/_freeGlobal.js": -/*!********************************************!*\ - !*** ./node_modules/lodash/_freeGlobal.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/lodash/_getRawTag.js": -/*!*******************************************!*\ - !*** ./node_modules/lodash/_getRawTag.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -module.exports = getRawTag; - - -/***/ }), - -/***/ "./node_modules/lodash/_objectToString.js": -/*!************************************************!*\ - !*** ./node_modules/lodash/_objectToString.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -module.exports = objectToString; - - -/***/ }), - -/***/ "./node_modules/lodash/_root.js": -/*!**************************************!*\ - !*** ./node_modules/lodash/_root.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; - - -/***/ }), - -/***/ "./node_modules/lodash/debounce.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/debounce.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), - now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"), - toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -module.exports = debounce; - - -/***/ }), - -/***/ "./node_modules/lodash/isObject.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/isObject.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -module.exports = isObject; - - -/***/ }), - -/***/ "./node_modules/lodash/isObjectLike.js": -/*!*********************************************!*\ - !*** ./node_modules/lodash/isObjectLike.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -module.exports = isObjectLike; - - -/***/ }), - -/***/ "./node_modules/lodash/isSymbol.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/isSymbol.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), - isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} - -module.exports = isSymbol; - - -/***/ }), - -/***/ "./node_modules/lodash/now.js": -/*!************************************!*\ - !*** ./node_modules/lodash/now.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); - -/** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ -var now = function() { - return root.Date.now(); -}; - -module.exports = now; - - -/***/ }), - -/***/ "./node_modules/lodash/toNumber.js": -/*!*****************************************!*\ - !*** ./node_modules/lodash/toNumber.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), - isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = toNumber; - - -/***/ }), - -/***/ "./node_modules/material-ui/Button/Button.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/Button/Button.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _colorManipulator = __webpack_require__(/*! ../styles/colorManipulator */ "./node_modules/material-ui/styles/colorManipulator.js"); - -var _ButtonBase = __webpack_require__(/*! ../ButtonBase */ "./node_modules/material-ui/ButtonBase/index.js"); - -var _ButtonBase2 = _interopRequireDefault(_ButtonBase); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -var _reactHelpers = __webpack_require__(/*! ../utils/reactHelpers */ "./node_modules/material-ui/utils/reactHelpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// @inheritedComponent ButtonBase - -var styles = exports.styles = function styles(theme) { - return { - root: (0, _extends3.default)({}, theme.typography.button, { - lineHeight: '1.4em', // Improve readability for multiline button. - boxSizing: 'border-box', - minWidth: theme.spacing.unit * 11, - minHeight: 36, - padding: theme.spacing.unit + 'px ' + theme.spacing.unit * 2 + 'px', - borderRadius: 2, - color: theme.palette.text.primary, - transition: theme.transitions.create(['background-color', 'box-shadow'], { - duration: theme.transitions.duration.short - }), - '&:hover': { - textDecoration: 'none', - // Reset on mouse devices - backgroundColor: (0, _colorManipulator.fade)(theme.palette.text.primary, 0.12), - '@media (hover: none)': { - backgroundColor: 'transparent' - }, - '&$disabled': { - backgroundColor: 'transparent' - } - } - }), - label: { - width: '100%', - display: 'inherit', - alignItems: 'inherit', - justifyContent: 'inherit' - }, - flatPrimary: { - color: theme.palette.primary.main, - '&:hover': { - backgroundColor: (0, _colorManipulator.fade)(theme.palette.primary.main, 0.12), - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: 'transparent' - } - } - }, - flatSecondary: { - color: theme.palette.secondary.main, - '&:hover': { - backgroundColor: (0, _colorManipulator.fade)(theme.palette.secondary.main, 0.12), - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: 'transparent' - } - } - }, - colorInherit: { - color: 'inherit' - }, - raised: { - color: theme.palette.getContrastText(theme.palette.grey[300]), - backgroundColor: theme.palette.grey[300], - boxShadow: theme.shadows[2], - '&$keyboardFocused': { - boxShadow: theme.shadows[6] - }, - '&:active': { - boxShadow: theme.shadows[8] - }, - '&$disabled': { - boxShadow: theme.shadows[0], - backgroundColor: theme.palette.action.disabledBackground - }, - '&:hover': { - backgroundColor: theme.palette.grey.A100, - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: theme.palette.grey[300] - }, - '&$disabled': { - backgroundColor: theme.palette.action.disabledBackground - } - } - }, - keyboardFocused: {}, - raisedPrimary: { - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.primary.main, - '&:hover': { - backgroundColor: theme.palette.primary.dark, - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: theme.palette.primary.main - } - } - }, - raisedSecondary: { - color: theme.palette.secondary.contrastText, - backgroundColor: theme.palette.secondary.main, - '&:hover': { - backgroundColor: theme.palette.secondary.dark, - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: theme.palette.secondary.main - } - } - }, - disabled: { - color: theme.palette.action.disabled - }, - fab: { - borderRadius: '50%', - padding: 0, - minWidth: 0, - width: 56, - fontSize: 24, - height: 56, - boxShadow: theme.shadows[6], - '&:active': { - boxShadow: theme.shadows[12] - } - }, - mini: { - width: 40, - height: 40 - }, - sizeSmall: { - padding: theme.spacing.unit - 1 + 'px ' + theme.spacing.unit + 'px', - minWidth: theme.spacing.unit * 8, - minHeight: 32, - fontSize: theme.typography.pxToRem(theme.typography.fontSize - 1) - }, - sizeLarge: { - padding: theme.spacing.unit + 'px ' + theme.spacing.unit * 3 + 'px', - minWidth: theme.spacing.unit * 14, - minHeight: 40, - fontSize: theme.typography.pxToRem(theme.typography.fontSize + 1) - }, - fullWidth: { - width: '100%' - } - }; -}; - -function Button(props) { - var _classNames; - - var childrenProp = props.children, - classes = props.classes, - classNameProp = props.className, - color = props.color, - disabled = props.disabled, - disableFocusRipple = props.disableFocusRipple, - fullWidth = props.fullWidth, - mini = props.mini, - size = props.size, - variant = props.variant, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'color', 'disabled', 'disableFocusRipple', 'fullWidth', 'mini', 'size', 'variant']); - - - var fab = variant === 'fab'; - var raised = variant === 'raised'; - var flat = !raised && !fab; - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.raised, raised || fab), (0, _defineProperty3.default)(_classNames, classes.fab, fab), (0, _defineProperty3.default)(_classNames, classes.mini, fab && mini), (0, _defineProperty3.default)(_classNames, classes.colorInherit, color === 'inherit'), (0, _defineProperty3.default)(_classNames, classes.flatPrimary, flat && color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.flatSecondary, flat && color === 'secondary'), (0, _defineProperty3.default)(_classNames, classes.raisedPrimary, !flat && color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.raisedSecondary, !flat && color === 'secondary'), (0, _defineProperty3.default)(_classNames, classes['size' + (0, _helpers.capitalize)(size)], size !== 'medium'), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), _classNames), classNameProp); - - var children = childrenProp; - - if (fab) { - children = _react2.default.Children.map(children, function (child) { - if ((0, _reactHelpers.isMuiElement)(child, ['Icon', 'SvgIcon'])) { - return _react2.default.cloneElement(child, { fontSize: true }); - } - return child; - }); - } - - return _react2.default.createElement( - _ButtonBase2.default, - (0, _extends3.default)({ - className: className, - disabled: disabled, - focusRipple: !disableFocusRipple, - keyboardFocusedClassName: classes.keyboardFocused - }, other), - _react2.default.createElement( - 'span', - { className: classes.label }, - children - ) - ); -} - -Button.propTypes = true ? { - /** - * The content of the button. - */ - children: _propTypes2.default.node.isRequired, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The color of the component. It supports those theme colors that make sense for this component. - */ - color: _propTypes2.default.oneOf(['default', 'inherit', 'primary', 'secondary']), - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - * The default value is a `button`. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the button will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the keyboard focus ripple will be disabled. - * `disableRipple` must also be true. - */ - disableFocusRipple: _propTypes2.default.bool, - /** - * If `true`, the ripple effect will be disabled. - */ - disableRipple: _propTypes2.default.bool, - /** - * If `true`, the button will take up the full width of its container. - */ - fullWidth: _propTypes2.default.bool, - /** - * The URL to link to when the button is clicked. - * If defined, an `a` element will be used as the root node. - */ - href: _propTypes2.default.string, - /** - * If `true`, and `variant` is `'fab'`, will use mini floating action button styling. - */ - mini: _propTypes2.default.bool, - /** - * The size of the button. - * `small` is equivalent to the dense button styling. - */ - size: _propTypes2.default.oneOf(['small', 'medium', 'large']), - /** - * @ignore - */ - type: _propTypes2.default.string, - /** - * The color of the component. It supports those theme colors that make sense for this component. - */ - variant: _propTypes2.default.oneOf(['flat', 'raised', 'fab']) -} : undefined; - -Button.defaultProps = { - color: 'default', - disabled: false, - disableFocusRipple: false, - disableRipple: false, - fullWidth: false, - mini: false, - size: 'medium', - type: 'button', - variant: 'flat' -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiButton' })(Button); - -/***/ }), - -/***/ "./node_modules/material-ui/Button/index.js": -/*!**************************************************!*\ - !*** ./node_modules/material-ui/Button/index.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Button = __webpack_require__(/*! ./Button */ "./node_modules/material-ui/Button/Button.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Button).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/ButtonBase/ButtonBase.js": -/*!***********************************************************!*\ - !*** ./node_modules/material-ui/ButtonBase/ButtonBase.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _keycode = __webpack_require__(/*! keycode */ "./node_modules/keycode/index.js"); - -var _keycode2 = _interopRequireDefault(_keycode); - -var _ownerWindow = __webpack_require__(/*! dom-helpers/ownerWindow */ "./node_modules/dom-helpers/ownerWindow.js"); - -var _ownerWindow2 = _interopRequireDefault(_ownerWindow); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _keyboardFocus = __webpack_require__(/*! ../utils/keyboardFocus */ "./node_modules/material-ui/utils/keyboardFocus.js"); - -var _TouchRipple = __webpack_require__(/*! ./TouchRipple */ "./node_modules/material-ui/ButtonBase/TouchRipple.js"); - -var _TouchRipple2 = _interopRequireDefault(_TouchRipple); - -var _createRippleHandler = __webpack_require__(/*! ./createRippleHandler */ "./node_modules/material-ui/ButtonBase/createRippleHandler.js"); - -var _createRippleHandler2 = _interopRequireDefault(_createRippleHandler); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = { - root: { - display: 'inline-flex', - alignItems: 'center', - justifyContent: 'center', - position: 'relative', - // Remove grey highlight - WebkitTapHighlightColor: 'transparent', - backgroundColor: 'transparent', // Reset default value - outline: 'none', - border: 0, - margin: 0, // Remove the margin in Safari - borderRadius: 0, - padding: 0, // Remove the padding in Firefox - cursor: 'pointer', - userSelect: 'none', - verticalAlign: 'middle', - '-moz-appearance': 'none', // Reset - '-webkit-appearance': 'none', // Reset - textDecoration: 'none', - // So we take precedent over the style of a native element. - color: 'inherit', - '&::-moz-focus-inner': { - borderStyle: 'none' // Remove Firefox dotted outline. - } - }, - disabled: { - pointerEvents: 'none', // Disable link interactions - cursor: 'default' - } -}; - -/** - * `ButtonBase` contains as few styles as possible. - * It aims to be a simple building block for creating a button. - * It contains a load of style reset and some focus/ripple logic. - */ - -var ButtonBase = function (_React$Component) { - (0, _inherits3.default)(ButtonBase, _React$Component); - - function ButtonBase() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, ButtonBase); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ButtonBase.__proto__ || (0, _getPrototypeOf2.default)(ButtonBase)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - keyboardFocused: false - }, _this.onKeyboardFocusHandler = function (event) { - _this.keyDown = false; - _this.setState({ keyboardFocused: true }); - - if (_this.props.onKeyboardFocus) { - _this.props.onKeyboardFocus(event); - } - }, _this.onRippleRef = function (node) { - _this.ripple = node; - }, _this.ripple = null, _this.keyDown = false, _this.button = null, _this.keyboardFocusTimeout = null, _this.keyboardFocusCheckTime = 50, _this.keyboardFocusMaxCheckTimes = 5, _this.handleKeyDown = function (event) { - var _this$props = _this.props, - component = _this$props.component, - focusRipple = _this$props.focusRipple, - onKeyDown = _this$props.onKeyDown, - onClick = _this$props.onClick; - - var key = (0, _keycode2.default)(event); - - // Check if key is already down to avoid repeats being counted as multiple activations - if (focusRipple && !_this.keyDown && _this.state.keyboardFocused && _this.ripple && key === 'space') { - _this.keyDown = true; - event.persist(); - _this.ripple.stop(event, function () { - _this.ripple.start(event); - }); - } - - if (onKeyDown) { - onKeyDown(event); - } - - // Keyboard accessibility for non interactive elements - if (event.target === event.currentTarget && component && component !== 'button' && (key === 'space' || key === 'enter')) { - event.preventDefault(); - if (onClick) { - onClick(event); - } - } - }, _this.handleKeyUp = function (event) { - if (_this.props.focusRipple && (0, _keycode2.default)(event) === 'space' && _this.ripple && _this.state.keyboardFocused) { - _this.keyDown = false; - event.persist(); - _this.ripple.stop(event, function () { - return _this.ripple.pulsate(event); - }); - } - if (_this.props.onKeyUp) { - _this.props.onKeyUp(event); - } - }, _this.handleMouseDown = (0, _createRippleHandler2.default)(_this, 'MouseDown', 'start', function () { - clearTimeout(_this.keyboardFocusTimeout); - (0, _keyboardFocus.focusKeyPressed)(false); - if (_this.state.keyboardFocused) { - _this.setState({ keyboardFocused: false }); - } - }), _this.handleMouseUp = (0, _createRippleHandler2.default)(_this, 'MouseUp', 'stop'), _this.handleMouseLeave = (0, _createRippleHandler2.default)(_this, 'MouseLeave', 'stop', function (event) { - if (_this.state.keyboardFocused) { - event.preventDefault(); - } - }), _this.handleTouchStart = (0, _createRippleHandler2.default)(_this, 'TouchStart', 'start'), _this.handleTouchEnd = (0, _createRippleHandler2.default)(_this, 'TouchEnd', 'stop'), _this.handleTouchMove = (0, _createRippleHandler2.default)(_this, 'TouchEnd', 'stop'), _this.handleBlur = (0, _createRippleHandler2.default)(_this, 'Blur', 'stop', function () { - clearTimeout(_this.keyboardFocusTimeout); - (0, _keyboardFocus.focusKeyPressed)(false); - _this.setState({ keyboardFocused: false }); - }), _this.handleFocus = function (event) { - if (_this.props.disabled) { - return; - } - - // Fix for https://github.com/facebook/react/issues/7769 - if (!_this.button) { - _this.button = event.currentTarget; - } - - event.persist(); - (0, _keyboardFocus.detectKeyboardFocus)(_this, _this.button, function () { - _this.onKeyboardFocusHandler(event); - }); - - if (_this.props.onFocus) { - _this.props.onFocus(event); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(ButtonBase, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.button = (0, _reactDom.findDOMNode)(this); - (0, _keyboardFocus.listenForFocusKeys)((0, _ownerWindow2.default)(this.button)); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - // The blur won't fire when the disabled state is set on a focused input. - // We need to book keep the focused state manually. - if (!this.props.disabled && nextProps.disabled && this.state.keyboardFocused) { - this.setState({ - keyboardFocused: false - }); - } - } - }, { - key: 'componentWillUpdate', - value: function componentWillUpdate(nextProps, nextState) { - if (this.props.focusRipple && nextState.keyboardFocused && !this.state.keyboardFocused && !this.props.disableRipple) { - this.ripple.pulsate(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.button = null; - clearTimeout(this.keyboardFocusTimeout); - } // Used to help track keyboard activation keyDown - - }, { - key: 'render', - value: function render() { - var _classNames; - - var _props = this.props, - buttonRef = _props.buttonRef, - centerRipple = _props.centerRipple, - children = _props.children, - classes = _props.classes, - classNameProp = _props.className, - component = _props.component, - disabled = _props.disabled, - disableRipple = _props.disableRipple, - focusRipple = _props.focusRipple, - keyboardFocusedClassName = _props.keyboardFocusedClassName, - onBlur = _props.onBlur, - onFocus = _props.onFocus, - onKeyboardFocus = _props.onKeyboardFocus, - onKeyDown = _props.onKeyDown, - onKeyUp = _props.onKeyUp, - onMouseDown = _props.onMouseDown, - onMouseLeave = _props.onMouseLeave, - onMouseUp = _props.onMouseUp, - onTouchEnd = _props.onTouchEnd, - onTouchMove = _props.onTouchMove, - onTouchStart = _props.onTouchStart, - tabIndex = _props.tabIndex, - type = _props.type, - other = (0, _objectWithoutProperties3.default)(_props, ['buttonRef', 'centerRipple', 'children', 'classes', 'className', 'component', 'disabled', 'disableRipple', 'focusRipple', 'keyboardFocusedClassName', 'onBlur', 'onFocus', 'onKeyboardFocus', 'onKeyDown', 'onKeyUp', 'onMouseDown', 'onMouseLeave', 'onMouseUp', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'tabIndex', 'type']); - - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, keyboardFocusedClassName || '', this.state.keyboardFocused), _classNames), classNameProp); - - var buttonProps = {}; - - var ComponentProp = component; - - if (!ComponentProp) { - if (other.href) { - ComponentProp = 'a'; - } else { - ComponentProp = 'button'; - } - } - - if (ComponentProp === 'button') { - buttonProps.type = type || 'button'; - buttonProps.disabled = disabled; - } else { - buttonProps.role = 'button'; - } - - return _react2.default.createElement( - ComponentProp, - (0, _extends3.default)({ - onBlur: this.handleBlur, - onFocus: this.handleFocus, - onKeyDown: this.handleKeyDown, - onKeyUp: this.handleKeyUp, - onMouseDown: this.handleMouseDown, - onMouseLeave: this.handleMouseLeave, - onMouseUp: this.handleMouseUp, - onTouchEnd: this.handleTouchEnd, - onTouchMove: this.handleTouchMove, - onTouchStart: this.handleTouchStart, - tabIndex: disabled ? '-1' : tabIndex, - className: className, - ref: buttonRef - }, buttonProps, other), - children, - !disableRipple && !disabled ? _react2.default.createElement(_TouchRipple2.default, { innerRef: this.onRippleRef, center: centerRipple }) : null - ); - } - }]); - return ButtonBase; -}(_react2.default.Component); - -ButtonBase.propTypes = true ? { - /** - * Use that property to pass a ref callback to the native button component. - */ - buttonRef: _propTypes2.default.func, - /** - * If `true`, the ripples will be centered. - * They won't start at the cursor interaction position. - */ - centerRipple: _propTypes2.default.bool, - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - * The default value is a `button`. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the base button will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the ripple effect will be disabled. - */ - disableRipple: _propTypes2.default.bool, - /** - * If `true`, the base button will have a keyboard focus ripple. - * `disableRipple` must also be `false`. - */ - focusRipple: _propTypes2.default.bool, - /** - * The CSS class applied while the component is keyboard focused. - */ - keyboardFocusedClassName: _propTypes2.default.string, - /** - * @ignore - */ - onBlur: _propTypes2.default.func, - /** - * @ignore - */ - onClick: _propTypes2.default.func, - /** - * @ignore - */ - onFocus: _propTypes2.default.func, - /** - * Callback fired when the component is focused with a keyboard. - * We trigger a `onFocus` callback too. - */ - onKeyboardFocus: _propTypes2.default.func, - /** - * @ignore - */ - onKeyDown: _propTypes2.default.func, - /** - * @ignore - */ - onKeyUp: _propTypes2.default.func, - /** - * @ignore - */ - onMouseDown: _propTypes2.default.func, - /** - * @ignore - */ - onMouseLeave: _propTypes2.default.func, - /** - * @ignore - */ - onMouseUp: _propTypes2.default.func, - /** - * @ignore - */ - onTouchEnd: _propTypes2.default.func, - /** - * @ignore - */ - onTouchMove: _propTypes2.default.func, - /** - * @ignore - */ - onTouchStart: _propTypes2.default.func, - /** - * @ignore - */ - role: _propTypes2.default.string, - /** - * @ignore - */ - tabIndex: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), - /** - * @ignore - */ - type: _propTypes2.default.string -} : undefined; - -ButtonBase.defaultProps = { - centerRipple: false, - disableRipple: false, - focusRipple: false, - tabIndex: '0', - type: 'button' -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiButtonBase' })(ButtonBase); - -/***/ }), - -/***/ "./node_modules/material-ui/ButtonBase/Ripple.js": -/*!*******************************************************!*\ - !*** ./node_modules/material-ui/ButtonBase/Ripple.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _Transition = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/Transition.js"); - -var _Transition2 = _interopRequireDefault(_Transition); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @ignore - internal component. - */ -var Ripple = function (_React$Component) { - (0, _inherits3.default)(Ripple, _React$Component); - - function Ripple() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Ripple); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Ripple.__proto__ || (0, _getPrototypeOf2.default)(Ripple)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - rippleVisible: false, - rippleLeaving: false - }, _this.handleEnter = function () { - _this.setState({ - rippleVisible: true - }); - }, _this.handleExit = function () { - _this.setState({ - rippleLeaving: true - }); - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Ripple, [{ - key: 'render', - value: function render() { - var _classNames, _classNames2; - - var _props = this.props, - classes = _props.classes, - classNameProp = _props.className, - pulsate = _props.pulsate, - rippleX = _props.rippleX, - rippleY = _props.rippleY, - rippleSize = _props.rippleSize, - other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'className', 'pulsate', 'rippleX', 'rippleY', 'rippleSize']); - var _state = this.state, - rippleVisible = _state.rippleVisible, - rippleLeaving = _state.rippleLeaving; - - - var className = (0, _classnames2.default)(classes.wrapper, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.wrapperLeaving, rippleLeaving), (0, _defineProperty3.default)(_classNames, classes.wrapperPulsating, pulsate), _classNames), classNameProp); - - var rippleClassName = (0, _classnames2.default)(classes.ripple, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.rippleVisible, rippleVisible), (0, _defineProperty3.default)(_classNames2, classes.rippleFast, pulsate), _classNames2)); - - var rippleStyles = { - width: rippleSize, - height: rippleSize, - top: -(rippleSize / 2) + rippleY, - left: -(rippleSize / 2) + rippleX - }; - - return _react2.default.createElement( - _Transition2.default, - (0, _extends3.default)({ onEnter: this.handleEnter, onExit: this.handleExit }, other), - _react2.default.createElement( - 'span', - { className: className }, - _react2.default.createElement('span', { className: rippleClassName, style: rippleStyles }) - ) - ); - } - }]); - return Ripple; -}(_react2.default.Component); - -Ripple.propTypes = true ? { - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element. - */ - pulsate: _propTypes2.default.bool, - /** - * Diameter of the ripple. - */ - rippleSize: _propTypes2.default.number, - /** - * Horizontal position of the ripple center. - */ - rippleX: _propTypes2.default.number, - /** - * Vertical position of the ripple center. - */ - rippleY: _propTypes2.default.number -} : undefined; - -Ripple.defaultProps = { - pulsate: false -}; - -exports.default = Ripple; - -/***/ }), - -/***/ "./node_modules/material-ui/ButtonBase/TouchRipple.js": -/*!************************************************************!*\ - !*** ./node_modules/material-ui/ButtonBase/TouchRipple.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = exports.DELAY_RIPPLE = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _toConsumableArray2 = __webpack_require__(/*! babel-runtime/helpers/toConsumableArray */ "./node_modules/babel-runtime/helpers/toConsumableArray.js"); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _TransitionGroup = __webpack_require__(/*! react-transition-group/TransitionGroup */ "./node_modules/react-transition-group/TransitionGroup.js"); - -var _TransitionGroup2 = _interopRequireDefault(_TransitionGroup); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Ripple = __webpack_require__(/*! ./Ripple */ "./node_modules/material-ui/ButtonBase/Ripple.js"); - -var _Ripple2 = _interopRequireDefault(_Ripple); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DURATION = 550; -var DELAY_RIPPLE = exports.DELAY_RIPPLE = 80; - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'block', - position: 'absolute', - overflow: 'hidden', - borderRadius: 'inherit', - width: '100%', - height: '100%', - left: 0, - top: 0, - pointerEvents: 'none', - zIndex: 0 - }, - wrapper: { - opacity: 1 - }, - wrapperLeaving: { - opacity: 0, - animation: 'mui-ripple-exit ' + DURATION + 'ms ' + theme.transitions.easing.easeInOut - }, - wrapperPulsating: { - position: 'absolute', - left: 0, - top: 0, - display: 'block', - width: '100%', - height: '100%', - animation: 'mui-ripple-pulsate 2500ms ' + theme.transitions.easing.easeInOut + ' 200ms infinite' - }, - '@keyframes mui-ripple-enter': { - '0%': { - transform: 'scale(0)' - }, - '100%': { - transform: 'scale(1)' - } - }, - '@keyframes mui-ripple-exit': { - '0%': { - opacity: 1 - }, - '100%': { - opacity: 0 - } - }, - '@keyframes mui-ripple-pulsate': { - '0%': { - transform: 'scale(1)' - }, - '50%': { - transform: 'scale(0.92)' - }, - '100%': { - transform: 'scale(1)' - } - }, - ripple: { - width: 50, - height: 50, - left: 0, - top: 0, - opacity: 0, - position: 'absolute', - borderRadius: '50%', - background: 'currentColor' - }, - rippleVisible: { - opacity: 0.3, - transform: 'scale(1)', - animation: 'mui-ripple-enter ' + DURATION + 'ms ' + theme.transitions.easing.easeInOut - }, - rippleFast: { - animationDuration: '200ms' - } - }; -}; - -/** - * @ignore - internal component. - */ - -var TouchRipple = function (_React$Component) { - (0, _inherits3.default)(TouchRipple, _React$Component); - - function TouchRipple() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, TouchRipple); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TouchRipple.__proto__ || (0, _getPrototypeOf2.default)(TouchRipple)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - nextKey: 0, - ripples: [] - }, _this.ignoringMouseDown = false, _this.startTimer = null, _this.startTimerCommit = null, _this.pulsate = function () { - _this.start({}, { pulsate: true }); - }, _this.start = function () { - var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var cb = arguments[2]; - var _options$pulsate = options.pulsate, - pulsate = _options$pulsate === undefined ? false : _options$pulsate, - _options$center = options.center, - center = _options$center === undefined ? _this.props.center || options.pulsate : _options$center, - _options$fakeElement = options.fakeElement, - fakeElement = _options$fakeElement === undefined ? false : _options$fakeElement; - - - if (event.type === 'mousedown' && _this.ignoringMouseDown) { - _this.ignoringMouseDown = false; - return; - } - - if (event.type === 'touchstart') { - _this.ignoringMouseDown = true; - } - - var element = fakeElement ? null : _reactDom2.default.findDOMNode(_this); - var rect = element ? element.getBoundingClientRect() : { - width: 0, - height: 0, - left: 0, - top: 0 - }; - - // Get the size of the ripple - var rippleX = void 0; - var rippleY = void 0; - var rippleSize = void 0; - - if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) { - rippleX = Math.round(rect.width / 2); - rippleY = Math.round(rect.height / 2); - } else { - var clientX = event.clientX ? event.clientX : event.touches[0].clientX; - var clientY = event.clientY ? event.clientY : event.touches[0].clientY; - rippleX = Math.round(clientX - rect.left); - rippleY = Math.round(clientY - rect.top); - } - - if (center) { - rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); - - // For some reason the animation is broken on Mobile Chrome if the size if even. - if (rippleSize % 2 === 0) { - rippleSize += 1; - } - } else { - var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2; - var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2; - rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2)); - } - - // Touche devices - if (event.touches) { - // Prepare the ripple effect. - _this.startTimerCommit = function () { - _this.startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb }); - }; - // Deplay the execution of the ripple effect. - _this.startTimer = setTimeout(function () { - _this.startTimerCommit(); - _this.startTimerCommit = null; - }, DELAY_RIPPLE); // We have to make a tradeoff with this value. - } else { - _this.startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb }); - } - }, _this.startCommit = function (params) { - var pulsate = params.pulsate, - rippleX = params.rippleX, - rippleY = params.rippleY, - rippleSize = params.rippleSize, - cb = params.cb; - - var ripples = _this.state.ripples; - - // Add a ripple to the ripples array. - ripples = [].concat((0, _toConsumableArray3.default)(ripples), [_react2.default.createElement(_Ripple2.default, { - key: _this.state.nextKey, - classes: _this.props.classes, - timeout: { - exit: DURATION, - enter: DURATION - }, - pulsate: pulsate, - rippleX: rippleX, - rippleY: rippleY, - rippleSize: rippleSize - })]); - - _this.setState({ - nextKey: _this.state.nextKey + 1, - ripples: ripples - }, cb); - }, _this.stop = function (event, cb) { - clearTimeout(_this.startTimer); - var ripples = _this.state.ripples; - - // The touch interaction occures to quickly. - // We still want to show ripple effect. - - if (event.type === 'touchend' && _this.startTimerCommit) { - event.persist(); - _this.startTimerCommit(); - _this.startTimerCommit = null; - _this.startTimer = setTimeout(function () { - _this.stop(event, cb); - }, 0); - return; - } - - _this.startTimerCommit = null; - - if (ripples && ripples.length) { - _this.setState({ - ripples: ripples.slice(1) - }, cb); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(TouchRipple, [{ - key: 'componentWillUnmount', - value: function componentWillUnmount() { - clearTimeout(this.startTimer); - } - - // Used to filter out mouse emulated events on mobile. - - // We use a timer in order to only show the ripples for touch "click" like events. - // We don't want to display the ripple for touch scroll events. - - // This is the hook called once the previous timeout is ready. - - }, { - key: 'render', - value: function render() { - var _props = this.props, - center = _props.center, - classes = _props.classes, - className = _props.className, - other = (0, _objectWithoutProperties3.default)(_props, ['center', 'classes', 'className']); - - - return _react2.default.createElement( - _TransitionGroup2.default, - (0, _extends3.default)({ - component: 'span', - enter: true, - exit: true, - className: (0, _classnames2.default)(classes.root, className) - }, other), - this.state.ripples - ); - } - }]); - return TouchRipple; -}(_react2.default.Component); - -TouchRipple.propTypes = true ? { - /** - * If `true`, the ripple starts at the center of the component - * rather than at the point of interaction. - */ - center: _propTypes2.default.bool, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string -} : undefined; - -TouchRipple.defaultProps = { - center: false -}; - -exports.default = (0, _withStyles2.default)(styles, { flip: false, name: 'MuiTouchRipple' })(TouchRipple); - -/***/ }), - -/***/ "./node_modules/material-ui/ButtonBase/createRippleHandler.js": -/*!********************************************************************!*\ - !*** ./node_modules/material-ui/ButtonBase/createRippleHandler.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -function createRippleHandler(instance, eventName, action, cb) { - return function handleEvent(event) { - if (cb) { - cb.call(instance, event); - } - - if (event.defaultPrevented) { - return false; - } - - if (instance.ripple) { - instance.ripple[action](event); - } - - if (instance.props && typeof instance.props['on' + eventName] === 'function') { - instance.props['on' + eventName](event); - } - - return true; - }; -} - -exports.default = createRippleHandler; - -/***/ }), - -/***/ "./node_modules/material-ui/ButtonBase/index.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/ButtonBase/index.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _ButtonBase = __webpack_require__(/*! ./ButtonBase */ "./node_modules/material-ui/ButtonBase/ButtonBase.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ButtonBase).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Form/FormControl.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/Form/FormControl.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Input = __webpack_require__(/*! ../Input/Input */ "./node_modules/material-ui/Input/Input.js"); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -var _reactHelpers = __webpack_require__(/*! ../utils/reactHelpers */ "./node_modules/material-ui/utils/reactHelpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'inline-flex', - flexDirection: 'column', - position: 'relative', - // Reset fieldset default style - minWidth: 0, - padding: 0, - margin: 0, - border: 0 - }, - marginNormal: { - marginTop: theme.spacing.unit * 2, - marginBottom: theme.spacing.unit - }, - marginDense: { - marginTop: theme.spacing.unit, - marginBottom: theme.spacing.unit / 2 - }, - fullWidth: { - width: '100%' - } - }; -}; - -/** - * Provides context such as dirty/focused/error/required for form inputs. - * Relying on the context provides high flexibilty and ensures that the state always stay - * consitent across the children of the `FormControl`. - * This context is used by the following components: - * - FormLabel - * - FormHelperText - * - Input - * - InputLabel - */ - -var FormControl = function (_React$Component) { - (0, _inherits3.default)(FormControl, _React$Component); - - function FormControl(props, context) { - (0, _classCallCheck3.default)(this, FormControl); - - // We need to iterate through the children and find the Input in order - // to fully support server side rendering. - var _this = (0, _possibleConstructorReturn3.default)(this, (FormControl.__proto__ || (0, _getPrototypeOf2.default)(FormControl)).call(this, props, context)); - - _this.state = { - adornedStart: false, - dirty: false, - focused: false - }; - - _this.handleFocus = function (event) { - if (_this.props.onFocus) { - _this.props.onFocus(event); - } - _this.setState(function (state) { - return !state.focused ? { focused: true } : null; - }); - }; - - _this.handleBlur = function (event) { - // The event might be undefined. - // For instance, a child component might call this hook - // when an input is disabled but still having the focus. - if (_this.props.onBlur && event) { - _this.props.onBlur(event); - } - _this.setState(function (state) { - return state.focused ? { focused: false } : null; - }); - }; - - _this.handleDirty = function () { - if (!_this.state.dirty) { - _this.setState({ dirty: true }); - } - }; - - _this.handleClean = function () { - if (_this.state.dirty) { - _this.setState({ dirty: false }); - } - }; - - var children = _this.props.children; - - if (children) { - _react2.default.Children.forEach(children, function (child) { - if ((0, _reactHelpers.isMuiElement)(child, ['Input', 'Select']) && (0, _Input.isDirty)(child.props, true)) { - _this.state.dirty = true; - } - if ((0, _reactHelpers.isMuiElement)(child, ['Input']) && (0, _Input.isAdornedStart)(child.props)) { - _this.state.adornedStart = true; - } - }); - } - return _this; - } - - (0, _createClass3.default)(FormControl, [{ - key: 'getChildContext', - value: function getChildContext() { - var _props = this.props, - disabled = _props.disabled, - error = _props.error, - required = _props.required, - margin = _props.margin; - var _state = this.state, - adornedStart = _state.adornedStart, - dirty = _state.dirty, - focused = _state.focused; - - - return { - muiFormControl: { - adornedStart: adornedStart, - dirty: dirty, - disabled: disabled, - error: error, - focused: focused, - margin: margin, - required: required, - onDirty: this.handleDirty, - onClean: this.handleClean, - onFocus: this.handleFocus, - onBlur: this.handleBlur - } - }; - } - }, { - key: 'render', - value: function render() { - var _classNames; - - var _props2 = this.props, - classes = _props2.classes, - className = _props2.className, - Component = _props2.component, - disabled = _props2.disabled, - error = _props2.error, - fullWidth = _props2.fullWidth, - margin = _props2.margin, - required = _props2.required, - other = (0, _objectWithoutProperties3.default)(_props2, ['classes', 'className', 'component', 'disabled', 'error', 'fullWidth', 'margin', 'required']); - - - return _react2.default.createElement(Component, (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['margin' + (0, _helpers.capitalize)(margin)], margin !== 'none'), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), _classNames), className) - }, other, { - onFocus: this.handleFocus, - onBlur: this.handleBlur - })); - } - }]); - return FormControl; -}(_react2.default.Component); - -FormControl.propTypes = true ? { - /** - * The contents of the form control. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the label, input and helper text should be displayed in a disabled state. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the label should be displayed in an error state. - */ - error: _propTypes2.default.bool, - /** - * If `true`, the component will take up the full width of its container. - */ - fullWidth: _propTypes2.default.bool, - /** - * If `dense` or `normal`, will adjust vertical spacing of this and contained components. - */ - margin: _propTypes2.default.oneOf(['none', 'dense', 'normal']), - /** - * @ignore - */ - onBlur: _propTypes2.default.func, - /** - * @ignore - */ - onFocus: _propTypes2.default.func, - /** - * If `true`, the label will indicate that the input is required. - */ - required: _propTypes2.default.bool -} : undefined; - -FormControl.defaultProps = { - component: 'div', - disabled: false, - error: false, - fullWidth: false, - margin: 'none', - required: false -}; - -FormControl.childContextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormControl' })(FormControl); - -/***/ }), - -/***/ "./node_modules/material-ui/Form/FormControlLabel.js": -/*!***********************************************************!*\ - !*** ./node_modules/material-ui/Form/FormControlLabel.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Typography = __webpack_require__(/*! ../Typography */ "./node_modules/material-ui/Typography/index.js"); - -var _Typography2 = _interopRequireDefault(_Typography); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'inline-flex', - alignItems: 'center', - cursor: 'pointer', - // For correct alignment with the text. - verticalAlign: 'middle', - // Remove grey highlight - WebkitTapHighlightColor: 'transparent', - marginLeft: -14, - marginRight: theme.spacing.unit * 2 // used for row presentation of radio/checkbox - }, - disabled: { - color: theme.palette.text.disabled, - cursor: 'default' - }, - label: {} - }; -}; - -/** - * Drop in replacement of the `Radio`, `Switch` and `Checkbox` component. - * Use this component if you want to display an extra label. - */ -/* eslint-disable jsx-a11y/label-has-for */ - -function FormControlLabel(props, context) { - var checked = props.checked, - classes = props.classes, - classNameProp = props.className, - control = props.control, - disabledProp = props.disabled, - inputRef = props.inputRef, - label = props.label, - name = props.name, - onChange = props.onChange, - value = props.value, - other = (0, _objectWithoutProperties3.default)(props, ['checked', 'classes', 'className', 'control', 'disabled', 'inputRef', 'label', 'name', 'onChange', 'value']); - var muiFormControl = context.muiFormControl; - - var disabled = disabledProp; - - if (typeof control.props.disabled !== 'undefined') { - if (typeof disabled === 'undefined') { - disabled = control.props.disabled; - } - } - - if (muiFormControl) { - if (typeof disabled === 'undefined') { - disabled = muiFormControl.disabled; - } - } - - var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp); - - return _react2.default.createElement( - 'label', - (0, _extends3.default)({ className: className }, other), - _react2.default.cloneElement(control, { - disabled: disabled, - checked: typeof control.props.checked === 'undefined' ? checked : control.props.checked, - name: control.props.name || name, - onChange: control.props.onChange || onChange, - value: control.props.value || value, - inputRef: control.props.inputRef || inputRef - }), - _react2.default.createElement( - _Typography2.default, - { component: 'span', className: classes.label }, - label - ) - ); -} - -FormControlLabel.propTypes = true ? { - /** - * If `true`, the component appears selected. - */ - checked: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.string]), - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * A control element. For instance, it can be be a `Radio`, a `Switch` or a `Checkbox`. - */ - control: _propTypes2.default.element, - /** - * If `true`, the control will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * Use that property to pass a ref callback to the native input component. - */ - inputRef: _propTypes2.default.func, - /** - * The text to be used in an enclosing label element. - */ - label: _propTypes2.default.node, - /* - * @ignore - */ - name: _propTypes2.default.string, - /** - * Callback fired when the state is changed. - * - * @param {object} event The event source of the callback - * @param {boolean} checked The `checked` value of the switch - */ - onChange: _propTypes2.default.func, - /** - * The value of the component. - */ - value: _propTypes2.default.string -} : undefined; - -FormControlLabel.contextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormControlLabel' })(FormControlLabel); - -/***/ }), - -/***/ "./node_modules/material-ui/Form/FormGroup.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/Form/FormGroup.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = { - root: { - display: 'flex', - flexDirection: 'column', - flexWrap: 'wrap' - }, - row: { - flexDirection: 'row' - } -}; - -/** - * `FormGroup` wraps controls such as `Checkbox` and `Switch`. - * It provides compact row layout. - * For the `Radio`, you should be using the `RadioGroup` component instead of this one. - */ -function FormGroup(props) { - var classes = props.classes, - className = props.className, - children = props.children, - row = props.row, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'children', 'row']); - - var rootClassName = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.row, row), className); - - return _react2.default.createElement( - 'div', - (0, _extends3.default)({ className: rootClassName }, other), - children - ); -} - -FormGroup.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * Display group of elements in a compact row. - */ - row: _propTypes2.default.bool -} : undefined; - -FormGroup.defaultProps = { - row: false -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormGroup' })(FormGroup); - -/***/ }), - -/***/ "./node_modules/material-ui/Form/FormHelperText.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/Form/FormHelperText.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - color: theme.palette.text.secondary, - fontFamily: theme.typography.fontFamily, - fontSize: theme.typography.pxToRem(12), - textAlign: 'left', - marginTop: theme.spacing.unit, - lineHeight: '1em', - minHeight: '1em', - margin: 0 - }, - dense: { - marginTop: theme.spacing.unit / 2 - }, - error: { - color: theme.palette.error.main - }, - disabled: { - color: theme.palette.text.disabled - } - }; -}; - -function FormHelperText(props, context) { - var _classNames; - - var classes = props.classes, - classNameProp = props.className, - disabledProp = props.disabled, - errorProp = props.error, - marginProp = props.margin, - Component = props.component, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'disabled', 'error', 'margin', 'component']); - var muiFormControl = context.muiFormControl; - - - var disabled = disabledProp; - var error = errorProp; - var margin = marginProp; - - if (muiFormControl) { - if (typeof disabled === 'undefined') { - disabled = muiFormControl.disabled; - } - - if (typeof error === 'undefined') { - error = muiFormControl.error; - } - - if (typeof margin === 'undefined') { - margin = muiFormControl.margin; - } - } - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), (0, _defineProperty3.default)(_classNames, classes.dense, margin === 'dense'), _classNames), classNameProp); - - return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other)); -} - -FormHelperText.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the helper text should be displayed in a disabled state. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, helper text should be displayed in an error state. - */ - error: _propTypes2.default.bool, - /** - * If `dense`, will adjust vertical spacing. This is normally obtained via context from - * FormControl. - */ - margin: _propTypes2.default.oneOf(['dense']) -} : undefined; - -FormHelperText.defaultProps = { - component: 'p' -}; - -FormHelperText.contextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormHelperText' })(FormHelperText); - -/***/ }), - -/***/ "./node_modules/material-ui/Form/FormLabel.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/Form/FormLabel.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - fontFamily: theme.typography.fontFamily, - color: theme.palette.text.secondary, - fontSize: theme.typography.pxToRem(16), - lineHeight: 1, - padding: 0 - }, - focused: { - color: theme.palette.primary[theme.palette.type === 'light' ? 'dark' : 'light'] - }, - error: { - color: theme.palette.error.main - }, - disabled: { - color: theme.palette.text.disabled - } - }; -}; - -function FormLabel(props, context) { - var _classNames; - - var children = props.children, - classes = props.classes, - classNameProp = props.className, - Component = props.component, - disabledProp = props.disabled, - errorProp = props.error, - focusedProp = props.focused, - requiredProp = props.required, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'component', 'disabled', 'error', 'focused', 'required']); - var muiFormControl = context.muiFormControl; - - - var required = requiredProp; - var focused = focusedProp; - var disabled = disabledProp; - var error = errorProp; - - if (muiFormControl) { - if (typeof required === 'undefined') { - required = muiFormControl.required; - } - if (typeof focused === 'undefined') { - focused = muiFormControl.focused; - } - if (typeof disabled === 'undefined') { - disabled = muiFormControl.disabled; - } - if (typeof error === 'undefined') { - error = muiFormControl.error; - } - } - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.focused, focused), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), _classNames), classNameProp); - - var asteriskClassName = (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.error, error)); - - return _react2.default.createElement( - Component, - (0, _extends3.default)({ className: className }, other), - children, - required && _react2.default.createElement( - 'span', - { className: asteriskClassName }, - '\u2009*' - ) - ); -} - -FormLabel.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the label should be displayed in a disabled state. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the label should be displayed in an error state. - */ - error: _propTypes2.default.bool, - /** - * If `true`, the input of this label is focused (used by `FormGroup` components). - */ - focused: _propTypes2.default.bool, - /** - * If `true`, the label will indicate that the input is required. - */ - required: _propTypes2.default.bool -} : undefined; - -FormLabel.defaultProps = { - component: 'label' -}; - -FormLabel.contextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormLabel' })(FormLabel); - -/***/ }), - -/***/ "./node_modules/material-ui/Form/index.js": -/*!************************************************!*\ - !*** ./node_modules/material-ui/Form/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _FormGroup = __webpack_require__(/*! ./FormGroup */ "./node_modules/material-ui/Form/FormGroup.js"); - -Object.defineProperty(exports, 'FormGroup', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FormGroup).default; - } -}); - -var _FormLabel = __webpack_require__(/*! ./FormLabel */ "./node_modules/material-ui/Form/FormLabel.js"); - -Object.defineProperty(exports, 'FormLabel', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FormLabel).default; - } -}); - -var _FormControl = __webpack_require__(/*! ./FormControl */ "./node_modules/material-ui/Form/FormControl.js"); - -Object.defineProperty(exports, 'FormControl', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FormControl).default; - } -}); - -var _FormHelperText = __webpack_require__(/*! ./FormHelperText */ "./node_modules/material-ui/Form/FormHelperText.js"); - -Object.defineProperty(exports, 'FormHelperText', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FormHelperText).default; - } -}); - -var _FormControlLabel = __webpack_require__(/*! ./FormControlLabel */ "./node_modules/material-ui/Form/FormControlLabel.js"); - -Object.defineProperty(exports, 'FormControlLabel', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FormControlLabel).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Input/Input.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Input/Input.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -exports.hasValue = hasValue; -exports.isDirty = isDirty; -exports.isAdornedStart = isAdornedStart; - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Textarea = __webpack_require__(/*! ./Textarea */ "./node_modules/material-ui/Input/Textarea.js"); - -var _Textarea2 = _interopRequireDefault(_Textarea); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Supports determination of isControlled(). -// Controlled input accepts its current value as a prop. -// -// @see https://facebook.github.io/react/docs/forms.html#controlled-components -// @param value -// @returns {boolean} true if string (including '') or number (including zero) -function hasValue(value) { - return value != null && !(Array.isArray(value) && value.length === 0); -} - -// Determine if field is dirty (a.k.a. filled). -// -// Response determines if label is presented above field or as placeholder. -// -// @param obj -// @param SSR -// @returns {boolean} False when not present or empty string. -// True when any number or string with length. -function isDirty(obj) { - var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== ''); -} - -// Determine if an Input is adorned on start. -// It's corresponding to the left with LTR. -// -// @param obj -// @returns {boolean} False when no adornments. -// True when adorned at the start. -function isAdornedStart(obj) { - return obj.startAdornment; -} - -var styles = exports.styles = function styles(theme) { - var light = theme.palette.type === 'light'; - var placeholder = { - color: 'currentColor', - opacity: light ? 0.42 : 0.5, - transition: theme.transitions.create('opacity', { - duration: theme.transitions.duration.shorter - }) - }; - var placeholderHidden = { - opacity: 0 - }; - var placeholderVisible = { - opacity: light ? 0.42 : 0.5 - }; - var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)'; - - return { - root: { - // Mimics the default input display property used by browsers for an input. - display: 'inline-flex', - position: 'relative', - fontFamily: theme.typography.fontFamily, - color: light ? 'rgba(0, 0, 0, 0.87)' : theme.palette.common.white, - fontSize: theme.typography.pxToRem(16), - lineHeight: '1.1875em' // Reset (19px), match the native input line-height - }, - formControl: { - 'label + &': { - marginTop: theme.spacing.unit * 2 - } - }, - inkbar: { - '&:after': { - backgroundColor: theme.palette.primary[light ? 'dark' : 'light'], - left: 0, - bottom: 0, - // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242 - content: '""', - height: 2, - position: 'absolute', - right: 0, - transform: 'scaleX(0)', - transition: theme.transitions.create('transform', { - duration: theme.transitions.duration.shorter, - easing: theme.transitions.easing.easeOut - }), - pointerEvents: 'none' // Transparent to the hover style. - }, - '&$focused:after': { - transform: 'scaleX(1)' - } - }, - error: { - '&:after': { - backgroundColor: theme.palette.error.main, - transform: 'scaleX(1)' // error is always underlined in red - } - }, - focused: {}, - disabled: { - color: theme.palette.text.disabled - }, - underline: { - '&:before': { - backgroundColor: bottomLineColor, - left: 0, - bottom: 0, - // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242 - content: '""', - height: 1, - position: 'absolute', - right: 0, - transition: theme.transitions.create('background-color', { - duration: theme.transitions.duration.shorter - }), - pointerEvents: 'none' // Transparent to the hover style. - }, - '&:hover:not($disabled):before': { - backgroundColor: theme.palette.text.primary, - height: 2 - }, - '&$disabled:before': { - background: 'transparent', - backgroundImage: 'linear-gradient(to right, ' + bottomLineColor + ' 33%, transparent 0%)', - backgroundPosition: 'left top', - backgroundRepeat: 'repeat-x', - backgroundSize: '5px 1px' - } - }, - multiline: { - padding: theme.spacing.unit - 2 + 'px 0 ' + (theme.spacing.unit - 1) + 'px' - }, - fullWidth: { - width: '100%' - }, - input: { - font: 'inherit', - color: 'currentColor', - padding: theme.spacing.unit - 2 + 'px 0 ' + (theme.spacing.unit - 1) + 'px', - border: 0, - boxSizing: 'content-box', - verticalAlign: 'middle', - background: 'none', - margin: 0, // Reset for Safari - // Remove grey highlight - WebkitTapHighlightColor: 'transparent', - display: 'block', - // Make the flex item shrink with Firefox - minWidth: 0, - width: '100%', - '&::-webkit-input-placeholder': placeholder, - '&::-moz-placeholder': placeholder, // Firefox 19+ - '&:-ms-input-placeholder': placeholder, // IE 11 - '&::-ms-input-placeholder': placeholder, // Edge - '&:focus': { - outline: 0 - }, - // Reset Firefox invalid required input style - '&:invalid': { - boxShadow: 'none' - }, - '&::-webkit-search-decoration': { - // Remove the padding when type=search. - '-webkit-appearance': 'none' - }, - // Show and hide the placeholder logic - 'label[data-shrink=false] + $formControl &': { - '&::-webkit-input-placeholder': placeholderHidden, - '&::-moz-placeholder': placeholderHidden, // Firefox 19+ - '&:-ms-input-placeholder': placeholderHidden, // IE 11 - '&::-ms-input-placeholder': placeholderHidden, // Edge - '&:focus::-webkit-input-placeholder': placeholderVisible, - '&:focus::-moz-placeholder': placeholderVisible, // Firefox 19+ - '&:focus:-ms-input-placeholder': placeholderVisible, // IE 11 - '&:focus::-ms-input-placeholder': placeholderVisible // Edge - } - }, - inputDense: { - paddingTop: theme.spacing.unit / 2 - 1 - }, - inputDisabled: { - opacity: 1 // Reset iOS opacity - }, - inputType: { - // type="date" or type="time", etc. have specific styles we need to reset. - height: '1.1875em' // Reset (19px), match the native input line-height - }, - inputMultiline: { - resize: 'none', - padding: 0 - }, - inputSearch: { - // Improve type search style. - '-moz-appearance': 'textfield', - '-webkit-appearance': 'textfield' - } - }; -}; - -function formControlState(props, context) { - var disabled = props.disabled; - var error = props.error; - var margin = props.margin; - - if (context && context.muiFormControl) { - if (typeof disabled === 'undefined') { - disabled = context.muiFormControl.disabled; - } - - if (typeof error === 'undefined') { - error = context.muiFormControl.error; - } - - if (typeof margin === 'undefined') { - margin = context.muiFormControl.margin; - } - } - - return { - disabled: disabled, - error: error, - margin: margin - }; -} - -var Input = function (_React$Component) { - (0, _inherits3.default)(Input, _React$Component); - - function Input() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Input); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Input.__proto__ || (0, _getPrototypeOf2.default)(Input)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - focused: false - }, _this.input = null, _this.handleFocus = function (event) { - // Fix an bug with IE11 where the focus/blur events are triggered - // while the input is disabled. - if (formControlState(_this.props, _this.context).disabled) { - event.stopPropagation(); - return; - } - - _this.setState({ focused: true }); - if (_this.props.onFocus) { - _this.props.onFocus(event); - } - }, _this.handleBlur = function (event) { - _this.setState({ focused: false }); - if (_this.props.onBlur) { - _this.props.onBlur(event); - } - }, _this.handleChange = function (event) { - if (!_this.isControlled) { - _this.checkDirty(_this.input); - } - - // Perform in the willUpdate - if (_this.props.onChange) { - _this.props.onChange(event); - } - }, _this.handleRefInput = function (node) { - _this.input = node; - - if (_this.props.inputRef) { - _this.props.inputRef(node); - } else if (_this.props.inputProps && _this.props.inputProps.ref) { - _this.props.inputProps.ref(node); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Input, [{ - key: 'getChildContext', - value: function getChildContext() { - // We are consuming the parent muiFormControl context. - // We don't want a child to consume it a second time. - return { - muiFormControl: null - }; - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - this.isControlled = this.props.value != null; - - if (this.isControlled) { - this.checkDirty(this.props); - } - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - if (!this.isControlled) { - this.checkDirty(this.input); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - // The blur won't fire when the disabled state is set on a focused input. - // We need to book keep the focused state manually. - if (!formControlState(this.props, this.context).disabled && formControlState(nextProps, nextContext).disabled) { - this.setState({ - focused: false - }); - } - } - }, { - key: 'componentWillUpdate', - value: function componentWillUpdate(nextProps, nextState, nextContext) { - if (this.isControlled) { - this.checkDirty(nextProps); - } // else performed in the onChange - - // Book keep the focused state. - if (!formControlState(this.props, this.context).disabled && formControlState(nextProps, nextContext).disabled) { - var muiFormControl = this.context.muiFormControl; - - if (muiFormControl && muiFormControl.onBlur) { - muiFormControl.onBlur(); - } - } - } - - // Holds the input reference - - }, { - key: 'checkDirty', - value: function checkDirty(obj) { - var muiFormControl = this.context.muiFormControl; - - - if (isDirty(obj)) { - if (muiFormControl && muiFormControl.onDirty) { - muiFormControl.onDirty(); - } - if (this.props.onDirty) { - this.props.onDirty(); - } - return; - } - - if (muiFormControl && muiFormControl.onClean) { - muiFormControl.onClean(); - } - if (this.props.onClean) { - this.props.onClean(); - } - } - }, { - key: 'render', - value: function render() { - var _classNames, _classNames2; - - var _props = this.props, - autoComplete = _props.autoComplete, - autoFocus = _props.autoFocus, - classes = _props.classes, - classNameProp = _props.className, - defaultValue = _props.defaultValue, - disabledProp = _props.disabled, - disableUnderline = _props.disableUnderline, - endAdornment = _props.endAdornment, - errorProp = _props.error, - fullWidth = _props.fullWidth, - id = _props.id, - inputComponent = _props.inputComponent, - _props$inputProps = _props.inputProps; - _props$inputProps = _props$inputProps === undefined ? {} : _props$inputProps; - var inputPropsClassName = _props$inputProps.className, - inputPropsProp = (0, _objectWithoutProperties3.default)(_props$inputProps, ['className']), - inputRef = _props.inputRef, - marginProp = _props.margin, - multiline = _props.multiline, - name = _props.name, - onBlur = _props.onBlur, - onChange = _props.onChange, - onClean = _props.onClean, - onDirty = _props.onDirty, - onFocus = _props.onFocus, - onKeyDown = _props.onKeyDown, - onKeyUp = _props.onKeyUp, - placeholder = _props.placeholder, - readOnly = _props.readOnly, - rows = _props.rows, - rowsMax = _props.rowsMax, - startAdornment = _props.startAdornment, - type = _props.type, - value = _props.value, - other = (0, _objectWithoutProperties3.default)(_props, ['autoComplete', 'autoFocus', 'classes', 'className', 'defaultValue', 'disabled', 'disableUnderline', 'endAdornment', 'error', 'fullWidth', 'id', 'inputComponent', 'inputProps', 'inputRef', 'margin', 'multiline', 'name', 'onBlur', 'onChange', 'onClean', 'onDirty', 'onFocus', 'onKeyDown', 'onKeyUp', 'placeholder', 'readOnly', 'rows', 'rowsMax', 'startAdornment', 'type', 'value']); - var muiFormControl = this.context.muiFormControl; - - var _formControlState = formControlState(this.props, this.context), - disabled = _formControlState.disabled, - error = _formControlState.error, - margin = _formControlState.margin; - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), (0, _defineProperty3.default)(_classNames, classes.focused, this.state.focused), (0, _defineProperty3.default)(_classNames, classes.formControl, muiFormControl), (0, _defineProperty3.default)(_classNames, classes.inkbar, !disableUnderline), (0, _defineProperty3.default)(_classNames, classes.multiline, multiline), (0, _defineProperty3.default)(_classNames, classes.underline, !disableUnderline), _classNames), classNameProp); - - var inputClassName = (0, _classnames2.default)(classes.input, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.inputDisabled, disabled), (0, _defineProperty3.default)(_classNames2, classes.inputType, type !== 'text'), (0, _defineProperty3.default)(_classNames2, classes.inputMultiline, multiline), (0, _defineProperty3.default)(_classNames2, classes.inputSearch, type === 'search'), (0, _defineProperty3.default)(_classNames2, classes.inputDense, margin === 'dense'), _classNames2), inputPropsClassName); - - var required = muiFormControl && muiFormControl.required === true; - - var InputComponent = 'input'; - var inputProps = (0, _extends3.default)({}, inputPropsProp, { - ref: this.handleRefInput - }); - - if (inputComponent) { - InputComponent = inputComponent; - inputProps = (0, _extends3.default)({ - // Rename ref to inputRef as we don't know the - // provided `inputComponent` structure. - inputRef: this.handleRefInput - }, inputProps, { - ref: null - }); - } else if (multiline) { - if (rows && !rowsMax) { - InputComponent = 'textarea'; - } else { - inputProps = (0, _extends3.default)({ - rowsMax: rowsMax, - textareaRef: this.handleRefInput - }, inputProps, { - ref: null - }); - InputComponent = _Textarea2.default; - } - } - - return _react2.default.createElement( - 'div', - (0, _extends3.default)({ onBlur: this.handleBlur, onFocus: this.handleFocus, className: className }, other), - startAdornment, - _react2.default.createElement(InputComponent, (0, _extends3.default)({ - autoComplete: autoComplete, - autoFocus: autoFocus, - className: inputClassName, - onChange: this.handleChange, - onKeyUp: onKeyUp, - onKeyDown: onKeyDown, - disabled: disabled, - required: required ? true : undefined, - value: value, - id: id, - name: name, - defaultValue: defaultValue, - placeholder: placeholder, - type: type, - readOnly: readOnly, - rows: rows, - 'aria-required': required, - 'aria-invalid': error - }, inputProps)), - endAdornment - ); - } - }]); - return Input; -}(_react2.default.Component); - -Input.propTypes = true ? { - /** - * This property helps users to fill forms faster, especially on mobile devices. - * The name can be confusing, as it's more like an autofill. - * You can learn more about it here: - * https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill - */ - autoComplete: _propTypes2.default.string, - /** - * If `true`, the input will be focused during the first mount. - */ - autoFocus: _propTypes2.default.bool, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * The CSS class name of the wrapper element. - */ - className: _propTypes2.default.string, - /** - * The default input value, useful when not controlling the component. - */ - defaultValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * If `true`, the input will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the input will not have an underline. - */ - disableUnderline: _propTypes2.default.bool, - /** - * End `InputAdornment` for this component. - */ - endAdornment: _propTypes2.default.node, - /** - * If `true`, the input will indicate an error. This is normally obtained via context from - * FormControl. - */ - error: _propTypes2.default.bool, - /** - * If `true`, the input will take up the full width of its container. - */ - fullWidth: _propTypes2.default.bool, - /** - * The id of the `input` element. - */ - id: _propTypes2.default.string, - /** - * The component used for the native input. - * Either a string to use a DOM element or a component. - */ - inputComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * Properties applied to the `input` element. - */ - inputProps: _propTypes2.default.object, - /** - * Use that property to pass a ref callback to the native input component. - */ - inputRef: _propTypes2.default.func, - /** - * If `dense`, will adjust vertical spacing. This is normally obtained via context from - * FormControl. - */ - margin: _propTypes2.default.oneOf(['dense', 'none']), - /** - * If `true`, a textarea element will be rendered. - */ - multiline: _propTypes2.default.bool, - /** - * Name attribute of the `input` element. - */ - name: _propTypes2.default.string, - /** - * @ignore - */ - onBlur: _propTypes2.default.func, - /** - * Callback fired when the value is changed. - * - * @param {object} event The event source of the callback - */ - onChange: _propTypes2.default.func, - /** - * TODO - */ - onClean: _propTypes2.default.func, - /** - * TODO - */ - onDirty: _propTypes2.default.func, - /** - * @ignore - */ - onFocus: _propTypes2.default.func, - /** - * @ignore - */ - onKeyDown: _propTypes2.default.func, - /** - * @ignore - */ - onKeyUp: _propTypes2.default.func, - /** - * The short hint displayed in the input before the user enters a value. - */ - placeholder: _propTypes2.default.string, - /** - * @ignore - */ - readOnly: _propTypes2.default.bool, - /** - * Number of rows to display when multiline option is set to true. - */ - rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Maximum number of rows to display when multiline option is set to true. - */ - rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Start `InputAdornment` for this component. - */ - startAdornment: _propTypes2.default.node, - /** - * Type of the input element. It should be a valid HTML5 input type. - */ - type: _propTypes2.default.string, - /** - * The input value, required for a controlled component. - */ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))]) -} : undefined; - -Input.muiName = 'Input'; - -Input.defaultProps = { - disableUnderline: false, - fullWidth: false, - multiline: false, - type: 'text' -}; - -Input.contextTypes = { - muiFormControl: _propTypes2.default.object -}; - -Input.childContextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiInput' })(Input); - -/***/ }), - -/***/ "./node_modules/material-ui/Input/InputAdornment.js": -/*!**********************************************************!*\ - !*** ./node_modules/material-ui/Input/InputAdornment.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _Typography = __webpack_require__(/*! ../Typography */ "./node_modules/material-ui/Typography/index.js"); - -var _Typography2 = _interopRequireDefault(_Typography); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'flex', - maxHeight: '2em', - alignItems: 'center' - }, - positionStart: { - marginRight: theme.spacing.unit - }, - positionEnd: { - marginLeft: theme.spacing.unit - } - }; -}; - -function InputAdornment(props) { - var _classNames; - - var children = props.children, - Component = props.component, - classes = props.classes, - className = props.className, - disableTypography = props.disableTypography, - position = props.position, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'component', 'classes', 'className', 'disableTypography', 'position']); - - - return _react2.default.createElement( - Component, - (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.positionStart, position === 'start'), (0, _defineProperty3.default)(_classNames, classes.positionEnd, position === 'end'), _classNames), className) - }, other), - typeof children === 'string' && !disableTypography ? _react2.default.createElement( - _Typography2.default, - { color: 'textSecondary' }, - children - ) : children - ); -} - -InputAdornment.propTypes = true ? { - /** - * The content of the component, normally an `IconButton` or string. - */ - children: _propTypes2.default.node.isRequired, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If children is a string then disable wrapping in a Typography component. - */ - disableTypography: _propTypes2.default.bool, - /** - * The position this adornment should appear relative to the `Input`. - */ - position: _propTypes2.default.oneOf(['start', 'end']) -} : undefined; - -InputAdornment.defaultProps = { - component: 'div', - disableTypography: false -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiInputAdornment' })(InputAdornment); - -/***/ }), - -/***/ "./node_modules/material-ui/Input/InputLabel.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/Input/InputLabel.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Form = __webpack_require__(/*! ../Form */ "./node_modules/material-ui/Form/index.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - transformOrigin: 'top left' - }, - formControl: { - position: 'absolute', - left: 0, - top: 0, - // slight alteration to spec spacing to match visual spec result - transform: 'translate(0, ' + theme.spacing.unit * 3 + 'px) scale(1)' - }, - labelDense: { - // Compensation for the `Input.inputDense` style. - transform: 'translate(0, ' + (theme.spacing.unit * 2.5 + 1) + 'px) scale(1)' - }, - shrink: { - transform: 'translate(0, 1.5px) scale(0.75)', - transformOrigin: 'top left' - }, - animated: { - transition: theme.transitions.create('transform', { - duration: theme.transitions.duration.shorter, - easing: theme.transitions.easing.easeOut - }) - }, - disabled: { - color: theme.palette.text.disabled - } - }; -}; // @inheritedComponent FormLabel - -function InputLabel(props, context) { - var _classNames; - - var children = props.children, - classes = props.classes, - classNameProp = props.className, - disableAnimation = props.disableAnimation, - disabled = props.disabled, - FormControlClasses = props.FormControlClasses, - marginProp = props.margin, - shrinkProp = props.shrink, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'disableAnimation', 'disabled', 'FormControlClasses', 'margin', 'shrink']); - var muiFormControl = context.muiFormControl; - - var shrink = shrinkProp; - - if (typeof shrink === 'undefined' && muiFormControl) { - shrink = muiFormControl.dirty || muiFormControl.focused || muiFormControl.adornedStart; - } - - var margin = marginProp; - if (typeof margin === 'undefined' && muiFormControl) { - margin = muiFormControl.margin; - } - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.formControl, muiFormControl), (0, _defineProperty3.default)(_classNames, classes.animated, !disableAnimation), (0, _defineProperty3.default)(_classNames, classes.shrink, shrink), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.labelDense, margin === 'dense'), _classNames), classNameProp); - - return _react2.default.createElement( - _Form.FormLabel, - (0, _extends3.default)({ 'data-shrink': shrink, className: className, classes: FormControlClasses }, other), - children - ); -} - -InputLabel.propTypes = true ? { - /** - * The contents of the `InputLabel`. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * If `true`, the transition animation is disabled. - */ - disableAnimation: _propTypes2.default.bool, - /** - * If `true`, apply disabled class. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the label will be displayed in an error state. - */ - error: _propTypes2.default.bool, - /** - * If `true`, the input of this label is focused. - */ - focused: _propTypes2.default.bool, - /** - * `classes` property applied to the `FormControl` element. - */ - FormControlClasses: _propTypes2.default.object, - /** - * If `dense`, will adjust vertical spacing. This is normally obtained via context from - * FormControl. - */ - margin: _propTypes2.default.oneOf(['dense']), - /** - * if `true`, the label will indicate that the input is required. - */ - required: _propTypes2.default.bool, - /** - * If `true`, the label is shrunk. - */ - shrink: _propTypes2.default.bool -} : undefined; - -InputLabel.defaultProps = { - disabled: false, - disableAnimation: false -}; - -InputLabel.contextTypes = { - muiFormControl: _propTypes2.default.object -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiInputLabel' })(InputLabel); - -/***/ }), - -/***/ "./node_modules/material-ui/Input/Textarea.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/Input/Textarea.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _debounce = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js"); - -var _debounce2 = _interopRequireDefault(_debounce); - -var _reactEventListener = __webpack_require__(/*! react-event-listener */ "./node_modules/react-event-listener/lib/index.js"); - -var _reactEventListener2 = _interopRequireDefault(_reactEventListener); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ROWS_HEIGHT = 19; - -var styles = exports.styles = { - root: { - position: 'relative', // because the shadow has position: 'absolute', - width: '100%' - }, - textarea: { - width: '100%', - height: '100%', - resize: 'none', - font: 'inherit', - padding: 0, - cursor: 'inherit', - boxSizing: 'border-box', - lineHeight: 'inherit', - border: 'none', - outline: 'none', - background: 'transparent' - }, - shadow: { - resize: 'none', - // Overflow also needed to here to remove the extra row - // added to textareas in Firefox. - overflow: 'hidden', - // Visibility needed to hide the extra text area on ipads - visibility: 'hidden', - position: 'absolute', - height: 'auto', - whiteSpace: 'pre-wrap' - } -}; - -/** - * @ignore - internal component. - */ - -var Textarea = function (_React$Component) { - (0, _inherits3.default)(Textarea, _React$Component); - - function Textarea() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Textarea); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Textarea.__proto__ || (0, _getPrototypeOf2.default)(Textarea)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - height: null - }, _this.shadow = null, _this.singlelineShadow = null, _this.input = null, _this.value = null, _this.handleResize = (0, _debounce2.default)(function (event) { - _this.syncHeightWithShadow(event); - }, 166), _this.handleRefInput = function (node) { - _this.input = node; - if (_this.props.textareaRef) { - _this.props.textareaRef(node); - } - }, _this.handleRefSinglelineShadow = function (node) { - _this.singlelineShadow = node; - }, _this.handleRefShadow = function (node) { - _this.shadow = node; - }, _this.handleChange = function (event) { - _this.value = event.target.value; - - if (typeof _this.props.value === 'undefined' && _this.shadow) { - // The component is not controlled, we need to update the shallow value. - _this.shadow.value = _this.value; - _this.syncHeightWithShadow(event); - } - - if (_this.props.onChange) { - _this.props.onChange(event); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Textarea, [{ - key: 'componentWillMount', - value: function componentWillMount() { - // expects the components it renders to respond to 'value' - // so that it can check whether they are dirty - this.value = this.props.value || this.props.defaultValue || ''; - this.setState({ - height: Number(this.props.rows) * ROWS_HEIGHT - }); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.syncHeightWithShadow(null); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.value !== this.props.value || Number(nextProps.rowsMax) !== Number(this.props.rowsMax)) { - this.syncHeightWithShadow(null, nextProps); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.handleResize.cancel(); - } - }, { - key: 'syncHeightWithShadow', - value: function syncHeightWithShadow(event) { - var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props; - - if (this.shadow && this.singlelineShadow) { - // The component is controlled, we need to update the shallow value. - if (typeof this.props.value !== 'undefined') { - this.shadow.value = props.value == null ? '' : String(props.value); - } - - var lineHeight = this.singlelineShadow.scrollHeight; - var newHeight = this.shadow.scrollHeight; - - // Guarding for jsdom, where scrollHeight isn't present. - // See https://github.com/tmpvar/jsdom/issues/1013 - if (newHeight === undefined) { - return; - } - - if (Number(props.rowsMax) >= Number(props.rows)) { - newHeight = Math.min(Number(props.rowsMax) * lineHeight, newHeight); - } - - newHeight = Math.max(newHeight, lineHeight); - - if (this.state.height !== newHeight) { - this.setState({ - height: newHeight - }); - } - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - classes = _props.classes, - className = _props.className, - defaultValue = _props.defaultValue, - onChange = _props.onChange, - rows = _props.rows, - rowsMax = _props.rowsMax, - textareaRef = _props.textareaRef, - value = _props.value, - other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'className', 'defaultValue', 'onChange', 'rows', 'rowsMax', 'textareaRef', 'value']); - - - return _react2.default.createElement( - 'div', - { className: classes.root, style: { height: this.state.height } }, - _react2.default.createElement(_reactEventListener2.default, { target: 'window', onResize: this.handleResize }), - _react2.default.createElement('textarea', { - ref: this.handleRefSinglelineShadow, - className: (0, _classnames2.default)(classes.shadow, classes.textarea), - tabIndex: -1, - rows: '1', - readOnly: true, - 'aria-hidden': 'true', - value: '' - }), - _react2.default.createElement('textarea', { - ref: this.handleRefShadow, - className: (0, _classnames2.default)(classes.shadow, classes.textarea), - tabIndex: -1, - rows: rows, - 'aria-hidden': 'true', - readOnly: true, - defaultValue: defaultValue, - value: value - }), - _react2.default.createElement('textarea', (0, _extends3.default)({ - rows: rows, - className: (0, _classnames2.default)(classes.textarea, className), - defaultValue: defaultValue, - value: value, - onChange: this.handleChange, - ref: this.handleRefInput - }, other)) - ); - } - }]); - return Textarea; -}(_react2.default.Component); - -Textarea.propTypes = true ? { - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * @ignore - */ - defaultValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * @ignore - */ - disabled: _propTypes2.default.bool, - /** - * @ignore - */ - onChange: _propTypes2.default.func, - /** - * Number of rows to display when multiline option is set to true. - */ - rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Maximum number of rows to display when multiline option is set to true. - */ - rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Use that property to pass a ref callback to the native textarea element. - */ - textareaRef: _propTypes2.default.func, - /** - * @ignore - */ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]) -} : undefined; - -Textarea.defaultProps = { - rows: 1 -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiTextarea' })(Textarea); - -/***/ }), - -/***/ "./node_modules/material-ui/Input/index.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Input/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Input = __webpack_require__(/*! ./Input */ "./node_modules/material-ui/Input/Input.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Input).default; - } -}); - -var _InputAdornment = __webpack_require__(/*! ./InputAdornment */ "./node_modules/material-ui/Input/InputAdornment.js"); - -Object.defineProperty(exports, 'InputAdornment', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_InputAdornment).default; - } -}); - -var _InputLabel = __webpack_require__(/*! ./InputLabel */ "./node_modules/material-ui/Input/InputLabel.js"); - -Object.defineProperty(exports, 'InputLabel', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_InputLabel).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/List/List.js": -/*!***********************************************!*\ - !*** ./node_modules/material-ui/List/List.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - listStyle: 'none', - margin: 0, - padding: 0, - position: 'relative' - }, - padding: { - paddingTop: theme.spacing.unit, - paddingBottom: theme.spacing.unit - }, - dense: { - paddingTop: theme.spacing.unit / 2, - paddingBottom: theme.spacing.unit / 2 - }, - subheader: { - paddingTop: 0 - } - }; -}; - -var List = function (_React$Component) { - (0, _inherits3.default)(List, _React$Component); - - function List() { - (0, _classCallCheck3.default)(this, List); - return (0, _possibleConstructorReturn3.default)(this, (List.__proto__ || (0, _getPrototypeOf2.default)(List)).apply(this, arguments)); - } - - (0, _createClass3.default)(List, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - dense: this.props.dense - }; - } - }, { - key: 'render', - value: function render() { - var _classNames; - - var _props = this.props, - children = _props.children, - classes = _props.classes, - classNameProp = _props.className, - Component = _props.component, - dense = _props.dense, - disablePadding = _props.disablePadding, - subheader = _props.subheader, - other = (0, _objectWithoutProperties3.default)(_props, ['children', 'classes', 'className', 'component', 'dense', 'disablePadding', 'subheader']); - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.dense, dense && !disablePadding), (0, _defineProperty3.default)(_classNames, classes.padding, !disablePadding), (0, _defineProperty3.default)(_classNames, classes.subheader, subheader), _classNames), classNameProp); - - return _react2.default.createElement( - Component, - (0, _extends3.default)({ className: className }, other), - subheader, - children - ); - } - }]); - return List; -}(_react2.default.Component); - -List.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, compact vertical padding designed for keyboard and mouse input will be used for - * the list and list items. The property is available to descendant components as the - * `dense` context. - */ - dense: _propTypes2.default.bool, - /** - * If `true`, vertical padding will be removed from the list. - */ - disablePadding: _propTypes2.default.bool, - /** - * The content of the subheader, normally `ListSubheader`. - */ - subheader: _propTypes2.default.node -} : undefined; - -List.defaultProps = { - component: 'ul', - dense: false, - disablePadding: false -}; - -List.childContextTypes = { - dense: _propTypes2.default.bool -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiList' })(List); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListItem.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/List/ListItem.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _ButtonBase = __webpack_require__(/*! ../ButtonBase */ "./node_modules/material-ui/ButtonBase/index.js"); - -var _ButtonBase2 = _interopRequireDefault(_ButtonBase); - -var _reactHelpers = __webpack_require__(/*! ../utils/reactHelpers */ "./node_modules/material-ui/utils/reactHelpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - position: 'relative', - textDecoration: 'none', - width: '100%', - boxSizing: 'border-box', - textAlign: 'left' - }, - container: { - position: 'relative' - }, - keyboardFocused: { - backgroundColor: theme.palette.action.hover - }, - default: { - paddingTop: 12, - paddingBottom: 12 - }, - dense: { - paddingTop: theme.spacing.unit, - paddingBottom: theme.spacing.unit - }, - disabled: { - opacity: 0.5 - }, - divider: { - borderBottom: '1px solid ' + theme.palette.divider, - backgroundClip: 'padding-box' - }, - gutters: { - paddingLeft: theme.spacing.unit * 2, - paddingRight: theme.spacing.unit * 2 - }, - button: { - transition: theme.transitions.create('background-color', { - duration: theme.transitions.duration.shortest - }), - '&:hover': { - textDecoration: 'none', - backgroundColor: theme.palette.action.hover, - // Reset on mouse devices - '@media (hover: none)': { - backgroundColor: 'transparent' - } - } - }, - secondaryAction: { - // Add some space to avoid collision as `ListItemSecondaryAction` - // is absolutely positionned. - paddingRight: theme.spacing.unit * 4 - } - }; -}; - -var ListItem = function (_React$Component) { - (0, _inherits3.default)(ListItem, _React$Component); - - function ListItem() { - (0, _classCallCheck3.default)(this, ListItem); - return (0, _possibleConstructorReturn3.default)(this, (ListItem.__proto__ || (0, _getPrototypeOf2.default)(ListItem)).apply(this, arguments)); - } - - (0, _createClass3.default)(ListItem, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - dense: this.props.dense || this.context.dense || false - }; - } - }, { - key: 'render', - value: function render() { - var _classNames; - - var _props = this.props, - button = _props.button, - childrenProp = _props.children, - classes = _props.classes, - classNameProp = _props.className, - componentProp = _props.component, - ContainerComponent = _props.ContainerComponent, - ContainerProps = _props.ContainerProps, - dense = _props.dense, - disabled = _props.disabled, - disableGutters = _props.disableGutters, - divider = _props.divider, - other = (0, _objectWithoutProperties3.default)(_props, ['button', 'children', 'classes', 'className', 'component', 'ContainerComponent', 'ContainerProps', 'dense', 'disabled', 'disableGutters', 'divider']); - - - var isDense = dense || this.context.dense || false; - var children = _react2.default.Children.toArray(childrenProp); - var hasAvatar = children.some(function (value) { - return (0, _reactHelpers.isMuiElement)(value, ['ListItemAvatar']); - }); - var hasSecondaryAction = children.length && (0, _reactHelpers.isMuiElement)(children[children.length - 1], ['ListItemSecondaryAction']); - - var className = (0, _classnames2.default)(classes.root, isDense || hasAvatar ? classes.dense : classes.default, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.gutters, !disableGutters), (0, _defineProperty3.default)(_classNames, classes.divider, divider), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.button, button), (0, _defineProperty3.default)(_classNames, classes.secondaryAction, hasSecondaryAction), _classNames), classNameProp); - - var componentProps = (0, _extends3.default)({ className: className, disabled: disabled }, other); - var Component = componentProp || 'li'; - - if (button) { - componentProps.component = componentProp || 'div'; - componentProps.keyboardFocusedClassName = classes.keyboardFocused; - Component = _ButtonBase2.default; - } - - if (hasSecondaryAction) { - Component = Component !== _ButtonBase2.default && !componentProp ? 'div' : Component; - - return _react2.default.createElement( - ContainerComponent, - (0, _extends3.default)({ className: classes.container }, ContainerProps), - _react2.default.createElement( - Component, - componentProps, - children - ), - children.pop() - ); - } - - return _react2.default.createElement( - Component, - componentProps, - children - ); - } - }]); - return ListItem; -}(_react2.default.Component); - -ListItem.propTypes = true ? { - /** - * If `true`, the list item will be a button (using `ButtonBase`). - */ - button: _propTypes2.default.bool, - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - * By default, it's a `li` when `button` is `false` and a `div` when `button` is `true`. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * The container component. Useful when a `ListItemSecondaryAction` is rendered. - */ - ContainerComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * Properties applied to the container element when the component - * is used to display a `ListItemSecondaryAction`. - */ - ContainerProps: _propTypes2.default.object, - /** - * If `true`, compact vertical padding designed for keyboard and mouse input will be used. - */ - dense: _propTypes2.default.bool, - /** - * @ignore - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the left and right padding is removed. - */ - disableGutters: _propTypes2.default.bool, - /** - * If `true`, a 1px light border is added to the bottom of the list item. - */ - divider: _propTypes2.default.bool -} : undefined; - -ListItem.defaultProps = { - button: false, - ContainerComponent: 'li', - dense: false, - disabled: false, - disableGutters: false, - divider: false -}; - -ListItem.contextTypes = { - dense: _propTypes2.default.bool -}; - -ListItem.childContextTypes = { - dense: _propTypes2.default.bool -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItem' })(ListItem); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListItemAvatar.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/List/ListItemAvatar.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - width: 36, - height: 36, - fontSize: theme.typography.pxToRem(18), - marginRight: 4 - }, - icon: { - width: 20, - height: 20, - fontSize: theme.typography.pxToRem(20) - } - }; -}; - -/** - * It's a simple wrapper to apply the `dense` mode styles to `Avatar`. - */ -function ListItemAvatar(props, context) { - var children = props.children, - classes = props.classes, - classNameProp = props.className, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']); - - - if (context.dense === undefined) { - true ? (0, _warning2.default)(false, 'Material-UI: is a simple wrapper to apply the dense styles\n to . You do not need it unless you are controlling the dense property.') : undefined; - return props.children; - } - - return _react2.default.cloneElement(children, (0, _extends3.default)({ - className: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.root, context.dense), classNameProp, children.props.className), - childrenClassName: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.icon, context.dense), children.props.childrenClassName) - }, other)); -} - -ListItemAvatar.propTypes = true ? { - /** - * The content of the component, normally `Avatar`. - */ - children: _propTypes2.default.element.isRequired, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string -} : undefined; - -ListItemAvatar.contextTypes = { - dense: _propTypes2.default.bool -}; - -ListItemAvatar.muiName = 'ListItemAvatar'; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemAvatar' })(ListItemAvatar); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListItemIcon.js": -/*!*******************************************************!*\ - !*** ./node_modules/material-ui/List/ListItemIcon.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - height: 24, - marginRight: theme.spacing.unit * 2, - width: 24, - color: theme.palette.action.active, - flexShrink: 0 - } - }; -}; - -/** - * A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`. - */ -function ListItemIcon(props) { - var children = props.children, - classes = props.classes, - classNameProp = props.className, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']); - - - return _react2.default.cloneElement(children, (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.root, classNameProp, children.props.className) - }, other)); -} - -ListItemIcon.propTypes = true ? { - /** - * The content of the component, normally `Icon`, `SvgIcon`, - * or a `material-ui-icons` SVG icon component. - */ - children: _propTypes2.default.element.isRequired, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string -} : undefined; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemIcon' })(ListItemIcon); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListItemSecondaryAction.js": -/*!******************************************************************!*\ - !*** ./node_modules/material-ui/List/ListItemSecondaryAction.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - position: 'absolute', - right: 4, - top: '50%', - marginTop: -theme.spacing.unit * 3 - } - }; -}; - -function ListItemSecondaryAction(props) { - var children = props.children, - classes = props.classes, - className = props.className, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']); - - - return _react2.default.createElement( - 'div', - (0, _extends3.default)({ className: (0, _classnames2.default)(classes.root, className) }, other), - children - ); -} - -ListItemSecondaryAction.propTypes = true ? { - /** - * The content of the component, normally an `IconButton` or selection control. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string -} : undefined; - -ListItemSecondaryAction.muiName = 'ListItemSecondaryAction'; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemSecondaryAction' })(ListItemSecondaryAction); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListItemText.js": -/*!*******************************************************!*\ - !*** ./node_modules/material-ui/List/ListItemText.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Typography = __webpack_require__(/*! ../Typography */ "./node_modules/material-ui/Typography/index.js"); - -var _Typography2 = _interopRequireDefault(_Typography); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - flex: '1 1 auto', - minWidth: 0, - padding: '0 16px', - '&:first-child': { - paddingLeft: 0 - } - }, - inset: { - '&:first-child': { - paddingLeft: theme.spacing.unit * 7 - } - }, - dense: { - fontSize: theme.typography.pxToRem(13) - }, - primary: { - '&$textDense': { - fontSize: 'inherit' - } - }, - secondary: { - '&$textDense': { - fontSize: 'inherit' - } - }, - textDense: {} - }; -}; - -function ListItemText(props, context) { - var _classNames; - - var classes = props.classes, - classNameProp = props.className, - disableTypography = props.disableTypography, - inset = props.inset, - primary = props.primary, - secondary = props.secondary, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'disableTypography', 'inset', 'primary', 'secondary']); - var dense = context.dense; - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.dense, dense), (0, _defineProperty3.default)(_classNames, classes.inset, inset), _classNames), classNameProp); - - return _react2.default.createElement( - 'div', - (0, _extends3.default)({ className: className }, other), - primary && (disableTypography ? primary : _react2.default.createElement( - _Typography2.default, - { - variant: 'subheading', - className: (0, _classnames2.default)(classes.primary, (0, _defineProperty3.default)({}, classes.textDense, dense)) - }, - primary - )), - secondary && (disableTypography ? secondary : _react2.default.createElement( - _Typography2.default, - { - variant: 'body1', - className: (0, _classnames2.default)(classes.secondary, (0, _defineProperty3.default)({}, classes.textDense, dense)), - color: 'textSecondary' - }, - secondary - )) - ); -} - -ListItemText.propTypes = true ? { - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * If `true`, the children won't be wrapped by a typography component. - * For instance, that can be useful to can render an h4 instead of a - */ - disableTypography: _propTypes2.default.bool, - /** - * If `true`, the children will be indented. - * This should be used if there is no left avatar or left icon. - */ - inset: _propTypes2.default.bool, - primary: _propTypes2.default.node, - secondary: _propTypes2.default.node -} : undefined; - -ListItemText.defaultProps = { - disableTypography: false, - inset: false, - primary: false, - secondary: false -}; - -ListItemText.contextTypes = { - dense: _propTypes2.default.bool -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemText' })(ListItemText); - -/***/ }), - -/***/ "./node_modules/material-ui/List/ListSubheader.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/List/ListSubheader.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - boxSizing: 'border-box', - lineHeight: '48px', - listStyle: 'none', - paddingLeft: theme.spacing.unit * 2, - paddingRight: theme.spacing.unit * 2, - color: theme.palette.text.secondary, - fontFamily: theme.typography.fontFamily, - fontWeight: theme.typography.fontWeightMedium, - fontSize: theme.typography.pxToRem(theme.typography.fontSize) - }, - colorPrimary: { - color: theme.palette.primary.main - }, - colorInherit: { - color: 'inherit' - }, - inset: { - paddingLeft: theme.spacing.unit * 9 - }, - sticky: { - position: 'sticky', - top: 0, - zIndex: 1, - backgroundColor: 'inherit' - } - }; -}; - -function ListSubheader(props) { - var _classNames; - - var classes = props.classes, - classNameProp = props.className, - color = props.color, - Component = props.component, - disableSticky = props.disableSticky, - inset = props.inset, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'component', 'disableSticky', 'inset']); - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.inset, inset), (0, _defineProperty3.default)(_classNames, classes.sticky, !disableSticky), _classNames), classNameProp); - - return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other)); -} - -ListSubheader.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The color of the component. It supports those theme colors that make sense for this component. - */ - color: _propTypes2.default.oneOf(['default', 'primary', 'inherit']), - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the List Subheader will not stick to the top during scroll. - */ - disableSticky: _propTypes2.default.bool, - /** - * If `true`, the List Subheader will be indented. - */ - inset: _propTypes2.default.bool -} : undefined; - -ListSubheader.defaultProps = { - color: 'default', - component: 'li', - disableSticky: false, - inset: false -}; - -ListSubheader.muiName = 'ListSubheader'; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiListSubheader' })(ListSubheader); - -/***/ }), - -/***/ "./node_modules/material-ui/List/index.js": -/*!************************************************!*\ - !*** ./node_modules/material-ui/List/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _List = __webpack_require__(/*! ./List */ "./node_modules/material-ui/List/List.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_List).default; - } -}); - -var _ListItem = __webpack_require__(/*! ./ListItem */ "./node_modules/material-ui/List/ListItem.js"); - -Object.defineProperty(exports, 'ListItem', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListItem).default; - } -}); - -var _ListItemAvatar = __webpack_require__(/*! ./ListItemAvatar */ "./node_modules/material-ui/List/ListItemAvatar.js"); - -Object.defineProperty(exports, 'ListItemAvatar', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListItemAvatar).default; - } -}); - -var _ListItemText = __webpack_require__(/*! ./ListItemText */ "./node_modules/material-ui/List/ListItemText.js"); - -Object.defineProperty(exports, 'ListItemText', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListItemText).default; - } -}); - -var _ListItemIcon = __webpack_require__(/*! ./ListItemIcon */ "./node_modules/material-ui/List/ListItemIcon.js"); - -Object.defineProperty(exports, 'ListItemIcon', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListItemIcon).default; - } -}); - -var _ListItemSecondaryAction = __webpack_require__(/*! ./ListItemSecondaryAction */ "./node_modules/material-ui/List/ListItemSecondaryAction.js"); - -Object.defineProperty(exports, 'ListItemSecondaryAction', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListItemSecondaryAction).default; - } -}); - -var _ListSubheader = __webpack_require__(/*! ./ListSubheader */ "./node_modules/material-ui/List/ListSubheader.js"); - -Object.defineProperty(exports, 'ListSubheader', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ListSubheader).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Menu/Menu.js": -/*!***********************************************!*\ - !*** ./node_modules/material-ui/Menu/Menu.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _scrollbarSize = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js"); - -var _scrollbarSize2 = _interopRequireDefault(_scrollbarSize); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Popover = __webpack_require__(/*! ../Popover */ "./node_modules/material-ui/Popover/index.js"); - -var _Popover2 = _interopRequireDefault(_Popover); - -var _MenuList = __webpack_require__(/*! ./MenuList */ "./node_modules/material-ui/Menu/MenuList.js"); - -var _MenuList2 = _interopRequireDefault(_MenuList); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var RTL_ORIGIN = { - vertical: 'top', - horizontal: 'right' -}; // @inheritedComponent Popover - -var LTR_ORIGIN = { - vertical: 'top', - horizontal: 'left' -}; - -var styles = exports.styles = { - paper: { - // specZ: The maximum height of a simple menu should be one or more rows less than the view - // height. This ensures a tappable area outside of the simple menu with which to dismiss - // the menu. - maxHeight: 'calc(100vh - 96px)', - // Add iOS momentum scrolling. - WebkitOverflowScrolling: 'touch' - } -}; - -var Menu = function (_React$Component) { - (0, _inherits3.default)(Menu, _React$Component); - - function Menu() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Menu); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Menu.__proto__ || (0, _getPrototypeOf2.default)(Menu)).call.apply(_ref, [this].concat(args))), _this), _this.getContentAnchorEl = function () { - if (!_this.menuList || !_this.menuList.selectedItem) { - return (0, _reactDom.findDOMNode)(_this.menuList).firstChild; - } - - return (0, _reactDom.findDOMNode)(_this.menuList.selectedItem); - }, _this.menuList = undefined, _this.focus = function () { - if (_this.menuList && _this.menuList.selectedItem) { - (0, _reactDom.findDOMNode)(_this.menuList.selectedItem).focus(); - return; - } - - var menuList = (0, _reactDom.findDOMNode)(_this.menuList); - if (menuList && menuList.firstChild) { - menuList.firstChild.focus(); - } - }, _this.handleEnter = function (element) { - var theme = _this.props.theme; - - var menuList = (0, _reactDom.findDOMNode)(_this.menuList); - - // Focus so the scroll computation of the Popover works as expected. - _this.focus(); - - // Let's ignore that piece of logic if users are already overriding the width - // of the menu. - if (menuList && element.clientHeight < menuList.clientHeight && !menuList.style.width) { - var size = (0, _scrollbarSize2.default)() + 'px'; - menuList.style[theme.direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = size; - menuList.style.width = 'calc(100% + ' + size + ')'; - } - - if (_this.props.onEnter) { - _this.props.onEnter(element); - } - }, _this.handleListKeyDown = function (event, key) { - if (key === 'tab') { - event.preventDefault(); - - if (_this.props.onClose) { - _this.props.onClose(event); - } - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Menu, [{ - key: 'componentDidMount', - value: function componentDidMount() { - if (this.props.open) { - this.focus(); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - children = _props.children, - classes = _props.classes, - MenuListProps = _props.MenuListProps, - onEnter = _props.onEnter, - _props$PaperProps = _props.PaperProps, - PaperProps = _props$PaperProps === undefined ? {} : _props$PaperProps, - PopoverClasses = _props.PopoverClasses, - theme = _props.theme, - other = (0, _objectWithoutProperties3.default)(_props, ['children', 'classes', 'MenuListProps', 'onEnter', 'PaperProps', 'PopoverClasses', 'theme']); - - - return _react2.default.createElement( - _Popover2.default, - (0, _extends3.default)({ - getContentAnchorEl: this.getContentAnchorEl, - classes: PopoverClasses, - onEnter: this.handleEnter, - anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN, - transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN, - PaperProps: (0, _extends3.default)({}, PaperProps, { - classes: (0, _extends3.default)({}, PaperProps.classes, { - root: classes.paper - }) - }) - }, other), - _react2.default.createElement( - _MenuList2.default, - (0, _extends3.default)({ - role: 'menu', - onKeyDown: this.handleListKeyDown - }, MenuListProps, { - ref: function ref(node) { - _this2.menuList = node; - } - }), - children - ) - ); - } - }]); - return Menu; -}(_react2.default.Component); - -Menu.propTypes = true ? { - /** - * The DOM element used to set the position of the menu. - */ - anchorEl: _propTypes2.default.object, - /** - * Menu contents, normally `MenuItem`s. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * Properties applied to the `MenuList` element. - */ - MenuListProps: _propTypes2.default.object, - /** - * Callback fired when the component requests to be closed. - * - * @param {object} event The event source of the callback - */ - onClose: _propTypes2.default.func, - /** - * Callback fired before the Menu enters. - */ - onEnter: _propTypes2.default.func, - /** - * Callback fired when the Menu has entered. - */ - onEntered: _propTypes2.default.func, - /** - * Callback fired when the Menu is entering. - */ - onEntering: _propTypes2.default.func, - /** - * Callback fired before the Menu exits. - */ - onExit: _propTypes2.default.func, - /** - * Callback fired when the Menu has exited. - */ - onExited: _propTypes2.default.func, - /** - * Callback fired when the Menu is exiting. - */ - onExiting: _propTypes2.default.func, - /** - * If `true`, the menu is visible. - */ - open: _propTypes2.default.bool.isRequired, - /** - * @ignore - */ - PaperProps: _propTypes2.default.object, - /** - * `classes` property applied to the `Popover` element. - */ - PopoverClasses: _propTypes2.default.object, - /** - * @ignore - */ - theme: _propTypes2.default.object.isRequired, - /** - * The length of the transition in `ms`, or 'auto' - */ - transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])]) -} : undefined; - -Menu.defaultProps = { - transitionDuration: 'auto' -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiMenu', withTheme: true })(Menu); - -/***/ }), - -/***/ "./node_modules/material-ui/Menu/MenuList.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/Menu/MenuList.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _toConsumableArray2 = __webpack_require__(/*! babel-runtime/helpers/toConsumableArray */ "./node_modules/babel-runtime/helpers/toConsumableArray.js"); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _keycode = __webpack_require__(/*! keycode */ "./node_modules/keycode/index.js"); - -var _keycode2 = _interopRequireDefault(_keycode); - -var _contains = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"); - -var _contains2 = _interopRequireDefault(_contains); - -var _activeElement = __webpack_require__(/*! dom-helpers/activeElement */ "./node_modules/dom-helpers/activeElement.js"); - -var _activeElement2 = _interopRequireDefault(_activeElement); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _List = __webpack_require__(/*! ../List */ "./node_modules/material-ui/List/index.js"); - -var _List2 = _interopRequireDefault(_List); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// @inheritedComponent List - -var MenuList = function (_React$Component) { - (0, _inherits3.default)(MenuList, _React$Component); - - function MenuList() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, MenuList); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = MenuList.__proto__ || (0, _getPrototypeOf2.default)(MenuList)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - currentTabIndex: undefined - }, _this.list = undefined, _this.selectedItem = undefined, _this.blurTimer = undefined, _this.handleBlur = function (event) { - _this.blurTimer = setTimeout(function () { - if (_this.list) { - var list = (0, _reactDom.findDOMNode)(_this.list); - var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list)); - if (!(0, _contains2.default)(list, currentFocus)) { - _this.resetTabIndex(); - } - } - }, 30); - - if (_this.props.onBlur) { - _this.props.onBlur(event); - } - }, _this.handleKeyDown = function (event) { - var list = (0, _reactDom.findDOMNode)(_this.list); - var key = (0, _keycode2.default)(event); - var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list)); - - if ((key === 'up' || key === 'down') && (!currentFocus || currentFocus && !(0, _contains2.default)(list, currentFocus))) { - if (_this.selectedItem) { - (0, _reactDom.findDOMNode)(_this.selectedItem).focus(); - } else { - list.firstChild.focus(); - } - } else if (key === 'down') { - event.preventDefault(); - if (currentFocus.nextElementSibling) { - currentFocus.nextElementSibling.focus(); - } - } else if (key === 'up') { - event.preventDefault(); - if (currentFocus.previousElementSibling) { - currentFocus.previousElementSibling.focus(); - } - } - - if (_this.props.onKeyDown) { - _this.props.onKeyDown(event, key); - } - }, _this.handleItemFocus = function (event) { - var list = (0, _reactDom.findDOMNode)(_this.list); - if (list) { - for (var i = 0; i < list.children.length; i += 1) { - if (list.children[i] === event.currentTarget) { - _this.setTabIndex(i); - break; - } - } - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(MenuList, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.resetTabIndex(); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - clearTimeout(this.blurTimer); - } - }, { - key: 'setTabIndex', - value: function setTabIndex(index) { - this.setState({ currentTabIndex: index }); - } - }, { - key: 'focus', - value: function focus() { - var currentTabIndex = this.state.currentTabIndex; - - var list = (0, _reactDom.findDOMNode)(this.list); - if (!list || !list.children || !list.firstChild) { - return; - } - - if (currentTabIndex && currentTabIndex >= 0) { - list.children[currentTabIndex].focus(); - } else { - list.firstChild.focus(); - } - } - }, { - key: 'resetTabIndex', - value: function resetTabIndex() { - var list = (0, _reactDom.findDOMNode)(this.list); - var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list)); - var items = [].concat((0, _toConsumableArray3.default)(list.children)); - var currentFocusIndex = items.indexOf(currentFocus); - - if (currentFocusIndex !== -1) { - return this.setTabIndex(currentFocusIndex); - } - - if (this.selectedItem) { - return this.setTabIndex(items.indexOf((0, _reactDom.findDOMNode)(this.selectedItem))); - } - - return this.setTabIndex(0); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - children = _props.children, - className = _props.className, - onBlur = _props.onBlur, - onKeyDown = _props.onKeyDown, - other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'onBlur', 'onKeyDown']); - - - return _react2.default.createElement( - _List2.default, - (0, _extends3.default)({ - role: 'menu', - ref: function ref(node) { - _this2.list = node; - }, - className: className, - onKeyDown: this.handleKeyDown, - onBlur: this.handleBlur - }, other), - _react2.default.Children.map(children, function (child, index) { - if (!_react2.default.isValidElement(child)) { - return null; - } - - return _react2.default.cloneElement(child, { - tabIndex: index === _this2.state.currentTabIndex ? 0 : -1, - ref: child.props.selected ? function (node) { - _this2.selectedItem = node; - } : undefined, - onFocus: _this2.handleItemFocus - }); - }) - ); - } - }]); - return MenuList; -}(_react2.default.Component); - -MenuList.propTypes = true ? { - /** - * MenuList contents, normally `MenuItem`s. - */ - children: _propTypes2.default.node, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * @ignore - */ - onBlur: _propTypes2.default.func, - /** - * @ignore - */ - onKeyDown: _propTypes2.default.func -} : undefined; - -exports.default = MenuList; - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/Backdrop.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/Modal/Backdrop.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Fade = __webpack_require__(/*! ../transitions/Fade */ "./node_modules/material-ui/transitions/Fade.js"); - -var _Fade2 = _interopRequireDefault(_Fade); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = { - root: { - zIndex: -1, - width: '100%', - height: '100%', - position: 'fixed', - top: 0, - left: 0, - // Remove grey highlight - WebkitTapHighlightColor: 'transparent', - willChange: 'opacity', - backgroundColor: 'rgba(0, 0, 0, 0.5)' - }, - invisible: { - backgroundColor: 'transparent' - } -}; - -function Backdrop(props) { - var classes = props.classes, - invisible = props.invisible, - open = props.open, - transitionDuration = props.transitionDuration, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'invisible', 'open', 'transitionDuration']); - - - var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.invisible, invisible)); - - return _react2.default.createElement( - _Fade2.default, - (0, _extends3.default)({ appear: true, 'in': open, timeout: transitionDuration }, other), - _react2.default.createElement('div', { className: className, 'aria-hidden': 'true' }) - ); -} - -Backdrop.propTypes = true ? { - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * If `true`, the backdrop is invisible. - * It can be used when rendering a popover or a custom select component. - */ - invisible: _propTypes2.default.bool, - /** - * If `true`, the backdrop is open. - */ - open: _propTypes2.default.bool.isRequired, - /** - * The duration for the transition, in milliseconds. - * You may specify a single timeout for all transitions, or individually with an object. - */ - transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number })]) -} : undefined; - -Backdrop.defaultProps = { - invisible: false -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiBackdrop' })(Backdrop); - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/Modal.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Modal/Modal.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _keycode = __webpack_require__(/*! keycode */ "./node_modules/keycode/index.js"); - -var _keycode2 = _interopRequireDefault(_keycode); - -var _activeElement = __webpack_require__(/*! dom-helpers/activeElement */ "./node_modules/dom-helpers/activeElement.js"); - -var _activeElement2 = _interopRequireDefault(_activeElement); - -var _contains = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"); - -var _contains2 = _interopRequireDefault(_contains); - -var _inDOM = __webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"); - -var _inDOM2 = _interopRequireDefault(_inDOM); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _RefHolder = __webpack_require__(/*! ../internal/RefHolder */ "./node_modules/material-ui/internal/RefHolder.js"); - -var _RefHolder2 = _interopRequireDefault(_RefHolder); - -var _Portal = __webpack_require__(/*! ../Portal */ "./node_modules/material-ui/Portal/index.js"); - -var _Portal2 = _interopRequireDefault(_Portal); - -var _addEventListener = __webpack_require__(/*! ../utils/addEventListener */ "./node_modules/material-ui/utils/addEventListener.js"); - -var _addEventListener2 = _interopRequireDefault(_addEventListener); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _ModalManager = __webpack_require__(/*! ./ModalManager */ "./node_modules/material-ui/Modal/ModalManager.js"); - -var _ModalManager2 = _interopRequireDefault(_ModalManager); - -var _Backdrop = __webpack_require__(/*! ./Backdrop */ "./node_modules/material-ui/Modal/Backdrop.js"); - -var _Backdrop2 = _interopRequireDefault(_Backdrop); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getContainer(container, defaultContainer) { - container = typeof container === 'function' ? container() : container; - return _reactDom2.default.findDOMNode(container) || defaultContainer; -} // @inheritedComponent Portal - -function getHasTransition(props) { - return props.children ? props.children.props.hasOwnProperty('in') : false; -} - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'flex', - width: '100%', - height: '100%', - position: 'fixed', - zIndex: theme.zIndex.modal, - top: 0, - left: 0 - }, - hidden: { - visibility: 'hidden' - } - }; -}; - -var Modal = function (_React$Component) { - (0, _inherits3.default)(Modal, _React$Component); - - function Modal(props, context) { - (0, _classCallCheck3.default)(this, Modal); - - var _this = (0, _possibleConstructorReturn3.default)(this, (Modal.__proto__ || (0, _getPrototypeOf2.default)(Modal)).call(this, props, context)); - - _this.dialog = null; - _this.mounted = false; - _this.mountNode = null; - - _this.handleRendered = function () { - _this.autoFocus(); - - if (_this.props.onRendered) { - _this.props.onRendered(); - } - }; - - _this.handleOpen = function () { - var doc = (0, _ownerDocument2.default)(_this.mountNode); - var container = getContainer(_this.props.container, doc.body); - - _this.props.manager.add(_this, container); - _this.onDocumentKeydownListener = (0, _addEventListener2.default)(doc, 'keydown', _this.handleDocumentKeyDown); - _this.onFocusinListener = (0, _addEventListener2.default)(doc, 'focus', _this.enforceFocus, true); - }; - - _this.handleClose = function () { - _this.props.manager.remove(_this); - _this.onDocumentKeydownListener.remove(); - _this.onFocusinListener.remove(); - _this.restoreLastFocus(); - }; - - _this.handleExited = function () { - _this.setState({ exited: true }); - _this.handleClose(); - }; - - _this.handleBackdropClick = function (event) { - if (event.target !== event.currentTarget) { - return; - } - - if (_this.props.onBackdropClick) { - _this.props.onBackdropClick(event); - } - - if (!_this.props.disableBackdropClick && _this.props.onClose) { - _this.props.onClose(event, 'backdropClick'); - } - }; - - _this.handleDocumentKeyDown = function (event) { - if (!_this.isTopModal() || (0, _keycode2.default)(event) !== 'esc') { - return; - } - - if (_this.props.onEscapeKeyDown) { - _this.props.onEscapeKeyDown(event); - } - - if (!_this.props.disableEscapeKeyDown && _this.props.onClose) { - _this.props.onClose(event, 'escapeKeyDown'); - } - }; - - _this.checkForFocus = function () { - if (_inDOM2.default) { - _this.lastFocus = (0, _activeElement2.default)(); - } - }; - - _this.enforceFocus = function () { - if (_this.props.disableEnforceFocus || !_this.mounted || !_this.isTopModal()) { - return; - } - - var dialogElement = _this.getDialogElement(); - var currentActiveElement = (0, _activeElement2.default)((0, _ownerDocument2.default)(_this.mountNode)); - - if (dialogElement && !(0, _contains2.default)(dialogElement, currentActiveElement)) { - dialogElement.focus(); - } - }; - - _this.state = { - exited: !_this.props.open - }; - return _this; - } - - (0, _createClass3.default)(Modal, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.mounted = true; - if (this.props.open) { - this.handleOpen(); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.open) { - this.setState({ exited: false }); - } else if (!getHasTransition(nextProps)) { - // Otherwise let handleExited take care of marking exited. - this.setState({ exited: true }); - } - } - }, { - key: 'componentWillUpdate', - value: function componentWillUpdate(nextProps) { - if (!this.props.open && nextProps.open) { - this.checkForFocus(); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (prevProps.open && !this.props.open && !getHasTransition(this.props)) { - // Otherwise handleExited will call this. - this.handleClose(); - } else if (!prevProps.open && this.props.open) { - this.handleOpen(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.mounted = false; - - if (this.props.open || getHasTransition(this.props) && !this.state.exited) { - this.handleClose(); - } - } - }, { - key: 'getDialogElement', - value: function getDialogElement() { - return _reactDom2.default.findDOMNode(this.dialog); - } - }, { - key: 'autoFocus', - value: function autoFocus() { - if (this.props.disableAutoFocus) { - return; - } - - var dialogElement = this.getDialogElement(); - var currentActiveElement = (0, _activeElement2.default)((0, _ownerDocument2.default)(this.mountNode)); - - if (dialogElement && !(0, _contains2.default)(dialogElement, currentActiveElement)) { - this.lastFocus = currentActiveElement; - - if (!dialogElement.hasAttribute('tabIndex')) { - true ? (0, _warning2.default)(false, ['Material-UI: the modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n')) : undefined; - dialogElement.setAttribute('tabIndex', -1); - } - - dialogElement.focus(); - } - } - }, { - key: 'restoreLastFocus', - value: function restoreLastFocus() { - if (this.props.disableRestoreFocus) { - return; - } - - if (this.lastFocus) { - this.lastFocus.focus(); - this.lastFocus = null; - } - } - }, { - key: 'isTopModal', - value: function isTopModal() { - return this.props.manager.isTopModal(this); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - BackdropComponent = _props.BackdropComponent, - BackdropProps = _props.BackdropProps, - children = _props.children, - classes = _props.classes, - className = _props.className, - container = _props.container, - disableAutoFocus = _props.disableAutoFocus, - disableBackdropClick = _props.disableBackdropClick, - disableEnforceFocus = _props.disableEnforceFocus, - disableEscapeKeyDown = _props.disableEscapeKeyDown, - disableRestoreFocus = _props.disableRestoreFocus, - hideBackdrop = _props.hideBackdrop, - keepMounted = _props.keepMounted, - onBackdropClick = _props.onBackdropClick, - onClose = _props.onClose, - onEscapeKeyDown = _props.onEscapeKeyDown, - onRendered = _props.onRendered, - open = _props.open, - manager = _props.manager, - other = (0, _objectWithoutProperties3.default)(_props, ['BackdropComponent', 'BackdropProps', 'children', 'classes', 'className', 'container', 'disableAutoFocus', 'disableBackdropClick', 'disableEnforceFocus', 'disableEscapeKeyDown', 'disableRestoreFocus', 'hideBackdrop', 'keepMounted', 'onBackdropClick', 'onClose', 'onEscapeKeyDown', 'onRendered', 'open', 'manager']); - var exited = this.state.exited; - - var hasTransition = getHasTransition(this.props); - var childProps = {}; - - if (!keepMounted && !open && (!hasTransition || exited)) { - return null; - } - - // It's a Transition like component - if (hasTransition) { - childProps.onExited = (0, _helpers.createChainedFunction)(this.handleExited, children.props.onExited); - } - - if (children.props.role === undefined) { - childProps.role = children.props.role || 'document'; - } - - if (children.props.tabIndex === undefined) { - childProps.tabIndex = children.props.tabIndex || '-1'; - } - - return _react2.default.createElement( - _Portal2.default, - { - ref: function ref(node) { - _this2.mountNode = node ? node.getMountNode() : node; - }, - container: container, - onRendered: this.handleRendered - }, - _react2.default.createElement( - 'div', - (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.root, className, (0, _defineProperty3.default)({}, classes.hidden, exited)) - }, other), - hideBackdrop ? null : _react2.default.createElement(BackdropComponent, (0, _extends3.default)({ open: open, onClick: this.handleBackdropClick }, BackdropProps)), - _react2.default.createElement( - _RefHolder2.default, - { - ref: function ref(node) { - _this2.dialog = node; - } - }, - _react2.default.cloneElement(children, childProps) - ) - ) - ); - } - }]); - return Modal; -}(_react2.default.Component); - -Modal.propTypes = true ? { - /** - * A backdrop component. Useful for custom backdrop rendering. - */ - BackdropComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * Properties applied to the `Backdrop` element. - */ - BackdropProps: _propTypes2.default.object, - /** - * A single child content element. - */ - children: _propTypes2.default.element, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * A node, component instance, or function that returns either. - * The `container` will have the portal children appended to it. - */ - container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]), - /** - * If `true`, the modal will not automatically shift focus to itself when it opens, and - * replace it to the last focused element when it closes. - * This also works correctly with any modal children that have the `disableAutoFocus` prop. - * - * Generally this should never be set to `true` as it makes the modal less - * accessible to assistive technologies, like screen readers. - */ - disableAutoFocus: _propTypes2.default.bool, - /** - * If `true`, clicking the backdrop will not fire any callback. - */ - disableBackdropClick: _propTypes2.default.bool, - /** - * If `true`, the modal will not prevent focus from leaving the modal while open. - * - * Generally this should never be set to `true` as it makes the modal less - * accessible to assistive technologies, like screen readers. - */ - disableEnforceFocus: _propTypes2.default.bool, - /** - * If `true`, hitting escape will not fire any callback. - */ - disableEscapeKeyDown: _propTypes2.default.bool, - /** - * If `true`, the modal will not restore focus to previously focused element once - * modal is hidden. - */ - disableRestoreFocus: _propTypes2.default.bool, - /** - * If `true`, the backdrop is not rendered. - */ - hideBackdrop: _propTypes2.default.bool, - /** - * Always keep the children in the DOM. - * This property can be useful in SEO situation or - * when you want to maximize the responsiveness of the Modal. - */ - keepMounted: _propTypes2.default.bool, - /** - * A modal manager used to track and manage the state of open - * Modals. Useful when customizing how modals interact within a container. - */ - manager: _propTypes2.default.object, - /** - * Callback fired when the backdrop is clicked. - */ - onBackdropClick: _propTypes2.default.func, - /** - * Callback fired when the component requests to be closed. - * The `reason` parameter can optionally be used to control the response to `onClose`. - * - * @param {object} event The event source of the callback - * @param {string} reason Can be:`"escapeKeyDown"`, `"backdropClick"` - */ - onClose: _propTypes2.default.func, - /** - * Callback fired when the escape key is pressed, - * `disableEscapeKeyDown` is false and the modal is in focus. - */ - onEscapeKeyDown: _propTypes2.default.func, - /** - * Callback fired once the children has been mounted into the `container`. - * It signals that the `open={true}` property took effect. - */ - onRendered: _propTypes2.default.func, - /** - * If `true`, the modal is open. - */ - open: _propTypes2.default.bool.isRequired -} : undefined; - -Modal.defaultProps = { - disableAutoFocus: false, - disableBackdropClick: false, - disableEnforceFocus: false, - disableEscapeKeyDown: false, - disableRestoreFocus: false, - hideBackdrop: false, - keepMounted: false, - // Modals don't open on the server so this won't conflict with concurrent requests. - manager: new _ModalManager2.default(), - BackdropComponent: _Backdrop2.default -}; - -exports.default = (0, _withStyles2.default)(styles, { flip: false, name: 'MuiModal' })(Modal); - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/ModalManager.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/Modal/ModalManager.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -var _style = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js"); - -var _style2 = _interopRequireDefault(_style); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _scrollbarSize = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js"); - -var _scrollbarSize2 = _interopRequireDefault(_scrollbarSize); - -var _isOverflowing = __webpack_require__(/*! ./isOverflowing */ "./node_modules/material-ui/Modal/isOverflowing.js"); - -var _isOverflowing2 = _interopRequireDefault(_isOverflowing); - -var _manageAriaHidden = __webpack_require__(/*! ./manageAriaHidden */ "./node_modules/material-ui/Modal/manageAriaHidden.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function findIndexOf(data, callback) { - var idx = -1; - data.some(function (item, index) { - if (callback(item)) { - idx = index; - return true; - } - return false; - }); - return idx; -} - -function findContainer(data, modal) { - return findIndexOf(data, function (item) { - return item.modals.indexOf(modal) !== -1; - }); -} - -function getPaddingRight(node) { - return parseInt((0, _style2.default)(node, 'paddingRight') || 0, 10); -} - -function setContainerStyle(data, container) { - var style = { overflow: 'hidden' }; - - // We are only interested in the actual `style` here because we will override it. - data.style = { - overflow: container.style.overflow, - paddingRight: container.style.paddingRight - }; - - if (data.overflowing) { - var scrollbarSize = (0, _scrollbarSize2.default)(); - - // Use computed style, here to get the real padding to add our scrollbar width. - style.paddingRight = getPaddingRight(container) + scrollbarSize + 'px'; - - // .mui-fixed is a global helper. - var fixedNodes = (0, _ownerDocument2.default)(container).querySelectorAll('.mui-fixed'); - for (var i = 0; i < fixedNodes.length; i += 1) { - var paddingRight = getPaddingRight(fixedNodes[i]); - data.prevPaddings.push(paddingRight); - fixedNodes[i].style.paddingRight = paddingRight + scrollbarSize + 'px'; - } - } - - (0, _keys2.default)(style).forEach(function (key) { - container.style[key] = style[key]; - }); -} - -function removeContainerStyle(data, container) { - (0, _keys2.default)(data.style).forEach(function (key) { - container.style[key] = data.style[key]; - }); - - var fixedNodes = (0, _ownerDocument2.default)(container).querySelectorAll('.mui-fixed'); - for (var i = 0; i < fixedNodes.length; i += 1) { - fixedNodes[i].style.paddingRight = data.prevPaddings[i] + 'px'; - } -} -/** - * @ignore - do not document. - * - * Proper state managment for containers and the modals in those containers. - * Simplified, but inspired by react-overlay's ModalManager class - * Used by the Modal to ensure proper styling of containers. - */ - -var ModalManager = function ModalManager() { - var _this = this; - - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$hideSiblingNodes = _ref.hideSiblingNodes, - hideSiblingNodes = _ref$hideSiblingNodes === undefined ? true : _ref$hideSiblingNodes, - _ref$handleContainerO = _ref.handleContainerOverflow, - handleContainerOverflow = _ref$handleContainerO === undefined ? true : _ref$handleContainerO; - - (0, _classCallCheck3.default)(this, ModalManager); - - this.add = function (modal, container) { - var modalIdx = _this.modals.indexOf(modal); - var containerIdx = _this.containers.indexOf(container); - - if (modalIdx !== -1) { - return modalIdx; - } - - modalIdx = _this.modals.length; - _this.modals.push(modal); - - if (_this.hideSiblingNodes) { - (0, _manageAriaHidden.hideSiblings)(container, modal.mountNode); - } - - if (containerIdx !== -1) { - _this.data[containerIdx].modals.push(modal); - return modalIdx; - } - - var data = { - modals: [modal], - overflowing: (0, _isOverflowing2.default)(container), - prevPaddings: [] - }; - - if (_this.handleContainerOverflow) { - setContainerStyle(data, container); - } - - _this.containers.push(container); - _this.data.push(data); - - return modalIdx; - }; - - this.remove = function (modal) { - var modalIdx = _this.modals.indexOf(modal); - - if (modalIdx === -1) { - return modalIdx; - } - - var containerIdx = findContainer(_this.data, modal); - var data = _this.data[containerIdx]; - var container = _this.containers[containerIdx]; - - data.modals.splice(data.modals.indexOf(modal), 1); - _this.modals.splice(modalIdx, 1); - - // If that was the last modal in a container, clean up the container. - if (data.modals.length === 0) { - if (_this.handleContainerOverflow) { - removeContainerStyle(data, container); - } - - if (_this.hideSiblingNodes) { - (0, _manageAriaHidden.showSiblings)(container, modal.mountNode); - } - _this.containers.splice(containerIdx, 1); - _this.data.splice(containerIdx, 1); - } else if (_this.hideSiblingNodes) { - // Otherwise make sure the next top modal is visible to a SR. - (0, _manageAriaHidden.ariaHidden)(false, data.modals[data.modals.length - 1].mountNode); - } - - return modalIdx; - }; - - this.isTopModal = function (modal) { - return !!_this.modals.length && _this.modals[_this.modals.length - 1] === modal; - }; - - this.hideSiblingNodes = hideSiblingNodes; - this.handleContainerOverflow = handleContainerOverflow; - // this.modals[modalIdx] = modal - this.modals = []; - // this.containers[containerIdx] = container - this.containers = []; - // this.data[containerIdx] = { - // modals: [], - // } - this.data = []; -}; - -exports.default = ModalManager; - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/index.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Modal/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Modal = __webpack_require__(/*! ./Modal */ "./node_modules/material-ui/Modal/Modal.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Modal).default; - } -}); - -var _Backdrop = __webpack_require__(/*! ./Backdrop */ "./node_modules/material-ui/Modal/Backdrop.js"); - -Object.defineProperty(exports, 'Backdrop', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Backdrop).default; - } -}); - -var _ModalManager = __webpack_require__(/*! ./ModalManager */ "./node_modules/material-ui/Modal/ModalManager.js"); - -Object.defineProperty(exports, 'ModalManager', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ModalManager).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/isOverflowing.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/Modal/isOverflowing.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isBody = isBody; -exports.default = isOverflowing; - -var _isWindow = __webpack_require__(/*! dom-helpers/query/isWindow */ "./node_modules/dom-helpers/query/isWindow.js"); - -var _isWindow2 = _interopRequireDefault(_isWindow); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _ownerWindow = __webpack_require__(/*! dom-helpers/ownerWindow */ "./node_modules/dom-helpers/ownerWindow.js"); - -var _ownerWindow2 = _interopRequireDefault(_ownerWindow); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isBody(node) { - return node && node.tagName.toLowerCase() === 'body'; -} - -// Do we have a scroll bar? -function isOverflowing(container) { - var doc = (0, _ownerDocument2.default)(container); - var win = (0, _ownerWindow2.default)(doc); - - /* istanbul ignore next */ - if (!(0, _isWindow2.default)(doc) && !isBody(container)) { - return container.scrollHeight > container.clientHeight; - } - - // Takes in account potential non zero margin on the body. - var style = win.getComputedStyle(doc.body); - var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10); - var marginRight = parseInt(style.getPropertyValue('margin-right'), 10); - - return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth; -} - -/***/ }), - -/***/ "./node_modules/material-ui/Modal/manageAriaHidden.js": -/*!************************************************************!*\ - !*** ./node_modules/material-ui/Modal/manageAriaHidden.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ariaHidden = ariaHidden; -exports.hideSiblings = hideSiblings; -exports.showSiblings = showSiblings; -var BLACKLIST = ['template', 'script', 'style']; - -function isHidable(node) { - return node.nodeType === 1 && BLACKLIST.indexOf(node.tagName.toLowerCase()) === -1; -} - -function siblings(container, mount, callback) { - mount = [].concat(mount); // eslint-disable-line no-param-reassign - [].forEach.call(container.children, function (node) { - if (mount.indexOf(node) === -1 && isHidable(node)) { - callback(node); - } - }); -} - -function ariaHidden(show, node) { - if (!node) { - return; - } - if (show) { - node.setAttribute('aria-hidden', 'true'); - } else { - node.removeAttribute('aria-hidden'); - } -} - -function hideSiblings(container, mountNode) { - siblings(container, mountNode, function (node) { - return ariaHidden(true, node); - }); -} - -function showSiblings(container, mountNode) { - siblings(container, mountNode, function (node) { - return ariaHidden(false, node); - }); -} - -/***/ }), - -/***/ "./node_modules/material-ui/Paper/Paper.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Paper/Paper.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - var shadows = {}; - theme.shadows.forEach(function (shadow, index) { - shadows['shadow' + index] = { - boxShadow: shadow - }; - }); - - return (0, _extends3.default)({ - root: { - backgroundColor: theme.palette.background.paper - }, - rounded: { - borderRadius: 2 - } - }, shadows); -}; - -function Paper(props) { - var classes = props.classes, - classNameProp = props.className, - Component = props.component, - square = props.square, - elevation = props.elevation, - other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'component', 'square', 'elevation']); - - - true ? (0, _warning2.default)(elevation >= 0 && elevation < 25, 'Material-UI: this elevation `' + elevation + '` is not implemented.') : undefined; - - var className = (0, _classnames2.default)(classes.root, classes['shadow' + elevation], (0, _defineProperty3.default)({}, classes.rounded, !square), classNameProp); - - return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other)); -} - -Paper.propTypes = true ? { - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * Shadow depth, corresponds to `dp` in the spec. - * It's accepting values between 0 and 24 inclusive. - */ - elevation: _propTypes2.default.number, - /** - * If `true`, rounded corners are disabled. - */ - square: _propTypes2.default.bool -} : undefined; - -Paper.defaultProps = { - component: 'div', - elevation: 2, - square: false -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiPaper' })(Paper); - -/***/ }), - -/***/ "./node_modules/material-ui/Paper/index.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/Paper/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Paper = __webpack_require__(/*! ./Paper */ "./node_modules/material-ui/Paper/Paper.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Paper).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Popover/Popover.js": -/*!*****************************************************!*\ - !*** ./node_modules/material-ui/Popover/Popover.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _contains = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"); - -var _contains2 = _interopRequireDefault(_contains); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _ownerWindow = __webpack_require__(/*! dom-helpers/ownerWindow */ "./node_modules/dom-helpers/ownerWindow.js"); - -var _ownerWindow2 = _interopRequireDefault(_ownerWindow); - -var _debounce = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js"); - -var _debounce2 = _interopRequireDefault(_debounce); - -var _reactEventListener = __webpack_require__(/*! react-event-listener */ "./node_modules/react-event-listener/lib/index.js"); - -var _reactEventListener2 = _interopRequireDefault(_reactEventListener); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Modal = __webpack_require__(/*! ../Modal */ "./node_modules/material-ui/Modal/index.js"); - -var _Modal2 = _interopRequireDefault(_Modal); - -var _Grow = __webpack_require__(/*! ../transitions/Grow */ "./node_modules/material-ui/transitions/Grow.js"); - -var _Grow2 = _interopRequireDefault(_Grow); - -var _Paper = __webpack_require__(/*! ../Paper */ "./node_modules/material-ui/Paper/index.js"); - -var _Paper2 = _interopRequireDefault(_Paper); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getOffsetTop(rect, vertical) { - var offset = 0; - - if (typeof vertical === 'number') { - offset = vertical; - } else if (vertical === 'center') { - offset = rect.height / 2; - } else if (vertical === 'bottom') { - offset = rect.height; - } - - return offset; -} // @inheritedComponent Modal - -function getOffsetLeft(rect, horizontal) { - var offset = 0; - - if (typeof horizontal === 'number') { - offset = horizontal; - } else if (horizontal === 'center') { - offset = rect.width / 2; - } else if (horizontal === 'right') { - offset = rect.width; - } - - return offset; -} - -function getTransformOriginValue(transformOrigin) { - return [transformOrigin.horizontal, transformOrigin.vertical].map(function (n) { - return typeof n === 'number' ? n + 'px' : n; - }).join(' '); -} - -// Sum the scrollTop between two elements. -function getScrollParent(parent, child) { - var element = child; - var scrollTop = 0; - - while (element && element !== parent) { - element = element.parentNode; - scrollTop += element.scrollTop; - } - return scrollTop; -} - -function getAnchorEl(anchorEl) { - return typeof anchorEl === 'function' ? anchorEl() : anchorEl; -} - -var styles = exports.styles = { - paper: { - position: 'absolute', - overflowY: 'auto', - overflowX: 'hidden', - // So we see the popover when it's empty. - // It's most likely on issue on userland. - minWidth: 16, - minHeight: 16, - maxWidth: 'calc(100vw - 32px)', - maxHeight: 'calc(100vh - 32px)', - '&:focus': { - outline: 'none' - } - } -}; - -var Popover = function (_React$Component) { - (0, _inherits3.default)(Popover, _React$Component); - - function Popover() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Popover); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Popover.__proto__ || (0, _getPrototypeOf2.default)(Popover)).call.apply(_ref, [this].concat(args))), _this), _this.componentWillUnmount = function () { - _this.handleResize.cancel(); - }, _this.setPositioningStyles = function (element) { - if (element && element.style) { - var positioning = _this.getPositioningStyle(element); - element.style.top = positioning.top; - element.style.left = positioning.left; - element.style.transformOrigin = positioning.transformOrigin; - } - }, _this.getPositioningStyle = function (element) { - var _this$props = _this.props, - anchorEl = _this$props.anchorEl, - marginThreshold = _this$props.marginThreshold; - - // Check if the parent has requested anchoring on an inner content node - - var contentAnchorOffset = _this.getContentAnchorOffset(element); - // Get the offset of of the anchoring element - var anchorOffset = _this.getAnchorOffset(contentAnchorOffset); - - var elemRect = { - width: element.clientWidth, - height: element.clientHeight - }; - // Get the transform origin point on the element itself - var transformOrigin = _this.getTransformOrigin(elemRect, contentAnchorOffset); - - // Calculate element positioning - var top = anchorOffset.top - transformOrigin.vertical; - var left = anchorOffset.left - transformOrigin.horizontal; - var bottom = top + elemRect.height; - var right = left + elemRect.width; - - // Use the parent window of the anchorEl if provided - var containerWindow = (0, _ownerWindow2.default)(getAnchorEl(anchorEl)); - - // Window thresholds taking required margin into account - var heightThreshold = containerWindow.innerHeight - marginThreshold; - var widthThreshold = containerWindow.innerWidth - marginThreshold; - - // Check if the vertical axis needs shifting - if (top < marginThreshold) { - var diff = top - marginThreshold; - top -= diff; - transformOrigin.vertical += diff; - } else if (bottom > heightThreshold) { - var _diff = bottom - heightThreshold; - top -= _diff; - transformOrigin.vertical += _diff; - } - - true ? (0, _warning2.default)(elemRect.height < heightThreshold || !elemRect.height || !heightThreshold, ['Material-UI: the popover component is too tall.', 'Some part of it can not be seen on the screen (' + (elemRect.height - heightThreshold) + 'px).', 'Please consider adding a `max-height` to improve the user-experience.'].join('\n')) : undefined; - - // Check if the horizontal axis needs shifting - if (left < marginThreshold) { - var _diff2 = left - marginThreshold; - left -= _diff2; - transformOrigin.horizontal += _diff2; - } else if (right > widthThreshold) { - var _diff3 = right - widthThreshold; - left -= _diff3; - transformOrigin.horizontal += _diff3; - } - - return { - top: top + 'px', - left: left + 'px', - transformOrigin: getTransformOriginValue(transformOrigin) - }; - }, _this.transitionEl = undefined, _this.handleGetOffsetTop = getOffsetTop, _this.handleGetOffsetLeft = getOffsetLeft, _this.handleEnter = function (element) { - if (_this.props.onEnter) { - _this.props.onEnter(element); - } - - _this.setPositioningStyles(element); - }, _this.handleResize = (0, _debounce2.default)(function () { - var element = _reactDom2.default.findDOMNode(_this.transitionEl); - _this.setPositioningStyles(element); - }, 166), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Popover, [{ - key: 'componentDidMount', - value: function componentDidMount() { - if (this.props.action) { - this.props.action({ - updatePosition: this.handleResize - }); - } - } - }, { - key: 'getAnchorOffset', - - - // Returns the top/left offset of the position - // to attach to on the anchor element (or body if none is provided) - value: function getAnchorOffset(contentAnchorOffset) { - var _props = this.props, - anchorEl = _props.anchorEl, - anchorOrigin = _props.anchorOrigin, - anchorReference = _props.anchorReference, - anchorPosition = _props.anchorPosition; - - - if (anchorReference === 'anchorPosition') { - return anchorPosition; - } - - // If an anchor element wasn't provided, just use the parent body element of this Popover - var anchorElement = getAnchorEl(anchorEl) || (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(this.transitionEl)).body; - var anchorRect = anchorElement.getBoundingClientRect(); - var anchorVertical = contentAnchorOffset === 0 ? anchorOrigin.vertical : 'center'; - - return { - top: anchorRect.top + this.handleGetOffsetTop(anchorRect, anchorVertical), - left: anchorRect.left + this.handleGetOffsetLeft(anchorRect, anchorOrigin.horizontal) - }; - } - - // Returns the vertical offset of inner content to anchor the transform on if provided - - }, { - key: 'getContentAnchorOffset', - value: function getContentAnchorOffset(element) { - var _props2 = this.props, - getContentAnchorEl = _props2.getContentAnchorEl, - anchorReference = _props2.anchorReference; - - var contentAnchorOffset = 0; - - if (getContentAnchorEl && anchorReference === 'anchorEl') { - var contentAnchorEl = getContentAnchorEl(element); - - if (contentAnchorEl && (0, _contains2.default)(element, contentAnchorEl)) { - var scrollTop = getScrollParent(element, contentAnchorEl); - contentAnchorOffset = contentAnchorEl.offsetTop + contentAnchorEl.clientHeight / 2 - scrollTop || 0; - } - - // != the default value - true ? (0, _warning2.default)(this.props.anchorOrigin.vertical === 'top', ['Material-UI: you can not change the default `anchorOrigin.vertical` value ', 'when also providing the `getContentAnchorEl` property to the popover component.', 'Only use one of the two properties.', 'Set `getContentAnchorEl` to null or left `anchorOrigin.vertical` unchanged.'].join('\n')) : undefined; - } - - return contentAnchorOffset; - } - - // Return the base transform origin using the element - // and taking the content anchor offset into account if in use - - }, { - key: 'getTransformOrigin', - value: function getTransformOrigin(elemRect) { - var contentAnchorOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var transformOrigin = this.props.transformOrigin; - - return { - vertical: this.handleGetOffsetTop(elemRect, transformOrigin.vertical) + contentAnchorOffset, - horizontal: this.handleGetOffsetLeft(elemRect, transformOrigin.horizontal) - }; - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props3 = this.props, - action = _props3.action, - anchorEl = _props3.anchorEl, - anchorOrigin = _props3.anchorOrigin, - anchorPosition = _props3.anchorPosition, - anchorReference = _props3.anchorReference, - children = _props3.children, - classes = _props3.classes, - containerProp = _props3.container, - elevation = _props3.elevation, - getContentAnchorEl = _props3.getContentAnchorEl, - marginThreshold = _props3.marginThreshold, - onEnter = _props3.onEnter, - onEntered = _props3.onEntered, - onEntering = _props3.onEntering, - onExit = _props3.onExit, - onExited = _props3.onExited, - onExiting = _props3.onExiting, - open = _props3.open, - PaperProps = _props3.PaperProps, - role = _props3.role, - transformOrigin = _props3.transformOrigin, - TransitionProp = _props3.transition, - transitionDuration = _props3.transitionDuration, - other = (0, _objectWithoutProperties3.default)(_props3, ['action', 'anchorEl', 'anchorOrigin', 'anchorPosition', 'anchorReference', 'children', 'classes', 'container', 'elevation', 'getContentAnchorEl', 'marginThreshold', 'onEnter', 'onEntered', 'onEntering', 'onExit', 'onExited', 'onExiting', 'open', 'PaperProps', 'role', 'transformOrigin', 'transition', 'transitionDuration']); - - // If the container prop is provided, use that - // If the anchorEl prop is provided, use its parent body element as the container - // If neither are provided let the Modal take care of choosing the container - - var container = containerProp || (anchorEl ? (0, _ownerDocument2.default)(getAnchorEl(anchorEl)).body : undefined); - - var transitionProps = {}; - // The provided transition might not support the auto timeout value. - if (TransitionProp === _Grow2.default) { - transitionProps.timeout = transitionDuration; - } - - return _react2.default.createElement( - _Modal2.default, - (0, _extends3.default)({ container: container, open: open, BackdropProps: { invisible: true } }, other), - _react2.default.createElement( - TransitionProp, - (0, _extends3.default)({ - appear: true, - 'in': open, - onEnter: this.handleEnter, - onEntered: onEntered, - onEntering: onEntering, - onExit: onExit, - onExited: onExited, - onExiting: onExiting, - role: role, - ref: function ref(node) { - _this2.transitionEl = node; - } - }, transitionProps), - _react2.default.createElement( - _Paper2.default, - (0, _extends3.default)({ - className: classes.paper, - - elevation: elevation - }, PaperProps), - _react2.default.createElement(_reactEventListener2.default, { target: 'window', onResize: this.handleResize }), - children - ) - ) - ); - } - }]); - return Popover; -}(_react2.default.Component); - -Popover.propTypes = true ? { - /** - * This is callback property. It's called by the component on mount. - * This is useful when you want to trigger an action programmatically. - * It currently only supports updatePosition() action. - * - * @param {object} actions This object contains all posible actions - * that can be triggered programmatically. - */ - action: _propTypes2.default.func, - /** - * This is the DOM element, or a function that returns the DOM element, - * that may be used to set the position of the popover. - */ - anchorEl: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]), - /** - * This is the point on the anchor where the popover's - * `anchorEl` will attach to. This is not used when the - * anchorReference is 'anchorPosition'. - * - * Options: - * vertical: [top, center, bottom]; - * horizontal: [left, center, right]. - */ - anchorOrigin: _propTypes2.default.shape({ - horizontal: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['left', 'center', 'right'])]), - vertical: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['top', 'center', 'bottom'])]) - }), - /** - * This is the position that may be used - * to set the position of the popover. - * The coordinates are relative to - * the application's client area. - */ - anchorPosition: _propTypes2.default.shape({ - top: _propTypes2.default.number, - left: _propTypes2.default.number - }), - /* - * This determines which anchor prop to refer to to set - * the position of the popover. - */ - anchorReference: _propTypes2.default.oneOf(['anchorEl', 'anchorPosition']), - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * A node, component instance, or function that returns either. - * The `container` will passed to the Modal component. - * By default, it's using the body of the anchorEl's top-level document object, - * so it's simply `document.body` most of the time. - */ - container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]), - /** - * The elevation of the popover. - */ - elevation: _propTypes2.default.number, - /** - * This function is called in order to retrieve the content anchor element. - * It's the opposite of the `anchorEl` property. - * The content anchor element should be an element inside the popover. - * It's used to correctly scroll and set the position of the popover. - * The positioning strategy tries to make the content anchor element just above the - * anchor element. - */ - getContentAnchorEl: _propTypes2.default.func, - /** - * Specifies how close to the edge of the window the popover can appear. - */ - marginThreshold: _propTypes2.default.number, - /** - * Callback fired when the component requests to be closed. - * - * @param {object} event The event source of the callback. - */ - onClose: _propTypes2.default.func, - /** - * Callback fired before the component is entering. - */ - onEnter: _propTypes2.default.func, - /** - * Callback fired when the component has entered. - */ - onEntered: _propTypes2.default.func, - /** - * Callback fired when the component is entering. - */ - onEntering: _propTypes2.default.func, - /** - * Callback fired before the component is exiting. - */ - onExit: _propTypes2.default.func, - /** - * Callback fired when the component has exited. - */ - onExited: _propTypes2.default.func, - /** - * Callback fired when the component is exiting. - */ - onExiting: _propTypes2.default.func, - /** - * If `true`, the popover is visible. - */ - open: _propTypes2.default.bool.isRequired, - /** - * Properties applied to the `Paper` element. - */ - PaperProps: _propTypes2.default.object, - /** - * @ignore - */ - role: _propTypes2.default.string, - /** - * This is the point on the popover which - * will attach to the anchor's origin. - * - * Options: - * vertical: [top, center, bottom, x(px)]; - * horizontal: [left, center, right, x(px)]. - */ - transformOrigin: _propTypes2.default.shape({ - horizontal: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['left', 'center', 'right'])]), - vertical: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['top', 'center', 'bottom'])]) - }), - /** - * Transition component. - */ - transition: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * Set to 'auto' to automatically calculate transition time based on height. - */ - transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])]) -} : undefined; - -Popover.defaultProps = { - anchorReference: 'anchorEl', - anchorOrigin: { - vertical: 'top', - horizontal: 'left' - }, - elevation: 8, - marginThreshold: 16, - transformOrigin: { - vertical: 'top', - horizontal: 'left' - }, - transition: _Grow2.default, - transitionDuration: 'auto' -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiPopover' })(Popover); - -/***/ }), - -/***/ "./node_modules/material-ui/Popover/index.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/Popover/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Popover = __webpack_require__(/*! ./Popover */ "./node_modules/material-ui/Popover/Popover.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Popover).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Portal/LegacyPortal.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/Portal/LegacyPortal.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _exactProp = __webpack_require__(/*! ../utils/exactProp */ "./node_modules/material-ui/utils/exactProp.js"); - -var _exactProp2 = _interopRequireDefault(_exactProp); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getContainer(container, defaultContainer) { - container = typeof container === 'function' ? container() : container; - return _reactDom2.default.findDOMNode(container) || defaultContainer; -} - -function getOwnerDocument(element) { - return (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(element)); -} - -/** - * @ignore - internal component. - * - * This module will soon be gone. We should drop it as soon as React@15.x support stop. - */ - -var LegacyPortal = function (_React$Component) { - (0, _inherits3.default)(LegacyPortal, _React$Component); - - function LegacyPortal() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, LegacyPortal); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = LegacyPortal.__proto__ || (0, _getPrototypeOf2.default)(LegacyPortal)).call.apply(_ref, [this].concat(args))), _this), _this.getMountNode = function () { - return _this.mountNode; - }, _this.mountOverlayTarget = function () { - if (!_this.overlayTarget) { - _this.overlayTarget = document.createElement('div'); - _this.mountNode = getContainer(_this.props.container, getOwnerDocument(_this).body); - _this.mountNode.appendChild(_this.overlayTarget); - } - }, _this.unmountOverlayTarget = function () { - if (_this.overlayTarget) { - _this.mountNode.removeChild(_this.overlayTarget); - _this.overlayTarget = null; - } - _this.mountNode = null; - }, _this.unrenderOverlay = function () { - if (_this.overlayTarget) { - _reactDom2.default.unmountComponentAtNode(_this.overlayTarget); - _this.overlayInstance = null; - } - }, _this.renderOverlay = function () { - var overlay = _this.props.children; - _this.mountOverlayTarget(); - var initialRender = !_this.overlayInstance; - _this.overlayInstance = _reactDom2.default.unstable_renderSubtreeIntoContainer(_this, overlay, _this.overlayTarget, function () { - if (initialRender && _this.props.onRendered) { - _this.props.onRendered(); - } - }); - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(LegacyPortal, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.mounted = true; - this.renderOverlay(); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (this.overlayTarget && nextProps.container !== this.props.container) { - this.mountNode.removeChild(this.overlayTarget); - this.mountNode = getContainer(nextProps.container, getOwnerDocument(this).body); - this.mountNode.appendChild(this.overlayTarget); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.renderOverlay(); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.mounted = false; - this.unrenderOverlay(); - this.unmountOverlayTarget(); - } - - /** - * @public - */ - - }, { - key: 'render', - value: function render() { - return null; - } - }]); - return LegacyPortal; -}(_react2.default.Component); - -LegacyPortal.propTypes = true ? { - children: _propTypes2.default.element.isRequired, - container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]), - onRendered: _propTypes2.default.func -} : undefined; - -LegacyPortal.propTypes = true ? (0, _exactProp2.default)(LegacyPortal.propTypes, 'LegacyPortal') : undefined; - -exports.default = LegacyPortal; - -/***/ }), - -/***/ "./node_modules/material-ui/Portal/Portal.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/Portal/Portal.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -var _exactProp = __webpack_require__(/*! ../utils/exactProp */ "./node_modules/material-ui/utils/exactProp.js"); - -var _exactProp2 = _interopRequireDefault(_exactProp); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getContainer(container, defaultContainer) { - container = typeof container === 'function' ? container() : container; - return _reactDom2.default.findDOMNode(container) || defaultContainer; -} - -function getOwnerDocument(element) { - return (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(element)); -} - -/** - * This component shares many concepts with - * [react-overlays](https://react-bootstrap.github.io/react-overlays/#portals) - * But has been forked in order to fix some bugs, reduce the number of dependencies - * and take the control of our destiny. - */ - -var Portal = function (_React$Component) { - (0, _inherits3.default)(Portal, _React$Component); - - function Portal() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Portal); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Portal.__proto__ || (0, _getPrototypeOf2.default)(Portal)).call.apply(_ref, [this].concat(args))), _this), _this.getMountNode = function () { - return _this.mountNode; - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Portal, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.setContainer(this.props.container); - this.forceUpdate(this.props.onRendered); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.container !== this.props.container) { - this.setContainer(nextProps.container); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.mountNode = null; - } - }, { - key: 'setContainer', - value: function setContainer(container) { - this.mountNode = getContainer(container, getOwnerDocument(this).body); - } - - /** - * @public - */ - - }, { - key: 'render', - value: function render() { - var children = this.props.children; - - - return this.mountNode ? _reactDom2.default.createPortal(children, this.mountNode) : null; - } - }]); - return Portal; -}(_react2.default.Component); - -Portal.propTypes = true ? { - /** - * The children to render into the `container`. - */ - children: _propTypes2.default.node.isRequired, - /** - * A node, component instance, or function that returns either. - * The `container` will have the portal children appended to it. - * By default, it's using the body of the top-level document object, - * so it's simply `document.body` most of the time. - */ - container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]), - /** - * Callback fired once the children has been mounted into the `container`. - */ - onRendered: _propTypes2.default.func -} : undefined; - -Portal.propTypes = true ? (0, _exactProp2.default)(Portal.propTypes, 'Portal') : undefined; - -exports.default = Portal; - -/***/ }), - -/***/ "./node_modules/material-ui/Portal/index.js": -/*!**************************************************!*\ - !*** ./node_modules/material-ui/Portal/index.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reactDom = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _Portal = __webpack_require__(/*! ./Portal */ "./node_modules/material-ui/Portal/Portal.js"); - -var _Portal2 = _interopRequireDefault(_Portal); - -var _LegacyPortal = __webpack_require__(/*! ./LegacyPortal */ "./node_modules/material-ui/Portal/LegacyPortal.js"); - -var _LegacyPortal2 = _interopRequireDefault(_LegacyPortal); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _reactDom2.default.createPortal ? _Portal2.default : _LegacyPortal2.default; - -/***/ }), - -/***/ "./node_modules/material-ui/Select/Select.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/Select/Select.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _SelectInput = __webpack_require__(/*! ./SelectInput */ "./node_modules/material-ui/Select/SelectInput.js"); - -var _SelectInput2 = _interopRequireDefault(_SelectInput); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _Input = __webpack_require__(/*! ../Input */ "./node_modules/material-ui/Input/index.js"); - -var _Input2 = _interopRequireDefault(_Input); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Import to enforce the CSS injection order - -var styles = exports.styles = function styles(theme) { - return { - root: { - position: 'relative', - width: '100%' - }, - select: { - '-moz-appearance': 'none', // Reset - '-webkit-appearance': 'none', // Reset - // When interacting quickly, the text can end up selected. - // Native select can't be selected either. - userSelect: 'none', - paddingRight: theme.spacing.unit * 4, - width: 'calc(100% - ' + theme.spacing.unit * 4 + 'px)', - minWidth: theme.spacing.unit * 2, // So it doesn't collapse. - cursor: 'pointer', - '&:focus': { - // Show that it's not an text input - background: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)', - borderRadius: 0 // Reset Chrome style - }, - // Remove Firefox focus border - '&:-moz-focusring': { - color: 'transparent', - textShadow: '0 0 0 #000' - }, - // Remove IE11 arrow - '&::-ms-expand': { - display: 'none' - } - }, - selectMenu: { - width: 'auto', // Fix Safari textOverflow - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - overflow: 'hidden', - minHeight: '1.1875em' // Reset (19px), match the native input line-height - }, - disabled: { - cursor: 'default' - }, - icon: { - // We use a position absolute over a flexbox in order to forward the pointer events - // to the input. - position: 'absolute', - right: 0, - top: 'calc(50% - 12px)', // Center vertically - color: theme.palette.action.active, - 'pointer-events': 'none' // Don't block pointer events on the select under the icon. - } - }; -}; // @inheritedComponent Input - -function Select(props) { - var autoWidth = props.autoWidth, - children = props.children, - classes = props.classes, - displayEmpty = props.displayEmpty, - input = props.input, - inputProps = props.inputProps, - MenuProps = props.MenuProps, - multiple = props.multiple, - native = props.native, - onClose = props.onClose, - onOpen = props.onOpen, - open = props.open, - renderValue = props.renderValue, - SelectDisplayProps = props.SelectDisplayProps, - other = (0, _objectWithoutProperties3.default)(props, ['autoWidth', 'children', 'classes', 'displayEmpty', 'input', 'inputProps', 'MenuProps', 'multiple', 'native', 'onClose', 'onOpen', 'open', 'renderValue', 'SelectDisplayProps']); - - - return _react2.default.cloneElement(input, (0, _extends3.default)({ - // Most of the logic is implemented in `SelectInput`. - // The `Select` component is a simple API wrapper to expose something better to play with. - inputComponent: _SelectInput2.default, - inputProps: (0, _extends3.default)({ - autoWidth: autoWidth, - children: children, - classes: classes, - displayEmpty: displayEmpty, - MenuProps: MenuProps, - multiple: multiple, - native: native, - onClose: onClose, - onOpen: onOpen, - open: open, - renderValue: renderValue, - SelectDisplayProps: SelectDisplayProps, - type: undefined }, inputProps, input ? input.props.inputProps : {}) - }, other)); -} - -Select.propTypes = true ? { - /** - * If true, the width of the popover will automatically be set according to the items inside the - * menu, otherwise it will be at least the width of the select input. - */ - autoWidth: _propTypes2.default.bool, - /** - * The option elements to populate the select with. - * Can be some `MenuItem` when `native` is false and `option` when `native` is true. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * If `true`, the selected item is displayed even if its value is empty. - * You can only use it when the `native` property is `false` (default). - */ - displayEmpty: _propTypes2.default.bool, - /** - * An `Input` element; does not have to be a material-ui specific `Input`. - */ - input: _propTypes2.default.element, - /** - * Properties applied to the `input` element. - * When `native` is `true`, the properties are applied on the `select` element. - */ - inputProps: _propTypes2.default.object, - /** - * Properties applied to the `Menu` element. - */ - MenuProps: _propTypes2.default.object, - /** - * If true, `value` must be an array and the menu will support multiple selections. - * You can only use it when the `native` property is `false` (default). - */ - multiple: _propTypes2.default.bool, - /** - * If `true`, the component will be using a native `select` element. - */ - native: _propTypes2.default.bool, - /** - * Callback function fired when a menu item is selected. - * - * @param {object} event The event source of the callback - * @param {object} child The react element that was selected - */ - onChange: _propTypes2.default.func, - /** - * Callback fired when the component requests to be closed. - * Useful in controlled mode (see open). - * - * @param {object} event The event source of the callback - */ - onClose: _propTypes2.default.func, - /** - * Callback fired when the component requests to be opened. - * Useful in controlled mode (see open). - * - * @param {object} event The event source of the callback - */ - onOpen: _propTypes2.default.func, - /** - * Control `select` open state. - * You can only use it when the `native` property is `false` (default). - */ - open: _propTypes2.default.bool, - /** - * Render the selected value. - * You can only use it when the `native` property is `false` (default). - */ - renderValue: _propTypes2.default.func, - /** - * Properties applied to the clickable div element. - */ - SelectDisplayProps: _propTypes2.default.object, - /** - * The input value, required for a controlled component. - */ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))]) -} : undefined; - -Select.defaultProps = { - autoWidth: false, - displayEmpty: false, - input: _react2.default.createElement(_Input2.default, null), - multiple: false, - native: false -}; - -Select.muiName = 'Select'; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiSelect' })(Select); - -/***/ }), - -/***/ "./node_modules/material-ui/Select/SelectInput.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/Select/SelectInput.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _toConsumableArray2 = __webpack_require__(/*! babel-runtime/helpers/toConsumableArray */ "./node_modules/babel-runtime/helpers/toConsumableArray.js"); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _keycode = __webpack_require__(/*! keycode */ "./node_modules/keycode/index.js"); - -var _keycode2 = _interopRequireDefault(_keycode); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _ArrowDropDown = __webpack_require__(/*! ../internal/svg-icons/ArrowDropDown */ "./node_modules/material-ui/internal/svg-icons/ArrowDropDown.js"); - -var _ArrowDropDown2 = _interopRequireDefault(_ArrowDropDown); - -var _Menu = __webpack_require__(/*! ../Menu/Menu */ "./node_modules/material-ui/Menu/Menu.js"); - -var _Menu2 = _interopRequireDefault(_Menu); - -var _Input = __webpack_require__(/*! ../Input/Input */ "./node_modules/material-ui/Input/Input.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @ignore - internal component. - */ -var SelectInput = function (_React$Component) { - (0, _inherits3.default)(SelectInput, _React$Component); - - function SelectInput() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, SelectInput); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = SelectInput.__proto__ || (0, _getPrototypeOf2.default)(SelectInput)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - open: false - }, _this.ignoreNextBlur = false, _this.displayNode = null, _this.isControlled = _this.props.open !== undefined, _this.update = _this.isControlled ? function (_ref2) { - var event = _ref2.event, - open = _ref2.open; - - if (open) { - _this.props.onOpen(event); - } else { - _this.props.onClose(event); - } - } : function (_ref3) { - var open = _ref3.open; - return _this.setState({ open: open }); - }, _this.handleClick = function (event) { - // Opening the menu is going to blur the. It will be focused back when closed. - _this.ignoreNextBlur = true; - _this.update({ - open: true, - event: event - }); - }, _this.handleClose = function (event) { - _this.update({ - open: false, - event: event - }); - }, _this.handleItemClick = function (child) { - return function (event) { - if (!_this.props.multiple) { - _this.update({ - open: false, - event: event - }); - } - - var _this$props = _this.props, - onChange = _this$props.onChange, - name = _this$props.name; - - - if (onChange) { - var value = void 0; - var target = void 0; - - if (event.target) { - target = event.target; - } - - if (_this.props.multiple) { - value = Array.isArray(_this.props.value) ? [].concat((0, _toConsumableArray3.default)(_this.props.value)) : []; - var itemIndex = value.indexOf(child.props.value); - if (itemIndex === -1) { - value.push(child.props.value); - } else { - value.splice(itemIndex, 1); - } - } else { - value = child.props.value; - } - - event.persist(); - event.target = (0, _extends3.default)({}, target, { value: value, name: name }); - - onChange(event, child); - } - }; - }, _this.handleBlur = function (event) { - if (_this.ignoreNextBlur === true) { - // The parent components are relying on the bubbling of the event. - event.stopPropagation(); - _this.ignoreNextBlur = false; - return; - } - - if (_this.props.onBlur) { - _this.props.onBlur(event); - } - }, _this.handleKeyDown = function (event) { - if (_this.props.readOnly) { - return; - } - - if (['space', 'up', 'down'].includes((0, _keycode2.default)(event))) { - event.preventDefault(); - // Opening the menu is going to blur the. It will be focused back when closed. - _this.ignoreNextBlur = true; - _this.update({ - open: true, - event: event - }); - } - }, _this.handleSelectRef = function (node) { - if (!_this.props.inputRef) { - return; - } - - _this.props.inputRef({ - node: node, - // By pass the native input as we expose a rich object (array). - value: _this.props.value - }); - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(SelectInput, [{ - key: 'componentDidMount', - value: function componentDidMount() { - if (this.isControlled && this.props.open) { - // Focus the display node so the focus is restored on this element once - // the menu is closed. - this.displayNode.focus(); - // Rerender with the resolve `displayNode` reference. - this.forceUpdate(); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - autoWidth = _props.autoWidth, - children = _props.children, - classes = _props.classes, - classNameProp = _props.className, - disabled = _props.disabled, - displayEmpty = _props.displayEmpty, - inputRef = _props.inputRef, - _props$MenuProps = _props.MenuProps, - MenuProps = _props$MenuProps === undefined ? {} : _props$MenuProps, - multiple = _props.multiple, - name = _props.name, - native = _props.native, - onBlur = _props.onBlur, - onChange = _props.onChange, - onClose = _props.onClose, - onFocus = _props.onFocus, - onOpen = _props.onOpen, - openProp = _props.open, - readOnly = _props.readOnly, - renderValue = _props.renderValue, - SelectDisplayProps = _props.SelectDisplayProps, - tabIndexProp = _props.tabIndex, - _props$type = _props.type, - type = _props$type === undefined ? 'hidden' : _props$type, - value = _props.value, - other = (0, _objectWithoutProperties3.default)(_props, ['autoWidth', 'children', 'classes', 'className', 'disabled', 'displayEmpty', 'inputRef', 'MenuProps', 'multiple', 'name', 'native', 'onBlur', 'onChange', 'onClose', 'onFocus', 'onOpen', 'open', 'readOnly', 'renderValue', 'SelectDisplayProps', 'tabIndex', 'type', 'value']); - - var open = this.isControlled && this.displayNode ? openProp : this.state.open; - - if (native) { - true ? (0, _warning2.default)(multiple === false, 'Material-UI: you can not use the `native` and `multiple` properties ' + 'at the same time on a `Select` component.') : undefined; - true ? (0, _warning2.default)(!renderValue, 'Material-UI: the `renderValue` property is not used by the native implementation.') : undefined; - true ? (0, _warning2.default)(!displayEmpty, 'Material-UI: the `displayEmpty` property is not used by the native implementation.') : undefined; - - return _react2.default.createElement( - 'div', - { className: classes.root }, - _react2.default.createElement( - 'select', - (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.select, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp), - name: name, - disabled: disabled, - onBlur: onBlur, - onChange: onChange, - onFocus: onFocus, - value: value, - readOnly: readOnly, - ref: inputRef - }, other), - children - ), - _react2.default.createElement(_ArrowDropDown2.default, { className: classes.icon }) - ); - } - - if (value === undefined) { - throw new Error('Material-UI: the `value` property is required ' + 'when using the `Select` component with `native=false`.'); - } - - var display = void 0; - var displaySingle = ''; - var displayMultiple = []; - var computeDisplay = false; - - // No need to display any value if the field is empty. - if ((0, _Input.isDirty)(this.props) || displayEmpty) { - if (renderValue) { - display = renderValue(value); - } else { - computeDisplay = true; - } - } - - var items = _react2.default.Children.map(children, function (child) { - if (!_react2.default.isValidElement(child)) { - return null; - } - var selected = void 0; - - if (multiple) { - if (!Array.isArray(value)) { - throw new Error('Material-UI: the `value` property must be an array ' + 'when using the `Select` component with `multiple`.'); - } - - selected = value.indexOf(child.props.value) !== -1; - if (selected && computeDisplay) { - displayMultiple.push(child.props.children); - } - } else { - selected = value === child.props.value; - if (selected && computeDisplay) { - displaySingle = child.props.children; - } - } - - return _react2.default.cloneElement(child, { - role: 'option', - selected: selected, - onClick: _this2.handleItemClick(child) - }); - }); - - if (computeDisplay) { - display = multiple ? displayMultiple.join(', ') : displaySingle; - } - - var MenuMinWidth = this.displayNode && !autoWidth ? this.displayNode.clientWidth : undefined; - - var tabIndex = void 0; - if (typeof tabIndexProp !== 'undefined') { - tabIndex = tabIndexProp; - } else { - tabIndex = disabled ? null : 0; - } - - return _react2.default.createElement( - 'div', - { className: classes.root }, - _react2.default.createElement( - 'div', - (0, _extends3.default)({ - className: (0, _classnames2.default)(classes.select, classes.selectMenu, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp), - ref: function ref(node) { - _this2.displayNode = node; - }, - - 'aria-pressed': open ? 'true' : 'false', - tabIndex: tabIndex, - role: 'button', - 'aria-owns': open ? 'menu-' + (name || '') : null, - 'aria-haspopup': 'true', - onKeyDown: this.handleKeyDown, - onBlur: this.handleBlur, - onClick: disabled || readOnly ? null : this.handleClick, - onFocus: onFocus - }, SelectDisplayProps), - _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: '​' } }), - display - ), - _react2.default.createElement('input', (0, _extends3.default)({ - value: Array.isArray(value) ? value.join(',') : value, - name: name, - readOnly: readOnly, - ref: this.handleSelectRef, - type: type - }, other)), - _react2.default.createElement(_ArrowDropDown2.default, { className: classes.icon }), - _react2.default.createElement( - _Menu2.default, - (0, _extends3.default)({ - id: 'menu-' + (name || ''), - anchorEl: this.displayNode, - open: open, - onClose: this.handleClose - }, MenuProps, { - MenuListProps: (0, _extends3.default)({ - role: 'listbox' - }, MenuProps.MenuListProps), - PaperProps: (0, _extends3.default)({}, MenuProps.PaperProps, { - style: (0, _extends3.default)({ - minWidth: MenuMinWidth - }, MenuProps.PaperProps != null ? MenuProps.PaperProps.style : null) - }) - }), - items - ) - ); - } - }]); - return SelectInput; -}(_react2.default.Component); - -SelectInput.propTypes = true ? { - /** - * If true, the width of the popover will automatically be set according to the items inside the - * menu, otherwise it will be at least the width of the select input. - */ - autoWidth: _propTypes2.default.bool, - /** - * The option elements to populate the select with. - * Can be some `MenuItem` when `native` is false and `option` when `native` is true. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * The CSS class name of the select element. - */ - className: _propTypes2.default.string, - /** - * If `true`, the select will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the selected item is displayed even if its value is empty. - * You can only use it when the `native` property is `false` (default). - */ - displayEmpty: _propTypes2.default.bool, - /** - * Use that property to pass a ref callback to the native select element. - */ - inputRef: _propTypes2.default.func, - /** - * Properties applied to the `Menu` element. - */ - MenuProps: _propTypes2.default.object, - /** - * If true, `value` must be an array and the menu will support multiple selections. - * You can only use it when the `native` property is `false` (default). - */ - multiple: _propTypes2.default.bool, - /** - * Name attribute of the `select` or hidden `input` element. - */ - name: _propTypes2.default.string, - /** - * If `true`, the component will be using a native `select` element. - */ - native: _propTypes2.default.bool, - /** - * @ignore - */ - onBlur: _propTypes2.default.func, - /** - * Callback function fired when a menu item is selected. - * - * @param {object} event The event source of the callback - * @param {object} child The react element that was selected - */ - onChange: _propTypes2.default.func, - /** - * Callback fired when the component requests to be closed. - * Useful in controlled mode (see open). - * - * @param {object} event The event source of the callback - */ - onClose: _propTypes2.default.func, - /** - * @ignore - */ - onFocus: _propTypes2.default.func, - /** - * Callback fired when the component requests to be opened. - * Useful in controlled mode (see open). - * - * @param {object} event The event source of the callback - */ - onOpen: _propTypes2.default.func, - /** - * Control `select` open state. - * You can only use it when the `native` property is `false` (default). - */ - open: _propTypes2.default.bool, - /** - * @ignore - */ - readOnly: _propTypes2.default.bool, - /** - * Render the selected value. - * You can only use it when the `native` property is `false` (default). - */ - renderValue: _propTypes2.default.func, - /** - * Properties applied to the clickable div element. - */ - SelectDisplayProps: _propTypes2.default.object, - /** - * @ignore - */ - tabIndex: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), - /** - * @ignore - */ - type: _propTypes2.default.string, - /** - * The value of the component, required for a controlled component. - */ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))]) -} : undefined; - -exports.default = SelectInput; - -/***/ }), - -/***/ "./node_modules/material-ui/SvgIcon/SvgIcon.js": -/*!*****************************************************!*\ - !*** ./node_modules/material-ui/SvgIcon/SvgIcon.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'inline-block', - fill: 'currentColor', - height: 24, - width: 24, - userSelect: 'none', - flexShrink: 0, - transition: theme.transitions.create('fill', { - duration: theme.transitions.duration.shorter - }) - }, - colorPrimary: { - color: theme.palette.primary.main - }, - colorSecondary: { - color: theme.palette.secondary.main - }, - colorAction: { - color: theme.palette.action.active - }, - colorDisabled: { - color: theme.palette.action.disabled - }, - colorError: { - color: theme.palette.error.main - }, - fontSize: { - width: '1em', - height: '1em' - } - }; -}; - -function SvgIcon(props) { - var _classNames; - - var children = props.children, - classes = props.classes, - classNameProp = props.className, - color = props.color, - fontSize = props.fontSize, - nativeColor = props.nativeColor, - titleAccess = props.titleAccess, - viewBox = props.viewBox, - other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'color', 'fontSize', 'nativeColor', 'titleAccess', 'viewBox']); - - - var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'inherit'), (0, _defineProperty3.default)(_classNames, classes.fontSize, fontSize), _classNames), classNameProp); - - return _react2.default.createElement( - 'svg', - (0, _extends3.default)({ - className: className, - focusable: 'false', - viewBox: viewBox, - color: nativeColor, - 'aria-hidden': titleAccess ? 'false' : 'true' - }, other), - titleAccess ? _react2.default.createElement( - 'title', - null, - titleAccess - ) : null, - children - ); -} - -SvgIcon.propTypes = true ? { - /** - * Node passed into the SVG element. - */ - children: _propTypes2.default.node.isRequired, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The color of the component. It supports those theme colors that make sense for this component. - * You can use the `nativeColor` property to apply a color attribute to the SVG element. - */ - color: _propTypes2.default.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']), - /** - * If `true`, the icon size will be determined by the font-size. - */ - fontSize: _propTypes2.default.bool, - /** - * Applies a color attribute to the SVG element. - */ - nativeColor: _propTypes2.default.string, - /** - * Provides a human-readable title for the element that contains it. - * https://www.w3.org/TR/SVG-access/#Equivalent - */ - titleAccess: _propTypes2.default.string, - /** - * Allows you to redefine what the coordinates without units mean inside an SVG element. - * For example, if the SVG element is 500 (width) by 200 (height), - * and you pass viewBox="0 0 50 20", - * this means that the coordinates inside the SVG will go from the top left corner (0,0) - * to bottom right (50,20) and each unit will be worth 10px. - */ - viewBox: _propTypes2.default.string -} : undefined; - -SvgIcon.defaultProps = { - color: 'inherit', - fontSize: false, - viewBox: '0 0 24 24' -}; - -SvgIcon.muiName = 'SvgIcon'; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiSvgIcon' })(SvgIcon); - -/***/ }), - -/***/ "./node_modules/material-ui/SvgIcon/index.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/SvgIcon/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _SvgIcon = __webpack_require__(/*! ./SvgIcon */ "./node_modules/material-ui/SvgIcon/SvgIcon.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_SvgIcon).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/TextField/TextField.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/TextField/TextField.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Input = __webpack_require__(/*! ../Input */ "./node_modules/material-ui/Input/index.js"); - -var _Input2 = _interopRequireDefault(_Input); - -var _FormControl = __webpack_require__(/*! ../Form/FormControl */ "./node_modules/material-ui/Form/FormControl.js"); - -var _FormControl2 = _interopRequireDefault(_FormControl); - -var _FormHelperText = __webpack_require__(/*! ../Form/FormHelperText */ "./node_modules/material-ui/Form/FormHelperText.js"); - -var _FormHelperText2 = _interopRequireDefault(_FormHelperText); - -var _Select = __webpack_require__(/*! ../Select/Select */ "./node_modules/material-ui/Select/Select.js"); - -var _Select2 = _interopRequireDefault(_Select); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The `TextField` is a convenience wrapper for the most common cases (80%). - * It cannot be all things to all people, otherwise the API would grow out of control. - * - * ## Advanced Configuration - * - * It's important to understand that the text field is a simple abstraction - * on top of the following components: - * - [FormControl](/api/form-control) - * - [InputLabel](/api/input-label) - * - [Input](/api/input) - * - [FormHelperText](/api/form-helper-text) - * - * If you wish to alter the properties applied to the native input, you can do as follow: - * - * ```jsx - * const inputProps = { - * step: 300, - * }; - * - * return ; - * ``` - * - * For advanced cases, please look at the source of TextField by clicking on the - * "Edit this page" button above. Consider either: - * - using the upper case props for passing values direct to the components. - * - using the underlying components directly as shown in the demos. - */ -function TextField(props) { - var autoComplete = props.autoComplete, - autoFocus = props.autoFocus, - children = props.children, - className = props.className, - defaultValue = props.defaultValue, - disabled = props.disabled, - error = props.error, - FormHelperTextProps = props.FormHelperTextProps, - fullWidth = props.fullWidth, - helperText = props.helperText, - helperTextClassName = props.helperTextClassName, - id = props.id, - InputLabelProps = props.InputLabelProps, - inputProps = props.inputProps, - InputProps = props.InputProps, - inputRef = props.inputRef, - label = props.label, - labelClassName = props.labelClassName, - multiline = props.multiline, - name = props.name, - onChange = props.onChange, - placeholder = props.placeholder, - required = props.required, - rows = props.rows, - rowsMax = props.rowsMax, - select = props.select, - SelectProps = props.SelectProps, - type = props.type, - value = props.value, - other = (0, _objectWithoutProperties3.default)(props, ['autoComplete', 'autoFocus', 'children', 'className', 'defaultValue', 'disabled', 'error', 'FormHelperTextProps', 'fullWidth', 'helperText', 'helperTextClassName', 'id', 'InputLabelProps', 'inputProps', 'InputProps', 'inputRef', 'label', 'labelClassName', 'multiline', 'name', 'onChange', 'placeholder', 'required', 'rows', 'rowsMax', 'select', 'SelectProps', 'type', 'value']); - - - true ? (0, _warning2.default)(!select || Boolean(children), 'Material-UI: `children` must be passed when using the `TextField` component with `select`.') : undefined; - - var helperTextId = helperText && id ? id + '-helper-text' : undefined; - var InputComponent = _react2.default.createElement(_Input2.default, (0, _extends3.default)({ - autoComplete: autoComplete, - autoFocus: autoFocus, - defaultValue: defaultValue, - disabled: disabled, - fullWidth: fullWidth, - multiline: multiline, - name: name, - rows: rows, - rowsMax: rowsMax, - type: type, - value: value, - id: id, - inputRef: inputRef, - onChange: onChange, - placeholder: placeholder, - inputProps: inputProps - }, InputProps)); - - return _react2.default.createElement( - _FormControl2.default, - (0, _extends3.default)({ - 'aria-describedby': helperTextId, - className: className, - error: error, - fullWidth: fullWidth, - required: required - }, other), - label && _react2.default.createElement( - _Input.InputLabel, - (0, _extends3.default)({ htmlFor: id, className: labelClassName }, InputLabelProps), - label - ), - select ? _react2.default.createElement( - _Select2.default, - (0, _extends3.default)({ value: value, input: InputComponent }, SelectProps), - children - ) : InputComponent, - helperText && _react2.default.createElement( - _FormHelperText2.default, - (0, _extends3.default)({ className: helperTextClassName, id: helperTextId }, FormHelperTextProps), - helperText - ) - ); -} // @inheritedComponent FormControl - -TextField.propTypes = true ? { - /** - * This property helps users to fill forms faster, especially on mobile devices. - * The name can be confusing, as it's more like an autofill. - * You can learn more about it here: - * https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill - */ - autoComplete: _propTypes2.default.string, - /** - * If `true`, the input will be focused during the first mount. - */ - autoFocus: _propTypes2.default.bool, - /** - * @ignore - */ - children: _propTypes2.default.node, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The default value of the `Input` element. - */ - defaultValue: _propTypes2.default.string, - /** - * If `true`, the input will be disabled. - */ - disabled: _propTypes2.default.bool, - /** - * If `true`, the label will be displayed in an error state. - */ - error: _propTypes2.default.bool, - /** - * Properties applied to the `FormHelperText` element. - */ - FormHelperTextProps: _propTypes2.default.object, - /** - * If `true`, the input will take up the full width of its container. - */ - fullWidth: _propTypes2.default.bool, - /** - * The helper text content. - */ - helperText: _propTypes2.default.node, - /** - * The CSS class name of the helper text element. - */ - helperTextClassName: _propTypes2.default.string, - /** - * The id of the `input` element. - * Use that property to make `label` and `helperText` accessible for screen readers. - */ - id: _propTypes2.default.string, - /** - * Properties applied to the `InputLabel` element. - */ - InputLabelProps: _propTypes2.default.object, - /** - * Properties applied to the `Input` element. - */ - InputProps: _propTypes2.default.object, - /** - * Properties applied to the native `input` element. - */ - inputProps: _propTypes2.default.object, - /** - * Use that property to pass a ref callback to the native input component. - */ - inputRef: _propTypes2.default.func, - /** - * The label content. - */ - label: _propTypes2.default.node, - /** - * The CSS class name of the label element. - */ - labelClassName: _propTypes2.default.string, - /** - * If `dense` or `normal`, will adjust vertical spacing of this and contained components. - */ - margin: _propTypes2.default.oneOf(['none', 'dense', 'normal']), - /** - * If `true`, a textarea element will be rendered instead of an input. - */ - multiline: _propTypes2.default.bool, - /** - * Name attribute of the `input` element. - */ - name: _propTypes2.default.string, - /** - * Callback fired when the value is changed. - * - * @param {object} event The event source of the callback - */ - onChange: _propTypes2.default.func, - /** - * The short hint displayed in the input before the user enters a value. - */ - placeholder: _propTypes2.default.string, - /** - * If `true`, the label is displayed as required. - */ - required: _propTypes2.default.bool, - /** - * Number of rows to display when multiline option is set to true. - */ - rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Maximum number of rows to display when multiline option is set to true. - */ - rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - /** - * Render a `Select` element while passing the `Input` element to `Select` as `input` parameter. - * If this option is set you must pass the options of the select as children. - */ - select: _propTypes2.default.bool, - /** - * Properties applied to the `Select` element. - */ - SelectProps: _propTypes2.default.object, - /** - * Type attribute of the `Input` element. It should be a valid HTML5 input type. - */ - type: _propTypes2.default.string, - /** - * The value of the `Input` element, required for a controlled component. - */ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))]) -} : undefined; - -TextField.defaultProps = { - required: false, - select: false -}; - -exports.default = TextField; - -/***/ }), - -/***/ "./node_modules/material-ui/TextField/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/material-ui/TextField/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _TextField = __webpack_require__(/*! ./TextField */ "./node_modules/material-ui/TextField/TextField.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_TextField).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/Typography/Typography.js": -/*!***********************************************************!*\ - !*** ./node_modules/material-ui/Typography/Typography.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.styles = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _withStyles = __webpack_require__(/*! ../styles/withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -var _withStyles2 = _interopRequireDefault(_withStyles); - -var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/material-ui/utils/helpers.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = exports.styles = function styles(theme) { - return { - root: { - display: 'block', - margin: 0 - }, - display4: theme.typography.display4, - display3: theme.typography.display3, - display2: theme.typography.display2, - display1: theme.typography.display1, - headline: theme.typography.headline, - title: theme.typography.title, - subheading: theme.typography.subheading, - body2: theme.typography.body2, - body1: theme.typography.body1, - caption: theme.typography.caption, - button: theme.typography.button, - alignLeft: { - textAlign: 'left' - }, - alignCenter: { - textAlign: 'center' - }, - alignRight: { - textAlign: 'right' - }, - alignJustify: { - textAlign: 'justify' - }, - noWrap: { - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap' - }, - gutterBottom: { - marginBottom: '0.35em' - }, - paragraph: { - marginBottom: theme.spacing.unit * 2 - }, - colorInherit: { - color: 'inherit' - }, - colorPrimary: { - color: theme.palette.primary.main - }, - colorSecondary: { - color: theme.palette.secondary.main - }, - colorTextSecondary: { - color: theme.palette.text.secondary - }, - colorError: { - color: theme.palette.error.main - } - }; -}; - -function Typography(props) { - var _classNames; - - var align = props.align, - classes = props.classes, - classNameProp = props.className, - componentProp = props.component, - color = props.color, - gutterBottom = props.gutterBottom, - headlineMapping = props.headlineMapping, - noWrap = props.noWrap, - paragraph = props.paragraph, - variant = props.variant, - other = (0, _objectWithoutProperties3.default)(props, ['align', 'classes', 'className', 'component', 'color', 'gutterBottom', 'headlineMapping', 'noWrap', 'paragraph', 'variant']); - - - var className = (0, _classnames2.default)(classes.root, classes[variant], (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.noWrap, noWrap), (0, _defineProperty3.default)(_classNames, classes.gutterBottom, gutterBottom), (0, _defineProperty3.default)(_classNames, classes.paragraph, paragraph), (0, _defineProperty3.default)(_classNames, classes['align' + (0, _helpers.capitalize)(align)], align !== 'inherit'), _classNames), classNameProp); - - var Component = componentProp || (paragraph ? 'p' : headlineMapping[variant]) || 'span'; - - return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other)); -} - -Typography.propTypes = true ? { - /** - * Set the text-align on the component. - */ - align: _propTypes2.default.oneOf(['inherit', 'left', 'center', 'right', 'justify']), - /** - * The content of the component. - */ - children: _propTypes2.default.node, - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object.isRequired, - /** - * @ignore - */ - className: _propTypes2.default.string, - /** - * The color of the component. It supports those theme colors that make sense for this component. - */ - color: _propTypes2.default.oneOf(['inherit', 'primary', 'textSecondary', 'secondary', 'error', 'default']), - /** - * The component used for the root node. - * Either a string to use a DOM element or a component. - * By default, it maps the variant to a good default headline component. - */ - component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - /** - * If `true`, the text will have a bottom margin. - */ - gutterBottom: _propTypes2.default.bool, - /** - * We are empirically mapping the variant property to a range of different DOM element types. - * For instance, h1 to h6. If you wish to change that mapping, you can provide your own. - * Alternatively, you can use the `component` property. - */ - headlineMapping: _propTypes2.default.object, - /** - * If `true`, the text will not wrap, but instead will truncate with an ellipsis. - */ - noWrap: _propTypes2.default.bool, - /** - * If `true`, the text will have a bottom margin. - */ - paragraph: _propTypes2.default.bool, - /** - * Applies the theme typography styles. - */ - variant: _propTypes2.default.oneOf(['display4', 'display3', 'display2', 'display1', 'headline', 'title', 'subheading', 'body2', 'body1', 'caption', 'button']) -} : undefined; - -Typography.defaultProps = { - align: 'inherit', - color: 'default', - gutterBottom: false, - headlineMapping: { - display4: 'h1', - display3: 'h1', - display2: 'h1', - display1: 'h1', - headline: 'h1', - title: 'h2', - subheading: 'h3', - body2: 'aside', - body1: 'p' - }, - noWrap: false, - paragraph: false, - variant: 'body1' -}; - -exports.default = (0, _withStyles2.default)(styles, { name: 'MuiTypography' })(Typography); - -/***/ }), - -/***/ "./node_modules/material-ui/Typography/index.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/Typography/index.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Typography = __webpack_require__(/*! ./Typography */ "./node_modules/material-ui/Typography/Typography.js"); - -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Typography).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/colors/common.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/colors/common.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var common = { - black: '#000', - white: '#fff' -}; - -exports.default = common; - -/***/ }), - -/***/ "./node_modules/material-ui/colors/grey.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/colors/grey.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var grey = { - 50: '#fafafa', - 100: '#f5f5f5', - 200: '#eeeeee', - 300: '#e0e0e0', - 400: '#bdbdbd', - 500: '#9e9e9e', - 600: '#757575', - 700: '#616161', - 800: '#424242', - 900: '#212121', - A100: '#d5d5d5', - A200: '#aaaaaa', - A400: '#303030', - A700: '#616161' -}; - -exports.default = grey; - -/***/ }), - -/***/ "./node_modules/material-ui/colors/indigo.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/colors/indigo.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var indigo = { - 50: '#e8eaf6', - 100: '#c5cae9', - 200: '#9fa8da', - 300: '#7986cb', - 400: '#5c6bc0', - 500: '#3f51b5', - 600: '#3949ab', - 700: '#303f9f', - 800: '#283593', - 900: '#1a237e', - A100: '#8c9eff', - A200: '#536dfe', - A400: '#3d5afe', - A700: '#304ffe' -}; - -exports.default = indigo; - -/***/ }), - -/***/ "./node_modules/material-ui/colors/pink.js": -/*!*************************************************!*\ - !*** ./node_modules/material-ui/colors/pink.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var pink = { - 50: '#fce4ec', - 100: '#f8bbd0', - 200: '#f48fb1', - 300: '#f06292', - 400: '#ec407a', - 500: '#e91e63', - 600: '#d81b60', - 700: '#c2185b', - 800: '#ad1457', - 900: '#880e4f', - A100: '#ff80ab', - A200: '#ff4081', - A400: '#f50057', - A700: '#c51162' -}; - -exports.default = pink; - -/***/ }), - -/***/ "./node_modules/material-ui/colors/red.js": -/*!************************************************!*\ - !*** ./node_modules/material-ui/colors/red.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var red = { - 50: '#ffebee', - 100: '#ffcdd2', - 200: '#ef9a9a', - 300: '#e57373', - 400: '#ef5350', - 500: '#f44336', - 600: '#e53935', - 700: '#d32f2f', - 800: '#c62828', - 900: '#b71c1c', - A100: '#ff8a80', - A200: '#ff5252', - A400: '#ff1744', - A700: '#d50000' -}; - -exports.default = red; - -/***/ }), - -/***/ "./node_modules/material-ui/internal/RefHolder.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/internal/RefHolder.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @ignore - internal component. - * - * Internal helper component to allow attaching a ref to a - * child element that may not accept refs (functional component). - */ -var RefHolder = function (_React$Component) { - (0, _inherits3.default)(RefHolder, _React$Component); - - function RefHolder() { - (0, _classCallCheck3.default)(this, RefHolder); - return (0, _possibleConstructorReturn3.default)(this, (RefHolder.__proto__ || (0, _getPrototypeOf2.default)(RefHolder)).apply(this, arguments)); - } - - (0, _createClass3.default)(RefHolder, [{ - key: 'render', - value: function render() { - return this.props.children; - } - }]); - return RefHolder; -}(_react2.default.Component); - -RefHolder.propTypes = true ? { - children: _propTypes2.default.node -} : undefined; - -exports.default = RefHolder; - -/***/ }), - -/***/ "./node_modules/material-ui/internal/svg-icons/ArrowDropDown.js": -/*!**********************************************************************!*\ - !*** ./node_modules/material-ui/internal/svg-icons/ArrowDropDown.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _pure = __webpack_require__(/*! recompose/pure */ "./node_modules/recompose/pure.js"); - -var _pure2 = _interopRequireDefault(_pure); - -var _SvgIcon = __webpack_require__(/*! ../../SvgIcon */ "./node_modules/material-ui/SvgIcon/index.js"); - -var _SvgIcon2 = _interopRequireDefault(_SvgIcon); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @ignore - internal component. - */ -var _ref = _react2.default.createElement('path', { d: 'M7 10l5 5 5-5z' }); - -var ArrowDropDown = function ArrowDropDown(props) { - return _react2.default.createElement( - _SvgIcon2.default, - props, - _ref - ); -}; - -ArrowDropDown = (0, _pure2.default)(ArrowDropDown); -ArrowDropDown.muiName = 'SvgIcon'; - -exports.default = ArrowDropDown; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/MuiThemeProvider.js": -/*!*************************************************************!*\ - !*** ./node_modules/material-ui/styles/MuiThemeProvider.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _brcast = __webpack_require__(/*! brcast */ "./node_modules/brcast/dist/brcast.es.js"); - -var _brcast2 = _interopRequireDefault(_brcast); - -var _themeListener = __webpack_require__(/*! ./themeListener */ "./node_modules/material-ui/styles/themeListener.js"); - -var _themeListener2 = _interopRequireDefault(_themeListener); - -var _exactProp = __webpack_require__(/*! ../utils/exactProp */ "./node_modules/material-ui/utils/exactProp.js"); - -var _exactProp2 = _interopRequireDefault(_exactProp); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * This component takes a `theme` property. - * It makes the `theme` available down the React tree thanks to React context. - * This component should preferably be used at **the root of your component tree**. - */ -var MuiThemeProvider = function (_React$Component) { - (0, _inherits3.default)(MuiThemeProvider, _React$Component); - - function MuiThemeProvider(props, context) { - (0, _classCallCheck3.default)(this, MuiThemeProvider); - - // Get the outer theme from the context, can be null - var _this = (0, _possibleConstructorReturn3.default)(this, (MuiThemeProvider.__proto__ || (0, _getPrototypeOf2.default)(MuiThemeProvider)).call(this, props, context)); - - _this.broadcast = (0, _brcast2.default)(); - _this.unsubscribeId = null; - _this.outerTheme = null; - _this.outerTheme = _themeListener2.default.initial(context); - // Propagate the theme so it can be accessed by the children - _this.broadcast.setState(_this.mergeOuterLocalTheme(_this.props.theme)); - return _this; - } - - (0, _createClass3.default)(MuiThemeProvider, [{ - key: 'getChildContext', - value: function getChildContext() { - var _ref; - - var _props = this.props, - sheetsManager = _props.sheetsManager, - disableStylesGeneration = _props.disableStylesGeneration; - - var muiThemeProviderOptions = this.context.muiThemeProviderOptions || {}; - - if (sheetsManager !== undefined) { - muiThemeProviderOptions.sheetsManager = sheetsManager; - } - - if (disableStylesGeneration !== undefined) { - muiThemeProviderOptions.disableStylesGeneration = disableStylesGeneration; - } - - return _ref = {}, (0, _defineProperty3.default)(_ref, _themeListener.CHANNEL, this.broadcast), (0, _defineProperty3.default)(_ref, 'muiThemeProviderOptions', muiThemeProviderOptions), _ref; - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - // Subscribe on the outer theme, if present - this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (outerTheme) { - _this2.outerTheme = outerTheme; - // Forward the parent theme update to the children - _this2.broadcast.setState(_this2.mergeOuterLocalTheme(_this2.props.theme)); - }); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - // Propagate a local theme update - if (this.props.theme !== nextProps.theme) { - this.broadcast.setState(this.mergeOuterLocalTheme(nextProps.theme)); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - if (this.unsubscribeId !== null) { - _themeListener2.default.unsubscribe(this.context, this.unsubscribeId); - } - } - // We are not using the React state in order to avoid unnecessary rerender. - - }, { - key: 'mergeOuterLocalTheme', - - - // Simple merge between the outer theme and the local theme - value: function mergeOuterLocalTheme(localTheme) { - // To support composition of theme. - if (typeof localTheme === 'function') { - true ? (0, _warning2.default)(this.outerTheme, ['Material-UI: you are providing a theme function property ' + 'to the MuiThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n')) : undefined; - return localTheme(this.outerTheme); - } - - if (!this.outerTheme) { - return localTheme; - } - - return (0, _extends3.default)({}, this.outerTheme, localTheme); - } - }, { - key: 'render', - value: function render() { - return this.props.children; - } - }]); - return MuiThemeProvider; -}(_react2.default.Component); - -MuiThemeProvider.propTypes = true ? { - /** - * You can only provide a single element with react@15, a node with react@16. - */ - children: _propTypes2.default.node.isRequired, - /** - * You can disable the generation of the styles with this option. - * It can be useful when traversing the React tree outside of the HTML - * rendering step on the server. - * Let's say you are using react-apollo to extract all - * the queries made by the interface server side. - * You can significantly speed up the traversal with this property. - */ - disableStylesGeneration: _propTypes2.default.bool, - /** - * The sheetsManager is used to deduplicate style sheet injection in the page. - * It's deduplicating using the (theme, styles) couple. - * On the server, you should provide a new instance for each request. - */ - sheetsManager: _propTypes2.default.object, - /** - * A theme object. - */ - theme: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]).isRequired -} : undefined; - -MuiThemeProvider.propTypes = true ? (0, _exactProp2.default)(MuiThemeProvider.propTypes, 'MuiThemeProvider') : undefined; - -MuiThemeProvider.childContextTypes = (0, _extends3.default)({}, _themeListener2.default.contextTypes, { - muiThemeProviderOptions: _propTypes2.default.object -}); - -MuiThemeProvider.contextTypes = (0, _extends3.default)({}, _themeListener2.default.contextTypes, { - muiThemeProviderOptions: _propTypes2.default.object -}); - -exports.default = MuiThemeProvider; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/colorManipulator.js": -/*!*************************************************************!*\ - !*** ./node_modules/material-ui/styles/colorManipulator.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.convertHexToRGB = convertHexToRGB; -exports.decomposeColor = decomposeColor; -exports.recomposeColor = recomposeColor; -exports.getContrastRatio = getContrastRatio; -exports.getLuminance = getLuminance; -exports.emphasize = emphasize; -exports.fade = fade; -exports.darken = darken; -exports.lighten = lighten; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a number whose value is limited to the given range. - * - * @param {number} value The value to be clamped - * @param {number} min The lower boundary of the output range - * @param {number} max The upper boundary of the output range - * @returns {number} A number in the range [min, max] - */ -function clamp(value) { - var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - - true ? (0, _warning2.default)(value >= min && value <= max, 'Material-UI: the value provided ' + value + ' is out of range [' + min + ', ' + max + '].') : undefined; - - if (value < min) { - return min; - } - if (value > max) { - return max; - } - return value; -} - -/** - * Converts a color from CSS hex format to CSS rgb format. - * - * @param {string} color - Hex color, i.e. #nnn or #nnnnnn - * @returns {string} A CSS rgb color string - */ -// weak -/* eslint-disable no-use-before-define */ - -function convertHexToRGB(color) { - color = color.substr(1); - - var re = new RegExp('.{1,' + color.length / 3 + '}', 'g'); - var colors = color.match(re); - - if (colors && colors[0].length === 1) { - colors = colors.map(function (n) { - return n + n; - }); - } - - return colors ? 'rgb(' + colors.map(function (n) { - return parseInt(n, 16); - }).join(', ') + ')' : ''; -} - -/** - * Returns an object with the type and values of a color. - * - * Note: Does not support rgb % values. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @returns {object} - A MUI color object: {type: string, values: number[]} - */ -function decomposeColor(color) { - if (color.charAt(0) === '#') { - return decomposeColor(convertHexToRGB(color)); - } - - var marker = color.indexOf('('); - var type = color.substring(0, marker); - var values = color.substring(marker + 1, color.length - 1).split(','); - values = values.map(function (value) { - return parseFloat(value); - }); - - return { type: type, values: values }; -} - -/** - * Converts a color object with type and values to a string. - * - * @param {object} color - Decomposed color - * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla' - * @param {array} color.values - [n,n,n] or [n,n,n,n] - * @returns {string} A CSS color string - */ -function recomposeColor(color) { - var type = color.type; - var values = color.values; - - - if (type.indexOf('rgb') > -1) { - // Only convert the first 3 values to int (i.e. not alpha) - values = values.map(function (n, i) { - return i < 3 ? parseInt(n, 10) : n; - }); - } - - if (type.indexOf('hsl') > -1) { - values[1] = values[1] + '%'; - values[2] = values[2] + '%'; - } - - return color.type + '(' + values.join(', ') + ')'; -} - -/** - * Calculates the contrast ratio between two colors. - * - * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests - * - * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @returns {number} A contrast ratio value in the range 0 - 21. - */ -function getContrastRatio(foreground, background) { - var lumA = getLuminance(foreground); - var lumB = getLuminance(background); - return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05); -} - -/** - * The relative brightness of any point in a color space, - * normalized to 0 for darkest black and 1 for lightest white. - * - * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @returns {number} The relative brightness of the color in the range 0 - 1 - */ -function getLuminance(color) { - var decomposedColor = decomposeColor(color); - - if (decomposedColor.type.indexOf('rgb') > -1) { - var rgb = decomposedColor.values.map(function (val) { - val /= 255; // normalized - return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); - }); - // Truncate at 3 digits - return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3)); - } else if (decomposedColor.type.indexOf('hsl') > -1) { - return decomposedColor.values[2] / 100; - } - - throw new Error('Material-UI: unsupported `' + color + '` color.'); -} - -/** - * Darken or lighten a colour, depending on its luminance. - * Light colors are darkened, dark colors are lightened. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {number} coefficient=0.15 - multiplier in the range 0 - 1 - * @returns {string} A CSS color string. Hex input values are returned as rgb - */ -function emphasize(color) { - var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15; - - return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient); -} - -/** - * Set the absolute transparency of a color. - * Any existing alpha values are overwritten. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {number} value - value to set the alpha channel to in the range 0 -1 - * @returns {string} A CSS color string. Hex input values are returned as rgb - */ -function fade(color, value) { - true ? (0, _warning2.default)(color, 'Material-UI: missing color argument in fade(' + color + ', ' + value + ').') : undefined; - - if (!color) return color; - - color = decomposeColor(color); - value = clamp(value); - - if (color.type === 'rgb' || color.type === 'hsl') { - color.type += 'a'; - } - color.values[3] = value; - - return recomposeColor(color); -} - -/** - * Darkens a color. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {number} coefficient - multiplier in the range 0 - 1 - * @returns {string} A CSS color string. Hex input values are returned as rgb - */ -function darken(color, coefficient) { - true ? (0, _warning2.default)(color, 'Material-UI: missing color argument in darken(' + color + ', ' + coefficient + ').') : undefined; - - if (!color) return color; - - color = decomposeColor(color); - coefficient = clamp(coefficient); - - if (color.type.indexOf('hsl') > -1) { - color.values[2] *= 1 - coefficient; - } else if (color.type.indexOf('rgb') > -1) { - for (var i = 0; i < 3; i += 1) { - color.values[i] *= 1 - coefficient; - } - } - return recomposeColor(color); -} - -/** - * Lightens a color. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {number} coefficient - multiplier in the range 0 - 1 - * @returns {string} A CSS color string. Hex input values are returned as rgb - */ -function lighten(color, coefficient) { - true ? (0, _warning2.default)(color, 'Material-UI: missing color argument in lighten(' + color + ', ' + coefficient + ').') : undefined; - - if (!color) return color; - - color = decomposeColor(color); - coefficient = clamp(coefficient); - - if (color.type.indexOf('hsl') > -1) { - color.values[2] += (100 - color.values[2]) * coefficient; - } else if (color.type.indexOf('rgb') > -1) { - for (var i = 0; i < 3; i += 1) { - color.values[i] += (255 - color.values[i]) * coefficient; - } - } - - return recomposeColor(color); -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createBreakpoints.js": -/*!**************************************************************!*\ - !*** ./node_modules/material-ui/styles/createBreakpoints.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.keys = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -exports.default = createBreakpoints; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Sorted ASC by size. That's important. -// It can't be configured as it's used statically for propTypes. -var keys = exports.keys = ['xs', 'sm', 'md', 'lg', 'xl']; - -// Keep in mind that @media is inclusive by the CSS specification. -function createBreakpoints(breakpoints) { - var _breakpoints$values = breakpoints.values, - values = _breakpoints$values === undefined ? { - xs: 0, - sm: 600, - md: 960, - lg: 1280, - xl: 1920 - } : _breakpoints$values, - _breakpoints$unit = breakpoints.unit, - unit = _breakpoints$unit === undefined ? 'px' : _breakpoints$unit, - _breakpoints$step = breakpoints.step, - step = _breakpoints$step === undefined ? 5 : _breakpoints$step, - other = (0, _objectWithoutProperties3.default)(breakpoints, ['values', 'unit', 'step']); - - - function up(key) { - var value = typeof values[key] === 'number' ? values[key] : key; - return '@media (min-width:' + value + unit + ')'; - } - - function down(key) { - var endIndex = keys.indexOf(key) + 1; - var upperbound = values[keys[endIndex]]; - - if (endIndex === keys.length) { - // xl down applies to all sizes - return up('xs'); - } - - var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key; - return '@media (max-width:' + (value - step / 100) + unit + ')'; - } - - function between(start, end) { - var endIndex = keys.indexOf(end) + 1; - - if (endIndex === keys.length) { - return up(start); - } - - return '@media (min-width:' + values[start] + unit + ') and ' + ('(max-width:' + (values[keys[endIndex]] - step / 100) + unit + ')'); - } - - function only(key) { - return between(key, key); - } - - function width(key) { - return values[key]; - } - - return (0, _extends3.default)({ - keys: keys, - values: values, - up: up, - down: down, - between: between, - only: only, - width: width - }, other); -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createGenerateClassName.js": -/*!********************************************************************!*\ - !*** ./node_modules/material-ui/styles/createGenerateClassName.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createGenerateClassName; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var generatorCounter = 0; - -// Returns a function which generates unique class names based on counters. -// When new generator function is created, rule counter is reset. -// We need to reset the rule counter for SSR for each request. -// -// It's inspired by -// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js -function createGenerateClassName() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _options$dangerouslyU = options.dangerouslyUseGlobalCSS, - dangerouslyUseGlobalCSS = _options$dangerouslyU === undefined ? false : _options$dangerouslyU, - _options$productionPr = options.productionPrefix, - productionPrefix = _options$productionPr === undefined ? 'jss' : _options$productionPr; - - var escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g; - var ruleCounter = 0; - - // - HMR can lead to many class name generators being instantiated, - // so the warning is only triggered in production. - // - We expect a class name generator to be instantiated per new request on the server, - // so the warning is only triggered client side. - // - You can get away with having multiple class name generators - // by modifying the `productionPrefix`. - if (false) {} - - return function (rule, styleSheet) { - ruleCounter += 1; - true ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined; - - // Code branch the whole block at the expense of more code. - if (dangerouslyUseGlobalCSS) { - if (styleSheet && styleSheet.options.classNamePrefix) { - var prefix = styleSheet.options.classNamePrefix; - // Sanitize the string as will be used to prefix the generated class name. - prefix = prefix.replace(escapeRegex, '-'); - - if (prefix.match(/^Mui/)) { - return prefix + '-' + rule.key; - } - - if (true) { - return prefix + '-' + rule.key + '-' + ruleCounter; - } - } - - if (false) {} - - return rule.key + '-' + ruleCounter; - } - - if (false) {} - - if (styleSheet && styleSheet.options.classNamePrefix) { - var _prefix = styleSheet.options.classNamePrefix; - // Sanitize the string as will be used to prefix the generated class name. - _prefix = _prefix.replace(escapeRegex, '-'); - - return _prefix + '-' + rule.key + '-' + ruleCounter; - } - - return rule.key + '-' + ruleCounter; - }; -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createMixins.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/styles/createMixins.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _extends3 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends4 = _interopRequireDefault(_extends3); - -exports.default = createMixins; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function createMixins(breakpoints, spacing, mixins) { - var _toolbar; - - return (0, _extends4.default)({ - gutters: function gutters(styles) { - return (0, _extends4.default)({ - paddingLeft: spacing.unit * 2, - paddingRight: spacing.unit * 2 - }, styles, (0, _defineProperty3.default)({}, breakpoints.up('sm'), (0, _extends4.default)({ - paddingLeft: spacing.unit * 3, - paddingRight: spacing.unit * 3 - }, styles[breakpoints.up('sm')]))); - }, - toolbar: (_toolbar = { - minHeight: 56 - }, (0, _defineProperty3.default)(_toolbar, breakpoints.up('xs') + ' and (orientation: landscape)', { - minHeight: 48 - }), (0, _defineProperty3.default)(_toolbar, breakpoints.up('sm'), { - minHeight: 64 - }), _toolbar) - }, mixins); -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createMuiTheme.js": -/*!***********************************************************!*\ - !*** ./node_modules/material-ui/styles/createMuiTheme.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _deepmerge = __webpack_require__(/*! deepmerge */ "./node_modules/deepmerge/dist/es.js"); - -var _deepmerge2 = _interopRequireDefault(_deepmerge); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _createTypography = __webpack_require__(/*! ./createTypography */ "./node_modules/material-ui/styles/createTypography.js"); - -var _createTypography2 = _interopRequireDefault(_createTypography); - -var _createBreakpoints = __webpack_require__(/*! ./createBreakpoints */ "./node_modules/material-ui/styles/createBreakpoints.js"); - -var _createBreakpoints2 = _interopRequireDefault(_createBreakpoints); - -var _createPalette = __webpack_require__(/*! ./createPalette */ "./node_modules/material-ui/styles/createPalette.js"); - -var _createPalette2 = _interopRequireDefault(_createPalette); - -var _createMixins = __webpack_require__(/*! ./createMixins */ "./node_modules/material-ui/styles/createMixins.js"); - -var _createMixins2 = _interopRequireDefault(_createMixins); - -var _shadows = __webpack_require__(/*! ./shadows */ "./node_modules/material-ui/styles/shadows.js"); - -var _shadows2 = _interopRequireDefault(_shadows); - -var _transitions = __webpack_require__(/*! ./transitions */ "./node_modules/material-ui/styles/transitions.js"); - -var _transitions2 = _interopRequireDefault(_transitions); - -var _zIndex = __webpack_require__(/*! ./zIndex */ "./node_modules/material-ui/styles/zIndex.js"); - -var _zIndex2 = _interopRequireDefault(_zIndex); - -var _spacing = __webpack_require__(/*! ./spacing */ "./node_modules/material-ui/styles/spacing.js"); - -var _spacing2 = _interopRequireDefault(_spacing); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function createMuiTheme() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _options$palette = options.palette, - paletteInput = _options$palette === undefined ? {} : _options$palette, - _options$breakpoints = options.breakpoints, - breakpointsInput = _options$breakpoints === undefined ? {} : _options$breakpoints, - _options$mixins = options.mixins, - mixinsInput = _options$mixins === undefined ? {} : _options$mixins, - _options$typography = options.typography, - typographyInput = _options$typography === undefined ? {} : _options$typography, - shadowsInput = options.shadows, - other = (0, _objectWithoutProperties3.default)(options, ['palette', 'breakpoints', 'mixins', 'typography', 'shadows']); - - - var palette = (0, _createPalette2.default)(paletteInput); - var breakpoints = (0, _createBreakpoints2.default)(breakpointsInput); - - var muiTheme = (0, _extends3.default)({ - direction: 'ltr', - palette: palette, - typography: (0, _createTypography2.default)(palette, typographyInput), - mixins: (0, _createMixins2.default)(breakpoints, _spacing2.default, mixinsInput), - breakpoints: breakpoints, - shadows: shadowsInput || _shadows2.default - }, (0, _deepmerge2.default)({ - transitions: _transitions2.default, - spacing: _spacing2.default, - zIndex: _zIndex2.default - }, other)); - - true ? (0, _warning2.default)(muiTheme.shadows.length === 25, 'Material-UI: the shadows array provided to createMuiTheme should support 25 elevations.') : undefined; - - return muiTheme; -} // < 1kb payload overhead when lodash/merge is > 3kb. -exports.default = createMuiTheme; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createPalette.js": -/*!**********************************************************!*\ - !*** ./node_modules/material-ui/styles/createPalette.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.dark = exports.light = undefined; - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -exports.default = createPalette; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _deepmerge = __webpack_require__(/*! deepmerge */ "./node_modules/deepmerge/dist/es.js"); - -var _deepmerge2 = _interopRequireDefault(_deepmerge); - -var _indigo = __webpack_require__(/*! ../colors/indigo */ "./node_modules/material-ui/colors/indigo.js"); - -var _indigo2 = _interopRequireDefault(_indigo); - -var _pink = __webpack_require__(/*! ../colors/pink */ "./node_modules/material-ui/colors/pink.js"); - -var _pink2 = _interopRequireDefault(_pink); - -var _grey = __webpack_require__(/*! ../colors/grey */ "./node_modules/material-ui/colors/grey.js"); - -var _grey2 = _interopRequireDefault(_grey); - -var _red = __webpack_require__(/*! ../colors/red */ "./node_modules/material-ui/colors/red.js"); - -var _red2 = _interopRequireDefault(_red); - -var _common = __webpack_require__(/*! ../colors/common */ "./node_modules/material-ui/colors/common.js"); - -var _common2 = _interopRequireDefault(_common); - -var _colorManipulator = __webpack_require__(/*! ./colorManipulator */ "./node_modules/material-ui/styles/colorManipulator.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// < 1kb payload overhead when lodash/merge is > 3kb. -var light = exports.light = { - // The colors used to style the text. - text: { - // The most important text. - primary: 'rgba(0, 0, 0, 0.87)', - // Secondary text. - secondary: 'rgba(0, 0, 0, 0.54)', - // Disabled text have even lower visual prominence. - disabled: 'rgba(0, 0, 0, 0.38)', - // Text hints. - hint: 'rgba(0, 0, 0, 0.38)' - }, - // The color used to divide different elements. - divider: 'rgba(0, 0, 0, 0.12)', - // The background colors used to style the surfaces. - // Consistency between these values is important. - background: { - paper: _common2.default.white, - default: _grey2.default[50] - }, - // The colors used to style the action elements. - action: { - // The color of an active action like an icon button. - active: 'rgba(0, 0, 0, 0.54)', - // The color of an hovered action. - hover: 'rgba(0, 0, 0, 0.08)', - // The color of a selected action. - selected: 'rgba(0, 0, 0, 0.14)', - // The color of a disabled action. - disabled: 'rgba(0, 0, 0, 0.26)', - // The background color of a disabled action. - disabledBackground: 'rgba(0, 0, 0, 0.12)' - } -}; - -var dark = exports.dark = { - text: { - primary: _common2.default.white, - secondary: 'rgba(255, 255, 255, 0.7)', - disabled: 'rgba(255, 255, 255, 0.5)', - hint: 'rgba(255, 255, 255, 0.5)', - icon: 'rgba(255, 255, 255, 0.5)' - }, - divider: 'rgba(255, 255, 255, 0.12)', - background: { - paper: _grey2.default[800], - default: '#303030' - }, - action: { - active: _common2.default.white, - hover: 'rgba(255, 255, 255, 0.1)', - selected: 'rgba(255, 255, 255, 0.2)', - disabled: 'rgba(255, 255, 255, 0.3)', - disabledBackground: 'rgba(255, 255, 255, 0.12)' - } -}; - -function addLightOrDark(intent, direction, shade, tonalOffset) { - if (!intent[direction]) { - if (intent.hasOwnProperty(shade)) { - intent[direction] = intent[shade]; - } else if (direction === 'light') { - intent.light = (0, _colorManipulator.lighten)(intent.main, tonalOffset); - } else if (direction === 'dark') { - intent.dark = (0, _colorManipulator.darken)(intent.main, tonalOffset * 1.5); - } - } -} - -function createPalette(palette) { - var _palette$primary = palette.primary, - primary = _palette$primary === undefined ? { - light: _indigo2.default[300], - main: _indigo2.default[500], - dark: _indigo2.default[700] - } : _palette$primary, - _palette$secondary = palette.secondary, - secondary = _palette$secondary === undefined ? { - light: _pink2.default.A200, - main: _pink2.default.A400, - dark: _pink2.default.A700 - } : _palette$secondary, - _palette$error = palette.error, - error = _palette$error === undefined ? { - light: _red2.default[300], - main: _red2.default[500], - dark: _red2.default[700] - } : _palette$error, - _palette$type = palette.type, - type = _palette$type === undefined ? 'light' : _palette$type, - _palette$contrastThre = palette.contrastThreshold, - contrastThreshold = _palette$contrastThre === undefined ? 3 : _palette$contrastThre, - _palette$tonalOffset = palette.tonalOffset, - tonalOffset = _palette$tonalOffset === undefined ? 0.2 : _palette$tonalOffset, - other = (0, _objectWithoutProperties3.default)(palette, ['primary', 'secondary', 'error', 'type', 'contrastThreshold', 'tonalOffset']); - - - function getContrastText(background) { - // Use the same logic as - // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59 - // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54 - var contrastText = (0, _colorManipulator.getContrastRatio)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary; - - if (true) { - var contrast = (0, _colorManipulator.getContrastRatio)(background, contrastText); - true ? (0, _warning2.default)(contrast >= 3, ['Material-UI: the contrast ratio of ' + contrast + ':1 for ' + contrastText + ' on ' + background, 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : undefined; - } - - return contrastText; - } - - function augmentColor(color, mainShade, lightShade, darkShade) { - if (!color.main && color[mainShade]) { - color.main = color[mainShade]; - } - addLightOrDark(color, 'light', lightShade, tonalOffset); - addLightOrDark(color, 'dark', darkShade, tonalOffset); - if (!color.contrastText) { - color.contrastText = getContrastText(color.main); - } - } - - augmentColor(primary, 500, 300, 700); - augmentColor(secondary, 'A400', 'A200', 'A700'); - augmentColor(error, 500, 300, 700); - - var types = { dark: dark, light: light }; - - true ? (0, _warning2.default)(types[type], 'Material-UI: the palette type `' + type + '` is not supported.') : undefined; - - var paletteOutput = (0, _deepmerge2.default)((0, _extends3.default)({ - // A collection of common colors. - common: _common2.default, - // The palette type, can be light or dark. - type: type, - // The colors used to represent primary interface elements for a user. - primary: primary, - // The colors used to represent secondary interface elements for a user. - secondary: secondary, - // The colors used to represent interface elements that the user should be made aware of. - error: error, - // The grey colors. - grey: _grey2.default, - // Used by `getContrastText()` to maximize the contrast between the background and - // the text. - contrastThreshold: contrastThreshold, - // Take a background color and return the color of the text to maximize the contrast. - getContrastText: getContrastText, - // Used by the functions below to shift a color's luminance by approximately - // two indexes within its tonal palette. - // E.g., shift from Red 500 to Red 300 or Red 700. - tonalOffset: tonalOffset - }, types[type]), other, { - clone: false // No need to clone deep - }); - - return paletteOutput; -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/createTypography.js": -/*!*************************************************************!*\ - !*** ./node_modules/material-ui/styles/createTypography.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -exports.default = createTypography; - -var _deepmerge = __webpack_require__(/*! deepmerge */ "./node_modules/deepmerge/dist/es.js"); - -var _deepmerge2 = _interopRequireDefault(_deepmerge); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// < 1kb payload overhead when lodash/merge is > 3kb. - -function round(value) { - return Math.round(value * 1e5) / 1e5; -} - -function createTypography(palette, typography) { - var _ref = typeof typography === 'function' ? typography(palette) : typography, - _ref$fontFamily = _ref.fontFamily, - fontFamily = _ref$fontFamily === undefined ? '"Roboto", "Helvetica", "Arial", sans-serif' : _ref$fontFamily, - _ref$fontSize = _ref.fontSize, - fontSize = _ref$fontSize === undefined ? 14 : _ref$fontSize, - _ref$fontWeightLight = _ref.fontWeightLight, - fontWeightLight = _ref$fontWeightLight === undefined ? 300 : _ref$fontWeightLight, - _ref$fontWeightRegula = _ref.fontWeightRegular, - fontWeightRegular = _ref$fontWeightRegula === undefined ? 400 : _ref$fontWeightRegula, - _ref$fontWeightMedium = _ref.fontWeightMedium, - fontWeightMedium = _ref$fontWeightMedium === undefined ? 500 : _ref$fontWeightMedium, - _ref$htmlFontSize = _ref.htmlFontSize, - htmlFontSize = _ref$htmlFontSize === undefined ? 16 : _ref$htmlFontSize, - other = (0, _objectWithoutProperties3.default)(_ref, ['fontFamily', 'fontSize', 'fontWeightLight', 'fontWeightRegular', 'fontWeightMedium', 'htmlFontSize']); - - function pxToRem(value) { - return value / htmlFontSize + 'rem'; - } - - return (0, _deepmerge2.default)({ - pxToRem: pxToRem, - round: round, - fontFamily: fontFamily, - fontSize: fontSize, - fontWeightLight: fontWeightLight, - fontWeightRegular: fontWeightRegular, - fontWeightMedium: fontWeightMedium, - display4: { - fontSize: pxToRem(112), - fontWeight: fontWeightLight, - fontFamily: fontFamily, - letterSpacing: '-.04em', - lineHeight: round(128 / 112) + 'em', - marginLeft: '-.06em', - color: palette.text.secondary - }, - display3: { - fontSize: pxToRem(56), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - letterSpacing: '-.02em', - lineHeight: round(73 / 56) + 'em', - marginLeft: '-.04em', - color: palette.text.secondary - }, - display2: { - fontSize: pxToRem(45), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(48 / 45) + 'em', - marginLeft: '-.04em', - color: palette.text.secondary - }, - display1: { - fontSize: pxToRem(34), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(41 / 34) + 'em', - marginLeft: '-.04em', - color: palette.text.secondary - }, - headline: { - fontSize: pxToRem(24), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(32.5 / 24) + 'em', - color: palette.text.primary - }, - title: { - fontSize: pxToRem(21), - fontWeight: fontWeightMedium, - fontFamily: fontFamily, - lineHeight: round(24.5 / 21) + 'em', - color: palette.text.primary - }, - subheading: { - fontSize: pxToRem(16), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(24 / 16) + 'em', - color: palette.text.primary - }, - body2: { - fontSize: pxToRem(14), - fontWeight: fontWeightMedium, - fontFamily: fontFamily, - lineHeight: round(24 / 14) + 'em', - color: palette.text.primary - }, - body1: { - fontSize: pxToRem(14), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(20.5 / 14) + 'em', - color: palette.text.primary - }, - caption: { - fontSize: pxToRem(12), - fontWeight: fontWeightRegular, - fontFamily: fontFamily, - lineHeight: round(16.5 / 12) + 'em', - color: palette.text.secondary - }, - button: { - fontSize: pxToRem(fontSize), - textTransform: 'uppercase', - fontWeight: fontWeightMedium, - fontFamily: fontFamily - } - }, other, { - clone: false // No need to clone deep - }); -} - -/***/ }), - -/***/ "./node_modules/material-ui/styles/getStylesCreator.js": -/*!*************************************************************!*\ - !*** ./node_modules/material-ui/styles/getStylesCreator.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _deepmerge = __webpack_require__(/*! deepmerge */ "./node_modules/deepmerge/dist/es.js"); - -var _deepmerge2 = _interopRequireDefault(_deepmerge); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// < 1kb payload overhead when lodash/merge is > 3kb. - -function getStylesCreator(stylesOrCreator) { - var themingEnabled = typeof stylesOrCreator === 'function'; - - function create(theme, name) { - var styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator; - - if (!theme.overrides || !name || !theme.overrides[name]) { - return styles; - } - - var overrides = theme.overrides[name]; - var stylesWithOverrides = (0, _extends3.default)({}, styles); - - (0, _keys2.default)(overrides).forEach(function (key) { - true ? (0, _warning2.default)(stylesWithOverrides[key], ['Material-UI: you are trying to override a style that does not exist.', 'Fix the `' + key + '` key of `theme.overrides.' + name + '`.'].join('\n')) : undefined; - stylesWithOverrides[key] = (0, _deepmerge2.default)(stylesWithOverrides[key], overrides[key]); - }); - - return stylesWithOverrides; - } - - return { - create: create, - options: {}, - themingEnabled: themingEnabled - }; -} - -exports.default = getStylesCreator; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/index.js": -/*!**************************************************!*\ - !*** ./node_modules/material-ui/styles/index.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createGenerateClassName = __webpack_require__(/*! ./createGenerateClassName */ "./node_modules/material-ui/styles/createGenerateClassName.js"); - -Object.defineProperty(exports, 'createGenerateClassName', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_createGenerateClassName).default; - } -}); - -var _createMuiTheme = __webpack_require__(/*! ./createMuiTheme */ "./node_modules/material-ui/styles/createMuiTheme.js"); - -Object.defineProperty(exports, 'createMuiTheme', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_createMuiTheme).default; - } -}); - -var _jssPreset = __webpack_require__(/*! ./jssPreset */ "./node_modules/material-ui/styles/jssPreset.js"); - -Object.defineProperty(exports, 'jssPreset', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_jssPreset).default; - } -}); - -var _MuiThemeProvider = __webpack_require__(/*! ./MuiThemeProvider */ "./node_modules/material-ui/styles/MuiThemeProvider.js"); - -Object.defineProperty(exports, 'MuiThemeProvider', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_MuiThemeProvider).default; - } -}); - -var _withStyles = __webpack_require__(/*! ./withStyles */ "./node_modules/material-ui/styles/withStyles.js"); - -Object.defineProperty(exports, 'withStyles', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_withStyles).default; - } -}); - -var _withTheme = __webpack_require__(/*! ./withTheme */ "./node_modules/material-ui/styles/withTheme.js"); - -Object.defineProperty(exports, 'withTheme', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_withTheme).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ "./node_modules/material-ui/styles/jssPreset.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/styles/jssPreset.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jssGlobal = __webpack_require__(/*! jss-global */ "./node_modules/jss-global/lib/index.js"); - -var _jssGlobal2 = _interopRequireDefault(_jssGlobal); - -var _jssNested = __webpack_require__(/*! jss-nested */ "./node_modules/jss-nested/lib/index.js"); - -var _jssNested2 = _interopRequireDefault(_jssNested); - -var _jssCamelCase = __webpack_require__(/*! jss-camel-case */ "./node_modules/jss-camel-case/lib/index.js"); - -var _jssCamelCase2 = _interopRequireDefault(_jssCamelCase); - -var _jssDefaultUnit = __webpack_require__(/*! jss-default-unit */ "./node_modules/jss-default-unit/lib/index.js"); - -var _jssDefaultUnit2 = _interopRequireDefault(_jssDefaultUnit); - -var _jssVendorPrefixer = __webpack_require__(/*! jss-vendor-prefixer */ "./node_modules/jss-vendor-prefixer/lib/index.js"); - -var _jssVendorPrefixer2 = _interopRequireDefault(_jssVendorPrefixer); - -var _jssPropsSort = __webpack_require__(/*! jss-props-sort */ "./node_modules/jss-props-sort/lib/index.js"); - -var _jssPropsSort2 = _interopRequireDefault(_jssPropsSort); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Subset of jss-preset-default with only the plugins the Material-UI -// components are using. -function jssPreset() { - return { - plugins: [(0, _jssGlobal2.default)(), (0, _jssNested2.default)(), (0, _jssCamelCase2.default)(), (0, _jssDefaultUnit2.default)(), (0, _jssVendorPrefixer2.default)(), (0, _jssPropsSort2.default)()] - }; -} - -exports.default = jssPreset; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/shadows.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/styles/shadows.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var shadowKeyUmbraOpacity = 0.2; -var shadowKeyPenumbraOpacity = 0.14; -var shadowAmbientShadowOpacity = 0.12; - -function createShadow() { - return [(arguments.length <= 0 ? undefined : arguments[0]) + 'px ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px ' + (arguments.length <= 2 ? undefined : arguments[2]) + 'px ' + (arguments.length <= 3 ? undefined : arguments[3]) + 'px rgba(0, 0, 0, ' + shadowKeyUmbraOpacity + ')', (arguments.length <= 4 ? undefined : arguments[4]) + 'px ' + (arguments.length <= 5 ? undefined : arguments[5]) + 'px ' + (arguments.length <= 6 ? undefined : arguments[6]) + 'px ' + (arguments.length <= 7 ? undefined : arguments[7]) + 'px rgba(0, 0, 0, ' + shadowKeyPenumbraOpacity + ')', (arguments.length <= 8 ? undefined : arguments[8]) + 'px ' + (arguments.length <= 9 ? undefined : arguments[9]) + 'px ' + (arguments.length <= 10 ? undefined : arguments[10]) + 'px ' + (arguments.length <= 11 ? undefined : arguments[11]) + 'px rgba(0, 0, 0, ' + shadowAmbientShadowOpacity + ')'].join(','); -} - -var shadows = ['none', createShadow(0, 1, 3, 0, 0, 1, 1, 0, 0, 2, 1, -1), createShadow(0, 1, 5, 0, 0, 2, 2, 0, 0, 3, 1, -2), createShadow(0, 1, 8, 0, 0, 3, 4, 0, 0, 3, 3, -2), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)]; - -exports.default = shadows; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/spacing.js": -/*!****************************************************!*\ - !*** ./node_modules/material-ui/styles/spacing.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - // All components align to an 8dp square baseline grid for mobile, tablet, and desktop. - // https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-baseline-grids - unit: 8 -}; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/themeListener.js": -/*!**********************************************************!*\ - !*** ./node_modules/material-ui/styles/themeListener.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CHANNEL = undefined; - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Same value used by react-jss -var CHANNEL = exports.CHANNEL = '__THEMING__'; - -var themeListener = { - contextTypes: (0, _defineProperty3.default)({}, CHANNEL, _propTypes2.default.object), - initial: function initial(context) { - if (!context[CHANNEL]) { - return null; - } - - return context[CHANNEL].getState(); - }, - subscribe: function subscribe(context, cb) { - if (!context[CHANNEL]) { - return null; - } - - return context[CHANNEL].subscribe(cb); - }, - unsubscribe: function unsubscribe(context, subscriptionId) { - if (context[CHANNEL]) { - context[CHANNEL].unsubscribe(subscriptionId); - } - } -}; - -exports.default = themeListener; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/transitions.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/styles/transitions.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isNumber = exports.isString = exports.formatMs = exports.duration = exports.easing = undefined; - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _isNan = __webpack_require__(/*! babel-runtime/core-js/number/is-nan */ "./node_modules/babel-runtime/core-js/number/is-nan.js"); - -var _isNan2 = _interopRequireDefault(_isNan); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves -// to learn the context in which each easing should be used. -var easing = exports.easing = { - // This is the most common easing curve. - easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)', - // Objects enter the screen at full velocity from off-screen and - // slowly decelerate to a resting point. - easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)', - // Objects leave the screen at full velocity. They do not decelerate when off-screen. - easeIn: 'cubic-bezier(0.4, 0, 1, 1)', - // The sharp curve is used by objects that may return to the screen at any time. - sharp: 'cubic-bezier(0.4, 0, 0.6, 1)' -}; - -// Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations -// to learn when use what timing - -/* eslint-disable no-param-reassign */ - -var duration = exports.duration = { - shortest: 150, - shorter: 200, - short: 250, - // most basic recommended timing - standard: 300, - // this is to be used in complex animations - complex: 375, - // recommended when something is entering screen - enteringScreen: 225, - // recommended when something is leaving screen - leavingScreen: 195 -}; - -var formatMs = exports.formatMs = function formatMs(milliseconds) { - return Math.round(milliseconds) + 'ms'; -}; -var isString = exports.isString = function isString(value) { - return typeof value === 'string'; -}; -var isNumber = exports.isNumber = function isNumber(value) { - return !(0, _isNan2.default)(parseFloat(value)); -}; - -/** - * @param {string|Array} props - * @param {object} param - * @param {string} param.prop - * @param {number} param.duration - * @param {string} param.easing - * @param {number} param.delay - */ -exports.default = { - easing: easing, - duration: duration, - create: function create() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all']; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var _options$duration = options.duration, - durationOption = _options$duration === undefined ? duration.standard : _options$duration, - _options$easing = options.easing, - easingOption = _options$easing === undefined ? easing.easeInOut : _options$easing, - _options$delay = options.delay, - delay = _options$delay === undefined ? 0 : _options$delay, - other = (0, _objectWithoutProperties3.default)(options, ['duration', 'easing', 'delay']); - - - true ? (0, _warning2.default)(isString(props) || Array.isArray(props), 'Material-UI: argument "props" must be a string or Array.') : undefined; - true ? (0, _warning2.default)(isNumber(durationOption) || isString(durationOption), 'Material-UI: argument "duration" must be a number or a string but found ' + durationOption + '.') : undefined; - true ? (0, _warning2.default)(isString(easingOption), 'Material-UI: argument "easing" must be a string.') : undefined; - true ? (0, _warning2.default)(isNumber(delay) || isString(delay), 'Material-UI: argument "delay" must be a number or a string.') : undefined; - true ? (0, _warning2.default)((0, _keys2.default)(other).length === 0, 'Material-UI: unrecognized argument(s) [' + (0, _keys2.default)(other).join(',') + ']') : undefined; - - return (Array.isArray(props) ? props : [props]).map(function (animatedProp) { - return animatedProp + ' ' + (typeof durationOption === 'string' ? durationOption : formatMs(durationOption)) + ' ' + easingOption + ' ' + (typeof delay === 'string' ? delay : formatMs(delay)); - }).join(','); - }, - getAutoHeightDuration: function getAutoHeightDuration(height) { - if (!height) { - return 0; - } - - var constant = height / 36; - - // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10 - return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10); - } -}; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/withStyles.js": -/*!*******************************************************!*\ - !*** ./node_modules/material-ui/styles/withStyles.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sheetsManager = undefined; - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _map = __webpack_require__(/*! babel-runtime/core-js/map */ "./node_modules/babel-runtime/core-js/map.js"); - -var _map2 = _interopRequireDefault(_map); - -var _minSafeInteger = __webpack_require__(/*! babel-runtime/core-js/number/min-safe-integer */ "./node_modules/babel-runtime/core-js/number/min-safe-integer.js"); - -var _minSafeInteger2 = _interopRequireDefault(_minSafeInteger); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _hoistNonReactStatics = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/index.js"); - -var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); - -var _getDisplayName = __webpack_require__(/*! recompose/getDisplayName */ "./node_modules/recompose/getDisplayName.js"); - -var _getDisplayName2 = _interopRequireDefault(_getDisplayName); - -var _wrapDisplayName = __webpack_require__(/*! recompose/wrapDisplayName */ "./node_modules/recompose/wrapDisplayName.js"); - -var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); - -var _contextTypes = __webpack_require__(/*! react-jss/lib/contextTypes */ "./node_modules/react-jss/lib/contextTypes.js"); - -var _contextTypes2 = _interopRequireDefault(_contextTypes); - -var _jss = __webpack_require__(/*! jss */ "./node_modules/jss/lib/index.js"); - -var _ns = __webpack_require__(/*! react-jss/lib/ns */ "./node_modules/react-jss/lib/ns.js"); - -var ns = _interopRequireWildcard(_ns); - -var _jssPreset = __webpack_require__(/*! ./jssPreset */ "./node_modules/material-ui/styles/jssPreset.js"); - -var _jssPreset2 = _interopRequireDefault(_jssPreset); - -var _createMuiTheme = __webpack_require__(/*! ./createMuiTheme */ "./node_modules/material-ui/styles/createMuiTheme.js"); - -var _createMuiTheme2 = _interopRequireDefault(_createMuiTheme); - -var _themeListener = __webpack_require__(/*! ./themeListener */ "./node_modules/material-ui/styles/themeListener.js"); - -var _themeListener2 = _interopRequireDefault(_themeListener); - -var _createGenerateClassName = __webpack_require__(/*! ./createGenerateClassName */ "./node_modules/material-ui/styles/createGenerateClassName.js"); - -var _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName); - -var _getStylesCreator = __webpack_require__(/*! ./getStylesCreator */ "./node_modules/material-ui/styles/getStylesCreator.js"); - -var _getStylesCreator2 = _interopRequireDefault(_getStylesCreator); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// New JSS instance. -var jss = (0, _jss.create)((0, _jssPreset2.default)()); - -// Use a singleton or the provided one by the context. -var generateClassName = (0, _createGenerateClassName2.default)(); - -// Global index counter to preserve source order. -// As we create the style sheet during componentWillMount lifecycle, -// children are handled after the parents, so the order of style elements would -// be parent->child. It is a problem though when a parent passes a className -// which needs to override any childs styles. StyleSheet of the child has a higher -// specificity, because of the source order. -// So our solution is to render sheets them in the reverse order child->sheet, so -// that parent has a higher specificity. -var indexCounter = _minSafeInteger2.default; - -var sheetsManager = exports.sheetsManager = new _map2.default(); - -// We use the same empty object to ref count the styles that don't need a theme object. -var noopTheme = {}; - -// In order to have self-supporting components, we rely on default theme when not provided. -var defaultTheme = void 0; - -function getDefaultTheme() { - if (defaultTheme) { - return defaultTheme; - } - - defaultTheme = (0, _createMuiTheme2.default)(); - return defaultTheme; -} - -// Link a style sheet with a component. -// It does not modify the component passed to it; -// instead, it returns a new component, with a `classes` property. -var withStyles = function withStyles(stylesOrCreator) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return function (Component) { - var _options$withTheme = options.withTheme, - withTheme = _options$withTheme === undefined ? false : _options$withTheme, - _options$flip = options.flip, - flip = _options$flip === undefined ? null : _options$flip, - name = options.name, - styleSheetOptions = (0, _objectWithoutProperties3.default)(options, ['withTheme', 'flip', 'name']); - - var stylesCreator = (0, _getStylesCreator2.default)(stylesOrCreator); - var listenToTheme = stylesCreator.themingEnabled || withTheme || typeof name === 'string'; - - indexCounter += 1; - stylesCreator.options.index = indexCounter; - - true ? (0, _warning2.default)(indexCounter < 0, ['Material-UI: you might have a memory leak.', 'The indexCounter is not supposed to grow that much.'].join(' ')) : undefined; - - var WithStyles = function (_React$Component) { - (0, _inherits3.default)(WithStyles, _React$Component); - - function WithStyles(props, context) { - (0, _classCallCheck3.default)(this, WithStyles); - - var _this = (0, _possibleConstructorReturn3.default)(this, (WithStyles.__proto__ || (0, _getPrototypeOf2.default)(WithStyles)).call(this, props, context)); - - _this.state = {}; - _this.disableStylesGeneration = false; - _this.jss = null; - _this.sheetOptions = null; - _this.sheetsManager = sheetsManager; - _this.stylesCreatorSaved = null; - _this.theme = null; - _this.unsubscribeId = null; - - - _this.jss = _this.context[ns.jss] || jss; - - var muiThemeProviderOptions = _this.context.muiThemeProviderOptions; - - if (muiThemeProviderOptions) { - if (muiThemeProviderOptions.sheetsManager) { - _this.sheetsManager = muiThemeProviderOptions.sheetsManager; - } - - _this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration; - } - - // Attach the stylesCreator to the instance of the component as in the context - // of react-hot-loader the hooks can be executed in a different closure context: - // https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107 - _this.stylesCreatorSaved = stylesCreator; - _this.sheetOptions = (0, _extends3.default)({ - generateClassName: generateClassName - }, _this.context[ns.sheetOptions]); - // We use || as the function call is lazy evaluated. - _this.theme = listenToTheme ? _themeListener2.default.initial(context) || getDefaultTheme() : noopTheme; - return _this; - } - - (0, _createClass3.default)(WithStyles, [{ - key: 'componentWillMount', - value: function componentWillMount() { - this.attach(this.theme); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - if (!listenToTheme) { - return; - } - - this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (theme) { - var oldTheme = _this2.theme; - _this2.theme = theme; - _this2.attach(_this2.theme); - - // Rerender the component so the underlying component gets the theme update. - // By theme update we mean receiving and applying the new class names. - _this2.setState({}, function () { - _this2.detach(oldTheme); - }); - }); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps() { - // react-hot-loader specific logic - if (this.stylesCreatorSaved === stylesCreator || "development" === 'production') { - return; - } - - this.detach(this.theme); - this.stylesCreatorSaved = stylesCreator; - this.attach(this.theme); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.detach(this.theme); - - if (this.unsubscribeId !== null) { - _themeListener2.default.unsubscribe(this.context, this.unsubscribeId); - } - } - }, { - key: 'attach', - value: function attach(theme) { - if (this.disableStylesGeneration) { - return; - } - - var stylesCreatorSaved = this.stylesCreatorSaved; - var sheetManager = this.sheetsManager.get(stylesCreatorSaved); - - if (!sheetManager) { - sheetManager = new _map2.default(); - this.sheetsManager.set(stylesCreatorSaved, sheetManager); - } - - var sheetManagerTheme = sheetManager.get(theme); - - if (!sheetManagerTheme) { - sheetManagerTheme = { - refs: 0, - sheet: null - }; - sheetManager.set(theme, sheetManagerTheme); - } - - if (sheetManagerTheme.refs === 0) { - var styles = stylesCreatorSaved.create(theme, name); - var meta = name; - - if ("development" !== 'production' && !meta) { - meta = (0, _getDisplayName2.default)(Component); - } - - var sheet = this.jss.createStyleSheet(styles, (0, _extends3.default)({ - meta: meta, - classNamePrefix: meta, - flip: typeof flip === 'boolean' ? flip : theme.direction === 'rtl', - link: false - }, this.sheetOptions, stylesCreatorSaved.options, { - name: name - }, styleSheetOptions)); - - sheetManagerTheme.sheet = sheet; - sheet.attach(); - - var sheetsRegistry = this.context[ns.sheetsRegistry]; - if (sheetsRegistry) { - sheetsRegistry.add(sheet); - } - } - - sheetManagerTheme.refs += 1; - } - }, { - key: 'detach', - value: function detach(theme) { - if (this.disableStylesGeneration) { - return; - } - - var stylesCreatorSaved = this.stylesCreatorSaved; - var sheetManager = this.sheetsManager.get(stylesCreatorSaved); - var sheetManagerTheme = sheetManager.get(theme); - - sheetManagerTheme.refs -= 1; - - if (sheetManagerTheme.refs === 0) { - sheetManager.delete(theme); - this.jss.removeStyleSheet(sheetManagerTheme.sheet); - var sheetsRegistry = this.context[ns.sheetsRegistry]; - if (sheetsRegistry) { - sheetsRegistry.remove(sheetManagerTheme.sheet); - } - } - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - var _props = this.props, - classesProp = _props.classes, - innerRef = _props.innerRef, - other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'innerRef']); - - - var classes = void 0; - var renderedClasses = {}; - - if (!this.disableStylesGeneration) { - var sheetManager = this.sheetsManager.get(this.stylesCreatorSaved); - var sheetsManagerTheme = sheetManager.get(this.theme); - renderedClasses = sheetsManagerTheme.sheet.classes; - } - - if (classesProp) { - classes = (0, _extends3.default)({}, renderedClasses, (0, _keys2.default)(classesProp).reduce(function (accumulator, key) { - true ? (0, _warning2.default)(renderedClasses[key] || _this3.disableStylesGeneration, ['Material-UI: the key `' + key + '` ' + ('provided to the classes property is not implemented in ' + (0, _getDisplayName2.default)(Component) + '.'), 'You can only override one of the following: ' + (0, _keys2.default)(renderedClasses).join(',')].join('\n')) : undefined; - - true ? (0, _warning2.default)(!classesProp[key] || typeof classesProp[key] === 'string', ['Material-UI: the key `' + key + '` ' + ('provided to the classes property is not valid for ' + (0, _getDisplayName2.default)(Component) + '.'), 'You need to provide a non empty string instead of: ' + classesProp[key] + '.'].join('\n')) : undefined; - - if (classesProp[key]) { - accumulator[key] = renderedClasses[key] + ' ' + classesProp[key]; - } - - return accumulator; - }, {})); - } else { - classes = renderedClasses; - } - - var more = {}; - - // Provide the theme to the wrapped component. - // So we don't have to use the `withTheme()` Higher-order Component. - if (withTheme) { - more.theme = this.theme; - } - - return _react2.default.createElement(Component, (0, _extends3.default)({ classes: classes }, more, other, { ref: innerRef })); - } - }]); - return WithStyles; - }(_react2.default.Component); - - WithStyles.propTypes = true ? { - /** - * Useful to extend the style applied to components. - */ - classes: _propTypes2.default.object, - /** - * Use that property to pass a ref callback to the decorated component. - */ - innerRef: _propTypes2.default.func - } : undefined; - - WithStyles.contextTypes = (0, _extends3.default)({ - muiThemeProviderOptions: _propTypes2.default.object - }, _contextTypes2.default, listenToTheme ? _themeListener2.default.contextTypes : {}); - - if (true) { - WithStyles.displayName = (0, _wrapDisplayName2.default)(Component, 'WithStyles'); - } - - (0, _hoistNonReactStatics2.default)(WithStyles, Component); - - if (true) { - // Exposed for test purposes. - WithStyles.Naked = Component; - WithStyles.options = options; - } - - return WithStyles; - }; -}; - -exports.default = withStyles; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/withTheme.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/styles/withTheme.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _hoistNonReactStatics = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/index.js"); - -var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); - -var _wrapDisplayName = __webpack_require__(/*! recompose/wrapDisplayName */ "./node_modules/recompose/wrapDisplayName.js"); - -var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); - -var _createMuiTheme = __webpack_require__(/*! ./createMuiTheme */ "./node_modules/material-ui/styles/createMuiTheme.js"); - -var _createMuiTheme2 = _interopRequireDefault(_createMuiTheme); - -var _themeListener = __webpack_require__(/*! ./themeListener */ "./node_modules/material-ui/styles/themeListener.js"); - -var _themeListener2 = _interopRequireDefault(_themeListener); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var defaultTheme = void 0; - -function getDefaultTheme() { - if (defaultTheme) { - return defaultTheme; - } - - defaultTheme = (0, _createMuiTheme2.default)(); - return defaultTheme; -} - -// Provide the theme object as a property to the input component. -var withTheme = function withTheme() { - return function (Component) { - var WithTheme = function (_React$Component) { - (0, _inherits3.default)(WithTheme, _React$Component); - - function WithTheme(props, context) { - (0, _classCallCheck3.default)(this, WithTheme); - - var _this = (0, _possibleConstructorReturn3.default)(this, (WithTheme.__proto__ || (0, _getPrototypeOf2.default)(WithTheme)).call(this, props, context)); - - _this.state = {}; - _this.unsubscribeId = null; - - _this.state = { - // We use || as the function call is lazy evaluated. - theme: _themeListener2.default.initial(context) || getDefaultTheme() - }; - return _this; - } - - (0, _createClass3.default)(WithTheme, [{ - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (theme) { - _this2.setState({ theme: theme }); - }); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - if (this.unsubscribeId !== null) { - _themeListener2.default.unsubscribe(this.context, this.unsubscribeId); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(Component, (0, _extends3.default)({ theme: this.state.theme }, this.props)); - } - }]); - return WithTheme; - }(_react2.default.Component); - - WithTheme.contextTypes = _themeListener2.default.contextTypes; - - if (true) { - WithTheme.displayName = (0, _wrapDisplayName2.default)(Component, 'WithTheme'); - } - - (0, _hoistNonReactStatics2.default)(WithTheme, Component); - - if (true) { - // Exposed for test purposes. - WithTheme.Naked = Component; - } - - return WithTheme; - }; -}; - -exports.default = withTheme; - -/***/ }), - -/***/ "./node_modules/material-ui/styles/zIndex.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/styles/zIndex.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// We need to centralize the zIndex definitions as they work -// like global values in the browser. -var zIndex = { - mobileStepper: 1000, - appBar: 1100, - drawer: 1200, - modal: 1300, - snackbar: 1400, - tooltip: 1500 -}; - -exports.default = zIndex; - -/***/ }), - -/***/ "./node_modules/material-ui/transitions/Fade.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/transitions/Fade.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Transition = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/Transition.js"); - -var _Transition2 = _interopRequireDefault(_Transition); - -var _transitions = __webpack_require__(/*! ../styles/transitions */ "./node_modules/material-ui/styles/transitions.js"); - -var _withTheme = __webpack_require__(/*! ../styles/withTheme */ "./node_modules/material-ui/styles/withTheme.js"); - -var _withTheme2 = _interopRequireDefault(_withTheme); - -var _utils = __webpack_require__(/*! ./utils */ "./node_modules/material-ui/transitions/utils.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// @inheritedComponent Transition - -var styles = { - entering: { - opacity: 1 - }, - entered: { - opacity: 1 - } -}; - -/** - * The Fade transition is used by the [Modal](/demos/modals) component. - * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally. - */ - -var Fade = function (_React$Component) { - (0, _inherits3.default)(Fade, _React$Component); - - function Fade() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Fade); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Fade.__proto__ || (0, _getPrototypeOf2.default)(Fade)).call.apply(_ref, [this].concat(args))), _this), _this.handleEnter = function (node) { - var theme = _this.props.theme; - - (0, _utils.reflow)(node); // So the animation always start from the start. - - var _getTransitionProps = (0, _utils.getTransitionProps)(_this.props, { - mode: 'enter' - }), - transitionDuration = _getTransitionProps.duration, - delay = _getTransitionProps.delay; - - node.style.transition = theme.transitions.create('opacity', { - duration: transitionDuration, - delay: delay - }); - node.style.webkitTransition = theme.transitions.create('opacity', { - duration: transitionDuration, - delay: delay - }); - - if (_this.props.onEnter) { - _this.props.onEnter(node); - } - }, _this.handleExit = function (node) { - var theme = _this.props.theme; - - var _getTransitionProps2 = (0, _utils.getTransitionProps)(_this.props, { - mode: 'exit' - }), - transitionDuration = _getTransitionProps2.duration, - delay = _getTransitionProps2.delay; - - node.style.transition = theme.transitions.create('opacity', { - duration: transitionDuration, - delay: delay - }); - node.style.webkitTransition = theme.transitions.create('opacity', { - duration: transitionDuration, - delay: delay - }); - - if (_this.props.onExit) { - _this.props.onExit(node); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Fade, [{ - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - onEnter = _props.onEnter, - onExit = _props.onExit, - styleProp = _props.style, - theme = _props.theme, - other = (0, _objectWithoutProperties3.default)(_props, ['children', 'onEnter', 'onExit', 'style', 'theme']); - - - var style = (0, _extends3.default)({}, styleProp, _react2.default.isValidElement(children) ? children.props.style : {}); - - return _react2.default.createElement( - _Transition2.default, - (0, _extends3.default)({ appear: true, onEnter: this.handleEnter, onExit: this.handleExit }, other), - function (state, childProps) { - return _react2.default.cloneElement(children, (0, _extends3.default)({ - style: (0, _extends3.default)({ - opacity: 0 - }, styles[state], style) - }, childProps)); - } - ); - } - }]); - return Fade; -}(_react2.default.Component); - -Fade.propTypes = true ? { - /** - * A single child content element. - */ - children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.func]), - /** - * If `true`, the component will transition in. - */ - in: _propTypes2.default.bool, - /** - * @ignore - */ - onEnter: _propTypes2.default.func, - /** - * @ignore - */ - onEntering: _propTypes2.default.func, - /** - * @ignore - */ - onExit: _propTypes2.default.func, - /** - * @ignore - */ - style: _propTypes2.default.object, - /** - * @ignore - */ - theme: _propTypes2.default.object.isRequired, - /** - * The duration for the transition, in milliseconds. - * You may specify a single timeout for all transitions, or individually with an object. - */ - timeout: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number })]) -} : undefined; - -Fade.defaultProps = { - timeout: { - enter: _transitions.duration.enteringScreen, - exit: _transitions.duration.leavingScreen - } -}; - -exports.default = (0, _withTheme2.default)()(Fade); - -/***/ }), - -/***/ "./node_modules/material-ui/transitions/Grow.js": -/*!******************************************************!*\ - !*** ./node_modules/material-ui/transitions/Grow.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _getPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/get-prototype-of */ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js"); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(/*! babel-runtime/helpers/createClass */ "./node_modules/babel-runtime/helpers/createClass.js"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Transition = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/Transition.js"); - -var _Transition2 = _interopRequireDefault(_Transition); - -var _withTheme = __webpack_require__(/*! ../styles/withTheme */ "./node_modules/material-ui/styles/withTheme.js"); - -var _withTheme2 = _interopRequireDefault(_withTheme); - -var _utils = __webpack_require__(/*! ./utils */ "./node_modules/material-ui/transitions/utils.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getScale(value) { - return 'scale(' + value + ', ' + Math.pow(value, 2) + ')'; -} // @inheritedComponent Transition - -var styles = { - entering: { - opacity: 1, - transform: getScale(1) - }, - entered: { - opacity: 1, - transform: getScale(1) - } -}; - -/** - * The Grow transition is used by the [Popover](/demos/popovers) component. - * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally. - */ - -var Grow = function (_React$Component) { - (0, _inherits3.default)(Grow, _React$Component); - - function Grow() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, Grow); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Grow.__proto__ || (0, _getPrototypeOf2.default)(Grow)).call.apply(_ref, [this].concat(args))), _this), _this.autoTimeout = undefined, _this.timer = null, _this.handleEnter = function (node) { - var _this$props = _this.props, - theme = _this$props.theme, - timeout = _this$props.timeout; - - (0, _utils.reflow)(node); // So the animation always start from the start. - - var _getTransitionProps = (0, _utils.getTransitionProps)(_this.props, { - mode: 'enter' - }), - transitionDuration = _getTransitionProps.duration, - delay = _getTransitionProps.delay; - - var duration = 0; - if (timeout === 'auto') { - duration = theme.transitions.getAutoHeightDuration(node.clientHeight); - _this.autoTimeout = duration; - } else { - duration = transitionDuration; - } - - node.style.transition = [theme.transitions.create('opacity', { - duration: duration, - delay: delay - }), theme.transitions.create('transform', { - duration: duration * 0.666, - delay: delay - })].join(','); - - if (_this.props.onEnter) { - _this.props.onEnter(node); - } - }, _this.handleExit = function (node) { - var _this$props2 = _this.props, - theme = _this$props2.theme, - timeout = _this$props2.timeout; - - var duration = 0; - - var _getTransitionProps2 = (0, _utils.getTransitionProps)(_this.props, { - mode: 'exit' - }), - transitionDuration = _getTransitionProps2.duration, - delay = _getTransitionProps2.delay; - - if (timeout === 'auto') { - duration = theme.transitions.getAutoHeightDuration(node.clientHeight); - _this.autoTimeout = duration; - } else { - duration = transitionDuration; - } - - node.style.transition = [theme.transitions.create('opacity', { - duration: duration, - delay: delay - }), theme.transitions.create('transform', { - duration: duration * 0.666, - delay: delay || duration * 0.333 - })].join(','); - - node.style.opacity = '0'; - node.style.transform = getScale(0.75); - - if (_this.props.onExit) { - _this.props.onExit(node); - } - }, _this.addEndListener = function (_, next) { - if (_this.props.timeout === 'auto') { - _this.timer = setTimeout(next, _this.autoTimeout || 0); - } - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(Grow, [{ - key: 'componentWillUnmount', - value: function componentWillUnmount() { - clearTimeout(this.timer); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - onEnter = _props.onEnter, - onExit = _props.onExit, - styleProp = _props.style, - theme = _props.theme, - timeout = _props.timeout, - other = (0, _objectWithoutProperties3.default)(_props, ['children', 'onEnter', 'onExit', 'style', 'theme', 'timeout']); - - - var style = (0, _extends3.default)({}, styleProp, _react2.default.isValidElement(children) ? children.props.style : {}); - - return _react2.default.createElement( - _Transition2.default, - (0, _extends3.default)({ - appear: true, - onEnter: this.handleEnter, - onExit: this.handleExit, - addEndListener: this.addEndListener, - timeout: timeout === 'auto' ? null : timeout - }, other), - function (state, childProps) { - return _react2.default.cloneElement(children, (0, _extends3.default)({ - style: (0, _extends3.default)({ - opacity: 0, - transform: getScale(0.75) - }, styles[state], style) - }, childProps)); - } - ); - } - }]); - return Grow; -}(_react2.default.Component); - -Grow.propTypes = true ? { - /** - * A single child content element. - */ - children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.func]), - /** - * If `true`, show the component; triggers the enter or exit animation. - */ - in: _propTypes2.default.bool, - /** - * @ignore - */ - onEnter: _propTypes2.default.func, - /** - * @ignore - */ - onEntered: _propTypes2.default.func, - /** - * @ignore - */ - onEntering: _propTypes2.default.func, - /** - * @ignore - */ - onExit: _propTypes2.default.func, - /** - * @ignore - */ - style: _propTypes2.default.object, - /** - * @ignore - */ - theme: _propTypes2.default.object.isRequired, - /** - * The duration for the transition, in milliseconds. - * You may specify a single timeout for all transitions, or individually with an object. - * - * Set to 'auto' to automatically calculate transition time based on height. - */ - timeout: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])]) -} : undefined; - -Grow.defaultProps = { - timeout: 'auto' -}; - -exports.default = (0, _withTheme2.default)()(Grow); - -/***/ }), - -/***/ "./node_modules/material-ui/transitions/utils.js": -/*!*******************************************************!*\ - !*** ./node_modules/material-ui/transitions/utils.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTransitionProps = getTransitionProps; -var reflow = exports.reflow = function reflow(node) { - return node.scrollTop; -}; - -function getTransitionProps(props, options) { - var timeout = props.timeout, - _props$style = props.style, - style = _props$style === undefined ? {} : _props$style; - - - return { - duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode], - delay: style.transitionDelay - }; -} - -/***/ }), - -/***/ "./node_modules/material-ui/utils/addEventListener.js": -/*!************************************************************!*\ - !*** ./node_modules/material-ui/utils/addEventListener.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (node, event, handler, capture) { - node.addEventListener(event, handler, capture); - return { - remove: function remove() { - node.removeEventListener(event, handler, capture); - } - }; -}; - -/***/ }), - -/***/ "./node_modules/material-ui/utils/exactProp.js": -/*!*****************************************************!*\ - !*** ./node_modules/material-ui/utils/exactProp.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.specialProperty = undefined; - -var _defineProperty2 = __webpack_require__(/*! babel-runtime/helpers/defineProperty */ "./node_modules/babel-runtime/helpers/defineProperty.js"); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -var _extends3 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); - -var _extends4 = _interopRequireDefault(_extends3); - -exports.default = exactProp; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This module is based on https://github.com/airbnb/prop-types-exact repository. -// However, in order to reduce the number of dependencies and to remove some extra safe checks -// the module was forked. - -var specialProperty = exports.specialProperty = 'exact-prop: \u200B'; - -function exactProp(propTypes, componentNameInError) { - return (0, _extends4.default)({}, propTypes, (0, _defineProperty3.default)({}, specialProperty, function (props) { - var unknownProps = (0, _keys2.default)(props).filter(function (prop) { - return !propTypes.hasOwnProperty(prop); - }); - if (unknownProps.length > 0) { - return new TypeError(componentNameInError + ': unknown props found: ' + unknownProps.join(', ') + '. Please remove the unknown properties.'); - } - return null; - })); -} - -/***/ }), - -/***/ "./node_modules/material-ui/utils/helpers.js": -/*!***************************************************!*\ - !*** ./node_modules/material-ui/utils/helpers.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); - -var _keys2 = _interopRequireDefault(_keys); - -exports.capitalize = capitalize; -exports.contains = contains; -exports.findIndex = findIndex; -exports.find = find; -exports.createChainedFunction = createChainedFunction; - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function capitalize(string) { - if ("development" !== 'production' && typeof string !== 'string') { - throw new Error('Material-UI: capitalize(string) expects a string argument.'); - } - - return string.charAt(0).toUpperCase() + string.slice(1); -} // weak - -function contains(obj, pred) { - return (0, _keys2.default)(pred).every(function (key) { - return obj.hasOwnProperty(key) && obj[key] === pred[key]; - }); -} - -function findIndex(arr, pred) { - var predType = typeof pred === 'undefined' ? 'undefined' : (0, _typeof3.default)(pred); - for (var i = 0; i < arr.length; i += 1) { - if (predType === 'function' && !!pred(arr[i], i, arr) === true) { - return i; - } - if (predType === 'object' && contains(arr[i], pred)) { - return i; - } - if (['string', 'number', 'boolean'].indexOf(predType) !== -1) { - return arr.indexOf(pred); - } - } - return -1; -} - -function find(arr, pred) { - var index = findIndex(arr, pred); - return index > -1 ? arr[index] : undefined; -} - -/** - * Safe chained function - * - * Will only create a new function if needed, - * otherwise will pass back existing functions or null. - * - * @param {function} functions to chain - * @returns {function|null} - */ -function createChainedFunction() { - for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } - - return funcs.filter(function (func) { - return func != null; - }).reduce(function (acc, func) { - true ? (0, _warning2.default)(typeof func === 'function', 'Material-UI: invalid Argument Type, must only provide functions, undefined, or null.') : undefined; - - return function chainedFunction() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - acc.apply(this, args); - func.apply(this, args); - }; - }, function () {}); -} - -/***/ }), - -/***/ "./node_modules/material-ui/utils/keyboardFocus.js": -/*!*********************************************************!*\ - !*** ./node_modules/material-ui/utils/keyboardFocus.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.focusKeyPressed = focusKeyPressed; -exports.detectKeyboardFocus = detectKeyboardFocus; -exports.listenForFocusKeys = listenForFocusKeys; - -var _keycode = __webpack_require__(/*! keycode */ "./node_modules/keycode/index.js"); - -var _keycode2 = _interopRequireDefault(_keycode); - -var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/browser.js"); - -var _warning2 = _interopRequireDefault(_warning); - -var _contains = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"); - -var _contains2 = _interopRequireDefault(_contains); - -var _ownerDocument = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"); - -var _ownerDocument2 = _interopRequireDefault(_ownerDocument); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// weak - -var internal = { - focusKeyPressed: false -}; - -function focusKeyPressed(pressed) { - if (typeof pressed !== 'undefined') { - internal.focusKeyPressed = Boolean(pressed); - } - - return internal.focusKeyPressed; -} - -function detectKeyboardFocus(instance, element, callback) { - var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - - true ? (0, _warning2.default)(instance.keyboardFocusCheckTime, 'Material-UI: missing instance.keyboardFocusCheckTime') : undefined; - true ? (0, _warning2.default)(instance.keyboardFocusMaxCheckTimes, 'Material-UI: missing instance.keyboardFocusMaxCheckTimes') : undefined; - - instance.keyboardFocusTimeout = setTimeout(function () { - var doc = (0, _ownerDocument2.default)(element); - - if (focusKeyPressed() && (doc.activeElement === element || (0, _contains2.default)(element, doc.activeElement))) { - callback(); - } else if (attempt < instance.keyboardFocusMaxCheckTimes) { - detectKeyboardFocus(instance, element, callback, attempt + 1); - } - }, instance.keyboardFocusCheckTime); -} - -var FOCUS_KEYS = ['tab', 'enter', 'space', 'esc', 'up', 'down', 'left', 'right']; - -function isFocusKey(event) { - return FOCUS_KEYS.indexOf((0, _keycode2.default)(event)) !== -1; -} - -var handleKeyUpEvent = function handleKeyUpEvent(event) { - if (isFocusKey(event)) { - internal.focusKeyPressed = true; - } -}; - -function listenForFocusKeys(win) { - // The event listener will only be added once per window. - // Duplicate event listeners will be ignored by addEventListener. - // Also, this logic is client side only, we don't need a teardown. - win.addEventListener('keyup', handleKeyUpEvent); -} - -/***/ }), - -/***/ "./node_modules/material-ui/utils/reactHelpers.js": -/*!********************************************************!*\ - !*** ./node_modules/material-ui/utils/reactHelpers.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.cloneChildrenWithClassName = cloneChildrenWithClassName; -exports.isMuiElement = isMuiElement; -exports.isMuiComponent = isMuiComponent; - -var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint-disable import/prefer-default-export */ - -function cloneChildrenWithClassName(children, className) { - return _react2.default.Children.map(children, function (child) { - return _react2.default.isValidElement(child) && _react2.default.cloneElement(child, { - className: (0, _classnames2.default)(child.props.className, className) - }); - }); -} - -function isMuiElement(element, muiNames) { - return _react2.default.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1; -} - -function isMuiComponent(element, muiNames) { - return muiNames.indexOf(element.muiName) !== -1; -} - -/***/ }), - -/***/ "./node_modules/md5.js/index.js": -/*!**************************************!*\ - !*** ./node_modules/md5.js/index.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) { -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var HashBase = __webpack_require__(/*! hash-base */ "./node_modules/md5.js/node_modules/hash-base/index.js") - -var ARRAY16 = new Array(16) - -function MD5 () { - HashBase.call(this, 64) - - // state - this._a = 0x67452301 - this._b = 0xefcdab89 - this._c = 0x98badcfe - this._d = 0x10325476 -} - -inherits(MD5, HashBase) - -MD5.prototype._update = function () { - var M = ARRAY16 - for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4) - - var a = this._a - var b = this._b - var c = this._c - var d = this._d - - a = fnF(a, b, c, d, M[0], 0xd76aa478, 7) - d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12) - c = fnF(c, d, a, b, M[2], 0x242070db, 17) - b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22) - a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7) - d = fnF(d, a, b, c, M[5], 0x4787c62a, 12) - c = fnF(c, d, a, b, M[6], 0xa8304613, 17) - b = fnF(b, c, d, a, M[7], 0xfd469501, 22) - a = fnF(a, b, c, d, M[8], 0x698098d8, 7) - d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12) - c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17) - b = fnF(b, c, d, a, M[11], 0x895cd7be, 22) - a = fnF(a, b, c, d, M[12], 0x6b901122, 7) - d = fnF(d, a, b, c, M[13], 0xfd987193, 12) - c = fnF(c, d, a, b, M[14], 0xa679438e, 17) - b = fnF(b, c, d, a, M[15], 0x49b40821, 22) - - a = fnG(a, b, c, d, M[1], 0xf61e2562, 5) - d = fnG(d, a, b, c, M[6], 0xc040b340, 9) - c = fnG(c, d, a, b, M[11], 0x265e5a51, 14) - b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20) - a = fnG(a, b, c, d, M[5], 0xd62f105d, 5) - d = fnG(d, a, b, c, M[10], 0x02441453, 9) - c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14) - b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20) - a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5) - d = fnG(d, a, b, c, M[14], 0xc33707d6, 9) - c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14) - b = fnG(b, c, d, a, M[8], 0x455a14ed, 20) - a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5) - d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9) - c = fnG(c, d, a, b, M[7], 0x676f02d9, 14) - b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20) - - a = fnH(a, b, c, d, M[5], 0xfffa3942, 4) - d = fnH(d, a, b, c, M[8], 0x8771f681, 11) - c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16) - b = fnH(b, c, d, a, M[14], 0xfde5380c, 23) - a = fnH(a, b, c, d, M[1], 0xa4beea44, 4) - d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11) - c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16) - b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23) - a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4) - d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11) - c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16) - b = fnH(b, c, d, a, M[6], 0x04881d05, 23) - a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4) - d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11) - c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16) - b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23) - - a = fnI(a, b, c, d, M[0], 0xf4292244, 6) - d = fnI(d, a, b, c, M[7], 0x432aff97, 10) - c = fnI(c, d, a, b, M[14], 0xab9423a7, 15) - b = fnI(b, c, d, a, M[5], 0xfc93a039, 21) - a = fnI(a, b, c, d, M[12], 0x655b59c3, 6) - d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10) - c = fnI(c, d, a, b, M[10], 0xffeff47d, 15) - b = fnI(b, c, d, a, M[1], 0x85845dd1, 21) - a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6) - d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10) - c = fnI(c, d, a, b, M[6], 0xa3014314, 15) - b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21) - a = fnI(a, b, c, d, M[4], 0xf7537e82, 6) - d = fnI(d, a, b, c, M[11], 0xbd3af235, 10) - c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15) - b = fnI(b, c, d, a, M[9], 0xeb86d391, 21) - - this._a = (this._a + a) | 0 - this._b = (this._b + b) | 0 - this._c = (this._c + c) | 0 - this._d = (this._d + d) | 0 -} - -MD5.prototype._digest = function () { - // create padding and handle blocks - this._block[this._blockOffset++] = 0x80 - if (this._blockOffset > 56) { - this._block.fill(0, this._blockOffset, 64) - this._update() - this._blockOffset = 0 - } - - this._block.fill(0, this._blockOffset, 56) - this._block.writeUInt32LE(this._length[0], 56) - this._block.writeUInt32LE(this._length[1], 60) - this._update() - - // produce result - var buffer = new Buffer(16) - buffer.writeInt32LE(this._a, 0) - buffer.writeInt32LE(this._b, 4) - buffer.writeInt32LE(this._c, 8) - buffer.writeInt32LE(this._d, 12) - return buffer -} - -function rotl (x, n) { - return (x << n) | (x >>> (32 - n)) -} - -function fnF (a, b, c, d, m, k, s) { - return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0 -} - -function fnG (a, b, c, d, m, k, s) { - return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0 -} - -function fnH (a, b, c, d, m, k, s) { - return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0 -} - -function fnI (a, b, c, d, m, k, s) { - return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0 -} - -module.exports = MD5 - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/md5.js/node_modules/hash-base/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/md5.js/node_modules/hash-base/index.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var Transform = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js").Transform -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") - -function throwIfNotStringOrBuffer (val, prefix) { - if (!Buffer.isBuffer(val) && typeof val !== 'string') { - throw new TypeError(prefix + ' must be a string or a buffer') - } -} - -function HashBase (blockSize) { - Transform.call(this) - - this._block = Buffer.allocUnsafe(blockSize) - this._blockSize = blockSize - this._blockOffset = 0 - this._length = [0, 0, 0, 0] - - this._finalized = false -} - -inherits(HashBase, Transform) - -HashBase.prototype._transform = function (chunk, encoding, callback) { - var error = null - try { - this.update(chunk, encoding) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype._flush = function (callback) { - var error = null - try { - this.push(this.digest()) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype.update = function (data, encoding) { - throwIfNotStringOrBuffer(data, 'Data') - if (this._finalized) throw new Error('Digest already called') - if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding) - - // consume data - var block = this._block - var offset = 0 - while (this._blockOffset + data.length - offset >= this._blockSize) { - for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] - this._update() - this._blockOffset = 0 - } - while (offset < data.length) block[this._blockOffset++] = data[offset++] - - // update length - for (var j = 0, carry = data.length * 8; carry > 0; ++j) { - this._length[j] += carry - carry = (this._length[j] / 0x0100000000) | 0 - if (carry > 0) this._length[j] -= 0x0100000000 * carry - } - - return this -} - -HashBase.prototype._update = function () { - throw new Error('_update is not implemented') -} - -HashBase.prototype.digest = function (encoding) { - if (this._finalized) throw new Error('Digest already called') - this._finalized = true - - var digest = this._digest() - if (encoding !== undefined) digest = digest.toString(encoding) - - // reset state - this._block.fill(0) - this._blockOffset = 0 - for (var i = 0; i < 4; ++i) this._length[i] = 0 - - return digest -} - -HashBase.prototype._digest = function () { - throw new Error('_digest is not implemented') -} - -module.exports = HashBase - - -/***/ }), - -/***/ "./node_modules/miller-rabin/lib/mr.js": -/*!*********************************************!*\ - !*** ./node_modules/miller-rabin/lib/mr.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var bn = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var brorand = __webpack_require__(/*! brorand */ "./node_modules/brorand/index.js"); - -function MillerRabin(rand) { - this.rand = rand || new brorand.Rand(); -} -module.exports = MillerRabin; - -MillerRabin.create = function create(rand) { - return new MillerRabin(rand); -}; - -MillerRabin.prototype._randbelow = function _randbelow(n) { - var len = n.bitLength(); - var min_bytes = Math.ceil(len / 8); - - // Generage random bytes until a number less than n is found. - // This ensures that 0..n-1 have an equal probability of being selected. - do - var a = new bn(this.rand.generate(min_bytes)); - while (a.cmp(n) >= 0); - - return a; -}; - -MillerRabin.prototype._randrange = function _randrange(start, stop) { - // Generate a random number greater than or equal to start and less than stop. - var size = stop.sub(start); - return start.add(this._randbelow(size)); -}; - -MillerRabin.prototype.test = function test(n, k, cb) { - var len = n.bitLength(); - var red = bn.mont(n); - var rone = new bn(1).toRed(red); - - if (!k) - k = Math.max(1, (len / 48) | 0); - - // Find d and s, (n - 1) = (2 ^ s) * d; - var n1 = n.subn(1); - for (var s = 0; !n1.testn(s); s++) {} - var d = n.shrn(s); - - var rn1 = n1.toRed(red); - - var prime = true; - for (; k > 0; k--) { - var a = this._randrange(new bn(2), n1); - if (cb) - cb(a); - - var x = a.toRed(red).redPow(d); - if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) - continue; - - for (var i = 1; i < s; i++) { - x = x.redSqr(); - - if (x.cmp(rone) === 0) - return false; - if (x.cmp(rn1) === 0) - break; - } - - if (i === s) - return false; - } - - return prime; -}; - -MillerRabin.prototype.getDivisor = function getDivisor(n, k) { - var len = n.bitLength(); - var red = bn.mont(n); - var rone = new bn(1).toRed(red); - - if (!k) - k = Math.max(1, (len / 48) | 0); - - // Find d and s, (n - 1) = (2 ^ s) * d; - var n1 = n.subn(1); - for (var s = 0; !n1.testn(s); s++) {} - var d = n.shrn(s); - - var rn1 = n1.toRed(red); - - for (; k > 0; k--) { - var a = this._randrange(new bn(2), n1); - - var g = n.gcd(a); - if (g.cmpn(1) !== 0) - return g; - - var x = a.toRed(red).redPow(d); - if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) - continue; - - for (var i = 1; i < s; i++) { - x = x.redSqr(); - - if (x.cmp(rone) === 0) - return x.fromRed().subn(1).gcd(n); - if (x.cmp(rn1) === 0) - break; - } - - if (i === s) { - x = x.redSqr(); - return x.fromRed().subn(1).gcd(n); - } - } - - return false; -}; - - -/***/ }), - -/***/ "./node_modules/minimalistic-assert/index.js": -/*!***************************************************!*\ - !*** ./node_modules/minimalistic-assert/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = assert; - -function assert(val, msg) { - if (!val) - throw new Error(msg || 'Assertion failed'); -} - -assert.equal = function assertEqual(l, r, msg) { - if (l != r) - throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); -}; - - -/***/ }), - -/***/ "./node_modules/minimalistic-crypto-utils/lib/utils.js": -/*!*************************************************************!*\ - !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = exports; - -function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg !== 'string') { - for (var i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - return res; - } - if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (var i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } else { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } - return res; -} -utils.toArray = toArray; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -utils.zero2 = zero2; - -function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -utils.toHex = toHex; - -utils.encode = function encode(arr, enc) { - if (enc === 'hex') - return toHex(arr); - else - return arr; -}; - - -/***/ }), - -/***/ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js ***! - \******************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer; - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.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 true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return -1; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'.repeat(p); - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'.repeat(p + 1); - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'.repeat(p + 2); - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character for each buffered byte of a (partial) -// character needs to be added to the output. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} - -/***/ }), - -/***/ "./node_modules/number-to-bn/node_modules/bn.js/lib/bn.js": -/*!****************************************************************!*\ - !*** ./node_modules/number-to-bn/node_modules/bn.js/lib/bn.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer; - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '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' - ]; - - var groupSizes = [ - 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 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) { - // No-op, we should not move anything at all - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - r.strip(); - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(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); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(typeof module === 'undefined' || module, this); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/number-to-bn/src/index.js": -/*!************************************************!*\ - !*** ./node_modules/number-to-bn/src/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var BN = __webpack_require__(/*! bn.js */ "./node_modules/number-to-bn/node_modules/bn.js/lib/bn.js"); -var stripHexPrefix = __webpack_require__(/*! strip-hex-prefix */ "./node_modules/strip-hex-prefix/src/index.js"); - -/** - * Returns a BN object, converts a number value to a BN - * @param {String|Number|Object} `arg` input a string number, hex string number, number, BigNumber or BN object - * @return {Object} `output` BN object of the number - * @throws if the argument is not an array, object that isn't a bignumber, not a string number or number - */ -module.exports = function numberToBN(arg) { - if (typeof arg === 'string' || typeof arg === 'number') { - var multiplier = new BN(1); // eslint-disable-line - var formattedString = String(arg).toLowerCase().trim(); - var isHexPrefixed = formattedString.substr(0, 2) === '0x' || formattedString.substr(0, 3) === '-0x'; - var stringArg = stripHexPrefix(formattedString); // eslint-disable-line - if (stringArg.substr(0, 1) === '-') { - stringArg = stripHexPrefix(stringArg.slice(1)); - multiplier = new BN(-1, 10); - } - stringArg = stringArg === '' ? '0' : stringArg; - - if ((!stringArg.match(/^-?[0-9]+$/) && stringArg.match(/^[0-9A-Fa-f]+$/)) - || stringArg.match(/^[a-fA-F]+$/) - || (isHexPrefixed === true && stringArg.match(/^[0-9A-Fa-f]+$/))) { - return new BN(stringArg, 16).mul(multiplier); - } - - if ((stringArg.match(/^-?[0-9]+$/) || stringArg === '') && isHexPrefixed === false) { - return new BN(stringArg, 10).mul(multiplier); - } - } else if (typeof arg === 'object' && arg.toString && (!arg.pop && !arg.push)) { - if (arg.toString(10).match(/^-?[0-9]+$/) && (arg.mul || arg.dividedToIntegerBy)) { - return new BN(arg.toString(10), 10); - } - } - - throw new Error('[number-to-bn] while converting number ' + JSON.stringify(arg) + ' to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.'); -} - - -/***/ }), - -/***/ "./node_modules/object-assign/index.js": -/*!*********************************************!*\ - !*** ./node_modules/object-assign/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - -/***/ }), - -/***/ "./node_modules/oboe/dist/oboe-browser.js": -/*!************************************************!*\ - !*** ./node_modules/oboe/dist/oboe-browser.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// This file is the concatenation of many js files. -// See http://github.com/jimhigson/oboe.js for the raw source - -// having a local undefined, window, Object etc allows slightly better minification: -(function (window, Object, Array, Error, JSON, undefined ) { - - // v2.1.3 - -/* - -Copyright (c) 2013, Jim Higson - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. 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. - -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. - -*/ - -/** - * Partially complete a function. - * - * var add3 = partialComplete( function add(a,b){return a+b}, 3 ); - * - * add3(4) // gives 7 - * - * function wrap(left, right, cen){return left + " " + cen + " " + right;} - * - * var pirateGreeting = partialComplete( wrap , "I'm", ", a mighty pirate!" ); - * - * pirateGreeting("Guybrush Threepwood"); - * // gives "I'm Guybrush Threepwood, a mighty pirate!" - */ -var partialComplete = varArgs(function( fn, args ) { - - // this isn't the shortest way to write this but it does - // avoid creating a new array each time to pass to fn.apply, - // otherwise could just call boundArgs.concat(callArgs) - - var numBoundArgs = args.length; - - return varArgs(function( callArgs ) { - - for (var i = 0; i < callArgs.length; i++) { - args[numBoundArgs + i] = callArgs[i]; - } - - args.length = numBoundArgs + callArgs.length; - - return fn.apply(this, args); - }); - }), - -/** - * Compose zero or more functions: - * - * compose(f1, f2, f3)(x) = f1(f2(f3(x)))) - * - * The last (inner-most) function may take more than one parameter: - * - * compose(f1, f2, f3)(x,y) = f1(f2(f3(x,y)))) - */ - compose = varArgs(function(fns) { - - var fnsList = arrayAsList(fns); - - function next(params, curFn) { - return [apply(params, curFn)]; - } - - return varArgs(function(startParams){ - - return foldR(next, startParams, fnsList)[0]; - }); - }); - -/** - * A more optimised version of compose that takes exactly two functions - * @param f1 - * @param f2 - */ -function compose2(f1, f2){ - return function(){ - return f1.call(this,f2.apply(this,arguments)); - } -} - -/** - * Generic form for a function to get a property from an object - * - * var o = { - * foo:'bar' - * } - * - * var getFoo = attr('foo') - * - * fetFoo(o) // returns 'bar' - * - * @param {String} key the property name - */ -function attr(key) { - return function(o) { return o[key]; }; -} - -/** - * Call a list of functions with the same args until one returns a - * truthy result. Similar to the || operator. - * - * So: - * lazyUnion([f1,f2,f3 ... fn])( p1, p2 ... pn ) - * - * Is equivalent to: - * apply([p1, p2 ... pn], f1) || - * apply([p1, p2 ... pn], f2) || - * apply([p1, p2 ... pn], f3) ... apply(fn, [p1, p2 ... pn]) - * - * @returns the first return value that is given that is truthy. - */ - var lazyUnion = varArgs(function(fns) { - - return varArgs(function(params){ - - var maybeValue; - - for (var i = 0; i < len(fns); i++) { - - maybeValue = apply(params, fns[i]); - - if( maybeValue ) { - return maybeValue; - } - } - }); - }); - -/** - * This file declares various pieces of functional programming. - * - * This isn't a general purpose functional library, to keep things small it - * has just the parts useful for Oboe.js. - */ - - -/** - * Call a single function with the given arguments array. - * Basically, a functional-style version of the OO-style Function#apply for - * when we don't care about the context ('this') of the call. - * - * The order of arguments allows partial completion of the arguments array - */ -function apply(args, fn) { - return fn.apply(undefined, args); -} - -/** - * Define variable argument functions but cut out all that tedious messing about - * with the arguments object. Delivers the variable-length part of the arguments - * list as an array. - * - * Eg: - * - * var myFunction = varArgs( - * function( fixedArgument, otherFixedArgument, variableNumberOfArguments ){ - * console.log( variableNumberOfArguments ); - * } - * ) - * - * myFunction('a', 'b', 1, 2, 3); // logs [1,2,3] - * - * var myOtherFunction = varArgs(function( variableNumberOfArguments ){ - * console.log( variableNumberOfArguments ); - * }) - * - * myFunction(1, 2, 3); // logs [1,2,3] - * - */ -function varArgs(fn){ - - var numberOfFixedArguments = fn.length -1, - slice = Array.prototype.slice; - - - if( numberOfFixedArguments == 0 ) { - // an optimised case for when there are no fixed args: - - return function(){ - return fn.call(this, slice.call(arguments)); - } - - } else if( numberOfFixedArguments == 1 ) { - // an optimised case for when there are is one fixed args: - - return function(){ - return fn.call(this, arguments[0], slice.call(arguments, 1)); - } - } - - // general case - - // we know how many arguments fn will always take. Create a - // fixed-size array to hold that many, to be re-used on - // every call to the returned function - var argsHolder = Array(fn.length); - - return function(){ - - for (var i = 0; i < numberOfFixedArguments; i++) { - argsHolder[i] = arguments[i]; - } - - argsHolder[numberOfFixedArguments] = - slice.call(arguments, numberOfFixedArguments); - - return fn.apply( this, argsHolder); - } -} - - -/** - * Swap the order of parameters to a binary function - * - * A bit like this flip: http://zvon.org/other/haskell/Outputprelude/flip_f.html - */ -function flip(fn){ - return function(a, b){ - return fn(b,a); - } -} - - -/** - * Create a function which is the intersection of two other functions. - * - * Like the && operator, if the first is truthy, the second is never called, - * otherwise the return value from the second is returned. - */ -function lazyIntersection(fn1, fn2) { - - return function (param) { - - return fn1(param) && fn2(param); - }; -} - -/** - * A function which does nothing - */ -function noop(){} - -/** - * A function which is always happy - */ -function always(){return true} - -/** - * Create a function which always returns the same - * value - * - * var return3 = functor(3); - * - * return3() // gives 3 - * return3() // still gives 3 - * return3() // will always give 3 - */ -function functor(val){ - return function(){ - return val; - } -} - -/** - * This file defines some loosely associated syntactic sugar for - * Javascript programming - */ - - -/** - * Returns true if the given candidate is of type T - */ -function isOfType(T, maybeSomething){ - return maybeSomething && maybeSomething.constructor === T; -} - -var len = attr('length'), - isString = partialComplete(isOfType, String); - -/** - * I don't like saying this: - * - * foo !=== undefined - * - * because of the double-negative. I find this: - * - * defined(foo) - * - * easier to read. - */ -function defined( value ) { - return value !== undefined; -} - -/** - * Returns true if object o has a key named like every property in - * the properties array. Will give false if any are missing, or if o - * is not an object. - */ -function hasAllProperties(fieldList, o) { - - return (o instanceof Object) - && - all(function (field) { - return (field in o); - }, fieldList); -} -/** - * Like cons in Lisp - */ -function cons(x, xs) { - - /* Internally lists are linked 2-element Javascript arrays. - - Ideally the return here would be Object.freeze([x,xs]) - so that bugs related to mutation are found fast. - However, cons is right on the critical path for - performance and this slows oboe-mark down by - ~25%. Under theoretical future JS engines that freeze more - efficiently (possibly even use immutability to - run faster) this should be considered for - restoration. - */ - - return [x,xs]; -} - -/** - * The empty list - */ -var emptyList = null, - -/** - * Get the head of a list. - * - * Ie, head(cons(a,b)) = a - */ - head = attr(0), - -/** - * Get the tail of a list. - * - * Ie, tail(cons(a,b)) = b - */ - tail = attr(1); - - -/** - * Converts an array to a list - * - * asList([a,b,c]) - * - * is equivalent to: - * - * cons(a, cons(b, cons(c, emptyList))) - **/ -function arrayAsList(inputArray){ - - return reverseList( - inputArray.reduce( - flip(cons), - emptyList - ) - ); -} - -/** - * A varargs version of arrayAsList. Works a bit like list - * in LISP. - * - * list(a,b,c) - * - * is equivalent to: - * - * cons(a, cons(b, cons(c, emptyList))) - */ -var list = varArgs(arrayAsList); - -/** - * Convert a list back to a js native array - */ -function listAsArray(list){ - - return foldR( function(arraySoFar, listItem){ - - arraySoFar.unshift(listItem); - return arraySoFar; - - }, [], list ); - -} - -/** - * Map a function over a list - */ -function map(fn, list) { - - return list - ? cons(fn(head(list)), map(fn,tail(list))) - : emptyList - ; -} - -/** - * foldR implementation. Reduce a list down to a single value. - * - * @pram {Function} fn (rightEval, curVal) -> result - */ -function foldR(fn, startValue, list) { - - return list - ? fn(foldR(fn, startValue, tail(list)), head(list)) - : startValue - ; -} - -/** - * foldR implementation. Reduce a list down to a single value. - * - * @pram {Function} fn (rightEval, curVal) -> result - */ -function foldR1(fn, list) { - - return tail(list) - ? fn(foldR1(fn, tail(list)), head(list)) - : head(list) - ; -} - - -/** - * Return a list like the one given but with the first instance equal - * to item removed - */ -function without(list, test, removedFn) { - - return withoutInner(list, removedFn || noop); - - function withoutInner(subList, removedFn) { - return subList - ? ( test(head(subList)) - ? (removedFn(head(subList)), tail(subList)) - : cons(head(subList), withoutInner(tail(subList), removedFn)) - ) - : emptyList - ; - } -} - -/** - * Returns true if the given function holds for every item in - * the list, false otherwise - */ -function all(fn, list) { - - return !list || - ( fn(head(list)) && all(fn, tail(list)) ); -} - -/** - * Call every function in a list of functions with the same arguments - * - * This doesn't make any sense if we're doing pure functional because - * it doesn't return anything. Hence, this is only really useful if the - * functions being called have side-effects. - */ -function applyEach(fnList, args) { - - if( fnList ) { - head(fnList).apply(null, args); - - applyEach(tail(fnList), args); - } -} - -/** - * Reverse the order of a list - */ -function reverseList(list){ - - // js re-implementation of 3rd solution from: - // http://www.haskell.org/haskellwiki/99_questions/Solutions/5 - function reverseInner( list, reversedAlready ) { - if( !list ) { - return reversedAlready; - } - - return reverseInner(tail(list), cons(head(list), reversedAlready)) - } - - return reverseInner(list, emptyList); -} - -function first(test, list) { - return list && - (test(head(list)) - ? head(list) - : first(test,tail(list))); -} - -/* - This is a slightly hacked-up browser only version of clarinet - - * some features removed to help keep browser Oboe under - the 5k micro-library limit - * plug directly into event bus - - For the original go here: - https://github.com/dscape/clarinet - - We receive the events: - STREAM_DATA - STREAM_END - - We emit the events: - SAX_KEY - SAX_VALUE_OPEN - SAX_VALUE_CLOSE - FAIL_EVENT - */ - -function clarinet(eventBus) { - "use strict"; - - var - // shortcut some events on the bus - emitSaxKey = eventBus(SAX_KEY).emit, - emitValueOpen = eventBus(SAX_VALUE_OPEN).emit, - emitValueClose = eventBus(SAX_VALUE_CLOSE).emit, - emitFail = eventBus(FAIL_EVENT).emit, - - MAX_BUFFER_LENGTH = 64 * 1024 - , stringTokenPattern = /[\\"\n]/g - , _n = 0 - - // states - , BEGIN = _n++ - , VALUE = _n++ // general stuff - , OPEN_OBJECT = _n++ // { - , CLOSE_OBJECT = _n++ // } - , OPEN_ARRAY = _n++ // [ - , CLOSE_ARRAY = _n++ // ] - , STRING = _n++ // "" - , OPEN_KEY = _n++ // , "a" - , CLOSE_KEY = _n++ // : - , TRUE = _n++ // r - , TRUE2 = _n++ // u - , TRUE3 = _n++ // e - , FALSE = _n++ // a - , FALSE2 = _n++ // l - , FALSE3 = _n++ // s - , FALSE4 = _n++ // e - , NULL = _n++ // u - , NULL2 = _n++ // l - , NULL3 = _n++ // l - , NUMBER_DECIMAL_POINT = _n++ // . - , NUMBER_DIGIT = _n // [0-9] - - // setup initial parser values - , bufferCheckPosition = MAX_BUFFER_LENGTH - , latestError - , c - , p - , textNode = undefined - , numberNode = "" - , slashed = false - , closed = false - , state = BEGIN - , stack = [] - , unicodeS = null - , unicodeI = 0 - , depth = 0 - , position = 0 - , column = 0 //mostly for error reporting - , line = 1 - ; - - function checkBufferLength () { - - var maxActual = 0; - - if (textNode !== undefined && textNode.length > MAX_BUFFER_LENGTH) { - emitError("Max buffer length exceeded: textNode"); - maxActual = Math.max(maxActual, textNode.length); - } - if (numberNode.length > MAX_BUFFER_LENGTH) { - emitError("Max buffer length exceeded: numberNode"); - maxActual = Math.max(maxActual, numberNode.length); - } - - bufferCheckPosition = (MAX_BUFFER_LENGTH - maxActual) - + position; - } - - eventBus(STREAM_DATA).on(handleData); - - /* At the end of the http content close the clarinet - This will provide an error if the total content provided was not - valid json, ie if not all arrays, objects and Strings closed properly */ - eventBus(STREAM_END).on(handleStreamEnd); - - function emitError (errorString) { - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - - latestError = Error(errorString + "\nLn: "+line+ - "\nCol: "+column+ - "\nChr: "+c); - - emitFail(errorReport(undefined, undefined, latestError)); - } - - function handleStreamEnd() { - if( state == BEGIN ) { - // Handle the case where the stream closes without ever receiving - // any input. This isn't an error - response bodies can be blank, - // particularly for 204 http responses - - // Because of how Oboe is currently implemented, we parse a - // completely empty stream as containing an empty object. - // This is because Oboe's done event is only fired when the - // root object of the JSON stream closes. - - // This should be decoupled and attached instead to the input stream - // from the http (or whatever) resource ending. - // If this decoupling could happen the SAX parser could simply emit - // zero events on a completely empty input. - emitValueOpen({}); - emitValueClose(); - - closed = true; - return; - } - - if (state !== VALUE || depth !== 0) - emitError("Unexpected end"); - - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - - closed = true; - } - - function whitespace(c){ - return c == '\r' || c == '\n' || c == ' ' || c == '\t'; - } - - function handleData (chunk) { - - // this used to throw the error but inside Oboe we will have already - // gotten the error when it was emitted. The important thing is to - // not continue with the parse. - if (latestError) - return; - - if (closed) { - return emitError("Cannot write after close"); - } - - var i = 0; - c = chunk[0]; - - while (c) { - p = c; - c = chunk[i++]; - if(!c) break; - - position ++; - if (c == "\n") { - line ++; - column = 0; - } else column ++; - switch (state) { - - case BEGIN: - if (c === "{") state = OPEN_OBJECT; - else if (c === "[") state = OPEN_ARRAY; - else if (!whitespace(c)) - return emitError("Non-whitespace before {[."); - continue; - - case OPEN_KEY: - case OPEN_OBJECT: - if (whitespace(c)) continue; - if(state === OPEN_KEY) stack.push(CLOSE_KEY); - else { - if(c === '}') { - emitValueOpen({}); - emitValueClose(); - state = stack.pop() || VALUE; - continue; - } else stack.push(CLOSE_OBJECT); - } - if(c === '"') - state = STRING; - else - return emitError("Malformed object key should start with \" "); - continue; - - case CLOSE_KEY: - case CLOSE_OBJECT: - if (whitespace(c)) continue; - - if(c===':') { - if(state === CLOSE_OBJECT) { - stack.push(CLOSE_OBJECT); - - if (textNode !== undefined) { - // was previously (in upstream Clarinet) one event - // - object open came with the text of the first - emitValueOpen({}); - emitSaxKey(textNode); - textNode = undefined; - } - depth++; - } else { - if (textNode !== undefined) { - emitSaxKey(textNode); - textNode = undefined; - } - } - state = VALUE; - } else if (c==='}') { - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - emitValueClose(); - depth--; - state = stack.pop() || VALUE; - } else if(c===',') { - if(state === CLOSE_OBJECT) - stack.push(CLOSE_OBJECT); - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - state = OPEN_KEY; - } else - return emitError('Bad object'); - continue; - - case OPEN_ARRAY: // after an array there always a value - case VALUE: - if (whitespace(c)) continue; - if(state===OPEN_ARRAY) { - emitValueOpen([]); - depth++; - state = VALUE; - if(c === ']') { - emitValueClose(); - depth--; - state = stack.pop() || VALUE; - continue; - } else { - stack.push(CLOSE_ARRAY); - } - } - if(c === '"') state = STRING; - else if(c === '{') state = OPEN_OBJECT; - else if(c === '[') state = OPEN_ARRAY; - else if(c === 't') state = TRUE; - else if(c === 'f') state = FALSE; - else if(c === 'n') state = NULL; - else if(c === '-') { // keep and continue - numberNode += c; - } else if(c==='0') { - numberNode += c; - state = NUMBER_DIGIT; - } else if('123456789'.indexOf(c) !== -1) { - numberNode += c; - state = NUMBER_DIGIT; - } else - return emitError("Bad value"); - continue; - - case CLOSE_ARRAY: - if(c===',') { - stack.push(CLOSE_ARRAY); - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - state = VALUE; - } else if (c===']') { - if (textNode !== undefined) { - emitValueOpen(textNode); - emitValueClose(); - textNode = undefined; - } - emitValueClose(); - depth--; - state = stack.pop() || VALUE; - } else if (whitespace(c)) - continue; - else - return emitError('Bad array'); - continue; - - case STRING: - if (textNode === undefined) { - textNode = ""; - } - - // thanks thejh, this is an about 50% performance improvement. - var starti = i-1; - - STRING_BIGLOOP: while (true) { - - // zero means "no unicode active". 1-4 mean "parse some more". end after 4. - while (unicodeI > 0) { - unicodeS += c; - c = chunk.charAt(i++); - if (unicodeI === 4) { - // TODO this might be slow? well, probably not used too often anyway - textNode += String.fromCharCode(parseInt(unicodeS, 16)); - unicodeI = 0; - starti = i-1; - } else { - unicodeI++; - } - // we can just break here: no stuff we skipped that still has to be sliced out or so - if (!c) break STRING_BIGLOOP; - } - if (c === '"' && !slashed) { - state = stack.pop() || VALUE; - textNode += chunk.substring(starti, i-1); - break; - } - if (c === '\\' && !slashed) { - slashed = true; - textNode += chunk.substring(starti, i-1); - c = chunk.charAt(i++); - if (!c) break; - } - if (slashed) { - slashed = false; - if (c === 'n') { textNode += '\n'; } - else if (c === 'r') { textNode += '\r'; } - else if (c === 't') { textNode += '\t'; } - else if (c === 'f') { textNode += '\f'; } - else if (c === 'b') { textNode += '\b'; } - else if (c === 'u') { - // \uxxxx. meh! - unicodeI = 1; - unicodeS = ''; - } else { - textNode += c; - } - c = chunk.charAt(i++); - starti = i-1; - if (!c) break; - else continue; - } - - stringTokenPattern.lastIndex = i; - var reResult = stringTokenPattern.exec(chunk); - if (!reResult) { - i = chunk.length+1; - textNode += chunk.substring(starti, i-1); - break; - } - i = reResult.index+1; - c = chunk.charAt(reResult.index); - if (!c) { - textNode += chunk.substring(starti, i-1); - break; - } - } - continue; - - case TRUE: - if (!c) continue; // strange buffers - if (c==='r') state = TRUE2; - else - return emitError( 'Invalid true started with t'+ c); - continue; - - case TRUE2: - if (!c) continue; - if (c==='u') state = TRUE3; - else - return emitError('Invalid true started with tr'+ c); - continue; - - case TRUE3: - if (!c) continue; - if(c==='e') { - emitValueOpen(true); - emitValueClose(); - state = stack.pop() || VALUE; - } else - return emitError('Invalid true started with tru'+ c); - continue; - - case FALSE: - if (!c) continue; - if (c==='a') state = FALSE2; - else - return emitError('Invalid false started with f'+ c); - continue; - - case FALSE2: - if (!c) continue; - if (c==='l') state = FALSE3; - else - return emitError('Invalid false started with fa'+ c); - continue; - - case FALSE3: - if (!c) continue; - if (c==='s') state = FALSE4; - else - return emitError('Invalid false started with fal'+ c); - continue; - - case FALSE4: - if (!c) continue; - if (c==='e') { - emitValueOpen(false); - emitValueClose(); - state = stack.pop() || VALUE; - } else - return emitError('Invalid false started with fals'+ c); - continue; - - case NULL: - if (!c) continue; - if (c==='u') state = NULL2; - else - return emitError('Invalid null started with n'+ c); - continue; - - case NULL2: - if (!c) continue; - if (c==='l') state = NULL3; - else - return emitError('Invalid null started with nu'+ c); - continue; - - case NULL3: - if (!c) continue; - if(c==='l') { - emitValueOpen(null); - emitValueClose(); - state = stack.pop() || VALUE; - } else - return emitError('Invalid null started with nul'+ c); - continue; - - case NUMBER_DECIMAL_POINT: - if(c==='.') { - numberNode += c; - state = NUMBER_DIGIT; - } else - return emitError('Leading zero not followed by .'); - continue; - - case NUMBER_DIGIT: - if('0123456789'.indexOf(c) !== -1) numberNode += c; - else if (c==='.') { - if(numberNode.indexOf('.')!==-1) - return emitError('Invalid number has two dots'); - numberNode += c; - } else if (c==='e' || c==='E') { - if(numberNode.indexOf('e')!==-1 || - numberNode.indexOf('E')!==-1 ) - return emitError('Invalid number has two exponential'); - numberNode += c; - } else if (c==="+" || c==="-") { - if(!(p==='e' || p==='E')) - return emitError('Invalid symbol in number'); - numberNode += c; - } else { - if (numberNode) { - emitValueOpen(parseFloat(numberNode)); - emitValueClose(); - numberNode = ""; - } - i--; // go back one - state = stack.pop() || VALUE; - } - continue; - - default: - return emitError("Unknown state: " + state); - } - } - if (position >= bufferCheckPosition) - checkBufferLength(); - } -} - - -/** - * A bridge used to assign stateless functions to listen to clarinet. - * - * As well as the parameter from clarinet, each callback will also be passed - * the result of the last callback. - * - * This may also be used to clear all listeners by assigning zero handlers: - * - * ascentManager( clarinet, {} ) - */ -function ascentManager(oboeBus, handlers){ - "use strict"; - - var listenerId = {}, - ascent; - - function stateAfter(handler) { - return function(param){ - ascent = handler( ascent, param); - } - } - - for( var eventName in handlers ) { - - oboeBus(eventName).on(stateAfter(handlers[eventName]), listenerId); - } - - oboeBus(NODE_SWAP).on(function(newNode) { - - var oldHead = head(ascent), - key = keyOf(oldHead), - ancestors = tail(ascent), - parentNode; - - if( ancestors ) { - parentNode = nodeOf(head(ancestors)); - parentNode[key] = newNode; - } - }); - - oboeBus(NODE_DROP).on(function() { - - var oldHead = head(ascent), - key = keyOf(oldHead), - ancestors = tail(ascent), - parentNode; - - if( ancestors ) { - parentNode = nodeOf(head(ancestors)); - - delete parentNode[key]; - } - }); - - oboeBus(ABORTING).on(function(){ - - for( var eventName in handlers ) { - oboeBus(eventName).un(listenerId); - } - }); -} - -// based on gist https://gist.github.com/monsur/706839 - -/** - * XmlHttpRequest's getAllResponseHeaders() method returns a string of response - * headers according to the format described here: - * http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method - * This method parses that string into a user-friendly key/value pair object. - */ -function parseResponseHeaders(headerStr) { - var headers = {}; - - headerStr && headerStr.split('\u000d\u000a') - .forEach(function(headerPair){ - - // Can't use split() here because it does the wrong thing - // if the header value has the string ": " in it. - var index = headerPair.indexOf('\u003a\u0020'); - - headers[headerPair.substring(0, index)] - = headerPair.substring(index + 2); - }); - - return headers; -} - -/** - * Detect if a given URL is cross-origin in the scope of the - * current page. - * - * Browser only (since cross-origin has no meaning in Node.js) - * - * @param {Object} pageLocation - as in window.location - * @param {Object} ajaxHost - an object like window.location describing the - * origin of the url that we want to ajax in - */ -function isCrossOrigin(pageLocation, ajaxHost) { - - /* - * NB: defaultPort only knows http and https. - * Returns undefined otherwise. - */ - function defaultPort(protocol) { - return {'http:':80, 'https:':443}[protocol]; - } - - function portOf(location) { - // pageLocation should always have a protocol. ajaxHost if no port or - // protocol is specified, should use the port of the containing page - - return location.port || defaultPort(location.protocol||pageLocation.protocol); - } - - // if ajaxHost doesn't give a domain, port is the same as pageLocation - // it can't give a protocol but not a domain - // it can't give a port but not a domain - - return !!( (ajaxHost.protocol && (ajaxHost.protocol != pageLocation.protocol)) || - (ajaxHost.host && (ajaxHost.host != pageLocation.host)) || - (ajaxHost.host && (portOf(ajaxHost) != portOf(pageLocation))) - ); -} - -/* turn any url into an object like window.location */ -function parseUrlOrigin(url) { - // url could be domain-relative - // url could give a domain - - // cross origin means: - // same domain - // same port - // some protocol - // so, same everything up to the first (single) slash - // if such is given - // - // can ignore everything after that - - var URL_HOST_PATTERN = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/, - - // if no match, use an empty array so that - // subexpressions 1,2,3 are all undefined - // and will ultimately return all empty - // strings as the parse result: - urlHostMatch = URL_HOST_PATTERN.exec(url) || []; - - return { - protocol: urlHostMatch[1] || '', - host: urlHostMatch[2] || '', - port: urlHostMatch[3] || '' - }; -} - -function httpTransport(){ - return new XMLHttpRequest(); -} - -/** - * A wrapper around the browser XmlHttpRequest object that raises an - * event whenever a new part of the response is available. - * - * In older browsers progressive reading is impossible so all the - * content is given in a single call. For newer ones several events - * should be raised, allowing progressive interpretation of the response. - * - * @param {Function} oboeBus an event bus local to this Oboe instance - * @param {XMLHttpRequest} xhr the xhr to use as the transport. Under normal - * operation, will have been created using httpTransport() above - * but for tests a stub can be provided instead. - * @param {String} method one of 'GET' 'POST' 'PUT' 'PATCH' 'DELETE' - * @param {String} url the url to make a request to - * @param {String|Null} data some content to be sent with the request. - * Only valid if method is POST or PUT. - * @param {Object} [headers] the http request headers to send - * @param {boolean} withCredentials the XHR withCredentials property will be - * set to this value - */ -function streamingHttp(oboeBus, xhr, method, url, data, headers, withCredentials) { - - "use strict"; - - var emitStreamData = oboeBus(STREAM_DATA).emit, - emitFail = oboeBus(FAIL_EVENT).emit, - numberOfCharsAlreadyGivenToCallback = 0, - stillToSendStartEvent = true; - - // When an ABORTING message is put on the event bus abort - // the ajax request - oboeBus( ABORTING ).on( function(){ - - // if we keep the onreadystatechange while aborting the XHR gives - // a callback like a successful call so first remove this listener - // by assigning null: - xhr.onreadystatechange = null; - - xhr.abort(); - }); - - /** - * Handle input from the underlying xhr: either a state change, - * the progress event or the request being complete. - */ - function handleProgress() { - - var textSoFar = xhr.responseText, - newText = textSoFar.substr(numberOfCharsAlreadyGivenToCallback); - - - /* Raise the event for new text. - - On older browsers, the new text is the whole response. - On newer/better ones, the fragment part that we got since - last progress. */ - - if( newText ) { - emitStreamData( newText ); - } - - numberOfCharsAlreadyGivenToCallback = len(textSoFar); - } - - - if('onprogress' in xhr){ // detect browser support for progressive delivery - xhr.onprogress = handleProgress; - } - - xhr.onreadystatechange = function() { - - function sendStartIfNotAlready() { - // Internet Explorer is very unreliable as to when xhr.status etc can - // be read so has to be protected with try/catch and tried again on - // the next readyState if it fails - try{ - stillToSendStartEvent && oboeBus( HTTP_START ).emit( - xhr.status, - parseResponseHeaders(xhr.getAllResponseHeaders()) ); - stillToSendStartEvent = false; - } catch(e){/* do nothing, will try again on next readyState*/} - } - - switch( xhr.readyState ) { - - case 2: // HEADERS_RECEIVED - case 3: // LOADING - return sendStartIfNotAlready(); - - case 4: // DONE - sendStartIfNotAlready(); // if xhr.status hasn't been available yet, it must be NOW, huh IE? - - // is this a 2xx http code? - var successful = String(xhr.status)[0] == 2; - - if( successful ) { - // In Chrome 29 (not 28) no onprogress is emitted when a response - // is complete before the onload. We need to always do handleInput - // in case we get the load but have not had a final progress event. - // This looks like a bug and may change in future but let's take - // the safest approach and assume we might not have received a - // progress event for each part of the response - handleProgress(); - - oboeBus(STREAM_END).emit(); - } else { - - emitFail( errorReport( - xhr.status, - xhr.responseText - )); - } - } - }; - - try{ - - xhr.open(method, url, true); - - for( var headerName in headers ){ - xhr.setRequestHeader(headerName, headers[headerName]); - } - - if( !isCrossOrigin(window.location, parseUrlOrigin(url)) ) { - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - - xhr.withCredentials = withCredentials; - - xhr.send(data); - - } catch( e ) { - - // To keep a consistent interface with Node, we can't emit an event here. - // Node's streaming http adaptor receives the error as an asynchronous - // event rather than as an exception. If we emitted now, the Oboe user - // has had no chance to add a .fail listener so there is no way - // the event could be useful. For both these reasons defer the - // firing to the next JS frame. - window.setTimeout( - partialComplete(emitFail, errorReport(undefined, undefined, e)) - , 0 - ); - } -} - -var jsonPathSyntax = (function() { - - var - - /** - * Export a regular expression as a simple function by exposing just - * the Regex#exec. This allows regex tests to be used under the same - * interface as differently implemented tests, or for a user of the - * tests to not concern themselves with their implementation as regular - * expressions. - * - * This could also be expressed point-free as: - * Function.prototype.bind.bind(RegExp.prototype.exec), - * - * But that's far too confusing! (and not even smaller once minified - * and gzipped) - */ - regexDescriptor = function regexDescriptor(regex) { - return regex.exec.bind(regex); - } - - /** - * Join several regular expressions and express as a function. - * This allows the token patterns to reuse component regular expressions - * instead of being expressed in full using huge and confusing regular - * expressions. - */ - , jsonPathClause = varArgs(function( componentRegexes ) { - - // The regular expressions all start with ^ because we - // only want to find matches at the start of the - // JSONPath fragment we are inspecting - componentRegexes.unshift(/^/); - - return regexDescriptor( - RegExp( - componentRegexes.map(attr('source')).join('') - ) - ); - }) - - , possiblyCapturing = /(\$?)/ - , namedNode = /([\w-_]+|\*)/ - , namePlaceholder = /()/ - , nodeInArrayNotation = /\["([^"]+)"\]/ - , numberedNodeInArrayNotation = /\[(\d+|\*)\]/ - , fieldList = /{([\w ]*?)}/ - , optionalFieldList = /(?:{([\w ]*?)})?/ - - - // foo or * - , jsonPathNamedNodeInObjectNotation = jsonPathClause( - possiblyCapturing, - namedNode, - optionalFieldList - ) - - // ["foo"] - , jsonPathNamedNodeInArrayNotation = jsonPathClause( - possiblyCapturing, - nodeInArrayNotation, - optionalFieldList - ) - - // [2] or [*] - , jsonPathNumberedNodeInArrayNotation = jsonPathClause( - possiblyCapturing, - numberedNodeInArrayNotation, - optionalFieldList - ) - - // {a b c} - , jsonPathPureDuckTyping = jsonPathClause( - possiblyCapturing, - namePlaceholder, - fieldList - ) - - // .. - , jsonPathDoubleDot = jsonPathClause(/\.\./) - - // . - , jsonPathDot = jsonPathClause(/\./) - - // ! - , jsonPathBang = jsonPathClause( - possiblyCapturing, - /!/ - ) - - // nada! - , emptyString = jsonPathClause(/$/) - - ; - - - /* We export only a single function. When called, this function injects - into another function the descriptors from above. - */ - return function (fn){ - return fn( - lazyUnion( - jsonPathNamedNodeInObjectNotation - , jsonPathNamedNodeInArrayNotation - , jsonPathNumberedNodeInArrayNotation - , jsonPathPureDuckTyping - ) - , jsonPathDoubleDot - , jsonPathDot - , jsonPathBang - , emptyString - ); - }; - -}()); -/** - * Get a new key->node mapping - * - * @param {String|Number} key - * @param {Object|Array|String|Number|null} node a value found in the json - */ -function namedNode(key, node) { - return {key:key, node:node}; -} - -/** get the key of a namedNode */ -var keyOf = attr('key'); - -/** get the node from a namedNode */ -var nodeOf = attr('node'); -/** - * This file provides various listeners which can be used to build up - * a changing ascent based on the callbacks provided by Clarinet. It listens - * to the low-level events from Clarinet and emits higher-level ones. - * - * The building up is stateless so to track a JSON file - * ascentManager.js is required to store the ascent state - * between calls. - */ - - - -/** - * A special value to use in the path list to represent the path 'to' a root - * object (which doesn't really have any path). This prevents the need for - * special-casing detection of the root object and allows it to be treated - * like any other object. We might think of this as being similar to the - * 'unnamed root' domain ".", eg if I go to - * http://en.wikipedia.org./wiki/En/Main_page the dot after 'org' deliminates - * the unnamed root of the DNS. - * - * This is kept as an object to take advantage that in Javascript's OO objects - * are guaranteed to be distinct, therefore no other object can possibly clash - * with this one. Strings, numbers etc provide no such guarantee. - **/ -var ROOT_PATH = {}; - - -/** - * Create a new set of handlers for clarinet's events, bound to the emit - * function given. - */ -function incrementalContentBuilder( oboeBus ) { - - var emitNodeOpened = oboeBus(NODE_OPENED).emit, - emitNodeClosed = oboeBus(NODE_CLOSED).emit, - emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit, - emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit; - - function arrayIndicesAreKeys( possiblyInconsistentAscent, newDeepestNode) { - - /* for values in arrays we aren't pre-warned of the coming paths - (Clarinet gives no call to onkey like it does for values in objects) - so if we are in an array we need to create this path ourselves. The - key will be len(parentNode) because array keys are always sequential - numbers. */ - - var parentNode = nodeOf( head( possiblyInconsistentAscent)); - - return isOfType( Array, parentNode) - ? - keyFound( possiblyInconsistentAscent, - len(parentNode), - newDeepestNode - ) - : - // nothing needed, return unchanged - possiblyInconsistentAscent - ; - } - - function nodeOpened( ascent, newDeepestNode ) { - - if( !ascent ) { - // we discovered the root node, - emitRootOpened( newDeepestNode); - - return keyFound( ascent, ROOT_PATH, newDeepestNode); - } - - // we discovered a non-root node - - var arrayConsistentAscent = arrayIndicesAreKeys( ascent, newDeepestNode), - ancestorBranches = tail( arrayConsistentAscent), - previouslyUnmappedName = keyOf( head( arrayConsistentAscent)); - - appendBuiltContent( - ancestorBranches, - previouslyUnmappedName, - newDeepestNode - ); - - return cons( - namedNode( previouslyUnmappedName, newDeepestNode ), - ancestorBranches - ); - } - - - /** - * Add a new value to the object we are building up to represent the - * parsed JSON - */ - function appendBuiltContent( ancestorBranches, key, node ){ - - nodeOf( head( ancestorBranches))[key] = node; - } - - - /** - * For when we find a new key in the json. - * - * @param {String|Number|Object} newDeepestName the key. If we are in an - * array will be a number, otherwise a string. May take the special - * value ROOT_PATH if the root node has just been found - * - * @param {String|Number|Object|Array|Null|undefined} [maybeNewDeepestNode] - * usually this won't be known so can be undefined. Can't use null - * to represent unknown because null is a valid value in JSON - **/ - function keyFound(ascent, newDeepestName, maybeNewDeepestNode) { - - if( ascent ) { // if not root - - // If we have the key but (unless adding to an array) no known value - // yet. Put that key in the output but against no defined value: - appendBuiltContent( ascent, newDeepestName, maybeNewDeepestNode ); - } - - var ascentWithNewPath = cons( - namedNode( newDeepestName, - maybeNewDeepestNode), - ascent - ); - - emitNodeOpened( ascentWithNewPath); - - return ascentWithNewPath; - } - - - /** - * For when the current node ends. - */ - function nodeClosed( ascent ) { - - emitNodeClosed( ascent); - - return tail( ascent) || - // If there are no nodes left in the ascent the root node - // just closed. Emit a special event for this: - emitRootClosed(nodeOf(head(ascent))); - } - - var contentBuilderHandlers = {}; - contentBuilderHandlers[SAX_VALUE_OPEN] = nodeOpened; - contentBuilderHandlers[SAX_VALUE_CLOSE] = nodeClosed; - contentBuilderHandlers[SAX_KEY] = keyFound; - return contentBuilderHandlers; -} - -/** - * The jsonPath evaluator compiler used for Oboe.js. - * - * One function is exposed. This function takes a String JSONPath spec and - * returns a function to test candidate ascents for matches. - * - * String jsonPath -> (List ascent) -> Boolean|Object - * - * This file is coded in a pure functional style. That is, no function has - * side effects, every function evaluates to the same value for the same - * arguments and no variables are reassigned. - */ -// the call to jsonPathSyntax injects the token syntaxes that are needed -// inside the compiler -var jsonPathCompiler = jsonPathSyntax(function (pathNodeSyntax, - doubleDotSyntax, - dotSyntax, - bangSyntax, - emptySyntax ) { - - var CAPTURING_INDEX = 1; - var NAME_INDEX = 2; - var FIELD_LIST_INDEX = 3; - - var headKey = compose2(keyOf, head), - headNode = compose2(nodeOf, head); - - /** - * Create an evaluator function for a named path node, expressed in the - * JSONPath like: - * foo - * ["bar"] - * [2] - */ - function nameClause(previousExpr, detection ) { - - var name = detection[NAME_INDEX], - - matchesName = ( !name || name == '*' ) - ? always - : function(ascent){return headKey(ascent) == name}; - - - return lazyIntersection(matchesName, previousExpr); - } - - /** - * Create an evaluator function for a a duck-typed node, expressed like: - * - * {spin, taste, colour} - * .particle{spin, taste, colour} - * *{spin, taste, colour} - */ - function duckTypeClause(previousExpr, detection) { - - var fieldListStr = detection[FIELD_LIST_INDEX]; - - if (!fieldListStr) - return previousExpr; // don't wrap at all, return given expr as-is - - var hasAllrequiredFields = partialComplete( - hasAllProperties, - arrayAsList(fieldListStr.split(/\W+/)) - ), - - isMatch = compose2( - hasAllrequiredFields, - headNode - ); - - return lazyIntersection(isMatch, previousExpr); - } - - /** - * Expression for $, returns the evaluator function - */ - function capture( previousExpr, detection ) { - - // extract meaning from the detection - var capturing = !!detection[CAPTURING_INDEX]; - - if (!capturing) - return previousExpr; // don't wrap at all, return given expr as-is - - return lazyIntersection(previousExpr, head); - - } - - /** - * Create an evaluator function that moves onto the next item on the - * lists. This function is the place where the logic to move up a - * level in the ascent exists. - * - * Eg, for JSONPath ".foo" we need skip1(nameClause(always, [,'foo'])) - */ - function skip1(previousExpr) { - - - if( previousExpr == always ) { - /* If there is no previous expression this consume command - is at the start of the jsonPath. - Since JSONPath specifies what we'd like to find but not - necessarily everything leading down to it, when running - out of JSONPath to check against we default to true */ - return always; - } - - /** return true if the ascent we have contains only the JSON root, - * false otherwise - */ - function notAtRoot(ascent){ - return headKey(ascent) != ROOT_PATH; - } - - return lazyIntersection( - /* If we're already at the root but there are more - expressions to satisfy, can't consume any more. No match. - - This check is why none of the other exprs have to be able - to handle empty lists; skip1 is the only evaluator that - moves onto the next token and it refuses to do so once it - reaches the last item in the list. */ - notAtRoot, - - /* We are not at the root of the ascent yet. - Move to the next level of the ascent by handing only - the tail to the previous expression */ - compose2(previousExpr, tail) - ); - - } - - /** - * Create an evaluator function for the .. (double dot) token. Consumes - * zero or more levels of the ascent, the fewest that are required to find - * a match when given to previousExpr. - */ - function skipMany(previousExpr) { - - if( previousExpr == always ) { - /* If there is no previous expression this consume command - is at the start of the jsonPath. - Since JSONPath specifies what we'd like to find but not - necessarily everything leading down to it, when running - out of JSONPath to check against we default to true */ - return always; - } - - var - // In JSONPath .. is equivalent to !.. so if .. reaches the root - // the match has succeeded. Ie, we might write ..foo or !..foo - // and both should match identically. - terminalCaseWhenArrivingAtRoot = rootExpr(), - terminalCaseWhenPreviousExpressionIsSatisfied = previousExpr, - recursiveCase = skip1(function(ascent) { - return cases(ascent); - }), - - cases = lazyUnion( - terminalCaseWhenArrivingAtRoot - , terminalCaseWhenPreviousExpressionIsSatisfied - , recursiveCase - ); - - return cases; - } - - /** - * Generate an evaluator for ! - matches only the root element of the json - * and ignores any previous expressions since nothing may precede !. - */ - function rootExpr() { - - return function(ascent){ - return headKey(ascent) == ROOT_PATH; - }; - } - - /** - * Generate a statement wrapper to sit around the outermost - * clause evaluator. - * - * Handles the case where the capturing is implicit because the JSONPath - * did not contain a '$' by returning the last node. - */ - function statementExpr(lastClause) { - - return function(ascent) { - - // kick off the evaluation by passing through to the last clause - var exprMatch = lastClause(ascent); - - return exprMatch === true ? head(ascent) : exprMatch; - }; - } - - /** - * For when a token has been found in the JSONPath input. - * Compiles the parser for that token and returns in combination with the - * parser already generated. - * - * @param {Function} exprs a list of the clause evaluator generators for - * the token that was found - * @param {Function} parserGeneratedSoFar the parser already found - * @param {Array} detection the match given by the regex engine when - * the feature was found - */ - function expressionsReader( exprs, parserGeneratedSoFar, detection ) { - - // if exprs is zero-length foldR will pass back the - // parserGeneratedSoFar as-is so we don't need to treat - // this as a special case - - return foldR( - function( parserGeneratedSoFar, expr ){ - - return expr(parserGeneratedSoFar, detection); - }, - parserGeneratedSoFar, - exprs - ); - - } - - /** - * If jsonPath matches the given detector function, creates a function which - * evaluates against every clause in the clauseEvaluatorGenerators. The - * created function is propagated to the onSuccess function, along with - * the remaining unparsed JSONPath substring. - * - * The intended use is to create a clauseMatcher by filling in - * the first two arguments, thus providing a function that knows - * some syntax to match and what kind of generator to create if it - * finds it. The parameter list once completed is: - * - * (jsonPath, parserGeneratedSoFar, onSuccess) - * - * onSuccess may be compileJsonPathToFunction, to recursively continue - * parsing after finding a match or returnFoundParser to stop here. - */ - function generateClauseReaderIfTokenFound ( - - tokenDetector, clauseEvaluatorGenerators, - - jsonPath, parserGeneratedSoFar, onSuccess) { - - var detected = tokenDetector(jsonPath); - - if(detected) { - var compiledParser = expressionsReader( - clauseEvaluatorGenerators, - parserGeneratedSoFar, - detected - ), - - remainingUnparsedJsonPath = jsonPath.substr(len(detected[0])); - - return onSuccess(remainingUnparsedJsonPath, compiledParser); - } - } - - /** - * Partially completes generateClauseReaderIfTokenFound above. - */ - function clauseMatcher(tokenDetector, exprs) { - - return partialComplete( - generateClauseReaderIfTokenFound, - tokenDetector, - exprs - ); - } - - /** - * clauseForJsonPath is a function which attempts to match against - * several clause matchers in order until one matches. If non match the - * jsonPath expression is invalid and an error is thrown. - * - * The parameter list is the same as a single clauseMatcher: - * - * (jsonPath, parserGeneratedSoFar, onSuccess) - */ - var clauseForJsonPath = lazyUnion( - - clauseMatcher(pathNodeSyntax , list( capture, - duckTypeClause, - nameClause, - skip1 )) - - , clauseMatcher(doubleDotSyntax , list( skipMany)) - - // dot is a separator only (like whitespace in other languages) but - // rather than make it a special case, use an empty list of - // expressions when this token is found - , clauseMatcher(dotSyntax , list() ) - - , clauseMatcher(bangSyntax , list( capture, - rootExpr)) - - , clauseMatcher(emptySyntax , list( statementExpr)) - - , function (jsonPath) { - throw Error('"' + jsonPath + '" could not be tokenised') - } - ); - - - /** - * One of two possible values for the onSuccess argument of - * generateClauseReaderIfTokenFound. - * - * When this function is used, generateClauseReaderIfTokenFound simply - * returns the compiledParser that it made, regardless of if there is - * any remaining jsonPath to be compiled. - */ - function returnFoundParser(_remainingJsonPath, compiledParser){ - return compiledParser - } - - /** - * Recursively compile a JSONPath expression. - * - * This function serves as one of two possible values for the onSuccess - * argument of generateClauseReaderIfTokenFound, meaning continue to - * recursively compile. Otherwise, returnFoundParser is given and - * compilation terminates. - */ - function compileJsonPathToFunction( uncompiledJsonPath, - parserGeneratedSoFar ) { - - /** - * On finding a match, if there is remaining text to be compiled - * we want to either continue parsing using a recursive call to - * compileJsonPathToFunction. Otherwise, we want to stop and return - * the parser that we have found so far. - */ - var onFind = uncompiledJsonPath - ? compileJsonPathToFunction - : returnFoundParser; - - return clauseForJsonPath( - uncompiledJsonPath, - parserGeneratedSoFar, - onFind - ); - } - - /** - * This is the function that we expose to the rest of the library. - */ - return function(jsonPath){ - - try { - // Kick off the recursive parsing of the jsonPath - return compileJsonPathToFunction(jsonPath, always); - - } catch( e ) { - throw Error( 'Could not compile "' + jsonPath + - '" because ' + e.message - ); - } - } - -}); - -/** - * A pub/sub which is responsible for a single event type. A - * multi-event type event bus is created by pubSub by collecting - * several of these. - * - * @param {String} eventType - * the name of the events managed by this singleEventPubSub - * @param {singleEventPubSub} [newListener] - * place to notify of new listeners - * @param {singleEventPubSub} [removeListener] - * place to notify of when listeners are removed - */ -function singleEventPubSub(eventType, newListener, removeListener){ - - /** we are optimised for emitting events over firing them. - * As well as the tuple list which stores event ids and - * listeners there is a list with just the listeners which - * can be iterated more quickly when we are emitting - */ - var listenerTupleList, - listenerList; - - function hasId(id){ - return function(tuple) { - return tuple.id == id; - }; - } - - return { - - /** - * @param {Function} listener - * @param {*} listenerId - * an id that this listener can later by removed by. - * Can be of any type, to be compared to other ids using == - */ - on:function( listener, listenerId ) { - - var tuple = { - listener: listener - , id: listenerId || listener // when no id is given use the - // listener function as the id - }; - - if( newListener ) { - newListener.emit(eventType, listener, tuple.id); - } - - listenerTupleList = cons( tuple, listenerTupleList ); - listenerList = cons( listener, listenerList ); - - return this; // chaining - }, - - emit:function () { - applyEach( listenerList, arguments ); - }, - - un: function( listenerId ) { - - var removed; - - listenerTupleList = without( - listenerTupleList, - hasId(listenerId), - function(tuple){ - removed = tuple; - } - ); - - if( removed ) { - listenerList = without( listenerList, function(listener){ - return listener == removed.listener; - }); - - if( removeListener ) { - removeListener.emit(eventType, removed.listener, removed.id); - } - } - }, - - listeners: function(){ - // differs from Node EventEmitter: returns list, not array - return listenerList; - }, - - hasListener: function(listenerId){ - var test = listenerId? hasId(listenerId) : always; - - return defined(first( test, listenerTupleList)); - } - }; -} -/** - * pubSub is a curried interface for listening to and emitting - * events. - * - * If we get a bus: - * - * var bus = pubSub(); - * - * We can listen to event 'foo' like: - * - * bus('foo').on(myCallback) - * - * And emit event foo like: - * - * bus('foo').emit() - * - * or, with a parameter: - * - * bus('foo').emit('bar') - * - * All functions can be cached and don't need to be - * bound. Ie: - * - * var fooEmitter = bus('foo').emit - * fooEmitter('bar'); // emit an event - * fooEmitter('baz'); // emit another - * - * There's also an uncurried[1] shortcut for .emit and .on: - * - * bus.on('foo', callback) - * bus.emit('foo', 'bar') - * - * [1]: http://zvon.org/other/haskell/Outputprelude/uncurry_f.html - */ -function pubSub(){ - - var singles = {}, - newListener = newSingle('newListener'), - removeListener = newSingle('removeListener'); - - function newSingle(eventName) { - return singles[eventName] = singleEventPubSub( - eventName, - newListener, - removeListener - ); - } - - /** pubSub instances are functions */ - function pubSubInstance( eventName ){ - - return singles[eventName] || newSingle( eventName ); - } - - // add convenience EventEmitter-style uncurried form of 'emit' and 'on' - ['emit', 'on', 'un'].forEach(function(methodName){ - - pubSubInstance[methodName] = varArgs(function(eventName, parameters){ - apply( parameters, pubSubInstance( eventName )[methodName]); - }); - }); - - return pubSubInstance; -} - -/** - * This file declares some constants to use as names for event types. - */ - -var // the events which are never exported are kept as - // the smallest possible representation, in numbers: - _S = 1, - - // fired whenever a new node starts in the JSON stream: - NODE_OPENED = _S++, - - // fired whenever a node closes in the JSON stream: - NODE_CLOSED = _S++, - - // called if a .node callback returns a value - - NODE_SWAP = _S++, - NODE_DROP = _S++, - - FAIL_EVENT = 'fail', - - ROOT_NODE_FOUND = _S++, - ROOT_PATH_FOUND = _S++, - - HTTP_START = 'start', - STREAM_DATA = 'data', - STREAM_END = 'end', - ABORTING = _S++, - - // SAX events butchered from Clarinet - SAX_KEY = _S++, - SAX_VALUE_OPEN = _S++, - SAX_VALUE_CLOSE = _S++; - -function errorReport(statusCode, body, error) { - try{ - var jsonBody = JSON.parse(body); - }catch(e){} - - return { - statusCode:statusCode, - body:body, - jsonBody:jsonBody, - thrown:error - }; -} - -/** - * The pattern adaptor listens for newListener and removeListener - * events. When patterns are added or removed it compiles the JSONPath - * and wires them up. - * - * When nodes and paths are found it emits the fully-qualified match - * events with parameters ready to ship to the outside world - */ - -function patternAdapter(oboeBus, jsonPathCompiler) { - - var predicateEventMap = { - node:oboeBus(NODE_CLOSED) - , path:oboeBus(NODE_OPENED) - }; - - function emitMatchingNode(emitMatch, node, ascent) { - - /* - We're now calling to the outside world where Lisp-style - lists will not be familiar. Convert to standard arrays. - - Also, reverse the order because it is more common to - list paths "root to leaf" than "leaf to root" */ - var descent = reverseList(ascent); - - emitMatch( - node, - - // To make a path, strip off the last item which is the special - // ROOT_PATH token for the 'path' to the root node - listAsArray(tail(map(keyOf,descent))), // path - listAsArray(map(nodeOf, descent)) // ancestors - ); - } - - /* - * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if - * matching the specified pattern, propagate to pattern-match events such as - * oboeBus('node:!') - * - * - * - * @param {Function} predicateEvent - * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED). - * @param {Function} compiledJsonPath - */ - function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){ - - var emitMatch = oboeBus(fullEventName).emit; - - predicateEvent.on( function (ascent) { - - var maybeMatchingMapping = compiledJsonPath(ascent); - - /* Possible values for maybeMatchingMapping are now: - - false: - we did not match - - an object/array/string/number/null: - we matched and have the node that matched. - Because nulls are valid json values this can be null. - - undefined: - we matched but don't have the matching node yet. - ie, we know there is an upcoming node that matches but we - can't say anything else about it. - */ - if (maybeMatchingMapping !== false) { - - emitMatchingNode( - emitMatch, - nodeOf(maybeMatchingMapping), - ascent - ); - } - }, fullEventName); - - oboeBus('removeListener').on( function(removedEventName){ - - // if the fully qualified match event listener is later removed, clean up - // by removing the underlying listener if it was the last using that pattern: - - if( removedEventName == fullEventName ) { - - if( !oboeBus(removedEventName).listeners( )) { - predicateEvent.un( fullEventName ); - } - } - }); - } - - oboeBus('newListener').on( function(fullEventName){ - - var match = /(node|path):(.*)/.exec(fullEventName); - - if( match ) { - var predicateEvent = predicateEventMap[match[1]]; - - if( !predicateEvent.hasListener( fullEventName) ) { - - addUnderlyingListener( - fullEventName, - predicateEvent, - jsonPathCompiler( match[2] ) - ); - } - } - }) - -} - -/** - * The instance API is the thing that is returned when oboe() is called. - * it allows: - * - * - listeners for various events to be added and removed - * - the http response header/headers to be read - */ -function instanceApi(oboeBus, contentSource){ - - var oboeApi, - fullyQualifiedNamePattern = /^(node|path):./, - rootNodeFinishedEvent = oboeBus(ROOT_NODE_FOUND), - emitNodeDrop = oboeBus(NODE_DROP).emit, - emitNodeSwap = oboeBus(NODE_SWAP).emit, - - /** - * Add any kind of listener that the instance api exposes - */ - addListener = varArgs(function( eventId, parameters ){ - - if( oboeApi[eventId] ) { - - // for events added as .on(event, callback), if there is a - // .event() equivalent with special behaviour , pass through - // to that: - apply(parameters, oboeApi[eventId]); - } else { - - // we have a standard Node.js EventEmitter 2-argument call. - // The first parameter is the listener. - var event = oboeBus(eventId), - listener = parameters[0]; - - if( fullyQualifiedNamePattern.test(eventId) ) { - - // allow fully-qualified node/path listeners - // to be added - addForgettableCallback(event, listener); - } else { - - // the event has no special handling, pass through - // directly onto the event bus: - event.on( listener); - } - } - - return oboeApi; // chaining - }), - - /** - * Remove any kind of listener that the instance api exposes - */ - removeListener = function( eventId, p2, p3 ){ - - if( eventId == 'done' ) { - - rootNodeFinishedEvent.un(p2); - - } else if( eventId == 'node' || eventId == 'path' ) { - - // allow removal of node and path - oboeBus.un(eventId + ':' + p2, p3); - } else { - - // we have a standard Node.js EventEmitter 2-argument call. - // The second parameter is the listener. This may be a call - // to remove a fully-qualified node/path listener but requires - // no special handling - var listener = p2; - - oboeBus(eventId).un(listener); - } - - return oboeApi; // chaining - }; - - /** - * Add a callback, wrapped in a try/catch so as to not break the - * execution of Oboe if an exception is thrown (fail events are - * fired instead) - * - * The callback is used as the listener id so that it can later be - * removed using .un(callback) - */ - function addProtectedCallback(eventName, callback) { - oboeBus(eventName).on(protectedCallback(callback), callback); - return oboeApi; // chaining - } - - /** - * Add a callback where, if .forget() is called during the callback's - * execution, the callback will be de-registered - */ - function addForgettableCallback(event, callback, listenerId) { - - // listenerId is optional and if not given, the original - // callback will be used - listenerId = listenerId || callback; - - var safeCallback = protectedCallback(callback); - - event.on( function() { - - var discard = false; - - oboeApi.forget = function(){ - discard = true; - }; - - apply( arguments, safeCallback ); - - delete oboeApi.forget; - - if( discard ) { - event.un(listenerId); - } - }, listenerId); - - return oboeApi; // chaining - } - - /** - * wrap a callback so that if it throws, Oboe.js doesn't crash but instead - * throw the error in another event loop - */ - function protectedCallback( callback ) { - return function() { - try{ - return callback.apply(oboeApi, arguments); - }catch(e) { - setTimeout(function() { - throw e; - }); - } - } - } - - /** - * Return the fully qualified event for when a pattern matches - * either a node or a path - * - * @param type {String} either 'node' or 'path' - */ - function fullyQualifiedPatternMatchEvent(type, pattern) { - return oboeBus(type + ':' + pattern); - } - - function wrapCallbackToSwapNodeIfSomethingReturned( callback ) { - return function() { - var returnValueFromCallback = callback.apply(this, arguments); - - if( defined(returnValueFromCallback) ) { - - if( returnValueFromCallback == oboe.drop ) { - emitNodeDrop(); - } else { - emitNodeSwap(returnValueFromCallback); - } - } - } - } - - function addSingleNodeOrPathListener(eventId, pattern, callback) { - - var effectiveCallback; - - if( eventId == 'node' ) { - effectiveCallback = wrapCallbackToSwapNodeIfSomethingReturned(callback); - } else { - effectiveCallback = callback; - } - - addForgettableCallback( - fullyQualifiedPatternMatchEvent(eventId, pattern), - effectiveCallback, - callback - ); - } - - /** - * Add several listeners at a time, from a map - */ - function addMultipleNodeOrPathListeners(eventId, listenerMap) { - - for( var pattern in listenerMap ) { - addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]); - } - } - - /** - * implementation behind .onPath() and .onNode() - */ - function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){ - - if( isString(jsonPathOrListenerMap) ) { - addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback); - - } else { - addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap); - } - - return oboeApi; // chaining - } - - - // some interface methods are only filled in after we receive - // values and are noops before that: - oboeBus(ROOT_PATH_FOUND).on( function(rootNode) { - oboeApi.root = functor(rootNode); - }); - - /** - * When content starts make the headers readable through the - * instance API - */ - oboeBus(HTTP_START).on( function(_statusCode, headers) { - - oboeApi.header = function(name) { - return name ? headers[name] - : headers - ; - } - }); - - /** - * Construct and return the public API of the Oboe instance to be - * returned to the calling application - */ - return oboeApi = { - on : addListener, - addListener : addListener, - removeListener : removeListener, - emit : oboeBus.emit, - - node : partialComplete(addNodeOrPathListenerApi, 'node'), - path : partialComplete(addNodeOrPathListenerApi, 'path'), - - done : partialComplete(addForgettableCallback, rootNodeFinishedEvent), - start : partialComplete(addProtectedCallback, HTTP_START ), - - // fail doesn't use protectedCallback because - // could lead to non-terminating loops - fail : oboeBus(FAIL_EVENT).on, - - // public api calling abort fires the ABORTING event - abort : oboeBus(ABORTING).emit, - - // initially return nothing for header and root - header : noop, - root : noop, - - source : contentSource - }; -} - -/** - * This file sits just behind the API which is used to attain a new - * Oboe instance. It creates the new components that are required - * and introduces them to each other. - */ - -function wire (httpMethodName, contentSource, body, headers, withCredentials){ - - var oboeBus = pubSub(); - - // Wire the input stream in if we are given a content source. - // This will usually be the case. If not, the instance created - // will have to be passed content from an external source. - - if( contentSource ) { - - streamingHttp( oboeBus, - httpTransport(), - httpMethodName, - contentSource, - body, - headers, - withCredentials - ); - } - - clarinet(oboeBus); - - ascentManager(oboeBus, incrementalContentBuilder(oboeBus)); - - patternAdapter(oboeBus, jsonPathCompiler); - - return instanceApi(oboeBus, contentSource); -} - -function applyDefaults( passthrough, url, httpMethodName, body, headers, withCredentials, cached ){ - - headers = headers ? - // Shallow-clone the headers array. This allows it to be - // modified without side effects to the caller. We don't - // want to change objects that the user passes in. - JSON.parse(JSON.stringify(headers)) - : {}; - - if( body ) { - if( !isString(body) ) { - - // If the body is not a string, stringify it. This allows objects to - // be given which will be sent as JSON. - body = JSON.stringify(body); - - // Default Content-Type to JSON unless given otherwise. - headers['Content-Type'] = headers['Content-Type'] || 'application/json'; - } - } else { - body = null; - } - - // support cache busting like jQuery.ajax({cache:false}) - function modifiedUrl(baseUrl, cached) { - - if( cached === false ) { - - if( baseUrl.indexOf('?') == -1 ) { - baseUrl += '?'; - } else { - baseUrl += '&'; - } - - baseUrl += '_=' + new Date().getTime(); - } - return baseUrl; - } - - return passthrough( httpMethodName || 'GET', modifiedUrl(url, cached), body, headers, withCredentials || false ); -} - -// export public API -function oboe(arg1) { - - // We use duck-typing to detect if the parameter given is a stream, with the - // below list of parameters. - // Unpipe and unshift would normally be present on a stream but this breaks - // compatibility with Request streams. - // See https://github.com/jimhigson/oboe.js/issues/65 - - var nodeStreamMethodNames = list('resume', 'pause', 'pipe'), - isStream = partialComplete( - hasAllProperties - , nodeStreamMethodNames - ); - - if( arg1 ) { - if (isStream(arg1) || isString(arg1)) { - - // simple version for GETs. Signature is: - // oboe( url ) - // or, under node: - // oboe( readableStream ) - return applyDefaults( - wire, - arg1 // url - ); - - } else { - - // method signature is: - // oboe({method:m, url:u, body:b, headers:{...}}) - - return applyDefaults( - wire, - arg1.url, - arg1.method, - arg1.body, - arg1.headers, - arg1.withCredentials, - arg1.cached - ); - - } - } else { - // wire up a no-AJAX, no-stream Oboe. Will have to have content - // fed in externally and using .emit. - return wire(); - } -} - -/* oboe.drop is a special value. If a node callback returns this value the - parsed node is deleted from the JSON - */ -oboe.drop = function() { - return oboe.drop; -}; - - - if ( true ) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return oboe; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})((function(){ - // Access to the window object throws an exception in HTML5 web workers so - // point it to "self" if it runs in a web worker - try { - return window; - } catch (e) { - return self; - } - }()), Object, Array, Error, JSON); - - -/***/ }), - -/***/ "./node_modules/parse-asn1/aesid.json": -/*!********************************************!*\ - !*** ./node_modules/parse-asn1/aesid.json ***! - \********************************************/ -/*! exports provided: 2.16.840.1.101.3.4.1.1, 2.16.840.1.101.3.4.1.2, 2.16.840.1.101.3.4.1.3, 2.16.840.1.101.3.4.1.4, 2.16.840.1.101.3.4.1.21, 2.16.840.1.101.3.4.1.22, 2.16.840.1.101.3.4.1.23, 2.16.840.1.101.3.4.1.24, 2.16.840.1.101.3.4.1.41, 2.16.840.1.101.3.4.1.42, 2.16.840.1.101.3.4.1.43, 2.16.840.1.101.3.4.1.44, default */ -/***/ (function(module) { - -module.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"}; - -/***/ }), - -/***/ "./node_modules/parse-asn1/asn1.js": -/*!*****************************************!*\ - !*** ./node_modules/parse-asn1/asn1.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js -// Fedor, you are amazing. - - -var asn1 = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js") - -exports.certificate = __webpack_require__(/*! ./certificate */ "./node_modules/parse-asn1/certificate.js") - -var RSAPrivateKey = asn1.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() - ) -}) -exports.RSAPrivateKey = RSAPrivateKey - -var RSAPublicKey = asn1.define('RSAPublicKey', function () { - this.seq().obj( - this.key('modulus').int(), - this.key('publicExponent').int() - ) -}) -exports.RSAPublicKey = RSAPublicKey - -var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) -exports.PublicKey = PublicKey - -var AlgorithmIdentifier = asn1.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() - ) -}) - -var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { - this.seq().obj( - this.key('version').int(), - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPrivateKey').octstr() - ) -}) -exports.PrivateKey = PrivateKeyInfo -var EncryptedPrivateKeyInfo = asn1.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() - ) -}) - -exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo - -var DSAPrivateKey = asn1.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() - ) -}) -exports.DSAPrivateKey = DSAPrivateKey - -exports.DSAparam = asn1.define('DSAparam', function () { - this.int() -}) - -var ECPrivateKey = asn1.define('ECPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('privateKey').octstr(), - this.key('parameters').optional().explicit(0).use(ECParameters), - this.key('publicKey').optional().explicit(1).bitstr() - ) -}) -exports.ECPrivateKey = ECPrivateKey - -var ECParameters = asn1.define('ECParameters', function () { - this.choice({ - namedCurve: this.objid() - }) -}) - -exports.signature = asn1.define('signature', function () { - this.seq().obj( - this.key('r').int(), - this.key('s').int() - ) -}) - - -/***/ }), - -/***/ "./node_modules/parse-asn1/certificate.js": -/*!************************************************!*\ - !*** ./node_modules/parse-asn1/certificate.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js -// thanks to @Rantanen - - - -var asn = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js") - -var Time = asn.define('Time', function () { - this.choice({ - utcTime: this.utctime(), - generalTime: this.gentime() - }) -}) - -var AttributeTypeValue = asn.define('AttributeTypeValue', function () { - this.seq().obj( - this.key('type').objid(), - this.key('value').any() - ) -}) - -var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () { - this.seq().obj( - this.key('algorithm').objid(), - this.key('parameters').optional() - ) -}) - -var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) - -var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () { - this.setof(AttributeTypeValue) -}) - -var RDNSequence = asn.define('RDNSequence', function () { - this.seqof(RelativeDistinguishedName) -}) - -var Name = asn.define('Name', function () { - this.choice({ - rdnSequence: this.use(RDNSequence) - }) -}) - -var Validity = asn.define('Validity', function () { - this.seq().obj( - this.key('notBefore').use(Time), - this.key('notAfter').use(Time) - ) -}) - -var Extension = asn.define('Extension', function () { - this.seq().obj( - this.key('extnID').objid(), - this.key('critical').bool().def(false), - this.key('extnValue').octstr() - ) -}) - -var TBSCertificate = asn.define('TBSCertificate', function () { - this.seq().obj( - this.key('version').explicit(0).int(), - this.key('serialNumber').int(), - this.key('signature').use(AlgorithmIdentifier), - this.key('issuer').use(Name), - this.key('validity').use(Validity), - this.key('subject').use(Name), - this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), - this.key('issuerUniqueID').implicit(1).bitstr().optional(), - this.key('subjectUniqueID').implicit(2).bitstr().optional(), - this.key('extensions').explicit(3).seqof(Extension).optional() - ) -}) - -var X509Certificate = asn.define('X509Certificate', function () { - this.seq().obj( - this.key('tbsCertificate').use(TBSCertificate), - this.key('signatureAlgorithm').use(AlgorithmIdentifier), - this.key('signatureValue').bitstr() - ) -}) - -module.exports = X509Certificate - - -/***/ }), - -/***/ "./node_modules/parse-asn1/fixProc.js": -/*!********************************************!*\ - !*** ./node_modules/parse-asn1/fixProc.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {// adapted from https://github.com/apatil/pemstrip -var findProc = /Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m -var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m -var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m -var evp = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js") -var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js") -module.exports = function (okey, password) { - var key = okey.toString() - var match = key.match(findProc) - var decrypted - if (!match) { - var match2 = key.match(fullRegex) - decrypted = new Buffer(match2[2].replace(/\r?\n/g, ''), 'base64') - } else { - var suite = 'aes' + match[1] - var iv = new Buffer(match[2], 'hex') - var cipherText = new Buffer(match[3].replace(/\r?\n/g, ''), 'base64') - var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key - var out = [] - var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - decrypted = Buffer.concat(out) - } - var tag = key.match(startRegex)[1] - return { - tag: tag, - data: decrypted - } -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/parse-asn1/index.js": -/*!******************************************!*\ - !*** ./node_modules/parse-asn1/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var asn1 = __webpack_require__(/*! ./asn1 */ "./node_modules/parse-asn1/asn1.js") -var aesid = __webpack_require__(/*! ./aesid.json */ "./node_modules/parse-asn1/aesid.json") -var fixProc = __webpack_require__(/*! ./fixProc */ "./node_modules/parse-asn1/fixProc.js") -var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js") -var compat = __webpack_require__(/*! pbkdf2 */ "./node_modules/pbkdf2/browser.js") -module.exports = parseKeys - -function parseKeys (buffer) { - var password - if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { - password = buffer.passphrase - buffer = buffer.key - } - if (typeof buffer === 'string') { - buffer = new Buffer(buffer) - } - - var stripped = fixProc(buffer, password) - - var type = stripped.tag - var data = stripped.data - var subtype, ndata - switch (type) { - case 'CERTIFICATE': - ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo - // falls through - case 'PUBLIC KEY': - if (!ndata) { - ndata = asn1.PublicKey.decode(data, 'der') - } - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') - case '1.2.840.10045.2.1': - ndata.subjectPrivateKey = ndata.subjectPublicKey - return { - type: 'ec', - data: ndata - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') - return { - type: 'dsa', - data: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - throw new Error('unknown key type ' + type) - case 'ENCRYPTED PRIVATE KEY': - data = asn1.EncryptedPrivateKey.decode(data, 'der') - data = decrypt(data, password) - // falls through - case 'PRIVATE KEY': - ndata = asn1.PrivateKey.decode(data, 'der') - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') - case '1.2.840.10045.2.1': - return { - curve: ndata.algorithm.curve, - privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') - return { - type: 'dsa', - params: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - throw new Error('unknown key type ' + type) - case 'RSA PUBLIC KEY': - return asn1.RSAPublicKey.decode(data, 'der') - case 'RSA PRIVATE KEY': - return asn1.RSAPrivateKey.decode(data, 'der') - case 'DSA PRIVATE KEY': - return { - type: 'dsa', - params: asn1.DSAPrivateKey.decode(data, 'der') - } - case 'EC PRIVATE KEY': - data = asn1.ECPrivateKey.decode(data, 'der') - return { - curve: data.parameters.value, - privateKey: data.privateKey - } - default: throw new Error('unknown key type ' + type) - } -} -parseKeys.signature = asn1.signature -function decrypt (data, password) { - var salt = data.algorithm.decrypt.kde.kdeparams.salt - var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) - var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] - var iv = data.algorithm.decrypt.cipher.iv - var cipherText = data.subjectPrivateKey - var keylen = parseInt(algo.split('-')[1], 10) / 8 - var key = compat.pbkdf2Sync(password, salt, iters, keylen) - var cipher = ciphers.createDecipheriv(algo, key, iv) - var out = [] - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - return Buffer.concat(out) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/parse-headers/parse-headers.js": -/*!*****************************************************!*\ - !*** ./node_modules/parse-headers/parse-headers.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var trim = __webpack_require__(/*! trim */ "./node_modules/trim/index.js") - , forEach = __webpack_require__(/*! for-each */ "./node_modules/for-each/index.js") - , isArray = function(arg) { - return Object.prototype.toString.call(arg) === '[object Array]'; - } - -module.exports = function (headers) { - if (!headers) - return {} - - var result = {} - - forEach( - trim(headers).split('\n') - , function (row) { - var index = row.indexOf(':') - , key = trim(row.slice(0, index)).toLowerCase() - , value = trim(row.slice(index + 1)) - - if (typeof(result[key]) === 'undefined') { - result[key] = value - } else if (isArray(result[key])) { - result[key].push(value) - } else { - result[key] = [ result[key], value ] - } - } - ) - - return result -} - -/***/ }), - -/***/ "./node_modules/pbkdf2/browser.js": -/*!****************************************!*\ - !*** ./node_modules/pbkdf2/browser.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - - -exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ "./node_modules/pbkdf2/lib/async.js") - -exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ "./node_modules/pbkdf2/lib/sync-browser.js") - - -/***/ }), - -/***/ "./node_modules/pbkdf2/lib/async.js": -/*!******************************************!*\ - !*** ./node_modules/pbkdf2/lib/async.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, process) {var checkParameters = __webpack_require__(/*! ./precondition */ "./node_modules/pbkdf2/lib/precondition.js") -var defaultEncoding = __webpack_require__(/*! ./default-encoding */ "./node_modules/pbkdf2/lib/default-encoding.js") -var sync = __webpack_require__(/*! ./sync */ "./node_modules/pbkdf2/lib/sync-browser.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer - -var ZERO_BUF -var subtle = global.crypto && global.crypto.subtle -var toBrowser = { - 'sha': 'SHA-1', - 'sha-1': 'SHA-1', - 'sha1': 'SHA-1', - 'sha256': 'SHA-256', - 'sha-256': 'SHA-256', - 'sha384': 'SHA-384', - 'sha-384': 'SHA-384', - 'sha-512': 'SHA-512', - 'sha512': 'SHA-512' -} -var checks = [] -function checkNative (algo) { - if (global.process && !global.process.browser) { - return Promise.resolve(false) - } - if (!subtle || !subtle.importKey || !subtle.deriveBits) { - return Promise.resolve(false) - } - if (checks[algo] !== undefined) { - return checks[algo] - } - ZERO_BUF = ZERO_BUF || Buffer.alloc(8) - var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) - .then(function () { - return true - }).catch(function () { - return false - }) - checks[algo] = prom - return prom -} -function browserPbkdf2 (password, salt, iterations, length, algo) { - return subtle.importKey( - 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits'] - ).then(function (key) { - return subtle.deriveBits({ - name: 'PBKDF2', - salt: salt, - iterations: iterations, - hash: { - name: algo - } - }, key, length << 3) - }).then(function (res) { - return Buffer.from(res) - }) -} -function resolvePromise (promise, callback) { - promise.then(function (out) { - process.nextTick(function () { - callback(null, out) - }) - }, function (e) { - process.nextTick(function () { - callback(e) - }) - }) -} -module.exports = function (password, salt, iterations, keylen, digest, callback) { - if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) - - checkParameters(iterations, keylen) - if (typeof digest === 'function') { - callback = digest - digest = undefined - } - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - digest = digest || 'sha1' - var algo = toBrowser[digest.toLowerCase()] - if (!algo || typeof global.Promise !== 'function') { - return process.nextTick(function () { - var out - try { - out = sync(password, salt, iterations, keylen, digest) - } catch (e) { - return callback(e) - } - callback(null, out) - }) - } - resolvePromise(checkNative(algo).then(function (resp) { - if (resp) { - return browserPbkdf2(password, salt, iterations, keylen, algo) - } else { - return sync(password, salt, iterations, keylen, digest) - } - }), callback) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/pbkdf2/lib/default-encoding.js": -/*!*****************************************************!*\ - !*** ./node_modules/pbkdf2/lib/default-encoding.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding -/* istanbul ignore next */ -if (process.browser) { - defaultEncoding = 'utf-8' -} else { - var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) - - defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary' -} -module.exports = defaultEncoding - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/pbkdf2/lib/precondition.js": -/*!*************************************************!*\ - !*** ./node_modules/pbkdf2/lib/precondition.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs -module.exports = function (iterations, keylen) { - if (typeof iterations !== 'number') { - throw new TypeError('Iterations not a number') - } - - if (iterations < 0) { - throw new TypeError('Bad iterations') - } - - if (typeof keylen !== 'number') { - throw new TypeError('Key length not a number') - } - - if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ - throw new TypeError('Bad key length') - } -} - - -/***/ }), - -/***/ "./node_modules/pbkdf2/lib/sync-browser.js": -/*!*************************************************!*\ - !*** ./node_modules/pbkdf2/lib/sync-browser.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var md5 = __webpack_require__(/*! create-hash/md5 */ "./node_modules/create-hash/md5.js") -var rmd160 = __webpack_require__(/*! ripemd160 */ "./node_modules/ripemd160/index.js") -var sha = __webpack_require__(/*! sha.js */ "./node_modules/sha.js/index.js") - -var checkParameters = __webpack_require__(/*! ./precondition */ "./node_modules/pbkdf2/lib/precondition.js") -var defaultEncoding = __webpack_require__(/*! ./default-encoding */ "./node_modules/pbkdf2/lib/default-encoding.js") -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var ZEROS = Buffer.alloc(128) -var sizes = { - md5: 16, - sha1: 20, - sha224: 28, - sha256: 32, - sha384: 48, - sha512: 64, - rmd160: 20, - ripemd160: 20 -} - -function Hmac (alg, key, saltLen) { - var hash = getDigest(alg) - var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 - - if (key.length > blocksize) { - key = hash(key) - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]) - var opad = Buffer.allocUnsafe(blocksize + sizes[alg]) - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - - var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4) - ipad.copy(ipad1, 0, 0, blocksize) - this.ipad1 = ipad1 - this.ipad2 = ipad - this.opad = opad - this.alg = alg - this.blocksize = blocksize - this.hash = hash - this.size = sizes[alg] -} - -Hmac.prototype.run = function (data, ipad) { - data.copy(ipad, this.blocksize) - var h = this.hash(ipad) - h.copy(this.opad, this.blocksize) - return this.hash(this.opad) -} - -function getDigest (alg) { - function shaFunc (data) { - return sha(alg).update(data).digest() - } - - if (alg === 'rmd160' || alg === 'ripemd160') return rmd160 - if (alg === 'md5') return md5 - return shaFunc -} - -function pbkdf2 (password, salt, iterations, keylen, digest) { - if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) - - checkParameters(iterations, keylen) - - digest = digest || 'sha1' - - var hmac = new Hmac(digest, password, salt.length) - - var DK = Buffer.allocUnsafe(keylen) - var block1 = Buffer.allocUnsafe(salt.length + 4) - salt.copy(block1, 0, 0, salt.length) - - var destPos = 0 - var hLen = sizes[digest] - var l = Math.ceil(keylen / hLen) - - for (var i = 1; i <= l; i++) { - block1.writeUInt32BE(i, salt.length) - - var T = hmac.run(block1, hmac.ipad1) - var U = T - - for (var j = 1; j < iterations; j++) { - U = hmac.run(U, hmac.ipad2) - for (var k = 0; k < hLen; k++) T[k] ^= U[k] - } - - T.copy(DK, destPos) - destPos += hLen - } - - return DK -} - -module.exports = pbkdf2 - - -/***/ }), - -/***/ "./node_modules/process-nextick-args/index.js": -/*!****************************************************!*\ - !*** ./node_modules/process-nextick-args/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process -} - -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } -} - - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/prop-types/checkPropTypes.js": -/*!***************************************************!*\ - !*** ./node_modules/prop-types/checkPropTypes.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -if (true) { - var invariant = __webpack_require__(/*! fbjs/lib/invariant */ "./node_modules/fbjs/lib/invariant.js"); - var warning = __webpack_require__(/*! fbjs/lib/warning */ "./node_modules/fbjs/lib/warning.js"); - var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (true) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - - -/***/ }), - -/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": -/*!************************************************************!*\ - !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ "./node_modules/fbjs/lib/emptyFunction.js"); -var invariant = __webpack_require__(/*! fbjs/lib/invariant */ "./node_modules/fbjs/lib/invariant.js"); -var warning = __webpack_require__(/*! fbjs/lib/warning */ "./node_modules/fbjs/lib/warning.js"); -var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); - -var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); -var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; - - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (true) { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if ("development" !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - true ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : undefined; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - true ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - // We need to check all keys in case some are required but missing from - // props. - var allKeys = assign({}, props[propName], shapeTypes); - for (var key in allKeys) { - var checker = shapeTypes[key]; - if (!checker) { - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') - ); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - - -/***/ }), - -/***/ "./node_modules/prop-types/index.js": -/*!******************************************!*\ - !*** ./node_modules/prop-types/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -if (true) { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(isValidElement, throwOnDirectAccess); -} else {} - - -/***/ }), - -/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": -/*!*************************************************************!*\ - !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), - -/***/ "./node_modules/public-encrypt/browser.js": -/*!************************************************!*\ - !*** ./node_modules/public-encrypt/browser.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ "./node_modules/public-encrypt/publicEncrypt.js"); -exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ "./node_modules/public-encrypt/privateDecrypt.js"); - -exports.privateEncrypt = function privateEncrypt(key, buf) { - return exports.publicEncrypt(key, buf, true); -}; - -exports.publicDecrypt = function publicDecrypt(key, buf) { - return exports.privateDecrypt(key, buf, true); -}; - -/***/ }), - -/***/ "./node_modules/public-encrypt/mgf.js": -/*!********************************************!*\ - !*** ./node_modules/public-encrypt/mgf.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js"); -module.exports = function (seed, len) { - var t = new Buffer(''); - var i = 0, c; - while (t.length < len) { - c = i2ops(i++); - t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]); - } - return t.slice(0, len); -}; - -function i2ops(c) { - var out = new Buffer(4); - out.writeUInt32BE(c,0); - return out; -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/public-encrypt/privateDecrypt.js": -/*!*******************************************************!*\ - !*** ./node_modules/public-encrypt/privateDecrypt.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js"); -var mgf = __webpack_require__(/*! ./mgf */ "./node_modules/public-encrypt/mgf.js"); -var xor = __webpack_require__(/*! ./xor */ "./node_modules/public-encrypt/xor.js"); -var bn = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var crt = __webpack_require__(/*! browserify-rsa */ "./node_modules/browserify-rsa/index.js"); -var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js"); -var withPublic = __webpack_require__(/*! ./withPublic */ "./node_modules/public-encrypt/withPublic.js"); -module.exports = function privateDecrypt(private_key, enc, reverse) { - var padding; - if (private_key.padding) { - padding = private_key.padding; - } else if (reverse) { - padding = 1; - } else { - padding = 4; - } - - var key = parseKeys(private_key); - var k = key.modulus.byteLength(); - if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) { - throw new Error('decryption error'); - } - var msg; - if (reverse) { - msg = withPublic(new bn(enc), key); - } else { - msg = crt(enc, key); - } - var zBuffer = new Buffer(k - msg.length); - zBuffer.fill(0); - msg = Buffer.concat([zBuffer, msg], k); - if (padding === 4) { - return oaep(key, msg); - } else if (padding === 1) { - return pkcs1(key, msg, reverse); - } else if (padding === 3) { - return msg; - } else { - throw new Error('unknown padding'); - } -}; - -function oaep(key, msg){ - var n = key.modulus; - var k = key.modulus.byteLength(); - var mLen = msg.length; - var iHash = createHash('sha1').update(new Buffer('')).digest(); - var hLen = iHash.length; - var hLen2 = 2 * hLen; - if (msg[0] !== 0) { - throw new Error('decryption error'); - } - var maskedSeed = msg.slice(1, hLen + 1); - var maskedDb = msg.slice(hLen + 1); - var seed = xor(maskedSeed, mgf(maskedDb, hLen)); - var db = xor(maskedDb, mgf(seed, k - hLen - 1)); - if (compare(iHash, db.slice(0, hLen))) { - throw new Error('decryption error'); - } - var i = hLen; - while (db[i] === 0) { - i++; - } - if (db[i++] !== 1) { - throw new Error('decryption error'); - } - return db.slice(i); -} - -function pkcs1(key, msg, reverse){ - var p1 = msg.slice(0, 2); - var i = 2; - var status = 0; - while (msg[i++] !== 0) { - if (i >= msg.length) { - status++; - break; - } - } - var ps = msg.slice(2, i - 1); - var p2 = msg.slice(i - 1, i); - - if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){ - status++; - } - if (ps.length < 8) { - status++; - } - if (status) { - throw new Error('decryption error'); - } - return msg.slice(i); -} -function compare(a, b){ - a = new Buffer(a); - b = new Buffer(b); - var dif = 0; - var len = a.length; - if (a.length !== b.length) { - dif++; - len = Math.min(a.length, b.length); - } - var i = -1; - while (++i < len) { - dif += (a[i] ^ b[i]); - } - return dif; -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/public-encrypt/publicEncrypt.js": -/*!******************************************************!*\ - !*** ./node_modules/public-encrypt/publicEncrypt.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js"); -var randomBytes = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js"); -var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js"); -var mgf = __webpack_require__(/*! ./mgf */ "./node_modules/public-encrypt/mgf.js"); -var xor = __webpack_require__(/*! ./xor */ "./node_modules/public-encrypt/xor.js"); -var bn = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -var withPublic = __webpack_require__(/*! ./withPublic */ "./node_modules/public-encrypt/withPublic.js"); -var crt = __webpack_require__(/*! browserify-rsa */ "./node_modules/browserify-rsa/index.js"); - -var constants = { - RSA_PKCS1_OAEP_PADDING: 4, - RSA_PKCS1_PADDIN: 1, - RSA_NO_PADDING: 3 -}; - -module.exports = function publicEncrypt(public_key, msg, reverse) { - var padding; - if (public_key.padding) { - padding = public_key.padding; - } else if (reverse) { - padding = 1; - } else { - padding = 4; - } - var key = parseKeys(public_key); - var paddedMsg; - if (padding === 4) { - paddedMsg = oaep(key, msg); - } else if (padding === 1) { - paddedMsg = pkcs1(key, msg, reverse); - } else if (padding === 3) { - paddedMsg = new bn(msg); - if (paddedMsg.cmp(key.modulus) >= 0) { - throw new Error('data too long for modulus'); - } - } else { - throw new Error('unknown padding'); - } - if (reverse) { - return crt(paddedMsg, key); - } else { - return withPublic(paddedMsg, key); - } -}; - -function oaep(key, msg){ - var k = key.modulus.byteLength(); - var mLen = msg.length; - var iHash = createHash('sha1').update(new Buffer('')).digest(); - var hLen = iHash.length; - var hLen2 = 2 * hLen; - if (mLen > k - hLen2 - 2) { - throw new Error('message too long'); - } - var ps = new Buffer(k - mLen - hLen2 - 2); - ps.fill(0); - var dblen = k - hLen - 1; - var seed = randomBytes(hLen); - var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen)); - var maskedSeed = xor(seed, mgf(maskedDb, hLen)); - return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k)); -} -function pkcs1(key, msg, reverse){ - var mLen = msg.length; - var k = key.modulus.byteLength(); - if (mLen > k - 11) { - throw new Error('message too long'); - } - var ps; - if (reverse) { - ps = new Buffer(k - mLen - 3); - ps.fill(0xff); - } else { - ps = nonZero(k - mLen - 3); - } - return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); -} -function nonZero(len, crypto) { - var out = new Buffer(len); - var i = 0; - var cache = randomBytes(len*2); - var cur = 0; - var num; - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len*2); - cur = 0; - } - num = cache[cur++]; - if (num) { - out[i++] = num; - } - } - return out; -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/public-encrypt/withPublic.js": -/*!***************************************************!*\ - !*** ./node_modules/public-encrypt/withPublic.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); -function withPublic(paddedMsg, key) { - return new Buffer(paddedMsg - .toRed(bn.mont(key.modulus)) - .redPow(new bn(key.publicExponent)) - .fromRed() - .toArray()); -} - -module.exports = withPublic; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/public-encrypt/xor.js": -/*!********************************************!*\ - !*** ./node_modules/public-encrypt/xor.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function xor(a, b) { - var len = a.length; - var i = -1; - while (++i < len) { - a[i] ^= b[i]; - } - return a -}; - -/***/ }), - -/***/ "./node_modules/punycode/punycode.js": -/*!*******************************************!*\ - !*** ./node_modules/punycode/punycode.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; - } - - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, - - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' - - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators - - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw new RangeError(errors[type]); - } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } - - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); - - } - - return ucs2encode(output); - } - - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - handledCPCount = basicLength = output.length; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); - } - - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } - - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.4.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - true - ) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { - return punycode; - }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} - -}(this)); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/query-string/index.js": -/*!********************************************!*\ - !*** ./node_modules/query-string/index.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strictUriEncode = __webpack_require__(/*! strict-uri-encode */ "./node_modules/strict-uri-encode/index.js"); -var objectAssign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); -var decodeComponent = __webpack_require__(/*! decode-uri-component */ "./node_modules/decode-uri-component/index.js"); - -function encoderForArrayFormat(opts) { - switch (opts.arrayFormat) { - case 'index': - return function (key, value, index) { - return value === null ? [ - encode(key, opts), - '[', - index, - ']' - ].join('') : [ - encode(key, opts), - '[', - encode(index, opts), - ']=', - encode(value, opts) - ].join(''); - }; - - case 'bracket': - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '[]=', - encode(value, opts) - ].join(''); - }; - - default: - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '=', - encode(value, opts) - ].join(''); - }; - } -} - -function parserForArrayFormat(opts) { - var result; - - switch (opts.arrayFormat) { - case 'index': - return function (key, value, accumulator) { - result = /\[(\d*)\]$/.exec(key); - - key = key.replace(/\[\d*\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } - - accumulator[key][result[1]] = value; - }; - - case 'bracket': - return function (key, value, accumulator) { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } else if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - - default: - return function (key, value, accumulator) { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - } -} - -function encode(value, opts) { - if (opts.encode) { - return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); - } - - return value; -} - -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } else if (typeof input === 'object') { - return keysSorter(Object.keys(input)).sort(function (a, b) { - return Number(a) - Number(b); - }).map(function (key) { - return input[key]; - }); - } - - return input; -} - -exports.extract = function (str) { - var queryStart = str.indexOf('?'); - if (queryStart === -1) { - return ''; - } - return str.slice(queryStart + 1); -}; - -exports.parse = function (str, opts) { - opts = objectAssign({arrayFormat: 'none'}, opts); - - var formatter = parserForArrayFormat(opts); - - // Create an object with no prototype - // https://github.com/sindresorhus/query-string/issues/47 - var ret = Object.create(null); - - if (typeof str !== 'string') { - return ret; - } - - str = str.trim().replace(/^[?#&]/, ''); - - if (!str) { - return ret; - } - - str.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; - - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeComponent(val); - - formatter(decodeComponent(key), val, ret); - }); - - return Object.keys(ret).sort().reduce(function (result, key) { - var val = ret[key]; - if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { - // Sort object keys, not values - result[key] = keysSorter(val); - } else { - result[key] = val; - } - - return result; - }, Object.create(null)); -}; - -exports.stringify = function (obj, opts) { - var defaults = { - encode: true, - strict: true, - arrayFormat: 'none' - }; - - opts = objectAssign(defaults, opts); - - if (opts.sort === false) { - opts.sort = function () {}; - } - - var formatter = encoderForArrayFormat(opts); - - return obj ? Object.keys(obj).sort(opts.sort).map(function (key) { - var val = obj[key]; - - if (val === undefined) { - return ''; - } - - if (val === null) { - return encode(key, opts); - } - - if (Array.isArray(val)) { - var result = []; - - val.slice().forEach(function (val2) { - if (val2 === undefined) { - return; - } - - result.push(formatter(key, val2, result.length)); - }); - - return result.join('&'); - } - - return encode(key, opts) + '=' + encode(val, opts); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; - -exports.parseUrl = function (str, opts) { - return { - url: str.split('?')[0] || '', - query: this.parse(this.extract(str), opts) - }; -}; - - -/***/ }), - -/***/ "./node_modules/querystring-es3/decode.js": -/*!************************************************!*\ - !*** ./node_modules/querystring-es3/decode.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), - -/***/ "./node_modules/querystring-es3/encode.js": -/*!************************************************!*\ - !*** ./node_modules/querystring-es3/encode.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } -}; - -module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return map(objectKeys(obj), function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (isArray(obj[k])) { - return map(obj[k], function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); - - } - - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -function map (xs, f) { - if (xs.map) return xs.map(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - res.push(f(xs[i], i)); - } - return res; -} - -var objectKeys = Object.keys || function (obj) { - var res = []; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - - -/***/ }), - -/***/ "./node_modules/querystring-es3/index.js": -/*!***********************************************!*\ - !*** ./node_modules/querystring-es3/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "./node_modules/querystring-es3/decode.js"); -exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "./node_modules/querystring-es3/encode.js"); - - -/***/ }), - -/***/ "./node_modules/randombytes/browser.js": -/*!*********************************************!*\ - !*** ./node_modules/randombytes/browser.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) { - -function oldBrowser () { - throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') -} - -var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - - // XXX: phantomjs doesn't like a buffer being passed here - var bytes = Buffer.from(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/randomfill/browser.js": -/*!********************************************!*\ - !*** ./node_modules/randomfill/browser.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) { - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} -var safeBuffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js") -var randombytes = __webpack_require__(/*! randombytes */ "./node_modules/randombytes/browser.js") -var Buffer = safeBuffer.Buffer -var kBufferMaxLength = safeBuffer.kMaxLength -var crypto = global.crypto || global.msCrypto -var kMaxUint32 = Math.pow(2, 32) - 1 -function assertOffset (offset, length) { - if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare - throw new TypeError('offset must be a number') - } - - if (offset > kMaxUint32 || offset < 0) { - throw new TypeError('offset must be a uint32') - } - - if (offset > kBufferMaxLength || offset > length) { - throw new RangeError('offset out of range') - } -} - -function assertSize (size, offset, length) { - if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare - throw new TypeError('size must be a number') - } - - if (size > kMaxUint32 || size < 0) { - throw new TypeError('size must be a uint32') - } - - if (size + offset > length || size > kBufferMaxLength) { - throw new RangeError('buffer too small') - } -} -if ((crypto && crypto.getRandomValues) || !process.browser) { - exports.randomFill = randomFill - exports.randomFillSync = randomFillSync -} else { - exports.randomFill = oldBrowser - exports.randomFillSync = oldBrowser -} -function randomFill (buf, offset, size, cb) { - if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { - throw new TypeError('"buf" argument must be a Buffer or Uint8Array') - } - - if (typeof offset === 'function') { - cb = offset - offset = 0 - size = buf.length - } else if (typeof size === 'function') { - cb = size - size = buf.length - offset - } else if (typeof cb !== 'function') { - throw new TypeError('"cb" argument must be a function') - } - assertOffset(offset, buf.length) - assertSize(size, offset, buf.length) - return actualFill(buf, offset, size, cb) -} - -function actualFill (buf, offset, size, cb) { - if (process.browser) { - var ourBuf = buf.buffer - var uint = new Uint8Array(ourBuf, offset, size) - crypto.getRandomValues(uint) - if (cb) { - process.nextTick(function () { - cb(null, buf) - }) - return - } - return buf - } - if (cb) { - randombytes(size, function (err, bytes) { - if (err) { - return cb(err) - } - bytes.copy(buf, offset) - cb(null, buf) - }) - return - } - var bytes = randombytes(size) - bytes.copy(buf, offset) - return buf -} -function randomFillSync (buf, offset, size) { - if (typeof offset === 'undefined') { - offset = 0 - } - if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { - throw new TypeError('"buf" argument must be a Buffer or Uint8Array') - } - - assertOffset(offset, buf.length) - - if (size === undefined) size = buf.length - offset - - assertSize(size, offset, buf.length) - - return actualFill(buf, offset, size) -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/randomhex/src/browser.js": -/*!***********************************************!*\ - !*** ./node_modules/randomhex/src/browser.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = window.crypto; - -/***/ }), - -/***/ "./node_modules/randomhex/src/crypto.js": -/*!**********************************************!*\ - !*** ./node_modules/randomhex/src/crypto.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(/*! crypto */ "./node_modules/randomhex/src/browser.js"); - -/***/ }), - -/***/ "./node_modules/randomhex/src/index.js": -/*!*********************************************!*\ - !*** ./node_modules/randomhex/src/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var randomHex = function(size, callback) { - var crypto = __webpack_require__(/*! ./crypto.js */ "./node_modules/randomhex/src/crypto.js"); - var isCallback = (typeof callback === 'function'); - - - if (size > 65536) { - if(isCallback) { - callback(new Error('Requested too many random bytes.')); - } else { - throw new Error('Requested too many random bytes.'); - } - }; - - - // is node - if (typeof crypto !== 'undefined' && crypto.randomBytes) { - - if(isCallback) { - crypto.randomBytes(size, function(err, result){ - if(!err) { - callback(null, '0x'+ result.toString('hex')); - } else { - callback(error); - } - }) - } else { - return '0x'+ crypto.randomBytes(size).toString('hex'); - } - - // is browser - } else { - var cryptoLib; - - if (typeof crypto !== 'undefined') { - cryptoLib = crypto; - } else if(typeof msCrypto !== 'undefined') { - cryptoLib = msCrypto; - } - - if (cryptoLib && cryptoLib.getRandomValues) { - var randomBytes = cryptoLib.getRandomValues(new Uint8Array(size)); - var returnValue = '0x'+ Array.from(randomBytes).map(function(arr){ return arr.toString(16); }).join(''); - - if(isCallback) { - callback(null, returnValue); - } else { - return returnValue; - } - - // not crypto object - } else { - var error = new Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.'); - - if(isCallback) { - callback(error); - } else { - throw error; - } - } - } -}; - - -module.exports = randomHex; - - -/***/ }), - -/***/ "./node_modules/react-dom/cjs/react-dom.development.js": -/*!*************************************************************!*\ - !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** @license React v16.2.0 - * react-dom.development.js - * - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - - - -if (true) { - (function() { -'use strict'; - -var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -var invariant = __webpack_require__(/*! fbjs/lib/invariant */ "./node_modules/fbjs/lib/invariant.js"); -var warning = __webpack_require__(/*! fbjs/lib/warning */ "./node_modules/fbjs/lib/warning.js"); -var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ "./node_modules/fbjs/lib/ExecutionEnvironment.js"); -var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); -var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ "./node_modules/fbjs/lib/emptyFunction.js"); -var EventListener = __webpack_require__(/*! fbjs/lib/EventListener */ "./node_modules/fbjs/lib/EventListener.js"); -var getActiveElement = __webpack_require__(/*! fbjs/lib/getActiveElement */ "./node_modules/fbjs/lib/getActiveElement.js"); -var shallowEqual = __webpack_require__(/*! fbjs/lib/shallowEqual */ "./node_modules/fbjs/lib/shallowEqual.js"); -var containsNode = __webpack_require__(/*! fbjs/lib/containsNode */ "./node_modules/fbjs/lib/containsNode.js"); -var focusNode = __webpack_require__(/*! fbjs/lib/focusNode */ "./node_modules/fbjs/lib/focusNode.js"); -var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ "./node_modules/fbjs/lib/emptyObject.js"); -var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); -var hyphenateStyleName = __webpack_require__(/*! fbjs/lib/hyphenateStyleName */ "./node_modules/fbjs/lib/hyphenateStyleName.js"); -var camelizeStyleName = __webpack_require__(/*! fbjs/lib/camelizeStyleName */ "./node_modules/fbjs/lib/camelizeStyleName.js"); - -/** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. - */ - -!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0; - -// These attributes should be all lowercase to allow for -// case insensitive checks -var RESERVED_PROPS = { - children: true, - dangerouslySetInnerHTML: true, - defaultValue: true, - defaultChecked: true, - innerHTML: true, - suppressContentEditableWarning: true, - suppressHydrationWarning: true, - style: true -}; - -function checkMask(value, bitmask) { - return (value & bitmask) === bitmask; -} - -var DOMPropertyInjection = { - /** - * Mapping from normalized, camelcased property names to a configuration that - * specifies how the associated DOM property should be accessed or rendered. - */ - MUST_USE_PROPERTY: 0x1, - HAS_BOOLEAN_VALUE: 0x4, - HAS_NUMERIC_VALUE: 0x8, - HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8, - HAS_OVERLOADED_BOOLEAN_VALUE: 0x20, - HAS_STRING_BOOLEAN_VALUE: 0x40, - - /** - * Inject some specialized knowledge about the DOM. This takes a config object - * with the following properties: - * - * Properties: object mapping DOM property name to one of the - * DOMPropertyInjection constants or null. If your attribute isn't in here, - * it won't get written to the DOM. - * - * DOMAttributeNames: object mapping React attribute name to the DOM - * attribute name. Attribute names not specified use the **lowercase** - * normalized name. - * - * DOMAttributeNamespaces: object mapping React attribute name to the DOM - * attribute namespace URL. (Attribute names not specified use no namespace.) - * - * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. - * Property names not specified use the normalized name. - * - * DOMMutationMethods: Properties that require special mutation methods. If - * `value` is undefined, the mutation method should unset the property. - * - * @param {object} domPropertyConfig the config as described above. - */ - injectDOMPropertyConfig: function (domPropertyConfig) { - var Injection = DOMPropertyInjection; - var Properties = domPropertyConfig.Properties || {}; - var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {}; - var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; - var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - - for (var propName in Properties) { - !!properties.hasOwnProperty(propName) ? invariant(false, "injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.", propName) : void 0; - - var lowerCased = propName.toLowerCase(); - var propConfig = Properties[propName]; - - var propertyInfo = { - attributeName: lowerCased, - attributeNamespace: null, - propertyName: propName, - mutationMethod: null, - - mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY), - hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE), - hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE), - hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE), - hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE), - hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE) - }; - !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant(false, "DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s", propName) : void 0; - - if (DOMAttributeNames.hasOwnProperty(propName)) { - var attributeName = DOMAttributeNames[propName]; - - propertyInfo.attributeName = attributeName; - } - - if (DOMAttributeNamespaces.hasOwnProperty(propName)) { - propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName]; - } - - if (DOMMutationMethods.hasOwnProperty(propName)) { - propertyInfo.mutationMethod = DOMMutationMethods[propName]; - } - - // Downcase references to whitelist properties to check for membership - // without case-sensitivity. This allows the whitelist to pick up - // `allowfullscreen`, which should be written using the property configuration - // for `allowFullscreen` - properties[propName] = propertyInfo; - } - } -}; - -/* eslint-disable max-len */ -var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; -/* eslint-enable max-len */ -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - - -var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; - -/** - * Map from property "standard name" to an object with info about how to set - * the property in the DOM. Each object contains: - * - * attributeName: - * Used when rendering markup or with `*Attribute()`. - * attributeNamespace - * propertyName: - * Used on DOM node instances. (This includes properties that mutate due to - * external factors.) - * mutationMethod: - * If non-null, used instead of the property or `setAttribute()` after - * initial render. - * mustUseProperty: - * Whether the property must be accessed and mutated as an object property. - * hasBooleanValue: - * Whether the property should be removed when set to a falsey value. - * hasNumericValue: - * Whether the property must be numeric or parse as a numeric and should be - * removed when set to a falsey value. - * hasPositiveNumericValue: - * Whether the property must be positive numeric or parse as a positive - * numeric and should be removed when set to a falsey value. - * hasOverloadedBooleanValue: - * Whether the property can be used as a flag as well as with a value. - * Removed when strictly equal to false; present without a value when - * strictly equal to true; present with a value otherwise. - */ -var properties = {}; - -/** - * Checks whether a property name is a writeable attribute. - * @method - */ -function shouldSetAttribute(name, value) { - if (isReservedProp(name)) { - return false; - } - if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { - return false; - } - if (value === null) { - return true; - } - switch (typeof value) { - case 'boolean': - return shouldAttributeAcceptBooleanValue(name); - case 'undefined': - case 'number': - case 'string': - case 'object': - return true; - default: - // function, symbol - return false; - } -} - -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} - -function shouldAttributeAcceptBooleanValue(name) { - if (isReservedProp(name)) { - return true; - } - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue; - } - var prefix = name.toLowerCase().slice(0, 5); - return prefix === 'data-' || prefix === 'aria-'; -} - -/** - * Checks to see if a property name is within the list of properties - * reserved for internal React operations. These properties should - * not be set on an HTML element. - * - * @private - * @param {string} name - * @return {boolean} If the name is within reserved props - */ -function isReservedProp(name) { - return RESERVED_PROPS.hasOwnProperty(name); -} - -var injection = DOMPropertyInjection; - -var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY; -var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE; -var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE; -var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE; -var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE; -var HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE; - -var HTMLDOMPropertyConfig = { - // When adding attributes to this list, be sure to also add them to - // the `possibleStandardNames` module to ensure casing and incorrect - // name warnings. - Properties: { - allowFullScreen: HAS_BOOLEAN_VALUE, - // specifies target context for links with `preload` type - async: HAS_BOOLEAN_VALUE, - // Note: there is a special case that prevents it from being written to the DOM - // on the client side because the browsers are inconsistent. Instead we call focus(). - autoFocus: HAS_BOOLEAN_VALUE, - autoPlay: HAS_BOOLEAN_VALUE, - capture: HAS_OVERLOADED_BOOLEAN_VALUE, - checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - cols: HAS_POSITIVE_NUMERIC_VALUE, - contentEditable: HAS_STRING_BOOLEAN_VALUE, - controls: HAS_BOOLEAN_VALUE, - 'default': HAS_BOOLEAN_VALUE, - defer: HAS_BOOLEAN_VALUE, - disabled: HAS_BOOLEAN_VALUE, - download: HAS_OVERLOADED_BOOLEAN_VALUE, - draggable: HAS_STRING_BOOLEAN_VALUE, - formNoValidate: HAS_BOOLEAN_VALUE, - hidden: HAS_BOOLEAN_VALUE, - loop: HAS_BOOLEAN_VALUE, - // Caution; `option.selected` is not updated if `select.multiple` is - // disabled with `removeAttribute`. - multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - noValidate: HAS_BOOLEAN_VALUE, - open: HAS_BOOLEAN_VALUE, - playsInline: HAS_BOOLEAN_VALUE, - readOnly: HAS_BOOLEAN_VALUE, - required: HAS_BOOLEAN_VALUE, - reversed: HAS_BOOLEAN_VALUE, - rows: HAS_POSITIVE_NUMERIC_VALUE, - rowSpan: HAS_NUMERIC_VALUE, - scoped: HAS_BOOLEAN_VALUE, - seamless: HAS_BOOLEAN_VALUE, - selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - size: HAS_POSITIVE_NUMERIC_VALUE, - start: HAS_NUMERIC_VALUE, - // support for projecting regular DOM Elements via V1 named slots ( shadow dom ) - span: HAS_POSITIVE_NUMERIC_VALUE, - spellCheck: HAS_STRING_BOOLEAN_VALUE, - // Style must be explicitly set in the attribute list. React components - // expect a style object - style: 0, - // Keep it in the whitelist because it is case-sensitive for SVG. - tabIndex: 0, - // itemScope is for for Microdata support. - // See http://schema.org/docs/gs.html - itemScope: HAS_BOOLEAN_VALUE, - // These attributes must stay in the white-list because they have - // different attribute names (see DOMAttributeNames below) - acceptCharset: 0, - className: 0, - htmlFor: 0, - httpEquiv: 0, - // Attributes with mutation methods must be specified in the whitelist - // Set the string boolean flag to allow the behavior - value: HAS_STRING_BOOLEAN_VALUE - }, - DOMAttributeNames: { - acceptCharset: 'accept-charset', - className: 'class', - htmlFor: 'for', - httpEquiv: 'http-equiv' - }, - DOMMutationMethods: { - value: function (node, value) { - if (value == null) { - return node.removeAttribute('value'); - } - - // Number inputs get special treatment due to some edge cases in - // Chrome. Let everything else assign the value attribute as normal. - // https://github.com/facebook/react/issues/7253#issuecomment-236074326 - if (node.type !== 'number' || node.hasAttribute('value') === false) { - node.setAttribute('value', '' + value); - } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) { - // Don't assign an attribute if validation reports bad - // input. Chrome will clear the value. Additionally, don't - // operate on inputs that have focus, otherwise Chrome might - // strip off trailing decimal places and cause the user's - // cursor position to jump to the beginning of the input. - // - // In ReactDOMInput, we have an onBlur event that will trigger - // this function again when focus is lost. - node.setAttribute('value', '' + value); - } - } - } -}; - -var HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE; - - -var NS = { - xlink: 'http://www.w3.org/1999/xlink', - xml: 'http://www.w3.org/XML/1998/namespace' -}; - -/** - * This is a list of all SVG attributes that need special casing, - * namespacing, or boolean value assignment. - * - * When adding attributes to this list, be sure to also add them to - * the `possibleStandardNames` module to ensure casing and incorrect - * name warnings. - * - * SVG Attributes List: - * https://www.w3.org/TR/SVG/attindex.html - * SMIL Spec: - * https://www.w3.org/TR/smil - */ -var ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space']; - -var SVGDOMPropertyConfig = { - Properties: { - autoReverse: HAS_STRING_BOOLEAN_VALUE$1, - externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1, - preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1 - }, - DOMAttributeNames: { - autoReverse: 'autoReverse', - externalResourcesRequired: 'externalResourcesRequired', - preserveAlpha: 'preserveAlpha' - }, - DOMAttributeNamespaces: { - xlinkActuate: NS.xlink, - xlinkArcrole: NS.xlink, - xlinkHref: NS.xlink, - xlinkRole: NS.xlink, - xlinkShow: NS.xlink, - xlinkTitle: NS.xlink, - xlinkType: NS.xlink, - xmlBase: NS.xml, - xmlLang: NS.xml, - xmlSpace: NS.xml - } -}; - -var CAMELIZE = /[\-\:]([a-z])/g; -var capitalize = function (token) { - return token[1].toUpperCase(); -}; - -ATTRS.forEach(function (original) { - var reactName = original.replace(CAMELIZE, capitalize); - - SVGDOMPropertyConfig.Properties[reactName] = 0; - SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original; -}); - -injection.injectDOMPropertyConfig(HTMLDOMPropertyConfig); -injection.injectDOMPropertyConfig(SVGDOMPropertyConfig); - -var ReactErrorUtils = { - // Used by Fiber to simulate a try-catch. - _caughtError: null, - _hasCaughtError: false, - - // Used by event system to capture/rethrow the first error. - _rethrowError: null, - _hasRethrowError: false, - - injection: { - injectErrorUtils: function (injectedErrorUtils) { - !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant(false, 'Injected invokeGuardedCallback() must be a function.') : void 0; - invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; - } - }, - - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) { - invokeGuardedCallback.apply(ReactErrorUtils, arguments); - }, - - /** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if _caughtError and _rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) { - ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); - if (ReactErrorUtils.hasCaughtError()) { - var error = ReactErrorUtils.clearCaughtError(); - if (!ReactErrorUtils._hasRethrowError) { - ReactErrorUtils._hasRethrowError = true; - ReactErrorUtils._rethrowError = error; - } - } - }, - - /** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - rethrowCaughtError: function () { - return rethrowCaughtError.apply(ReactErrorUtils, arguments); - }, - - hasCaughtError: function () { - return ReactErrorUtils._hasCaughtError; - }, - - clearCaughtError: function () { - if (ReactErrorUtils._hasCaughtError) { - var error = ReactErrorUtils._caughtError; - ReactErrorUtils._caughtError = null; - ReactErrorUtils._hasCaughtError = false; - return error; - } else { - invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'); - } - } -}; - -var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { - ReactErrorUtils._hasCaughtError = false; - ReactErrorUtils._caughtError = null; - var funcArgs = Array.prototype.slice.call(arguments, 3); - try { - func.apply(context, funcArgs); - } catch (error) { - ReactErrorUtils._caughtError = error; - ReactErrorUtils._hasCaughtError = true; - } -}; - -{ - // In DEV mode, we swap out invokeGuardedCallback for a special version - // that plays more nicely with the browser's DevTools. The idea is to preserve - // "Pause on exceptions" behavior. Because React wraps all user-provided - // functions in invokeGuardedCallback, and the production version of - // invokeGuardedCallback uses a try-catch, all user exceptions are treated - // like caught exceptions, and the DevTools won't pause unless the developer - // takes the extra step of enabling pause on caught exceptions. This is - // untintuitive, though, because even though React has caught the error, from - // the developer's perspective, the error is uncaught. - // - // To preserve the expected "Pause on exceptions" behavior, we don't use a - // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake - // DOM node, and call the user-provided callback from inside an event handler - // for that fake event. If the callback throws, the error is "captured" using - // a global event handler. But because the error happens in a different - // event loop context, it does not interrupt the normal program flow. - // Effectively, this gives us try-catch behavior without actually using - // try-catch. Neat! - - // Check that the browser supports the APIs we need to implement our special - // DEV version of invokeGuardedCallback - if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { - var fakeNode = document.createElement('react'); - - var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { - // Keeps track of whether the user-provided callback threw an error. We - // set this to true at the beginning, then set it to false right after - // calling the function. If the function errors, `didError` will never be - // set to false. This strategy works even if the browser is flaky and - // fails to call our global error handler, because it doesn't rely on - // the error event at all. - var didError = true; - - // Create an event handler for our fake event. We will synchronously - // dispatch our fake event using `dispatchEvent`. Inside the handler, we - // call the user-provided callback. - var funcArgs = Array.prototype.slice.call(arguments, 3); - function callCallback() { - // We immediately remove the callback from event listeners so that - // nested `invokeGuardedCallback` calls do not clash. Otherwise, a - // nested call would trigger the fake event handlers of any call higher - // in the stack. - fakeNode.removeEventListener(evtType, callCallback, false); - func.apply(context, funcArgs); - didError = false; - } - - // Create a global error event handler. We use this to capture the value - // that was thrown. It's possible that this error handler will fire more - // than once; for example, if non-React code also calls `dispatchEvent` - // and a handler for that event throws. We should be resilient to most of - // those cases. Even if our error event handler fires more than once, the - // last error event is always used. If the callback actually does error, - // we know that the last error event is the correct one, because it's not - // possible for anything else to have happened in between our callback - // erroring and the code that follows the `dispatchEvent` call below. If - // the callback doesn't error, but the error event was fired, we know to - // ignore it because `didError` will be false, as described above. - var error = void 0; - // Use this to track whether the error event is ever called. - var didSetError = false; - var isCrossOriginError = false; - - function onError(event) { - error = event.error; - didSetError = true; - if (error === null && event.colno === 0 && event.lineno === 0) { - isCrossOriginError = true; - } - } - - // Create a fake event type. - var evtType = 'react-' + (name ? name : 'invokeguardedcallback'); - - // Attach our event handlers - window.addEventListener('error', onError); - fakeNode.addEventListener(evtType, callCallback, false); - - // Synchronously dispatch our fake event. If the user-provided function - // errors, it will trigger our global error handler. - var evt = document.createEvent('Event'); - evt.initEvent(evtType, false, false); - fakeNode.dispatchEvent(evt); - - if (didError) { - if (!didSetError) { - // The callback errored, but the error event never fired. - error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); - } else if (isCrossOriginError) { - error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); - } - ReactErrorUtils._hasCaughtError = true; - ReactErrorUtils._caughtError = error; - } else { - ReactErrorUtils._hasCaughtError = false; - ReactErrorUtils._caughtError = null; - } - - // Remove our event listeners - window.removeEventListener('error', onError); - }; - - invokeGuardedCallback = invokeGuardedCallbackDev; - } -} - -var rethrowCaughtError = function () { - if (ReactErrorUtils._hasRethrowError) { - var error = ReactErrorUtils._rethrowError; - ReactErrorUtils._rethrowError = null; - ReactErrorUtils._hasRethrowError = false; - throw error; - } -}; - -/** - * Injectable ordering of event plugins. - */ -var eventPluginOrder = null; - -/** - * Injectable mapping from names to event plugin modules. - */ -var namesToPlugins = {}; - -/** - * Recomputes the plugin list using the injected plugins and plugin ordering. - * - * @private - */ -function recomputePluginOrdering() { - if (!eventPluginOrder) { - // Wait until an `eventPluginOrder` is injected. - return; - } - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName]; - var pluginIndex = eventPluginOrder.indexOf(pluginName); - !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; - if (plugins[pluginIndex]) { - continue; - } - !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; - plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - for (var eventName in publishedEvents) { - !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; - } - } -} - -/** - * Publishes an event so that it can be dispatched by the supplied plugin. - * - * @param {object} dispatchConfig Dispatch configuration for the event. - * @param {object} PluginModule Plugin publishing the event. - * @return {boolean} True if the event was successfully published. - * @private - */ -function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0; - eventNameDispatchConfigs[eventName] = dispatchConfig; - - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) { - if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } - } - return true; - } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); - return true; - } - return false; -} - -/** - * Publishes a registration name that is used to identify dispatched events. - * - * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. - * @private - */ -function publishRegistrationName(registrationName, pluginModule, eventName) { - !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0; - registrationNameModules[registrationName] = pluginModule; - registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - - { - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; - - if (registrationName === 'onDoubleClick') { - possibleRegistrationNames.ondblclick = registrationName; - } - } -} - -/** - * Registers plugins so that they can extract and dispatch events. - * - * @see {EventPluginHub} - */ - -/** - * Ordered list of injected plugins. - */ -var plugins = []; - -/** - * Mapping from event name to dispatch config - */ -var eventNameDispatchConfigs = {}; - -/** - * Mapping from registration name to plugin module - */ -var registrationNameModules = {}; - -/** - * Mapping from registration name to event name - */ -var registrationNameDependencies = {}; - -/** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in true. - * @type {Object} - */ -var possibleRegistrationNames = {}; -// Trust the developer to only use possibleRegistrationNames in true - -/** - * Injects an ordering of plugins (by plugin name). This allows the ordering - * to be decoupled from injection of the actual plugins so that ordering is - * always deterministic regardless of packaging, on-the-fly injection, etc. - * - * @param {array} InjectedEventPluginOrder - * @internal - * @see {EventPluginHub.injection.injectEventPluginOrder} - */ -function injectEventPluginOrder(injectedEventPluginOrder) { - !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0; - // Clone the ordering so it cannot be dynamically mutated. - eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); - recomputePluginOrdering(); -} - -/** - * Injects plugins to be used by `EventPluginHub`. The plugin names must be - * in the ordering injected by `injectEventPluginOrder`. - * - * Plugins can be injected as part of page initialization or on-the-fly. - * - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - * @internal - * @see {EventPluginHub.injection.injectEventPluginsByName} - */ -function injectEventPluginsByName(injectedNamesToPlugins) { - var isOrderingDirty = false; - for (var pluginName in injectedNamesToPlugins) { - if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { - continue; - } - var pluginModule = injectedNamesToPlugins[pluginName]; - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { - !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0; - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = true; - } - } - if (isOrderingDirty) { - recomputePluginOrdering(); - } -} - -var EventPluginRegistry = Object.freeze({ - plugins: plugins, - eventNameDispatchConfigs: eventNameDispatchConfigs, - registrationNameModules: registrationNameModules, - registrationNameDependencies: registrationNameDependencies, - possibleRegistrationNames: possibleRegistrationNames, - injectEventPluginOrder: injectEventPluginOrder, - injectEventPluginsByName: injectEventPluginsByName -}); - -var getFiberCurrentPropsFromNode = null; -var getInstanceFromNode = null; -var getNodeFromInstance = null; - -var injection$2 = { - injectComponentTree: function (Injected) { - getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode; - getInstanceFromNode = Injected.getInstanceFromNode; - getNodeFromInstance = Injected.getNodeFromInstance; - - { - warning(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); - } - } -}; - - - - - - -var validateEventDispatches; -{ - validateEventDispatches = function (event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - - var listenersIsArr = Array.isArray(dispatchListeners); - var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - - var instancesIsArr = Array.isArray(dispatchInstances); - var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; - - warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.'); - }; -} - -/** - * Dispatch the event to the listener. - * @param {SyntheticEvent} event SyntheticEvent to handle - * @param {boolean} simulated If the event is simulated (changes exn behavior) - * @param {function} listener Application-level callback - * @param {*} inst Internal component instance - */ -function executeDispatch(event, simulated, listener, inst) { - var type = event.type || 'unknown-event'; - event.currentTarget = getNodeFromInstance(inst); - ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); - event.currentTarget = null; -} - -/** - * Standard/simple iteration through an event's collected dispatches. - */ -function executeDispatchesInOrder(event, simulated) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - { - validateEventDispatches(event); - } - if (Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length; i++) { - if (event.isPropagationStopped()) { - break; - } - // Listeners and Instances are two parallel arrays that are always in sync. - executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); - } - } else if (dispatchListeners) { - executeDispatch(event, simulated, dispatchListeners, dispatchInstances); - } - event._dispatchListeners = null; - event._dispatchInstances = null; -} - -/** - * @see executeDispatchesInOrderStopAtTrueImpl - */ - - -/** - * Execution of a "direct" dispatch - there must be at most one dispatch - * accumulated on the event or it is considered an error. It doesn't really make - * sense for an event with multiple dispatches (bubbled) to keep track of the - * return values at each dispatch execution, but it does tend to make sense when - * dealing with "direct" dispatches. - * - * @return {*} The return value of executing the single dispatch. - */ - - -/** - * @param {SyntheticEvent} event - * @return {boolean} True iff number of dispatches accumulated is greater than 0. - */ - -/** - * Accumulates items that must not be null or undefined into the first one. This - * is used to conserve memory by avoiding array allocations, and thus sacrifices - * API cleanness. Since `current` can be null before being passed in and not - * null after this function, make sure to assign it back to `current`: - * - * `a = accumulateInto(a, b);` - * - * This API should be sparingly used. Try `accumulate` for something cleaner. - * - * @return {*|array<*>} An accumulation of items. - */ - -function accumulateInto(current, next) { - !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0; - - if (current == null) { - return next; - } - - // Both are not empty. Warning: Never call x.concat(y) when you are not - // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { - if (Array.isArray(next)) { - current.push.apply(current, next); - return current; - } - current.push(next); - return current; - } - - if (Array.isArray(next)) { - // A bit too dangerous to mutate `next`. - return [current].concat(next); - } - - return [current, next]; -} - -/** - * @param {array} arr an "accumulation" of items which is either an Array or - * a single item. Useful when paired with the `accumulate` module. This is a - * simple utility that allows us to reason about a collection of items, but - * handling the case when there is exactly one item (and we do not need to - * allocate an array). - * @param {function} cb Callback invoked with each element or a collection. - * @param {?} [scope] Scope used as `this` in a callback. - */ -function forEachAccumulated(arr, cb, scope) { - if (Array.isArray(arr)) { - arr.forEach(cb, scope); - } else if (arr) { - cb.call(scope, arr); - } -} - -/** - * Internal queue of events that have accumulated their dispatches and are - * waiting to have their dispatches executed. - */ -var eventQueue = null; - -/** - * Dispatches an event and releases it back into the pool, unless persistent. - * - * @param {?object} event Synthetic event to be dispatched. - * @param {boolean} simulated If the event is simulated (changes exn behavior) - * @private - */ -var executeDispatchesAndRelease = function (event, simulated) { - if (event) { - executeDispatchesInOrder(event, simulated); - - if (!event.isPersistent()) { - event.constructor.release(event); - } - } -}; -var executeDispatchesAndReleaseSimulated = function (e) { - return executeDispatchesAndRelease(e, true); -}; -var executeDispatchesAndReleaseTopLevel = function (e) { - return executeDispatchesAndRelease(e, false); -}; - -function isInteractive(tag) { - return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; -} - -function shouldPreventMouseEvent(name, type, props) { - switch (name) { - case 'onClick': - case 'onClickCapture': - case 'onDoubleClick': - case 'onDoubleClickCapture': - case 'onMouseDown': - case 'onMouseDownCapture': - case 'onMouseMove': - case 'onMouseMoveCapture': - case 'onMouseUp': - case 'onMouseUpCapture': - return !!(props.disabled && isInteractive(type)); - default: - return false; - } -} - -/** - * This is a unified interface for event plugins to be installed and configured. - * - * Event plugins can implement the following properties: - * - * `extractEvents` {function(string, DOMEventTarget, string, object): *} - * Required. When a top-level event is fired, this method is expected to - * extract synthetic events that will in turn be queued and dispatched. - * - * `eventTypes` {object} - * Optional, plugins that fire events must publish a mapping of registration - * names that are used to register listeners. Values of this mapping must - * be objects that contain `registrationName` or `phasedRegistrationNames`. - * - * `executeDispatch` {function(object, function, string)} - * Optional, allows plugins to override how an event gets dispatched. By - * default, the listener is simply invoked. - * - * Each plugin that is injected into `EventsPluginHub` is immediately operable. - * - * @public - */ - -/** - * Methods for injecting dependencies. - */ -var injection$1 = { - /** - * @param {array} InjectedEventPluginOrder - * @public - */ - injectEventPluginOrder: injectEventPluginOrder, - - /** - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - */ - injectEventPluginsByName: injectEventPluginsByName -}; - -/** - * @param {object} inst The instance, which is the source of events. - * @param {string} registrationName Name of listener (e.g. `onClick`). - * @return {?function} The stored callback. - */ -function getListener(inst, registrationName) { - var listener; - - // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not - // live here; needs to be moved to a better place soon - var stateNode = inst.stateNode; - if (!stateNode) { - // Work in progress (ex: onload events in incremental mode). - return null; - } - var props = getFiberCurrentPropsFromNode(stateNode); - if (!props) { - // Work in progress. - return null; - } - listener = props[registrationName]; - if (shouldPreventMouseEvent(registrationName, inst.type, props)) { - return null; - } - !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0; - return listener; -} - -/** - * Allows registered plugins an opportunity to extract events from top-level - * native browser events. - * - * @return {*} An accumulation of synthetic events. - * @internal - */ -function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events; - for (var i = 0; i < plugins.length; i++) { - // Not every plugin in the ordering may be loaded at runtime. - var possiblePlugin = plugins[i]; - if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - if (extractedEvents) { - events = accumulateInto(events, extractedEvents); - } - } - } - return events; -} - -/** - * Enqueues a synthetic event that should be dispatched when - * `processEventQueue` is invoked. - * - * @param {*} events An accumulation of synthetic events. - * @internal - */ -function enqueueEvents(events) { - if (events) { - eventQueue = accumulateInto(eventQueue, events); - } -} - -/** - * Dispatches all synthetic events on the event queue. - * - * @internal - */ -function processEventQueue(simulated) { - // Set `eventQueue` to null before processing it so that we can tell if more - // events get enqueued while processing. - var processingEventQueue = eventQueue; - eventQueue = null; - - if (!processingEventQueue) { - return; - } - - if (simulated) { - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); - } else { - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); - } - !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; - // This would be a good time to rethrow if any of the event handlers threw. - ReactErrorUtils.rethrowCaughtError(); -} - -var EventPluginHub = Object.freeze({ - injection: injection$1, - getListener: getListener, - extractEvents: extractEvents, - enqueueEvents: enqueueEvents, - processEventQueue: processEventQueue -}); - -var IndeterminateComponent = 0; // Before we know whether it is functional or class -var FunctionalComponent = 1; -var ClassComponent = 2; -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. -var HostComponent = 5; -var HostText = 6; -var CallComponent = 7; -var CallHandlerPhase = 8; -var ReturnComponent = 9; -var Fragment = 10; - -var randomKey = Math.random().toString(36).slice(2); -var internalInstanceKey = '__reactInternalInstance$' + randomKey; -var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; - -function precacheFiberNode$1(hostInst, node) { - node[internalInstanceKey] = hostInst; -} - -/** - * Given a DOM node, return the closest ReactDOMComponent or - * ReactDOMTextComponent instance ancestor. - */ -function getClosestInstanceFromNode(node) { - if (node[internalInstanceKey]) { - return node[internalInstanceKey]; - } - - // Walk up the tree until we find an ancestor whose instance we have cached. - var parents = []; - while (!node[internalInstanceKey]) { - parents.push(node); - if (node.parentNode) { - node = node.parentNode; - } else { - // Top of the tree. This node must not be part of a React tree (or is - // unmounted, potentially). - return null; - } - } - - var closest = void 0; - var inst = node[internalInstanceKey]; - if (inst.tag === HostComponent || inst.tag === HostText) { - // In Fiber, this will always be the deepest root. - return inst; - } - for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { - closest = inst; - } - - return closest; -} - -/** - * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent - * instance, or null if the node was not rendered by this React. - */ -function getInstanceFromNode$1(node) { - var inst = node[internalInstanceKey]; - if (inst) { - if (inst.tag === HostComponent || inst.tag === HostText) { - return inst; - } else { - return null; - } - } - return null; -} - -/** - * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding - * DOM node. - */ -function getNodeFromInstance$1(inst) { - if (inst.tag === HostComponent || inst.tag === HostText) { - // In Fiber this, is just the state node right now. We assume it will be - // a host component or host text. - return inst.stateNode; - } - - // Without this first invariant, passing a non-DOM-component triggers the next - // invariant for a missing parent, which is super confusing. - invariant(false, 'getNodeFromInstance: Invalid argument.'); -} - -function getFiberCurrentPropsFromNode$1(node) { - return node[internalEventHandlersKey] || null; -} - -function updateFiberProps$1(node, props) { - node[internalEventHandlersKey] = props; -} - -var ReactDOMComponentTree = Object.freeze({ - precacheFiberNode: precacheFiberNode$1, - getClosestInstanceFromNode: getClosestInstanceFromNode, - getInstanceFromNode: getInstanceFromNode$1, - getNodeFromInstance: getNodeFromInstance$1, - getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1, - updateFiberProps: updateFiberProps$1 -}); - -function getParent(inst) { - do { - inst = inst['return']; - // TODO: If this is a HostRoot we might want to bail out. - // That is depending on if we want nested subtrees (layers) to bubble - // events to their parent. We could also go through parentNode on the - // host node but that wouldn't work for React Native and doesn't let us - // do the portal feature. - } while (inst && inst.tag !== HostComponent); - if (inst) { - return inst; - } - return null; -} - -/** - * Return the lowest common ancestor of A and B, or null if they are in - * different trees. - */ -function getLowestCommonAncestor(instA, instB) { - var depthA = 0; - for (var tempA = instA; tempA; tempA = getParent(tempA)) { - depthA++; - } - var depthB = 0; - for (var tempB = instB; tempB; tempB = getParent(tempB)) { - depthB++; - } - - // If A is deeper, crawl up. - while (depthA - depthB > 0) { - instA = getParent(instA); - depthA--; - } - - // If B is deeper, crawl up. - while (depthB - depthA > 0) { - instB = getParent(instB); - depthB--; - } - - // Walk in lockstep until we find a match. - var depth = depthA; - while (depth--) { - if (instA === instB || instA === instB.alternate) { - return instA; - } - instA = getParent(instA); - instB = getParent(instB); - } - return null; -} - -/** - * Return if A is an ancestor of B. - */ - - -/** - * Return the parent instance of the passed-in instance. - */ -function getParentInstance(inst) { - return getParent(inst); -} - -/** - * Simulates the traversal of a two-phase, capture/bubble event dispatch. - */ -function traverseTwoPhase(inst, fn, arg) { - var path = []; - while (inst) { - path.push(inst); - inst = getParent(inst); - } - var i; - for (i = path.length; i-- > 0;) { - fn(path[i], 'captured', arg); - } - for (i = 0; i < path.length; i++) { - fn(path[i], 'bubbled', arg); - } -} - -/** - * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that - * should would receive a `mouseEnter` or `mouseLeave` event. - * - * Does not invoke the callback on the nearest common ancestor because nothing - * "entered" or "left" that element. - */ -function traverseEnterLeave(from, to, fn, argFrom, argTo) { - var common = from && to ? getLowestCommonAncestor(from, to) : null; - var pathFrom = []; - while (true) { - if (!from) { - break; - } - if (from === common) { - break; - } - var alternate = from.alternate; - if (alternate !== null && alternate === common) { - break; - } - pathFrom.push(from); - from = getParent(from); - } - var pathTo = []; - while (true) { - if (!to) { - break; - } - if (to === common) { - break; - } - var _alternate = to.alternate; - if (_alternate !== null && _alternate === common) { - break; - } - pathTo.push(to); - to = getParent(to); - } - for (var i = 0; i < pathFrom.length; i++) { - fn(pathFrom[i], 'bubbled', argFrom); - } - for (var _i = pathTo.length; _i-- > 0;) { - fn(pathTo[_i], 'captured', argTo); - } -} - -/** - * Some event types have a notion of different registration names for different - * "phases" of propagation. This finds listeners by a given phase. - */ -function listenerAtPhase(inst, event, propagationPhase) { - var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; - return getListener(inst, registrationName); -} - -/** - * A small set of propagation patterns, each of which will accept a small amount - * of information, and generate a set of "dispatch ready event objects" - which - * are sets of events that have already been annotated with a set of dispatched - * listener functions/ids. The API is designed this way to discourage these - * propagation strategies from actually executing the dispatches, since we - * always want to collect the entire set of dispatches before executing even a - * single one. - */ - -/** - * Tags a `SyntheticEvent` with dispatched listeners. Creating this function - * here, allows us to not have to bind or create functions for each event. - * Mutating the event's members allows us to not have to create a wrapping - * "dispatch" object that pairs the event with the listener. - */ -function accumulateDirectionalDispatches(inst, phase, event) { - { - warning(inst, 'Dispatching inst must not be null'); - } - var listener = listenerAtPhase(inst, event, phase); - if (listener) { - event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); - event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); - } -} - -/** - * Collect dispatches (must be entirely collected before dispatching - see unit - * tests). Lazily allocate the array to conserve memory. We must loop through - * each event and perform the traversal for each one. We cannot perform a - * single traversal for the entire collection of events because each event may - * have a different target. - */ -function accumulateTwoPhaseDispatchesSingle(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); - } -} - -/** - * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. - */ -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst; - var parentInst = targetInst ? getParentInstance(targetInst) : null; - traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); - } -} - -/** - * Accumulates without regard to direction, does not look for phased - * registration names. Same as `accumulateDirectDispatchesSingle` but without - * requiring that the `dispatchMarker` be the same as the dispatched ID. - */ -function accumulateDispatches(inst, ignoredDirection, event) { - if (inst && event && event.dispatchConfig.registrationName) { - var registrationName = event.dispatchConfig.registrationName; - var listener = getListener(inst, registrationName); - if (listener) { - event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); - event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); - } - } -} - -/** - * Accumulates dispatches on an `SyntheticEvent`, but only for the - * `dispatchMarker`. - * @param {SyntheticEvent} event - */ -function accumulateDirectDispatchesSingle(event) { - if (event && event.dispatchConfig.registrationName) { - accumulateDispatches(event._targetInst, null, event); - } -} - -function accumulateTwoPhaseDispatches(events) { - forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); -} - -function accumulateTwoPhaseDispatchesSkipTarget(events) { - forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); -} - -function accumulateEnterLeaveDispatches(leave, enter, from, to) { - traverseEnterLeave(from, to, accumulateDispatches, leave, enter); -} - -function accumulateDirectDispatches(events) { - forEachAccumulated(events, accumulateDirectDispatchesSingle); -} - -var EventPropagators = Object.freeze({ - accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, - accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, - accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches, - accumulateDirectDispatches: accumulateDirectDispatches -}); - -var contentKey = null; - -/** - * Gets the key used to access text content on a DOM node. - * - * @return {?string} Key used to access text content. - * @internal - */ -function getTextContentAccessor() { - if (!contentKey && ExecutionEnvironment.canUseDOM) { - // Prefer textContent to innerText because many browsers support both but - // SVG elements don't support innerText even when
does. - contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; - } - return contentKey; -} - -/** - * This helper object stores information about text content of a target node, - * allowing comparison of content before and after a given event. - * - * Identify the node where selection currently begins, then observe - * both its text content and its current position in the DOM. Since the - * browser may natively replace the target node during composition, we can - * use its position to find its replacement. - * - * - */ -var compositionState = { - _root: null, - _startText: null, - _fallbackText: null -}; - -function initialize(nativeEventTarget) { - compositionState._root = nativeEventTarget; - compositionState._startText = getText(); - return true; -} - -function reset() { - compositionState._root = null; - compositionState._startText = null; - compositionState._fallbackText = null; -} - -function getData() { - if (compositionState._fallbackText) { - return compositionState._fallbackText; - } - - var start; - var startValue = compositionState._startText; - var startLength = startValue.length; - var end; - var endValue = getText(); - var endLength = endValue.length; - - for (start = 0; start < startLength; start++) { - if (startValue[start] !== endValue[start]) { - break; - } - } - - var minEnd = startLength - start; - for (end = 1; end <= minEnd; end++) { - if (startValue[startLength - end] !== endValue[endLength - end]) { - break; - } - } - - var sliceTail = end > 1 ? 1 - end : undefined; - compositionState._fallbackText = endValue.slice(start, sliceTail); - return compositionState._fallbackText; -} - -function getText() { - if ('value' in compositionState._root) { - return compositionState._root.value; - } - return compositionState._root[getTextContentAccessor()]; -} - -/* eslint valid-typeof: 0 */ - -var didWarnForAddedNewProperty = false; -var isProxySupported = typeof Proxy === 'function'; -var EVENT_POOL_SIZE = 10; - -var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances']; - -/** - * @interface Event - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var EventInterface = { - type: null, - target: null, - // currentTarget is set when dispatching; no use in copying it here - currentTarget: emptyFunction.thatReturnsNull, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function (event) { - return event.timeStamp || Date.now(); - }, - defaultPrevented: null, - isTrusted: null -}; - -/** - * Synthetic events are dispatched by event plugins, typically in response to a - * top-level event delegation handler. - * - * These systems should generally use pooling to reduce the frequency of garbage - * collection. The system should check `isPersistent` to determine whether the - * event should be released into the pool after being dispatched. Users that - * need a persisted event should invoke `persist`. - * - * Synthetic events (and subclasses) implement the DOM Level 3 Events API by - * normalizing browser quirks. Subclasses do not necessarily have to implement a - * DOM interface; custom application-specific events can also subclass this. - * - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {*} targetInst Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @param {DOMEventTarget} nativeEventTarget Target node. - */ -function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - { - // these have a getter/setter for warnings - delete this.nativeEvent; - delete this.preventDefault; - delete this.stopPropagation; - } - - this.dispatchConfig = dispatchConfig; - this._targetInst = targetInst; - this.nativeEvent = nativeEvent; - - var Interface = this.constructor.Interface; - for (var propName in Interface) { - if (!Interface.hasOwnProperty(propName)) { - continue; - } - { - delete this[propName]; // this has a getter/setter for warnings - } - var normalize = Interface[propName]; - if (normalize) { - this[propName] = normalize(nativeEvent); - } else { - if (propName === 'target') { - this.target = nativeEventTarget; - } else { - this[propName] = nativeEvent[propName]; - } - } - } - - var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; - if (defaultPrevented) { - this.isDefaultPrevented = emptyFunction.thatReturnsTrue; - } else { - this.isDefaultPrevented = emptyFunction.thatReturnsFalse; - } - this.isPropagationStopped = emptyFunction.thatReturnsFalse; - return this; -} - -_assign(SyntheticEvent.prototype, { - preventDefault: function () { - this.defaultPrevented = true; - var event = this.nativeEvent; - if (!event) { - return; - } - - if (event.preventDefault) { - event.preventDefault(); - } else if (typeof event.returnValue !== 'unknown') { - event.returnValue = false; - } - this.isDefaultPrevented = emptyFunction.thatReturnsTrue; - }, - - stopPropagation: function () { - var event = this.nativeEvent; - if (!event) { - return; - } - - if (event.stopPropagation) { - event.stopPropagation(); - } else if (typeof event.cancelBubble !== 'unknown') { - // The ChangeEventPlugin registers a "propertychange" event for - // IE. This event does not support bubbling or cancelling, and - // any references to cancelBubble throw "Member not found". A - // typeof check of "unknown" circumvents this issue (and is also - // IE specific). - event.cancelBubble = true; - } - - this.isPropagationStopped = emptyFunction.thatReturnsTrue; - }, - - /** - * We release all dispatched `SyntheticEvent`s after each event loop, adding - * them back into the pool. This allows a way to hold onto a reference that - * won't be added back into the pool. - */ - persist: function () { - this.isPersistent = emptyFunction.thatReturnsTrue; - }, - - /** - * Checks if this event should be released back into the pool. - * - * @return {boolean} True if this should not be released, false otherwise. - */ - isPersistent: emptyFunction.thatReturnsFalse, - - /** - * `PooledClass` looks for `destructor` on each instance it releases. - */ - destructor: function () { - var Interface = this.constructor.Interface; - for (var propName in Interface) { - { - Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); - } - } - for (var i = 0; i < shouldBeReleasedProperties.length; i++) { - this[shouldBeReleasedProperties[i]] = null; - } - { - Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); - Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction)); - Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); - } - } -}); - -SyntheticEvent.Interface = EventInterface; - -/** - * Helper to reduce boilerplate when creating subclasses. - * - * @param {function} Class - * @param {?object} Interface - */ -SyntheticEvent.augmentClass = function (Class, Interface) { - var Super = this; - - var E = function () {}; - E.prototype = Super.prototype; - var prototype = new E(); - - _assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - - Class.Interface = _assign({}, Super.Interface, Interface); - Class.augmentClass = Super.augmentClass; - addEventPoolingTo(Class); -}; - -/** Proxying after everything set on SyntheticEvent - * to resolve Proxy issue on some WebKit browsers - * in which some Event properties are set to undefined (GH#10010) - */ -{ - if (isProxySupported) { - /*eslint-disable no-func-assign */ - SyntheticEvent = new Proxy(SyntheticEvent, { - construct: function (target, args) { - return this.apply(target, Object.create(target.prototype), args); - }, - apply: function (constructor, that, args) { - return new Proxy(constructor.apply(that, args), { - set: function (target, prop, value) { - if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { - warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.'); - didWarnForAddedNewProperty = true; - } - target[prop] = value; - return true; - } - }); - } - }); - /*eslint-enable no-func-assign */ - } -} - -addEventPoolingTo(SyntheticEvent); - -/** - * Helper to nullify syntheticEvent instance properties when destructing - * - * @param {String} propName - * @param {?object} getVal - * @return {object} defineProperty object - */ -function getPooledWarningPropertyDefinition(propName, getVal) { - var isFunction = typeof getVal === 'function'; - return { - configurable: true, - set: set, - get: get - }; - - function set(val) { - var action = isFunction ? 'setting the method' : 'setting the property'; - warn(action, 'This is effectively a no-op'); - return val; - } - - function get() { - var action = isFunction ? 'accessing the method' : 'accessing the property'; - var result = isFunction ? 'This is a no-op function' : 'This is set to null'; - warn(action, result); - return getVal; - } - - function warn(action, result) { - var warningCondition = false; - warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result); - } -} - -function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { - var EventConstructor = this; - if (EventConstructor.eventPool.length) { - var instance = EventConstructor.eventPool.pop(); - EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); - return instance; - } - return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); -} - -function releasePooledEvent(event) { - var EventConstructor = this; - !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0; - event.destructor(); - if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { - EventConstructor.eventPool.push(event); - } -} - -function addEventPoolingTo(EventConstructor) { - EventConstructor.eventPool = []; - EventConstructor.getPooled = getPooledEvent; - EventConstructor.release = releasePooledEvent; -} - -var SyntheticEvent$1 = SyntheticEvent; - -/** - * @interface Event - * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents - */ -var CompositionEventInterface = { - data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); - -/** - * @interface Event - * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 - * /#events-inputevents - */ -var InputEventInterface = { - data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticInputEvent, InputEventInterface); - -var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space -var START_KEYCODE = 229; - -var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; - -var documentMode = null; -if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) { - documentMode = document.documentMode; -} - -// Webkit offers a very useful `textInput` event that can be used to -// directly represent `beforeInput`. The IE `textinput` event is not as -// useful, so we don't use it. -var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); - -// In IE9+, we have access to composition events, but the data supplied -// by the native compositionend event may be incorrect. Japanese ideographic -// spaces, for instance (\u3000) are not recorded correctly. -var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); - -/** - * Opera <= 12 includes TextEvent in window, but does not fire - * text input events. Rely on keypress instead. - */ -function isPresto() { - var opera = window.opera; - return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; -} - -var SPACEBAR_CODE = 32; -var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); - -// Events and their corresponding property names. -var eventTypes = { - beforeInput: { - phasedRegistrationNames: { - bubbled: 'onBeforeInput', - captured: 'onBeforeInputCapture' - }, - dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste'] - }, - compositionEnd: { - phasedRegistrationNames: { - bubbled: 'onCompositionEnd', - captured: 'onCompositionEndCapture' - }, - dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - }, - compositionStart: { - phasedRegistrationNames: { - bubbled: 'onCompositionStart', - captured: 'onCompositionStartCapture' - }, - dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - }, - compositionUpdate: { - phasedRegistrationNames: { - bubbled: 'onCompositionUpdate', - captured: 'onCompositionUpdateCapture' - }, - dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - } -}; - -// Track whether we've ever handled a keypress on the space key. -var hasSpaceKeypress = false; - -/** - * Return whether a native keypress event is assumed to be a command. - * This is required because Firefox fires `keypress` events for key commands - * (cut, copy, select-all, etc.) even though no character is inserted. - */ -function isKeypressCommand(nativeEvent) { - return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && - // ctrlKey && altKey is equivalent to AltGr, and is not a command. - !(nativeEvent.ctrlKey && nativeEvent.altKey); -} - -/** - * Translate native top level events into event types. - * - * @param {string} topLevelType - * @return {object} - */ -function getCompositionEventType(topLevelType) { - switch (topLevelType) { - case 'topCompositionStart': - return eventTypes.compositionStart; - case 'topCompositionEnd': - return eventTypes.compositionEnd; - case 'topCompositionUpdate': - return eventTypes.compositionUpdate; - } -} - -/** - * Does our fallback best-guess model think this event signifies that - * composition has begun? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackCompositionStart(topLevelType, nativeEvent) { - return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE; -} - -/** - * Does our fallback mode think that this event is the end of composition? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackCompositionEnd(topLevelType, nativeEvent) { - switch (topLevelType) { - case 'topKeyUp': - // Command keys insert or clear IME input. - return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; - case 'topKeyDown': - // Expect IME keyCode on each keydown. If we get any other - // code we must have exited earlier. - return nativeEvent.keyCode !== START_KEYCODE; - case 'topKeyPress': - case 'topMouseDown': - case 'topBlur': - // Events are not possible without cancelling IME. - return true; - default: - return false; - } -} - -/** - * Google Input Tools provides composition data via a CustomEvent, - * with the `data` property populated in the `detail` object. If this - * is available on the event object, use it. If not, this is a plain - * composition event and we have nothing special to extract. - * - * @param {object} nativeEvent - * @return {?string} - */ -function getDataFromCustomEvent(nativeEvent) { - var detail = nativeEvent.detail; - if (typeof detail === 'object' && 'data' in detail) { - return detail.data; - } - return null; -} - -// Track the current IME composition status, if any. -var isComposing = false; - -/** - * @return {?object} A SyntheticCompositionEvent. - */ -function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var eventType; - var fallbackData; - - if (canUseCompositionEvent) { - eventType = getCompositionEventType(topLevelType); - } else if (!isComposing) { - if (isFallbackCompositionStart(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionStart; - } - } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionEnd; - } - - if (!eventType) { - return null; - } - - if (useFallbackCompositionData) { - // The current composition is stored statically and must not be - // overwritten while composition continues. - if (!isComposing && eventType === eventTypes.compositionStart) { - isComposing = initialize(nativeEventTarget); - } else if (eventType === eventTypes.compositionEnd) { - if (isComposing) { - fallbackData = getData(); - } - } - } - - var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget); - - if (fallbackData) { - // Inject data generated from fallback path into the synthetic event. - // This matches the property of native CompositionEventInterface. - event.data = fallbackData; - } else { - var customData = getDataFromCustomEvent(nativeEvent); - if (customData !== null) { - event.data = customData; - } - } - - accumulateTwoPhaseDispatches(event); - return event; -} - -/** - * @param {TopLevelTypes} topLevelType Record from `BrowserEventConstants`. - * @param {object} nativeEvent Native browser event. - * @return {?string} The string corresponding to this `beforeInput` event. - */ -function getNativeBeforeInputChars(topLevelType, nativeEvent) { - switch (topLevelType) { - case 'topCompositionEnd': - return getDataFromCustomEvent(nativeEvent); - case 'topKeyPress': - /** - * If native `textInput` events are available, our goal is to make - * use of them. However, there is a special case: the spacebar key. - * In Webkit, preventing default on a spacebar `textInput` event - * cancels character insertion, but it *also* causes the browser - * to fall back to its default spacebar behavior of scrolling the - * page. - * - * Tracking at: - * https://code.google.com/p/chromium/issues/detail?id=355103 - * - * To avoid this issue, use the keypress event as if no `textInput` - * event is available. - */ - var which = nativeEvent.which; - if (which !== SPACEBAR_CODE) { - return null; - } - - hasSpaceKeypress = true; - return SPACEBAR_CHAR; - - case 'topTextInput': - // Record the characters to be added to the DOM. - var chars = nativeEvent.data; - - // If it's a spacebar character, assume that we have already handled - // it at the keypress level and bail immediately. Android Chrome - // doesn't give us keycodes, so we need to blacklist it. - if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { - return null; - } - - return chars; - - default: - // For other native event types, do nothing. - return null; - } -} - -/** - * For browsers that do not provide the `textInput` event, extract the - * appropriate string to use for SyntheticInputEvent. - * - * @param {string} topLevelType Record from `BrowserEventConstants`. - * @param {object} nativeEvent Native browser event. - * @return {?string} The fallback string for this `beforeInput` event. - */ -function getFallbackBeforeInputChars(topLevelType, nativeEvent) { - // If we are currently composing (IME) and using a fallback to do so, - // try to extract the composed characters from the fallback object. - // If composition event is available, we extract a string only at - // compositionevent, otherwise extract it at fallback events. - if (isComposing) { - if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { - var chars = getData(); - reset(); - isComposing = false; - return chars; - } - return null; - } - - switch (topLevelType) { - case 'topPaste': - // If a paste event occurs after a keypress, throw out the input - // chars. Paste events should not lead to BeforeInput events. - return null; - case 'topKeyPress': - /** - * As of v27, Firefox may fire keypress events even when no character - * will be inserted. A few possibilities: - * - * - `which` is `0`. Arrow keys, Esc key, etc. - * - * - `which` is the pressed key code, but no char is available. - * Ex: 'AltGr + d` in Polish. There is no modified character for - * this key combination and no character is inserted into the - * document, but FF fires the keypress for char code `100` anyway. - * No `input` event will occur. - * - * - `which` is the pressed key code, but a command combination is - * being used. Ex: `Cmd+C`. No character is inserted, and no - * `input` event will occur. - */ - if (!isKeypressCommand(nativeEvent)) { - // IE fires the `keypress` event when a user types an emoji via - // Touch keyboard of Windows. In such a case, the `char` property - // holds an emoji character like `\uD83D\uDE0A`. Because its length - // is 2, the property `which` does not represent an emoji correctly. - // In such a case, we directly return the `char` property instead of - // using `which`. - if (nativeEvent.char && nativeEvent.char.length > 1) { - return nativeEvent.char; - } else if (nativeEvent.which) { - return String.fromCharCode(nativeEvent.which); - } - } - return null; - case 'topCompositionEnd': - return useFallbackCompositionData ? null : nativeEvent.data; - default: - return null; - } -} - -/** - * Extract a SyntheticInputEvent for `beforeInput`, based on either native - * `textInput` or fallback behavior. - * - * @return {?object} A SyntheticInputEvent. - */ -function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var chars; - - if (canUseTextInputEvent) { - chars = getNativeBeforeInputChars(topLevelType, nativeEvent); - } else { - chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); - } - - // If no characters are being inserted, no BeforeInput event should - // be fired. - if (!chars) { - return null; - } - - var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget); - - event.data = chars; - accumulateTwoPhaseDispatches(event); - return event; -} - -/** - * Create an `onBeforeInput` event to match - * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. - * - * This event plugin is based on the native `textInput` event - * available in Chrome, Safari, Opera, and IE. This event fires after - * `onKeyPress` and `onCompositionEnd`, but before `onInput`. - * - * `beforeInput` is spec'd but not implemented in any browsers, and - * the `input` event does not provide any useful information about what has - * actually been added, contrary to the spec. Thus, `textInput` is the best - * available event to identify the characters that have actually been inserted - * into the target node. - * - * This plugin is also responsible for emitting `composition` events, thus - * allowing us to share composition fallback code for both `beforeInput` and - * `composition` event types. - */ -var BeforeInputEventPlugin = { - eventTypes: eventTypes, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)]; - } -}; - -// Use to restore controlled state after a change event has fired. - -var fiberHostComponent = null; - -var ReactControlledComponentInjection = { - injectFiberControlledHostComponent: function (hostComponentImpl) { - // The fiber implementation doesn't use dynamic dispatch so we need to - // inject the implementation. - fiberHostComponent = hostComponentImpl; - } -}; - -var restoreTarget = null; -var restoreQueue = null; - -function restoreStateOfTarget(target) { - // We perform this translation at the end of the event loop so that we - // always receive the correct fiber here - var internalInstance = getInstanceFromNode(target); - if (!internalInstance) { - // Unmounted - return; - } - !(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? invariant(false, 'Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); - fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); -} - -var injection$3 = ReactControlledComponentInjection; - -function enqueueStateRestore(target) { - if (restoreTarget) { - if (restoreQueue) { - restoreQueue.push(target); - } else { - restoreQueue = [target]; - } - } else { - restoreTarget = target; - } -} - -function restoreStateIfNeeded() { - if (!restoreTarget) { - return; - } - var target = restoreTarget; - var queuedTargets = restoreQueue; - restoreTarget = null; - restoreQueue = null; - - restoreStateOfTarget(target); - if (queuedTargets) { - for (var i = 0; i < queuedTargets.length; i++) { - restoreStateOfTarget(queuedTargets[i]); - } - } -} - -var ReactControlledComponent = Object.freeze({ - injection: injection$3, - enqueueStateRestore: enqueueStateRestore, - restoreStateIfNeeded: restoreStateIfNeeded -}); - -// Used as a way to call batchedUpdates when we don't have a reference to -// the renderer. Such as when we're dispatching events or if third party -// libraries need to call batchedUpdates. Eventually, this API will go away when -// everything is batched by default. We'll then have a similar API to opt-out of -// scheduled work and instead do synchronous work. - -// Defaults -var fiberBatchedUpdates = function (fn, bookkeeping) { - return fn(bookkeeping); -}; - -var isNestingBatched = false; -function batchedUpdates(fn, bookkeeping) { - if (isNestingBatched) { - // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. Therefore, we add the target to - // a queue of work. - return fiberBatchedUpdates(fn, bookkeeping); - } - isNestingBatched = true; - try { - return fiberBatchedUpdates(fn, bookkeeping); - } finally { - // Here we wait until all updates have propagated, which is important - // when using controlled components within layers: - // https://github.com/facebook/react/issues/1698 - // Then we restore state of any controlled component. - isNestingBatched = false; - restoreStateIfNeeded(); - } -} - -var ReactGenericBatchingInjection = { - injectFiberBatchedUpdates: function (_batchedUpdates) { - fiberBatchedUpdates = _batchedUpdates; - } -}; - -var injection$4 = ReactGenericBatchingInjection; - -/** - * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary - */ -var supportedInputTypes = { - color: true, - date: true, - datetime: true, - 'datetime-local': true, - email: true, - month: true, - number: true, - password: true, - range: true, - search: true, - tel: true, - text: true, - time: true, - url: true, - week: true -}; - -function isTextInputElement(elem) { - var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); - - if (nodeName === 'input') { - return !!supportedInputTypes[elem.type]; - } - - if (nodeName === 'textarea') { - return true; - } - - return false; -} - -/** - * HTML nodeType values that represent the type of the node - */ - -var ELEMENT_NODE = 1; -var TEXT_NODE = 3; -var COMMENT_NODE = 8; -var DOCUMENT_NODE = 9; -var DOCUMENT_FRAGMENT_NODE = 11; - -/** - * Gets the target node from a native browser event by accounting for - * inconsistencies in browser DOM APIs. - * - * @param {object} nativeEvent Native browser event. - * @return {DOMEventTarget} Target node. - */ -function getEventTarget(nativeEvent) { - var target = nativeEvent.target || nativeEvent.srcElement || window; - - // Normalize SVG element events #4963 - if (target.correspondingUseElement) { - target = target.correspondingUseElement; - } - - // Safari may fire events on text nodes (Node.TEXT_NODE is 3). - // @see http://www.quirksmode.org/js/events_properties.html - return target.nodeType === TEXT_NODE ? target.parentNode : target; -} - -var useHasFeature; -if (ExecutionEnvironment.canUseDOM) { - useHasFeature = document.implementation && document.implementation.hasFeature && - // always returns true in newer browsers as per the standard. - // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature - document.implementation.hasFeature('', '') !== true; -} - -/** - * Checks if an event is supported in the current execution environment. - * - * NOTE: This will not work correctly for non-generic events such as `change`, - * `reset`, `load`, `error`, and `select`. - * - * Borrows from Modernizr. - * - * @param {string} eventNameSuffix Event name, e.g. "click". - * @param {?boolean} capture Check if the capture phase is supported. - * @return {boolean} True if the event is supported. - * @internal - * @license Modernizr 3.0.0pre (Custom Build) | MIT - */ -function isEventSupported(eventNameSuffix, capture) { - if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { - return false; - } - - var eventName = 'on' + eventNameSuffix; - var isSupported = eventName in document; - - if (!isSupported) { - var element = document.createElement('div'); - element.setAttribute(eventName, 'return;'); - isSupported = typeof element[eventName] === 'function'; - } - - if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { - // This is the only way to test support for the `wheel` event in IE9+. - isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); - } - - return isSupported; -} - -function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); -} - -function getTracker(node) { - return node._valueTracker; -} - -function detachTracker(node) { - node._valueTracker = null; -} - -function getValueFromNode(node) { - var value = ''; - if (!node) { - return value; - } - - if (isCheckable(node)) { - value = node.checked ? 'true' : 'false'; - } else { - value = node.value; - } - - return value; -} - -function trackValueOnNode(node) { - var valueField = isCheckable(node) ? 'checked' : 'value'; - var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); - - var currentValue = '' + node[valueField]; - - // if someone has already defined a value or Safari, then bail - // and don't track value will cause over reporting of changes, - // but it's better then a hard failure - // (needed for certain tests that spyOn input values and Safari) - if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { - return; - } - - Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable, - configurable: true, - get: function () { - return descriptor.get.call(this); - }, - set: function (value) { - currentValue = '' + value; - descriptor.set.call(this, value); - } - }); - - var tracker = { - getValue: function () { - return currentValue; - }, - setValue: function (value) { - currentValue = '' + value; - }, - stopTracking: function () { - detachTracker(node); - delete node[valueField]; - } - }; - return tracker; -} - -function track(node) { - if (getTracker(node)) { - return; - } - - // TODO: Once it's just Fiber we can move this to node._wrapperState - node._valueTracker = trackValueOnNode(node); -} - -function updateValueIfChanged(node) { - if (!node) { - return false; - } - - var tracker = getTracker(node); - // if there is no tracker at this point it's unlikely - // that trying again will succeed - if (!tracker) { - return true; - } - - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(node); - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; - } - return false; -} - -var eventTypes$1 = { - change: { - phasedRegistrationNames: { - bubbled: 'onChange', - captured: 'onChangeCapture' - }, - dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange'] - } -}; - -function createAndAccumulateChangeEvent(inst, nativeEvent, target) { - var event = SyntheticEvent$1.getPooled(eventTypes$1.change, inst, nativeEvent, target); - event.type = 'change'; - // Flag this event loop as needing state restore. - enqueueStateRestore(target); - accumulateTwoPhaseDispatches(event); - return event; -} -/** - * For IE shims - */ -var activeElement = null; -var activeElementInst = null; - -/** - * SECTION: handle `change` event - */ -function shouldUseChangeEvent(elem) { - var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); - return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; -} - -function manualDispatchChangeEvent(nativeEvent) { - var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); - - // If change and propertychange bubbled, we'd just bind to it like all the - // other events and have it go through ReactBrowserEventEmitter. Since it - // doesn't, we manually listen for the events and so we have to enqueue and - // process the abstract event manually. - // - // Batching is necessary here in order to ensure that all event handlers run - // before the next rerender (including event handlers attached to ancestor - // elements instead of directly on the input). Without this, controlled - // components don't work properly in conjunction with event bubbling because - // the component is rerendered and the value reverted before all the event - // handlers can run. See https://github.com/facebook/react/issues/708. - batchedUpdates(runEventInBatch, event); -} - -function runEventInBatch(event) { - enqueueEvents(event); - processEventQueue(false); -} - -function getInstIfValueChanged(targetInst) { - var targetNode = getNodeFromInstance$1(targetInst); - if (updateValueIfChanged(targetNode)) { - return targetInst; - } -} - -function getTargetInstForChangeEvent(topLevelType, targetInst) { - if (topLevelType === 'topChange') { - return targetInst; - } -} - -/** - * SECTION: handle `input` event - */ -var isInputEventSupported = false; -if (ExecutionEnvironment.canUseDOM) { - // IE9 claims to support the input event but fails to trigger it when - // deleting text, so we ignore its input events. - isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); -} - -/** - * (For IE <=9) Starts tracking propertychange events on the passed-in element - * and override the value property so that we can distinguish user events from - * value changes in JS. - */ -function startWatchingForValueChange(target, targetInst) { - activeElement = target; - activeElementInst = targetInst; - activeElement.attachEvent('onpropertychange', handlePropertyChange); -} - -/** - * (For IE <=9) Removes the event listeners from the currently-tracked element, - * if any exists. - */ -function stopWatchingForValueChange() { - if (!activeElement) { - return; - } - activeElement.detachEvent('onpropertychange', handlePropertyChange); - activeElement = null; - activeElementInst = null; -} - -/** - * (For IE <=9) Handles a propertychange event, sending a `change` event if - * the value of the active element has changed. - */ -function handlePropertyChange(nativeEvent) { - if (nativeEvent.propertyName !== 'value') { - return; - } - if (getInstIfValueChanged(activeElementInst)) { - manualDispatchChangeEvent(nativeEvent); - } -} - -function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { - if (topLevelType === 'topFocus') { - // In IE9, propertychange fires for most input events but is buggy and - // doesn't fire when text is deleted, but conveniently, selectionchange - // appears to fire in all of the remaining cases so we catch those and - // forward the event if the value has changed - // In either case, we don't want to call the event handler if the value - // is changed from JS so we redefine a setter for `.value` that updates - // our activeElementValue variable, allowing us to ignore those changes - // - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForValueChange(); - startWatchingForValueChange(target, targetInst); - } else if (topLevelType === 'topBlur') { - stopWatchingForValueChange(); - } -} - -// For IE8 and IE9. -function getTargetInstForInputEventPolyfill(topLevelType, targetInst) { - if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') { - // On the selectionchange event, the target is just document which isn't - // helpful for us so just check activeElement instead. - // - // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire - // propertychange on the first input event after setting `value` from a - // script and fires only keydown, keypress, keyup. Catching keyup usually - // gets it and catching keydown lets us fire an event for the first - // keystroke if user does a key repeat (it'll be a little delayed: right - // before the second keystroke). Other input methods (e.g., paste) seem to - // fire selectionchange normally. - return getInstIfValueChanged(activeElementInst); - } -} - -/** - * SECTION: handle `click` event - */ -function shouldUseClickEvent(elem) { - // Use the `click` event to detect changes to checkbox and radio inputs. - // This approach works across all browsers, whereas `change` does not fire - // until `blur` in IE8. - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); -} - -function getTargetInstForClickEvent(topLevelType, targetInst) { - if (topLevelType === 'topClick') { - return getInstIfValueChanged(targetInst); - } -} - -function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) { - if (topLevelType === 'topInput' || topLevelType === 'topChange') { - return getInstIfValueChanged(targetInst); - } -} - -function handleControlledInputBlur(inst, node) { - // TODO: In IE, inst is occasionally null. Why? - if (inst == null) { - return; - } - - // Fiber and ReactDOM keep wrapper state in separate places - var state = inst._wrapperState || node._wrapperState; - - if (!state || !state.controlled || node.type !== 'number') { - return; - } - - // If controlled, assign the value attribute to the current value on blur - var value = '' + node.value; - if (node.getAttribute('value') !== value) { - node.setAttribute('value', value); - } -} - -/** - * This plugin creates an `onChange` event that normalizes change events - * across form elements. This event fires at a time when it's possible to - * change the element's value without seeing a flicker. - * - * Supported elements are: - * - input (see `isTextInputElement`) - * - textarea - * - select - */ -var ChangeEventPlugin = { - eventTypes: eventTypes$1, - - _isInputEventSupported: isInputEventSupported, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; - - var getTargetInstFunc, handleEventFunc; - if (shouldUseChangeEvent(targetNode)) { - getTargetInstFunc = getTargetInstForChangeEvent; - } else if (isTextInputElement(targetNode)) { - if (isInputEventSupported) { - getTargetInstFunc = getTargetInstForInputOrChangeEvent; - } else { - getTargetInstFunc = getTargetInstForInputEventPolyfill; - handleEventFunc = handleEventsForInputEventPolyfill; - } - } else if (shouldUseClickEvent(targetNode)) { - getTargetInstFunc = getTargetInstForClickEvent; - } - - if (getTargetInstFunc) { - var inst = getTargetInstFunc(topLevelType, targetInst); - if (inst) { - var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget); - return event; - } - } - - if (handleEventFunc) { - handleEventFunc(topLevelType, targetNode, targetInst); - } - - // When blurring, set the value attribute for number inputs - if (topLevelType === 'topBlur') { - handleControlledInputBlur(targetInst, targetNode); - } - } -}; - -/** - * Module that is injectable into `EventPluginHub`, that specifies a - * deterministic ordering of `EventPlugin`s. A convenient way to reason about - * plugins, without having to package every one of them. This is better than - * having plugins be ordered in the same order that they are injected because - * that ordering would be influenced by the packaging order. - * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that - * preventing default on events is convenient in `SimpleEventPlugin` handlers. - */ -var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; - -/** - * @interface UIEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var UIEventInterface = { - view: null, - detail: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticUIEvent, UIEventInterface); - -/** - * Translation from modifier key to the associated property in the event. - * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers - */ - -var modifierKeyToProp = { - Alt: 'altKey', - Control: 'ctrlKey', - Meta: 'metaKey', - Shift: 'shiftKey' -}; - -// IE8 does not implement getModifierState so we simply map it to the only -// modifier keys exposed by the event itself, does not support Lock-keys. -// Currently, all major browsers except Chrome seems to support Lock-keys. -function modifierStateGetter(keyArg) { - var syntheticEvent = this; - var nativeEvent = syntheticEvent.nativeEvent; - if (nativeEvent.getModifierState) { - return nativeEvent.getModifierState(keyArg); - } - var keyProp = modifierKeyToProp[keyArg]; - return keyProp ? !!nativeEvent[keyProp] : false; -} - -function getEventModifierState(nativeEvent) { - return modifierStateGetter; -} - -/** - * @interface MouseEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var MouseEventInterface = { - screenX: null, - screenY: null, - clientX: null, - clientY: null, - pageX: null, - pageY: null, - ctrlKey: null, - shiftKey: null, - altKey: null, - metaKey: null, - getModifierState: getEventModifierState, - button: null, - buttons: null, - relatedTarget: function (event) { - return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); - -var eventTypes$2 = { - mouseEnter: { - registrationName: 'onMouseEnter', - dependencies: ['topMouseOut', 'topMouseOver'] - }, - mouseLeave: { - registrationName: 'onMouseLeave', - dependencies: ['topMouseOut', 'topMouseOver'] - } -}; - -var EnterLeaveEventPlugin = { - eventTypes: eventTypes$2, - - /** - * For almost every interaction we care about, there will be both a top-level - * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that - * we do not extract duplicate events. However, moving the mouse into the - * browser from outside will not fire a `mouseout` event. In this case, we use - * the `mouseover` top-level event. - */ - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { - return null; - } - if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') { - // Must not be a mouse in or mouse out - ignoring. - return null; - } - - var win; - if (nativeEventTarget.window === nativeEventTarget) { - // `nativeEventTarget` is probably a window object. - win = nativeEventTarget; - } else { - // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. - var doc = nativeEventTarget.ownerDocument; - if (doc) { - win = doc.defaultView || doc.parentWindow; - } else { - win = window; - } - } - - var from; - var to; - if (topLevelType === 'topMouseOut') { - from = targetInst; - var related = nativeEvent.relatedTarget || nativeEvent.toElement; - to = related ? getClosestInstanceFromNode(related) : null; - } else { - // Moving to a node from outside the window. - from = null; - to = targetInst; - } - - if (from === to) { - // Nothing pertains to our managed components. - return null; - } - - var fromNode = from == null ? win : getNodeFromInstance$1(from); - var toNode = to == null ? win : getNodeFromInstance$1(to); - - var leave = SyntheticMouseEvent.getPooled(eventTypes$2.mouseLeave, from, nativeEvent, nativeEventTarget); - leave.type = 'mouseleave'; - leave.target = fromNode; - leave.relatedTarget = toNode; - - var enter = SyntheticMouseEvent.getPooled(eventTypes$2.mouseEnter, to, nativeEvent, nativeEventTarget); - enter.type = 'mouseenter'; - enter.target = toNode; - enter.relatedTarget = fromNode; - - accumulateEnterLeaveDispatches(leave, enter, from, to); - - return [leave, enter]; - } -}; - -/** - * `ReactInstanceMap` maintains a mapping from a public facing stateful - * instance (key) and the internal representation (value). This allows public - * methods to accept the user facing instance as an argument and map them back - * to internal methods. - * - * Note that this module is currently shared and assumed to be stateless. - * If this becomes an actual Map, that will break. - */ - -/** - * This API should be called `delete` but we'd have to make sure to always - * transform these to strings for IE support. When this transform is fully - * supported we can rename it. - */ - - -function get(key) { - return key._reactInternalFiber; -} - -function has(key) { - return key._reactInternalFiber !== undefined; -} - -function set(key, value) { - key._reactInternalFiber = value; -} - -var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var ReactCurrentOwner = ReactInternals.ReactCurrentOwner; -var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame; - -function getComponentName(fiber) { - var type = fiber.type; - - if (typeof type === 'string') { - return type; - } - if (typeof type === 'function') { - return type.displayName || type.name; - } - return null; -} - -// Don't change these two values: -var NoEffect = 0; // 0b00000000 -var PerformedWork = 1; // 0b00000001 - -// You can change the rest (and add more). -var Placement = 2; // 0b00000010 -var Update = 4; // 0b00000100 -var PlacementAndUpdate = 6; // 0b00000110 -var Deletion = 8; // 0b00001000 -var ContentReset = 16; // 0b00010000 -var Callback = 32; // 0b00100000 -var Err = 64; // 0b01000000 -var Ref = 128; // 0b10000000 - -var MOUNTING = 1; -var MOUNTED = 2; -var UNMOUNTED = 3; - -function isFiberMountedImpl(fiber) { - var node = fiber; - if (!fiber.alternate) { - // If there is no alternate, this might be a new tree that isn't inserted - // yet. If it is, then it will have a pending insertion effect on it. - if ((node.effectTag & Placement) !== NoEffect) { - return MOUNTING; - } - while (node['return']) { - node = node['return']; - if ((node.effectTag & Placement) !== NoEffect) { - return MOUNTING; - } - } - } else { - while (node['return']) { - node = node['return']; - } - } - if (node.tag === HostRoot) { - // TODO: Check if this was a nested HostRoot when used with - // renderContainerIntoSubtree. - return MOUNTED; - } - // If we didn't hit the root, that means that we're in an disconnected tree - // that has been unmounted. - return UNMOUNTED; -} - -function isFiberMounted(fiber) { - return isFiberMountedImpl(fiber) === MOUNTED; -} - -function isMounted(component) { - { - var owner = ReactCurrentOwner.current; - if (owner !== null && owner.tag === ClassComponent) { - var ownerFiber = owner; - var instance = ownerFiber.stateNode; - warning(instance._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber) || 'A component'); - instance._warnedAboutRefsInRender = true; - } - } - - var fiber = get(component); - if (!fiber) { - return false; - } - return isFiberMountedImpl(fiber) === MOUNTED; -} - -function assertIsMounted(fiber) { - !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; -} - -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - // If there is no alternate, then we only need to check if it is mounted. - var state = isFiberMountedImpl(fiber); - !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; - if (state === MOUNTING) { - return null; - } - return fiber; - } - // If we have two possible branches, we'll walk backwards up to the root - // to see what path the root points to. On the way we may hit one of the - // special cases and we'll deal with them. - var a = fiber; - var b = alternate; - while (true) { - var parentA = a['return']; - var parentB = parentA ? parentA.alternate : null; - if (!parentA || !parentB) { - // We're at the root. - break; - } - - // If both copies of the parent fiber point to the same child, we can - // assume that the child is current. This happens when we bailout on low - // priority: the bailed out fiber's child reuses the current child. - if (parentA.child === parentB.child) { - var child = parentA.child; - while (child) { - if (child === a) { - // We've determined that A is the current branch. - assertIsMounted(parentA); - return fiber; - } - if (child === b) { - // We've determined that B is the current branch. - assertIsMounted(parentA); - return alternate; - } - child = child.sibling; - } - // We should never have an alternate for any mounting node. So the only - // way this could possibly happen is if this was unmounted, if at all. - invariant(false, 'Unable to find node on an unmounted component.'); - } - - if (a['return'] !== b['return']) { - // The return pointer of A and the return pointer of B point to different - // fibers. We assume that return pointers never criss-cross, so A must - // belong to the child set of A.return, and B must belong to the child - // set of B.return. - a = parentA; - b = parentB; - } else { - // The return pointers point to the same fiber. We'll have to use the - // default, slow path: scan the child sets of each parent alternate to see - // which child belongs to which set. - // - // Search parent A's child set - var didFindChild = false; - var _child = parentA.child; - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = true; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - // Search parent B's child set - _child = parentB.child; - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = true; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0; - } - } - - !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - // If the root is not a host container, we're in a disconnected tree. I.e. - // unmounted. - !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; - if (a.stateNode.current === a) { - // We've determined that A is the current branch. - return fiber; - } - // Otherwise B has to be current branch. - return alternate; -} - -function findCurrentHostFiber(parent) { - var currentParent = findCurrentFiberUsingSlowPath(parent); - if (!currentParent) { - return null; - } - - // Next we'll drill down this component to find the first HostComponent/Text. - var node = currentParent; - while (true) { - if (node.tag === HostComponent || node.tag === HostText) { - return node; - } else if (node.child) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === currentParent) { - return null; - } - while (!node.sibling) { - if (!node['return'] || node['return'] === currentParent) { - return null; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - // Flow needs the return null here, but ESLint complains about it. - // eslint-disable-next-line no-unreachable - return null; -} - -function findCurrentHostFiberWithNoPortals(parent) { - var currentParent = findCurrentFiberUsingSlowPath(parent); - if (!currentParent) { - return null; - } - - // Next we'll drill down this component to find the first HostComponent/Text. - var node = currentParent; - while (true) { - if (node.tag === HostComponent || node.tag === HostText) { - return node; - } else if (node.child && node.tag !== HostPortal) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === currentParent) { - return null; - } - while (!node.sibling) { - if (!node['return'] || node['return'] === currentParent) { - return null; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - // Flow needs the return null here, but ESLint complains about it. - // eslint-disable-next-line no-unreachable - return null; -} - -var CALLBACK_BOOKKEEPING_POOL_SIZE = 10; -var callbackBookkeepingPool = []; - -/** - * Find the deepest React component completely containing the root of the - * passed-in instance (for use when entire React trees are nested within each - * other). If React trees are not nested, returns null. - */ -function findRootContainerNode(inst) { - // TODO: It may be a good idea to cache this to prevent unnecessary DOM - // traversal, but caching is difficult to do correctly without using a - // mutation observer to listen for all DOM changes. - while (inst['return']) { - inst = inst['return']; - } - if (inst.tag !== HostRoot) { - // This can happen if we're in a detached tree. - return null; - } - return inst.stateNode.containerInfo; -} - -// Used to store ancestor hierarchy in top level callback -function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) { - if (callbackBookkeepingPool.length) { - var instance = callbackBookkeepingPool.pop(); - instance.topLevelType = topLevelType; - instance.nativeEvent = nativeEvent; - instance.targetInst = targetInst; - return instance; - } - return { - topLevelType: topLevelType, - nativeEvent: nativeEvent, - targetInst: targetInst, - ancestors: [] - }; -} - -function releaseTopLevelCallbackBookKeeping(instance) { - instance.topLevelType = null; - instance.nativeEvent = null; - instance.targetInst = null; - instance.ancestors.length = 0; - if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) { - callbackBookkeepingPool.push(instance); - } -} - -function handleTopLevelImpl(bookKeeping) { - var targetInst = bookKeeping.targetInst; - - // Loop through the hierarchy, in case there's any nested components. - // It's important that we build the array of ancestors before calling any - // event handlers, because event handlers can modify the DOM, leading to - // inconsistencies with ReactMount's node cache. See #1105. - var ancestor = targetInst; - do { - if (!ancestor) { - bookKeeping.ancestors.push(ancestor); - break; - } - var root = findRootContainerNode(ancestor); - if (!root) { - break; - } - bookKeeping.ancestors.push(ancestor); - ancestor = getClosestInstanceFromNode(root); - } while (ancestor); - - for (var i = 0; i < bookKeeping.ancestors.length; i++) { - targetInst = bookKeeping.ancestors[i]; - _handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); - } -} - -// TODO: can we stop exporting these? -var _enabled = true; -var _handleTopLevel = void 0; - -function setHandleTopLevel(handleTopLevel) { - _handleTopLevel = handleTopLevel; -} - -function setEnabled(enabled) { - _enabled = !!enabled; -} - -function isEnabled() { - return _enabled; -} - -/** - * Traps top-level events by using event bubbling. - * - * @param {string} topLevelType Record from `BrowserEventConstants`. - * @param {string} handlerBaseName Event name (e.g. "click"). - * @param {object} element Element on which to attach listener. - * @return {?object} An object with a remove function which will forcefully - * remove the listener. - * @internal - */ -function trapBubbledEvent(topLevelType, handlerBaseName, element) { - if (!element) { - return null; - } - return EventListener.listen(element, handlerBaseName, dispatchEvent.bind(null, topLevelType)); -} - -/** - * Traps a top-level event by using event capturing. - * - * @param {string} topLevelType Record from `BrowserEventConstants`. - * @param {string} handlerBaseName Event name (e.g. "click"). - * @param {object} element Element on which to attach listener. - * @return {?object} An object with a remove function which will forcefully - * remove the listener. - * @internal - */ -function trapCapturedEvent(topLevelType, handlerBaseName, element) { - if (!element) { - return null; - } - return EventListener.capture(element, handlerBaseName, dispatchEvent.bind(null, topLevelType)); -} - -function dispatchEvent(topLevelType, nativeEvent) { - if (!_enabled) { - return; - } - - var nativeEventTarget = getEventTarget(nativeEvent); - var targetInst = getClosestInstanceFromNode(nativeEventTarget); - if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { - // If we get an event (ex: img onload) before committing that - // component's mount, ignore it for now (that is, treat it as if it was an - // event on a non-React tree). We might also consider queueing events and - // dispatching them after the mount. - targetInst = null; - } - - var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); - - try { - // Event queue being processed in the same cycle allows - // `preventDefault`. - batchedUpdates(handleTopLevelImpl, bookKeeping); - } finally { - releaseTopLevelCallbackBookKeeping(bookKeeping); - } -} - -var ReactDOMEventListener = Object.freeze({ - get _enabled () { return _enabled; }, - get _handleTopLevel () { return _handleTopLevel; }, - setHandleTopLevel: setHandleTopLevel, - setEnabled: setEnabled, - isEnabled: isEnabled, - trapBubbledEvent: trapBubbledEvent, - trapCapturedEvent: trapCapturedEvent, - dispatchEvent: dispatchEvent -}); - -/** - * Generate a mapping of standard vendor prefixes using the defined style property and event name. - * - * @param {string} styleProp - * @param {string} eventName - * @returns {object} - */ -function makePrefixMap(styleProp, eventName) { - var prefixes = {}; - - prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); - prefixes['Webkit' + styleProp] = 'webkit' + eventName; - prefixes['Moz' + styleProp] = 'moz' + eventName; - prefixes['ms' + styleProp] = 'MS' + eventName; - prefixes['O' + styleProp] = 'o' + eventName.toLowerCase(); - - return prefixes; -} - -/** - * A list of event names to a configurable list of vendor prefixes. - */ -var vendorPrefixes = { - animationend: makePrefixMap('Animation', 'AnimationEnd'), - animationiteration: makePrefixMap('Animation', 'AnimationIteration'), - animationstart: makePrefixMap('Animation', 'AnimationStart'), - transitionend: makePrefixMap('Transition', 'TransitionEnd') -}; - -/** - * Event names that have already been detected and prefixed (if applicable). - */ -var prefixedEventNames = {}; - -/** - * Element to check for prefixes on. - */ -var style = {}; - -/** - * Bootstrap if a DOM exists. - */ -if (ExecutionEnvironment.canUseDOM) { - style = document.createElement('div').style; - - // On some platforms, in particular some releases of Android 4.x, - // the un-prefixed "animation" and "transition" properties are defined on the - // style object but the events that fire will still be prefixed, so we need - // to check if the un-prefixed events are usable, and if not remove them from the map. - if (!('AnimationEvent' in window)) { - delete vendorPrefixes.animationend.animation; - delete vendorPrefixes.animationiteration.animation; - delete vendorPrefixes.animationstart.animation; - } - - // Same as above - if (!('TransitionEvent' in window)) { - delete vendorPrefixes.transitionend.transition; - } -} - -/** - * Attempts to determine the correct vendor prefixed event name. - * - * @param {string} eventName - * @returns {string} - */ -function getVendorPrefixedEventName(eventName) { - if (prefixedEventNames[eventName]) { - return prefixedEventNames[eventName]; - } else if (!vendorPrefixes[eventName]) { - return eventName; - } - - var prefixMap = vendorPrefixes[eventName]; - - for (var styleProp in prefixMap) { - if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { - return prefixedEventNames[eventName] = prefixMap[styleProp]; - } - } - - return ''; -} - -/** - * Types of raw signals from the browser caught at the top level. - * - * For events like 'submit' which don't consistently bubble (which we - * trap at a lower node than `document`), binding at `document` would - * cause duplicate events so we don't include them here. - */ -var topLevelTypes$1 = { - topAbort: 'abort', - topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', - topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration', - topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart', - topBlur: 'blur', - topCancel: 'cancel', - topCanPlay: 'canplay', - topCanPlayThrough: 'canplaythrough', - topChange: 'change', - topClick: 'click', - topClose: 'close', - topCompositionEnd: 'compositionend', - topCompositionStart: 'compositionstart', - topCompositionUpdate: 'compositionupdate', - topContextMenu: 'contextmenu', - topCopy: 'copy', - topCut: 'cut', - topDoubleClick: 'dblclick', - topDrag: 'drag', - topDragEnd: 'dragend', - topDragEnter: 'dragenter', - topDragExit: 'dragexit', - topDragLeave: 'dragleave', - topDragOver: 'dragover', - topDragStart: 'dragstart', - topDrop: 'drop', - topDurationChange: 'durationchange', - topEmptied: 'emptied', - topEncrypted: 'encrypted', - topEnded: 'ended', - topError: 'error', - topFocus: 'focus', - topInput: 'input', - topKeyDown: 'keydown', - topKeyPress: 'keypress', - topKeyUp: 'keyup', - topLoadedData: 'loadeddata', - topLoad: 'load', - topLoadedMetadata: 'loadedmetadata', - topLoadStart: 'loadstart', - topMouseDown: 'mousedown', - topMouseMove: 'mousemove', - topMouseOut: 'mouseout', - topMouseOver: 'mouseover', - topMouseUp: 'mouseup', - topPaste: 'paste', - topPause: 'pause', - topPlay: 'play', - topPlaying: 'playing', - topProgress: 'progress', - topRateChange: 'ratechange', - topScroll: 'scroll', - topSeeked: 'seeked', - topSeeking: 'seeking', - topSelectionChange: 'selectionchange', - topStalled: 'stalled', - topSuspend: 'suspend', - topTextInput: 'textInput', - topTimeUpdate: 'timeupdate', - topToggle: 'toggle', - topTouchCancel: 'touchcancel', - topTouchEnd: 'touchend', - topTouchMove: 'touchmove', - topTouchStart: 'touchstart', - topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend', - topVolumeChange: 'volumechange', - topWaiting: 'waiting', - topWheel: 'wheel' -}; - -var BrowserEventConstants = { - topLevelTypes: topLevelTypes$1 -}; - -function runEventQueueInBatch(events) { - enqueueEvents(events); - processEventQueue(false); -} - -/** - * Streams a fired top-level event to `EventPluginHub` where plugins have the - * opportunity to create `ReactEvent`s to be dispatched. - */ -function handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - runEventQueueInBatch(events); -} - -var topLevelTypes = BrowserEventConstants.topLevelTypes; - -/** - * Summary of `ReactBrowserEventEmitter` event handling: - * - * - Top-level delegation is used to trap most native browser events. This - * may only occur in the main thread and is the responsibility of - * ReactDOMEventListener, which is injected and can therefore support - * pluggable event sources. This is the only work that occurs in the main - * thread. - * - * - We normalize and de-duplicate events to account for browser quirks. This - * may be done in the worker thread. - * - * - Forward these native events (with the associated top-level type used to - * trap it) to `EventPluginHub`, which in turn will ask plugins if they want - * to extract any synthetic events. - * - * - The `EventPluginHub` will then process each event by annotating them with - * "dispatches", a sequence of listeners and IDs that care about that event. - * - * - The `EventPluginHub` then dispatches the events. - * - * Overview of React and the event system: - * - * +------------+ . - * | DOM | . - * +------------+ . - * | . - * v . - * +------------+ . - * | ReactEvent | . - * | Listener | . - * +------------+ . +-----------+ - * | . +--------+|SimpleEvent| - * | . | |Plugin | - * +-----|------+ . v +-----------+ - * | | | . +--------------+ +------------+ - * | +-----------.--->|EventPluginHub| | Event | - * | | . | | +-----------+ | Propagators| - * | ReactEvent | . | | |TapEvent | |------------| - * | Emitter | . | |<---+|Plugin | |other plugin| - * | | . | | +-----------+ | utilities | - * | +-----------.--->| | +------------+ - * | | | . +--------------+ - * +-----|------+ . ^ +-----------+ - * | . | |Enter/Leave| - * + . +-------+|Plugin | - * +-------------+ . +-----------+ - * | application | . - * |-------------| . - * | | . - * | | . - * +-------------+ . - * . - * React Core . General Purpose Event Plugin System - */ - -var alreadyListeningTo = {}; -var reactTopListenersCounter = 0; - -/** - * To ensure no conflicts with other potential React instances on the page - */ -var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2); - -function getListeningForDocument(mountAt) { - // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` - // directly. - if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { - mountAt[topListenersIDKey] = reactTopListenersCounter++; - alreadyListeningTo[mountAt[topListenersIDKey]] = {}; - } - return alreadyListeningTo[mountAt[topListenersIDKey]]; -} - -/** - * We listen for bubbled touch events on the document object. - * - * Firefox v8.01 (and possibly others) exhibited strange behavior when - * mounting `onmousemove` events at some node that was not the document - * element. The symptoms were that if your mouse is not moving over something - * contained within that mount point (for example on the background) the - * top-level listeners for `onmousemove` won't be called. However, if you - * register the `mousemove` on the document object, then it will of course - * catch all `mousemove`s. This along with iOS quirks, justifies restricting - * top-level listeners to the document object only, at least for these - * movement types of events and possibly all events. - * - * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html - * - * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but - * they bubble to document. - * - * @param {string} registrationName Name of listener (e.g. `onClick`). - * @param {object} contentDocumentHandle Document which owns the container - */ -function listenTo(registrationName, contentDocumentHandle) { - var mountAt = contentDocumentHandle; - var isListening = getListeningForDocument(mountAt); - var dependencies = registrationNameDependencies[registrationName]; - - for (var i = 0; i < dependencies.length; i++) { - var dependency = dependencies[i]; - if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { - if (dependency === 'topScroll') { - trapCapturedEvent('topScroll', 'scroll', mountAt); - } else if (dependency === 'topFocus' || dependency === 'topBlur') { - trapCapturedEvent('topFocus', 'focus', mountAt); - trapCapturedEvent('topBlur', 'blur', mountAt); - - // to make sure blur and focus event listeners are only attached once - isListening.topBlur = true; - isListening.topFocus = true; - } else if (dependency === 'topCancel') { - if (isEventSupported('cancel', true)) { - trapCapturedEvent('topCancel', 'cancel', mountAt); - } - isListening.topCancel = true; - } else if (dependency === 'topClose') { - if (isEventSupported('close', true)) { - trapCapturedEvent('topClose', 'close', mountAt); - } - isListening.topClose = true; - } else if (topLevelTypes.hasOwnProperty(dependency)) { - trapBubbledEvent(dependency, topLevelTypes[dependency], mountAt); - } - - isListening[dependency] = true; - } - } -} - -function isListeningToAllDependencies(registrationName, mountAt) { - var isListening = getListeningForDocument(mountAt); - var dependencies = registrationNameDependencies[registrationName]; - for (var i = 0; i < dependencies.length; i++) { - var dependency = dependencies[i]; - if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { - return false; - } - } - return true; -} - -/** - * Given any node return the first leaf node without children. - * - * @param {DOMElement|DOMTextNode} node - * @return {DOMElement|DOMTextNode} - */ -function getLeafNode(node) { - while (node && node.firstChild) { - node = node.firstChild; - } - return node; -} - -/** - * Get the next sibling within a container. This will walk up the - * DOM if a node's siblings have been exhausted. - * - * @param {DOMElement|DOMTextNode} node - * @return {?DOMElement|DOMTextNode} - */ -function getSiblingNode(node) { - while (node) { - if (node.nextSibling) { - return node.nextSibling; - } - node = node.parentNode; - } -} - -/** - * Get object describing the nodes which contain characters at offset. - * - * @param {DOMElement|DOMTextNode} root - * @param {number} offset - * @return {?object} - */ -function getNodeForCharacterOffset(root, offset) { - var node = getLeafNode(root); - var nodeStart = 0; - var nodeEnd = 0; - - while (node) { - if (node.nodeType === TEXT_NODE) { - nodeEnd = nodeStart + node.textContent.length; - - if (nodeStart <= offset && nodeEnd >= offset) { - return { - node: node, - offset: offset - nodeStart - }; - } - - nodeStart = nodeEnd; - } - - node = getLeafNode(getSiblingNode(node)); - } -} - -/** - * @param {DOMElement} outerNode - * @return {?object} - */ -function getOffsets(outerNode) { - var selection = window.getSelection && window.getSelection(); - - if (!selection || selection.rangeCount === 0) { - return null; - } - - var anchorNode = selection.anchorNode, - anchorOffset = selection.anchorOffset, - focusNode$$1 = selection.focusNode, - focusOffset = selection.focusOffset; - - // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the - // up/down buttons on an . Anonymous divs do not seem to - // expose properties, triggering a "Permission denied error" if any of its - // properties are accessed. The only seemingly possible way to avoid erroring - // is to access a property that typically works for non-anonymous divs and - // catch any error that may otherwise arise. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 - - try { - /* eslint-disable no-unused-expressions */ - anchorNode.nodeType; - focusNode$$1.nodeType; - /* eslint-enable no-unused-expressions */ - } catch (e) { - return null; - } - - return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset); -} - -/** - * Returns {start, end} where `start` is the character/codepoint index of - * (anchorNode, anchorOffset) within the textContent of `outerNode`, and - * `end` is the index of (focusNode, focusOffset). - * - * Returns null if you pass in garbage input but we should probably just crash. - * - * Exported only for testing. - */ -function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset) { - var length = 0; - var start = -1; - var end = -1; - var indexWithinAnchor = 0; - var indexWithinFocus = 0; - var node = outerNode; - var parentNode = null; - - outer: while (true) { - var next = null; - - while (true) { - if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { - start = length + anchorOffset; - } - if (node === focusNode$$1 && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { - end = length + focusOffset; - } - - if (node.nodeType === TEXT_NODE) { - length += node.nodeValue.length; - } - - if ((next = node.firstChild) === null) { - break; - } - // Moving from `node` to its first child `next`. - parentNode = node; - node = next; - } - - while (true) { - if (node === outerNode) { - // If `outerNode` has children, this is always the second time visiting - // it. If it has no children, this is still the first loop, and the only - // valid selection is anchorNode and focusNode both equal to this node - // and both offsets 0, in which case we will have handled above. - break outer; - } - if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { - start = length; - } - if (parentNode === focusNode$$1 && ++indexWithinFocus === focusOffset) { - end = length; - } - if ((next = node.nextSibling) !== null) { - break; - } - node = parentNode; - parentNode = node.parentNode; - } - - // Moving from `node` to its next sibling `next`. - node = next; - } - - if (start === -1 || end === -1) { - // This should never happen. (Would happen if the anchor/focus nodes aren't - // actually inside the passed-in node.) - return null; - } - - return { - start: start, - end: end - }; -} - -/** - * In modern non-IE browsers, we can support both forward and backward - * selections. - * - * Note: IE10+ supports the Selection object, but it does not support - * the `extend` method, which means that even in modern IE, it's not possible - * to programmatically create a backward selection. Thus, for all IE - * versions, we use the old IE API to create our selections. - * - * @param {DOMElement|DOMTextNode} node - * @param {object} offsets - */ -function setOffsets(node, offsets) { - if (!window.getSelection) { - return; - } - - var selection = window.getSelection(); - var length = node[getTextContentAccessor()].length; - var start = Math.min(offsets.start, length); - var end = offsets.end === undefined ? start : Math.min(offsets.end, length); - - // IE 11 uses modern selection, but doesn't support the extend method. - // Flip backward selections, so we can set with a single range. - if (!selection.extend && start > end) { - var temp = end; - end = start; - start = temp; - } - - var startMarker = getNodeForCharacterOffset(node, start); - var endMarker = getNodeForCharacterOffset(node, end); - - if (startMarker && endMarker) { - if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { - return; - } - var range = document.createRange(); - range.setStart(startMarker.node, startMarker.offset); - selection.removeAllRanges(); - - if (start > end) { - selection.addRange(range); - selection.extend(endMarker.node, endMarker.offset); - } else { - range.setEnd(endMarker.node, endMarker.offset); - selection.addRange(range); - } - } -} - -function isInDocument(node) { - return containsNode(document.documentElement, node); -} - -/** - * @ReactInputSelection: React input selection module. Based on Selection.js, - * but modified to be suitable for react and has a couple of bug fixes (doesn't - * assume buttons have range selections allowed). - * Input selection module for React. - */ - -function hasSelectionCapabilities(elem) { - var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); - return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); -} - -function getSelectionInformation() { - var focusedElem = getActiveElement(); - return { - focusedElem: focusedElem, - selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null - }; -} - -/** - * @restoreSelection: If any selection information was potentially lost, - * restore it. This is useful when performing operations that could remove dom - * nodes and place them back in, resulting in focus being lost. - */ -function restoreSelection(priorSelectionInformation) { - var curFocusedElem = getActiveElement(); - var priorFocusedElem = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { - if (hasSelectionCapabilities(priorFocusedElem)) { - setSelection(priorFocusedElem, priorSelectionRange); - } - - // Focusing a node can change the scroll position, which is undesirable - var ancestors = []; - var ancestor = priorFocusedElem; - while (ancestor = ancestor.parentNode) { - if (ancestor.nodeType === ELEMENT_NODE) { - ancestors.push({ - element: ancestor, - left: ancestor.scrollLeft, - top: ancestor.scrollTop - }); - } - } - - focusNode(priorFocusedElem); - - for (var i = 0; i < ancestors.length; i++) { - var info = ancestors[i]; - info.element.scrollLeft = info.left; - info.element.scrollTop = info.top; - } - } -} - -/** - * @getSelection: Gets the selection bounds of a focused textarea, input or - * contentEditable node. - * -@input: Look up selection bounds of this input - * -@return {start: selectionStart, end: selectionEnd} - */ -function getSelection$1(input) { - var selection = void 0; - - if ('selectionStart' in input) { - // Modern browser with input or textarea. - selection = { - start: input.selectionStart, - end: input.selectionEnd - }; - } else { - // Content editable or old IE textarea. - selection = getOffsets(input); - } - - return selection || { start: 0, end: 0 }; -} - -/** - * @setSelection: Sets the selection bounds of a textarea or input and focuses - * the input. - * -@input Set selection bounds of this input or textarea - * -@offsets Object of same form that is returned from get* - */ -function setSelection(input, offsets) { - var start = offsets.start, - end = offsets.end; - - if (end === undefined) { - end = start; - } - - if ('selectionStart' in input) { - input.selectionStart = start; - input.selectionEnd = Math.min(end, input.value.length); - } else { - setOffsets(input, offsets); - } -} - -var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; - -var eventTypes$3 = { - select: { - phasedRegistrationNames: { - bubbled: 'onSelect', - captured: 'onSelectCapture' - }, - dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange'] - } -}; - -var activeElement$1 = null; -var activeElementInst$1 = null; -var lastSelection = null; -var mouseDown = false; - -/** - * Get an object which is a unique representation of the current selection. - * - * The return value will not be consistent across nodes or browsers, but - * two identical selections on the same node will return identical objects. - * - * @param {DOMElement} node - * @return {object} - */ -function getSelection(node) { - if ('selectionStart' in node && hasSelectionCapabilities(node)) { - return { - start: node.selectionStart, - end: node.selectionEnd - }; - } else if (window.getSelection) { - var selection = window.getSelection(); - return { - anchorNode: selection.anchorNode, - anchorOffset: selection.anchorOffset, - focusNode: selection.focusNode, - focusOffset: selection.focusOffset - }; - } -} - -/** - * Poll selection to see whether it's changed. - * - * @param {object} nativeEvent - * @return {?SyntheticEvent} - */ -function constructSelectEvent(nativeEvent, nativeEventTarget) { - // Ensure we have the right element, and that the user is not dragging a - // selection (this matches native `select` event behavior). In HTML5, select - // fires only on input and textarea thus if there's no focused element we - // won't dispatch. - if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement()) { - return null; - } - - // Only fire when selection has actually changed. - var currentSelection = getSelection(activeElement$1); - if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { - lastSelection = currentSelection; - - var syntheticEvent = SyntheticEvent$1.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget); - - syntheticEvent.type = 'select'; - syntheticEvent.target = activeElement$1; - - accumulateTwoPhaseDispatches(syntheticEvent); - - return syntheticEvent; - } - - return null; -} - -/** - * This plugin creates an `onSelect` event that normalizes select events - * across form elements. - * - * Supported elements are: - * - input (see `isTextInputElement`) - * - textarea - * - contentEditable - * - * This differs from native browser implementations in the following ways: - * - Fires on contentEditable fields as well as inputs. - * - Fires for collapsed selection. - * - Fires after user input. - */ -var SelectEventPlugin = { - eventTypes: eventTypes$3, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === DOCUMENT_NODE ? nativeEventTarget : nativeEventTarget.ownerDocument; - // Track whether all listeners exists for this plugin. If none exist, we do - // not extract events. See #3639. - if (!doc || !isListeningToAllDependencies('onSelect', doc)) { - return null; - } - - var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; - - switch (topLevelType) { - // Track the input node that has focus. - case 'topFocus': - if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { - activeElement$1 = targetNode; - activeElementInst$1 = targetInst; - lastSelection = null; - } - break; - case 'topBlur': - activeElement$1 = null; - activeElementInst$1 = null; - lastSelection = null; - break; - // Don't fire the event while the user is dragging. This matches the - // semantics of the native select event. - case 'topMouseDown': - mouseDown = true; - break; - case 'topContextMenu': - case 'topMouseUp': - mouseDown = false; - return constructSelectEvent(nativeEvent, nativeEventTarget); - // Chrome and IE fire non-standard event when selection is changed (and - // sometimes when it hasn't). IE's event fires out of order with respect - // to key and input events on deletion, so we discard it. - // - // Firefox doesn't support selectionchange, so check selection status - // after each key entry. The selection changes after keydown and before - // keyup, but we check on keydown as well in the case of holding down a - // key, when multiple keydown events are fired but only one keyup is. - // This is also our approach for IE handling, for the reason above. - case 'topSelectionChange': - if (skipSelectionChangeEvent) { - break; - } - // falls through - case 'topKeyDown': - case 'topKeyUp': - return constructSelectEvent(nativeEvent, nativeEventTarget); - } - - return null; - } -}; - -/** - * @interface Event - * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface - * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent - */ -var AnimationEventInterface = { - animationName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); - -/** - * @interface Event - * @see http://www.w3.org/TR/clipboard-apis/ - */ -var ClipboardEventInterface = { - clipboardData: function (event) { - return 'clipboardData' in event ? event.clipboardData : window.clipboardData; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); - -/** - * @interface FocusEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var FocusEventInterface = { - relatedTarget: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); - -/** - * `charCode` represents the actual "character code" and is safe to use with - * `String.fromCharCode`. As such, only keys that correspond to printable - * characters produce a valid `charCode`, the only exception to this is Enter. - * The Tab-key is considered non-printable and does not have a `charCode`, - * presumably because it does not produce a tab-character in browsers. - * - * @param {object} nativeEvent Native browser event. - * @return {number} Normalized `charCode` property. - */ -function getEventCharCode(nativeEvent) { - var charCode; - var keyCode = nativeEvent.keyCode; - - if ('charCode' in nativeEvent) { - charCode = nativeEvent.charCode; - - // FF does not set `charCode` for the Enter-key, check against `keyCode`. - if (charCode === 0 && keyCode === 13) { - charCode = 13; - } - } else { - // IE8 does not implement `charCode`, but `keyCode` has the correct value. - charCode = keyCode; - } - - // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. - // Must not discard the (non-)printable Enter-key. - if (charCode >= 32 || charCode === 13) { - return charCode; - } - - return 0; -} - -/** - * Normalization of deprecated HTML5 `key` values - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -var normalizeKey = { - Esc: 'Escape', - Spacebar: ' ', - Left: 'ArrowLeft', - Up: 'ArrowUp', - Right: 'ArrowRight', - Down: 'ArrowDown', - Del: 'Delete', - Win: 'OS', - Menu: 'ContextMenu', - Apps: 'ContextMenu', - Scroll: 'ScrollLock', - MozPrintableKey: 'Unidentified' -}; - -/** - * Translation from legacy `keyCode` to HTML5 `key` - * Only special keys supported, all others depend on keyboard layout or browser - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -var translateToKey = { - '8': 'Backspace', - '9': 'Tab', - '12': 'Clear', - '13': 'Enter', - '16': 'Shift', - '17': 'Control', - '18': 'Alt', - '19': 'Pause', - '20': 'CapsLock', - '27': 'Escape', - '32': ' ', - '33': 'PageUp', - '34': 'PageDown', - '35': 'End', - '36': 'Home', - '37': 'ArrowLeft', - '38': 'ArrowUp', - '39': 'ArrowRight', - '40': 'ArrowDown', - '45': 'Insert', - '46': 'Delete', - '112': 'F1', - '113': 'F2', - '114': 'F3', - '115': 'F4', - '116': 'F5', - '117': 'F6', - '118': 'F7', - '119': 'F8', - '120': 'F9', - '121': 'F10', - '122': 'F11', - '123': 'F12', - '144': 'NumLock', - '145': 'ScrollLock', - '224': 'Meta' -}; - -/** - * @param {object} nativeEvent Native browser event. - * @return {string} Normalized `key` property. - */ -function getEventKey(nativeEvent) { - if (nativeEvent.key) { - // Normalize inconsistent values reported by browsers due to - // implementations of a working draft specification. - - // FireFox implements `key` but returns `MozPrintableKey` for all - // printable characters (normalized to `Unidentified`), ignore it. - var key = normalizeKey[nativeEvent.key] || nativeEvent.key; - if (key !== 'Unidentified') { - return key; - } - } - - // Browser does not implement `key`, polyfill as much of it as we can. - if (nativeEvent.type === 'keypress') { - var charCode = getEventCharCode(nativeEvent); - - // The enter-key is technically both printable and non-printable and can - // thus be captured by `keypress`, no other non-printable key should. - return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); - } - if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { - // While user keyboard layout determines the actual meaning of each - // `keyCode` value, almost all function keys have a universal value. - return translateToKey[nativeEvent.keyCode] || 'Unidentified'; - } - return ''; -} - -/** - * @interface KeyboardEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var KeyboardEventInterface = { - key: getEventKey, - location: null, - ctrlKey: null, - shiftKey: null, - altKey: null, - metaKey: null, - repeat: null, - locale: null, - getModifierState: getEventModifierState, - // Legacy Interface - charCode: function (event) { - // `charCode` is the result of a KeyPress event and represents the value of - // the actual printable character. - - // KeyPress is deprecated, but its replacement is not yet final and not - // implemented in any major browser. Only KeyPress has charCode. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - return 0; - }, - keyCode: function (event) { - // `keyCode` is the result of a KeyDown/Up event and represents the value of - // physical keyboard key. - - // The actual meaning of the value depends on the users' keyboard layout - // which cannot be detected. Assuming that it is a US keyboard layout - // provides a surprisingly accurate mapping for US and European users. - // Due to this, it is left to the user to implement at this time. - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - }, - which: function (event) { - // `which` is an alias for either `keyCode` or `charCode` depending on the - // type of the event. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); - -/** - * @interface DragEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var DragEventInterface = { - dataTransfer: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticMouseEvent} - */ -function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); - -/** - * @interface TouchEvent - * @see http://www.w3.org/TR/touch-events/ - */ -var TouchEventInterface = { - touches: null, - targetTouches: null, - changedTouches: null, - altKey: null, - metaKey: null, - ctrlKey: null, - shiftKey: null, - getModifierState: getEventModifierState -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); - -/** - * @interface Event - * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- - * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent - */ -var TransitionEventInterface = { - propertyName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); - -/** - * @interface WheelEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var WheelEventInterface = { - deltaX: function (event) { - return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). - 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; - }, - deltaY: function (event) { - return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). - 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). - 'wheelDelta' in event ? -event.wheelDelta : 0; - }, - deltaZ: null, - - // Browsers without "deltaMode" is reporting in raw wheel delta where one - // notch on the scroll is always +/- 120, roughly equivalent to pixels. - // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or - // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. - deltaMode: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticMouseEvent} - */ -function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); - -/** - * Turns - * ['abort', ...] - * into - * eventTypes = { - * 'abort': { - * phasedRegistrationNames: { - * bubbled: 'onAbort', - * captured: 'onAbortCapture', - * }, - * dependencies: ['topAbort'], - * }, - * ... - * }; - * topLevelEventsToDispatchConfig = { - * 'topAbort': { sameConfig } - * }; - */ -var eventTypes$4 = {}; -var topLevelEventsToDispatchConfig = {}; -['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'toggle', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) { - var capitalizedEvent = event[0].toUpperCase() + event.slice(1); - var onEvent = 'on' + capitalizedEvent; - var topEvent = 'top' + capitalizedEvent; - - var type = { - phasedRegistrationNames: { - bubbled: onEvent, - captured: onEvent + 'Capture' - }, - dependencies: [topEvent] - }; - eventTypes$4[event] = type; - topLevelEventsToDispatchConfig[topEvent] = type; -}); - -// Only used in DEV for exhaustiveness validation. -var knownHTMLTopLevelTypes = ['topAbort', 'topCancel', 'topCanPlay', 'topCanPlayThrough', 'topClose', 'topDurationChange', 'topEmptied', 'topEncrypted', 'topEnded', 'topError', 'topInput', 'topInvalid', 'topLoad', 'topLoadedData', 'topLoadedMetadata', 'topLoadStart', 'topPause', 'topPlay', 'topPlaying', 'topProgress', 'topRateChange', 'topReset', 'topSeeked', 'topSeeking', 'topStalled', 'topSubmit', 'topSuspend', 'topTimeUpdate', 'topToggle', 'topVolumeChange', 'topWaiting']; - -var SimpleEventPlugin = { - eventTypes: eventTypes$4, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; - if (!dispatchConfig) { - return null; - } - var EventConstructor; - switch (topLevelType) { - case 'topKeyPress': - // Firefox creates a keypress event for function keys too. This removes - // the unwanted keypress events. Enter is however both printable and - // non-printable. One would expect Tab to be as well (but it isn't). - if (getEventCharCode(nativeEvent) === 0) { - return null; - } - /* falls through */ - case 'topKeyDown': - case 'topKeyUp': - EventConstructor = SyntheticKeyboardEvent; - break; - case 'topBlur': - case 'topFocus': - EventConstructor = SyntheticFocusEvent; - break; - case 'topClick': - // Firefox creates a click event on right mouse clicks. This removes the - // unwanted click events. - if (nativeEvent.button === 2) { - return null; - } - /* falls through */ - case 'topDoubleClick': - case 'topMouseDown': - case 'topMouseMove': - case 'topMouseUp': - // TODO: Disabled elements should not respond to mouse events - /* falls through */ - case 'topMouseOut': - case 'topMouseOver': - case 'topContextMenu': - EventConstructor = SyntheticMouseEvent; - break; - case 'topDrag': - case 'topDragEnd': - case 'topDragEnter': - case 'topDragExit': - case 'topDragLeave': - case 'topDragOver': - case 'topDragStart': - case 'topDrop': - EventConstructor = SyntheticDragEvent; - break; - case 'topTouchCancel': - case 'topTouchEnd': - case 'topTouchMove': - case 'topTouchStart': - EventConstructor = SyntheticTouchEvent; - break; - case 'topAnimationEnd': - case 'topAnimationIteration': - case 'topAnimationStart': - EventConstructor = SyntheticAnimationEvent; - break; - case 'topTransitionEnd': - EventConstructor = SyntheticTransitionEvent; - break; - case 'topScroll': - EventConstructor = SyntheticUIEvent; - break; - case 'topWheel': - EventConstructor = SyntheticWheelEvent; - break; - case 'topCopy': - case 'topCut': - case 'topPaste': - EventConstructor = SyntheticClipboardEvent; - break; - default: - { - if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) { - warning(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType); - } - } - // HTML Events - // @see http://www.w3.org/TR/html5/index.html#events-0 - EventConstructor = SyntheticEvent$1; - break; - } - var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); - accumulateTwoPhaseDispatches(event); - return event; - } -}; - -setHandleTopLevel(handleTopLevel); - -/** - * Inject modules for resolving DOM hierarchy and plugin ordering. - */ -injection$1.injectEventPluginOrder(DOMEventPluginOrder); -injection$2.injectComponentTree(ReactDOMComponentTree); - -/** - * Some important event plugins included by default (without having to require - * them). - */ -injection$1.injectEventPluginsByName({ - SimpleEventPlugin: SimpleEventPlugin, - EnterLeaveEventPlugin: EnterLeaveEventPlugin, - ChangeEventPlugin: ChangeEventPlugin, - SelectEventPlugin: SelectEventPlugin, - BeforeInputEventPlugin: BeforeInputEventPlugin -}); - -var enableAsyncSubtreeAPI = true; -var enableAsyncSchedulingByDefaultInReactDOM = false; -// Exports ReactDOM.createRoot -var enableCreateRoot = false; -var enableUserTimingAPI = true; - -// Mutating mode (React DOM, React ART, React Native): -var enableMutatingReconciler = true; -// Experimental noop mode (currently unused): -var enableNoopReconciler = false; -// Experimental persistent mode (CS): -var enablePersistentReconciler = false; - -// Helps identify side effects in begin-phase lifecycle hooks and setState reducers: -var debugRenderPhaseSideEffects = false; - -// Only used in www builds. - -var valueStack = []; - -{ - var fiberStack = []; -} - -var index = -1; - -function createCursor(defaultValue) { - return { - current: defaultValue - }; -} - - - -function pop(cursor, fiber) { - if (index < 0) { - { - warning(false, 'Unexpected pop.'); - } - return; - } - - { - if (fiber !== fiberStack[index]) { - warning(false, 'Unexpected Fiber popped.'); - } - } - - cursor.current = valueStack[index]; - - valueStack[index] = null; - - { - fiberStack[index] = null; - } - - index--; -} - -function push(cursor, value, fiber) { - index++; - - valueStack[index] = cursor.current; - - { - fiberStack[index] = fiber; - } - - cursor.current = value; -} - -function reset$1() { - while (index > -1) { - valueStack[index] = null; - - { - fiberStack[index] = null; - } - - index--; - } -} - -var describeComponentFrame = function (name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); -}; - -function describeFiber(fiber) { - switch (fiber.tag) { - case IndeterminateComponent: - case FunctionalComponent: - case ClassComponent: - case HostComponent: - var owner = fiber._debugOwner; - var source = fiber._debugSource; - var name = getComponentName(fiber); - var ownerName = null; - if (owner) { - ownerName = getComponentName(owner); - } - return describeComponentFrame(name, source, ownerName); - default: - return ''; - } -} - -// This function can only be called with a work-in-progress fiber and -// only during begin or complete phase. Do not call it under any other -// circumstances. -function getStackAddendumByWorkInProgressFiber(workInProgress) { - var info = ''; - var node = workInProgress; - do { - info += describeFiber(node); - // Otherwise this return pointer might point to the wrong tree: - node = node['return']; - } while (node); - return info; -} - -function getCurrentFiberOwnerName() { - { - var fiber = ReactDebugCurrentFiber.current; - if (fiber === null) { - return null; - } - var owner = fiber._debugOwner; - if (owner !== null && typeof owner !== 'undefined') { - return getComponentName(owner); - } - } - return null; -} - -function getCurrentFiberStackAddendum() { - { - var fiber = ReactDebugCurrentFiber.current; - if (fiber === null) { - return null; - } - // Safe because if current fiber exists, we are reconciling, - // and it is guaranteed to be the work-in-progress version. - return getStackAddendumByWorkInProgressFiber(fiber); - } - return null; -} - -function resetCurrentFiber() { - ReactDebugCurrentFrame.getCurrentStack = null; - ReactDebugCurrentFiber.current = null; - ReactDebugCurrentFiber.phase = null; -} - -function setCurrentFiber(fiber) { - ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum; - ReactDebugCurrentFiber.current = fiber; - ReactDebugCurrentFiber.phase = null; -} - -function setCurrentPhase(phase) { - ReactDebugCurrentFiber.phase = phase; -} - -var ReactDebugCurrentFiber = { - current: null, - phase: null, - resetCurrentFiber: resetCurrentFiber, - setCurrentFiber: setCurrentFiber, - setCurrentPhase: setCurrentPhase, - getCurrentFiberOwnerName: getCurrentFiberOwnerName, - getCurrentFiberStackAddendum: getCurrentFiberStackAddendum -}; - -// Prefix measurements so that it's possible to filter them. -// Longer prefixes are hard to read in DevTools. -var reactEmoji = '\u269B'; -var warningEmoji = '\u26D4'; -var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; - -// Keep track of current fiber so that we know the path to unwind on pause. -// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them? -var currentFiber = null; -// If we're in the middle of user code, which fiber and method is it? -// Reusing `currentFiber` would be confusing for this because user code fiber -// can change during commit phase too, but we don't need to unwind it (since -// lifecycles in the commit phase don't resemble a tree). -var currentPhase = null; -var currentPhaseFiber = null; -// Did lifecycle hook schedule an update? This is often a performance problem, -// so we will keep track of it, and include it in the report. -// Track commits caused by cascading updates. -var isCommitting = false; -var hasScheduledUpdateInCurrentCommit = false; -var hasScheduledUpdateInCurrentPhase = false; -var commitCountInCurrentWorkLoop = 0; -var effectCountInCurrentCommit = 0; -var isWaitingForCallback = false; -// During commits, we only show a measurement once per method name -// to avoid stretch the commit phase with measurement overhead. -var labelsInCurrentCommit = new Set(); - -var formatMarkName = function (markName) { - return reactEmoji + ' ' + markName; -}; - -var formatLabel = function (label, warning$$1) { - var prefix = warning$$1 ? warningEmoji + ' ' : reactEmoji + ' '; - var suffix = warning$$1 ? ' Warning: ' + warning$$1 : ''; - return '' + prefix + label + suffix; -}; - -var beginMark = function (markName) { - performance.mark(formatMarkName(markName)); -}; - -var clearMark = function (markName) { - performance.clearMarks(formatMarkName(markName)); -}; - -var endMark = function (label, markName, warning$$1) { - var formattedMarkName = formatMarkName(markName); - var formattedLabel = formatLabel(label, warning$$1); - try { - performance.measure(formattedLabel, formattedMarkName); - } catch (err) {} - // If previous mark was missing for some reason, this will throw. - // This could only happen if React crashed in an unexpected place earlier. - // Don't pile on with more errors. - - // Clear marks immediately to avoid growing buffer. - performance.clearMarks(formattedMarkName); - performance.clearMeasures(formattedLabel); -}; - -var getFiberMarkName = function (label, debugID) { - return label + ' (#' + debugID + ')'; -}; - -var getFiberLabel = function (componentName, isMounted, phase) { - if (phase === null) { - // These are composite component total time measurements. - return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']'; - } else { - // Composite component methods. - return componentName + '.' + phase; - } -}; - -var beginFiberMark = function (fiber, phase) { - var componentName = getComponentName(fiber) || 'Unknown'; - var debugID = fiber._debugID; - var isMounted = fiber.alternate !== null; - var label = getFiberLabel(componentName, isMounted, phase); - - if (isCommitting && labelsInCurrentCommit.has(label)) { - // During the commit phase, we don't show duplicate labels because - // there is a fixed overhead for every measurement, and we don't - // want to stretch the commit phase beyond necessary. - return false; - } - labelsInCurrentCommit.add(label); - - var markName = getFiberMarkName(label, debugID); - beginMark(markName); - return true; -}; - -var clearFiberMark = function (fiber, phase) { - var componentName = getComponentName(fiber) || 'Unknown'; - var debugID = fiber._debugID; - var isMounted = fiber.alternate !== null; - var label = getFiberLabel(componentName, isMounted, phase); - var markName = getFiberMarkName(label, debugID); - clearMark(markName); -}; - -var endFiberMark = function (fiber, phase, warning$$1) { - var componentName = getComponentName(fiber) || 'Unknown'; - var debugID = fiber._debugID; - var isMounted = fiber.alternate !== null; - var label = getFiberLabel(componentName, isMounted, phase); - var markName = getFiberMarkName(label, debugID); - endMark(label, markName, warning$$1); -}; - -var shouldIgnoreFiber = function (fiber) { - // Host components should be skipped in the timeline. - // We could check typeof fiber.type, but does this work with RN? - switch (fiber.tag) { - case HostRoot: - case HostComponent: - case HostText: - case HostPortal: - case ReturnComponent: - case Fragment: - return true; - default: - return false; - } -}; - -var clearPendingPhaseMeasurement = function () { - if (currentPhase !== null && currentPhaseFiber !== null) { - clearFiberMark(currentPhaseFiber, currentPhase); - } - currentPhaseFiber = null; - currentPhase = null; - hasScheduledUpdateInCurrentPhase = false; -}; - -var pauseTimers = function () { - // Stops all currently active measurements so that they can be resumed - // if we continue in a later deferred loop from the same unit of work. - var fiber = currentFiber; - while (fiber) { - if (fiber._debugIsCurrentlyTiming) { - endFiberMark(fiber, null, null); - } - fiber = fiber['return']; - } -}; - -var resumeTimersRecursively = function (fiber) { - if (fiber['return'] !== null) { - resumeTimersRecursively(fiber['return']); - } - if (fiber._debugIsCurrentlyTiming) { - beginFiberMark(fiber, null); - } -}; - -var resumeTimers = function () { - // Resumes all measurements that were active during the last deferred loop. - if (currentFiber !== null) { - resumeTimersRecursively(currentFiber); - } -}; - -function recordEffect() { - if (enableUserTimingAPI) { - effectCountInCurrentCommit++; - } -} - -function recordScheduleUpdate() { - if (enableUserTimingAPI) { - if (isCommitting) { - hasScheduledUpdateInCurrentCommit = true; - } - if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') { - hasScheduledUpdateInCurrentPhase = true; - } - } -} - -function startRequestCallbackTimer() { - if (enableUserTimingAPI) { - if (supportsUserTiming && !isWaitingForCallback) { - isWaitingForCallback = true; - beginMark('(Waiting for async callback...)'); - } - } -} - -function stopRequestCallbackTimer(didExpire) { - if (enableUserTimingAPI) { - if (supportsUserTiming) { - isWaitingForCallback = false; - var warning$$1 = didExpire ? 'React was blocked by main thread' : null; - endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning$$1); - } - } -} - -function startWorkTimer(fiber) { - if (enableUserTimingAPI) { - if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { - return; - } - // If we pause, this is the fiber to unwind from. - currentFiber = fiber; - if (!beginFiberMark(fiber, null)) { - return; - } - fiber._debugIsCurrentlyTiming = true; - } -} - -function cancelWorkTimer(fiber) { - if (enableUserTimingAPI) { - if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { - return; - } - // Remember we shouldn't complete measurement for this fiber. - // Otherwise flamechart will be deep even for small updates. - fiber._debugIsCurrentlyTiming = false; - clearFiberMark(fiber, null); - } -} - -function stopWorkTimer(fiber) { - if (enableUserTimingAPI) { - if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { - return; - } - // If we pause, its parent is the fiber to unwind from. - currentFiber = fiber['return']; - if (!fiber._debugIsCurrentlyTiming) { - return; - } - fiber._debugIsCurrentlyTiming = false; - endFiberMark(fiber, null, null); - } -} - -function stopFailedWorkTimer(fiber) { - if (enableUserTimingAPI) { - if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { - return; - } - // If we pause, its parent is the fiber to unwind from. - currentFiber = fiber['return']; - if (!fiber._debugIsCurrentlyTiming) { - return; - } - fiber._debugIsCurrentlyTiming = false; - var warning$$1 = 'An error was thrown inside this error boundary'; - endFiberMark(fiber, null, warning$$1); - } -} - -function startPhaseTimer(fiber, phase) { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - clearPendingPhaseMeasurement(); - if (!beginFiberMark(fiber, phase)) { - return; - } - currentPhaseFiber = fiber; - currentPhase = phase; - } -} - -function stopPhaseTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - if (currentPhase !== null && currentPhaseFiber !== null) { - var warning$$1 = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null; - endFiberMark(currentPhaseFiber, currentPhase, warning$$1); - } - currentPhase = null; - currentPhaseFiber = null; - } -} - -function startWorkLoopTimer(nextUnitOfWork) { - if (enableUserTimingAPI) { - currentFiber = nextUnitOfWork; - if (!supportsUserTiming) { - return; - } - commitCountInCurrentWorkLoop = 0; - // This is top level call. - // Any other measurements are performed within. - beginMark('(React Tree Reconciliation)'); - // Resume any measurements that were in progress during the last loop. - resumeTimers(); - } -} - -function stopWorkLoopTimer(interruptedBy) { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - var warning$$1 = null; - if (interruptedBy !== null) { - if (interruptedBy.tag === HostRoot) { - warning$$1 = 'A top-level update interrupted the previous render'; - } else { - var componentName = getComponentName(interruptedBy) || 'Unknown'; - warning$$1 = 'An update to ' + componentName + ' interrupted the previous render'; - } - } else if (commitCountInCurrentWorkLoop > 1) { - warning$$1 = 'There were cascading updates'; - } - commitCountInCurrentWorkLoop = 0; - // Pause any measurements until the next loop. - pauseTimers(); - endMark('(React Tree Reconciliation)', '(React Tree Reconciliation)', warning$$1); - } -} - -function startCommitTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - isCommitting = true; - hasScheduledUpdateInCurrentCommit = false; - labelsInCurrentCommit.clear(); - beginMark('(Committing Changes)'); - } -} - -function stopCommitTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - - var warning$$1 = null; - if (hasScheduledUpdateInCurrentCommit) { - warning$$1 = 'Lifecycle hook scheduled a cascading update'; - } else if (commitCountInCurrentWorkLoop > 0) { - warning$$1 = 'Caused by a cascading update in earlier commit'; - } - hasScheduledUpdateInCurrentCommit = false; - commitCountInCurrentWorkLoop++; - isCommitting = false; - labelsInCurrentCommit.clear(); - - endMark('(Committing Changes)', '(Committing Changes)', warning$$1); - } -} - -function startCommitHostEffectsTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - effectCountInCurrentCommit = 0; - beginMark('(Committing Host Effects)'); - } -} - -function stopCommitHostEffectsTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - var count = effectCountInCurrentCommit; - effectCountInCurrentCommit = 0; - endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null); - } -} - -function startCommitLifeCyclesTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - effectCountInCurrentCommit = 0; - beginMark('(Calling Lifecycle Methods)'); - } -} - -function stopCommitLifeCyclesTimer() { - if (enableUserTimingAPI) { - if (!supportsUserTiming) { - return; - } - var count = effectCountInCurrentCommit; - effectCountInCurrentCommit = 0; - endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null); - } -} - -{ - var warnedAboutMissingGetChildContext = {}; -} - -// A cursor to the current merged context object on the stack. -var contextStackCursor = createCursor(emptyObject); -// A cursor to a boolean indicating whether the context has changed. -var didPerformWorkStackCursor = createCursor(false); -// Keep track of the previous context object that was on the stack. -// We use this to get access to the parent context after we have already -// pushed the next context provider, and now need to merge their contexts. -var previousContext = emptyObject; - -function getUnmaskedContext(workInProgress) { - var hasOwnContext = isContextProvider(workInProgress); - if (hasOwnContext) { - // If the fiber is a context provider itself, when we read its context - // we have already pushed its own child context on the stack. A context - // provider should not "see" its own child context. Therefore we read the - // previous (parent) context instead for a context provider. - return previousContext; - } - return contextStackCursor.current; -} - -function cacheContext(workInProgress, unmaskedContext, maskedContext) { - var instance = workInProgress.stateNode; - instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; - instance.__reactInternalMemoizedMaskedChildContext = maskedContext; -} - -function getMaskedContext(workInProgress, unmaskedContext) { - var type = workInProgress.type; - var contextTypes = type.contextTypes; - if (!contextTypes) { - return emptyObject; - } - - // Avoid recreating masked context unless unmasked context has changed. - // Failing to do this will result in unnecessary calls to componentWillReceiveProps. - // This may trigger infinite loops if componentWillReceiveProps calls setState. - var instance = workInProgress.stateNode; - if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { - return instance.__reactInternalMemoizedMaskedChildContext; - } - - var context = {}; - for (var key in contextTypes) { - context[key] = unmaskedContext[key]; - } - - { - var name = getComponentName(workInProgress) || 'Unknown'; - checkPropTypes(contextTypes, context, 'context', name, ReactDebugCurrentFiber.getCurrentFiberStackAddendum); - } - - // Cache unmasked context so we can avoid recreating masked context unless necessary. - // Context is created before the class component is instantiated so check for instance. - if (instance) { - cacheContext(workInProgress, unmaskedContext, context); - } - - return context; -} - -function hasContextChanged() { - return didPerformWorkStackCursor.current; -} - -function isContextConsumer(fiber) { - return fiber.tag === ClassComponent && fiber.type.contextTypes != null; -} - -function isContextProvider(fiber) { - return fiber.tag === ClassComponent && fiber.type.childContextTypes != null; -} - -function popContextProvider(fiber) { - if (!isContextProvider(fiber)) { - return; - } - - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); -} - -function popTopLevelContextObject(fiber) { - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); -} - -function pushTopLevelContextObject(fiber, context, didChange) { - !(contextStackCursor.cursor == null) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - push(contextStackCursor, context, fiber); - push(didPerformWorkStackCursor, didChange, fiber); -} - -function processChildContext(fiber, parentContext) { - var instance = fiber.stateNode; - var childContextTypes = fiber.type.childContextTypes; - - // TODO (bvaughn) Replace this behavior with an invariant() in the future. - // It has only been added in Fiber to match the (unintentional) behavior in Stack. - if (typeof instance.getChildContext !== 'function') { - { - var componentName = getComponentName(fiber) || 'Unknown'; - - if (!warnedAboutMissingGetChildContext[componentName]) { - warnedAboutMissingGetChildContext[componentName] = true; - warning(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName); - } - } - return parentContext; - } - - var childContext = void 0; - { - ReactDebugCurrentFiber.setCurrentPhase('getChildContext'); - } - startPhaseTimer(fiber, 'getChildContext'); - childContext = instance.getChildContext(); - stopPhaseTimer(); - { - ReactDebugCurrentFiber.setCurrentPhase(null); - } - for (var contextKey in childContext) { - !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(fiber) || 'Unknown', contextKey) : void 0; - } - { - var name = getComponentName(fiber) || 'Unknown'; - checkPropTypes(childContextTypes, childContext, 'child context', name, - // In practice, there is one case in which we won't get a stack. It's when - // somebody calls unstable_renderSubtreeIntoContainer() and we process - // context from the parent component instance. The stack will be missing - // because it's outside of the reconciliation, and so the pointer has not - // been set. This is rare and doesn't matter. We'll also remove that API. - ReactDebugCurrentFiber.getCurrentFiberStackAddendum); - } - - return _assign({}, parentContext, childContext); -} - -function pushContextProvider(workInProgress) { - if (!isContextProvider(workInProgress)) { - return false; - } - - var instance = workInProgress.stateNode; - // We push the context as early as possible to ensure stack integrity. - // If the instance does not exist yet, we will push null at first, - // and replace it on the stack later when invalidating the context. - var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; - - // Remember the parent context so we can merge with it later. - // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. - previousContext = contextStackCursor.current; - push(contextStackCursor, memoizedMergedChildContext, workInProgress); - push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); - - return true; -} - -function invalidateContextProvider(workInProgress, didChange) { - var instance = workInProgress.stateNode; - !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - if (didChange) { - // Merge parent and own context. - // Skip this if we're not updating due to sCU. - // This avoids unnecessarily recomputing memoized values. - var mergedContext = processChildContext(workInProgress, previousContext); - instance.__reactInternalMemoizedMergedChildContext = mergedContext; - - // Replace the old (or empty) context with the new one. - // It is important to unwind the context in the reverse order. - pop(didPerformWorkStackCursor, workInProgress); - pop(contextStackCursor, workInProgress); - // Now push the new context and mark that it has changed. - push(contextStackCursor, mergedContext, workInProgress); - push(didPerformWorkStackCursor, didChange, workInProgress); - } else { - pop(didPerformWorkStackCursor, workInProgress); - push(didPerformWorkStackCursor, didChange, workInProgress); - } -} - -function resetContext() { - previousContext = emptyObject; - contextStackCursor.current = emptyObject; - didPerformWorkStackCursor.current = false; -} - -function findCurrentUnmaskedContext(fiber) { - // Currently this is only used with renderSubtreeIntoContainer; not sure if it - // makes sense elsewhere - !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - var node = fiber; - while (node.tag !== HostRoot) { - if (isContextProvider(node)) { - return node.stateNode.__reactInternalMemoizedMergedChildContext; - } - var parent = node['return']; - !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0; - node = parent; - } - return node.stateNode.context; -} - -var NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax - -var Sync = 1; -var Never = 2147483647; // Max int32: Math.pow(2, 31) - 1 - -var UNIT_SIZE = 10; -var MAGIC_NUMBER_OFFSET = 2; - -// 1 unit of expiration time represents 10ms. -function msToExpirationTime(ms) { - // Always add an offset so that we don't clash with the magic number for NoWork. - return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET; -} - -function expirationTimeToMs(expirationTime) { - return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE; -} - -function ceiling(num, precision) { - return ((num / precision | 0) + 1) * precision; -} - -function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) { - return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE); -} - -var NoContext = 0; -var AsyncUpdates = 1; - -{ - var hasBadMapPolyfill = false; - try { - var nonExtensibleObject = Object.preventExtensions({}); - /* eslint-disable no-new */ - - /* eslint-enable no-new */ - } catch (e) { - // TODO: Consider warning about bad polyfills - hasBadMapPolyfill = true; - } -} - -// A Fiber is work on a Component that needs to be done or was done. There can -// be more than one per component. - - -{ - var debugCounter = 1; -} - -function FiberNode(tag, key, internalContextTag) { - // Instance - this.tag = tag; - this.key = key; - this.type = null; - this.stateNode = null; - - // Fiber - this['return'] = null; - this.child = null; - this.sibling = null; - this.index = 0; - - this.ref = null; - - this.pendingProps = null; - this.memoizedProps = null; - this.updateQueue = null; - this.memoizedState = null; - - this.internalContextTag = internalContextTag; - - // Effects - this.effectTag = NoEffect; - this.nextEffect = null; - - this.firstEffect = null; - this.lastEffect = null; - - this.expirationTime = NoWork; - - this.alternate = null; - - { - this._debugID = debugCounter++; - this._debugSource = null; - this._debugOwner = null; - this._debugIsCurrentlyTiming = false; - if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { - Object.preventExtensions(this); - } - } -} - -// This is a constructor function, rather than a POJO constructor, still -// please ensure we do the following: -// 1) Nobody should add any instance methods on this. Instance methods can be -// more difficult to predict when they get optimized and they are almost -// never inlined properly in static compilers. -// 2) Nobody should rely on `instanceof Fiber` for type testing. We should -// always know when it is a fiber. -// 3) We might want to experiment with using numeric keys since they are easier -// to optimize in a non-JIT environment. -// 4) We can easily go from a constructor to a createFiber object literal if that -// is faster. -// 5) It should be easy to port this to a C struct and keep a C implementation -// compatible. -var createFiber = function (tag, key, internalContextTag) { - // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors - return new FiberNode(tag, key, internalContextTag); -}; - -function shouldConstruct(Component) { - return !!(Component.prototype && Component.prototype.isReactComponent); -} - -// This is used to create an alternate fiber to do work on. -function createWorkInProgress(current, pendingProps, expirationTime) { - var workInProgress = current.alternate; - if (workInProgress === null) { - // We use a double buffering pooling technique because we know that we'll - // only ever need at most two versions of a tree. We pool the "other" unused - // node that we're free to reuse. This is lazily created to avoid allocating - // extra objects for things that are never updated. It also allow us to - // reclaim the extra memory if needed. - workInProgress = createFiber(current.tag, current.key, current.internalContextTag); - workInProgress.type = current.type; - workInProgress.stateNode = current.stateNode; - - { - // DEV-only fields - workInProgress._debugID = current._debugID; - workInProgress._debugSource = current._debugSource; - workInProgress._debugOwner = current._debugOwner; - } - - workInProgress.alternate = current; - current.alternate = workInProgress; - } else { - // We already have an alternate. - // Reset the effect tag. - workInProgress.effectTag = NoEffect; - - // The effect list is no longer valid. - workInProgress.nextEffect = null; - workInProgress.firstEffect = null; - workInProgress.lastEffect = null; - } - - workInProgress.expirationTime = expirationTime; - workInProgress.pendingProps = pendingProps; - - workInProgress.child = current.child; - workInProgress.memoizedProps = current.memoizedProps; - workInProgress.memoizedState = current.memoizedState; - workInProgress.updateQueue = current.updateQueue; - - // These will be overridden during the parent's reconciliation - workInProgress.sibling = current.sibling; - workInProgress.index = current.index; - workInProgress.ref = current.ref; - - return workInProgress; -} - -function createHostRootFiber() { - var fiber = createFiber(HostRoot, null, NoContext); - return fiber; -} - -function createFiberFromElement(element, internalContextTag, expirationTime) { - var owner = null; - { - owner = element._owner; - } - - var fiber = void 0; - var type = element.type, - key = element.key; - - if (typeof type === 'function') { - fiber = shouldConstruct(type) ? createFiber(ClassComponent, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag); - fiber.type = type; - fiber.pendingProps = element.props; - } else if (typeof type === 'string') { - fiber = createFiber(HostComponent, key, internalContextTag); - fiber.type = type; - fiber.pendingProps = element.props; - } else if (typeof type === 'object' && type !== null && typeof type.tag === 'number') { - // Currently assumed to be a continuation and therefore is a fiber already. - // TODO: The yield system is currently broken for updates in some cases. - // The reified yield stores a fiber, but we don't know which fiber that is; - // the current or a workInProgress? When the continuation gets rendered here - // we don't know if we can reuse that fiber or if we need to clone it. - // There is probably a clever way to restructure this. - fiber = type; - fiber.pendingProps = element.props; - } else { - var info = ''; - { - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - var ownerName = owner ? getComponentName(owner) : null; - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - } - invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info); - } - - { - fiber._debugSource = element._source; - fiber._debugOwner = element._owner; - } - - fiber.expirationTime = expirationTime; - - return fiber; -} - -function createFiberFromFragment(elements, internalContextTag, expirationTime, key) { - var fiber = createFiber(Fragment, key, internalContextTag); - fiber.pendingProps = elements; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromText(content, internalContextTag, expirationTime) { - var fiber = createFiber(HostText, null, internalContextTag); - fiber.pendingProps = content; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromHostInstanceForDeletion() { - var fiber = createFiber(HostComponent, null, NoContext); - fiber.type = 'DELETED'; - return fiber; -} - -function createFiberFromCall(call, internalContextTag, expirationTime) { - var fiber = createFiber(CallComponent, call.key, internalContextTag); - fiber.type = call.handler; - fiber.pendingProps = call; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromReturn(returnNode, internalContextTag, expirationTime) { - var fiber = createFiber(ReturnComponent, null, internalContextTag); - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromPortal(portal, internalContextTag, expirationTime) { - var fiber = createFiber(HostPortal, portal.key, internalContextTag); - fiber.pendingProps = portal.children || []; - fiber.expirationTime = expirationTime; - fiber.stateNode = { - containerInfo: portal.containerInfo, - pendingChildren: null, // Used by persistent updates - implementation: portal.implementation - }; - return fiber; -} - -function createFiberRoot(containerInfo, hydrate) { - // Cyclic construction. This cheats the type system right now because - // stateNode is any. - var uninitializedFiber = createHostRootFiber(); - var root = { - current: uninitializedFiber, - containerInfo: containerInfo, - pendingChildren: null, - remainingExpirationTime: NoWork, - isReadyForCommit: false, - finishedWork: null, - context: null, - pendingContext: null, - hydrate: hydrate, - nextScheduledRoot: null - }; - uninitializedFiber.stateNode = root; - return root; -} - -var onCommitFiberRoot = null; -var onCommitFiberUnmount = null; -var hasLoggedError = false; - -function catchErrors(fn) { - return function (arg) { - try { - return fn(arg); - } catch (err) { - if (true && !hasLoggedError) { - hasLoggedError = true; - warning(false, 'React DevTools encountered an error: %s', err); - } - } - }; -} - -function injectInternals(internals) { - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - // No DevTools - return false; - } - var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; - if (hook.isDisabled) { - // This isn't a real property on the hook, but it can be set to opt out - // of DevTools integration and associated warnings and logs. - // https://github.com/facebook/react/issues/3877 - return true; - } - if (!hook.supportsFiber) { - { - warning(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools'); - } - // DevTools exists, even though it doesn't support Fiber. - return true; - } - try { - var rendererID = hook.inject(internals); - // We have successfully injected, so now it is safe to set up hooks. - onCommitFiberRoot = catchErrors(function (root) { - return hook.onCommitFiberRoot(rendererID, root); - }); - onCommitFiberUnmount = catchErrors(function (fiber) { - return hook.onCommitFiberUnmount(rendererID, fiber); - }); - } catch (err) { - // Catch all errors because it is unsafe to throw during initialization. - { - warning(false, 'React DevTools encountered an error: %s.', err); - } - } - // DevTools exists - return true; -} - -function onCommitRoot(root) { - if (typeof onCommitFiberRoot === 'function') { - onCommitFiberRoot(root); - } -} - -function onCommitUnmount(fiber) { - if (typeof onCommitFiberUnmount === 'function') { - onCommitFiberUnmount(fiber); - } -} - -{ - var didWarnUpdateInsideUpdate = false; -} - -// Callbacks are not validated until invocation - - -// Singly linked-list of updates. When an update is scheduled, it is added to -// the queue of the current fiber and the work-in-progress fiber. The two queues -// are separate but they share a persistent structure. -// -// During reconciliation, updates are removed from the work-in-progress fiber, -// but they remain on the current fiber. That ensures that if a work-in-progress -// is aborted, the aborted updates are recovered by cloning from current. -// -// The work-in-progress queue is always a subset of the current queue. -// -// When the tree is committed, the work-in-progress becomes the current. - - -function createUpdateQueue(baseState) { - var queue = { - baseState: baseState, - expirationTime: NoWork, - first: null, - last: null, - callbackList: null, - hasForceUpdate: false, - isInitialized: false - }; - { - queue.isProcessing = false; - } - return queue; -} - -function insertUpdateIntoQueue(queue, update) { - // Append the update to the end of the list. - if (queue.last === null) { - // Queue is empty - queue.first = queue.last = update; - } else { - queue.last.next = update; - queue.last = update; - } - if (queue.expirationTime === NoWork || queue.expirationTime > update.expirationTime) { - queue.expirationTime = update.expirationTime; - } -} - -function insertUpdateIntoFiber(fiber, update) { - // We'll have at least one and at most two distinct update queues. - var alternateFiber = fiber.alternate; - var queue1 = fiber.updateQueue; - if (queue1 === null) { - // TODO: We don't know what the base state will be until we begin work. - // It depends on which fiber is the next current. Initialize with an empty - // base state, then set to the memoizedState when rendering. Not super - // happy with this approach. - queue1 = fiber.updateQueue = createUpdateQueue(null); - } - - var queue2 = void 0; - if (alternateFiber !== null) { - queue2 = alternateFiber.updateQueue; - if (queue2 === null) { - queue2 = alternateFiber.updateQueue = createUpdateQueue(null); - } - } else { - queue2 = null; - } - queue2 = queue2 !== queue1 ? queue2 : null; - - // Warn if an update is scheduled from inside an updater function. - { - if ((queue1.isProcessing || queue2 !== null && queue2.isProcessing) && !didWarnUpdateInsideUpdate) { - warning(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); - didWarnUpdateInsideUpdate = true; - } - } - - // If there's only one queue, add the update to that queue and exit. - if (queue2 === null) { - insertUpdateIntoQueue(queue1, update); - return; - } - - // If either queue is empty, we need to add to both queues. - if (queue1.last === null || queue2.last === null) { - insertUpdateIntoQueue(queue1, update); - insertUpdateIntoQueue(queue2, update); - return; - } - - // If both lists are not empty, the last update is the same for both lists - // because of structural sharing. So, we should only append to one of - // the lists. - insertUpdateIntoQueue(queue1, update); - // But we still need to update the `last` pointer of queue2. - queue2.last = update; -} - -function getUpdateExpirationTime(fiber) { - if (fiber.tag !== ClassComponent && fiber.tag !== HostRoot) { - return NoWork; - } - var updateQueue = fiber.updateQueue; - if (updateQueue === null) { - return NoWork; - } - return updateQueue.expirationTime; -} - -function getStateFromUpdate(update, instance, prevState, props) { - var partialState = update.partialState; - if (typeof partialState === 'function') { - var updateFn = partialState; - - // Invoke setState callback an extra time to help detect side-effects. - if (debugRenderPhaseSideEffects) { - updateFn.call(instance, prevState, props); - } - - return updateFn.call(instance, prevState, props); - } else { - return partialState; - } -} - -function processUpdateQueue(current, workInProgress, queue, instance, props, renderExpirationTime) { - if (current !== null && current.updateQueue === queue) { - // We need to create a work-in-progress queue, by cloning the current queue. - var currentQueue = queue; - queue = workInProgress.updateQueue = { - baseState: currentQueue.baseState, - expirationTime: currentQueue.expirationTime, - first: currentQueue.first, - last: currentQueue.last, - isInitialized: currentQueue.isInitialized, - // These fields are no longer valid because they were already committed. - // Reset them. - callbackList: null, - hasForceUpdate: false - }; - } - - { - // Set this flag so we can warn if setState is called inside the update - // function of another setState. - queue.isProcessing = true; - } - - // Reset the remaining expiration time. If we skip over any updates, we'll - // increase this accordingly. - queue.expirationTime = NoWork; - - // TODO: We don't know what the base state will be until we begin work. - // It depends on which fiber is the next current. Initialize with an empty - // base state, then set to the memoizedState when rendering. Not super - // happy with this approach. - var state = void 0; - if (queue.isInitialized) { - state = queue.baseState; - } else { - state = queue.baseState = workInProgress.memoizedState; - queue.isInitialized = true; - } - var dontMutatePrevState = true; - var update = queue.first; - var didSkip = false; - while (update !== null) { - var updateExpirationTime = update.expirationTime; - if (updateExpirationTime > renderExpirationTime) { - // This update does not have sufficient priority. Skip it. - var remainingExpirationTime = queue.expirationTime; - if (remainingExpirationTime === NoWork || remainingExpirationTime > updateExpirationTime) { - // Update the remaining expiration time. - queue.expirationTime = updateExpirationTime; - } - if (!didSkip) { - didSkip = true; - queue.baseState = state; - } - // Continue to the next update. - update = update.next; - continue; - } - - // This update does have sufficient priority. - - // If no previous updates were skipped, drop this update from the queue by - // advancing the head of the list. - if (!didSkip) { - queue.first = update.next; - if (queue.first === null) { - queue.last = null; - } - } - - // Process the update - var _partialState = void 0; - if (update.isReplace) { - state = getStateFromUpdate(update, instance, state, props); - dontMutatePrevState = true; - } else { - _partialState = getStateFromUpdate(update, instance, state, props); - if (_partialState) { - if (dontMutatePrevState) { - // $FlowFixMe: Idk how to type this properly. - state = _assign({}, state, _partialState); - } else { - state = _assign(state, _partialState); - } - dontMutatePrevState = false; - } - } - if (update.isForced) { - queue.hasForceUpdate = true; - } - if (update.callback !== null) { - // Append to list of callbacks. - var _callbackList = queue.callbackList; - if (_callbackList === null) { - _callbackList = queue.callbackList = []; - } - _callbackList.push(update); - } - update = update.next; - } - - if (queue.callbackList !== null) { - workInProgress.effectTag |= Callback; - } else if (queue.first === null && !queue.hasForceUpdate) { - // The queue is empty. We can reset it. - workInProgress.updateQueue = null; - } - - if (!didSkip) { - didSkip = true; - queue.baseState = state; - } - - { - // No longer processing. - queue.isProcessing = false; - } - - return state; -} - -function commitCallbacks(queue, context) { - var callbackList = queue.callbackList; - if (callbackList === null) { - return; - } - // Set the list to null to make sure they don't get called more than once. - queue.callbackList = null; - for (var i = 0; i < callbackList.length; i++) { - var update = callbackList[i]; - var _callback = update.callback; - // This update might be processed again. Clear the callback so it's only - // called once. - update.callback = null; - !(typeof _callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback) : void 0; - _callback.call(context); - } -} - -var fakeInternalInstance = {}; -var isArray = Array.isArray; - -{ - var didWarnAboutStateAssignmentForComponent = {}; - - var warnOnInvalidCallback = function (callback, callerName) { - warning(callback === null || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); - }; - - // This is so gross but it's at least non-critical and can be removed if - // it causes problems. This is meant to give a nicer error message for - // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, - // ...)) which otherwise throws a "_processChildContext is not a function" - // exception. - Object.defineProperty(fakeInternalInstance, '_processChildContext', { - enumerable: false, - value: function () { - invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'); - } - }); - Object.freeze(fakeInternalInstance); -} - -var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) { - // Class component state updater - var updater = { - isMounted: isMounted, - enqueueSetState: function (instance, partialState, callback) { - var fiber = get(instance); - callback = callback === undefined ? null : callback; - { - warnOnInvalidCallback(callback, 'setState'); - } - var expirationTime = computeExpirationForFiber(fiber); - var update = { - expirationTime: expirationTime, - partialState: partialState, - callback: callback, - isReplace: false, - isForced: false, - nextCallback: null, - next: null - }; - insertUpdateIntoFiber(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueReplaceState: function (instance, state, callback) { - var fiber = get(instance); - callback = callback === undefined ? null : callback; - { - warnOnInvalidCallback(callback, 'replaceState'); - } - var expirationTime = computeExpirationForFiber(fiber); - var update = { - expirationTime: expirationTime, - partialState: state, - callback: callback, - isReplace: true, - isForced: false, - nextCallback: null, - next: null - }; - insertUpdateIntoFiber(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueForceUpdate: function (instance, callback) { - var fiber = get(instance); - callback = callback === undefined ? null : callback; - { - warnOnInvalidCallback(callback, 'forceUpdate'); - } - var expirationTime = computeExpirationForFiber(fiber); - var update = { - expirationTime: expirationTime, - partialState: null, - callback: callback, - isReplace: false, - isForced: true, - nextCallback: null, - next: null - }; - insertUpdateIntoFiber(fiber, update); - scheduleWork(fiber, expirationTime); - } - }; - - function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { - if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) { - // If the workInProgress already has an Update effect, return true - return true; - } - - var instance = workInProgress.stateNode; - var type = workInProgress.type; - if (typeof instance.shouldComponentUpdate === 'function') { - startPhaseTimer(workInProgress, 'shouldComponentUpdate'); - var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { - instance.shouldComponentUpdate(newProps, newState, newContext); - } - - { - warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown'); - } - - return shouldUpdate; - } - - if (type.prototype && type.prototype.isPureReactComponent) { - return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); - } - - return true; - } - - function checkClassInstance(workInProgress) { - var instance = workInProgress.stateNode; - var type = workInProgress.type; - { - var name = getComponentName(workInProgress); - var renderPresent = instance.render; - - if (!renderPresent) { - if (type.prototype && typeof type.prototype.render === 'function') { - warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); - } else { - warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); - } - } - - var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; - warning(noGetInitialStateOnES6, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name); - var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; - warning(noGetDefaultPropsOnES6, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name); - var noInstancePropTypes = !instance.propTypes; - warning(noInstancePropTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name); - var noInstanceContextTypes = !instance.contextTypes; - warning(noInstanceContextTypes, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name); - var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function'; - warning(noComponentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name); - if (type.prototype && type.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { - warning(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(workInProgress) || 'A pure component'); - } - var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function'; - warning(noComponentDidUnmount, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name); - var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function'; - warning(noComponentDidReceiveProps, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name); - var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; - warning(noComponentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name); - var hasMutatedProps = instance.props !== workInProgress.pendingProps; - warning(instance.props === undefined || !hasMutatedProps, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name); - var noInstanceDefaultProps = !instance.defaultProps; - warning(noInstanceDefaultProps, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name); - } - - var state = instance.state; - if (state && (typeof state !== 'object' || isArray(state))) { - warning(false, '%s.state: must be set to an object or null', getComponentName(workInProgress)); - } - if (typeof instance.getChildContext === 'function') { - warning(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress)); - } - } - - function resetInputPointers(workInProgress, instance) { - instance.props = workInProgress.memoizedProps; - instance.state = workInProgress.memoizedState; - } - - function adoptClassInstance(workInProgress, instance) { - instance.updater = updater; - workInProgress.stateNode = instance; - // The instance needs access to the fiber so that it can schedule updates - set(instance, workInProgress); - { - instance._reactInternalInstance = fakeInternalInstance; - } - } - - function constructClassInstance(workInProgress, props) { - var ctor = workInProgress.type; - var unmaskedContext = getUnmaskedContext(workInProgress); - var needsContext = isContextConsumer(workInProgress); - var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject; - var instance = new ctor(props, context); - adoptClassInstance(workInProgress, instance); - - // Cache unmasked context so we can avoid recreating masked context unless necessary. - // ReactFiberContext usually updates this cache but can't for newly-created instances. - if (needsContext) { - cacheContext(workInProgress, unmaskedContext, context); - } - - return instance; - } - - function callComponentWillMount(workInProgress, instance) { - startPhaseTimer(workInProgress, 'componentWillMount'); - var oldState = instance.state; - instance.componentWillMount(); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { - instance.componentWillMount(); - } - - if (oldState !== instance.state) { - { - warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress)); - } - updater.enqueueReplaceState(instance, instance.state, null); - } - } - - function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { - startPhaseTimer(workInProgress, 'componentWillReceiveProps'); - var oldState = instance.state; - instance.componentWillReceiveProps(newProps, newContext); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { - instance.componentWillReceiveProps(newProps, newContext); - } - - if (instance.state !== oldState) { - { - var componentName = getComponentName(workInProgress) || 'Component'; - if (!didWarnAboutStateAssignmentForComponent[componentName]) { - warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); - didWarnAboutStateAssignmentForComponent[componentName] = true; - } - } - updater.enqueueReplaceState(instance, instance.state, null); - } - } - - // Invokes the mount life-cycles on a previously never rendered instance. - function mountClassInstance(workInProgress, renderExpirationTime) { - var current = workInProgress.alternate; - - { - checkClassInstance(workInProgress); - } - - var instance = workInProgress.stateNode; - var state = instance.state || null; - - var props = workInProgress.pendingProps; - !props ? invariant(false, 'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - var unmaskedContext = getUnmaskedContext(workInProgress); - - instance.props = props; - instance.state = workInProgress.memoizedState = state; - instance.refs = emptyObject; - instance.context = getMaskedContext(workInProgress, unmaskedContext); - - if (enableAsyncSubtreeAPI && workInProgress.type != null && workInProgress.type.prototype != null && workInProgress.type.prototype.unstable_isAsyncReactComponent === true) { - workInProgress.internalContextTag |= AsyncUpdates; - } - - if (typeof instance.componentWillMount === 'function') { - callComponentWillMount(workInProgress, instance); - // If we had additional state updates during this life-cycle, let's - // process them now. - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime); - } - } - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; - } - } - - // Called on a preexisting class instance. Returns false if a resumed render - // could be reused. - // function resumeMountClassInstance( - // workInProgress: Fiber, - // priorityLevel: PriorityLevel, - // ): boolean { - // const instance = workInProgress.stateNode; - // resetInputPointers(workInProgress, instance); - - // let newState = workInProgress.memoizedState; - // let newProps = workInProgress.pendingProps; - // if (!newProps) { - // // If there isn't any new props, then we'll reuse the memoized props. - // // This could be from already completed work. - // newProps = workInProgress.memoizedProps; - // invariant( - // newProps != null, - // 'There should always be pending or memoized props. This error is ' + - // 'likely caused by a bug in React. Please file an issue.', - // ); - // } - // const newUnmaskedContext = getUnmaskedContext(workInProgress); - // const newContext = getMaskedContext(workInProgress, newUnmaskedContext); - - // const oldContext = instance.context; - // const oldProps = workInProgress.memoizedProps; - - // if ( - // typeof instance.componentWillReceiveProps === 'function' && - // (oldProps !== newProps || oldContext !== newContext) - // ) { - // callComponentWillReceiveProps( - // workInProgress, - // instance, - // newProps, - // newContext, - // ); - // } - - // // Process the update queue before calling shouldComponentUpdate - // const updateQueue = workInProgress.updateQueue; - // if (updateQueue !== null) { - // newState = processUpdateQueue( - // workInProgress, - // updateQueue, - // instance, - // newState, - // newProps, - // priorityLevel, - // ); - // } - - // // TODO: Should we deal with a setState that happened after the last - // // componentWillMount and before this componentWillMount? Probably - // // unsupported anyway. - - // if ( - // !checkShouldComponentUpdate( - // workInProgress, - // workInProgress.memoizedProps, - // newProps, - // workInProgress.memoizedState, - // newState, - // newContext, - // ) - // ) { - // // Update the existing instance's state, props, and context pointers even - // // though we're bailing out. - // instance.props = newProps; - // instance.state = newState; - // instance.context = newContext; - // return false; - // } - - // // Update the input pointers now so that they are correct when we call - // // componentWillMount - // instance.props = newProps; - // instance.state = newState; - // instance.context = newContext; - - // if (typeof instance.componentWillMount === 'function') { - // callComponentWillMount(workInProgress, instance); - // // componentWillMount may have called setState. Process the update queue. - // const newUpdateQueue = workInProgress.updateQueue; - // if (newUpdateQueue !== null) { - // newState = processUpdateQueue( - // workInProgress, - // newUpdateQueue, - // instance, - // newState, - // newProps, - // priorityLevel, - // ); - // } - // } - - // if (typeof instance.componentDidMount === 'function') { - // workInProgress.effectTag |= Update; - // } - - // instance.state = newState; - - // return true; - // } - - // Invokes the update life-cycles and returns false if it shouldn't rerender. - function updateClassInstance(current, workInProgress, renderExpirationTime) { - var instance = workInProgress.stateNode; - resetInputPointers(workInProgress, instance); - - var oldProps = workInProgress.memoizedProps; - var newProps = workInProgress.pendingProps; - if (!newProps) { - // If there aren't any new props, then we'll reuse the memoized props. - // This could be from already completed work. - newProps = oldProps; - !(newProps != null) ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - var oldContext = instance.context; - var newUnmaskedContext = getUnmaskedContext(workInProgress); - var newContext = getMaskedContext(workInProgress, newUnmaskedContext); - - // Note: During these life-cycles, instance.props/instance.state are what - // ever the previously attempted to render - not the "current". However, - // during componentDidUpdate we pass the "current" props. - - if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) { - callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); - } - - // Compute the next state using the memoized state and the update queue. - var oldState = workInProgress.memoizedState; - // TODO: Previous state can be null. - var newState = void 0; - if (workInProgress.updateQueue !== null) { - newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime); - } else { - newState = oldState; - } - - if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } - } - return false; - } - - var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); - - if (shouldUpdate) { - if (typeof instance.componentWillUpdate === 'function') { - startPhaseTimer(workInProgress, 'componentWillUpdate'); - instance.componentWillUpdate(newProps, newState, newContext); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { - instance.componentWillUpdate(newProps, newState, newContext); - } - } - if (typeof instance.componentDidUpdate === 'function') { - workInProgress.effectTag |= Update; - } - } else { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } - } - - // If shouldComponentUpdate returned false, we should still update the - // memoized props/state to indicate that this work can be reused. - memoizeProps(workInProgress, newProps); - memoizeState(workInProgress, newState); - } - - // Update the existing instance's state, props, and context pointers even - // if shouldComponentUpdate returns false. - instance.props = newProps; - instance.state = newState; - instance.context = newContext; - - return shouldUpdate; - } - - return { - adoptClassInstance: adoptClassInstance, - constructClassInstance: constructClassInstance, - mountClassInstance: mountClassInstance, - // resumeMountClassInstance, - updateClassInstance: updateClassInstance - }; -}; - -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var hasSymbol = typeof Symbol === 'function' && Symbol['for']; - -var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7; -var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8; -var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9; -var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca; -var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb; - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; - -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable === 'undefined') { - return null; - } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - return null; -} - -var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; - - -{ - var didWarnAboutMaps = false; - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - var ownerHasKeyUseWarning = {}; - var ownerHasFunctionTypeWarning = {}; - - var warnForMissingKey = function (child) { - if (child === null || typeof child !== 'object') { - return; - } - if (!child._store || child._store.validated || child.key != null) { - return; - } - !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; - child._store.validated = true; - - var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + (getCurrentFiberStackAddendum$1() || ''); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; - - warning(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.%s', getCurrentFiberStackAddendum$1()); - }; -} - -var isArray$1 = Array.isArray; - -function coerceRef(current, element) { - var mixedRef = element.ref; - if (mixedRef !== null && typeof mixedRef !== 'function') { - if (element._owner) { - var owner = element._owner; - var inst = void 0; - if (owner) { - var ownerFiber = owner; - !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Stateless function components cannot have refs.') : void 0; - inst = ownerFiber.stateNode; - } - !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0; - var stringRef = '' + mixedRef; - // Check if previous string ref matches new string ref - if (current !== null && current.ref !== null && current.ref._stringRef === stringRef) { - return current.ref; - } - var ref = function (value) { - var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; - if (value === null) { - delete refs[stringRef]; - } else { - refs[stringRef] = value; - } - }; - ref._stringRef = stringRef; - return ref; - } else { - !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function or a string.') : void 0; - !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).', mixedRef) : void 0; - } - } - return mixedRef; -} - -function throwOnInvalidObjectType(returnFiber, newChild) { - if (returnFiber.type !== 'textarea') { - var addendum = ''; - { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + (getCurrentFiberStackAddendum$1() || ''); - } - invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum); - } -} - -function warnOnFunctionType() { - var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + (getCurrentFiberStackAddendum$1() || ''); - - if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { - return; - } - ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; - - warning(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.%s', getCurrentFiberStackAddendum$1() || ''); -} - -// This wrapper function exists because I expect to clone the code in each path -// to be able to optimize each path individually by branching early. This needs -// a compiler or we can do it manually. Helpers that don't need this branching -// live outside of this function. -function ChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (!shouldTrackSideEffects) { - // Noop. - return; - } - // Deletions are added in reversed order so we add it to the front. - // At this point, the return fiber's effect list is empty except for - // deletions, so we can just append the deletion to the list. The remaining - // effects aren't added until the complete phase. Once we implement - // resuming, this may not be true. - var last = returnFiber.lastEffect; - if (last !== null) { - last.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; - } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; - } - childToDelete.nextEffect = null; - childToDelete.effectTag = Deletion; - } - - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) { - // Noop. - return null; - } - - // TODO: For the shouldClone case, this could be micro-optimized a bit by - // assuming that after the first child we've already added everything. - var childToDelete = currentFirstChild; - while (childToDelete !== null) { - deleteChild(returnFiber, childToDelete); - childToDelete = childToDelete.sibling; - } - return null; - } - - function mapRemainingChildren(returnFiber, currentFirstChild) { - // Add the remaining children to a temporary map so that we can find them by - // keys quickly. Implicit (null) keys get added to this set with their index - var existingChildren = new Map(); - - var existingChild = currentFirstChild; - while (existingChild !== null) { - if (existingChild.key !== null) { - existingChildren.set(existingChild.key, existingChild); - } else { - existingChildren.set(existingChild.index, existingChild); - } - existingChild = existingChild.sibling; - } - return existingChildren; - } - - function useFiber(fiber, pendingProps, expirationTime) { - // We currently set sibling to null and index to 0 here because it is easy - // to forget to do before returning it. E.g. for the single child case. - var clone = createWorkInProgress(fiber, pendingProps, expirationTime); - clone.index = 0; - clone.sibling = null; - return clone; - } - - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) { - // Noop. - return lastPlacedIndex; - } - var current = newFiber.alternate; - if (current !== null) { - var oldIndex = current.index; - if (oldIndex < lastPlacedIndex) { - // This is a move. - newFiber.effectTag = Placement; - return lastPlacedIndex; - } else { - // This item can stay in place. - return oldIndex; - } - } else { - // This is an insertion. - newFiber.effectTag = Placement; - return lastPlacedIndex; - } - } - - function placeSingleChild(newFiber) { - // This is simpler for the single child case. We only need to do a - // placement for inserting new children. - if (shouldTrackSideEffects && newFiber.alternate === null) { - newFiber.effectTag = Placement; - } - return newFiber; - } - - function updateTextNode(returnFiber, current, textContent, expirationTime) { - if (current === null || current.tag !== HostText) { - // Insert - var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current, textContent, expirationTime); - existing['return'] = returnFiber; - return existing; - } - } - - function updateElement(returnFiber, current, element, expirationTime) { - if (current !== null && current.type === element.type) { - // Move based on index - var existing = useFiber(current, element.props, expirationTime); - existing.ref = coerceRef(current, element); - existing['return'] = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - // Insert - var created = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime); - created.ref = coerceRef(current, element); - created['return'] = returnFiber; - return created; - } - } - - function updateCall(returnFiber, current, call, expirationTime) { - // TODO: Should this also compare handler to determine whether to reuse? - if (current === null || current.tag !== CallComponent) { - // Insert - var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } else { - // Move based on index - var existing = useFiber(current, call, expirationTime); - existing['return'] = returnFiber; - return existing; - } - } - - function updateReturn(returnFiber, current, returnNode, expirationTime) { - if (current === null || current.tag !== ReturnComponent) { - // Insert - var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime); - created.type = returnNode.value; - created['return'] = returnFiber; - return created; - } else { - // Move based on index - var existing = useFiber(current, null, expirationTime); - existing.type = returnNode.value; - existing['return'] = returnFiber; - return existing; - } - } - - function updatePortal(returnFiber, current, portal, expirationTime) { - if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { - // Insert - var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current, portal.children || [], expirationTime); - existing['return'] = returnFiber; - return existing; - } - } - - function updateFragment(returnFiber, current, fragment, expirationTime, key) { - if (current === null || current.tag !== Fragment) { - // Insert - var created = createFiberFromFragment(fragment, returnFiber.internalContextTag, expirationTime, key); - created['return'] = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current, fragment, expirationTime); - existing['return'] = returnFiber; - return existing; - } - } - - function createChild(returnFiber, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - var created = createFiberFromText('' + newChild, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } - - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - if (newChild.type === REACT_FRAGMENT_TYPE) { - var _created = createFiberFromFragment(newChild.props.children, returnFiber.internalContextTag, expirationTime, newChild.key); - _created['return'] = returnFiber; - return _created; - } else { - var _created2 = createFiberFromElement(newChild, returnFiber.internalContextTag, expirationTime); - _created2.ref = coerceRef(null, newChild); - _created2['return'] = returnFiber; - return _created2; - } - } - - case REACT_CALL_TYPE: - { - var _created3 = createFiberFromCall(newChild, returnFiber.internalContextTag, expirationTime); - _created3['return'] = returnFiber; - return _created3; - } - - case REACT_RETURN_TYPE: - { - var _created4 = createFiberFromReturn(newChild, returnFiber.internalContextTag, expirationTime); - _created4.type = newChild.value; - _created4['return'] = returnFiber; - return _created4; - } - - case REACT_PORTAL_TYPE: - { - var _created5 = createFiberFromPortal(newChild, returnFiber.internalContextTag, expirationTime); - _created5['return'] = returnFiber; - return _created5; - } - } - - if (isArray$1(newChild) || getIteratorFn(newChild)) { - var _created6 = createFiberFromFragment(newChild, returnFiber.internalContextTag, expirationTime, null); - _created6['return'] = returnFiber; - return _created6; - } - - throwOnInvalidObjectType(returnFiber, newChild); - } - - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - - return null; - } - - function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { - // Update the fiber if the keys match, otherwise return null. - - var key = oldFiber !== null ? oldFiber.key : null; - - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - if (key !== null) { - return null; - } - return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); - } - - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - if (newChild.key === key) { - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); - } - return updateElement(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - - case REACT_CALL_TYPE: - { - if (newChild.key === key) { - return updateCall(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - - case REACT_RETURN_TYPE: - { - // Returns don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a - // yield. - if (key === null) { - return updateReturn(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - - case REACT_PORTAL_TYPE: - { - if (newChild.key === key) { - return updatePortal(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - } - - if (isArray$1(newChild) || getIteratorFn(newChild)) { - if (key !== null) { - return null; - } - - return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); - } - - throwOnInvalidObjectType(returnFiber, newChild); - } - - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - - return null; - } - - function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys, so we neither have to check the old nor - // new node for the key. If both are text nodes, they match. - var matchedFiber = existingChildren.get(newIdx) || null; - return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); - } - - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); - } - return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); - } - - case REACT_CALL_TYPE: - { - var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updateCall(returnFiber, _matchedFiber2, newChild, expirationTime); - } - - case REACT_RETURN_TYPE: - { - // Returns don't have keys, so we neither have to check the old nor - // new node for the key. If both are returns, they match. - var _matchedFiber3 = existingChildren.get(newIdx) || null; - return updateReturn(returnFiber, _matchedFiber3, newChild, expirationTime); - } - - case REACT_PORTAL_TYPE: - { - var _matchedFiber4 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updatePortal(returnFiber, _matchedFiber4, newChild, expirationTime); - } - } - - if (isArray$1(newChild) || getIteratorFn(newChild)) { - var _matchedFiber5 = existingChildren.get(newIdx) || null; - return updateFragment(returnFiber, _matchedFiber5, newChild, expirationTime, null); - } - - throwOnInvalidObjectType(returnFiber, newChild); - } - - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - - return null; - } - - /** - * Warns if there is a duplicate or missing key - */ - function warnOnInvalidKey(child, knownKeys) { - { - if (typeof child !== 'object' || child === null) { - return knownKeys; - } - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_CALL_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(child); - var key = child.key; - if (typeof key !== 'string') { - break; - } - if (knownKeys === null) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - warning(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.%s', key, getCurrentFiberStackAddendum$1()); - break; - default: - break; - } - } - return knownKeys; - } - - function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { - // This algorithm can't optimize by searching from boths ends since we - // don't have backpointers on fibers. I'm trying to see how far we can get - // with that model. If it ends up not being worth the tradeoffs, we can - // add it later. - - // Even with a two ended optimization, we'd want to optimize for the case - // where there are few changes and brute force the comparison instead of - // going for the Map. It'd like to explore hitting that path first in - // forward-only mode and only go for the Map once we notice that we need - // lots of look ahead. This doesn't handle reversal as well as two ended - // search but that's unusual. Besides, for the two ended optimization to - // work on Iterables, we'd need to copy the whole set. - - // In this first iteration, we'll just live with hitting the bad case - // (adding everything to a Map) in for every insert/move. - - // If you change this code, also update reconcileChildrenIterator() which - // uses the same algorithm. - - { - // First, validate keys. - var knownKeys = null; - for (var i = 0; i < newChildren.length; i++) { - var child = newChildren[i]; - knownKeys = warnOnInvalidKey(child, knownKeys); - } - } - - var resultingFirstChild = null; - var previousNewFiber = null; - - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; - for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (oldFiber === null) { - oldFiber = nextOldFiber; - } - break; - } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } - } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; - } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - - if (newIdx === newChildren.length) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; - } - - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); - if (!_newFiber) { - continue; - } - lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber; - } else { - previousNewFiber.sibling = _newFiber; - } - previousNewFiber = _newFiber; - } - return resultingFirstChild; - } - - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); - if (_newFiber2) { - if (shouldTrackSideEffects) { - if (_newFiber2.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren['delete'](_newFiber2.key === null ? newIdx : _newFiber2.key); - } - } - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber2; - } else { - previousNewFiber.sibling = _newFiber2; - } - previousNewFiber = _newFiber2; - } - } - - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - } - - return resultingFirstChild; - } - - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { - // This is the same implementation as reconcileChildrenArray(), - // but using the iterator instead. - - var iteratorFn = getIteratorFn(newChildrenIterable); - !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - { - // Warn about using Maps as children - if (typeof newChildrenIterable.entries === 'function') { - var possibleMap = newChildrenIterable; - if (possibleMap.entries === iteratorFn) { - warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$1()); - didWarnAboutMaps = true; - } - } - - // First, validate keys. - // We'll get a different iterator later for the main pass. - var _newChildren = iteratorFn.call(newChildrenIterable); - if (_newChildren) { - var knownKeys = null; - var _step = _newChildren.next(); - for (; !_step.done; _step = _newChildren.next()) { - var child = _step.value; - knownKeys = warnOnInvalidKey(child, knownKeys); - } - } - } - - var newChildren = iteratorFn.call(newChildrenIterable); - !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0; - - var resultingFirstChild = null; - var previousNewFiber = null; - - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; - - var step = newChildren.next(); - for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (!oldFiber) { - oldFiber = nextOldFiber; - } - break; - } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } - } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; - } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - - if (step.done) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; - } - - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber3 = createChild(returnFiber, step.value, expirationTime); - if (_newFiber3 === null) { - continue; - } - lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber3; - } else { - previousNewFiber.sibling = _newFiber3; - } - previousNewFiber = _newFiber3; - } - return resultingFirstChild; - } - - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); - if (_newFiber4 !== null) { - if (shouldTrackSideEffects) { - if (_newFiber4.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren['delete'](_newFiber4.key === null ? newIdx : _newFiber4.key); - } - } - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber4; - } else { - previousNewFiber.sibling = _newFiber4; - } - previousNewFiber = _newFiber4; - } - } - - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - } - - return resultingFirstChild; - } - - function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { - // There's no need to check for keys on text nodes since we don't have a - // way to define them. - if (currentFirstChild !== null && currentFirstChild.tag === HostText) { - // We already have an existing node so let's just update it and delete - // the rest. - deleteRemainingChildren(returnFiber, currentFirstChild.sibling); - var existing = useFiber(currentFirstChild, textContent, expirationTime); - existing['return'] = returnFiber; - return existing; - } - // The existing first child is not a text node so we need to create one - // and delete the existing ones. - deleteRemainingChildren(returnFiber, currentFirstChild); - var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } - - function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { - var key = element.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); - existing.ref = coerceRef(child, element); - existing['return'] = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - if (element.type === REACT_FRAGMENT_TYPE) { - var created = createFiberFromFragment(element.props.children, returnFiber.internalContextTag, expirationTime, element.key); - created['return'] = returnFiber; - return created; - } else { - var _created7 = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime); - _created7.ref = coerceRef(currentFirstChild, element); - _created7['return'] = returnFiber; - return _created7; - } - } - - function reconcileSingleCall(returnFiber, currentFirstChild, call, expirationTime) { - var key = call.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === CallComponent) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, call, expirationTime); - existing['return'] = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } - - function reconcileSingleReturn(returnFiber, currentFirstChild, returnNode, expirationTime) { - // There's no need to check for keys on yields since they're stateless. - var child = currentFirstChild; - if (child !== null) { - if (child.tag === ReturnComponent) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, null, expirationTime); - existing.type = returnNode.value; - existing['return'] = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - } - } - - var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime); - created.type = returnNode.value; - created['return'] = returnFiber; - return created; - } - - function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { - var key = portal.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, portal.children || [], expirationTime); - existing['return'] = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } - - // This API will tag the children with the side-effect of the reconciliation - // itself. They will be added to the side-effect list as we pass through the - // children and the parent. - function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { - // This function is not recursive. - // If the top level item is an array, we treat it as a set of children, - // not as a fragment. Nested arrays on the other hand will be treated as - // fragment nodes. Recursion happens at the normal flow. - - // Handle top level unkeyed fragments as if they were arrays. - // This leads to an ambiguity between <>{[...]} and <>.... - // We treat the ambiguous cases above the same. - if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) { - newChild = newChild.props.children; - } - - // Handle object types - var isObject = typeof newChild === 'object' && newChild !== null; - - if (isObject) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); - - case REACT_CALL_TYPE: - return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime)); - case REACT_RETURN_TYPE: - return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime)); - case REACT_PORTAL_TYPE: - return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); - } - } - - if (typeof newChild === 'string' || typeof newChild === 'number') { - return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); - } - - if (isArray$1(newChild)) { - return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); - } - - if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); - } - - if (isObject) { - throwOnInvalidObjectType(returnFiber, newChild); - } - - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - if (typeof newChild === 'undefined') { - // If the new child is undefined, and the return fiber is a composite - // component, throw an error. If Fiber return types are disabled, - // we already threw above. - switch (returnFiber.tag) { - case ClassComponent: - { - { - var instance = returnFiber.stateNode; - if (instance.render._isMockFunction) { - // We allow auto-mocks to proceed as if they're returning null. - break; - } - } - } - // Intentionally fall through to the next case, which handles both - // functions and classes - // eslint-disable-next-lined no-fallthrough - case FunctionalComponent: - { - var Component = returnFiber.type; - invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component'); - } - } - } - - // Remaining cases are all treated as empty. - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - - return reconcileChildFibers; -} - -var reconcileChildFibers = ChildReconciler(true); -var mountChildFibers = ChildReconciler(false); - -function cloneChildFibers(current, workInProgress) { - !(current === null || workInProgress.child === current.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; - - if (workInProgress.child === null) { - return; - } - - var currentChild = workInProgress.child; - var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - workInProgress.child = newChild; - - newChild['return'] = workInProgress; - while (currentChild.sibling !== null) { - currentChild = currentChild.sibling; - newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - newChild['return'] = workInProgress; - } - newChild.sibling = null; -} - -{ - var warnedAboutStatelessRefs = {}; -} - -var ReactFiberBeginWork = function (config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber) { - var shouldSetTextContent = config.shouldSetTextContent, - useSyncScheduling = config.useSyncScheduling, - shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree; - var pushHostContext = hostContext.pushHostContext, - pushHostContainer = hostContext.pushHostContainer; - var enterHydrationState = hydrationContext.enterHydrationState, - resetHydrationState = hydrationContext.resetHydrationState, - tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance; - - var _ReactFiberClassCompo = ReactFiberClassComponent(scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState), - adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, - constructClassInstance = _ReactFiberClassCompo.constructClassInstance, - mountClassInstance = _ReactFiberClassCompo.mountClassInstance, - updateClassInstance = _ReactFiberClassCompo.updateClassInstance; - - // TODO: Remove this and use reconcileChildrenAtExpirationTime directly. - - - function reconcileChildren(current, workInProgress, nextChildren) { - reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime); - } - - function reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime) { - if (current === null) { - // If this is a fresh new component that hasn't been rendered yet, we - // won't update its child set by applying minimal side-effects. Instead, - // we will add them all to the child before it gets rendered. That means - // we can optimize this reconciliation pass by not tracking side-effects. - workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); - } else { - // If the current child is the same as the work in progress, it means that - // we haven't yet started any work on these children. Therefore, we use - // the clone algorithm to create a copy of all the current children. - - // If we had any progressed work already, that is invalid at this point so - // let's throw it out. - workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime); - } - } - - function updateFragment(current, workInProgress) { - var nextChildren = workInProgress.pendingProps; - if (hasContextChanged()) { - // Normally we can bail out on props equality but if context has changed - // we don't do the bailout and we have to reuse existing props instead. - if (nextChildren === null) { - nextChildren = workInProgress.memoizedProps; - } - } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - reconcileChildren(current, workInProgress, nextChildren); - memoizeProps(workInProgress, nextChildren); - return workInProgress.child; - } - - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (ref !== null && (!current || current.ref !== ref)) { - // Schedule a Ref effect - workInProgress.effectTag |= Ref; - } - } - - function updateFunctionalComponent(current, workInProgress) { - var fn = workInProgress.type; - var nextProps = workInProgress.pendingProps; - - var memoizedProps = workInProgress.memoizedProps; - if (hasContextChanged()) { - // Normally we can bail out on props equality but if context has changed - // we don't do the bailout and we have to reuse existing props instead. - if (nextProps === null) { - nextProps = memoizedProps; - } - } else { - if (nextProps === null || memoizedProps === nextProps) { - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - // TODO: consider bringing fn.shouldComponentUpdate() back. - // It used to be here. - } - - var unmaskedContext = getUnmaskedContext(workInProgress); - var context = getMaskedContext(workInProgress, unmaskedContext); - - var nextChildren; - - { - ReactCurrentOwner.current = workInProgress; - ReactDebugCurrentFiber.setCurrentPhase('render'); - nextChildren = fn(nextProps, context); - ReactDebugCurrentFiber.setCurrentPhase(null); - } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current, workInProgress, nextChildren); - memoizeProps(workInProgress, nextProps); - return workInProgress.child; - } - - function updateClassComponent(current, workInProgress, renderExpirationTime) { - // Push context providers early to prevent context stack mismatches. - // During mounting we don't know the child context yet as the instance doesn't exist. - // We will invalidate the child context in finishClassComponent() right after rendering. - var hasContext = pushContextProvider(workInProgress); - - var shouldUpdate = void 0; - if (current === null) { - if (!workInProgress.stateNode) { - // In the initial pass we might need to construct the instance. - constructClassInstance(workInProgress, workInProgress.pendingProps); - mountClassInstance(workInProgress, renderExpirationTime); - shouldUpdate = true; - } else { - invariant(false, 'Resuming work not yet implemented.'); - // In a resume, we'll already have an instance we can reuse. - // shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); - } - } else { - shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime); - } - return finishClassComponent(current, workInProgress, shouldUpdate, hasContext); - } - - function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { - // Refs should update even if shouldComponentUpdate returns false - markRef(current, workInProgress); - - if (!shouldUpdate) { - // Context providers should defer to sCU for rendering - if (hasContext) { - invalidateContextProvider(workInProgress, false); - } - - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - - var instance = workInProgress.stateNode; - - // Rerender - ReactCurrentOwner.current = workInProgress; - var nextChildren = void 0; - { - ReactDebugCurrentFiber.setCurrentPhase('render'); - nextChildren = instance.render(); - if (debugRenderPhaseSideEffects) { - instance.render(); - } - ReactDebugCurrentFiber.setCurrentPhase(null); - } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current, workInProgress, nextChildren); - // Memoize props and state using the values we just used to render. - // TODO: Restructure so we never read values from the instance. - memoizeState(workInProgress, instance.state); - memoizeProps(workInProgress, instance.props); - - // The context might have changed so we need to recalculate it. - if (hasContext) { - invalidateContextProvider(workInProgress, true); - } - - return workInProgress.child; - } - - function pushHostRootContext(workInProgress) { - var root = workInProgress.stateNode; - if (root.pendingContext) { - pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); - } else if (root.context) { - // Should always be set - pushTopLevelContextObject(workInProgress, root.context, false); - } - pushHostContainer(workInProgress, root.containerInfo); - } - - function updateHostRoot(current, workInProgress, renderExpirationTime) { - pushHostRootContext(workInProgress); - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - var prevState = workInProgress.memoizedState; - var state = processUpdateQueue(current, workInProgress, updateQueue, null, null, renderExpirationTime); - if (prevState === state) { - // If the state is the same as before, that's a bailout because we had - // no work that expires at this time. - resetHydrationState(); - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - var element = state.element; - var root = workInProgress.stateNode; - if ((current === null || current.child === null) && root.hydrate && enterHydrationState(workInProgress)) { - // If we don't have any current children this might be the first pass. - // We always try to hydrate. If this isn't a hydration pass there won't - // be any children to hydrate which is effectively the same thing as - // not hydrating. - - // This is a bit of a hack. We track the host root as a placement to - // know that we're currently in a mounting state. That way isMounted - // works as expected. We must reset this before committing. - // TODO: Delete this when we delete isMounted and findDOMNode. - workInProgress.effectTag |= Placement; - - // Ensure that children mount into this root without tracking - // side-effects. This ensures that we don't store Placement effects on - // nodes that will be hydrated. - workInProgress.child = mountChildFibers(workInProgress, null, element, renderExpirationTime); - } else { - // Otherwise reset hydration state in case we aborted and resumed another - // root. - resetHydrationState(); - reconcileChildren(current, workInProgress, element); - } - memoizeState(workInProgress, state); - return workInProgress.child; - } - resetHydrationState(); - // If there is no update queue, that's a bailout because the root has no props. - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - - function updateHostComponent(current, workInProgress, renderExpirationTime) { - pushHostContext(workInProgress); - - if (current === null) { - tryToClaimNextHydratableInstance(workInProgress); - } - - var type = workInProgress.type; - var memoizedProps = workInProgress.memoizedProps; - var nextProps = workInProgress.pendingProps; - if (nextProps === null) { - nextProps = memoizedProps; - !(nextProps !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - var prevProps = current !== null ? current.memoizedProps : null; - - if (hasContextChanged()) { - // Normally we can bail out on props equality but if context has changed - // we don't do the bailout and we have to reuse existing props instead. - } else if (nextProps === null || memoizedProps === nextProps) { - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - - var nextChildren = nextProps.children; - var isDirectTextChild = shouldSetTextContent(type, nextProps); - - if (isDirectTextChild) { - // We special case a direct text child of a host node. This is a common - // case. We won't handle it as a reified child. We will instead handle - // this in the host environment that also have access to this prop. That - // avoids allocating another HostText fiber and traversing it. - nextChildren = null; - } else if (prevProps && shouldSetTextContent(type, prevProps)) { - // If we're switching from a direct text child to a normal child, or to - // empty, we need to schedule the text content to be reset. - workInProgress.effectTag |= ContentReset; - } - - markRef(current, workInProgress); - - // Check the host config to see if the children are offscreen/hidden. - if (renderExpirationTime !== Never && !useSyncScheduling && shouldDeprioritizeSubtree(type, nextProps)) { - // Down-prioritize the children. - workInProgress.expirationTime = Never; - // Bailout and come back to this fiber later. - return null; - } - - reconcileChildren(current, workInProgress, nextChildren); - memoizeProps(workInProgress, nextProps); - return workInProgress.child; - } - - function updateHostText(current, workInProgress) { - if (current === null) { - tryToClaimNextHydratableInstance(workInProgress); - } - var nextProps = workInProgress.pendingProps; - if (nextProps === null) { - nextProps = workInProgress.memoizedProps; - } - memoizeProps(workInProgress, nextProps); - // Nothing to do here. This is terminal. We'll do the completion step - // immediately after. - return null; - } - - function mountIndeterminateComponent(current, workInProgress, renderExpirationTime) { - !(current === null) ? invariant(false, 'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var fn = workInProgress.type; - var props = workInProgress.pendingProps; - var unmaskedContext = getUnmaskedContext(workInProgress); - var context = getMaskedContext(workInProgress, unmaskedContext); - - var value; - - { - if (fn.prototype && typeof fn.prototype.render === 'function') { - var componentName = getComponentName(workInProgress); - warning(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName); - } - ReactCurrentOwner.current = workInProgress; - value = fn(props, context); - } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - - if (typeof value === 'object' && value !== null && typeof value.render === 'function') { - // Proceed under the assumption that this is a class instance - workInProgress.tag = ClassComponent; - - // Push context providers early to prevent context stack mismatches. - // During mounting we don't know the child context yet as the instance doesn't exist. - // We will invalidate the child context in finishClassComponent() right after rendering. - var hasContext = pushContextProvider(workInProgress); - adoptClassInstance(workInProgress, value); - mountClassInstance(workInProgress, renderExpirationTime); - return finishClassComponent(current, workInProgress, true, hasContext); - } else { - // Proceed under the assumption that this is a functional component - workInProgress.tag = FunctionalComponent; - { - var Component = workInProgress.type; - - if (Component) { - warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component'); - } - if (workInProgress.ref !== null) { - var info = ''; - var ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName(); - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - - var warningKey = ownerName || workInProgress._debugID || ''; - var debugSource = workInProgress._debugSource; - if (debugSource) { - warningKey = debugSource.fileName + ':' + debugSource.lineNumber; - } - if (!warnedAboutStatelessRefs[warningKey]) { - warnedAboutStatelessRefs[warningKey] = true; - warning(false, 'Stateless function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s%s', info, ReactDebugCurrentFiber.getCurrentFiberStackAddendum()); - } - } - } - reconcileChildren(current, workInProgress, value); - memoizeProps(workInProgress, props); - return workInProgress.child; - } - } - - function updateCallComponent(current, workInProgress, renderExpirationTime) { - var nextCall = workInProgress.pendingProps; - if (hasContextChanged()) { - // Normally we can bail out on props equality but if context has changed - // we don't do the bailout and we have to reuse existing props instead. - if (nextCall === null) { - nextCall = current && current.memoizedProps; - !(nextCall !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - } else if (nextCall === null || workInProgress.memoizedProps === nextCall) { - nextCall = workInProgress.memoizedProps; - // TODO: When bailing out, we might need to return the stateNode instead - // of the child. To check it for work. - // return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - - var nextChildren = nextCall.children; - - // The following is a fork of reconcileChildrenAtExpirationTime but using - // stateNode to store the child. - if (current === null) { - workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); - } else { - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); - } - - memoizeProps(workInProgress, nextCall); - // This doesn't take arbitrary time so we could synchronously just begin - // eagerly do the work of workInProgress.child as an optimization. - return workInProgress.stateNode; - } - - function updatePortalComponent(current, workInProgress, renderExpirationTime) { - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - var nextChildren = workInProgress.pendingProps; - if (hasContextChanged()) { - // Normally we can bail out on props equality but if context has changed - // we don't do the bailout and we have to reuse existing props instead. - if (nextChildren === null) { - nextChildren = current && current.memoizedProps; - !(nextChildren != null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { - return bailoutOnAlreadyFinishedWork(current, workInProgress); - } - - if (current === null) { - // Portals are special because we don't append the children during mount - // but at commit. Therefore we need to track insertions which the normal - // flow doesn't do during mount. This doesn't happen at the root because - // the root always starts with a "current" with a null child. - // TODO: Consider unifying this with how the root works. - workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); - memoizeProps(workInProgress, nextChildren); - } else { - reconcileChildren(current, workInProgress, nextChildren); - memoizeProps(workInProgress, nextChildren); - } - return workInProgress.child; - } - - /* - function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) { - let child = firstChild; - do { - // Ensure that the first and last effect of the parent corresponds - // to the children's first and last effect. - if (!returnFiber.firstEffect) { - returnFiber.firstEffect = child.firstEffect; - } - if (child.lastEffect) { - if (returnFiber.lastEffect) { - returnFiber.lastEffect.nextEffect = child.firstEffect; - } - returnFiber.lastEffect = child.lastEffect; - } - } while (child = child.sibling); - } - */ - - function bailoutOnAlreadyFinishedWork(current, workInProgress) { - cancelWorkTimer(workInProgress); - - // TODO: We should ideally be able to bail out early if the children have no - // more work to do. However, since we don't have a separation of this - // Fiber's priority and its children yet - we don't know without doing lots - // of the same work we do anyway. Once we have that separation we can just - // bail out here if the children has no more work at this priority level. - // if (workInProgress.priorityOfChildren <= priorityLevel) { - // // If there are side-effects in these children that have not yet been - // // committed we need to ensure that they get properly transferred up. - // if (current && current.child !== workInProgress.child) { - // reuseChildrenEffects(workInProgress, child); - // } - // return null; - // } - - cloneChildFibers(current, workInProgress); - return workInProgress.child; - } - - function bailoutOnLowPriority(current, workInProgress) { - cancelWorkTimer(workInProgress); - - // TODO: Handle HostComponent tags here as well and call pushHostContext()? - // See PR 8590 discussion for context - switch (workInProgress.tag) { - case HostRoot: - pushHostRootContext(workInProgress); - break; - case ClassComponent: - pushContextProvider(workInProgress); - break; - case HostPortal: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - } - // TODO: What if this is currently in progress? - // How can that happen? How is this not being cloned? - return null; - } - - // TODO: Delete memoizeProps/State and move to reconcile/bailout instead - function memoizeProps(workInProgress, nextProps) { - workInProgress.memoizedProps = nextProps; - } - - function memoizeState(workInProgress, nextState) { - workInProgress.memoizedState = nextState; - // Don't reset the updateQueue, in case there are pending updates. Resetting - // is handled by processUpdateQueue. - } - - function beginWork(current, workInProgress, renderExpirationTime) { - if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) { - return bailoutOnLowPriority(current, workInProgress); - } - - switch (workInProgress.tag) { - case IndeterminateComponent: - return mountIndeterminateComponent(current, workInProgress, renderExpirationTime); - case FunctionalComponent: - return updateFunctionalComponent(current, workInProgress); - case ClassComponent: - return updateClassComponent(current, workInProgress, renderExpirationTime); - case HostRoot: - return updateHostRoot(current, workInProgress, renderExpirationTime); - case HostComponent: - return updateHostComponent(current, workInProgress, renderExpirationTime); - case HostText: - return updateHostText(current, workInProgress); - case CallHandlerPhase: - // This is a restart. Reset the tag to the initial phase. - workInProgress.tag = CallComponent; - // Intentionally fall through since this is now the same. - case CallComponent: - return updateCallComponent(current, workInProgress, renderExpirationTime); - case ReturnComponent: - // A return component is just a placeholder, we can just run through the - // next one immediately. - return null; - case HostPortal: - return updatePortalComponent(current, workInProgress, renderExpirationTime); - case Fragment: - return updateFragment(current, workInProgress); - default: - invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); - } - } - - function beginFailedWork(current, workInProgress, renderExpirationTime) { - // Push context providers here to avoid a push/pop context mismatch. - switch (workInProgress.tag) { - case ClassComponent: - pushContextProvider(workInProgress); - break; - case HostRoot: - pushHostRootContext(workInProgress); - break; - default: - invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.'); - } - - // Add an error effect so we can handle the error during the commit phase - workInProgress.effectTag |= Err; - - // This is a weird case where we do "resume" work — work that failed on - // our first attempt. Because we no longer have a notion of "progressed - // deletions," reset the child to the current child to make sure we delete - // it again. TODO: Find a better way to handle this, perhaps during a more - // general overhaul of error handling. - if (current === null) { - workInProgress.child = null; - } else if (workInProgress.child !== current.child) { - workInProgress.child = current.child; - } - - if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) { - return bailoutOnLowPriority(current, workInProgress); - } - - // If we don't bail out, we're going be recomputing our children so we need - // to drop our effect list. - workInProgress.firstEffect = null; - workInProgress.lastEffect = null; - - // Unmount the current children as if the component rendered null - var nextChildren = null; - reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime); - - if (workInProgress.tag === ClassComponent) { - var instance = workInProgress.stateNode; - workInProgress.memoizedProps = instance.props; - workInProgress.memoizedState = instance.state; - } - - return workInProgress.child; - } - - return { - beginWork: beginWork, - beginFailedWork: beginFailedWork - }; -}; - -var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { - var createInstance = config.createInstance, - createTextInstance = config.createTextInstance, - appendInitialChild = config.appendInitialChild, - finalizeInitialChildren = config.finalizeInitialChildren, - prepareUpdate = config.prepareUpdate, - mutation = config.mutation, - persistence = config.persistence; - var getRootHostContainer = hostContext.getRootHostContainer, - popHostContext = hostContext.popHostContext, - getHostContext = hostContext.getHostContext, - popHostContainer = hostContext.popHostContainer; - var prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, - prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, - popHydrationState = hydrationContext.popHydrationState; - - - function markUpdate(workInProgress) { - // Tag the fiber with an update effect. This turns a Placement into - // an UpdateAndPlacement. - workInProgress.effectTag |= Update; - } - - function markRef(workInProgress) { - workInProgress.effectTag |= Ref; - } - - function appendAllReturns(returns, workInProgress) { - var node = workInProgress.stateNode; - if (node) { - node['return'] = workInProgress; - } - while (node !== null) { - if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) { - invariant(false, 'A call cannot have host component children.'); - } else if (node.tag === ReturnComponent) { - returns.push(node.type); - } else if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === workInProgress) { - return; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - } - - function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) { - var call = workInProgress.memoizedProps; - !call ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - // First step of the call has completed. Now we need to do the second. - // TODO: It would be nice to have a multi stage call represented by a - // single component, or at least tail call optimize nested ones. Currently - // that requires additional fields that we don't want to add to the fiber. - // So this requires nested handlers. - // Note: This doesn't mutate the alternate node. I don't think it needs to - // since this stage is reset for every pass. - workInProgress.tag = CallHandlerPhase; - - // Build up the returns. - // TODO: Compare this to a generator or opaque helpers like Children. - var returns = []; - appendAllReturns(returns, workInProgress); - var fn = call.handler; - var props = call.props; - var nextChildren = fn(props, returns); - - var currentFirstChild = current !== null ? current.child : null; - workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, renderExpirationTime); - return workInProgress.child; - } - - function appendAllChildren(parent, workInProgress) { - // We only have the top Fiber that was created but we need recurse down its - // children to find all the terminal nodes. - var node = workInProgress.child; - while (node !== null) { - if (node.tag === HostComponent || node.tag === HostText) { - appendInitialChild(parent, node.stateNode); - } else if (node.tag === HostPortal) { - // If we have a portal child, then we don't want to traverse - // down its children. Instead, we'll get insertions from each child in - // the portal directly. - } else if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === workInProgress) { - return; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === workInProgress) { - return; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - } - - var updateHostContainer = void 0; - var updateHostComponent = void 0; - var updateHostText = void 0; - if (mutation) { - if (enableMutatingReconciler) { - // Mutation mode - updateHostContainer = function (workInProgress) { - // Noop - }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { - // TODO: Type this specific to this type of component. - workInProgress.updateQueue = updatePayload; - // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. All the work is done in commitWork. - if (updatePayload) { - markUpdate(workInProgress); - } - }; - updateHostText = function (current, workInProgress, oldText, newText) { - // If the text differs, mark it as an update. All the work in done in commitWork. - if (oldText !== newText) { - markUpdate(workInProgress); - } - }; - } else { - invariant(false, 'Mutating reconciler is disabled.'); - } - } else if (persistence) { - if (enablePersistentReconciler) { - // Persistent host tree mode - var cloneInstance = persistence.cloneInstance, - createContainerChildSet = persistence.createContainerChildSet, - appendChildToContainerChildSet = persistence.appendChildToContainerChildSet, - finalizeContainerChildren = persistence.finalizeContainerChildren; - - // An unfortunate fork of appendAllChildren because we have two different parent types. - - var appendAllChildrenToContainer = function (containerChildSet, workInProgress) { - // We only have the top Fiber that was created but we need recurse down its - // children to find all the terminal nodes. - var node = workInProgress.child; - while (node !== null) { - if (node.tag === HostComponent || node.tag === HostText) { - appendChildToContainerChildSet(containerChildSet, node.stateNode); - } else if (node.tag === HostPortal) { - // If we have a portal child, then we don't want to traverse - // down its children. Instead, we'll get insertions from each child in - // the portal directly. - } else if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === workInProgress) { - return; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === workInProgress) { - return; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - }; - updateHostContainer = function (workInProgress) { - var portalOrRoot = workInProgress.stateNode; - var childrenUnchanged = workInProgress.firstEffect === null; - if (childrenUnchanged) { - // No changes, just reuse the existing instance. - } else { - var container = portalOrRoot.containerInfo; - var newChildSet = createContainerChildSet(container); - if (finalizeContainerChildren(container, newChildSet)) { - markUpdate(workInProgress); - } - portalOrRoot.pendingChildren = newChildSet; - // If children might have changed, we have to add them all to the set. - appendAllChildrenToContainer(newChildSet, workInProgress); - // Schedule an update on the container to swap out the container. - markUpdate(workInProgress); - } - }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { - // If there are no effects associated with this node, then none of our children had any updates. - // This guarantees that we can reuse all of them. - var childrenUnchanged = workInProgress.firstEffect === null; - var currentInstance = current.stateNode; - if (childrenUnchanged && updatePayload === null) { - // No changes, just reuse the existing instance. - // Note that this might release a previous clone. - workInProgress.stateNode = currentInstance; - } else { - var recyclableInstance = workInProgress.stateNode; - var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance); - if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance)) { - markUpdate(workInProgress); - } - workInProgress.stateNode = newInstance; - if (childrenUnchanged) { - // If there are no other effects in this tree, we need to flag this node as having one. - // Even though we're not going to use it for anything. - // Otherwise parents won't know that there are new children to propagate upwards. - markUpdate(workInProgress); - } else { - // If children might have changed, we have to add them all to the set. - appendAllChildren(newInstance, workInProgress); - } - } - }; - updateHostText = function (current, workInProgress, oldText, newText) { - if (oldText !== newText) { - // If the text content differs, we'll create a new text instance for it. - var rootContainerInstance = getRootHostContainer(); - var currentHostContext = getHostContext(); - workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress); - // We'll have to mark it as having an effect, even though we won't use the effect for anything. - // This lets the parents know that at least one of their children has changed. - markUpdate(workInProgress); - } - }; - } else { - invariant(false, 'Persistent reconciler is disabled.'); - } - } else { - if (enableNoopReconciler) { - // No host operations - updateHostContainer = function (workInProgress) { - // Noop - }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { - // Noop - }; - updateHostText = function (current, workInProgress, oldText, newText) { - // Noop - }; - } else { - invariant(false, 'Noop reconciler is disabled.'); - } - } - - function completeWork(current, workInProgress, renderExpirationTime) { - // Get the latest props. - var newProps = workInProgress.pendingProps; - if (newProps === null) { - newProps = workInProgress.memoizedProps; - } else if (workInProgress.expirationTime !== Never || renderExpirationTime === Never) { - // Reset the pending props, unless this was a down-prioritization. - workInProgress.pendingProps = null; - } - - switch (workInProgress.tag) { - case FunctionalComponent: - return null; - case ClassComponent: - { - // We are leaving this subtree, so pop context if any. - popContextProvider(workInProgress); - return null; - } - case HostRoot: - { - popHostContainer(workInProgress); - popTopLevelContextObject(workInProgress); - var fiberRoot = workInProgress.stateNode; - if (fiberRoot.pendingContext) { - fiberRoot.context = fiberRoot.pendingContext; - fiberRoot.pendingContext = null; - } - - if (current === null || current.child === null) { - // If we hydrated, pop so that we can delete any remaining children - // that weren't hydrated. - popHydrationState(workInProgress); - // This resets the hacky state to fix isMounted before committing. - // TODO: Delete this when we delete isMounted and findDOMNode. - workInProgress.effectTag &= ~Placement; - } - updateHostContainer(workInProgress); - return null; - } - case HostComponent: - { - popHostContext(workInProgress); - var rootContainerInstance = getRootHostContainer(); - var type = workInProgress.type; - if (current !== null && workInProgress.stateNode != null) { - // If we have an alternate, that means this is an update and we need to - // schedule a side-effect to do the updates. - var oldProps = current.memoizedProps; - // If we get updated because one of our children updated, we don't - // have newProps so we'll have to reuse them. - // TODO: Split the update API as separate for the props vs. children. - // Even better would be if children weren't special cased at all tho. - var instance = workInProgress.stateNode; - var currentHostContext = getHostContext(); - var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); - - updateHostComponent(current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance); - - if (current.ref !== workInProgress.ref) { - markRef(workInProgress); - } - } else { - if (!newProps) { - !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0; - // This can happen when we abort work. - return null; - } - - var _currentHostContext = getHostContext(); - // TODO: Move createInstance to beginWork and keep it on a context - // "stack" as the parent. Then append children as we go in beginWork - // or completeWork depending on we want to add then top->down or - // bottom->up. Top->down is faster in IE11. - var wasHydrated = popHydrationState(workInProgress); - if (wasHydrated) { - // TODO: Move this and createInstance step into the beginPhase - // to consolidate. - if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, _currentHostContext)) { - // If changes to the hydrated node needs to be applied at the - // commit-phase we mark this as such. - markUpdate(workInProgress); - } - } else { - var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); - - appendAllChildren(_instance, workInProgress); - - // Certain renderers require commit-time effects for initial mount. - // (eg DOM renderer supports auto-focus for certain elements). - // Make sure such renderers get scheduled for later work. - if (finalizeInitialChildren(_instance, type, newProps, rootContainerInstance)) { - markUpdate(workInProgress); - } - workInProgress.stateNode = _instance; - } - - if (workInProgress.ref !== null) { - // If there is a ref on a host node we need to schedule a callback - markRef(workInProgress); - } - } - return null; - } - case HostText: - { - var newText = newProps; - if (current && workInProgress.stateNode != null) { - var oldText = current.memoizedProps; - // If we have an alternate, that means this is an update and we need - // to schedule a side-effect to do the updates. - updateHostText(current, workInProgress, oldText, newText); - } else { - if (typeof newText !== 'string') { - !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0; - // This can happen when we abort work. - return null; - } - var _rootContainerInstance = getRootHostContainer(); - var _currentHostContext2 = getHostContext(); - var _wasHydrated = popHydrationState(workInProgress); - if (_wasHydrated) { - if (prepareToHydrateHostTextInstance(workInProgress)) { - markUpdate(workInProgress); - } - } else { - workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress); - } - } - return null; - } - case CallComponent: - return moveCallToHandlerPhase(current, workInProgress, renderExpirationTime); - case CallHandlerPhase: - // Reset the tag to now be a first phase call. - workInProgress.tag = CallComponent; - return null; - case ReturnComponent: - // Does nothing. - return null; - case Fragment: - return null; - case HostPortal: - popHostContainer(workInProgress); - updateHostContainer(workInProgress); - return null; - // Error cases - case IndeterminateComponent: - invariant(false, 'An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.'); - // eslint-disable-next-line no-fallthrough - default: - invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); - } - } - - return { - completeWork: completeWork - }; -}; - -var invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback; -var hasCaughtError$1 = ReactErrorUtils.hasCaughtError; -var clearCaughtError$1 = ReactErrorUtils.clearCaughtError; - - -var ReactFiberCommitWork = function (config, captureError) { - var getPublicInstance = config.getPublicInstance, - mutation = config.mutation, - persistence = config.persistence; - - - var callComponentWillUnmountWithTimer = function (current, instance) { - startPhaseTimer(current, 'componentWillUnmount'); - instance.props = current.memoizedProps; - instance.state = current.memoizedState; - instance.componentWillUnmount(); - stopPhaseTimer(); - }; - - // Capture errors so they don't interrupt unmounting. - function safelyCallComponentWillUnmount(current, instance) { - { - invokeGuardedCallback$2(null, callComponentWillUnmountWithTimer, null, current, instance); - if (hasCaughtError$1()) { - var unmountError = clearCaughtError$1(); - captureError(current, unmountError); - } - } - } - - function safelyDetachRef(current) { - var ref = current.ref; - if (ref !== null) { - { - invokeGuardedCallback$2(null, ref, null, null); - if (hasCaughtError$1()) { - var refError = clearCaughtError$1(); - captureError(current, refError); - } - } - } - } - - function commitLifeCycles(current, finishedWork) { - switch (finishedWork.tag) { - case ClassComponent: - { - var instance = finishedWork.stateNode; - if (finishedWork.effectTag & Update) { - if (current === null) { - startPhaseTimer(finishedWork, 'componentDidMount'); - instance.props = finishedWork.memoizedProps; - instance.state = finishedWork.memoizedState; - instance.componentDidMount(); - stopPhaseTimer(); - } else { - var prevProps = current.memoizedProps; - var prevState = current.memoizedState; - startPhaseTimer(finishedWork, 'componentDidUpdate'); - instance.props = finishedWork.memoizedProps; - instance.state = finishedWork.memoizedState; - instance.componentDidUpdate(prevProps, prevState); - stopPhaseTimer(); - } - } - var updateQueue = finishedWork.updateQueue; - if (updateQueue !== null) { - commitCallbacks(updateQueue, instance); - } - return; - } - case HostRoot: - { - var _updateQueue = finishedWork.updateQueue; - if (_updateQueue !== null) { - var _instance = finishedWork.child !== null ? finishedWork.child.stateNode : null; - commitCallbacks(_updateQueue, _instance); - } - return; - } - case HostComponent: - { - var _instance2 = finishedWork.stateNode; - - // Renderers may schedule work to be done after host components are mounted - // (eg DOM renderer may schedule auto-focus for inputs and form controls). - // These effects should only be committed when components are first mounted, - // aka when there is no current/alternate. - if (current === null && finishedWork.effectTag & Update) { - var type = finishedWork.type; - var props = finishedWork.memoizedProps; - commitMount(_instance2, type, props, finishedWork); - } - - return; - } - case HostText: - { - // We have no life-cycles associated with text. - return; - } - case HostPortal: - { - // We have no life-cycles associated with portals. - return; - } - default: - { - invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'); - } - } - } - - function commitAttachRef(finishedWork) { - var ref = finishedWork.ref; - if (ref !== null) { - var instance = finishedWork.stateNode; - switch (finishedWork.tag) { - case HostComponent: - ref(getPublicInstance(instance)); - break; - default: - ref(instance); - } - } - } - - function commitDetachRef(current) { - var currentRef = current.ref; - if (currentRef !== null) { - currentRef(null); - } - } - - // User-originating errors (lifecycles and refs) should not interrupt - // deletion, so don't let them throw. Host-originating errors should - // interrupt deletion, so it's okay - function commitUnmount(current) { - if (typeof onCommitUnmount === 'function') { - onCommitUnmount(current); - } - - switch (current.tag) { - case ClassComponent: - { - safelyDetachRef(current); - var instance = current.stateNode; - if (typeof instance.componentWillUnmount === 'function') { - safelyCallComponentWillUnmount(current, instance); - } - return; - } - case HostComponent: - { - safelyDetachRef(current); - return; - } - case CallComponent: - { - commitNestedUnmounts(current.stateNode); - return; - } - case HostPortal: - { - // TODO: this is recursive. - // We are also not using this parent because - // the portal will get pushed immediately. - if (enableMutatingReconciler && mutation) { - unmountHostComponents(current); - } else if (enablePersistentReconciler && persistence) { - emptyPortalContainer(current); - } - return; - } - } - } - - function commitNestedUnmounts(root) { - // While we're inside a removed host node we don't want to call - // removeChild on the inner nodes because they're removed by the top - // call anyway. We also want to call componentWillUnmount on all - // composites before this host node is removed from the tree. Therefore - var node = root; - while (true) { - commitUnmount(node); - // Visit children because they may contain more composite or host nodes. - // Skip portals because commitUnmount() currently visits them recursively. - if (node.child !== null && ( - // If we use mutation we drill down into portals using commitUnmount above. - // If we don't use mutation we drill down into portals here instead. - !mutation || node.tag !== HostPortal)) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === root) { - return; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === root) { - return; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - } - - function detachFiber(current) { - // Cut off the return pointers to disconnect it from the tree. Ideally, we - // should clear the child pointer of the parent alternate to let this - // get GC:ed but we don't know which for sure which parent is the current - // one so we'll settle for GC:ing the subtree of this child. This child - // itself will be GC:ed when the parent updates the next time. - current['return'] = null; - current.child = null; - if (current.alternate) { - current.alternate.child = null; - current.alternate['return'] = null; - } - } - - if (!mutation) { - var commitContainer = void 0; - if (persistence) { - var replaceContainerChildren = persistence.replaceContainerChildren, - createContainerChildSet = persistence.createContainerChildSet; - - var emptyPortalContainer = function (current) { - var portal = current.stateNode; - var containerInfo = portal.containerInfo; - - var emptyChildSet = createContainerChildSet(containerInfo); - replaceContainerChildren(containerInfo, emptyChildSet); - }; - commitContainer = function (finishedWork) { - switch (finishedWork.tag) { - case ClassComponent: - { - return; - } - case HostComponent: - { - return; - } - case HostText: - { - return; - } - case HostRoot: - case HostPortal: - { - var portalOrRoot = finishedWork.stateNode; - var containerInfo = portalOrRoot.containerInfo, - _pendingChildren = portalOrRoot.pendingChildren; - - replaceContainerChildren(containerInfo, _pendingChildren); - return; - } - default: - { - invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'); - } - } - }; - } else { - commitContainer = function (finishedWork) { - // Noop - }; - } - if (enablePersistentReconciler || enableNoopReconciler) { - return { - commitResetTextContent: function (finishedWork) {}, - commitPlacement: function (finishedWork) {}, - commitDeletion: function (current) { - // Detach refs and call componentWillUnmount() on the whole subtree. - commitNestedUnmounts(current); - detachFiber(current); - }, - commitWork: function (current, finishedWork) { - commitContainer(finishedWork); - }, - - commitLifeCycles: commitLifeCycles, - commitAttachRef: commitAttachRef, - commitDetachRef: commitDetachRef - }; - } else if (persistence) { - invariant(false, 'Persistent reconciler is disabled.'); - } else { - invariant(false, 'Noop reconciler is disabled.'); - } - } - var commitMount = mutation.commitMount, - commitUpdate = mutation.commitUpdate, - resetTextContent = mutation.resetTextContent, - commitTextUpdate = mutation.commitTextUpdate, - appendChild = mutation.appendChild, - appendChildToContainer = mutation.appendChildToContainer, - insertBefore = mutation.insertBefore, - insertInContainerBefore = mutation.insertInContainerBefore, - removeChild = mutation.removeChild, - removeChildFromContainer = mutation.removeChildFromContainer; - - - function getHostParentFiber(fiber) { - var parent = fiber['return']; - while (parent !== null) { - if (isHostParent(parent)) { - return parent; - } - parent = parent['return']; - } - invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.'); - } - - function isHostParent(fiber) { - return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; - } - - function getHostSibling(fiber) { - // We're going to search forward into the tree until we find a sibling host - // node. Unfortunately, if multiple insertions are done in a row we have to - // search past them. This leads to exponential search for the next sibling. - var node = fiber; - siblings: while (true) { - // If we didn't find anything, let's try the next sibling. - while (node.sibling === null) { - if (node['return'] === null || isHostParent(node['return'])) { - // If we pop out of the root or hit the parent the fiber we are the - // last sibling. - return null; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - while (node.tag !== HostComponent && node.tag !== HostText) { - // If it is not host node and, we might have a host node inside it. - // Try to search down until we find one. - if (node.effectTag & Placement) { - // If we don't have a child, try the siblings instead. - continue siblings; - } - // If we don't have a child, try the siblings instead. - // We also skip portals because they are not part of this host tree. - if (node.child === null || node.tag === HostPortal) { - continue siblings; - } else { - node.child['return'] = node; - node = node.child; - } - } - // Check if this host node is stable or about to be placed. - if (!(node.effectTag & Placement)) { - // Found it! - return node.stateNode; - } - } - } - - function commitPlacement(finishedWork) { - // Recursively insert all host nodes into the parent. - var parentFiber = getHostParentFiber(finishedWork); - var parent = void 0; - var isContainer = void 0; - switch (parentFiber.tag) { - case HostComponent: - parent = parentFiber.stateNode; - isContainer = false; - break; - case HostRoot: - parent = parentFiber.stateNode.containerInfo; - isContainer = true; - break; - case HostPortal: - parent = parentFiber.stateNode.containerInfo; - isContainer = true; - break; - default: - invariant(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.'); - } - if (parentFiber.effectTag & ContentReset) { - // Reset the text content of the parent before doing any insertions - resetTextContent(parent); - // Clear ContentReset from the effect tag - parentFiber.effectTag &= ~ContentReset; - } - - var before = getHostSibling(finishedWork); - // We only have the top Fiber that was inserted but we need recurse down its - // children to find all the terminal nodes. - var node = finishedWork; - while (true) { - if (node.tag === HostComponent || node.tag === HostText) { - if (before) { - if (isContainer) { - insertInContainerBefore(parent, node.stateNode, before); - } else { - insertBefore(parent, node.stateNode, before); - } - } else { - if (isContainer) { - appendChildToContainer(parent, node.stateNode); - } else { - appendChild(parent, node.stateNode); - } - } - } else if (node.tag === HostPortal) { - // If the insertion itself is a portal, then we don't want to traverse - // down its children. Instead, we'll get insertions from each child in - // the portal directly. - } else if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - if (node === finishedWork) { - return; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === finishedWork) { - return; - } - node = node['return']; - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - } - - function unmountHostComponents(current) { - // We only have the top Fiber that was inserted but we need recurse down its - var node = current; - - // Each iteration, currentParent is populated with node's host parent if not - // currentParentIsValid. - var currentParentIsValid = false; - var currentParent = void 0; - var currentParentIsContainer = void 0; - - while (true) { - if (!currentParentIsValid) { - var parent = node['return']; - findParent: while (true) { - !(parent !== null) ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : void 0; - switch (parent.tag) { - case HostComponent: - currentParent = parent.stateNode; - currentParentIsContainer = false; - break findParent; - case HostRoot: - currentParent = parent.stateNode.containerInfo; - currentParentIsContainer = true; - break findParent; - case HostPortal: - currentParent = parent.stateNode.containerInfo; - currentParentIsContainer = true; - break findParent; - } - parent = parent['return']; - } - currentParentIsValid = true; - } - - if (node.tag === HostComponent || node.tag === HostText) { - commitNestedUnmounts(node); - // After all the children have unmounted, it is now safe to remove the - // node from the tree. - if (currentParentIsContainer) { - removeChildFromContainer(currentParent, node.stateNode); - } else { - removeChild(currentParent, node.stateNode); - } - // Don't visit children because we already visited them. - } else if (node.tag === HostPortal) { - // When we go into a portal, it becomes the parent to remove from. - // We will reassign it back when we pop the portal on the way up. - currentParent = node.stateNode.containerInfo; - // Visit children because portals might contain host components. - if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - } else { - commitUnmount(node); - // Visit children because we may find more host components below. - if (node.child !== null) { - node.child['return'] = node; - node = node.child; - continue; - } - } - if (node === current) { - return; - } - while (node.sibling === null) { - if (node['return'] === null || node['return'] === current) { - return; - } - node = node['return']; - if (node.tag === HostPortal) { - // When we go out of the portal, we need to restore the parent. - // Since we don't keep a stack of them, we will search for it. - currentParentIsValid = false; - } - } - node.sibling['return'] = node['return']; - node = node.sibling; - } - } - - function commitDeletion(current) { - // Recursively delete all host nodes from the parent. - // Detach refs and call componentWillUnmount() on the whole subtree. - unmountHostComponents(current); - detachFiber(current); - } - - function commitWork(current, finishedWork) { - switch (finishedWork.tag) { - case ClassComponent: - { - return; - } - case HostComponent: - { - var instance = finishedWork.stateNode; - if (instance != null) { - // Commit the work prepared earlier. - var newProps = finishedWork.memoizedProps; - // For hydration we reuse the update path but we treat the oldProps - // as the newProps. The updatePayload will contain the real change in - // this case. - var oldProps = current !== null ? current.memoizedProps : newProps; - var type = finishedWork.type; - // TODO: Type the updateQueue to be specific to host components. - var updatePayload = finishedWork.updateQueue; - finishedWork.updateQueue = null; - if (updatePayload !== null) { - commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); - } - } - return; - } - case HostText: - { - !(finishedWork.stateNode !== null) ? invariant(false, 'This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var textInstance = finishedWork.stateNode; - var newText = finishedWork.memoizedProps; - // For hydration we reuse the update path but we treat the oldProps - // as the newProps. The updatePayload will contain the real change in - // this case. - var oldText = current !== null ? current.memoizedProps : newText; - commitTextUpdate(textInstance, oldText, newText); - return; - } - case HostRoot: - { - return; - } - default: - { - invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.'); - } - } - } - - function commitResetTextContent(current) { - resetTextContent(current.stateNode); - } - - if (enableMutatingReconciler) { - return { - commitResetTextContent: commitResetTextContent, - commitPlacement: commitPlacement, - commitDeletion: commitDeletion, - commitWork: commitWork, - commitLifeCycles: commitLifeCycles, - commitAttachRef: commitAttachRef, - commitDetachRef: commitDetachRef - }; - } else { - invariant(false, 'Mutating reconciler is disabled.'); - } -}; - -var NO_CONTEXT = {}; - -var ReactFiberHostContext = function (config) { - var getChildHostContext = config.getChildHostContext, - getRootHostContext = config.getRootHostContext; - - - var contextStackCursor = createCursor(NO_CONTEXT); - var contextFiberStackCursor = createCursor(NO_CONTEXT); - var rootInstanceStackCursor = createCursor(NO_CONTEXT); - - function requiredContext(c) { - !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0; - return c; - } - - function getRootHostContainer() { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - return rootInstance; - } - - function pushHostContainer(fiber, nextRootInstance) { - // Push current root instance onto the stack; - // This allows us to reset root when portals are popped. - push(rootInstanceStackCursor, nextRootInstance, fiber); - - var nextRootContext = getRootHostContext(nextRootInstance); - - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextRootContext, fiber); - } - - function popHostContainer(fiber) { - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); - } - - function getHostContext() { - var context = requiredContext(contextStackCursor.current); - return context; - } - - function pushHostContext(fiber) { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - var context = requiredContext(contextStackCursor.current); - var nextContext = getChildHostContext(context, fiber.type, rootInstance); - - // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; - } - - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); - } - - function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; - } - - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - } - - function resetHostContainer() { - contextStackCursor.current = NO_CONTEXT; - rootInstanceStackCursor.current = NO_CONTEXT; - } - - return { - getHostContext: getHostContext, - getRootHostContainer: getRootHostContainer, - popHostContainer: popHostContainer, - popHostContext: popHostContext, - pushHostContainer: pushHostContainer, - pushHostContext: pushHostContext, - resetHostContainer: resetHostContainer - }; -}; - -var ReactFiberHydrationContext = function (config) { - var shouldSetTextContent = config.shouldSetTextContent, - hydration = config.hydration; - - // If this doesn't have hydration mode. - - if (!hydration) { - return { - enterHydrationState: function () { - return false; - }, - resetHydrationState: function () {}, - tryToClaimNextHydratableInstance: function () {}, - prepareToHydrateHostInstance: function () { - invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); - }, - prepareToHydrateHostTextInstance: function () { - invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); - }, - popHydrationState: function (fiber) { - return false; - } - }; - } - - var canHydrateInstance = hydration.canHydrateInstance, - canHydrateTextInstance = hydration.canHydrateTextInstance, - getNextHydratableSibling = hydration.getNextHydratableSibling, - getFirstHydratableChild = hydration.getFirstHydratableChild, - hydrateInstance = hydration.hydrateInstance, - hydrateTextInstance = hydration.hydrateTextInstance, - didNotMatchHydratedContainerTextInstance = hydration.didNotMatchHydratedContainerTextInstance, - didNotMatchHydratedTextInstance = hydration.didNotMatchHydratedTextInstance, - didNotHydrateContainerInstance = hydration.didNotHydrateContainerInstance, - didNotHydrateInstance = hydration.didNotHydrateInstance, - didNotFindHydratableContainerInstance = hydration.didNotFindHydratableContainerInstance, - didNotFindHydratableContainerTextInstance = hydration.didNotFindHydratableContainerTextInstance, - didNotFindHydratableInstance = hydration.didNotFindHydratableInstance, - didNotFindHydratableTextInstance = hydration.didNotFindHydratableTextInstance; - - // The deepest Fiber on the stack involved in a hydration context. - // This may have been an insertion or a hydration. - - var hydrationParentFiber = null; - var nextHydratableInstance = null; - var isHydrating = false; - - function enterHydrationState(fiber) { - var parentInstance = fiber.stateNode.containerInfo; - nextHydratableInstance = getFirstHydratableChild(parentInstance); - hydrationParentFiber = fiber; - isHydrating = true; - return true; - } - - function deleteHydratableInstance(returnFiber, instance) { - { - switch (returnFiber.tag) { - case HostRoot: - didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); - break; - case HostComponent: - didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); - break; - } - } - - var childToDelete = createFiberFromHostInstanceForDeletion(); - childToDelete.stateNode = instance; - childToDelete['return'] = returnFiber; - childToDelete.effectTag = Deletion; - - // This might seem like it belongs on progressedFirstDeletion. However, - // these children are not part of the reconciliation list of children. - // Even if we abort and rereconcile the children, that will try to hydrate - // again and the nodes are still in the host tree so these will be - // recreated. - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; - } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; - } - } - - function insertNonHydratedInstance(returnFiber, fiber) { - fiber.effectTag |= Placement; - { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - switch (fiber.tag) { - case HostComponent: - var type = fiber.type; - var props = fiber.pendingProps; - didNotFindHydratableContainerInstance(parentContainer, type, props); - break; - case HostText: - var text = fiber.pendingProps; - didNotFindHydratableContainerTextInstance(parentContainer, text); - break; - } - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - switch (fiber.tag) { - case HostComponent: - var _type = fiber.type; - var _props = fiber.pendingProps; - didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props); - break; - case HostText: - var _text = fiber.pendingProps; - didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); - break; - } - break; - } - default: - return; - } - } - } - - function tryHydrate(fiber, nextInstance) { - switch (fiber.tag) { - case HostComponent: - { - var type = fiber.type; - var props = fiber.pendingProps; - var instance = canHydrateInstance(nextInstance, type, props); - if (instance !== null) { - fiber.stateNode = instance; - return true; - } - return false; - } - case HostText: - { - var text = fiber.pendingProps; - var textInstance = canHydrateTextInstance(nextInstance, text); - if (textInstance !== null) { - fiber.stateNode = textInstance; - return true; - } - return false; - } - default: - return false; - } - } - - function tryToClaimNextHydratableInstance(fiber) { - if (!isHydrating) { - return; - } - var nextInstance = nextHydratableInstance; - if (!nextInstance) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; - } - if (!tryHydrate(fiber, nextInstance)) { - // If we can't hydrate this instance let's try the next one. - // We use this as a heuristic. It's based on intuition and not data so it - // might be flawed or unnecessary. - nextInstance = getNextHydratableSibling(nextInstance); - if (!nextInstance || !tryHydrate(fiber, nextInstance)) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; - } - // We matched the next one, we'll now assume that the first one was - // superfluous and we'll delete it. Since we can't eagerly delete it - // we'll have to schedule a deletion. To do that, this node needs a dummy - // fiber associated with it. - deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); - } - hydrationParentFiber = fiber; - nextHydratableInstance = getFirstHydratableChild(nextInstance); - } - - function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { - var instance = fiber.stateNode; - var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); - // TODO: Type this specific to this type of component. - fiber.updateQueue = updatePayload; - // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. - if (updatePayload !== null) { - return true; - } - return false; - } - - function prepareToHydrateHostTextInstance(fiber) { - var textInstance = fiber.stateNode; - var textContent = fiber.memoizedProps; - var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); - { - if (shouldUpdate) { - // We assume that prepareToHydrateHostTextInstance is called in a context where the - // hydration parent is the parent host component of this host text. - var returnFiber = hydrationParentFiber; - if (returnFiber !== null) { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); - break; - } - } - } - } - } - return shouldUpdate; - } - - function popToNextHostParent(fiber) { - var parent = fiber['return']; - while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) { - parent = parent['return']; - } - hydrationParentFiber = parent; - } - - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) { - // We're deeper than the current hydration context, inside an inserted - // tree. - return false; - } - if (!isHydrating) { - // If we're not currently hydrating but we're in a hydration context, then - // we were an insertion and now need to pop up reenter hydration of our - // siblings. - popToNextHostParent(fiber); - isHydrating = true; - return false; - } - - var type = fiber.type; - - // If we have any remaining hydratable nodes, we need to delete them now. - // We only do this deeper than head and body since they tend to have random - // other nodes in them. We also ignore components with pure text content in - // side of them. - // TODO: Better heuristic. - if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { - var nextInstance = nextHydratableInstance; - while (nextInstance) { - deleteHydratableInstance(fiber, nextInstance); - nextInstance = getNextHydratableSibling(nextInstance); - } - } - - popToNextHostParent(fiber); - nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; - return true; - } - - function resetHydrationState() { - hydrationParentFiber = null; - nextHydratableInstance = null; - isHydrating = false; - } - - return { - enterHydrationState: enterHydrationState, - resetHydrationState: resetHydrationState, - tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, - prepareToHydrateHostInstance: prepareToHydrateHostInstance, - prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, - popHydrationState: popHydrationState - }; -}; - -// This lets us hook into Fiber to debug what it's doing. -// See https://github.com/facebook/react/pull/8033. -// This is not part of the public API, not even for React DevTools. -// You may only inject a debugTool if you work on React Fiber itself. -var ReactFiberInstrumentation = { - debugTool: null -}; - -var ReactFiberInstrumentation_1 = ReactFiberInstrumentation; - -var defaultShowDialog = function (capturedError) { - return true; -}; - -var showDialog = defaultShowDialog; - -function logCapturedError(capturedError) { - var logError = showDialog(capturedError); - - // Allow injected showDialog() to prevent default console.error logging. - // This enables renderers like ReactNative to better manage redbox behavior. - if (logError === false) { - return; - } - - var error = capturedError.error; - var suppressLogging = error && error.suppressReactErrorLogging; - if (suppressLogging) { - return; - } - - { - var componentName = capturedError.componentName, - componentStack = capturedError.componentStack, - errorBoundaryName = capturedError.errorBoundaryName, - errorBoundaryFound = capturedError.errorBoundaryFound, - willRetry = capturedError.willRetry; - - - var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:'; - - var errorBoundaryMessage = void 0; - // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow. - if (errorBoundaryFound && errorBoundaryName) { - if (willRetry) { - errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.'); - } else { - errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\n' + 'Recreating the tree from scratch failed so React will unmount the tree.'; - } - } else { - errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.'; - } - var combinedMessage = '' + componentNameMessage + componentStack + '\n\n' + ('' + errorBoundaryMessage); - - // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - console.error(combinedMessage); - } -} - -var invokeGuardedCallback$1 = ReactErrorUtils.invokeGuardedCallback; -var hasCaughtError = ReactErrorUtils.hasCaughtError; -var clearCaughtError = ReactErrorUtils.clearCaughtError; - - -{ - var didWarnAboutStateTransition = false; - var didWarnSetStateChildContext = false; - var didWarnStateUpdateForUnmountedComponent = {}; - - var warnAboutUpdateOnUnmounted = function (fiber) { - var componentName = getComponentName(fiber) || 'ReactClass'; - if (didWarnStateUpdateForUnmountedComponent[componentName]) { - return; - } - warning(false, 'Can only update a mounted or mounting ' + 'component. This usually means you called setState, replaceState, ' + 'or forceUpdate on an unmounted component. This is a no-op.\n\nPlease ' + 'check the code for the %s component.', componentName); - didWarnStateUpdateForUnmountedComponent[componentName] = true; - }; - - var warnAboutInvalidUpdates = function (instance) { - switch (ReactDebugCurrentFiber.phase) { - case 'getChildContext': - if (didWarnSetStateChildContext) { - return; - } - warning(false, 'setState(...): Cannot call setState() inside getChildContext()'); - didWarnSetStateChildContext = true; - break; - case 'render': - if (didWarnAboutStateTransition) { - return; - } - warning(false, 'Cannot update during an existing state transition (such as within ' + "`render` or another component's constructor). Render methods should " + 'be a pure function of props and state; constructor side-effects are ' + 'an anti-pattern, but can be moved to `componentWillMount`.'); - didWarnAboutStateTransition = true; - break; - } - }; -} - -var ReactFiberScheduler = function (config) { - var hostContext = ReactFiberHostContext(config); - var hydrationContext = ReactFiberHydrationContext(config); - var popHostContainer = hostContext.popHostContainer, - popHostContext = hostContext.popHostContext, - resetHostContainer = hostContext.resetHostContainer; - - var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber), - beginWork = _ReactFiberBeginWork.beginWork, - beginFailedWork = _ReactFiberBeginWork.beginFailedWork; - - var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), - completeWork = _ReactFiberCompleteWo.completeWork; - - var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), - commitResetTextContent = _ReactFiberCommitWork.commitResetTextContent, - commitPlacement = _ReactFiberCommitWork.commitPlacement, - commitDeletion = _ReactFiberCommitWork.commitDeletion, - commitWork = _ReactFiberCommitWork.commitWork, - commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, - commitAttachRef = _ReactFiberCommitWork.commitAttachRef, - commitDetachRef = _ReactFiberCommitWork.commitDetachRef; - - var now = config.now, - scheduleDeferredCallback = config.scheduleDeferredCallback, - cancelDeferredCallback = config.cancelDeferredCallback, - useSyncScheduling = config.useSyncScheduling, - prepareForCommit = config.prepareForCommit, - resetAfterCommit = config.resetAfterCommit; - - // Represents the current time in ms. - - var startTime = now(); - var mostRecentCurrentTime = msToExpirationTime(0); - - // Represents the expiration time that incoming updates should use. (If this - // is NoWork, use the default strategy: async updates in async mode, sync - // updates in sync mode.) - var expirationContext = NoWork; - - var isWorking = false; - - // The next work in progress fiber that we're currently working on. - var nextUnitOfWork = null; - var nextRoot = null; - // The time at which we're currently rendering work. - var nextRenderExpirationTime = NoWork; - - // The next fiber with an effect that we're currently committing. - var nextEffect = null; - - // Keep track of which fibers have captured an error that need to be handled. - // Work is removed from this collection after componentDidCatch is called. - var capturedErrors = null; - // Keep track of which fibers have failed during the current batch of work. - // This is a different set than capturedErrors, because it is not reset until - // the end of the batch. This is needed to propagate errors correctly if a - // subtree fails more than once. - var failedBoundaries = null; - // Error boundaries that captured an error during the current commit. - var commitPhaseBoundaries = null; - var firstUncaughtError = null; - var didFatal = false; - - var isCommitting = false; - var isUnmounting = false; - - // Used for performance tracking. - var interruptedBy = null; - - function resetContextStack() { - // Reset the stack - reset$1(); - // Reset the cursors - resetContext(); - resetHostContainer(); - } - - function commitAllHostEffects() { - while (nextEffect !== null) { - { - ReactDebugCurrentFiber.setCurrentFiber(nextEffect); - } - recordEffect(); - - var effectTag = nextEffect.effectTag; - if (effectTag & ContentReset) { - commitResetTextContent(nextEffect); - } - - if (effectTag & Ref) { - var current = nextEffect.alternate; - if (current !== null) { - commitDetachRef(current); - } - } - - // The following switch statement is only concerned about placement, - // updates, and deletions. To avoid needing to add a case for every - // possible bitmap value, we remove the secondary effects from the - // effect tag and switch on that value. - var primaryEffectTag = effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork); - switch (primaryEffectTag) { - case Placement: - { - commitPlacement(nextEffect); - // Clear the "placement" from effect tag so that we know that this is inserted, before - // any life-cycles like componentDidMount gets called. - // TODO: findDOMNode doesn't rely on this any more but isMounted - // does and isMounted is deprecated anyway so we should be able - // to kill this. - nextEffect.effectTag &= ~Placement; - break; - } - case PlacementAndUpdate: - { - // Placement - commitPlacement(nextEffect); - // Clear the "placement" from effect tag so that we know that this is inserted, before - // any life-cycles like componentDidMount gets called. - nextEffect.effectTag &= ~Placement; - - // Update - var _current = nextEffect.alternate; - commitWork(_current, nextEffect); - break; - } - case Update: - { - var _current2 = nextEffect.alternate; - commitWork(_current2, nextEffect); - break; - } - case Deletion: - { - isUnmounting = true; - commitDeletion(nextEffect); - isUnmounting = false; - break; - } - } - nextEffect = nextEffect.nextEffect; - } - - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - } - - function commitAllLifeCycles() { - while (nextEffect !== null) { - var effectTag = nextEffect.effectTag; - - if (effectTag & (Update | Callback)) { - recordEffect(); - var current = nextEffect.alternate; - commitLifeCycles(current, nextEffect); - } - - if (effectTag & Ref) { - recordEffect(); - commitAttachRef(nextEffect); - } - - if (effectTag & Err) { - recordEffect(); - commitErrorHandling(nextEffect); - } - - var next = nextEffect.nextEffect; - // Ensure that we clean these up so that we don't accidentally keep them. - // I'm not actually sure this matters because we can't reset firstEffect - // and lastEffect since they're on every node, not just the effectful - // ones. So we have to clean everything as we reuse nodes anyway. - nextEffect.nextEffect = null; - // Ensure that we reset the effectTag here so that we can rely on effect - // tags to reason about the current life-cycle. - nextEffect = next; - } - } - - function commitRoot(finishedWork) { - // We keep track of this so that captureError can collect any boundaries - // that capture an error during the commit phase. The reason these aren't - // local to this function is because errors that occur during cWU are - // captured elsewhere, to prevent the unmount from being interrupted. - isWorking = true; - isCommitting = true; - startCommitTimer(); - - var root = finishedWork.stateNode; - !(root.current !== finishedWork) ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0; - root.isReadyForCommit = false; - - // Reset this to null before calling lifecycles - ReactCurrentOwner.current = null; - - var firstEffect = void 0; - if (finishedWork.effectTag > PerformedWork) { - // A fiber's effect list consists only of its children, not itself. So if - // the root has an effect, we need to add it to the end of the list. The - // resulting list is the set that would belong to the root's parent, if - // it had one; that is, all the effects in the tree including the root. - if (finishedWork.lastEffect !== null) { - finishedWork.lastEffect.nextEffect = finishedWork; - firstEffect = finishedWork.firstEffect; - } else { - firstEffect = finishedWork; - } - } else { - // There is no effect on the root. - firstEffect = finishedWork.firstEffect; - } - - prepareForCommit(); - - // Commit all the side-effects within a tree. We'll do this in two passes. - // The first pass performs all the host insertions, updates, deletions and - // ref unmounts. - nextEffect = firstEffect; - startCommitHostEffectsTimer(); - while (nextEffect !== null) { - var didError = false; - var _error = void 0; - { - invokeGuardedCallback$1(null, commitAllHostEffects, null); - if (hasCaughtError()) { - didError = true; - _error = clearCaughtError(); - } - } - if (didError) { - !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0; - captureError(nextEffect, _error); - // Clean-up - if (nextEffect !== null) { - nextEffect = nextEffect.nextEffect; - } - } - } - stopCommitHostEffectsTimer(); - - resetAfterCommit(); - - // The work-in-progress tree is now the current tree. This must come after - // the first pass of the commit phase, so that the previous tree is still - // current during componentWillUnmount, but before the second pass, so that - // the finished work is current during componentDidMount/Update. - root.current = finishedWork; - - // In the second pass we'll perform all life-cycles and ref callbacks. - // Life-cycles happen as a separate pass so that all placements, updates, - // and deletions in the entire tree have already been invoked. - // This pass also triggers any renderer-specific initial effects. - nextEffect = firstEffect; - startCommitLifeCyclesTimer(); - while (nextEffect !== null) { - var _didError = false; - var _error2 = void 0; - { - invokeGuardedCallback$1(null, commitAllLifeCycles, null); - if (hasCaughtError()) { - _didError = true; - _error2 = clearCaughtError(); - } - } - if (_didError) { - !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0; - captureError(nextEffect, _error2); - if (nextEffect !== null) { - nextEffect = nextEffect.nextEffect; - } - } - } - - isCommitting = false; - isWorking = false; - stopCommitLifeCyclesTimer(); - stopCommitTimer(); - if (typeof onCommitRoot === 'function') { - onCommitRoot(finishedWork.stateNode); - } - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork); - } - - // If we caught any errors during this commit, schedule their boundaries - // to update. - if (commitPhaseBoundaries) { - commitPhaseBoundaries.forEach(scheduleErrorRecovery); - commitPhaseBoundaries = null; - } - - if (firstUncaughtError !== null) { - var _error3 = firstUncaughtError; - firstUncaughtError = null; - onUncaughtError(_error3); - } - - var remainingTime = root.current.expirationTime; - - if (remainingTime === NoWork) { - capturedErrors = null; - failedBoundaries = null; - } - - return remainingTime; - } - - function resetExpirationTime(workInProgress, renderTime) { - if (renderTime !== Never && workInProgress.expirationTime === Never) { - // The children of this component are hidden. Don't bubble their - // expiration times. - return; - } - - // Check for pending updates. - var newExpirationTime = getUpdateExpirationTime(workInProgress); - - // TODO: Calls need to visit stateNode - - // Bubble up the earliest expiration time. - var child = workInProgress.child; - while (child !== null) { - if (child.expirationTime !== NoWork && (newExpirationTime === NoWork || newExpirationTime > child.expirationTime)) { - newExpirationTime = child.expirationTime; - } - child = child.sibling; - } - workInProgress.expirationTime = newExpirationTime; - } - - function completeUnitOfWork(workInProgress) { - while (true) { - // The current, flushed, state of this fiber is the alternate. - // Ideally nothing should rely on this, but relying on it here - // means that we don't need an additional field on the work in - // progress. - var current = workInProgress.alternate; - { - ReactDebugCurrentFiber.setCurrentFiber(workInProgress); - } - var next = completeWork(current, workInProgress, nextRenderExpirationTime); - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - - var returnFiber = workInProgress['return']; - var siblingFiber = workInProgress.sibling; - - resetExpirationTime(workInProgress, nextRenderExpirationTime); - - if (next !== null) { - stopWorkTimer(workInProgress); - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); - } - // If completing this work spawned new work, do that next. We'll come - // back here again. - return next; - } - - if (returnFiber !== null) { - // Append all the effects of the subtree and this fiber onto the effect - // list of the parent. The completion order of the children affects the - // side-effect order. - if (returnFiber.firstEffect === null) { - returnFiber.firstEffect = workInProgress.firstEffect; - } - if (workInProgress.lastEffect !== null) { - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = workInProgress.firstEffect; - } - returnFiber.lastEffect = workInProgress.lastEffect; - } - - // If this fiber had side-effects, we append it AFTER the children's - // side-effects. We can perform certain side-effects earlier if - // needed, by doing multiple passes over the effect list. We don't want - // to schedule our own side-effect on our own list because if end up - // reusing children we'll schedule this effect onto itself since we're - // at the end. - var effectTag = workInProgress.effectTag; - // Skip both NoWork and PerformedWork tags when creating the effect list. - // PerformedWork effect is read by React DevTools but shouldn't be committed. - if (effectTag > PerformedWork) { - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = workInProgress; - } else { - returnFiber.firstEffect = workInProgress; - } - returnFiber.lastEffect = workInProgress; - } - } - - stopWorkTimer(workInProgress); - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); - } - - if (siblingFiber !== null) { - // If there is more work to do in this returnFiber, do that next. - return siblingFiber; - } else if (returnFiber !== null) { - // If there's no more work in this returnFiber. Complete the returnFiber. - workInProgress = returnFiber; - continue; - } else { - // We've reached the root. - var root = workInProgress.stateNode; - root.isReadyForCommit = true; - return null; - } - } - - // Without this explicit null return Flow complains of invalid return type - // TODO Remove the above while(true) loop - // eslint-disable-next-line no-unreachable - return null; - } - - function performUnitOfWork(workInProgress) { - // The current, flushed, state of this fiber is the alternate. - // Ideally nothing should rely on this, but relying on it here - // means that we don't need an additional field on the work in - // progress. - var current = workInProgress.alternate; - - // See if beginning this work spawns more work. - startWorkTimer(workInProgress); - { - ReactDebugCurrentFiber.setCurrentFiber(workInProgress); - } - - var next = beginWork(current, workInProgress, nextRenderExpirationTime); - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress); - } - - if (next === null) { - // If this doesn't spawn new work, complete the current work. - next = completeUnitOfWork(workInProgress); - } - - ReactCurrentOwner.current = null; - - return next; - } - - function performFailedUnitOfWork(workInProgress) { - // The current, flushed, state of this fiber is the alternate. - // Ideally nothing should rely on this, but relying on it here - // means that we don't need an additional field on the work in - // progress. - var current = workInProgress.alternate; - - // See if beginning this work spawns more work. - startWorkTimer(workInProgress); - { - ReactDebugCurrentFiber.setCurrentFiber(workInProgress); - } - var next = beginFailedWork(current, workInProgress, nextRenderExpirationTime); - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress); - } - - if (next === null) { - // If this doesn't spawn new work, complete the current work. - next = completeUnitOfWork(workInProgress); - } - - ReactCurrentOwner.current = null; - - return next; - } - - function workLoop(expirationTime) { - if (capturedErrors !== null) { - // If there are unhandled errors, switch to the slow work loop. - // TODO: How to avoid this check in the fast path? Maybe the renderer - // could keep track of which roots have unhandled errors and call a - // forked version of renderRoot. - slowWorkLoopThatChecksForFailedWork(expirationTime); - return; - } - if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) { - return; - } - - if (nextRenderExpirationTime <= mostRecentCurrentTime) { - // Flush all expired work. - while (nextUnitOfWork !== null) { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } else { - // Flush asynchronous work until the deadline runs out of time. - while (nextUnitOfWork !== null && !shouldYield()) { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } - } - - function slowWorkLoopThatChecksForFailedWork(expirationTime) { - if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) { - return; - } - - if (nextRenderExpirationTime <= mostRecentCurrentTime) { - // Flush all expired work. - while (nextUnitOfWork !== null) { - if (hasCapturedError(nextUnitOfWork)) { - // Use a forked version of performUnitOfWork - nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork); - } else { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } - } else { - // Flush asynchronous work until the deadline runs out of time. - while (nextUnitOfWork !== null && !shouldYield()) { - if (hasCapturedError(nextUnitOfWork)) { - // Use a forked version of performUnitOfWork - nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork); - } else { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } - } - } - - function renderRootCatchBlock(root, failedWork, boundary, expirationTime) { - // We're going to restart the error boundary that captured the error. - // Conceptually, we're unwinding the stack. We need to unwind the - // context stack, too. - unwindContexts(failedWork, boundary); - - // Restart the error boundary using a forked version of - // performUnitOfWork that deletes the boundary's children. The entire - // failed subree will be unmounted. During the commit phase, a special - // lifecycle method is called on the error boundary, which triggers - // a re-render. - nextUnitOfWork = performFailedUnitOfWork(boundary); - - // Continue working. - workLoop(expirationTime); - } - - function renderRoot(root, expirationTime) { - !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; - isWorking = true; - - // We're about to mutate the work-in-progress tree. If the root was pending - // commit, it no longer is: we'll need to complete it again. - root.isReadyForCommit = false; - - // Check if we're starting from a fresh stack, or if we're resuming from - // previously yielded work. - if (root !== nextRoot || expirationTime !== nextRenderExpirationTime || nextUnitOfWork === null) { - // Reset the stack and start working from the root. - resetContextStack(); - nextRoot = root; - nextRenderExpirationTime = expirationTime; - nextUnitOfWork = createWorkInProgress(nextRoot.current, null, expirationTime); - } - - startWorkLoopTimer(nextUnitOfWork); - - var didError = false; - var error = null; - { - invokeGuardedCallback$1(null, workLoop, null, expirationTime); - if (hasCaughtError()) { - didError = true; - error = clearCaughtError(); - } - } - - // An error was thrown during the render phase. - while (didError) { - if (didFatal) { - // This was a fatal error. Don't attempt to recover from it. - firstUncaughtError = error; - break; - } - - var failedWork = nextUnitOfWork; - if (failedWork === null) { - // An error was thrown but there's no current unit of work. This can - // happen during the commit phase if there's a bug in the renderer. - didFatal = true; - continue; - } - - // "Capture" the error by finding the nearest boundary. If there is no - // error boundary, we use the root. - var boundary = captureError(failedWork, error); - !(boundary !== null) ? invariant(false, 'Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - if (didFatal) { - // The error we just captured was a fatal error. This happens - // when the error propagates to the root more than once. - continue; - } - - didError = false; - error = null; - { - invokeGuardedCallback$1(null, renderRootCatchBlock, null, root, failedWork, boundary, expirationTime); - if (hasCaughtError()) { - didError = true; - error = clearCaughtError(); - continue; - } - } - // We're finished working. Exit the error loop. - break; - } - - var uncaughtError = firstUncaughtError; - - // We're done performing work. Time to clean up. - stopWorkLoopTimer(interruptedBy); - interruptedBy = null; - isWorking = false; - didFatal = false; - firstUncaughtError = null; - - if (uncaughtError !== null) { - onUncaughtError(uncaughtError); - } - - return root.isReadyForCommit ? root.current.alternate : null; - } - - // Returns the boundary that captured the error, or null if the error is ignored - function captureError(failedWork, error) { - // It is no longer valid because we exited the user code. - ReactCurrentOwner.current = null; - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - - // Search for the nearest error boundary. - var boundary = null; - - // Passed to logCapturedError() - var errorBoundaryFound = false; - var willRetry = false; - var errorBoundaryName = null; - - // Host containers are a special case. If the failed work itself is a host - // container, then it acts as its own boundary. In all other cases, we - // ignore the work itself and only search through the parents. - if (failedWork.tag === HostRoot) { - boundary = failedWork; - - if (isFailedBoundary(failedWork)) { - // If this root already failed, there must have been an error when - // attempting to unmount it. This is a worst-case scenario and - // should only be possible if there's a bug in the renderer. - didFatal = true; - } - } else { - var node = failedWork['return']; - while (node !== null && boundary === null) { - if (node.tag === ClassComponent) { - var instance = node.stateNode; - if (typeof instance.componentDidCatch === 'function') { - errorBoundaryFound = true; - errorBoundaryName = getComponentName(node); - - // Found an error boundary! - boundary = node; - willRetry = true; - } - } else if (node.tag === HostRoot) { - // Treat the root like a no-op error boundary - boundary = node; - } - - if (isFailedBoundary(node)) { - // This boundary is already in a failed state. - - // If we're currently unmounting, that means this error was - // thrown while unmounting a failed subtree. We should ignore - // the error. - if (isUnmounting) { - return null; - } - - // If we're in the commit phase, we should check to see if - // this boundary already captured an error during this commit. - // This case exists because multiple errors can be thrown during - // a single commit without interruption. - if (commitPhaseBoundaries !== null && (commitPhaseBoundaries.has(node) || node.alternate !== null && commitPhaseBoundaries.has(node.alternate))) { - // If so, we should ignore this error. - return null; - } - - // The error should propagate to the next boundary -— we keep looking. - boundary = null; - willRetry = false; - } - - node = node['return']; - } - } - - if (boundary !== null) { - // Add to the collection of failed boundaries. This lets us know that - // subsequent errors in this subtree should propagate to the next boundary. - if (failedBoundaries === null) { - failedBoundaries = new Set(); - } - failedBoundaries.add(boundary); - - // This method is unsafe outside of the begin and complete phases. - // We might be in the commit phase when an error is captured. - // The risk is that the return path from this Fiber may not be accurate. - // That risk is acceptable given the benefit of providing users more context. - var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork); - var _componentName = getComponentName(failedWork); - - // Add to the collection of captured errors. This is stored as a global - // map of errors and their component stack location keyed by the boundaries - // that capture them. We mostly use this Map as a Set; it's a Map only to - // avoid adding a field to Fiber to store the error. - if (capturedErrors === null) { - capturedErrors = new Map(); - } - - var capturedError = { - componentName: _componentName, - componentStack: _componentStack, - error: error, - errorBoundary: errorBoundaryFound ? boundary.stateNode : null, - errorBoundaryFound: errorBoundaryFound, - errorBoundaryName: errorBoundaryName, - willRetry: willRetry - }; - - capturedErrors.set(boundary, capturedError); - - try { - logCapturedError(capturedError); - } catch (e) { - // Prevent cycle if logCapturedError() throws. - // A cycle may still occur if logCapturedError renders a component that throws. - var suppressLogging = e && e.suppressReactErrorLogging; - if (!suppressLogging) { - console.error(e); - } - } - - // If we're in the commit phase, defer scheduling an update on the - // boundary until after the commit is complete - if (isCommitting) { - if (commitPhaseBoundaries === null) { - commitPhaseBoundaries = new Set(); - } - commitPhaseBoundaries.add(boundary); - } else { - // Otherwise, schedule an update now. - // TODO: Is this actually necessary during the render phase? Is it - // possible to unwind and continue rendering at the same priority, - // without corrupting internal state? - scheduleErrorRecovery(boundary); - } - return boundary; - } else if (firstUncaughtError === null) { - // If no boundary is found, we'll need to throw the error - firstUncaughtError = error; - } - return null; - } - - function hasCapturedError(fiber) { - // TODO: capturedErrors should store the boundary instance, to avoid needing - // to check the alternate. - return capturedErrors !== null && (capturedErrors.has(fiber) || fiber.alternate !== null && capturedErrors.has(fiber.alternate)); - } - - function isFailedBoundary(fiber) { - // TODO: failedBoundaries should store the boundary instance, to avoid - // needing to check the alternate. - return failedBoundaries !== null && (failedBoundaries.has(fiber) || fiber.alternate !== null && failedBoundaries.has(fiber.alternate)); - } - - function commitErrorHandling(effectfulFiber) { - var capturedError = void 0; - if (capturedErrors !== null) { - capturedError = capturedErrors.get(effectfulFiber); - capturedErrors['delete'](effectfulFiber); - if (capturedError == null) { - if (effectfulFiber.alternate !== null) { - effectfulFiber = effectfulFiber.alternate; - capturedError = capturedErrors.get(effectfulFiber); - capturedErrors['delete'](effectfulFiber); - } - } - } - - !(capturedError != null) ? invariant(false, 'No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - switch (effectfulFiber.tag) { - case ClassComponent: - var instance = effectfulFiber.stateNode; - - var info = { - componentStack: capturedError.componentStack - }; - - // Allow the boundary to handle the error, usually by scheduling - // an update to itself - instance.componentDidCatch(capturedError.error, info); - return; - case HostRoot: - if (firstUncaughtError === null) { - firstUncaughtError = capturedError.error; - } - return; - default: - invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.'); - } - } - - function unwindContexts(from, to) { - var node = from; - while (node !== null) { - switch (node.tag) { - case ClassComponent: - popContextProvider(node); - break; - case HostComponent: - popHostContext(node); - break; - case HostRoot: - popHostContainer(node); - break; - case HostPortal: - popHostContainer(node); - break; - } - if (node === to || node.alternate === to) { - stopFailedWorkTimer(node); - break; - } else { - stopWorkTimer(node); - } - node = node['return']; - } - } - - function computeAsyncExpiration() { - // Given the current clock time, returns an expiration time. We use rounding - // to batch like updates together. - // Should complete within ~1000ms. 1200ms max. - var currentTime = recalculateCurrentTime(); - var expirationMs = 1000; - var bucketSizeMs = 200; - return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs); - } - - function computeExpirationForFiber(fiber) { - var expirationTime = void 0; - if (expirationContext !== NoWork) { - // An explicit expiration context was set; - expirationTime = expirationContext; - } else if (isWorking) { - if (isCommitting) { - // Updates that occur during the commit phase should have sync priority - // by default. - expirationTime = Sync; - } else { - // Updates during the render phase should expire at the same time as - // the work that is being rendered. - expirationTime = nextRenderExpirationTime; - } - } else { - // No explicit expiration context was set, and we're not currently - // performing work. Calculate a new expiration time. - if (useSyncScheduling && !(fiber.internalContextTag & AsyncUpdates)) { - // This is a sync update - expirationTime = Sync; - } else { - // This is an async update - expirationTime = computeAsyncExpiration(); - } - } - return expirationTime; - } - - function scheduleWork(fiber, expirationTime) { - return scheduleWorkImpl(fiber, expirationTime, false); - } - - function checkRootNeedsClearing(root, fiber, expirationTime) { - if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) { - // Restart the root from the top. - if (nextUnitOfWork !== null) { - // This is an interruption. (Used for performance tracking.) - interruptedBy = fiber; - } - nextRoot = null; - nextUnitOfWork = null; - nextRenderExpirationTime = NoWork; - } - } - - function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) { - recordScheduleUpdate(); - - { - if (!isErrorRecovery && fiber.tag === ClassComponent) { - var instance = fiber.stateNode; - warnAboutInvalidUpdates(instance); - } - } - - var node = fiber; - while (node !== null) { - // Walk the parent path to the root and update each node's - // expiration time. - if (node.expirationTime === NoWork || node.expirationTime > expirationTime) { - node.expirationTime = expirationTime; - } - if (node.alternate !== null) { - if (node.alternate.expirationTime === NoWork || node.alternate.expirationTime > expirationTime) { - node.alternate.expirationTime = expirationTime; - } - } - if (node['return'] === null) { - if (node.tag === HostRoot) { - var root = node.stateNode; - - checkRootNeedsClearing(root, fiber, expirationTime); - requestWork(root, expirationTime); - checkRootNeedsClearing(root, fiber, expirationTime); - } else { - { - if (!isErrorRecovery && fiber.tag === ClassComponent) { - warnAboutUpdateOnUnmounted(fiber); - } - } - return; - } - } - node = node['return']; - } - } - - function scheduleErrorRecovery(fiber) { - scheduleWorkImpl(fiber, Sync, true); - } - - function recalculateCurrentTime() { - // Subtract initial time so it fits inside 32bits - var ms = now() - startTime; - mostRecentCurrentTime = msToExpirationTime(ms); - return mostRecentCurrentTime; - } - - function deferredUpdates(fn) { - var previousExpirationContext = expirationContext; - expirationContext = computeAsyncExpiration(); - try { - return fn(); - } finally { - expirationContext = previousExpirationContext; - } - } - - function syncUpdates(fn) { - var previousExpirationContext = expirationContext; - expirationContext = Sync; - try { - return fn(); - } finally { - expirationContext = previousExpirationContext; - } - } - - // TODO: Everything below this is written as if it has been lifted to the - // renderers. I'll do this in a follow-up. - - // Linked-list of roots - var firstScheduledRoot = null; - var lastScheduledRoot = null; - - var callbackExpirationTime = NoWork; - var callbackID = -1; - var isRendering = false; - var nextFlushedRoot = null; - var nextFlushedExpirationTime = NoWork; - var deadlineDidExpire = false; - var hasUnhandledError = false; - var unhandledError = null; - var deadline = null; - - var isBatchingUpdates = false; - var isUnbatchingUpdates = false; - - // Use these to prevent an infinite loop of nested updates - var NESTED_UPDATE_LIMIT = 1000; - var nestedUpdateCount = 0; - - var timeHeuristicForUnitOfWork = 1; - - function scheduleCallbackWithExpiration(expirationTime) { - if (callbackExpirationTime !== NoWork) { - // A callback is already scheduled. Check its expiration time (timeout). - if (expirationTime > callbackExpirationTime) { - // Existing callback has sufficient timeout. Exit. - return; - } else { - // Existing callback has insufficient timeout. Cancel and schedule a - // new one. - cancelDeferredCallback(callbackID); - } - // The request callback timer is already running. Don't start a new one. - } else { - startRequestCallbackTimer(); - } - - // Compute a timeout for the given expiration time. - var currentMs = now() - startTime; - var expirationMs = expirationTimeToMs(expirationTime); - var timeout = expirationMs - currentMs; - - callbackExpirationTime = expirationTime; - callbackID = scheduleDeferredCallback(performAsyncWork, { timeout: timeout }); - } - - // requestWork is called by the scheduler whenever a root receives an update. - // It's up to the renderer to call renderRoot at some point in the future. - function requestWork(root, expirationTime) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { - invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.'); - } - - // Add the root to the schedule. - // Check if this root is already part of the schedule. - if (root.nextScheduledRoot === null) { - // This root is not already scheduled. Add it. - root.remainingExpirationTime = expirationTime; - if (lastScheduledRoot === null) { - firstScheduledRoot = lastScheduledRoot = root; - root.nextScheduledRoot = root; - } else { - lastScheduledRoot.nextScheduledRoot = root; - lastScheduledRoot = root; - lastScheduledRoot.nextScheduledRoot = firstScheduledRoot; - } - } else { - // This root is already scheduled, but its priority may have increased. - var remainingExpirationTime = root.remainingExpirationTime; - if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) { - // Update the priority. - root.remainingExpirationTime = expirationTime; - } - } - - if (isRendering) { - // Prevent reentrancy. Remaining work will be scheduled at the end of - // the currently rendering batch. - return; - } - - if (isBatchingUpdates) { - // Flush work at the end of the batch. - if (isUnbatchingUpdates) { - // ...unless we're inside unbatchedUpdates, in which case we should - // flush it now. - nextFlushedRoot = root; - nextFlushedExpirationTime = Sync; - performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); - } - return; - } - - // TODO: Get rid of Sync and use current time? - if (expirationTime === Sync) { - performWork(Sync, null); - } else { - scheduleCallbackWithExpiration(expirationTime); - } - } - - function findHighestPriorityRoot() { - var highestPriorityWork = NoWork; - var highestPriorityRoot = null; - - if (lastScheduledRoot !== null) { - var previousScheduledRoot = lastScheduledRoot; - var root = firstScheduledRoot; - while (root !== null) { - var remainingExpirationTime = root.remainingExpirationTime; - if (remainingExpirationTime === NoWork) { - // This root no longer has work. Remove it from the scheduler. - - // TODO: This check is redudant, but Flow is confused by the branch - // below where we set lastScheduledRoot to null, even though we break - // from the loop right after. - !(previousScheduledRoot !== null && lastScheduledRoot !== null) ? invariant(false, 'Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.') : void 0; - if (root === root.nextScheduledRoot) { - // This is the only root in the list. - root.nextScheduledRoot = null; - firstScheduledRoot = lastScheduledRoot = null; - break; - } else if (root === firstScheduledRoot) { - // This is the first root in the list. - var next = root.nextScheduledRoot; - firstScheduledRoot = next; - lastScheduledRoot.nextScheduledRoot = next; - root.nextScheduledRoot = null; - } else if (root === lastScheduledRoot) { - // This is the last root in the list. - lastScheduledRoot = previousScheduledRoot; - lastScheduledRoot.nextScheduledRoot = firstScheduledRoot; - root.nextScheduledRoot = null; - break; - } else { - previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot; - root.nextScheduledRoot = null; - } - root = previousScheduledRoot.nextScheduledRoot; - } else { - if (highestPriorityWork === NoWork || remainingExpirationTime < highestPriorityWork) { - // Update the priority, if it's higher - highestPriorityWork = remainingExpirationTime; - highestPriorityRoot = root; - } - if (root === lastScheduledRoot) { - break; - } - previousScheduledRoot = root; - root = root.nextScheduledRoot; - } - } - } - - // If the next root is the same as the previous root, this is a nested - // update. To prevent an infinite loop, increment the nested update count. - var previousFlushedRoot = nextFlushedRoot; - if (previousFlushedRoot !== null && previousFlushedRoot === highestPriorityRoot) { - nestedUpdateCount++; - } else { - // Reset whenever we switch roots. - nestedUpdateCount = 0; - } - nextFlushedRoot = highestPriorityRoot; - nextFlushedExpirationTime = highestPriorityWork; - } - - function performAsyncWork(dl) { - performWork(NoWork, dl); - } - - function performWork(minExpirationTime, dl) { - deadline = dl; - - // Keep working on roots until there's no more work, or until the we reach - // the deadline. - findHighestPriorityRoot(); - - if (enableUserTimingAPI && deadline !== null) { - var didExpire = nextFlushedExpirationTime < recalculateCurrentTime(); - stopRequestCallbackTimer(didExpire); - } - - while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) { - performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); - // Find the next highest priority work. - findHighestPriorityRoot(); - } - - // We're done flushing work. Either we ran out of time in this callback, - // or there's no more work left with sufficient priority. - - // If we're inside a callback, set this to false since we just completed it. - if (deadline !== null) { - callbackExpirationTime = NoWork; - callbackID = -1; - } - // If there's work left over, schedule a new callback. - if (nextFlushedExpirationTime !== NoWork) { - scheduleCallbackWithExpiration(nextFlushedExpirationTime); - } - - // Clean-up. - deadline = null; - deadlineDidExpire = false; - nestedUpdateCount = 0; - - if (hasUnhandledError) { - var _error4 = unhandledError; - unhandledError = null; - hasUnhandledError = false; - throw _error4; - } - } - - function performWorkOnRoot(root, expirationTime) { - !!isRendering ? invariant(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - isRendering = true; - - // Check if this is async work or sync/expired work. - // TODO: Pass current time as argument to renderRoot, commitRoot - if (expirationTime <= recalculateCurrentTime()) { - // Flush sync work. - var finishedWork = root.finishedWork; - if (finishedWork !== null) { - // This root is already complete. We can commit it. - root.finishedWork = null; - root.remainingExpirationTime = commitRoot(finishedWork); - } else { - root.finishedWork = null; - finishedWork = renderRoot(root, expirationTime); - if (finishedWork !== null) { - // We've completed the root. Commit it. - root.remainingExpirationTime = commitRoot(finishedWork); - } - } - } else { - // Flush async work. - var _finishedWork = root.finishedWork; - if (_finishedWork !== null) { - // This root is already complete. We can commit it. - root.finishedWork = null; - root.remainingExpirationTime = commitRoot(_finishedWork); - } else { - root.finishedWork = null; - _finishedWork = renderRoot(root, expirationTime); - if (_finishedWork !== null) { - // We've completed the root. Check the deadline one more time - // before committing. - if (!shouldYield()) { - // Still time left. Commit the root. - root.remainingExpirationTime = commitRoot(_finishedWork); - } else { - // There's no time left. Mark this root as complete. We'll come - // back and commit it later. - root.finishedWork = _finishedWork; - } - } - } - } - - isRendering = false; - } - - // When working on async work, the reconciler asks the renderer if it should - // yield execution. For DOM, we implement this with requestIdleCallback. - function shouldYield() { - if (deadline === null) { - return false; - } - if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { - // Disregard deadline.didTimeout. Only expired work should be flushed - // during a timeout. This path is only hit for non-expired work. - return false; - } - deadlineDidExpire = true; - return true; - } - - // TODO: Not happy about this hook. Conceptually, renderRoot should return a - // tuple of (isReadyForCommit, didError, error) - function onUncaughtError(error) { - !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0; - // Unschedule this root so we don't work on it again until there's - // another update. - nextFlushedRoot.remainingExpirationTime = NoWork; - if (!hasUnhandledError) { - hasUnhandledError = true; - unhandledError = error; - } - } - - // TODO: Batching should be implemented at the renderer level, not inside - // the reconciler. - function batchedUpdates(fn, a) { - var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingUpdates = true; - try { - return fn(a); - } finally { - isBatchingUpdates = previousIsBatchingUpdates; - if (!isBatchingUpdates && !isRendering) { - performWork(Sync, null); - } - } - } - - // TODO: Batching should be implemented at the renderer level, not inside - // the reconciler. - function unbatchedUpdates(fn) { - if (isBatchingUpdates && !isUnbatchingUpdates) { - isUnbatchingUpdates = true; - try { - return fn(); - } finally { - isUnbatchingUpdates = false; - } - } - return fn(); - } - - // TODO: Batching should be implemented at the renderer level, not within - // the reconciler. - function flushSync(fn) { - var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingUpdates = true; - try { - return syncUpdates(fn); - } finally { - isBatchingUpdates = previousIsBatchingUpdates; - !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0; - performWork(Sync, null); - } - } - - return { - computeAsyncExpiration: computeAsyncExpiration, - computeExpirationForFiber: computeExpirationForFiber, - scheduleWork: scheduleWork, - batchedUpdates: batchedUpdates, - unbatchedUpdates: unbatchedUpdates, - flushSync: flushSync, - deferredUpdates: deferredUpdates - }; -}; - -{ - var didWarnAboutNestedUpdates = false; -} - -// 0 is PROD, 1 is DEV. -// Might add PROFILE later. - - -function getContextForSubtree(parentComponent) { - if (!parentComponent) { - return emptyObject; - } - - var fiber = get(parentComponent); - var parentContext = findCurrentUnmaskedContext(fiber); - return isContextProvider(fiber) ? processChildContext(fiber, parentContext) : parentContext; -} - -var ReactFiberReconciler$1 = function (config) { - var getPublicInstance = config.getPublicInstance; - - var _ReactFiberScheduler = ReactFiberScheduler(config), - computeAsyncExpiration = _ReactFiberScheduler.computeAsyncExpiration, - computeExpirationForFiber = _ReactFiberScheduler.computeExpirationForFiber, - scheduleWork = _ReactFiberScheduler.scheduleWork, - batchedUpdates = _ReactFiberScheduler.batchedUpdates, - unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, - flushSync = _ReactFiberScheduler.flushSync, - deferredUpdates = _ReactFiberScheduler.deferredUpdates; - - function scheduleTopLevelUpdate(current, element, callback) { - { - if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) { - didWarnAboutNestedUpdates = true; - warning(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(ReactDebugCurrentFiber.current) || 'Unknown'); - } - } - - callback = callback === undefined ? null : callback; - { - warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback); - } - - var expirationTime = void 0; - // Check if the top-level element is an async wrapper component. If so, - // treat updates to the root as async. This is a bit weird but lets us - // avoid a separate `renderAsync` API. - if (enableAsyncSubtreeAPI && element != null && element.type != null && element.type.prototype != null && element.type.prototype.unstable_isAsyncReactComponent === true) { - expirationTime = computeAsyncExpiration(); - } else { - expirationTime = computeExpirationForFiber(current); - } - - var update = { - expirationTime: expirationTime, - partialState: { element: element }, - callback: callback, - isReplace: false, - isForced: false, - nextCallback: null, - next: null - }; - insertUpdateIntoFiber(current, update); - scheduleWork(current, expirationTime); - } - - function findHostInstance(fiber) { - var hostFiber = findCurrentHostFiber(fiber); - if (hostFiber === null) { - return null; - } - return hostFiber.stateNode; - } - - return { - createContainer: function (containerInfo, hydrate) { - return createFiberRoot(containerInfo, hydrate); - }, - updateContainer: function (element, container, parentComponent, callback) { - // TODO: If this is a nested container, this won't be the root. - var current = container.current; - - { - if (ReactFiberInstrumentation_1.debugTool) { - if (current.alternate === null) { - ReactFiberInstrumentation_1.debugTool.onMountContainer(container); - } else if (element === null) { - ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container); - } else { - ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container); - } - } - } - - var context = getContextForSubtree(parentComponent); - if (container.context === null) { - container.context = context; - } else { - container.pendingContext = context; - } - - scheduleTopLevelUpdate(current, element, callback); - }, - - - batchedUpdates: batchedUpdates, - - unbatchedUpdates: unbatchedUpdates, - - deferredUpdates: deferredUpdates, - - flushSync: flushSync, - - getPublicRootInstance: function (container) { - var containerFiber = container.current; - if (!containerFiber.child) { - return null; - } - switch (containerFiber.child.tag) { - case HostComponent: - return getPublicInstance(containerFiber.child.stateNode); - default: - return containerFiber.child.stateNode; - } - }, - - - findHostInstance: findHostInstance, - - findHostInstanceWithNoPortals: function (fiber) { - var hostFiber = findCurrentHostFiberWithNoPortals(fiber); - if (hostFiber === null) { - return null; - } - return hostFiber.stateNode; - }, - injectIntoDevTools: function (devToolsConfig) { - var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; - - return injectInternals(_assign({}, devToolsConfig, { - findHostInstanceByFiber: function (fiber) { - return findHostInstance(fiber); - }, - findFiberByHostInstance: function (instance) { - if (!findFiberByHostInstance) { - // Might not be implemented by the renderer. - return null; - } - return findFiberByHostInstance(instance); - } - })); - } - }; -}; - -var ReactFiberReconciler$2 = Object.freeze({ - default: ReactFiberReconciler$1 -}); - -var ReactFiberReconciler$3 = ( ReactFiberReconciler$2 && ReactFiberReconciler$1 ) || ReactFiberReconciler$2; - -// TODO: bundle Flow types with the package. - - - -// TODO: decide on the top-level export form. -// This is hacky but makes it work with both Rollup and Jest. -var reactReconciler = ReactFiberReconciler$3['default'] ? ReactFiberReconciler$3['default'] : ReactFiberReconciler$3; - -function createPortal$1(children, containerInfo, -// TODO: figure out the API for cross-renderer implementation. -implementation) { - var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - return { - // This tag allow us to uniquely identify this as a React Portal - $$typeof: REACT_PORTAL_TYPE, - key: key == null ? null : '' + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; -} - -// TODO: this is special because it gets imported during build. - -var ReactVersion = '16.2.0'; - -// a requestAnimationFrame, storing the time for the start of the frame, then -// scheduling a postMessage which gets scheduled after paint. Within the -// postMessage handler do as much work as possible until time + frame rate. -// By separating the idle call into a separate event tick we ensure that -// layout, paint and other browser work is counted against the available time. -// The frame rate is dynamically adjusted. - -{ - if (ExecutionEnvironment.canUseDOM && typeof requestAnimationFrame !== 'function') { - warning(false, 'React depends on requestAnimationFrame. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills'); - } -} - -var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; - -var now = void 0; -if (hasNativePerformanceNow) { - now = function () { - return performance.now(); - }; -} else { - now = function () { - return Date.now(); - }; -} - -// TODO: There's no way to cancel, because Fiber doesn't atm. -var rIC = void 0; -var cIC = void 0; - -if (!ExecutionEnvironment.canUseDOM) { - rIC = function (frameCallback) { - return setTimeout(function () { - frameCallback({ - timeRemaining: function () { - return Infinity; - } - }); - }); - }; - cIC = function (timeoutID) { - clearTimeout(timeoutID); - }; -} else if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { - // Polyfill requestIdleCallback and cancelIdleCallback - - var scheduledRICCallback = null; - var isIdleScheduled = false; - var timeoutTime = -1; - - var isAnimationFrameScheduled = false; - - var frameDeadline = 0; - // We start out assuming that we run at 30fps but then the heuristic tracking - // will adjust this value to a faster fps if we get more frequent animation - // frames. - var previousFrameTime = 33; - var activeFrameTime = 33; - - var frameDeadlineObject; - if (hasNativePerformanceNow) { - frameDeadlineObject = { - didTimeout: false, - timeRemaining: function () { - // We assume that if we have a performance timer that the rAF callback - // gets a performance timer value. Not sure if this is always true. - var remaining = frameDeadline - performance.now(); - return remaining > 0 ? remaining : 0; - } - }; - } else { - frameDeadlineObject = { - didTimeout: false, - timeRemaining: function () { - // Fallback to Date.now() - var remaining = frameDeadline - Date.now(); - return remaining > 0 ? remaining : 0; - } - }; - } - - // We use the postMessage trick to defer idle work until after the repaint. - var messageKey = '__reactIdleCallback$' + Math.random().toString(36).slice(2); - var idleTick = function (event) { - if (event.source !== window || event.data !== messageKey) { - return; - } - - isIdleScheduled = false; - - var currentTime = now(); - if (frameDeadline - currentTime <= 0) { - // There's no time left in this idle period. Check if the callback has - // a timeout and whether it's been exceeded. - if (timeoutTime !== -1 && timeoutTime <= currentTime) { - // Exceeded the timeout. Invoke the callback even though there's no - // time left. - frameDeadlineObject.didTimeout = true; - } else { - // No timeout. - if (!isAnimationFrameScheduled) { - // Schedule another animation callback so we retry later. - isAnimationFrameScheduled = true; - requestAnimationFrame(animationTick); - } - // Exit without invoking the callback. - return; - } - } else { - // There's still time left in this idle period. - frameDeadlineObject.didTimeout = false; - } - - timeoutTime = -1; - var callback = scheduledRICCallback; - scheduledRICCallback = null; - if (callback !== null) { - callback(frameDeadlineObject); - } - }; - // Assumes that we have addEventListener in this environment. Might need - // something better for old IE. - window.addEventListener('message', idleTick, false); - - var animationTick = function (rafTime) { - isAnimationFrameScheduled = false; - var nextFrameTime = rafTime - frameDeadline + activeFrameTime; - if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) { - if (nextFrameTime < 8) { - // Defensive coding. We don't support higher frame rates than 120hz. - // If we get lower than that, it is probably a bug. - nextFrameTime = 8; - } - // If one frame goes long, then the next one can be short to catch up. - // If two frames are short in a row, then that's an indication that we - // actually have a higher frame rate than what we're currently optimizing. - // We adjust our heuristic dynamically accordingly. For example, if we're - // running on 120hz display or 90hz VR display. - // Take the max of the two in case one of them was an anomaly due to - // missed frame deadlines. - activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime; - } else { - previousFrameTime = nextFrameTime; - } - frameDeadline = rafTime + activeFrameTime; - if (!isIdleScheduled) { - isIdleScheduled = true; - window.postMessage(messageKey, '*'); - } - }; - - rIC = function (callback, options) { - // This assumes that we only schedule one callback at a time because that's - // how Fiber uses it. - scheduledRICCallback = callback; - if (options != null && typeof options.timeout === 'number') { - timeoutTime = now() + options.timeout; - } - if (!isAnimationFrameScheduled) { - // If rAF didn't already schedule one, we need to schedule a frame. - // TODO: If this rAF doesn't materialize because the browser throttles, we - // might want to still have setTimeout trigger rIC as a backup to ensure - // that we keep performing work. - isAnimationFrameScheduled = true; - requestAnimationFrame(animationTick); - } - return 0; - }; - - cIC = function () { - scheduledRICCallback = null; - isIdleScheduled = false; - timeoutTime = -1; - }; -} else { - rIC = window.requestIdleCallback; - cIC = window.cancelIdleCallback; -} - -/** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var lowPriorityWarning = function () {}; - -{ - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -var lowPriorityWarning$1 = lowPriorityWarning; - -// isAttributeNameSafe() is currently duplicated in DOMMarkupOperations. -// TODO: Find a better place for this. -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { - return true; - } - if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { - return false; - } - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - { - warning(false, 'Invalid attribute name: `%s`', attributeName); - } - return false; -} - -// shouldIgnoreValue() is currently duplicated in DOMMarkupOperations. -// TODO: Find a better place for this. -function shouldIgnoreValue(propertyInfo, value) { - return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; -} - -/** - * Operations for dealing with DOM properties. - */ - - - - - -/** - * Get the value for a property on a node. Only used in DEV for SSR validation. - * The "expected" argument is used as a hint of what the expected value is. - * Some properties have multiple equivalent values. - */ -function getValueForProperty(node, name, expected) { - { - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod || propertyInfo.mustUseProperty) { - return node[propertyInfo.propertyName]; - } else { - var attributeName = propertyInfo.attributeName; - - var stringValue = null; - - if (propertyInfo.hasOverloadedBooleanValue) { - if (node.hasAttribute(attributeName)) { - var value = node.getAttribute(attributeName); - if (value === '') { - return true; - } - if (shouldIgnoreValue(propertyInfo, expected)) { - return value; - } - if (value === '' + expected) { - return expected; - } - return value; - } - } else if (node.hasAttribute(attributeName)) { - if (shouldIgnoreValue(propertyInfo, expected)) { - // We had an attribute but shouldn't have had one, so read it - // for the error message. - return node.getAttribute(attributeName); - } - if (propertyInfo.hasBooleanValue) { - // If this was a boolean, it doesn't matter what the value is - // the fact that we have it is the same as the expected. - return expected; - } - // Even if this property uses a namespace we use getAttribute - // because we assume its namespaced name is the same as our config. - // To use getAttributeNS we need the local name which we don't have - // in our config atm. - stringValue = node.getAttribute(attributeName); - } - - if (shouldIgnoreValue(propertyInfo, expected)) { - return stringValue === null ? expected : stringValue; - } else if (stringValue === '' + expected) { - return expected; - } else { - return stringValue; - } - } - } - } -} - -/** - * Get the value for a attribute on a node. Only used in DEV for SSR validation. - * The third argument is used as a hint of what the expected value is. Some - * attributes have multiple equivalent values. - */ -function getValueForAttribute(node, name, expected) { - { - if (!isAttributeNameSafe(name)) { - return; - } - if (!node.hasAttribute(name)) { - return expected === undefined ? undefined : null; - } - var value = node.getAttribute(name); - if (value === '' + expected) { - return expected; - } - return value; - } -} - -/** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ -function setValueForProperty(node, name, value) { - var propertyInfo = getPropertyInfo(name); - - if (propertyInfo && shouldSetAttribute(name, value)) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(propertyInfo, value)) { - deleteValueForProperty(node, name); - return; - } else if (propertyInfo.mustUseProperty) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propertyInfo.propertyName] = value; - } else { - var attributeName = propertyInfo.attributeName; - var namespace = propertyInfo.attributeNamespace; - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - if (namespace) { - node.setAttributeNS(namespace, attributeName, '' + value); - } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - node.setAttribute(attributeName, ''); - } else { - node.setAttribute(attributeName, '' + value); - } - } - } else { - setValueForAttribute(node, name, shouldSetAttribute(name, value) ? value : null); - return; - } - - { - - } -} - -function setValueForAttribute(node, name, value) { - if (!isAttributeNameSafe(name)) { - return; - } - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } - - { - - } -} - -/** - * Deletes an attributes from a node. - * - * @param {DOMElement} node - * @param {string} name - */ -function deleteValueForAttribute(node, name) { - node.removeAttribute(name); -} - -/** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ -function deleteValueForProperty(node, name) { - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (propertyInfo.mustUseProperty) { - var propName = propertyInfo.propertyName; - if (propertyInfo.hasBooleanValue) { - node[propName] = false; - } else { - node[propName] = ''; - } - } else { - node.removeAttribute(propertyInfo.attributeName); - } - } else { - node.removeAttribute(name); - } -} - -var ReactControlledValuePropTypes = { - checkPropTypes: null -}; - -{ - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - - var propTypes = { - value: function (props, propName, componentName) { - if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { - return null; - } - return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - }, - checked: function (props, propName, componentName) { - if (!props[propName] || props.onChange || props.readOnly || props.disabled) { - return null; - } - return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - }; - - /** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ - ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) { - checkPropTypes(propTypes, props, 'prop', tagName, getStack); - }; -} - -// TODO: direct imports like some-package/src/* are bad. Fix me. -var getCurrentFiberOwnerName$2 = ReactDebugCurrentFiber.getCurrentFiberOwnerName; -var getCurrentFiberStackAddendum$3 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; - -var didWarnValueDefaultValue = false; -var didWarnCheckedDefaultChecked = false; -var didWarnControlledToUncontrolled = false; -var didWarnUncontrolledToControlled = false; - -function isControlled(props) { - var usesChecked = props.type === 'checkbox' || props.type === 'radio'; - return usesChecked ? props.checked != null : props.value != null; -} - -/** - * Implements an host component that allows setting these optional - * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. - * - * If `checked` or `value` are not supplied (or null/undefined), user actions - * that affect the checked state or value will trigger updates to the element. - * - * If they are supplied (and not null/undefined), the rendered element will not - * trigger updates to the element. Instead, the props must change in order for - * the rendered element to be updated. - * - * The rendered element will be initialized as unchecked (or `defaultChecked`) - * with an empty value (or `defaultValue`). - * - * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html - */ - -function getHostProps(element, props) { - var node = element; - var value = props.value; - var checked = props.checked; - - var hostProps = _assign({ - // Make sure we set .type before any other properties (setting .value - // before .type means .value is lost in IE11 and below) - type: undefined, - // Make sure we set .step before .value (setting .value before .step - // means .value is rounded on mount, based upon step precision) - step: undefined, - // Make sure we set .min & .max before .value (to ensure proper order - // in corner cases such as min or max deriving from value, e.g. Issue #7170) - min: undefined, - max: undefined - }, props, { - defaultChecked: undefined, - defaultValue: undefined, - value: value != null ? value : node._wrapperState.initialValue, - checked: checked != null ? checked : node._wrapperState.initialChecked - }); - - return hostProps; -} - -function initWrapperState(element, props) { - { - ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum$3); - - if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type); - didWarnCheckedDefaultChecked = true; - } - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type); - didWarnValueDefaultValue = true; - } - } - - var defaultValue = props.defaultValue; - var node = element; - node._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: props.value != null ? props.value : defaultValue, - controlled: isControlled(props) - }; -} - -function updateChecked(element, props) { - var node = element; - var checked = props.checked; - if (checked != null) { - setValueForProperty(node, 'checked', checked); - } -} - -function updateWrapper(element, props) { - var node = element; - { - var controlled = isControlled(props); - - if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - warning(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3()); - didWarnUncontrolledToControlled = true; - } - if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - warning(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3()); - didWarnControlledToUncontrolled = true; - } - } - - updateChecked(element, props); - - var value = props.value; - if (value != null) { - if (value === 0 && node.value === '') { - node.value = '0'; - // Note: IE9 reports a number inputs as 'text', so check props instead. - } else if (props.type === 'number') { - // Simulate `input.valueAsNumber`. IE9 does not support it - var valueAsNumber = parseFloat(node.value) || 0; - - if ( - // eslint-disable-next-line - value != valueAsNumber || - // eslint-disable-next-line - value == valueAsNumber && node.value != value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else if (node.value !== '' + value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else { - if (props.value == null && props.defaultValue != null) { - // In Chrome, assigning defaultValue to certain input types triggers input validation. - // For number inputs, the display value loses trailing decimal points. For email inputs, - // Chrome raises "The specified value is not a valid email address". - // - // Here we check to see if the defaultValue has actually changed, avoiding these problems - // when the user is inputting text - // - // https://github.com/facebook/react/issues/7253 - if (node.defaultValue !== '' + props.defaultValue) { - node.defaultValue = '' + props.defaultValue; - } - } - if (props.checked == null && props.defaultChecked != null) { - node.defaultChecked = !!props.defaultChecked; - } - } -} - -function postMountWrapper(element, props) { - var node = element; - - // Detach value from defaultValue. We won't do anything if we're working on - // submit or reset inputs as those values & defaultValues are linked. They - // are not resetable nodes so this operation doesn't matter and actually - // removes browser-default values (eg "Submit Query") when no value is - // provided. - - switch (props.type) { - case 'submit': - case 'reset': - break; - case 'color': - case 'date': - case 'datetime': - case 'datetime-local': - case 'month': - case 'time': - case 'week': - // This fixes the no-show issue on iOS Safari and Android Chrome: - // https://github.com/facebook/react/issues/7233 - node.value = ''; - node.value = node.defaultValue; - break; - default: - node.value = node.value; - break; - } - - // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug - // this is needed to work around a chrome bug where setting defaultChecked - // will sometimes influence the value of checked (even after detachment). - // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 - // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - if (name !== '') { - node.name = ''; - } - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !node.defaultChecked; - if (name !== '') { - node.name = name; - } -} - -function restoreControlledState$1(element, props) { - var node = element; - updateWrapper(node, props); - updateNamedCousins(node, props); -} - -function updateNamedCousins(rootNode, props) { - var name = props.name; - if (props.type === 'radio' && name != null) { - var queryRoot = rootNode; - - while (queryRoot.parentNode) { - queryRoot = queryRoot.parentNode; - } - - // If `rootNode.form` was non-null, then we could try `form.elements`, - // but that sometimes behaves strangely in IE8. We could also try using - // `form.getElementsByName`, but that will only return direct children - // and won't include inputs that use the HTML5 `form=` attribute. Since - // the input might not even be in a form. It might not even be in the - // document. Let's just use the local `querySelectorAll` to ensure we don't - // miss anything. - var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); - - for (var i = 0; i < group.length; i++) { - var otherNode = group[i]; - if (otherNode === rootNode || otherNode.form !== rootNode.form) { - continue; - } - // This will throw if radio buttons rendered by different copies of React - // and the same name are rendered into the same form (same as #1939). - // That's probably okay; we don't support it just as we don't support - // mixing React radio buttons with non-React ones. - var otherProps = getFiberCurrentPropsFromNode$1(otherNode); - !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0; - - // We need update the tracked value on the named cousin since the value - // was changed but the input saw no event or value set - updateValueIfChanged(otherNode); - - // If this is a controlled radio button group, forcing the input that - // was previously checked to update will cause it to be come re-checked - // as appropriate. - updateWrapper(otherNode, otherProps); - } - } -} - -function flattenChildren(children) { - var content = ''; - - // Flatten children and warn if they aren't strings or numbers; - // invalid types are ignored. - // We can silently skip them because invalid DOM nesting warning - // catches these cases in Fiber. - React.Children.forEach(children, function (child) { - if (child == null) { - return; - } - if (typeof child === 'string' || typeof child === 'number') { - content += child; - } - }); - - return content; -} - -/** - * Implements an