var gramjs = /******/ (function(modules) { // webpackBootstrap /******/ // 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: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // 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, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // 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 = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./gramjs/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./gramjs/Helpers.js": /*!***************************!*\ !*** ./gramjs/Helpers.js ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var crypto = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n/**\n * use this instead of ** because of webpack\n * @param a {bigint}\n * @param b {bigint}\n * @returns {bigint}\n */\n\n\nfunction bigIntPower(a, b) {\n var i;\n var pow = BigInt(1);\n\n for (i = BigInt(0); i < b; i++) {\n pow = pow * a;\n }\n\n return pow;\n}\n/**\n * converts a buffer to big int\n * @param buffer\n * @param little\n * @param signed\n * @returns {bigint}\n */\n\n\nfunction readBigIntFromBuffer(buffer) {\n var little = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var signed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var randBuffer = Buffer.from(buffer);\n var bytesNumber = randBuffer.length;\n\n if (little) {\n randBuffer = randBuffer.reverse();\n }\n\n var bigInt = BigInt('0x' + randBuffer.toString('hex'));\n\n if (signed && Math.floor(bigInt.toString('2').length / 8) >= bytesNumber) {\n bigInt -= bigIntPower(BigInt(2), BigInt(bytesNumber * 8));\n }\n\n return bigInt;\n}\n/**\n * converts a big int to a buffer\n * @param bigInt\n * @param bytesNumber\n * @param little\n * @param signed\n * @returns {Buffer}\n */\n\n\nfunction readBufferFromBigInt(bigInt, bytesNumber) {\n var little = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var signed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var bitLength = bigInt.toString('2').length;\n var bytes = Math.ceil(bitLength / 8);\n\n if (bytesNumber < bytes) {\n throw new Error('OverflowError: int too big to convert');\n }\n\n if (!signed && bigInt < 0) {\n throw new Error('Cannot convert to unsigned');\n }\n\n var below = false;\n\n if (bigInt < 0) {\n below = true;\n bigInt = -bigInt;\n }\n\n var hex = bigInt.toString('16').padStart(bytesNumber * 2, '0');\n var l = Buffer.from(hex, 'hex');\n\n if (little) {\n l = l.reverse();\n }\n\n if (signed && below) {\n if (little) {\n l[0] = 256 - l[0];\n\n for (var i = 1; i < l.length; i++) {\n l[i] = 255 - l[i];\n }\n } else {\n l[l.length - 1] = 256 - l[l.length - 1];\n\n for (var _i = 0; _i < l.length - 1; _i++) {\n l[_i] = 255 - l[_i];\n }\n }\n }\n\n return l;\n}\n/**\n * Generates a random long integer (8 bytes), which is optionally signed\n * @returns {BigInt}\n */\n\n\nfunction generateRandomLong() {\n var signed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n return readBigIntFromBuffer(generateRandomBytes(8), true, signed);\n}\n/**\n * .... really javascript\n * @param n {number}\n * @param m {number}\n * @returns {number}\n */\n\n\nfunction mod(n, m) {\n return (n % m + m) % m;\n}\n/**\n * Generates a random bytes array\n * @param count\n * @returns {Buffer}\n */\n\n\nfunction generateRandomBytes(count) {\n return crypto.randomBytes(count);\n}\n/**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param sharedKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n\n\nfunction calcKey(sharedKey, msgKey, client) {\n var x = client === true ? 0 : 8;\n var sha1a = sha1(Buffer.concat([msgKey, sharedKey.slice(x, x + 32)]));\n var sha1b = sha1(Buffer.concat([sharedKey.slice(x + 32, x + 48), msgKey, sharedKey.slice(x + 48, x + 64)]));\n var sha1c = sha1(Buffer.concat([sharedKey.slice(x + 64, x + 96), msgKey]));\n var sha1d = sha1(Buffer.concat([msgKey, sharedKey.slice(x + 96, x + 128)]));\n var key = Buffer.concat([sha1a.slice(0, 8), sha1b.slice(8, 20), sha1c.slice(4, 16)]);\n var iv = Buffer.concat([sha1a.slice(8, 20), sha1b.slice(0, 8), sha1c.slice(16, 20), sha1d.slice(0, 8)]);\n return {\n key: key,\n iv: iv\n };\n}\n/**\n * Calculates the message key from the given data\n * @param data\n * @returns {Buffer}\n */\n\n\nfunction calcMsgKey(data) {\n return sha1(data).slice(4, 20);\n}\n/**\n * Generates the key data corresponding to the given nonces\n * @param serverNonce\n * @param newNonce\n * @returns {{key: Buffer, iv: Buffer}}\n */\n\n\nfunction generateKeyDataFromNonce(serverNonce, newNonce) {\n serverNonce = readBufferFromBigInt(serverNonce, 16, true, true);\n newNonce = readBufferFromBigInt(newNonce, 32, true, true);\n var hash1 = sha1(Buffer.concat([newNonce, serverNonce]));\n var hash2 = sha1(Buffer.concat([serverNonce, newNonce]));\n var hash3 = sha1(Buffer.concat([newNonce, newNonce]));\n var keyBuffer = Buffer.concat([hash1, hash2.slice(0, 12)]);\n var ivBuffer = Buffer.concat([hash2.slice(12, 20), hash3, newNonce.slice(0, 4)]);\n return {\n key: keyBuffer,\n iv: ivBuffer\n };\n}\n/**\n * Calculates the SHA1 digest for the given data\n * @param data\n * @returns {Buffer}\n */\n\n\nfunction sha1(data) {\n var shaSum = crypto.createHash('sha1');\n shaSum.update(data);\n return shaSum.digest();\n}\n/**\n * Calculates the SHA256 digest for the given data\n * @param data\n * @returns {Buffer}\n */\n\n\nfunction sha256(data) {\n var shaSum = crypto.createHash('sha256');\n shaSum.update(data);\n return shaSum.digest();\n}\n/**\n * Fast mod pow for RSA calculation. a^b % n\n * @param a\n * @param b\n * @param n\n * @returns {bigint}\n */\n\n\nfunction modExp(a, b, n) {\n a = a % n;\n var result = BigInt(1);\n var x = a;\n\n while (b > BigInt(0)) {\n var leastSignificantBit = b % BigInt(2);\n b = b / BigInt(2);\n\n if (leastSignificantBit === BigInt(1)) {\n result = result * x;\n result = result % n;\n }\n\n x = x * x;\n x = x % n;\n }\n\n return result;\n}\n/**\n * returns a random int from min (inclusive) and max (inclusive)\n * @param min\n * @param max\n * @returns {number}\n */\n\n\nfunction getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n/**\n * Sleeps a specified amount of time\n * @param ms time in milliseconds\n * @returns {Promise}\n */\n\n\nvar sleep = function sleep(ms) {\n return new Promise(function (resolve) {\n return setTimeout(resolve, ms);\n });\n};\n/**\n * Checks if the obj is an array\n * @param obj\n * @returns {boolean}\n */\n\n\nfunction isArrayLike(obj) {\n if (!obj) return false;\n var l = obj.length;\n if (typeof l != 'number' || l < 0) return false;\n if (Math.floor(l) !== l) return false; // fast check\n\n if (l > 0 && !(l - 1 in obj)) return false; // more complete check (optional)\n\n for (var i = 0; i < l; ++i) {\n if (!(i in obj)) return false;\n }\n\n return true;\n}\n\nmodule.exports = {\n readBigIntFromBuffer: readBigIntFromBuffer,\n readBufferFromBigInt: readBufferFromBigInt,\n generateRandomLong: generateRandomLong,\n mod: mod,\n generateRandomBytes: generateRandomBytes,\n calcKey: calcKey,\n calcMsgKey: calcMsgKey,\n generateKeyDataFromNonce: generateKeyDataFromNonce,\n sha1: sha1,\n sha256: sha256,\n modExp: modExp,\n getRandomInt: getRandomInt,\n sleep: sleep,\n isArrayLike: isArrayLike\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/Helpers.js?"); /***/ }), /***/ "./gramjs/Password.js": /*!****************************!*\ !*** ./gramjs/Password.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar Factorizator = __webpack_require__(/*! ./crypto/Factorizator */ \"./gramjs/crypto/Factorizator.js\");\n\nvar _require = __webpack_require__(/*! ./tl */ \"./gramjs/tl/index.js\"),\n types = _require.types;\n\nvar _require2 = __webpack_require__(/*! ./Helpers */ \"./gramjs/Helpers.js\"),\n readBigIntFromBuffer = _require2.readBigIntFromBuffer,\n readBufferFromBigInt = _require2.readBufferFromBigInt,\n sha256 = _require2.sha256,\n modExp = _require2.modExp,\n generateRandomBytes = _require2.generateRandomBytes;\n\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar SIZE_FOR_HASH = 256;\n/**\n *\n *\n * @param prime{BigInt}\n * @param g{BigInt}\n */\n\nfunction checkPrimeAndGoodCheck(prime, g) {\n var goodPrimeBitsCount = 2048;\n\n if (prime < 0 || prime.toString('2').length !== goodPrimeBitsCount) {\n throw new Error(\"bad prime count \".concat(prime.toString('2').length, \",expected \").concat(goodPrimeBitsCount));\n } // TODO this is kinda slow\n\n\n if (Factorizator.factorize(prime)[0] !== 1) {\n throw new Error('give \"prime\" is not prime');\n }\n\n if (g === BigInt(2)) {\n if (prime % BigInt(8) !== BigInt(7)) {\n throw new Error(\"bad g \".concat(g, \", mod8 \").concat(prime % 8));\n }\n } else if (g === BigInt(3)) {\n if (prime % BigInt(3) !== BigInt(2)) {\n throw new Error(\"bad g \".concat(g, \", mod3 \").concat(prime % 3));\n } // eslint-disable-next-line no-empty\n\n } else if (g === BigInt(4)) {} else if (g === BigInt(5)) {\n if (![BigInt(1), BigInt(4)].includes(prime % BigInt(5))) {\n throw new Error(\"bad g \".concat(g, \", mod8 \").concat(prime % 5));\n }\n } else if (g === BigInt(6)) {\n if (![BigInt(19), BigInt(23)].includes(prime % BigInt(24))) {\n throw new Error(\"bad g \".concat(g, \", mod8 \").concat(prime % 24));\n }\n } else if (g === BigInt(7)) {\n if (![BigInt(3), BigInt(5), BigInt(6)].includes(prime % BigInt(7))) {\n throw new Error(\"bad g \".concat(g, \", mod8 \").concat(prime % 7));\n }\n } else {\n throw new Error(\"bad g \".concat(g));\n }\n\n var primeSub1Div2 = (prime - BigInt(1)) / BigInt(2);\n\n if (Factorizator.factorize(primeSub1Div2)[0] !== 1) {\n throw new Error('(prime - 1) // 2 is not prime');\n }\n}\n/**\n *\n * @param primeBytes{Buffer}\n * @param g{number}\n */\n\n\nfunction checkPrimeAndGood(primeBytes, g) {\n var goodPrime = Buffer.from([0xC7, 0x1C, 0xAE, 0xB9, 0xC6, 0xB1, 0xC9, 0x04, 0x8E, 0x6C, 0x52, 0x2F, 0x70, 0xF1, 0x3F, 0x73, 0x98, 0x0D, 0x40, 0x23, 0x8E, 0x3E, 0x21, 0xC1, 0x49, 0x34, 0xD0, 0x37, 0x56, 0x3D, 0x93, 0x0F, 0x48, 0x19, 0x8A, 0x0A, 0xA7, 0xC1, 0x40, 0x58, 0x22, 0x94, 0x93, 0xD2, 0x25, 0x30, 0xF4, 0xDB, 0xFA, 0x33, 0x6F, 0x6E, 0x0A, 0xC9, 0x25, 0x13, 0x95, 0x43, 0xAE, 0xD4, 0x4C, 0xCE, 0x7C, 0x37, 0x20, 0xFD, 0x51, 0xF6, 0x94, 0x58, 0x70, 0x5A, 0xC6, 0x8C, 0xD4, 0xFE, 0x6B, 0x6B, 0x13, 0xAB, 0xDC, 0x97, 0x46, 0x51, 0x29, 0x69, 0x32, 0x84, 0x54, 0xF1, 0x8F, 0xAF, 0x8C, 0x59, 0x5F, 0x64, 0x24, 0x77, 0xFE, 0x96, 0xBB, 0x2A, 0x94, 0x1D, 0x5B, 0xCD, 0x1D, 0x4A, 0xC8, 0xCC, 0x49, 0x88, 0x07, 0x08, 0xFA, 0x9B, 0x37, 0x8E, 0x3C, 0x4F, 0x3A, 0x90, 0x60, 0xBE, 0xE6, 0x7C, 0xF9, 0xA4, 0xA4, 0xA6, 0x95, 0x81, 0x10, 0x51, 0x90, 0x7E, 0x16, 0x27, 0x53, 0xB5, 0x6B, 0x0F, 0x6B, 0x41, 0x0D, 0xBA, 0x74, 0xD8, 0xA8, 0x4B, 0x2A, 0x14, 0xB3, 0x14, 0x4E, 0x0E, 0xF1, 0x28, 0x47, 0x54, 0xFD, 0x17, 0xED, 0x95, 0x0D, 0x59, 0x65, 0xB4, 0xB9, 0xDD, 0x46, 0x58, 0x2D, 0xB1, 0x17, 0x8D, 0x16, 0x9C, 0x6B, 0xC4, 0x65, 0xB0, 0xD6, 0xFF, 0x9C, 0xA3, 0x92, 0x8F, 0xEF, 0x5B, 0x9A, 0xE4, 0xE4, 0x18, 0xFC, 0x15, 0xE8, 0x3E, 0xBE, 0xA0, 0xF8, 0x7F, 0xA9, 0xFF, 0x5E, 0xED, 0x70, 0x05, 0x0D, 0xED, 0x28, 0x49, 0xF4, 0x7B, 0xF9, 0x59, 0xD9, 0x56, 0x85, 0x0C, 0xE9, 0x29, 0x85, 0x1F, 0x0D, 0x81, 0x15, 0xF6, 0x35, 0xB1, 0x05, 0xEE, 0x2E, 0x4E, 0x15, 0xD0, 0x4B, 0x24, 0x54, 0xBF, 0x6F, 0x4F, 0xAD, 0xF0, 0x34, 0xB1, 0x04, 0x03, 0x11, 0x9C, 0xD8, 0xE3, 0xB9, 0x2F, 0xCC, 0x5B]);\n\n if (goodPrime.equals(primeBytes)) {\n if ([3, 4, 5, 7].includes(g)) {\n return; // It's good\n }\n }\n\n checkPrimeAndGoodCheck(readBigIntFromBuffer(primeBytes, false), g);\n}\n/**\n *\n * @param number{BigInt}\n * @param p{BigInt}\n * @returns {boolean}\n */\n\n\nfunction isGoodLarge(number, p) {\n return number > BigInt(0) && p - number > BigInt(0);\n}\n/**\n *\n * @param number {Buffer}\n * @returns {Buffer}\n */\n\n\nfunction numBytesForHash(number) {\n return Buffer.concat([Buffer.alloc(SIZE_FOR_HASH - number.length), number]);\n}\n/**\n *\n * @param g {Buffer}\n * @returns {Buffer}\n */\n\n\nfunction bigNumForHash(g) {\n return readBufferFromBigInt(g, SIZE_FOR_HASH, false);\n}\n/**\n *\n * @param modexp\n * @param prime\n * @returns {Boolean}\n */\n\n\nfunction isGoodModExpFirst(modexp, prime) {\n var diff = prime - modexp;\n var minDiffBitsCount = 2048 - 64;\n var maxModExpSize = 256;\n return !(diff < 0 || diff.toString('2').length < minDiffBitsCount || modexp.toString('2').length < minDiffBitsCount || Math.floor((modexp.toString('2').length + 7) / 8) > maxModExpSize);\n}\n\nfunction xor(a, b) {\n var length = Math.min(a.length, b.length);\n\n for (var i = 0; i < length; i++) {\n a[i] = a[i] ^ b[i];\n }\n\n return a;\n}\n/**\n *\n * @param password{Buffer}\n * @param salt{Buffer}\n * @param iterations{number}\n * @returns {*}\n */\n\n\nfunction pbkdf2sha512(password, salt, iterations) {\n return crypto.pbkdf2Sync(password, salt, iterations, 64, 'sha512');\n}\n/**\n *\n * @param algo {types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n * @returns {Buffer|*}\n */\n\n\nfunction computeHash(algo, password) {\n var hash1 = sha256(Buffer.concat([algo.salt1, Buffer.from(password, 'utf-8'), algo.salt1]));\n var hash2 = sha256(Buffer.concat([algo.salt2, hash1, algo.salt2]));\n var hash3 = pbkdf2sha512(hash2, algo.salt1, 100000);\n return sha256(Buffer.concat([algo.salt2, hash3, algo.salt2]));\n}\n/**\n *\n * @param algo {types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}\n * @param password\n */\n\n\nfunction computeDigest(algo, password) {\n try {\n checkPrimeAndGood(algo.p, algo.g);\n } catch (e) {\n throw new Error('bad p/g in password');\n }\n\n var value = modExp(BigInt(algo.g), readBigIntFromBuffer(computeHash(algo, password), false), readBigIntFromBuffer(algo.p, false));\n return bigNumForHash(value);\n}\n/**\n *\n * @param request {types.account.Password}\n * @param password {string}\n */\n\n\nfunction computeCheck(request, password) {\n var algo = request.currentAlgo;\n\n if (!(algo instanceof types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {\n throw new Error(\"Unsupported password algorithm \".concat(algo.constructor.name));\n }\n\n var pwHash = computeHash(algo, password);\n var p = readBigIntFromBuffer(algo.p, false);\n var g = algo.g;\n var B = readBigIntFromBuffer(request.srp_B, false);\n\n try {\n checkPrimeAndGood(algo.p, g);\n } catch (e) {\n throw new Error('bad /g in password');\n }\n\n if (!isGoodLarge(B, p)) {\n throw new Error('bad b in check');\n }\n\n var x = readBigIntFromBuffer(pwHash, false);\n var pForHash = numBytesForHash(algo.p);\n var gForHash = bigNumForHash(g);\n var bForHash = numBytesForHash(request.srp_B);\n var gX = modExp(BigInt(g), x, p);\n var k = readBigIntFromBuffer(sha256(Buffer.concat([pForHash, gForHash])), false);\n var kgX = k * gX % p;\n\n var generateAndCheckRandom = function generateAndCheckRandom() {\n var randomSize = 256; // eslint-disable-next-line no-constant-condition\n\n while (true) {\n var random = generateRandomBytes(randomSize);\n\n var _a = readBigIntFromBuffer(random, false);\n\n var A = modExp(BigInt(g), _a, p);\n\n if (isGoodModExpFirst(A, p)) {\n var _aForHash = bigNumForHash(A);\n\n var _u = readBigIntFromBuffer(sha256(Buffer.concat([_aForHash, bForHash])), false);\n\n if (_u > BigInt(0)) {\n return [_a, _aForHash, _u];\n }\n }\n }\n };\n\n var _generateAndCheckRand = generateAndCheckRandom(),\n _generateAndCheckRand2 = _slicedToArray(_generateAndCheckRand, 3),\n a = _generateAndCheckRand2[0],\n aForHash = _generateAndCheckRand2[1],\n u = _generateAndCheckRand2[2];\n\n var gB = (B - kgX) % p;\n\n if (!isGoodModExpFirst(gB, p)) {\n throw new Error('bad gB');\n }\n\n var ux = u * x;\n var aUx = a + ux;\n var S = modExp(gB, aUx, p);\n var K = sha256(bigNumForHash(S));\n var M1 = sha256(Buffer.concat([xor(sha256(pForHash), sha256(gForHash)), sha256(algo.salt1), sha256(algo.salt2), aForHash, bForHash, K]));\n return new types.InputCheckPasswordSRP({\n srpId: request.srpId,\n A: Buffer.from(aForHash),\n M1: M1\n });\n}\n\nmodule.exports = {\n computeCheck: computeCheck,\n computeDigest: computeDigest\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/Password.js?"); /***/ }), /***/ "./gramjs/Utils.js": /*!*************************!*\ !*** ./gramjs/Utils.js ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar _require = __webpack_require__(/*! ./tl */ \"./gramjs/tl/index.js\"),\n types = _require.types;\n\nvar USERNAME_RE = new RegExp('@|(?:https?:\\\\/\\\\/)?(?:www\\\\.)?' + '(?:telegram\\\\.(?:me|dog)|t\\\\.me)\\\\/(@|joinchat\\\\/)?');\nvar TG_JOIN_RE = new RegExp('tg:\\\\/\\\\/(join)\\\\?invite=');\nvar VALID_USERNAME_RE = new RegExp('^([a-z]((?!__)[\\\\w\\\\d]){3,30}[a-z\\\\d]|gif|vid|' + 'pic|bing|wiki|imdb|bold|vote|like|coub)$');\n\nfunction _raiseCastFail(entity, target) {\n throw new Error(\"Cannot cast \".concat(entity.constructor.name, \" to any kind of \").concat(target));\n}\n/**\n Gets the input peer for the given \"entity\" (user, chat or channel).\n\n A ``TypeError`` is raised if the given entity isn't a supported type\n or if ``check_hash is True`` but the entity's ``access_hash is None``\n *or* the entity contains ``min`` information. In this case, the hash\n cannot be used for general purposes, and thus is not returned to avoid\n any issues which can derive from invalid access hashes.\n\n Note that ``check_hash`` **is ignored** if an input peer is already\n passed since in that case we assume the user knows what they're doing.\n This is key to getting entities by explicitly passing ``hash = 0``.\n\n * @param entity\n * @param allowSelf\n * @param checkHash\n */\n\n\nfunction getInputPeer(entity) {\n var allowSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var checkHash = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n if (entity.SUBCLASS_OF_ID === undefined) {\n // e.g. custom.Dialog (can't cyclic import).\n if (allowSelf && 'inputEntity' in entity) {\n return entity.inputEntity;\n } else if ('entity' in entity) {\n return getInputPeer(entity.entity);\n } else {\n _raiseCastFail(entity, 'InputPeer');\n }\n }\n\n if (entity.SUBCLASS_OF_ID === 0xc91c90b6) {\n // crc32(b'InputPeer')\n return entity;\n }\n\n if (entity instanceof types.User) {\n if (entity.isSelf && allowSelf) {\n return new types.InputPeerSelf();\n } else if (entity.accessHash !== undefined && !entity.min || !checkHash) {\n return new types.InputPeerUser({\n userId: entity.id,\n accessHash: entity.accessHash\n });\n } else {\n throw new Error('User without access_hash or min info cannot be input');\n }\n }\n\n if (entity instanceof types.Chat || entity instanceof types.ChatEmpty || entity instanceof types.ChatForbidden) {\n return new types.InputPeerChat({\n chatId: entity.id\n });\n }\n\n if (entity instanceof types.Channel) {\n if (entity.accessHash !== undefined && !entity.min || checkHash) {\n return new types.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash\n });\n } else {\n throw new TypeError('Channel without access_hash or min info cannot be input');\n }\n }\n\n if (entity instanceof types.ChannelForbidden) {\n // \"channelForbidden are never min\", and since their hash is\n // also not optional, we assume that this truly is the case.\n return new types.InputPeerChannel({\n channelId: entity.id,\n accessHash: entity.accessHash\n });\n }\n\n if (entity instanceof types.InputUser) {\n return new types.InputPeerUser({\n userId: entity.userId,\n accessHash: entity.accessHash\n });\n }\n\n if (entity instanceof types.InputChannel) {\n return new types.InputPeerChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash\n });\n }\n\n if (entity instanceof types.UserEmpty) {\n return new types.InputPeerEmpty();\n }\n\n if (entity instanceof types.UserFull) {\n return getInputPeer(entity.user);\n }\n\n if (entity instanceof types.ChatFull) {\n return new types.InputPeerChat({\n chatId: entity.id\n });\n }\n\n if (entity instanceof types.PeerChat) {\n return new types.InputPeerChat(entity.chat_id);\n }\n\n _raiseCastFail(entity, 'InputPeer');\n}\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputChannel`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n * @returns {InputChannel|*}\n */\n\n\nfunction getInputChannel(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputChannel');\n }\n\n if (entity.SUBCLASS_OF_ID === 0x40f202fd) {\n // crc32(b'InputChannel')\n return entity;\n }\n\n if (entity instanceof types.Channel || entity instanceof types.ChannelForbidden) {\n return new types.InputChannel({\n channelId: entity.id,\n accessHash: entity.accessHash || 0\n });\n }\n\n if (entity instanceof types.InputPeerChannel) {\n return new types.InputChannel({\n channelId: entity.channelId,\n accessHash: entity.accessHash\n });\n }\n\n _raiseCastFail(entity, 'InputChannel');\n}\n/**\n Similar to :meth:`get_input_peer`, but for :tl:`InputUser`'s alone.\n\n .. important::\n\n This method does not validate for invalid general-purpose access\n hashes, unlike `get_input_peer`. Consider using instead:\n ``get_input_channel(get_input_peer(channel))``.\n\n * @param entity\n */\n\n\nfunction getInputUser(entity) {\n if (entity.SUBCLASS_OF_ID === undefined) {\n _raiseCastFail(entity, 'InputUser');\n }\n\n if (entity.SUBCLASS_OF_ID === 0xe669bf46) {\n // crc32(b'InputUser')\n return entity;\n }\n\n if (entity instanceof types.User) {\n if (entity.isSelf) {\n return new types.InputPeerSelf();\n } else {\n return new types.InputUser({\n userId: entity.id,\n accessHash: entity.accessHash || 0\n });\n }\n }\n\n if (entity instanceof types.InputPeerSelf) {\n return new types.InputPeerSelf();\n }\n\n if (entity instanceof types.UserEmpty || entity instanceof types.InputPeerEmpty) {\n return new types.InputUserEmpty();\n }\n\n if (entity instanceof types.UserFull) {\n return getInputUser(entity.user);\n }\n\n if (entity instanceof types.InputPeerUser) {\n return new types.InputUser({\n userId: entity.userId,\n accessHash: entity.accessHash\n });\n }\n\n _raiseCastFail(entity, 'InputUser');\n}\n/**\n Similar to :meth:`get_input_peer`, but for dialogs\n * @param dialog\n */\n\n\nfunction getInputDialog(dialog) {\n try {\n if (dialog.SUBCLASS_OF_ID === 0xa21c9795) {\n // crc32(b'InputDialogPeer')\n return dialog;\n }\n\n if (dialog.SUBCLASS_OF_ID === 0xc91c90b6) {\n // crc32(b'InputPeer')\n return new types.InputDialogPeer({\n peer: dialog\n });\n }\n } catch (e) {\n _raiseCastFail(dialog, 'InputDialogPeer');\n }\n\n try {\n return new types.InputDialogPeer(getInputPeer(dialog)); // eslint-disable-next-line no-empty\n } catch (e) {}\n\n _raiseCastFail(dialog, 'InputDialogPeer');\n}\n\nfunction getInputMessage(message) {\n try {\n if (typeof message == 'number') {\n // This case is really common too\n return new types.InputMessageID({\n id: message\n });\n } else if (message.SUBCLASS_OF_ID === 0x54b6bcc5) {\n // crc32(b'InputMessage')\n return message;\n } else if (message.SUBCLASS_OF_ID === 0x790009e3) {\n // crc32(b'Message')\n return new types.InputMessageID(message.id);\n } // eslint-disable-next-line no-empty\n\n } catch (e) {}\n\n _raiseCastFail(message, 'InputMessage');\n}\n\nfunction getPeer(peer) {\n try {\n if (typeof peer === 'number') {\n var res = resolveId(peer);\n\n if (res[1] === types.PeerChannel) {\n return new res[1]({\n channelId: res[0]\n });\n } else if (res[1] === types.PeerChat) {\n return new res[1]({\n chatId: res[0]\n });\n } else {\n return new res[1]({\n userId: res[0]\n });\n }\n }\n\n if (peer.SUBCLASS_OF_ID === undefined) {\n throw new Error();\n }\n\n if (peer.SUBCLASS_OF_ID === 0x2d45687) {\n return peer;\n } else if (peer instanceof types.contacts.ResolvedPeer || peer instanceof types.InputNotifyPeer || peer instanceof types.TopPeer || peer instanceof types.Dialog || peer instanceof types.DialogPeer) {\n return peer.peer;\n } else if (peer instanceof types.ChannelFull) {\n return new types.PeerChannel({\n channelId: peer.id\n });\n }\n\n if (peer.SUBCLASS_OF_ID === 0x7d7c6f86 || peer.SUBCLASS_OF_ID === 0xd9c7fc18) {\n // ChatParticipant, ChannelParticipant\n return new types.PeerUser({\n userId: peer.userId\n });\n }\n\n peer = getInputPeer(peer, false, false);\n\n if (peer instanceof types.InputPeerUser) {\n return new types.PeerUser({\n userId: peer.userId\n });\n } else if (peer instanceof types.InputPeerChat) {\n return new types.PeerChat({\n chatId: peer.chatId\n });\n } else if (peer instanceof types.InputPeerChannel) {\n return new types.PeerChannel({\n channelId: peer.channelId\n });\n } // eslint-disable-next-line no-empty\n\n } catch (e) {\n console.log(e);\n }\n\n _raiseCastFail(peer, 'peer');\n}\n/**\n Convert the given peer into its marked ID by default.\n\n This \"mark\" comes from the \"bot api\" format, and with it the peer type\n can be identified back. User ID is left unmodified, chat ID is negated,\n and channel ID is prefixed with -100:\n\n * ``user_id``\n * ``-chat_id``\n * ``-100channel_id``\n\n The original ID and the peer type class can be returned with\n a call to :meth:`resolve_id(marked_id)`.\n * @param peer\n * @param addMark\n */\n\n\nfunction getPeerId(peer) {\n var addMark = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n // First we assert it's a Peer TLObject, or early return for integers\n if (typeof peer == 'number') {\n return addMark ? peer : resolveId(peer)[0];\n } // Tell the user to use their client to resolve InputPeerSelf if we got one\n\n\n if (peer instanceof types.InputPeerSelf) {\n _raiseCastFail(peer, 'int (you might want to use client.get_peer_id)');\n }\n\n try {\n peer = getPeer(peer);\n } catch (e) {\n console.log(e);\n\n _raiseCastFail(peer, 'int');\n }\n\n if (peer instanceof types.PeerUser) {\n return peer.userId;\n } else if (peer instanceof types.PeerChat) {\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.chatId <= 0x7fffffff)) {\n peer.chatId = resolveId(peer.chatId)[0];\n }\n\n return addMark ? -peer.chatId : peer.chatId;\n } else {\n // if (peer instanceof types.PeerChannel)\n // Check in case the user mixed things up to avoid blowing up\n if (!(0 < peer.channelId <= 0x7fffffff)) {\n peer.channelId = resolveId(peer.channelId)[0];\n }\n\n if (!addMark) {\n return peer.channelId;\n } // Concat -100 through math tricks, .to_supergroup() on\n // Madeline IDs will be strictly positive -> log works.\n\n\n try {\n return -(peer.channelId + Math.pow(10, Math.floor(Math.log10(peer.channelId) + 3)));\n } catch (e) {\n throw new Error('Cannot get marked ID of a channel unless its ID is strictly positive');\n }\n }\n}\n/**\n * Given a marked ID, returns the original ID and its :tl:`Peer` type.\n * @param markedId\n */\n\n\nfunction resolveId(markedId) {\n if (markedId >= 0) {\n return [markedId, types.PeerUser];\n } // There have been report of chat IDs being 10000xyz, which means their\n // marked version is -10000xyz, which in turn looks like a channel but\n // it becomes 00xyz (= xyz). Hence, we must assert that there are only\n // two zeroes.\n\n\n var m = markedId.toString().match(/-100([^0]\\d*)/);\n\n if (m) {\n return [parseInt(m[1]), types.PeerChannel];\n }\n\n return [-markedId, types.PeerChat];\n}\n/**\n * returns an entity pair\n * @param entityId\n * @param entities\n * @param cache\n * @param getInputPeer\n * @returns {{inputEntity: *, entity: *}}\n * @private\n */\n\n\nfunction _getEntityPair(entityId, entities, cache) {\n var getInputPeer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : getInputPeer;\n var entity = entities.get(entityId);\n var inputEntity = cache[entityId];\n\n if (inputEntity === undefined) {\n try {\n inputEntity = getInputPeer(inputEntity);\n } catch (e) {\n inputEntity = null;\n }\n }\n\n return {\n entity: entity,\n inputEntity: inputEntity\n };\n}\n\nfunction getMessageId(message) {\n if (message === null || message === undefined) {\n return null;\n }\n\n if (typeof message == 'number') {\n return message;\n }\n\n if (message.SUBCLASS_OF_ID === 0x790009e3) {\n // crc32(b'Message')\n return message.id;\n }\n\n throw new Error(\"Invalid message type: \".concat(message.constructor.name));\n}\n/**\n * Parses the given phone, or returns `None` if it's invalid.\n * @param phone\n */\n\n\nfunction parsePhone(phone) {\n if (typeof phone === 'number') {\n return phone.toString();\n } else {\n phone = phone.toString().replace(/[+()\\s-]/gm, '');\n\n if (!isNaN(phone)) {\n return phone;\n }\n }\n}\n/**\n Parses the given username or channel access hash, given\n a string, username or URL. Returns a tuple consisting of\n both the stripped, lowercase username and whether it is\n a joinchat/ hash (in which case is not lowercase'd).\n\n Returns ``(None, False)`` if the ``username`` or link is not valid.\n\n * @param username {string}\n */\n\n\nfunction parseUsername(username) {\n username = username.trim();\n var m = username.match(USERNAME_RE) || username.match(TG_JOIN_RE);\n\n if (m) {\n username = username.replace(m[0], '');\n\n if (m[1]) {\n return {\n username: username,\n isInvite: true\n };\n } else {\n username = rtrim(username, '/');\n }\n }\n\n if (username.match(VALID_USERNAME_RE)) {\n return {\n username: username.toLowerCase(),\n isInvite: false\n };\n } else {\n return {\n username: null,\n isInvite: false\n };\n }\n}\n\nfunction rtrim(s, mask) {\n while (~mask.indexOf(s[s.length - 1])) {\n s = s.slice(0, -1);\n }\n\n return s;\n}\n/**\n * Gets the display name for the given :tl:`User`,\n :tl:`Chat` or :tl:`Channel`. Returns an empty string otherwise\n * @param entity\n */\n\n\nfunction getDisplayName(entity) {\n if (entity instanceof types.User) {\n if (entity.lastName && entity.firstName) {\n return \"\".concat(entity.firstName, \" \").concat(entity.lastName);\n } else if (entity.firstName) {\n return entity.firstName;\n } else if (entity.lastName) {\n return entity.lastName;\n } else {\n return '';\n }\n } else if (entity instanceof types.Chat || entity instanceof types.Channel) {\n return entity.title;\n }\n\n return '';\n}\n/**\n * check if a given item is an array like or not\n * @param item\n * @returns {boolean}\n */\n\n\nfunction isListLike(item) {\n return Array.isArray(item) || !!item && _typeof(item) === 'object' && typeof item.length === 'number' && (item.length === 0 || item.length > 0 && item.length - 1 in item);\n}\n\nmodule.exports = {\n getMessageId: getMessageId,\n _getEntityPair: _getEntityPair,\n getInputMessage: getInputMessage,\n getInputDialog: getInputDialog,\n getInputUser: getInputUser,\n getInputChannel: getInputChannel,\n getInputPeer: getInputPeer,\n parsePhone: parsePhone,\n parseUsername: parseUsername,\n getPeer: getPeer,\n getPeerId: getPeerId,\n getDisplayName: getDisplayName,\n resolveId: resolveId,\n isListLike: isListLike\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/Utils.js?"); /***/ }), /***/ "./gramjs/Version.js": /*!***************************!*\ !*** ./gramjs/Version.js ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = '0.0.2';\n\n//# sourceURL=webpack://gramjs/./gramjs/Version.js?"); /***/ }), /***/ "./gramjs/client/TelegramClient.js": /*!*****************************************!*\ !*** ./gramjs/client/TelegramClient.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(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; }\n\nvar Logger = __webpack_require__(/*! ../extensions/Logger */ \"./gramjs/extensions/Logger.js\");\n\nvar _require = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n sleep = _require.sleep;\n\nvar errors = __webpack_require__(/*! ../errors */ \"./gramjs/errors/index.js\");\n\nvar MemorySession = __webpack_require__(/*! ../sessions/Memory */ \"./gramjs/sessions/Memory.js\");\n\nvar _require2 = __webpack_require__(/*! ../crypto/RSA */ \"./gramjs/crypto/RSA.js\"),\n addKey = _require2.addKey;\n\nvar _require3 = __webpack_require__(/*! ../tl/tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLRequest = _require3.TLRequest;\n\nvar utils = __webpack_require__(/*! ../Utils */ \"./gramjs/Utils.js\");\n\nvar Session = __webpack_require__(/*! ../sessions/Abstract */ \"./gramjs/sessions/Abstract.js\");\n\nvar JSONSession = __webpack_require__(/*! ../sessions/JSONSession */ \"./gramjs/sessions/JSONSession.js\");\n\nvar os = __webpack_require__(/*! os */ \"./node_modules/os-browserify/browser.js\");\n\nvar _require4 = __webpack_require__(/*! ../tl/functions/help */ \"./gramjs/tl/functions/help.js\"),\n GetConfigRequest = _require4.GetConfigRequest;\n\nvar _require5 = __webpack_require__(/*! ../tl/AllTLObjects */ \"./gramjs/tl/AllTLObjects.js\"),\n LAYER = _require5.LAYER;\n\nvar _require6 = __webpack_require__(/*! ../tl */ \"./gramjs/tl/index.js\"),\n functions = _require6.functions,\n types = _require6.types;\n\nvar _require7 = __webpack_require__(/*! ../Password */ \"./gramjs/Password.js\"),\n computeCheck = _require7.computeCheck;\n\nvar MTProtoSender = __webpack_require__(/*! ../network/MTProtoSender */ \"./gramjs/network/MTProtoSender.js\");\n\nvar _require8 = __webpack_require__(/*! ../network/connection/TCPObfuscated */ \"./gramjs/network/connection/TCPObfuscated.js\"),\n ConnectionTCPObfuscated = _require8.ConnectionTCPObfuscated;\n\nvar DEFAULT_DC_ID = 4;\nvar DEFAULT_IPV4_IP = '149.154.167.51';\nvar DEFAULT_IPV6_IP = '[2001:67c:4e8:f002::a]';\nvar DEFAULT_PORT = 443;\n\nvar TelegramClient =\n/*#__PURE__*/\nfunction () {\n function TelegramClient(session, apiId, apiHash) {\n var _this = this;\n\n var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : TelegramClient.DEFAULT_OPTIONS;\n\n _classCallCheck(this, TelegramClient);\n\n if (apiId === undefined || apiHash === undefined) {\n throw Error('Your API ID or Hash are invalid. Please read \"Requirements\" on README.md');\n }\n\n var args = _objectSpread({}, TelegramClient.DEFAULT_OPTIONS, {}, opts);\n\n this.apiId = apiId;\n this.apiHash = apiHash;\n this._useIPV6 = args.useIPV6;\n this._entityCache = new Set();\n\n if (typeof args.baseLogger == 'string') {\n this._log = new Logger();\n } else {\n this._log = args.baseLogger;\n } // Determine what session we will use\n\n\n if (typeof session === 'string' || !session) {\n try {\n session = JSONSession.tryLoadOrCreateNew(session);\n } catch (e) {\n console.log(e);\n session = new MemorySession();\n }\n } else if (!(session instanceof Session)) {\n throw new Error('The given session must be str or a session instance');\n }\n\n if (!session.serverAddress || session.serverAddress.includes(':') !== this._useIPV6) {\n session.setDC(DEFAULT_DC_ID, this._useIPV6 ? DEFAULT_IPV6_IP : DEFAULT_IPV4_IP, DEFAULT_PORT);\n }\n\n this.floodSleepLimit = args.floodSleepLimit;\n this._eventBuilders = [];\n this._phoneCodeHash = {};\n this.session = session; // this._entityCache = EntityCache();\n\n this.apiId = parseInt(apiId);\n this.apiHash = apiHash;\n this._requestRetries = args.requestRetries;\n this._connectionRetries = args.connectionRetries;\n this._retryDelay = args.retryDelay || 0;\n\n if (args.proxy) {\n this._log.warn('proxies are not supported');\n }\n\n this._proxy = args.proxy;\n this._timeout = args.timeout;\n this._autoReconnect = args.autoReconnect;\n this._connection = args.connection; // TODO add proxy support\n\n this._floodWaitedRequests = {};\n\n this._initWith = function (x) {\n return new functions.InvokeWithLayerRequest({\n layer: LAYER,\n query: new functions.InitConnectionRequest({\n apiId: _this.apiId,\n deviceModel: args.deviceModel || os.type().toString() || 'Unknown',\n systemVersion: args.systemVersion || os.release().toString() || '1.0',\n appVersion: args.appVersion || '1.0',\n langCode: args.langCode,\n langPack: '',\n // this should be left empty.\n systemLangCode: args.systemLangCode,\n query: x,\n proxy: null // no proxies yet.\n\n })\n });\n }; // These will be set later\n\n\n this._config = null;\n this._sender = new MTProtoSender(this.session.authKey, {\n logger: this._log,\n retries: this._connectionRetries,\n delay: this._retryDelay,\n autoReconnect: this._autoReconnect,\n connectTimeout: this._timeout,\n authKeyCallback: this._authKeyCallback.bind(this),\n updateCallback: this._handleUpdate.bind(this)\n });\n this.phoneCodeHashes = [];\n } // region Connecting\n\n /**\n * Connects to the Telegram servers, executing authentication if required.\n * Note that authenticating to the Telegram servers is not the same as authenticating\n * the app, which requires to send a code first.\n * @returns {Promise}\n */\n\n\n _createClass(TelegramClient, [{\n key: \"connect\",\n value: function connect() {\n var connection;\n return regeneratorRuntime.async(function connect$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n connection = new this._connection(this.session.serverAddress, this.session.port, this.session.dcId, this._log);\n _context.next = 3;\n return regeneratorRuntime.awrap(this._sender.connect(connection));\n\n case 3:\n if (_context.sent) {\n _context.next = 5;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 5:\n this.session.authKey = this._sender.authKey;\n _context.next = 8;\n return regeneratorRuntime.awrap(this.session.save());\n\n case 8:\n _context.next = 10;\n return regeneratorRuntime.awrap(this._sender.send(this._initWith(new GetConfigRequest())));\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n /**\n * Disconnects from the Telegram server\n * @returns {Promise}\n */\n\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n return regeneratorRuntime.async(function disconnect$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!this._sender) {\n _context2.next = 3;\n break;\n }\n\n _context2.next = 3;\n return regeneratorRuntime.awrap(this._sender.disconnect());\n\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_switchDC\",\n value: function _switchDC(newDc) {\n var DC;\n return regeneratorRuntime.async(function _switchDC$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n this._log.info(\"Reconnecting to new data center \".concat(newDc));\n\n _context3.next = 3;\n return regeneratorRuntime.awrap(this._getDC(newDc));\n\n case 3:\n DC = _context3.sent;\n this.session.setDC(DC.id, DC.ipAddress, DC.port); // authKey's are associated with a server, which has now changed\n // so it's not valid anymore. Set to None to force recreating it.\n\n this._sender.authKey.key = null;\n this.session.authKey = null;\n _context3.next = 9;\n return regeneratorRuntime.awrap(this.session.save());\n\n case 9:\n _context3.next = 11;\n return regeneratorRuntime.awrap(this.disconnect());\n\n case 11:\n _context3.next = 13;\n return regeneratorRuntime.awrap(this.connect());\n\n case 13:\n return _context3.abrupt(\"return\", _context3.sent);\n\n case 14:\n case \"end\":\n return _context3.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_authKeyCallback\",\n value: function _authKeyCallback(authKey) {\n return regeneratorRuntime.async(function _authKeyCallback$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n this.session.authKey = authKey;\n _context4.next = 3;\n return regeneratorRuntime.awrap(this.session.save());\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, null, this);\n } // endregion\n // region Working with different connections/Data Centers\n\n }, {\n key: \"_getDC\",\n value: function _getDC(dcId) {\n var cdn,\n _iteratorNormalCompletion,\n _didIteratorError,\n _iteratorError,\n _iterator,\n _step,\n pk,\n _iteratorNormalCompletion2,\n _didIteratorError2,\n _iteratorError2,\n _iterator2,\n _step2,\n DC,\n _args5 = arguments;\n\n return regeneratorRuntime.async(function _getDC$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n cdn = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : false;\n\n if (this._config) {\n _context5.next = 5;\n break;\n }\n\n _context5.next = 4;\n return regeneratorRuntime.awrap(this.invoke(new functions.help.GetConfigRequest()));\n\n case 4:\n this._config = _context5.sent;\n\n case 5:\n if (!(cdn && !this._cdnConfig)) {\n _context5.next = 28;\n break;\n }\n\n _context5.next = 8;\n return regeneratorRuntime.awrap(this.invoke(new functions.help.GetCdnConfigRequest()));\n\n case 8:\n this._cdnConfig = _context5.sent;\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context5.prev = 12;\n\n for (_iterator = this._cdnConfig.publicKeys[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n pk = _step.value;\n addKey(pk.publicKey);\n }\n\n _context5.next = 20;\n break;\n\n case 16:\n _context5.prev = 16;\n _context5.t0 = _context5[\"catch\"](12);\n _didIteratorError = true;\n _iteratorError = _context5.t0;\n\n case 20:\n _context5.prev = 20;\n _context5.prev = 21;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 23:\n _context5.prev = 23;\n\n if (!_didIteratorError) {\n _context5.next = 26;\n break;\n }\n\n throw _iteratorError;\n\n case 26:\n return _context5.finish(23);\n\n case 27:\n return _context5.finish(20);\n\n case 28:\n _iteratorNormalCompletion2 = true;\n _didIteratorError2 = false;\n _iteratorError2 = undefined;\n _context5.prev = 31;\n _iterator2 = this._config.dcOptions[Symbol.iterator]();\n\n case 33:\n if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {\n _context5.next = 40;\n break;\n }\n\n DC = _step2.value;\n\n if (!(DC.id === dcId && Boolean(DC.ipv6) === this._useIPV6 && Boolean(DC.cdn) === cdn)) {\n _context5.next = 37;\n break;\n }\n\n return _context5.abrupt(\"return\", DC);\n\n case 37:\n _iteratorNormalCompletion2 = true;\n _context5.next = 33;\n break;\n\n case 40:\n _context5.next = 46;\n break;\n\n case 42:\n _context5.prev = 42;\n _context5.t1 = _context5[\"catch\"](31);\n _didIteratorError2 = true;\n _iteratorError2 = _context5.t1;\n\n case 46:\n _context5.prev = 46;\n _context5.prev = 47;\n\n if (!_iteratorNormalCompletion2 && _iterator2[\"return\"] != null) {\n _iterator2[\"return\"]();\n }\n\n case 49:\n _context5.prev = 49;\n\n if (!_didIteratorError2) {\n _context5.next = 52;\n break;\n }\n\n throw _iteratorError2;\n\n case 52:\n return _context5.finish(49);\n\n case 53:\n return _context5.finish(46);\n\n case 54:\n case \"end\":\n return _context5.stop();\n }\n }\n }, null, this, [[12, 16, 20, 28], [21,, 23, 27], [31, 42, 46, 54], [47,, 49, 53]]);\n } // endregion\n // region Invoking Telegram request\n\n /**\n * Invokes a MTProtoRequest (sends and receives it) and returns its result\n * @param request\n * @returns {Promise}\n */\n\n }, {\n key: \"invoke\",\n value: function invoke(request) {\n var due, diff, attempt, promise, result, shouldRaise;\n return regeneratorRuntime.async(function invoke$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n if (request instanceof TLRequest) {\n _context6.next = 2;\n break;\n }\n\n throw new Error('You can only invoke MTProtoRequests');\n\n case 2:\n _context6.next = 4;\n return regeneratorRuntime.awrap(request.resolve(this, utils));\n\n case 4:\n if (!(request.CONSTRUCTOR_ID in this._floodWaitedRequests)) {\n _context6.next = 19;\n break;\n }\n\n due = this._floodWaitedRequests[request.CONSTRUCTOR_ID];\n diff = Math.round(due - new Date().getTime() / 1000);\n\n if (!(diff <= 3)) {\n _context6.next = 11;\n break;\n }\n\n delete this._floodWaitedRequests[request.CONSTRUCTOR_ID];\n _context6.next = 19;\n break;\n\n case 11:\n if (!(diff <= this.floodSleepLimit)) {\n _context6.next = 18;\n break;\n }\n\n this._log.info(\"Sleeping early for \".concat(diff, \"s on flood wait\"));\n\n _context6.next = 15;\n return regeneratorRuntime.awrap(sleep(diff));\n\n case 15:\n delete this._floodWaitedRequests[request.CONSTRUCTOR_ID];\n _context6.next = 19;\n break;\n\n case 18:\n throw new errors.FloodWaitError({\n request: request,\n capture: diff\n });\n\n case 19:\n this._last_request = new Date().getTime();\n attempt = 0;\n attempt = 0;\n\n case 22:\n if (!(attempt < this._requestRetries)) {\n _context6.next = 72;\n break;\n }\n\n _context6.prev = 23;\n promise = this._sender.send(request);\n _context6.next = 27;\n return regeneratorRuntime.awrap(promise);\n\n case 27:\n result = _context6.sent;\n this.session.processEntities(result);\n\n this._entityCache.add(result);\n\n return _context6.abrupt(\"return\", result);\n\n case 33:\n _context6.prev = 33;\n _context6.t0 = _context6[\"catch\"](23);\n\n if (!(_context6.t0 instanceof errors.ServerError || _context6.t0 instanceof errors.RpcCallFailError || _context6.t0 instanceof errors.RpcMcgetFailError)) {\n _context6.next = 41;\n break;\n }\n\n this._log.warn(\"Telegram is having internal issues \".concat(_context6.t0.constructor.name));\n\n _context6.next = 39;\n return regeneratorRuntime.awrap(sleep(2000));\n\n case 39:\n _context6.next = 69;\n break;\n\n case 41:\n if (!(_context6.t0 instanceof errors.FloodWaitError || _context6.t0 instanceof errors.FloodTestPhoneWaitError)) {\n _context6.next = 52;\n break;\n }\n\n this._floodWaitedRequests = new Date().getTime() / 1000 + _context6.t0.seconds;\n\n if (!(_context6.t0.seconds <= this.floodSleepLimit)) {\n _context6.next = 49;\n break;\n }\n\n this._log.info(\"Sleeping for \".concat(_context6.t0.seconds, \"s on flood wait\"));\n\n _context6.next = 47;\n return regeneratorRuntime.awrap(sleep(_context6.t0.seconds * 1000));\n\n case 47:\n _context6.next = 50;\n break;\n\n case 49:\n throw _context6.t0;\n\n case 50:\n _context6.next = 69;\n break;\n\n case 52:\n if (!(_context6.t0 instanceof errors.PhoneMigrateError || _context6.t0 instanceof errors.NetworkMigrateError || _context6.t0 instanceof errors.UserMigrateError)) {\n _context6.next = 68;\n break;\n }\n\n this._log.info(\"Phone migrated to \".concat(_context6.t0.newDc));\n\n shouldRaise = _context6.t0 instanceof errors.PhoneMigrateError || _context6.t0 instanceof errors.NetworkMigrateError;\n _context6.t1 = shouldRaise;\n\n if (!_context6.t1) {\n _context6.next = 60;\n break;\n }\n\n _context6.next = 59;\n return regeneratorRuntime.awrap(this.isUserAuthorized());\n\n case 59:\n _context6.t1 = _context6.sent;\n\n case 60:\n if (!_context6.t1) {\n _context6.next = 62;\n break;\n }\n\n throw _context6.t0;\n\n case 62:\n _context6.next = 64;\n return regeneratorRuntime.awrap(sleep(1000));\n\n case 64:\n _context6.next = 66;\n return regeneratorRuntime.awrap(this._switchDC(_context6.t0.newDc));\n\n case 66:\n _context6.next = 69;\n break;\n\n case 68:\n throw _context6.t0;\n\n case 69:\n attempt++;\n _context6.next = 22;\n break;\n\n case 72:\n throw new Error(\"Request was unsuccessful \".concat(attempt, \" time(s)\"));\n\n case 73:\n case \"end\":\n return _context6.stop();\n }\n }\n }, null, this, [[23, 33]]);\n }\n }, {\n key: \"getMe\",\n value: function getMe() {\n var me;\n return regeneratorRuntime.async(function getMe$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return regeneratorRuntime.awrap(this.invoke(new functions.users.GetUsersRequest({\n id: [new types.InputUserSelf()]\n })));\n\n case 2:\n me = _context7.sent[0];\n return _context7.abrupt(\"return\", me);\n\n case 4:\n case \"end\":\n return _context7.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"start\",\n value: function start() {\n var args,\n value,\n me,\n attempts,\n twoStepDetected,\n signUp,\n _value,\n i,\n pass,\n name,\n _args8 = arguments;\n\n return regeneratorRuntime.async(function start$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n args = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {\n phone: null,\n code: null,\n password: null,\n botToken: null,\n forceSMS: null,\n firstName: null,\n lastName: null,\n maxAttempts: 5\n };\n args.maxAttempts = args.maxAttempts || 5;\n\n if (this.isConnected()) {\n _context8.next = 5;\n break;\n }\n\n _context8.next = 5;\n return regeneratorRuntime.awrap(this.connect());\n\n case 5:\n _context8.next = 7;\n return regeneratorRuntime.awrap(this.isUserAuthorized());\n\n case 7:\n if (!_context8.sent) {\n _context8.next = 9;\n break;\n }\n\n return _context8.abrupt(\"return\", this);\n\n case 9:\n if (!(args.code == null && !args.botToken)) {\n _context8.next = 11;\n break;\n }\n\n throw new Error('Please pass a promise to the code arg');\n\n case 11:\n if (!(!args.botToken && !args.phone)) {\n _context8.next = 13;\n break;\n }\n\n throw new Error('Please provide either a phone or a bot token');\n\n case 13:\n if (args.botToken) {\n _context8.next = 25;\n break;\n }\n\n case 14:\n if (!(typeof args.phone == 'function')) {\n _context8.next = 25;\n break;\n }\n\n _context8.next = 17;\n return regeneratorRuntime.awrap(args.phone());\n\n case 17:\n value = _context8.sent;\n\n if (!(value.indexOf(':') !== -1)) {\n _context8.next = 21;\n break;\n }\n\n args.botToken = value;\n return _context8.abrupt(\"break\", 25);\n\n case 21:\n args.phone = utils.parsePhone(value) || args.phone;\n console.old('phone is ', args.phone);\n _context8.next = 14;\n break;\n\n case 25:\n if (!args.botToken) {\n _context8.next = 29;\n break;\n }\n\n _context8.next = 28;\n return regeneratorRuntime.awrap(this.signIn({\n botToken: args.botToken\n }));\n\n case 28:\n return _context8.abrupt(\"return\", this);\n\n case 29:\n attempts = 0;\n twoStepDetected = false;\n _context8.next = 33;\n return regeneratorRuntime.awrap(this.sendCodeRequest(args.phone, args.forceSMS));\n\n case 33:\n signUp = false;\n\n case 34:\n if (!(attempts < args.maxAttempts)) {\n _context8.next = 77;\n break;\n }\n\n _context8.prev = 35;\n _context8.next = 38;\n return regeneratorRuntime.awrap(args.code());\n\n case 38:\n _value = _context8.sent;\n console.old(\"your value is \", _value);\n\n if (_value) {\n _context8.next = 42;\n break;\n }\n\n throw new errors.PhoneCodeEmptyError({\n request: null\n });\n\n case 42:\n if (!signUp) {\n _context8.next = 48;\n break;\n }\n\n _context8.next = 45;\n return regeneratorRuntime.awrap(this.signUp({\n code: _value,\n firstName: args.firstName,\n lastName: args.lastName\n }));\n\n case 45:\n me = _context8.sent;\n _context8.next = 51;\n break;\n\n case 48:\n _context8.next = 50;\n return regeneratorRuntime.awrap(this.signIn({\n phone: args.phone,\n code: _value\n }));\n\n case 50:\n me = _context8.sent;\n\n case 51:\n return _context8.abrupt(\"break\", 77);\n\n case 54:\n _context8.prev = 54;\n _context8.t0 = _context8[\"catch\"](35);\n\n if (!(_context8.t0 instanceof errors.SessionPasswordNeededError)) {\n _context8.next = 61;\n break;\n }\n\n twoStepDetected = true;\n return _context8.abrupt(\"break\", 77);\n\n case 61:\n if (!(_context8.t0 instanceof errors.PhoneNumberOccupiedError)) {\n _context8.next = 65;\n break;\n }\n\n signUp = true;\n _context8.next = 74;\n break;\n\n case 65:\n if (!(_context8.t0 instanceof errors.PhoneNumberUnoccupiedError)) {\n _context8.next = 69;\n break;\n }\n\n signUp = true;\n _context8.next = 74;\n break;\n\n case 69:\n if (!(_context8.t0 instanceof errors.PhoneCodeEmptyError || _context8.t0 instanceof errors.PhoneCodeExpiredError || _context8.t0 instanceof errors.PhoneCodeHashEmptyError || _context8.t0 instanceof errors.PhoneCodeInvalidError)) {\n _context8.next = 73;\n break;\n }\n\n console.log('Invalid code. Please try again.');\n _context8.next = 74;\n break;\n\n case 73:\n throw _context8.t0;\n\n case 74:\n attempts++;\n _context8.next = 34;\n break;\n\n case 77:\n if (!(attempts >= args.maxAttempts)) {\n _context8.next = 79;\n break;\n }\n\n throw new Error(\"\".concat(args.maxAttempts, \" consecutive sign-in attempts failed. Aborting\"));\n\n case 79:\n if (!twoStepDetected) {\n _context8.next = 108;\n break;\n }\n\n if (args.password) {\n _context8.next = 82;\n break;\n }\n\n throw new Error('Two-step verification is enabled for this account. ' + 'Please provide the \\'password\\' argument to \\'start()\\'.');\n\n case 82:\n if (!(typeof args.password == 'function')) {\n _context8.next = 105;\n break;\n }\n\n i = 0;\n\n case 84:\n if (!(i < args.maxAttempts)) {\n _context8.next = 103;\n break;\n }\n\n _context8.prev = 85;\n _context8.next = 88;\n return regeneratorRuntime.awrap(args.password());\n\n case 88:\n pass = _context8.sent;\n console.old('your pass is ', pass);\n _context8.next = 92;\n return regeneratorRuntime.awrap(this.signIn({\n phone: args.phone,\n password: pass\n }));\n\n case 92:\n me = _context8.sent;\n return _context8.abrupt(\"break\", 103);\n\n case 96:\n _context8.prev = 96;\n _context8.t1 = _context8[\"catch\"](85);\n console.old(_context8.t1);\n console.log('Invalid password. Please try again');\n\n case 100:\n i++;\n _context8.next = 84;\n break;\n\n case 103:\n _context8.next = 108;\n break;\n\n case 105:\n _context8.next = 107;\n return regeneratorRuntime.awrap(this.signIn({\n phone: args.phone,\n password: args.password\n }));\n\n case 107:\n me = _context8.sent;\n\n case 108:\n name = utils.getDisplayName(me);\n console.log('Signed in successfully as' + name);\n return _context8.abrupt(\"return\", this);\n\n case 111:\n case \"end\":\n return _context8.stop();\n }\n }\n }, null, this, [[35, 54], [85, 96]]);\n }\n }, {\n key: \"signIn\",\n value: function signIn() {\n var args,\n result,\n _this$_parsePhoneAndH,\n _this$_parsePhoneAndH2,\n phone,\n phoneCodeHash,\n pwd,\n _args9 = arguments;\n\n return regeneratorRuntime.async(function signIn$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n args = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {\n phone: null,\n code: null,\n password: null,\n botToken: null,\n phoneCodeHash: null\n };\n\n if (!(args.phone && !args.code && !args.password)) {\n _context9.next = 7;\n break;\n }\n\n _context9.next = 4;\n return regeneratorRuntime.awrap(this.sendCodeRequest(args.phone));\n\n case 4:\n return _context9.abrupt(\"return\", _context9.sent);\n\n case 7:\n if (!args.code) {\n _context9.next = 14;\n break;\n }\n\n _this$_parsePhoneAndH = this._parsePhoneAndHash(args.phone, args.phoneCodeHash), _this$_parsePhoneAndH2 = _slicedToArray(_this$_parsePhoneAndH, 2), phone = _this$_parsePhoneAndH2[0], phoneCodeHash = _this$_parsePhoneAndH2[1]; // May raise PhoneCodeEmptyError, PhoneCodeExpiredError,\n // PhoneCodeHashEmptyError or PhoneCodeInvalidError.\n\n _context9.next = 11;\n return regeneratorRuntime.awrap(this.invoke(new functions.auth.SignInRequest({\n phoneNumber: phone,\n phoneCodeHash: phoneCodeHash,\n phoneCode: args.code.toString()\n })));\n\n case 11:\n result = _context9.sent;\n _context9.next = 30;\n break;\n\n case 14:\n if (!args.password) {\n _context9.next = 23;\n break;\n }\n\n _context9.next = 17;\n return regeneratorRuntime.awrap(this.invoke(new functions.account.GetPasswordRequest()));\n\n case 17:\n pwd = _context9.sent;\n _context9.next = 20;\n return regeneratorRuntime.awrap(this.invoke(new functions.auth.CheckPasswordRequest({\n password: computeCheck(pwd, args.password)\n })));\n\n case 20:\n result = _context9.sent;\n _context9.next = 30;\n break;\n\n case 23:\n if (!args.botToken) {\n _context9.next = 29;\n break;\n }\n\n _context9.next = 26;\n return regeneratorRuntime.awrap(this.invoke(new functions.auth.ImportBotAuthorizationRequest({\n flags: 0,\n botAuthToken: args.botToken,\n apiId: this.apiId,\n apiHash: this.apiHash\n })));\n\n case 26:\n result = _context9.sent;\n _context9.next = 30;\n break;\n\n case 29:\n throw new Error('You must provide a phone and a code the first time, ' + 'and a password only if an RPCError was raised before.');\n\n case 30:\n return _context9.abrupt(\"return\", this._onLogin(result.user));\n\n case 31:\n case \"end\":\n return _context9.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_parsePhoneAndHash\",\n value: function _parsePhoneAndHash(phone, phoneHash) {\n phone = utils.parsePhone(phone) || this._phone;\n\n if (!phone) {\n throw new Error('Please make sure to call send_code_request first.');\n }\n\n phoneHash = phoneHash || this._phoneCodeHash[phone];\n\n if (!phoneHash) {\n throw new Error('You also need to provide a phone_code_hash.');\n }\n\n return [phone, phoneHash];\n } // endregion\n\n }, {\n key: \"isUserAuthorized\",\n value: function isUserAuthorized() {\n return regeneratorRuntime.async(function isUserAuthorized$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n if (this._authorized) {\n _context10.next = 10;\n break;\n }\n\n _context10.prev = 1;\n _context10.next = 4;\n return regeneratorRuntime.awrap(this.invoke(new functions.updates.GetStateRequest()));\n\n case 4:\n this._authorized = true;\n _context10.next = 10;\n break;\n\n case 7:\n _context10.prev = 7;\n _context10.t0 = _context10[\"catch\"](1);\n this._authorized = false;\n\n case 10:\n return _context10.abrupt(\"return\", this._authorized);\n\n case 11:\n case \"end\":\n return _context10.stop();\n }\n }\n }, null, this, [[1, 7]]);\n }\n /**\n * Callback called whenever the login or sign up process completes.\n * Returns the input user parameter.\n * @param user\n * @private\n */\n\n }, {\n key: \"_onLogin\",\n value: function _onLogin(user) {\n this._bot = Boolean(user.bot);\n this._authorized = true;\n return user;\n }\n }, {\n key: \"sendCodeRequest\",\n value: function sendCodeRequest(phone) {\n var forceSMS,\n result,\n phoneHash,\n _args11 = arguments;\n return regeneratorRuntime.async(function sendCodeRequest$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n forceSMS = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : false;\n phone = utils.parsePhone(phone) || this._phone;\n phoneHash = this._phoneCodeHash[phone];\n\n if (phoneHash) {\n _context11.next = 21;\n break;\n }\n\n _context11.prev = 4;\n _context11.next = 7;\n return regeneratorRuntime.awrap(this.invoke(new functions.auth.SendCodeRequest({\n phoneNumber: phone,\n apiId: this.apiId,\n apiHash: this.apiHash,\n settings: new types.CodeSettings()\n })));\n\n case 7:\n result = _context11.sent;\n _context11.next = 17;\n break;\n\n case 10:\n _context11.prev = 10;\n _context11.t0 = _context11[\"catch\"](4);\n\n if (!(_context11.t0 instanceof errors.AuthRestartError)) {\n _context11.next = 16;\n break;\n }\n\n _context11.next = 15;\n return regeneratorRuntime.awrap(this.sendCodeRequest(phone, forceSMS));\n\n case 15:\n return _context11.abrupt(\"return\", _context11.sent);\n\n case 16:\n throw _context11.t0;\n\n case 17:\n // If we already sent a SMS, do not resend the code (hash may be empty)\n if (result.type instanceof types.auth.SentCodeTypeSms) {\n forceSMS = false;\n }\n\n if (result.phoneCodeHash) {\n this._phoneCodeHash[phone] = phoneHash = result.phoneCodeHash;\n }\n\n _context11.next = 22;\n break;\n\n case 21:\n forceSMS = true;\n\n case 22:\n this._phone = phone;\n\n if (!forceSMS) {\n _context11.next = 28;\n break;\n }\n\n _context11.next = 26;\n return regeneratorRuntime.awrap(this.invoke(new functions.auth.ResendCodeRequest({\n phone: phone,\n phoneHash: phoneHash\n })));\n\n case 26:\n result = _context11.sent;\n this._phoneCodeHash[phone] = result.phoneCodeHash;\n\n case 28:\n return _context11.abrupt(\"return\", result);\n\n case 29:\n case \"end\":\n return _context11.stop();\n }\n }\n }, null, this, [[4, 10]]);\n } // event region\n\n }, {\n key: \"addEventHandler\",\n value: function addEventHandler(callback, event) {\n this._eventBuilders.push([event, callback]);\n }\n }, {\n key: \"_handleUpdate\",\n value: function _handleUpdate(update) {\n this.session.processEntities(update);\n\n this._entityCache.add(update);\n\n if (update instanceof types.Updates || update instanceof types.UpdatesCombined) {\n // TODO deal with entities\n var entities = {};\n\n for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(update.users), _toConsumableArray(update.chats)); _i2 < _arr2.length; _i2++) {\n var x = _arr2[_i2];\n entities[utils.getPeerId(x)] = x;\n }\n\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = update.updates[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var u = _step3.value;\n\n this._processUpdate(u, update.updates, entities);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3[\"return\"] != null) {\n _iterator3[\"return\"]();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n } else if (update instanceof types.UpdateShort) {\n this._processUpdate(update.update, null);\n } else {\n this._processUpdate(update, null);\n } // TODO add caching\n // this._stateCache.update(update)\n\n }\n }, {\n key: \"_processUpdate\",\n value: function _processUpdate(update, others, entities) {\n update._entities = entities || {};\n var args = {\n update: update,\n others: others\n };\n\n this._dispatchUpdate(args);\n } // endregion\n // region private methods\n\n /**\n Gets a full entity from the given string, which may be a phone or\n a username, and processes all the found entities on the session.\n The string may also be a user link, or a channel/chat invite link.\n This method has the side effect of adding the found users to the\n session database, so it can be queried later without API calls,\n if this option is enabled on the session.\n Returns the found entity, or raises TypeError if not found.\n * @param string {string}\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_getEntityFromString\",\n value: function _getEntityFromString(string) {\n var phone, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, user, _utils$parseUsername, username, isJoinChat, invite, result, pid, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, x, _iteratorNormalCompletion6, _didIteratorError6, _iteratorError6, _iterator6, _step6, _x;\n\n return regeneratorRuntime.async(function _getEntityFromString$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n phone = utils.parsePhone(string);\n\n if (!phone) {\n _context12.next = 41;\n break;\n }\n\n _context12.prev = 2;\n _iteratorNormalCompletion4 = true;\n _didIteratorError4 = false;\n _iteratorError4 = undefined;\n _context12.prev = 6;\n _context12.next = 9;\n return regeneratorRuntime.awrap(this.invoke(new functions.contacts.GetContactsRequest(0)));\n\n case 9:\n _context12.t0 = Symbol.iterator;\n _iterator4 = _context12.sent.users[_context12.t0]();\n\n case 11:\n if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) {\n _context12.next = 18;\n break;\n }\n\n user = _step4.value;\n\n if (!(user.phone === phone)) {\n _context12.next = 15;\n break;\n }\n\n return _context12.abrupt(\"return\", user);\n\n case 15:\n _iteratorNormalCompletion4 = true;\n _context12.next = 11;\n break;\n\n case 18:\n _context12.next = 24;\n break;\n\n case 20:\n _context12.prev = 20;\n _context12.t1 = _context12[\"catch\"](6);\n _didIteratorError4 = true;\n _iteratorError4 = _context12.t1;\n\n case 24:\n _context12.prev = 24;\n _context12.prev = 25;\n\n if (!_iteratorNormalCompletion4 && _iterator4[\"return\"] != null) {\n _iterator4[\"return\"]();\n }\n\n case 27:\n _context12.prev = 27;\n\n if (!_didIteratorError4) {\n _context12.next = 30;\n break;\n }\n\n throw _iteratorError4;\n\n case 30:\n return _context12.finish(27);\n\n case 31:\n return _context12.finish(24);\n\n case 32:\n _context12.next = 39;\n break;\n\n case 34:\n _context12.prev = 34;\n _context12.t2 = _context12[\"catch\"](2);\n\n if (!(_context12.t2 instanceof errors.BotMethodInvalidError)) {\n _context12.next = 38;\n break;\n }\n\n throw new Error('Cannot get entity by phone number as a ' + 'bot (try using integer IDs, not strings)');\n\n case 38:\n throw _context12.t2;\n\n case 39:\n _context12.next = 128;\n break;\n\n case 41:\n if (!['me', 'this'].includes(string.toLowerCase())) {\n _context12.next = 47;\n break;\n }\n\n _context12.next = 44;\n return regeneratorRuntime.awrap(this.getMe());\n\n case 44:\n return _context12.abrupt(\"return\", _context12.sent);\n\n case 47:\n _utils$parseUsername = utils.parseUsername(string), username = _utils$parseUsername.username, isJoinChat = _utils$parseUsername.isJoinChat;\n\n if (!isJoinChat) {\n _context12.next = 60;\n break;\n }\n\n _context12.next = 51;\n return regeneratorRuntime.awrap(this.invoke(new functions.messages.CheckChatInviteRequest({\n 'hash': username\n })));\n\n case 51:\n invite = _context12.sent;\n\n if (!(invite instanceof types.ChatInvite)) {\n _context12.next = 56;\n break;\n }\n\n throw new Error('Cannot get entity from a channel (or group) ' + 'that you are not part of. Join the group and retry');\n\n case 56:\n if (!(invite instanceof types.ChatInviteAlready)) {\n _context12.next = 58;\n break;\n }\n\n return _context12.abrupt(\"return\", invite.chat);\n\n case 58:\n _context12.next = 128;\n break;\n\n case 60:\n if (!username) {\n _context12.next = 128;\n break;\n }\n\n _context12.prev = 61;\n _context12.next = 64;\n return regeneratorRuntime.awrap(this.invoke(new functions.contacts.ResolveUsernameRequest(username)));\n\n case 64:\n result = _context12.sent;\n pid = utils.getPeerId(result.peer, false);\n\n if (!(result.peer instanceof types.PeerUser)) {\n _context12.next = 95;\n break;\n }\n\n _iteratorNormalCompletion5 = true;\n _didIteratorError5 = false;\n _iteratorError5 = undefined;\n _context12.prev = 70;\n _iterator5 = result.users[Symbol.iterator]();\n\n case 72:\n if (_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done) {\n _context12.next = 79;\n break;\n }\n\n x = _step5.value;\n\n if (!(x.id === pid)) {\n _context12.next = 76;\n break;\n }\n\n return _context12.abrupt(\"return\", x);\n\n case 76:\n _iteratorNormalCompletion5 = true;\n _context12.next = 72;\n break;\n\n case 79:\n _context12.next = 85;\n break;\n\n case 81:\n _context12.prev = 81;\n _context12.t3 = _context12[\"catch\"](70);\n _didIteratorError5 = true;\n _iteratorError5 = _context12.t3;\n\n case 85:\n _context12.prev = 85;\n _context12.prev = 86;\n\n if (!_iteratorNormalCompletion5 && _iterator5[\"return\"] != null) {\n _iterator5[\"return\"]();\n }\n\n case 88:\n _context12.prev = 88;\n\n if (!_didIteratorError5) {\n _context12.next = 91;\n break;\n }\n\n throw _iteratorError5;\n\n case 91:\n return _context12.finish(88);\n\n case 92:\n return _context12.finish(85);\n\n case 93:\n _context12.next = 121;\n break;\n\n case 95:\n _iteratorNormalCompletion6 = true;\n _didIteratorError6 = false;\n _iteratorError6 = undefined;\n _context12.prev = 98;\n _iterator6 = result.chats[Symbol.iterator]();\n\n case 100:\n if (_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done) {\n _context12.next = 107;\n break;\n }\n\n _x = _step6.value;\n\n if (!(_x.id === pid)) {\n _context12.next = 104;\n break;\n }\n\n return _context12.abrupt(\"return\", _x);\n\n case 104:\n _iteratorNormalCompletion6 = true;\n _context12.next = 100;\n break;\n\n case 107:\n _context12.next = 113;\n break;\n\n case 109:\n _context12.prev = 109;\n _context12.t4 = _context12[\"catch\"](98);\n _didIteratorError6 = true;\n _iteratorError6 = _context12.t4;\n\n case 113:\n _context12.prev = 113;\n _context12.prev = 114;\n\n if (!_iteratorNormalCompletion6 && _iterator6[\"return\"] != null) {\n _iterator6[\"return\"]();\n }\n\n case 116:\n _context12.prev = 116;\n\n if (!_didIteratorError6) {\n _context12.next = 119;\n break;\n }\n\n throw _iteratorError6;\n\n case 119:\n return _context12.finish(116);\n\n case 120:\n return _context12.finish(113);\n\n case 121:\n _context12.next = 128;\n break;\n\n case 123:\n _context12.prev = 123;\n _context12.t5 = _context12[\"catch\"](61);\n\n if (!(_context12.t5 instanceof errors.UsernameNotOccupiedError)) {\n _context12.next = 127;\n break;\n }\n\n throw new Error(\"No user has \\\"\".concat(username, \"\\\" as username\"));\n\n case 127:\n throw _context12.t5;\n\n case 128:\n throw new Error(\"Cannot find any entity corresponding to \\\"\".concat(string, \"\\\"\"));\n\n case 129:\n case \"end\":\n return _context12.stop();\n }\n }\n }, null, this, [[2, 34], [6, 20, 24, 32], [25,, 27, 31], [61, 123], [70, 81, 85, 93], [86,, 88, 92], [98, 109, 113, 121], [114,, 116, 120]]);\n } // endregion\n // users region\n\n /**\n Turns the given entity into its input entity version.\n Most requests use this kind of :tl:`InputPeer`, so this is the most\n suitable call to make for those cases. **Generally you should let the\n library do its job** and don't worry about getting the input entity\n first, but if you're going to use an entity often, consider making the\n call:\n Arguments\n entity (`str` | `int` | :tl:`Peer` | :tl:`InputPeer`):\n If a username or invite link is given, **the library will\n use the cache**. This means that it's possible to be using\n a username that *changed* or an old invite link (this only\n happens if an invite link for a small group chat is used\n after it was upgraded to a mega-group).\n If the username or ID from the invite link is not found in\n the cache, it will be fetched. The same rules apply to phone\n numbers (``'+34 123456789'``) from people in your contact list.\n If an exact name is given, it must be in the cache too. This\n is not reliable as different people can share the same name\n and which entity is returned is arbitrary, and should be used\n only for quick tests.\n If a positive integer ID is given, the entity will be searched\n in cached users, chats or channels, without making any call.\n If a negative integer ID is given, the entity will be searched\n exactly as either a chat (prefixed with ``-``) or as a channel\n (prefixed with ``-100``).\n If a :tl:`Peer` is given, it will be searched exactly in the\n cache as either a user, chat or channel.\n If the given object can be turned into an input entity directly,\n said operation will be done.\n Unsupported types will raise ``TypeError``.\n If the entity can't be found, ``ValueError`` will be raised.\n Returns\n :tl:`InputPeerUser`, :tl:`InputPeerChat` or :tl:`InputPeerChannel`\n or :tl:`InputPeerSelf` if the parameter is ``'me'`` or ``'self'``.\n If you need to get the ID of yourself, you should use\n `get_me` with ``input_peer=True``) instead.\n Example\n .. code-block:: python\n // If you're going to use \"username\" often in your code\n // (make a lot of calls), consider getting its input entity\n // once, and then using the \"user\" everywhere instead.\n user = await client.get_input_entity('username')\n // The same applies to IDs, chats or channels.\n chat = await client.get_input_entity(-123456789)\n * @param peer\n * @returns {Promise}\n */\n\n }, {\n key: \"getInputEntity\",\n value: function getInputEntity(peer) {\n var users, channels;\n return regeneratorRuntime.async(function getInputEntity$(_context13) {\n while (1) {\n switch (_context13.prev = _context13.next) {\n case 0:\n _context13.prev = 0;\n return _context13.abrupt(\"return\", utils.getInputPeer(peer));\n\n case 4:\n _context13.prev = 4;\n _context13.t0 = _context13[\"catch\"](0);\n\n case 6:\n _context13.prev = 6;\n\n if (!(typeof peer === 'number' || peer.SUBCLASS_OF_ID === 0x2d45687)) {\n _context13.next = 10;\n break;\n }\n\n if (!this._entityCache.has(peer)) {\n _context13.next = 10;\n break;\n }\n\n return _context13.abrupt(\"return\", this._entityCache[peer]);\n\n case 10:\n _context13.next = 14;\n break;\n\n case 12:\n _context13.prev = 12;\n _context13.t1 = _context13[\"catch\"](6);\n\n case 14:\n if (!['me', 'this'].includes(peer)) {\n _context13.next = 16;\n break;\n }\n\n return _context13.abrupt(\"return\", new types.InputPeerSelf());\n\n case 16:\n _context13.prev = 16;\n return _context13.abrupt(\"return\", this.session.getInputEntity(peer));\n\n case 20:\n _context13.prev = 20;\n _context13.t2 = _context13[\"catch\"](16);\n\n case 22:\n if (!(typeof peer === 'string')) {\n _context13.next = 28;\n break;\n }\n\n _context13.t3 = utils;\n _context13.next = 26;\n return regeneratorRuntime.awrap(this._getEntityFromString(peer));\n\n case 26:\n _context13.t4 = _context13.sent;\n return _context13.abrupt(\"return\", _context13.t3.getInputPeer.call(_context13.t3, _context13.t4));\n\n case 28:\n // If we're a bot and the user has messaged us privately users.getUsers\n // will work with access_hash = 0. Similar for channels.getChannels.\n // If we're not a bot but the user is in our contacts, it seems to work\n // regardless. These are the only two special-cased requests.\n peer = utils.getPeer(peer);\n\n if (!(peer instanceof types.PeerUser)) {\n _context13.next = 37;\n break;\n }\n\n _context13.next = 32;\n return regeneratorRuntime.awrap(this.invoke(new functions.users.GetUsersRequest({\n id: [new types.InputUser({\n userId: peer.userId,\n accessHash: 0\n })]\n })));\n\n case 32:\n users = _context13.sent;\n\n if (!(users && !(users[0] instanceof types.UserEmpty))) {\n _context13.next = 35;\n break;\n }\n\n return _context13.abrupt(\"return\", utils.getInputPeer(users[0]));\n\n case 35:\n _context13.next = 52;\n break;\n\n case 37:\n if (!(peer instanceof types.PeerChat)) {\n _context13.next = 41;\n break;\n }\n\n return _context13.abrupt(\"return\", new types.InputPeerChat({\n chatId: peer.chatId\n }));\n\n case 41:\n if (!(peer instanceof types.PeerChannel)) {\n _context13.next = 52;\n break;\n }\n\n _context13.prev = 42;\n _context13.next = 45;\n return regeneratorRuntime.awrap(this.invoke(new functions.channels.GetChannelsRequest({\n id: [new types.InputChannel({\n channelId: peer.channelId,\n accessHash: 0\n })]\n })));\n\n case 45:\n channels = _context13.sent;\n return _context13.abrupt(\"return\", utils.getInputPeer(channels.chats[0]));\n\n case 49:\n _context13.prev = 49;\n _context13.t5 = _context13[\"catch\"](42);\n console.log(_context13.t5);\n\n case 52:\n throw new Error(\"Could not find the input entity for \".concat(peer.id || peer.channelId || peer.chatId || peer.userId, \".\\n Please read https://\") + 'docs.telethon.dev/en/latest/concepts/entities.html to' + ' find out more details.');\n\n case 53:\n case \"end\":\n return _context13.stop();\n }\n }\n }, null, this, [[0, 4], [6, 12], [16, 20], [42, 49]]);\n } // endregion\n\n }, {\n key: \"_dispatchUpdate\",\n value: function _dispatchUpdate() {\n var args,\n _iteratorNormalCompletion7,\n _didIteratorError7,\n _iteratorError7,\n _iterator7,\n _step7,\n _step7$value,\n builder,\n callback,\n event,\n _args14 = arguments;\n\n return regeneratorRuntime.async(function _dispatchUpdate$(_context14) {\n while (1) {\n switch (_context14.prev = _context14.next) {\n case 0:\n args = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {\n update: null,\n others: null,\n channelId: null,\n ptsDate: null\n };\n _iteratorNormalCompletion7 = true;\n _didIteratorError7 = false;\n _iteratorError7 = undefined;\n _context14.prev = 4;\n _iterator7 = this._eventBuilders[Symbol.iterator]();\n\n case 6:\n if (_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done) {\n _context14.next = 15;\n break;\n }\n\n _step7$value = _slicedToArray(_step7.value, 2), builder = _step7$value[0], callback = _step7$value[1];\n event = builder.build(args.update);\n\n if (!event) {\n _context14.next = 12;\n break;\n }\n\n _context14.next = 12;\n return regeneratorRuntime.awrap(callback(event));\n\n case 12:\n _iteratorNormalCompletion7 = true;\n _context14.next = 6;\n break;\n\n case 15:\n _context14.next = 21;\n break;\n\n case 17:\n _context14.prev = 17;\n _context14.t0 = _context14[\"catch\"](4);\n _didIteratorError7 = true;\n _iteratorError7 = _context14.t0;\n\n case 21:\n _context14.prev = 21;\n _context14.prev = 22;\n\n if (!_iteratorNormalCompletion7 && _iterator7[\"return\"] != null) {\n _iterator7[\"return\"]();\n }\n\n case 24:\n _context14.prev = 24;\n\n if (!_didIteratorError7) {\n _context14.next = 27;\n break;\n }\n\n throw _iteratorError7;\n\n case 27:\n return _context14.finish(24);\n\n case 28:\n return _context14.finish(21);\n\n case 29:\n case \"end\":\n return _context14.stop();\n }\n }\n }, null, this, [[4, 17, 21, 29], [22,, 24, 28]]);\n }\n }, {\n key: \"isConnected\",\n value: function isConnected() {\n if (this._sender) {\n if (this._sender.isConnected()) {\n return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"signUp\",\n value: function signUp() {\n return regeneratorRuntime.async(function signUp$(_context15) {\n while (1) {\n switch (_context15.prev = _context15.next) {\n case 0:\n case \"end\":\n return _context15.stop();\n }\n }\n });\n }\n }]);\n\n return TelegramClient;\n}();\n\n_defineProperty(TelegramClient, \"DEFAULT_OPTIONS\", {\n connection: ConnectionTCPObfuscated,\n useIPV6: false,\n proxy: null,\n timeout: 10,\n requestRetries: 5,\n connectionRetries: 5,\n retryDelay: 1,\n autoReconnect: true,\n sequentialUpdates: false,\n FloodSleepLimit: 60,\n deviceModel: null,\n systemVersion: null,\n appVersion: null,\n langCode: 'en',\n systemLangCode: 'en',\n baseLogger: 'gramjs'\n});\n\nmodule.exports = TelegramClient;\n\n//# sourceURL=webpack://gramjs/./gramjs/client/TelegramClient.js?"); /***/ }), /***/ "./gramjs/crypto/AES.js": /*!******************************!*\ !*** ./gramjs/crypto/AES.js ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar aesjs = __webpack_require__(/*! aes-js */ \"./node_modules/aes-js/index.js\");\n\nvar _require = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n generateRandomBytes = _require.generateRandomBytes;\n\nvar AES =\n/*#__PURE__*/\nfunction () {\n function AES() {\n _classCallCheck(this, AES);\n }\n\n _createClass(AES, null, [{\n key: \"decryptIge\",\n\n /**\n * Decrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param cipherText {Buffer}\n * @param key {Buffer}\n * @param iv {Buffer}\n * @returns {Buffer}\n */\n value: function decryptIge(cipherText, key, iv) {\n var iv1 = iv.slice(0, Math.floor(iv.length / 2));\n var iv2 = iv.slice(Math.floor(iv.length / 2));\n var plainText = new Array(cipherText.length).fill(0);\n var aes = new aesjs.AES(key);\n var blocksCount = Math.floor(plainText.length / 16);\n var cipherTextBlock = new Array(16).fill(0);\n\n for (var blockIndex = 0; blockIndex < blocksCount; blockIndex++) {\n for (var i = 0; i < 16; i++) {\n cipherTextBlock[i] = cipherText[blockIndex * 16 + i] ^ iv2[i];\n }\n\n var plainTextBlock = aes.decrypt(cipherTextBlock);\n\n for (var _i = 0; _i < 16; _i++) {\n plainTextBlock[_i] ^= iv1[_i];\n }\n\n iv1 = cipherText.slice(blockIndex * 16, blockIndex * 16 + 16);\n iv2 = plainTextBlock.slice(0, 16);\n plainText = new Uint8Array([].concat(_toConsumableArray(plainText.slice(0, blockIndex * 16)), _toConsumableArray(plainTextBlock.slice(0, 16)), _toConsumableArray(plainText.slice(blockIndex * 16 + 16))));\n }\n\n return Buffer.from(plainText);\n }\n /**\n * Encrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param plainText {Buffer}\n * @param key {Buffer}\n * @param iv {Buffer}\n * @returns {Buffer}\n */\n\n }, {\n key: \"encryptIge\",\n value: function encryptIge(plainText, key, iv) {\n var padding = plainText.length % 16;\n\n if (padding) {\n plainText = Buffer.concat([plainText, generateRandomBytes(16 - padding)]);\n }\n\n var iv1 = iv.slice(0, Math.floor(iv.length / 2));\n var iv2 = iv.slice(Math.floor(iv.length / 2));\n var aes = new aesjs.AES(key);\n var cipherText = Buffer.alloc(0);\n var blockCount = Math.floor(plainText.length / 16);\n\n for (var blockIndex = 0; blockIndex < blockCount; blockIndex++) {\n var plainTextBlock = Buffer.from(plainText.slice(blockIndex * 16, blockIndex * 16 + 16));\n\n for (var i = 0; i < 16; i++) {\n plainTextBlock[i] ^= iv1[i];\n }\n\n var cipherTextBlock = Buffer.from(aes.encrypt(plainTextBlock));\n\n for (var _i2 = 0; _i2 < 16; _i2++) {\n cipherTextBlock[_i2] ^= iv2[_i2];\n }\n\n iv1 = cipherTextBlock;\n iv2 = plainText.slice(blockIndex * 16, blockIndex * 16 + 16);\n cipherText = Buffer.concat([cipherText, cipherTextBlock]);\n }\n\n return cipherText;\n }\n }]);\n\n return AES;\n}();\n\nmodule.exports = AES;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/crypto/AES.js?"); /***/ }), /***/ "./gramjs/crypto/AESCTR.js": /*!*********************************!*\ !*** ./gramjs/crypto/AESCTR.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar aesjs = __webpack_require__(/*! aes-js */ \"./node_modules/aes-js/index.js\");\n\nvar stackTrace = __webpack_require__(/*! stack-trace */ \"./node_modules/stack-trace/lib/stack-trace.js\");\n\nvar AESModeCTR =\n/*#__PURE__*/\nfunction () {\n function AESModeCTR(key, iv) {\n _classCallCheck(this, AESModeCTR);\n\n if (!(key instanceof Buffer) || !(iv instanceof Buffer) || iv.length !== 16) {\n throw new Error('Key and iv need to be a buffer');\n }\n\n this.cipher = new aesjs.ModeOfOperation.ctr(Buffer.from(key), Buffer.from(iv));\n }\n\n _createClass(AESModeCTR, [{\n key: \"encrypt\",\n value: function encrypt(data) {\n var res = this.cipher.encrypt(data);\n return Buffer.from(res);\n }\n }, {\n key: \"decrypt\",\n value: function decrypt(data) {\n return Buffer.from(this.cipher.decrypt(data));\n }\n }]);\n\n return AESModeCTR;\n}();\n\nmodule.exports = AESModeCTR;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/crypto/AESCTR.js?"); /***/ }), /***/ "./gramjs/crypto/AuthKey.js": /*!**********************************!*\ !*** ./gramjs/crypto/AuthKey.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar _require = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n sha1 = _require.sha1,\n readBufferFromBigInt = _require.readBufferFromBigInt,\n readBigIntFromBuffer = _require.readBigIntFromBuffer;\n\nvar BinaryReader = __webpack_require__(/*! ../extensions/BinaryReader */ \"./gramjs/extensions/BinaryReader.js\");\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar AuthKey =\n/*#__PURE__*/\nfunction () {\n function AuthKey(data) {\n _classCallCheck(this, AuthKey);\n\n this.key = data;\n }\n\n _createClass(AuthKey, [{\n key: \"calcNewNonceHash\",\n // TODO : This doesn't really fit here, it's only used in authentication\n\n /**\n * Calculates the new nonce hash based on the current class fields' values\n * @param newNonce\n * @param number\n * @returns {bigint}\n */\n value: function calcNewNonceHash(newNonce, number) {\n newNonce = readBufferFromBigInt(newNonce, 32, true, true);\n var data = Buffer.concat([newNonce, struct.pack('= what) {\n c -= what;\n }\n }\n\n a += a;\n\n if (a >= what) {\n a -= what;\n }\n\n b >>= BigInt(1);\n }\n\n x = c;\n var z = BigInt(x < y ? y - x : x - y);\n g = this.gcd(z, what);\n\n if (g !== BigInt(1)) {\n break;\n }\n\n if ((j & j - BigInt(1)) === BigInt(0)) {\n y = x;\n }\n }\n\n if (g > 1) {\n break;\n }\n }\n\n var p = what / g;\n return p < g ? p : g;\n }\n /**\n * Calculates the greatest common divisor\n * @param a {BigInt}\n * @param b {BigInt}\n * @returns {BigInt}\n */\n\n }, {\n key: \"gcd\",\n value: function gcd(a, b) {\n while (a !== BigInt(0) && b !== BigInt(0)) {\n while ((b & BigInt(1)) === BigInt(0)) {\n b >>= BigInt(1);\n }\n\n while ((a & BigInt(1)) === BigInt(0)) {\n a >>= BigInt(1);\n }\n\n if (a > b) {\n a -= b;\n } else {\n b -= a;\n }\n }\n\n return b === BigInt(0) ? a : b;\n }\n /**\n * Factorizes the given number and returns both the divisor and the number divided by the divisor\n * @param pq {BigInt}\n * @returns {{p: BigInt, q: BigInt}}\n */\n\n }, {\n key: \"factorize\",\n value: function factorize(pq) {\n var divisor = this.findSmallMultiplierLopatin(pq);\n return {\n p: divisor,\n q: pq / divisor\n };\n }\n }]);\n\n return Factorizator;\n}();\n\nmodule.exports = Factorizator;\n\n//# sourceURL=webpack://gramjs/./gramjs/crypto/Factorizator.js?"); /***/ }), /***/ "./gramjs/crypto/RSA.js": /*!******************************!*\ !*** ./gramjs/crypto/RSA.js ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var NodeRSA = __webpack_require__(/*! node-rsa */ \"./node_modules/node-rsa/src/NodeRSA.js\");\n\nvar _require = __webpack_require__(/*! ../tl/tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar _require2 = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n readBigIntFromBuffer = _require2.readBigIntFromBuffer,\n sha1 = _require2.sha1,\n modExp = _require2.modExp,\n readBufferFromBigInt = _require2.readBufferFromBigInt,\n generateRandomBytes = _require2.generateRandomBytes;\n\nvar _serverKeys = {};\n/**\n * Gets the arbitrary-length byte array corresponding to the given integer\n * @param integer {number,BigInt}\n * @param signed {boolean}\n * @returns {Buffer}\n */\n\nfunction getByteArray(integer) {\n var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _integer$toString = integer.toString(2),\n bits = _integer$toString.length;\n\n var byteLength = Math.floor((bits + 8 - 1) / 8);\n return readBufferFromBigInt(BigInt(integer), byteLength, false, signed);\n}\n\nfunction _computeFingerprint(key) {\n var buf = readBigIntFromBuffer(key.keyPair.n.toBuffer(), false);\n var nArray = getByteArray(buf);\n var n = TLObject.serializeBytes(nArray);\n var e = TLObject.serializeBytes(getByteArray(key.keyPair.e)); // Telegram uses the last 8 bytes as the fingerprint\n\n var sh = sha1(Buffer.concat([n, e]));\n return readBigIntFromBuffer(sh.slice(-8), true, true);\n}\n\nfunction addKey(pub) {\n var key = new NodeRSA(pub);\n _serverKeys[_computeFingerprint(key)] = key;\n}\n\nfunction encrypt(fingerprint, data) {\n var key = _serverKeys[fingerprint];\n\n if (!key) {\n return undefined;\n }\n\n var buf = readBigIntFromBuffer(key.keyPair.n.toBuffer(), false);\n var rand = generateRandomBytes(235 - data.length);\n var toEncrypt = Buffer.concat([sha1(data), data, rand]);\n var payload = readBigIntFromBuffer(toEncrypt, false);\n var encrypted = modExp(payload, BigInt(key.keyPair.e), buf);\n var block = readBufferFromBigInt(encrypted, 256, false);\n return block;\n}\n\nvar publicKeys = [\"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\\nlyDONS789sVoD/xCS9Y0hkkC3gtL1tSfTlgCMOOul9lcixlEKzwKENj1Yz/s7daS\\nan9tqw3bfUV/nqgbhGX81v/+7RFAEd+RwFnK7a+XYl9sluzHRyVVaTTveB2GazTw\\nEfzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+\\n8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd9P0NsZRPsmoqVwMbMu7mStFai6aIhc3n\\nSlv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB\\n-----END RSA PUBLIC KEY-----\", \"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEAxq7aeLAqJR20tkQQMfRn+ocfrtMlJsQ2Uksfs7Xcoo77jAid0bRt\\nksiVmT2HEIJUlRxfABoPBV8wY9zRTUMaMA654pUX41mhyVN+XoerGxFvrs9dF1Ru\\nvCHbI02dM2ppPvyytvvMoefRoL5BTcpAihFgm5xCaakgsJ/tH5oVl74CdhQw8J5L\\nxI/K++KJBUyZ26Uba1632cOiq05JBUW0Z2vWIOk4BLysk7+U9z+SxynKiZR3/xdi\\nXvFKk01R3BHV+GUKM2RYazpS/P8v7eyKhAbKxOdRcFpHLlVwfjyM1VlDQrEZxsMp\\nNTLYXb6Sce1Uov0YtNx5wEowlREH1WOTlwIDAQAB\\n-----END RSA PUBLIC KEY-----\", \"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEAsQZnSWVZNfClk29RcDTJQ76n8zZaiTGuUsi8sUhW8AS4PSbPKDm+\\nDyJgdHDWdIF3HBzl7DHeFrILuqTs0vfS7Pa2NW8nUBwiaYQmPtwEa4n7bTmBVGsB\\n1700/tz8wQWOLUlL2nMv+BPlDhxq4kmJCyJfgrIrHlX8sGPcPA4Y6Rwo0MSqYn3s\\ng1Pu5gOKlaT9HKmE6wn5Sut6IiBjWozrRQ6n5h2RXNtO7O2qCDqjgB2vBxhV7B+z\\nhRbLbCmW0tYMDsvPpX5M8fsO05svN+lKtCAuz1leFns8piZpptpSCFn7bWxiA9/f\\nx5x17D7pfah3Sy2pA+NDXyzSlGcKdaUmwQIDAQAB\\n-----END RSA PUBLIC KEY-----\", \"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEAwqjFW0pi4reKGbkc9pK83Eunwj/k0G8ZTioMMPbZmW99GivMibwa\\nxDM9RDWabEMyUtGoQC2ZcDeLWRK3W8jMP6dnEKAlvLkDLfC4fXYHzFO5KHEqF06i\\nqAqBdmI1iBGdQv/OQCBcbXIWCGDY2AsiqLhlGQfPOI7/vvKc188rTriocgUtoTUc\\n/n/sIUzkgwTqRyvWYynWARWzQg0I9olLBBC2q5RQJJlnYXZwyTL3y9tdb7zOHkks\\nWV9IMQmZmyZh/N7sMbGWQpt4NMchGpPGeJ2e5gHBjDnlIf2p1yZOYeUYrdbwcS0t\\nUiggS4UeE8TzIuXFQxw7fzEIlmhIaq3FnwIDAQAB\\n-----END RSA PUBLIC KEY-----\"];\n\nfor (var _i = 0, _publicKeys = publicKeys; _i < _publicKeys.length; _i++) {\n var pub = _publicKeys[_i];\n addKey(pub);\n}\n\nmodule.exports = {\n encrypt: encrypt,\n addKey: addKey\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/crypto/RSA.js?"); /***/ }), /***/ "./gramjs/errors/Common.js": /*!*********************************!*\ !*** ./gramjs/errors/Common.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _defineProperty(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; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Errors not related to the Telegram API itself\n */\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n/**\n * Occurs when a read operation was cancelled.\n */\n\n\nvar ReadCancelledError =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(ReadCancelledError, _Error);\n\n function ReadCancelledError() {\n _classCallCheck(this, ReadCancelledError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReadCancelledError).call(this, 'The read operation was cancelled.'));\n }\n\n return ReadCancelledError;\n}(_wrapNativeSuper(Error));\n/**\n * Occurs when a type is not found, for example,\n * when trying to read a TLObject with an invalid constructor code.\n */\n\n\nvar TypeNotFoundError =\n/*#__PURE__*/\nfunction (_Error2) {\n _inherits(TypeNotFoundError, _Error2);\n\n function TypeNotFoundError(invalidConstructorId, remaining) {\n var _this;\n\n _classCallCheck(this, TypeNotFoundError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TypeNotFoundError).call(this, \"Could not find a matching Constructor ID for the TLObject that was supposed to be\\n read with ID \".concat(invalidConstructorId, \". Most likely, a TLObject was trying to be read when\\n it should not be read. Remaining bytes: \").concat(remaining)));\n _this.invalidConstructorId = invalidConstructorId;\n _this.remaining = remaining;\n return _this;\n }\n\n return TypeNotFoundError;\n}(_wrapNativeSuper(Error));\n/**\n * Occurs when using the TCP full mode and the checksum of a received\n * packet doesn't match the expected checksum.\n */\n\n\nvar InvalidChecksumError =\n/*#__PURE__*/\nfunction (_Error3) {\n _inherits(InvalidChecksumError, _Error3);\n\n function InvalidChecksumError(checksum, validChecksum) {\n var _this2;\n\n _classCallCheck(this, InvalidChecksumError);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(InvalidChecksumError).call(this, \"Invalid checksum (\".concat(checksum, \" when \").concat(validChecksum, \" was expected). This packet should be skipped.\")));\n _this2.checksum = checksum;\n _this2.validChecksum = validChecksum;\n return _this2;\n }\n\n return InvalidChecksumError;\n}(_wrapNativeSuper(Error));\n/**\n * Occurs when the buffer is invalid, and may contain an HTTP error code.\n * For instance, 404 means \"forgotten/broken authorization key\", while\n */\n\n\nvar InvalidBufferError =\n/*#__PURE__*/\nfunction (_Error4) {\n _inherits(InvalidBufferError, _Error4);\n\n function InvalidBufferError(payload) {\n var _this3;\n\n _classCallCheck(this, InvalidBufferError);\n\n var code = -struct.unpack(' 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n _classCallCheck(this, RPCError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RPCError).call(this, 'RPCError {0}: {1}{2}'.replace('{0}', code).replace('{1}', message).replace('{2}', RPCError._fmtRequest(request))));\n _this.code = code;\n _this.message = message;\n return _this;\n }\n\n _createClass(RPCError, null, [{\n key: \"_fmtRequest\",\n value: function _fmtRequest(request) {\n // TODO fix this\n return \" (caused by \".concat(request.constructor.name, \")\");\n }\n }]);\n\n return RPCError;\n}(_wrapNativeSuper(Error));\n/**\n * The request must be repeated, but directed to a different data center.\n */\n\n\nvar InvalidDCError =\n/*#__PURE__*/\nfunction (_RPCError) {\n _inherits(InvalidDCError, _RPCError);\n\n function InvalidDCError(request, message, code) {\n var _this2;\n\n _classCallCheck(this, InvalidDCError);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(InvalidDCError).call(this, request, message, code));\n _this2.code = code || 303;\n _this2.message = message || 'ERROR_SEE_OTHER';\n return _this2;\n }\n\n return InvalidDCError;\n}(RPCError);\n/**\n * The query contains errors. In the event that a request was created\n * using a form and contains user generated data, the user should be\n * notified that the data must be corrected before the query is repeated.\n */\n\n\nvar BadRequestError =\n/*#__PURE__*/\nfunction (_RPCError2) {\n _inherits(BadRequestError, _RPCError2);\n\n function BadRequestError() {\n var _getPrototypeOf2;\n\n var _this3;\n\n _classCallCheck(this, BadRequestError);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this3 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(BadRequestError)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this3), \"code\", 400);\n\n _defineProperty(_assertThisInitialized(_this3), \"message\", 'BAD_REQUEST');\n\n return _this3;\n }\n\n return BadRequestError;\n}(RPCError);\n/**\n * There was an unauthorized attempt to use functionality available only\n * to authorized users.\n */\n\n\nvar UnauthorizedError =\n/*#__PURE__*/\nfunction (_RPCError3) {\n _inherits(UnauthorizedError, _RPCError3);\n\n function UnauthorizedError() {\n var _getPrototypeOf3;\n\n var _this4;\n\n _classCallCheck(this, UnauthorizedError);\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this4 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(UnauthorizedError)).call.apply(_getPrototypeOf3, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this4), \"code\", 401);\n\n _defineProperty(_assertThisInitialized(_this4), \"message\", 'UNAUTHORIZED');\n\n return _this4;\n }\n\n return UnauthorizedError;\n}(RPCError);\n/**\n * Privacy violation. For example, an attempt to write a message to\n * someone who has blacklisted the current user.\n */\n\n\nvar ForbiddenError =\n/*#__PURE__*/\nfunction (_RPCError4) {\n _inherits(ForbiddenError, _RPCError4);\n\n function ForbiddenError() {\n var _getPrototypeOf4;\n\n var _this5;\n\n _classCallCheck(this, ForbiddenError);\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n _this5 = _possibleConstructorReturn(this, (_getPrototypeOf4 = _getPrototypeOf(ForbiddenError)).call.apply(_getPrototypeOf4, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this5), \"code\", 403);\n\n _defineProperty(_assertThisInitialized(_this5), \"message\", 'FORBIDDEN');\n\n return _this5;\n }\n\n return ForbiddenError;\n}(RPCError);\n/**\n * An attempt to invoke a non-existent object, such as a method.\n */\n\n\nvar NotFoundError =\n/*#__PURE__*/\nfunction (_RPCError5) {\n _inherits(NotFoundError, _RPCError5);\n\n function NotFoundError() {\n var _getPrototypeOf5;\n\n var _this6;\n\n _classCallCheck(this, NotFoundError);\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n _this6 = _possibleConstructorReturn(this, (_getPrototypeOf5 = _getPrototypeOf(NotFoundError)).call.apply(_getPrototypeOf5, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this6), \"code\", 404);\n\n _defineProperty(_assertThisInitialized(_this6), \"message\", 'NOT_FOUND');\n\n return _this6;\n }\n\n return NotFoundError;\n}(RPCError);\n/**\n * Errors related to invalid authorization key, like\n * AUTH_KEY_DUPLICATED which can cause the connection to fail.\n */\n\n\nvar AuthKeyError =\n/*#__PURE__*/\nfunction (_RPCError6) {\n _inherits(AuthKeyError, _RPCError6);\n\n function AuthKeyError() {\n var _getPrototypeOf6;\n\n var _this7;\n\n _classCallCheck(this, AuthKeyError);\n\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n _this7 = _possibleConstructorReturn(this, (_getPrototypeOf6 = _getPrototypeOf(AuthKeyError)).call.apply(_getPrototypeOf6, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this7), \"code\", 406);\n\n _defineProperty(_assertThisInitialized(_this7), \"message\", 'AUTH_KEY');\n\n return _this7;\n }\n\n return AuthKeyError;\n}(RPCError);\n/**\n * The maximum allowed number of attempts to invoke the given method\n * with the given input parameters has been exceeded. For example, in an\n * attempt to request a large number of text messages (SMS) for the same\n * phone number.\n */\n\n\nvar FloodError =\n/*#__PURE__*/\nfunction (_RPCError7) {\n _inherits(FloodError, _RPCError7);\n\n function FloodError() {\n var _getPrototypeOf7;\n\n var _this8;\n\n _classCallCheck(this, FloodError);\n\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n _this8 = _possibleConstructorReturn(this, (_getPrototypeOf7 = _getPrototypeOf(FloodError)).call.apply(_getPrototypeOf7, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this8), \"code\", 420);\n\n _defineProperty(_assertThisInitialized(_this8), \"message\", 'FLOOD');\n\n return _this8;\n }\n\n return FloodError;\n}(RPCError);\n/**\n * An internal server error occurred while a request was being processed\n * for example, there was a disruption while accessing a database or file\n * storage\n */\n\n\nvar ServerError =\n/*#__PURE__*/\nfunction (_RPCError8) {\n _inherits(ServerError, _RPCError8);\n\n function ServerError() {\n var _getPrototypeOf8;\n\n var _this9;\n\n _classCallCheck(this, ServerError);\n\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n _this9 = _possibleConstructorReturn(this, (_getPrototypeOf8 = _getPrototypeOf(ServerError)).call.apply(_getPrototypeOf8, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this9), \"code\", 500);\n\n _defineProperty(_assertThisInitialized(_this9), \"message\", 'INTERNAL');\n\n return _this9;\n }\n\n return ServerError;\n}(RPCError);\n/**\n * Clicking the inline buttons of bots that never (or take to long to)\n * call ``answerCallbackQuery`` will result in this \"special\" RPCError.\n */\n\n\nvar TimedOutError =\n/*#__PURE__*/\nfunction (_RPCError9) {\n _inherits(TimedOutError, _RPCError9);\n\n function TimedOutError() {\n var _getPrototypeOf9;\n\n var _this10;\n\n _classCallCheck(this, TimedOutError);\n\n for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n args[_key8] = arguments[_key8];\n }\n\n _this10 = _possibleConstructorReturn(this, (_getPrototypeOf9 = _getPrototypeOf(TimedOutError)).call.apply(_getPrototypeOf9, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this10), \"code\", 503);\n\n _defineProperty(_assertThisInitialized(_this10), \"message\", 'Timeout');\n\n return _this10;\n }\n\n return TimedOutError;\n}(RPCError);\n\nmodule.exports = {\n RPCError: RPCError,\n InvalidDCError: InvalidDCError,\n BadRequestError: BadRequestError,\n UnauthorizedError: UnauthorizedError,\n ForbiddenError: ForbiddenError,\n NotFoundError: NotFoundError,\n AuthKeyError: AuthKeyError,\n FloodError: FloodError,\n ServerError: ServerError,\n TimedOutError: TimedOutError\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/errors/RPCBaseErrors.js?"); /***/ }), /***/ "./gramjs/errors/RPCErrorList.js": /*!***************************************!*\ !*** ./gramjs/errors/RPCErrorList.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = __webpack_require__(/*! ./rpcbaseerrors */ \"./gramjs/errors/rpcbaseerrors.js\"),\n RPCError = _require.RPCError,\n BadRequestError = _require.BadRequestError,\n UnauthorizedError = _require.UnauthorizedError,\n AuthKeyError = _require.AuthKeyError,\n ServerError = _require.ServerError,\n ForbiddenError = _require.ForbiddenError,\n InvalidDCError = _require.InvalidDCError,\n FloodError = _require.FloodError,\n TimedOutError = _require.TimedOutError;\n\nvar format = __webpack_require__(/*! string-format */ \"./node_modules/string-format/index.js\");\n\nvar AboutTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError) {\n _inherits(AboutTooLongError, _BadRequestError);\n\n function AboutTooLongError(args) {\n _classCallCheck(this, AboutTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AboutTooLongError).call(this, 'The provided bio is too long' + RPCError._fmtRequest(args.request)));\n }\n\n return AboutTooLongError;\n}(BadRequestError);\n\nvar AccessTokenExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError2) {\n _inherits(AccessTokenExpiredError, _BadRequestError2);\n\n function AccessTokenExpiredError(args) {\n _classCallCheck(this, AccessTokenExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AccessTokenExpiredError).call(this, 'Bot token expired' + RPCError._fmtRequest(args.request)));\n }\n\n return AccessTokenExpiredError;\n}(BadRequestError);\n\nvar AccessTokenInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError3) {\n _inherits(AccessTokenInvalidError, _BadRequestError3);\n\n function AccessTokenInvalidError(args) {\n _classCallCheck(this, AccessTokenInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AccessTokenInvalidError).call(this, 'The provided token is not valid' + RPCError._fmtRequest(args.request)));\n }\n\n return AccessTokenInvalidError;\n}(BadRequestError);\n\nvar ActiveUserRequiredError =\n/*#__PURE__*/\nfunction (_UnauthorizedError) {\n _inherits(ActiveUserRequiredError, _UnauthorizedError);\n\n function ActiveUserRequiredError(args) {\n _classCallCheck(this, ActiveUserRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ActiveUserRequiredError).call(this, 'The method is only available to already activated users' + RPCError._fmtRequest(args.request)));\n }\n\n return ActiveUserRequiredError;\n}(UnauthorizedError);\n\nvar AdminsTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError4) {\n _inherits(AdminsTooMuchError, _BadRequestError4);\n\n function AdminsTooMuchError(args) {\n _classCallCheck(this, AdminsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AdminsTooMuchError).call(this, 'Too many admins' + RPCError._fmtRequest(args.request)));\n }\n\n return AdminsTooMuchError;\n}(BadRequestError);\n\nvar AdminRankEmojiNotAllowedError =\n/*#__PURE__*/\nfunction (_BadRequestError5) {\n _inherits(AdminRankEmojiNotAllowedError, _BadRequestError5);\n\n function AdminRankEmojiNotAllowedError(args) {\n _classCallCheck(this, AdminRankEmojiNotAllowedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AdminRankEmojiNotAllowedError).call(this, 'Emoji are not allowed in admin titles or ranks' + RPCError._fmtRequest(args.request)));\n }\n\n return AdminRankEmojiNotAllowedError;\n}(BadRequestError);\n\nvar AdminRankInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError6) {\n _inherits(AdminRankInvalidError, _BadRequestError6);\n\n function AdminRankInvalidError(args) {\n _classCallCheck(this, AdminRankInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AdminRankInvalidError).call(this, 'The given admin title or rank was invalid (possibly larger than 16 characters)' + RPCError._fmtRequest(args.request)));\n }\n\n return AdminRankInvalidError;\n}(BadRequestError);\n\nvar ApiIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError7) {\n _inherits(ApiIdInvalidError, _BadRequestError7);\n\n function ApiIdInvalidError(args) {\n _classCallCheck(this, ApiIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ApiIdInvalidError).call(this, 'The api_id/api_hash combination is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ApiIdInvalidError;\n}(BadRequestError);\n\nvar ApiIdPublishedFloodError =\n/*#__PURE__*/\nfunction (_BadRequestError8) {\n _inherits(ApiIdPublishedFloodError, _BadRequestError8);\n\n function ApiIdPublishedFloodError(args) {\n _classCallCheck(this, ApiIdPublishedFloodError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ApiIdPublishedFloodError).call(this, 'This API id was published somewhere, you can\\'t use it now' + RPCError._fmtRequest(args.request)));\n }\n\n return ApiIdPublishedFloodError;\n}(BadRequestError);\n\nvar ArticleTitleEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError9) {\n _inherits(ArticleTitleEmptyError, _BadRequestError9);\n\n function ArticleTitleEmptyError(args) {\n _classCallCheck(this, ArticleTitleEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ArticleTitleEmptyError).call(this, 'The title of the article is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ArticleTitleEmptyError;\n}(BadRequestError);\n\nvar AuthBytesInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError10) {\n _inherits(AuthBytesInvalidError, _BadRequestError10);\n\n function AuthBytesInvalidError(args) {\n _classCallCheck(this, AuthBytesInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthBytesInvalidError).call(this, 'The provided authorization is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthBytesInvalidError;\n}(BadRequestError);\n\nvar AuthKeyDuplicatedError =\n/*#__PURE__*/\nfunction (_AuthKeyError) {\n _inherits(AuthKeyDuplicatedError, _AuthKeyError);\n\n function AuthKeyDuplicatedError(args) {\n _classCallCheck(this, AuthKeyDuplicatedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthKeyDuplicatedError).call(this, 'The authorization key (session file) was used under two different IP addresses simultaneously, and can no longer be used. Use the same session exclusively, or use different sessions' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthKeyDuplicatedError;\n}(AuthKeyError);\n\nvar AuthKeyInvalidError =\n/*#__PURE__*/\nfunction (_UnauthorizedError2) {\n _inherits(AuthKeyInvalidError, _UnauthorizedError2);\n\n function AuthKeyInvalidError(args) {\n _classCallCheck(this, AuthKeyInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthKeyInvalidError).call(this, 'The key is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthKeyInvalidError;\n}(UnauthorizedError);\n\nvar AuthKeyPermEmptyError =\n/*#__PURE__*/\nfunction (_UnauthorizedError3) {\n _inherits(AuthKeyPermEmptyError, _UnauthorizedError3);\n\n function AuthKeyPermEmptyError(args) {\n _classCallCheck(this, AuthKeyPermEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthKeyPermEmptyError).call(this, 'The method is unavailable for temporary authorization key, not bound to permanent' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthKeyPermEmptyError;\n}(UnauthorizedError);\n\nvar AuthKeyUnregisteredError =\n/*#__PURE__*/\nfunction (_UnauthorizedError4) {\n _inherits(AuthKeyUnregisteredError, _UnauthorizedError4);\n\n function AuthKeyUnregisteredError(args) {\n _classCallCheck(this, AuthKeyUnregisteredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthKeyUnregisteredError).call(this, 'The key is not registered in the system' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthKeyUnregisteredError;\n}(UnauthorizedError);\n\nvar AuthRestartError =\n/*#__PURE__*/\nfunction (_ServerError) {\n _inherits(AuthRestartError, _ServerError);\n\n function AuthRestartError(args) {\n _classCallCheck(this, AuthRestartError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(AuthRestartError).call(this, 'Restart the authorization process' + RPCError._fmtRequest(args.request)));\n }\n\n return AuthRestartError;\n}(ServerError);\n\nvar BannedRightsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError11) {\n _inherits(BannedRightsInvalidError, _BadRequestError11);\n\n function BannedRightsInvalidError(args) {\n _classCallCheck(this, BannedRightsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BannedRightsInvalidError).call(this, 'You cannot use that set of permissions in this request, i.e. restricting view_messages as a default' + RPCError._fmtRequest(args.request)));\n }\n\n return BannedRightsInvalidError;\n}(BadRequestError);\n\nvar BotsTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError12) {\n _inherits(BotsTooMuchError, _BadRequestError12);\n\n function BotsTooMuchError(args) {\n _classCallCheck(this, BotsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotsTooMuchError).call(this, 'There are too many bots in this chat/channel' + RPCError._fmtRequest(args.request)));\n }\n\n return BotsTooMuchError;\n}(BadRequestError);\n\nvar BotChannelsNaError =\n/*#__PURE__*/\nfunction (_BadRequestError13) {\n _inherits(BotChannelsNaError, _BadRequestError13);\n\n function BotChannelsNaError(args) {\n _classCallCheck(this, BotChannelsNaError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotChannelsNaError).call(this, 'Bots can\\'t edit admin privileges' + RPCError._fmtRequest(args.request)));\n }\n\n return BotChannelsNaError;\n}(BadRequestError);\n\nvar BotGroupsBlockedError =\n/*#__PURE__*/\nfunction (_BadRequestError14) {\n _inherits(BotGroupsBlockedError, _BadRequestError14);\n\n function BotGroupsBlockedError(args) {\n _classCallCheck(this, BotGroupsBlockedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotGroupsBlockedError).call(this, 'This bot can\\'t be added to groups' + RPCError._fmtRequest(args.request)));\n }\n\n return BotGroupsBlockedError;\n}(BadRequestError);\n\nvar BotInlineDisabledError =\n/*#__PURE__*/\nfunction (_BadRequestError15) {\n _inherits(BotInlineDisabledError, _BadRequestError15);\n\n function BotInlineDisabledError(args) {\n _classCallCheck(this, BotInlineDisabledError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotInlineDisabledError).call(this, 'This bot can\\'t be used in inline mode' + RPCError._fmtRequest(args.request)));\n }\n\n return BotInlineDisabledError;\n}(BadRequestError);\n\nvar BotInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError16) {\n _inherits(BotInvalidError, _BadRequestError16);\n\n function BotInvalidError(args) {\n _classCallCheck(this, BotInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotInvalidError).call(this, 'This is not a valid bot' + RPCError._fmtRequest(args.request)));\n }\n\n return BotInvalidError;\n}(BadRequestError);\n\nvar BotMethodInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError17) {\n _inherits(BotMethodInvalidError, _BadRequestError17);\n\n function BotMethodInvalidError(args) {\n _classCallCheck(this, BotMethodInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotMethodInvalidError).call(this, 'The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot' + RPCError._fmtRequest(args.request)));\n }\n\n return BotMethodInvalidError;\n}(BadRequestError);\n\nvar BotMissingError =\n/*#__PURE__*/\nfunction (_BadRequestError18) {\n _inherits(BotMissingError, _BadRequestError18);\n\n function BotMissingError(args) {\n _classCallCheck(this, BotMissingError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotMissingError).call(this, 'This method can only be run by a bot' + RPCError._fmtRequest(args.request)));\n }\n\n return BotMissingError;\n}(BadRequestError);\n\nvar BotPaymentsDisabledError =\n/*#__PURE__*/\nfunction (_BadRequestError19) {\n _inherits(BotPaymentsDisabledError, _BadRequestError19);\n\n function BotPaymentsDisabledError(args) {\n _classCallCheck(this, BotPaymentsDisabledError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotPaymentsDisabledError).call(this, 'This method can only be run by a bot' + RPCError._fmtRequest(args.request)));\n }\n\n return BotPaymentsDisabledError;\n}(BadRequestError);\n\nvar BotPollsDisabledError =\n/*#__PURE__*/\nfunction (_BadRequestError20) {\n _inherits(BotPollsDisabledError, _BadRequestError20);\n\n function BotPollsDisabledError(args) {\n _classCallCheck(this, BotPollsDisabledError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BotPollsDisabledError).call(this, 'You cannot create polls under a bot account' + RPCError._fmtRequest(args.request)));\n }\n\n return BotPollsDisabledError;\n}(BadRequestError);\n\nvar BroadcastIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError21) {\n _inherits(BroadcastIdInvalidError, _BadRequestError21);\n\n function BroadcastIdInvalidError(args) {\n _classCallCheck(this, BroadcastIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(BroadcastIdInvalidError).call(this, 'The channel is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return BroadcastIdInvalidError;\n}(BadRequestError);\n\nvar ButtonDataInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError22) {\n _inherits(ButtonDataInvalidError, _BadRequestError22);\n\n function ButtonDataInvalidError(args) {\n _classCallCheck(this, ButtonDataInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ButtonDataInvalidError).call(this, 'The provided button data is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ButtonDataInvalidError;\n}(BadRequestError);\n\nvar ButtonTypeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError23) {\n _inherits(ButtonTypeInvalidError, _BadRequestError23);\n\n function ButtonTypeInvalidError(args) {\n _classCallCheck(this, ButtonTypeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ButtonTypeInvalidError).call(this, 'The type of one of the buttons you provided is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ButtonTypeInvalidError;\n}(BadRequestError);\n\nvar ButtonUrlInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError24) {\n _inherits(ButtonUrlInvalidError, _BadRequestError24);\n\n function ButtonUrlInvalidError(args) {\n _classCallCheck(this, ButtonUrlInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ButtonUrlInvalidError).call(this, 'Button URL invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ButtonUrlInvalidError;\n}(BadRequestError);\n\nvar CallAlreadyAcceptedError =\n/*#__PURE__*/\nfunction (_BadRequestError25) {\n _inherits(CallAlreadyAcceptedError, _BadRequestError25);\n\n function CallAlreadyAcceptedError(args) {\n _classCallCheck(this, CallAlreadyAcceptedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CallAlreadyAcceptedError).call(this, 'The call was already accepted' + RPCError._fmtRequest(args.request)));\n }\n\n return CallAlreadyAcceptedError;\n}(BadRequestError);\n\nvar CallAlreadyDeclinedError =\n/*#__PURE__*/\nfunction (_BadRequestError26) {\n _inherits(CallAlreadyDeclinedError, _BadRequestError26);\n\n function CallAlreadyDeclinedError(args) {\n _classCallCheck(this, CallAlreadyDeclinedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CallAlreadyDeclinedError).call(this, 'The call was already declined' + RPCError._fmtRequest(args.request)));\n }\n\n return CallAlreadyDeclinedError;\n}(BadRequestError);\n\nvar CallOccupyFailedError =\n/*#__PURE__*/\nfunction (_ServerError2) {\n _inherits(CallOccupyFailedError, _ServerError2);\n\n function CallOccupyFailedError(args) {\n _classCallCheck(this, CallOccupyFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CallOccupyFailedError).call(this, 'The call failed because the user is already making another call' + RPCError._fmtRequest(args.request)));\n }\n\n return CallOccupyFailedError;\n}(ServerError);\n\nvar CallPeerInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError27) {\n _inherits(CallPeerInvalidError, _BadRequestError27);\n\n function CallPeerInvalidError(args) {\n _classCallCheck(this, CallPeerInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CallPeerInvalidError).call(this, 'The provided call peer object is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return CallPeerInvalidError;\n}(BadRequestError);\n\nvar CallProtocolFlagsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError28) {\n _inherits(CallProtocolFlagsInvalidError, _BadRequestError28);\n\n function CallProtocolFlagsInvalidError(args) {\n _classCallCheck(this, CallProtocolFlagsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CallProtocolFlagsInvalidError).call(this, 'Call protocol flags invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return CallProtocolFlagsInvalidError;\n}(BadRequestError);\n\nvar CdnMethodInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError29) {\n _inherits(CdnMethodInvalidError, _BadRequestError29);\n\n function CdnMethodInvalidError(args) {\n _classCallCheck(this, CdnMethodInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CdnMethodInvalidError).call(this, 'This method cannot be invoked on a CDN server. Refer to https://core.telegram.org/cdn#schema for available methods' + RPCError._fmtRequest(args.request)));\n }\n\n return CdnMethodInvalidError;\n}(BadRequestError);\n\nvar ChannelsAdminPublicTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError30) {\n _inherits(ChannelsAdminPublicTooMuchError, _BadRequestError30);\n\n function ChannelsAdminPublicTooMuchError(args) {\n _classCallCheck(this, ChannelsAdminPublicTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChannelsAdminPublicTooMuchError).call(this, 'You\\'re admin of too many public channels, make some channels private to change the username of this channel' + RPCError._fmtRequest(args.request)));\n }\n\n return ChannelsAdminPublicTooMuchError;\n}(BadRequestError);\n\nvar ChannelsTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError31) {\n _inherits(ChannelsTooMuchError, _BadRequestError31);\n\n function ChannelsTooMuchError(args) {\n _classCallCheck(this, ChannelsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChannelsTooMuchError).call(this, 'You have joined too many channels/supergroups' + RPCError._fmtRequest(args.request)));\n }\n\n return ChannelsTooMuchError;\n}(BadRequestError);\n\nvar ChannelInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError32) {\n _inherits(ChannelInvalidError, _BadRequestError32);\n\n function ChannelInvalidError(args) {\n _classCallCheck(this, ChannelInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChannelInvalidError).call(this, 'Invalid channel object. Make sure to pass the right types, for instance making sure that the request is designed for channels or otherwise look for a different one more suited' + RPCError._fmtRequest(args.request)));\n }\n\n return ChannelInvalidError;\n}(BadRequestError);\n\nvar ChannelPrivateError =\n/*#__PURE__*/\nfunction (_BadRequestError33) {\n _inherits(ChannelPrivateError, _BadRequestError33);\n\n function ChannelPrivateError(args) {\n _classCallCheck(this, ChannelPrivateError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChannelPrivateError).call(this, 'The channel specified is private and you lack permission to access it. Another reason may be that you were banned from it' + RPCError._fmtRequest(args.request)));\n }\n\n return ChannelPrivateError;\n}(BadRequestError);\n\nvar ChannelPublicGroupNaError =\n/*#__PURE__*/\nfunction (_ForbiddenError) {\n _inherits(ChannelPublicGroupNaError, _ForbiddenError);\n\n function ChannelPublicGroupNaError(args) {\n _classCallCheck(this, ChannelPublicGroupNaError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChannelPublicGroupNaError).call(this, 'channel/supergroup not available' + RPCError._fmtRequest(args.request)));\n }\n\n return ChannelPublicGroupNaError;\n}(ForbiddenError);\n\nvar ChatAboutNotModifiedError =\n/*#__PURE__*/\nfunction (_BadRequestError34) {\n _inherits(ChatAboutNotModifiedError, _BadRequestError34);\n\n function ChatAboutNotModifiedError(args) {\n _classCallCheck(this, ChatAboutNotModifiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatAboutNotModifiedError).call(this, 'About text has not changed' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatAboutNotModifiedError;\n}(BadRequestError);\n\nvar ChatAboutTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError35) {\n _inherits(ChatAboutTooLongError, _BadRequestError35);\n\n function ChatAboutTooLongError(args) {\n _classCallCheck(this, ChatAboutTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatAboutTooLongError).call(this, 'Chat about too long' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatAboutTooLongError;\n}(BadRequestError);\n\nvar ChatAdminInviteRequiredError =\n/*#__PURE__*/\nfunction (_ForbiddenError2) {\n _inherits(ChatAdminInviteRequiredError, _ForbiddenError2);\n\n function ChatAdminInviteRequiredError(args) {\n _classCallCheck(this, ChatAdminInviteRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatAdminInviteRequiredError).call(this, 'You do not have the rights to do this' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatAdminInviteRequiredError;\n}(ForbiddenError);\n\nvar ChatAdminRequiredError =\n/*#__PURE__*/\nfunction (_BadRequestError36) {\n _inherits(ChatAdminRequiredError, _BadRequestError36);\n\n function ChatAdminRequiredError(args) {\n _classCallCheck(this, ChatAdminRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatAdminRequiredError).call(this, 'Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatAdminRequiredError;\n}(BadRequestError);\n\nvar ChatForbiddenError =\n/*#__PURE__*/\nfunction (_BadRequestError37) {\n _inherits(ChatForbiddenError, _BadRequestError37);\n\n function ChatForbiddenError(args) {\n _classCallCheck(this, ChatForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatForbiddenError).call(this, 'You cannot write in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatForbiddenError;\n}(BadRequestError);\n\nvar ChatIdEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError38) {\n _inherits(ChatIdEmptyError, _BadRequestError38);\n\n function ChatIdEmptyError(args) {\n _classCallCheck(this, ChatIdEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatIdEmptyError).call(this, 'The provided chat ID is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatIdEmptyError;\n}(BadRequestError);\n\nvar ChatIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError39) {\n _inherits(ChatIdInvalidError, _BadRequestError39);\n\n function ChatIdInvalidError(args) {\n _classCallCheck(this, ChatIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatIdInvalidError).call(this, 'Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited\\nAn example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatIdInvalidError;\n}(BadRequestError);\n\nvar ChatInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError40) {\n _inherits(ChatInvalidError, _BadRequestError40);\n\n function ChatInvalidError(args) {\n _classCallCheck(this, ChatInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatInvalidError).call(this, 'The chat is invalid for this request' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatInvalidError;\n}(BadRequestError);\n\nvar ChatLinkExistsError =\n/*#__PURE__*/\nfunction (_BadRequestError41) {\n _inherits(ChatLinkExistsError, _BadRequestError41);\n\n function ChatLinkExistsError(args) {\n _classCallCheck(this, ChatLinkExistsError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatLinkExistsError).call(this, 'The chat is linked to a channel and cannot be used in that request' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatLinkExistsError;\n}(BadRequestError);\n\nvar ChatNotModifiedError =\n/*#__PURE__*/\nfunction (_BadRequestError42) {\n _inherits(ChatNotModifiedError, _BadRequestError42);\n\n function ChatNotModifiedError(args) {\n _classCallCheck(this, ChatNotModifiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatNotModifiedError).call(this, 'The chat or channel wasn\\'t modified (title, invites, username, admins, etc. are the same)' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatNotModifiedError;\n}(BadRequestError);\n\nvar ChatRestrictedError =\n/*#__PURE__*/\nfunction (_BadRequestError43) {\n _inherits(ChatRestrictedError, _BadRequestError43);\n\n function ChatRestrictedError(args) {\n _classCallCheck(this, ChatRestrictedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatRestrictedError).call(this, 'The chat is restricted and cannot be used in that request' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatRestrictedError;\n}(BadRequestError);\n\nvar ChatSendGifsForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError3) {\n _inherits(ChatSendGifsForbiddenError, _ForbiddenError3);\n\n function ChatSendGifsForbiddenError(args) {\n _classCallCheck(this, ChatSendGifsForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatSendGifsForbiddenError).call(this, 'You can\\'t send gifs in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatSendGifsForbiddenError;\n}(ForbiddenError);\n\nvar ChatSendInlineForbiddenError =\n/*#__PURE__*/\nfunction (_BadRequestError44) {\n _inherits(ChatSendInlineForbiddenError, _BadRequestError44);\n\n function ChatSendInlineForbiddenError(args) {\n _classCallCheck(this, ChatSendInlineForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatSendInlineForbiddenError).call(this, 'You cannot send inline results in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatSendInlineForbiddenError;\n}(BadRequestError);\n\nvar ChatSendMediaForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError4) {\n _inherits(ChatSendMediaForbiddenError, _ForbiddenError4);\n\n function ChatSendMediaForbiddenError(args) {\n _classCallCheck(this, ChatSendMediaForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatSendMediaForbiddenError).call(this, 'You can\\'t send media in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatSendMediaForbiddenError;\n}(ForbiddenError);\n\nvar ChatSendStickersForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError5) {\n _inherits(ChatSendStickersForbiddenError, _ForbiddenError5);\n\n function ChatSendStickersForbiddenError(args) {\n _classCallCheck(this, ChatSendStickersForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatSendStickersForbiddenError).call(this, 'You can\\'t send stickers in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatSendStickersForbiddenError;\n}(ForbiddenError);\n\nvar ChatTitleEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError45) {\n _inherits(ChatTitleEmptyError, _BadRequestError45);\n\n function ChatTitleEmptyError(args) {\n _classCallCheck(this, ChatTitleEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatTitleEmptyError).call(this, 'No chat title provided' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatTitleEmptyError;\n}(BadRequestError);\n\nvar ChatWriteForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError6) {\n _inherits(ChatWriteForbiddenError, _ForbiddenError6);\n\n function ChatWriteForbiddenError(args) {\n _classCallCheck(this, ChatWriteForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ChatWriteForbiddenError).call(this, 'You can\\'t write in this chat' + RPCError._fmtRequest(args.request)));\n }\n\n return ChatWriteForbiddenError;\n}(ForbiddenError);\n\nvar CodeEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError46) {\n _inherits(CodeEmptyError, _BadRequestError46);\n\n function CodeEmptyError(args) {\n _classCallCheck(this, CodeEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CodeEmptyError).call(this, 'The provided code is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return CodeEmptyError;\n}(BadRequestError);\n\nvar CodeHashInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError47) {\n _inherits(CodeHashInvalidError, _BadRequestError47);\n\n function CodeHashInvalidError(args) {\n _classCallCheck(this, CodeHashInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CodeHashInvalidError).call(this, 'Code hash invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return CodeHashInvalidError;\n}(BadRequestError);\n\nvar CodeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError48) {\n _inherits(CodeInvalidError, _BadRequestError48);\n\n function CodeInvalidError(args) {\n _classCallCheck(this, CodeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CodeInvalidError).call(this, 'Code invalid (i.e. from email)' + RPCError._fmtRequest(args.request)));\n }\n\n return CodeInvalidError;\n}(BadRequestError);\n\nvar ConnectionApiIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError49) {\n _inherits(ConnectionApiIdInvalidError, _BadRequestError49);\n\n function ConnectionApiIdInvalidError(args) {\n _classCallCheck(this, ConnectionApiIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionApiIdInvalidError).call(this, 'The provided API id is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionApiIdInvalidError;\n}(BadRequestError);\n\nvar ConnectionDeviceModelEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError50) {\n _inherits(ConnectionDeviceModelEmptyError, _BadRequestError50);\n\n function ConnectionDeviceModelEmptyError(args) {\n _classCallCheck(this, ConnectionDeviceModelEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionDeviceModelEmptyError).call(this, 'Device model empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionDeviceModelEmptyError;\n}(BadRequestError);\n\nvar ConnectionLangPackInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError51) {\n _inherits(ConnectionLangPackInvalidError, _BadRequestError51);\n\n function ConnectionLangPackInvalidError(args) {\n _classCallCheck(this, ConnectionLangPackInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionLangPackInvalidError).call(this, 'The specified language pack is not valid. This is meant to be used by official applications only so far, leave it empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionLangPackInvalidError;\n}(BadRequestError);\n\nvar ConnectionLayerInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError52) {\n _inherits(ConnectionLayerInvalidError, _BadRequestError52);\n\n function ConnectionLayerInvalidError(args) {\n _classCallCheck(this, ConnectionLayerInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionLayerInvalidError).call(this, 'The very first request must always be InvokeWithLayerRequest' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionLayerInvalidError;\n}(BadRequestError);\n\nvar ConnectionNotInitedError =\n/*#__PURE__*/\nfunction (_BadRequestError53) {\n _inherits(ConnectionNotInitedError, _BadRequestError53);\n\n function ConnectionNotInitedError(args) {\n _classCallCheck(this, ConnectionNotInitedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionNotInitedError).call(this, 'Connection not initialized' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionNotInitedError;\n}(BadRequestError);\n\nvar ConnectionSystemEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError54) {\n _inherits(ConnectionSystemEmptyError, _BadRequestError54);\n\n function ConnectionSystemEmptyError(args) {\n _classCallCheck(this, ConnectionSystemEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ConnectionSystemEmptyError).call(this, 'Connection system empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ConnectionSystemEmptyError;\n}(BadRequestError);\n\nvar ContactIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError55) {\n _inherits(ContactIdInvalidError, _BadRequestError55);\n\n function ContactIdInvalidError(args) {\n _classCallCheck(this, ContactIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ContactIdInvalidError).call(this, 'The provided contact ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ContactIdInvalidError;\n}(BadRequestError);\n\nvar DataInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError56) {\n _inherits(DataInvalidError, _BadRequestError56);\n\n function DataInvalidError(args) {\n _classCallCheck(this, DataInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DataInvalidError).call(this, 'Encrypted data invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return DataInvalidError;\n}(BadRequestError);\n\nvar DataJsonInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError57) {\n _inherits(DataJsonInvalidError, _BadRequestError57);\n\n function DataJsonInvalidError(args) {\n _classCallCheck(this, DataJsonInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DataJsonInvalidError).call(this, 'The provided JSON data is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return DataJsonInvalidError;\n}(BadRequestError);\n\nvar DateEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError58) {\n _inherits(DateEmptyError, _BadRequestError58);\n\n function DateEmptyError(args) {\n _classCallCheck(this, DateEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DateEmptyError).call(this, 'Date empty' + RPCError._fmtRequest(args.request)));\n }\n\n return DateEmptyError;\n}(BadRequestError);\n\nvar DcIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError59) {\n _inherits(DcIdInvalidError, _BadRequestError59);\n\n function DcIdInvalidError(args) {\n _classCallCheck(this, DcIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DcIdInvalidError).call(this, 'This occurs when an authorization is tried to be exported for the same data center one is currently connected to' + RPCError._fmtRequest(args.request)));\n }\n\n return DcIdInvalidError;\n}(BadRequestError);\n\nvar DhGAInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError60) {\n _inherits(DhGAInvalidError, _BadRequestError60);\n\n function DhGAInvalidError(args) {\n _classCallCheck(this, DhGAInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DhGAInvalidError).call(this, 'g_a invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return DhGAInvalidError;\n}(BadRequestError);\n\nvar EmailHashExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError61) {\n _inherits(EmailHashExpiredError, _BadRequestError61);\n\n function EmailHashExpiredError(args) {\n _classCallCheck(this, EmailHashExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EmailHashExpiredError).call(this, 'The email hash expired and cannot be used to verify it' + RPCError._fmtRequest(args.request)));\n }\n\n return EmailHashExpiredError;\n}(BadRequestError);\n\nvar EmailInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError62) {\n _inherits(EmailInvalidError, _BadRequestError62);\n\n function EmailInvalidError(args) {\n _classCallCheck(this, EmailInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EmailInvalidError).call(this, 'The given email is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return EmailInvalidError;\n}(BadRequestError);\n\nvar EmailUnconfirmedError =\n/*#__PURE__*/\nfunction (_BadRequestError63) {\n _inherits(EmailUnconfirmedError, _BadRequestError63);\n\n function EmailUnconfirmedError(args) {\n var _this;\n\n _classCallCheck(this, EmailUnconfirmedError);\n\n var codeLength = Number(args.capture || 0);\n _this = _possibleConstructorReturn(this, _getPrototypeOf(EmailUnconfirmedError).call(this, format('Email unconfirmed, the length of the code must be {code_length}', {\n codeLength: codeLength\n }) + RPCError._fmtRequest(args.request)));\n _this.codeLength = codeLength;\n return _this;\n }\n\n return EmailUnconfirmedError;\n}(BadRequestError);\n\nvar EmoticonEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError64) {\n _inherits(EmoticonEmptyError, _BadRequestError64);\n\n function EmoticonEmptyError(args) {\n _classCallCheck(this, EmoticonEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EmoticonEmptyError).call(this, 'The emoticon field cannot be empty' + RPCError._fmtRequest(args.request)));\n }\n\n return EmoticonEmptyError;\n}(BadRequestError);\n\nvar EncryptedMessageInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError65) {\n _inherits(EncryptedMessageInvalidError, _BadRequestError65);\n\n function EncryptedMessageInvalidError(args) {\n _classCallCheck(this, EncryptedMessageInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptedMessageInvalidError).call(this, 'Encrypted message invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptedMessageInvalidError;\n}(BadRequestError);\n\nvar EncryptionAlreadyAcceptedError =\n/*#__PURE__*/\nfunction (_BadRequestError66) {\n _inherits(EncryptionAlreadyAcceptedError, _BadRequestError66);\n\n function EncryptionAlreadyAcceptedError(args) {\n _classCallCheck(this, EncryptionAlreadyAcceptedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptionAlreadyAcceptedError).call(this, 'Secret chat already accepted' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptionAlreadyAcceptedError;\n}(BadRequestError);\n\nvar EncryptionAlreadyDeclinedError =\n/*#__PURE__*/\nfunction (_BadRequestError67) {\n _inherits(EncryptionAlreadyDeclinedError, _BadRequestError67);\n\n function EncryptionAlreadyDeclinedError(args) {\n _classCallCheck(this, EncryptionAlreadyDeclinedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptionAlreadyDeclinedError).call(this, 'The secret chat was already declined' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptionAlreadyDeclinedError;\n}(BadRequestError);\n\nvar EncryptionDeclinedError =\n/*#__PURE__*/\nfunction (_BadRequestError68) {\n _inherits(EncryptionDeclinedError, _BadRequestError68);\n\n function EncryptionDeclinedError(args) {\n _classCallCheck(this, EncryptionDeclinedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptionDeclinedError).call(this, 'The secret chat was declined' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptionDeclinedError;\n}(BadRequestError);\n\nvar EncryptionIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError69) {\n _inherits(EncryptionIdInvalidError, _BadRequestError69);\n\n function EncryptionIdInvalidError(args) {\n _classCallCheck(this, EncryptionIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptionIdInvalidError).call(this, 'The provided secret chat ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptionIdInvalidError;\n}(BadRequestError);\n\nvar EncryptionOccupyFailedError =\n/*#__PURE__*/\nfunction (_ServerError3) {\n _inherits(EncryptionOccupyFailedError, _ServerError3);\n\n function EncryptionOccupyFailedError(args) {\n _classCallCheck(this, EncryptionOccupyFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EncryptionOccupyFailedError).call(this, 'TDLib developer claimed it is not an error while accepting secret chats and 500 is used instead of 420' + RPCError._fmtRequest(args.request)));\n }\n\n return EncryptionOccupyFailedError;\n}(ServerError);\n\nvar EntitiesTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError70) {\n _inherits(EntitiesTooLongError, _BadRequestError70);\n\n function EntitiesTooLongError(args) {\n _classCallCheck(this, EntitiesTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EntitiesTooLongError).call(this, 'It is no longer possible to send such long data inside entity tags (for example inline text URLs)' + RPCError._fmtRequest(args.request)));\n }\n\n return EntitiesTooLongError;\n}(BadRequestError);\n\nvar EntityMentionUserInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError71) {\n _inherits(EntityMentionUserInvalidError, _BadRequestError71);\n\n function EntityMentionUserInvalidError(args) {\n _classCallCheck(this, EntityMentionUserInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(EntityMentionUserInvalidError).call(this, 'You can\\'t use this entity' + RPCError._fmtRequest(args.request)));\n }\n\n return EntityMentionUserInvalidError;\n}(BadRequestError);\n\nvar ErrorTextEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError72) {\n _inherits(ErrorTextEmptyError, _BadRequestError72);\n\n function ErrorTextEmptyError(args) {\n _classCallCheck(this, ErrorTextEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ErrorTextEmptyError).call(this, 'The provided error message is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return ErrorTextEmptyError;\n}(BadRequestError);\n\nvar ExportCardInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError73) {\n _inherits(ExportCardInvalidError, _BadRequestError73);\n\n function ExportCardInvalidError(args) {\n _classCallCheck(this, ExportCardInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ExportCardInvalidError).call(this, 'Provided card is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ExportCardInvalidError;\n}(BadRequestError);\n\nvar ExternalUrlInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError74) {\n _inherits(ExternalUrlInvalidError, _BadRequestError74);\n\n function ExternalUrlInvalidError(args) {\n _classCallCheck(this, ExternalUrlInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ExternalUrlInvalidError).call(this, 'External URL invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ExternalUrlInvalidError;\n}(BadRequestError);\n\nvar FieldNameEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError75) {\n _inherits(FieldNameEmptyError, _BadRequestError75);\n\n function FieldNameEmptyError(args) {\n _classCallCheck(this, FieldNameEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FieldNameEmptyError).call(this, 'The field with the name FIELD_NAME is missing' + RPCError._fmtRequest(args.request)));\n }\n\n return FieldNameEmptyError;\n}(BadRequestError);\n\nvar FieldNameInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError76) {\n _inherits(FieldNameInvalidError, _BadRequestError76);\n\n function FieldNameInvalidError(args) {\n _classCallCheck(this, FieldNameInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FieldNameInvalidError).call(this, 'The field with the name FIELD_NAME is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FieldNameInvalidError;\n}(BadRequestError);\n\nvar FileIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError77) {\n _inherits(FileIdInvalidError, _BadRequestError77);\n\n function FileIdInvalidError(args) {\n _classCallCheck(this, FileIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FileIdInvalidError).call(this, 'The provided file id is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FileIdInvalidError;\n}(BadRequestError);\n\nvar FileMigrateError =\n/*#__PURE__*/\nfunction (_InvalidDCError) {\n _inherits(FileMigrateError, _InvalidDCError);\n\n function FileMigrateError(args) {\n var _this2;\n\n _classCallCheck(this, FileMigrateError);\n\n var newDc = Number(args.capture || 0);\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(FileMigrateError).call(this, format('The file to be accessed is currently stored in DC {new_dc}', {\n newDc: newDc\n }) + RPCError._fmtRequest(args.request)));\n _this2.newDc = newDc;\n return _this2;\n }\n\n return FileMigrateError;\n}(InvalidDCError);\n\nvar FilePartsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError78) {\n _inherits(FilePartsInvalidError, _BadRequestError78);\n\n function FilePartsInvalidError(args) {\n _classCallCheck(this, FilePartsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePartsInvalidError).call(this, 'The number of file parts is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePartsInvalidError;\n}(BadRequestError);\n\nvar FilePart0MissingError =\n/*#__PURE__*/\nfunction (_BadRequestError79) {\n _inherits(FilePart0MissingError, _BadRequestError79);\n\n function FilePart0MissingError(args) {\n _classCallCheck(this, FilePart0MissingError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePart0MissingError).call(this, 'File part 0 missing' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePart0MissingError;\n}(BadRequestError);\n\nvar FilePartEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError80) {\n _inherits(FilePartEmptyError, _BadRequestError80);\n\n function FilePartEmptyError(args) {\n _classCallCheck(this, FilePartEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePartEmptyError).call(this, 'The provided file part is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePartEmptyError;\n}(BadRequestError);\n\nvar FilePartInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError81) {\n _inherits(FilePartInvalidError, _BadRequestError81);\n\n function FilePartInvalidError(args) {\n _classCallCheck(this, FilePartInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePartInvalidError).call(this, 'The file part number is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePartInvalidError;\n}(BadRequestError);\n\nvar FilePartLengthInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError82) {\n _inherits(FilePartLengthInvalidError, _BadRequestError82);\n\n function FilePartLengthInvalidError(args) {\n _classCallCheck(this, FilePartLengthInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePartLengthInvalidError).call(this, 'The length of a file part is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePartLengthInvalidError;\n}(BadRequestError);\n\nvar FilePartSizeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError83) {\n _inherits(FilePartSizeInvalidError, _BadRequestError83);\n\n function FilePartSizeInvalidError(args) {\n _classCallCheck(this, FilePartSizeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilePartSizeInvalidError).call(this, 'The provided file part size is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FilePartSizeInvalidError;\n}(BadRequestError);\n\nvar FilePartMissingError =\n/*#__PURE__*/\nfunction (_BadRequestError84) {\n _inherits(FilePartMissingError, _BadRequestError84);\n\n function FilePartMissingError(args) {\n var _this3;\n\n _classCallCheck(this, FilePartMissingError);\n\n var which = Number(args.capture || 0);\n _this3 = _possibleConstructorReturn(this, _getPrototypeOf(FilePartMissingError).call(this, format('Part {which} of the file is missing from storage', {\n which: which\n }) + RPCError._fmtRequest(args.request)));\n _this3.which = which;\n return _this3;\n }\n\n return FilePartMissingError;\n}(BadRequestError);\n\nvar FilerefUpgradeNeededError =\n/*#__PURE__*/\nfunction (_AuthKeyError2) {\n _inherits(FilerefUpgradeNeededError, _AuthKeyError2);\n\n function FilerefUpgradeNeededError(args) {\n _classCallCheck(this, FilerefUpgradeNeededError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FilerefUpgradeNeededError).call(this, 'The file reference needs to be refreshed before being used again' + RPCError._fmtRequest(args.request)));\n }\n\n return FilerefUpgradeNeededError;\n}(AuthKeyError);\n\nvar FirstNameInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError85) {\n _inherits(FirstNameInvalidError, _BadRequestError85);\n\n function FirstNameInvalidError(args) {\n _classCallCheck(this, FirstNameInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FirstNameInvalidError).call(this, 'The first name is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return FirstNameInvalidError;\n}(BadRequestError);\n\nvar FloodTestPhoneWaitError =\n/*#__PURE__*/\nfunction (_FloodError) {\n _inherits(FloodTestPhoneWaitError, _FloodError);\n\n function FloodTestPhoneWaitError(args) {\n var _this4;\n\n _classCallCheck(this, FloodTestPhoneWaitError);\n\n var seconds = Number(args.capture || 0);\n _this4 = _possibleConstructorReturn(this, _getPrototypeOf(FloodTestPhoneWaitError).call(this, format('A wait of {seconds} seconds is required in the test servers', {\n seconds: seconds\n }) + RPCError._fmtRequest(args.request)));\n _this4.seconds = seconds;\n return _this4;\n }\n\n return FloodTestPhoneWaitError;\n}(FloodError);\n\nvar FloodWaitError =\n/*#__PURE__*/\nfunction (_FloodError2) {\n _inherits(FloodWaitError, _FloodError2);\n\n function FloodWaitError(args) {\n var _this5;\n\n _classCallCheck(this, FloodWaitError);\n\n var seconds = Number(args.capture || 0);\n _this5 = _possibleConstructorReturn(this, _getPrototypeOf(FloodWaitError).call(this, format('A wait of {seconds} seconds is required', {\n seconds: seconds\n }) + RPCError._fmtRequest(args.request)));\n _this5.seconds = seconds;\n return _this5;\n }\n\n return FloodWaitError;\n}(FloodError);\n\nvar FolderIdEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError86) {\n _inherits(FolderIdEmptyError, _BadRequestError86);\n\n function FolderIdEmptyError(args) {\n _classCallCheck(this, FolderIdEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FolderIdEmptyError).call(this, 'The folder you tried to delete was already empty' + RPCError._fmtRequest(args.request)));\n }\n\n return FolderIdEmptyError;\n}(BadRequestError);\n\nvar FolderIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError87) {\n _inherits(FolderIdInvalidError, _BadRequestError87);\n\n function FolderIdInvalidError(args) {\n _classCallCheck(this, FolderIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FolderIdInvalidError).call(this, 'The folder you tried to use was not valid' + RPCError._fmtRequest(args.request)));\n }\n\n return FolderIdInvalidError;\n}(BadRequestError);\n\nvar FreshResetAuthorisationForbiddenError =\n/*#__PURE__*/\nfunction (_AuthKeyError3) {\n _inherits(FreshResetAuthorisationForbiddenError, _AuthKeyError3);\n\n function FreshResetAuthorisationForbiddenError(args) {\n _classCallCheck(this, FreshResetAuthorisationForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(FreshResetAuthorisationForbiddenError).call(this, 'The current session is too new and cannot be used to reset other authorisations yet' + RPCError._fmtRequest(args.request)));\n }\n\n return FreshResetAuthorisationForbiddenError;\n}(AuthKeyError);\n\nvar GifIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError88) {\n _inherits(GifIdInvalidError, _BadRequestError88);\n\n function GifIdInvalidError(args) {\n _classCallCheck(this, GifIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(GifIdInvalidError).call(this, 'The provided GIF ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return GifIdInvalidError;\n}(BadRequestError);\n\nvar GroupedMediaInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError89) {\n _inherits(GroupedMediaInvalidError, _BadRequestError89);\n\n function GroupedMediaInvalidError(args) {\n _classCallCheck(this, GroupedMediaInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(GroupedMediaInvalidError).call(this, 'Invalid grouped media' + RPCError._fmtRequest(args.request)));\n }\n\n return GroupedMediaInvalidError;\n}(BadRequestError);\n\nvar HashInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError90) {\n _inherits(HashInvalidError, _BadRequestError90);\n\n function HashInvalidError(args) {\n _classCallCheck(this, HashInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(HashInvalidError).call(this, 'The provided hash is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return HashInvalidError;\n}(BadRequestError);\n\nvar HistoryGetFailedError =\n/*#__PURE__*/\nfunction (_ServerError4) {\n _inherits(HistoryGetFailedError, _ServerError4);\n\n function HistoryGetFailedError(args) {\n _classCallCheck(this, HistoryGetFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(HistoryGetFailedError).call(this, 'Fetching of history failed' + RPCError._fmtRequest(args.request)));\n }\n\n return HistoryGetFailedError;\n}(ServerError);\n\nvar ImageProcessFailedError =\n/*#__PURE__*/\nfunction (_BadRequestError91) {\n _inherits(ImageProcessFailedError, _BadRequestError91);\n\n function ImageProcessFailedError(args) {\n _classCallCheck(this, ImageProcessFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ImageProcessFailedError).call(this, 'Failure while processing image' + RPCError._fmtRequest(args.request)));\n }\n\n return ImageProcessFailedError;\n}(BadRequestError);\n\nvar InlineResultExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError92) {\n _inherits(InlineResultExpiredError, _BadRequestError92);\n\n function InlineResultExpiredError(args) {\n _classCallCheck(this, InlineResultExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InlineResultExpiredError).call(this, 'The inline query expired' + RPCError._fmtRequest(args.request)));\n }\n\n return InlineResultExpiredError;\n}(BadRequestError);\n\nvar InputConstructorInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError93) {\n _inherits(InputConstructorInvalidError, _BadRequestError93);\n\n function InputConstructorInvalidError(args) {\n _classCallCheck(this, InputConstructorInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputConstructorInvalidError).call(this, 'The provided constructor is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return InputConstructorInvalidError;\n}(BadRequestError);\n\nvar InputFetchErrorError =\n/*#__PURE__*/\nfunction (_BadRequestError94) {\n _inherits(InputFetchErrorError, _BadRequestError94);\n\n function InputFetchErrorError(args) {\n _classCallCheck(this, InputFetchErrorError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputFetchErrorError).call(this, 'An error occurred while deserializing TL parameters' + RPCError._fmtRequest(args.request)));\n }\n\n return InputFetchErrorError;\n}(BadRequestError);\n\nvar InputFetchFailError =\n/*#__PURE__*/\nfunction (_BadRequestError95) {\n _inherits(InputFetchFailError, _BadRequestError95);\n\n function InputFetchFailError(args) {\n _classCallCheck(this, InputFetchFailError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputFetchFailError).call(this, 'Failed deserializing TL payload' + RPCError._fmtRequest(args.request)));\n }\n\n return InputFetchFailError;\n}(BadRequestError);\n\nvar InputLayerInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError96) {\n _inherits(InputLayerInvalidError, _BadRequestError96);\n\n function InputLayerInvalidError(args) {\n _classCallCheck(this, InputLayerInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputLayerInvalidError).call(this, 'The provided layer is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return InputLayerInvalidError;\n}(BadRequestError);\n\nvar InputMethodInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError97) {\n _inherits(InputMethodInvalidError, _BadRequestError97);\n\n function InputMethodInvalidError(args) {\n _classCallCheck(this, InputMethodInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputMethodInvalidError).call(this, 'The invoked method does not exist anymore or has never existed' + RPCError._fmtRequest(args.request)));\n }\n\n return InputMethodInvalidError;\n}(BadRequestError);\n\nvar InputRequestTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError98) {\n _inherits(InputRequestTooLongError, _BadRequestError98);\n\n function InputRequestTooLongError(args) {\n _classCallCheck(this, InputRequestTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputRequestTooLongError).call(this, 'The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message)' + RPCError._fmtRequest(args.request)));\n }\n\n return InputRequestTooLongError;\n}(BadRequestError);\n\nvar InputUserDeactivatedError =\n/*#__PURE__*/\nfunction (_BadRequestError99) {\n _inherits(InputUserDeactivatedError, _BadRequestError99);\n\n function InputUserDeactivatedError(args) {\n _classCallCheck(this, InputUserDeactivatedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InputUserDeactivatedError).call(this, 'The specified user was deleted' + RPCError._fmtRequest(args.request)));\n }\n\n return InputUserDeactivatedError;\n}(BadRequestError);\n\nvar InterdcCallErrorError =\n/*#__PURE__*/\nfunction (_BadRequestError100) {\n _inherits(InterdcCallErrorError, _BadRequestError100);\n\n function InterdcCallErrorError(args) {\n var _this6;\n\n _classCallCheck(this, InterdcCallErrorError);\n\n var dc = Number(args.capture || 0);\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(InterdcCallErrorError).call(this, format('An error occurred while communicating with DC {dc}', {\n dc: dc\n }) + RPCError._fmtRequest(args.request)));\n _this6.dc = dc;\n return _this6;\n }\n\n return InterdcCallErrorError;\n}(BadRequestError);\n\nvar InterdcCallRichErrorError =\n/*#__PURE__*/\nfunction (_BadRequestError101) {\n _inherits(InterdcCallRichErrorError, _BadRequestError101);\n\n function InterdcCallRichErrorError(args) {\n var _this7;\n\n _classCallCheck(this, InterdcCallRichErrorError);\n\n var dc = Number(args.capture || 0);\n _this7 = _possibleConstructorReturn(this, _getPrototypeOf(InterdcCallRichErrorError).call(this, format('A rich error occurred while communicating with DC {dc}', {\n dc: dc\n }) + RPCError._fmtRequest(args.request)));\n _this7.dc = dc;\n return _this7;\n }\n\n return InterdcCallRichErrorError;\n}(BadRequestError);\n\nvar InviteHashEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError102) {\n _inherits(InviteHashEmptyError, _BadRequestError102);\n\n function InviteHashEmptyError(args) {\n _classCallCheck(this, InviteHashEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InviteHashEmptyError).call(this, 'The invite hash is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return InviteHashEmptyError;\n}(BadRequestError);\n\nvar InviteHashExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError103) {\n _inherits(InviteHashExpiredError, _BadRequestError103);\n\n function InviteHashExpiredError(args) {\n _classCallCheck(this, InviteHashExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InviteHashExpiredError).call(this, 'The chat the user tried to join has expired and is not valid anymore' + RPCError._fmtRequest(args.request)));\n }\n\n return InviteHashExpiredError;\n}(BadRequestError);\n\nvar InviteHashInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError104) {\n _inherits(InviteHashInvalidError, _BadRequestError104);\n\n function InviteHashInvalidError(args) {\n _classCallCheck(this, InviteHashInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(InviteHashInvalidError).call(this, 'The invite hash is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return InviteHashInvalidError;\n}(BadRequestError);\n\nvar LangPackInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError105) {\n _inherits(LangPackInvalidError, _BadRequestError105);\n\n function LangPackInvalidError(args) {\n _classCallCheck(this, LangPackInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LangPackInvalidError).call(this, 'The provided language pack is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return LangPackInvalidError;\n}(BadRequestError);\n\nvar LastnameInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError106) {\n _inherits(LastnameInvalidError, _BadRequestError106);\n\n function LastnameInvalidError(args) {\n _classCallCheck(this, LastnameInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LastnameInvalidError).call(this, 'The last name is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return LastnameInvalidError;\n}(BadRequestError);\n\nvar LimitInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError107) {\n _inherits(LimitInvalidError, _BadRequestError107);\n\n function LimitInvalidError(args) {\n _classCallCheck(this, LimitInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LimitInvalidError).call(this, 'An invalid limit was provided. See https://core.telegram.org/api/files#downloading-files' + RPCError._fmtRequest(args.request)));\n }\n\n return LimitInvalidError;\n}(BadRequestError);\n\nvar LinkNotModifiedError =\n/*#__PURE__*/\nfunction (_BadRequestError108) {\n _inherits(LinkNotModifiedError, _BadRequestError108);\n\n function LinkNotModifiedError(args) {\n _classCallCheck(this, LinkNotModifiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LinkNotModifiedError).call(this, 'The channel is already linked to this group' + RPCError._fmtRequest(args.request)));\n }\n\n return LinkNotModifiedError;\n}(BadRequestError);\n\nvar LocationInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError109) {\n _inherits(LocationInvalidError, _BadRequestError109);\n\n function LocationInvalidError(args) {\n _classCallCheck(this, LocationInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(LocationInvalidError).call(this, 'The location given for a file was invalid. See https://core.telegram.org/api/files#downloading-files' + RPCError._fmtRequest(args.request)));\n }\n\n return LocationInvalidError;\n}(BadRequestError);\n\nvar MaxIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError110) {\n _inherits(MaxIdInvalidError, _BadRequestError110);\n\n function MaxIdInvalidError(args) {\n _classCallCheck(this, MaxIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaxIdInvalidError).call(this, 'The provided max ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return MaxIdInvalidError;\n}(BadRequestError);\n\nvar MaxQtsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError111) {\n _inherits(MaxQtsInvalidError, _BadRequestError111);\n\n function MaxQtsInvalidError(args) {\n _classCallCheck(this, MaxQtsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MaxQtsInvalidError).call(this, 'The provided QTS were invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return MaxQtsInvalidError;\n}(BadRequestError);\n\nvar Md5ChecksumInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError112) {\n _inherits(Md5ChecksumInvalidError, _BadRequestError112);\n\n function Md5ChecksumInvalidError(args) {\n _classCallCheck(this, Md5ChecksumInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Md5ChecksumInvalidError).call(this, 'The MD5 check-sums do not match' + RPCError._fmtRequest(args.request)));\n }\n\n return Md5ChecksumInvalidError;\n}(BadRequestError);\n\nvar MediaCaptionTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError113) {\n _inherits(MediaCaptionTooLongError, _BadRequestError113);\n\n function MediaCaptionTooLongError(args) {\n _classCallCheck(this, MediaCaptionTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MediaCaptionTooLongError).call(this, 'The caption is too long' + RPCError._fmtRequest(args.request)));\n }\n\n return MediaCaptionTooLongError;\n}(BadRequestError);\n\nvar MediaEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError114) {\n _inherits(MediaEmptyError, _BadRequestError114);\n\n function MediaEmptyError(args) {\n _classCallCheck(this, MediaEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MediaEmptyError).call(this, 'The provided media object is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return MediaEmptyError;\n}(BadRequestError);\n\nvar MediaInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError115) {\n _inherits(MediaInvalidError, _BadRequestError115);\n\n function MediaInvalidError(args) {\n _classCallCheck(this, MediaInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MediaInvalidError).call(this, 'Media invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return MediaInvalidError;\n}(BadRequestError);\n\nvar MediaNewInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError116) {\n _inherits(MediaNewInvalidError, _BadRequestError116);\n\n function MediaNewInvalidError(args) {\n _classCallCheck(this, MediaNewInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MediaNewInvalidError).call(this, 'The new media to edit the message with is invalid (such as stickers or voice notes)' + RPCError._fmtRequest(args.request)));\n }\n\n return MediaNewInvalidError;\n}(BadRequestError);\n\nvar MediaPrevInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError117) {\n _inherits(MediaPrevInvalidError, _BadRequestError117);\n\n function MediaPrevInvalidError(args) {\n _classCallCheck(this, MediaPrevInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MediaPrevInvalidError).call(this, 'The old media cannot be edited with anything else (such as stickers or voice notes)' + RPCError._fmtRequest(args.request)));\n }\n\n return MediaPrevInvalidError;\n}(BadRequestError);\n\nvar MegagroupIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError118) {\n _inherits(MegagroupIdInvalidError, _BadRequestError118);\n\n function MegagroupIdInvalidError(args) {\n _classCallCheck(this, MegagroupIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MegagroupIdInvalidError).call(this, 'The group is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return MegagroupIdInvalidError;\n}(BadRequestError);\n\nvar MegagroupPrehistoryHiddenError =\n/*#__PURE__*/\nfunction (_BadRequestError119) {\n _inherits(MegagroupPrehistoryHiddenError, _BadRequestError119);\n\n function MegagroupPrehistoryHiddenError(args) {\n _classCallCheck(this, MegagroupPrehistoryHiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MegagroupPrehistoryHiddenError).call(this, 'You can\\'t set this discussion group because it\\'s history is hidden' + RPCError._fmtRequest(args.request)));\n }\n\n return MegagroupPrehistoryHiddenError;\n}(BadRequestError);\n\nvar MemberNoLocationError =\n/*#__PURE__*/\nfunction (_ServerError5) {\n _inherits(MemberNoLocationError, _ServerError5);\n\n function MemberNoLocationError(args) {\n _classCallCheck(this, MemberNoLocationError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MemberNoLocationError).call(this, 'An internal failure occurred while fetching user info (couldn\\'t find location)' + RPCError._fmtRequest(args.request)));\n }\n\n return MemberNoLocationError;\n}(ServerError);\n\nvar MemberOccupyPrimaryLocFailedError =\n/*#__PURE__*/\nfunction (_ServerError6) {\n _inherits(MemberOccupyPrimaryLocFailedError, _ServerError6);\n\n function MemberOccupyPrimaryLocFailedError(args) {\n _classCallCheck(this, MemberOccupyPrimaryLocFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MemberOccupyPrimaryLocFailedError).call(this, 'Occupation of primary member location failed' + RPCError._fmtRequest(args.request)));\n }\n\n return MemberOccupyPrimaryLocFailedError;\n}(ServerError);\n\nvar MessageAuthorRequiredError =\n/*#__PURE__*/\nfunction (_ForbiddenError7) {\n _inherits(MessageAuthorRequiredError, _ForbiddenError7);\n\n function MessageAuthorRequiredError(args) {\n _classCallCheck(this, MessageAuthorRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageAuthorRequiredError).call(this, 'Message author required' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageAuthorRequiredError;\n}(ForbiddenError);\n\nvar MessageDeleteForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError8) {\n _inherits(MessageDeleteForbiddenError, _ForbiddenError8);\n\n function MessageDeleteForbiddenError(args) {\n _classCallCheck(this, MessageDeleteForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageDeleteForbiddenError).call(this, 'You can\\'t delete one of the messages you tried to delete, most likely because it is a service message.' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageDeleteForbiddenError;\n}(ForbiddenError);\n\nvar MessageEditTimeExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError120) {\n _inherits(MessageEditTimeExpiredError, _BadRequestError120);\n\n function MessageEditTimeExpiredError(args) {\n _classCallCheck(this, MessageEditTimeExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageEditTimeExpiredError).call(this, 'You can\\'t edit this message anymore, too much time has passed since its creation.' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageEditTimeExpiredError;\n}(BadRequestError);\n\nvar MessageEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError121) {\n _inherits(MessageEmptyError, _BadRequestError121);\n\n function MessageEmptyError(args) {\n _classCallCheck(this, MessageEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageEmptyError).call(this, 'Empty or invalid UTF-8 message was sent' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageEmptyError;\n}(BadRequestError);\n\nvar MessageIdsEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError122) {\n _inherits(MessageIdsEmptyError, _BadRequestError122);\n\n function MessageIdsEmptyError(args) {\n _classCallCheck(this, MessageIdsEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageIdsEmptyError).call(this, 'No message ids were provided' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageIdsEmptyError;\n}(BadRequestError);\n\nvar MessageIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError123) {\n _inherits(MessageIdInvalidError, _BadRequestError123);\n\n function MessageIdInvalidError(args) {\n _classCallCheck(this, MessageIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageIdInvalidError).call(this, 'The specified message ID is invalid or you can\\'t do that operation on such message' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageIdInvalidError;\n}(BadRequestError);\n\nvar MessageNotModifiedError =\n/*#__PURE__*/\nfunction (_BadRequestError124) {\n _inherits(MessageNotModifiedError, _BadRequestError124);\n\n function MessageNotModifiedError(args) {\n _classCallCheck(this, MessageNotModifiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageNotModifiedError).call(this, 'Content of the message was not modified' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageNotModifiedError;\n}(BadRequestError);\n\nvar MessageTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError125) {\n _inherits(MessageTooLongError, _BadRequestError125);\n\n function MessageTooLongError(args) {\n _classCallCheck(this, MessageTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MessageTooLongError).call(this, 'Message was too long. Current maximum length is 4096 UTF-8 characters' + RPCError._fmtRequest(args.request)));\n }\n\n return MessageTooLongError;\n}(BadRequestError);\n\nvar MsgWaitFailedError =\n/*#__PURE__*/\nfunction (_BadRequestError126) {\n _inherits(MsgWaitFailedError, _BadRequestError126);\n\n function MsgWaitFailedError(args) {\n _classCallCheck(this, MsgWaitFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MsgWaitFailedError).call(this, 'A waiting call returned an error' + RPCError._fmtRequest(args.request)));\n }\n\n return MsgWaitFailedError;\n}(BadRequestError);\n\nvar MtSendQueueTooLongError =\n/*#__PURE__*/\nfunction (_ServerError7) {\n _inherits(MtSendQueueTooLongError, _ServerError7);\n\n function MtSendQueueTooLongError(args) {\n _classCallCheck(this, MtSendQueueTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MtSendQueueTooLongError).call(this, '' + RPCError._fmtRequest(args.request)));\n }\n\n return MtSendQueueTooLongError;\n}(ServerError);\n\nvar NeedChatInvalidError =\n/*#__PURE__*/\nfunction (_ServerError8) {\n _inherits(NeedChatInvalidError, _ServerError8);\n\n function NeedChatInvalidError(args) {\n _classCallCheck(this, NeedChatInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NeedChatInvalidError).call(this, 'The provided chat is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return NeedChatInvalidError;\n}(ServerError);\n\nvar NeedMemberInvalidError =\n/*#__PURE__*/\nfunction (_ServerError9) {\n _inherits(NeedMemberInvalidError, _ServerError9);\n\n function NeedMemberInvalidError(args) {\n _classCallCheck(this, NeedMemberInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NeedMemberInvalidError).call(this, 'The provided member is invalid or does not exist (for example a thumb size)' + RPCError._fmtRequest(args.request)));\n }\n\n return NeedMemberInvalidError;\n}(ServerError);\n\nvar NetworkMigrateError =\n/*#__PURE__*/\nfunction (_InvalidDCError2) {\n _inherits(NetworkMigrateError, _InvalidDCError2);\n\n function NetworkMigrateError(args) {\n var _this8;\n\n _classCallCheck(this, NetworkMigrateError);\n\n var newDc = Number(args.capture || 0);\n _this8 = _possibleConstructorReturn(this, _getPrototypeOf(NetworkMigrateError).call(this, format('The source IP address is associated with DC {new_dc}', {\n newDc: newDc\n }) + RPCError._fmtRequest(args.request)));\n _this8.newDc = newDc;\n return _this8;\n }\n\n return NetworkMigrateError;\n}(InvalidDCError);\n\nvar NewSaltInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError127) {\n _inherits(NewSaltInvalidError, _BadRequestError127);\n\n function NewSaltInvalidError(args) {\n _classCallCheck(this, NewSaltInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NewSaltInvalidError).call(this, 'The new salt is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return NewSaltInvalidError;\n}(BadRequestError);\n\nvar NewSettingsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError128) {\n _inherits(NewSettingsInvalidError, _BadRequestError128);\n\n function NewSettingsInvalidError(args) {\n _classCallCheck(this, NewSettingsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NewSettingsInvalidError).call(this, 'The new settings are invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return NewSettingsInvalidError;\n}(BadRequestError);\n\nvar OffsetInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError129) {\n _inherits(OffsetInvalidError, _BadRequestError129);\n\n function OffsetInvalidError(args) {\n _classCallCheck(this, OffsetInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(OffsetInvalidError).call(this, 'The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files' + RPCError._fmtRequest(args.request)));\n }\n\n return OffsetInvalidError;\n}(BadRequestError);\n\nvar OffsetPeerIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError130) {\n _inherits(OffsetPeerIdInvalidError, _BadRequestError130);\n\n function OffsetPeerIdInvalidError(args) {\n _classCallCheck(this, OffsetPeerIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(OffsetPeerIdInvalidError).call(this, 'The provided offset peer is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return OffsetPeerIdInvalidError;\n}(BadRequestError);\n\nvar OptionsTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError131) {\n _inherits(OptionsTooMuchError, _BadRequestError131);\n\n function OptionsTooMuchError(args) {\n _classCallCheck(this, OptionsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(OptionsTooMuchError).call(this, 'You defined too many options for the poll' + RPCError._fmtRequest(args.request)));\n }\n\n return OptionsTooMuchError;\n}(BadRequestError);\n\nvar PackShortNameInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError132) {\n _inherits(PackShortNameInvalidError, _BadRequestError132);\n\n function PackShortNameInvalidError(args) {\n _classCallCheck(this, PackShortNameInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PackShortNameInvalidError).call(this, 'Invalid sticker pack name. It must begin with a letter, can\\'t contain consecutive underscores and must end in \"_by_\".' + RPCError._fmtRequest(args.request)));\n }\n\n return PackShortNameInvalidError;\n}(BadRequestError);\n\nvar PackShortNameOccupiedError =\n/*#__PURE__*/\nfunction (_BadRequestError133) {\n _inherits(PackShortNameOccupiedError, _BadRequestError133);\n\n function PackShortNameOccupiedError(args) {\n _classCallCheck(this, PackShortNameOccupiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PackShortNameOccupiedError).call(this, 'A stickerpack with this name already exists' + RPCError._fmtRequest(args.request)));\n }\n\n return PackShortNameOccupiedError;\n}(BadRequestError);\n\nvar ParticipantsTooFewError =\n/*#__PURE__*/\nfunction (_BadRequestError134) {\n _inherits(ParticipantsTooFewError, _BadRequestError134);\n\n function ParticipantsTooFewError(args) {\n _classCallCheck(this, ParticipantsTooFewError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ParticipantsTooFewError).call(this, 'Not enough participants' + RPCError._fmtRequest(args.request)));\n }\n\n return ParticipantsTooFewError;\n}(BadRequestError);\n\nvar ParticipantCallFailedError =\n/*#__PURE__*/\nfunction (_ServerError10) {\n _inherits(ParticipantCallFailedError, _ServerError10);\n\n function ParticipantCallFailedError(args) {\n _classCallCheck(this, ParticipantCallFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ParticipantCallFailedError).call(this, 'Failure while making call' + RPCError._fmtRequest(args.request)));\n }\n\n return ParticipantCallFailedError;\n}(ServerError);\n\nvar ParticipantVersionOutdatedError =\n/*#__PURE__*/\nfunction (_BadRequestError135) {\n _inherits(ParticipantVersionOutdatedError, _BadRequestError135);\n\n function ParticipantVersionOutdatedError(args) {\n _classCallCheck(this, ParticipantVersionOutdatedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ParticipantVersionOutdatedError).call(this, 'The other participant does not use an up to date telegram client with support for calls' + RPCError._fmtRequest(args.request)));\n }\n\n return ParticipantVersionOutdatedError;\n}(BadRequestError);\n\nvar PasswordEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError136) {\n _inherits(PasswordEmptyError, _BadRequestError136);\n\n function PasswordEmptyError(args) {\n _classCallCheck(this, PasswordEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PasswordEmptyError).call(this, 'The provided password is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return PasswordEmptyError;\n}(BadRequestError);\n\nvar PasswordHashInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError137) {\n _inherits(PasswordHashInvalidError, _BadRequestError137);\n\n function PasswordHashInvalidError(args) {\n _classCallCheck(this, PasswordHashInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PasswordHashInvalidError).call(this, 'The password (and thus its hash value) you entered is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PasswordHashInvalidError;\n}(BadRequestError);\n\nvar PasswordRequiredError =\n/*#__PURE__*/\nfunction (_BadRequestError138) {\n _inherits(PasswordRequiredError, _BadRequestError138);\n\n function PasswordRequiredError(args) {\n _classCallCheck(this, PasswordRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PasswordRequiredError).call(this, 'The account must have 2-factor authentication enabled (a password) before this method can be used' + RPCError._fmtRequest(args.request)));\n }\n\n return PasswordRequiredError;\n}(BadRequestError);\n\nvar PaymentProviderInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError139) {\n _inherits(PaymentProviderInvalidError, _BadRequestError139);\n\n function PaymentProviderInvalidError(args) {\n _classCallCheck(this, PaymentProviderInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PaymentProviderInvalidError).call(this, 'The payment provider was not recognised or its token was invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PaymentProviderInvalidError;\n}(BadRequestError);\n\nvar PeerFloodError =\n/*#__PURE__*/\nfunction (_BadRequestError140) {\n _inherits(PeerFloodError, _BadRequestError140);\n\n function PeerFloodError(args) {\n _classCallCheck(this, PeerFloodError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PeerFloodError).call(this, 'Too many requests' + RPCError._fmtRequest(args.request)));\n }\n\n return PeerFloodError;\n}(BadRequestError);\n\nvar PeerIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError141) {\n _inherits(PeerIdInvalidError, _BadRequestError141);\n\n function PeerIdInvalidError(args) {\n _classCallCheck(this, PeerIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PeerIdInvalidError).call(this, 'An invalid Peer was used. Make sure to pass the right peer type' + RPCError._fmtRequest(args.request)));\n }\n\n return PeerIdInvalidError;\n}(BadRequestError);\n\nvar PeerIdNotSupportedError =\n/*#__PURE__*/\nfunction (_BadRequestError142) {\n _inherits(PeerIdNotSupportedError, _BadRequestError142);\n\n function PeerIdNotSupportedError(args) {\n _classCallCheck(this, PeerIdNotSupportedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PeerIdNotSupportedError).call(this, 'The provided peer ID is not supported' + RPCError._fmtRequest(args.request)));\n }\n\n return PeerIdNotSupportedError;\n}(BadRequestError);\n\nvar PersistentTimestampEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError143) {\n _inherits(PersistentTimestampEmptyError, _BadRequestError143);\n\n function PersistentTimestampEmptyError(args) {\n _classCallCheck(this, PersistentTimestampEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PersistentTimestampEmptyError).call(this, 'Persistent timestamp empty' + RPCError._fmtRequest(args.request)));\n }\n\n return PersistentTimestampEmptyError;\n}(BadRequestError);\n\nvar PersistentTimestampInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError144) {\n _inherits(PersistentTimestampInvalidError, _BadRequestError144);\n\n function PersistentTimestampInvalidError(args) {\n _classCallCheck(this, PersistentTimestampInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PersistentTimestampInvalidError).call(this, 'Persistent timestamp invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PersistentTimestampInvalidError;\n}(BadRequestError);\n\nvar PersistentTimestampOutdatedError =\n/*#__PURE__*/\nfunction (_ServerError11) {\n _inherits(PersistentTimestampOutdatedError, _ServerError11);\n\n function PersistentTimestampOutdatedError(args) {\n _classCallCheck(this, PersistentTimestampOutdatedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PersistentTimestampOutdatedError).call(this, 'Persistent timestamp outdated' + RPCError._fmtRequest(args.request)));\n }\n\n return PersistentTimestampOutdatedError;\n}(ServerError);\n\nvar PhoneCodeEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError145) {\n _inherits(PhoneCodeEmptyError, _BadRequestError145);\n\n function PhoneCodeEmptyError(args) {\n _classCallCheck(this, PhoneCodeEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneCodeEmptyError).call(this, 'The phone code is missing' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneCodeEmptyError;\n}(BadRequestError);\n\nvar PhoneCodeExpiredError =\n/*#__PURE__*/\nfunction (_BadRequestError146) {\n _inherits(PhoneCodeExpiredError, _BadRequestError146);\n\n function PhoneCodeExpiredError(args) {\n _classCallCheck(this, PhoneCodeExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneCodeExpiredError).call(this, 'The confirmation code has expired' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneCodeExpiredError;\n}(BadRequestError);\n\nvar PhoneCodeHashEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError147) {\n _inherits(PhoneCodeHashEmptyError, _BadRequestError147);\n\n function PhoneCodeHashEmptyError(args) {\n _classCallCheck(this, PhoneCodeHashEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneCodeHashEmptyError).call(this, 'The phone code hash is missing' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneCodeHashEmptyError;\n}(BadRequestError);\n\nvar PhoneCodeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError148) {\n _inherits(PhoneCodeInvalidError, _BadRequestError148);\n\n function PhoneCodeInvalidError(args) {\n _classCallCheck(this, PhoneCodeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneCodeInvalidError).call(this, 'The phone code entered was invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneCodeInvalidError;\n}(BadRequestError);\n\nvar PhoneMigrateError =\n/*#__PURE__*/\nfunction (_InvalidDCError3) {\n _inherits(PhoneMigrateError, _InvalidDCError3);\n\n function PhoneMigrateError(args) {\n var _this9;\n\n _classCallCheck(this, PhoneMigrateError);\n\n var newDc = Number(args.capture || 0);\n _this9 = _possibleConstructorReturn(this, _getPrototypeOf(PhoneMigrateError).call(this, format('The phone number a user is trying to use for authorization is associated with DC {new_dc}', {\n newDc: newDc\n }) + RPCError._fmtRequest(args.request)));\n _this9.newDc = newDc;\n return _this9;\n }\n\n return PhoneMigrateError;\n}(InvalidDCError);\n\nvar PhoneNumberAppSignupForbiddenError =\n/*#__PURE__*/\nfunction (_BadRequestError149) {\n _inherits(PhoneNumberAppSignupForbiddenError, _BadRequestError149);\n\n function PhoneNumberAppSignupForbiddenError(args) {\n _classCallCheck(this, PhoneNumberAppSignupForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberAppSignupForbiddenError).call(this, '' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberAppSignupForbiddenError;\n}(BadRequestError);\n\nvar PhoneNumberBannedError =\n/*#__PURE__*/\nfunction (_BadRequestError150) {\n _inherits(PhoneNumberBannedError, _BadRequestError150);\n\n function PhoneNumberBannedError(args) {\n _classCallCheck(this, PhoneNumberBannedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberBannedError).call(this, 'The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberBannedError;\n}(BadRequestError);\n\nvar PhoneNumberFloodError =\n/*#__PURE__*/\nfunction (_BadRequestError151) {\n _inherits(PhoneNumberFloodError, _BadRequestError151);\n\n function PhoneNumberFloodError(args) {\n _classCallCheck(this, PhoneNumberFloodError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberFloodError).call(this, 'You asked for the code too many times.' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberFloodError;\n}(BadRequestError);\n\nvar PhoneNumberInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError152) {\n _inherits(PhoneNumberInvalidError, _BadRequestError152);\n\n function PhoneNumberInvalidError(args) {\n _classCallCheck(this, PhoneNumberInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberInvalidError).call(this, 'The phone number is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberInvalidError;\n}(BadRequestError);\n\nvar PhoneNumberOccupiedError =\n/*#__PURE__*/\nfunction (_BadRequestError153) {\n _inherits(PhoneNumberOccupiedError, _BadRequestError153);\n\n function PhoneNumberOccupiedError(args) {\n _classCallCheck(this, PhoneNumberOccupiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberOccupiedError).call(this, 'The phone number is already in use' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberOccupiedError;\n}(BadRequestError);\n\nvar PhoneNumberUnoccupiedError =\n/*#__PURE__*/\nfunction (_BadRequestError154) {\n _inherits(PhoneNumberUnoccupiedError, _BadRequestError154);\n\n function PhoneNumberUnoccupiedError(args) {\n _classCallCheck(this, PhoneNumberUnoccupiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberUnoccupiedError).call(this, 'The phone number is not yet being used' + RPCError._fmtRequest(args.request)));\n }\n\n return PhoneNumberUnoccupiedError;\n}(BadRequestError);\n\nvar PhonePasswordFloodError =\n/*#__PURE__*/\nfunction (_AuthKeyError4) {\n _inherits(PhonePasswordFloodError, _AuthKeyError4);\n\n function PhonePasswordFloodError(args) {\n _classCallCheck(this, PhonePasswordFloodError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhonePasswordFloodError).call(this, 'You have tried logging in too many times' + RPCError._fmtRequest(args.request)));\n }\n\n return PhonePasswordFloodError;\n}(AuthKeyError);\n\nvar PhonePasswordProtectedError =\n/*#__PURE__*/\nfunction (_BadRequestError155) {\n _inherits(PhonePasswordProtectedError, _BadRequestError155);\n\n function PhonePasswordProtectedError(args) {\n _classCallCheck(this, PhonePasswordProtectedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhonePasswordProtectedError).call(this, 'This phone is password protected' + RPCError._fmtRequest(args.request)));\n }\n\n return PhonePasswordProtectedError;\n}(BadRequestError);\n\nvar PhotoContentUrlEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError156) {\n _inherits(PhotoContentUrlEmptyError, _BadRequestError156);\n\n function PhotoContentUrlEmptyError(args) {\n _classCallCheck(this, PhotoContentUrlEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoContentUrlEmptyError).call(this, 'The content from the URL used as a photo appears to be empty or has caused another HTTP error' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoContentUrlEmptyError;\n}(BadRequestError);\n\nvar PhotoCropSizeSmallError =\n/*#__PURE__*/\nfunction (_BadRequestError157) {\n _inherits(PhotoCropSizeSmallError, _BadRequestError157);\n\n function PhotoCropSizeSmallError(args) {\n _classCallCheck(this, PhotoCropSizeSmallError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoCropSizeSmallError).call(this, 'Photo is too small' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoCropSizeSmallError;\n}(BadRequestError);\n\nvar PhotoExtInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError158) {\n _inherits(PhotoExtInvalidError, _BadRequestError158);\n\n function PhotoExtInvalidError(args) {\n _classCallCheck(this, PhotoExtInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoExtInvalidError).call(this, 'The extension of the photo is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoExtInvalidError;\n}(BadRequestError);\n\nvar PhotoInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError159) {\n _inherits(PhotoInvalidError, _BadRequestError159);\n\n function PhotoInvalidError(args) {\n _classCallCheck(this, PhotoInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoInvalidError).call(this, 'Photo invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoInvalidError;\n}(BadRequestError);\n\nvar PhotoInvalidDimensionsError =\n/*#__PURE__*/\nfunction (_BadRequestError160) {\n _inherits(PhotoInvalidDimensionsError, _BadRequestError160);\n\n function PhotoInvalidDimensionsError(args) {\n _classCallCheck(this, PhotoInvalidDimensionsError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoInvalidDimensionsError).call(this, 'The photo dimensions are invalid (hint: `pip install pillow` for `send_file` to resize images)' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoInvalidDimensionsError;\n}(BadRequestError);\n\nvar PhotoSaveFileInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError161) {\n _inherits(PhotoSaveFileInvalidError, _BadRequestError161);\n\n function PhotoSaveFileInvalidError(args) {\n _classCallCheck(this, PhotoSaveFileInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoSaveFileInvalidError).call(this, 'The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoSaveFileInvalidError;\n}(BadRequestError);\n\nvar PhotoThumbUrlEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError162) {\n _inherits(PhotoThumbUrlEmptyError, _BadRequestError162);\n\n function PhotoThumbUrlEmptyError(args) {\n _classCallCheck(this, PhotoThumbUrlEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PhotoThumbUrlEmptyError).call(this, 'The URL used as a thumbnail appears to be empty or has caused another HTTP error' + RPCError._fmtRequest(args.request)));\n }\n\n return PhotoThumbUrlEmptyError;\n}(BadRequestError);\n\nvar PinRestrictedError =\n/*#__PURE__*/\nfunction (_BadRequestError163) {\n _inherits(PinRestrictedError, _BadRequestError163);\n\n function PinRestrictedError(args) {\n _classCallCheck(this, PinRestrictedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PinRestrictedError).call(this, 'You can\\'t pin messages in private chats with other people' + RPCError._fmtRequest(args.request)));\n }\n\n return PinRestrictedError;\n}(BadRequestError);\n\nvar PollOptionDuplicateError =\n/*#__PURE__*/\nfunction (_BadRequestError164) {\n _inherits(PollOptionDuplicateError, _BadRequestError164);\n\n function PollOptionDuplicateError(args) {\n _classCallCheck(this, PollOptionDuplicateError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PollOptionDuplicateError).call(this, 'A duplicate option was sent in the same poll' + RPCError._fmtRequest(args.request)));\n }\n\n return PollOptionDuplicateError;\n}(BadRequestError);\n\nvar PollUnsupportedError =\n/*#__PURE__*/\nfunction (_BadRequestError165) {\n _inherits(PollUnsupportedError, _BadRequestError165);\n\n function PollUnsupportedError(args) {\n _classCallCheck(this, PollUnsupportedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PollUnsupportedError).call(this, 'This layer does not support polls in the issued method' + RPCError._fmtRequest(args.request)));\n }\n\n return PollUnsupportedError;\n}(BadRequestError);\n\nvar PrivacyKeyInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError166) {\n _inherits(PrivacyKeyInvalidError, _BadRequestError166);\n\n function PrivacyKeyInvalidError(args) {\n _classCallCheck(this, PrivacyKeyInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PrivacyKeyInvalidError).call(this, 'The privacy key is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return PrivacyKeyInvalidError;\n}(BadRequestError);\n\nvar PtsChangeEmptyError =\n/*#__PURE__*/\nfunction (_ServerError12) {\n _inherits(PtsChangeEmptyError, _ServerError12);\n\n function PtsChangeEmptyError(args) {\n _classCallCheck(this, PtsChangeEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(PtsChangeEmptyError).call(this, 'No PTS change' + RPCError._fmtRequest(args.request)));\n }\n\n return PtsChangeEmptyError;\n}(ServerError);\n\nvar QueryIdEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError167) {\n _inherits(QueryIdEmptyError, _BadRequestError167);\n\n function QueryIdEmptyError(args) {\n _classCallCheck(this, QueryIdEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(QueryIdEmptyError).call(this, 'The query ID is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return QueryIdEmptyError;\n}(BadRequestError);\n\nvar QueryIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError168) {\n _inherits(QueryIdInvalidError, _BadRequestError168);\n\n function QueryIdInvalidError(args) {\n _classCallCheck(this, QueryIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(QueryIdInvalidError).call(this, 'The query ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return QueryIdInvalidError;\n}(BadRequestError);\n\nvar QueryTooShortError =\n/*#__PURE__*/\nfunction (_BadRequestError169) {\n _inherits(QueryTooShortError, _BadRequestError169);\n\n function QueryTooShortError(args) {\n _classCallCheck(this, QueryTooShortError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(QueryTooShortError).call(this, 'The query string is too short' + RPCError._fmtRequest(args.request)));\n }\n\n return QueryTooShortError;\n}(BadRequestError);\n\nvar RandomIdDuplicateError =\n/*#__PURE__*/\nfunction (_ServerError13) {\n _inherits(RandomIdDuplicateError, _ServerError13);\n\n function RandomIdDuplicateError(args) {\n _classCallCheck(this, RandomIdDuplicateError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RandomIdDuplicateError).call(this, 'You provided a random ID that was already used' + RPCError._fmtRequest(args.request)));\n }\n\n return RandomIdDuplicateError;\n}(ServerError);\n\nvar RandomIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError170) {\n _inherits(RandomIdInvalidError, _BadRequestError170);\n\n function RandomIdInvalidError(args) {\n _classCallCheck(this, RandomIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RandomIdInvalidError).call(this, 'A provided random ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return RandomIdInvalidError;\n}(BadRequestError);\n\nvar RandomLengthInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError171) {\n _inherits(RandomLengthInvalidError, _BadRequestError171);\n\n function RandomLengthInvalidError(args) {\n _classCallCheck(this, RandomLengthInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RandomLengthInvalidError).call(this, 'Random length invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return RandomLengthInvalidError;\n}(BadRequestError);\n\nvar RangesInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError172) {\n _inherits(RangesInvalidError, _BadRequestError172);\n\n function RangesInvalidError(args) {\n _classCallCheck(this, RangesInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RangesInvalidError).call(this, 'Invalid range provided' + RPCError._fmtRequest(args.request)));\n }\n\n return RangesInvalidError;\n}(BadRequestError);\n\nvar ReactionEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError173) {\n _inherits(ReactionEmptyError, _BadRequestError173);\n\n function ReactionEmptyError(args) {\n _classCallCheck(this, ReactionEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReactionEmptyError).call(this, 'No reaction provided' + RPCError._fmtRequest(args.request)));\n }\n\n return ReactionEmptyError;\n}(BadRequestError);\n\nvar ReactionInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError174) {\n _inherits(ReactionInvalidError, _BadRequestError174);\n\n function ReactionInvalidError(args) {\n _classCallCheck(this, ReactionInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReactionInvalidError).call(this, 'Invalid reaction provided (only emoji are allowed)' + RPCError._fmtRequest(args.request)));\n }\n\n return ReactionInvalidError;\n}(BadRequestError);\n\nvar RegIdGenerateFailedError =\n/*#__PURE__*/\nfunction (_ServerError14) {\n _inherits(RegIdGenerateFailedError, _ServerError14);\n\n function RegIdGenerateFailedError(args) {\n _classCallCheck(this, RegIdGenerateFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RegIdGenerateFailedError).call(this, 'Failure while generating registration ID' + RPCError._fmtRequest(args.request)));\n }\n\n return RegIdGenerateFailedError;\n}(ServerError);\n\nvar ReplyMarkupInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError175) {\n _inherits(ReplyMarkupInvalidError, _BadRequestError175);\n\n function ReplyMarkupInvalidError(args) {\n _classCallCheck(this, ReplyMarkupInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReplyMarkupInvalidError).call(this, 'The provided reply markup is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ReplyMarkupInvalidError;\n}(BadRequestError);\n\nvar ReplyMarkupTooLongError =\n/*#__PURE__*/\nfunction (_BadRequestError176) {\n _inherits(ReplyMarkupTooLongError, _BadRequestError176);\n\n function ReplyMarkupTooLongError(args) {\n _classCallCheck(this, ReplyMarkupTooLongError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ReplyMarkupTooLongError).call(this, 'The data embedded in the reply markup buttons was too much' + RPCError._fmtRequest(args.request)));\n }\n\n return ReplyMarkupTooLongError;\n}(BadRequestError);\n\nvar ResultIdDuplicateError =\n/*#__PURE__*/\nfunction (_BadRequestError177) {\n _inherits(ResultIdDuplicateError, _BadRequestError177);\n\n function ResultIdDuplicateError(args) {\n _classCallCheck(this, ResultIdDuplicateError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ResultIdDuplicateError).call(this, 'Duplicated IDs on the sent results. Make sure to use unique IDs.' + RPCError._fmtRequest(args.request)));\n }\n\n return ResultIdDuplicateError;\n}(BadRequestError);\n\nvar ResultTypeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError178) {\n _inherits(ResultTypeInvalidError, _BadRequestError178);\n\n function ResultTypeInvalidError(args) {\n _classCallCheck(this, ResultTypeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ResultTypeInvalidError).call(this, 'Result type invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return ResultTypeInvalidError;\n}(BadRequestError);\n\nvar ResultsTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError179) {\n _inherits(ResultsTooMuchError, _BadRequestError179);\n\n function ResultsTooMuchError(args) {\n _classCallCheck(this, ResultsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ResultsTooMuchError).call(this, 'You sent too many results. See https://core.telegram.org/bots/api#answerinlinequery for the current limit.' + RPCError._fmtRequest(args.request)));\n }\n\n return ResultsTooMuchError;\n}(BadRequestError);\n\nvar RightForbiddenError =\n/*#__PURE__*/\nfunction (_ForbiddenError9) {\n _inherits(RightForbiddenError, _ForbiddenError9);\n\n function RightForbiddenError(args) {\n _classCallCheck(this, RightForbiddenError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RightForbiddenError).call(this, 'Either your admin rights do not allow you to do this or you passed the wrong rights combination (some rights only apply to channels and vice versa)' + RPCError._fmtRequest(args.request)));\n }\n\n return RightForbiddenError;\n}(ForbiddenError);\n\nvar RpcCallFailError =\n/*#__PURE__*/\nfunction (_BadRequestError180) {\n _inherits(RpcCallFailError, _BadRequestError180);\n\n function RpcCallFailError(args) {\n _classCallCheck(this, RpcCallFailError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RpcCallFailError).call(this, 'Telegram is having internal issues, please try again later.' + RPCError._fmtRequest(args.request)));\n }\n\n return RpcCallFailError;\n}(BadRequestError);\n\nvar RpcMcgetFailError =\n/*#__PURE__*/\nfunction (_BadRequestError181) {\n _inherits(RpcMcgetFailError, _BadRequestError181);\n\n function RpcMcgetFailError(args) {\n _classCallCheck(this, RpcMcgetFailError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RpcMcgetFailError).call(this, 'Telegram is having internal issues, please try again later.' + RPCError._fmtRequest(args.request)));\n }\n\n return RpcMcgetFailError;\n}(BadRequestError);\n\nvar RsaDecryptFailedError =\n/*#__PURE__*/\nfunction (_BadRequestError182) {\n _inherits(RsaDecryptFailedError, _BadRequestError182);\n\n function RsaDecryptFailedError(args) {\n _classCallCheck(this, RsaDecryptFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(RsaDecryptFailedError).call(this, 'Internal RSA decryption failed' + RPCError._fmtRequest(args.request)));\n }\n\n return RsaDecryptFailedError;\n}(BadRequestError);\n\nvar ScheduleDateTooLateError =\n/*#__PURE__*/\nfunction (_BadRequestError183) {\n _inherits(ScheduleDateTooLateError, _BadRequestError183);\n\n function ScheduleDateTooLateError(args) {\n _classCallCheck(this, ScheduleDateTooLateError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ScheduleDateTooLateError).call(this, 'The date you tried to schedule is too far in the future (last known limit of 1 year and a few hours)' + RPCError._fmtRequest(args.request)));\n }\n\n return ScheduleDateTooLateError;\n}(BadRequestError);\n\nvar ScheduleTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError184) {\n _inherits(ScheduleTooMuchError, _BadRequestError184);\n\n function ScheduleTooMuchError(args) {\n _classCallCheck(this, ScheduleTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ScheduleTooMuchError).call(this, 'You cannot schedule more messages in this chat (last known limit of 100 per chat)' + RPCError._fmtRequest(args.request)));\n }\n\n return ScheduleTooMuchError;\n}(BadRequestError);\n\nvar SearchQueryEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError185) {\n _inherits(SearchQueryEmptyError, _BadRequestError185);\n\n function SearchQueryEmptyError(args) {\n _classCallCheck(this, SearchQueryEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SearchQueryEmptyError).call(this, 'The search query is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return SearchQueryEmptyError;\n}(BadRequestError);\n\nvar SecondsInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError186) {\n _inherits(SecondsInvalidError, _BadRequestError186);\n\n function SecondsInvalidError(args) {\n _classCallCheck(this, SecondsInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SecondsInvalidError).call(this, 'Slow mode only supports certain values (e.g. 0, 10s, 30s, 1m, 5m, 15m and 1h)' + RPCError._fmtRequest(args.request)));\n }\n\n return SecondsInvalidError;\n}(BadRequestError);\n\nvar SendMessageMediaInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError187) {\n _inherits(SendMessageMediaInvalidError, _BadRequestError187);\n\n function SendMessageMediaInvalidError(args) {\n _classCallCheck(this, SendMessageMediaInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SendMessageMediaInvalidError).call(this, 'The message media was invalid or not specified' + RPCError._fmtRequest(args.request)));\n }\n\n return SendMessageMediaInvalidError;\n}(BadRequestError);\n\nvar SendMessageTypeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError188) {\n _inherits(SendMessageTypeInvalidError, _BadRequestError188);\n\n function SendMessageTypeInvalidError(args) {\n _classCallCheck(this, SendMessageTypeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SendMessageTypeInvalidError).call(this, 'The message type is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return SendMessageTypeInvalidError;\n}(BadRequestError);\n\nvar SessionExpiredError =\n/*#__PURE__*/\nfunction (_UnauthorizedError5) {\n _inherits(SessionExpiredError, _UnauthorizedError5);\n\n function SessionExpiredError(args) {\n _classCallCheck(this, SessionExpiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SessionExpiredError).call(this, 'The authorization has expired' + RPCError._fmtRequest(args.request)));\n }\n\n return SessionExpiredError;\n}(UnauthorizedError);\n\nvar SessionPasswordNeededError =\n/*#__PURE__*/\nfunction (_UnauthorizedError6) {\n _inherits(SessionPasswordNeededError, _UnauthorizedError6);\n\n function SessionPasswordNeededError(args) {\n _classCallCheck(this, SessionPasswordNeededError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SessionPasswordNeededError).call(this, 'Two-steps verification is enabled and a password is required' + RPCError._fmtRequest(args.request)));\n }\n\n return SessionPasswordNeededError;\n}(UnauthorizedError);\n\nvar SessionRevokedError =\n/*#__PURE__*/\nfunction (_UnauthorizedError7) {\n _inherits(SessionRevokedError, _UnauthorizedError7);\n\n function SessionRevokedError(args) {\n _classCallCheck(this, SessionRevokedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SessionRevokedError).call(this, 'The authorization has been invalidated, because of the user terminating all sessions' + RPCError._fmtRequest(args.request)));\n }\n\n return SessionRevokedError;\n}(UnauthorizedError);\n\nvar Sha256HashInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError189) {\n _inherits(Sha256HashInvalidError, _BadRequestError189);\n\n function Sha256HashInvalidError(args) {\n _classCallCheck(this, Sha256HashInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Sha256HashInvalidError).call(this, 'The provided SHA256 hash is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return Sha256HashInvalidError;\n}(BadRequestError);\n\nvar ShortnameOccupyFailedError =\n/*#__PURE__*/\nfunction (_BadRequestError190) {\n _inherits(ShortnameOccupyFailedError, _BadRequestError190);\n\n function ShortnameOccupyFailedError(args) {\n _classCallCheck(this, ShortnameOccupyFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ShortnameOccupyFailedError).call(this, 'An error occurred when trying to register the short-name used for the sticker pack. Try a different name' + RPCError._fmtRequest(args.request)));\n }\n\n return ShortnameOccupyFailedError;\n}(BadRequestError);\n\nvar SlowModeWaitError =\n/*#__PURE__*/\nfunction (_FloodError3) {\n _inherits(SlowModeWaitError, _FloodError3);\n\n function SlowModeWaitError(args) {\n var _this10;\n\n _classCallCheck(this, SlowModeWaitError);\n\n var seconds = Number(args.capture || 0);\n _this10 = _possibleConstructorReturn(this, _getPrototypeOf(SlowModeWaitError).call(this, format('A wait of {seconds} seconds is required before sending another message in this chat', {\n seconds: seconds\n }) + RPCError._fmtRequest(args.request)));\n _this10.seconds = seconds;\n return _this10;\n }\n\n return SlowModeWaitError;\n}(FloodError);\n\nvar StartParamEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError191) {\n _inherits(StartParamEmptyError, _BadRequestError191);\n\n function StartParamEmptyError(args) {\n _classCallCheck(this, StartParamEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StartParamEmptyError).call(this, 'The start parameter is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return StartParamEmptyError;\n}(BadRequestError);\n\nvar StartParamInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError192) {\n _inherits(StartParamInvalidError, _BadRequestError192);\n\n function StartParamInvalidError(args) {\n _classCallCheck(this, StartParamInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StartParamInvalidError).call(this, 'Start parameter invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StartParamInvalidError;\n}(BadRequestError);\n\nvar StickersetInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError193) {\n _inherits(StickersetInvalidError, _BadRequestError193);\n\n function StickersetInvalidError(args) {\n _classCallCheck(this, StickersetInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickersetInvalidError).call(this, 'The provided sticker set is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickersetInvalidError;\n}(BadRequestError);\n\nvar StickersEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError194) {\n _inherits(StickersEmptyError, _BadRequestError194);\n\n function StickersEmptyError(args) {\n _classCallCheck(this, StickersEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickersEmptyError).call(this, 'No sticker provided' + RPCError._fmtRequest(args.request)));\n }\n\n return StickersEmptyError;\n}(BadRequestError);\n\nvar StickerEmojiInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError195) {\n _inherits(StickerEmojiInvalidError, _BadRequestError195);\n\n function StickerEmojiInvalidError(args) {\n _classCallCheck(this, StickerEmojiInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickerEmojiInvalidError).call(this, 'Sticker emoji invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickerEmojiInvalidError;\n}(BadRequestError);\n\nvar StickerFileInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError196) {\n _inherits(StickerFileInvalidError, _BadRequestError196);\n\n function StickerFileInvalidError(args) {\n _classCallCheck(this, StickerFileInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickerFileInvalidError).call(this, 'Sticker file invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickerFileInvalidError;\n}(BadRequestError);\n\nvar StickerIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError197) {\n _inherits(StickerIdInvalidError, _BadRequestError197);\n\n function StickerIdInvalidError(args) {\n _classCallCheck(this, StickerIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickerIdInvalidError).call(this, 'The provided sticker ID is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickerIdInvalidError;\n}(BadRequestError);\n\nvar StickerInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError198) {\n _inherits(StickerInvalidError, _BadRequestError198);\n\n function StickerInvalidError(args) {\n _classCallCheck(this, StickerInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickerInvalidError).call(this, 'The provided sticker is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickerInvalidError;\n}(BadRequestError);\n\nvar StickerPngDimensionsError =\n/*#__PURE__*/\nfunction (_BadRequestError199) {\n _inherits(StickerPngDimensionsError, _BadRequestError199);\n\n function StickerPngDimensionsError(args) {\n _classCallCheck(this, StickerPngDimensionsError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StickerPngDimensionsError).call(this, 'Sticker png dimensions invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return StickerPngDimensionsError;\n}(BadRequestError);\n\nvar StorageCheckFailedError =\n/*#__PURE__*/\nfunction (_ServerError15) {\n _inherits(StorageCheckFailedError, _ServerError15);\n\n function StorageCheckFailedError(args) {\n _classCallCheck(this, StorageCheckFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StorageCheckFailedError).call(this, 'Server storage check failed' + RPCError._fmtRequest(args.request)));\n }\n\n return StorageCheckFailedError;\n}(ServerError);\n\nvar StoreInvalidScalarTypeError =\n/*#__PURE__*/\nfunction (_ServerError16) {\n _inherits(StoreInvalidScalarTypeError, _ServerError16);\n\n function StoreInvalidScalarTypeError(args) {\n _classCallCheck(this, StoreInvalidScalarTypeError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StoreInvalidScalarTypeError).call(this, '' + RPCError._fmtRequest(args.request)));\n }\n\n return StoreInvalidScalarTypeError;\n}(ServerError);\n\nvar TakeoutInitDelayError =\n/*#__PURE__*/\nfunction (_FloodError4) {\n _inherits(TakeoutInitDelayError, _FloodError4);\n\n function TakeoutInitDelayError(args) {\n var _this11;\n\n _classCallCheck(this, TakeoutInitDelayError);\n\n var seconds = Number(args.capture || 0);\n _this11 = _possibleConstructorReturn(this, _getPrototypeOf(TakeoutInitDelayError).call(this, format('A wait of {seconds} seconds is required before being able to initiate the takeout', {\n seconds: seconds\n }) + RPCError._fmtRequest(args.request)));\n _this11.seconds = seconds;\n return _this11;\n }\n\n return TakeoutInitDelayError;\n}(FloodError);\n\nvar TakeoutInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError200) {\n _inherits(TakeoutInvalidError, _BadRequestError200);\n\n function TakeoutInvalidError(args) {\n _classCallCheck(this, TakeoutInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TakeoutInvalidError).call(this, 'The takeout session has been invalidated by another data export session' + RPCError._fmtRequest(args.request)));\n }\n\n return TakeoutInvalidError;\n}(BadRequestError);\n\nvar TakeoutRequiredError =\n/*#__PURE__*/\nfunction (_BadRequestError201) {\n _inherits(TakeoutRequiredError, _BadRequestError201);\n\n function TakeoutRequiredError(args) {\n _classCallCheck(this, TakeoutRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TakeoutRequiredError).call(this, 'You must initialize a takeout request first' + RPCError._fmtRequest(args.request)));\n }\n\n return TakeoutRequiredError;\n}(BadRequestError);\n\nvar TempAuthKeyEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError202) {\n _inherits(TempAuthKeyEmptyError, _BadRequestError202);\n\n function TempAuthKeyEmptyError(args) {\n _classCallCheck(this, TempAuthKeyEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TempAuthKeyEmptyError).call(this, 'No temporary auth key provided' + RPCError._fmtRequest(args.request)));\n }\n\n return TempAuthKeyEmptyError;\n}(BadRequestError);\n\nvar TimeoutError =\n/*#__PURE__*/\nfunction (_TimedOutError) {\n _inherits(TimeoutError, _TimedOutError);\n\n function TimeoutError(args) {\n _classCallCheck(this, TimeoutError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TimeoutError).call(this, 'A timeout occurred while fetching data from the worker' + RPCError._fmtRequest(args.request)));\n }\n\n return TimeoutError;\n}(TimedOutError);\n\nvar TmpPasswordDisabledError =\n/*#__PURE__*/\nfunction (_BadRequestError203) {\n _inherits(TmpPasswordDisabledError, _BadRequestError203);\n\n function TmpPasswordDisabledError(args) {\n _classCallCheck(this, TmpPasswordDisabledError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TmpPasswordDisabledError).call(this, 'The temporary password is disabled' + RPCError._fmtRequest(args.request)));\n }\n\n return TmpPasswordDisabledError;\n}(BadRequestError);\n\nvar TokenInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError204) {\n _inherits(TokenInvalidError, _BadRequestError204);\n\n function TokenInvalidError(args) {\n _classCallCheck(this, TokenInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TokenInvalidError).call(this, 'The provided token is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return TokenInvalidError;\n}(BadRequestError);\n\nvar TtlDaysInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError205) {\n _inherits(TtlDaysInvalidError, _BadRequestError205);\n\n function TtlDaysInvalidError(args) {\n _classCallCheck(this, TtlDaysInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TtlDaysInvalidError).call(this, 'The provided TTL is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return TtlDaysInvalidError;\n}(BadRequestError);\n\nvar TypesEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError206) {\n _inherits(TypesEmptyError, _BadRequestError206);\n\n function TypesEmptyError(args) {\n _classCallCheck(this, TypesEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TypesEmptyError).call(this, 'The types field is empty' + RPCError._fmtRequest(args.request)));\n }\n\n return TypesEmptyError;\n}(BadRequestError);\n\nvar TypeConstructorInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError207) {\n _inherits(TypeConstructorInvalidError, _BadRequestError207);\n\n function TypeConstructorInvalidError(args) {\n _classCallCheck(this, TypeConstructorInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(TypeConstructorInvalidError).call(this, 'The type constructor is invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return TypeConstructorInvalidError;\n}(BadRequestError);\n\nvar UnknownMethodError =\n/*#__PURE__*/\nfunction (_ServerError17) {\n _inherits(UnknownMethodError, _ServerError17);\n\n function UnknownMethodError(args) {\n _classCallCheck(this, UnknownMethodError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UnknownMethodError).call(this, 'The method you tried to call cannot be called on non-CDN DCs' + RPCError._fmtRequest(args.request)));\n }\n\n return UnknownMethodError;\n}(ServerError);\n\nvar UntilDateInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError208) {\n _inherits(UntilDateInvalidError, _BadRequestError208);\n\n function UntilDateInvalidError(args) {\n _classCallCheck(this, UntilDateInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UntilDateInvalidError).call(this, 'That date cannot be specified in this request (try using None)' + RPCError._fmtRequest(args.request)));\n }\n\n return UntilDateInvalidError;\n}(BadRequestError);\n\nvar UrlInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError209) {\n _inherits(UrlInvalidError, _BadRequestError209);\n\n function UrlInvalidError(args) {\n _classCallCheck(this, UrlInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UrlInvalidError).call(this, 'The URL used was invalid (e.g. when answering a callback with an URL that\\'s not t.me/yourbot or your game\\'s URL)' + RPCError._fmtRequest(args.request)));\n }\n\n return UrlInvalidError;\n}(BadRequestError);\n\nvar UsernameInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError210) {\n _inherits(UsernameInvalidError, _BadRequestError210);\n\n function UsernameInvalidError(args) {\n _classCallCheck(this, UsernameInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsernameInvalidError).call(this, 'Nobody is using this username, or the username is unacceptable. If the latter, it must match r\"[a-zA-Z][\\w\\d]{3,30}[a-zA-Z\\d]\"' + RPCError._fmtRequest(args.request)));\n }\n\n return UsernameInvalidError;\n}(BadRequestError);\n\nvar UsernameNotModifiedError =\n/*#__PURE__*/\nfunction (_BadRequestError211) {\n _inherits(UsernameNotModifiedError, _BadRequestError211);\n\n function UsernameNotModifiedError(args) {\n _classCallCheck(this, UsernameNotModifiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsernameNotModifiedError).call(this, 'The username is not different from the current username' + RPCError._fmtRequest(args.request)));\n }\n\n return UsernameNotModifiedError;\n}(BadRequestError);\n\nvar UsernameNotOccupiedError =\n/*#__PURE__*/\nfunction (_BadRequestError212) {\n _inherits(UsernameNotOccupiedError, _BadRequestError212);\n\n function UsernameNotOccupiedError(args) {\n _classCallCheck(this, UsernameNotOccupiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsernameNotOccupiedError).call(this, 'The username is not in use by anyone else yet' + RPCError._fmtRequest(args.request)));\n }\n\n return UsernameNotOccupiedError;\n}(BadRequestError);\n\nvar UsernameOccupiedError =\n/*#__PURE__*/\nfunction (_BadRequestError213) {\n _inherits(UsernameOccupiedError, _BadRequestError213);\n\n function UsernameOccupiedError(args) {\n _classCallCheck(this, UsernameOccupiedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsernameOccupiedError).call(this, 'The username is already taken' + RPCError._fmtRequest(args.request)));\n }\n\n return UsernameOccupiedError;\n}(BadRequestError);\n\nvar UsersTooFewError =\n/*#__PURE__*/\nfunction (_BadRequestError214) {\n _inherits(UsersTooFewError, _BadRequestError214);\n\n function UsersTooFewError(args) {\n _classCallCheck(this, UsersTooFewError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsersTooFewError).call(this, 'Not enough users (to create a chat, for example)' + RPCError._fmtRequest(args.request)));\n }\n\n return UsersTooFewError;\n}(BadRequestError);\n\nvar UsersTooMuchError =\n/*#__PURE__*/\nfunction (_BadRequestError215) {\n _inherits(UsersTooMuchError, _BadRequestError215);\n\n function UsersTooMuchError(args) {\n _classCallCheck(this, UsersTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UsersTooMuchError).call(this, 'The maximum number of users has been exceeded (to create a chat, for example)' + RPCError._fmtRequest(args.request)));\n }\n\n return UsersTooMuchError;\n}(BadRequestError);\n\nvar UserAdminInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError216) {\n _inherits(UserAdminInvalidError, _BadRequestError216);\n\n function UserAdminInvalidError(args) {\n _classCallCheck(this, UserAdminInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserAdminInvalidError).call(this, 'Either you\\'re not an admin or you tried to ban an admin that you didn\\'t promote' + RPCError._fmtRequest(args.request)));\n }\n\n return UserAdminInvalidError;\n}(BadRequestError);\n\nvar UserAlreadyParticipantError =\n/*#__PURE__*/\nfunction (_BadRequestError217) {\n _inherits(UserAlreadyParticipantError, _BadRequestError217);\n\n function UserAlreadyParticipantError(args) {\n _classCallCheck(this, UserAlreadyParticipantError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserAlreadyParticipantError).call(this, 'The authenticated user is already a participant of the chat' + RPCError._fmtRequest(args.request)));\n }\n\n return UserAlreadyParticipantError;\n}(BadRequestError);\n\nvar UserBannedInChannelError =\n/*#__PURE__*/\nfunction (_BadRequestError218) {\n _inherits(UserBannedInChannelError, _BadRequestError218);\n\n function UserBannedInChannelError(args) {\n _classCallCheck(this, UserBannedInChannelError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserBannedInChannelError).call(this, 'You\\'re banned from sending messages in supergroups/channels' + RPCError._fmtRequest(args.request)));\n }\n\n return UserBannedInChannelError;\n}(BadRequestError);\n\nvar UserBlockedError =\n/*#__PURE__*/\nfunction (_BadRequestError219) {\n _inherits(UserBlockedError, _BadRequestError219);\n\n function UserBlockedError(args) {\n _classCallCheck(this, UserBlockedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserBlockedError).call(this, 'User blocked' + RPCError._fmtRequest(args.request)));\n }\n\n return UserBlockedError;\n}(BadRequestError);\n\nvar UserBotError =\n/*#__PURE__*/\nfunction (_BadRequestError220) {\n _inherits(UserBotError, _BadRequestError220);\n\n function UserBotError(args) {\n _classCallCheck(this, UserBotError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserBotError).call(this, 'Bots can only be admins in channels.' + RPCError._fmtRequest(args.request)));\n }\n\n return UserBotError;\n}(BadRequestError);\n\nvar UserBotInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError221) {\n _inherits(UserBotInvalidError, _BadRequestError221);\n\n function UserBotInvalidError(args) {\n _classCallCheck(this, UserBotInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserBotInvalidError).call(this, 'This method can only be called by a bot' + RPCError._fmtRequest(args.request)));\n }\n\n return UserBotInvalidError;\n}(BadRequestError);\n\nvar UserBotRequiredError =\n/*#__PURE__*/\nfunction (_BadRequestError222) {\n _inherits(UserBotRequiredError, _BadRequestError222);\n\n function UserBotRequiredError(args) {\n _classCallCheck(this, UserBotRequiredError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserBotRequiredError).call(this, 'This method can only be called by a bot' + RPCError._fmtRequest(args.request)));\n }\n\n return UserBotRequiredError;\n}(BadRequestError);\n\nvar UserChannelsTooMuchError =\n/*#__PURE__*/\nfunction (_ForbiddenError10) {\n _inherits(UserChannelsTooMuchError, _ForbiddenError10);\n\n function UserChannelsTooMuchError(args) {\n _classCallCheck(this, UserChannelsTooMuchError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserChannelsTooMuchError).call(this, 'One of the users you tried to add is already in too many channels/supergroups' + RPCError._fmtRequest(args.request)));\n }\n\n return UserChannelsTooMuchError;\n}(ForbiddenError);\n\nvar UserCreatorError =\n/*#__PURE__*/\nfunction (_BadRequestError223) {\n _inherits(UserCreatorError, _BadRequestError223);\n\n function UserCreatorError(args) {\n _classCallCheck(this, UserCreatorError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserCreatorError).call(this, 'You can\\'t leave this channel, because you\\'re its creator' + RPCError._fmtRequest(args.request)));\n }\n\n return UserCreatorError;\n}(BadRequestError);\n\nvar UserDeactivatedError =\n/*#__PURE__*/\nfunction (_UnauthorizedError8) {\n _inherits(UserDeactivatedError, _UnauthorizedError8);\n\n function UserDeactivatedError(args) {\n _classCallCheck(this, UserDeactivatedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserDeactivatedError).call(this, 'The user has been deleted/deactivated' + RPCError._fmtRequest(args.request)));\n }\n\n return UserDeactivatedError;\n}(UnauthorizedError);\n\nvar UserDeactivatedBanError =\n/*#__PURE__*/\nfunction (_UnauthorizedError9) {\n _inherits(UserDeactivatedBanError, _UnauthorizedError9);\n\n function UserDeactivatedBanError(args) {\n _classCallCheck(this, UserDeactivatedBanError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserDeactivatedBanError).call(this, 'The user has been deleted/deactivated' + RPCError._fmtRequest(args.request)));\n }\n\n return UserDeactivatedBanError;\n}(UnauthorizedError);\n\nvar UserIdInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError224) {\n _inherits(UserIdInvalidError, _BadRequestError224);\n\n function UserIdInvalidError(args) {\n _classCallCheck(this, UserIdInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserIdInvalidError).call(this, 'Invalid object ID for a user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited' + RPCError._fmtRequest(args.request)));\n }\n\n return UserIdInvalidError;\n}(BadRequestError);\n\nvar UserInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError225) {\n _inherits(UserInvalidError, _BadRequestError225);\n\n function UserInvalidError(args) {\n _classCallCheck(this, UserInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserInvalidError).call(this, 'The given user was invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return UserInvalidError;\n}(BadRequestError);\n\nvar UserIsBlockedError =\n/*#__PURE__*/\nfunction (_BadRequestError226) {\n _inherits(UserIsBlockedError, _BadRequestError226);\n\n function UserIsBlockedError(args) {\n _classCallCheck(this, UserIsBlockedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserIsBlockedError).call(this, 'User is blocked' + RPCError._fmtRequest(args.request)));\n }\n\n return UserIsBlockedError;\n}(BadRequestError);\n\nvar UserIsBotError =\n/*#__PURE__*/\nfunction (_BadRequestError227) {\n _inherits(UserIsBotError, _BadRequestError227);\n\n function UserIsBotError(args) {\n _classCallCheck(this, UserIsBotError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserIsBotError).call(this, 'Bots can\\'t send messages to other bots' + RPCError._fmtRequest(args.request)));\n }\n\n return UserIsBotError;\n}(BadRequestError);\n\nvar UserKickedError =\n/*#__PURE__*/\nfunction (_BadRequestError228) {\n _inherits(UserKickedError, _BadRequestError228);\n\n function UserKickedError(args) {\n _classCallCheck(this, UserKickedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserKickedError).call(this, 'This user was kicked from this supergroup/channel' + RPCError._fmtRequest(args.request)));\n }\n\n return UserKickedError;\n}(BadRequestError);\n\nvar UserMigrateError =\n/*#__PURE__*/\nfunction (_InvalidDCError4) {\n _inherits(UserMigrateError, _InvalidDCError4);\n\n function UserMigrateError(args) {\n var _this12;\n\n _classCallCheck(this, UserMigrateError);\n\n var newDc = Number(args.capture || 0);\n _this12 = _possibleConstructorReturn(this, _getPrototypeOf(UserMigrateError).call(this, format('The user whose identity is being used to execute queries is associated with DC {new_dc}', {\n newDc: newDc\n }) + RPCError._fmtRequest(args.request)));\n _this12.newDc = newDc;\n return _this12;\n }\n\n return UserMigrateError;\n}(InvalidDCError);\n\nvar UserNotMutualContactError =\n/*#__PURE__*/\nfunction (_BadRequestError229) {\n _inherits(UserNotMutualContactError, _BadRequestError229);\n\n function UserNotMutualContactError(args) {\n _classCallCheck(this, UserNotMutualContactError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserNotMutualContactError).call(this, 'The provided user is not a mutual contact' + RPCError._fmtRequest(args.request)));\n }\n\n return UserNotMutualContactError;\n}(BadRequestError);\n\nvar UserNotParticipantError =\n/*#__PURE__*/\nfunction (_BadRequestError230) {\n _inherits(UserNotParticipantError, _BadRequestError230);\n\n function UserNotParticipantError(args) {\n _classCallCheck(this, UserNotParticipantError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserNotParticipantError).call(this, 'The target user is not a member of the specified megagroup or channel' + RPCError._fmtRequest(args.request)));\n }\n\n return UserNotParticipantError;\n}(BadRequestError);\n\nvar UserPrivacyRestrictedError =\n/*#__PURE__*/\nfunction (_ForbiddenError11) {\n _inherits(UserPrivacyRestrictedError, _ForbiddenError11);\n\n function UserPrivacyRestrictedError(args) {\n _classCallCheck(this, UserPrivacyRestrictedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserPrivacyRestrictedError).call(this, 'The user\\'s privacy settings do not allow you to do this' + RPCError._fmtRequest(args.request)));\n }\n\n return UserPrivacyRestrictedError;\n}(ForbiddenError);\n\nvar UserRestrictedError =\n/*#__PURE__*/\nfunction (_ForbiddenError12) {\n _inherits(UserRestrictedError, _ForbiddenError12);\n\n function UserRestrictedError(args) {\n _classCallCheck(this, UserRestrictedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(UserRestrictedError).call(this, 'You\\'re spamreported, you can\\'t create channels or chats.' + RPCError._fmtRequest(args.request)));\n }\n\n return UserRestrictedError;\n}(ForbiddenError);\n\nvar VideoContentTypeInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError231) {\n _inherits(VideoContentTypeInvalidError, _BadRequestError231);\n\n function VideoContentTypeInvalidError(args) {\n _classCallCheck(this, VideoContentTypeInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(VideoContentTypeInvalidError).call(this, 'The video content type is not supported with the given parameters (i.e. supports_streaming)' + RPCError._fmtRequest(args.request)));\n }\n\n return VideoContentTypeInvalidError;\n}(BadRequestError);\n\nvar WallpaperFileInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError232) {\n _inherits(WallpaperFileInvalidError, _BadRequestError232);\n\n function WallpaperFileInvalidError(args) {\n _classCallCheck(this, WallpaperFileInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WallpaperFileInvalidError).call(this, 'The given file cannot be used as a wallpaper' + RPCError._fmtRequest(args.request)));\n }\n\n return WallpaperFileInvalidError;\n}(BadRequestError);\n\nvar WallpaperInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError233) {\n _inherits(WallpaperInvalidError, _BadRequestError233);\n\n function WallpaperInvalidError(args) {\n _classCallCheck(this, WallpaperInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WallpaperInvalidError).call(this, 'The input wallpaper was not valid' + RPCError._fmtRequest(args.request)));\n }\n\n return WallpaperInvalidError;\n}(BadRequestError);\n\nvar WcConvertUrlInvalidError =\n/*#__PURE__*/\nfunction (_BadRequestError234) {\n _inherits(WcConvertUrlInvalidError, _BadRequestError234);\n\n function WcConvertUrlInvalidError(args) {\n _classCallCheck(this, WcConvertUrlInvalidError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WcConvertUrlInvalidError).call(this, 'WC convert URL invalid' + RPCError._fmtRequest(args.request)));\n }\n\n return WcConvertUrlInvalidError;\n}(BadRequestError);\n\nvar WebpageCurlFailedError =\n/*#__PURE__*/\nfunction (_BadRequestError235) {\n _inherits(WebpageCurlFailedError, _BadRequestError235);\n\n function WebpageCurlFailedError(args) {\n _classCallCheck(this, WebpageCurlFailedError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WebpageCurlFailedError).call(this, 'Failure while fetching the webpage with cURL' + RPCError._fmtRequest(args.request)));\n }\n\n return WebpageCurlFailedError;\n}(BadRequestError);\n\nvar WebpageMediaEmptyError =\n/*#__PURE__*/\nfunction (_BadRequestError236) {\n _inherits(WebpageMediaEmptyError, _BadRequestError236);\n\n function WebpageMediaEmptyError(args) {\n _classCallCheck(this, WebpageMediaEmptyError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WebpageMediaEmptyError).call(this, 'Webpage media empty' + RPCError._fmtRequest(args.request)));\n }\n\n return WebpageMediaEmptyError;\n}(BadRequestError);\n\nvar WorkerBusyTooLongRetryError =\n/*#__PURE__*/\nfunction (_ServerError18) {\n _inherits(WorkerBusyTooLongRetryError, _ServerError18);\n\n function WorkerBusyTooLongRetryError(args) {\n _classCallCheck(this, WorkerBusyTooLongRetryError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(WorkerBusyTooLongRetryError).call(this, 'Telegram workers are too busy to respond immediately' + RPCError._fmtRequest(args.request)));\n }\n\n return WorkerBusyTooLongRetryError;\n}(ServerError);\n\nvar YouBlockedUserError =\n/*#__PURE__*/\nfunction (_BadRequestError237) {\n _inherits(YouBlockedUserError, _BadRequestError237);\n\n function YouBlockedUserError(args) {\n _classCallCheck(this, YouBlockedUserError);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(YouBlockedUserError).call(this, 'You blocked this user' + RPCError._fmtRequest(args.request)));\n }\n\n return YouBlockedUserError;\n}(BadRequestError);\n\nvar rpcErrorsObject = {\n ABOUT_TOO_LONG: AboutTooLongError,\n ACCESS_TOKEN_EXPIRED: AccessTokenExpiredError,\n ACCESS_TOKEN_INVALID: AccessTokenInvalidError,\n ACTIVE_USER_REQUIRED: ActiveUserRequiredError,\n ADMINS_TOO_MUCH: AdminsTooMuchError,\n ADMIN_RANK_EMOJI_NOT_ALLOWED: AdminRankEmojiNotAllowedError,\n ADMIN_RANK_INVALID: AdminRankInvalidError,\n API_ID_INVALID: ApiIdInvalidError,\n API_ID_PUBLISHED_FLOOD: ApiIdPublishedFloodError,\n ARTICLE_TITLE_EMPTY: ArticleTitleEmptyError,\n AUTH_BYTES_INVALID: AuthBytesInvalidError,\n AUTH_KEY_DUPLICATED: AuthKeyDuplicatedError,\n AUTH_KEY_INVALID: AuthKeyInvalidError,\n AUTH_KEY_PERM_EMPTY: AuthKeyPermEmptyError,\n AUTH_KEY_UNREGISTERED: AuthKeyUnregisteredError,\n AUTH_RESTART: AuthRestartError,\n BANNED_RIGHTS_INVALID: BannedRightsInvalidError,\n BOTS_TOO_MUCH: BotsTooMuchError,\n BOT_CHANNELS_NA: BotChannelsNaError,\n BOT_GROUPS_BLOCKED: BotGroupsBlockedError,\n BOT_INLINE_DISABLED: BotInlineDisabledError,\n BOT_INVALID: BotInvalidError,\n BOT_METHOD_INVALID: BotMethodInvalidError,\n BOT_MISSING: BotMissingError,\n BOT_PAYMENTS_DISABLED: BotPaymentsDisabledError,\n BOT_POLLS_DISABLED: BotPollsDisabledError,\n BROADCAST_ID_INVALID: BroadcastIdInvalidError,\n BUTTON_DATA_INVALID: ButtonDataInvalidError,\n BUTTON_TYPE_INVALID: ButtonTypeInvalidError,\n BUTTON_URL_INVALID: ButtonUrlInvalidError,\n CALL_ALREADY_ACCEPTED: CallAlreadyAcceptedError,\n CALL_ALREADY_DECLINED: CallAlreadyDeclinedError,\n CALL_OCCUPY_FAILED: CallOccupyFailedError,\n CALL_PEER_INVALID: CallPeerInvalidError,\n CALL_PROTOCOL_FLAGS_INVALID: CallProtocolFlagsInvalidError,\n CDN_METHOD_INVALID: CdnMethodInvalidError,\n CHANNELS_ADMIN_PUBLIC_TOO_MUCH: ChannelsAdminPublicTooMuchError,\n CHANNELS_TOO_MUCH: ChannelsTooMuchError,\n CHANNEL_INVALID: ChannelInvalidError,\n CHANNEL_PRIVATE: ChannelPrivateError,\n CHANNEL_PUBLIC_GROUP_NA: ChannelPublicGroupNaError,\n CHAT_ABOUT_NOT_MODIFIED: ChatAboutNotModifiedError,\n CHAT_ABOUT_TOO_LONG: ChatAboutTooLongError,\n CHAT_ADMIN_INVITE_REQUIRED: ChatAdminInviteRequiredError,\n CHAT_ADMIN_REQUIRED: ChatAdminRequiredError,\n CHAT_FORBIDDEN: ChatForbiddenError,\n CHAT_ID_EMPTY: ChatIdEmptyError,\n CHAT_ID_INVALID: ChatIdInvalidError,\n CHAT_INVALID: ChatInvalidError,\n CHAT_LINK_EXISTS: ChatLinkExistsError,\n CHAT_NOT_MODIFIED: ChatNotModifiedError,\n CHAT_RESTRICTED: ChatRestrictedError,\n CHAT_SEND_GIFS_FORBIDDEN: ChatSendGifsForbiddenError,\n CHAT_SEND_INLINE_FORBIDDEN: ChatSendInlineForbiddenError,\n CHAT_SEND_MEDIA_FORBIDDEN: ChatSendMediaForbiddenError,\n CHAT_SEND_STICKERS_FORBIDDEN: ChatSendStickersForbiddenError,\n CHAT_TITLE_EMPTY: ChatTitleEmptyError,\n CHAT_WRITE_FORBIDDEN: ChatWriteForbiddenError,\n CODE_EMPTY: CodeEmptyError,\n CODE_HASH_INVALID: CodeHashInvalidError,\n CODE_INVALID: CodeInvalidError,\n CONNECTION_API_ID_INVALID: ConnectionApiIdInvalidError,\n CONNECTION_DEVICE_MODEL_EMPTY: ConnectionDeviceModelEmptyError,\n CONNECTION_LANG_PACK_INVALID: ConnectionLangPackInvalidError,\n CONNECTION_LAYER_INVALID: ConnectionLayerInvalidError,\n CONNECTION_NOT_INITED: ConnectionNotInitedError,\n CONNECTION_SYSTEM_EMPTY: ConnectionSystemEmptyError,\n CONTACT_ID_INVALID: ContactIdInvalidError,\n DATA_INVALID: DataInvalidError,\n DATA_JSON_INVALID: DataJsonInvalidError,\n DATE_EMPTY: DateEmptyError,\n DC_ID_INVALID: DcIdInvalidError,\n DH_G_A_INVALID: DhGAInvalidError,\n EMAIL_HASH_EXPIRED: EmailHashExpiredError,\n EMAIL_INVALID: EmailInvalidError,\n EMOTICON_EMPTY: EmoticonEmptyError,\n ENCRYPTED_MESSAGE_INVALID: EncryptedMessageInvalidError,\n ENCRYPTION_ALREADY_ACCEPTED: EncryptionAlreadyAcceptedError,\n ENCRYPTION_ALREADY_DECLINED: EncryptionAlreadyDeclinedError,\n ENCRYPTION_DECLINED: EncryptionDeclinedError,\n ENCRYPTION_ID_INVALID: EncryptionIdInvalidError,\n ENCRYPTION_OCCUPY_FAILED: EncryptionOccupyFailedError,\n ENTITIES_TOO_LONG: EntitiesTooLongError,\n ENTITY_MENTION_USER_INVALID: EntityMentionUserInvalidError,\n ERROR_TEXT_EMPTY: ErrorTextEmptyError,\n EXPORT_CARD_INVALID: ExportCardInvalidError,\n EXTERNAL_URL_INVALID: ExternalUrlInvalidError,\n FIELD_NAME_EMPTY: FieldNameEmptyError,\n FIELD_NAME_INVALID: FieldNameInvalidError,\n FILE_ID_INVALID: FileIdInvalidError,\n FILE_PARTS_INVALID: FilePartsInvalidError,\n FILE_PART_0_MISSING: FilePart0MissingError,\n FILE_PART_EMPTY: FilePartEmptyError,\n FILE_PART_INVALID: FilePartInvalidError,\n FILE_PART_LENGTH_INVALID: FilePartLengthInvalidError,\n FILE_PART_SIZE_INVALID: FilePartSizeInvalidError,\n FILEREF_UPGRADE_NEEDED: FilerefUpgradeNeededError,\n FIRSTNAME_INVALID: FirstNameInvalidError,\n FOLDER_ID_EMPTY: FolderIdEmptyError,\n FOLDER_ID_INVALID: FolderIdInvalidError,\n FRESH_RESET_AUTHORISATION_FORBIDDEN: FreshResetAuthorisationForbiddenError,\n GIF_ID_INVALID: GifIdInvalidError,\n GROUPED_MEDIA_INVALID: GroupedMediaInvalidError,\n HASH_INVALID: HashInvalidError,\n HISTORY_GET_FAILED: HistoryGetFailedError,\n IMAGE_PROCESS_FAILED: ImageProcessFailedError,\n INLINE_RESULT_EXPIRED: InlineResultExpiredError,\n INPUT_CONSTRUCTOR_INVALID: InputConstructorInvalidError,\n INPUT_FETCH_ERROR: InputFetchErrorError,\n INPUT_FETCH_FAIL: InputFetchFailError,\n INPUT_LAYER_INVALID: InputLayerInvalidError,\n INPUT_METHOD_INVALID: InputMethodInvalidError,\n INPUT_REQUEST_TOO_LONG: InputRequestTooLongError,\n INPUT_USER_DEACTIVATED: InputUserDeactivatedError,\n INVITE_HASH_EMPTY: InviteHashEmptyError,\n INVITE_HASH_EXPIRED: InviteHashExpiredError,\n INVITE_HASH_INVALID: InviteHashInvalidError,\n LANG_PACK_INVALID: LangPackInvalidError,\n LASTNAME_INVALID: LastnameInvalidError,\n LIMIT_INVALID: LimitInvalidError,\n LINK_NOT_MODIFIED: LinkNotModifiedError,\n LOCATION_INVALID: LocationInvalidError,\n MAX_ID_INVALID: MaxIdInvalidError,\n MAX_QTS_INVALID: MaxQtsInvalidError,\n MD5_CHECKSUM_INVALID: Md5ChecksumInvalidError,\n MEDIA_CAPTION_TOO_LONG: MediaCaptionTooLongError,\n MEDIA_EMPTY: MediaEmptyError,\n MEDIA_INVALID: MediaInvalidError,\n MEDIA_NEW_INVALID: MediaNewInvalidError,\n MEDIA_PREV_INVALID: MediaPrevInvalidError,\n MEGAGROUP_ID_INVALID: MegagroupIdInvalidError,\n MEGAGROUP_PREHISTORY_HIDDEN: MegagroupPrehistoryHiddenError,\n MEMBER_NO_LOCATION: MemberNoLocationError,\n MEMBER_OCCUPY_PRIMARY_LOC_FAILED: MemberOccupyPrimaryLocFailedError,\n MESSAGE_AUTHOR_REQUIRED: MessageAuthorRequiredError,\n MESSAGE_DELETE_FORBIDDEN: MessageDeleteForbiddenError,\n MESSAGE_EDIT_TIME_EXPIRED: MessageEditTimeExpiredError,\n MESSAGE_EMPTY: MessageEmptyError,\n MESSAGE_IDS_EMPTY: MessageIdsEmptyError,\n MESSAGE_ID_INVALID: MessageIdInvalidError,\n MESSAGE_NOT_MODIFIED: MessageNotModifiedError,\n MESSAGE_TOO_LONG: MessageTooLongError,\n MSG_WAIT_FAILED: MsgWaitFailedError,\n MT_SEND_QUEUE_TOO_LONG: MtSendQueueTooLongError,\n NEED_CHAT_INVALID: NeedChatInvalidError,\n NEED_MEMBER_INVALID: NeedMemberInvalidError,\n NEW_SALT_INVALID: NewSaltInvalidError,\n NEW_SETTINGS_INVALID: NewSettingsInvalidError,\n OFFSET_INVALID: OffsetInvalidError,\n OFFSET_PEER_ID_INVALID: OffsetPeerIdInvalidError,\n OPTIONS_TOO_MUCH: OptionsTooMuchError,\n PACK_SHORT_NAME_INVALID: PackShortNameInvalidError,\n PACK_SHORT_NAME_OCCUPIED: PackShortNameOccupiedError,\n PARTICIPANTS_TOO_FEW: ParticipantsTooFewError,\n PARTICIPANT_CALL_FAILED: ParticipantCallFailedError,\n PARTICIPANT_VERSION_OUTDATED: ParticipantVersionOutdatedError,\n PASSWORD_EMPTY: PasswordEmptyError,\n PASSWORD_HASH_INVALID: PasswordHashInvalidError,\n PASSWORD_REQUIRED: PasswordRequiredError,\n PAYMENT_PROVIDER_INVALID: PaymentProviderInvalidError,\n PEER_FLOOD: PeerFloodError,\n PEER_ID_INVALID: PeerIdInvalidError,\n PEER_ID_NOT_SUPPORTED: PeerIdNotSupportedError,\n PERSISTENT_TIMESTAMP_EMPTY: PersistentTimestampEmptyError,\n PERSISTENT_TIMESTAMP_INVALID: PersistentTimestampInvalidError,\n PERSISTENT_TIMESTAMP_OUTDATED: PersistentTimestampOutdatedError,\n PHONE_CODE_EMPTY: PhoneCodeEmptyError,\n PHONE_CODE_EXPIRED: PhoneCodeExpiredError,\n PHONE_CODE_HASH_EMPTY: PhoneCodeHashEmptyError,\n PHONE_CODE_INVALID: PhoneCodeInvalidError,\n PHONE_NUMBER_APP_SIGNUP_FORBIDDEN: PhoneNumberAppSignupForbiddenError,\n PHONE_NUMBER_BANNED: PhoneNumberBannedError,\n PHONE_NUMBER_FLOOD: PhoneNumberFloodError,\n PHONE_NUMBER_INVALID: PhoneNumberInvalidError,\n PHONE_NUMBER_OCCUPIED: PhoneNumberOccupiedError,\n PHONE_NUMBER_UNOCCUPIED: PhoneNumberUnoccupiedError,\n PHONE_PASSWORD_FLOOD: PhonePasswordFloodError,\n PHONE_PASSWORD_PROTECTED: PhonePasswordProtectedError,\n PHOTO_CONTENT_URL_EMPTY: PhotoContentUrlEmptyError,\n PHOTO_CROP_SIZE_SMALL: PhotoCropSizeSmallError,\n PHOTO_EXT_INVALID: PhotoExtInvalidError,\n PHOTO_INVALID: PhotoInvalidError,\n PHOTO_INVALID_DIMENSIONS: PhotoInvalidDimensionsError,\n PHOTO_SAVE_FILE_INVALID: PhotoSaveFileInvalidError,\n PHOTO_THUMB_URL_EMPTY: PhotoThumbUrlEmptyError,\n PIN_RESTRICTED: PinRestrictedError,\n POLL_OPTION_DUPLICATE: PollOptionDuplicateError,\n POLL_UNSUPPORTED: PollUnsupportedError,\n PRIVACY_KEY_INVALID: PrivacyKeyInvalidError,\n PTS_CHANGE_EMPTY: PtsChangeEmptyError,\n QUERY_ID_EMPTY: QueryIdEmptyError,\n QUERY_ID_INVALID: QueryIdInvalidError,\n QUERY_TOO_SHORT: QueryTooShortError,\n RANDOM_ID_DUPLICATE: RandomIdDuplicateError,\n RANDOM_ID_INVALID: RandomIdInvalidError,\n RANDOM_LENGTH_INVALID: RandomLengthInvalidError,\n RANGES_INVALID: RangesInvalidError,\n REACTION_EMPTY: ReactionEmptyError,\n REACTION_INVALID: ReactionInvalidError,\n REG_ID_GENERATE_FAILED: RegIdGenerateFailedError,\n REPLY_MARKUP_INVALID: ReplyMarkupInvalidError,\n REPLY_MARKUP_TOO_LONG: ReplyMarkupTooLongError,\n RESULT_ID_DUPLICATE: ResultIdDuplicateError,\n RESULT_TYPE_INVALID: ResultTypeInvalidError,\n RESULTS_TOO_MUCH: ResultsTooMuchError,\n RIGHT_FORBIDDEN: RightForbiddenError,\n RPC_CALL_FAIL: RpcCallFailError,\n RPC_MCGET_FAIL: RpcMcgetFailError,\n RSA_DECRYPT_FAILED: RsaDecryptFailedError,\n SCHEDULE_DATE_TOO_LATE: ScheduleDateTooLateError,\n SCHEDULE_TOO_MUCH: ScheduleTooMuchError,\n SEARCH_QUERY_EMPTY: SearchQueryEmptyError,\n SECONDS_INVALID: SecondsInvalidError,\n SEND_MESSAGE_MEDIA_INVALID: SendMessageMediaInvalidError,\n SEND_MESSAGE_TYPE_INVALID: SendMessageTypeInvalidError,\n SESSION_EXPIRED: SessionExpiredError,\n SESSION_PASSWORD_NEEDED: SessionPasswordNeededError,\n SESSION_REVOKED: SessionRevokedError,\n SHA256_HASH_INVALID: Sha256HashInvalidError,\n SHORTNAME_OCCUPY_FAILED: ShortnameOccupyFailedError,\n START_PARAM_EMPTY: StartParamEmptyError,\n START_PARAM_INVALID: StartParamInvalidError,\n STICKERSET_INVALID: StickersetInvalidError,\n STICKERS_EMPTY: StickersEmptyError,\n STICKER_EMOJI_INVALID: StickerEmojiInvalidError,\n STICKER_FILE_INVALID: StickerFileInvalidError,\n STICKER_ID_INVALID: StickerIdInvalidError,\n STICKER_INVALID: StickerInvalidError,\n STICKER_PNG_DIMENSIONS: StickerPngDimensionsError,\n STORAGE_CHECK_FAILED: StorageCheckFailedError,\n STORE_INVALID_SCALAR_TYPE: StoreInvalidScalarTypeError,\n TAKEOUT_INVALID: TakeoutInvalidError,\n TAKEOUT_REQUIRED: TakeoutRequiredError,\n TEMP_AUTH_KEY_EMPTY: TempAuthKeyEmptyError,\n Timeout: TimeoutError,\n TMP_PASSWORD_DISABLED: TmpPasswordDisabledError,\n TOKEN_INVALID: TokenInvalidError,\n TTL_DAYS_INVALID: TtlDaysInvalidError,\n TYPES_EMPTY: TypesEmptyError,\n TYPE_CONSTRUCTOR_INVALID: TypeConstructorInvalidError,\n UNKNOWN_METHOD: UnknownMethodError,\n UNTIL_DATE_INVALID: UntilDateInvalidError,\n URL_INVALID: UrlInvalidError,\n USERNAME_INVALID: UsernameInvalidError,\n USERNAME_NOT_MODIFIED: UsernameNotModifiedError,\n USERNAME_NOT_OCCUPIED: UsernameNotOccupiedError,\n USERNAME_OCCUPIED: UsernameOccupiedError,\n USERS_TOO_FEW: UsersTooFewError,\n USERS_TOO_MUCH: UsersTooMuchError,\n USER_ADMIN_INVALID: UserAdminInvalidError,\n USER_ALREADY_PARTICIPANT: UserAlreadyParticipantError,\n USER_BANNED_IN_CHANNEL: UserBannedInChannelError,\n USER_BLOCKED: UserBlockedError,\n USER_BOT: UserBotError,\n USER_BOT_INVALID: UserBotInvalidError,\n USER_BOT_REQUIRED: UserBotRequiredError,\n USER_CHANNELS_TOO_MUCH: UserChannelsTooMuchError,\n USER_CREATOR: UserCreatorError,\n USER_DEACTIVATED: UserDeactivatedError,\n USER_DEACTIVATED_BAN: UserDeactivatedBanError,\n USER_ID_INVALID: UserIdInvalidError,\n USER_INVALID: UserInvalidError,\n USER_IS_BLOCKED: UserIsBlockedError,\n USER_IS_BOT: UserIsBotError,\n USER_KICKED: UserKickedError,\n USER_NOT_MUTUAL_CONTACT: UserNotMutualContactError,\n USER_NOT_PARTICIPANT: UserNotParticipantError,\n USER_PRIVACY_RESTRICTED: UserPrivacyRestrictedError,\n USER_RESTRICTED: UserRestrictedError,\n VIDEO_CONTENT_TYPE_INVALID: VideoContentTypeInvalidError,\n WALLPAPER_FILE_INVALID: WallpaperFileInvalidError,\n WALLPAPER_INVALID: WallpaperInvalidError,\n WC_CONVERT_URL_INVALID: WcConvertUrlInvalidError,\n WEBPAGE_CURL_FAILED: WebpageCurlFailedError,\n WEBPAGE_MEDIA_EMPTY: WebpageMediaEmptyError,\n WORKER_BUSY_TOO_LONG_RETRY: WorkerBusyTooLongRetryError,\n YOU_BLOCKED_USER: YouBlockedUserError\n};\nvar rpcErrorRe = [[/EMAIL_UNCONFIRMED_(\\d+)/, EmailUnconfirmedError], [/FILE_MIGRATE_(\\d+)/, FileMigrateError], [/FILE_PART_(\\d+)_MISSING/, FilePartMissingError], [/FLOOD_TEST_PHONE_WAIT_(\\d+)/, FloodTestPhoneWaitError], [/FLOOD_WAIT_(\\d+)/, FloodWaitError], [/INTERDC_(\\d+)_CALL_ERROR/, InterdcCallErrorError], [/INTERDC_(\\d+)_CALL_RICH_ERROR/, InterdcCallRichErrorError], [/NETWORK_MIGRATE_(\\d+)/, NetworkMigrateError], [/PHONE_MIGRATE_(\\d+)/, PhoneMigrateError], [/SLOWMODE_WAIT_(\\d+)/, SlowModeWaitError], [/TAKEOUT_INIT_DELAY_(\\d+)/, TakeoutInitDelayError], [/USER_MIGRATE_(\\d+)/, UserMigrateError]];\nmodule.exports = {\n EmailUnconfirmedError: EmailUnconfirmedError,\n FileMigrateError: FileMigrateError,\n FilePartMissingError: FilePartMissingError,\n FloodTestPhoneWaitError: FloodTestPhoneWaitError,\n FloodWaitError: FloodWaitError,\n InterdcCallErrorError: InterdcCallErrorError,\n InterdcCallRichErrorError: InterdcCallRichErrorError,\n NetworkMigrateError: NetworkMigrateError,\n PhoneMigrateError: PhoneMigrateError,\n SlowModeWaitError: SlowModeWaitError,\n TakeoutInitDelayError: TakeoutInitDelayError,\n UserMigrateError: UserMigrateError,\n AboutTooLongError: AboutTooLongError,\n AccessTokenExpiredError: AccessTokenExpiredError,\n AccessTokenInvalidError: AccessTokenInvalidError,\n ActiveUserRequiredError: ActiveUserRequiredError,\n AdminsTooMuchError: AdminsTooMuchError,\n AdminRankEmojiNotAllowedError: AdminRankEmojiNotAllowedError,\n AdminRankInvalidError: AdminRankInvalidError,\n ApiIdInvalidError: ApiIdInvalidError,\n ApiIdPublishedFloodError: ApiIdPublishedFloodError,\n ArticleTitleEmptyError: ArticleTitleEmptyError,\n AuthBytesInvalidError: AuthBytesInvalidError,\n AuthKeyDuplicatedError: AuthKeyDuplicatedError,\n AuthKeyInvalidError: AuthKeyInvalidError,\n AuthKeyPermEmptyError: AuthKeyPermEmptyError,\n AuthKeyUnregisteredError: AuthKeyUnregisteredError,\n AuthRestartError: AuthRestartError,\n BannedRightsInvalidError: BannedRightsInvalidError,\n BotsTooMuchError: BotsTooMuchError,\n BotChannelsNaError: BotChannelsNaError,\n BotGroupsBlockedError: BotGroupsBlockedError,\n BotInlineDisabledError: BotInlineDisabledError,\n BotInvalidError: BotInvalidError,\n BotMethodInvalidError: BotMethodInvalidError,\n BotMissingError: BotMissingError,\n BotPaymentsDisabledError: BotPaymentsDisabledError,\n BotPollsDisabledError: BotPollsDisabledError,\n BroadcastIdInvalidError: BroadcastIdInvalidError,\n ButtonDataInvalidError: ButtonDataInvalidError,\n ButtonTypeInvalidError: ButtonTypeInvalidError,\n ButtonUrlInvalidError: ButtonUrlInvalidError,\n CallAlreadyAcceptedError: CallAlreadyAcceptedError,\n CallAlreadyDeclinedError: CallAlreadyDeclinedError,\n CallOccupyFailedError: CallOccupyFailedError,\n CallPeerInvalidError: CallPeerInvalidError,\n CallProtocolFlagsInvalidError: CallProtocolFlagsInvalidError,\n CdnMethodInvalidError: CdnMethodInvalidError,\n ChannelsAdminPublicTooMuchError: ChannelsAdminPublicTooMuchError,\n ChannelsTooMuchError: ChannelsTooMuchError,\n ChannelInvalidError: ChannelInvalidError,\n ChannelPrivateError: ChannelPrivateError,\n ChannelPublicGroupNaError: ChannelPublicGroupNaError,\n ChatAboutNotModifiedError: ChatAboutNotModifiedError,\n ChatAboutTooLongError: ChatAboutTooLongError,\n ChatAdminInviteRequiredError: ChatAdminInviteRequiredError,\n ChatAdminRequiredError: ChatAdminRequiredError,\n ChatForbiddenError: ChatForbiddenError,\n ChatIdEmptyError: ChatIdEmptyError,\n ChatIdInvalidError: ChatIdInvalidError,\n ChatInvalidError: ChatInvalidError,\n ChatLinkExistsError: ChatLinkExistsError,\n ChatNotModifiedError: ChatNotModifiedError,\n ChatRestrictedError: ChatRestrictedError,\n ChatSendGifsForbiddenError: ChatSendGifsForbiddenError,\n ChatSendInlineForbiddenError: ChatSendInlineForbiddenError,\n ChatSendMediaForbiddenError: ChatSendMediaForbiddenError,\n ChatSendStickersForbiddenError: ChatSendStickersForbiddenError,\n ChatTitleEmptyError: ChatTitleEmptyError,\n ChatWriteForbiddenError: ChatWriteForbiddenError,\n CodeEmptyError: CodeEmptyError,\n CodeHashInvalidError: CodeHashInvalidError,\n CodeInvalidError: CodeInvalidError,\n ConnectionApiIdInvalidError: ConnectionApiIdInvalidError,\n ConnectionDeviceModelEmptyError: ConnectionDeviceModelEmptyError,\n ConnectionLangPackInvalidError: ConnectionLangPackInvalidError,\n ConnectionLayerInvalidError: ConnectionLayerInvalidError,\n ConnectionNotInitedError: ConnectionNotInitedError,\n ConnectionSystemEmptyError: ConnectionSystemEmptyError,\n ContactIdInvalidError: ContactIdInvalidError,\n DataInvalidError: DataInvalidError,\n DataJsonInvalidError: DataJsonInvalidError,\n DateEmptyError: DateEmptyError,\n DcIdInvalidError: DcIdInvalidError,\n DhGAInvalidError: DhGAInvalidError,\n EmailHashExpiredError: EmailHashExpiredError,\n EmailInvalidError: EmailInvalidError,\n EmoticonEmptyError: EmoticonEmptyError,\n EncryptedMessageInvalidError: EncryptedMessageInvalidError,\n EncryptionAlreadyAcceptedError: EncryptionAlreadyAcceptedError,\n EncryptionAlreadyDeclinedError: EncryptionAlreadyDeclinedError,\n EncryptionDeclinedError: EncryptionDeclinedError,\n EncryptionIdInvalidError: EncryptionIdInvalidError,\n EncryptionOccupyFailedError: EncryptionOccupyFailedError,\n EntitiesTooLongError: EntitiesTooLongError,\n EntityMentionUserInvalidError: EntityMentionUserInvalidError,\n ErrorTextEmptyError: ErrorTextEmptyError,\n ExportCardInvalidError: ExportCardInvalidError,\n ExternalUrlInvalidError: ExternalUrlInvalidError,\n FieldNameEmptyError: FieldNameEmptyError,\n FieldNameInvalidError: FieldNameInvalidError,\n FileIdInvalidError: FileIdInvalidError,\n FilePartsInvalidError: FilePartsInvalidError,\n FilePart0MissingError: FilePart0MissingError,\n FilePartEmptyError: FilePartEmptyError,\n FilePartInvalidError: FilePartInvalidError,\n FilePartLengthInvalidError: FilePartLengthInvalidError,\n FilePartSizeInvalidError: FilePartSizeInvalidError,\n FilerefUpgradeNeededError: FilerefUpgradeNeededError,\n FirstNameInvalidError: FirstNameInvalidError,\n FolderIdEmptyError: FolderIdEmptyError,\n FolderIdInvalidError: FolderIdInvalidError,\n FreshResetAuthorisationForbiddenError: FreshResetAuthorisationForbiddenError,\n GifIdInvalidError: GifIdInvalidError,\n GroupedMediaInvalidError: GroupedMediaInvalidError,\n HashInvalidError: HashInvalidError,\n HistoryGetFailedError: HistoryGetFailedError,\n ImageProcessFailedError: ImageProcessFailedError,\n InlineResultExpiredError: InlineResultExpiredError,\n InputConstructorInvalidError: InputConstructorInvalidError,\n InputFetchErrorError: InputFetchErrorError,\n InputFetchFailError: InputFetchFailError,\n InputLayerInvalidError: InputLayerInvalidError,\n InputMethodInvalidError: InputMethodInvalidError,\n InputRequestTooLongError: InputRequestTooLongError,\n InputUserDeactivatedError: InputUserDeactivatedError,\n InviteHashEmptyError: InviteHashEmptyError,\n InviteHashExpiredError: InviteHashExpiredError,\n InviteHashInvalidError: InviteHashInvalidError,\n LangPackInvalidError: LangPackInvalidError,\n LastnameInvalidError: LastnameInvalidError,\n LimitInvalidError: LimitInvalidError,\n LinkNotModifiedError: LinkNotModifiedError,\n LocationInvalidError: LocationInvalidError,\n MaxIdInvalidError: MaxIdInvalidError,\n MaxQtsInvalidError: MaxQtsInvalidError,\n Md5ChecksumInvalidError: Md5ChecksumInvalidError,\n MediaCaptionTooLongError: MediaCaptionTooLongError,\n MediaEmptyError: MediaEmptyError,\n MediaInvalidError: MediaInvalidError,\n MediaNewInvalidError: MediaNewInvalidError,\n MediaPrevInvalidError: MediaPrevInvalidError,\n MegagroupIdInvalidError: MegagroupIdInvalidError,\n MegagroupPrehistoryHiddenError: MegagroupPrehistoryHiddenError,\n MemberNoLocationError: MemberNoLocationError,\n MemberOccupyPrimaryLocFailedError: MemberOccupyPrimaryLocFailedError,\n MessageAuthorRequiredError: MessageAuthorRequiredError,\n MessageDeleteForbiddenError: MessageDeleteForbiddenError,\n MessageEditTimeExpiredError: MessageEditTimeExpiredError,\n MessageEmptyError: MessageEmptyError,\n MessageIdsEmptyError: MessageIdsEmptyError,\n MessageIdInvalidError: MessageIdInvalidError,\n MessageNotModifiedError: MessageNotModifiedError,\n MessageTooLongError: MessageTooLongError,\n MsgWaitFailedError: MsgWaitFailedError,\n MtSendQueueTooLongError: MtSendQueueTooLongError,\n NeedChatInvalidError: NeedChatInvalidError,\n NeedMemberInvalidError: NeedMemberInvalidError,\n NewSaltInvalidError: NewSaltInvalidError,\n NewSettingsInvalidError: NewSettingsInvalidError,\n OffsetInvalidError: OffsetInvalidError,\n OffsetPeerIdInvalidError: OffsetPeerIdInvalidError,\n OptionsTooMuchError: OptionsTooMuchError,\n PackShortNameInvalidError: PackShortNameInvalidError,\n PackShortNameOccupiedError: PackShortNameOccupiedError,\n ParticipantsTooFewError: ParticipantsTooFewError,\n ParticipantCallFailedError: ParticipantCallFailedError,\n ParticipantVersionOutdatedError: ParticipantVersionOutdatedError,\n PasswordEmptyError: PasswordEmptyError,\n PasswordHashInvalidError: PasswordHashInvalidError,\n PasswordRequiredError: PasswordRequiredError,\n PaymentProviderInvalidError: PaymentProviderInvalidError,\n PeerFloodError: PeerFloodError,\n PeerIdInvalidError: PeerIdInvalidError,\n PeerIdNotSupportedError: PeerIdNotSupportedError,\n PersistentTimestampEmptyError: PersistentTimestampEmptyError,\n PersistentTimestampInvalidError: PersistentTimestampInvalidError,\n PersistentTimestampOutdatedError: PersistentTimestampOutdatedError,\n PhoneCodeEmptyError: PhoneCodeEmptyError,\n PhoneCodeExpiredError: PhoneCodeExpiredError,\n PhoneCodeHashEmptyError: PhoneCodeHashEmptyError,\n PhoneCodeInvalidError: PhoneCodeInvalidError,\n PhoneNumberAppSignupForbiddenError: PhoneNumberAppSignupForbiddenError,\n PhoneNumberBannedError: PhoneNumberBannedError,\n PhoneNumberFloodError: PhoneNumberFloodError,\n PhoneNumberInvalidError: PhoneNumberInvalidError,\n PhoneNumberOccupiedError: PhoneNumberOccupiedError,\n PhoneNumberUnoccupiedError: PhoneNumberUnoccupiedError,\n PhonePasswordFloodError: PhonePasswordFloodError,\n PhonePasswordProtectedError: PhonePasswordProtectedError,\n PhotoContentUrlEmptyError: PhotoContentUrlEmptyError,\n PhotoCropSizeSmallError: PhotoCropSizeSmallError,\n PhotoExtInvalidError: PhotoExtInvalidError,\n PhotoInvalidError: PhotoInvalidError,\n PhotoInvalidDimensionsError: PhotoInvalidDimensionsError,\n PhotoSaveFileInvalidError: PhotoSaveFileInvalidError,\n PhotoThumbUrlEmptyError: PhotoThumbUrlEmptyError,\n PinRestrictedError: PinRestrictedError,\n PollOptionDuplicateError: PollOptionDuplicateError,\n PollUnsupportedError: PollUnsupportedError,\n PrivacyKeyInvalidError: PrivacyKeyInvalidError,\n PtsChangeEmptyError: PtsChangeEmptyError,\n QueryIdEmptyError: QueryIdEmptyError,\n QueryIdInvalidError: QueryIdInvalidError,\n QueryTooShortError: QueryTooShortError,\n RandomIdDuplicateError: RandomIdDuplicateError,\n RandomIdInvalidError: RandomIdInvalidError,\n RandomLengthInvalidError: RandomLengthInvalidError,\n RangesInvalidError: RangesInvalidError,\n ReactionEmptyError: ReactionEmptyError,\n ReactionInvalidError: ReactionInvalidError,\n RegIdGenerateFailedError: RegIdGenerateFailedError,\n ReplyMarkupInvalidError: ReplyMarkupInvalidError,\n ReplyMarkupTooLongError: ReplyMarkupTooLongError,\n ResultIdDuplicateError: ResultIdDuplicateError,\n ResultTypeInvalidError: ResultTypeInvalidError,\n ResultsTooMuchError: ResultsTooMuchError,\n RightForbiddenError: RightForbiddenError,\n RpcCallFailError: RpcCallFailError,\n RpcMcgetFailError: RpcMcgetFailError,\n RsaDecryptFailedError: RsaDecryptFailedError,\n ScheduleDateTooLateError: ScheduleDateTooLateError,\n ScheduleTooMuchError: ScheduleTooMuchError,\n SearchQueryEmptyError: SearchQueryEmptyError,\n SecondsInvalidError: SecondsInvalidError,\n SendMessageMediaInvalidError: SendMessageMediaInvalidError,\n SendMessageTypeInvalidError: SendMessageTypeInvalidError,\n SessionExpiredError: SessionExpiredError,\n SessionPasswordNeededError: SessionPasswordNeededError,\n SessionRevokedError: SessionRevokedError,\n Sha256HashInvalidError: Sha256HashInvalidError,\n ShortnameOccupyFailedError: ShortnameOccupyFailedError,\n StartParamEmptyError: StartParamEmptyError,\n StartParamInvalidError: StartParamInvalidError,\n StickersetInvalidError: StickersetInvalidError,\n StickersEmptyError: StickersEmptyError,\n StickerEmojiInvalidError: StickerEmojiInvalidError,\n StickerFileInvalidError: StickerFileInvalidError,\n StickerIdInvalidError: StickerIdInvalidError,\n StickerInvalidError: StickerInvalidError,\n StickerPngDimensionsError: StickerPngDimensionsError,\n StorageCheckFailedError: StorageCheckFailedError,\n StoreInvalidScalarTypeError: StoreInvalidScalarTypeError,\n TakeoutInvalidError: TakeoutInvalidError,\n TakeoutRequiredError: TakeoutRequiredError,\n TempAuthKeyEmptyError: TempAuthKeyEmptyError,\n TimeoutError: TimeoutError,\n TmpPasswordDisabledError: TmpPasswordDisabledError,\n TokenInvalidError: TokenInvalidError,\n TtlDaysInvalidError: TtlDaysInvalidError,\n TypesEmptyError: TypesEmptyError,\n TypeConstructorInvalidError: TypeConstructorInvalidError,\n UnknownMethodError: UnknownMethodError,\n UntilDateInvalidError: UntilDateInvalidError,\n UrlInvalidError: UrlInvalidError,\n UsernameInvalidError: UsernameInvalidError,\n UsernameNotModifiedError: UsernameNotModifiedError,\n UsernameNotOccupiedError: UsernameNotOccupiedError,\n UsernameOccupiedError: UsernameOccupiedError,\n UsersTooFewError: UsersTooFewError,\n UsersTooMuchError: UsersTooMuchError,\n UserAdminInvalidError: UserAdminInvalidError,\n UserAlreadyParticipantError: UserAlreadyParticipantError,\n UserBannedInChannelError: UserBannedInChannelError,\n UserBlockedError: UserBlockedError,\n UserBotError: UserBotError,\n UserBotInvalidError: UserBotInvalidError,\n UserBotRequiredError: UserBotRequiredError,\n UserChannelsTooMuchError: UserChannelsTooMuchError,\n UserCreatorError: UserCreatorError,\n UserDeactivatedError: UserDeactivatedError,\n UserDeactivatedBanError: UserDeactivatedBanError,\n UserIdInvalidError: UserIdInvalidError,\n UserInvalidError: UserInvalidError,\n UserIsBlockedError: UserIsBlockedError,\n UserIsBotError: UserIsBotError,\n UserKickedError: UserKickedError,\n UserNotMutualContactError: UserNotMutualContactError,\n UserNotParticipantError: UserNotParticipantError,\n UserPrivacyRestrictedError: UserPrivacyRestrictedError,\n UserRestrictedError: UserRestrictedError,\n VideoContentTypeInvalidError: VideoContentTypeInvalidError,\n WallpaperFileInvalidError: WallpaperFileInvalidError,\n WallpaperInvalidError: WallpaperInvalidError,\n WcConvertUrlInvalidError: WcConvertUrlInvalidError,\n WebpageCurlFailedError: WebpageCurlFailedError,\n WebpageMediaEmptyError: WebpageMediaEmptyError,\n WorkerBusyTooLongRetryError: WorkerBusyTooLongRetryError,\n YouBlockedUserError: YouBlockedUserError,\n rpcErrorsObject: rpcErrorsObject,\n rpcErrorRe: rpcErrorRe\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/errors/RPCErrorList.js?"); /***/ }), /***/ "./gramjs/errors/index.js": /*!********************************!*\ !*** ./gramjs/errors/index.js ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(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; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n/**\n * Converts a Telegram's RPC Error to a Python error.\n * @param rpcError the RPCError instance\n * @param request the request that caused this error\n * @constructor the RPCError as a Python exception that represents this error\n */\nvar _require = __webpack_require__(/*! ./RPCErrorList */ \"./gramjs/errors/RPCErrorList.js\"),\n rpcErrorsObject = _require.rpcErrorsObject,\n rpcErrorRe = _require.rpcErrorRe;\n\nfunction RPCMessageToError(rpcError, request) {\n // Try to get the error by direct look-up, otherwise regex\n var cls = rpcErrorsObject[rpcError.errorMessage];\n\n if (cls) {\n // eslint-disable-next-line new-cap\n return new cls({\n request: request\n });\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = rpcErrorRe[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _slicedToArray(_step.value, 2),\n msgRegex = _step$value[0],\n Cls = _step$value[1];\n\n var m = rpcError.errorMessage.match(msgRegex);\n\n if (m) {\n var capture = m.length === 2 ? parseInt(m[1]) : null;\n return new Cls({\n request: request,\n capture: capture\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nmodule.exports = _objectSpread({\n RPCMessageToError: RPCMessageToError\n}, __webpack_require__(/*! ./Common */ \"./gramjs/errors/Common.js\"), {}, __webpack_require__(/*! ./RPCBaseErrors */ \"./gramjs/errors/RPCBaseErrors.js\"), {}, __webpack_require__(/*! ./RPCErrorList */ \"./gramjs/errors/RPCErrorList.js\"));\n\n//# sourceURL=webpack://gramjs/./gramjs/errors/index.js?"); /***/ }), /***/ "./gramjs/errors/rpcbaseerrors.js": /*!****************************************!*\ !*** ./gramjs/errors/rpcbaseerrors.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function _defineProperty(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; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Base class for all Remote Procedure Call errors.\n */\nvar RPCError =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(RPCError, _Error);\n\n function RPCError(request, message) {\n var _this;\n\n var code = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n _classCallCheck(this, RPCError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RPCError).call(this, 'RPCError {0}: {1}{2}'.replace('{0}', code).replace('{1}', message).replace('{2}', RPCError._fmtRequest(request))));\n _this.code = code;\n _this.message = message;\n return _this;\n }\n\n _createClass(RPCError, null, [{\n key: \"_fmtRequest\",\n value: function _fmtRequest(request) {\n // TODO fix this\n return \" (caused by \".concat(request.constructor.name, \")\");\n }\n }]);\n\n return RPCError;\n}(_wrapNativeSuper(Error));\n/**\n * The request must be repeated, but directed to a different data center.\n */\n\n\nvar InvalidDCError =\n/*#__PURE__*/\nfunction (_RPCError) {\n _inherits(InvalidDCError, _RPCError);\n\n function InvalidDCError(request, message, code) {\n var _this2;\n\n _classCallCheck(this, InvalidDCError);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(InvalidDCError).call(this, request, message, code));\n _this2.code = code || 303;\n _this2.message = message || 'ERROR_SEE_OTHER';\n return _this2;\n }\n\n return InvalidDCError;\n}(RPCError);\n/**\n * The query contains errors. In the event that a request was created\n * using a form and contains user generated data, the user should be\n * notified that the data must be corrected before the query is repeated.\n */\n\n\nvar BadRequestError =\n/*#__PURE__*/\nfunction (_RPCError2) {\n _inherits(BadRequestError, _RPCError2);\n\n function BadRequestError() {\n var _getPrototypeOf2;\n\n var _this3;\n\n _classCallCheck(this, BadRequestError);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this3 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(BadRequestError)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this3), \"code\", 400);\n\n _defineProperty(_assertThisInitialized(_this3), \"message\", 'BAD_REQUEST');\n\n return _this3;\n }\n\n return BadRequestError;\n}(RPCError);\n/**\n * There was an unauthorized attempt to use functionality available only\n * to authorized users.\n */\n\n\nvar UnauthorizedError =\n/*#__PURE__*/\nfunction (_RPCError3) {\n _inherits(UnauthorizedError, _RPCError3);\n\n function UnauthorizedError() {\n var _getPrototypeOf3;\n\n var _this4;\n\n _classCallCheck(this, UnauthorizedError);\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this4 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(UnauthorizedError)).call.apply(_getPrototypeOf3, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this4), \"code\", 401);\n\n _defineProperty(_assertThisInitialized(_this4), \"message\", 'UNAUTHORIZED');\n\n return _this4;\n }\n\n return UnauthorizedError;\n}(RPCError);\n/**\n * Privacy violation. For example, an attempt to write a message to\n * someone who has blacklisted the current user.\n */\n\n\nvar ForbiddenError =\n/*#__PURE__*/\nfunction (_RPCError4) {\n _inherits(ForbiddenError, _RPCError4);\n\n function ForbiddenError() {\n var _getPrototypeOf4;\n\n var _this5;\n\n _classCallCheck(this, ForbiddenError);\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n _this5 = _possibleConstructorReturn(this, (_getPrototypeOf4 = _getPrototypeOf(ForbiddenError)).call.apply(_getPrototypeOf4, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this5), \"code\", 403);\n\n _defineProperty(_assertThisInitialized(_this5), \"message\", 'FORBIDDEN');\n\n return _this5;\n }\n\n return ForbiddenError;\n}(RPCError);\n/**\n * An attempt to invoke a non-existent object, such as a method.\n */\n\n\nvar NotFoundError =\n/*#__PURE__*/\nfunction (_RPCError5) {\n _inherits(NotFoundError, _RPCError5);\n\n function NotFoundError() {\n var _getPrototypeOf5;\n\n var _this6;\n\n _classCallCheck(this, NotFoundError);\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n _this6 = _possibleConstructorReturn(this, (_getPrototypeOf5 = _getPrototypeOf(NotFoundError)).call.apply(_getPrototypeOf5, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this6), \"code\", 404);\n\n _defineProperty(_assertThisInitialized(_this6), \"message\", 'NOT_FOUND');\n\n return _this6;\n }\n\n return NotFoundError;\n}(RPCError);\n/**\n * Errors related to invalid authorization key, like\n * AUTH_KEY_DUPLICATED which can cause the connection to fail.\n */\n\n\nvar AuthKeyError =\n/*#__PURE__*/\nfunction (_RPCError6) {\n _inherits(AuthKeyError, _RPCError6);\n\n function AuthKeyError() {\n var _getPrototypeOf6;\n\n var _this7;\n\n _classCallCheck(this, AuthKeyError);\n\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n _this7 = _possibleConstructorReturn(this, (_getPrototypeOf6 = _getPrototypeOf(AuthKeyError)).call.apply(_getPrototypeOf6, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this7), \"code\", 406);\n\n _defineProperty(_assertThisInitialized(_this7), \"message\", 'AUTH_KEY');\n\n return _this7;\n }\n\n return AuthKeyError;\n}(RPCError);\n/**\n * The maximum allowed number of attempts to invoke the given method\n * with the given input parameters has been exceeded. For example, in an\n * attempt to request a large number of text messages (SMS) for the same\n * phone number.\n */\n\n\nvar FloodError =\n/*#__PURE__*/\nfunction (_RPCError7) {\n _inherits(FloodError, _RPCError7);\n\n function FloodError() {\n var _getPrototypeOf7;\n\n var _this8;\n\n _classCallCheck(this, FloodError);\n\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n _this8 = _possibleConstructorReturn(this, (_getPrototypeOf7 = _getPrototypeOf(FloodError)).call.apply(_getPrototypeOf7, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this8), \"code\", 420);\n\n _defineProperty(_assertThisInitialized(_this8), \"message\", 'FLOOD');\n\n return _this8;\n }\n\n return FloodError;\n}(RPCError);\n/**\n * An internal server error occurred while a request was being processed\n * for example, there was a disruption while accessing a database or file\n * storage\n */\n\n\nvar ServerError =\n/*#__PURE__*/\nfunction (_RPCError8) {\n _inherits(ServerError, _RPCError8);\n\n function ServerError() {\n var _getPrototypeOf8;\n\n var _this9;\n\n _classCallCheck(this, ServerError);\n\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n _this9 = _possibleConstructorReturn(this, (_getPrototypeOf8 = _getPrototypeOf(ServerError)).call.apply(_getPrototypeOf8, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this9), \"code\", 500);\n\n _defineProperty(_assertThisInitialized(_this9), \"message\", 'INTERNAL');\n\n return _this9;\n }\n\n return ServerError;\n}(RPCError);\n/**\n * Clicking the inline buttons of bots that never (or take to long to)\n * call ``answerCallbackQuery`` will result in this \"special\" RPCError.\n */\n\n\nvar TimedOutError =\n/*#__PURE__*/\nfunction (_RPCError9) {\n _inherits(TimedOutError, _RPCError9);\n\n function TimedOutError() {\n var _getPrototypeOf9;\n\n var _this10;\n\n _classCallCheck(this, TimedOutError);\n\n for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n args[_key8] = arguments[_key8];\n }\n\n _this10 = _possibleConstructorReturn(this, (_getPrototypeOf9 = _getPrototypeOf(TimedOutError)).call.apply(_getPrototypeOf9, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this10), \"code\", 503);\n\n _defineProperty(_assertThisInitialized(_this10), \"message\", 'Timeout');\n\n return _this10;\n }\n\n return TimedOutError;\n}(RPCError);\n\nmodule.exports = {\n RPCError: RPCError,\n InvalidDCError: InvalidDCError,\n BadRequestError: BadRequestError,\n UnauthorizedError: UnauthorizedError,\n ForbiddenError: ForbiddenError,\n NotFoundError: NotFoundError,\n AuthKeyError: AuthKeyError,\n FloodError: FloodError,\n ServerError: ServerError,\n TimedOutError: TimedOutError\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/errors/rpcbaseerrors.js?"); /***/ }), /***/ "./gramjs/events/NewMessage.js": /*!*************************************!*\ !*** ./gramjs/events/NewMessage.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = __webpack_require__(/*! ./common */ \"./gramjs/events/common.js\"),\n EventBuilder = _require.EventBuilder,\n EventCommon = _require.EventCommon;\n\nvar _require2 = __webpack_require__(/*! ../tl */ \"./gramjs/tl/index.js\"),\n types = _require2.types;\n\nvar NewMessage =\n/*#__PURE__*/\nfunction (_EventBuilder) {\n _inherits(NewMessage, _EventBuilder);\n\n function NewMessage() {\n var _this;\n\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n chats: null,\n func: null\n };\n\n _classCallCheck(this, NewMessage);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewMessage).call(this, args));\n _this.chats = args.chats;\n _this.func = args.func;\n _this._noCheck = true;\n return _this;\n }\n\n _createClass(NewMessage, [{\n key: \"_resolve\",\n value: function _resolve(client) {\n return regeneratorRuntime.async(function _resolve$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return regeneratorRuntime.awrap(_get(_getPrototypeOf(NewMessage.prototype), \"_resolve\", this).call(this, client));\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"build\",\n value: function build(update) {\n var others = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var thisId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var event;\n\n if (update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewChannelMessage) {\n if (!(update.message instanceof types.Message)) {\n return;\n }\n\n event = new Event(update.message);\n } else if (update instanceof types.UpdateShortMessage) {\n event = new Event(new types.Message({\n out: update.out,\n mentioned: update.mentioned,\n mediaUnread: update.mediaUnread,\n silent: update.silent,\n id: update.id,\n // Note that to_id/from_id complement each other in private\n // messages, depending on whether the message was outgoing.\n toId: new types.PeerUser(update.out ? update.userId : thisId),\n fromId: update.out ? thisId : update.userId,\n message: update.message,\n date: update.date,\n fwdFrom: update.fwdFrom,\n viaBotId: update.viaBotId,\n replyToMsgId: update.replyToMsgId,\n entities: update.entities\n }));\n } else if (update instanceof types.UpdateShortChatMessage) {\n event = new this.Event(new types.Message({\n out: update.out,\n mentioned: update.mentioned,\n mediaUnread: update.mediaUnread,\n silent: update.silent,\n id: update.id,\n toId: new types.PeerChat(update.chatId),\n fromId: update.fromId,\n message: update.message,\n date: update.date,\n fwdFrom: update.fwdFrom,\n viaBotId: update.viaBotId,\n replyToMsgId: update.replyToMsgId,\n entities: update.entities\n }));\n } else {\n return;\n } // Make messages sent to ourselves outgoing unless they're forwarded.\n // This makes it consistent with official client's appearance.\n\n\n var ori = event.message;\n\n if (ori.toId instanceof types.PeerUser) {\n if (ori.fromId === ori.toId.userId && !ori.fwdFrom) {\n event.message.out = true;\n }\n }\n\n return event;\n }\n }, {\n key: \"filter\",\n value: function filter(event) {\n if (this._noCheck) {\n return event;\n }\n\n return event;\n }\n }]);\n\n return NewMessage;\n}(EventBuilder);\n\nvar Event =\n/*#__PURE__*/\nfunction (_EventCommon) {\n _inherits(Event, _EventCommon);\n\n function Event(message) {\n var _this2;\n\n _classCallCheck(this, Event);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(Event).call(this));\n _this2.message = message;\n return _this2;\n }\n\n return Event;\n}(EventCommon);\n\nmodule.exports = NewMessage;\n\n//# sourceURL=webpack://gramjs/./gramjs/events/NewMessage.js?"); /***/ }), /***/ "./gramjs/events/Raw.js": /*!******************************!*\ !*** ./gramjs/events/Raw.js ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = __webpack_require__(/*! ./common */ \"./gramjs/events/common.js\"),\n EventBuilder = _require.EventBuilder;\n\nvar Raw =\n/*#__PURE__*/\nfunction (_EventBuilder) {\n _inherits(Raw, _EventBuilder);\n\n function Raw() {\n var _this;\n\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n types: null,\n func: null\n };\n\n _classCallCheck(this, Raw);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Raw).call(this));\n\n if (!args.types) {\n _this.types = true;\n } else {\n _this.types = args.types;\n }\n\n return _this;\n }\n\n _createClass(Raw, [{\n key: \"build\",\n value: function build(update) {\n var others = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n return update;\n }\n }]);\n\n return Raw;\n}(EventBuilder);\n\nmodule.exports = Raw;\n\n//# sourceURL=webpack://gramjs/./gramjs/events/Raw.js?"); /***/ }), /***/ "./gramjs/events/common.js": /*!*********************************!*\ !*** ./gramjs/events/common.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar EventBuilder =\n/*#__PURE__*/\nfunction () {\n function EventBuilder() {\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n chats: null,\n blacklistChats: null,\n func: null\n };\n\n _classCallCheck(this, EventBuilder);\n\n this.chats = args.chats;\n this.blacklistChats = Boolean(args.blacklistChats);\n this.resolved = false;\n this.func = args.func;\n }\n\n _createClass(EventBuilder, [{\n key: \"build\",\n value: function build(update) {\n var others = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n }\n }]);\n\n return EventBuilder;\n}();\n\nvar EventCommon = function EventCommon() {\n _classCallCheck(this, EventCommon);\n};\n\nmodule.exports = {\n EventBuilder: EventBuilder,\n EventCommon: EventCommon\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/events/common.js?"); /***/ }), /***/ "./gramjs/events/index.js": /*!********************************!*\ !*** ./gramjs/events/index.js ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar NewMessage = __webpack_require__(/*! ./NewMessage */ \"./gramjs/events/NewMessage.js\");\n\nvar Raw = __webpack_require__(/*! ./Raw */ \"./gramjs/events/Raw.js\");\n\nvar StopPropagation =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(StopPropagation, _Error);\n\n function StopPropagation() {\n _classCallCheck(this, StopPropagation);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(StopPropagation).apply(this, arguments));\n }\n\n return StopPropagation;\n}(_wrapNativeSuper(Error));\n\nmodule.exports = {\n NewMessage: NewMessage,\n StopPropagation: StopPropagation,\n Raw: Raw\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/events/index.js?"); /***/ }), /***/ "./gramjs/extensions/AsyncQueue.js": /*!*****************************************!*\ !*** ./gramjs/extensions/AsyncQueue.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar AsyncQueue =\n/*#__PURE__*/\nfunction () {\n function AsyncQueue() {\n var _this = this;\n\n _classCallCheck(this, AsyncQueue);\n\n this._queue = [];\n this.canGet = new Promise(function (resolve) {\n _this.resolveGet = resolve;\n });\n this.canPush = true;\n }\n\n _createClass(AsyncQueue, [{\n key: \"push\",\n value: function push(value) {\n var _this2 = this;\n\n return regeneratorRuntime.async(function push$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return regeneratorRuntime.awrap(this.canPush);\n\n case 2:\n this._queue.push(value);\n\n this.resolveGet(true);\n this.canPush = new Promise(function (resolve) {\n _this2.resolvePush = resolve;\n });\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"pop\",\n value: function pop() {\n var _this3 = this;\n\n var returned;\n return regeneratorRuntime.async(function pop$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return regeneratorRuntime.awrap(this.canGet);\n\n case 2:\n returned = this._queue.pop();\n this.resolvePush(true);\n this.canGet = new Promise(function (resolve) {\n _this3.resolveGet = resolve;\n });\n return _context2.abrupt(\"return\", returned);\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, null, this);\n }\n }]);\n\n return AsyncQueue;\n}();\n\nmodule.exports = AsyncQueue;\n\n//# sourceURL=webpack://gramjs/./gramjs/extensions/AsyncQueue.js?"); /***/ }), /***/ "./gramjs/extensions/BinaryReader.js": /*!*******************************************!*\ !*** ./gramjs/extensions/BinaryReader.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar _require = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\"),\n unpack = _require.unpack;\n\nvar _require2 = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n TypeNotFoundError = _require2.TypeNotFoundError;\n\nvar _require3 = __webpack_require__(/*! ../tl/core */ \"./gramjs/tl/core/index.js\"),\n coreObjects = _require3.coreObjects;\n\nvar _require4 = __webpack_require__(/*! ../tl/AllTLObjects */ \"./gramjs/tl/AllTLObjects.js\"),\n tlobjects = _require4.tlobjects;\n\nvar _require5 = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n readBigIntFromBuffer = _require5.readBigIntFromBuffer;\n\nvar BinaryReader =\n/*#__PURE__*/\nfunction () {\n /**\n * Small utility class to read binary data.\n * @param data {Buffer}\n */\n function BinaryReader(data) {\n _classCallCheck(this, BinaryReader);\n\n this.stream = data;\n this._last = null;\n this.offset = 0;\n } // region Reading\n // \"All numbers are written as little endian.\"\n // https://core.telegram.org/mtproto\n\n /**\n * Reads a single byte value.\n */\n\n\n _createClass(BinaryReader, [{\n key: \"readByte\",\n value: function readByte() {\n return this.read(1)[0];\n }\n /**\n * Reads an integer (4 bytes or 32 bits) value.\n * @param signed {Boolean}\n */\n\n }, {\n key: \"readInt\",\n value: function readInt() {\n var signed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var res;\n\n if (signed) {\n res = this.stream.readInt32LE(this.offset);\n } else {\n res = this.stream.readUInt32LE(this.offset);\n }\n\n this.offset += 4;\n return res;\n }\n /**\n * Reads a long integer (8 bytes or 64 bits) value.\n * @param signed\n * @returns {bigint}\n */\n\n }, {\n key: \"readLong\",\n value: function readLong() {\n var signed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n return this.readLargeInt(64, signed);\n }\n /**\n * Reads a real floating point (4 bytes) value.\n * @returns {number}\n */\n\n }, {\n key: \"readFloat\",\n value: function readFloat() {\n return unpack(' 1 && arguments[1] !== undefined ? arguments[1] : true;\n var buffer = this.read(Math.floor(bits / 8));\n return readBigIntFromBuffer(buffer, true, signed);\n }\n /**\n * Read the given amount of bytes, or -1 to read all remaining.\n * @param length {number}\n */\n\n }, {\n key: \"read\",\n value: function read() {\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n\n if (length === -1) {\n length = this.stream.length - this.offset;\n }\n\n var result = this.stream.slice(this.offset, this.offset + length);\n this.offset += length;\n\n if (result.length !== length) {\n throw Error(\"No more data left to read (need \".concat(length, \", got \").concat(result.length, \": \").concat(result, \"); last read \").concat(this._last));\n }\n\n this._last = result;\n return result;\n }\n /**\n * Gets the byte array representing the current buffer as a whole.\n * @returns {Buffer}\n */\n\n }, {\n key: \"getBuffer\",\n value: function getBuffer() {\n return this.stream;\n } // endregion\n // region Telegram custom reading\n\n /**\n * Reads a Telegram-encoded byte array, without the need of\n * specifying its length.\n * @returns {Buffer}\n */\n\n }, {\n key: \"tgReadBytes\",\n value: function tgReadBytes() {\n var firstByte = this.readByte();\n var padding;\n var length;\n\n if (firstByte === 254) {\n length = this.readByte() | this.readByte() << 8 | this.readByte() << 16;\n padding = length % 4;\n } else {\n length = firstByte;\n padding = (length + 1) % 4;\n }\n\n var data = this.read(length);\n\n if (padding > 0) {\n padding = 4 - padding;\n this.read(padding);\n }\n\n return data;\n }\n /**\n * Reads a Telegram-encoded string.\n * @returns {string}\n */\n\n }, {\n key: \"tgReadString\",\n value: function tgReadString() {\n return this.tgReadBytes().toString('utf-8');\n }\n /**\n * Reads a Telegram boolean value.\n * @returns {boolean}\n */\n\n }, {\n key: \"tgReadBool\",\n value: function tgReadBool() {\n var value = this.readInt(false);\n\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else {\n throw new Error(\"Invalid boolean code \".concat(value.toString('16')));\n }\n }\n /**\n * Reads and converts Unix time (used by Telegram)\n * into a Javascript {Date} object.\n * @returns {Date}\n */\n\n }, {\n key: \"tgReadDate\",\n value: function tgReadDate() {\n var value = this.readInt();\n return new Date(value * 1000);\n }\n /**\n * Reads a Telegram object.\n */\n\n }, {\n key: \"tgReadObject\",\n value: function tgReadObject() {\n var constructorId = this.readInt(false);\n var clazz = tlobjects[constructorId];\n\n if (clazz === undefined) {\n /**\n * The class was None, but there's still a\n * chance of it being a manually parsed value like bool!\n */\n var value = constructorId;\n\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boolFalse\n return false;\n } else if (value === 0x1cb5c415) {\n // Vector\n var temp = [];\n var length = this.readInt();\n\n for (var i = 0; i < length; i++) {\n temp.push(this.tgReadObject());\n }\n\n return temp;\n }\n\n clazz = coreObjects[constructorId];\n\n if (clazz === undefined) {\n // If there was still no luck, give up\n this.seek(-4); // Go back\n\n var pos = this.tellPosition();\n var error = new TypeNotFoundError(constructorId, this.read());\n this.setPosition(pos);\n throw error;\n }\n }\n\n return clazz.fromReader(this);\n }\n /**\n * Reads a vector (a list) of Telegram objects.\n * @returns {[Buffer]}\n */\n\n }, {\n key: \"tgReadVector\",\n value: function tgReadVector() {\n if (this.readInt(false) !== 0x1cb5c415) {\n throw new Error('Invalid constructor code, vector was expected');\n }\n\n var count = this.readInt();\n var temp = [];\n\n for (var i = 0; i < count; i++) {\n temp.push(this.tgReadObject());\n }\n\n return temp;\n } // endregion\n\n /**\n * Closes the reader.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n this.stream = null;\n } // region Position related\n\n /**\n * Tells the current position on the stream.\n * @returns {number}\n */\n\n }, {\n key: \"tellPosition\",\n value: function tellPosition() {\n return this.offset;\n }\n /**\n * Sets the current position on the stream.\n * @param position\n */\n\n }, {\n key: \"setPosition\",\n value: function setPosition(position) {\n this.offset = position;\n }\n /**\n * Seeks the stream position given an offset from the current position.\n * The offset may be negative.\n * @param offset\n */\n\n }, {\n key: \"seek\",\n value: function seek(offset) {\n this.offset += offset;\n } // endregion\n\n }]);\n\n return BinaryReader;\n}();\n\nmodule.exports = BinaryReader;\n\n//# sourceURL=webpack://gramjs/./gramjs/extensions/BinaryReader.js?"); /***/ }), /***/ "./gramjs/extensions/BinaryWriter.js": /*!*******************************************!*\ !*** ./gramjs/extensions/BinaryWriter.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar BinaryWriter =\n/*#__PURE__*/\nfunction () {\n function BinaryWriter(stream) {\n _classCallCheck(this, BinaryWriter);\n\n this._stream = stream;\n }\n\n _createClass(BinaryWriter, [{\n key: \"write\",\n value: function write(buffer) {\n this._stream = Buffer.concat([this._stream, buffer]);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this._stream;\n }\n }]);\n\n return BinaryWriter;\n}();\n\nmodule.exports = BinaryWriter;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/extensions/BinaryWriter.js?"); /***/ }), /***/ "./gramjs/extensions/Logger.js": /*!*************************************!*\ !*** ./gramjs/extensions/Logger.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(process) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(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; }\n\nvar logger = null;\n\nvar Logger =\n/*#__PURE__*/\nfunction () {\n function Logger(level) {\n _classCallCheck(this, Logger);\n\n this.level = level;\n this.isBrowser = typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs;\n\n if (!this.isBrowser) {\n this.colors = {\n start: '\\x1b[2m',\n warn: '\\x1b[35m',\n info: '\\x1b[33m',\n debug: '\\x1b[36m',\n error: '\\x1b[31m',\n end: '\\x1b[0m'\n };\n } else {\n this.colors = {\n start: '%c',\n warn: 'color : #ff00ff',\n info: 'color : #ffff00',\n debug: 'color : #00ffff',\n error: 'color : #ff0000',\n end: ''\n };\n }\n\n this.messageFormat = '[%t] [%l] - [%m]';\n }\n /**\n *\n * @param level {string}\n * @returns {boolean}\n */\n\n\n _createClass(Logger, [{\n key: \"canSend\",\n value: function canSend(level) {\n return Logger.levels.indexOf(this.level) <= Logger.levels.indexOf(level);\n }\n /**\n * @param message {string}\n */\n\n }, {\n key: \"warn\",\n value: function warn(message) {\n this._log('warn', message, this.colors.warn);\n }\n /**\n * @param message {string}\n */\n\n }, {\n key: \"info\",\n value: function info(message) {\n this._log('info', message, this.colors.info);\n }\n /**\n * @param message {string}\n */\n\n }, {\n key: \"debug\",\n value: function debug(message) {\n this._log('debug', message, this.colors.debug);\n }\n /**\n * @param message {string}\n */\n\n }, {\n key: \"error\",\n value: function error(message) {\n this._log('error', message, this.colors.error);\n }\n }, {\n key: \"format\",\n value: function format(message, level) {\n return this.messageFormat.replace('%t', new Date().toISOString()).replace('%l', level.toUpperCase()).replace('%m', message);\n }\n }, {\n key: \"_log\",\n\n /**\n * @param level {string}\n * @param message {string}\n * @param color {string}\n */\n value: function _log(level, message, color) {\n if (this.canSend(level)) {\n if (!this.isBrowser) {\n console.log(color + this.format(message, level) + this.colors.end);\n } else {\n console.log(this.colors.start + this.format(message, level), color);\n }\n } else {\n console.log('can\\'t send');\n }\n }\n }], [{\n key: \"getLogger\",\n value: function getLogger() {\n if (!logger) {\n logger = new Logger('debug');\n }\n\n return logger;\n }\n }]);\n\n return Logger;\n}();\n\n_defineProperty(Logger, \"levels\", ['debug', 'info', 'warn', 'error']);\n\nmodule.exports = Logger;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./gramjs/extensions/Logger.js?"); /***/ }), /***/ "./gramjs/extensions/MessagePacker.js": /*!********************************************!*\ !*** ./gramjs/extensions/MessagePacker.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar MessageContainer = __webpack_require__(/*! ../tl/core/MessageContainer */ \"./gramjs/tl/core/MessageContainer.js\");\n\nvar TLMessage = __webpack_require__(/*! ../tl/core/TLMessage */ \"./gramjs/tl/core/TLMessage.js\");\n\nvar _require = __webpack_require__(/*! ../tl/tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLRequest = _require.TLRequest;\n\nvar BinaryWriter = __webpack_require__(/*! ../extensions/BinaryWriter */ \"./gramjs/extensions/BinaryWriter.js\");\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar MessagePacker =\n/*#__PURE__*/\nfunction () {\n function MessagePacker(state, logger) {\n var _this = this;\n\n _classCallCheck(this, MessagePacker);\n\n this._state = state;\n this._queue = [];\n this._ready = new Promise(function (resolve) {\n _this.setReady = resolve;\n });\n this._log = logger;\n }\n\n _createClass(MessagePacker, [{\n key: \"values\",\n value: function values() {\n return this._queue;\n }\n }, {\n key: \"append\",\n value: function append(state) {\n this._queue.push(state);\n\n this.setReady(true);\n }\n }, {\n key: \"extend\",\n value: function extend(states) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = states[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var state = _step.value;\n\n this._queue.push(state);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n this.setReady(true);\n }\n }, {\n key: \"get\",\n value: function get() {\n var _this2 = this;\n\n var data, buffer, batch, size, state, afterId, containerId, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, s;\n\n return regeneratorRuntime.async(function get$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (this._queue.length) {\n _context.next = 4;\n break;\n }\n\n this._ready = new Promise(function (resolve) {\n _this2.setReady = resolve;\n });\n _context.next = 4;\n return regeneratorRuntime.awrap(this._ready);\n\n case 4:\n buffer = new BinaryWriter(Buffer.alloc(0));\n batch = [];\n size = 0;\n\n case 7:\n if (!(this._queue.length && batch.length <= MessageContainer.MAXIMUM_LENGTH)) {\n _context.next = 28;\n break;\n }\n\n state = this._queue.shift();\n size += state.data.length + TLMessage.SIZE_OVERHEAD;\n\n if (!(size <= MessageContainer.MAXIMUM_SIZE)) {\n _context.next = 19;\n break;\n }\n\n afterId = void 0;\n\n if (state.after) {\n afterId = state.after.msgId;\n }\n\n _context.next = 15;\n return regeneratorRuntime.awrap(this._state.writeDataAsMessage(buffer, state.data, state.request instanceof TLRequest, afterId));\n\n case 15:\n state.msgId = _context.sent;\n\n this._log.debug(\"Assigned msgId = \".concat(state.msgId, \" to \").concat(state.request.constructor.name));\n\n batch.push(state);\n return _context.abrupt(\"continue\", 7);\n\n case 19:\n if (!batch.length) {\n _context.next = 22;\n break;\n }\n\n this._queue.unshift(state);\n\n return _context.abrupt(\"break\", 28);\n\n case 22:\n this._log.warn(\"Message payload for \".concat(state.request.constructor.name, \" is too long \").concat(state.data.length, \" and cannot be sent\"));\n\n state.promise.reject('Request Payload is too big');\n size = 0;\n return _context.abrupt(\"continue\", 7);\n\n case 28:\n if (batch.length) {\n _context.next = 30;\n break;\n }\n\n return _context.abrupt(\"return\", null);\n\n case 30:\n if (!(batch.length > 1)) {\n _context.next = 54;\n break;\n }\n\n data = Buffer.concat([struct.pack('}\n */\n\n\nfunction doAuthentication(sender, log) {\n var bytes, nonce, resPQ, pq, _Factorizator$factori, p, q, newNonce, pqInnerData, cipherText, targetFingerprint, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, fingerprint, serverDhParams, sh, nnh, _Helpers$generateKeyD, key, iv, plainTextAnswer, reader, serverDhInner, dhPrime, ga, timeOffset, b, gb, gab, _ref, clientDhInner, clientDdhInnerHashed, clientDhEncrypted, dhGen, nonceTypes, name, authKey, nonceNumber, newNonceHash, dhHash;\n\n return regeneratorRuntime.async(function doAuthentication$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // Step 1 sending: PQ Request, endianness doesn't matter since it's random\n bytes = Helpers.generateRandomBytes(16);\n nonce = Helpers.readBigIntFromBuffer(bytes, false, true);\n _context.next = 4;\n return regeneratorRuntime.awrap(sender.send(new ReqPqMultiRequest({\n nonce: nonce\n })));\n\n case 4:\n resPQ = _context.sent;\n log.debug('Starting authKey generation step 1');\n\n if (resPQ instanceof ResPQ) {\n _context.next = 8;\n break;\n }\n\n throw new Error(\"Step 1 answer was \".concat(resPQ));\n\n case 8:\n if (!(resPQ.nonce !== nonce)) {\n _context.next = 10;\n break;\n }\n\n throw new SecurityError('Step 1 invalid nonce from server');\n\n case 10:\n pq = Helpers.readBigIntFromBuffer(resPQ.pq, false, true);\n log.debug('Finished authKey generation step 1');\n log.debug('Starting authKey generation step 2'); // Step 2 sending: DH Exchange\n\n _Factorizator$factori = Factorizator.factorize(pq), p = _Factorizator$factori.p, q = _Factorizator$factori.q;\n p = getByteArray(p);\n q = getByteArray(q);\n bytes = Helpers.generateRandomBytes(32);\n newNonce = Helpers.readBigIntFromBuffer(bytes, true, true);\n pqInnerData = new PQInnerData({\n pq: getByteArray(pq),\n // unsigned\n p: p,\n q: q,\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n newNonce: newNonce\n }); // sha_digest + data + random_bytes\n\n cipherText = null;\n targetFingerprint = null;\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context.prev = 24;\n _iterator = resPQ.serverPublicKeyFingerprints[Symbol.iterator]();\n\n case 26:\n if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {\n _context.next = 35;\n break;\n }\n\n fingerprint = _step.value;\n cipherText = RSA.encrypt(fingerprint.toString(), pqInnerData.bytes);\n\n if (!(cipherText !== null && cipherText !== undefined)) {\n _context.next = 32;\n break;\n }\n\n targetFingerprint = fingerprint;\n return _context.abrupt(\"break\", 35);\n\n case 32:\n _iteratorNormalCompletion = true;\n _context.next = 26;\n break;\n\n case 35:\n _context.next = 41;\n break;\n\n case 37:\n _context.prev = 37;\n _context.t0 = _context[\"catch\"](24);\n _didIteratorError = true;\n _iteratorError = _context.t0;\n\n case 41:\n _context.prev = 41;\n _context.prev = 42;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 44:\n _context.prev = 44;\n\n if (!_didIteratorError) {\n _context.next = 47;\n break;\n }\n\n throw _iteratorError;\n\n case 47:\n return _context.finish(44);\n\n case 48:\n return _context.finish(41);\n\n case 49:\n if (!(cipherText === null || cipherText === undefined)) {\n _context.next = 51;\n break;\n }\n\n throw new SecurityError('Step 2 could not find a valid key for fingerprints');\n\n case 51:\n _context.next = 53;\n return regeneratorRuntime.awrap(sender.send(new ReqDHParamsRequest({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n p: p,\n q: q,\n publicKeyFingerprint: targetFingerprint,\n encryptedData: cipherText\n })));\n\n case 53:\n serverDhParams = _context.sent;\n\n if (serverDhParams instanceof ServerDHParamsOk || serverDhParams instanceof ServerDHParamsFail) {\n _context.next = 56;\n break;\n }\n\n throw new Error(\"Step 2.1 answer was \".concat(serverDhParams));\n\n case 56:\n if (!(serverDhParams.nonce !== resPQ.nonce)) {\n _context.next = 58;\n break;\n }\n\n throw new SecurityError('Step 2 invalid nonce from server');\n\n case 58:\n if (!(serverDhParams.serverNonce !== resPQ.serverNonce)) {\n _context.next = 60;\n break;\n }\n\n throw new SecurityError('Step 2 invalid server nonce from server');\n\n case 60:\n if (!(serverDhParams instanceof ServerDHParamsFail)) {\n _context.next = 65;\n break;\n }\n\n sh = Helpers.sha1(Helpers.readBufferFromBigInt(newNonce, 32, true, true).slice(4, 20));\n nnh = Helpers.readBigIntFromBuffer(sh, true, true);\n\n if (!(serverDhParams.newNonceHash !== nnh)) {\n _context.next = 65;\n break;\n }\n\n throw new SecurityError('Step 2 invalid DH fail nonce from server');\n\n case 65:\n if (serverDhParams instanceof ServerDHParamsOk) {\n _context.next = 67;\n break;\n }\n\n throw new Error(\"Step 2.2 answer was \".concat(serverDhParams));\n\n case 67:\n log.debug('Finished authKey generation step 2');\n log.debug('Starting authKey generation step 3'); // Step 3 sending: Complete DH Exchange\n\n _Helpers$generateKeyD = Helpers.generateKeyDataFromNonce(resPQ.serverNonce, newNonce), key = _Helpers$generateKeyD.key, iv = _Helpers$generateKeyD.iv;\n\n if (!(serverDhParams.encryptedAnswer.length % 16 !== 0)) {\n _context.next = 72;\n break;\n }\n\n throw new SecurityError('Step 3 AES block size mismatch');\n\n case 72:\n plainTextAnswer = AES.decryptIge(serverDhParams.encryptedAnswer, key, iv);\n reader = new BinaryReader(plainTextAnswer);\n reader.read(20); // hash sum\n\n serverDhInner = reader.tgReadObject();\n\n if (serverDhInner instanceof ServerDHInnerData) {\n _context.next = 78;\n break;\n }\n\n throw new Error(\"Step 3 answer was \".concat(serverDhInner));\n\n case 78:\n if (!(serverDhInner.nonce !== resPQ.nonce)) {\n _context.next = 80;\n break;\n }\n\n throw new SecurityError('Step 3 Invalid nonce in encrypted answer');\n\n case 80:\n if (!(serverDhInner.serverNonce !== resPQ.serverNonce)) {\n _context.next = 82;\n break;\n }\n\n throw new SecurityError('Step 3 Invalid server nonce in encrypted answer');\n\n case 82:\n dhPrime = Helpers.readBigIntFromBuffer(serverDhInner.dhPrime, false, false);\n ga = Helpers.readBigIntFromBuffer(serverDhInner.gA, false, false);\n timeOffset = serverDhInner.serverTime - Math.floor(new Date().getTime() / 1000);\n b = Helpers.readBigIntFromBuffer(Helpers.generateRandomBytes(256), false, false);\n gb = Helpers.modExp(BigInt(serverDhInner.g), b, dhPrime);\n gab = Helpers.modExp(ga, b, dhPrime); // Prepare client DH Inner Data\n\n _ref = new ClientDHInnerData({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n retryId: 0,\n // TODO Actual retry ID\n gB: getByteArray(gb, false)\n }), clientDhInner = _ref.bytes;\n clientDdhInnerHashed = Buffer.concat([Helpers.sha1(clientDhInner), clientDhInner]); // Encryption\n\n clientDhEncrypted = AES.encryptIge(clientDdhInnerHashed, key, iv);\n _context.next = 93;\n return regeneratorRuntime.awrap(sender.send(new SetClientDHParamsRequest({\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n encryptedData: clientDhEncrypted\n })));\n\n case 93:\n dhGen = _context.sent;\n nonceTypes = [DhGenOk, DhGenRetry, DhGenFail];\n\n if (dhGen instanceof nonceTypes[0] || dhGen instanceof nonceTypes[1] || dhGen instanceof nonceTypes[2]) {\n _context.next = 97;\n break;\n }\n\n throw new Error(\"Step 3.1 answer was \".concat(dhGen));\n\n case 97:\n name = dhGen.constructor.name;\n\n if (!(dhGen.nonce !== resPQ.nonce)) {\n _context.next = 100;\n break;\n }\n\n throw new SecurityError(\"Step 3 invalid \".concat(name, \" nonce from server\"));\n\n case 100:\n if (!(dhGen.serverNonce !== resPQ.serverNonce)) {\n _context.next = 102;\n break;\n }\n\n throw new SecurityError(\"Step 3 invalid \".concat(name, \" server nonce from server\"));\n\n case 102:\n authKey = new AuthKey(getByteArray(gab));\n nonceNumber = 1 + nonceTypes.indexOf(dhGen.constructor);\n newNonceHash = authKey.calcNewNonceHash(newNonce, nonceNumber);\n dhHash = dhGen[\"newNonceHash\".concat(nonceNumber)];\n\n if (!(dhHash !== newNonceHash)) {\n _context.next = 108;\n break;\n }\n\n throw new SecurityError('Step 3 invalid new nonce hash');\n\n case 108:\n if (dhGen instanceof DhGenOk) {\n _context.next = 110;\n break;\n }\n\n throw new Error(\"Step 3.2 answer was \".concat(dhGen));\n\n case 110:\n log.debug('Finished authKey generation step 3');\n return _context.abrupt(\"return\", {\n authKey: authKey,\n timeOffset: timeOffset\n });\n\n case 112:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, null, [[24, 37, 41, 49], [42,, 44, 48]]);\n}\n/**\n * Gets the arbitrary-length byte array corresponding to the given integer\n * @param integer {number,BigInt}\n * @param signed {boolean}\n * @returns {Buffer}\n */\n\n\nfunction getByteArray(integer) {\n var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var bits = integer.toString(2).length;\n var byteLength = Math.floor((bits + 8 - 1) / 8);\n return Helpers.readBufferFromBigInt(BigInt(integer), byteLength, false, signed);\n}\n\nmodule.exports = doAuthentication;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/network/Authenticator.js?"); /***/ }), /***/ "./gramjs/network/MTProtoPlainSender.js": /*!**********************************************!*\ !*** ./gramjs/network/MTProtoPlainSender.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * This module contains the class used to communicate with Telegram's servers\n * in plain text, when no authorization key has been created yet.\n */\nvar Helpers = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\");\n\nvar MTProtoState = __webpack_require__(/*! ./MTProtoState */ \"./gramjs/network/MTProtoState.js\");\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar BinaryReader = __webpack_require__(/*! ../extensions/BinaryReader */ \"./gramjs/extensions/BinaryReader.js\");\n\nvar _require = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n InvalidBufferError = _require.InvalidBufferError;\n/**\n * MTProto Mobile Protocol plain sender (https://core.telegram.org/mtproto/description#unencrypted-messages)\n */\n\n\nvar MTProtoPlainSender =\n/*#__PURE__*/\nfunction () {\n /**\n * Initializes the MTProto plain sender.\n * @param connection connection: the Connection to be used.\n * @param loggers\n */\n function MTProtoPlainSender(connection, loggers) {\n _classCallCheck(this, MTProtoPlainSender);\n\n this._state = new MTProtoState(connection, loggers);\n this._connection = connection;\n }\n /**\n * Sends and receives the result for the given request.\n * @param request\n */\n\n\n _createClass(MTProtoPlainSender, [{\n key: \"send\",\n value: function send(request) {\n var body, msgId, res, reader, authKeyId, length;\n return regeneratorRuntime.async(function send$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n body = request.bytes;\n msgId = this._state._getNewMsgId();\n res = Buffer.concat([struct.pack('= newMsgId) {\n newMsgId = this._lastMsgId + BigInt(4);\n }\n\n this._lastMsgId = newMsgId;\n return BigInt(newMsgId);\n }\n }]);\n\n return MTProtoPlainSender;\n}();\n\nmodule.exports = MTProtoPlainSender;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/network/MTProtoPlainSender.js?"); /***/ }), /***/ "./gramjs/network/MTProtoSender.js": /*!*****************************************!*\ !*** ./gramjs/network/MTProtoSender.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(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; }\n\nvar MtProtoPlainSender = __webpack_require__(/*! ./MTProtoPlainSender */ \"./gramjs/network/MTProtoPlainSender.js\");\n\nvar MTProtoState = __webpack_require__(/*! ./MTProtoState */ \"./gramjs/network/MTProtoState.js\");\n\nvar Helpers = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\");\n\nvar AuthKey = __webpack_require__(/*! ../crypto/AuthKey */ \"./gramjs/crypto/AuthKey.js\");\n\nvar doAuthentication = __webpack_require__(/*! ./Authenticator */ \"./gramjs/network/Authenticator.js\");\n\nvar RPCResult = __webpack_require__(/*! ../tl/core/RPCResult */ \"./gramjs/tl/core/RPCResult.js\");\n\nvar MessageContainer = __webpack_require__(/*! ../tl/core/MessageContainer */ \"./gramjs/tl/core/MessageContainer.js\");\n\nvar GZIPPacked = __webpack_require__(/*! ../tl/core/GZIPPacked */ \"./gramjs/tl/core/GZIPPacked.js\");\n\nvar RequestState = __webpack_require__(/*! ./RequestState */ \"./gramjs/network/RequestState.js\");\n\nvar format = __webpack_require__(/*! string-format */ \"./node_modules/string-format/index.js\");\n\nvar _require = __webpack_require__(/*! ../tl/types */ \"./gramjs/tl/types/index.js\"),\n MsgsAck = _require.MsgsAck,\n File = _require.File,\n MsgsStateInfo = _require.MsgsStateInfo,\n Pong = _require.Pong;\n\nvar MessagePacker = __webpack_require__(/*! ../extensions/MessagePacker */ \"./gramjs/extensions/MessagePacker.js\");\n\nvar BinaryReader = __webpack_require__(/*! ../extensions/BinaryReader */ \"./gramjs/extensions/BinaryReader.js\");\n\nvar _require2 = __webpack_require__(/*! ../tl/types */ \"./gramjs/tl/types/index.js\"),\n BadServerSalt = _require2.BadServerSalt,\n BadMsgNotification = _require2.BadMsgNotification,\n MsgDetailedInfo = _require2.MsgDetailedInfo,\n MsgNewDetailedInfo = _require2.MsgNewDetailedInfo,\n NewSessionCreated = _require2.NewSessionCreated,\n FutureSalts = _require2.FutureSalts,\n MsgsStateReq = _require2.MsgsStateReq,\n MsgResendReq = _require2.MsgResendReq,\n MsgsAllInfo = _require2.MsgsAllInfo;\n\nvar _require3 = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n SecurityError = _require3.SecurityError;\n\nvar _require4 = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n InvalidBufferError = _require4.InvalidBufferError;\n\nvar _require5 = __webpack_require__(/*! ../tl/functions/auth */ \"./gramjs/tl/functions/auth.js\"),\n LogOutRequest = _require5.LogOutRequest;\n\nvar _require6 = __webpack_require__(/*! ../errors */ \"./gramjs/errors/index.js\"),\n RPCMessageToError = _require6.RPCMessageToError;\n\nvar _require7 = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n TypeNotFoundError = _require7.TypeNotFoundError; // const { tlobjects } = require(\"../gramjs/tl/alltlobjects\");\n\n\nformat.extend(String.prototype, {});\n/**\n * MTProto Mobile Protocol sender\n * (https://core.telegram.org/mtproto/description)\n * This class is responsible for wrapping requests into `TLMessage`'s,\n * sending them over the network and receiving them in a safe manner.\n *\n * Automatic reconnection due to temporary network issues is a concern\n * for this class as well, including retry of messages that could not\n * be sent successfully.\n *\n * A new authorization key will be generated on connection if no other\n * key exists yet.\n */\n\nvar MTProtoSender =\n/*#__PURE__*/\nfunction () {\n /**\n * @param authKey\n * @param opts\n */\n function MTProtoSender(authKey, opts) {\n var _this$_handlers;\n\n _classCallCheck(this, MTProtoSender);\n\n var args = _objectSpread({}, MTProtoSender.DEFAULT_OPTIONS, {}, opts);\n\n this._connection = null;\n this._log = args.logger;\n this._retries = args.retries;\n this._delay = args.delay;\n this._autoReconnect = args.autoReconnect;\n this._connectTimeout = args.connectTimeout;\n this._authKeyCallback = args.authKeyCallback;\n this._updateCallback = args.updateCallback;\n this._autoReconnectCallback = args.autoReconnectCallback;\n /**\n * Whether the user has explicitly connected or disconnected.\n *\n * If a disconnection happens for any other reason and it\n * was *not* user action then the pending messages won't\n * be cleared but on explicit user disconnection all the\n * pending futures should be cancelled.\n */\n\n this._user_connected = false;\n this._reconnecting = false;\n this._disconnected = true;\n /**\n * We need to join the loops upon disconnection\n */\n\n this._send_loop_handle = null;\n this._recv_loop_handle = null;\n /**\n * Preserving the references of the AuthKey and state is important\n */\n\n this.authKey = authKey || new AuthKey(null);\n this._state = new MTProtoState(this.authKey, this._log);\n /**\n * Outgoing messages are put in a queue and sent in a batch.\n * Note that here we're also storing their ``_RequestState``.\n */\n\n this._send_queue = new MessagePacker(this._state, this._log);\n /**\n * Sent states are remembered until a response is received.\n */\n\n this._pending_state = {};\n /**\n * Responses must be acknowledged, and we can also batch these.\n */\n\n this._pending_ack = new Set();\n /**\n * Similar to pending_messages but only for the last acknowledges.\n * These can't go in pending_messages because no acknowledge for them\n * is received, but we may still need to resend their state on bad salts.\n */\n\n this._last_acks = [];\n /**\n * Jump table from response ID to method that handles it\n */\n\n this._handlers = (_this$_handlers = {}, _defineProperty(_this$_handlers, RPCResult.CONSTRUCTOR_ID, this._handleRPCResult.bind(this)), _defineProperty(_this$_handlers, MessageContainer.CONSTRUCTOR_ID, this._handleContainer.bind(this)), _defineProperty(_this$_handlers, GZIPPacked.CONSTRUCTOR_ID, this._handleGzipPacked.bind(this)), _defineProperty(_this$_handlers, Pong.CONSTRUCTOR_ID, this._handlePong.bind(this)), _defineProperty(_this$_handlers, BadServerSalt.CONSTRUCTOR_ID, this._handleBadServerSalt.bind(this)), _defineProperty(_this$_handlers, BadMsgNotification.CONSTRUCTOR_ID, this._handleBadNotification.bind(this)), _defineProperty(_this$_handlers, MsgDetailedInfo.CONSTRUCTOR_ID, this._handleDetailedInfo.bind(this)), _defineProperty(_this$_handlers, MsgNewDetailedInfo.CONSTRUCTOR_ID, this._handleNewDetailedInfo.bind(this)), _defineProperty(_this$_handlers, NewSessionCreated.CONSTRUCTOR_ID, this._handleNewSessionCreated.bind(this)), _defineProperty(_this$_handlers, MsgsAck.CONSTRUCTOR_ID, this._handleAck.bind(this)), _defineProperty(_this$_handlers, FutureSalts.CONSTRUCTOR_ID, this._handleFutureSalts.bind(this)), _defineProperty(_this$_handlers, MsgsStateReq.CONSTRUCTOR_ID, this._handleStateForgotten.bind(this)), _defineProperty(_this$_handlers, MsgResendReq.CONSTRUCTOR_ID, this._handleStateForgotten.bind(this)), _defineProperty(_this$_handlers, MsgsAllInfo.CONSTRUCTOR_ID, this._handleMsgAll.bind(this)), _this$_handlers);\n } // Public API\n\n /**\n * Connects to the specified given connection using the given auth key.\n * @param connection\n * @returns {Promise}\n */\n\n\n _createClass(MTProtoSender, [{\n key: \"connect\",\n value: function connect(connection) {\n return regeneratorRuntime.async(function connect$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!this._user_connected) {\n _context.next = 3;\n break;\n }\n\n this._log.info('User is already connected!');\n\n return _context.abrupt(\"return\", false);\n\n case 3:\n this._connection = connection;\n _context.next = 6;\n return regeneratorRuntime.awrap(this._connect());\n\n case 6:\n return _context.abrupt(\"return\", true);\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"isConnected\",\n value: function isConnected() {\n return this._user_connected;\n }\n /**\n * Cleanly disconnects the instance from the network, cancels\n * all pending requests, and closes the send and receive loops.\n */\n\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n return regeneratorRuntime.async(function disconnect$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return regeneratorRuntime.awrap(this._disconnect());\n\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }\n }, null, this);\n }\n /**\n *\n This method enqueues the given request to be sent. Its send\n state will be saved until a response arrives, and a ``Future``\n that will be resolved when the response arrives will be returned:\n .. code-block:: javascript\n async def method():\n # Sending (enqueued for the send loop)\n future = sender.send(request)\n # Receiving (waits for the receive loop to read the result)\n result = await future\n Designed like this because Telegram may send the response at\n any point, and it can send other items while one waits for it.\n Once the response for this future arrives, it is set with the\n received result, quite similar to how a ``receive()`` call\n would otherwise work.\n Since the receiving part is \"built in\" the future, it's\n impossible to await receive a result that was never sent.\n * @param request\n * @returns {RequestState}\n */\n\n }, {\n key: \"send\",\n value: function send(request) {\n if (!this._user_connected) {\n throw new Error('Cannot send requests while disconnected');\n }\n\n if (!Helpers.isArrayLike(request)) {\n var state = new RequestState(request);\n\n this._send_queue.append(state);\n\n return state.promise;\n } else {\n throw new Error('not supported');\n }\n }\n /**\n * Performs the actual connection, retrying, generating the\n * authorization key if necessary, and starting the send and\n * receive loops.\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_connect\",\n value: function _connect() {\n var plain, res;\n return regeneratorRuntime.async(function _connect$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n this._log.info('Connecting to {0}...'.replace('{0}', this._connection));\n\n _context3.next = 3;\n return regeneratorRuntime.awrap(this._connection.connect());\n\n case 3:\n this._log.debug('Connection success!');\n\n if (this.authKey._key) {\n _context3.next = 16;\n break;\n }\n\n plain = new MtProtoPlainSender(this._connection, this._log);\n\n this._log.debug('New auth_key attempt ...');\n\n _context3.next = 9;\n return regeneratorRuntime.awrap(doAuthentication(plain, this._log));\n\n case 9:\n res = _context3.sent;\n\n this._log.debug('Generated new auth_key successfully');\n\n this.authKey.key = res.authKey;\n this._state.time_offset = res.timeOffset;\n /**\n * This is *EXTREMELY* important since we don't control\n * external references to the authorization key, we must\n * notify whenever we change it. This is crucial when we\n * switch to different data centers.\n */\n\n if (this._authKeyCallback) {\n this._authKeyCallback(this.authKey);\n }\n\n _context3.next = 17;\n break;\n\n case 16:\n this._log.debug('Already have an auth key ...');\n\n case 17:\n this._user_connected = true;\n\n this._log.debug('Starting send loop');\n\n this._send_loop_handle = this._sendLoop();\n\n this._log.debug('Starting receive loop');\n\n this._recv_loop_handle = this._recvLoop(); // _disconnected only completes after manual disconnection\n // or errors after which the sender cannot continue such\n // as failing to reconnect or any unexpected error.\n\n this._log.info('Connection to %s complete!'.replace('%s', this._connection.toString()));\n\n case 23:\n case \"end\":\n return _context3.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_disconnect\",\n value: function _disconnect() {\n var error,\n _args4 = arguments;\n return regeneratorRuntime.async(function _disconnect$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n error = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;\n\n if (!(this._connection === null)) {\n _context4.next = 4;\n break;\n }\n\n this._log.info('Not disconnecting (already have no connection)');\n\n return _context4.abrupt(\"return\");\n\n case 4:\n this._log.info('Disconnecting from %s...'.replace('%s', this._connection.toString()));\n\n this._user_connected = false;\n\n this._log.debug('Closing current connection...');\n\n _context4.next = 9;\n return regeneratorRuntime.awrap(this._connection.disconnect());\n\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }\n }, null, this);\n }\n /**\n * This loop is responsible for popping items off the send\n * queue, encrypting them, and sending them over the network.\n * Besides `connect`, only this method ever sends data.\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_sendLoop\",\n value: function _sendLoop() {\n var ack, res, data, batch, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, state;\n\n return regeneratorRuntime.async(function _sendLoop$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n if (!(this._user_connected && !this._reconnecting)) {\n _context5.next = 44;\n break;\n }\n\n if (this._pending_ack.size) {\n ack = new RequestState(new MsgsAck({\n msgIds: Array.apply(void 0, _toConsumableArray(this._pending_ack))\n }));\n\n this._send_queue.append(ack);\n\n this._last_acks.push(ack);\n\n this._pending_ack.clear();\n } // this._log.debug('Waiting for messages to send...');\n\n\n this._log.debug('Waiting for messages to send...'); // TODO Wait for the connection send queue to be empty?\n // This means that while it's not empty we can wait for\n // more messages to be added to the send queue.\n\n\n _context5.next = 5;\n return regeneratorRuntime.awrap(this._send_queue.get());\n\n case 5:\n res = _context5.sent;\n\n if (res) {\n _context5.next = 8;\n break;\n }\n\n return _context5.abrupt(\"continue\", 0);\n\n case 8:\n data = res.data;\n batch = res.batch;\n\n this._log.debug(\"Encrypting \".concat(batch.length, \" message(s) in \").concat(data.length, \" bytes for sending\"));\n\n data = this._state.encryptMessageData(data);\n _context5.prev = 12;\n _context5.next = 15;\n return regeneratorRuntime.awrap(this._connection.send(data));\n\n case 15:\n _context5.next = 22;\n break;\n\n case 17:\n _context5.prev = 17;\n _context5.t0 = _context5[\"catch\"](12);\n console.log(_context5.t0);\n\n this._log.info('Connection closed while sending data');\n\n return _context5.abrupt(\"return\");\n\n case 22:\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context5.prev = 25;\n\n for (_iterator = batch[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n state = _step.value;\n this._pending_state[state.msgId] = state;\n }\n\n _context5.next = 33;\n break;\n\n case 29:\n _context5.prev = 29;\n _context5.t1 = _context5[\"catch\"](25);\n _didIteratorError = true;\n _iteratorError = _context5.t1;\n\n case 33:\n _context5.prev = 33;\n _context5.prev = 34;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 36:\n _context5.prev = 36;\n\n if (!_didIteratorError) {\n _context5.next = 39;\n break;\n }\n\n throw _iteratorError;\n\n case 39:\n return _context5.finish(36);\n\n case 40:\n return _context5.finish(33);\n\n case 41:\n this._log.debug('Encrypted messages put in a queue to be sent');\n\n _context5.next = 0;\n break;\n\n case 44:\n case \"end\":\n return _context5.stop();\n }\n }\n }, null, this, [[12, 17], [25, 29, 33, 41], [34,, 36, 40]]);\n }\n }, {\n key: \"_recvLoop\",\n value: function _recvLoop() {\n var body, message;\n return regeneratorRuntime.async(function _recvLoop$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n if (!(this._user_connected && !this._reconnecting)) {\n _context6.next = 52;\n break;\n }\n\n // this._log.debug('Receiving items from the network...');\n this._log.debug('Receiving items from the network...');\n\n _context6.prev = 2;\n _context6.next = 5;\n return regeneratorRuntime.awrap(this._connection.recv());\n\n case 5:\n body = _context6.sent;\n _context6.next = 12;\n break;\n\n case 8:\n _context6.prev = 8;\n _context6.t0 = _context6[\"catch\"](2);\n\n // this._log.info('Connection closed while receiving data');\n this._log.warn('Connection closed while receiving data');\n\n return _context6.abrupt(\"return\");\n\n case 12:\n _context6.prev = 12;\n _context6.next = 15;\n return regeneratorRuntime.awrap(this._state.decryptMessageData(body));\n\n case 15:\n message = _context6.sent;\n _context6.next = 41;\n break;\n\n case 18:\n _context6.prev = 18;\n _context6.t1 = _context6[\"catch\"](12);\n console.log(_context6.t1);\n\n if (!(_context6.t1 instanceof TypeNotFoundError)) {\n _context6.next = 26;\n break;\n }\n\n // Received object which we don't know how to deserialize\n this._log.info(\"Type \".concat(_context6.t1.invalidConstructorId, \" not found, remaining data \").concat(_context6.t1.remaining));\n\n return _context6.abrupt(\"continue\", 0);\n\n case 26:\n if (!(_context6.t1 instanceof SecurityError)) {\n _context6.next = 31;\n break;\n }\n\n // A step while decoding had the incorrect data. This message\n // should not be considered safe and it should be ignored.\n this._log.warn(\"Security error while unpacking a received message: \".concat(_context6.t1));\n\n return _context6.abrupt(\"continue\", 0);\n\n case 31:\n if (!(_context6.t1 instanceof InvalidBufferError)) {\n _context6.next = 39;\n break;\n }\n\n this._log.info('Broken authorization key; resetting');\n\n this.authKey.key = null;\n\n if (this._authKeyCallback) {\n this._authKeyCallback(null);\n }\n\n this._startReconnect(_context6.t1);\n\n return _context6.abrupt(\"return\");\n\n case 39:\n this._log.error('Unhandled error while receiving data');\n\n return _context6.abrupt(\"return\");\n\n case 41:\n _context6.prev = 41;\n _context6.next = 44;\n return regeneratorRuntime.awrap(this._processMessage(message));\n\n case 44:\n _context6.next = 50;\n break;\n\n case 46:\n _context6.prev = 46;\n _context6.t2 = _context6[\"catch\"](41);\n console.log(_context6.t2);\n\n this._log.error('Unhandled error while receiving data');\n\n case 50:\n _context6.next = 0;\n break;\n\n case 52:\n case \"end\":\n return _context6.stop();\n }\n }\n }, null, this, [[2, 8], [12, 18], [41, 46]]);\n } // Response Handlers\n\n /**\n * Adds the given message to the list of messages that must be\n * acknowledged and dispatches control to different ``_handle_*``\n * method based on its type.\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_processMessage\",\n value: function _processMessage(message) {\n var handler;\n return regeneratorRuntime.async(function _processMessage$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n this._pending_ack.add(message.msgId); // eslint-disable-next-line require-atomic-updates\n\n\n _context7.next = 3;\n return regeneratorRuntime.awrap(message.obj);\n\n case 3:\n message.obj = _context7.sent;\n handler = this._handlers[message.obj.CONSTRUCTOR_ID];\n\n if (!handler) {\n handler = this._handleUpdate.bind(this);\n }\n\n _context7.next = 8;\n return regeneratorRuntime.awrap(handler(message));\n\n case 8:\n case \"end\":\n return _context7.stop();\n }\n }\n }, null, this);\n }\n /**\n * Pops the states known to match the given ID from pending messages.\n * This method should be used when the response isn't specific.\n * @param msgId\n * @returns {*[]}\n * @private\n */\n\n }, {\n key: \"_popStates\",\n value: function _popStates(msgId) {\n var state = this._pending_state[msgId];\n\n if (state) {\n delete this._pending_state[msgId];\n return [state];\n }\n\n var toPop = [];\n\n for (state in this._pending_state) {\n if (state.containerId === msgId) {\n toPop.push(state.msgId);\n }\n }\n\n if (toPop.length) {\n var temp = [];\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = toPop[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var x = _step2.value;\n temp.push(this._pending_state[x]);\n delete this._pending_state[x];\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2[\"return\"] != null) {\n _iterator2[\"return\"]();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return temp;\n }\n\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = this._last_acks[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var ack = _step3.value;\n\n if (ack.msgId === msgId) {\n return [ack];\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3[\"return\"] != null) {\n _iterator3[\"return\"]();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return [];\n }\n /**\n * Handles the result for Remote Procedure Calls:\n * rpc_result#f35c6d01 req_msg_id:long result:bytes = RpcResult;\n * This is where the future results for sent requests are set.\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleRPCResult\",\n value: function _handleRPCResult(message) {\n var RPCResult, state, reader, error, _reader, read;\n\n return regeneratorRuntime.async(function _handleRPCResult$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n RPCResult = message.obj;\n state = this._pending_state[RPCResult.reqMsgId];\n\n if (state) {\n delete this._pending_state[RPCResult.reqMsgId];\n }\n\n this._log.debug(\"Handling RPC result for message \".concat(RPCResult.reqMsgId));\n\n if (state) {\n _context8.next = 20;\n break;\n }\n\n _context8.prev = 5;\n reader = new BinaryReader(RPCResult.body);\n\n if (reader.tgReadObject() instanceof File) {\n _context8.next = 9;\n break;\n }\n\n throw new TypeNotFoundError('Not an upload.File');\n\n case 9:\n _context8.next = 20;\n break;\n\n case 11:\n _context8.prev = 11;\n _context8.t0 = _context8[\"catch\"](5);\n console.log(_context8.t0);\n\n if (!(_context8.t0 instanceof TypeNotFoundError)) {\n _context8.next = 19;\n break;\n }\n\n this._log.info(\"Received response without parent request: \".concat(RPCResult.body));\n\n return _context8.abrupt(\"return\");\n\n case 19:\n throw _context8.t0;\n\n case 20:\n if (!RPCResult.error) {\n _context8.next = 26;\n break;\n }\n\n // eslint-disable-next-line new-cap\n error = RPCMessageToError(RPCResult.error, state.request);\n\n this._send_queue.append(new RequestState(new MsgsAck({\n msgIds: [state.msgId]\n })));\n\n state.reject(error);\n _context8.next = 31;\n break;\n\n case 26:\n _reader = new BinaryReader(RPCResult.body);\n _context8.next = 29;\n return regeneratorRuntime.awrap(state.request.readResult(_reader));\n\n case 29:\n read = _context8.sent;\n state.resolve(read);\n\n case 31:\n case \"end\":\n return _context8.stop();\n }\n }\n }, null, this, [[5, 11]]);\n }\n /**\n * Processes the inner messages of a container with many of them:\n * msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleContainer\",\n value: function _handleContainer(message) {\n var _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, innerMessage;\n\n return regeneratorRuntime.async(function _handleContainer$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n this._log.debug('Handling container');\n\n _iteratorNormalCompletion4 = true;\n _didIteratorError4 = false;\n _iteratorError4 = undefined;\n _context9.prev = 4;\n _iterator4 = message.obj.messages[Symbol.iterator]();\n\n case 6:\n if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) {\n _context9.next = 13;\n break;\n }\n\n innerMessage = _step4.value;\n _context9.next = 10;\n return regeneratorRuntime.awrap(this._processMessage(innerMessage));\n\n case 10:\n _iteratorNormalCompletion4 = true;\n _context9.next = 6;\n break;\n\n case 13:\n _context9.next = 19;\n break;\n\n case 15:\n _context9.prev = 15;\n _context9.t0 = _context9[\"catch\"](4);\n _didIteratorError4 = true;\n _iteratorError4 = _context9.t0;\n\n case 19:\n _context9.prev = 19;\n _context9.prev = 20;\n\n if (!_iteratorNormalCompletion4 && _iterator4[\"return\"] != null) {\n _iterator4[\"return\"]();\n }\n\n case 22:\n _context9.prev = 22;\n\n if (!_didIteratorError4) {\n _context9.next = 25;\n break;\n }\n\n throw _iteratorError4;\n\n case 25:\n return _context9.finish(22);\n\n case 26:\n return _context9.finish(19);\n\n case 27:\n case \"end\":\n return _context9.stop();\n }\n }\n }, null, this, [[4, 15, 19, 27], [20,, 22, 26]]);\n }\n /**\n * Unpacks the data from a gzipped object and processes it:\n * gzip_packed#3072cfa1 packed_data:bytes = Object;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleGzipPacked\",\n value: function _handleGzipPacked(message) {\n var reader;\n return regeneratorRuntime.async(function _handleGzipPacked$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n this._log.debug('Handling gzipped data');\n\n reader = new BinaryReader(message.obj.data);\n message.obj = reader.tgReadObject();\n _context10.next = 5;\n return regeneratorRuntime.awrap(this._processMessage(message));\n\n case 5:\n case \"end\":\n return _context10.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_handleUpdate\",\n value: function _handleUpdate(message) {\n return regeneratorRuntime.async(function _handleUpdate$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n if (!(message.obj.SUBCLASS_OF_ID !== 0x8af52aac)) {\n _context11.next = 3;\n break;\n }\n\n // crc32(b'Updates')\n this._log.warn(\"Note: \".concat(message.obj.constructor.name, \" is not an update, not dispatching it\"));\n\n return _context11.abrupt(\"return\");\n\n case 3:\n this._log.debug('Handling update ' + message.obj.constructor.name);\n\n if (this._updateCallback) {\n this._updateCallback(message.obj);\n }\n\n case 5:\n case \"end\":\n return _context11.stop();\n }\n }\n }, null, this);\n }\n /**\n * Handles pong results, which don't come inside a ``RPCResult``\n * but are still sent through a request:\n * pong#347773c5 msg_id:long ping_id:long = Pong;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handlePong\",\n value: function _handlePong(message) {\n var pong, state;\n return regeneratorRuntime.async(function _handlePong$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n pong = message.obj;\n\n this._log.debug(\"Handling pong for message \".concat(pong.msgId));\n\n state = this._pending_state[pong.msgId];\n delete this._pending_state[pong.msgId]; // Todo Check result\n\n if (state) {\n state.resolve(pong);\n }\n\n case 5:\n case \"end\":\n return _context12.stop();\n }\n }\n }, null, this);\n }\n /**\n * Corrects the currently used server salt to use the right value\n * before enqueuing the rejected message to be re-sent:\n * bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int\n * error_code:int new_server_salt:long = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleBadServerSalt\",\n value: function _handleBadServerSalt(message) {\n var badSalt, states;\n return regeneratorRuntime.async(function _handleBadServerSalt$(_context13) {\n while (1) {\n switch (_context13.prev = _context13.next) {\n case 0:\n badSalt = message.obj;\n\n this._log.debug(\"Handling bad salt for message \".concat(badSalt.badMsgId));\n\n this._state.salt = badSalt.newServerSalt;\n states = this._popStates(badSalt.badMsgId);\n\n this._send_queue.extend(states);\n\n this._log.debug(\"\".concat(states.length, \" message(s) will be resent\"));\n\n case 6:\n case \"end\":\n return _context13.stop();\n }\n }\n }, null, this);\n }\n /**\n * Adjusts the current state to be correct based on the\n * received bad message notification whenever possible:\n * bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int\n * error_code:int = BadMsgNotification;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleBadNotification\",\n value: function _handleBadNotification(message) {\n var badMsg, states, to;\n return regeneratorRuntime.async(function _handleBadNotification$(_context14) {\n while (1) {\n switch (_context14.prev = _context14.next) {\n case 0:\n badMsg = message.obj;\n states = this._popStates(badMsg.badMsgId);\n\n this._log.debug(\"Handling bad msg \".concat(badMsg));\n\n if (![16, 17].contains(badMsg.errorCode)) {\n _context14.next = 8;\n break;\n }\n\n // Sent msg_id too low or too high (respectively).\n // Use the current msg_id to determine the right time offset.\n to = this._state.updateTimeOffset(message.msgId);\n\n this._log.info(\"System clock is wrong, set time offset to \".concat(to, \"s\"));\n\n _context14.next = 17;\n break;\n\n case 8:\n if (!(badMsg.errorCode === 32)) {\n _context14.next = 12;\n break;\n }\n\n // msg_seqno too low, so just pump it up by some \"large\" amount\n // TODO A better fix would be to start with a new fresh session ID\n this._state._sequence += 64;\n _context14.next = 17;\n break;\n\n case 12:\n if (!(badMsg.errorCode === 33)) {\n _context14.next = 16;\n break;\n }\n\n // msg_seqno too high never seems to happen but just in case\n this._state._sequence -= 16;\n _context14.next = 17;\n break;\n\n case 16:\n return _context14.abrupt(\"return\");\n\n case 17:\n // Messages are to be re-sent once we've corrected the issue\n this._send_queue.extend(states);\n\n this._log.debug(\"\".concat(states.length, \" messages will be resent due to bad msg\"));\n\n case 19:\n case \"end\":\n return _context14.stop();\n }\n }\n }, null, this);\n }\n /**\n * Updates the current status with the received detailed information:\n * msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleDetailedInfo\",\n value: function _handleDetailedInfo(message) {\n var msgId;\n return regeneratorRuntime.async(function _handleDetailedInfo$(_context15) {\n while (1) {\n switch (_context15.prev = _context15.next) {\n case 0:\n // TODO https://goo.gl/VvpCC6\n msgId = message.obj.answerMsgId;\n\n this._log.debug(\"Handling detailed info for message \".concat(msgId));\n\n this._pending_ack.add(msgId);\n\n case 3:\n case \"end\":\n return _context15.stop();\n }\n }\n }, null, this);\n }\n /**\n * Updates the current status with the received detailed information:\n * msg_new_detailed_info#809db6df answer_msg_id:long\n * bytes:int status:int = MsgDetailedInfo;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleNewDetailedInfo\",\n value: function _handleNewDetailedInfo(message) {\n var msgId;\n return regeneratorRuntime.async(function _handleNewDetailedInfo$(_context16) {\n while (1) {\n switch (_context16.prev = _context16.next) {\n case 0:\n // TODO https://goo.gl/VvpCC6\n msgId = message.obj.answerMsgId;\n\n this._log.debug(\"Handling new detailed info for message \".concat(msgId));\n\n this._pending_ack.add(msgId);\n\n case 3:\n case \"end\":\n return _context16.stop();\n }\n }\n }, null, this);\n }\n /**\n * Updates the current status with the received session information:\n * new_session_created#9ec20908 first_msg_id:long unique_id:long\n * server_salt:long = NewSession;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleNewSessionCreated\",\n value: function _handleNewSessionCreated(message) {\n return regeneratorRuntime.async(function _handleNewSessionCreated$(_context17) {\n while (1) {\n switch (_context17.prev = _context17.next) {\n case 0:\n // TODO https://goo.gl/LMyN7A\n this._log.debug('Handling new session created');\n\n this._state.salt = message.obj.serverSalt;\n\n case 2:\n case \"end\":\n return _context17.stop();\n }\n }\n }, null, this);\n }\n /**\n * Handles a server acknowledge about our messages. Normally\n * these can be ignored except in the case of ``auth.logOut``:\n *\n * auth.logOut#5717da40 = Bool;\n *\n * Telegram doesn't seem to send its result so we need to confirm\n * it manually. No other request is known to have this behaviour.\n * Since the ID of sent messages consisting of a container is\n * never returned (unless on a bad notification), this method\n * also removes containers messages when any of their inner\n * messages are acknowledged.\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleAck\",\n value: function _handleAck(message) {\n var ack, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, msgId, state;\n\n return regeneratorRuntime.async(function _handleAck$(_context18) {\n while (1) {\n switch (_context18.prev = _context18.next) {\n case 0:\n ack = message.obj;\n\n this._log.debug(\"Handling acknowledge for \".concat(ack.msgIds));\n\n _iteratorNormalCompletion5 = true;\n _didIteratorError5 = false;\n _iteratorError5 = undefined;\n _context18.prev = 5;\n\n for (_iterator5 = ack.msgIds[Symbol.iterator](); !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n msgId = _step5.value;\n state = this._pending_state[msgId];\n\n if (state && state.request instanceof LogOutRequest) {\n delete this._pending_state[msgId];\n state.resolve(true);\n }\n }\n\n _context18.next = 13;\n break;\n\n case 9:\n _context18.prev = 9;\n _context18.t0 = _context18[\"catch\"](5);\n _didIteratorError5 = true;\n _iteratorError5 = _context18.t0;\n\n case 13:\n _context18.prev = 13;\n _context18.prev = 14;\n\n if (!_iteratorNormalCompletion5 && _iterator5[\"return\"] != null) {\n _iterator5[\"return\"]();\n }\n\n case 16:\n _context18.prev = 16;\n\n if (!_didIteratorError5) {\n _context18.next = 19;\n break;\n }\n\n throw _iteratorError5;\n\n case 19:\n return _context18.finish(16);\n\n case 20:\n return _context18.finish(13);\n\n case 21:\n case \"end\":\n return _context18.stop();\n }\n }\n }, null, this, [[5, 9, 13, 21], [14,, 16, 20]]);\n }\n /**\n * Handles future salt results, which don't come inside a\n * ``rpc_result`` but are still sent through a request:\n * future_salts#ae500895 req_msg_id:long now:int\n * salts:vector = FutureSalts;\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleFutureSalts\",\n value: function _handleFutureSalts(message) {\n var state;\n return regeneratorRuntime.async(function _handleFutureSalts$(_context19) {\n while (1) {\n switch (_context19.prev = _context19.next) {\n case 0:\n // TODO save these salts and automatically adjust to the\n // correct one whenever the salt in use expires.\n this._log.debug(\"Handling future salts for message \".concat(message.msgId));\n\n state = this._pending_state[message.msgId];\n\n if (state) {\n delete this._pending_state[message];\n state.resolve(message.obj);\n }\n\n case 3:\n case \"end\":\n return _context19.stop();\n }\n }\n }, null, this);\n }\n /**\n * Handles both :tl:`MsgsStateReq` and :tl:`MsgResendReq` by\n * enqueuing a :tl:`MsgsStateInfo` to be sent at a later point.\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleStateForgotten\",\n value: function _handleStateForgotten(message) {\n return regeneratorRuntime.async(function _handleStateForgotten$(_context20) {\n while (1) {\n switch (_context20.prev = _context20.next) {\n case 0:\n this._send_queue.append(new RequestState(new MsgsStateInfo(message.msgId, String.fromCharCode(1).repeat(message.obj.msgIds))));\n\n case 1:\n case \"end\":\n return _context20.stop();\n }\n }\n }, null, this);\n }\n /**\n * Handles :tl:`MsgsAllInfo` by doing nothing (yet).\n * @param message\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: \"_handleMsgAll\",\n value: function _handleMsgAll(message) {\n return regeneratorRuntime.async(function _handleMsgAll$(_context21) {\n while (1) {\n switch (_context21.prev = _context21.next) {\n case 0:\n case \"end\":\n return _context21.stop();\n }\n }\n });\n }\n }, {\n key: \"_startReconnect\",\n value: function _startReconnect(e) {\n if (this._user_connected && !this._reconnecting) {\n this._reconnecting = true;\n\n this._reconnect(e);\n }\n }\n }, {\n key: \"_reconnect\",\n value: function _reconnect(e) {\n var retries, attempt;\n return regeneratorRuntime.async(function _reconnect$(_context22) {\n while (1) {\n switch (_context22.prev = _context22.next) {\n case 0:\n this._log.debug('Closing current connection...');\n\n _context22.next = 3;\n return regeneratorRuntime.awrap(this._connection.disconnect());\n\n case 3:\n this._reconnecting = false;\n\n this._state.reset();\n\n retries = this._retries;\n attempt = 0;\n\n case 7:\n if (!(attempt < retries)) {\n _context22.next = 25;\n break;\n }\n\n _context22.prev = 8;\n _context22.next = 11;\n return regeneratorRuntime.awrap(this._connect());\n\n case 11:\n this._send_queue.extend(Object.values(this._pending_state));\n\n this._pending_state = {};\n\n if (this._autoReconnectCallback) {\n this._autoReconnectCallback();\n }\n\n return _context22.abrupt(\"break\", 25);\n\n case 17:\n _context22.prev = 17;\n _context22.t0 = _context22[\"catch\"](8);\n\n this._log.error(_context22.t0);\n\n _context22.next = 22;\n return regeneratorRuntime.awrap(Helpers.sleep(this._delay));\n\n case 22:\n attempt++;\n _context22.next = 7;\n break;\n\n case 25:\n case \"end\":\n return _context22.stop();\n }\n }\n }, null, this, [[8, 17]]);\n }\n }]);\n\n return MTProtoSender;\n}();\n\n_defineProperty(MTProtoSender, \"DEFAULT_OPTIONS\", {\n logger: null,\n retries: 5,\n delay: 1,\n autoReconnect: true,\n connectTimeout: null,\n authKeyCallback: null,\n updateCallback: null,\n autoReconnectCallback: null\n});\n\nmodule.exports = MTProtoSender;\n\n//# sourceURL=webpack://gramjs/./gramjs/network/MTProtoSender.js?"); /***/ }), /***/ "./gramjs/network/MTProtoState.js": /*!****************************************!*\ !*** ./gramjs/network/MTProtoState.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar Helpers = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\");\n\nvar AES = __webpack_require__(/*! ../crypto/AES */ \"./gramjs/crypto/AES.js\");\n\nvar BinaryReader = __webpack_require__(/*! ../extensions/BinaryReader */ \"./gramjs/extensions/BinaryReader.js\");\n\nvar GZIPPacked = __webpack_require__(/*! ../tl/core/GZIPPacked */ \"./gramjs/tl/core/GZIPPacked.js\");\n\nvar _require = __webpack_require__(/*! ../tl/core */ \"./gramjs/tl/core/index.js\"),\n TLMessage = _require.TLMessage;\n\nvar _require2 = __webpack_require__(/*! ../errors/Common */ \"./gramjs/errors/Common.js\"),\n SecurityError = _require2.SecurityError,\n InvalidBufferError = _require2.InvalidBufferError;\n\nvar _require3 = __webpack_require__(/*! ../tl/functions */ \"./gramjs/tl/functions/index.js\"),\n InvokeAfterMsgRequest = _require3.InvokeAfterMsgRequest;\n\nvar MTProtoState =\n/*#__PURE__*/\nfunction () {\n /**\n *\n `telethon.network.mtprotosender.MTProtoSender` needs to hold a state\n in order to be able to encrypt and decrypt incoming/outgoing messages,\n as well as generating the message IDs. Instances of this class hold\n together all the required information.\n It doesn't make sense to use `telethon.sessions.abstract.Session` for\n the sender because the sender should *not* be concerned about storing\n this information to disk, as one may create as many senders as they\n desire to any other data center, or some CDN. Using the same session\n for all these is not a good idea as each need their own authkey, and\n the concept of \"copying\" sessions with the unnecessary entities or\n updates state for these connections doesn't make sense.\n While it would be possible to have a `MTProtoPlainState` that does no\n encryption so that it was usable through the `MTProtoLayer` and thus\n avoid the need for a `MTProtoPlainSender`, the `MTProtoLayer` is more\n focused to efficiency and this state is also more advanced (since it\n supports gzipping and invoking after other message IDs). There are too\n many methods that would be needed to make it convenient to use for the\n authentication process, at which point the `MTProtoPlainSender` is better\n * @param authKey\n * @param loggers\n */\n function MTProtoState(authKey, loggers) {\n _classCallCheck(this, MTProtoState);\n\n this.authKey = authKey;\n this._log = loggers;\n this.timeOffset = 0;\n this.salt = 0;\n this.id = this._sequence = this._lastMsgId = null;\n this.reset();\n }\n /**\n * Resets the state\n */\n\n\n _createClass(MTProtoState, [{\n key: \"reset\",\n value: function reset() {\n // Session IDs can be random on every connection\n this.id = Helpers.generateRandomLong(true);\n this._sequence = 0;\n this._lastMsgId = 0;\n }\n /**\n * Updates the message ID to a new one,\n * used when the time offset changed.\n * @param message\n */\n\n }, {\n key: \"updateMessageId\",\n value: function updateMessageId(message) {\n message.msgId = this._getNewMsgId();\n }\n /**\n * Calculate the key based on Telegram guidelines, specifying whether it's the client or not\n * @param authKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n\n }, {\n key: \"_calcKey\",\n value: function _calcKey(authKey, msgKey, client) {\n var x = client === true ? 0 : 8;\n var sha256a = Helpers.sha256(Buffer.concat([msgKey, authKey.slice(x, x + 36)]));\n var sha256b = Helpers.sha256(Buffer.concat([authKey.slice(x + 40, x + 76), msgKey]));\n var key = Buffer.concat([sha256a.slice(0, 8), sha256b.slice(8, 24), sha256a.slice(24, 32)]);\n var iv = Buffer.concat([sha256b.slice(0, 8), sha256a.slice(8, 24), sha256b.slice(24, 32)]);\n return {\n key: key,\n iv: iv\n };\n }\n /**\n * Writes a message containing the given data into buffer.\n * Returns the message id.\n * @param buffer\n * @param data\n * @param contentRelated\n * @param afterId\n */\n\n }, {\n key: \"writeDataAsMessage\",\n value: function writeDataAsMessage(buffer, data, contentRelated, afterId) {\n var msgId, seqNo, body;\n return regeneratorRuntime.async(function writeDataAsMessage$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n msgId = this._getNewMsgId();\n seqNo = this._getSeqNo(contentRelated);\n\n if (afterId) {\n _context.next = 8;\n break;\n }\n\n _context.next = 5;\n return regeneratorRuntime.awrap(GZIPPacked.gzipIfSmaller(contentRelated, data));\n\n case 5:\n body = _context.sent;\n _context.next = 11;\n break;\n\n case 8:\n _context.next = 10;\n return regeneratorRuntime.awrap(GZIPPacked.gzipIfSmaller(contentRelated, new InvokeAfterMsgRequest(afterId, data).toBuffer()));\n\n case 10:\n body = _context.sent;\n\n case 11:\n buffer.write(struct.pack('= newMsgId) {\n newMsgId = this._lastMsgId + BigInt(4);\n }\n\n this._lastMsgId = newMsgId;\n return newMsgId;\n }\n /**\n * Updates the time offset to the correct\n * one given a known valid message ID.\n * @param correctMsgId\n */\n\n }, {\n key: \"updateTimeOffset\",\n value: function updateTimeOffset(correctMsgId) {\n var bad = this._getNewMsgId();\n\n var old = this.timeOffset;\n var now = Math.floor(new Date().getTime() / 1000);\n var correct = correctMsgId >> BigInt(32);\n this.timeOffset = correct - now;\n\n if (this.timeOffset !== old) {\n this._lastMsgId = 0;\n\n this._log.debug(\"Updated time offset (old offset \".concat(old, \", bad \").concat(bad, \", good \").concat(correctMsgId, \", new \").concat(this.timeOffset, \")\"));\n }\n\n return this.timeOffset;\n }\n /**\n * Generates the next sequence number depending on whether\n * it should be for a content-related query or not.\n * @param contentRelated\n * @private\n */\n\n }, {\n key: \"_getSeqNo\",\n value: function _getSeqNo(contentRelated) {\n if (contentRelated) {\n var result = this._sequence * 2 + 1;\n this._sequence += 1;\n return result;\n } else {\n return this._sequence * 2;\n }\n }\n }]);\n\n return MTProtoState;\n}();\n\nmodule.exports = MTProtoState;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/network/MTProtoState.js?"); /***/ }), /***/ "./gramjs/network/RequestState.js": /*!****************************************!*\ !*** ./gramjs/network/RequestState.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RequestState = function RequestState(request) {\n var _this = this;\n\n var after = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, RequestState);\n\n this.containerId = null;\n this.msgId = null;\n this.request = request;\n this.data = request.bytes;\n this.after = after;\n this.result = null;\n this.promise = new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n });\n};\n\nmodule.exports = RequestState;\n\n//# sourceURL=webpack://gramjs/./gramjs/network/RequestState.js?"); /***/ }), /***/ "./gramjs/network/connection/Connection.js": /*!*************************************************!*\ !*** ./gramjs/network/connection/Connection.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(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; }\n\nvar PromisedWebSockets = __webpack_require__(/*! ../../extensions/PromisedWebSockets */ \"./gramjs/extensions/PromisedWebSockets.js\");\n\nvar AsyncQueue = __webpack_require__(/*! ../../extensions/AsyncQueue */ \"./gramjs/extensions/AsyncQueue.js\");\n/**\n * The `Connection` class is a wrapper around ``asyncio.open_connection``.\n *\n * Subclasses will implement different transport modes as atomic operations,\n * which this class eases doing since the exposed interface simply puts and\n * gets complete data payloads to and from queues.\n *\n * The only error that will raise from send and receive methods is\n * ``ConnectionError``, which will raise when attempting to send if\n * the client is disconnected (includes remote disconnections).\n */\n\n\nvar Connection =\n/*#__PURE__*/\nfunction () {\n function Connection(ip, port, dcId, loggers) {\n _classCallCheck(this, Connection);\n\n _defineProperty(this, \"PacketCodecClass\", null);\n\n this._ip = ip;\n this._port = port;\n this._dcId = dcId;\n this._log = loggers;\n this._connected = false;\n this._sendTask = null;\n this._recvTask = null;\n this._codec = null;\n this._obfuscation = null; // TcpObfuscated and MTProxy\n\n this._sendArray = new AsyncQueue();\n this._recvArray = new AsyncQueue(); //this.socket = new PromiseSocket(new Socket())\n\n this.socket = new PromisedWebSockets();\n }\n\n _createClass(Connection, [{\n key: \"_connect\",\n value: function _connect() {\n return regeneratorRuntime.async(function _connect$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this._log.debug('Connecting');\n\n _context.next = 3;\n return regeneratorRuntime.awrap(this.socket.connect(this._port, this._ip));\n\n case 3:\n this._log.debug('Finished connecting'); // await this.socket.connect({host: this._ip, port: this._port});\n\n\n this._codec = new this.PacketCodecClass(this);\n _context.next = 7;\n return regeneratorRuntime.awrap(this._initConn());\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"connect\",\n value: function connect() {\n return regeneratorRuntime.async(function connect$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return regeneratorRuntime.awrap(this._connect());\n\n case 2:\n this._connected = true;\n\n if (!this._sendTask) {\n this._sendTask = this._sendLoop();\n }\n\n this._recvTask = this._recvLoop();\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n return regeneratorRuntime.async(function disconnect$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n this._connected = false;\n _context3.next = 3;\n return regeneratorRuntime.awrap(this.socket.close());\n\n case 3:\n case \"end\":\n return _context3.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"send\",\n value: function send(data) {\n return regeneratorRuntime.async(function send$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (this._connected) {\n _context4.next = 2;\n break;\n }\n\n throw new Error('Not connected');\n\n case 2:\n _context4.next = 4;\n return regeneratorRuntime.awrap(this._sendArray.push(data));\n\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"recv\",\n value: function recv() {\n var result;\n return regeneratorRuntime.async(function recv$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n if (!this._connected) {\n _context5.next = 8;\n break;\n }\n\n _context5.next = 3;\n return regeneratorRuntime.awrap(this._recvArray.pop());\n\n case 3:\n result = _context5.sent;\n\n if (!result) {\n _context5.next = 6;\n break;\n }\n\n return _context5.abrupt(\"return\", result);\n\n case 6:\n _context5.next = 0;\n break;\n\n case 8:\n throw new Error('Not connected');\n\n case 9:\n case \"end\":\n return _context5.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_sendLoop\",\n value: function _sendLoop() {\n var data;\n return regeneratorRuntime.async(function _sendLoop$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.prev = 0;\n\n case 1:\n if (!this._connected) {\n _context6.next = 9;\n break;\n }\n\n _context6.next = 4;\n return regeneratorRuntime.awrap(this._sendArray.pop());\n\n case 4:\n data = _context6.sent;\n _context6.next = 7;\n return regeneratorRuntime.awrap(this._send(data));\n\n case 7:\n _context6.next = 1;\n break;\n\n case 9:\n _context6.next = 15;\n break;\n\n case 11:\n _context6.prev = 11;\n _context6.t0 = _context6[\"catch\"](0);\n console.log(_context6.t0);\n\n this._log.info('The server closed the connection while sending');\n\n case 15:\n case \"end\":\n return _context6.stop();\n }\n }\n }, null, this, [[0, 11]]);\n }\n }, {\n key: \"_recvLoop\",\n value: function _recvLoop() {\n var data;\n return regeneratorRuntime.async(function _recvLoop$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n if (!this._connected) {\n _context7.next = 18;\n break;\n }\n\n _context7.prev = 1;\n _context7.next = 4;\n return regeneratorRuntime.awrap(this._recv());\n\n case 4:\n data = _context7.sent;\n\n if (data) {\n _context7.next = 7;\n break;\n }\n\n return _context7.abrupt(\"return\");\n\n case 7:\n _context7.next = 14;\n break;\n\n case 9:\n _context7.prev = 9;\n _context7.t0 = _context7[\"catch\"](1);\n console.log(_context7.t0);\n\n this._log.info('an error occured');\n\n return _context7.abrupt(\"return\");\n\n case 14:\n _context7.next = 16;\n return regeneratorRuntime.awrap(this._recvArray.push(data));\n\n case 16:\n _context7.next = 0;\n break;\n\n case 18:\n case \"end\":\n return _context7.stop();\n }\n }\n }, null, this, [[1, 9]]);\n }\n }, {\n key: \"_initConn\",\n value: function _initConn() {\n return regeneratorRuntime.async(function _initConn$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n if (!this._codec.tag) {\n _context8.next = 3;\n break;\n }\n\n _context8.next = 3;\n return regeneratorRuntime.awrap(this.socket.write(this._codec.tag));\n\n case 3:\n case \"end\":\n return _context8.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_send\",\n value: function _send(data) {\n var encodedPacket;\n return regeneratorRuntime.async(function _send$(_context9) {\n while (1) {\n switch (_context9.prev = _context9.next) {\n case 0:\n encodedPacket = this._codec.encodePacket(data);\n this.socket.write(encodedPacket);\n\n case 2:\n case \"end\":\n return _context9.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_recv\",\n value: function _recv() {\n return regeneratorRuntime.async(function _recv$(_context10) {\n while (1) {\n switch (_context10.prev = _context10.next) {\n case 0:\n _context10.next = 2;\n return regeneratorRuntime.awrap(this._codec.readPacket(this.socket));\n\n case 2:\n return _context10.abrupt(\"return\", _context10.sent);\n\n case 3:\n case \"end\":\n return _context10.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this._ip, \":\").concat(this._port, \"/\").concat(this.constructor.name.replace('Connection', ''));\n }\n }]);\n\n return Connection;\n}();\n\nvar ObfuscatedConnection =\n/*#__PURE__*/\nfunction (_Connection) {\n _inherits(ObfuscatedConnection, _Connection);\n\n function ObfuscatedConnection() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ObfuscatedConnection);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ObfuscatedConnection)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"ObfuscatedIO\", null);\n\n return _this;\n }\n\n _createClass(ObfuscatedConnection, [{\n key: \"_initConn\",\n value: function _initConn() {\n return regeneratorRuntime.async(function _initConn$(_context11) {\n while (1) {\n switch (_context11.prev = _context11.next) {\n case 0:\n this._obfuscation = new this.ObfuscatedIO(this);\n this.socket.write(this._obfuscation.header);\n\n case 2:\n case \"end\":\n return _context11.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"_send\",\n value: function _send(data) {\n this._obfuscation.write(this._codec.encodePacket(data));\n }\n }, {\n key: \"_recv\",\n value: function _recv() {\n return regeneratorRuntime.async(function _recv$(_context12) {\n while (1) {\n switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return regeneratorRuntime.awrap(this._codec.readPacket(this._obfuscation));\n\n case 2:\n return _context12.abrupt(\"return\", _context12.sent);\n\n case 3:\n case \"end\":\n return _context12.stop();\n }\n }\n }, null, this);\n }\n }]);\n\n return ObfuscatedConnection;\n}(Connection);\n\nvar PacketCodec =\n/*#__PURE__*/\nfunction () {\n function PacketCodec(connection) {\n _classCallCheck(this, PacketCodec);\n\n this._conn = connection;\n }\n\n _createClass(PacketCodec, [{\n key: \"encodePacket\",\n value: function encodePacket(data) {\n throw new Error('Not Implemented'); // Override\n }\n }, {\n key: \"readPacket\",\n value: function readPacket(reader) {\n return regeneratorRuntime.async(function readPacket$(_context13) {\n while (1) {\n switch (_context13.prev = _context13.next) {\n case 0:\n throw new Error('Not Implemented');\n\n case 1:\n case \"end\":\n return _context13.stop();\n }\n }\n });\n }\n }]);\n\n return PacketCodec;\n}();\n\nmodule.exports = {\n Connection: Connection,\n PacketCodec: PacketCodec,\n ObfuscatedConnection: ObfuscatedConnection\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/network/connection/Connection.js?"); /***/ }), /***/ "./gramjs/network/connection/TCPAbridged.js": /*!**************************************************!*\ !*** ./gramjs/network/connection/TCPAbridged.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar _require = __webpack_require__(/*! ../../Helpers */ \"./gramjs/Helpers.js\"),\n readBufferFromBigInt = _require.readBufferFromBigInt;\n\nvar _require2 = __webpack_require__(/*! ./Connection */ \"./gramjs/network/connection/Connection.js\"),\n Connection = _require2.Connection,\n PacketCodec = _require2.PacketCodec;\n\nvar AbridgedPacketCodec =\n/*#__PURE__*/\nfunction (_PacketCodec) {\n _inherits(AbridgedPacketCodec, _PacketCodec);\n\n function AbridgedPacketCodec(props) {\n var _this;\n\n _classCallCheck(this, AbridgedPacketCodec);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AbridgedPacketCodec).call(this, props));\n _this.tag = AbridgedPacketCodec.tag;\n _this.obfuscateTag = AbridgedPacketCodec.obfuscateTag;\n return _this;\n }\n\n _createClass(AbridgedPacketCodec, [{\n key: \"encodePacket\",\n value: function encodePacket(data) {\n var length = data.length >> 2;\n\n if (length < 127) {\n length = struct.pack('B', length);\n } else {\n length = Buffer.from('7f', 'hex') + readBufferFromBigInt(BigInt(length), 3);\n }\n\n return Buffer.concat([length, data]);\n }\n }, {\n key: \"readPacket\",\n value: function readPacket(reader) {\n var readData, length;\n return regeneratorRuntime.async(function readPacket$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return regeneratorRuntime.awrap(reader.read(1));\n\n case 2:\n readData = _context.sent;\n length = struct.unpack('= 127)) {\n _context.next = 14;\n break;\n }\n\n _context.t0 = struct;\n _context.t1 = Buffer;\n _context.next = 9;\n return regeneratorRuntime.awrap(reader.read(3));\n\n case 9:\n _context.t2 = _context.sent;\n _context.t3 = Buffer.alloc(1);\n _context.t4 = [_context.t2, _context.t3];\n _context.t5 = _context.t1.concat.call(_context.t1, _context.t4);\n length = _context.t0.unpack.call(_context.t0, '}\n */\n\n }, {\n key: \"readPacket\",\n value: function readPacket(reader) {\n var packetLenSeq, res, _res, packetLen, body, _struct$unpack, _struct$unpack2, checksum, validChecksum;\n\n return regeneratorRuntime.async(function readPacket$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return regeneratorRuntime.awrap(reader.read(8));\n\n case 2:\n packetLenSeq = _context.sent;\n\n if (!(packetLenSeq === undefined)) {\n _context.next = 5;\n break;\n }\n\n return _context.abrupt(\"return\", false);\n\n case 5:\n res = struct.unpack(' 0 && arguments[0] !== undefined ? arguments[0] : null;\n return toInstance || new this.constructor();\n }\n /**\n * Sets the information of the data center address and port that\n * the library should connect to, as well as the data center ID,\n * which is currently unused.\n * @param dcId {number}\n * @param serverAddress {string}\n * @param port {number}\n */\n\n }, {\n key: \"setDC\",\n value: function setDC(dcId, serverAddress, port) {\n throw new Error('Not implemented');\n }\n /**\n * Returns the currently-used data center ID.\n */\n\n }, {\n key: \"getUpdateState\",\n\n /**\n * Returns the ``UpdateState`` associated with the given `entity_id`.\n * If the `entity_id` is 0, it should return the ``UpdateState`` for\n * no specific channel (the \"general\" state). If no state is known\n * it should ``return None``.\n * @param entityId\n */\n value: function getUpdateState(entityId) {\n throw new Error('Not Implemented');\n }\n /**\n * Sets the given ``UpdateState`` for the specified `entity_id`, which\n * should be 0 if the ``UpdateState`` is the \"general\" state (and not\n * for any specific channel).\n * @param entityId\n * @param state\n */\n\n }, {\n key: \"setUpdateState\",\n value: function setUpdateState(entityId, state) {\n throw new Error('Not Implemented');\n }\n /**\n * Called on client disconnection. Should be used to\n * free any used resources. Can be left empty if none.\n */\n\n }, {\n key: \"close\",\n value: function close() {}\n /**\n * called whenever important properties change. It should\n * make persist the relevant session information to disk.\n */\n\n }, {\n key: \"save\",\n value: function save() {\n throw new Error('Not Implemented');\n }\n /**\n * Called upon client.log_out(). Should delete the stored\n * information from disk since it's not valid anymore.\n */\n\n }, {\n key: \"delete\",\n value: function _delete() {\n throw new Error('Not Implemented');\n }\n /**\n * Lists available sessions. Not used by the library itself.\n */\n\n }, {\n key: \"listSessions\",\n value: function listSessions() {\n throw new Error('Not Implemented');\n }\n /**\n * Processes the input ``TLObject`` or ``list`` and saves\n * whatever information is relevant (e.g., ID or access hash).\n * @param tlo\n */\n\n }, {\n key: \"processEntities\",\n value: function processEntities(tlo) {\n throw new Error('Not Implemented');\n }\n /**\n * Turns the given key into an ``InputPeer`` (e.g. ``InputPeerUser``).\n * The library uses this method whenever an ``InputPeer`` is needed\n * to suit several purposes (e.g. user only provided its ID or wishes\n * to use a cached username to avoid extra RPC).\n */\n\n }, {\n key: \"getInputEntity\",\n value: function getInputEntity(key) {\n throw new Error('Not Implemented');\n }\n }, {\n key: \"dcId\",\n get: function get() {\n throw new Error('Not Implemented');\n }\n /**\n * Returns the server address where the library should connect to.\n */\n\n }, {\n key: \"serverAddress\",\n get: function get() {\n throw new Error('Not Implemented');\n }\n /**\n * Returns the port to which the library should connect to.\n */\n\n }, {\n key: \"port\",\n get: function get() {\n throw new Error('Not Implemented');\n }\n /**\n * Returns an ``AuthKey`` instance associated with the saved\n * data center, or `None` if a new one should be generated.\n */\n\n }, {\n key: \"authKey\",\n get: function get() {\n throw new Error('Not Implemented');\n }\n /**\n * Sets the ``AuthKey`` to be used for the saved data center.\n * @param value\n */\n ,\n set: function set(value) {\n throw new Error('Not Implemented');\n }\n /**\n * Returns an ID of the takeout process initialized for this session,\n * or `None` if there's no were any unfinished takeout requests.\n */\n\n }, {\n key: \"takeoutId\",\n get: function get() {\n throw new Error('Not Implemented');\n }\n /**\n * Sets the ID of the unfinished takeout process for this session.\n * @param value\n */\n ,\n set: function set(value) {\n throw new Error('Not Implemented');\n }\n }]);\n\n return Session;\n}();\n\nmodule.exports = Session;\n\n//# sourceURL=webpack://gramjs/./gramjs/sessions/Abstract.js?"); /***/ }), /***/ "./gramjs/sessions/JSONSession.js": /*!****************************************!*\ !*** ./gramjs/sessions/JSONSession.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar _require = __webpack_require__(/*! ../Helpers */ \"./gramjs/Helpers.js\"),\n generateRandomLong = _require.generateRandomLong,\n getRandomInt = _require.getRandomInt;\n\nvar fs = __webpack_require__(/*! fs */ 4).promises;\n\nvar _require2 = __webpack_require__(/*! fs */ 4),\n existsSync = _require2.existsSync,\n readFileSync = _require2.readFileSync;\n\nvar AuthKey = __webpack_require__(/*! ../crypto/AuthKey */ \"./gramjs/crypto/AuthKey.js\");\n\nvar _require3 = __webpack_require__(/*! ../tl/tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require3.TLObject;\n\nvar utils = __webpack_require__(/*! ../Utils */ \"./gramjs/Utils.js\");\n\nvar types = __webpack_require__(/*! ../tl/types */ \"./gramjs/tl/types/index.js\");\n\nBigInt.toJSON = function () {\n return {\n fool: this.fool.toString('hex')\n };\n};\n\nBigInt.parseJson = function () {\n return {\n fool: BigInt('0x' + this.fool)\n };\n};\n\nvar Session =\n/*#__PURE__*/\nfunction () {\n function Session(sessionUserId) {\n _classCallCheck(this, Session);\n\n this.sessionUserId = sessionUserId;\n this._serverAddress = null;\n this._dcId = 0;\n this._port = null; // this.serverAddress = \"localhost\";\n // this.port = 21;\n\n this.authKey = undefined;\n this.id = generateRandomLong(false);\n this.sequence = 0;\n this.salt = BigInt(0); // Unsigned long\n\n this.timeOffset = BigInt(0);\n this.lastMessageId = BigInt(0);\n this.user = undefined;\n this._files = {};\n this._entities = new Set();\n this._updateStates = {};\n }\n /**\n * Saves the current session object as session_user_id.session\n */\n\n\n _createClass(Session, [{\n key: \"save\",\n value: function save() {\n var str;\n return regeneratorRuntime.async(function save$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!this.sessionUserId) {\n _context.next = 4;\n break;\n }\n\n str = JSON.stringify(this, function (key, value) {\n if (typeof value === 'bigint') {\n return value.toString() + 'n';\n } else {\n return value;\n }\n });\n _context.next = 4;\n return regeneratorRuntime.awrap(fs.writeFile(\"\".concat(this.sessionUserId, \".session\"), str));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"setDC\",\n value: function setDC(dcId, serverAddress, port) {\n this._dcId = dcId | 0;\n this._serverAddress = serverAddress;\n this._port = port;\n }\n }, {\n key: \"getUpdateState\",\n value: function getUpdateState(entityId) {\n return this._updateStates[entityId];\n }\n }, {\n key: \"setUpdateState\",\n value: function setUpdateState(entityId, state) {\n return this._updateStates[entityId] = state;\n }\n }, {\n key: \"close\",\n value: function close() {}\n }, {\n key: \"delete\",\n value: function _delete() {}\n }, {\n key: \"_entityValuesToRow\",\n value: function _entityValuesToRow(id, hash, username, phone, name) {\n // While this is a simple implementation it might be overrode by,\n // other classes so they don't need to implement the plural form\n // of the method. Don't remove.\n return [id, hash, username, phone, name];\n }\n }, {\n key: \"_entityToRow\",\n value: function _entityToRow(e) {\n if (!(e instanceof TLObject)) {\n return;\n }\n\n var p;\n var markedId;\n\n try {\n p = utils.getInputPeer(e, false);\n markedId = utils.getPeerId(p);\n } catch (e) {\n // Note: `get_input_peer` already checks for non-zero `access_hash`.\n // See issues #354 and #392. It also checks that the entity\n // is not `min`, because its `access_hash` cannot be used\n // anywhere (since layer 102, there are two access hashes).\n return;\n }\n\n var pHash;\n\n if (p instanceof types.InputPeerUser || p instanceof types.InputPeerChannel) {\n pHash = p.accessHash;\n } else if (p instanceof types.InputPeerChat) {\n pHash = 0;\n } else {\n return;\n }\n\n var username = e.username;\n\n if (username) {\n username = username.toLowerCase();\n }\n\n var phone = e.phone;\n var name = utils.getDisplayName(e);\n return this._entityValuesToRow(markedId, pHash, username, phone, name);\n }\n }, {\n key: \"_entitiesToRows\",\n value: function _entitiesToRows(tlo) {\n var entities = [];\n\n if (tlo instanceof TLObject && utils.isListLike(tlo)) {\n // This may be a list of users already for instance\n entities = tlo;\n } else {\n if ('user' in tlo) {\n entities.push(tlo.user);\n }\n\n if ('chats' in tlo && utils.isListLike(tlo.chats)) {\n entities.concat(tlo.chats);\n }\n\n if ('users' in tlo && utils.isListLike(tlo.users)) {\n entities.concat(tlo.users);\n }\n }\n\n var rows = []; // Rows to add (id, hash, username, phone, name)\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = entities[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var e = _step.value;\n\n var row = this._entityToRow(e);\n\n if (row) {\n rows.push(row);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return rows;\n }\n }, {\n key: \"getNewMsgId\",\n value: function getNewMsgId() {\n var msTime = new Date().getTime();\n var newMessageId = BigInt(BigInt(Math.floor(msTime / 1000)) + this.timeOffset) << BigInt(32) | BigInt(msTime % 1000) << BigInt(22) | BigInt(getRandomInt(0, 524288)) << BigInt(2); // 2^19\n\n if (this.lastMessageId >= newMessageId) {\n newMessageId = this.lastMessageId + BigInt(4);\n }\n\n this.lastMessageId = newMessageId;\n return newMessageId;\n }\n }, {\n key: \"processEntities\",\n value: function processEntities(tlo) {\n var entitiesSet = this._entitiesToRows(tlo);\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = entitiesSet[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var e = _step2.value;\n\n this._entities.add(e);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2[\"return\"] != null) {\n _iterator2[\"return\"]();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByPhone\",\n value: function getEntityRowsByPhone(phone) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = this._entities[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var e = _step3.value;\n\n // id, hash, username, phone, name\n if (e[3] === phone) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3[\"return\"] != null) {\n _iterator3[\"return\"]();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByName\",\n value: function getEntityRowsByName(name) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = this._entities[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var e = _step4.value;\n\n // id, hash, username, phone, name\n if (e[4] === name) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4[\"return\"] != null) {\n _iterator4[\"return\"]();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByUsername\",\n value: function getEntityRowsByUsername(username) {\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = this._entities[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var e = _step5.value;\n\n // id, hash, username, phone, name\n if (e[2] === username) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5[\"return\"] != null) {\n _iterator5[\"return\"]();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsById\",\n value: function getEntityRowsById(id) {\n var exact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (exact) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = this._entities[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var e = _step6.value;\n\n // id, hash, username, phone, name\n if (e[0] === id) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6[\"return\"] != null) {\n _iterator6[\"return\"]();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n } else {\n var ids = [utils.getPeerId(new types.PeerUser({\n userId: id\n })), utils.getPeerId(new types.PeerChat({\n chatId: id\n })), utils.getPeerId(new types.PeerChannel({\n channelId: id\n }))];\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = this._entities[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var _e = _step7.value;\n\n // id, hash, username, phone, name\n if (ids.includes(_e[0])) {\n return [_e[0], _e[1]];\n }\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7[\"return\"] != null) {\n _iterator7[\"return\"]();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n }\n }, {\n key: \"getInputEntity\",\n value: function getInputEntity(key) {\n var exact;\n\n if (key.SUBCLASS_OF_ID !== undefined) {\n if ([0xc91c90b6, 0xe669bf46, 0x40f202fd].includes(key.SUBCLASS_OF_ID)) {\n // hex(crc32(b'InputPeer', b'InputUser' and b'InputChannel'))\n // We already have an Input version, so nothing else required\n return key;\n } // Try to early return if this key can be casted as input peer\n\n\n return utils.getInputPeer(key);\n } else {\n // Not a TLObject or can't be cast into InputPeer\n if (key instanceof TLObject) {\n key = utils.getPeerId(key);\n exact = true;\n } else {\n exact = !(typeof key == 'number') || key < 0;\n }\n }\n\n var result = null;\n\n if (typeof key === 'string') {\n var phone = utils.parsePhone(key);\n\n if (phone) {\n result = this.getEntityRowsByPhone(phone);\n } else {\n var _utils$parseUsername = utils.parseUsername(key),\n username = _utils$parseUsername.username,\n isInvite = _utils$parseUsername.isInvite;\n\n if (username && !isInvite) {\n result = this.getEntityRowsByUsername(username);\n } else {\n var tup = utils.resolveInviteLink(key)[1];\n\n if (tup) {\n result = this.getEntityRowsById(tup, false);\n }\n }\n }\n } else if (typeof key === 'number') {\n result = this.getEntityRowsById(key, exact);\n }\n\n if (!result && typeof key === 'string') {\n result = this.getEntityRowsByName(key);\n }\n\n if (result) {\n var entityId = result[0]; // unpack resulting tuple\n\n var entityHash = result[1];\n var resolved = utils.resolveId(entityId);\n entityId = resolved[0];\n var kind = resolved[1]; // removes the mark and returns type of entity\n\n if (kind === types.PeerUser) {\n return new types.InputPeerUser({\n userId: entityId,\n accessHash: entityHash\n });\n } else if (kind === types.PeerChat) {\n return new types.InputPeerChat({\n chatId: entityId\n });\n } else if (kind === types.PeerChannel) {\n return new types.InputPeerChannel({\n channelId: entityId,\n accessHash: entityHash\n });\n }\n } else {\n throw new Error('Could not find input entity with key ' + key);\n }\n }\n }, {\n key: \"serverAddress\",\n get: function get() {\n return this._serverAddress;\n }\n }, {\n key: \"port\",\n get: function get() {\n return this._port;\n }\n }, {\n key: \"dcId\",\n get: function get() {\n return this._dcId;\n }\n }], [{\n key: \"tryLoadOrCreateNew\",\n value: function tryLoadOrCreateNew(sessionUserId) {\n if (sessionUserId === undefined) {\n return new Session();\n }\n\n var filepath = \"\".concat(sessionUserId, \".session\");\n\n if (existsSync(filepath)) {\n try {\n var ob = JSON.parse(readFileSync(filepath, 'utf-8'), function (key, value) {\n if (typeof value == 'string' && value.match(/(\\d+)n/)) {\n return BigInt(value.slice(0, -1));\n } else {\n return value;\n }\n });\n var authKey = new AuthKey(Buffer.from(ob.authKey._key.data));\n var session = new Session(ob.sessionUserId);\n session._serverAddress = ob._serverAddress;\n session._port = ob._port;\n session._dcId = ob._dcId; // this.serverAddress = \"localhost\";\n // this.port = 21;\n\n session.authKey = authKey;\n session.id = ob.id;\n session.sequence = ob.sequence;\n session.salt = ob.salt; // Unsigned long\n\n session.timeOffset = ob.timeOffset;\n session.lastMessageId = ob.lastMessageId;\n session.user = ob.user;\n return session;\n } catch (e) {\n return new Session(sessionUserId);\n }\n } else {\n return new Session(sessionUserId);\n }\n }\n }]);\n\n return Session;\n}();\n\nmodule.exports = Session;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/sessions/JSONSession.js?"); /***/ }), /***/ "./gramjs/sessions/Memory.js": /*!***********************************!*\ !*** ./gramjs/sessions/Memory.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = __webpack_require__(/*! ../tl/tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar utils = __webpack_require__(/*! ../Utils */ \"./gramjs/Utils.js\");\n\nvar types = __webpack_require__(/*! ../tl/types */ \"./gramjs/tl/types/index.js\");\n\nvar Session = __webpack_require__(/*! ./Abstract */ \"./gramjs/sessions/Abstract.js\");\n\nvar MemorySession =\n/*#__PURE__*/\nfunction (_Session) {\n _inherits(MemorySession, _Session);\n\n function MemorySession() {\n var _this;\n\n _classCallCheck(this, MemorySession);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MemorySession).call(this));\n _this._serverAddress = null;\n _this._dcId = 0;\n _this._port = null;\n _this._authKey = null;\n _this._takeoutId = null;\n _this._entities = new Set();\n _this._updateStates = {};\n return _this;\n }\n\n _createClass(MemorySession, [{\n key: \"setDC\",\n value: function setDC(dcId, serverAddress, port) {\n this._dcId = dcId | 0;\n this._serverAddress = serverAddress;\n this._port = port;\n }\n }, {\n key: \"getUpdateState\",\n value: function getUpdateState(entityId) {\n return this._updateStates[entityId];\n }\n }, {\n key: \"setUpdateState\",\n value: function setUpdateState(entityId, state) {\n return this._updateStates[entityId] = state;\n }\n }, {\n key: \"close\",\n value: function close() {}\n }, {\n key: \"save\",\n value: function save() {}\n }, {\n key: \"delete\",\n value: function _delete() {}\n }, {\n key: \"_entityValuesToRow\",\n value: function _entityValuesToRow(id, hash, username, phone, name) {\n // While this is a simple implementation it might be overrode by,\n // other classes so they don't need to implement the plural form\n // of the method. Don't remove.\n return [id, hash, username, phone, name];\n }\n }, {\n key: \"_entityToRow\",\n value: function _entityToRow(e) {\n if (!(e instanceof TLObject)) {\n return;\n }\n\n var p;\n var markedId;\n\n try {\n p = utils.getInputPeer(e, false);\n markedId = utils.getPeerId(p);\n } catch (e) {\n // Note: `get_input_peer` already checks for non-zero `access_hash`.\n // See issues #354 and #392. It also checks that the entity\n // is not `min`, because its `access_hash` cannot be used\n // anywhere (since layer 102, there are two access hashes).\n return;\n }\n\n var pHash;\n\n if (p instanceof types.InputPeerUser || p instanceof types.InputPeerChannel) {\n pHash = p.accessHash;\n } else if (p instanceof types.InputPeerChat) {\n pHash = 0;\n } else {\n return;\n }\n\n var username = e.username;\n\n if (username) {\n username = username.toLowerCase();\n }\n\n var phone = e.phone;\n var name = utils.getDisplayName(e);\n return this._entityValuesToRow(markedId, pHash, username, phone, name);\n }\n }, {\n key: \"_entitiesToRows\",\n value: function _entitiesToRows(tlo) {\n var entities = [];\n\n if (tlo instanceof TLObject && utils.isListLike(tlo)) {\n // This may be a list of users already for instance\n entities = tlo;\n } else {\n if ('user' in tlo) {\n entities.push(tlo.user);\n }\n\n if ('chats' in tlo && utils.isListLike(tlo.chats)) {\n entities.concat(tlo.chats);\n }\n\n if ('users' in tlo && utils.isListLike(tlo.users)) {\n entities.concat(tlo.users);\n }\n }\n\n var rows = []; // Rows to add (id, hash, username, phone, name)\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = entities[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var e = _step.value;\n\n var row = this._entityToRow(e);\n\n if (row) {\n rows.push(row);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return rows;\n }\n }, {\n key: \"processEntities\",\n value: function processEntities(tlo) {\n var entitiesSet = this._entitiesToRows(tlo);\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = entitiesSet[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var e = _step2.value;\n\n this._entities.add(e);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2[\"return\"] != null) {\n _iterator2[\"return\"]();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByPhone\",\n value: function getEntityRowsByPhone(phone) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = this._entities[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var e = _step3.value;\n\n // id, hash, username, phone, name\n if (e[3] === phone) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3[\"return\"] != null) {\n _iterator3[\"return\"]();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByUsername\",\n value: function getEntityRowsByUsername(username) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = this._entities[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var e = _step4.value;\n\n // id, hash, username, phone, name\n if (e[2] === username) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4[\"return\"] != null) {\n _iterator4[\"return\"]();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsByName\",\n value: function getEntityRowsByName(name) {\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = this._entities[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var e = _step5.value;\n\n // id, hash, username, phone, name\n if (e[4] === name) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5[\"return\"] != null) {\n _iterator5[\"return\"]();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n }, {\n key: \"getEntityRowsById\",\n value: function getEntityRowsById(id) {\n var exact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (exact) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = this._entities[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var e = _step6.value;\n\n // id, hash, username, phone, name\n if (e[0] === id) {\n return [e[0], e[1]];\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6[\"return\"] != null) {\n _iterator6[\"return\"]();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n } else {\n var ids = [utils.getPeerId(new types.PeerUser({\n userId: id\n })), utils.getPeerId(new types.PeerChat({\n chatId: id\n })), utils.getPeerId(new types.PeerChannel({\n channelId: id\n }))];\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = this._entities[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var _e = _step7.value;\n\n // id, hash, username, phone, name\n if (ids.includes(_e[0])) {\n return [_e[0], _e[1]];\n }\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7[\"return\"] != null) {\n _iterator7[\"return\"]();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n }\n }, {\n key: \"getInputEntity\",\n value: function getInputEntity(key) {\n var exact;\n\n if (key.SUBCLASS_OF_ID !== undefined) {\n if ([0xc91c90b6, 0xe669bf46, 0x40f202fd].includes(key.SUBCLASS_OF_ID)) {\n // hex(crc32(b'InputPeer', b'InputUser' and b'InputChannel'))\n // We already have an Input version, so nothing else required\n return key;\n } // Try to early return if this key can be casted as input peer\n\n\n return utils.getInputPeer(key);\n } else {\n // Not a TLObject or can't be cast into InputPeer\n if (key instanceof TLObject) {\n key = utils.getPeerId(key);\n exact = true;\n } else {\n exact = !(typeof key == 'number') || key < 0;\n }\n }\n\n var result = null;\n\n if (typeof key === 'string') {\n var phone = utils.parsePhone(key);\n\n if (phone) {\n result = this.getEntityRowsByPhone(phone);\n } else {\n var _utils$parseUsername = utils.parseUsername(key),\n username = _utils$parseUsername.username,\n isInvite = _utils$parseUsername.isInvite;\n\n if (username && !isInvite) {\n result = this.getEntityRowsByUsername(username);\n } else {\n var tup = utils.resolveInviteLink(key)[1];\n\n if (tup) {\n result = this.getEntityRowsById(tup, false);\n }\n }\n }\n } else if (typeof key === 'number') {\n result = this.getEntityRowsById(key, exact);\n }\n\n if (!result && typeof key === 'string') {\n result = this.getEntityRowsByName(key);\n }\n\n if (result) {\n var entityId = result[0]; // unpack resulting tuple\n\n var entityHash = result[1];\n var resolved = utils.resolveId(entityId);\n entityId = resolved[0];\n var kind = resolved[1]; // removes the mark and returns type of entity\n\n if (kind === types.PeerUser) {\n return new types.InputPeerUser({\n userId: entityId,\n accessHash: entityHash\n });\n } else if (kind === types.PeerChat) {\n return new types.InputPeerChat({\n chatId: entityId\n });\n } else if (kind === types.PeerChannel) {\n return new types.InputPeerChannel({\n channelId: entityId,\n accessHash: entityHash\n });\n }\n } else {\n throw new Error('Could not find input entity with key ' + key);\n }\n }\n }, {\n key: \"dcId\",\n get: function get() {\n return this._dcId;\n }\n }, {\n key: \"serverAddress\",\n get: function get() {\n return this._serverAddress;\n }\n }, {\n key: \"port\",\n get: function get() {\n return this._port;\n }\n }, {\n key: \"authKey\",\n get: function get() {\n return this._authKey;\n },\n set: function set(value) {\n this._authKey = value;\n }\n }, {\n key: \"takeoutId\",\n get: function get() {\n return this._takeoutId;\n },\n set: function set(value) {\n this._takeoutId = value;\n }\n }]);\n\n return MemorySession;\n}(Session);\n\nmodule.exports = MemorySession;\n\n//# sourceURL=webpack://gramjs/./gramjs/sessions/Memory.js?"); /***/ }), /***/ "./gramjs/sessions/StringSession.js": /*!******************************************!*\ !*** ./gramjs/sessions/StringSession.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar MemorySession = __webpack_require__(/*! ./Memory */ \"./gramjs/sessions/Memory.js\");\n\nvar AuthKey = __webpack_require__(/*! ../crypto/AuthKey */ \"./gramjs/crypto/AuthKey.js\");\n\nvar BinaryReader = __webpack_require__(/*! ../extensions/BinaryReader */ \"./gramjs/extensions/BinaryReader.js\");\n\nvar CURRENT_VERSION = '1';\n\nvar StringSession =\n/*#__PURE__*/\nfunction (_MemorySession) {\n _inherits(StringSession, _MemorySession);\n\n /**\n * This session file can be easily saved and loaded as a string. According\n * to the initial design, it contains only the data that is necessary for\n * successful connection and authentication, so takeout ID is not stored.\n * It is thought to be used where you don't want to create any on-disk\n * files but would still like to be able to save and load existing sessions\n * by other means.\n * You can use custom `encode` and `decode` functions, if present:\n * `encode` definition must be ``function encode(value: Buffer) -> string:``.\n * `decode` definition must be ``function decode(value: string) -> Buffer:``.\n * @param session {string|null}\n */\n function StringSession() {\n var _this;\n\n var session = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _classCallCheck(this, StringSession);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(StringSession).call(this));\n\n if (session) {\n if (session[0] !== CURRENT_VERSION) {\n throw new Error('Not a valid string');\n }\n\n session = session.slice(1);\n var ipLen = session.length === 352 ? 4 : 16;\n var r = StringSession.decode(session);\n var reader = new BinaryReader(r);\n _this._dcId = reader.read(1).readUInt8(0);\n var ip = reader.read(ipLen);\n _this._port = reader.read(2).readInt16BE(0);\n var key = reader.read(-1);\n _this._serverAddress = ip.readUInt8(0) + '.' + ip.readUInt8(1) + '.' + ip.readUInt8(2) + '.' + ip.readUInt8(3);\n\n if (key) {\n _this._authKey = new AuthKey(key);\n }\n }\n\n return _this;\n }\n /**\n * @param x {Buffer}\n * @returns {string}\n */\n\n\n _createClass(StringSession, [{\n key: \"save\",\n value: function save() {\n if (!this.authKey) {\n return '';\n }\n\n var ip = this.serverAddress.split('.');\n var dcBuffer = Buffer.from([this.dcId]);\n var ipBuffer = Buffer.alloc(4);\n var portBuffer = Buffer.alloc(2);\n portBuffer.writeInt16BE(this.port, 0);\n\n for (var i = 0; i < ip.length; i++) {\n ipBuffer.writeUInt8(parseInt(ip[i]), i);\n }\n\n return CURRENT_VERSION + StringSession.encode(Buffer.concat([dcBuffer, ipBuffer, portBuffer, this.authKey.key]));\n }\n }], [{\n key: \"encode\",\n value: function encode(x) {\n return x.toString('base64');\n }\n /**\n * @param x {string}\n * @returns {Buffer}\n */\n\n }, {\n key: \"decode\",\n value: function decode(x) {\n return Buffer.from(x, 'base64');\n }\n }]);\n\n return StringSession;\n}(MemorySession);\n\nmodule.exports = StringSession;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/sessions/StringSession.js?"); /***/ }), /***/ "./gramjs/sessions/index.js": /*!**********************************!*\ !*** ./gramjs/sessions/index.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var JSONSession = __webpack_require__(/*! ./JSONSession */ \"./gramjs/sessions/JSONSession.js\");\n\nvar Memory = __webpack_require__(/*! ./Memory */ \"./gramjs/sessions/Memory.js\");\n\nvar StringSession = __webpack_require__(/*! ./StringSession */ \"./gramjs/sessions/StringSession.js\");\n\nmodule.exports = {\n JSONSession: JSONSession,\n Memory: Memory,\n StringSession: StringSession\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/sessions/index.js?"); /***/ }), /***/ "./gramjs/tl/AllTLObjects.js": /*!***********************************!*\ !*** ./gramjs/tl/AllTLObjects.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* ! File generated by TLObjects' generator. All changes will be ERASED !*/\nvar _require = __webpack_require__(/*! . */ \"./gramjs/tl/index.js\"),\n types = _require.types,\n functions = _require.functions,\n patched = _require.patched;\n\nvar LAYER = 105;\nvar tlobjects = {\n 0x07f3b18ea: types.InputPeerEmpty,\n 0x07da07ec9: types.InputPeerSelf,\n 0x0179be863: types.InputPeerChat,\n 0x07b8e7de6: types.InputPeerUser,\n 0x020adaef8: types.InputPeerChannel,\n 0x017bae2e6: types.InputPeerUserFromMessage,\n 0x09c95f7bb: types.InputPeerChannelFromMessage,\n 0x0b98886cf: types.InputUserEmpty,\n 0x0f7c1b13f: types.InputUserSelf,\n 0x0d8292816: types.InputUser,\n 0x02d117597: types.InputUserFromMessage,\n 0x0f392b7f4: types.InputPhoneContact,\n 0x0f52ff27f: types.InputFile,\n 0x0fa4f0bb5: types.InputFileBig,\n 0x09664f57f: types.InputMediaEmpty,\n 0x01e287d04: types.InputMediaUploadedPhoto,\n 0x0b3ba0635: types.InputMediaPhoto,\n 0x0f9c44144: types.InputMediaGeoPoint,\n 0x0f8ab7dfb: types.InputMediaContact,\n 0x05b38c6c1: types.InputMediaUploadedDocument,\n 0x023ab23d2: types.InputMediaDocument,\n 0x0c13d1c11: types.InputMediaVenue,\n 0x04843b0fd: types.InputMediaGifExternal,\n 0x0e5bbfe1a: types.InputMediaPhotoExternal,\n 0x0fb52dc99: types.InputMediaDocumentExternal,\n 0x0d33f43f3: types.InputMediaGame,\n 0x0f4e096c3: types.InputMediaInvoice,\n 0x0ce4e82fd: types.InputMediaGeoLive,\n 0x006b3765b: types.InputMediaPoll,\n 0x01ca48f57: types.InputChatPhotoEmpty,\n 0x0927c55b4: types.InputChatUploadedPhoto,\n 0x08953ad37: types.InputChatPhoto,\n 0x0e4c123d6: types.InputGeoPointEmpty,\n 0x0f3b7acc9: types.InputGeoPoint,\n 0x01cd7bf0d: types.InputPhotoEmpty,\n 0x03bb3b94a: types.InputPhoto,\n 0x0dfdaabe1: types.InputFileLocation,\n 0x0f5235d55: types.InputEncryptedFileLocation,\n 0x0bad07584: types.InputDocumentFileLocation,\n 0x0cbc7ee28: types.InputSecureFileLocation,\n 0x029be5899: types.InputTakeoutFileLocation,\n 0x040181ffe: types.InputPhotoFileLocation,\n 0x027d69997: types.InputPeerPhotoFileLocation,\n 0x00dbaeae9: types.InputStickerSetThumb,\n 0x09db1bc6d: types.PeerUser,\n 0x0bad0e5bb: types.PeerChat,\n 0x0bddde532: types.PeerChannel,\n 0x0aa963b05: types.storage.FileUnknown,\n 0x040bc6f52: types.storage.FilePartial,\n 0x0007efe0e: types.storage.FileJpeg,\n 0x0cae1aadf: types.storage.FileGif,\n 0x00a4f63c0: types.storage.FilePng,\n 0x0ae1e508d: types.storage.FilePdf,\n 0x0528a0677: types.storage.FileMp3,\n 0x04b09ebbc: types.storage.FileMov,\n 0x0b3cea0e4: types.storage.FileMp4,\n 0x01081464c: types.storage.FileWebp,\n 0x0200250ba: types.UserEmpty,\n 0x0938458c1: types.User,\n 0x04f11bae1: types.UserProfilePhotoEmpty,\n 0x0ecd75d8c: types.UserProfilePhoto,\n 0x009d05049: types.UserStatusEmpty,\n 0x0edb93949: types.UserStatusOnline,\n 0x0008c703f: types.UserStatusOffline,\n 0x0e26f42f1: types.UserStatusRecently,\n 0x007bf09fc: types.UserStatusLastWeek,\n 0x077ebc742: types.UserStatusLastMonth,\n 0x09ba2d800: types.ChatEmpty,\n 0x03bda1bde: types.Chat,\n 0x007328bdb: types.ChatForbidden,\n 0x0d31a961e: types.Channel,\n 0x0289da732: types.ChannelForbidden,\n 0x01b7c9db3: types.ChatFull,\n 0x02d895c74: types.ChannelFull,\n 0x0c8d7493e: types.ChatParticipant,\n 0x0da13538a: types.ChatParticipantCreator,\n 0x0e2d6e436: types.ChatParticipantAdmin,\n 0x0fc900c2b: types.ChatParticipantsForbidden,\n 0x03f460fed: types.ChatParticipants,\n 0x037c1011c: types.ChatPhotoEmpty,\n 0x0475cdbd5: types.ChatPhoto,\n 0x083e5de54: types.MessageEmpty,\n 0x0452c0e65: types.Message,\n 0x09e19a1f6: types.MessageService,\n 0x03ded6320: types.MessageMediaEmpty,\n 0x0695150d7: types.MessageMediaPhoto,\n 0x056e0d474: types.MessageMediaGeo,\n 0x0cbf24940: types.MessageMediaContact,\n 0x09f84f49e: types.MessageMediaUnsupported,\n 0x09cb070d7: types.MessageMediaDocument,\n 0x0a32dd600: types.MessageMediaWebPage,\n 0x02ec0533f: types.MessageMediaVenue,\n 0x0fdb19008: types.MessageMediaGame,\n 0x084551347: types.MessageMediaInvoice,\n 0x07c3c2609: types.MessageMediaGeoLive,\n 0x04bd6e798: types.MessageMediaPoll,\n 0x0b6aef7b0: types.MessageActionEmpty,\n 0x0a6638b9a: types.MessageActionChatCreate,\n 0x0b5a1ce5a: types.MessageActionChatEditTitle,\n 0x07fcb13a8: types.MessageActionChatEditPhoto,\n 0x095e3fbef: types.MessageActionChatDeletePhoto,\n 0x0488a7337: types.MessageActionChatAddUser,\n 0x0b2ae9b0c: types.MessageActionChatDeleteUser,\n 0x0f89cf5e8: types.MessageActionChatJoinedByLink,\n 0x095d2ac92: types.MessageActionChannelCreate,\n 0x051bdb021: types.MessageActionChatMigrateTo,\n 0x0b055eaee: types.MessageActionChannelMigrateFrom,\n 0x094bd38ed: types.MessageActionPinMessage,\n 0x09fbab604: types.MessageActionHistoryClear,\n 0x092a72876: types.MessageActionGameScore,\n 0x08f31b327: types.MessageActionPaymentSentMe,\n 0x040699cd0: types.MessageActionPaymentSent,\n 0x080e11a7f: types.MessageActionPhoneCall,\n 0x04792929b: types.MessageActionScreenshotTaken,\n 0x0fae69f56: types.MessageActionCustomAction,\n 0x0abe9affe: types.MessageActionBotAllowed,\n 0x01b287353: types.MessageActionSecureValuesSentMe,\n 0x0d95c6154: types.MessageActionSecureValuesSent,\n 0x0f3f25f76: types.MessageActionContactSignUp,\n 0x02c171f72: types.Dialog,\n 0x071bd134c: types.DialogFolder,\n 0x02331b22d: types.PhotoEmpty,\n 0x0d07504a5: types.Photo,\n 0x00e17e23c: types.PhotoSizeEmpty,\n 0x077bfb61b: types.PhotoSize,\n 0x0e9a734fa: types.PhotoCachedSize,\n 0x0e0b0bc2e: types.PhotoStrippedSize,\n 0x01117dd5f: types.GeoPointEmpty,\n 0x00296f104: types.GeoPoint,\n 0x05e002502: types.auth.SentCode,\n 0x0cd050916: types.auth.Authorization,\n 0x044747e9a: types.auth.AuthorizationSignUpRequired,\n 0x0df969c2d: types.auth.ExportedAuthorization,\n 0x0b8bc5b0c: types.InputNotifyPeer,\n 0x0193b4417: types.InputNotifyUsers,\n 0x04a95e84e: types.InputNotifyChats,\n 0x0b1db7c7e: types.InputNotifyBroadcasts,\n 0x09c3d198e: types.InputPeerNotifySettings,\n 0x0af509d20: types.PeerNotifySettings,\n 0x0818426cd: types.PeerSettings,\n 0x0a437c3ed: types.WallPaper,\n 0x058dbcab8: types.InputReportReasonSpam,\n 0x01e22c78d: types.InputReportReasonViolence,\n 0x02e59d922: types.InputReportReasonPornography,\n 0x0adf44ee3: types.InputReportReasonChildAbuse,\n 0x0e1746d0a: types.InputReportReasonOther,\n 0x09b89f93a: types.InputReportReasonCopyright,\n 0x0dbd4feed: types.InputReportReasonGeoIrrelevant,\n 0x0edf17c12: types.UserFull,\n 0x0f911c994: types.Contact,\n 0x0d0028438: types.ImportedContact,\n 0x0561bc879: types.ContactBlocked,\n 0x0d3680c61: types.ContactStatus,\n 0x0b74ba9d2: types.contacts.ContactsNotModified,\n 0x0eae87e42: types.contacts.Contacts,\n 0x077d01c3b: types.contacts.ImportedContacts,\n 0x01c138d15: types.contacts.Blocked,\n 0x0900802a1: types.contacts.BlockedSlice,\n 0x015ba6c40: types.messages.Dialogs,\n 0x071e094f3: types.messages.DialogsSlice,\n 0x0f0e3e596: types.messages.DialogsNotModified,\n 0x08c718e87: types.messages.Messages,\n 0x0c8edce1e: types.messages.MessagesSlice,\n 0x099262e37: types.messages.ChannelMessages,\n 0x074535f21: types.messages.MessagesNotModified,\n 0x064ff9fd5: types.messages.Chats,\n 0x09cd81144: types.messages.ChatsSlice,\n 0x0e5d7d19c: types.messages.ChatFull,\n 0x0b45c69d1: types.messages.AffectedHistory,\n 0x057e2f66c: types.InputMessagesFilterEmpty,\n 0x09609a51c: types.InputMessagesFilterPhotos,\n 0x09fc00e65: types.InputMessagesFilterVideo,\n 0x056e9f0e4: types.InputMessagesFilterPhotoVideo,\n 0x09eddf188: types.InputMessagesFilterDocument,\n 0x07ef0dd87: types.InputMessagesFilterUrl,\n 0x0ffc86587: types.InputMessagesFilterGif,\n 0x050f5c392: types.InputMessagesFilterVoice,\n 0x03751b49e: types.InputMessagesFilterMusic,\n 0x03a20ecb8: types.InputMessagesFilterChatPhotos,\n 0x080c99768: types.InputMessagesFilterPhoneCalls,\n 0x07a7c17a4: types.InputMessagesFilterRoundVoice,\n 0x0b549da53: types.InputMessagesFilterRoundVideo,\n 0x0c1f8e69a: types.InputMessagesFilterMyMentions,\n 0x0e7026d0d: types.InputMessagesFilterGeo,\n 0x0e062db83: types.InputMessagesFilterContacts,\n 0x01f2b0afd: types.UpdateNewMessage,\n 0x04e90bfd6: types.UpdateMessageID,\n 0x0a20db0e5: types.UpdateDeleteMessages,\n 0x05c486927: types.UpdateUserTyping,\n 0x09a65ea1f: types.UpdateChatUserTyping,\n 0x007761198: types.UpdateChatParticipants,\n 0x01bfbd823: types.UpdateUserStatus,\n 0x0a7332b73: types.UpdateUserName,\n 0x095313b0c: types.UpdateUserPhoto,\n 0x012bcbd9a: types.UpdateNewEncryptedMessage,\n 0x01710f156: types.UpdateEncryptedChatTyping,\n 0x0b4a2e88d: types.UpdateEncryption,\n 0x038fe25b7: types.UpdateEncryptedMessagesRead,\n 0x0ea4b0e5c: types.UpdateChatParticipantAdd,\n 0x06e5f8c22: types.UpdateChatParticipantDelete,\n 0x08e5e9873: types.UpdateDcOptions,\n 0x080ece81a: types.UpdateUserBlocked,\n 0x0bec268ef: types.UpdateNotifySettings,\n 0x0ebe46819: types.UpdateServiceNotification,\n 0x0ee3b272a: types.UpdatePrivacy,\n 0x012b9417b: types.UpdateUserPhone,\n 0x09c974fdf: types.UpdateReadHistoryInbox,\n 0x02f2f21bf: types.UpdateReadHistoryOutbox,\n 0x07f891213: types.UpdateWebPage,\n 0x068c13933: types.UpdateReadMessagesContents,\n 0x0eb0467fb: types.UpdateChannelTooLong,\n 0x0b6d45656: types.UpdateChannel,\n 0x062ba04d9: types.UpdateNewChannelMessage,\n 0x0330b5424: types.UpdateReadChannelInbox,\n 0x0c37521c9: types.UpdateDeleteChannelMessages,\n 0x098a12b4b: types.UpdateChannelMessageViews,\n 0x0b6901959: types.UpdateChatParticipantAdmin,\n 0x0688a30aa: types.UpdateNewStickerSet,\n 0x00bb2d201: types.UpdateStickerSetsOrder,\n 0x043ae3dec: types.UpdateStickerSets,\n 0x09375341e: types.UpdateSavedGifs,\n 0x054826690: types.UpdateBotInlineQuery,\n 0x00e48f964: types.UpdateBotInlineSend,\n 0x01b3f4df7: types.UpdateEditChannelMessage,\n 0x098592475: types.UpdateChannelPinnedMessage,\n 0x0e73547e1: types.UpdateBotCallbackQuery,\n 0x0e40370a3: types.UpdateEditMessage,\n 0x0f9d27a5a: types.UpdateInlineBotCallbackQuery,\n 0x025d6c9c7: types.UpdateReadChannelOutbox,\n 0x0ee2bb969: types.UpdateDraftMessage,\n 0x0571d2742: types.UpdateReadFeaturedStickers,\n 0x09a422c20: types.UpdateRecentStickers,\n 0x0a229dd06: types.UpdateConfig,\n 0x03354678f: types.UpdatePtsChanged,\n 0x040771900: types.UpdateChannelWebPage,\n 0x06e6fe51c: types.UpdateDialogPinned,\n 0x0fa0f3ca2: types.UpdatePinnedDialogs,\n 0x08317c0c3: types.UpdateBotWebhookJSON,\n 0x09b9240a6: types.UpdateBotWebhookJSONQuery,\n 0x0e0cdc940: types.UpdateBotShippingQuery,\n 0x05d2f3aa9: types.UpdateBotPrecheckoutQuery,\n 0x0ab0f6b1e: types.UpdatePhoneCall,\n 0x046560264: types.UpdateLangPackTooLong,\n 0x056022f4d: types.UpdateLangPack,\n 0x0e511996d: types.UpdateFavedStickers,\n 0x089893b45: types.UpdateChannelReadMessagesContents,\n 0x07084a7be: types.UpdateContactsReset,\n 0x070db6837: types.UpdateChannelAvailableMessages,\n 0x0e16459c3: types.UpdateDialogUnreadMark,\n 0x04c43da18: types.UpdateUserPinnedMessage,\n 0x0e10db349: types.UpdateChatPinnedMessage,\n 0x0aca1657b: types.UpdateMessagePoll,\n 0x054c01850: types.UpdateChatDefaultBannedRights,\n 0x019360dc0: types.UpdateFolderPeers,\n 0x06a7e7366: types.UpdatePeerSettings,\n 0x0b4afcfb0: types.UpdatePeerLocated,\n 0x039a51dfb: types.UpdateNewScheduledMessage,\n 0x090866cee: types.UpdateDeleteScheduledMessages,\n 0x08216fba3: types.UpdateTheme,\n 0x0a56c2a3e: types.updates.State,\n 0x05d75a138: types.updates.DifferenceEmpty,\n 0x000f49ca0: types.updates.Difference,\n 0x0a8fb1981: types.updates.DifferenceSlice,\n 0x04afe8f6d: types.updates.DifferenceTooLong,\n 0x0e317af7e: types.UpdatesTooLong,\n 0x0914fbf11: types.UpdateShortMessage,\n 0x016812688: types.UpdateShortChatMessage,\n 0x078d4dec1: types.UpdateShort,\n 0x0725b04c3: types.UpdatesCombined,\n 0x074ae4240: types.Updates,\n 0x011f1331c: types.UpdateShortSentMessage,\n 0x08dca6aa5: types.photos.Photos,\n 0x015051f54: types.photos.PhotosSlice,\n 0x020212ca8: types.photos.Photo,\n 0x0096a18d5: types.upload.File,\n 0x0f18cda44: types.upload.FileCdnRedirect,\n 0x018b7a10d: types.DcOption,\n 0x0330b4067: types.Config,\n 0x08e1a1775: types.NearestDc,\n 0x01da7158f: types.help.AppUpdate,\n 0x0c45a6536: types.help.NoAppUpdate,\n 0x018cb9f78: types.help.InviteText,\n 0x0ab7ec0a0: types.EncryptedChatEmpty,\n 0x03bf703dc: types.EncryptedChatWaiting,\n 0x0c878527e: types.EncryptedChatRequested,\n 0x0fa56ce36: types.EncryptedChat,\n 0x013d6dd27: types.EncryptedChatDiscarded,\n 0x0f141b5e1: types.InputEncryptedChat,\n 0x0c21f497e: types.EncryptedFileEmpty,\n 0x04a70994c: types.EncryptedFile,\n 0x01837c364: types.InputEncryptedFileEmpty,\n 0x064bd0306: types.InputEncryptedFileUploaded,\n 0x05a17b5e5: types.InputEncryptedFile,\n 0x02dc173c8: types.InputEncryptedFileBigUploaded,\n 0x0ed18c118: types.EncryptedMessage,\n 0x023734b06: types.EncryptedMessageService,\n 0x0c0e24635: types.messages.DhConfigNotModified,\n 0x02c221edd: types.messages.DhConfig,\n 0x0560f8935: types.messages.SentEncryptedMessage,\n 0x09493ff32: types.messages.SentEncryptedFile,\n 0x072f0eaae: types.InputDocumentEmpty,\n 0x01abfb575: types.InputDocument,\n 0x036f8c871: types.DocumentEmpty,\n 0x09ba29cc1: types.Document,\n 0x017c6b5f6: types.help.Support,\n 0x09fd40bd8: types.NotifyPeer,\n 0x0b4c83b4c: types.NotifyUsers,\n 0x0c007cec3: types.NotifyChats,\n 0x0d612e8ef: types.NotifyBroadcasts,\n 0x016bf744e: types.SendMessageTypingAction,\n 0x0fd5ec8f5: types.SendMessageCancelAction,\n 0x0a187d66f: types.SendMessageRecordVideoAction,\n 0x0e9763aec: types.SendMessageUploadVideoAction,\n 0x0d52f73f7: types.SendMessageRecordAudioAction,\n 0x0f351d7ab: types.SendMessageUploadAudioAction,\n 0x0d1d34a26: types.SendMessageUploadPhotoAction,\n 0x0aa0cd9e4: types.SendMessageUploadDocumentAction,\n 0x0176f8ba1: types.SendMessageGeoLocationAction,\n 0x0628cbc6f: types.SendMessageChooseContactAction,\n 0x0dd6a8f48: types.SendMessageGamePlayAction,\n 0x088f27fbc: types.SendMessageRecordRoundAction,\n 0x0243e1c66: types.SendMessageUploadRoundAction,\n 0x0b3134d9d: types.contacts.Found,\n 0x04f96cb18: types.InputPrivacyKeyStatusTimestamp,\n 0x0bdfb0426: types.InputPrivacyKeyChatInvite,\n 0x0fabadc5f: types.InputPrivacyKeyPhoneCall,\n 0x0db9e70d2: types.InputPrivacyKeyPhoneP2P,\n 0x0a4dd4c08: types.InputPrivacyKeyForwards,\n 0x05719bacc: types.InputPrivacyKeyProfilePhoto,\n 0x00352dafa: types.InputPrivacyKeyPhoneNumber,\n 0x0d1219bdd: types.InputPrivacyKeyAddedByPhone,\n 0x0bc2eab30: types.PrivacyKeyStatusTimestamp,\n 0x0500e6dfa: types.PrivacyKeyChatInvite,\n 0x03d662b7b: types.PrivacyKeyPhoneCall,\n 0x039491cc8: types.PrivacyKeyPhoneP2P,\n 0x069ec56a3: types.PrivacyKeyForwards,\n 0x096151fed: types.PrivacyKeyProfilePhoto,\n 0x0d19ae46d: types.PrivacyKeyPhoneNumber,\n 0x042ffd42b: types.PrivacyKeyAddedByPhone,\n 0x00d09e07b: types.InputPrivacyValueAllowContacts,\n 0x0184b35ce: types.InputPrivacyValueAllowAll,\n 0x0131cc67f: types.InputPrivacyValueAllowUsers,\n 0x00ba52007: types.InputPrivacyValueDisallowContacts,\n 0x0d66b66c9: types.InputPrivacyValueDisallowAll,\n 0x090110467: types.InputPrivacyValueDisallowUsers,\n 0x04c81c1ba: types.InputPrivacyValueAllowChatParticipants,\n 0x0d82363af: types.InputPrivacyValueDisallowChatParticipants,\n 0x0fffe1bac: types.PrivacyValueAllowContacts,\n 0x065427b82: types.PrivacyValueAllowAll,\n 0x04d5bbe0c: types.PrivacyValueAllowUsers,\n 0x0f888fa1a: types.PrivacyValueDisallowContacts,\n 0x08b73e763: types.PrivacyValueDisallowAll,\n 0x00c7f49b7: types.PrivacyValueDisallowUsers,\n 0x018be796b: types.PrivacyValueAllowChatParticipants,\n 0x0acae0690: types.PrivacyValueDisallowChatParticipants,\n 0x050a04e45: types.account.PrivacyRules,\n 0x0b8d0afdf: types.AccountDaysTTL,\n 0x06c37c15c: types.DocumentAttributeImageSize,\n 0x011b58939: types.DocumentAttributeAnimated,\n 0x06319d612: types.DocumentAttributeSticker,\n 0x00ef02ce6: types.DocumentAttributeVideo,\n 0x09852f9c6: types.DocumentAttributeAudio,\n 0x015590068: types.DocumentAttributeFilename,\n 0x09801d2f7: types.DocumentAttributeHasStickers,\n 0x0f1749a22: types.messages.StickersNotModified,\n 0x0e4599bbd: types.messages.Stickers,\n 0x012b299d4: types.StickerPack,\n 0x0e86602c3: types.messages.AllStickersNotModified,\n 0x0edfd405f: types.messages.AllStickers,\n 0x084d19185: types.messages.AffectedMessages,\n 0x0eb1477e8: types.WebPageEmpty,\n 0x0c586da1c: types.WebPagePending,\n 0x0fa64e172: types.WebPage,\n 0x085849473: types.WebPageNotModified,\n 0x0ad01d61d: types.Authorization,\n 0x01250abde: types.account.Authorizations,\n 0x0ad2641f8: types.account.Password,\n 0x09a5c33e5: types.account.PasswordSettings,\n 0x0c23727c9: types.account.PasswordInputSettings,\n 0x0137948a5: types.auth.PasswordRecovery,\n 0x0a384b779: types.ReceivedNotifyMessage,\n 0x069df3769: types.ChatInviteEmpty,\n 0x0fc2e05bc: types.ChatInviteExported,\n 0x05a686d7c: types.ChatInviteAlready,\n 0x0dfc2f58e: types.ChatInvite,\n 0x0ffb62b95: types.InputStickerSetEmpty,\n 0x09de7a269: types.InputStickerSetID,\n 0x0861cc8a0: types.InputStickerSetShortName,\n 0x0028703c8: types.InputStickerSetAnimatedEmoji,\n 0x0eeb46f27: types.StickerSet,\n 0x0b60a24a6: types.messages.StickerSet,\n 0x0c27ac8c7: types.BotCommand,\n 0x098e81d3a: types.BotInfo,\n 0x0a2fa4880: types.KeyboardButton,\n 0x0258aff05: types.KeyboardButtonUrl,\n 0x0683a5e46: types.KeyboardButtonCallback,\n 0x0b16a6c29: types.KeyboardButtonRequestPhone,\n 0x0fc796b3f: types.KeyboardButtonRequestGeoLocation,\n 0x00568a748: types.KeyboardButtonSwitchInline,\n 0x050f41ccf: types.KeyboardButtonGame,\n 0x0afd93fbb: types.KeyboardButtonBuy,\n 0x010b78d29: types.KeyboardButtonUrlAuth,\n 0x0d02e7fd4: types.InputKeyboardButtonUrlAuth,\n 0x077608b83: types.KeyboardButtonRow,\n 0x0a03e5b85: types.ReplyKeyboardHide,\n 0x0f4108aa0: types.ReplyKeyboardForceReply,\n 0x03502758c: types.ReplyKeyboardMarkup,\n 0x048a30254: types.ReplyInlineMarkup,\n 0x0bb92ba95: types.MessageEntityUnknown,\n 0x0fa04579d: types.MessageEntityMention,\n 0x06f635b0d: types.MessageEntityHashtag,\n 0x06cef8ac7: types.MessageEntityBotCommand,\n 0x06ed02538: types.MessageEntityUrl,\n 0x064e475c2: types.MessageEntityEmail,\n 0x0bd610bc9: types.MessageEntityBold,\n 0x0826f8b60: types.MessageEntityItalic,\n 0x028a20571: types.MessageEntityCode,\n 0x073924be0: types.MessageEntityPre,\n 0x076a6d327: types.MessageEntityTextUrl,\n 0x0352dca58: types.MessageEntityMentionName,\n 0x0208e68c9: types.InputMessageEntityMentionName,\n 0x09b69e34b: types.MessageEntityPhone,\n 0x04c4e743f: types.MessageEntityCashtag,\n 0x09c4e7e8b: types.MessageEntityUnderline,\n 0x0bf0693d4: types.MessageEntityStrike,\n 0x0020df5d0: types.MessageEntityBlockquote,\n 0x0ee8c1e86: types.InputChannelEmpty,\n 0x0afeb712e: types.InputChannel,\n 0x02a286531: types.InputChannelFromMessage,\n 0x07f077ad9: types.contacts.ResolvedPeer,\n 0x00ae30253: types.MessageRange,\n 0x03e11affb: types.updates.ChannelDifferenceEmpty,\n 0x0a4bcc6fe: types.updates.ChannelDifferenceTooLong,\n 0x02064674e: types.updates.ChannelDifference,\n 0x094d42ee7: types.ChannelMessagesFilterEmpty,\n 0x0cd77d957: types.ChannelMessagesFilter,\n 0x015ebac1d: types.ChannelParticipant,\n 0x0a3289a6d: types.ChannelParticipantSelf,\n 0x0808d15a4: types.ChannelParticipantCreator,\n 0x0ccbebbaf: types.ChannelParticipantAdmin,\n 0x01c0facaf: types.ChannelParticipantBanned,\n 0x0de3f3c79: types.ChannelParticipantsRecent,\n 0x0b4608969: types.ChannelParticipantsAdmins,\n 0x0a3b54985: types.ChannelParticipantsKicked,\n 0x0b0d1865b: types.ChannelParticipantsBots,\n 0x01427a5e1: types.ChannelParticipantsBanned,\n 0x00656ac4b: types.ChannelParticipantsSearch,\n 0x0bb6ae88d: types.ChannelParticipantsContacts,\n 0x0f56ee2a8: types.channels.ChannelParticipants,\n 0x0f0173fe9: types.channels.ChannelParticipantsNotModified,\n 0x0d0d9b163: types.channels.ChannelParticipant,\n 0x0780a0310: types.help.TermsOfService,\n 0x0162ecc1f: types.FoundGif,\n 0x09c750409: types.FoundGifCached,\n 0x0450a1c0a: types.messages.FoundGifs,\n 0x0e8025ca2: types.messages.SavedGifsNotModified,\n 0x02e0709a5: types.messages.SavedGifs,\n 0x03380c786: types.InputBotInlineMessageMediaAuto,\n 0x03dcd7a87: types.InputBotInlineMessageText,\n 0x0c1b15d65: types.InputBotInlineMessageMediaGeo,\n 0x0417bbf11: types.InputBotInlineMessageMediaVenue,\n 0x0a6edbffd: types.InputBotInlineMessageMediaContact,\n 0x04b425864: types.InputBotInlineMessageGame,\n 0x088bf9319: types.InputBotInlineResult,\n 0x0a8d864a7: types.InputBotInlineResultPhoto,\n 0x0fff8fdc4: types.InputBotInlineResultDocument,\n 0x04fa417f2: types.InputBotInlineResultGame,\n 0x0764cf810: types.BotInlineMessageMediaAuto,\n 0x08c7f65e2: types.BotInlineMessageText,\n 0x0b722de65: types.BotInlineMessageMediaGeo,\n 0x08a86659c: types.BotInlineMessageMediaVenue,\n 0x018d1cdc2: types.BotInlineMessageMediaContact,\n 0x011965f3a: types.BotInlineResult,\n 0x017db940b: types.BotInlineMediaResult,\n 0x0947ca848: types.messages.BotResults,\n 0x05dab1af4: types.ExportedMessageLink,\n 0x0ec338270: types.MessageFwdHeader,\n 0x072a3158c: types.auth.CodeTypeSms,\n 0x0741cd3e3: types.auth.CodeTypeCall,\n 0x0226ccefb: types.auth.CodeTypeFlashCall,\n 0x03dbb5986: types.auth.SentCodeTypeApp,\n 0x0c000bba2: types.auth.SentCodeTypeSms,\n 0x05353e5a7: types.auth.SentCodeTypeCall,\n 0x0ab03c6d9: types.auth.SentCodeTypeFlashCall,\n 0x036585ea4: types.messages.BotCallbackAnswer,\n 0x026b5dde6: types.messages.MessageEditData,\n 0x0890c3d89: types.InputBotInlineMessageID,\n 0x03c20629f: types.InlineBotSwitchPM,\n 0x03371c354: types.messages.PeerDialogs,\n 0x0edcdc05b: types.TopPeer,\n 0x0ab661b5b: types.TopPeerCategoryBotsPM,\n 0x0148677e2: types.TopPeerCategoryBotsInline,\n 0x00637b7ed: types.TopPeerCategoryCorrespondents,\n 0x0bd17a14a: types.TopPeerCategoryGroups,\n 0x0161d9628: types.TopPeerCategoryChannels,\n 0x01e76a78c: types.TopPeerCategoryPhoneCalls,\n 0x0a8406ca9: types.TopPeerCategoryForwardUsers,\n 0x0fbeec0f0: types.TopPeerCategoryForwardChats,\n 0x0fb834291: types.TopPeerCategoryPeers,\n 0x0de266ef5: types.contacts.TopPeersNotModified,\n 0x070b772a8: types.contacts.TopPeers,\n 0x0b52c939d: types.contacts.TopPeersDisabled,\n 0x01b0c841a: types.DraftMessageEmpty,\n 0x0fd8e711f: types.DraftMessage,\n 0x004ede3cf: types.messages.FeaturedStickersNotModified,\n 0x0f89d88e5: types.messages.FeaturedStickers,\n 0x00b17f890: types.messages.RecentStickersNotModified,\n 0x022f3afb3: types.messages.RecentStickers,\n 0x04fcba9c8: types.messages.ArchivedStickers,\n 0x038641628: types.messages.StickerSetInstallResultSuccess,\n 0x035e410a8: types.messages.StickerSetInstallResultArchive,\n 0x06410a5d2: types.StickerSetCovered,\n 0x03407e51b: types.StickerSetMultiCovered,\n 0x0aed6dbb2: types.MaskCoords,\n 0x04a992157: types.InputStickeredMediaPhoto,\n 0x00438865b: types.InputStickeredMediaDocument,\n 0x0bdf9653b: types.Game,\n 0x0032c3e77: types.InputGameID,\n 0x0c331e80a: types.InputGameShortName,\n 0x058fffcd0: types.HighScore,\n 0x09a3bfd99: types.messages.HighScores,\n 0x0dc3d824f: types.TextEmpty,\n 0x0744694e0: types.TextPlain,\n 0x06724abc4: types.TextBold,\n 0x0d912a59c: types.TextItalic,\n 0x0c12622c4: types.TextUnderline,\n 0x09bf8bb95: types.TextStrike,\n 0x06c3f19b9: types.TextFixed,\n 0x03c2884c1: types.TextUrl,\n 0x0de5a0dd6: types.TextEmail,\n 0x07e6260d7: types.TextConcat,\n 0x0ed6a8504: types.TextSubscript,\n 0x0c7fb5e01: types.TextSuperscript,\n 0x0034b8621: types.TextMarked,\n 0x01ccb966a: types.TextPhone,\n 0x0081ccf4f: types.TextImage,\n 0x035553762: types.TextAnchor,\n 0x013567e8a: types.PageBlockUnsupported,\n 0x070abc3fd: types.PageBlockTitle,\n 0x08ffa9a1f: types.PageBlockSubtitle,\n 0x0baafe5e0: types.PageBlockAuthorDate,\n 0x0bfd064ec: types.PageBlockHeader,\n 0x0f12bb6e1: types.PageBlockSubheader,\n 0x0467a0766: types.PageBlockParagraph,\n 0x0c070d93e: types.PageBlockPreformatted,\n 0x048870999: types.PageBlockFooter,\n 0x0db20b188: types.PageBlockDivider,\n 0x0ce0d37b0: types.PageBlockAnchor,\n 0x0e4e88011: types.PageBlockList,\n 0x0263d7c26: types.PageBlockBlockquote,\n 0x04f4456d3: types.PageBlockPullquote,\n 0x01759c560: types.PageBlockPhoto,\n 0x07c8fe7b6: types.PageBlockVideo,\n 0x039f23300: types.PageBlockCover,\n 0x0a8718dc5: types.PageBlockEmbed,\n 0x0f259a80b: types.PageBlockEmbedPost,\n 0x065a0fa4d: types.PageBlockCollage,\n 0x0031f9590: types.PageBlockSlideshow,\n 0x0ef1751b5: types.PageBlockChannel,\n 0x0804361ea: types.PageBlockAudio,\n 0x01e148390: types.PageBlockKicker,\n 0x0bf4dea82: types.PageBlockTable,\n 0x09a8ae1e1: types.PageBlockOrderedList,\n 0x076768bed: types.PageBlockDetails,\n 0x016115a96: types.PageBlockRelatedArticles,\n 0x0a44f3ef6: types.PageBlockMap,\n 0x085e42301: types.PhoneCallDiscardReasonMissed,\n 0x0e095c1a0: types.PhoneCallDiscardReasonDisconnect,\n 0x057adc690: types.PhoneCallDiscardReasonHangup,\n 0x0faf7e8c9: types.PhoneCallDiscardReasonBusy,\n 0x07d748d04: types.DataJSON,\n 0x0cb296bf8: types.LabeledPrice,\n 0x0c30aa358: types.Invoice,\n 0x0ea02c27e: types.PaymentCharge,\n 0x01e8caaeb: types.PostAddress,\n 0x0909c3f94: types.PaymentRequestedInfo,\n 0x0cdc27a1f: types.PaymentSavedCredentialsCard,\n 0x01c570ed1: types.WebDocument,\n 0x0f9c8bcc6: types.WebDocumentNoProxy,\n 0x09bed434d: types.InputWebDocument,\n 0x0c239d686: types.InputWebFileLocation,\n 0x09f2221c9: types.InputWebFileGeoPointLocation,\n 0x021e753bc: types.upload.WebFile,\n 0x03f56aea3: types.payments.PaymentForm,\n 0x0d1451883: types.payments.ValidatedRequestedInfo,\n 0x04e5f810d: types.payments.PaymentResult,\n 0x0d8411139: types.payments.PaymentVerificationNeeded,\n 0x0500911e1: types.payments.PaymentReceipt,\n 0x0fb8fe43c: types.payments.SavedInfo,\n 0x0c10eb2cf: types.InputPaymentCredentialsSaved,\n 0x03417d728: types.InputPaymentCredentials,\n 0x00aa1c39f: types.InputPaymentCredentialsApplePay,\n 0x0ca05d50e: types.InputPaymentCredentialsAndroidPay,\n 0x0db64fd34: types.account.TmpPassword,\n 0x0b6213cdf: types.ShippingOption,\n 0x0ffa0a496: types.InputStickerSetItem,\n 0x01e36fded: types.InputPhoneCall,\n 0x05366c915: types.PhoneCallEmpty,\n 0x01b8f4ad1: types.PhoneCallWaiting,\n 0x087eabb53: types.PhoneCallRequested,\n 0x0997c454a: types.PhoneCallAccepted,\n 0x08742ae7f: types.PhoneCall,\n 0x050ca4de1: types.PhoneCallDiscarded,\n 0x09d4c17c0: types.PhoneConnection,\n 0x0a2bb35cb: types.PhoneCallProtocol,\n 0x0ec82e140: types.phone.PhoneCall,\n 0x0eea8e46e: types.upload.CdnFileReuploadNeeded,\n 0x0a99fca4f: types.upload.CdnFile,\n 0x0c982eaba: types.CdnPublicKey,\n 0x05725e40a: types.CdnConfig,\n 0x0cad181f6: types.LangPackString,\n 0x06c47ac9f: types.LangPackStringPluralized,\n 0x02979eeb2: types.LangPackStringDeleted,\n 0x0f385c1f6: types.LangPackDifference,\n 0x0eeca5ce3: types.LangPackLanguage,\n 0x0e6dfb825: types.ChannelAdminLogEventActionChangeTitle,\n 0x055188a2e: types.ChannelAdminLogEventActionChangeAbout,\n 0x06a4afc38: types.ChannelAdminLogEventActionChangeUsername,\n 0x0434bd2af: types.ChannelAdminLogEventActionChangePhoto,\n 0x01b7907ae: types.ChannelAdminLogEventActionToggleInvites,\n 0x026ae0971: types.ChannelAdminLogEventActionToggleSignatures,\n 0x0e9e82c18: types.ChannelAdminLogEventActionUpdatePinned,\n 0x0709b2405: types.ChannelAdminLogEventActionEditMessage,\n 0x042e047bb: types.ChannelAdminLogEventActionDeleteMessage,\n 0x0183040d3: types.ChannelAdminLogEventActionParticipantJoin,\n 0x0f89777f2: types.ChannelAdminLogEventActionParticipantLeave,\n 0x0e31c34d8: types.ChannelAdminLogEventActionParticipantInvite,\n 0x0e6d83d7e: types.ChannelAdminLogEventActionParticipantToggleBan,\n 0x0d5676710: types.ChannelAdminLogEventActionParticipantToggleAdmin,\n 0x0b1c3caa7: types.ChannelAdminLogEventActionChangeStickerSet,\n 0x05f5c95f1: types.ChannelAdminLogEventActionTogglePreHistoryHidden,\n 0x02df5fc0a: types.ChannelAdminLogEventActionDefaultBannedRights,\n 0x08f079643: types.ChannelAdminLogEventActionStopPoll,\n 0x0a26f881b: types.ChannelAdminLogEventActionChangeLinkedChat,\n 0x00e6b76ae: types.ChannelAdminLogEventActionChangeLocation,\n 0x053909779: types.ChannelAdminLogEventActionToggleSlowMode,\n 0x03b5a3e40: types.ChannelAdminLogEvent,\n 0x0ed8af74d: types.channels.AdminLogResults,\n 0x0ea107ae4: types.ChannelAdminLogEventsFilter,\n 0x05ce14175: types.PopularContact,\n 0x09e8fa6d3: types.messages.FavedStickersNotModified,\n 0x0f37f2f16: types.messages.FavedStickers,\n 0x046e1d13d: types.RecentMeUrlUnknown,\n 0x08dbc3336: types.RecentMeUrlUser,\n 0x0a01b22f9: types.RecentMeUrlChat,\n 0x0eb49081d: types.RecentMeUrlChatInvite,\n 0x0bc0a57dc: types.RecentMeUrlStickerSet,\n 0x00e0310d7: types.help.RecentMeUrls,\n 0x01cc6e91f: types.InputSingleMedia,\n 0x0cac943f2: types.WebAuthorization,\n 0x0ed56c9fc: types.account.WebAuthorizations,\n 0x0a676a322: types.InputMessageID,\n 0x0bad88395: types.InputMessageReplyTo,\n 0x086872538: types.InputMessagePinned,\n 0x0fcaafeb7: types.InputDialogPeer,\n 0x064600527: types.InputDialogPeerFolder,\n 0x0e56dbf05: types.DialogPeer,\n 0x0514519e2: types.DialogPeerFolder,\n 0x00d54b65d: types.messages.FoundStickerSetsNotModified,\n 0x05108d648: types.messages.FoundStickerSets,\n 0x06242c773: types.FileHash,\n 0x075588b3f: types.InputClientProxy,\n 0x0e09e1fb8: types.help.ProxyDataEmpty,\n 0x02bf7ee23: types.help.ProxyDataPromo,\n 0x0e3309f7f: types.help.TermsOfServiceUpdateEmpty,\n 0x028ecf961: types.help.TermsOfServiceUpdate,\n 0x03334b0f0: types.InputSecureFileUploaded,\n 0x05367e5be: types.InputSecureFile,\n 0x064199744: types.SecureFileEmpty,\n 0x0e0277a62: types.SecureFile,\n 0x08aeabec3: types.SecureData,\n 0x07d6099dd: types.SecurePlainPhone,\n 0x021ec5a5f: types.SecurePlainEmail,\n 0x09d2a81e3: types.SecureValueTypePersonalDetails,\n 0x03dac6a00: types.SecureValueTypePassport,\n 0x006e425c4: types.SecureValueTypeDriverLicense,\n 0x0a0d0744b: types.SecureValueTypeIdentityCard,\n 0x099a48f23: types.SecureValueTypeInternalPassport,\n 0x0cbe31e26: types.SecureValueTypeAddress,\n 0x0fc36954e: types.SecureValueTypeUtilityBill,\n 0x089137c0d: types.SecureValueTypeBankStatement,\n 0x08b883488: types.SecureValueTypeRentalAgreement,\n 0x099e3806a: types.SecureValueTypePassportRegistration,\n 0x0ea02ec33: types.SecureValueTypeTemporaryRegistration,\n 0x0b320aadb: types.SecureValueTypePhone,\n 0x08e3ca7ee: types.SecureValueTypeEmail,\n 0x0187fa0ca: types.SecureValue,\n 0x0db21d0a7: types.InputSecureValue,\n 0x0ed1ecdb0: types.SecureValueHash,\n 0x0e8a40bd9: types.SecureValueErrorData,\n 0x000be3dfa: types.SecureValueErrorFrontSide,\n 0x0868a2aa5: types.SecureValueErrorReverseSide,\n 0x0e537ced6: types.SecureValueErrorSelfie,\n 0x07a700873: types.SecureValueErrorFile,\n 0x0666220e9: types.SecureValueErrorFiles,\n 0x0869d758f: types.SecureValueError,\n 0x0a1144770: types.SecureValueErrorTranslationFile,\n 0x034636dd8: types.SecureValueErrorTranslationFiles,\n 0x033f0ea47: types.SecureCredentialsEncrypted,\n 0x0ad2e1cd8: types.account.AuthorizationForm,\n 0x0811f854f: types.account.SentEmailCode,\n 0x066afa166: types.help.DeepLinkInfoEmpty,\n 0x06a4ee832: types.help.DeepLinkInfo,\n 0x01142bd56: types.SavedPhoneContact,\n 0x04dba4501: types.account.Takeout,\n 0x0d45ab096: types.PasswordKdfAlgoUnknown,\n 0x03a912d4a: types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow,\n 0x0004a8537: types.SecurePasswordKdfAlgoUnknown,\n 0x0bbf2dda0: types.SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000,\n 0x086471d92: types.SecurePasswordKdfAlgoSHA512,\n 0x01527bcac: types.SecureSecretSettings,\n 0x09880f658: types.InputCheckPasswordEmpty,\n 0x0d27ff082: types.InputCheckPasswordSRP,\n 0x0829d99da: types.SecureRequiredType,\n 0x0027477b4: types.SecureRequiredTypeOneOf,\n 0x0bfb9f457: types.help.PassportConfigNotModified,\n 0x0a098d6af: types.help.PassportConfig,\n 0x01d1b1245: types.InputAppEvent,\n 0x0c0de1bd9: types.JsonObjectValue,\n 0x03f6d7b68: types.JsonNull,\n 0x0c7345e6a: types.JsonBool,\n 0x02be0dfa4: types.JsonNumber,\n 0x0b71e767a: types.JsonString,\n 0x0f7444763: types.JsonArray,\n 0x099c1d49d: types.JsonObject,\n 0x034566b6a: types.PageTableCell,\n 0x0e0c0c5e5: types.PageTableRow,\n 0x06f747657: types.PageCaption,\n 0x0b92fb6cd: types.PageListItemText,\n 0x025e073fc: types.PageListItemBlocks,\n 0x05e068047: types.PageListOrderedItemText,\n 0x098dd8936: types.PageListOrderedItemBlocks,\n 0x0b390dc08: types.PageRelatedArticle,\n 0x0ae891bec: types.Page,\n 0x08c05f1c9: types.help.SupportName,\n 0x0f3ae2eed: types.help.UserInfoEmpty,\n 0x001eb3758: types.help.UserInfo,\n 0x06ca9c2e9: types.PollAnswer,\n 0x0d5529d06: types.Poll,\n 0x03b6ddad2: types.PollAnswerVoters,\n 0x05755785a: types.PollResults,\n 0x0f041e250: types.ChatOnlines,\n 0x047a971e0: types.StatsURL,\n 0x05fb224d5: types.ChatAdminRights,\n 0x09f120418: types.ChatBannedRights,\n 0x0e630b979: types.InputWallPaper,\n 0x072091c80: types.InputWallPaperSlug,\n 0x01c199183: types.account.WallPapersNotModified,\n 0x0702b65a9: types.account.WallPapers,\n 0x0debebe83: types.CodeSettings,\n 0x0a12f40b8: types.WallPaperSettings,\n 0x0d246fd47: types.AutoDownloadSettings,\n 0x063cacf26: types.account.AutoDownloadSettings,\n 0x0d5b3b9f9: types.EmojiKeyword,\n 0x0236df622: types.EmojiKeywordDeleted,\n 0x05cc761bd: types.EmojiKeywordsDifference,\n 0x0a575739d: types.EmojiURL,\n 0x0b3fb5361: types.EmojiLanguage,\n 0x0bc7fc6cd: types.FileLocationToBeDeprecated,\n 0x0ff544e65: types.Folder,\n 0x0fbd2c296: types.InputFolderPeer,\n 0x0e9baa668: types.FolderPeer,\n 0x0e844ebff: types.messages.SearchCounter,\n 0x092d33a0e: types.UrlAuthResultRequest,\n 0x08f8c0e4e: types.UrlAuthResultAccepted,\n 0x0a9d6db1f: types.UrlAuthResultDefault,\n 0x0bfb5ad8b: types.ChannelLocationEmpty,\n 0x0209b82db: types.ChannelLocation,\n 0x0ca461b5d: types.PeerLocated,\n 0x0d072acb4: types.RestrictionReason,\n 0x03c5693e9: types.InputTheme,\n 0x0f5890df1: types.InputThemeSlug,\n 0x0483d270c: types.ThemeDocumentNotModified,\n 0x0f7d90ce0: types.Theme,\n 0x0f41eb622: types.account.ThemesNotModified,\n 0x07f676421: types.account.Themes,\n 0x0cb9f372d: functions.InvokeAfterMsgRequest,\n 0x03dc4b4f0: functions.InvokeAfterMsgsRequest,\n 0x0785188b8: functions.InitConnectionRequest,\n 0x0da9b0d0d: functions.InvokeWithLayerRequest,\n 0x0bf9459b7: functions.InvokeWithoutUpdatesRequest,\n 0x0365275f2: functions.InvokeWithMessagesRangeRequest,\n 0x0aca9fd2e: functions.InvokeWithTakeoutRequest,\n 0x0a677244f: functions.auth.SendCodeRequest,\n 0x080eee427: functions.auth.SignUpRequest,\n 0x0bcd51581: functions.auth.SignInRequest,\n 0x05717da40: functions.auth.LogOutRequest,\n 0x09fab0d1a: functions.auth.ResetAuthorizationsRequest,\n 0x0e5bfffcd: functions.auth.ExportAuthorizationRequest,\n 0x0e3ef9613: functions.auth.ImportAuthorizationRequest,\n 0x0cdd42a05: functions.auth.BindTempAuthKeyRequest,\n 0x067a3ff2c: functions.auth.ImportBotAuthorizationRequest,\n 0x0d18b4d16: functions.auth.CheckPasswordRequest,\n 0x0d897bc66: functions.auth.RequestPasswordRecoveryRequest,\n 0x04ea56e92: functions.auth.RecoverPasswordRequest,\n 0x03ef1a9bf: functions.auth.ResendCodeRequest,\n 0x01f040578: functions.auth.CancelCodeRequest,\n 0x08e48a188: functions.auth.DropTempAuthKeysRequest,\n 0x068976c6f: functions.account.RegisterDeviceRequest,\n 0x03076c4bf: functions.account.UnregisterDeviceRequest,\n 0x084be5b93: functions.account.UpdateNotifySettingsRequest,\n 0x012b3ad31: functions.account.GetNotifySettingsRequest,\n 0x0db7e1747: functions.account.ResetNotifySettingsRequest,\n 0x078515775: functions.account.UpdateProfileRequest,\n 0x06628562c: functions.account.UpdateStatusRequest,\n 0x0aabb1763: functions.account.GetWallPapersRequest,\n 0x0ae189d5f: functions.account.ReportPeerRequest,\n 0x02714d86c: functions.account.CheckUsernameRequest,\n 0x03e0bdd7c: functions.account.UpdateUsernameRequest,\n 0x0dadbc950: functions.account.GetPrivacyRequest,\n 0x0c9f81ce8: functions.account.SetPrivacyRequest,\n 0x0418d4e0b: functions.account.DeleteAccountRequest,\n 0x008fc711d: functions.account.GetAccountTTLRequest,\n 0x02442485e: functions.account.SetAccountTTLRequest,\n 0x082574ae5: functions.account.SendChangePhoneCodeRequest,\n 0x070c32edb: functions.account.ChangePhoneRequest,\n 0x038df3532: functions.account.UpdateDeviceLockedRequest,\n 0x0e320c158: functions.account.GetAuthorizationsRequest,\n 0x0df77f3bc: functions.account.ResetAuthorizationRequest,\n 0x0548a30f5: functions.account.GetPasswordRequest,\n 0x09cd4eaf9: functions.account.GetPasswordSettingsRequest,\n 0x0a59b102f: functions.account.UpdatePasswordSettingsRequest,\n 0x01b3faa88: functions.account.SendConfirmPhoneCodeRequest,\n 0x05f2178c3: functions.account.ConfirmPhoneRequest,\n 0x0449e0b51: functions.account.GetTmpPasswordRequest,\n 0x0182e6d6f: functions.account.GetWebAuthorizationsRequest,\n 0x02d01b9ef: functions.account.ResetWebAuthorizationRequest,\n 0x0682d2594: functions.account.ResetWebAuthorizationsRequest,\n 0x0b288bc7d: functions.account.GetAllSecureValuesRequest,\n 0x073665bc2: functions.account.GetSecureValueRequest,\n 0x0899fe31d: functions.account.SaveSecureValueRequest,\n 0x0b880bc4b: functions.account.DeleteSecureValueRequest,\n 0x0b86ba8e1: functions.account.GetAuthorizationFormRequest,\n 0x0e7027c94: functions.account.AcceptAuthorizationRequest,\n 0x0a5a356f9: functions.account.SendVerifyPhoneCodeRequest,\n 0x04dd3a7f6: functions.account.VerifyPhoneRequest,\n 0x07011509f: functions.account.SendVerifyEmailCodeRequest,\n 0x0ecba39db: functions.account.VerifyEmailRequest,\n 0x0f05b4804: functions.account.InitTakeoutSessionRequest,\n 0x01d2652ee: functions.account.FinishTakeoutSessionRequest,\n 0x08fdf1920: functions.account.ConfirmPasswordEmailRequest,\n 0x07a7f2a15: functions.account.ResendPasswordEmailRequest,\n 0x0c1cbd5b6: functions.account.CancelPasswordEmailRequest,\n 0x09f07c728: functions.account.GetContactSignUpNotificationRequest,\n 0x0cff43f61: functions.account.SetContactSignUpNotificationRequest,\n 0x053577479: functions.account.GetNotifyExceptionsRequest,\n 0x0fc8ddbea: functions.account.GetWallPaperRequest,\n 0x0dd853661: functions.account.UploadWallPaperRequest,\n 0x06c5a5b37: functions.account.SaveWallPaperRequest,\n 0x0feed5769: functions.account.InstallWallPaperRequest,\n 0x0bb3b9804: functions.account.ResetWallPapersRequest,\n 0x056da0b3f: functions.account.GetAutoDownloadSettingsRequest,\n 0x076f36233: functions.account.SaveAutoDownloadSettingsRequest,\n 0x01c3db333: functions.account.UploadThemeRequest,\n 0x02b7ffd7f: functions.account.CreateThemeRequest,\n 0x03b8ea202: functions.account.UpdateThemeRequest,\n 0x0f257106c: functions.account.SaveThemeRequest,\n 0x07ae43737: functions.account.InstallThemeRequest,\n 0x08d9d742b: functions.account.GetThemeRequest,\n 0x0285946f8: functions.account.GetThemesRequest,\n 0x00d91a548: functions.users.GetUsersRequest,\n 0x0ca30a5b1: functions.users.GetFullUserRequest,\n 0x090c894b5: functions.users.SetSecureValueErrorsRequest,\n 0x02caa4a42: functions.contacts.GetContactIDsRequest,\n 0x0c4a353ee: functions.contacts.GetStatusesRequest,\n 0x0c023849f: functions.contacts.GetContactsRequest,\n 0x02c800be5: functions.contacts.ImportContactsRequest,\n 0x0096a0e00: functions.contacts.DeleteContactsRequest,\n 0x01013fd9e: functions.contacts.DeleteByPhonesRequest,\n 0x0332b49fc: functions.contacts.BlockRequest,\n 0x0e54100bd: functions.contacts.UnblockRequest,\n 0x0f57c350f: functions.contacts.GetBlockedRequest,\n 0x011f812d8: functions.contacts.SearchRequest,\n 0x0f93ccba3: functions.contacts.ResolveUsernameRequest,\n 0x0d4982db5: functions.contacts.GetTopPeersRequest,\n 0x01ae373ac: functions.contacts.ResetTopPeerRatingRequest,\n 0x0879537f1: functions.contacts.ResetSavedRequest,\n 0x082f1e39f: functions.contacts.GetSavedRequest,\n 0x08514bdda: functions.contacts.ToggleTopPeersRequest,\n 0x0e8f463d0: functions.contacts.AddContactRequest,\n 0x0f831a20f: functions.contacts.AcceptContactRequest,\n 0x00a356056: functions.contacts.GetLocatedRequest,\n 0x063c66506: functions.messages.GetMessagesRequest,\n 0x0a0ee3b73: functions.messages.GetDialogsRequest,\n 0x0dcbb8260: functions.messages.GetHistoryRequest,\n 0x08614ef68: functions.messages.SearchRequest,\n 0x00e306d3a: functions.messages.ReadHistoryRequest,\n 0x01c015b09: functions.messages.DeleteHistoryRequest,\n 0x0e58e95d2: functions.messages.DeleteMessagesRequest,\n 0x005a954c0: functions.messages.ReceivedMessagesRequest,\n 0x0a3825e50: functions.messages.SetTypingRequest,\n 0x0520c3870: functions.messages.SendMessageRequest,\n 0x03491eba9: functions.messages.SendMediaRequest,\n 0x0d9fee60e: functions.messages.ForwardMessagesRequest,\n 0x0cf1592db: functions.messages.ReportSpamRequest,\n 0x03672e09c: functions.messages.GetPeerSettingsRequest,\n 0x0bd82b658: functions.messages.ReportRequest,\n 0x03c6aa187: functions.messages.GetChatsRequest,\n 0x03b831c66: functions.messages.GetFullChatRequest,\n 0x0dc452855: functions.messages.EditChatTitleRequest,\n 0x0ca4c79d8: functions.messages.EditChatPhotoRequest,\n 0x0f9a0aa09: functions.messages.AddChatUserRequest,\n 0x0e0611f16: functions.messages.DeleteChatUserRequest,\n 0x009cb126e: functions.messages.CreateChatRequest,\n 0x026cf8950: functions.messages.GetDhConfigRequest,\n 0x0f64daf43: functions.messages.RequestEncryptionRequest,\n 0x03dbc0415: functions.messages.AcceptEncryptionRequest,\n 0x0edd923c5: functions.messages.DiscardEncryptionRequest,\n 0x0791451ed: functions.messages.SetEncryptedTypingRequest,\n 0x07f4b690a: functions.messages.ReadEncryptedHistoryRequest,\n 0x0a9776773: functions.messages.SendEncryptedRequest,\n 0x09a901b66: functions.messages.SendEncryptedFileRequest,\n 0x032d439a4: functions.messages.SendEncryptedServiceRequest,\n 0x055a5bb66: functions.messages.ReceivedQueueRequest,\n 0x04b0c8c0f: functions.messages.ReportEncryptedSpamRequest,\n 0x036a73f77: functions.messages.ReadMessageContentsRequest,\n 0x0043d4f2c: functions.messages.GetStickersRequest,\n 0x01c9618b1: functions.messages.GetAllStickersRequest,\n 0x08b68b0cc: functions.messages.GetWebPagePreviewRequest,\n 0x00df7534c: functions.messages.ExportChatInviteRequest,\n 0x03eadb1bb: functions.messages.CheckChatInviteRequest,\n 0x06c50051c: functions.messages.ImportChatInviteRequest,\n 0x02619a90e: functions.messages.GetStickerSetRequest,\n 0x0c78fe460: functions.messages.InstallStickerSetRequest,\n 0x0f96e55de: functions.messages.UninstallStickerSetRequest,\n 0x0e6df7378: functions.messages.StartBotRequest,\n 0x0c4c8a55d: functions.messages.GetMessagesViewsRequest,\n 0x0a9e69f2e: functions.messages.EditChatAdminRequest,\n 0x015a3b8e3: functions.messages.MigrateChatRequest,\n 0x0bf7225a4: functions.messages.SearchGlobalRequest,\n 0x078337739: functions.messages.ReorderStickerSetsRequest,\n 0x0338e2464: functions.messages.GetDocumentByHashRequest,\n 0x0bf9a776b: functions.messages.SearchGifsRequest,\n 0x083bf3d52: functions.messages.GetSavedGifsRequest,\n 0x0327a30cb: functions.messages.SaveGifRequest,\n 0x0514e999d: functions.messages.GetInlineBotResultsRequest,\n 0x0eb5ea206: functions.messages.SetInlineBotResultsRequest,\n 0x0220815b0: functions.messages.SendInlineBotResultRequest,\n 0x0fda68d36: functions.messages.GetMessageEditDataRequest,\n 0x048f71778: functions.messages.EditMessageRequest,\n 0x083557dba: functions.messages.EditInlineBotMessageRequest,\n 0x0810a9fec: functions.messages.GetBotCallbackAnswerRequest,\n 0x0d58f130a: functions.messages.SetBotCallbackAnswerRequest,\n 0x0e470bcfd: functions.messages.GetPeerDialogsRequest,\n 0x0bc39e14b: functions.messages.SaveDraftRequest,\n 0x06a3f8d65: functions.messages.GetAllDraftsRequest,\n 0x02dacca4f: functions.messages.GetFeaturedStickersRequest,\n 0x05b118126: functions.messages.ReadFeaturedStickersRequest,\n 0x05ea192c9: functions.messages.GetRecentStickersRequest,\n 0x0392718f8: functions.messages.SaveRecentStickerRequest,\n 0x08999602d: functions.messages.ClearRecentStickersRequest,\n 0x057f17692: functions.messages.GetArchivedStickersRequest,\n 0x065b8c79f: functions.messages.GetMaskStickersRequest,\n 0x0cc5b67cc: functions.messages.GetAttachedStickersRequest,\n 0x08ef8ecc0: functions.messages.SetGameScoreRequest,\n 0x015ad9f64: functions.messages.SetInlineGameScoreRequest,\n 0x0e822649d: functions.messages.GetGameHighScoresRequest,\n 0x00f635e1b: functions.messages.GetInlineGameHighScoresRequest,\n 0x00d0a48c4: functions.messages.GetCommonChatsRequest,\n 0x0eba80ff0: functions.messages.GetAllChatsRequest,\n 0x032ca8f91: functions.messages.GetWebPageRequest,\n 0x0a731e257: functions.messages.ToggleDialogPinRequest,\n 0x03b1adf37: functions.messages.ReorderPinnedDialogsRequest,\n 0x0d6b94df2: functions.messages.GetPinnedDialogsRequest,\n 0x0e5f672fa: functions.messages.SetBotShippingResultsRequest,\n 0x009c2dd95: functions.messages.SetBotPrecheckoutResultsRequest,\n 0x0519bc2b1: functions.messages.UploadMediaRequest,\n 0x0c97df020: functions.messages.SendScreenshotNotificationRequest,\n 0x021ce0b0e: functions.messages.GetFavedStickersRequest,\n 0x0b9ffc55b: functions.messages.FaveStickerRequest,\n 0x046578472: functions.messages.GetUnreadMentionsRequest,\n 0x00f0189d3: functions.messages.ReadMentionsRequest,\n 0x0bbc45b09: functions.messages.GetRecentLocationsRequest,\n 0x0cc0110cb: functions.messages.SendMultiMediaRequest,\n 0x05057c497: functions.messages.UploadEncryptedFileRequest,\n 0x0c2b7d08b: functions.messages.SearchStickerSetsRequest,\n 0x01cff7e08: functions.messages.GetSplitRangesRequest,\n 0x0c286d98f: functions.messages.MarkDialogUnreadRequest,\n 0x022e24e22: functions.messages.GetDialogUnreadMarksRequest,\n 0x07e58ee9c: functions.messages.ClearAllDraftsRequest,\n 0x0d2aaf7ec: functions.messages.UpdatePinnedMessageRequest,\n 0x010ea6184: functions.messages.SendVoteRequest,\n 0x073bb643b: functions.messages.GetPollResultsRequest,\n 0x06e2be050: functions.messages.GetOnlinesRequest,\n 0x0812c2ae6: functions.messages.GetStatsURLRequest,\n 0x0def60797: functions.messages.EditChatAboutRequest,\n 0x0a5866b41: functions.messages.EditChatDefaultBannedRightsRequest,\n 0x035a0e062: functions.messages.GetEmojiKeywordsRequest,\n 0x01508b6af: functions.messages.GetEmojiKeywordsDifferenceRequest,\n 0x04e9963b2: functions.messages.GetEmojiKeywordsLanguagesRequest,\n 0x0d5b10c26: functions.messages.GetEmojiURLRequest,\n 0x0732eef00: functions.messages.GetSearchCountersRequest,\n 0x0e33f5613: functions.messages.RequestUrlAuthRequest,\n 0x0f729ea98: functions.messages.AcceptUrlAuthRequest,\n 0x04facb138: functions.messages.HidePeerSettingsBarRequest,\n 0x0e2c2685b: functions.messages.GetScheduledHistoryRequest,\n 0x0bdbb0464: functions.messages.GetScheduledMessagesRequest,\n 0x0bd38850a: functions.messages.SendScheduledMessagesRequest,\n 0x059ae2b16: functions.messages.DeleteScheduledMessagesRequest,\n 0x0edd4882a: functions.updates.GetStateRequest,\n 0x025939651: functions.updates.GetDifferenceRequest,\n 0x003173d78: functions.updates.GetChannelDifferenceRequest,\n 0x0f0bb5152: functions.photos.UpdateProfilePhotoRequest,\n 0x04f32c098: functions.photos.UploadProfilePhotoRequest,\n 0x087cf7f2f: functions.photos.DeletePhotosRequest,\n 0x091cd32a8: functions.photos.GetUserPhotosRequest,\n 0x0b304a621: functions.upload.SaveFilePartRequest,\n 0x0b15a9afc: functions.upload.GetFileRequest,\n 0x0de7b673d: functions.upload.SaveBigFilePartRequest,\n 0x024e6818d: functions.upload.GetWebFileRequest,\n 0x02000bcc3: functions.upload.GetCdnFileRequest,\n 0x09b2754a8: functions.upload.ReuploadCdnFileRequest,\n 0x04da54231: functions.upload.GetCdnFileHashesRequest,\n 0x0c7025931: functions.upload.GetFileHashesRequest,\n 0x0c4f9186b: functions.help.GetConfigRequest,\n 0x01fb33026: functions.help.GetNearestDcRequest,\n 0x0522d5a7d: functions.help.GetAppUpdateRequest,\n 0x04d392343: functions.help.GetInviteTextRequest,\n 0x09cdf08cd: functions.help.GetSupportRequest,\n 0x09010ef6f: functions.help.GetAppChangelogRequest,\n 0x0ec22cfcd: functions.help.SetBotUpdatesStatusRequest,\n 0x052029342: functions.help.GetCdnConfigRequest,\n 0x03dc0f114: functions.help.GetRecentMeUrlsRequest,\n 0x03d7758e1: functions.help.GetProxyDataRequest,\n 0x02ca51fd1: functions.help.GetTermsOfServiceUpdateRequest,\n 0x0ee72f79a: functions.help.AcceptTermsOfServiceRequest,\n 0x03fedc75f: functions.help.GetDeepLinkInfoRequest,\n 0x098914110: functions.help.GetAppConfigRequest,\n 0x06f02f748: functions.help.SaveAppLogRequest,\n 0x0c661ad08: functions.help.GetPassportConfigRequest,\n 0x0d360e72c: functions.help.GetSupportNameRequest,\n 0x0038a08d3: functions.help.GetUserInfoRequest,\n 0x066b91b70: functions.help.EditUserInfoRequest,\n 0x0cc104937: functions.channels.ReadHistoryRequest,\n 0x084c1fd4e: functions.channels.DeleteMessagesRequest,\n 0x0d10dd71b: functions.channels.DeleteUserHistoryRequest,\n 0x0fe087810: functions.channels.ReportSpamRequest,\n 0x0ad8c9a23: functions.channels.GetMessagesRequest,\n 0x0123e05e9: functions.channels.GetParticipantsRequest,\n 0x0546dd7a6: functions.channels.GetParticipantRequest,\n 0x00a7f6bbb: functions.channels.GetChannelsRequest,\n 0x008736a09: functions.channels.GetFullChannelRequest,\n 0x03d5fb10f: functions.channels.CreateChannelRequest,\n 0x0d33c8902: functions.channels.EditAdminRequest,\n 0x0566decd0: functions.channels.EditTitleRequest,\n 0x0f12e57c9: functions.channels.EditPhotoRequest,\n 0x010e6bd2c: functions.channels.CheckUsernameRequest,\n 0x03514b3de: functions.channels.UpdateUsernameRequest,\n 0x024b524c5: functions.channels.JoinChannelRequest,\n 0x0f836aa95: functions.channels.LeaveChannelRequest,\n 0x0199f3a6c: functions.channels.InviteToChannelRequest,\n 0x0c0111fe3: functions.channels.DeleteChannelRequest,\n 0x0ceb77163: functions.channels.ExportMessageLinkRequest,\n 0x01f69b606: functions.channels.ToggleSignaturesRequest,\n 0x0f8b036af: functions.channels.GetAdminedPublicChannelsRequest,\n 0x072796912: functions.channels.EditBannedRequest,\n 0x033ddf480: functions.channels.GetAdminLogRequest,\n 0x0ea8ca4f9: functions.channels.SetStickersRequest,\n 0x0eab5dc38: functions.channels.ReadMessageContentsRequest,\n 0x0af369d42: functions.channels.DeleteHistoryRequest,\n 0x0eabbb94c: functions.channels.TogglePreHistoryHiddenRequest,\n 0x08341ecc0: functions.channels.GetLeftChannelsRequest,\n 0x0f5dad378: functions.channels.GetGroupsForDiscussionRequest,\n 0x040582bb2: functions.channels.SetDiscussionGroupRequest,\n 0x08f38cd1f: functions.channels.EditCreatorRequest,\n 0x058e63f6d: functions.channels.EditLocationRequest,\n 0x0edd49ef0: functions.channels.ToggleSlowModeRequest,\n 0x0aa2769ed: functions.bots.SendCustomRequestRequest,\n 0x0e6213f4d: functions.bots.AnswerWebhookJSONQueryRequest,\n 0x099f09745: functions.payments.GetPaymentFormRequest,\n 0x0a092a980: functions.payments.GetPaymentReceiptRequest,\n 0x0770a8e74: functions.payments.ValidateRequestedInfoRequest,\n 0x02b8879b3: functions.payments.SendPaymentFormRequest,\n 0x0227d824b: functions.payments.GetSavedInfoRequest,\n 0x0d83d70c1: functions.payments.ClearSavedInfoRequest,\n 0x09bd86e6a: functions.stickers.CreateStickerSetRequest,\n 0x0f7760f51: functions.stickers.RemoveStickerFromSetRequest,\n 0x0ffb6d4ca: functions.stickers.ChangeStickerPositionRequest,\n 0x08653febe: functions.stickers.AddStickerToSetRequest,\n 0x055451fa9: functions.phone.GetCallConfigRequest,\n 0x042ff96ed: functions.phone.RequestCallRequest,\n 0x03bd2b4a0: functions.phone.AcceptCallRequest,\n 0x02efe1722: functions.phone.ConfirmCallRequest,\n 0x017d54f61: functions.phone.ReceivedCallRequest,\n 0x0b2cbc1c0: functions.phone.DiscardCallRequest,\n 0x059ead627: functions.phone.SetCallRatingRequest,\n 0x0277add7e: functions.phone.SaveCallDebugRequest,\n 0x0f2f2330a: functions.langpack.GetLangPackRequest,\n 0x0efea3803: functions.langpack.GetStringsRequest,\n 0x0cd984aa5: functions.langpack.GetDifferenceRequest,\n 0x042c6978f: functions.langpack.GetLanguagesRequest,\n 0x06a596502: functions.langpack.GetLanguageRequest,\n 0x06847d0ab: functions.folders.EditPeerFoldersRequest,\n 0x01c295881: functions.folders.DeleteFolderRequest,\n 0x005162463: types.ResPQ,\n 0x083c95aec: types.PQInnerData,\n 0x0a9f55f95: types.PQInnerDataDc,\n 0x03c6a84d4: types.PQInnerDataTemp,\n 0x056fddf88: types.PQInnerDataTempDc,\n 0x079cb045d: types.ServerDHParamsFail,\n 0x0d0e8075c: types.ServerDHParamsOk,\n 0x0b5890dba: types.ServerDHInnerData,\n 0x06643b654: types.ClientDHInnerData,\n 0x03bcbf734: types.DhGenOk,\n 0x046dc1fb9: types.DhGenRetry,\n 0x0a69dae02: types.DhGenFail,\n 0x0f660e1d4: types.DestroyAuthKeyOk,\n 0x00a9f2259: types.DestroyAuthKeyNone,\n 0x0ea109b13: types.DestroyAuthKeyFail,\n 0x060469778: functions.ReqPqRequest,\n 0x0be7e8ef1: functions.ReqPqMultiRequest,\n 0x0d712e4be: functions.ReqDHParamsRequest,\n 0x0f5045f1f: functions.SetClientDHParamsRequest,\n 0x0d1435160: functions.DestroyAuthKeyRequest,\n 0x062d6b459: types.MsgsAck,\n 0x0a7eff811: types.BadMsgNotification,\n 0x0edab447b: types.BadServerSalt,\n 0x0da69fb52: types.MsgsStateReq,\n 0x004deb57d: types.MsgsStateInfo,\n 0x08cc0d131: types.MsgsAllInfo,\n 0x0276d3ec6: types.MsgDetailedInfo,\n 0x0809db6df: types.MsgNewDetailedInfo,\n 0x07d861a08: types.MsgResendReq,\n 0x02144ca19: types.RpcError,\n 0x05e2ad36e: types.RpcAnswerUnknown,\n 0x0cd78e586: types.RpcAnswerDroppedRunning,\n 0x0a43ad8b7: types.RpcAnswerDropped,\n 0x00949d9dc: types.FutureSalt,\n 0x0ae500895: types.FutureSalts,\n 0x0347773c5: types.Pong,\n 0x0e22045fc: types.DestroySessionOk,\n 0x062d350c9: types.DestroySessionNone,\n 0x09ec20908: types.NewSessionCreated,\n 0x09299359f: types.HttpWait,\n 0x0d433ad73: types.IpPort,\n 0x037982646: types.IpPortSecret,\n 0x04679b65f: types.AccessPointRule,\n 0x05a592a6c: types.help.ConfigSimple,\n 0x06c52c484: types.TlsClientHello,\n 0x04218a164: types.TlsBlockString,\n 0x04d4dc41e: types.TlsBlockRandom,\n 0x009333afb: types.TlsBlockZero,\n 0x010e8636f: types.TlsBlockDomain,\n 0x0e675a1c1: types.TlsBlockGrease,\n 0x0e725d44f: types.TlsBlockScope,\n 0x058e4a740: functions.RpcDropAnswerRequest,\n 0x0b921bd04: functions.GetFutureSaltsRequest,\n 0x07abe77ec: functions.PingRequest,\n 0x0f3427b8c: functions.PingDelayDisconnectRequest,\n 0x0e7512126: functions.DestroySessionRequest\n};\nmodule.exports = {\n LAYER: LAYER,\n tlobjects: tlobjects\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/AllTLObjects.js?"); /***/ }), /***/ "./gramjs/tl/core/GZIPPacked.js": /*!**************************************!*\ !*** ./gramjs/tl/core/GZIPPacked.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar _require2 = __webpack_require__(/*! node-gzip */ \"./node_modules/node-gzip/dist/index.js\"),\n ungzip = _require2.ungzip;\n\nvar _require3 = __webpack_require__(/*! node-gzip */ \"./node_modules/node-gzip/dist/index.js\"),\n gzip = _require3.gzip;\n\nvar GZIPPacked =\n/*#__PURE__*/\nfunction (_TLObject) {\n _inherits(GZIPPacked, _TLObject);\n\n function GZIPPacked(data) {\n var _this;\n\n _classCallCheck(this, GZIPPacked);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GZIPPacked).call(this));\n _this.data = data;\n _this.CONSTRUCTOR_ID = 0x3072cfa1;\n return _this;\n }\n\n _createClass(GZIPPacked, [{\n key: \"toBytes\",\n value: function toBytes() {\n return regeneratorRuntime.async(function toBytes$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.t0 = Buffer;\n _context.t1 = struct.pack(' 512)) {\n _context2.next = 6;\n break;\n }\n\n _context2.next = 3;\n return regeneratorRuntime.awrap(new GZIPPacked(data).toBytes());\n\n case 3:\n gzipped = _context2.sent;\n\n if (!(gzipped.length < data.length)) {\n _context2.next = 6;\n break;\n }\n\n return _context2.abrupt(\"return\", gzipped);\n\n case 6:\n return _context2.abrupt(\"return\", data);\n\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n });\n }\n }, {\n key: \"read\",\n value: function read(reader) {\n var constructor;\n return regeneratorRuntime.async(function read$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n constructor = reader.readInt(false);\n\n if (!(constructor !== GZIPPacked.CONSTRUCTOR_ID)) {\n _context3.next = 3;\n break;\n }\n\n throw new Error('not equal');\n\n case 3:\n _context3.next = 5;\n return regeneratorRuntime.awrap(gzip(reader.tgReadBytes()));\n\n case 5:\n return _context3.abrupt(\"return\", _context3.sent);\n\n case 6:\n case \"end\":\n return _context3.stop();\n }\n }\n });\n }\n }, {\n key: \"fromReader\",\n value: function fromReader(reader) {\n return regeneratorRuntime.async(function fromReader$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.t0 = GZIPPacked;\n _context4.next = 3;\n return regeneratorRuntime.awrap(ungzip(reader.tgReadBytes()));\n\n case 3:\n _context4.t1 = _context4.sent;\n return _context4.abrupt(\"return\", new _context4.t0(_context4.t1));\n\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }\n });\n }\n }]);\n\n return GZIPPacked;\n}(TLObject);\n\n_defineProperty(GZIPPacked, \"CONSTRUCTOR_ID\", 0x3072cfa1);\n\nmodule.exports = GZIPPacked;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/core/GZIPPacked.js?"); /***/ }), /***/ "./gramjs/tl/core/MessageContainer.js": /*!********************************************!*\ !*** ./gramjs/tl/core/MessageContainer.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar TLMessage = __webpack_require__(/*! ./TLMessage */ \"./gramjs/tl/core/TLMessage.js\");\n\nvar MessageContainer =\n/*#__PURE__*/\nfunction (_TLObject) {\n _inherits(MessageContainer, _TLObject);\n\n // Maximum size in bytes for the inner payload of the container.\n // Telegram will close the connection if the payload is bigger.\n // The overhead of the container itself is subtracted.\n // Maximum amount of messages that can't be sent inside a single\n // container, inclusive. Beyond this limit Telegram will respond\n // with BAD_MESSAGE 64 (invalid container).\n //\n // This limit is not 100% accurate and may in some cases be higher.\n // However, sending up to 100 requests at once in a single container\n // is a reasonable conservative value, since it could also depend on\n // other factors like size per request, but we cannot know this.\n function MessageContainer(messages) {\n var _this;\n\n _classCallCheck(this, MessageContainer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MessageContainer).call(this));\n _this.CONSTRUCTOR_ID = 0x73f1f8dc;\n _this.messages = messages;\n return _this;\n }\n\n _createClass(MessageContainer, null, [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var messages, length, x, msgId, seqNo, _length, before, obj, tlMessage;\n\n return regeneratorRuntime.async(function fromReader$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n messages = [];\n length = reader.readInt();\n\n for (x = 0; x < length; x++) {\n msgId = reader.readLong();\n seqNo = reader.readInt();\n _length = reader.readInt();\n before = reader.tellPosition();\n obj = reader.tgReadObject();\n reader.setPosition(before + _length);\n tlMessage = new TLMessage(msgId, seqNo, obj);\n messages.push(tlMessage);\n }\n\n return _context.abrupt(\"return\", new MessageContainer(messages));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n });\n }\n }]);\n\n return MessageContainer;\n}(TLObject);\n\n_defineProperty(MessageContainer, \"CONSTRUCTOR_ID\", 0x73f1f8dc);\n\n_defineProperty(MessageContainer, \"MAXIMUM_SIZE\", 1044456 - 8);\n\n_defineProperty(MessageContainer, \"MAXIMUM_LENGTH\", 100);\n\nmodule.exports = MessageContainer;\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/core/MessageContainer.js?"); /***/ }), /***/ "./gramjs/tl/core/RPCResult.js": /*!*************************************!*\ !*** ./gramjs/tl/core/RPCResult.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar _require2 = __webpack_require__(/*! ../types */ \"./gramjs/tl/types/index.js\"),\n RpcError = _require2.RpcError;\n\nvar GZIPPacked = __webpack_require__(/*! ./GZIPPacked */ \"./gramjs/tl/core/GZIPPacked.js\");\n\nvar RPCResult =\n/*#__PURE__*/\nfunction (_TLObject) {\n _inherits(RPCResult, _TLObject);\n\n function RPCResult(reqMsgId, body, error) {\n var _this;\n\n _classCallCheck(this, RPCResult);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RPCResult).call(this));\n _this.CONSTRUCTOR_ID = 0xf35c6d01;\n _this.reqMsgId = reqMsgId;\n _this.body = body;\n _this.error = error;\n return _this;\n }\n\n _createClass(RPCResult, null, [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var msgId, innerCode;\n return regeneratorRuntime.async(function fromReader$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n msgId = reader.readLong();\n innerCode = reader.readInt(false);\n\n if (!(innerCode === RpcError.CONSTRUCTOR_ID)) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", new RPCResult(msgId, null, RpcError.fromReader(reader)));\n\n case 4:\n if (!(innerCode === GZIPPacked.CONSTRUCTOR_ID)) {\n _context.next = 11;\n break;\n }\n\n _context.t0 = RPCResult;\n _context.t1 = msgId;\n _context.next = 9;\n return regeneratorRuntime.awrap(GZIPPacked.fromReader(reader));\n\n case 9:\n _context.t2 = _context.sent.data;\n return _context.abrupt(\"return\", new _context.t0(_context.t1, _context.t2));\n\n case 11:\n reader.seek(-4); // This reader.read() will read more than necessary, but it's okay.\n // We could make use of MessageContainer's length here, but since\n // it's not necessary we don't need to care about it.\n\n return _context.abrupt(\"return\", new RPCResult(msgId, reader.read(), null));\n\n case 13:\n case \"end\":\n return _context.stop();\n }\n }\n });\n }\n }]);\n\n return RPCResult;\n}(TLObject);\n\n_defineProperty(RPCResult, \"CONSTRUCTOR_ID\", 0xf35c6d01);\n\nmodule.exports = RPCResult;\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/core/RPCResult.js?"); /***/ }), /***/ "./gramjs/tl/core/TLMessage.js": /*!*************************************!*\ !*** ./gramjs/tl/core/TLMessage.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar TLMessage =\n/*#__PURE__*/\nfunction (_TLObject) {\n _inherits(TLMessage, _TLObject);\n\n function TLMessage(msgId, seqNo, obj) {\n var _this;\n\n _classCallCheck(this, TLMessage);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TLMessage).call(this));\n _this.msgId = msgId;\n _this.seqNo = seqNo;\n _this.obj = obj;\n return _this;\n }\n\n return TLMessage;\n}(TLObject);\n\n_defineProperty(TLMessage, \"SIZE_OVERHEAD\", 12);\n\nmodule.exports = TLMessage;\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/core/TLMessage.js?"); /***/ }), /***/ "./gramjs/tl/core/index.js": /*!*********************************!*\ !*** ./gramjs/tl/core/index.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _coreObjects;\n\nfunction _defineProperty(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; }\n\nvar TLMessage = __webpack_require__(/*! ./TLMessage */ \"./gramjs/tl/core/TLMessage.js\");\n\nvar RPCResult = __webpack_require__(/*! ./RPCResult */ \"./gramjs/tl/core/RPCResult.js\");\n\nvar MessageContainer = __webpack_require__(/*! ./MessageContainer */ \"./gramjs/tl/core/MessageContainer.js\");\n\nvar GZIPPacked = __webpack_require__(/*! ./GZIPPacked */ \"./gramjs/tl/core/GZIPPacked.js\");\n\nvar coreObjects = (_coreObjects = {}, _defineProperty(_coreObjects, RPCResult.CONSTRUCTOR_ID, RPCResult), _defineProperty(_coreObjects, GZIPPacked.CONSTRUCTOR_ID, GZIPPacked), _defineProperty(_coreObjects, MessageContainer.CONSTRUCTOR_ID, MessageContainer), _coreObjects);\nmodule.exports = {\n TLMessage: TLMessage,\n RPCResult: RPCResult,\n MessageContainer: MessageContainer,\n GZIPPacked: GZIPPacked,\n coreObjects: coreObjects\n};\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/core/index.js?"); /***/ }), /***/ "./gramjs/tl/custom/index.js": /*!***********************************!*\ !*** ./gramjs/tl/custom/index.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/custom/index.js?"); /***/ }), /***/ "./gramjs/tl/functions/account.js": /*!****************************************!*\ !*** ./gramjs/tl/functions/account.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\n/* ! File generated by TLObjects' generator. All changes will be ERASED !*/\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar _require2 = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLRequest = _require2.TLRequest;\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar _require3 = __webpack_require__(/*! ../../Helpers */ \"./gramjs/Helpers.js\"),\n readBigIntFromBuffer = _require3.readBigIntFromBuffer,\n readBufferFromBigInt = _require3.readBufferFromBigInt,\n generateRandomBytes = _require3.generateRandomBytes;\n\nvar RegisterDeviceRequest =\n/*#__PURE__*/\nfunction (_TLRequest) {\n _inherits(RegisterDeviceRequest, _TLRequest);\n\n /**\n :returns Bool: This type has no constructors.\n */\n function RegisterDeviceRequest(args) {\n var _this;\n\n _classCallCheck(this, RegisterDeviceRequest);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RegisterDeviceRequest).call(this));\n args = args || {};\n _this.CONSTRUCTOR_ID = 0x68976c6f;\n _this.SUBCLASS_OF_ID = 0xf5b399ac;\n _this.noMuted = args.noMuted || null;\n _this.tokenType = args.tokenType;\n _this.token = args.token;\n _this.appSandbox = args.appSandbox;\n _this.secret = args.secret;\n _this.otherUids = args.otherUids;\n return _this;\n }\n\n _createClass(RegisterDeviceRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('6f6c9768', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetSecureValueRequest(args) {\n var _this32;\n\n _classCallCheck(this, GetSecureValueRequest);\n\n _this32 = _possibleConstructorReturn(this, _getPrototypeOf(GetSecureValueRequest).call(this));\n args = args || {};\n _this32.CONSTRUCTOR_ID = 0x73665bc2;\n _this32.SUBCLASS_OF_ID = 0xe82e4121;\n _this32.types = args.types;\n return _this32;\n }\n\n _createClass(GetSecureValueRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('c25b6673', 'hex'), Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetContactIDsRequest(args) {\n var _this;\n\n _classCallCheck(this, GetContactIDsRequest);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GetContactIDsRequest).call(this));\n args = args || {};\n _this.CONSTRUCTOR_ID = 0x2caa4a42;\n _this.SUBCLASS_OF_ID = 0x5026710f;\n _this.hash = args.hash;\n return _this;\n }\n\n _createClass(GetContactIDsRequest, [{\n key: \"readResult\",\n value: function readResult(reader) {\n reader.readInt(); // Vector ID\n\n var temp = [];\n var len = reader.readInt(); // fix this\n\n for (var i = 0; i < len; i++) {\n temp.push(reader.readInt());\n }\n\n return temp;\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('424aaa2c', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetStringsRequest(args) {\n var _this2;\n\n _classCallCheck(this, GetStringsRequest);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(GetStringsRequest).call(this));\n args = args || {};\n _this2.CONSTRUCTOR_ID = 0xefea3803;\n _this2.SUBCLASS_OF_ID = 0xc7b7353d;\n _this2.langPack = args.langPack;\n _this2.langCode = args.langCode;\n _this2.keys = args.keys;\n return _this2;\n }\n\n _createClass(GetStringsRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('0338eaef', 'hex'), TLObject.serializeBytes(this.langPack), TLObject.serializeBytes(this.langCode), Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetLanguagesRequest(args) {\n var _this4;\n\n _classCallCheck(this, GetLanguagesRequest);\n\n _this4 = _possibleConstructorReturn(this, _getPrototypeOf(GetLanguagesRequest).call(this));\n args = args || {};\n _this4.CONSTRUCTOR_ID = 0x42c6978f;\n _this4.SUBCLASS_OF_ID = 0x280912c9;\n _this4.langPack = args.langPack;\n return _this4;\n }\n\n _createClass(GetLanguagesRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('8f97c642', 'hex'), TLObject.serializeBytes(this.langPack)]);\n }\n }], [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var _lang_pack;\n\n var _x;\n\n var len;\n _lang_pack = reader.tgReadString();\n return new this({\n langPack: _lang_pack\n });\n }\n }]);\n\n return GetLanguagesRequest;\n}(TLRequest);\n\n_defineProperty(GetLanguagesRequest, \"CONSTRUCTOR_ID\", 0x42c6978f);\n\n_defineProperty(GetLanguagesRequest, \"SUBCLASS_OF_ID\", 0x280912c9);\n\nvar GetLanguageRequest =\n/*#__PURE__*/\nfunction (_TLRequest5) {\n _inherits(GetLanguageRequest, _TLRequest5);\n\n /**\n :returns LangPackLanguage: Instance of LangPackLanguage\n */\n function GetLanguageRequest(args) {\n var _this5;\n\n _classCallCheck(this, GetLanguageRequest);\n\n _this5 = _possibleConstructorReturn(this, _getPrototypeOf(GetLanguageRequest).call(this));\n args = args || {};\n _this5.CONSTRUCTOR_ID = 0x6a596502;\n _this5.SUBCLASS_OF_ID = 0xabac89b7;\n _this5.langPack = args.langPack;\n _this5.langCode = args.langCode;\n return _this5;\n }\n\n _createClass(GetLanguageRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('0265596a', 'hex'), TLObject.serializeBytes(this.langPack), TLObject.serializeBytes(this.langCode)]);\n }\n }], [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var _lang_pack;\n\n var _lang_code;\n\n var _x;\n\n var len;\n _lang_pack = reader.tgReadString();\n _lang_code = reader.tgReadString();\n return new this({\n langPack: _lang_pack,\n langCode: _lang_code\n });\n }\n }]);\n\n return GetLanguageRequest;\n}(TLRequest);\n\n_defineProperty(GetLanguageRequest, \"CONSTRUCTOR_ID\", 0x6a596502);\n\n_defineProperty(GetLanguageRequest, \"SUBCLASS_OF_ID\", 0xabac89b7);\n\nmodule.exports = {\n GetLangPackRequest: GetLangPackRequest,\n GetStringsRequest: GetStringsRequest,\n GetDifferenceRequest: GetDifferenceRequest,\n GetLanguagesRequest: GetLanguagesRequest,\n GetLanguageRequest: GetLanguageRequest\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./gramjs/tl/functions/langpack.js?"); /***/ }), /***/ "./gramjs/tl/functions/messages.js": /*!*****************************************!*\ !*** ./gramjs/tl/functions/messages.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(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; }\n\n/* ! File generated by TLObjects' generator. All changes will be ERASED !*/\nvar _require = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLObject = _require.TLObject;\n\nvar _require2 = __webpack_require__(/*! ../tlobject */ \"./gramjs/tl/tlobject.js\"),\n TLRequest = _require2.TLRequest;\n\nvar struct = __webpack_require__(/*! python-struct */ \"./node_modules/python-struct/src/browser_adapter.js\");\n\nvar _require3 = __webpack_require__(/*! ../../Helpers */ \"./gramjs/Helpers.js\"),\n readBigIntFromBuffer = _require3.readBigIntFromBuffer,\n readBufferFromBigInt = _require3.readBufferFromBigInt,\n generateRandomBytes = _require3.generateRandomBytes;\n\nvar GetMessagesRequest =\n/*#__PURE__*/\nfunction (_TLRequest) {\n _inherits(GetMessagesRequest, _TLRequest);\n\n /**\n :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages, MessagesNotModified\n */\n function GetMessagesRequest(args) {\n var _this;\n\n _classCallCheck(this, GetMessagesRequest);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GetMessagesRequest).call(this));\n args = args || {};\n _this.CONSTRUCTOR_ID = 0x63c66506;\n _this.SUBCLASS_OF_ID = 0xd4b40b5e;\n _this.id = args.id;\n return _this;\n }\n\n _createClass(GetMessagesRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n var _tmp, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _x;\n\n return regeneratorRuntime.async(function resolve$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _tmp = [];\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context.prev = 4;\n\n for (_iterator = this.id[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n _x = _step.value;\n\n _tmp.push(utils.getInputMessage(_x));\n }\n\n _context.next = 12;\n break;\n\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](4);\n _didIteratorError = true;\n _iteratorError = _context.t0;\n\n case 12:\n _context.prev = 12;\n _context.prev = 13;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 15:\n _context.prev = 15;\n\n if (!_didIteratorError) {\n _context.next = 18;\n break;\n }\n\n throw _iteratorError;\n\n case 18:\n return _context.finish(15);\n\n case 19:\n return _context.finish(12);\n\n case 20:\n this.id = _tmp;\n\n case 21:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this, [[4, 8, 12, 20], [13,, 15, 19]]);\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('0665c663', 'hex'), Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function ReceivedMessagesRequest(args) {\n var _this8;\n\n _classCallCheck(this, ReceivedMessagesRequest);\n\n _this8 = _possibleConstructorReturn(this, _getPrototypeOf(ReceivedMessagesRequest).call(this));\n args = args || {};\n _this8.CONSTRUCTOR_ID = 0x05a954c0;\n _this8.SUBCLASS_OF_ID = 0x8565f897;\n _this8.maxId = args.maxId;\n return _this8;\n }\n\n _createClass(ReceivedMessagesRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('c054a905', 'hex'), struct.pack(': This type has no constructors.\n */\n function ReceivedQueueRequest(args) {\n var _this32;\n\n _classCallCheck(this, ReceivedQueueRequest);\n\n _this32 = _possibleConstructorReturn(this, _getPrototypeOf(ReceivedQueueRequest).call(this));\n args = args || {};\n _this32.CONSTRUCTOR_ID = 0x55a5bb66;\n _this32.SUBCLASS_OF_ID = 0x8918e168;\n _this32.maxQts = args.maxQts;\n return _this32;\n }\n\n _createClass(ReceivedQueueRequest, [{\n key: \"readResult\",\n value: function readResult(reader) {\n reader.readInt(); // Vector ID\n\n var temp = [];\n var len = reader.readInt(); // fix this\n\n for (var i = 0; i < len; i++) {\n temp.push(reader.readLong());\n }\n\n return temp;\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('66bba555', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetMessagesViewsRequest(args) {\n var _this45;\n\n _classCallCheck(this, GetMessagesViewsRequest);\n\n _this45 = _possibleConstructorReturn(this, _getPrototypeOf(GetMessagesViewsRequest).call(this));\n args = args || {};\n _this45.CONSTRUCTOR_ID = 0xc4c8a55d;\n _this45.SUBCLASS_OF_ID = 0x5026710f;\n _this45.peer = args.peer;\n _this45.id = args.id;\n _this45.increment = args.increment;\n return _this45;\n }\n\n _createClass(GetMessagesViewsRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n return regeneratorRuntime.async(function resolve$(_context21) {\n while (1) {\n switch (_context21.prev = _context21.next) {\n case 0:\n _context21.t0 = utils;\n _context21.next = 3;\n return regeneratorRuntime.awrap(client.getInputEntity(this.peer));\n\n case 3:\n _context21.t1 = _context21.sent;\n this.peer = _context21.t0.getInputPeer.call(_context21.t0, _context21.t1);\n\n case 5:\n case \"end\":\n return _context21.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"readResult\",\n value: function readResult(reader) {\n reader.readInt(); // Vector ID\n\n var temp = [];\n var len = reader.readInt(); // fix this\n\n for (var i = 0; i < len; i++) {\n temp.push(reader.readInt());\n }\n\n return temp;\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('5da5c8c4', 'hex'), this.peer.bytes, Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetAttachedStickersRequest(args) {\n var _this72;\n\n _classCallCheck(this, GetAttachedStickersRequest);\n\n _this72 = _possibleConstructorReturn(this, _getPrototypeOf(GetAttachedStickersRequest).call(this));\n args = args || {};\n _this72.CONSTRUCTOR_ID = 0xcc5b67cc;\n _this72.SUBCLASS_OF_ID = 0xcc125f6b;\n _this72.media = args.media;\n return _this72;\n }\n\n _createClass(GetAttachedStickersRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('cc675bcc', 'hex'), this.media.bytes]);\n }\n }], [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var _media;\n\n var _x;\n\n var len;\n _media = reader.tgReadObject();\n return new this({\n media: _media\n });\n }\n }]);\n\n return GetAttachedStickersRequest;\n}(TLRequest);\n\n_defineProperty(GetAttachedStickersRequest, \"CONSTRUCTOR_ID\", 0xcc5b67cc);\n\n_defineProperty(GetAttachedStickersRequest, \"SUBCLASS_OF_ID\", 0xcc125f6b);\n\nvar SetGameScoreRequest =\n/*#__PURE__*/\nfunction (_TLRequest73) {\n _inherits(SetGameScoreRequest, _TLRequest73);\n\n /**\n :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage\n */\n function SetGameScoreRequest(args) {\n var _this73;\n\n _classCallCheck(this, SetGameScoreRequest);\n\n _this73 = _possibleConstructorReturn(this, _getPrototypeOf(SetGameScoreRequest).call(this));\n args = args || {};\n _this73.CONSTRUCTOR_ID = 0x8ef8ecc0;\n _this73.SUBCLASS_OF_ID = 0x8af52aac;\n _this73.editMessage = args.editMessage || null;\n _this73.force = args.force || null;\n _this73.peer = args.peer;\n _this73.id = args.id;\n _this73.userId = args.userId;\n _this73.score = args.score;\n return _this73;\n }\n\n _createClass(SetGameScoreRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n return regeneratorRuntime.async(function resolve$(_context34) {\n while (1) {\n switch (_context34.prev = _context34.next) {\n case 0:\n _context34.t0 = utils;\n _context34.next = 3;\n return regeneratorRuntime.awrap(client.getInputEntity(this.peer));\n\n case 3:\n _context34.t1 = _context34.sent;\n this.peer = _context34.t0.getInputPeer.call(_context34.t0, _context34.t1);\n _context34.t2 = utils;\n _context34.next = 8;\n return regeneratorRuntime.awrap(client.getInputEntity(this.userId));\n\n case 8:\n _context34.t3 = _context34.sent;\n this.user_id = _context34.t2.getInputUser.call(_context34.t2, _context34.t3);\n\n case 10:\n case \"end\":\n return _context34.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('c0ecf88e', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetEmojiKeywordsLanguagesRequest(args) {\n var _this108;\n\n _classCallCheck(this, GetEmojiKeywordsLanguagesRequest);\n\n _this108 = _possibleConstructorReturn(this, _getPrototypeOf(GetEmojiKeywordsLanguagesRequest).call(this));\n args = args || {};\n _this108.CONSTRUCTOR_ID = 0x4e9963b2;\n _this108.SUBCLASS_OF_ID = 0xe795d387;\n _this108.langCodes = args.langCodes;\n return _this108;\n }\n\n _createClass(GetEmojiKeywordsLanguagesRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('b263994e', 'hex'), Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function GetSearchCountersRequest(args) {\n var _this110;\n\n _classCallCheck(this, GetSearchCountersRequest);\n\n _this110 = _possibleConstructorReturn(this, _getPrototypeOf(GetSearchCountersRequest).call(this));\n args = args || {};\n _this110.CONSTRUCTOR_ID = 0x732eef00;\n _this110.SUBCLASS_OF_ID = 0x6bde3c6e;\n _this110.peer = args.peer;\n _this110.filters = args.filters;\n return _this110;\n }\n\n _createClass(GetSearchCountersRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n return regeneratorRuntime.async(function resolve$(_context56) {\n while (1) {\n switch (_context56.prev = _context56.next) {\n case 0:\n _context56.t0 = utils;\n _context56.next = 3;\n return regeneratorRuntime.awrap(client.getInputEntity(this.peer));\n\n case 3:\n _context56.t1 = _context56.sent;\n this.peer = _context56.t0.getInputPeer.call(_context56.t0, _context56.t1);\n\n case 5:\n case \"end\":\n return _context56.stop();\n }\n }\n }, null, this);\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('00ef2e73', 'hex'), this.peer.bytes, Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function DeletePhotosRequest(args) {\n var _this3;\n\n _classCallCheck(this, DeletePhotosRequest);\n\n _this3 = _possibleConstructorReturn(this, _getPrototypeOf(DeletePhotosRequest).call(this));\n args = args || {};\n _this3.CONSTRUCTOR_ID = 0x87cf7f2f;\n _this3.SUBCLASS_OF_ID = 0x8918e168;\n _this3.id = args.id;\n return _this3;\n }\n\n _createClass(DeletePhotosRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n var _tmp, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _x;\n\n return regeneratorRuntime.async(function resolve$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _tmp = [];\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context2.prev = 4;\n\n for (_iterator = this.id[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n _x = _step.value;\n\n _tmp.push(utils.getInputPhoto(_x));\n }\n\n _context2.next = 12;\n break;\n\n case 8:\n _context2.prev = 8;\n _context2.t0 = _context2[\"catch\"](4);\n _didIteratorError = true;\n _iteratorError = _context2.t0;\n\n case 12:\n _context2.prev = 12;\n _context2.prev = 13;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 15:\n _context2.prev = 15;\n\n if (!_didIteratorError) {\n _context2.next = 18;\n break;\n }\n\n throw _iteratorError;\n\n case 18:\n return _context2.finish(15);\n\n case 19:\n return _context2.finish(12);\n\n case 20:\n this.id = _tmp;\n\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }\n }, null, this, [[4, 8, 12, 20], [13,, 15, 19]]);\n }\n }, {\n key: \"readResult\",\n value: function readResult(reader) {\n reader.readInt(); // Vector ID\n\n var temp = [];\n var len = reader.readInt(); // fix this\n\n for (var i = 0; i < len; i++) {\n temp.push(reader.readLong());\n }\n\n return temp;\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('2f7fcf87', 'hex'), Buffer.from('15c4b51c', 'hex'), struct.pack(': This type has no constructors.\n */\n function ReuploadCdnFileRequest(args) {\n var _this6;\n\n _classCallCheck(this, ReuploadCdnFileRequest);\n\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(ReuploadCdnFileRequest).call(this));\n args = args || {};\n _this6.CONSTRUCTOR_ID = 0x9b2754a8;\n _this6.SUBCLASS_OF_ID = 0xa5940726;\n _this6.fileToken = args.fileToken;\n _this6.requestToken = args.requestToken;\n return _this6;\n }\n\n _createClass(ReuploadCdnFileRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('a854279b', 'hex'), TLObject.serializeBytes(this.fileToken), TLObject.serializeBytes(this.requestToken)]);\n }\n }], [{\n key: \"fromReader\",\n value: function fromReader(reader) {\n var _file_token;\n\n var _request_token;\n\n var _x;\n\n var len;\n _file_token = reader.tgReadBytes();\n _request_token = reader.tgReadBytes();\n return new this({\n fileToken: _file_token,\n requestToken: _request_token\n });\n }\n }]);\n\n return ReuploadCdnFileRequest;\n}(TLRequest);\n\n_defineProperty(ReuploadCdnFileRequest, \"CONSTRUCTOR_ID\", 0x9b2754a8);\n\n_defineProperty(ReuploadCdnFileRequest, \"SUBCLASS_OF_ID\", 0xa5940726);\n\nvar GetCdnFileHashesRequest =\n/*#__PURE__*/\nfunction (_TLRequest7) {\n _inherits(GetCdnFileHashesRequest, _TLRequest7);\n\n /**\n :returns Vector: This type has no constructors.\n */\n function GetCdnFileHashesRequest(args) {\n var _this7;\n\n _classCallCheck(this, GetCdnFileHashesRequest);\n\n _this7 = _possibleConstructorReturn(this, _getPrototypeOf(GetCdnFileHashesRequest).call(this));\n args = args || {};\n _this7.CONSTRUCTOR_ID = 0x4da54231;\n _this7.SUBCLASS_OF_ID = 0xa5940726;\n _this7.fileToken = args.fileToken;\n _this7.offset = args.offset;\n return _this7;\n }\n\n _createClass(GetCdnFileHashesRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('3142a54d', 'hex'), TLObject.serializeBytes(this.fileToken), struct.pack(': This type has no constructors.\n */\n function GetFileHashesRequest(args) {\n var _this8;\n\n _classCallCheck(this, GetFileHashesRequest);\n\n _this8 = _possibleConstructorReturn(this, _getPrototypeOf(GetFileHashesRequest).call(this));\n args = args || {};\n _this8.CONSTRUCTOR_ID = 0xc7025931;\n _this8.SUBCLASS_OF_ID = 0xa5940726;\n _this8.location = args.location;\n _this8.offset = args.offset;\n return _this8;\n }\n\n _createClass(GetFileHashesRequest, [{\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('315902c7', 'hex'), this.location.bytes, struct.pack(': This type has no constructors.\n */\n function GetUsersRequest(args) {\n var _this;\n\n _classCallCheck(this, GetUsersRequest);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(GetUsersRequest).call(this));\n args = args || {};\n _this.CONSTRUCTOR_ID = 0x0d91a548;\n _this.SUBCLASS_OF_ID = 0x406da4d;\n _this.id = args.id;\n return _this;\n }\n\n _createClass(GetUsersRequest, [{\n key: \"resolve\",\n value: function resolve(client, utils) {\n var _tmp, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _x;\n\n return regeneratorRuntime.async(function resolve$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _tmp = [];\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context.prev = 4;\n _iterator = this.id[Symbol.iterator]();\n\n case 6:\n if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {\n _context.next = 18;\n break;\n }\n\n _x = _step.value;\n _context.t0 = _tmp;\n _context.t1 = utils;\n _context.next = 12;\n return regeneratorRuntime.awrap(client.getInputEntity(_x));\n\n case 12:\n _context.t2 = _context.sent;\n _context.t3 = _context.t1.getInputUser.call(_context.t1, _context.t2);\n\n _context.t0.push.call(_context.t0, _context.t3);\n\n case 15:\n _iteratorNormalCompletion = true;\n _context.next = 6;\n break;\n\n case 18:\n _context.next = 24;\n break;\n\n case 20:\n _context.prev = 20;\n _context.t4 = _context[\"catch\"](4);\n _didIteratorError = true;\n _iteratorError = _context.t4;\n\n case 24:\n _context.prev = 24;\n _context.prev = 25;\n\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n\n case 27:\n _context.prev = 27;\n\n if (!_didIteratorError) {\n _context.next = 30;\n break;\n }\n\n throw _iteratorError;\n\n case 30:\n return _context.finish(27);\n\n case 31:\n return _context.finish(24);\n\n case 32:\n this.id = _tmp;\n\n case 33:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, this, [[4, 20, 24, 32], [25,, 27, 31]]);\n }\n }, {\n key: \"bytes\",\n get: function get() {\n return Buffer.concat([Buffer.from('48a5910d', 'hex'), Buffer.from('15c4b51c', 'hex'), struct.pack('> 8) % 256, (data.length >> 16) % 256]));\n r.push(data);\n }\n\n r.push(Buffer.alloc(padding).fill(0));\n return Buffer.concat(r);\n }\n }, {\n key: \"serializeDate\",\n value: function serializeDate(dt) {\n if (!dt) {\n return Buffer.alloc(4).fill(0);\n }\n\n if (dt instanceof Date) {\n dt = Math.floor((Date.now() - dt.getTime()) / 1000);\n }\n\n if (typeof dt == 'number') {\n return struct.pack('. See LICENSE.txt. */\n(function (root) {\n \"use strict\";\n\n function checkInt(value) {\n return parseInt(value) === value;\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) {\n return false;\n }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n } // It's an array; check it is a valid representation of a byte\n\n\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n } // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n\n\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n\n targetArray.set(sourceArray, targetStart);\n }\n\n var convertUtf8 = function () {\n function toBytes(text) {\n var result = [],\n i = 0;\n text = encodeURI(text);\n\n while (i < text.length) {\n var c = text.charCodeAt(i++); // if it is a % sign, encode the following 2 bytes as a hex value\n\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16));\n i += 2; // otherwise, just the actual byte\n } else {\n result.push(c);\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [],\n i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode((c & 0x1f) << 6 | bytes[i + 1] & 0x3f));\n i += 2;\n } else {\n result.push(String.fromCharCode((c & 0x0f) << 12 | (bytes[i + 1] & 0x3f) << 6 | bytes[i + 2] & 0x3f));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes\n };\n }();\n\n var convertHex = function () {\n function toBytes(text) {\n var result = [];\n\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n } // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n\n\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes\n };\n }(); // Number of rounds by keysize\n\n\n var numberOfRounds = {\n 16: 10,\n 24: 12,\n 32: 14\n }; // Round constant words\n\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; // S-box and Inverse S-box (S is for Substitution)\n\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16];\n var Si = [0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; // Transformations for encryption\n\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; // Transformations for decryption\n\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; // Transformations for decryption key expansion\n\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]);\n }\n\n return result;\n }\n\n var AES = function AES(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n };\n\n AES.prototype._prepare = function () {\n var rounds = numberOfRounds[this.key.length];\n\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n } // encryption round keys\n\n\n this._Ke = []; // decryption round keys\n\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4; // convert the key into ints\n\n var tk = convertToInt32(this.key); // copy values into round key arrays\n\n var index;\n\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n } // key expansion (fips-197 section 5.2)\n\n\n var rconpointer = 0;\n var t = KC,\n tt;\n\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= S[tt >> 16 & 0xFF] << 24 ^ S[tt >> 8 & 0xFF] << 16 ^ S[tt & 0xFF] << 8 ^ S[tt >> 24 & 0xFF] ^ rcon[rconpointer] << 24;\n rconpointer += 1; // key expansion (for non-256 bit)\n\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n } // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n\n } else {\n for (var i = 1; i < KC / 2; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n tt = tk[KC / 2 - 1];\n tk[KC / 2] ^= S[tt & 0xFF] ^ S[tt >> 8 & 0xFF] << 8 ^ S[tt >> 16 & 0xFF] << 16 ^ S[tt >> 24 & 0xFF] << 24;\n\n for (var i = KC / 2 + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n } // copy values into round key arrays\n\n\n var i = 0,\n r,\n c;\n\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n } // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n\n\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = U1[tt >> 24 & 0xFF] ^ U2[tt >> 16 & 0xFF] ^ U3[tt >> 8 & 0xFF] ^ U4[tt & 0xFF];\n }\n }\n };\n\n AES.prototype.encrypt = function (plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0]; // convert plaintext to (ints ^ key)\n\n var t = convertToInt32(plaintext);\n\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n } // apply round transforms\n\n\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = T1[t[i] >> 24 & 0xff] ^ T2[t[(i + 1) % 4] >> 16 & 0xff] ^ T3[t[(i + 2) % 4] >> 8 & 0xff] ^ T4[t[(i + 3) % 4] & 0xff] ^ this._Ke[r][i];\n }\n\n t = a.slice();\n } // the last round is special\n\n\n var result = createArray(16),\n tt;\n\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i] = (S[t[i] >> 24 & 0xff] ^ tt >> 24) & 0xff;\n result[4 * i + 1] = (S[t[(i + 1) % 4] >> 16 & 0xff] ^ tt >> 16) & 0xff;\n result[4 * i + 2] = (S[t[(i + 2) % 4] >> 8 & 0xff] ^ tt >> 8) & 0xff;\n result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff;\n }\n\n return result;\n };\n\n AES.prototype.decrypt = function (ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0]; // convert plaintext to (ints ^ key)\n\n var t = convertToInt32(ciphertext);\n\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n } // apply round transforms\n\n\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = T5[t[i] >> 24 & 0xff] ^ T6[t[(i + 3) % 4] >> 16 & 0xff] ^ T7[t[(i + 2) % 4] >> 8 & 0xff] ^ T8[t[(i + 1) % 4] & 0xff] ^ this._Kd[r][i];\n }\n\n t = a.slice();\n } // the last round is special\n\n\n var result = createArray(16),\n tt;\n\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i] = (Si[t[i] >> 24 & 0xff] ^ tt >> 24) & 0xff;\n result[4 * i + 1] = (Si[t[(i + 3) % 4] >> 16 & 0xff] ^ tt >> 16) & 0xff;\n result[4 * i + 2] = (Si[t[(i + 2) % 4] >> 8 & 0xff] ^ tt >> 8) & 0xff;\n result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff;\n }\n\n return result;\n };\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n\n\n var ModeOfOperationECB = function ModeOfOperationECB(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n this._aes = new AES(key);\n };\n\n ModeOfOperationECB.prototype.encrypt = function (plaintext) {\n plaintext = coerceArray(plaintext);\n\n if (plaintext.length % 16 !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n };\n\n ModeOfOperationECB.prototype.decrypt = function (ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if (ciphertext.length % 16 !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n };\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n\n\n var ModeOfOperationCBC = function ModeOfOperationCBC(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n this._aes = new AES(key);\n };\n\n ModeOfOperationCBC.prototype.encrypt = function (plaintext) {\n plaintext = coerceArray(plaintext);\n\n if (plaintext.length % 16 !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n };\n\n ModeOfOperationCBC.prototype.decrypt = function (ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if (ciphertext.length % 16 !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n };\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n\n\n var ModeOfOperationCFB = function ModeOfOperationCFB(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) {\n segmentSize = 1;\n }\n\n this.segmentSize = segmentSize;\n this._shiftRegister = coerceArray(iv, true);\n this._aes = new AES(key);\n };\n\n ModeOfOperationCFB.prototype.encrypt = function (plaintext) {\n if (plaintext.length % this.segmentSize != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n var xorSegment;\n\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n } // Shift the register\n\n\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n };\n\n ModeOfOperationCFB.prototype.decrypt = function (ciphertext) {\n if (ciphertext.length % this.segmentSize != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n var xorSegment;\n\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n } // Shift the register\n\n\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n };\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n\n\n var ModeOfOperationOFB = function ModeOfOperationOFB(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n this._aes = new AES(key);\n };\n\n ModeOfOperationOFB.prototype.encrypt = function (plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }; // Decryption is symetric\n\n\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n /**\n * Counter object for CTR common mode of operation\n */\n\n var Counter = function Counter(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n } // We allow 0, but anything false-ish uses the default 1\n\n\n if (initialValue !== 0 && !initialValue) {\n initialValue = 1;\n }\n\n if (typeof initialValue === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n } else {\n this.setBytes(initialValue);\n }\n };\n\n Counter.prototype.setValue = function (value) {\n if (typeof value !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n } // We cannot safely handle numbers beyond the safe range for integers\n\n\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n };\n\n Counter.prototype.setBytes = function (bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function () {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n };\n /**\n * Mode Of Operation - Counter (CTR)\n */\n\n\n var ModeOfOperationCTR = function ModeOfOperationCTR(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter);\n }\n\n this._counter = counter;\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n this._aes = new AES(key);\n };\n\n ModeOfOperationCTR.prototype.encrypt = function (plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n\n this._counter.increment();\n }\n\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }; // Decryption is symetric\n\n\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; ///////////////////////\n // Padding\n // See:https://tools.ietf.org/html/rfc2315\n\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - data.length % 16;\n var result = createArray(data.length + padder);\n copyArray(data, result);\n\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n\n if (data.length < 16) {\n throw new Error('PKCS#7 invalid length');\n }\n\n var padder = data[data.length - 1];\n\n if (padder > 16) {\n throw new Error('PKCS#7 padding byte out of range');\n }\n\n var length = data.length - padder;\n\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n } ///////////////////////\n // Exporting\n // The block cipher\n\n\n var aesjs = {\n AES: AES,\n Counter: Counter,\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray\n }\n }; // node.js\n\n if (true) {\n module.exports = aesjs; // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else {}\n})(this);\n\n//# sourceURL=webpack://gramjs/./node_modules/aes-js/index.js?"); /***/ }), /***/ "./node_modules/asn1.js/lib/asn1.js": /*!******************************************!*\ !*** ./node_modules/asn1.js/lib/asn1.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var asn1 = exports;\nasn1.bignum = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nasn1.define = __webpack_require__(/*! ./asn1/api */ \"./node_modules/asn1.js/lib/asn1/api.js\").define;\nasn1.base = __webpack_require__(/*! ./asn1/base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\");\nasn1.constants = __webpack_require__(/*! ./asn1/constants */ \"./node_modules/asn1.js/lib/asn1/constants/index.js\");\nasn1.decoders = __webpack_require__(/*! ./asn1/decoders */ \"./node_modules/asn1.js/lib/asn1/decoders/index.js\");\nasn1.encoders = __webpack_require__(/*! ./asn1/encoders */ \"./node_modules/asn1.js/lib/asn1/encoders/index.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1.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__) { eval("var asn1 = __webpack_require__(/*! ../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar api = exports;\n\napi.define = function define(name, body) {\n return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n this.name = name;\n this.body = body;\n this.decoders = {};\n this.encoders = {};\n}\n\n;\n\nEntity.prototype._createNamed = function createNamed(base) {\n var named;\n\n try {\n named = __webpack_require__(/*! vm */ \"./node_modules/vm-browserify/index.js\").runInThisContext('(function ' + this.name + '(entity) {\\n' + ' this._initNamed(entity);\\n' + '})');\n } catch (e) {\n named = function named(entity) {\n this._initNamed(entity);\n };\n }\n\n inherits(named, base);\n\n named.prototype._initNamed = function initnamed(entity) {\n base.call(this, entity);\n };\n\n return new named(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n enc = enc || 'der'; // Lazily create decoder\n\n if (!this.decoders.hasOwnProperty(enc)) this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\n return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n enc = enc || 'der'; // Lazily create encoder\n\n if (!this.encoders.hasOwnProperty(enc)) this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\n return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc,\n/* internal */\nreporter) {\n return this._getEncoder(enc).encode(data, reporter);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/api.js?"); /***/ }), /***/ "./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__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Reporter = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").Reporter;\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nfunction DecoderBuffer(base, options) {\n Reporter.call(this, options);\n\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer');\n return;\n }\n\n this.base = base;\n this.offset = 0;\n this.length = base.length;\n}\n\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.prototype.save = function save() {\n return {\n offset: this.offset,\n reporter: Reporter.prototype.save.call(this)\n };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n // Return skipped data\n var res = new DecoderBuffer(this.base);\n res.offset = save.offset;\n res.length = this.offset;\n this.offset = save.offset;\n Reporter.prototype.restore.call(this, save.reporter);\n return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n if (this.offset + 1 <= this.length) return this.base.readUInt8(this.offset++, true);else return this.error(fail || 'DecoderBuffer overrun');\n};\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n if (!(this.offset + bytes <= this.length)) return this.error(fail || 'DecoderBuffer overrun');\n var res = new DecoderBuffer(this.base); // Share reporter state\n\n res._reporterState = this._reporterState;\n res.offset = this.offset;\n res.length = this.offset + bytes;\n this.offset += bytes;\n return res;\n};\n\nDecoderBuffer.prototype.raw = function raw(save) {\n return this.base.slice(save ? save.offset : this.offset, this.length);\n};\n\nfunction EncoderBuffer(value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0;\n this.value = value.map(function (item) {\n if (!(item instanceof EncoderBuffer)) item = new EncoderBuffer(item, reporter);\n this.length += item.length;\n return item;\n }, this);\n } else if (typeof value === 'number') {\n if (!(0 <= value && value <= 0xff)) return reporter.error('non-byte EncoderBuffer value');\n this.value = value;\n this.length = 1;\n } else if (typeof value === 'string') {\n this.value = value;\n this.length = Buffer.byteLength(value);\n } else if (Buffer.isBuffer(value)) {\n this.value = value;\n this.length = value.length;\n } else {\n return reporter.error('Unsupported type: ' + _typeof(value));\n }\n}\n\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n if (!out) out = new Buffer(this.length);\n if (!offset) offset = 0;\n if (this.length === 0) return out;\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function (item) {\n item.join(out, offset);\n offset += item.length;\n });\n } else {\n 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);\n offset += this.length;\n }\n\n return out;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/base/buffer.js?"); /***/ }), /***/ "./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__) { eval("var base = exports;\nbase.Reporter = __webpack_require__(/*! ./reporter */ \"./node_modules/asn1.js/lib/asn1/base/reporter.js\").Reporter;\nbase.DecoderBuffer = __webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").DecoderBuffer;\nbase.EncoderBuffer = __webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").EncoderBuffer;\nbase.Node = __webpack_require__(/*! ./node */ \"./node_modules/asn1.js/lib/asn1/base/node.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/base/index.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__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Reporter = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").Reporter;\n\nvar EncoderBuffer = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").EncoderBuffer;\n\nvar DecoderBuffer = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").DecoderBuffer;\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\"); // Supported tags\n\n\nvar 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\n\nvar methods = ['key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', 'any', 'contains'].concat(tags); // Overrided methods list\n\nvar overrided = ['_peekTag', '_decodeTag', '_use', '_decodeStr', '_decodeObjid', '_decodeTime', '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', '_encodeNull', '_encodeInt', '_encodeBool'];\n\nfunction Node(enc, parent) {\n var state = {};\n this._baseState = state;\n state.enc = enc;\n state.parent = parent || null;\n state.children = null; // State\n\n state.tag = null;\n state.args = null;\n state.reverseArgs = null;\n state.choice = null;\n state.optional = false;\n state.any = false;\n state.obj = false;\n state.use = null;\n state.useDecoder = null;\n state.key = null;\n state['default'] = null;\n state.explicit = null;\n state.implicit = null;\n state.contains = null; // Should create new instance on each method\n\n if (!state.parent) {\n state.children = [];\n\n this._wrap();\n }\n}\n\nmodule.exports = Node;\nvar stateProps = ['enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', 'implicit', 'contains'];\n\nNode.prototype.clone = function clone() {\n var state = this._baseState;\n var cstate = {};\n stateProps.forEach(function (prop) {\n cstate[prop] = state[prop];\n });\n var res = new this.constructor(cstate.parent);\n res._baseState = cstate;\n return res;\n};\n\nNode.prototype._wrap = function wrap() {\n var state = this._baseState;\n methods.forEach(function (method) {\n this[method] = function _wrappedMethod() {\n var clone = new this.constructor(this);\n state.children.push(clone);\n return clone[method].apply(clone, arguments);\n };\n }, this);\n};\n\nNode.prototype._init = function init(body) {\n var state = this._baseState;\n assert(state.parent === null);\n body.call(this); // Filter children\n\n state.children = state.children.filter(function (child) {\n return child._baseState.parent === this;\n }, this);\n assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n var state = this._baseState; // Filter children and args\n\n var children = args.filter(function (arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function (arg) {\n return !(arg instanceof this.constructor);\n }, this);\n\n if (children.length !== 0) {\n assert(state.children === null);\n state.children = children; // Replace parent to maintain backward link\n\n children.forEach(function (child) {\n child._baseState.parent = this;\n }, this);\n }\n\n if (args.length !== 0) {\n assert(state.args === null);\n state.args = args;\n state.reverseArgs = args.map(function (arg) {\n if (_typeof(arg) !== 'object' || arg.constructor !== Object) return arg;\n var res = {};\n Object.keys(arg).forEach(function (key) {\n if (key == (key | 0)) key |= 0;\n var value = arg[key];\n res[value] = key;\n });\n return res;\n });\n }\n}; //\n// Overrided methods\n//\n\n\noverrided.forEach(function (method) {\n Node.prototype[method] = function _overrided() {\n var state = this._baseState;\n throw new Error(method + ' not implemented for encoding: ' + state.enc);\n };\n}); //\n// Public methods\n//\n\ntags.forEach(function (tag) {\n Node.prototype[tag] = function _tagMethod() {\n var state = this._baseState;\n var args = Array.prototype.slice.call(arguments);\n assert(state.tag === null);\n state.tag = tag;\n\n this._useArgs(args);\n\n return this;\n };\n});\n\nNode.prototype.use = function use(item) {\n assert(item);\n var state = this._baseState;\n assert(state.use === null);\n state.use = item;\n return this;\n};\n\nNode.prototype.optional = function optional() {\n var state = this._baseState;\n state.optional = true;\n return this;\n};\n\nNode.prototype.def = function def(val) {\n var state = this._baseState;\n assert(state['default'] === null);\n state['default'] = val;\n state.optional = true;\n return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n var state = this._baseState;\n assert(state.explicit === null && state.implicit === null);\n state.explicit = num;\n return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n var state = this._baseState;\n assert(state.explicit === null && state.implicit === null);\n state.implicit = num;\n return this;\n};\n\nNode.prototype.obj = function obj() {\n var state = this._baseState;\n var args = Array.prototype.slice.call(arguments);\n state.obj = true;\n if (args.length !== 0) this._useArgs(args);\n return this;\n};\n\nNode.prototype.key = function key(newKey) {\n var state = this._baseState;\n assert(state.key === null);\n state.key = newKey;\n return this;\n};\n\nNode.prototype.any = function any() {\n var state = this._baseState;\n state.any = true;\n return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n var state = this._baseState;\n assert(state.choice === null);\n state.choice = obj;\n\n this._useArgs(Object.keys(obj).map(function (key) {\n return obj[key];\n }));\n\n return this;\n};\n\nNode.prototype.contains = function contains(item) {\n var state = this._baseState;\n assert(state.use === null);\n state.contains = item;\n return this;\n}; //\n// Decoding\n//\n\n\nNode.prototype._decode = function decode(input, options) {\n var state = this._baseState; // Decode root node\n\n if (state.parent === null) return input.wrapResult(state.children[0]._decode(input, options));\n var result = state['default'];\n var present = true;\n var prevKey = null;\n if (state.key !== null) prevKey = input.enterKey(state.key); // Check if tag is there\n\n if (state.optional) {\n var tag = null;\n if (state.explicit !== null) tag = state.explicit;else if (state.implicit !== null) tag = state.implicit;else if (state.tag !== null) tag = state.tag;\n\n if (tag === null && !state.any) {\n // Trial and Error\n var save = input.save();\n\n try {\n if (state.choice === null) this._decodeGeneric(state.tag, input, options);else this._decodeChoice(input, options);\n present = true;\n } catch (e) {\n present = false;\n }\n\n input.restore(save);\n } else {\n present = this._peekTag(input, tag, state.any);\n if (input.isError(present)) return present;\n }\n } // Push object on stack\n\n\n var prevObj;\n if (state.obj && present) prevObj = input.enterObject();\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n var explicit = this._decodeTag(input, state.explicit);\n\n if (input.isError(explicit)) return explicit;\n input = explicit;\n }\n\n var start = input.offset; // Unwrap implicit and normal values\n\n if (state.use === null && state.choice === null) {\n if (state.any) var save = input.save();\n\n var body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any);\n\n if (input.isError(body)) return body;\n if (state.any) result = input.raw(save);else input = body;\n }\n\n if (options && options.track && state.tag !== null) options.track(input.path(), start, input.length, 'tagged');\n if (options && options.track && state.tag !== null) options.track(input.path(), input.offset, input.length, 'content'); // Select proper method for tag\n\n if (state.any) result = result;else if (state.choice === null) result = this._decodeGeneric(state.tag, input, options);else result = this._decodeChoice(input, options);\n if (input.isError(result)) return result; // Decode children\n\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren(child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options);\n });\n } // Decode contained/encoded by schema, only in bit or octet strings\n\n\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n var data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);\n }\n } // Pop object\n\n\n if (state.obj && present) result = input.leaveObject(prevObj); // Set key\n\n if (state.key !== null && (result !== null || present === true)) input.leaveKey(prevKey, state.key, result);else if (prevKey !== null) input.exitKey(prevKey);\n return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n var state = this._baseState;\n if (tag === 'seq' || tag === 'set') return null;\n 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);\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)._decode(input, options);\n } else {\n return input.error('unknown tag: ' + tag);\n }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n var state = this._baseState; // Create altered use decoder if implicit is set\n\n state.useDecoder = this._use(entity, obj);\n assert(state.useDecoder._baseState.parent === null);\n state.useDecoder = state.useDecoder._baseState.children[0];\n\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone();\n state.useDecoder._baseState.implicit = state.implicit;\n }\n\n return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n var state = this._baseState;\n var result = null;\n var match = false;\n Object.keys(state.choice).some(function (key) {\n var save = input.save();\n var node = state.choice[key];\n\n try {\n var value = node._decode(input, options);\n\n if (input.isError(value)) return false;\n result = {\n type: key,\n value: value\n };\n match = true;\n } catch (e) {\n input.restore(save);\n return false;\n }\n\n return true;\n }, this);\n if (!match) return input.error('Choice not matched');\n return result;\n}; //\n// Encoding\n//\n\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n var state = this._baseState;\n if (state['default'] !== null && state['default'] === data) return;\n\n var result = this._encodeValue(data, reporter, parent);\n\n if (result === undefined) return;\n if (this._skipDefault(result, reporter, parent)) return;\n return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n var state = this._baseState; // Decode root node\n\n if (state.parent === null) return state.children[0]._encode(data, reporter || new Reporter());\n var result = null; // Set reporter to share it with a child class\n\n this.reporter = reporter; // Check if data is there\n\n if (state.optional && data === undefined) {\n if (state['default'] !== null) data = state['default'];else return;\n } // Encode children first\n\n\n var content = null;\n var primitive = false;\n\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data);\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter);\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter);\n primitive = true;\n } else if (state.children) {\n content = state.children.map(function (child) {\n if (child._baseState.tag === 'null_') return child._encode(null, reporter, data);\n if (child._baseState.key === null) return reporter.error('Child should have a key');\n var prevKey = reporter.enterKey(child._baseState.key);\n if (_typeof(data) !== 'object') return reporter.error('Child expected, but input is not object');\n\n var res = child._encode(data[child._baseState.key], reporter, data);\n\n reporter.leaveKey(prevKey);\n return res;\n }, this).filter(function (child) {\n return child;\n });\n content = this._createEncoderBuffer(content);\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n // TODO(indutny): this should be thrown on DSL level\n if (!(state.args && state.args.length === 1)) return reporter.error('Too many args for : ' + state.tag);\n if (!Array.isArray(data)) return reporter.error('seqof/setof, but data is not Array');\n var child = this.clone();\n child._baseState.implicit = null;\n content = this._createEncoderBuffer(data.map(function (item) {\n var state = this._baseState;\n return this._getUse(state.args[0], data)._encode(item, reporter);\n }, child));\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter);\n } else {\n content = this._encodePrimitive(state.tag, data);\n primitive = true;\n }\n } // Encode data itself\n\n\n var result;\n\n if (!state.any && state.choice === null) {\n var tag = state.implicit !== null ? state.implicit : state.tag;\n var cls = state.implicit === null ? 'universal' : 'context';\n\n if (tag === null) {\n if (state.use === null) reporter.error('Tag could be omitted only for .use()');\n } else {\n if (state.use === null) result = this._encodeComposite(tag, primitive, cls, content);\n }\n } // Wrap in explicit\n\n\n if (state.explicit !== null) result = this._encodeComposite(state.explicit, false, 'context', result);\n return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n var state = this._baseState;\n var node = state.choice[data.type];\n\n if (!node) {\n assert(false, data.type + ' not found in ' + JSON.stringify(Object.keys(state.choice)));\n }\n\n return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n var state = this._baseState;\n 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);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n return /^[A-Za-z0-9 '\\(\\)\\+,\\-\\.\\/:=\\?]*$/.test(str);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/base/node.js?"); /***/ }), /***/ "./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__) { eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n}\n\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n var state = this._reporterState;\n return {\n obj: state.obj,\n pathLen: state.path.length\n };\n};\n\nReporter.prototype.restore = function restore(data) {\n var state = this._reporterState;\n state.obj = data.obj;\n state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n var state = this._reporterState;\n state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n var state = this._reporterState;\n this.exitKey(index);\n if (state.obj !== null) state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n var state = this._reporterState;\n var prev = state.obj;\n state.obj = {};\n return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n var state = this._reporterState;\n var now = state.obj;\n state.obj = prev;\n return now;\n};\n\nReporter.prototype.error = function error(msg) {\n var err;\n var state = this._reporterState;\n var inherited = msg instanceof ReporterError;\n\n if (inherited) {\n err = msg;\n } else {\n err = new ReporterError(state.path.map(function (elem) {\n return '[' + JSON.stringify(elem) + ']';\n }).join(''), msg.message || msg, msg.stack);\n }\n\n if (!state.options.partial) throw err;\n if (!inherited) state.errors.push(err);\n return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n var state = this._reporterState;\n if (!state.options.partial) return result;\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n };\n};\n\nfunction ReporterError(path, msg) {\n this.path = path;\n this.rethrow(msg);\n}\n\n;\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n this.message = msg + ' at: ' + (this.path || '(shallow)');\n if (Error.captureStackTrace) Error.captureStackTrace(this, ReporterError);\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n }\n\n return this;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/base/reporter.js?"); /***/ }), /***/ "./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__) { eval("var constants = __webpack_require__(/*! ../constants */ \"./node_modules/asn1.js/lib/asn1/constants/index.js\");\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n};\nexports.tagClassByName = constants._reverse(exports.tagClass);\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n};\nexports.tagByName = constants._reverse(exports.tag);\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/constants/der.js?"); /***/ }), /***/ "./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__) { eval("var constants = exports; // Helper\n\nconstants._reverse = function reverse(map) {\n var res = {};\n Object.keys(map).forEach(function (key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key) key = key | 0;\n var value = map[key];\n res[value] = key;\n });\n return res;\n};\n\nconstants.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/constants/der.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/constants/index.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__) { eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar asn1 = __webpack_require__(/*! ../../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\n\nvar base = asn1.base;\nvar bignum = asn1.bignum; // Import DER constants\n\nvar der = asn1.constants.der;\n\nfunction DERDecoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity; // Construct base tree\n\n this.tree = new DERNode();\n\n this.tree._init(entity.body);\n}\n\n;\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n if (!(data instanceof base.DecoderBuffer)) data = new base.DecoderBuffer(data, options);\n return this.tree._decode(data, options);\n}; // Tree methods\n\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\n\ninherits(DERNode, base.Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n if (buffer.isEmpty()) return false;\n var state = buffer.save();\n var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n if (buffer.isError(decodedTag)) return decodedTag;\n buffer.restore(state);\n return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + 'of' === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n var decodedTag = derDecodeTag(buffer, 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag)) return decodedTag;\n var len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of \"' + tag + '\"'); // Failure\n\n if (buffer.isError(len)) return len;\n\n if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + 'of' !== tag) {\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n }\n\n if (decodedTag.primitive || len !== null) return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"'); // Indefinite length... find END tag\n\n var state = buffer.save();\n\n var res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n\n if (buffer.isError(res)) return res;\n len = buffer.offset - state.offset;\n buffer.restore(state);\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n while (true) {\n var tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag)) return tag;\n var len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len)) return len;\n var res;\n if (tag.primitive || len !== null) res = buffer.skip(len);else res = this._skipUntilEnd(buffer, fail); // Failure\n\n if (buffer.isError(res)) return res;\n if (tag.tagStr === 'end') break;\n }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, options) {\n var result = [];\n\n while (!buffer.isEmpty()) {\n var possibleEnd = this._peekTag(buffer, 'end');\n\n if (buffer.isError(possibleEnd)) return possibleEnd;\n var res = decoder.decode(buffer, 'der', options);\n if (buffer.isError(res) && possibleEnd) break;\n result.push(res);\n }\n\n return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n if (tag === 'bitstr') {\n var unused = buffer.readUInt8();\n if (buffer.isError(unused)) return unused;\n return {\n unused: unused,\n data: buffer.raw()\n };\n } else if (tag === 'bmpstr') {\n var raw = buffer.raw();\n if (raw.length % 2 === 1) return buffer.error('Decoding of string type: bmpstr length mismatch');\n var str = '';\n\n for (var i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n }\n\n return str;\n } else if (tag === 'numstr') {\n var numstr = buffer.raw().toString('ascii');\n\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: ' + 'numstr unsupported characters');\n }\n\n return numstr;\n } else if (tag === 'octstr') {\n return buffer.raw();\n } else if (tag === 'objDesc') {\n return buffer.raw();\n } else if (tag === 'printstr') {\n var printstr = buffer.raw().toString('ascii');\n\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: ' + 'printstr unsupported characters');\n }\n\n return printstr;\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString();\n } else {\n return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n var result;\n var identifiers = [];\n var ident = 0;\n\n while (!buffer.isEmpty()) {\n var subident = buffer.readUInt8();\n ident <<= 7;\n ident |= subident & 0x7f;\n\n if ((subident & 0x80) === 0) {\n identifiers.push(ident);\n ident = 0;\n }\n }\n\n if (subident & 0x80) identifiers.push(ident);\n var first = identifiers[0] / 40 | 0;\n var second = identifiers[0] % 40;\n if (relative) result = identifiers;else result = [first, second].concat(identifiers.slice(1));\n\n if (values) {\n var tmp = values[result.join(' ')];\n if (tmp === undefined) tmp = values[result.join('.')];\n if (tmp !== undefined) result = tmp;\n }\n\n return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n var str = buffer.raw().toString();\n\n if (tag === 'gentime') {\n var year = str.slice(0, 4) | 0;\n var mon = str.slice(4, 6) | 0;\n var day = str.slice(6, 8) | 0;\n var hour = str.slice(8, 10) | 0;\n var min = str.slice(10, 12) | 0;\n var sec = str.slice(12, 14) | 0;\n } else if (tag === 'utctime') {\n var year = str.slice(0, 2) | 0;\n var mon = str.slice(2, 4) | 0;\n var day = str.slice(4, 6) | 0;\n var hour = str.slice(6, 8) | 0;\n var min = str.slice(8, 10) | 0;\n var sec = str.slice(10, 12) | 0;\n if (year < 70) year = 2000 + year;else year = 1900 + year;\n } else {\n return buffer.error('Decoding ' + tag + ' time is not supported yet');\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull(buffer) {\n return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n var res = buffer.readUInt8();\n if (buffer.isError(res)) return res;else return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n // Bigint, return as it is (assume big endian)\n var raw = buffer.raw();\n var res = new bignum(raw);\n if (values) res = values[res.toString(10)] || res;\n return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function') entity = entity(obj);\n return entity._getDecoder('der').tree;\n}; // Utility methods\n\n\nfunction derDecodeTag(buf, fail) {\n var tag = buf.readUInt8(fail);\n if (buf.isError(tag)) return tag;\n var cls = der.tagClass[tag >> 6];\n var primitive = (tag & 0x20) === 0; // Multi-octet tag - load\n\n if ((tag & 0x1f) === 0x1f) {\n var oct = tag;\n tag = 0;\n\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail);\n if (buf.isError(oct)) return oct;\n tag <<= 7;\n tag |= oct & 0x7f;\n }\n } else {\n tag &= 0x1f;\n }\n\n var tagStr = der.tag[tag];\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n var len = buf.readUInt8(fail);\n if (buf.isError(len)) return len; // Indefinite form\n\n if (!primitive && len === 0x80) return null; // Definite form\n\n if ((len & 0x80) === 0) {\n // Short form\n return len;\n } // Long form\n\n\n var num = len & 0x7f;\n if (num > 4) return buf.error('length octect is too long');\n len = 0;\n\n for (var i = 0; i < num; i++) {\n len <<= 8;\n var j = buf.readUInt8(fail);\n if (buf.isError(j)) return j;\n len |= j;\n }\n\n return len;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/decoders/der.js?"); /***/ }), /***/ "./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__) { eval("var decoders = exports;\ndecoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\ndecoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/decoders/pem.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/decoders/index.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__) { eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar DERDecoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n}\n\n;\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n var lines = data.toString().split(/[\\r\\n]+/g);\n var label = options.label.toUpperCase();\n var re = /^-----(BEGIN|END) ([^-]+)-----$/;\n var start = -1;\n var end = -1;\n\n for (var i = 0; i < lines.length; i++) {\n var match = lines[i].match(re);\n if (match === null) continue;\n if (match[2] !== label) continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN') break;\n start = i;\n } else {\n if (match[1] !== 'END') break;\n end = i;\n break;\n }\n }\n\n if (start === -1 || end === -1) throw new Error('PEM section not found for: ' + label);\n var base64 = lines.slice(start + 1, end).join(''); // Remove excessive symbols\n\n base64.replace(/[^a-z0-9\\+\\/=]+/gi, '');\n var input = new Buffer(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/decoders/pem.js?"); /***/ }), /***/ "./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__) { eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar asn1 = __webpack_require__(/*! ../../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\n\nvar base = asn1.base; // Import DER constants\n\nvar der = asn1.constants.der;\n\nfunction DEREncoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity; // Construct base tree\n\n this.tree = new DERNode();\n\n this.tree._init(entity.body);\n}\n\n;\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n return this.tree._encode(data, reporter).join();\n}; // Tree methods\n\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\n\ninherits(DERNode, base.Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) {\n var encodedTag = encodeTag(tag, primitive, cls, this.reporter); // Short form\n\n if (content.length < 0x80) {\n var header = new Buffer(2);\n header[0] = encodedTag;\n header[1] = content.length;\n return this._createEncoderBuffer([header, content]);\n } // Long form\n // Count octets required to store length\n\n\n var lenOctets = 1;\n\n for (var i = content.length; i >= 0x100; i >>= 8) {\n lenOctets++;\n }\n\n var header = new Buffer(1 + 1 + lenOctets);\n header[0] = encodedTag;\n header[1] = 0x80 | lenOctets;\n\n for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) {\n header[i] = j & 0xff;\n }\n\n return this._createEncoderBuffer([header, content]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([str.unused | 0, str.data]);\n } else if (tag === 'bmpstr') {\n var buf = new Buffer(str.length * 2);\n\n for (var i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n }\n\n return this._createEncoderBuffer(buf);\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports ' + 'only digits and space');\n }\n\n return this._createEncoderBuffer(str);\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n 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');\n }\n\n return this._createEncoderBuffer(str);\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str);\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str);\n } else {\n return this.reporter.error('Encoding of string type: ' + tag + ' unsupported');\n }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n if (typeof id === 'string') {\n if (!values) return this.reporter.error('string objid given, but no values map found');\n if (!values.hasOwnProperty(id)) return this.reporter.error('objid not found in values map');\n id = values[id].split(/[\\s\\.]+/g);\n\n for (var i = 0; i < id.length; i++) {\n id[i] |= 0;\n }\n } else if (Array.isArray(id)) {\n id = id.slice();\n\n for (var i = 0; i < id.length; i++) {\n id[i] |= 0;\n }\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error('objid() should be either array or string, ' + 'got: ' + JSON.stringify(id));\n }\n\n if (!relative) {\n if (id[1] >= 40) return this.reporter.error('Second objid identifier OOB');\n id.splice(0, 2, id[0] * 40 + id[1]);\n } // Count number of octets\n\n\n var size = 0;\n\n for (var i = 0; i < id.length; i++) {\n var ident = id[i];\n\n for (size++; ident >= 0x80; ident >>= 7) {\n size++;\n }\n }\n\n var objid = new Buffer(size);\n var offset = objid.length - 1;\n\n for (var i = id.length - 1; i >= 0; i--) {\n var ident = id[i];\n objid[offset--] = ident & 0x7f;\n\n while ((ident >>= 7) > 0) {\n objid[offset--] = 0x80 | ident & 0x7f;\n }\n }\n\n return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n if (num < 10) return '0' + num;else return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n var str;\n var date = new Date(time);\n\n if (tag === 'gentime') {\n str = [two(date.getFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z'].join('');\n } else if (tag === 'utctime') {\n str = [two(date.getFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z'].join('');\n } else {\n this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n }\n\n return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n if (typeof num === 'string') {\n if (!values) return this.reporter.error('String int or enum given, but no values map');\n\n if (!values.hasOwnProperty(num)) {\n return this.reporter.error('Values map doesn\\'t contain: ' + JSON.stringify(num));\n }\n\n num = values[num];\n } // Bignum, assume big endian\n\n\n if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n var numArray = num.toArray();\n\n if (!num.sign && numArray[0] & 0x80) {\n numArray.unshift(0);\n }\n\n num = new Buffer(numArray);\n }\n\n if (Buffer.isBuffer(num)) {\n var size = num.length;\n if (num.length === 0) size++;\n var out = new Buffer(size);\n num.copy(out);\n if (num.length === 0) out[0] = 0;\n return this._createEncoderBuffer(out);\n }\n\n if (num < 0x80) return this._createEncoderBuffer(num);\n if (num < 0x100) return this._createEncoderBuffer([0, num]);\n var size = 1;\n\n for (var i = num; i >= 0x100; i >>= 8) {\n size++;\n }\n\n var out = new Array(size);\n\n for (var i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff;\n num >>= 8;\n }\n\n if (out[0] & 0x80) {\n out.unshift(0);\n }\n\n return this._createEncoderBuffer(new Buffer(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function') entity = entity(obj);\n return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n var state = this._baseState;\n var i;\n if (state['default'] === null) return false;\n var data = dataBuffer.join();\n if (state.defaultBuffer === undefined) state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n if (data.length !== state.defaultBuffer.length) return false;\n\n for (i = 0; i < data.length; i++) {\n if (data[i] !== state.defaultBuffer[i]) return false;\n }\n\n return true;\n}; // Utility methods\n\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n var res;\n if (tag === 'seqof') tag = 'seq';else if (tag === 'setof') tag = 'set';\n 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);\n if (res >= 0x1f) return reporter.error('Multi-octet tag encoding unsupported');\n if (!primitive) res |= 0x20;\n res |= der.tagClassByName[cls || 'universal'] << 6;\n return res;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/encoders/der.js?"); /***/ }), /***/ "./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__) { eval("var encoders = exports;\nencoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\nencoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/encoders/pem.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/encoders/index.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__) { eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar DEREncoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\n\nfunction PEMEncoder(entity) {\n DEREncoder.call(this, entity);\n this.enc = 'pem';\n}\n\n;\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n var buf = DEREncoder.prototype.encode.call(this, data);\n var p = buf.toString('base64');\n var out = ['-----BEGIN ' + options.label + '-----'];\n\n for (var i = 0; i < p.length; i += 64) {\n out.push(p.slice(i, i + 64));\n }\n\n out.push('-----END ' + options.label + '-----');\n return out.join('\\n');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1.js/lib/asn1/encoders/pem.js?"); /***/ }), /***/ "./node_modules/asn1/lib/ber/errors.js": /*!*********************************************!*\ !*** ./node_modules/asn1/lib/ber/errors.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// Copyright 2011 Mark Cavage All rights reserved.\nmodule.exports = {\n newInvalidAsn1Error: function newInvalidAsn1Error(msg) {\n var e = new Error();\n e.name = 'InvalidAsn1Error';\n e.message = msg || '';\n return e;\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/ber/errors.js?"); /***/ }), /***/ "./node_modules/asn1/lib/ber/index.js": /*!********************************************!*\ !*** ./node_modules/asn1/lib/ber/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// Copyright 2011 Mark Cavage All rights reserved.\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/asn1/lib/ber/errors.js\");\n\nvar types = __webpack_require__(/*! ./types */ \"./node_modules/asn1/lib/ber/types.js\");\n\nvar Reader = __webpack_require__(/*! ./reader */ \"./node_modules/asn1/lib/ber/reader.js\");\n\nvar Writer = __webpack_require__(/*! ./writer */ \"./node_modules/asn1/lib/ber/writer.js\"); // --- Exports\n\n\nmodule.exports = {\n Reader: Reader,\n Writer: Writer\n};\n\nfor (var t in types) {\n if (types.hasOwnProperty(t)) module.exports[t] = types[t];\n}\n\nfor (var e in errors) {\n if (errors.hasOwnProperty(e)) module.exports[e] = errors[e];\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/ber/index.js?"); /***/ }), /***/ "./node_modules/asn1/lib/ber/reader.js": /*!*********************************************!*\ !*** ./node_modules/asn1/lib/ber/reader.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// Copyright 2011 Mark Cavage All rights reserved.\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\n\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\nvar ASN1 = __webpack_require__(/*! ./types */ \"./node_modules/asn1/lib/ber/types.js\");\n\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/asn1/lib/ber/errors.js\"); // --- Globals\n\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error; // --- API\n\nfunction Reader(data) {\n if (!data || !Buffer.isBuffer(data)) throw new TypeError('data must be a node Buffer');\n this._buf = data;\n this._size = data.length; // These hold the \"current\" state\n\n this._len = 0;\n this._offset = 0;\n}\n\nObject.defineProperty(Reader.prototype, 'length', {\n enumerable: true,\n get: function get() {\n return this._len;\n }\n});\nObject.defineProperty(Reader.prototype, 'offset', {\n enumerable: true,\n get: function get() {\n return this._offset;\n }\n});\nObject.defineProperty(Reader.prototype, 'remain', {\n get: function get() {\n return this._size - this._offset;\n }\n});\nObject.defineProperty(Reader.prototype, 'buffer', {\n get: function get() {\n return this._buf.slice(this._offset);\n }\n});\n/**\n * Reads a single byte and advances offset; you can pass in `true` to make this\n * a \"peek\" operation (i.e., get the byte, but don't advance the offset).\n *\n * @param {Boolean} peek true means don't move offset.\n * @return {Number} the next byte, null if not enough data.\n */\n\nReader.prototype.readByte = function (peek) {\n if (this._size - this._offset < 1) return null;\n var b = this._buf[this._offset] & 0xff;\n if (!peek) this._offset += 1;\n return b;\n};\n\nReader.prototype.peek = function () {\n return this.readByte(true);\n};\n/**\n * Reads a (potentially) variable length off the BER buffer. This call is\n * not really meant to be called directly, as callers have to manipulate\n * the internal buffer afterwards.\n *\n * As a result of this call, you can call `Reader.length`, until the\n * next thing called that does a readLength.\n *\n * @return {Number} the amount of offset to advance the buffer.\n * @throws {InvalidAsn1Error} on bad ASN.1\n */\n\n\nReader.prototype.readLength = function (offset) {\n if (offset === undefined) offset = this._offset;\n if (offset >= this._size) return null;\n var lenB = this._buf[offset++] & 0xff;\n if (lenB === null) return null;\n\n if ((lenB & 0x80) === 0x80) {\n lenB &= 0x7f;\n if (lenB === 0) throw newInvalidAsn1Error('Indefinite length not supported');\n if (lenB > 4) throw newInvalidAsn1Error('encoding too long');\n if (this._size - offset < lenB) return null;\n this._len = 0;\n\n for (var i = 0; i < lenB; i++) {\n this._len = (this._len << 8) + (this._buf[offset++] & 0xff);\n }\n } else {\n // Wasn't a variable length\n this._len = lenB;\n }\n\n return offset;\n};\n/**\n * Parses the next sequence in this BER buffer.\n *\n * To get the length of the sequence, call `Reader.length`.\n *\n * @return {Number} the sequence's tag.\n */\n\n\nReader.prototype.readSequence = function (tag) {\n var seq = this.peek();\n if (seq === null) return null;\n if (tag !== undefined && tag !== seq) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + seq.toString(16));\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null) return null;\n this._offset = o;\n return seq;\n};\n\nReader.prototype.readInt = function () {\n return this._readTag(ASN1.Integer);\n};\n\nReader.prototype.readBoolean = function () {\n return this._readTag(ASN1.Boolean) === 0 ? false : true;\n};\n\nReader.prototype.readEnumeration = function () {\n return this._readTag(ASN1.Enumeration);\n};\n\nReader.prototype.readString = function (tag, retbuf) {\n if (!tag) tag = ASN1.OctetString;\n var b = this.peek();\n if (b === null) return null;\n if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16));\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null) return null;\n if (this.length > this._size - o) return null;\n this._offset = o;\n if (this.length === 0) return retbuf ? Buffer.alloc(0) : '';\n\n var str = this._buf.slice(this._offset, this._offset + this.length);\n\n this._offset += this.length;\n return retbuf ? str : str.toString('utf8');\n};\n\nReader.prototype.readOID = function (tag) {\n if (!tag) tag = ASN1.OID;\n var b = this.readString(tag, true);\n if (b === null) return null;\n var values = [];\n var value = 0;\n\n for (var i = 0; i < b.length; i++) {\n var _byte = b[i] & 0xff;\n\n value <<= 7;\n value += _byte & 0x7f;\n\n if ((_byte & 0x80) === 0) {\n values.push(value);\n value = 0;\n }\n }\n\n value = values.shift();\n values.unshift(value % 40);\n values.unshift(value / 40 >> 0);\n return values.join('.');\n};\n\nReader.prototype._readTag = function (tag) {\n assert.ok(tag !== undefined);\n var b = this.peek();\n if (b === null) return null;\n if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16));\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null) return null;\n if (this.length > 4) throw newInvalidAsn1Error('Integer too long: ' + this.length);\n if (this.length > this._size - o) return null;\n this._offset = o;\n var fb = this._buf[this._offset];\n var value = 0;\n\n for (var i = 0; i < this.length; i++) {\n value <<= 8;\n value |= this._buf[this._offset++] & 0xff;\n }\n\n if ((fb & 0x80) === 0x80 && i !== 4) value -= 1 << i * 8;\n return value >> 0;\n}; // --- Exported API\n\n\nmodule.exports = Reader;\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/ber/reader.js?"); /***/ }), /***/ "./node_modules/asn1/lib/ber/types.js": /*!********************************************!*\ !*** ./node_modules/asn1/lib/ber/types.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// Copyright 2011 Mark Cavage All rights reserved.\nmodule.exports = {\n EOC: 0,\n Boolean: 1,\n Integer: 2,\n BitString: 3,\n OctetString: 4,\n Null: 5,\n OID: 6,\n ObjectDescriptor: 7,\n External: 8,\n Real: 9,\n // float\n Enumeration: 10,\n PDV: 11,\n Utf8String: 12,\n RelativeOID: 13,\n Sequence: 16,\n Set: 17,\n NumericString: 18,\n PrintableString: 19,\n T61String: 20,\n VideotexString: 21,\n IA5String: 22,\n UTCTime: 23,\n GeneralizedTime: 24,\n GraphicString: 25,\n VisibleString: 26,\n GeneralString: 28,\n UniversalString: 29,\n CharacterString: 30,\n BMPString: 31,\n Constructor: 32,\n Context: 128\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/ber/types.js?"); /***/ }), /***/ "./node_modules/asn1/lib/ber/writer.js": /*!*********************************************!*\ !*** ./node_modules/asn1/lib/ber/writer.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n// Copyright 2011 Mark Cavage All rights reserved.\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\n\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\nvar ASN1 = __webpack_require__(/*! ./types */ \"./node_modules/asn1/lib/ber/types.js\");\n\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/asn1/lib/ber/errors.js\"); // --- Globals\n\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\nvar DEFAULT_OPTS = {\n size: 1024,\n growthFactor: 8\n}; // --- Helpers\n\nfunction merge(from, to) {\n assert.ok(from);\n assert.equal(_typeof(from), 'object');\n assert.ok(to);\n assert.equal(_typeof(to), 'object');\n var keys = Object.getOwnPropertyNames(from);\n keys.forEach(function (key) {\n if (to[key]) return;\n var value = Object.getOwnPropertyDescriptor(from, key);\n Object.defineProperty(to, key, value);\n });\n return to;\n} // --- API\n\n\nfunction Writer(options) {\n options = merge(DEFAULT_OPTS, options || {});\n this._buf = Buffer.alloc(options.size || 1024);\n this._size = this._buf.length;\n this._offset = 0;\n this._options = options; // A list of offsets in the buffer where we need to insert\n // sequence tag/len pairs.\n\n this._seq = [];\n}\n\nObject.defineProperty(Writer.prototype, 'buffer', {\n get: function get() {\n if (this._seq.length) throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');\n return this._buf.slice(0, this._offset);\n }\n});\n\nWriter.prototype.writeByte = function (b) {\n if (typeof b !== 'number') throw new TypeError('argument must be a Number');\n\n this._ensure(1);\n\n this._buf[this._offset++] = b;\n};\n\nWriter.prototype.writeInt = function (i, tag) {\n if (typeof i !== 'number') throw new TypeError('argument must be a Number');\n if (typeof tag !== 'number') tag = ASN1.Integer;\n var sz = 4;\n\n while (((i & 0xff800000) === 0 || (i & 0xff800000) === 0xff800000 >> 0) && sz > 1) {\n sz--;\n i <<= 8;\n }\n\n if (sz > 4) throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');\n\n this._ensure(2 + sz);\n\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = sz;\n\n while (sz-- > 0) {\n this._buf[this._offset++] = (i & 0xff000000) >>> 24;\n i <<= 8;\n }\n};\n\nWriter.prototype.writeNull = function () {\n this.writeByte(ASN1.Null);\n this.writeByte(0x00);\n};\n\nWriter.prototype.writeEnumeration = function (i, tag) {\n if (typeof i !== 'number') throw new TypeError('argument must be a Number');\n if (typeof tag !== 'number') tag = ASN1.Enumeration;\n return this.writeInt(i, tag);\n};\n\nWriter.prototype.writeBoolean = function (b, tag) {\n if (typeof b !== 'boolean') throw new TypeError('argument must be a Boolean');\n if (typeof tag !== 'number') tag = ASN1.Boolean;\n\n this._ensure(3);\n\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = 0x01;\n this._buf[this._offset++] = b ? 0xff : 0x00;\n};\n\nWriter.prototype.writeString = function (s, tag) {\n if (typeof s !== 'string') throw new TypeError('argument must be a string (was: ' + _typeof(s) + ')');\n if (typeof tag !== 'number') tag = ASN1.OctetString;\n var len = Buffer.byteLength(s);\n this.writeByte(tag);\n this.writeLength(len);\n\n if (len) {\n this._ensure(len);\n\n this._buf.write(s, this._offset);\n\n this._offset += len;\n }\n};\n\nWriter.prototype.writeBuffer = function (buf, tag) {\n if (typeof tag !== 'number') throw new TypeError('tag must be a number');\n if (!Buffer.isBuffer(buf)) throw new TypeError('argument must be a buffer');\n this.writeByte(tag);\n this.writeLength(buf.length);\n\n this._ensure(buf.length);\n\n buf.copy(this._buf, this._offset, 0, buf.length);\n this._offset += buf.length;\n};\n\nWriter.prototype.writeStringArray = function (strings) {\n if (!strings instanceof Array) throw new TypeError('argument must be an Array[String]');\n var self = this;\n strings.forEach(function (s) {\n self.writeString(s);\n });\n}; // This is really to solve DER cases, but whatever for now\n\n\nWriter.prototype.writeOID = function (s, tag) {\n if (typeof s !== 'string') throw new TypeError('argument must be a string');\n if (typeof tag !== 'number') tag = ASN1.OID;\n if (!/^([0-9]+\\.){3,}[0-9]+$/.test(s)) throw new Error('argument is not a valid OID string');\n\n function encodeOctet(bytes, octet) {\n if (octet < 128) {\n bytes.push(octet);\n } else if (octet < 16384) {\n bytes.push(octet >>> 7 | 0x80);\n bytes.push(octet & 0x7F);\n } else if (octet < 2097152) {\n bytes.push(octet >>> 14 | 0x80);\n bytes.push((octet >>> 7 | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else if (octet < 268435456) {\n bytes.push(octet >>> 21 | 0x80);\n bytes.push((octet >>> 14 | 0x80) & 0xFF);\n bytes.push((octet >>> 7 | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else {\n bytes.push((octet >>> 28 | 0x80) & 0xFF);\n bytes.push((octet >>> 21 | 0x80) & 0xFF);\n bytes.push((octet >>> 14 | 0x80) & 0xFF);\n bytes.push((octet >>> 7 | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n }\n }\n\n var tmp = s.split('.');\n var bytes = [];\n bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));\n tmp.slice(2).forEach(function (b) {\n encodeOctet(bytes, parseInt(b, 10));\n });\n var self = this;\n\n this._ensure(2 + bytes.length);\n\n this.writeByte(tag);\n this.writeLength(bytes.length);\n bytes.forEach(function (b) {\n self.writeByte(b);\n });\n};\n\nWriter.prototype.writeLength = function (len) {\n if (typeof len !== 'number') throw new TypeError('argument must be a Number');\n\n this._ensure(4);\n\n if (len <= 0x7f) {\n this._buf[this._offset++] = len;\n } else if (len <= 0xff) {\n this._buf[this._offset++] = 0x81;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffff) {\n this._buf[this._offset++] = 0x82;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffffff) {\n this._buf[this._offset++] = 0x83;\n this._buf[this._offset++] = len >> 16;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else {\n throw newInvalidAsn1Error('Length too long (> 4 bytes)');\n }\n};\n\nWriter.prototype.startSequence = function (tag) {\n if (typeof tag !== 'number') tag = ASN1.Sequence | ASN1.Constructor;\n this.writeByte(tag);\n\n this._seq.push(this._offset);\n\n this._ensure(3);\n\n this._offset += 3;\n};\n\nWriter.prototype.endSequence = function () {\n var seq = this._seq.pop();\n\n var start = seq + 3;\n var len = this._offset - start;\n\n if (len <= 0x7f) {\n this._shift(start, len, -2);\n\n this._buf[seq] = len;\n } else if (len <= 0xff) {\n this._shift(start, len, -1);\n\n this._buf[seq] = 0x81;\n this._buf[seq + 1] = len;\n } else if (len <= 0xffff) {\n this._buf[seq] = 0x82;\n this._buf[seq + 1] = len >> 8;\n this._buf[seq + 2] = len;\n } else if (len <= 0xffffff) {\n this._shift(start, len, 1);\n\n this._buf[seq] = 0x83;\n this._buf[seq + 1] = len >> 16;\n this._buf[seq + 2] = len >> 8;\n this._buf[seq + 3] = len;\n } else {\n throw newInvalidAsn1Error('Sequence too long');\n }\n};\n\nWriter.prototype._shift = function (start, len, shift) {\n assert.ok(start !== undefined);\n assert.ok(len !== undefined);\n assert.ok(shift);\n\n this._buf.copy(this._buf, start + shift, start, start + len);\n\n this._offset += shift;\n};\n\nWriter.prototype._ensure = function (len) {\n assert.ok(len);\n\n if (this._size - this._offset < len) {\n var sz = this._size * this._options.growthFactor;\n if (sz - this._offset < len) sz += len;\n var buf = Buffer.alloc(sz);\n\n this._buf.copy(buf, 0, 0, this._offset);\n\n this._buf = buf;\n this._size = sz;\n }\n}; // --- Exported API\n\n\nmodule.exports = Writer;\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/ber/writer.js?"); /***/ }), /***/ "./node_modules/asn1/lib/index.js": /*!****************************************!*\ !*** ./node_modules/asn1/lib/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// Copyright 2011 Mark Cavage All rights reserved.\n// If you have no idea what ASN.1 or BER is, see this:\n// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\nvar Ber = __webpack_require__(/*! ./ber/index */ \"./node_modules/asn1/lib/ber/index.js\"); // --- Exported API\n\n\nmodule.exports = {\n Ber: Ber,\n BerReader: Ber.Reader,\n BerWriter: Ber.Writer\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/asn1/lib/index.js?"); /***/ }), /***/ "./node_modules/assert/assert.js": /*!***************************************!*\ !*** ./node_modules/assert/assert.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(global) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar objectAssign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\"); // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}\n\nfunction isBuffer(b) {\n if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {\n return global.Buffer.isBuffer(b);\n }\n\n return !!(b != null && b._isBuffer);\n} // based on node assert, original notice:\n// NB: The URL to the CommonJS spec is kept just for tradition.\n// node-assert has evolved a lot since then, both in API and behavior.\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nvar util = __webpack_require__(/*! util/ */ \"./node_modules/util/util.js\");\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar pSlice = Array.prototype.slice;\n\nvar functionsHaveNames = function () {\n return function foo() {}.name === 'foo';\n}();\n\nfunction pToString(obj) {\n return Object.prototype.toString.call(obj);\n}\n\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n\n if (!arrbuf) {\n return false;\n }\n\n if (arrbuf instanceof DataView) {\n return true;\n }\n\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n\n return false;\n} // 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\n\nvar assert = module.exports = ok; // 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/; // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\n\nfunction getName(func) {\n if (!util.isFunction(func)) {\n return;\n }\n\n if (functionsHaveNames) {\n return func.name;\n }\n\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\n\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n\n var stackStartFunction = options.stackStartFunction || fail;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n\n if (err.stack) {\n var out = err.stack; // try to strip useless frames\n\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}; // assert.AssertionError instanceof Error\n\n\nutil.inherits(assert.AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\n\nfunction inspect(something) {\n if (functionsHaveNames || !util.isFunction(something)) {\n return util.inspect(something);\n }\n\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\n\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect(self.expected), 128);\n} // At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n} // EXTENSION! allows for well behaved errors defined elsewhere.\n\n\nassert.fail = fail; // 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\n\nassert.ok = ok; // 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n}; // 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n}; // 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);\n }\n};\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0; // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime(); // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase; // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || _typeof(actual) !== 'object') && (expected === null || _typeof(expected) !== 'object')) {\n return strict ? actual === expected : actual == expected; // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer), new Uint8Array(expected.buffer)) === 0; // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {\n actual: [],\n expected: []\n };\n var actualIndex = memos.actual.indexOf(actual);\n\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined) return false; // if one is a primitive, the other must be same\n\n if (util.isPrimitive(a) || util.isPrimitive(b)) return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs) return false;\n\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i; // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n\n if (ka.length !== kb.length) return false; //the same set of keys (although not necessarily the same order),\n\n ka.sort();\n kb.sort(); //~~~cheap key test\n\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i]) return false;\n } //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n\n\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false;\n }\n\n return true;\n} // 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\n\nfunction notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n} // 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n}; // 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {// Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n\n try {\n block();\n } catch (e) {\n error = e;\n }\n\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && util.isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) {\n throw actual;\n }\n} // 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\n\nassert[\"throws\"] = function (block,\n/*optional*/\nerror,\n/*optional*/\nmessage) {\n _throws(true, block, error, message);\n}; // EXTENSION! This is annoying to write outside this module.\n\n\nassert.doesNotThrow = function (block,\n/*optional*/\nerror,\n/*optional*/\nmessage) {\n _throws(false, block, error, message);\n};\n\nassert.ifError = function (err) {\n if (err) throw err;\n}; // Expose a strict only variant of assert\n\n\nfunction strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}\n\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n\n return keys;\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/assert/assert.js?"); /***/ }), /***/ "./node_modules/base64-js/index.js": /*!*****************************************!*\ !*** ./node_modules/base64-js/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nexports.byteLength = byteLength;\nexports.toByteArray = toByteArray;\nexports.fromByteArray = fromByteArray;\nvar lookup = [];\nvar revLookup = [];\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n} // Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\n\n\nrevLookup['-'.charCodeAt(0)] = 62;\nrevLookup['_'.charCodeAt(0)] = 63;\n\nfunction getLens(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4');\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf('=');\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n} // base64 is 4/3 + up to two characters of the original data\n\n\nfunction byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 0xFF;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n return arr;\n}\n\nfunction tripletToBase64(num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n}\n\nfunction encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join('');\n}\n\nfunction fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');\n }\n\n return parts.join('');\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/base64-js/index.js?"); /***/ }), /***/ "./node_modules/bn.js/lib/bn.js": /*!**************************************!*\ !*** ./node_modules/bn.js/lib/bn.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function (module, exports) {\n 'use strict'; // Utils\n\n function assert(val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n } // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n\n\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n\n var TempCtor = function TempCtor() {};\n\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n } // BN\n\n\n function BN(number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0; // Reduction context\n\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n\n if (_typeof(module) === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n var Buffer;\n\n try {\n Buffer = __webpack_require__(/*! buffer */ 2).Buffer;\n } catch (e) {}\n\n BN.isBN = function isBN(num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && _typeof(num) === 'object' && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max(left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min(left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init(number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (_typeof(number) === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n\n assert(base === (base | 0) && base >= 2 && base <= 36);\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber(number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [number & 0x3ffffff, number / 0x4000000 & 0x3ffffff];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n\n this.words = [number & 0x3ffffff, number / 0x4000000 & 0x3ffffff, 1];\n this.length = 3;\n }\n\n if (endian !== 'le') return; // Reverse the bytes\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray(number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;\n this.words[j] |= w << off & 0x3ffffff;\n this.words[j + 1] = w >>> 26 - off & 0x3ffffff;\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;\n this.words[j] |= w << off & 0x3ffffff;\n this.words[j + 1] = w >>> 26 - off & 0x3ffffff;\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n\n return this.strip();\n };\n\n function parseHex(str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r <<= 4; // 'a' - 'f'\n\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa; // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa; // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex(number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w; // Scan 24-bit chunks and add them to the number\n\n var off = 0;\n\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= w << off & 0x3ffffff; // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n\n this.words[j + 1] |= w >>> 26 - off & 0x3fffff;\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= w << off & 0x3ffffff;\n this.words[j + 1] |= w >>> 26 - off & 0x3fffff;\n }\n\n this.strip();\n };\n\n function parseBase(str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n r *= mul; // 'a'\n\n if (c >= 49) {\n r += c - 49 + 0xa; // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa; // '0' - '9'\n } else {\n r += c;\n }\n }\n\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase(number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1; // Find length of limb in base\n\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n\n limbLen--;\n limbPow = limbPow / base | 0;\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n var word = 0;\n\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n this.imuln(limbPow);\n\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy(dest) {\n dest.words = new Array(this.length);\n\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone() {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand(size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n\n return this;\n }; // Remove leading `0` from `this`\n\n\n BN.prototype.strip = function strip() {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign() {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n\n return this;\n };\n\n BN.prototype.inspect = function inspect() {\n return (this.red ? '';\n };\n /*\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n */\n\n\n 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'];\n 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];\n 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];\n\n BN.prototype.toString = function toString(base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n var out;\n\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = ((w << off | carry) & 0xffffff).toString(16);\n carry = w >>> 24 - off & 0xffffff;\n\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n\n off += 2;\n\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n\n if (this.negative !== 0) {\n out = '-' + out;\n }\n\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base]; // var groupBase = Math.pow(base, groupSize);\n\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n\n if (this.isZero()) {\n out = '0' + out;\n }\n\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n\n if (this.negative !== 0) {\n out = '-' + out;\n }\n\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber() {\n var ret = this.words[0];\n\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + this.words[1] * 0x4000000;\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n\n return this.negative !== 0 ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON() {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer(endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray(endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n var b, i;\n var q = this.clone();\n\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits(w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits(w) {\n var t = w;\n var r = 0;\n\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits(w) {\n // Short-cut\n if (w === 0) return 26;\n var t = w;\n var r = 0;\n\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n\n if ((t & 0x1) === 0) {\n r++;\n }\n\n return r;\n }; // Return number of used bits in a BN\n\n\n BN.prototype.bitLength = function bitLength() {\n var w = this.words[this.length - 1];\n\n var hi = this._countBits(w);\n\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray(num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = bit / 26 | 0;\n var wbit = bit % 26;\n w[bit] = (num.words[off] & 1 << wbit) >>> wbit;\n }\n\n return w;\n } // Number of trailing zero bits\n\n\n BN.prototype.zeroBits = function zeroBits() {\n if (this.isZero()) return 0;\n var r = 0;\n\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n\n r += b;\n if (b !== 26) break;\n }\n\n return r;\n };\n\n BN.prototype.byteLength = function byteLength() {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos(width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos(width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg() {\n return this.negative !== 0;\n }; // Return negative clone of `this`\n\n\n BN.prototype.neg = function neg() {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg() {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n }; // Or `num` with `this` in-place\n\n\n BN.prototype.iuor = function iuor(num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior(num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n }; // Or `num` with `this`\n\n\n BN.prototype.or = function or(num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor(num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n }; // And `num` with `this` in-place\n\n\n BN.prototype.iuand = function iuand(num) {\n // b = min-length(num, this)\n var b;\n\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n return this.strip();\n };\n\n BN.prototype.iand = function iand(num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n }; // And `num` with `this`\n\n\n BN.prototype.and = function and(num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand(num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n }; // Xor `num` with `this` in-place\n\n\n BN.prototype.iuxor = function iuxor(num) {\n // a.length > b.length\n var a;\n var b;\n\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor(num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n }; // Xor `num` with `this`\n\n\n BN.prototype.xor = function xor(num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor(num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n }; // Not ``this`` with ``width`` bitwidth\n\n\n BN.prototype.inotn = function inotn(width) {\n assert(typeof width === 'number' && width >= 0);\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26; // Extend the buffer with leading zeroes\n\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n } // Handle complete words\n\n\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n } // Handle the residue\n\n\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & 0x3ffffff >> 26 - bitsLeft;\n } // And remove leading zeroes\n\n\n return this.strip();\n };\n\n BN.prototype.notn = function notn(width) {\n return this.clone().inotn(width);\n }; // Set `bit` of `this`\n\n\n BN.prototype.setn = function setn(bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n var off = bit / 26 | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | 1 << wbit;\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n }; // Add `num` to `this` in-place\n\n\n BN.prototype.iadd = function iadd(num) {\n var r; // negative + positive\n\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign(); // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n } // a.length > b.length\n\n\n var a, b;\n\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++; // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n }; // Add `num` to `this`\n\n\n BN.prototype.add = function add(num) {\n var res;\n\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n return num.clone().iadd(this);\n }; // Subtract `num` from `this` in-place\n\n\n BN.prototype.isub = function isub(num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign(); // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n } // At this point both numbers are positive\n\n\n var cmp = this.cmp(num); // Optimization - zeroify\n\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n } // a > b\n\n\n var a, b;\n\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n } // Copy rest of the words\n\n\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n }; // Subtract `num` from `this`\n\n\n BN.prototype.sub = function sub(num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo(self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = self.length + num.length | 0;\n out.length = len;\n len = len - 1 | 0; // Peel one iteration (compiler can't do it, because of code complexity)\n\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n var lo = r & 0x3ffffff;\n var carry = r / 0x4000000 | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += r / 0x4000000 | 0;\n rword = r & 0x3ffffff;\n }\n\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n } // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n\n\n var comb10MulTo = function comb10MulTo(self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = mid + Math.imul(ah0, bl0) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = mid + Math.imul(ah1, bl0) | 0;\n hi = Math.imul(ah1, bh0);\n lo = lo + Math.imul(al0, bl1) | 0;\n mid = mid + Math.imul(al0, bh1) | 0;\n mid = mid + Math.imul(ah0, bl1) | 0;\n hi = hi + Math.imul(ah0, bh1) | 0;\n var w1 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = mid + Math.imul(ah2, bl0) | 0;\n hi = Math.imul(ah2, bh0);\n lo = lo + Math.imul(al1, bl1) | 0;\n mid = mid + Math.imul(al1, bh1) | 0;\n mid = mid + Math.imul(ah1, bl1) | 0;\n hi = hi + Math.imul(ah1, bh1) | 0;\n lo = lo + Math.imul(al0, bl2) | 0;\n mid = mid + Math.imul(al0, bh2) | 0;\n mid = mid + Math.imul(ah0, bl2) | 0;\n hi = hi + Math.imul(ah0, bh2) | 0;\n var w2 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = mid + Math.imul(ah3, bl0) | 0;\n hi = Math.imul(ah3, bh0);\n lo = lo + Math.imul(al2, bl1) | 0;\n mid = mid + Math.imul(al2, bh1) | 0;\n mid = mid + Math.imul(ah2, bl1) | 0;\n hi = hi + Math.imul(ah2, bh1) | 0;\n lo = lo + Math.imul(al1, bl2) | 0;\n mid = mid + Math.imul(al1, bh2) | 0;\n mid = mid + Math.imul(ah1, bl2) | 0;\n hi = hi + Math.imul(ah1, bh2) | 0;\n lo = lo + Math.imul(al0, bl3) | 0;\n mid = mid + Math.imul(al0, bh3) | 0;\n mid = mid + Math.imul(ah0, bl3) | 0;\n hi = hi + Math.imul(ah0, bh3) | 0;\n var w3 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = mid + Math.imul(ah4, bl0) | 0;\n hi = Math.imul(ah4, bh0);\n lo = lo + Math.imul(al3, bl1) | 0;\n mid = mid + Math.imul(al3, bh1) | 0;\n mid = mid + Math.imul(ah3, bl1) | 0;\n hi = hi + Math.imul(ah3, bh1) | 0;\n lo = lo + Math.imul(al2, bl2) | 0;\n mid = mid + Math.imul(al2, bh2) | 0;\n mid = mid + Math.imul(ah2, bl2) | 0;\n hi = hi + Math.imul(ah2, bh2) | 0;\n lo = lo + Math.imul(al1, bl3) | 0;\n mid = mid + Math.imul(al1, bh3) | 0;\n mid = mid + Math.imul(ah1, bl3) | 0;\n hi = hi + Math.imul(ah1, bh3) | 0;\n lo = lo + Math.imul(al0, bl4) | 0;\n mid = mid + Math.imul(al0, bh4) | 0;\n mid = mid + Math.imul(ah0, bl4) | 0;\n hi = hi + Math.imul(ah0, bh4) | 0;\n var w4 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = mid + Math.imul(ah5, bl0) | 0;\n hi = Math.imul(ah5, bh0);\n lo = lo + Math.imul(al4, bl1) | 0;\n mid = mid + Math.imul(al4, bh1) | 0;\n mid = mid + Math.imul(ah4, bl1) | 0;\n hi = hi + Math.imul(ah4, bh1) | 0;\n lo = lo + Math.imul(al3, bl2) | 0;\n mid = mid + Math.imul(al3, bh2) | 0;\n mid = mid + Math.imul(ah3, bl2) | 0;\n hi = hi + Math.imul(ah3, bh2) | 0;\n lo = lo + Math.imul(al2, bl3) | 0;\n mid = mid + Math.imul(al2, bh3) | 0;\n mid = mid + Math.imul(ah2, bl3) | 0;\n hi = hi + Math.imul(ah2, bh3) | 0;\n lo = lo + Math.imul(al1, bl4) | 0;\n mid = mid + Math.imul(al1, bh4) | 0;\n mid = mid + Math.imul(ah1, bl4) | 0;\n hi = hi + Math.imul(ah1, bh4) | 0;\n lo = lo + Math.imul(al0, bl5) | 0;\n mid = mid + Math.imul(al0, bh5) | 0;\n mid = mid + Math.imul(ah0, bl5) | 0;\n hi = hi + Math.imul(ah0, bh5) | 0;\n var w5 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = mid + Math.imul(ah6, bl0) | 0;\n hi = Math.imul(ah6, bh0);\n lo = lo + Math.imul(al5, bl1) | 0;\n mid = mid + Math.imul(al5, bh1) | 0;\n mid = mid + Math.imul(ah5, bl1) | 0;\n hi = hi + Math.imul(ah5, bh1) | 0;\n lo = lo + Math.imul(al4, bl2) | 0;\n mid = mid + Math.imul(al4, bh2) | 0;\n mid = mid + Math.imul(ah4, bl2) | 0;\n hi = hi + Math.imul(ah4, bh2) | 0;\n lo = lo + Math.imul(al3, bl3) | 0;\n mid = mid + Math.imul(al3, bh3) | 0;\n mid = mid + Math.imul(ah3, bl3) | 0;\n hi = hi + Math.imul(ah3, bh3) | 0;\n lo = lo + Math.imul(al2, bl4) | 0;\n mid = mid + Math.imul(al2, bh4) | 0;\n mid = mid + Math.imul(ah2, bl4) | 0;\n hi = hi + Math.imul(ah2, bh4) | 0;\n lo = lo + Math.imul(al1, bl5) | 0;\n mid = mid + Math.imul(al1, bh5) | 0;\n mid = mid + Math.imul(ah1, bl5) | 0;\n hi = hi + Math.imul(ah1, bh5) | 0;\n lo = lo + Math.imul(al0, bl6) | 0;\n mid = mid + Math.imul(al0, bh6) | 0;\n mid = mid + Math.imul(ah0, bl6) | 0;\n hi = hi + Math.imul(ah0, bh6) | 0;\n var w6 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = mid + Math.imul(ah7, bl0) | 0;\n hi = Math.imul(ah7, bh0);\n lo = lo + Math.imul(al6, bl1) | 0;\n mid = mid + Math.imul(al6, bh1) | 0;\n mid = mid + Math.imul(ah6, bl1) | 0;\n hi = hi + Math.imul(ah6, bh1) | 0;\n lo = lo + Math.imul(al5, bl2) | 0;\n mid = mid + Math.imul(al5, bh2) | 0;\n mid = mid + Math.imul(ah5, bl2) | 0;\n hi = hi + Math.imul(ah5, bh2) | 0;\n lo = lo + Math.imul(al4, bl3) | 0;\n mid = mid + Math.imul(al4, bh3) | 0;\n mid = mid + Math.imul(ah4, bl3) | 0;\n hi = hi + Math.imul(ah4, bh3) | 0;\n lo = lo + Math.imul(al3, bl4) | 0;\n mid = mid + Math.imul(al3, bh4) | 0;\n mid = mid + Math.imul(ah3, bl4) | 0;\n hi = hi + Math.imul(ah3, bh4) | 0;\n lo = lo + Math.imul(al2, bl5) | 0;\n mid = mid + Math.imul(al2, bh5) | 0;\n mid = mid + Math.imul(ah2, bl5) | 0;\n hi = hi + Math.imul(ah2, bh5) | 0;\n lo = lo + Math.imul(al1, bl6) | 0;\n mid = mid + Math.imul(al1, bh6) | 0;\n mid = mid + Math.imul(ah1, bl6) | 0;\n hi = hi + Math.imul(ah1, bh6) | 0;\n lo = lo + Math.imul(al0, bl7) | 0;\n mid = mid + Math.imul(al0, bh7) | 0;\n mid = mid + Math.imul(ah0, bl7) | 0;\n hi = hi + Math.imul(ah0, bh7) | 0;\n var w7 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = mid + Math.imul(ah8, bl0) | 0;\n hi = Math.imul(ah8, bh0);\n lo = lo + Math.imul(al7, bl1) | 0;\n mid = mid + Math.imul(al7, bh1) | 0;\n mid = mid + Math.imul(ah7, bl1) | 0;\n hi = hi + Math.imul(ah7, bh1) | 0;\n lo = lo + Math.imul(al6, bl2) | 0;\n mid = mid + Math.imul(al6, bh2) | 0;\n mid = mid + Math.imul(ah6, bl2) | 0;\n hi = hi + Math.imul(ah6, bh2) | 0;\n lo = lo + Math.imul(al5, bl3) | 0;\n mid = mid + Math.imul(al5, bh3) | 0;\n mid = mid + Math.imul(ah5, bl3) | 0;\n hi = hi + Math.imul(ah5, bh3) | 0;\n lo = lo + Math.imul(al4, bl4) | 0;\n mid = mid + Math.imul(al4, bh4) | 0;\n mid = mid + Math.imul(ah4, bl4) | 0;\n hi = hi + Math.imul(ah4, bh4) | 0;\n lo = lo + Math.imul(al3, bl5) | 0;\n mid = mid + Math.imul(al3, bh5) | 0;\n mid = mid + Math.imul(ah3, bl5) | 0;\n hi = hi + Math.imul(ah3, bh5) | 0;\n lo = lo + Math.imul(al2, bl6) | 0;\n mid = mid + Math.imul(al2, bh6) | 0;\n mid = mid + Math.imul(ah2, bl6) | 0;\n hi = hi + Math.imul(ah2, bh6) | 0;\n lo = lo + Math.imul(al1, bl7) | 0;\n mid = mid + Math.imul(al1, bh7) | 0;\n mid = mid + Math.imul(ah1, bl7) | 0;\n hi = hi + Math.imul(ah1, bh7) | 0;\n lo = lo + Math.imul(al0, bl8) | 0;\n mid = mid + Math.imul(al0, bh8) | 0;\n mid = mid + Math.imul(ah0, bl8) | 0;\n hi = hi + Math.imul(ah0, bh8) | 0;\n var w8 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = mid + Math.imul(ah9, bl0) | 0;\n hi = Math.imul(ah9, bh0);\n lo = lo + Math.imul(al8, bl1) | 0;\n mid = mid + Math.imul(al8, bh1) | 0;\n mid = mid + Math.imul(ah8, bl1) | 0;\n hi = hi + Math.imul(ah8, bh1) | 0;\n lo = lo + Math.imul(al7, bl2) | 0;\n mid = mid + Math.imul(al7, bh2) | 0;\n mid = mid + Math.imul(ah7, bl2) | 0;\n hi = hi + Math.imul(ah7, bh2) | 0;\n lo = lo + Math.imul(al6, bl3) | 0;\n mid = mid + Math.imul(al6, bh3) | 0;\n mid = mid + Math.imul(ah6, bl3) | 0;\n hi = hi + Math.imul(ah6, bh3) | 0;\n lo = lo + Math.imul(al5, bl4) | 0;\n mid = mid + Math.imul(al5, bh4) | 0;\n mid = mid + Math.imul(ah5, bl4) | 0;\n hi = hi + Math.imul(ah5, bh4) | 0;\n lo = lo + Math.imul(al4, bl5) | 0;\n mid = mid + Math.imul(al4, bh5) | 0;\n mid = mid + Math.imul(ah4, bl5) | 0;\n hi = hi + Math.imul(ah4, bh5) | 0;\n lo = lo + Math.imul(al3, bl6) | 0;\n mid = mid + Math.imul(al3, bh6) | 0;\n mid = mid + Math.imul(ah3, bl6) | 0;\n hi = hi + Math.imul(ah3, bh6) | 0;\n lo = lo + Math.imul(al2, bl7) | 0;\n mid = mid + Math.imul(al2, bh7) | 0;\n mid = mid + Math.imul(ah2, bl7) | 0;\n hi = hi + Math.imul(ah2, bh7) | 0;\n lo = lo + Math.imul(al1, bl8) | 0;\n mid = mid + Math.imul(al1, bh8) | 0;\n mid = mid + Math.imul(ah1, bl8) | 0;\n hi = hi + Math.imul(ah1, bh8) | 0;\n lo = lo + Math.imul(al0, bl9) | 0;\n mid = mid + Math.imul(al0, bh9) | 0;\n mid = mid + Math.imul(ah0, bl9) | 0;\n hi = hi + Math.imul(ah0, bh9) | 0;\n var w9 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = mid + Math.imul(ah9, bl1) | 0;\n hi = Math.imul(ah9, bh1);\n lo = lo + Math.imul(al8, bl2) | 0;\n mid = mid + Math.imul(al8, bh2) | 0;\n mid = mid + Math.imul(ah8, bl2) | 0;\n hi = hi + Math.imul(ah8, bh2) | 0;\n lo = lo + Math.imul(al7, bl3) | 0;\n mid = mid + Math.imul(al7, bh3) | 0;\n mid = mid + Math.imul(ah7, bl3) | 0;\n hi = hi + Math.imul(ah7, bh3) | 0;\n lo = lo + Math.imul(al6, bl4) | 0;\n mid = mid + Math.imul(al6, bh4) | 0;\n mid = mid + Math.imul(ah6, bl4) | 0;\n hi = hi + Math.imul(ah6, bh4) | 0;\n lo = lo + Math.imul(al5, bl5) | 0;\n mid = mid + Math.imul(al5, bh5) | 0;\n mid = mid + Math.imul(ah5, bl5) | 0;\n hi = hi + Math.imul(ah5, bh5) | 0;\n lo = lo + Math.imul(al4, bl6) | 0;\n mid = mid + Math.imul(al4, bh6) | 0;\n mid = mid + Math.imul(ah4, bl6) | 0;\n hi = hi + Math.imul(ah4, bh6) | 0;\n lo = lo + Math.imul(al3, bl7) | 0;\n mid = mid + Math.imul(al3, bh7) | 0;\n mid = mid + Math.imul(ah3, bl7) | 0;\n hi = hi + Math.imul(ah3, bh7) | 0;\n lo = lo + Math.imul(al2, bl8) | 0;\n mid = mid + Math.imul(al2, bh8) | 0;\n mid = mid + Math.imul(ah2, bl8) | 0;\n hi = hi + Math.imul(ah2, bh8) | 0;\n lo = lo + Math.imul(al1, bl9) | 0;\n mid = mid + Math.imul(al1, bh9) | 0;\n mid = mid + Math.imul(ah1, bl9) | 0;\n hi = hi + Math.imul(ah1, bh9) | 0;\n var w10 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = mid + Math.imul(ah9, bl2) | 0;\n hi = Math.imul(ah9, bh2);\n lo = lo + Math.imul(al8, bl3) | 0;\n mid = mid + Math.imul(al8, bh3) | 0;\n mid = mid + Math.imul(ah8, bl3) | 0;\n hi = hi + Math.imul(ah8, bh3) | 0;\n lo = lo + Math.imul(al7, bl4) | 0;\n mid = mid + Math.imul(al7, bh4) | 0;\n mid = mid + Math.imul(ah7, bl4) | 0;\n hi = hi + Math.imul(ah7, bh4) | 0;\n lo = lo + Math.imul(al6, bl5) | 0;\n mid = mid + Math.imul(al6, bh5) | 0;\n mid = mid + Math.imul(ah6, bl5) | 0;\n hi = hi + Math.imul(ah6, bh5) | 0;\n lo = lo + Math.imul(al5, bl6) | 0;\n mid = mid + Math.imul(al5, bh6) | 0;\n mid = mid + Math.imul(ah5, bl6) | 0;\n hi = hi + Math.imul(ah5, bh6) | 0;\n lo = lo + Math.imul(al4, bl7) | 0;\n mid = mid + Math.imul(al4, bh7) | 0;\n mid = mid + Math.imul(ah4, bl7) | 0;\n hi = hi + Math.imul(ah4, bh7) | 0;\n lo = lo + Math.imul(al3, bl8) | 0;\n mid = mid + Math.imul(al3, bh8) | 0;\n mid = mid + Math.imul(ah3, bl8) | 0;\n hi = hi + Math.imul(ah3, bh8) | 0;\n lo = lo + Math.imul(al2, bl9) | 0;\n mid = mid + Math.imul(al2, bh9) | 0;\n mid = mid + Math.imul(ah2, bl9) | 0;\n hi = hi + Math.imul(ah2, bh9) | 0;\n var w11 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = mid + Math.imul(ah9, bl3) | 0;\n hi = Math.imul(ah9, bh3);\n lo = lo + Math.imul(al8, bl4) | 0;\n mid = mid + Math.imul(al8, bh4) | 0;\n mid = mid + Math.imul(ah8, bl4) | 0;\n hi = hi + Math.imul(ah8, bh4) | 0;\n lo = lo + Math.imul(al7, bl5) | 0;\n mid = mid + Math.imul(al7, bh5) | 0;\n mid = mid + Math.imul(ah7, bl5) | 0;\n hi = hi + Math.imul(ah7, bh5) | 0;\n lo = lo + Math.imul(al6, bl6) | 0;\n mid = mid + Math.imul(al6, bh6) | 0;\n mid = mid + Math.imul(ah6, bl6) | 0;\n hi = hi + Math.imul(ah6, bh6) | 0;\n lo = lo + Math.imul(al5, bl7) | 0;\n mid = mid + Math.imul(al5, bh7) | 0;\n mid = mid + Math.imul(ah5, bl7) | 0;\n hi = hi + Math.imul(ah5, bh7) | 0;\n lo = lo + Math.imul(al4, bl8) | 0;\n mid = mid + Math.imul(al4, bh8) | 0;\n mid = mid + Math.imul(ah4, bl8) | 0;\n hi = hi + Math.imul(ah4, bh8) | 0;\n lo = lo + Math.imul(al3, bl9) | 0;\n mid = mid + Math.imul(al3, bh9) | 0;\n mid = mid + Math.imul(ah3, bl9) | 0;\n hi = hi + Math.imul(ah3, bh9) | 0;\n var w12 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = mid + Math.imul(ah9, bl4) | 0;\n hi = Math.imul(ah9, bh4);\n lo = lo + Math.imul(al8, bl5) | 0;\n mid = mid + Math.imul(al8, bh5) | 0;\n mid = mid + Math.imul(ah8, bl5) | 0;\n hi = hi + Math.imul(ah8, bh5) | 0;\n lo = lo + Math.imul(al7, bl6) | 0;\n mid = mid + Math.imul(al7, bh6) | 0;\n mid = mid + Math.imul(ah7, bl6) | 0;\n hi = hi + Math.imul(ah7, bh6) | 0;\n lo = lo + Math.imul(al6, bl7) | 0;\n mid = mid + Math.imul(al6, bh7) | 0;\n mid = mid + Math.imul(ah6, bl7) | 0;\n hi = hi + Math.imul(ah6, bh7) | 0;\n lo = lo + Math.imul(al5, bl8) | 0;\n mid = mid + Math.imul(al5, bh8) | 0;\n mid = mid + Math.imul(ah5, bl8) | 0;\n hi = hi + Math.imul(ah5, bh8) | 0;\n lo = lo + Math.imul(al4, bl9) | 0;\n mid = mid + Math.imul(al4, bh9) | 0;\n mid = mid + Math.imul(ah4, bl9) | 0;\n hi = hi + Math.imul(ah4, bh9) | 0;\n var w13 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = mid + Math.imul(ah9, bl5) | 0;\n hi = Math.imul(ah9, bh5);\n lo = lo + Math.imul(al8, bl6) | 0;\n mid = mid + Math.imul(al8, bh6) | 0;\n mid = mid + Math.imul(ah8, bl6) | 0;\n hi = hi + Math.imul(ah8, bh6) | 0;\n lo = lo + Math.imul(al7, bl7) | 0;\n mid = mid + Math.imul(al7, bh7) | 0;\n mid = mid + Math.imul(ah7, bl7) | 0;\n hi = hi + Math.imul(ah7, bh7) | 0;\n lo = lo + Math.imul(al6, bl8) | 0;\n mid = mid + Math.imul(al6, bh8) | 0;\n mid = mid + Math.imul(ah6, bl8) | 0;\n hi = hi + Math.imul(ah6, bh8) | 0;\n lo = lo + Math.imul(al5, bl9) | 0;\n mid = mid + Math.imul(al5, bh9) | 0;\n mid = mid + Math.imul(ah5, bl9) | 0;\n hi = hi + Math.imul(ah5, bh9) | 0;\n var w14 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = mid + Math.imul(ah9, bl6) | 0;\n hi = Math.imul(ah9, bh6);\n lo = lo + Math.imul(al8, bl7) | 0;\n mid = mid + Math.imul(al8, bh7) | 0;\n mid = mid + Math.imul(ah8, bl7) | 0;\n hi = hi + Math.imul(ah8, bh7) | 0;\n lo = lo + Math.imul(al7, bl8) | 0;\n mid = mid + Math.imul(al7, bh8) | 0;\n mid = mid + Math.imul(ah7, bl8) | 0;\n hi = hi + Math.imul(ah7, bh8) | 0;\n lo = lo + Math.imul(al6, bl9) | 0;\n mid = mid + Math.imul(al6, bh9) | 0;\n mid = mid + Math.imul(ah6, bl9) | 0;\n hi = hi + Math.imul(ah6, bh9) | 0;\n var w15 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = mid + Math.imul(ah9, bl7) | 0;\n hi = Math.imul(ah9, bh7);\n lo = lo + Math.imul(al8, bl8) | 0;\n mid = mid + Math.imul(al8, bh8) | 0;\n mid = mid + Math.imul(ah8, bl8) | 0;\n hi = hi + Math.imul(ah8, bh8) | 0;\n lo = lo + Math.imul(al7, bl9) | 0;\n mid = mid + Math.imul(al7, bh9) | 0;\n mid = mid + Math.imul(ah7, bl9) | 0;\n hi = hi + Math.imul(ah7, bh9) | 0;\n var w16 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = mid + Math.imul(ah9, bl8) | 0;\n hi = Math.imul(ah9, bh8);\n lo = lo + Math.imul(al8, bl9) | 0;\n mid = mid + Math.imul(al8, bh9) | 0;\n mid = mid + Math.imul(ah8, bl9) | 0;\n hi = hi + Math.imul(ah8, bh9) | 0;\n var w17 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = mid + Math.imul(ah9, bl9) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (c + lo | 0) + ((mid & 0x1fff) << 13) | 0;\n c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n\n return out;\n }; // Polyfill comb\n\n\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo(self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n var carry = 0;\n var hncarry = 0;\n\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n var lo = r & 0x3ffffff;\n ncarry = ncarry + (r / 0x4000000 | 0) | 0;\n lo = lo + rword | 0;\n rword = lo & 0x3ffffff;\n ncarry = ncarry + (lo >>> 26) | 0;\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo(self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo(num, out) {\n var res;\n var len = this.length + num.length;\n\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n }; // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n\n function FFTM(x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT(N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n }; // Returns binary-reversed representation of `x`\n\n\n FFTM.prototype.revBin = function revBin(x, l, N) {\n if (x === 0 || x === N - 1) return x;\n var rb = 0;\n\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << l - i - 1;\n x >>= 1;\n }\n\n return rb;\n }; // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n\n\n FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n var rx = rtwdf_ * ro - itwdf_ * io;\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n /* jshint maxdepth : false */\n\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b(n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate(rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n t = iws[i];\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b(ws, N) {\n var carry = 0;\n\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + Math.round(ws[2 * i] / N) + carry;\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {\n var carry = 0;\n\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n rws[2 * i] = carry & 0x1fff;\n carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff;\n carry = carry >>> 13;\n } // Pad with zeroes\n\n\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub(N) {\n var ph = new Array(N);\n\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp(x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n var rmws = out.words;\n rmws.length = N;\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n }; // Multiply `this` by `num`\n\n\n BN.prototype.mul = function mul(num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n }; // Multiply employing FFT\n\n\n BN.prototype.mulf = function mulf(num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n }; // In-place Multiplication\n\n\n BN.prototype.imul = function imul(num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln(num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000); // Carry\n\n var carry = 0;\n\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += w / 0x4000000 | 0; // NOTE: lo is 27bit maximum\n\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln(num) {\n return this.clone().imuln(num);\n }; // `this` * `this`\n\n\n BN.prototype.sqr = function sqr() {\n return this.mul(this);\n }; // `this` * `this` in-place\n\n\n BN.prototype.isqr = function isqr() {\n return this.imul(this.clone());\n }; // Math.pow(`this`, `num`)\n\n\n BN.prototype.pow = function pow(num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1); // Skip leading zeroes\n\n var res = this;\n\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n res = res.mul(q);\n }\n }\n\n return res;\n }; // Shift-left in-place\n\n\n BN.prototype.iushln = function iushln(bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = 0x3ffffff >>> 26 - r << 26 - r;\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = (this.words[i] | 0) - newCarry << r;\n this.words[i] = c | carry;\n carry = newCarry >>> 26 - r;\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln(bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n }; // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n\n\n BN.prototype.iushrn = function iushrn(bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n\n if (hint) {\n h = (hint - hint % 26) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ 0x3ffffff >>> r << r;\n var maskedWords = extended;\n h -= s;\n h = Math.max(0, h); // Extended mode, copy masked part\n\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n\n maskedWords.length = s;\n }\n\n if (s === 0) {// No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = carry << 26 - r | word >>> r;\n carry = word & mask;\n } // Push carried bits as a mask\n\n\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn(bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n }; // Shift-left\n\n\n BN.prototype.shln = function shln(bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln(bits) {\n return this.clone().iushln(bits);\n }; // Shift-right\n\n\n BN.prototype.shrn = function shrn(bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn(bits) {\n return this.clone().iushrn(bits);\n }; // Test if n bit is set\n\n\n BN.prototype.testn = function testn(bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r; // Fast case: bit is much higher than all existing words\n\n if (this.length <= s) return false; // Check bit and return\n\n var w = this.words[s];\n return !!(w & q);\n }; // Return only lowers bits of number (in-place)\n\n\n BN.prototype.imaskn = function imaskn(bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ 0x3ffffff >>> r << r;\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n }; // Return only lowers bits of number\n\n\n BN.prototype.maskn = function maskn(bits) {\n return this.clone().imaskn(bits);\n }; // Add plain number `num` to `this`\n\n\n BN.prototype.iaddn = function iaddn(num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num); // Possible sign change\n\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n } // Add without checks\n\n\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn(num) {\n this.words[0] += num; // Carry\n\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n\n this.length = Math.max(this.length, i + 1);\n return this;\n }; // Subtract plain number `num` from `this`\n\n\n BN.prototype.isubn = function isubn(num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn(num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn(num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs() {\n this.negative = 0;\n return this;\n };\n\n BN.prototype.abs = function abs() {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - (right / 0x4000000 | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip(); // Subtraction overflow\n\n assert(carry === -1);\n carry = 0;\n\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n\n this.negative = 1;\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv(num, mode) {\n var shift = this.length - num.length;\n var a = this.clone();\n var b = num; // Normalize\n\n var bhi = b.words[b.length - 1] | 0;\n\n var bhiBits = this._countBits(bhi);\n\n shift = 26 - bhiBits;\n\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n } // Initialize quotient\n\n\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n\n if (diff.negative === 0) {\n a = diff;\n\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n 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\n // (0x7ffffff)\n\n qj = Math.min(qj / bhi | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n\n a._ishlnsubmul(b, 1, j);\n\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n\n if (q) {\n q.words[j] = qj;\n }\n }\n\n if (q) {\n q.strip();\n }\n\n a.strip(); // Denormalize\n\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n }; // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n\n\n BN.prototype.divmod = function divmod(num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n } // Both numbers are positive at this point\n // Strip both numbers to approximate shift value\n\n\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n } // Very short reduction\n\n\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n }; // Find `this` / `num`\n\n\n BN.prototype.div = function div(num) {\n return this.divmod(num, 'div', false).div;\n }; // Find `this` % `num`\n\n\n BN.prototype.mod = function mod(num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod(num) {\n return this.divmod(num, 'mod', true).mod;\n }; // Find Round(`this` / `num`)\n\n\n BN.prototype.divRound = function divRound(num) {\n var dm = this.divmod(num); // Fast case - exact division\n\n if (dm.mod.isZero()) return dm.div;\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half); // Round down\n\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; // Round up\n\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn(num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n var acc = 0;\n\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n }; // In-place division by number\n\n\n BN.prototype.idivn = function idivn(num) {\n assert(num <= 0x3ffffff);\n var carry = 0;\n\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = w / num | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn(num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd(p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n } // A * x + B * y = x\n\n\n var A = new BN(1);\n var B = new BN(0); // C * x + D * y = y\n\n var C = new BN(0);\n var D = new BN(1);\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) {\n ;\n }\n\n if (i > 0) {\n x.iushrn(i);\n\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) {\n ;\n }\n\n if (j > 0) {\n y.iushrn(j);\n\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n }; // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n\n\n BN.prototype._invmp = function _invmp(p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) {\n ;\n }\n\n if (i > 0) {\n a.iushrn(i);\n\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) {\n ;\n }\n\n if (j > 0) {\n b.iushrn(j);\n\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd(num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0; // Remove common factor of two\n\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n }; // Invert number in the field F(num)\n\n\n BN.prototype.invm = function invm(num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven() {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd() {\n return (this.words[0] & 1) === 1;\n }; // And first word and num\n\n\n BN.prototype.andln = function andln(num) {\n return this.words[0] & num;\n }; // Increment at the bit position in-line\n\n\n BN.prototype.bincn = function bincn(bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r; // Fast case: bit is much higher than all existing words\n\n if (this.length <= s) {\n this._expand(s + 1);\n\n this.words[s] |= q;\n return this;\n } // Add bit and propagate, if needed\n\n\n var carry = q;\n\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.isZero = function isZero() {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn(num) {\n var negative = num < 0;\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n this.strip();\n var res;\n\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n\n if (this.negative !== 0) return -res | 0;\n return res;\n }; // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n\n\n BN.prototype.cmp = function cmp(num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n }; // Unsigned comparison\n\n\n BN.prototype.ucmp = function ucmp(num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n var res = 0;\n\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n if (a === b) continue;\n\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n\n break;\n }\n\n return res;\n };\n\n BN.prototype.gtn = function gtn(num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt(num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten(num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte(num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn(num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt(num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten(num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte(num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn(num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq(num) {\n return this.cmp(num) === 0;\n }; //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n\n\n BN.red = function red(num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed(ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed() {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed(ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed(ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd(num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd(num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub(num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub(num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl(num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul(num) {\n assert(this.red, 'redMul works only with red numbers');\n\n this.red._verify2(this, num);\n\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul(num) {\n assert(this.red, 'redMul works only with red numbers');\n\n this.red._verify2(this, num);\n\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr() {\n assert(this.red, 'redSqr works only with red numbers');\n\n this.red._verify1(this);\n\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr() {\n assert(this.red, 'redISqr works only with red numbers');\n\n this.red._verify1(this);\n\n return this.red.isqr(this);\n }; // Square root over p\n\n\n BN.prototype.redSqrt = function redSqrt() {\n assert(this.red, 'redSqrt works only with red numbers');\n\n this.red._verify1(this);\n\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm() {\n assert(this.red, 'redInvm works only with red numbers');\n\n this.red._verify1(this);\n\n return this.red.invm(this);\n }; // Return negative clone of `this` % `red modulo`\n\n\n BN.prototype.redNeg = function redNeg() {\n assert(this.red, 'redNeg works only with red numbers');\n\n this.red._verify1(this);\n\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow(num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n\n this.red._verify1(this);\n\n return this.red.pow(this, num);\n }; // Prime numbers with efficient reduction\n\n\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n }; // Pseudo-Mersenne prime\n\n function MPrime(name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp() {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce(num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split(input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK(num) {\n return num.imul(this.k);\n };\n\n function K256() {\n MPrime.call(this, 'k256', 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n\n inherits(K256, MPrime);\n\n K256.prototype.split = function split(input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n var outLen = Math.min(input.length, 9);\n\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n } // Shift by 9 limbs\n\n\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = (next & mask) << 4 | prev >>> 22;\n prev = next;\n }\n\n prev >>>= 22;\n input.words[i - 10] = prev;\n\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK(num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2; // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n\n var lo = 0;\n\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + (lo / 0x4000000 | 0);\n } // Fast length reduction\n\n\n if (num.words[num.length - 1] === 0) {\n num.length--;\n\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n\n return num;\n };\n\n function P224() {\n MPrime.call(this, 'p224', 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n\n inherits(P224, MPrime);\n\n function P192() {\n MPrime.call(this, 'p192', 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n\n inherits(P192, MPrime);\n\n function P25519() {\n // 2 ^ 255 - 19\n MPrime.call(this, '25519', '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK(num) {\n // K = 0x13\n var carry = 0;\n\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n num.words[i] = lo;\n carry = hi;\n }\n\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n\n return num;\n }; // Exported mostly for testing purposes, use plain name instead\n\n\n BN._prime = function prime(name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n var prime;\n\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n\n primes[name] = prime;\n return prime;\n }; //\n // Base reduction engine\n //\n\n\n function Red(m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1(a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2(a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red, 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod(a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg(a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add(a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd(a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n\n return res;\n };\n\n Red.prototype.sub = function sub(a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub(a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n\n return res;\n };\n\n Red.prototype.shl = function shl(a, num) {\n this._verify1(a);\n\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul(a, b) {\n this._verify2(a, b);\n\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul(a, b) {\n this._verify2(a, b);\n\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr(a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr(a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt(a) {\n if (a.isZero()) return a.clone();\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1); // Fast case\n\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n } // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n\n\n var q = this.m.subn(1);\n var s = 0;\n\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n\n assert(!q.isZero());\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg(); // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n\n while (t.cmp(one) !== 0) {\n var tmp = t;\n\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm(a) {\n var inv = a._invmp(this.m);\n\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow(a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n\n for (var j = start - 1; j >= 0; j--) {\n var bit = word >> j & 1;\n\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo(num) {\n var r = num.umod(this.m);\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom(num) {\n var res = num.clone();\n res.red = null;\n return res;\n }; //\n // Montgomery method engine\n //\n\n\n BN.mont = function mont(num) {\n return new Mont(num);\n };\n\n function Mont(m) {\n Red.call(this, m);\n this.shift = this.m.bitLength();\n\n if (this.shift % 26 !== 0) {\n this.shift += 26 - this.shift % 26;\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo(num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom(num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul(a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul(a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm(a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})( false || module, this);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://gramjs/./node_modules/bn.js/lib/bn.js?"); /***/ }), /***/ "./node_modules/brorand/index.js": /*!***************************************!*\ !*** ./node_modules/brorand/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar r;\n\nmodule.exports = function rand(len) {\n if (!r) r = new Rand(null);\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\n\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n}; // Emulate crypto API using randy\n\n\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes) return this.rand.getBytes(n);\n var res = new Uint8Array(n);\n\n for (var i = 0; i < res.length; i++) {\n res[i] = this.rand.getByte();\n }\n\n return res;\n};\n\nif ((typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n }; // Safari's WebWorkers do not have `crypto`\n\n } else if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === 'object') {\n // Old junk\n Rand.prototype._rand = function () {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = __webpack_require__(/*! crypto */ 3);\n\n if (typeof crypto.randomBytes !== 'function') throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {}\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/brorand/index.js?"); /***/ }), /***/ "./node_modules/browserify-aes/aes.js": /*!********************************************!*\ !*** ./node_modules/browserify-aes/aes.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// based on the aes implimentation in triple sec\n// https://github.com/keybase/triplesec\n// which is in turn based on the one from crypto-js\n// https://code.google.com/p/crypto-js/\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nfunction asUInt32Array(buf) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);\n var len = buf.length / 4 | 0;\n var out = new Array(len);\n\n for (var i = 0; i < len; i++) {\n out[i] = buf.readUInt32BE(i * 4);\n }\n\n return out;\n}\n\nfunction scrubVec(v) {\n for (var i = 0; i < v.length; v++) {\n v[i] = 0;\n }\n}\n\nfunction cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {\n var SUB_MIX0 = SUB_MIX[0];\n var SUB_MIX1 = SUB_MIX[1];\n var SUB_MIX2 = SUB_MIX[2];\n var SUB_MIX3 = SUB_MIX[3];\n var s0 = M[0] ^ keySchedule[0];\n var s1 = M[1] ^ keySchedule[1];\n var s2 = M[2] ^ keySchedule[2];\n var s3 = M[3] ^ keySchedule[3];\n var t0, t1, t2, t3;\n var ksRow = 4;\n\n for (var round = 1; round < nRounds; round++) {\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 0xff] ^ SUB_MIX2[s2 >>> 8 & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++];\n t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 0xff] ^ SUB_MIX2[s3 >>> 8 & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++];\n t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 0xff] ^ SUB_MIX2[s0 >>> 8 & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++];\n t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 0xff] ^ SUB_MIX2[s1 >>> 8 & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++];\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n }\n\n t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n t0 = t0 >>> 0;\n t1 = t1 >>> 0;\n t2 = t2 >>> 0;\n t3 = t3 >>> 0;\n return [t0, t1, t2, t3];\n} // AES constants\n\n\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\nvar G = function () {\n // Compute double table\n var d = new Array(256);\n\n for (var j = 0; j < 256; j++) {\n if (j < 128) {\n d[j] = j << 1;\n } else {\n d[j] = j << 1 ^ 0x11b;\n }\n }\n\n var SBOX = [];\n var INV_SBOX = [];\n var SUB_MIX = [[], [], [], []];\n var INV_SUB_MIX = [[], [], [], []]; // Walk GF(2^8)\n\n var x = 0;\n var xi = 0;\n\n for (var i = 0; i < 256; ++i) {\n // Compute sbox\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n SBOX[x] = sx;\n INV_SBOX[sx] = x; // Compute multiplication\n\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4]; // Compute sub bytes, mix columns tables\n\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n SUB_MIX[0][x] = t << 24 | t >>> 8;\n SUB_MIX[1][x] = t << 16 | t >>> 16;\n SUB_MIX[2][x] = t << 8 | t >>> 24;\n SUB_MIX[3][x] = t; // Compute inv sub bytes, inv mix columns tables\n\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n INV_SUB_MIX[0][sx] = t << 24 | t >>> 8;\n INV_SUB_MIX[1][sx] = t << 16 | t >>> 16;\n INV_SUB_MIX[2][sx] = t << 8 | t >>> 24;\n INV_SUB_MIX[3][sx] = t;\n\n if (x === 0) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n\n return {\n SBOX: SBOX,\n INV_SBOX: INV_SBOX,\n SUB_MIX: SUB_MIX,\n INV_SUB_MIX: INV_SUB_MIX\n };\n}();\n\nfunction AES(key) {\n this._key = asUInt32Array(key);\n\n this._reset();\n}\n\nAES.blockSize = 4 * 4;\nAES.keySize = 256 / 8;\nAES.prototype.blockSize = AES.blockSize;\nAES.prototype.keySize = AES.keySize;\n\nAES.prototype._reset = function () {\n var keyWords = this._key;\n var keySize = keyWords.length;\n var nRounds = keySize + 6;\n var ksRows = (nRounds + 1) * 4;\n var keySchedule = [];\n\n for (var k = 0; k < keySize; k++) {\n keySchedule[k] = keyWords[k];\n }\n\n for (k = keySize; k < ksRows; k++) {\n var t = keySchedule[k - 1];\n\n if (k % keySize === 0) {\n t = t << 8 | t >>> 24;\n t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 0xff] << 16 | G.SBOX[t >>> 8 & 0xff] << 8 | G.SBOX[t & 0xff];\n t ^= RCON[k / keySize | 0] << 24;\n } else if (keySize > 6 && k % keySize === 4) {\n t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 0xff] << 16 | G.SBOX[t >>> 8 & 0xff] << 8 | G.SBOX[t & 0xff];\n }\n\n keySchedule[k] = keySchedule[k - keySize] ^ t;\n }\n\n var invKeySchedule = [];\n\n for (var ik = 0; ik < ksRows; ik++) {\n var ksR = ksRows - ik;\n var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)];\n\n if (ik < 4 || ksR <= 4) {\n invKeySchedule[ik] = tt;\n } else {\n 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]];\n }\n }\n\n this._nRounds = nRounds;\n this._keySchedule = keySchedule;\n this._invKeySchedule = invKeySchedule;\n};\n\nAES.prototype.encryptBlockRaw = function (M) {\n M = asUInt32Array(M);\n return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);\n};\n\nAES.prototype.encryptBlock = function (M) {\n var out = this.encryptBlockRaw(M);\n var buf = Buffer.allocUnsafe(16);\n buf.writeUInt32BE(out[0], 0);\n buf.writeUInt32BE(out[1], 4);\n buf.writeUInt32BE(out[2], 8);\n buf.writeUInt32BE(out[3], 12);\n return buf;\n};\n\nAES.prototype.decryptBlock = function (M) {\n M = asUInt32Array(M); // swap\n\n var m1 = M[1];\n M[1] = M[3];\n M[3] = m1;\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds);\n var buf = Buffer.allocUnsafe(16);\n buf.writeUInt32BE(out[0], 0);\n buf.writeUInt32BE(out[3], 4);\n buf.writeUInt32BE(out[2], 8);\n buf.writeUInt32BE(out[1], 12);\n return buf;\n};\n\nAES.prototype.scrub = function () {\n scrubVec(this._keySchedule);\n scrubVec(this._invKeySchedule);\n scrubVec(this._key);\n};\n\nmodule.exports.AES = AES;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/aes.js?"); /***/ }), /***/ "./node_modules/browserify-aes/authCipher.js": /*!***************************************************!*\ !*** ./node_modules/browserify-aes/authCipher.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar GHASH = __webpack_require__(/*! ./ghash */ \"./node_modules/browserify-aes/ghash.js\");\n\nvar xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\");\n\nvar incr32 = __webpack_require__(/*! ./incr32 */ \"./node_modules/browserify-aes/incr32.js\");\n\nfunction xorTest(a, b) {\n var out = 0;\n if (a.length !== b.length) out++;\n var len = Math.min(a.length, b.length);\n\n for (var i = 0; i < len; ++i) {\n out += a[i] ^ b[i];\n }\n\n return out;\n}\n\nfunction calcIv(self, iv, ck) {\n if (iv.length === 12) {\n self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])]);\n return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])]);\n }\n\n var ghash = new GHASH(ck);\n var len = iv.length;\n var toPad = len % 16;\n ghash.update(iv);\n\n if (toPad) {\n toPad = 16 - toPad;\n ghash.update(Buffer.alloc(toPad, 0));\n }\n\n ghash.update(Buffer.alloc(8, 0));\n var ivBits = len * 8;\n var tail = Buffer.alloc(8);\n tail.writeUIntBE(ivBits, 0, 8);\n ghash.update(tail);\n self._finID = ghash.state;\n var out = Buffer.from(self._finID);\n incr32(out);\n return out;\n}\n\nfunction StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this);\n var h = Buffer.alloc(4, 0);\n this._cipher = new aes.AES(key);\n\n var ck = this._cipher.encryptBlock(h);\n\n this._ghash = new GHASH(ck);\n iv = calcIv(this, iv, ck);\n this._prev = Buffer.from(iv);\n this._cache = Buffer.allocUnsafe(0);\n this._secCache = Buffer.allocUnsafe(0);\n this._decrypt = decrypt;\n this._alen = 0;\n this._len = 0;\n this._mode = mode;\n this._authTag = null;\n this._called = false;\n}\n\ninherits(StreamCipher, Transform);\n\nStreamCipher.prototype._update = function (chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - this._alen % 16;\n\n if (rump < 16) {\n rump = Buffer.alloc(rump, 0);\n\n this._ghash.update(rump);\n }\n }\n\n this._called = true;\n\n var out = this._mode.encrypt(this, chunk);\n\n if (this._decrypt) {\n this._ghash.update(chunk);\n } else {\n this._ghash.update(out);\n }\n\n this._len += chunk.length;\n return out;\n};\n\nStreamCipher.prototype._final = function () {\n if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data');\n var tag = xor(this._ghash[\"final\"](this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));\n if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data');\n this._authTag = tag;\n\n this._cipher.scrub();\n};\n\nStreamCipher.prototype.getAuthTag = function getAuthTag() {\n if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state');\n return this._authTag;\n};\n\nStreamCipher.prototype.setAuthTag = function setAuthTag(tag) {\n if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state');\n this._authTag = tag;\n};\n\nStreamCipher.prototype.setAAD = function setAAD(buf) {\n if (this._called) throw new Error('Attempting to set AAD in unsupported state');\n\n this._ghash.update(buf);\n\n this._alen += buf.length;\n};\n\nmodule.exports = StreamCipher;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/authCipher.js?"); /***/ }), /***/ "./node_modules/browserify-aes/browser.js": /*!************************************************!*\ !*** ./node_modules/browserify-aes/browser.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var ciphers = __webpack_require__(/*! ./encrypter */ \"./node_modules/browserify-aes/encrypter.js\");\n\nvar deciphers = __webpack_require__(/*! ./decrypter */ \"./node_modules/browserify-aes/decrypter.js\");\n\nvar modes = __webpack_require__(/*! ./modes/list.json */ \"./node_modules/browserify-aes/modes/list.json\");\n\nfunction getCiphers() {\n return Object.keys(modes);\n}\n\nexports.createCipher = exports.Cipher = ciphers.createCipher;\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv;\nexports.createDecipher = exports.Decipher = deciphers.createDecipher;\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv;\nexports.listCiphers = exports.getCiphers = getCiphers;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/browser.js?"); /***/ }), /***/ "./node_modules/browserify-aes/decrypter.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/decrypter.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var AuthCipher = __webpack_require__(/*! ./authCipher */ \"./node_modules/browserify-aes/authCipher.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar MODES = __webpack_require__(/*! ./modes */ \"./node_modules/browserify-aes/modes/index.js\");\n\nvar StreamCipher = __webpack_require__(/*! ./streamCipher */ \"./node_modules/browserify-aes/streamCipher.js\");\n\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\");\n\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction Decipher(mode, key, iv) {\n Transform.call(this);\n this._cache = new Splitter();\n this._last = void 0;\n this._cipher = new aes.AES(key);\n this._prev = Buffer.from(iv);\n this._mode = mode;\n this._autopadding = true;\n}\n\ninherits(Decipher, Transform);\n\nDecipher.prototype._update = function (data) {\n this._cache.add(data);\n\n var chunk;\n var thing;\n var out = [];\n\n while (chunk = this._cache.get(this._autopadding)) {\n thing = this._mode.decrypt(this, chunk);\n out.push(thing);\n }\n\n return Buffer.concat(out);\n};\n\nDecipher.prototype._final = function () {\n var chunk = this._cache.flush();\n\n if (this._autopadding) {\n return unpad(this._mode.decrypt(this, chunk));\n } else if (chunk) {\n throw new Error('data not multiple of block length');\n }\n};\n\nDecipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo;\n return this;\n};\n\nfunction Splitter() {\n this.cache = Buffer.allocUnsafe(0);\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data]);\n};\n\nSplitter.prototype.get = function (autoPadding) {\n var out;\n\n if (autoPadding) {\n if (this.cache.length > 16) {\n out = this.cache.slice(0, 16);\n this.cache = this.cache.slice(16);\n return out;\n }\n } else {\n if (this.cache.length >= 16) {\n out = this.cache.slice(0, 16);\n this.cache = this.cache.slice(16);\n return out;\n }\n }\n\n return null;\n};\n\nSplitter.prototype.flush = function () {\n if (this.cache.length) return this.cache;\n};\n\nfunction unpad(last) {\n var padded = last[15];\n\n if (padded < 1 || padded > 16) {\n throw new Error('unable to decrypt data');\n }\n\n var i = -1;\n\n while (++i < padded) {\n if (last[i + (16 - padded)] !== padded) {\n throw new Error('unable to decrypt data');\n }\n }\n\n if (padded === 16) return;\n return last.slice(0, 16 - padded);\n}\n\nfunction createDecipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config) throw new TypeError('invalid suite type');\n if (typeof iv === 'string') iv = Buffer.from(iv);\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length);\n if (typeof password === 'string') password = Buffer.from(password);\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length);\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv, true);\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv, true);\n }\n\n return new Decipher(config.module, password, iv);\n}\n\nfunction createDecipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config) throw new TypeError('invalid suite type');\n var keys = ebtk(password, false, config.key, config.iv);\n return createDecipheriv(suite, keys.key, keys.iv);\n}\n\nexports.createDecipher = createDecipher;\nexports.createDecipheriv = createDecipheriv;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/decrypter.js?"); /***/ }), /***/ "./node_modules/browserify-aes/encrypter.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/encrypter.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var MODES = __webpack_require__(/*! ./modes */ \"./node_modules/browserify-aes/modes/index.js\");\n\nvar AuthCipher = __webpack_require__(/*! ./authCipher */ \"./node_modules/browserify-aes/authCipher.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar StreamCipher = __webpack_require__(/*! ./streamCipher */ \"./node_modules/browserify-aes/streamCipher.js\");\n\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\");\n\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction Cipher(mode, key, iv) {\n Transform.call(this);\n this._cache = new Splitter();\n this._cipher = new aes.AES(key);\n this._prev = Buffer.from(iv);\n this._mode = mode;\n this._autopadding = true;\n}\n\ninherits(Cipher, Transform);\n\nCipher.prototype._update = function (data) {\n this._cache.add(data);\n\n var chunk;\n var thing;\n var out = [];\n\n while (chunk = this._cache.get()) {\n thing = this._mode.encrypt(this, chunk);\n out.push(thing);\n }\n\n return Buffer.concat(out);\n};\n\nvar PADDING = Buffer.alloc(16, 0x10);\n\nCipher.prototype._final = function () {\n var chunk = this._cache.flush();\n\n if (this._autopadding) {\n chunk = this._mode.encrypt(this, chunk);\n\n this._cipher.scrub();\n\n return chunk;\n }\n\n if (!chunk.equals(PADDING)) {\n this._cipher.scrub();\n\n throw new Error('data not multiple of block length');\n }\n};\n\nCipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo;\n return this;\n};\n\nfunction Splitter() {\n this.cache = Buffer.allocUnsafe(0);\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data]);\n};\n\nSplitter.prototype.get = function () {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16);\n this.cache = this.cache.slice(16);\n return out;\n }\n\n return null;\n};\n\nSplitter.prototype.flush = function () {\n var len = 16 - this.cache.length;\n var padBuff = Buffer.allocUnsafe(len);\n var i = -1;\n\n while (++i < len) {\n padBuff.writeUInt8(len, i);\n }\n\n return Buffer.concat([this.cache, padBuff]);\n};\n\nfunction createCipheriv(suite, password, iv) {\n var config = MODES[suite.toLowerCase()];\n if (!config) throw new TypeError('invalid suite type');\n if (typeof password === 'string') password = Buffer.from(password);\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length);\n if (typeof iv === 'string') iv = Buffer.from(iv);\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length);\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv);\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv);\n }\n\n return new Cipher(config.module, password, iv);\n}\n\nfunction createCipher(suite, password) {\n var config = MODES[suite.toLowerCase()];\n if (!config) throw new TypeError('invalid suite type');\n var keys = ebtk(password, false, config.key, config.iv);\n return createCipheriv(suite, keys.key, keys.iv);\n}\n\nexports.createCipheriv = createCipheriv;\nexports.createCipher = createCipher;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/encrypter.js?"); /***/ }), /***/ "./node_modules/browserify-aes/ghash.js": /*!**********************************************!*\ !*** ./node_modules/browserify-aes/ghash.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar ZEROES = Buffer.alloc(16, 0);\n\nfunction toArray(buf) {\n return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];\n}\n\nfunction fromArray(out) {\n var buf = Buffer.allocUnsafe(16);\n buf.writeUInt32BE(out[0] >>> 0, 0);\n buf.writeUInt32BE(out[1] >>> 0, 4);\n buf.writeUInt32BE(out[2] >>> 0, 8);\n buf.writeUInt32BE(out[3] >>> 0, 12);\n return buf;\n}\n\nfunction GHASH(key) {\n this.h = key;\n this.state = Buffer.alloc(16, 0);\n this.cache = Buffer.allocUnsafe(0);\n} // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\n// by Juho VƤhƤ-Herttua\n\n\nGHASH.prototype.ghash = function (block) {\n var i = -1;\n\n while (++i < block.length) {\n this.state[i] ^= block[i];\n }\n\n this._multiply();\n};\n\nGHASH.prototype._multiply = function () {\n var Vi = toArray(this.h);\n var Zi = [0, 0, 0, 0];\n var j, xi, lsbVi;\n var i = -1;\n\n while (++i < 128) {\n xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0;\n\n if (xi) {\n // Z_i+1 = Z_i ^ V_i\n Zi[0] ^= Vi[0];\n Zi[1] ^= Vi[1];\n Zi[2] ^= Vi[2];\n Zi[3] ^= Vi[3];\n } // Store the value of LSB(V_i)\n\n\n lsbVi = (Vi[3] & 1) !== 0; // V_i+1 = V_i >> 1\n\n for (j = 3; j > 0; j--) {\n Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;\n }\n\n Vi[0] = Vi[0] >>> 1; // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\n\n if (lsbVi) {\n Vi[0] = Vi[0] ^ 0xe1 << 24;\n }\n }\n\n this.state = fromArray(Zi);\n};\n\nGHASH.prototype.update = function (buf) {\n this.cache = Buffer.concat([this.cache, buf]);\n var chunk;\n\n while (this.cache.length >= 16) {\n chunk = this.cache.slice(0, 16);\n this.cache = this.cache.slice(16);\n this.ghash(chunk);\n }\n};\n\nGHASH.prototype[\"final\"] = function (abl, bl) {\n if (this.cache.length) {\n this.ghash(Buffer.concat([this.cache, ZEROES], 16));\n }\n\n this.ghash(fromArray([0, abl, 0, bl]));\n return this.state;\n};\n\nmodule.exports = GHASH;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/ghash.js?"); /***/ }), /***/ "./node_modules/browserify-aes/incr32.js": /*!***********************************************!*\ !*** ./node_modules/browserify-aes/incr32.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function incr32(iv) {\n var len = iv.length;\n var item;\n\n while (len--) {\n item = iv.readUInt8(len);\n\n if (item === 255) {\n iv.writeUInt8(0, len);\n } else {\n item++;\n iv.writeUInt8(item, len);\n break;\n }\n }\n}\n\nmodule.exports = incr32;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/incr32.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/cbc.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/modes/cbc.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\");\n\nexports.encrypt = function (self, block) {\n var data = xor(block, self._prev);\n self._prev = self._cipher.encryptBlock(data);\n return self._prev;\n};\n\nexports.decrypt = function (self, block) {\n var pad = self._prev;\n self._prev = block;\n\n var out = self._cipher.decryptBlock(block);\n\n return xor(out, pad);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/cbc.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/cfb.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/modes/cfb.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\");\n\nfunction encryptStart(self, data, decrypt) {\n var len = data.length;\n var out = xor(data, self._cache);\n self._cache = self._cache.slice(len);\n self._prev = Buffer.concat([self._prev, decrypt ? data : out]);\n return out;\n}\n\nexports.encrypt = function (self, data, decrypt) {\n var out = Buffer.allocUnsafe(0);\n var len;\n\n while (data.length) {\n if (self._cache.length === 0) {\n self._cache = self._cipher.encryptBlock(self._prev);\n self._prev = Buffer.allocUnsafe(0);\n }\n\n if (self._cache.length <= data.length) {\n len = self._cache.length;\n out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]);\n data = data.slice(len);\n } else {\n out = Buffer.concat([out, encryptStart(self, data, decrypt)]);\n break;\n }\n }\n\n return out;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/cfb.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/cfb1.js": /*!***************************************************!*\ !*** ./node_modules/browserify-aes/modes/cfb1.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nfunction encryptByte(self, byteParam, decrypt) {\n var pad;\n var i = -1;\n var len = 8;\n var out = 0;\n var bit, value;\n\n while (++i < len) {\n pad = self._cipher.encryptBlock(self._prev);\n bit = byteParam & 1 << 7 - i ? 0x80 : 0;\n value = pad[0] ^ bit;\n out += (value & 0x80) >> i % 8;\n self._prev = shiftIn(self._prev, decrypt ? bit : value);\n }\n\n return out;\n}\n\nfunction shiftIn(buffer, value) {\n var len = buffer.length;\n var i = -1;\n var out = Buffer.allocUnsafe(buffer.length);\n buffer = Buffer.concat([buffer, Buffer.from([value])]);\n\n while (++i < len) {\n out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;\n }\n\n return out;\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length;\n var out = Buffer.allocUnsafe(len);\n var i = -1;\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt);\n }\n\n return out;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/cfb1.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/cfb8.js": /*!***************************************************!*\ !*** ./node_modules/browserify-aes/modes/cfb8.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nfunction encryptByte(self, byteParam, decrypt) {\n var pad = self._cipher.encryptBlock(self._prev);\n\n var out = pad[0] ^ byteParam;\n self._prev = Buffer.concat([self._prev.slice(1), Buffer.from([decrypt ? byteParam : out])]);\n return out;\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length;\n var out = Buffer.allocUnsafe(len);\n var i = -1;\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt);\n }\n\n return out;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/cfb8.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/ctr.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/modes/ctr.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar incr32 = __webpack_require__(/*! ../incr32 */ \"./node_modules/browserify-aes/incr32.js\");\n\nfunction getBlock(self) {\n var out = self._cipher.encryptBlockRaw(self._prev);\n\n incr32(self._prev);\n return out;\n}\n\nvar blockSize = 16;\n\nexports.encrypt = function (self, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize);\n var start = self._cache.length;\n self._cache = Buffer.concat([self._cache, Buffer.allocUnsafe(chunkNum * blockSize)]);\n\n for (var i = 0; i < chunkNum; i++) {\n var out = getBlock(self);\n var offset = start + i * blockSize;\n\n self._cache.writeUInt32BE(out[0], offset + 0);\n\n self._cache.writeUInt32BE(out[1], offset + 4);\n\n self._cache.writeUInt32BE(out[2], offset + 8);\n\n self._cache.writeUInt32BE(out[3], offset + 12);\n }\n\n var pad = self._cache.slice(0, chunk.length);\n\n self._cache = self._cache.slice(chunk.length);\n return xor(chunk, pad);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/ctr.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/ecb.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/modes/ecb.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("exports.encrypt = function (self, block) {\n return self._cipher.encryptBlock(block);\n};\n\nexports.decrypt = function (self, block) {\n return self._cipher.decryptBlock(block);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/ecb.js?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/index.js": /*!****************************************************!*\ !*** ./node_modules/browserify-aes/modes/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var modeModules = {\n ECB: __webpack_require__(/*! ./ecb */ \"./node_modules/browserify-aes/modes/ecb.js\"),\n CBC: __webpack_require__(/*! ./cbc */ \"./node_modules/browserify-aes/modes/cbc.js\"),\n CFB: __webpack_require__(/*! ./cfb */ \"./node_modules/browserify-aes/modes/cfb.js\"),\n CFB8: __webpack_require__(/*! ./cfb8 */ \"./node_modules/browserify-aes/modes/cfb8.js\"),\n CFB1: __webpack_require__(/*! ./cfb1 */ \"./node_modules/browserify-aes/modes/cfb1.js\"),\n OFB: __webpack_require__(/*! ./ofb */ \"./node_modules/browserify-aes/modes/ofb.js\"),\n CTR: __webpack_require__(/*! ./ctr */ \"./node_modules/browserify-aes/modes/ctr.js\"),\n GCM: __webpack_require__(/*! ./ctr */ \"./node_modules/browserify-aes/modes/ctr.js\")\n};\n\nvar modes = __webpack_require__(/*! ./list.json */ \"./node_modules/browserify-aes/modes/list.json\");\n\nfor (var key in modes) {\n modes[key].module = modeModules[modes[key].mode];\n}\n\nmodule.exports = modes;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/index.js?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"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\\\"}}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/list.json?"); /***/ }), /***/ "./node_modules/browserify-aes/modes/ofb.js": /*!**************************************************!*\ !*** ./node_modules/browserify-aes/modes/ofb.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\");\n\nfunction getBlock(self) {\n self._prev = self._cipher.encryptBlock(self._prev);\n return self._prev;\n}\n\nexports.encrypt = function (self, chunk) {\n while (self._cache.length < chunk.length) {\n self._cache = Buffer.concat([self._cache, getBlock(self)]);\n }\n\n var pad = self._cache.slice(0, chunk.length);\n\n self._cache = self._cache.slice(chunk.length);\n return xor(chunk, pad);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/modes/ofb.js?"); /***/ }), /***/ "./node_modules/browserify-aes/streamCipher.js": /*!*****************************************************!*\ !*** ./node_modules/browserify-aes/streamCipher.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction StreamCipher(mode, key, iv, decrypt) {\n Transform.call(this);\n this._cipher = new aes.AES(key);\n this._prev = Buffer.from(iv);\n this._cache = Buffer.allocUnsafe(0);\n this._secCache = Buffer.allocUnsafe(0);\n this._decrypt = decrypt;\n this._mode = mode;\n}\n\ninherits(StreamCipher, Transform);\n\nStreamCipher.prototype._update = function (chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt);\n};\n\nStreamCipher.prototype._final = function () {\n this._cipher.scrub();\n};\n\nmodule.exports = StreamCipher;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-aes/streamCipher.js?"); /***/ }), /***/ "./node_modules/browserify-cipher/browser.js": /*!***************************************************!*\ !*** ./node_modules/browserify-cipher/browser.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var DES = __webpack_require__(/*! browserify-des */ \"./node_modules/browserify-des/index.js\");\n\nvar aes = __webpack_require__(/*! browserify-aes/browser */ \"./node_modules/browserify-aes/browser.js\");\n\nvar aesModes = __webpack_require__(/*! browserify-aes/modes */ \"./node_modules/browserify-aes/modes/index.js\");\n\nvar desModes = __webpack_require__(/*! browserify-des/modes */ \"./node_modules/browserify-des/modes.js\");\n\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\");\n\nfunction createCipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key;\n ivLen = aesModes[suite].iv;\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8;\n ivLen = desModes[suite].iv;\n } else {\n throw new TypeError('invalid suite type');\n }\n\n var keys = ebtk(password, false, keyLen, ivLen);\n return createCipheriv(suite, keys.key, keys.iv);\n}\n\nfunction createDecipher(suite, password) {\n suite = suite.toLowerCase();\n var keyLen, ivLen;\n\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key;\n ivLen = aesModes[suite].iv;\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8;\n ivLen = desModes[suite].iv;\n } else {\n throw new TypeError('invalid suite type');\n }\n\n var keys = ebtk(password, false, keyLen, ivLen);\n return createDecipheriv(suite, keys.key, keys.iv);\n}\n\nfunction createCipheriv(suite, key, iv) {\n suite = suite.toLowerCase();\n if (aesModes[suite]) return aes.createCipheriv(suite, key, iv);\n if (desModes[suite]) return new DES({\n key: key,\n iv: iv,\n mode: suite\n });\n throw new TypeError('invalid suite type');\n}\n\nfunction createDecipheriv(suite, key, iv) {\n suite = suite.toLowerCase();\n if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv);\n if (desModes[suite]) return new DES({\n key: key,\n iv: iv,\n mode: suite,\n decrypt: true\n });\n throw new TypeError('invalid suite type');\n}\n\nfunction getCiphers() {\n return Object.keys(desModes).concat(aes.getCiphers());\n}\n\nexports.createCipher = exports.Cipher = createCipher;\nexports.createCipheriv = exports.Cipheriv = createCipheriv;\nexports.createDecipher = exports.Decipher = createDecipher;\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv;\nexports.listCiphers = exports.getCiphers = getCiphers;\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-cipher/browser.js?"); /***/ }), /***/ "./node_modules/browserify-des/index.js": /*!**********************************************!*\ !*** ./node_modules/browserify-des/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var CipherBase = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar des = __webpack_require__(/*! des.js */ \"./node_modules/des.js/lib/des.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar modes = {\n 'des-ede3-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede3': des.EDE,\n 'des-ede-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede': des.EDE,\n 'des-cbc': des.CBC.instantiate(des.DES),\n 'des-ecb': des.DES\n};\nmodes.des = modes['des-cbc'];\nmodes.des3 = modes['des-ede3-cbc'];\nmodule.exports = DES;\ninherits(DES, CipherBase);\n\nfunction DES(opts) {\n CipherBase.call(this);\n var modeName = opts.mode.toLowerCase();\n var mode = modes[modeName];\n var type;\n\n if (opts.decrypt) {\n type = 'decrypt';\n } else {\n type = 'encrypt';\n }\n\n var key = opts.key;\n\n if (!Buffer.isBuffer(key)) {\n key = Buffer.from(key);\n }\n\n if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {\n key = Buffer.concat([key, key.slice(0, 8)]);\n }\n\n var iv = opts.iv;\n\n if (!Buffer.isBuffer(iv)) {\n iv = Buffer.from(iv);\n }\n\n this._des = mode.create({\n key: key,\n iv: iv,\n type: type\n });\n}\n\nDES.prototype._update = function (data) {\n return Buffer.from(this._des.update(data));\n};\n\nDES.prototype._final = function () {\n return Buffer.from(this._des[\"final\"]());\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-des/index.js?"); /***/ }), /***/ "./node_modules/browserify-des/modes.js": /*!**********************************************!*\ !*** ./node_modules/browserify-des/modes.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("exports['des-ecb'] = {\n key: 8,\n iv: 0\n};\nexports['des-cbc'] = exports.des = {\n key: 8,\n iv: 8\n};\nexports['des-ede3-cbc'] = exports.des3 = {\n key: 24,\n iv: 8\n};\nexports['des-ede3'] = {\n key: 24,\n iv: 0\n};\nexports['des-ede-cbc'] = {\n key: 16,\n iv: 8\n};\nexports['des-ede'] = {\n key: 16,\n iv: 0\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-des/modes.js?"); /***/ }), /***/ "./node_modules/browserify-rsa/index.js": /*!**********************************************!*\ !*** ./node_modules/browserify-rsa/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\n\nmodule.exports = crt;\n\nfunction blind(priv) {\n var r = getr(priv);\n var blinder = r.toRed(bn.mont(priv.modulus)).redPow(new bn(priv.publicExponent)).fromRed();\n return {\n blinder: blinder,\n unblinder: r.invm(priv.modulus)\n };\n}\n\nfunction crt(msg, priv) {\n var blinds = blind(priv);\n var len = priv.modulus.byteLength();\n var mod = bn.mont(priv.modulus);\n var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);\n var c1 = blinded.toRed(bn.mont(priv.prime1));\n var c2 = blinded.toRed(bn.mont(priv.prime2));\n var qinv = priv.coefficient;\n var p = priv.prime1;\n var q = priv.prime2;\n var m1 = c1.redPow(priv.exponent1);\n var m2 = c2.redPow(priv.exponent2);\n m1 = m1.fromRed();\n m2 = m2.fromRed();\n var h = m1.isub(m2).imul(qinv).umod(p);\n h.imul(q);\n m2.iadd(h);\n return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));\n}\n\ncrt.getr = getr;\n\nfunction getr(priv) {\n var len = priv.modulus.byteLength();\n var r = new bn(randomBytes(len));\n\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {\n r = new bn(randomBytes(len));\n }\n\n return r;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-rsa/index.js?"); /***/ }), /***/ "./node_modules/browserify-sign/algos.js": /*!***********************************************!*\ !*** ./node_modules/browserify-sign/algos.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./browser/algorithms.json */ \"./node_modules/browserify-sign/browser/algorithms.json\");\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/algos.js?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"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\\\"}}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/browser/algorithms.json?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"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\\\"}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/browser/curves.json?"); /***/ }), /***/ "./node_modules/browserify-sign/browser/index.js": /*!*******************************************************!*\ !*** ./node_modules/browserify-sign/browser/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\n\nvar stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar sign = __webpack_require__(/*! ./sign */ \"./node_modules/browserify-sign/browser/sign.js\");\n\nvar verify = __webpack_require__(/*! ./verify */ \"./node_modules/browserify-sign/browser/verify.js\");\n\nvar algorithms = __webpack_require__(/*! ./algorithms.json */ \"./node_modules/browserify-sign/browser/algorithms.json\");\n\nObject.keys(algorithms).forEach(function (key) {\n algorithms[key].id = new Buffer(algorithms[key].id, 'hex');\n algorithms[key.toLowerCase()] = algorithms[key];\n});\n\nfunction Sign(algorithm) {\n stream.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data) throw new Error('Unknown message digest');\n this._hashType = data.hash;\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\n\ninherits(Sign, stream.Writable);\n\nSign.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n\n done();\n};\n\nSign.prototype.update = function update(data, enc) {\n if (typeof data === 'string') data = new Buffer(data, enc);\n\n this._hash.update(data);\n\n return this;\n};\n\nSign.prototype.sign = function signMethod(key, enc) {\n this.end();\n\n var hash = this._hash.digest();\n\n var sig = sign(hash, key, this._hashType, this._signType, this._tag);\n return enc ? sig.toString(enc) : sig;\n};\n\nfunction Verify(algorithm) {\n stream.Writable.call(this);\n var data = algorithms[algorithm];\n if (!data) throw new Error('Unknown message digest');\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\n\ninherits(Verify, stream.Writable);\n\nVerify.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n\n done();\n};\n\nVerify.prototype.update = function update(data, enc) {\n if (typeof data === 'string') data = new Buffer(data, enc);\n\n this._hash.update(data);\n\n return this;\n};\n\nVerify.prototype.verify = function verifyMethod(key, sig, enc) {\n if (typeof sig === 'string') sig = new Buffer(sig, enc);\n this.end();\n\n var hash = this._hash.digest();\n\n return verify(sig, hash, key, this._signType, this._tag);\n};\n\nfunction createSign(algorithm) {\n return new Sign(algorithm);\n}\n\nfunction createVerify(algorithm) {\n return new Verify(algorithm);\n}\n\nmodule.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign: createSign,\n createVerify: createVerify\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/browser/index.js?"); /***/ }), /***/ "./node_modules/browserify-sign/browser/sign.js": /*!******************************************************!*\ !*** ./node_modules/browserify-sign/browser/sign.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar createHmac = __webpack_require__(/*! create-hmac */ \"./node_modules/create-hmac/browser.js\");\n\nvar crt = __webpack_require__(/*! browserify-rsa */ \"./node_modules/browserify-rsa/index.js\");\n\nvar EC = __webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\").ec;\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\n\nvar curves = __webpack_require__(/*! ./curves.json */ \"./node_modules/browserify-sign/browser/curves.json\");\n\nfunction sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n\n if (priv.curve) {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type');\n return ecSign(hash, priv);\n } else if (priv.type === 'dsa') {\n if (signType !== 'dsa') throw new Error('wrong private key type');\n return dsaSign(hash, priv, hashType);\n } else {\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type');\n }\n\n hash = Buffer.concat([tag, hash]);\n var len = priv.modulus.byteLength();\n var pad = [0, 1];\n\n while (hash.length + pad.length + 1 < len) {\n pad.push(0xff);\n }\n\n pad.push(0x00);\n var i = -1;\n\n while (++i < hash.length) {\n pad.push(hash[i]);\n }\n\n var out = crt(pad, priv);\n return out;\n}\n\nfunction ecSign(hash, priv) {\n var curveId = curves[priv.curve.join('.')];\n if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'));\n var curve = new EC(curveId);\n var key = curve.keyFromPrivate(priv.privateKey);\n var out = key.sign(hash);\n return new Buffer(out.toDER());\n}\n\nfunction dsaSign(hash, priv, algo) {\n var x = priv.params.priv_key;\n var p = priv.params.p;\n var q = priv.params.q;\n var g = priv.params.g;\n var r = new BN(0);\n var k;\n var H = bits2int(hash, q).mod(q);\n var s = false;\n var kv = getKey(x, q, hash, algo);\n\n while (s === false) {\n k = makeKey(q, kv, algo);\n r = makeR(g, k, p, q);\n s = k.invm(q).imul(H.add(x.mul(r))).mod(q);\n\n if (s.cmpn(0) === 0) {\n s = false;\n r = new BN(0);\n }\n }\n\n return toDER(r, s);\n}\n\nfunction toDER(r, s) {\n r = r.toArray();\n s = s.toArray(); // Pad values\n\n if (r[0] & 0x80) r = [0].concat(r);\n if (s[0] & 0x80) s = [0].concat(s);\n var total = r.length + s.length + 4;\n var res = [0x30, total, 0x02, r.length];\n res = res.concat(r, [0x02, s.length], s);\n return new Buffer(res);\n}\n\nfunction getKey(x, q, hash, algo) {\n x = new Buffer(x.toArray());\n\n if (x.length < q.byteLength()) {\n var zeros = new Buffer(q.byteLength() - x.length);\n zeros.fill(0);\n x = Buffer.concat([zeros, x]);\n }\n\n var hlen = hash.length;\n var hbits = bits2octets(hash, q);\n var v = new Buffer(hlen);\n v.fill(1);\n var k = new Buffer(hlen);\n k.fill(0);\n k = createHmac(algo, k).update(v).update(new Buffer([0])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n k = createHmac(algo, k).update(v).update(new Buffer([1])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n return {\n k: k,\n v: v\n };\n}\n\nfunction bits2int(obits, q) {\n var bits = new BN(obits);\n var shift = (obits.length << 3) - q.bitLength();\n if (shift > 0) bits.ishrn(shift);\n return bits;\n}\n\nfunction bits2octets(bits, q) {\n bits = bits2int(bits, q);\n bits = bits.mod(q);\n var out = new Buffer(bits.toArray());\n\n if (out.length < q.byteLength()) {\n var zeros = new Buffer(q.byteLength() - out.length);\n zeros.fill(0);\n out = Buffer.concat([zeros, out]);\n }\n\n return out;\n}\n\nfunction makeKey(q, kv, algo) {\n var t;\n var k;\n\n do {\n t = new Buffer(0);\n\n while (t.length * 8 < q.bitLength()) {\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n t = Buffer.concat([t, kv.v]);\n }\n\n k = bits2int(t, q);\n kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([0])).digest();\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n\n return k;\n}\n\nfunction makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n}\n\nmodule.exports = sign;\nmodule.exports.getKey = getKey;\nmodule.exports.makeKey = makeKey;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/browser/sign.js?"); /***/ }), /***/ "./node_modules/browserify-sign/browser/verify.js": /*!********************************************************!*\ !*** ./node_modules/browserify-sign/browser/verify.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar EC = __webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\").ec;\n\nvar parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\n\nvar curves = __webpack_require__(/*! ./curves.json */ \"./node_modules/browserify-sign/browser/curves.json\");\n\nfunction verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n\n if (pub.type === 'ec') {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type');\n return ecVerify(sig, hash, pub);\n } else if (pub.type === 'dsa') {\n if (signType !== 'dsa') throw new Error('wrong public key type');\n return dsaVerify(sig, hash, pub);\n } else {\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type');\n }\n\n hash = Buffer.concat([tag, hash]);\n var len = pub.modulus.byteLength();\n var pad = [1];\n var padNum = 0;\n\n while (hash.length + pad.length + 2 < len) {\n pad.push(0xff);\n padNum++;\n }\n\n pad.push(0x00);\n var i = -1;\n\n while (++i < hash.length) {\n pad.push(hash[i]);\n }\n\n pad = new Buffer(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red);\n sig = sig.redPow(new BN(pub.publicExponent));\n sig = new Buffer(sig.fromRed().toArray());\n var out = padNum < 8 ? 1 : 0;\n len = Math.min(sig.length, pad.length);\n if (sig.length !== pad.length) out = 1;\n i = -1;\n\n while (++i < len) {\n out |= sig[i] ^ pad[i];\n }\n\n return out === 0;\n}\n\nfunction ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join('.')];\n if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'));\n var curve = new EC(curveId);\n var pubkey = pub.data.subjectPrivateKey.data;\n return curve.verify(hash, sig, pubkey);\n}\n\nfunction dsaVerify(sig, hash, pub) {\n var p = pub.data.p;\n var q = pub.data.q;\n var g = pub.data.g;\n var y = pub.data.pub_key;\n var unpacked = parseKeys.signature.decode(sig, 'der');\n var s = unpacked.s;\n var r = unpacked.r;\n checkValue(s, q);\n checkValue(r, q);\n var montp = BN.mont(p);\n var w = s.invm(q);\n 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);\n return v.cmp(r) === 0;\n}\n\nfunction checkValue(b, q) {\n if (b.cmpn(0) <= 0) throw new Error('invalid sig');\n if (b.cmp(q) >= q) throw new Error('invalid sig');\n}\n\nmodule.exports = verify;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-sign/browser/verify.js?"); /***/ }), /***/ "./node_modules/browserify-zlib/lib/binding.js": /*!*****************************************************!*\ !*** ./node_modules/browserify-zlib/lib/binding.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {\n/* eslint camelcase: \"off\" */\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\n\nvar Zstream = __webpack_require__(/*! pako/lib/zlib/zstream */ \"./node_modules/pako/lib/zlib/zstream.js\");\n\nvar zlib_deflate = __webpack_require__(/*! pako/lib/zlib/deflate.js */ \"./node_modules/pako/lib/zlib/deflate.js\");\n\nvar zlib_inflate = __webpack_require__(/*! pako/lib/zlib/inflate.js */ \"./node_modules/pako/lib/zlib/inflate.js\");\n\nvar constants = __webpack_require__(/*! pako/lib/zlib/constants */ \"./node_modules/pako/lib/zlib/constants.js\");\n\nfor (var key in constants) {\n exports[key] = constants[key];\n} // zlib modes\n\n\nexports.NONE = 0;\nexports.DEFLATE = 1;\nexports.INFLATE = 2;\nexports.GZIP = 3;\nexports.GUNZIP = 4;\nexports.DEFLATERAW = 5;\nexports.INFLATERAW = 6;\nexports.UNZIP = 7;\nvar GZIP_HEADER_ID1 = 0x1f;\nvar GZIP_HEADER_ID2 = 0x8b;\n/**\n * Emulate Node's zlib C++ layer for use by the JS layer in index.js\n */\n\nfunction Zlib(mode) {\n if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {\n throw new TypeError('Bad argument');\n }\n\n this.dictionary = null;\n this.err = 0;\n this.flush = 0;\n this.init_done = false;\n this.level = 0;\n this.memLevel = 0;\n this.mode = mode;\n this.strategy = 0;\n this.windowBits = 0;\n this.write_in_progress = false;\n this.pending_close = false;\n this.gzip_id_bytes_read = 0;\n}\n\nZlib.prototype.close = function () {\n if (this.write_in_progress) {\n this.pending_close = true;\n return;\n }\n\n this.pending_close = false;\n assert(this.init_done, 'close before init');\n assert(this.mode <= exports.UNZIP);\n\n if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {\n zlib_deflate.deflateEnd(this.strm);\n } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {\n zlib_inflate.inflateEnd(this.strm);\n }\n\n this.mode = exports.NONE;\n this.dictionary = null;\n};\n\nZlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {\n assert.equal(arguments.length, 8);\n assert(this.init_done, 'write before init');\n assert(this.mode !== exports.NONE, 'already finalized');\n assert.equal(false, this.write_in_progress, 'write already in progress');\n assert.equal(false, this.pending_close, 'close is pending');\n this.write_in_progress = true;\n assert.equal(false, flush === undefined, 'must provide flush value');\n this.write_in_progress = true;\n\n if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {\n throw new Error('Invalid flush value');\n }\n\n if (input == null) {\n input = Buffer.alloc(0);\n in_len = 0;\n in_off = 0;\n }\n\n this.strm.avail_in = in_len;\n this.strm.input = input;\n this.strm.next_in = in_off;\n this.strm.avail_out = out_len;\n this.strm.output = out;\n this.strm.next_out = out_off;\n this.flush = flush;\n\n if (!async) {\n // sync version\n this._process();\n\n if (this._checkError()) {\n return this._afterSync();\n }\n\n return;\n } // async version\n\n\n var self = this;\n process.nextTick(function () {\n self._process();\n\n self._after();\n });\n return this;\n};\n\nZlib.prototype._afterSync = function () {\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n this.write_in_progress = false;\n return [avail_in, avail_out];\n};\n\nZlib.prototype._process = function () {\n var next_expected_header_byte = null; // If the avail_out is left at 0, then it means that it ran out\n // of room. If there was avail_out left over, then it means\n // that all of the input was consumed.\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n\n case exports.UNZIP:\n if (this.strm.avail_in > 0) {\n next_expected_header_byte = this.strm.next_in;\n }\n\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n this.gzip_id_bytes_read = 1;\n next_expected_header_byte++;\n\n if (this.strm.avail_in === 1) {\n // The only available byte was already read.\n break;\n }\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n\n // fallthrough\n\n case 1:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {\n this.gzip_id_bytes_read = 2;\n this.mode = exports.GUNZIP;\n } else {\n // There is no actual difference between INFLATE and INFLATERAW\n // (after initialization).\n this.mode = exports.INFLATE;\n }\n\n break;\n\n default:\n throw new Error('invalid number of gzip magic number bytes read');\n }\n\n // fallthrough\n\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n this.err = zlib_inflate.inflate(this.strm, this.flush // If data was encoded with dictionary\n );\n\n if (this.err === exports.Z_NEED_DICT && this.dictionary) {\n // Load it\n this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);\n\n if (this.err === exports.Z_OK) {\n // And try to decode again\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n } else if (this.err === exports.Z_DATA_ERROR) {\n // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.\n // Make it possible for After() to tell a bad dictionary from bad\n // input.\n this.err = exports.Z_NEED_DICT;\n }\n }\n\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {\n // Bytes remain in input buffer. Perhaps this is another compressed\n // member in the same archive, or just trailing garbage.\n // Trailing zero bytes are okay, though, since they are frequently\n // used for padding.\n this.reset();\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n }\n\n break;\n\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n};\n\nZlib.prototype._checkError = function () {\n // Acceptable error states depend on the type of zlib stream.\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {\n this._error('unexpected end of file');\n\n return false;\n }\n\n break;\n\n case exports.Z_STREAM_END:\n // normal statuses, not fatal\n break;\n\n case exports.Z_NEED_DICT:\n if (this.dictionary == null) {\n this._error('Missing dictionary');\n } else {\n this._error('Bad dictionary');\n }\n\n return false;\n\n default:\n // something else.\n this._error('Zlib error');\n\n return false;\n }\n\n return true;\n};\n\nZlib.prototype._after = function () {\n if (!this._checkError()) {\n return;\n }\n\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n this.write_in_progress = false; // call the write() cb\n\n this.callback(avail_in, avail_out);\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype._error = function (message) {\n if (this.strm.msg) {\n message = this.strm.msg;\n }\n\n this.onerror(message, this.err // no hope of rescue.\n );\n this.write_in_progress = false;\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');\n assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');\n assert(level >= -1 && level <= 9, 'invalid compression level');\n assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');\n assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');\n\n this._init(level, windowBits, memLevel, strategy, dictionary);\n\n this._setDictionary();\n};\n\nZlib.prototype.params = function () {\n throw new Error('deflateParams Not supported');\n};\n\nZlib.prototype.reset = function () {\n this._reset();\n\n this._setDictionary();\n};\n\nZlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {\n this.level = level;\n this.windowBits = windowBits;\n this.memLevel = memLevel;\n this.strategy = strategy;\n this.flush = exports.Z_NO_FLUSH;\n this.err = exports.Z_OK;\n\n if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {\n this.windowBits += 16;\n }\n\n if (this.mode === exports.UNZIP) {\n this.windowBits += 32;\n }\n\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {\n this.windowBits = -1 * this.windowBits;\n }\n\n this.strm = new Zstream();\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Init error');\n }\n\n this.dictionary = dictionary;\n this.write_in_progress = false;\n this.init_done = true;\n};\n\nZlib.prototype._setDictionary = function () {\n if (this.dictionary == null) {\n return;\n }\n\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to set dictionary');\n }\n};\n\nZlib.prototype._reset = function () {\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to reset stream');\n }\n};\n\nexports.Zlib = Zlib;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-zlib/lib/binding.js?"); /***/ }), /***/ "./node_modules/browserify-zlib/lib/index.js": /*!***************************************************!*\ !*** ./node_modules/browserify-zlib/lib/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform;\n\nvar binding = __webpack_require__(/*! ./binding */ \"./node_modules/browserify-zlib/lib/binding.js\");\n\nvar util = __webpack_require__(/*! util */ \"./node_modules/util/util.js\");\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\").ok;\n\nvar kMaxLength = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").kMaxLength;\n\nvar kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + 'than 0x' + kMaxLength.toString(16) + ' bytes'; // zlib doesn't provide these, so kludge them in following the same\n// const naming scheme zlib uses.\n\nbinding.Z_MIN_WINDOWBITS = 8;\nbinding.Z_MAX_WINDOWBITS = 15;\nbinding.Z_DEFAULT_WINDOWBITS = 15; // fewer than 64 bytes per chunk is stupid.\n// technically it could work with as few as 8, but even 64 bytes\n// is absurdly low. Usually a MB or more is best.\n\nbinding.Z_MIN_CHUNK = 64;\nbinding.Z_MAX_CHUNK = Infinity;\nbinding.Z_DEFAULT_CHUNK = 16 * 1024;\nbinding.Z_MIN_MEMLEVEL = 1;\nbinding.Z_MAX_MEMLEVEL = 9;\nbinding.Z_DEFAULT_MEMLEVEL = 8;\nbinding.Z_MIN_LEVEL = -1;\nbinding.Z_MAX_LEVEL = 9;\nbinding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; // expose all the zlib constants\n\nvar bkeys = Object.keys(binding);\n\nfor (var bk = 0; bk < bkeys.length; bk++) {\n var bkey = bkeys[bk];\n\n if (bkey.match(/^Z/)) {\n Object.defineProperty(exports, bkey, {\n enumerable: true,\n value: binding[bkey],\n writable: false\n });\n }\n} // translation table for return codes.\n\n\nvar codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n};\nvar ckeys = Object.keys(codes);\n\nfor (var ck = 0; ck < ckeys.length; ck++) {\n var ckey = ckeys[ck];\n codes[codes[ckey]] = ckey;\n}\n\nObject.defineProperty(exports, 'codes', {\n enumerable: true,\n value: Object.freeze(codes),\n writable: false\n});\nexports.Deflate = Deflate;\nexports.Inflate = Inflate;\nexports.Gzip = Gzip;\nexports.Gunzip = Gunzip;\nexports.DeflateRaw = DeflateRaw;\nexports.InflateRaw = InflateRaw;\nexports.Unzip = Unzip;\n\nexports.createDeflate = function (o) {\n return new Deflate(o);\n};\n\nexports.createInflate = function (o) {\n return new Inflate(o);\n};\n\nexports.createDeflateRaw = function (o) {\n return new DeflateRaw(o);\n};\n\nexports.createInflateRaw = function (o) {\n return new InflateRaw(o);\n};\n\nexports.createGzip = function (o) {\n return new Gzip(o);\n};\n\nexports.createGunzip = function (o) {\n return new Gunzip(o);\n};\n\nexports.createUnzip = function (o) {\n return new Unzip(o);\n}; // Convenience methods.\n// compress/decompress a string or buffer in one step.\n\n\nexports.deflate = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new Deflate(opts), buffer, callback);\n};\n\nexports.deflateSync = function (buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n};\n\nexports.gzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new Gzip(opts), buffer, callback);\n};\n\nexports.gzipSync = function (buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n};\n\nexports.deflateRaw = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n};\n\nexports.deflateRawSync = function (buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n};\n\nexports.unzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new Unzip(opts), buffer, callback);\n};\n\nexports.unzipSync = function (buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n};\n\nexports.inflate = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new Inflate(opts), buffer, callback);\n};\n\nexports.inflateSync = function (buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n};\n\nexports.gunzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n};\n\nexports.gunzipSync = function (buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n};\n\nexports.inflateRaw = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n};\n\nexports.inflateRawSync = function (buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n};\n\nfunction zlibBuffer(engine, buffer, callback) {\n var buffers = [];\n var nread = 0;\n engine.on('error', onError);\n engine.on('end', onEnd);\n engine.end(buffer);\n flow();\n\n function flow() {\n var chunk;\n\n while (null !== (chunk = engine.read())) {\n buffers.push(chunk);\n nread += chunk.length;\n }\n\n engine.once('readable', flow);\n }\n\n function onError(err) {\n engine.removeListener('end', onEnd);\n engine.removeListener('readable', flow);\n callback(err);\n }\n\n function onEnd() {\n var buf;\n var err = null;\n\n if (nread >= kMaxLength) {\n err = new RangeError(kRangeErrorMessage);\n } else {\n buf = Buffer.concat(buffers, nread);\n }\n\n buffers = [];\n engine.close();\n callback(err, buf);\n }\n}\n\nfunction zlibBufferSync(engine, buffer) {\n if (typeof buffer === 'string') buffer = Buffer.from(buffer);\n if (!Buffer.isBuffer(buffer)) throw new TypeError('Not a string or buffer');\n var flushFlag = engine._finishFlushFlag;\n return engine._processChunk(buffer, flushFlag);\n} // generic zlib\n// minimal 2-byte header\n\n\nfunction Deflate(opts) {\n if (!(this instanceof Deflate)) return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n}\n\nfunction Inflate(opts) {\n if (!(this instanceof Inflate)) return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n} // gzip - bigger header, same deflate compression\n\n\nfunction Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}\n\nfunction Gunzip(opts) {\n if (!(this instanceof Gunzip)) return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n} // raw - no header\n\n\nfunction DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n}\n\nfunction InflateRaw(opts) {\n if (!(this instanceof InflateRaw)) return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n} // auto-detect header.\n\n\nfunction Unzip(opts) {\n if (!(this instanceof Unzip)) return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n}\n\nfunction isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n} // the Zlib class they all inherit from\n// This thing manages the queue of requests, and returns\n// true or false if there is anything in the queue when\n// you call the .write() method.\n\n\nfunction Zlib(opts, mode) {\n var _this = this;\n\n this._opts = opts = opts || {};\n this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;\n Transform.call(this, opts);\n\n if (opts.flush && !isValidFlushFlag(opts.flush)) {\n throw new Error('Invalid flush flag: ' + opts.flush);\n }\n\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) {\n throw new Error('Invalid flush flag: ' + opts.finishFlush);\n }\n\n this._flushFlag = opts.flush || binding.Z_NO_FLUSH;\n this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? opts.finishFlush : binding.Z_FINISH;\n\n if (opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) {\n throw new Error('Invalid chunk size: ' + opts.chunkSize);\n }\n }\n\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) {\n throw new Error('Invalid windowBits: ' + opts.windowBits);\n }\n }\n\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) {\n throw new Error('Invalid compression level: ' + opts.level);\n }\n }\n\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) {\n throw new Error('Invalid memLevel: ' + opts.memLevel);\n }\n }\n\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) {\n throw new Error('Invalid strategy: ' + opts.strategy);\n }\n }\n\n if (opts.dictionary) {\n if (!Buffer.isBuffer(opts.dictionary)) {\n throw new Error('Invalid dictionary: it should be a Buffer instance');\n }\n }\n\n this._handle = new binding.Zlib(mode);\n var self = this;\n this._hadError = false;\n\n this._handle.onerror = function (message, errno) {\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n _close(self);\n\n self._hadError = true;\n var error = new Error(message);\n error.errno = errno;\n error.code = exports.codes[errno];\n self.emit('error', error);\n };\n\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === 'number') level = opts.level;\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === 'number') strategy = opts.strategy;\n\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary);\n\n this._buffer = Buffer.allocUnsafe(this._chunkSize);\n this._offset = 0;\n this._level = level;\n this._strategy = strategy;\n this.once('end', this.close);\n Object.defineProperty(this, '_closed', {\n get: function get() {\n return !_this._handle;\n },\n configurable: true,\n enumerable: true\n });\n}\n\nutil.inherits(Zlib, Transform);\n\nZlib.prototype.params = function (level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) {\n throw new RangeError('Invalid compression level: ' + level);\n }\n\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) {\n throw new TypeError('Invalid strategy: ' + strategy);\n }\n\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function () {\n assert(self._handle, 'zlib binding closed');\n\n self._handle.params(level, strategy);\n\n if (!self._hadError) {\n self._level = level;\n self._strategy = strategy;\n if (callback) callback();\n }\n });\n } else {\n process.nextTick(callback);\n }\n};\n\nZlib.prototype.reset = function () {\n assert(this._handle, 'zlib binding closed');\n return this._handle.reset();\n}; // This is the _flush function called by the transform class,\n// internally, when the last chunk has been written.\n\n\nZlib.prototype._flush = function (callback) {\n this._transform(Buffer.alloc(0), '', callback);\n};\n\nZlib.prototype.flush = function (kind, callback) {\n var _this2 = this;\n\n var ws = this._writableState;\n\n if (typeof kind === 'function' || kind === undefined && !callback) {\n callback = kind;\n kind = binding.Z_FULL_FLUSH;\n }\n\n if (ws.ended) {\n if (callback) process.nextTick(callback);\n } else if (ws.ending) {\n if (callback) this.once('end', callback);\n } else if (ws.needDrain) {\n if (callback) {\n this.once('drain', function () {\n return _this2.flush(kind, callback);\n });\n }\n } else {\n this._flushFlag = kind;\n this.write(Buffer.alloc(0), '', callback);\n }\n};\n\nZlib.prototype.close = function (callback) {\n _close(this, callback);\n\n process.nextTick(emitCloseNT, this);\n};\n\nfunction _close(engine, callback) {\n if (callback) process.nextTick(callback); // Caller may invoke .close after a zlib error (which will null _handle).\n\n if (!engine._handle) return;\n\n engine._handle.close();\n\n engine._handle = null;\n}\n\nfunction emitCloseNT(self) {\n self.emit('close');\n}\n\nZlib.prototype._transform = function (chunk, encoding, cb) {\n var flushFlag;\n var ws = this._writableState;\n var ending = ws.ending || ws.ended;\n var last = ending && (!chunk || ws.length === chunk.length);\n if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(new Error('invalid input'));\n if (!this._handle) return cb(new Error('zlib binding closed')); // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag\n // (or whatever flag was provided using opts.finishFlush).\n // If it's explicitly flushing at some other time, then we use\n // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression\n // goodness.\n\n if (last) flushFlag = this._finishFlushFlag;else {\n flushFlag = this._flushFlag; // once we've flushed the last of the queue, stop flushing and\n // go back to the normal behavior.\n\n if (chunk.length >= ws.length) {\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n }\n }\n\n this._processChunk(chunk, flushFlag, cb);\n};\n\nZlib.prototype._processChunk = function (chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length;\n var availOutBefore = this._chunkSize - this._offset;\n var inOff = 0;\n var self = this;\n var async = typeof cb === 'function';\n\n if (!async) {\n var buffers = [];\n var nread = 0;\n var error;\n this.on('error', function (er) {\n error = er;\n });\n assert(this._handle, 'zlib binding closed');\n\n do {\n var res = this._handle.writeSync(flushFlag, chunk, // in\n inOff, // in_off\n availInBefore, // in_len\n this._buffer, // out\n this._offset, //out_off\n availOutBefore); // out_len\n\n } while (!this._hadError && callback(res[0], res[1]));\n\n if (this._hadError) {\n throw error;\n }\n\n if (nread >= kMaxLength) {\n _close(this);\n\n throw new RangeError(kRangeErrorMessage);\n }\n\n var buf = Buffer.concat(buffers, nread);\n\n _close(this);\n\n return buf;\n }\n\n assert(this._handle, 'zlib binding closed');\n\n var req = this._handle.write(flushFlag, chunk, // in\n inOff, // in_off\n availInBefore, // in_len\n this._buffer, // out\n this._offset, //out_off\n availOutBefore); // out_len\n\n\n req.buffer = chunk;\n req.callback = callback;\n\n function callback(availInAfter, availOutAfter) {\n // When the callback is used in an async write, the callback's\n // context is the `req` object that was created. The req object\n // is === this._handle, and that's why it's important to null\n // out the values after they are done being used. `this._handle`\n // can stay in memory longer than the callback and buffer are needed.\n if (this) {\n this.buffer = null;\n this.callback = null;\n }\n\n if (self._hadError) return;\n var have = availOutBefore - availOutAfter;\n assert(have >= 0, 'have should not go down');\n\n if (have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n\n self._offset += have; // serve some output to the consumer.\n\n if (async) {\n self.push(out);\n } else {\n buffers.push(out);\n nread += out.length;\n }\n } // exhausted the output buffer, or used all the input create a new one.\n\n\n if (availOutAfter === 0 || self._offset >= self._chunkSize) {\n availOutBefore = self._chunkSize;\n self._offset = 0;\n self._buffer = Buffer.allocUnsafe(self._chunkSize);\n }\n\n if (availOutAfter === 0) {\n // Not actually done. Need to reprocess.\n // Also, update the availInBefore to the availInAfter value,\n // so that if we have to hit it a third (fourth, etc.) time,\n // it'll have the correct byte counts.\n inOff += availInBefore - availInAfter;\n availInBefore = availInAfter;\n if (!async) return true;\n\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n\n newReq.callback = callback; // this same function\n\n newReq.buffer = chunk;\n return;\n }\n\n if (!async) return false; // finished with the chunk.\n\n cb();\n }\n};\n\nutil.inherits(Deflate, Zlib);\nutil.inherits(Inflate, Zlib);\nutil.inherits(Gzip, Zlib);\nutil.inherits(Gunzip, Zlib);\nutil.inherits(DeflateRaw, Zlib);\nutil.inherits(InflateRaw, Zlib);\nutil.inherits(Unzip, Zlib);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/browserify-zlib/lib/index.js?"); /***/ }), /***/ "./node_modules/buffer-xor/index.js": /*!******************************************!*\ !*** ./node_modules/buffer-xor/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor(a, b) {\n var length = Math.min(a.length, b.length);\n var buffer = new Buffer(length);\n\n for (var i = 0; i < length; ++i) {\n buffer[i] = a[i] ^ b[i];\n }\n\n return buffer;\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/buffer-xor/index.js?"); /***/ }), /***/ "./node_modules/cipher-base/index.js": /*!*******************************************!*\ !*** ./node_modules/cipher-base/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform;\n\nvar StringDecoder = __webpack_require__(/*! string_decoder */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction CipherBase(hashMode) {\n Transform.call(this);\n this.hashMode = typeof hashMode === 'string';\n\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest;\n } else {\n this[\"final\"] = this._finalOrDigest;\n }\n\n if (this._final) {\n this.__final = this._final;\n this._final = null;\n }\n\n this._decoder = null;\n this._encoding = null;\n}\n\ninherits(CipherBase, Transform);\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc);\n }\n\n var outData = this._update(data);\n\n if (this.hashMode) return this;\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc);\n }\n\n return outData;\n};\n\nCipherBase.prototype.setAutoPadding = function () {};\n\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state');\n};\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state');\n};\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state');\n};\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err;\n\n try {\n if (this.hashMode) {\n this._update(data);\n } else {\n this.push(this._update(data));\n }\n } catch (e) {\n err = e;\n } finally {\n next(err);\n }\n};\n\nCipherBase.prototype._flush = function (done) {\n var err;\n\n try {\n this.push(this.__final());\n } catch (e) {\n err = e;\n }\n\n done(err);\n};\n\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0);\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true);\n }\n\n return outData;\n};\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc);\n this._encoding = enc;\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings');\n\n var out = this._decoder.write(value);\n\n if (fin) {\n out += this._decoder.end();\n }\n\n return out;\n};\n\nmodule.exports = CipherBase;\n\n//# sourceURL=webpack://gramjs/./node_modules/cipher-base/index.js?"); /***/ }), /***/ "./node_modules/constants-browserify/constants.json": /*!**********************************************************!*\ !*** ./node_modules/constants-browserify/constants.json ***! \**********************************************************/ /*! exports provided: O_RDONLY, O_WRONLY, O_RDWR, S_IFMT, S_IFREG, S_IFDIR, S_IFCHR, S_IFBLK, S_IFIFO, S_IFLNK, S_IFSOCK, O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_DIRECTORY, O_NOFOLLOW, O_SYNC, O_SYMLINK, O_NONBLOCK, S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXG, S_IRGRP, S_IWGRP, S_IXGRP, S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH, E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, EAFNOSUPPORT, EAGAIN, EALREADY, EBADF, EBADMSG, EBUSY, ECANCELED, ECHILD, ECONNABORTED, ECONNREFUSED, ECONNRESET, EDEADLK, EDESTADDRREQ, EDOM, EDQUOT, EEXIST, EFAULT, EFBIG, EHOSTUNREACH, EIDRM, EILSEQ, EINPROGRESS, EINTR, EINVAL, EIO, EISCONN, EISDIR, ELOOP, EMFILE, EMLINK, EMSGSIZE, EMULTIHOP, ENAMETOOLONG, ENETDOWN, ENETRESET, ENETUNREACH, ENFILE, ENOBUFS, ENODATA, ENODEV, ENOENT, ENOEXEC, ENOLCK, ENOLINK, ENOMEM, ENOMSG, ENOPROTOOPT, ENOSPC, ENOSR, ENOSTR, ENOSYS, ENOTCONN, ENOTDIR, ENOTEMPTY, ENOTSOCK, ENOTSUP, ENOTTY, ENXIO, EOPNOTSUPP, EOVERFLOW, EPERM, EPIPE, EPROTO, EPROTONOSUPPORT, EPROTOTYPE, ERANGE, EROFS, ESPIPE, ESRCH, ESTALE, ETIME, ETIMEDOUT, ETXTBSY, EWOULDBLOCK, EXDEV, SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGIOT, SIGBUS, SIGFPE, SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGSYS, SSL_OP_ALL, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_CISCO_ANYCONNECT, SSL_OP_COOKIE_EXCHANGE, SSL_OP_CRYPTOPRO_TLSEXT_BUG, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS, SSL_OP_EPHEMERAL_RSA, SSL_OP_LEGACY_SERVER_CONNECT, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER, SSL_OP_MICROSOFT_SESS_ID_BUG, SSL_OP_MSIE_SSLV2_RSA_PADDING, SSL_OP_NETSCAPE_CA_DN_BUG, SSL_OP_NETSCAPE_CHALLENGE_BUG, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG, SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG, SSL_OP_NO_COMPRESSION, SSL_OP_NO_QUERY_MTU, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION, SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TICKET, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, SSL_OP_PKCS1_CHECK_1, SSL_OP_PKCS1_CHECK_2, SSL_OP_SINGLE_DH_USE, SSL_OP_SINGLE_ECDH_USE, SSL_OP_SSLEAY_080_CLIENT_DH_BUG, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG, SSL_OP_TLS_BLOCK_PADDING_BUG, SSL_OP_TLS_D5_BUG, SSL_OP_TLS_ROLLBACK_BUG, ENGINE_METHOD_DSA, ENGINE_METHOD_DH, ENGINE_METHOD_RAND, ENGINE_METHOD_ECDH, ENGINE_METHOD_ECDSA, ENGINE_METHOD_CIPHERS, ENGINE_METHOD_DIGESTS, ENGINE_METHOD_STORE, ENGINE_METHOD_PKEY_METHS, ENGINE_METHOD_PKEY_ASN1_METHS, ENGINE_METHOD_ALL, ENGINE_METHOD_NONE, DH_CHECK_P_NOT_SAFE_PRIME, DH_CHECK_P_NOT_PRIME, DH_UNABLE_TO_CHECK_GENERATOR, DH_NOT_SUITABLE_GENERATOR, NPN_ENABLED, RSA_PKCS1_PADDING, RSA_SSLV23_PADDING, RSA_NO_PADDING, RSA_PKCS1_OAEP_PADDING, RSA_X931_PADDING, RSA_PKCS1_PSS_PADDING, POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_UNCOMPRESSED, POINT_CONVERSION_HYBRID, F_OK, R_OK, W_OK, X_OK, UV_UDP_REUSEADDR, default */ /***/ (function(module) { eval("module.exports = JSON.parse(\"{\\\"O_RDONLY\\\":0,\\\"O_WRONLY\\\":1,\\\"O_RDWR\\\":2,\\\"S_IFMT\\\":61440,\\\"S_IFREG\\\":32768,\\\"S_IFDIR\\\":16384,\\\"S_IFCHR\\\":8192,\\\"S_IFBLK\\\":24576,\\\"S_IFIFO\\\":4096,\\\"S_IFLNK\\\":40960,\\\"S_IFSOCK\\\":49152,\\\"O_CREAT\\\":512,\\\"O_EXCL\\\":2048,\\\"O_NOCTTY\\\":131072,\\\"O_TRUNC\\\":1024,\\\"O_APPEND\\\":8,\\\"O_DIRECTORY\\\":1048576,\\\"O_NOFOLLOW\\\":256,\\\"O_SYNC\\\":128,\\\"O_SYMLINK\\\":2097152,\\\"O_NONBLOCK\\\":4,\\\"S_IRWXU\\\":448,\\\"S_IRUSR\\\":256,\\\"S_IWUSR\\\":128,\\\"S_IXUSR\\\":64,\\\"S_IRWXG\\\":56,\\\"S_IRGRP\\\":32,\\\"S_IWGRP\\\":16,\\\"S_IXGRP\\\":8,\\\"S_IRWXO\\\":7,\\\"S_IROTH\\\":4,\\\"S_IWOTH\\\":2,\\\"S_IXOTH\\\":1,\\\"E2BIG\\\":7,\\\"EACCES\\\":13,\\\"EADDRINUSE\\\":48,\\\"EADDRNOTAVAIL\\\":49,\\\"EAFNOSUPPORT\\\":47,\\\"EAGAIN\\\":35,\\\"EALREADY\\\":37,\\\"EBADF\\\":9,\\\"EBADMSG\\\":94,\\\"EBUSY\\\":16,\\\"ECANCELED\\\":89,\\\"ECHILD\\\":10,\\\"ECONNABORTED\\\":53,\\\"ECONNREFUSED\\\":61,\\\"ECONNRESET\\\":54,\\\"EDEADLK\\\":11,\\\"EDESTADDRREQ\\\":39,\\\"EDOM\\\":33,\\\"EDQUOT\\\":69,\\\"EEXIST\\\":17,\\\"EFAULT\\\":14,\\\"EFBIG\\\":27,\\\"EHOSTUNREACH\\\":65,\\\"EIDRM\\\":90,\\\"EILSEQ\\\":92,\\\"EINPROGRESS\\\":36,\\\"EINTR\\\":4,\\\"EINVAL\\\":22,\\\"EIO\\\":5,\\\"EISCONN\\\":56,\\\"EISDIR\\\":21,\\\"ELOOP\\\":62,\\\"EMFILE\\\":24,\\\"EMLINK\\\":31,\\\"EMSGSIZE\\\":40,\\\"EMULTIHOP\\\":95,\\\"ENAMETOOLONG\\\":63,\\\"ENETDOWN\\\":50,\\\"ENETRESET\\\":52,\\\"ENETUNREACH\\\":51,\\\"ENFILE\\\":23,\\\"ENOBUFS\\\":55,\\\"ENODATA\\\":96,\\\"ENODEV\\\":19,\\\"ENOENT\\\":2,\\\"ENOEXEC\\\":8,\\\"ENOLCK\\\":77,\\\"ENOLINK\\\":97,\\\"ENOMEM\\\":12,\\\"ENOMSG\\\":91,\\\"ENOPROTOOPT\\\":42,\\\"ENOSPC\\\":28,\\\"ENOSR\\\":98,\\\"ENOSTR\\\":99,\\\"ENOSYS\\\":78,\\\"ENOTCONN\\\":57,\\\"ENOTDIR\\\":20,\\\"ENOTEMPTY\\\":66,\\\"ENOTSOCK\\\":38,\\\"ENOTSUP\\\":45,\\\"ENOTTY\\\":25,\\\"ENXIO\\\":6,\\\"EOPNOTSUPP\\\":102,\\\"EOVERFLOW\\\":84,\\\"EPERM\\\":1,\\\"EPIPE\\\":32,\\\"EPROTO\\\":100,\\\"EPROTONOSUPPORT\\\":43,\\\"EPROTOTYPE\\\":41,\\\"ERANGE\\\":34,\\\"EROFS\\\":30,\\\"ESPIPE\\\":29,\\\"ESRCH\\\":3,\\\"ESTALE\\\":70,\\\"ETIME\\\":101,\\\"ETIMEDOUT\\\":60,\\\"ETXTBSY\\\":26,\\\"EWOULDBLOCK\\\":35,\\\"EXDEV\\\":18,\\\"SIGHUP\\\":1,\\\"SIGINT\\\":2,\\\"SIGQUIT\\\":3,\\\"SIGILL\\\":4,\\\"SIGTRAP\\\":5,\\\"SIGABRT\\\":6,\\\"SIGIOT\\\":6,\\\"SIGBUS\\\":10,\\\"SIGFPE\\\":8,\\\"SIGKILL\\\":9,\\\"SIGUSR1\\\":30,\\\"SIGSEGV\\\":11,\\\"SIGUSR2\\\":31,\\\"SIGPIPE\\\":13,\\\"SIGALRM\\\":14,\\\"SIGTERM\\\":15,\\\"SIGCHLD\\\":20,\\\"SIGCONT\\\":19,\\\"SIGSTOP\\\":17,\\\"SIGTSTP\\\":18,\\\"SIGTTIN\\\":21,\\\"SIGTTOU\\\":22,\\\"SIGURG\\\":16,\\\"SIGXCPU\\\":24,\\\"SIGXFSZ\\\":25,\\\"SIGVTALRM\\\":26,\\\"SIGPROF\\\":27,\\\"SIGWINCH\\\":28,\\\"SIGIO\\\":23,\\\"SIGSYS\\\":12,\\\"SSL_OP_ALL\\\":2147486719,\\\"SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION\\\":262144,\\\"SSL_OP_CIPHER_SERVER_PREFERENCE\\\":4194304,\\\"SSL_OP_CISCO_ANYCONNECT\\\":32768,\\\"SSL_OP_COOKIE_EXCHANGE\\\":8192,\\\"SSL_OP_CRYPTOPRO_TLSEXT_BUG\\\":2147483648,\\\"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS\\\":2048,\\\"SSL_OP_EPHEMERAL_RSA\\\":0,\\\"SSL_OP_LEGACY_SERVER_CONNECT\\\":4,\\\"SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER\\\":32,\\\"SSL_OP_MICROSOFT_SESS_ID_BUG\\\":1,\\\"SSL_OP_MSIE_SSLV2_RSA_PADDING\\\":0,\\\"SSL_OP_NETSCAPE_CA_DN_BUG\\\":536870912,\\\"SSL_OP_NETSCAPE_CHALLENGE_BUG\\\":2,\\\"SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG\\\":1073741824,\\\"SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG\\\":8,\\\"SSL_OP_NO_COMPRESSION\\\":131072,\\\"SSL_OP_NO_QUERY_MTU\\\":4096,\\\"SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION\\\":65536,\\\"SSL_OP_NO_SSLv2\\\":16777216,\\\"SSL_OP_NO_SSLv3\\\":33554432,\\\"SSL_OP_NO_TICKET\\\":16384,\\\"SSL_OP_NO_TLSv1\\\":67108864,\\\"SSL_OP_NO_TLSv1_1\\\":268435456,\\\"SSL_OP_NO_TLSv1_2\\\":134217728,\\\"SSL_OP_PKCS1_CHECK_1\\\":0,\\\"SSL_OP_PKCS1_CHECK_2\\\":0,\\\"SSL_OP_SINGLE_DH_USE\\\":1048576,\\\"SSL_OP_SINGLE_ECDH_USE\\\":524288,\\\"SSL_OP_SSLEAY_080_CLIENT_DH_BUG\\\":128,\\\"SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG\\\":0,\\\"SSL_OP_TLS_BLOCK_PADDING_BUG\\\":512,\\\"SSL_OP_TLS_D5_BUG\\\":256,\\\"SSL_OP_TLS_ROLLBACK_BUG\\\":8388608,\\\"ENGINE_METHOD_DSA\\\":2,\\\"ENGINE_METHOD_DH\\\":4,\\\"ENGINE_METHOD_RAND\\\":8,\\\"ENGINE_METHOD_ECDH\\\":16,\\\"ENGINE_METHOD_ECDSA\\\":32,\\\"ENGINE_METHOD_CIPHERS\\\":64,\\\"ENGINE_METHOD_DIGESTS\\\":128,\\\"ENGINE_METHOD_STORE\\\":256,\\\"ENGINE_METHOD_PKEY_METHS\\\":512,\\\"ENGINE_METHOD_PKEY_ASN1_METHS\\\":1024,\\\"ENGINE_METHOD_ALL\\\":65535,\\\"ENGINE_METHOD_NONE\\\":0,\\\"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,\\\"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,\\\"F_OK\\\":0,\\\"R_OK\\\":4,\\\"W_OK\\\":2,\\\"X_OK\\\":1,\\\"UV_UDP_REUSEADDR\\\":4}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/constants-browserify/constants.json?"); /***/ }), /***/ "./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__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n\n return objectToString(arg) === '[object Array]';\n}\n\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\n\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\n\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return _typeof(arg) === 'symbol';\n}\n\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\n\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return _typeof(arg) === 'object' && arg !== null;\n}\n\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\n\nexports.isDate = isDate;\n\nfunction isError(e) {\n return objectToString(e) === '[object Error]' || e instanceof Error;\n}\n\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || _typeof(arg) === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexports.isPrimitive = isPrimitive;\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/core-util-is/lib/util.js?"); /***/ }), /***/ "./node_modules/crc/crc1.js": /*!**********************************!*\ !*** ./node_modules/crc/crc1.js ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n\nvar crc1 = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc1', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = ~~previous;\n var accum = 0;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n accum += _byte;\n }\n\n crc += accum % 256;\n return crc % 256;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc1);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc1.js?"); /***/ }), /***/ "./node_modules/crc/crc16.js": /*!***********************************!*\ !*** ./node_modules/crc/crc16.js ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=crc-16 --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc16 = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc-16', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = ~~previous;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = (TABLE[(crc ^ _byte) & 0xff] ^ crc >> 8) & 0xffff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc16);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc16.js?"); /***/ }), /***/ "./node_modules/crc/crc16ccitt.js": /*!****************************************!*\ !*** ./node_modules/crc/crc16ccitt.js ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=ccitt --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc16ccitt = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('ccitt', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = (TABLE[(crc >> 8 ^ _byte) & 0xff] ^ crc << 8) & 0xffff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc16ccitt);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc16ccitt.js?"); /***/ }), /***/ "./node_modules/crc/crc16kermit.js": /*!*****************************************!*\ !*** ./node_modules/crc/crc16kermit.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=kermit --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc16kermit = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('kermit', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = typeof previous !== 'undefined' ? ~~previous : 0x0000;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = (TABLE[(crc ^ _byte) & 0xff] ^ crc >> 8) & 0xffff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc16kermit);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc16kermit.js?"); /***/ }), /***/ "./node_modules/crc/crc16modbus.js": /*!*****************************************!*\ !*** ./node_modules/crc/crc16modbus.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=crc-16-modbus --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc16modbus = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc-16-modbus', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = (TABLE[(crc ^ _byte) & 0xff] ^ crc >> 8) & 0xffff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc16modbus);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc16modbus.js?"); /***/ }), /***/ "./node_modules/crc/crc16xmodem.js": /*!*****************************************!*\ !*** ./node_modules/crc/crc16xmodem.js ***! \*****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n\nvar crc16xmodem = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('xmodem', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = typeof previous !== 'undefined' ? ~~previous : 0x0;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n var code = crc >>> 8 & 0xff;\n code ^= _byte & 0xff;\n code ^= code >>> 4;\n crc = crc << 8 & 0xffff;\n crc ^= code;\n code = code << 5 & 0xffff;\n crc ^= code;\n code = code << 7 & 0xffff;\n crc ^= code;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc16xmodem);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc16xmodem.js?"); /***/ }), /***/ "./node_modules/crc/crc24.js": /*!***********************************!*\ !*** ./node_modules/crc/crc24.js ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-drive --model=crc-24 --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc24 = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc-24', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = typeof previous !== 'undefined' ? ~~previous : 0xb704ce;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = (TABLE[(crc >> 16 ^ _byte) & 0xff] ^ crc << 8) & 0xffffff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc24);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc24.js?"); /***/ }), /***/ "./node_modules/crc/crc32.js": /*!***********************************!*\ !*** ./node_modules/crc/crc32.js ***! \***********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=crc-32 --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc32 = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc-32', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = previous === 0 ? 0 : ~~previous ^ -1;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = TABLE[(crc ^ _byte) & 0xff] ^ crc >>> 8;\n }\n\n return crc ^ -1;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc32);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc32.js?"); /***/ }), /***/ "./node_modules/crc/crc8.js": /*!**********************************!*\ !*** ./node_modules/crc/crc8.js ***! \**********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=crc-8 --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc8 = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('crc-8', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = ~~previous;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = TABLE[(crc ^ _byte) & 0xff] & 0xff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc8);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc8.js?"); /***/ }), /***/ "./node_modules/crc/crc81wire.js": /*!***************************************!*\ !*** ./node_modules/crc/crc81wire.js ***! \***************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=dallas-1-wire --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crc81wire = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('dallas-1-wire', function (buf, previous) {\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = ~~previous;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = TABLE[(crc ^ _byte) & 0xff] & 0xff;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crc81wire);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crc81wire.js?"); /***/ }), /***/ "./node_modules/crc/crcjam.js": /*!************************************!*\ !*** ./node_modules/crc/crcjam.js ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _create_buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_buffer */ \"./node_modules/crc/create_buffer.js\");\n/* harmony import */ var _define_crc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./define_crc */ \"./node_modules/crc/define_crc.js\");\n\n\n // Generated by `./pycrc.py --algorithm=table-driven --model=jam --generate=c`\n// prettier-ignore\n\nvar TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d];\nif (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE);\nvar crcjam = Object(_define_crc__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('jam', function (buf) {\n var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n if (!buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].isBuffer(buf)) buf = Object(_create_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(buf);\n var crc = previous === 0 ? 0 : ~~previous;\n\n for (var index = 0; index < buf.length; index++) {\n var _byte = buf[index];\n crc = TABLE[(crc ^ _byte) & 0xff] ^ crc >>> 8;\n }\n\n return crc;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (crcjam);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/crcjam.js?"); /***/ }), /***/ "./node_modules/crc/create_buffer.js": /*!*******************************************!*\ !*** ./node_modules/crc/create_buffer.js ***! \*******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);\n\nvar createBuffer = buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].from && buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].alloc && buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].allocUnsafe && buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].allocUnsafeSlow ? buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"].from : // support for Node < 5.10\nfunction (val) {\n return new buffer__WEBPACK_IMPORTED_MODULE_0__[\"Buffer\"](val);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (createBuffer);\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/create_buffer.js?"); /***/ }), /***/ "./node_modules/crc/define_crc.js": /*!****************************************!*\ !*** ./node_modules/crc/define_crc.js ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (model, calc) {\n var fn = function fn(buf, previous) {\n return calc(buf, previous) >>> 0;\n };\n\n fn.signed = calc;\n fn.unsigned = fn;\n fn.model = model;\n return fn;\n});\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/define_crc.js?"); /***/ }), /***/ "./node_modules/crc/index.js": /*!***********************************!*\ !*** ./node_modules/crc/index.js ***! \***********************************/ /*! exports provided: crc1, crc8, crc81wire, crc16, crc16ccitt, crc16modbus, crc16xmodem, crc16kermit, crc24, crc32, crcjam, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _crc1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./crc1 */ \"./node_modules/crc/crc1.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc1\", function() { return _crc1__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _crc8__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./crc8 */ \"./node_modules/crc/crc8.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc8\", function() { return _crc8__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _crc81wire__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./crc81wire */ \"./node_modules/crc/crc81wire.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc81wire\", function() { return _crc81wire__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _crc16__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./crc16 */ \"./node_modules/crc/crc16.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc16\", function() { return _crc16__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _crc16ccitt__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./crc16ccitt */ \"./node_modules/crc/crc16ccitt.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc16ccitt\", function() { return _crc16ccitt__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _crc16modbus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./crc16modbus */ \"./node_modules/crc/crc16modbus.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc16modbus\", function() { return _crc16modbus__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _crc16xmodem__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./crc16xmodem */ \"./node_modules/crc/crc16xmodem.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc16xmodem\", function() { return _crc16xmodem__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _crc16kermit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./crc16kermit */ \"./node_modules/crc/crc16kermit.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc16kermit\", function() { return _crc16kermit__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _crc24__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./crc24 */ \"./node_modules/crc/crc24.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc24\", function() { return _crc24__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _crc32__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./crc32 */ \"./node_modules/crc/crc32.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crc32\", function() { return _crc32__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _crcjam__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./crcjam */ \"./node_modules/crc/crcjam.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"crcjam\", function() { return _crcjam__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n crc1: _crc1__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n crc8: _crc8__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n crc81wire: _crc81wire__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n crc16: _crc16__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n crc16ccitt: _crc16ccitt__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n crc16modbus: _crc16modbus__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n crc16xmodem: _crc16xmodem__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n crc16kermit: _crc16kermit__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n crc24: _crc24__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n crc32: _crc32__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n crcjam: _crcjam__WEBPACK_IMPORTED_MODULE_10__[\"default\"]\n});\n\n//# sourceURL=webpack://gramjs/./node_modules/crc/index.js?"); /***/ }), /***/ "./node_modules/create-ecdh/browser.js": /*!*********************************************!*\ !*** ./node_modules/create-ecdh/browser.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\");\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nmodule.exports = function createECDH(curve) {\n return new ECDH(curve);\n};\n\nvar aliases = {\n secp256k1: {\n name: 'secp256k1',\n byteLength: 32\n },\n secp224r1: {\n name: 'p224',\n byteLength: 28\n },\n prime256v1: {\n name: 'p256',\n byteLength: 32\n },\n prime192v1: {\n name: 'p192',\n byteLength: 24\n },\n ed25519: {\n name: 'ed25519',\n byteLength: 32\n },\n secp384r1: {\n name: 'p384',\n byteLength: 48\n },\n secp521r1: {\n name: 'p521',\n byteLength: 66\n }\n};\naliases.p224 = aliases.secp224r1;\naliases.p256 = aliases.secp256r1 = aliases.prime256v1;\naliases.p192 = aliases.secp192r1 = aliases.prime192v1;\naliases.p384 = aliases.secp384r1;\naliases.p521 = aliases.secp521r1;\n\nfunction ECDH(curve) {\n this.curveType = aliases[curve];\n\n if (!this.curveType) {\n this.curveType = {\n name: curve\n };\n }\n\n this.curve = new elliptic.ec(this.curveType.name); // eslint-disable-line new-cap\n\n this.keys = void 0;\n}\n\nECDH.prototype.generateKeys = function (enc, format) {\n this.keys = this.curve.genKeyPair();\n return this.getPublicKey(enc, format);\n};\n\nECDH.prototype.computeSecret = function (other, inenc, enc) {\n inenc = inenc || 'utf8';\n\n if (!Buffer.isBuffer(other)) {\n other = new Buffer(other, inenc);\n }\n\n var otherPub = this.curve.keyFromPublic(other).getPublic();\n var out = otherPub.mul(this.keys.getPrivate()).getX();\n return formatReturnValue(out, enc, this.curveType.byteLength);\n};\n\nECDH.prototype.getPublicKey = function (enc, format) {\n var key = this.keys.getPublic(format === 'compressed', true);\n\n if (format === 'hybrid') {\n if (key[key.length - 1] % 2) {\n key[0] = 7;\n } else {\n key[0] = 6;\n }\n }\n\n return formatReturnValue(key, enc);\n};\n\nECDH.prototype.getPrivateKey = function (enc) {\n return formatReturnValue(this.keys.getPrivate(), enc);\n};\n\nECDH.prototype.setPublicKey = function (pub, enc) {\n enc = enc || 'utf8';\n\n if (!Buffer.isBuffer(pub)) {\n pub = new Buffer(pub, enc);\n }\n\n this.keys._importPublic(pub);\n\n return this;\n};\n\nECDH.prototype.setPrivateKey = function (priv, enc) {\n enc = enc || 'utf8';\n\n if (!Buffer.isBuffer(priv)) {\n priv = new Buffer(priv, enc);\n }\n\n var _priv = new BN(priv);\n\n _priv = _priv.toString(16);\n this.keys = this.curve.genKeyPair();\n\n this.keys._importPrivate(_priv);\n\n return this;\n};\n\nfunction formatReturnValue(bn, enc, len) {\n if (!Array.isArray(bn)) {\n bn = bn.toArray();\n }\n\n var buf = new Buffer(bn);\n\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length);\n zeros.fill(0);\n buf = Buffer.concat([zeros, buf]);\n }\n\n if (!enc) {\n return buf;\n } else {\n return buf.toString(enc);\n }\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/create-ecdh/browser.js?"); /***/ }), /***/ "./node_modules/create-hash/browser.js": /*!*********************************************!*\ !*** ./node_modules/create-hash/browser.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\");\n\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\");\n\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\");\n\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nfunction Hash(hash) {\n Base.call(this, 'digest');\n this._hash = hash;\n}\n\ninherits(Hash, Base);\n\nHash.prototype._update = function (data) {\n this._hash.update(data);\n};\n\nHash.prototype._final = function () {\n return this._hash.digest();\n};\n\nmodule.exports = function createHash(alg) {\n alg = alg.toLowerCase();\n if (alg === 'md5') return new MD5();\n if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160();\n return new Hash(sha(alg));\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/create-hash/browser.js?"); /***/ }), /***/ "./node_modules/create-hash/md5.js": /*!*****************************************!*\ !*** ./node_modules/create-hash/md5.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\");\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest();\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/create-hash/md5.js?"); /***/ }), /***/ "./node_modules/create-hmac/browser.js": /*!*********************************************!*\ !*** ./node_modules/create-hmac/browser.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Legacy = __webpack_require__(/*! ./legacy */ \"./node_modules/create-hmac/legacy.js\");\n\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar md5 = __webpack_require__(/*! create-hash/md5 */ \"./node_modules/create-hash/md5.js\");\n\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\");\n\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\");\n\nvar ZEROS = Buffer.alloc(128);\n\nfunction Hmac(alg, key) {\n Base.call(this, 'digest');\n\n if (typeof key === 'string') {\n key = Buffer.from(key);\n }\n\n var blocksize = alg === 'sha512' || alg === 'sha384' ? 128 : 64;\n this._alg = alg;\n this._key = key;\n\n if (key.length > blocksize) {\n var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg);\n key = hash.update(key).digest();\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize);\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize);\n var opad = this._opad = Buffer.allocUnsafe(blocksize);\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36;\n opad[i] = key[i] ^ 0x5C;\n }\n\n this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg);\n\n this._hash.update(ipad);\n}\n\ninherits(Hmac, Base);\n\nHmac.prototype._update = function (data) {\n this._hash.update(data);\n};\n\nHmac.prototype._final = function () {\n var h = this._hash.digest();\n\n var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg);\n return hash.update(this._opad).update(h).digest();\n};\n\nmodule.exports = function createHmac(alg, key) {\n alg = alg.toLowerCase();\n\n if (alg === 'rmd160' || alg === 'ripemd160') {\n return new Hmac('rmd160', key);\n }\n\n if (alg === 'md5') {\n return new Legacy(md5, key);\n }\n\n return new Hmac(alg, key);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/create-hmac/browser.js?"); /***/ }), /***/ "./node_modules/create-hmac/legacy.js": /*!********************************************!*\ !*** ./node_modules/create-hmac/legacy.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\");\n\nvar ZEROS = Buffer.alloc(128);\nvar blocksize = 64;\n\nfunction Hmac(alg, key) {\n Base.call(this, 'digest');\n\n if (typeof key === 'string') {\n key = Buffer.from(key);\n }\n\n this._alg = alg;\n this._key = key;\n\n if (key.length > blocksize) {\n key = alg(key);\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize);\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize);\n var opad = this._opad = Buffer.allocUnsafe(blocksize);\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36;\n opad[i] = key[i] ^ 0x5C;\n }\n\n this._hash = [ipad];\n}\n\ninherits(Hmac, Base);\n\nHmac.prototype._update = function (data) {\n this._hash.push(data);\n};\n\nHmac.prototype._final = function () {\n var h = this._alg(Buffer.concat(this._hash));\n\n return this._alg(Buffer.concat([this._opad, h]));\n};\n\nmodule.exports = Hmac;\n\n//# sourceURL=webpack://gramjs/./node_modules/create-hmac/legacy.js?"); /***/ }), /***/ "./node_modules/crypto-browserify/index.js": /*!*************************************************!*\ !*** ./node_modules/crypto-browserify/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nexports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\nexports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\nexports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ \"./node_modules/create-hmac/browser.js\");\n\nvar algos = __webpack_require__(/*! browserify-sign/algos */ \"./node_modules/browserify-sign/algos.js\");\n\nvar algoKeys = Object.keys(algos);\nvar hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys);\n\nexports.getHashes = function () {\n return hashes;\n};\n\nvar p = __webpack_require__(/*! pbkdf2 */ \"./node_modules/pbkdf2/browser.js\");\n\nexports.pbkdf2 = p.pbkdf2;\nexports.pbkdf2Sync = p.pbkdf2Sync;\n\nvar aes = __webpack_require__(/*! browserify-cipher */ \"./node_modules/browserify-cipher/browser.js\");\n\nexports.Cipher = aes.Cipher;\nexports.createCipher = aes.createCipher;\nexports.Cipheriv = aes.Cipheriv;\nexports.createCipheriv = aes.createCipheriv;\nexports.Decipher = aes.Decipher;\nexports.createDecipher = aes.createDecipher;\nexports.Decipheriv = aes.Decipheriv;\nexports.createDecipheriv = aes.createDecipheriv;\nexports.getCiphers = aes.getCiphers;\nexports.listCiphers = aes.listCiphers;\n\nvar dh = __webpack_require__(/*! diffie-hellman */ \"./node_modules/diffie-hellman/browser.js\");\n\nexports.DiffieHellmanGroup = dh.DiffieHellmanGroup;\nexports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup;\nexports.getDiffieHellman = dh.getDiffieHellman;\nexports.createDiffieHellman = dh.createDiffieHellman;\nexports.DiffieHellman = dh.DiffieHellman;\n\nvar sign = __webpack_require__(/*! browserify-sign */ \"./node_modules/browserify-sign/browser/index.js\");\n\nexports.createSign = sign.createSign;\nexports.Sign = sign.Sign;\nexports.createVerify = sign.createVerify;\nexports.Verify = sign.Verify;\nexports.createECDH = __webpack_require__(/*! create-ecdh */ \"./node_modules/create-ecdh/browser.js\");\n\nvar publicEncrypt = __webpack_require__(/*! public-encrypt */ \"./node_modules/public-encrypt/browser.js\");\n\nexports.publicEncrypt = publicEncrypt.publicEncrypt;\nexports.privateEncrypt = publicEncrypt.privateEncrypt;\nexports.publicDecrypt = publicEncrypt.publicDecrypt;\nexports.privateDecrypt = publicEncrypt.privateDecrypt; // the least I can do is make error messages for the rest of the node.js/crypto api.\n// ;[\n// 'createCredentials'\n// ].forEach(function (name) {\n// exports[name] = function () {\n// throw new Error([\n// 'sorry, ' + name + ' is not implemented yet',\n// 'we accept pull requests',\n// 'https://github.com/crypto-browserify/crypto-browserify'\n// ].join('\\n'))\n// }\n// })\n\nvar rf = __webpack_require__(/*! randomfill */ \"./node_modules/randomfill/browser.js\");\n\nexports.randomFill = rf.randomFill;\nexports.randomFillSync = rf.randomFillSync;\n\nexports.createCredentials = function () {\n throw new Error(['sorry, createCredentials is not implemented yet', 'we accept pull requests', 'https://github.com/crypto-browserify/crypto-browserify'].join('\\n'));\n};\n\nexports.constants = {\n 'DH_CHECK_P_NOT_SAFE_PRIME': 2,\n 'DH_CHECK_P_NOT_PRIME': 1,\n 'DH_UNABLE_TO_CHECK_GENERATOR': 4,\n 'DH_NOT_SUITABLE_GENERATOR': 8,\n 'NPN_ENABLED': 1,\n 'ALPN_ENABLED': 1,\n 'RSA_PKCS1_PADDING': 1,\n 'RSA_SSLV23_PADDING': 2,\n 'RSA_NO_PADDING': 3,\n 'RSA_PKCS1_OAEP_PADDING': 4,\n 'RSA_X931_PADDING': 5,\n 'RSA_PKCS1_PSS_PADDING': 6,\n 'POINT_CONVERSION_COMPRESSED': 2,\n 'POINT_CONVERSION_UNCOMPRESSED': 4,\n 'POINT_CONVERSION_HYBRID': 6\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/crypto-browserify/index.js?"); /***/ }), /***/ "./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"; eval("\n\nexports.utils = __webpack_require__(/*! ./des/utils */ \"./node_modules/des.js/lib/des/utils.js\");\nexports.Cipher = __webpack_require__(/*! ./des/cipher */ \"./node_modules/des.js/lib/des/cipher.js\");\nexports.DES = __webpack_require__(/*! ./des/des */ \"./node_modules/des.js/lib/des/des.js\");\nexports.CBC = __webpack_require__(/*! ./des/cbc */ \"./node_modules/des.js/lib/des/cbc.js\");\nexports.EDE = __webpack_require__(/*! ./des/ede */ \"./node_modules/des.js/lib/des/ede.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des.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"; eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar proto = {};\n\nfunction CBCState(iv) {\n assert.equal(iv.length, 8, 'Invalid IV length');\n this.iv = new Array(8);\n\n for (var i = 0; i < this.iv.length; i++) {\n this.iv[i] = iv[i];\n }\n}\n\nfunction instantiate(Base) {\n function CBC(options) {\n Base.call(this, options);\n\n this._cbcInit();\n }\n\n inherits(CBC, Base);\n var keys = Object.keys(proto);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n\n CBC.create = function create(options) {\n return new CBC(options);\n };\n\n return CBC;\n}\n\nexports.instantiate = instantiate;\n\nproto._cbcInit = function _cbcInit() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n};\n\nproto._update = function _update(inp, inOff, out, outOff) {\n var state = this._cbcState;\n var superProto = this.constructor.super_.prototype;\n var iv = state.iv;\n\n if (this.type === 'encrypt') {\n for (var i = 0; i < this.blockSize; i++) {\n iv[i] ^= inp[inOff + i];\n }\n\n superProto._update.call(this, iv, 0, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++) {\n iv[i] = out[outOff + i];\n }\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++) {\n out[outOff + i] ^= iv[i];\n }\n\n for (var i = 0; i < this.blockSize; i++) {\n iv[i] = inp[inOff + i];\n }\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des/cbc.js?"); /***/ }), /***/ "./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"; eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction Cipher(options) {\n this.options = options;\n this.type = this.options.type;\n this.blockSize = 8;\n\n this._init();\n\n this.buffer = new Array(this.blockSize);\n this.bufferOff = 0;\n}\n\nmodule.exports = Cipher;\n\nCipher.prototype._init = function _init() {// Might be overrided\n};\n\nCipher.prototype.update = function update(data) {\n if (data.length === 0) return [];\n if (this.type === 'decrypt') return this._updateDecrypt(data);else return this._updateEncrypt(data);\n};\n\nCipher.prototype._buffer = function _buffer(data, off) {\n // Append data to buffer\n var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);\n\n for (var i = 0; i < min; i++) {\n this.buffer[this.bufferOff + i] = data[off + i];\n }\n\n this.bufferOff += min; // Shift next\n\n return min;\n};\n\nCipher.prototype._flushBuffer = function _flushBuffer(out, off) {\n this._update(this.buffer, 0, out, off);\n\n this.bufferOff = 0;\n return this.blockSize;\n};\n\nCipher.prototype._updateEncrypt = function _updateEncrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n var count = (this.bufferOff + data.length) / this.blockSize | 0;\n var out = new Array(count * this.blockSize);\n\n if (this.bufferOff !== 0) {\n inputOff += this._buffer(data, inputOff);\n if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff);\n } // Write blocks\n\n\n var max = data.length - (data.length - inputOff) % this.blockSize;\n\n for (; inputOff < max; inputOff += this.blockSize) {\n this._update(data, inputOff, out, outputOff);\n\n outputOff += this.blockSize;\n } // Queue rest\n\n\n for (; inputOff < data.length; inputOff++, this.bufferOff++) {\n this.buffer[this.bufferOff] = data[inputOff];\n }\n\n return out;\n};\n\nCipher.prototype._updateDecrypt = function _updateDecrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;\n var out = new Array(count * this.blockSize); // TODO(indutny): optimize it, this is far from optimal\n\n for (; count > 0; count--) {\n inputOff += this._buffer(data, inputOff);\n outputOff += this._flushBuffer(out, outputOff);\n } // Buffer rest of the input\n\n\n inputOff += this._buffer(data, inputOff);\n return out;\n};\n\nCipher.prototype[\"final\"] = function _final(buffer) {\n var first;\n if (buffer) first = this.update(buffer);\n var last;\n if (this.type === 'encrypt') last = this._finalEncrypt();else last = this._finalDecrypt();\n if (first) return first.concat(last);else return last;\n};\n\nCipher.prototype._pad = function _pad(buffer, off) {\n if (off === 0) return false;\n\n while (off < buffer.length) {\n buffer[off++] = 0;\n }\n\n return true;\n};\n\nCipher.prototype._finalEncrypt = function _finalEncrypt() {\n if (!this._pad(this.buffer, this.bufferOff)) return [];\n var out = new Array(this.blockSize);\n\n this._update(this.buffer, 0, out, 0);\n\n return out;\n};\n\nCipher.prototype._unpad = function _unpad(buffer) {\n return buffer;\n};\n\nCipher.prototype._finalDecrypt = function _finalDecrypt() {\n assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');\n var out = new Array(this.blockSize);\n\n this._flushBuffer(out, 0);\n\n return this._unpad(out);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des/cipher.js?"); /***/ }), /***/ "./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"; eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar des = __webpack_require__(/*! ../des */ \"./node_modules/des.js/lib/des.js\");\n\nvar utils = des.utils;\nvar Cipher = des.Cipher;\n\nfunction DESState() {\n this.tmp = new Array(2);\n this.keys = null;\n}\n\nfunction DES(options) {\n Cipher.call(this, options);\n var state = new DESState();\n this._desState = state;\n this.deriveKeys(state, options.key);\n}\n\ninherits(DES, Cipher);\nmodule.exports = DES;\n\nDES.create = function create(options) {\n return new DES(options);\n};\n\nvar shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n\nDES.prototype.deriveKeys = function deriveKeys(state, key) {\n state.keys = new Array(16 * 2);\n assert.equal(key.length, this.blockSize, 'Invalid key length');\n var kL = utils.readUInt32BE(key, 0);\n var kR = utils.readUInt32BE(key, 4);\n utils.pc1(kL, kR, state.tmp, 0);\n kL = state.tmp[0];\n kR = state.tmp[1];\n\n for (var i = 0; i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift);\n kR = utils.r28shl(kR, shift);\n utils.pc2(kL, kR, state.keys, i);\n }\n};\n\nDES.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._desState;\n var l = utils.readUInt32BE(inp, inOff);\n var r = utils.readUInt32BE(inp, inOff + 4); // Initial Permutation\n\n utils.ip(l, r, state.tmp, 0);\n l = state.tmp[0];\n r = state.tmp[1];\n if (this.type === 'encrypt') this._encrypt(state, l, r, state.tmp, 0);else this._decrypt(state, l, r, state.tmp, 0);\n l = state.tmp[0];\n r = state.tmp[1];\n utils.writeUInt32BE(out, l, outOff);\n utils.writeUInt32BE(out, r, outOff + 4);\n};\n\nDES.prototype._pad = function _pad(buffer, off) {\n var value = buffer.length - off;\n\n for (var i = off; i < buffer.length; i++) {\n buffer[i] = value;\n }\n\n return true;\n};\n\nDES.prototype._unpad = function _unpad(buffer) {\n var pad = buffer[buffer.length - 1];\n\n for (var i = buffer.length - pad; i < buffer.length; i++) {\n assert.equal(buffer[i], pad);\n }\n\n return buffer.slice(0, buffer.length - pad);\n};\n\nDES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {\n var l = lStart;\n var r = rStart; // Apply f() x16 times\n\n for (var i = 0; i < state.keys.length; i += 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1]; // f(r, k)\n\n utils.expand(r, state.tmp, 0);\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n var t = r;\n r = (l ^ f) >>> 0;\n l = t;\n } // Reverse Initial Permutation\n\n\n utils.rip(r, l, out, off);\n};\n\nDES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {\n var l = rStart;\n var r = lStart; // Apply f() x16 times\n\n for (var i = state.keys.length - 2; i >= 0; i -= 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1]; // f(r, k)\n\n utils.expand(l, state.tmp, 0);\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n var t = l;\n l = (r ^ f) >>> 0;\n r = t;\n } // Reverse Initial Permutation\n\n\n utils.rip(l, r, out, off);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des/des.js?"); /***/ }), /***/ "./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"; eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar des = __webpack_require__(/*! ../des */ \"./node_modules/des.js/lib/des.js\");\n\nvar Cipher = des.Cipher;\nvar DES = des.DES;\n\nfunction EDEState(type, key) {\n assert.equal(key.length, 24, 'Invalid key length');\n var k1 = key.slice(0, 8);\n var k2 = key.slice(8, 16);\n var k3 = key.slice(16, 24);\n\n if (type === 'encrypt') {\n this.ciphers = [DES.create({\n type: 'encrypt',\n key: k1\n }), DES.create({\n type: 'decrypt',\n key: k2\n }), DES.create({\n type: 'encrypt',\n key: k3\n })];\n } else {\n this.ciphers = [DES.create({\n type: 'decrypt',\n key: k3\n }), DES.create({\n type: 'encrypt',\n key: k2\n }), DES.create({\n type: 'decrypt',\n key: k1\n })];\n }\n}\n\nfunction EDE(options) {\n Cipher.call(this, options);\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n}\n\ninherits(EDE, Cipher);\nmodule.exports = EDE;\n\nEDE.create = function create(options) {\n return new EDE(options);\n};\n\nEDE.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._edeState;\n\n state.ciphers[0]._update(inp, inOff, out, outOff);\n\n state.ciphers[1]._update(out, outOff, out, outOff);\n\n state.ciphers[2]._update(out, outOff, out, outOff);\n};\n\nEDE.prototype._pad = DES.prototype._pad;\nEDE.prototype._unpad = DES.prototype._unpad;\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des/ede.js?"); /***/ }), /***/ "./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"; eval("\n\nexports.readUInt32BE = function readUInt32BE(bytes, off) {\n var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];\n return res >>> 0;\n};\n\nexports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {\n bytes[0 + off] = value >>> 24;\n bytes[1 + off] = value >>> 16 & 0xff;\n bytes[2 + off] = value >>> 8 & 0xff;\n bytes[3 + off] = value & 0xff;\n};\n\nexports.ip = function ip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= inR >>> j + i & 1;\n }\n\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= inL >>> j + i & 1;\n }\n }\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= inR >>> j + i & 1;\n }\n\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= inL >>> j + i & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.rip = function rip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 0; i < 4; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outL <<= 1;\n outL |= inR >>> j + i & 1;\n outL <<= 1;\n outL |= inL >>> j + i & 1;\n }\n }\n\n for (var i = 4; i < 8; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outR <<= 1;\n outR |= inR >>> j + i & 1;\n outR <<= 1;\n outR |= inL >>> j + i & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.pc1 = function pc1(inL, inR, out, off) {\n var outL = 0;\n var outR = 0; // 7, 15, 23, 31, 39, 47, 55, 63\n // 6, 14, 22, 30, 39, 47, 55, 63\n // 5, 13, 21, 29, 39, 47, 55, 63\n // 4, 12, 20, 28\n\n for (var i = 7; i >= 5; i--) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= inR >> j + i & 1;\n }\n\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= inL >> j + i & 1;\n }\n }\n\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= inR >> j + i & 1;\n } // 1, 9, 17, 25, 33, 41, 49, 57\n // 2, 10, 18, 26, 34, 42, 50, 58\n // 3, 11, 19, 27, 35, 43, 51, 59\n // 36, 44, 52, 60\n\n\n for (var i = 1; i <= 3; i++) {\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= inR >> j + i & 1;\n }\n\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= inL >> j + i & 1;\n }\n }\n\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= inL >> j + i & 1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.r28shl = function r28shl(num, shift) {\n return num << shift & 0xfffffff | num >>> 28 - shift;\n};\n\nvar pc2table = [// inL => outL\n14, 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\n15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24];\n\nexports.pc2 = function pc2(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n var len = pc2table.length >>> 1;\n\n for (var i = 0; i < len; i++) {\n outL <<= 1;\n outL |= inL >>> pc2table[i] & 0x1;\n }\n\n for (var i = len; i < pc2table.length; i++) {\n outR <<= 1;\n outR |= inR >>> pc2table[i] & 0x1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.expand = function expand(r, out, off) {\n var outL = 0;\n var outR = 0;\n outL = (r & 1) << 5 | r >>> 27;\n\n for (var i = 23; i >= 15; i -= 4) {\n outL <<= 6;\n outL |= r >>> i & 0x3f;\n }\n\n for (var i = 11; i >= 3; i -= 4) {\n outR |= r >>> i & 0x3f;\n outR <<= 6;\n }\n\n outR |= (r & 0x1f) << 1 | r >>> 31;\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nvar 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];\n\nexports.substitute = function substitute(inL, inR) {\n var out = 0;\n\n for (var i = 0; i < 4; i++) {\n var b = inL >>> 18 - i * 6 & 0x3f;\n var sb = sTable[i * 0x40 + b];\n out <<= 4;\n out |= sb;\n }\n\n for (var i = 0; i < 4; i++) {\n var b = inR >>> 18 - i * 6 & 0x3f;\n var sb = sTable[4 * 0x40 + i * 0x40 + b];\n out <<= 4;\n out |= sb;\n }\n\n return out >>> 0;\n};\n\nvar 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];\n\nexports.permute = function permute(num) {\n var out = 0;\n\n for (var i = 0; i < permuteTable.length; i++) {\n out <<= 1;\n out |= num >>> permuteTable[i] & 0x1;\n }\n\n return out >>> 0;\n};\n\nexports.padSplit = function padSplit(num, size, group) {\n var str = num.toString(2);\n\n while (str.length < size) {\n str = '0' + str;\n }\n\n var out = [];\n\n for (var i = 0; i < size; i += group) {\n out.push(str.slice(i, i + group));\n }\n\n return out.join(' ');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/des.js/lib/des/utils.js?"); /***/ }), /***/ "./node_modules/diffie-hellman/browser.js": /*!************************************************!*\ !*** ./node_modules/diffie-hellman/browser.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ \"./node_modules/diffie-hellman/lib/generatePrime.js\");\n\nvar primes = __webpack_require__(/*! ./lib/primes.json */ \"./node_modules/diffie-hellman/lib/primes.json\");\n\nvar DH = __webpack_require__(/*! ./lib/dh */ \"./node_modules/diffie-hellman/lib/dh.js\");\n\nfunction getDiffieHellman(mod) {\n var prime = new Buffer(primes[mod].prime, 'hex');\n var gen = new Buffer(primes[mod].gen, 'hex');\n return new DH(prime, gen);\n}\n\nvar ENCODINGS = {\n 'binary': true,\n 'hex': true,\n 'base64': true\n};\n\nfunction createDiffieHellman(prime, enc, generator, genc) {\n if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {\n return createDiffieHellman(prime, 'binary', enc, generator);\n }\n\n enc = enc || 'binary';\n genc = genc || 'binary';\n generator = generator || new Buffer([2]);\n\n if (!Buffer.isBuffer(generator)) {\n generator = new Buffer(generator, genc);\n }\n\n if (typeof prime === 'number') {\n return new DH(generatePrime(prime, generator), generator, true);\n }\n\n if (!Buffer.isBuffer(prime)) {\n prime = new Buffer(prime, enc);\n }\n\n return new DH(prime, generator, true);\n}\n\nexports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman;\nexports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/diffie-hellman/browser.js?"); /***/ }), /***/ "./node_modules/diffie-hellman/lib/dh.js": /*!***********************************************!*\ !*** ./node_modules/diffie-hellman/lib/dh.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar MillerRabin = __webpack_require__(/*! miller-rabin */ \"./node_modules/miller-rabin/lib/mr.js\");\n\nvar millerRabin = new MillerRabin();\nvar TWENTYFOUR = new BN(24);\nvar ELEVEN = new BN(11);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\n\nvar primes = __webpack_require__(/*! ./generatePrime */ \"./node_modules/diffie-hellman/lib/generatePrime.js\");\n\nvar randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\n\nmodule.exports = DH;\n\nfunction setPublicKey(pub, enc) {\n enc = enc || 'utf8';\n\n if (!Buffer.isBuffer(pub)) {\n pub = new Buffer(pub, enc);\n }\n\n this._pub = new BN(pub);\n return this;\n}\n\nfunction setPrivateKey(priv, enc) {\n enc = enc || 'utf8';\n\n if (!Buffer.isBuffer(priv)) {\n priv = new Buffer(priv, enc);\n }\n\n this._priv = new BN(priv);\n return this;\n}\n\nvar primeCache = {};\n\nfunction checkPrime(prime, generator) {\n var gen = generator.toString('hex');\n var hex = [gen, prime.toString(16)].join('_');\n\n if (hex in primeCache) {\n return primeCache[hex];\n }\n\n var error = 0;\n\n if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) {\n //not a prime so +1\n error += 1;\n\n if (gen === '02' || gen === '05') {\n // we'd be able to check the generator\n // it would fail so +8\n error += 8;\n } else {\n //we wouldn't be able to test the generator\n // so +4\n error += 4;\n }\n\n primeCache[hex] = error;\n return error;\n }\n\n if (!millerRabin.test(prime.shrn(1))) {\n //not a safe prime\n error += 2;\n }\n\n var rem;\n\n switch (gen) {\n case '02':\n if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {\n // unsuidable generator\n error += 8;\n }\n\n break;\n\n case '05':\n rem = prime.mod(TEN);\n\n if (rem.cmp(THREE) && rem.cmp(SEVEN)) {\n // prime mod 10 needs to equal 3 or 7\n error += 8;\n }\n\n break;\n\n default:\n error += 4;\n }\n\n primeCache[hex] = error;\n return error;\n}\n\nfunction DH(prime, generator, malleable) {\n this.setGenerator(generator);\n this.__prime = new BN(prime);\n this._prime = BN.mont(this.__prime);\n this._primeLen = prime.length;\n this._pub = undefined;\n this._priv = undefined;\n this._primeCode = undefined;\n\n if (malleable) {\n this.setPublicKey = setPublicKey;\n this.setPrivateKey = setPrivateKey;\n } else {\n this._primeCode = 8;\n }\n}\n\nObject.defineProperty(DH.prototype, 'verifyError', {\n enumerable: true,\n get: function get() {\n if (typeof this._primeCode !== 'number') {\n this._primeCode = checkPrime(this.__prime, this.__gen);\n }\n\n return this._primeCode;\n }\n});\n\nDH.prototype.generateKeys = function () {\n if (!this._priv) {\n this._priv = new BN(randomBytes(this._primeLen));\n }\n\n this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();\n return this.getPublicKey();\n};\n\nDH.prototype.computeSecret = function (other) {\n other = new BN(other);\n other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed();\n var out = new Buffer(secret.toArray());\n var prime = this.getPrime();\n\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0);\n out = Buffer.concat([front, out]);\n }\n\n return out;\n};\n\nDH.prototype.getPublicKey = function getPublicKey(enc) {\n return formatReturnValue(this._pub, enc);\n};\n\nDH.prototype.getPrivateKey = function getPrivateKey(enc) {\n return formatReturnValue(this._priv, enc);\n};\n\nDH.prototype.getPrime = function (enc) {\n return formatReturnValue(this.__prime, enc);\n};\n\nDH.prototype.getGenerator = function (enc) {\n return formatReturnValue(this._gen, enc);\n};\n\nDH.prototype.setGenerator = function (gen, enc) {\n enc = enc || 'utf8';\n\n if (!Buffer.isBuffer(gen)) {\n gen = new Buffer(gen, enc);\n }\n\n this.__gen = gen;\n this._gen = new BN(gen);\n return this;\n};\n\nfunction formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n\n if (!enc) {\n return buf;\n } else {\n return buf.toString(enc);\n }\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/diffie-hellman/lib/dh.js?"); /***/ }), /***/ "./node_modules/diffie-hellman/lib/generatePrime.js": /*!**********************************************************!*\ !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\n\nmodule.exports = findPrime;\nfindPrime.simpleSieve = simpleSieve;\nfindPrime.fermatTest = fermatTest;\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar TWENTYFOUR = new BN(24);\n\nvar MillerRabin = __webpack_require__(/*! miller-rabin */ \"./node_modules/miller-rabin/lib/mr.js\");\n\nvar millerRabin = new MillerRabin();\nvar ONE = new BN(1);\nvar TWO = new BN(2);\nvar FIVE = new BN(5);\nvar SIXTEEN = new BN(16);\nvar EIGHT = new BN(8);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar ELEVEN = new BN(11);\nvar FOUR = new BN(4);\nvar TWELVE = new BN(12);\nvar primes = null;\n\nfunction _getPrimes() {\n if (primes !== null) return primes;\n var limit = 0x100000;\n var res = [];\n res[0] = 2;\n\n for (var i = 1, k = 3; k < limit; k += 2) {\n var sqrt = Math.ceil(Math.sqrt(k));\n\n for (var j = 0; j < i && res[j] <= sqrt; j++) {\n if (k % res[j] === 0) break;\n }\n\n if (i !== j && res[j] <= sqrt) continue;\n res[i++] = k;\n }\n\n primes = res;\n return res;\n}\n\nfunction simpleSieve(p) {\n var primes = _getPrimes();\n\n for (var i = 0; i < primes.length; i++) {\n if (p.modn(primes[i]) === 0) {\n if (p.cmpn(primes[i]) === 0) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n}\n\nfunction findPrime(bits, gen) {\n if (bits < 16) {\n // this is what openssl does\n if (gen === 2 || gen === 5) {\n return new BN([0x8c, 0x7b]);\n } else {\n return new BN([0x8c, 0x27]);\n }\n }\n\n gen = new BN(gen);\n var num, n2;\n\n while (true) {\n num = new BN(randomBytes(Math.ceil(bits / 8)));\n\n while (num.bitLength() > bits) {\n num.ishrn(1);\n }\n\n if (num.isEven()) {\n num.iadd(ONE);\n }\n\n if (!num.testn(1)) {\n num.iadd(TWO);\n }\n\n if (!gen.cmp(TWO)) {\n while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {\n num.iadd(FOUR);\n }\n } else if (!gen.cmp(FIVE)) {\n while (num.mod(TEN).cmp(THREE)) {\n num.iadd(FOUR);\n }\n }\n\n n2 = num.shrn(1);\n\n if (simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num)) {\n return num;\n }\n }\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/diffie-hellman/lib/generatePrime.js?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"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\\\"}}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/diffie-hellman/lib/primes.json?"); /***/ }), /***/ "./node_modules/elliptic/lib/elliptic.js": /*!***********************************************!*\ !*** ./node_modules/elliptic/lib/elliptic.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar elliptic = exports;\nelliptic.version = __webpack_require__(/*! ../package.json */ \"./node_modules/elliptic/package.json\").version;\nelliptic.utils = __webpack_require__(/*! ./elliptic/utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\nelliptic.rand = __webpack_require__(/*! brorand */ \"./node_modules/brorand/index.js\");\nelliptic.curve = __webpack_require__(/*! ./elliptic/curve */ \"./node_modules/elliptic/lib/elliptic/curve/index.js\");\nelliptic.curves = __webpack_require__(/*! ./elliptic/curves */ \"./node_modules/elliptic/lib/elliptic/curves.js\"); // Protocols\n\nelliptic.ec = __webpack_require__(/*! ./elliptic/ec */ \"./node_modules/elliptic/lib/elliptic/ec/index.js\");\nelliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ \"./node_modules/elliptic/lib/elliptic/eddsa/index.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic.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"; eval("\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16); // Use Montgomery, when there is no fast reduction for the prime\n\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); // Useful for many curves\n\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red); // Curve configuration, optional\n\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); // Temporary arrays\n\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4); // Generalized Greg Maxwell's trick\n\n var adjustCount = this.n && this.p.div(this.n);\n\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\n\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1);\n var I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3; // Translate into more windowed form\n\n var repr = [];\n\n for (var j = 0; j < naf.length; j += doubles.step) {\n var nafW = 0;\n\n for (var k = j + doubles.step - 1; k >= j; k--) {\n nafW = (nafW << 1) + naf[k];\n }\n\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n\n for (var i = I; i > 0; i--) {\n for (var j = 0; j < repr.length; j++) {\n var nafW = repr[j];\n if (nafW === i) b = b.mixedAdd(doubles.points[j]);else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg());\n }\n\n a = a.add(b);\n }\n\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4; // Precompute window\n\n var nafPoints = p._getNAFPoints(w);\n\n w = nafPoints.wnd;\n var wnd = nafPoints.points; // Get NAF form\n\n var naf = getNAF(k, w); // Add `this`*(N+1) for every w-NAF index\n\n var acc = this.jpoint(null, null, null);\n\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var k = 0; i >= 0 && naf[i] === 0; i--) {\n k++;\n }\n\n if (i >= 0) k++;\n acc = acc.dblp(k);\n if (i < 0) break;\n var z = naf[i];\n assert(z !== 0);\n\n if (p.type === 'affine') {\n // J +- P\n if (z > 0) acc = acc.mixedAdd(wnd[z - 1 >> 1]);else acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());\n } else {\n // J +- J\n if (z > 0) acc = acc.add(wnd[z - 1 >> 1]);else acc = acc.add(wnd[-z - 1 >> 1].neg());\n }\n }\n\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3; // Fill all arrays\n\n var max = 0;\n\n for (var i = 0; i < len; i++) {\n var p = points[i];\n\n var nafPoints = p._getNAFPoints(defW);\n\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n } // Comb small window NAFs\n\n\n for (var i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a]);\n naf[b] = getNAF(coeffs[b], wndWidth[b]);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [points[a],\n /* 1 */\n null,\n /* 3 */\n null,\n /* 5 */\n points[b]\n /* 7 */\n ]; // Try to avoid Projective points, if possible\n\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [-3,\n /* -1 -1 */\n -1,\n /* -1 0 */\n -5,\n /* -1 1 */\n -7,\n /* 0 -1 */\n 0,\n /* 0 0 */\n 7,\n /* 0 1 */\n 5,\n /* 1 -1 */\n 1,\n /* 1 0 */\n 3\n /* 1 1 */\n ];\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n\n for (var j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n\n for (var i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n\n for (var j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0) zero = false;\n }\n\n if (!zero) break;\n k++;\n i--;\n }\n\n if (i >= 0) k++;\n acc = acc.dblp(k);\n if (i < 0) break;\n\n for (var j = 0; j < len; j++) {\n var z = tmp[j];\n var p;\n 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();\n if (p.type === 'affine') acc = acc.mixedAdd(p);else acc = acc.add(p);\n }\n } // Zeroify references\n\n\n for (var i = 0; i < len; i++) {\n wnd[i] = null;\n }\n\n if (jacobianResult) return acc;else return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\n\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq()\n/*other*/\n{\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n var len = this.p.byteLength(); // uncompressed, hybrid-odd, hybrid-even\n\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06) assert(bytes[bytes.length - 1] % 2 === 0);else if (bytes[0] === 0x07) assert(bytes[bytes.length - 1] % 2 === 1);\n var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n if (compact) return [this.getY().isEven() ? 0x02 : 0x03].concat(x);\n return [0x04].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed) return this;\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed) return false;\n var doubles = this.precomputed.doubles;\n if (!doubles) return false;\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;\n var doubles = [this];\n var acc = this;\n\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++) {\n acc = acc.dbl();\n }\n\n doubles.push(acc);\n }\n\n return {\n step: step,\n points: doubles\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;\n var res = [this];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n\n for (var i = 1; i < max; i++) {\n res[i] = res[i - 1].add(dbl);\n }\n\n return {\n wnd: wnd,\n points: res\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n\n for (var i = 0; i < k; i++) {\n r = r.dbl();\n }\n\n return r;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curve/base.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Base = __webpack_require__(/*! ./base */ \"./node_modules/elliptic/lib/elliptic/curve/base.js\");\n\nvar assert = utils.assert;\n\nfunction EdwardsCurve(conf) {\n // NOTE: Important as we are creating point in Base.call()\n this.twisted = (conf.a | 0) !== 1;\n this.mOneA = this.twisted && (conf.a | 0) === -1;\n this.extended = this.mOneA;\n Base.call(this, 'edwards', conf);\n this.a = new BN(conf.a, 16).umod(this.red.m);\n this.a = this.a.toRed(this.red);\n this.c = new BN(conf.c, 16).toRed(this.red);\n this.c2 = this.c.redSqr();\n this.d = new BN(conf.d, 16).toRed(this.red);\n this.dd = this.d.redAdd(this.d);\n assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n this.oneC = (conf.c | 0) === 1;\n}\n\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n if (this.mOneA) return num.redNeg();else return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n if (this.oneC) return num;else return this.c.redMul(num);\n}; // Just for compatibility with Short curve\n\n\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red) x = x.toRed(this.red);\n var x2 = x.redSqr();\n var rhs = this.c2.redSub(this.a.redMul(x2));\n var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n var y2 = rhs.redMul(lhs.redInvm());\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error('invalid point');\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd) y = y.redNeg();\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n y = new BN(y, 16);\n if (!y.red) y = y.toRed(this.red); // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)\n\n var y2 = y.redSqr();\n var lhs = y2.redSub(this.c2);\n var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);\n var x2 = lhs.redMul(rhs.redInvm());\n\n if (x2.cmp(this.zero) === 0) {\n if (odd) throw new Error('invalid point');else return this.point(this.zero, y);\n }\n\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error('invalid point');\n if (x.fromRed().isOdd() !== odd) x = x.redNeg();\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n if (point.isInfinity()) return true; // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n\n point.normalize();\n var x2 = point.x.redSqr();\n var y2 = point.y.redSqr();\n var lhs = x2.redMul(this.a).redAdd(y2);\n var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, 'projective');\n\n if (x === null && y === null && z === null) {\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = z ? new BN(z, 16) : this.curve.one;\n this.t = t && new BN(t, 16);\n if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red);\n this.zOne = this.z === this.curve.one; // Use extended coordinates\n\n if (this.curve.extended && !this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne) this.t = this.t.redMul(this.z.redInvm());\n }\n }\n}\n\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity()) return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #doubling-dbl-2008-hwcd\n // 4M + 4S\n // A = X1^2\n var a = this.x.redSqr(); // B = Y1^2\n\n var b = this.y.redSqr(); // C = 2 * Z1^2\n\n var c = this.z.redSqr();\n c = c.redIAdd(c); // D = a * A\n\n var d = this.curve._mulA(a); // E = (X1 + Y1)^2 - A - B\n\n\n var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); // G = D + B\n\n var g = d.redAdd(b); // F = G - C\n\n var f = g.redSub(c); // H = D - B\n\n var h = d.redSub(b); // X3 = E * F\n\n var nx = e.redMul(f); // Y3 = G * H\n\n var ny = g.redMul(h); // T3 = E * H\n\n var nt = e.redMul(h); // Z3 = F * G\n\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #doubling-dbl-2008-bbjlp\n // #doubling-dbl-2007-bl\n // and others\n // Generally 3M + 4S or 2M + 4S\n // B = (X1 + Y1)^2\n var b = this.x.redAdd(this.y).redSqr(); // C = X1^2\n\n var c = this.x.redSqr(); // D = Y1^2\n\n var d = this.y.redSqr();\n var nx;\n var ny;\n var nz;\n\n if (this.curve.twisted) {\n // E = a * C\n var e = this.curve._mulA(c); // F = E + D\n\n\n var f = e.redAdd(d);\n\n if (this.zOne) {\n // X3 = (B - C - D) * (F - 2)\n nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); // Y3 = F * (E - D)\n\n ny = f.redMul(e.redSub(d)); // Z3 = F^2 - 2 * F\n\n nz = f.redSqr().redSub(f).redSub(f);\n } else {\n // H = Z1^2\n var h = this.z.redSqr(); // J = F - 2 * H\n\n var j = f.redSub(h).redISub(h); // X3 = (B-C-D)*J\n\n nx = b.redSub(c).redISub(d).redMul(j); // Y3 = F * (E - D)\n\n ny = f.redMul(e.redSub(d)); // Z3 = F * J\n\n nz = f.redMul(j);\n }\n } else {\n // E = C + D\n var e = c.redAdd(d); // H = (c * Z1)^2\n\n var h = this.curve._mulC(this.z).redSqr(); // J = E - 2 * H\n\n\n var j = e.redSub(h).redSub(h); // X3 = c * (B - E) * J\n\n nx = this.curve._mulC(b.redISub(e)).redMul(j); // Y3 = c * E * (C - D)\n\n ny = this.curve._mulC(e).redMul(c.redISub(d)); // Z3 = E * J\n\n nz = e.redMul(j);\n }\n\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.isInfinity()) return this; // Double in extended coordinates\n\n if (this.curve.extended) return this._extDbl();else return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #addition-add-2008-hwcd-3\n // 8M\n // A = (Y1 - X1) * (Y2 - X2)\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); // B = (Y1 + X1) * (Y2 + X2)\n\n var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); // C = T1 * k * T2\n\n var c = this.t.redMul(this.curve.dd).redMul(p.t); // D = Z1 * 2 * Z2\n\n var d = this.z.redMul(p.z.redAdd(p.z)); // E = B - A\n\n var e = b.redSub(a); // F = D - C\n\n var f = d.redSub(c); // G = D + C\n\n var g = d.redAdd(c); // H = B + A\n\n var h = b.redAdd(a); // X3 = E * F\n\n var nx = e.redMul(f); // Y3 = G * H\n\n var ny = g.redMul(h); // T3 = E * H\n\n var nt = e.redMul(h); // Z3 = F * G\n\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #addition-add-2008-bbjlp\n // #addition-add-2007-bl\n // 10M + 1S\n // A = Z1 * Z2\n var a = this.z.redMul(p.z); // B = A^2\n\n var b = a.redSqr(); // C = X1 * X2\n\n var c = this.x.redMul(p.x); // D = Y1 * Y2\n\n var d = this.y.redMul(p.y); // E = d * C * D\n\n var e = this.curve.d.redMul(c).redMul(d); // F = B - E\n\n var f = b.redSub(e); // G = B + E\n\n var g = b.redAdd(e); // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n\n var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n var nx = a.redMul(f).redMul(tmp);\n var ny;\n var nz;\n\n if (this.curve.twisted) {\n // Y3 = A * G * (D - a * C)\n ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); // Z3 = F * G\n\n nz = f.redMul(g);\n } else {\n // Y3 = A * G * (D - C)\n ny = a.redMul(g).redMul(d.redSub(c)); // Z3 = c * F * G\n\n nz = this.curve._mulC(f).redMul(g);\n }\n\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n if (this.isInfinity()) return p;\n if (p.isInfinity()) return this;\n if (this.curve.extended) return this._extAdd(p);else return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);else return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n if (this.zOne) return this; // Normalize coordinates\n\n var zi = this.z.redInvm();\n this.x = this.x.redMul(zi);\n this.y = this.y.redMul(zi);\n if (this.t) this.t = this.t.redMul(zi);\n this.z = this.curve.one;\n this.zOne = true;\n return this;\n};\n\nPoint.prototype.neg = function neg() {\n return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n this.normalize();\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n this.normalize();\n return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0) return true;\n var xc = x.clone();\n var t = this.curve.redN.redMul(this.z);\n\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0) return false;\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0) return true;\n }\n}; // Compatibility with BaseCurve\n\n\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curve/edwards.js?"); /***/ }), /***/ "./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"; eval("\n\nvar curve = exports;\ncurve.base = __webpack_require__(/*! ./base */ \"./node_modules/elliptic/lib/elliptic/curve/base.js\");\ncurve[\"short\"] = __webpack_require__(/*! ./short */ \"./node_modules/elliptic/lib/elliptic/curve/short.js\");\ncurve.mont = __webpack_require__(/*! ./mont */ \"./node_modules/elliptic/lib/elliptic/curve/mont.js\");\ncurve.edwards = __webpack_require__(/*! ./edwards */ \"./node_modules/elliptic/lib/elliptic/curve/edwards.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curve/index.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"; eval("\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Base = __webpack_require__(/*! ./base */ \"./node_modules/elliptic/lib/elliptic/curve/base.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nfunction MontCurve(conf) {\n Base.call(this, 'mont', conf);\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.i4 = new BN(4).toRed(this.red).redInvm();\n this.two = new BN(2).toRed(this.red);\n this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\n\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n var x = point.normalize().x;\n var x2 = x.redSqr();\n var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n var y = rhs.redSqrt();\n return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n Base.BasePoint.call(this, curve, 'projective');\n\n if (x === null && z === null) {\n this.x = this.curve.one;\n this.z = this.curve.zero;\n } else {\n this.x = new BN(x, 16);\n this.z = new BN(z, 16);\n if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n }\n}\n\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {// No-op\n};\n\nPoint.prototype._encode = function _encode() {\n return this.getX().toArray('be', this.curve.p.byteLength());\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity()) return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A\n // A = X1 + Z1\n var a = this.x.redAdd(this.z); // AA = A^2\n\n var aa = a.redSqr(); // B = X1 - Z1\n\n var b = this.x.redSub(this.z); // BB = B^2\n\n var bb = b.redSqr(); // C = AA - BB\n\n var c = aa.redSub(bb); // X3 = AA * BB\n\n var nx = aa.redMul(bb); // Z3 = C * (BB + A24 * C)\n\n var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n // 4M + 2S + 6A\n // A = X2 + Z2\n var a = this.x.redAdd(this.z); // B = X2 - Z2\n\n var b = this.x.redSub(this.z); // C = X3 + Z3\n\n var c = p.x.redAdd(p.z); // D = X3 - Z3\n\n var d = p.x.redSub(p.z); // DA = D * A\n\n var da = d.redMul(a); // CB = C * B\n\n var cb = c.redMul(b); // X5 = Z1 * (DA + CB)^2\n\n var nx = diff.z.redMul(da.redAdd(cb).redSqr()); // Z5 = X1 * (DA - CB)^2\n\n var nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n var t = k.clone();\n var a = this; // (N / 2) * Q + Q\n\n var b = this.curve.point(null, null); // (N / 2) * Q\n\n var c = this; // Q\n\n for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) {\n bits.push(t.andln(1));\n }\n\n for (var i = bits.length - 1; i >= 0; i--) {\n if (bits[i] === 0) {\n // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n a = a.diffAdd(b, c); // N * Q = 2 * ((N / 2) * Q + Q))\n\n b = b.dbl();\n } else {\n // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n b = a.diffAdd(b, c); // N * Q + Q = 2 * ((N / 2) * Q + Q)\n\n a = a.dbl();\n }\n }\n\n return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n this.x = this.x.redMul(this.z.redInvm());\n this.z = this.curve.one;\n return this;\n};\n\nPoint.prototype.getX = function getX() {\n // Normalize coordinates\n this.normalize();\n return this.x.fromRed();\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curve/mont.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Base = __webpack_require__(/*! ./base */ \"./node_modules/elliptic/lib/elliptic/curve/base.js\");\n\nvar assert = utils.assert;\n\nfunction ShortCurve(conf) {\n Base.call(this, 'short', conf);\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; // If the curve is endomorphic, precalculate beta and lambda\n\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\n\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return; // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n\n var beta;\n var lambda;\n\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p); // Choose the smallest beta\n\n\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n } // Get basis vectors, used for balanced length-two representation\n\n\n var basis;\n\n if (conf.basis) {\n basis = conf.basis.map(function (vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [l1, l2];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1); // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n\n var a0;\n var b0; // First vector\n\n var a1;\n var b1; // Second vector\n\n var a2;\n var b2;\n var prevR;\n var i = 0;\n var r;\n var x;\n\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n\n prevR = r;\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n\n a2 = r.neg();\n b2 = x;\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n } // Normalize signs\n\n\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [{\n a: a1,\n b: b1\n }, {\n a: a2,\n b: b2\n }];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b); // Calculate answer\n\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return {\n k1: k1,\n k2: k2\n };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red) x = x.toRed(this.red);\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n 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\n // to non-red form?\n\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd) y = y.redNeg();\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf) return true;\n var x = point.x;\n var y = point.y;\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n\n var p = points[i];\n\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); // Clean-up references to points and coefficients\n\n\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n\n return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, 'affine');\n\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16); // Force redgomery representation when loading from JSON\n\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n\n if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\n\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo) return;\n var pre = this.precomputed;\n if (pre && pre.beta) return pre.beta;\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n\n if (pre) {\n var curve = this.curve;\n\n var endoMul = function endoMul(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed) return [this.x, this.y];\n return [this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n }];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string') obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2]) return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [res].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [res].concat(pre.naf.points.map(obj2point))\n }\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity()) return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf) return p; // P + O = P\n\n if (p.inf) return this; // P + P = 2P\n\n if (this.eq(p)) return this.dbl(); // P + (-P) = O\n\n if (this.neg().eq(p)) return this.curve.point(null, null); // P + Q = O\n\n if (this.x.cmp(p.x) === 0) return this.curve.point(null, null);\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf) return this; // 2P = O\n\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0) return this.curve.point(null, null);\n var a = this.curve.a;\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n if (this.isInfinity()) return this;else 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);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [this, p2];\n var coeffs = [k1, k2];\n if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs);else return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [this, p2];\n var coeffs = [k1, k2];\n if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true);else return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf) return this;\n var res = this.curve.point(this.x, this.y.redNeg());\n\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n\n var negate = function negate(p) {\n return p.neg();\n };\n\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf) return this.curve.jpoint(null, null, null);\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, 'jacobian');\n\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n\n if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n this.zOne = this.z === this.curve.one;\n}\n\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity()) return this.curve.point(null, null);\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity()) return p; // P + O = P\n\n if (p.isInfinity()) return this; // 12M + 4S + 7A\n\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);else return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity()) return p.toJ(); // P + O = P\n\n if (p.isInfinity()) return this; // 8M + 3S + 7A\n\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);else return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0) return this;\n if (this.isInfinity()) return this;\n if (!pow) return this.dbl();\n\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n\n for (var i = 0; i < pow; i++) {\n r = r.dbl();\n }\n\n return r;\n } // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n\n\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr(); // Reuse results\n\n var jyd = jy.redAdd(jy);\n\n for (var i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow) jz4 = jz4.redMul(jyd4);\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity()) return this;\n if (this.curve.zeroA) return this._zeroDbl();else if (this.curve.threeA) return this._threeDbl();else return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz; // Z = 1\n\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n // XX = X1^2\n var xx = this.x.redSqr(); // YY = Y1^2\n\n var yy = this.y.redSqr(); // YYYY = YY^2\n\n var yyyy = yy.redSqr(); // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s); // M = 3 * XX + a; a = 0\n\n var m = xx.redAdd(xx).redIAdd(xx); // T = M ^ 2 - 2*S\n\n var t = m.redSqr().redISub(s).redISub(s); // 8 * YYYY\n\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8); // X3 = T\n\n nx = t; // Y3 = M * (S - T) - 8 * YYYY\n\n ny = m.redMul(s.redISub(t)).redISub(yyyy8); // Z3 = 2*Y1\n\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n // A = X1^2\n var a = this.x.redSqr(); // B = Y1^2\n\n var b = this.y.redSqr(); // C = B^2\n\n var c = b.redSqr(); // D = 2 * ((X1 + B)^2 - A - C)\n\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d); // E = 3 * A\n\n var e = a.redAdd(a).redIAdd(a); // F = E^2\n\n var f = e.redSqr(); // 8 * C\n\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8); // X3 = F - 2 * D\n\n nx = f.redISub(d).redISub(d); // Y3 = E * (D - X3) - 8 * C\n\n ny = e.redMul(d.redISub(nx)).redISub(c8); // Z3 = 2 * Y1 * Z1\n\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz; // Z = 1\n\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n // XX = X1^2\n var xx = this.x.redSqr(); // YY = Y1^2\n\n var yy = this.y.redSqr(); // YYYY = YY^2\n\n var yyyy = yy.redSqr(); // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s); // M = 3 * XX + a\n\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); // T = M^2 - 2 * S\n\n var t = m.redSqr().redISub(s).redISub(s); // X3 = T\n\n nx = t; // Y3 = M * (S - T) - 8 * YYYY\n\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8); // Z3 = 2 * Y1\n\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n // delta = Z1^2\n var delta = this.z.redSqr(); // gamma = Y1^2\n\n var gamma = this.y.redSqr(); // beta = X1 * gamma\n\n var beta = this.x.redMul(gamma); // alpha = 3 * (X1 - delta) * (X1 + delta)\n\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha); // X3 = alpha^2 - 8 * beta\n\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8); // Z3 = (Y1 + Z1)^2 - gamma - delta\n\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a; // 4M + 6S + 10A\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA) return this.dbl().add(this); // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n // XX = X1^2\n\n var xx = this.x.redSqr(); // YY = Y1^2\n\n var yy = this.y.redSqr(); // ZZ = Z1^2\n\n var zz = this.z.redSqr(); // YYYY = YY^2\n\n var yyyy = yy.redSqr(); // M = 3 * XX + a * ZZ2; a = 0\n\n var m = xx.redAdd(xx).redIAdd(xx); // MM = M^2\n\n var mm = m.redSqr(); // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm); // EE = E^2\n\n var ee = e.redSqr(); // T = 16*YYYY\n\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t); // U = (M + E)^2 - MM - EE - T\n\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); // X3 = 4 * (X1 * EE - 4 * YY * U)\n\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx); // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny); // Z3 = (Z1 + E)^2 - ZZ - EE\n\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine') return this.eq(p.toJ());\n if (this === p) return true; // x1 * z2^2 == x2 * z1^2\n\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false; // y1 * z2^3 == y2 * z1^3\n\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0) return true;\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0) return false;\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0) return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity()) return '';\n return '';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curve/short.js?"); /***/ }), /***/ "./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"; eval("\n\nvar curves = exports;\n\nvar hash = __webpack_require__(/*! hash.js */ \"./node_modules/hash.js/lib/hash.js\");\n\nvar curve = __webpack_require__(/*! ./curve */ \"./node_modules/elliptic/lib/elliptic/curve/index.js\");\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short') this.curve = new curve[\"short\"](options);else if (options.type === 'edwards') this.curve = new curve.edwards(options);else this.curve = new curve.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\n\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function get() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve\n });\n return curve;\n }\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: ['188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811']\n});\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34']\n});\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: ['6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5']\n});\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n 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']\n});\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n 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']\n});\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: ['9']\n});\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: ['216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658']\n});\nvar pre;\n\ntry {\n pre = __webpack_require__(/*! ./precomputed/secp256k1 */ \"./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\");\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [{\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n }, {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }],\n gRed: false,\n g: ['79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', pre]\n});\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/curves.js?"); /***/ }), /***/ "./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"; eval("\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar HmacDRBG = __webpack_require__(/*! hmac-drbg */ \"./node_modules/hmac-drbg/lib/hmac-drbg.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar curves = __webpack_require__(/*! ../curves */ \"./node_modules/elliptic/lib/elliptic/curves.js\");\n\nvar rand = __webpack_require__(/*! brorand */ \"./node_modules/brorand/index.js\");\n\nvar assert = utils.assert;\n\nvar KeyPair = __webpack_require__(/*! ./key */ \"./node_modules/elliptic/lib/elliptic/ec/key.js\");\n\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/elliptic/lib/elliptic/ec/signature.js\");\n\nfunction EC(options) {\n if (!(this instanceof EC)) return new EC(options); // Shortcut `elliptic.ec(curve-name)`\n\n if (typeof options === 'string') {\n assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);\n options = curves[options];\n } // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n\n\n if (options instanceof curves.PresetCurve) options = {\n curve: options\n };\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g; // Point on curve\n\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1); // Hash for function for DRBG\n\n this.hash = options.hash || options.curve.hash;\n}\n\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options) options = {}; // Instantiate Hmac_DRBG\n\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray()\n });\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n\n do {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0) continue;\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0) msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n);else return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (_typeof(enc) === 'object') {\n options = enc;\n enc = null;\n }\n\n if (!options) options = {};\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new BN(msg, 16)); // Zero-extend key to provide enough entropy\n\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes); // Zero-extend nonce to have the same byte size as N\n\n var nonce = msg.toArray('be', bytes); // Instantiate Hmac_DRBG\n\n var drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8'\n }); // Number of bytes to generate\n\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; true; iter++) {\n var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue;\n var kp = this.g.mul(k);\n if (kp.isInfinity()) continue;\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0) continue;\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0) continue;\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0); // Use complement of `s`, if it is > `n / 2`\n\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new Signature({\n r: r,\n s: s,\n recoveryParam: recoveryParam\n });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex'); // Perform primitive values validation\n\n var r = signature.r;\n var s = signature.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false; // Validate signature\n\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n\n if (!this.curve._maxwellTrick) {\n var p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity()) return false;\n return p.getX().umod(this.n).cmp(r) === 0;\n } // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n\n var p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity()) return false; // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function (msg, signature, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.s; // A set LSB signifies that the y-coordinate is odd\n\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n 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.\n\n if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);else r = this.curve.pointFromX(r, isYOdd);\n var rInv = signature.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n); // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function (e, signature, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null) return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q)) return i;\n }\n\n throw new Error('Unable to find valid recovery factor');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/ec/index.js?"); /***/ }), /***/ "./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"; eval("\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null; // KeyPair(ec, { priv: ..., pub: ... })\n\n if (options.priv) this._importPrivate(options.priv, options.privEnc);\n if (options.pub) this._importPublic(options.pub, options.pubEnc);\n}\n\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair) return pub;\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair) return priv;\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n if (pub.isInfinity()) return {\n result: false,\n reason: 'Invalid public key'\n };\n if (!pub.validate()) return {\n result: false,\n reason: 'Public key is not a point'\n };\n if (!pub.mul(this.ec.curve.n).isInfinity()) return {\n result: false,\n reason: 'Public key * N != O'\n };\n return {\n result: true,\n reason: null\n };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub) this.pub = this.ec.g.mul(this.priv);\n if (!enc) return this.pub;\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex') return this.priv.toString(16, 2);else return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16); // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' || this.ec.curve.type === 'edwards') {\n assert(key.x && key.y, 'Need both x and y coordinate');\n }\n\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n\n this.pub = this.ec.curve.decodePoint(key, enc);\n}; // ECDH\n\n\nKeyPair.prototype.derive = function derive(pub) {\n return pub.mul(this.priv).getX();\n}; // ECDSA\n\n\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '';\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/ec/key.js?"); /***/ }), /***/ "./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"; eval("\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature) return options;\n if (this._importDER(options, enc)) return;\n assert(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined) this.recoveryParam = null;else this.recoveryParam = options.recoveryParam;\n}\n\nmodule.exports = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n\n if (!(initial & 0x80)) {\n return initial;\n }\n\n var octetLen = initial & 0xf;\n var val = 0;\n\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n }\n\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n\n if (i === 0) {\n return buf;\n }\n\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position();\n\n if (data[p.place++] !== 0x30) {\n return false;\n }\n\n var len = getLength(data, p);\n\n if (len + p.place !== data.length) {\n return false;\n }\n\n if (data[p.place++] !== 0x02) {\n return false;\n }\n\n var rlen = getLength(data, p);\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n\n if (data[p.place++] !== 0x02) {\n return false;\n }\n\n var slen = getLength(data, p);\n\n if (data.length !== slen + p.place) {\n return false;\n }\n\n var s = data.slice(p.place, slen + p.place);\n\n if (r[0] === 0 && r[1] & 0x80) {\n r = r.slice(1);\n }\n\n if (s[0] === 0 && s[1] & 0x80) {\n s = s.slice(1);\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n\n while (--octets) {\n arr.push(len >>> (octets << 3) & 0xff);\n }\n\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray(); // Pad values\n\n if (r[0] & 0x80) r = [0].concat(r); // Pad values\n\n if (s[0] & 0x80) s = [0].concat(s);\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n\n var arr = [0x02];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [0x30];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils.encode(res, enc);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/ec/signature.js?"); /***/ }), /***/ "./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"; eval("\n\nvar hash = __webpack_require__(/*! hash.js */ \"./node_modules/hash.js/lib/hash.js\");\n\nvar curves = __webpack_require__(/*! ../curves */ \"./node_modules/elliptic/lib/elliptic/curves.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\n\nvar KeyPair = __webpack_require__(/*! ./key */ \"./node_modules/elliptic/lib/elliptic/eddsa/key.js\");\n\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/elliptic/lib/elliptic/eddsa/signature.js\");\n\nfunction EDDSA(curve) {\n assert(curve === 'ed25519', 'only tested with ed25519 so far');\n if (!(this instanceof EDDSA)) return new EDDSA(curve);\n var curve = curves[curve].curve;\n this.curve = curve;\n this.g = curve.g;\n this.g.precompute(curve.n.bitLength() + 1);\n this.pointClass = curve.point().constructor;\n this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\n\nEDDSA.prototype.sign = function sign(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret);\n var r = this.hashInt(key.messagePrefix(), message);\n var R = this.g.mul(r);\n var Rencoded = this.encodePoint(R);\n var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv());\n var S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({\n R: R,\n S: S,\n Rencoded: Rencoded\n });\n};\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\n\n\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n message = parseBytes(message);\n sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub);\n var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n var SG = this.g.mul(sig.S());\n var RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n var hash = this.hash();\n\n for (var i = 0; i < arguments.length; i++) {\n hash.update(arguments[i]);\n }\n\n return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n if (sig instanceof Signature) return sig;\n return new Signature(this, sig);\n};\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\n\n\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n var enc = point.getY().toArray('le', this.encodingLength);\n enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n bytes = utils.parseBytes(bytes);\n var lastIx = bytes.length - 1;\n var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n var y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n return val instanceof this.pointClass;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/eddsa/index.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array} [params.pub] - public key point encoded as bytes\n*\n*/\n\nfunction KeyPair(eddsa, params) {\n this.eddsa = eddsa;\n this._secret = parseBytes(params.secret);\n if (eddsa.isPoint(params.pub)) this._pub = params.pub;else this._pubBytes = parseBytes(params.pub);\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n if (pub instanceof KeyPair) return pub;\n return new KeyPair(eddsa, {\n pub: pub\n });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n if (secret instanceof KeyPair) return secret;\n return new KeyPair(eddsa, {\n secret: secret\n });\n};\n\nKeyPair.prototype.secret = function secret() {\n return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n return this.eddsa.encodePoint(this.pub());\n});\ncachedProperty(KeyPair, 'pub', function pub() {\n if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes);\n return this.eddsa.g.mul(this.priv());\n});\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n var eddsa = this.eddsa;\n var hash = this.hash();\n var lastIx = eddsa.encodingLength - 1;\n var a = hash.slice(0, eddsa.encodingLength);\n a[0] &= 248;\n a[lastIx] &= 127;\n a[lastIx] |= 64;\n return a;\n});\ncachedProperty(KeyPair, 'priv', function priv() {\n return this.eddsa.decodeInt(this.privBytes());\n});\ncachedProperty(KeyPair, 'hash', function hash() {\n return this.eddsa.hash().update(this.secret()).digest();\n});\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n assert(this._secret, 'KeyPair can only verify');\n return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n assert(this._secret, 'KeyPair is public only');\n return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc) {\n return utils.encode(this.pubBytes(), enc);\n};\n\nmodule.exports = KeyPair;\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/eddsa/key.js?"); /***/ }), /***/ "./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"; eval("\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/elliptic/lib/elliptic/utils.js\");\n\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array|Object} sig -\n* @param {Array|Point} [sig.R] - R point as Point or bytes\n* @param {Array|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array} [sig.Rencoded] - R point encoded\n* @param {Array} [sig.Sencoded] - S scalar encoded\n*/\n\nfunction Signature(eddsa, sig) {\n this.eddsa = eddsa;\n if (_typeof(sig) !== 'object') sig = parseBytes(sig);\n\n if (Array.isArray(sig)) {\n sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n };\n }\n\n assert(sig.R && sig.S, 'Signature without R or S');\n if (eddsa.isPoint(sig.R)) this._R = sig.R;\n if (sig.S instanceof BN) this._S = sig.S;\n this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n return this.eddsa.decodeInt(this.Sencoded());\n});\ncachedProperty(Signature, 'R', function R() {\n return this.eddsa.decodePoint(this.Rencoded());\n});\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n return this.eddsa.encodePoint(this.R());\n});\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/eddsa/signature.js?"); /***/ }), /***/ "./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js": /*!*********************************************************************!*\ !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = {\n doubles: {\n step: 4,\n 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']]\n },\n naf: {\n wnd: 7,\n 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']]\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = exports;\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar minAssert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ \"./node_modules/minimalistic-crypto-utils/lib/utils.js\");\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode; // Represent num in a w-NAF form\n\nfunction getNAF(num, w) {\n var naf = [];\n var ws = 1 << w + 1;\n var k = num.clone();\n\n while (k.cmpn(1) >= 0) {\n var z;\n\n if (k.isOdd()) {\n var mod = k.andln(ws - 1);\n if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;else z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf.push(z); // Optimization, shift by word if possible\n\n var shift = k.cmpn(0) !== 0 && k.andln(ws - 1) === 0 ? w + 1 : 1;\n\n for (var i = 1; i < shift; i++) {\n naf.push(0);\n }\n\n k.iushrn(shift);\n }\n\n return naf;\n}\n\nutils.getNAF = getNAF; // Represent k1, k2 in a Joint Sparse Form\n\nfunction getJSF(k1, k2) {\n var jsf = [[], []];\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n // First phase\n var m14 = k1.andln(3) + d1 & 3;\n var m24 = k2.andln(3) + d2 & 3;\n if (m14 === 3) m14 = -1;\n if (m24 === 3) m24 = -1;\n var u1;\n\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n var m8 = k1.andln(7) + d1 & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14;else u1 = m14;\n }\n\n jsf[0].push(u1);\n var u2;\n\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n var m8 = k2.andln(7) + d2 & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24;else u2 = m24;\n }\n\n jsf[1].push(u2); // Second phase\n\n if (2 * d1 === u1 + 1) d1 = 1 - d1;\n if (2 * d2 === u2 + 1) d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\n\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] : this[key] = computer.call(this);\n };\n}\n\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : bytes;\n}\n\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\n\nutils.intFromLE = intFromLE;\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/lib/elliptic/utils.js?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"_from\\\":\\\"elliptic@^6.0.0\\\",\\\"_id\\\":\\\"elliptic@6.5.1\\\",\\\"_inBundle\\\":false,\\\"_integrity\\\":\\\"sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==\\\",\\\"_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.5.1.tgz\\\",\\\"_shasum\\\":\\\"c380f5f909bf1b9b4428d028cd18d3b0efd6b52b\\\",\\\"_spec\\\":\\\"elliptic@^6.0.0\\\",\\\"_where\\\":\\\"C:\\\\\\\\Users\\\\\\\\painor\\\\\\\\IdeaProjects\\\\\\\\gramjs\\\\\\\\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\\\":\\\"^3.0.4\\\",\\\"grunt\\\":\\\"^1.0.4\\\",\\\"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\\\":\\\"^9.0.1\\\",\\\"istanbul\\\":\\\"^0.4.2\\\",\\\"jscs\\\":\\\"^3.0.7\\\",\\\"jshint\\\":\\\"^2.6.0\\\",\\\"mocha\\\":\\\"^6.1.4\\\"},\\\"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.5.1\\\"}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/elliptic/package.json?"); /***/ }), /***/ "./node_modules/events/events.js": /*!***************************************!*\ !*** ./node_modules/events/events.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar R = (typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === 'object' ? Reflect : null;\nvar ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n};\nvar ReflectOwnKeys;\n\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys;\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n};\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\n\nmodule.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\n\nvar defaultMaxListeners = 10;\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function get() {\n return defaultMaxListeners;\n },\n set: function set(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function () {\n if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n}; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\n\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var doError = type === 'error';\n var events = this._events;\n if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; // If there is no 'error' event listener then throw.\n\n if (doError) {\n var er;\n if (args.length > 0) er = args[0];\n\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n } // At least give some kind of context to the user\n\n\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n if (handler === undefined) return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n\n for (var i = 0; i < len; ++i) {\n ReflectApply(listeners[i], this, args);\n }\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + _typeof(listener));\n }\n\n events = target._events;\n\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n\n events = target._events;\n }\n\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n } // Check for listener leak\n\n\n m = $getMaxListeners(target);\n\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true; // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n\n var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener = function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n};\n\nfunction onceWrapper() {\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = {\n fired: false,\n wrapFn: undefined,\n target: target,\n type: type,\n listener: listener\n };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + _typeof(listener));\n }\n\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + _typeof(listener));\n }\n\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n}; // Emits a 'removeListener' event if and only if the listener was removed.\n\n\nEventEmitter.prototype.removeListener = function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + _typeof(listener));\n }\n\n events = this._events;\n if (events === undefined) return this;\n list = events[type];\n if (list === undefined) return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else {\n delete events[type];\n if (events.removeListener) this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n if (position === 0) list.shift();else {\n spliceOne(list, position);\n }\n if (list.length === 1) events[type] = list[0];\n if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {\n var listeners, events, i;\n events = this._events;\n if (events === undefined) return this; // not listening for removeListener, no need to emit\n\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type];\n }\n\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n};\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n if (events === undefined) return [];\n var evlistener = events[type];\n if (evlistener === undefined) return [];\n if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function (emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\n\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n\n for (var i = 0; i < n; ++i) {\n copy[i] = arr[i];\n }\n\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++) {\n list[index] = list[index + 1];\n }\n\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n\n return ret;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/events/events.js?"); /***/ }), /***/ "./node_modules/evp_bytestokey/index.js": /*!**********************************************!*\ !*** ./node_modules/evp_bytestokey/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\");\n/* eslint-disable camelcase */\n\n\nfunction EVP_BytesToKey(password, salt, keyBits, ivLen) {\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary');\n\n if (salt) {\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary');\n if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length');\n }\n\n var keyLen = keyBits / 8;\n var key = Buffer.alloc(keyLen);\n var iv = Buffer.alloc(ivLen || 0);\n var tmp = Buffer.alloc(0);\n\n while (keyLen > 0 || ivLen > 0) {\n var hash = new MD5();\n hash.update(tmp);\n hash.update(password);\n if (salt) hash.update(salt);\n tmp = hash.digest();\n var used = 0;\n\n if (keyLen > 0) {\n var keyStart = key.length - keyLen;\n used = Math.min(keyLen, tmp.length);\n tmp.copy(key, keyStart, 0, used);\n keyLen -= used;\n }\n\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen;\n var length = Math.min(ivLen, tmp.length - used);\n tmp.copy(iv, ivStart, used, used + length);\n ivLen -= length;\n }\n }\n\n tmp.fill(0);\n return {\n key: key,\n iv: iv\n };\n}\n\nmodule.exports = EVP_BytesToKey;\n\n//# sourceURL=webpack://gramjs/./node_modules/evp_bytestokey/index.js?"); /***/ }), /***/ "./node_modules/hash-base/index.js": /*!*****************************************!*\ !*** ./node_modules/hash-base/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform;\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction throwIfNotStringOrBuffer(val, prefix) {\n if (!Buffer.isBuffer(val) && typeof val !== 'string') {\n throw new TypeError(prefix + ' must be a string or a buffer');\n }\n}\n\nfunction HashBase(blockSize) {\n Transform.call(this);\n this._block = Buffer.allocUnsafe(blockSize);\n this._blockSize = blockSize;\n this._blockOffset = 0;\n this._length = [0, 0, 0, 0];\n this._finalized = false;\n}\n\ninherits(HashBase, Transform);\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n var error = null;\n\n try {\n this.update(chunk, encoding);\n } catch (err) {\n error = err;\n }\n\n callback(error);\n};\n\nHashBase.prototype._flush = function (callback) {\n var error = null;\n\n try {\n this.push(this.digest());\n } catch (err) {\n error = err;\n }\n\n callback(error);\n};\n\nHashBase.prototype.update = function (data, encoding) {\n throwIfNotStringOrBuffer(data, 'Data');\n if (this._finalized) throw new Error('Digest already called');\n if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding); // consume data\n\n var block = this._block;\n var offset = 0;\n\n while (this._blockOffset + data.length - offset >= this._blockSize) {\n for (var i = this._blockOffset; i < this._blockSize;) {\n block[i++] = data[offset++];\n }\n\n this._update();\n\n this._blockOffset = 0;\n }\n\n while (offset < data.length) {\n block[this._blockOffset++] = data[offset++];\n } // update length\n\n\n for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n this._length[j] += carry;\n carry = this._length[j] / 0x0100000000 | 0;\n if (carry > 0) this._length[j] -= 0x0100000000 * carry;\n }\n\n return this;\n};\n\nHashBase.prototype._update = function () {\n throw new Error('_update is not implemented');\n};\n\nHashBase.prototype.digest = function (encoding) {\n if (this._finalized) throw new Error('Digest already called');\n this._finalized = true;\n\n var digest = this._digest();\n\n if (encoding !== undefined) digest = digest.toString(encoding); // reset state\n\n this._block.fill(0);\n\n this._blockOffset = 0;\n\n for (var i = 0; i < 4; ++i) {\n this._length[i] = 0;\n }\n\n return digest;\n};\n\nHashBase.prototype._digest = function () {\n throw new Error('_digest is not implemented');\n};\n\nmodule.exports = HashBase;\n\n//# sourceURL=webpack://gramjs/./node_modules/hash-base/index.js?"); /***/ }), /***/ "./node_modules/hash.js/lib/hash.js": /*!******************************************!*\ !*** ./node_modules/hash.js/lib/hash.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var hash = exports;\nhash.utils = __webpack_require__(/*! ./hash/utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\nhash.common = __webpack_require__(/*! ./hash/common */ \"./node_modules/hash.js/lib/hash/common.js\");\nhash.sha = __webpack_require__(/*! ./hash/sha */ \"./node_modules/hash.js/lib/hash/sha.js\");\nhash.ripemd = __webpack_require__(/*! ./hash/ripemd */ \"./node_modules/hash.js/lib/hash/ripemd.js\");\nhash.hmac = __webpack_require__(/*! ./hash/hmac */ \"./node_modules/hash.js/lib/hash/hmac.js\"); // Proxy hash functions to the main object\n\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\n\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending) this.pending = msg;else this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length; // Enough data, try updating\n\n if (this.pending.length >= this._delta8) {\n msg = this.pending; // Process pending data in blocks\n\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0) this.pending = null;\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n\n for (var i = 0; i < msg.length; i += this._delta32) {\n this._update(msg, i, i + this._delta32);\n }\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - (len + this.padLength) % bytes;\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n\n for (var i = 1; i < k; i++) {\n res[i] = 0;\n } // Append length\n\n\n len <<= 3;\n\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++) {\n res[i++] = 0;\n }\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = len >>> 24 & 0xff;\n res[i++] = len >>> 16 & 0xff;\n res[i++] = len >>> 8 & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = len >>> 8 & 0xff;\n res[i++] = len >>> 16 & 0xff;\n res[i++] = len >>> 24 & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++) {\n res[i++] = 0;\n }\n }\n\n return res;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/common.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\n\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize) key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize); // Add padding to key\n\n for (var i = key.length; i < this.blockSize; i++) {\n key.push(0);\n }\n\n for (i = 0; i < key.length; i++) {\n key[i] ^= 0x36;\n }\n\n this.inner = new this.Hash().update(key); // 0x36 ^ 0x5c = 0x6a\n\n for (i = 0; i < key.length; i++) {\n key[i] ^= 0x6a;\n }\n\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/hmac.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar common = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/common.js\");\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160)) return new RIPEMD160();\n BlockHash.call(this);\n this.h = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n this.endian = 'little';\n}\n\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n\n for (var j = 0; j < 80; j++) {\n var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex') return utils.toHex32(this.h, 'little');else return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n 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);\n}\n\nfunction K(j) {\n 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;\n}\n\nfunction Kh(j) {\n 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;\n}\n\nvar 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];\nvar 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];\nvar 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];\nvar 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];\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/ripemd.js?"); /***/ }), /***/ "./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"; eval("\n\nexports.sha1 = __webpack_require__(/*! ./sha/1 */ \"./node_modules/hash.js/lib/hash/sha/1.js\");\nexports.sha224 = __webpack_require__(/*! ./sha/224 */ \"./node_modules/hash.js/lib/hash/sha/224.js\");\nexports.sha256 = __webpack_require__(/*! ./sha/256 */ \"./node_modules/hash.js/lib/hash/sha/256.js\");\nexports.sha384 = __webpack_require__(/*! ./sha/384 */ \"./node_modules/hash.js/lib/hash/sha/384.js\");\nexports.sha512 = __webpack_require__(/*! ./sha/512 */ \"./node_modules/hash.js/lib/hash/sha/512.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha.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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\n\nvar shaCommon = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/sha/common.js\");\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\nvar sha1_K = [0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6];\n\nfunction SHA1() {\n if (!(this instanceof SHA1)) return new SHA1();\n BlockHash.call(this);\n this.h = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++) {\n W[i] = msg[start + i];\n }\n\n for (; i < W.length; i++) {\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n }\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex') return utils.toHex32(this.h, 'big');else return utils.split32(this.h, 'big');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/1.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar SHA256 = __webpack_require__(/*! ./256 */ \"./node_modules/hash.js/lib/hash/sha/256.js\");\n\nfunction SHA224() {\n if (!(this instanceof SHA224)) return new SHA224();\n SHA256.call(this);\n this.h = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4];\n}\n\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex') return utils.toHex32(this.h.slice(0, 7), 'big');else return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/224.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\n\nvar shaCommon = __webpack_require__(/*! ./common */ \"./node_modules/hash.js/lib/hash/sha/common.js\");\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\nvar BlockHash = common.BlockHash;\nvar 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];\n\nfunction SHA256() {\n if (!(this instanceof SHA256)) return new SHA256();\n BlockHash.call(this);\n this.h = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];\n this.k = sha256_K;\n this.W = new Array(64);\n}\n\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++) {\n W[i] = msg[start + i];\n }\n\n for (; i < W.length; i++) {\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n }\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n assert(this.k.length === W.length);\n\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex') return utils.toHex32(this.h, 'big');else return utils.split32(this.h, 'big');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/256.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar SHA512 = __webpack_require__(/*! ./512 */ \"./node_modules/hash.js/lib/hash/sha/512.js\");\n\nfunction SHA384() {\n if (!(this instanceof SHA384)) return new SHA384();\n SHA512.call(this);\n this.h = [0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4];\n}\n\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex') return utils.toHex32(this.h.slice(0, 12), 'big');else return utils.split32(this.h.slice(0, 12), 'big');\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/384.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar common = __webpack_require__(/*! ../common */ \"./node_modules/hash.js/lib/hash/common.js\");\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\nvar BlockHash = common.BlockHash;\nvar 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];\n\nfunction SHA512() {\n if (!(this instanceof SHA512)) return new SHA512();\n BlockHash.call(this);\n this.h = [0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179];\n this.k = sha512_K;\n this.W = new Array(160);\n}\n\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W; // 32 x 32bit words\n\n for (var i = 0; i < 32; i++) {\n W[i] = msg[start + i];\n }\n\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n\n var c3_lo = W[i - 31];\n W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n assert(this.k.length === W.length);\n\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n 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);\n 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);\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n hh = gh;\n hl = gl;\n gh = fh;\n gl = fl;\n fh = eh;\n fl = el;\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n dh = ch;\n dl = cl;\n ch = bh;\n cl = bl;\n bh = ah;\n bl = al;\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex') return utils.toHex32(this.h, 'big');else return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ ~xh & zh;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ ~xl & zl;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = xh & yh ^ xh & zh ^ yh & zh;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = xl & yl ^ xl & zl ^ yl & zl;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n\n var c2_hi = shr64_hi(xh, xl, 6);\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n\n var c2_lo = shr64_lo(xh, xl, 6);\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0) r += 0x100000000;\n return r;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/512.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/hash.js/lib/hash/utils.js\");\n\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0) return ch32(x, y, z);\n if (s === 1 || s === 3) return p32(x, y, z);\n if (s === 2) return maj32(x, y, z);\n}\n\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return x & y ^ ~x & z;\n}\n\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return x & y ^ x & z ^ y & z;\n}\n\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\n\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\n\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\n\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;\n}\n\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;\n}\n\nexports.g1_256 = g1_256;\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/sha/common.js?"); /***/ }), /***/ "./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"; eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg)) return msg.slice();\n if (!msg) return [];\n var res = [];\n\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = c >> 6 | 192;\n res[p++] = c & 63 | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = c >> 18 | 240;\n res[p++] = c >> 12 & 63 | 128;\n res[p++] = c >> 6 & 63 | 128;\n res[p++] = c & 63 | 128;\n } else {\n res[p++] = c >> 12 | 224;\n res[p++] = c >> 6 & 63 | 128;\n res[p++] = c & 63 | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0) msg = '0' + msg;\n\n for (i = 0; i < msg.length; i += 2) {\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n }\n } else {\n for (i = 0; i < msg.length; i++) {\n res[i] = msg[i] | 0;\n }\n }\n\n return res;\n}\n\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n\n for (var i = 0; i < msg.length; i++) {\n res += zero2(msg[i].toString(16));\n }\n\n return res;\n}\n\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = w >>> 24 | w >>> 8 & 0xff00 | w << 8 & 0xff0000 | (w & 0xff) << 24;\n return res >>> 0;\n}\n\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little') w = htonl(w);\n res += zero8(w.toString(16));\n }\n\n return res;\n}\n\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1) return '0' + word;else return word;\n}\n\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n 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;\n}\n\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n 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];\n res[i] = w >>> 0;\n }\n\n return res;\n}\n\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = m >>> 16 & 0xff;\n res[k + 2] = m >>> 8 & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = m >>> 16 & 0xff;\n res[k + 1] = m >>> 8 & 0xff;\n res[k] = m & 0xff;\n }\n }\n\n return res;\n}\n\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return w >>> b | w << 32 - b;\n}\n\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return w << b | w >>> 32 - b;\n}\n\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return a + b >>> 0;\n}\n\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return a + b + c >>> 0;\n}\n\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return a + b + c + d >>> 0;\n}\n\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return a + b + c + d + e >>> 0;\n}\n\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n var lo = al + bl >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\n\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = al + bl >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\n\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\n\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = lo + bl >>> 0;\n carry += lo < al ? 1 : 0;\n lo = lo + cl >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = lo + dl >>> 0;\n carry += lo < dl ? 1 : 0;\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\n\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\n\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = lo + bl >>> 0;\n carry += lo < al ? 1 : 0;\n lo = lo + cl >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = lo + dl >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = lo + el >>> 0;\n carry += lo < el ? 1 : 0;\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\n\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n return lo >>> 0;\n}\n\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = al << 32 - num | ah >>> num;\n return r >>> 0;\n}\n\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n}\n\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\n\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = ah << 32 - num | al >>> num;\n return r >>> 0;\n}\n\nexports.shr64_lo = shr64_lo;\n\n//# sourceURL=webpack://gramjs/./node_modules/hash.js/lib/hash/utils.js?"); /***/ }), /***/ "./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"; eval("\n\nvar hash = __webpack_require__(/*! hash.js */ \"./node_modules/hash.js/lib/hash.js\");\n\nvar utils = __webpack_require__(/*! minimalistic-crypto-utils */ \"./node_modules/minimalistic-crypto-utils/lib/utils.js\");\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG)) return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= this.minEntropy / 8, 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._init(entropy, nonce, pers);\n}\n\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac().update(this.V).update([0x00]);\n\n if (seed) kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed) return;\n this.K = this._hmac().update(this.V).update([0x01]).update(seed).digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n assert(entropy.length >= this.minEntropy / 8, 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval) throw new Error('Reseed is required'); // Optional encoding\n\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n } // Optional additional data\n\n\n if (add) {\n add = utils.toArray(add, addEnc || 'hex');\n\n this._update(add);\n }\n\n var temp = [];\n\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n\n this._update(add);\n\n this._reseed++;\n return utils.encode(res, enc);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/hmac-drbg/lib/hmac-drbg.js?"); /***/ }), /***/ "./node_modules/ieee754/index.js": /*!***************************************!*\ !*** ./node_modules/ieee754/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n};\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/ieee754/index.js?"); /***/ }), /***/ "./node_modules/inherits/inherits_browser.js": /*!***************************************************!*\ !*** ./node_modules/inherits/inherits_browser.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n\n var TempCtor = function TempCtor() {};\n\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n };\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/inherits/inherits_browser.js?"); /***/ }), /***/ "./node_modules/isarray/index.js": /*!***************************************!*\ !*** ./node_modules/isarray/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/isarray/index.js?"); /***/ }), /***/ "./node_modules/long/src/long.js": /*!***************************************!*\ !*** ./node_modules/long/src/long.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = Long;\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\n\nvar wasm = null;\n\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports;\n} catch (e) {} // no wasm support :(\n\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\n\n\nfunction Long(low, high, unsigned) {\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\n this.low = low | 0;\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\n\n this.high = high | 0;\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\n\n this.unsigned = !!unsigned;\n} // The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\n\n\nLong.prototype.__isLong__;\nObject.defineProperty(Long.prototype, \"__isLong__\", {\n value: true\n});\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\n\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\n\n\nLong.isLong = isLong;\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\n\nvar INT_CACHE = {};\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\n\nvar UINT_CACHE = {};\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\n\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n\n if (unsigned) {\n value >>>= 0;\n\n if (cache = 0 <= value && value < 256) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj) return cachedObj;\n }\n\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache) UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n\n if (cache = -128 <= value && value < 128) {\n cachedObj = INT_CACHE[value];\n if (cachedObj) return cachedObj;\n }\n\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache) INT_CACHE[value] = obj;\n return obj;\n }\n}\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\n\n\nLong.fromInt = fromInt;\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\n\nfunction fromNumber(value, unsigned) {\n if (isNaN(value)) return unsigned ? UZERO : ZERO;\n\n if (unsigned) {\n if (value < 0) return UZERO;\n if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL) return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;\n }\n\n if (value < 0) return fromNumber(-value, unsigned).neg();\n return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned);\n}\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\n\n\nLong.fromNumber = fromNumber;\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\n\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\n\n\nLong.fromBits = fromBits;\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\n\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\n\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0) throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\") return ZERO;\n\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned, unsigned = false;\n } else {\n unsigned = !!unsigned;\n }\n\n radix = radix || 10;\n if (radix < 2 || 36 < radix) throw RangeError('radix');\n var p;\n if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen');else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n } // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n var result = ZERO;\n\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n\n result.unsigned = unsigned;\n return result;\n}\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\n\n\nLong.fromString = fromString;\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\n\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number') return fromNumber(val, unsigned);\n if (typeof val === 'string') return fromString(val, unsigned); // Throws for non-objects, converts non-instanceof Long:\n\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\n\n\nLong.fromValue = fromValue; // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_16_DBL = 1 << 16;\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_24_DBL = 1 << 24;\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\n\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar ZERO = fromInt(0);\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\n\nLong.ZERO = ZERO;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar UZERO = fromInt(0, true);\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\n\nLong.UZERO = UZERO;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar ONE = fromInt(1);\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\n\nLong.ONE = ONE;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar UONE = fromInt(1, true);\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\n\nLong.UONE = UONE;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar NEG_ONE = fromInt(-1);\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\n\nLong.NEG_ONE = NEG_ONE;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\n\nLong.MAX_VALUE = MAX_VALUE;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\n\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\n\nvar MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\n\nLong.MIN_VALUE = MIN_VALUE;\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\n\nvar LongPrototype = Long.prototype;\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\n\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\n\n\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\n\n\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix) throw RangeError('radix');\n if (this.isZero()) return '0';\n\n if (this.isNegative()) {\n // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else return '-' + this.neg().toString(radix);\n } // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n\n\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero()) return digits + result;else {\n while (digits.length < 6) {\n digits = '0' + digits;\n }\n\n result = '' + digits + result;\n }\n }\n};\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\n\n\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\n\n\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\n\n\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\n\n\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\n\n\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n\n for (var bit = 31; bit > 0; bit--) {\n if ((val & 1 << bit) != 0) break;\n }\n\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.eqz = LongPrototype.isZero;\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\n\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.equals = function equals(other) {\n if (!isLong(other)) other = fromValue(other);\n if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false;\n return this.high === other.high && this.low === other.low;\n};\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.eq = LongPrototype.equals;\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(\n /* validates */\n other);\n};\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.neq = LongPrototype.notEquals;\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.ne = LongPrototype.notEquals;\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(\n /* validates */\n other) < 0;\n};\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.lt = LongPrototype.lessThan;\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(\n /* validates */\n other) <= 0;\n};\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(\n /* validates */\n other) > 0;\n};\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.gt = LongPrototype.greaterThan;\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(\n /* validates */\n other) >= 0;\n};\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\n\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\n\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\n\nLongPrototype.compare = function compare(other) {\n if (!isLong(other)) other = fromValue(other);\n if (this.eq(other)) return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) return -1;\n if (!thisNeg && otherNeg) return 1; // At this point the sign bits are the same\n\n if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; // Both are positive if at least one is unsigned\n\n return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1;\n};\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\n\n\nLongPrototype.comp = LongPrototype.compare;\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\n\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE;\n return this.not().add(ONE);\n};\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\n\n\nLongPrototype.neg = LongPrototype.negate;\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\n\nLongPrototype.add = function add(addend) {\n if (!isLong(addend)) addend = fromValue(addend); // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n var c48 = 0,\n c32 = 0,\n c16 = 0,\n c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);\n};\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\n\n\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\n\n\nLongPrototype.sub = LongPrototype.subtract;\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\n\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero()) return ZERO;\n if (!isLong(multiplier)) multiplier = fromValue(multiplier); // use wasm support if present\n\n if (wasm) {\n var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high);\n return fromBits(low, wasm.get_high(), this.unsigned);\n }\n\n if (multiplier.isZero()) return ZERO;\n if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative()) return this.neg().mul(multiplier.neg());else return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); // If both longs are small, use float multiplication\n\n\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n var c48 = 0,\n c32 = 0,\n c16 = 0,\n c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);\n};\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\n\n\nLongPrototype.mul = LongPrototype.multiply;\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\n\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor)) divisor = fromValue(divisor);\n if (divisor.isZero()) throw Error('division by zero'); // use wasm support if present\n\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned && this.high === -0x80000000 && divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), this.unsigned);\n }\n\n if (this.isZero()) return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE)) return ONE;else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO;\n\n if (this.isNegative()) {\n if (divisor.isNegative()) return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative()) return this.div(divisor.neg()).neg();\n\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned) divisor = divisor.toUnsigned();\n if (divisor.gt(this)) return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n } // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n\n\n rem = this;\n\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48),\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n } // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n\n\n if (approxRes.isZero()) approxRes = ONE;\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n\n return res;\n};\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\n\n\nLongPrototype.div = LongPrototype.divide;\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\n\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor)) divisor = fromValue(divisor); // use wasm support if present\n\n if (wasm) {\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\n\n\nLongPrototype.mod = LongPrototype.modulo;\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\n\nLongPrototype.rem = LongPrototype.modulo;\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\n\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\n\n\nLongPrototype.and = function and(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\n\n\nLongPrototype.or = function or(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\n\n\nLongPrototype.xor = function xor(other) {\n if (!isLong(other)) other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\n\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);else return fromBits(0, this.low << numBits - 32, this.unsigned);\n};\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\n\nLongPrototype.shl = LongPrototype.shiftLeft;\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned);\n};\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\n\nLongPrototype.shr = LongPrototype.shiftRight;\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n numBits &= 63;\n if (numBits === 0) return this;else {\n var high = this.high;\n\n if (numBits < 32) {\n var low = this.low;\n return fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned);\n } else if (numBits === 32) return fromBits(high, 0, this.unsigned);else return fromBits(high >>> numBits - 32, 0, this.unsigned);\n }\n};\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\n\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\n\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\n\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned) return this;\n return fromBits(this.low, this.high, false);\n};\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\n\n\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned) return this;\n return fromBits(this.low, this.high, true);\n};\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\n\n\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\n\n\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [lo & 0xff, lo >>> 8 & 0xff, lo >>> 16 & 0xff, lo >>> 24, hi & 0xff, hi >>> 8 & 0xff, hi >>> 16 & 0xff, hi >>> 24];\n};\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\n\n\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [hi >>> 24, hi >>> 16 & 0xff, hi >>> 8 & 0xff, hi & 0xff, lo >>> 24, lo >>> 16 & 0xff, lo >>> 8 & 0xff, lo & 0xff];\n};\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\n\n\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\n\n\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned);\n};\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\n\n\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/long/src/long.js?"); /***/ }), /***/ "./node_modules/md5.js/index.js": /*!**************************************!*\ !*** ./node_modules/md5.js/index.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar HashBase = __webpack_require__(/*! hash-base */ \"./node_modules/hash-base/index.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar ARRAY16 = new Array(16);\n\nfunction MD5() {\n HashBase.call(this, 64); // state\n\n this._a = 0x67452301;\n this._b = 0xefcdab89;\n this._c = 0x98badcfe;\n this._d = 0x10325476;\n}\n\ninherits(MD5, HashBase);\n\nMD5.prototype._update = function () {\n var M = ARRAY16;\n\n for (var i = 0; i < 16; ++i) {\n M[i] = this._block.readInt32LE(i * 4);\n }\n\n var a = this._a;\n var b = this._b;\n var c = this._c;\n var d = this._d;\n a = fnF(a, b, c, d, M[0], 0xd76aa478, 7);\n d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12);\n c = fnF(c, d, a, b, M[2], 0x242070db, 17);\n b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22);\n a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7);\n d = fnF(d, a, b, c, M[5], 0x4787c62a, 12);\n c = fnF(c, d, a, b, M[6], 0xa8304613, 17);\n b = fnF(b, c, d, a, M[7], 0xfd469501, 22);\n a = fnF(a, b, c, d, M[8], 0x698098d8, 7);\n d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12);\n c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17);\n b = fnF(b, c, d, a, M[11], 0x895cd7be, 22);\n a = fnF(a, b, c, d, M[12], 0x6b901122, 7);\n d = fnF(d, a, b, c, M[13], 0xfd987193, 12);\n c = fnF(c, d, a, b, M[14], 0xa679438e, 17);\n b = fnF(b, c, d, a, M[15], 0x49b40821, 22);\n a = fnG(a, b, c, d, M[1], 0xf61e2562, 5);\n d = fnG(d, a, b, c, M[6], 0xc040b340, 9);\n c = fnG(c, d, a, b, M[11], 0x265e5a51, 14);\n b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20);\n a = fnG(a, b, c, d, M[5], 0xd62f105d, 5);\n d = fnG(d, a, b, c, M[10], 0x02441453, 9);\n c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14);\n b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20);\n a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5);\n d = fnG(d, a, b, c, M[14], 0xc33707d6, 9);\n c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14);\n b = fnG(b, c, d, a, M[8], 0x455a14ed, 20);\n a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5);\n d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9);\n c = fnG(c, d, a, b, M[7], 0x676f02d9, 14);\n b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20);\n a = fnH(a, b, c, d, M[5], 0xfffa3942, 4);\n d = fnH(d, a, b, c, M[8], 0x8771f681, 11);\n c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16);\n b = fnH(b, c, d, a, M[14], 0xfde5380c, 23);\n a = fnH(a, b, c, d, M[1], 0xa4beea44, 4);\n d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11);\n c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16);\n b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23);\n a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4);\n d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11);\n c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16);\n b = fnH(b, c, d, a, M[6], 0x04881d05, 23);\n a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4);\n d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11);\n c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16);\n b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23);\n a = fnI(a, b, c, d, M[0], 0xf4292244, 6);\n d = fnI(d, a, b, c, M[7], 0x432aff97, 10);\n c = fnI(c, d, a, b, M[14], 0xab9423a7, 15);\n b = fnI(b, c, d, a, M[5], 0xfc93a039, 21);\n a = fnI(a, b, c, d, M[12], 0x655b59c3, 6);\n d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10);\n c = fnI(c, d, a, b, M[10], 0xffeff47d, 15);\n b = fnI(b, c, d, a, M[1], 0x85845dd1, 21);\n a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6);\n d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10);\n c = fnI(c, d, a, b, M[6], 0xa3014314, 15);\n b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21);\n a = fnI(a, b, c, d, M[4], 0xf7537e82, 6);\n d = fnI(d, a, b, c, M[11], 0xbd3af235, 10);\n c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15);\n b = fnI(b, c, d, a, M[9], 0xeb86d391, 21);\n this._a = this._a + a | 0;\n this._b = this._b + b | 0;\n this._c = this._c + c | 0;\n this._d = this._d + d | 0;\n};\n\nMD5.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80;\n\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64);\n\n this._update();\n\n this._blockOffset = 0;\n }\n\n this._block.fill(0, this._blockOffset, 56);\n\n this._block.writeUInt32LE(this._length[0], 56);\n\n this._block.writeUInt32LE(this._length[1], 60);\n\n this._update(); // produce result\n\n\n var buffer = Buffer.allocUnsafe(16);\n buffer.writeInt32LE(this._a, 0);\n buffer.writeInt32LE(this._b, 4);\n buffer.writeInt32LE(this._c, 8);\n buffer.writeInt32LE(this._d, 12);\n return buffer;\n};\n\nfunction rotl(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction fnF(a, b, c, d, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;\n}\n\nfunction fnG(a, b, c, d, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;\n}\n\nfunction fnH(a, b, c, d, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;\n}\n\nfunction fnI(a, b, c, d, m, k, s) {\n return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;\n}\n\nmodule.exports = MD5;\n\n//# sourceURL=webpack://gramjs/./node_modules/md5.js/index.js?"); /***/ }), /***/ "./node_modules/miller-rabin/lib/mr.js": /*!*********************************************!*\ !*** ./node_modules/miller-rabin/lib/mr.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var bn = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar brorand = __webpack_require__(/*! brorand */ \"./node_modules/brorand/index.js\");\n\nfunction MillerRabin(rand) {\n this.rand = rand || new brorand.Rand();\n}\n\nmodule.exports = MillerRabin;\n\nMillerRabin.create = function create(rand) {\n return new MillerRabin(rand);\n};\n\nMillerRabin.prototype._randbelow = function _randbelow(n) {\n var len = n.bitLength();\n var min_bytes = Math.ceil(len / 8); // Generage random bytes until a number less than n is found.\n // This ensures that 0..n-1 have an equal probability of being selected.\n\n do {\n var a = new bn(this.rand.generate(min_bytes));\n } while (a.cmp(n) >= 0);\n\n return a;\n};\n\nMillerRabin.prototype._randrange = function _randrange(start, stop) {\n // Generate a random number greater than or equal to start and less than stop.\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n};\n\nMillerRabin.prototype.test = function test(n, k, cb) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n if (!k) k = Math.max(1, len / 48 | 0); // Find d and s, (n - 1) = (2 ^ s) * d;\n\n var n1 = n.subn(1);\n\n for (var s = 0; !n1.testn(s); s++) {}\n\n var d = n.shrn(s);\n var rn1 = n1.toRed(red);\n var prime = true;\n\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n\n if (cb) cb(a);\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n if (x.cmp(rone) === 0) return false;\n if (x.cmp(rn1) === 0) break;\n }\n\n if (i === s) return false;\n }\n\n return prime;\n};\n\nMillerRabin.prototype.getDivisor = function getDivisor(n, k) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n if (!k) k = Math.max(1, len / 48 | 0); // Find d and s, (n - 1) = (2 ^ s) * d;\n\n var n1 = n.subn(1);\n\n for (var s = 0; !n1.testn(s); s++) {}\n\n var d = n.shrn(s);\n var rn1 = n1.toRed(red);\n\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n\n var g = n.gcd(a);\n if (g.cmpn(1) !== 0) return g;\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0) break;\n }\n\n if (i === s) {\n x = x.redSqr();\n return x.fromRed().subn(1).gcd(n);\n }\n }\n\n return false;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/miller-rabin/lib/mr.js?"); /***/ }), /***/ "./node_modules/minimalistic-assert/index.js": /*!***************************************************!*\ !*** ./node_modules/minimalistic-assert/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r) throw new Error(msg || 'Assertion failed: ' + l + ' != ' + r);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/minimalistic-assert/index.js?"); /***/ }), /***/ "./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"; eval("\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg)) return msg.slice();\n if (!msg) return [];\n var res = [];\n\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++) {\n res[i] = msg[i] | 0;\n }\n\n return res;\n }\n\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0) msg = '0' + msg;\n\n for (var i = 0; i < msg.length; i += 2) {\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi) res.push(hi, lo);else res.push(lo);\n }\n }\n\n return res;\n}\n\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1) return '0' + word;else return word;\n}\n\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n\n for (var i = 0; i < msg.length; i++) {\n res += zero2(msg[i].toString(16));\n }\n\n return res;\n}\n\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex') return toHex(arr);else return arr;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/minimalistic-crypto-utils/lib/utils.js?"); /***/ }), /***/ "./node_modules/node-gzip/dist/index.js": /*!**********************************************!*\ !*** ./node_modules/node-gzip/dist/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar zlib = __webpack_require__(/*! zlib */ \"./node_modules/browserify-zlib/lib/index.js\");\n\nmodule.exports = {\n gzip: function gzip(input, options) {\n var promise = new Promise(function (resolve, reject) {\n zlib.gzip(input, options, function (error, result) {\n if (!error) resolve(result);else reject(Error(error));\n });\n });\n return promise;\n },\n ungzip: function ungzip(input, options) {\n var promise = new Promise(function (resolve, reject) {\n zlib.gunzip(input, options, function (error, result) {\n if (!error) resolve(result);else reject(Error(error));\n });\n });\n return promise;\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-gzip/dist/index.js?"); /***/ }), /***/ "./node_modules/node-libs-browser/node_modules/buffer/index.js": /*!*********************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/buffer/index.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n/* eslint-disable no-proto */\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\");\n\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\");\n\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n\nexports.Buffer = Buffer;\nexports.SlowBuffer = SlowBuffer;\nexports.INSPECT_MAX_BYTES = 50;\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\n\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();\n/*\n * Export kMaxLength after typed array support is determined.\n */\n\nexports.kMaxLength = kMaxLength();\n\nfunction typedArraySupport() {\n try {\n var arr = new Uint8Array(1);\n arr.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function foo() {\n return 42;\n }\n };\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`\n } catch (e) {\n return false;\n }\n}\n\nfunction kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;\n}\n\nfunction createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length');\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length);\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length);\n }\n\n that.length = length;\n }\n\n return that;\n}\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\nfunction Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n}\n\nBuffer.poolSize = 8192; // not used by this implementation\n// TODO: Legacy, not needed anymore. Remove in next major version.\n\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype;\n return arr;\n};\n\nfunction from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number');\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length);\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset);\n }\n\n return fromObject(that, value);\n}\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length);\n};\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype;\n Buffer.__proto__ = Uint8Array;\n\n if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n });\n }\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number');\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative');\n }\n}\n\nfunction alloc(that, size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(that, size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);\n }\n\n return createBuffer(that, size);\n}\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding);\n};\n\nfunction allocUnsafe(that, size) {\n assertSize(size);\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0;\n }\n }\n\n return that;\n}\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size);\n};\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size);\n};\n\nfunction fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding');\n }\n\n var length = byteLength(string, encoding) | 0;\n that = createBuffer(that, length);\n var actual = that.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual);\n }\n\n return that;\n}\n\nfunction fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0;\n that = createBuffer(that, length);\n\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255;\n }\n\n return that;\n}\n\nfunction fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength; // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds');\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds');\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array);\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset);\n } else {\n array = new Uint8Array(array, byteOffset, length);\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array;\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array);\n }\n\n return that;\n}\n\nfunction fromObject(that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0;\n that = createBuffer(that, len);\n\n if (that.length === 0) {\n return that;\n }\n\n obj.copy(that, 0, 0, len);\n return that;\n }\n\n if (obj) {\n if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0);\n }\n\n return fromArrayLike(that, obj);\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data);\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');\n}\n\nfunction checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');\n }\n\n return length | 0;\n}\n\nfunction SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n}\n\nBuffer.isBuffer = function isBuffer(b) {\n return !!(b != null && b._isBuffer);\n};\n\nBuffer.compare = function compare(a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers');\n }\n\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n};\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true;\n\n default:\n return false;\n }\n};\n\nBuffer.concat = function concat(list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n var i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n var buffer = Buffer.allocUnsafe(length);\n var pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n var buf = list[i];\n\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n buf.copy(buffer, pos);\n pos += buf.length;\n }\n\n return buffer;\n};\n\nfunction byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== 'string') {\n string = '' + string;\n }\n\n var len = string.length;\n if (len === 0) return 0; // Use a for loop to avoid recursion\n\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len;\n\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length;\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2;\n\n case 'hex':\n return len >>> 1;\n\n case 'base64':\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) return utf8ToBytes(string).length; // assume utf8\n\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n}\n\nBuffer.byteLength = byteLength;\n\nfunction slowToString(encoding, start, end) {\n var loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return '';\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return '';\n } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return '';\n }\n\n if (!encoding) encoding = 'utf8';\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end);\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end);\n\n case 'ascii':\n return asciiSlice(this, start, end);\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end);\n\n case 'base64':\n return base64Slice(this, start, end);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n} // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\n\n\nBuffer.prototype._isBuffer = true;\n\nfunction swap(b, n, m) {\n var i = b[n];\n b[n] = b[m];\n b[m] = i;\n}\n\nBuffer.prototype.swap16 = function swap16() {\n var len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits');\n }\n\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n};\n\nBuffer.prototype.swap32 = function swap32() {\n var len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits');\n }\n\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n};\n\nBuffer.prototype.swap64 = function swap64() {\n var len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits');\n }\n\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n};\n\nBuffer.prototype.toString = function toString() {\n var length = this.length | 0;\n if (length === 0) return '';\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n};\n\nBuffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n};\n\nBuffer.prototype.inspect = function inspect() {\n var str = '';\n var max = exports.INSPECT_MAX_BYTES;\n\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');\n if (this.length > max) str += ' ... ';\n }\n\n return '';\n};\n\nBuffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer');\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index');\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n var x = thisEnd - thisStart;\n var y = end - start;\n var len = Math.min(x, y);\n var thisCopy = this.slice(thisStart, thisEnd);\n var targetCopy = target.slice(start, end);\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\n\n\nfunction bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}\n\nfunction arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1;\n var arrLength = arr.length;\n var valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n var i;\n\n if (dir) {\n var foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n var found = true;\n\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n}\n\nBuffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n};\n\nBuffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n};\n\nBuffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n};\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n var remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n } // must be an even number of digits\n\n\n var strLen = string.length;\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16);\n if (isNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n}\n\nfunction latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length);\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0;\n\n if (isFinite(length)) {\n length = length | 0;\n if (encoding === undefined) encoding = 'utf8';\n } else {\n encoding = length;\n length = undefined;\n } // legacy write(string, encoding, offset, length) - remove in v0.13\n\n } else {\n throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');\n }\n\n var remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds');\n }\n\n if (!encoding) encoding = 'utf8';\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length);\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length);\n\n case 'ascii':\n return asciiWrite(this, string, offset, length);\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length);\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n};\n\nBuffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n};\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n}\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n var res = [];\n var i = start;\n\n while (i < end) {\n var firstByte = buf[i];\n var codePoint = null;\n var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;\n\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;\n\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;\n\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD;\n bytesPerSequence = 1;\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(codePoint >>> 10 & 0x3FF | 0xD800);\n codePoint = 0xDC00 | codePoint & 0x3FF;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n} // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\n\n\nvar MAX_ARGUMENTS_LENGTH = 0x1000;\n\nfunction decodeCodePointsArray(codePoints) {\n var len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n var res = '';\n var i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n}\n\nfunction asciiSlice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F);\n }\n\n return ret;\n}\n\nfunction latin1Slice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n}\n\nfunction hexSlice(buf, start, end) {\n var len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n var out = '';\n\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i]);\n }\n\n return out;\n}\n\nfunction utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end);\n var res = '';\n\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n}\n\nBuffer.prototype.slice = function slice(start, end) {\n var len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n var newBuf;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end);\n newBuf.__proto__ = Buffer.prototype;\n } else {\n var sliceLen = end - start;\n newBuf = new Buffer(sliceLen, undefined);\n\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start];\n }\n }\n\n return newBuf;\n};\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\nfunction checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n var val = this[offset + --byteLength];\n var mul = 1;\n\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n};\n\nBuffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n};\n\nBuffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n};\n\nBuffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;\n};\n\nBuffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n};\n\nBuffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var i = byteLength;\n var mul = 1;\n var val = this[offset + --i];\n\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 0x80)) return this[offset];\n return (0xff - this[offset] + 1) * -1;\n};\n\nBuffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset] | this[offset + 1] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset + 1] | this[offset] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n};\n\nBuffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n};\n\nBuffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n};\n\nBuffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n};\n\nBuffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n};\n\nBuffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n};\n\nfunction checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds');\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var mul = 1;\n var i = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nfunction objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nfunction objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = 0;\n var mul = 1;\n var sub = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n var sub = 0;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n if (value < 0) value = 0xff + value + 1;\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nBuffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (value < 0) value = 0xffffffff + value + 1;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nfunction checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n if (offset < 0) throw new RangeError('Index out of range');\n}\n\nfunction writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n};\n\nfunction writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n}; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\nBuffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds');\n }\n\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');\n if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n var len = end - start;\n var i;\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start];\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start];\n }\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);\n }\n\n return len;\n}; // Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\n\n\nBuffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === 'string') {\n encoding = end;\n end = this.length;\n }\n\n if (val.length === 1) {\n var code = val.charCodeAt(0);\n\n if (code < 256) {\n val = code;\n }\n }\n\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string');\n }\n\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n } else if (typeof val === 'number') {\n val = val & 255;\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index');\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n var i;\n\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());\n var len = bytes.length;\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n}; // HELPER FUNCTIONS\n// ================\n\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g;\n\nfunction base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n\n return str;\n}\n\nfunction stringtrim(str) {\n if (str.trim) return str.trim();\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n\nfunction toHex(n) {\n if (n < 16) return '0' + n.toString(16);\n return n.toString(16);\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity;\n var codePoint;\n var length = string.length;\n var leadSurrogate = null;\n var bytes = [];\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else {\n throw new Error('Invalid code point');\n }\n }\n\n return bytes;\n}\n\nfunction asciiToBytes(str) {\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF);\n }\n\n return byteArray;\n}\n\nfunction utf16leToBytes(str, units) {\n var c, hi, lo;\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n}\n\nfunction base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n}\n\nfunction isnan(val) {\n return val !== val; // eslint-disable-line no-self-compare\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-libs-browser/node_modules/buffer/index.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/NodeRSA.js": /*!**********************************************!*\ !*** ./node_modules/node-rsa/src/NodeRSA.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*!\n * RSA library for Node.js\n *\n * Author: rzcoder\n * License MIT\n */\nvar constants = __webpack_require__(/*! constants */ \"./node_modules/constants-browserify/constants.json\");\n\nvar rsa = __webpack_require__(/*! ./libs/rsa.js */ \"./node_modules/node-rsa/src/libs/rsa.js\");\n\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar ber = __webpack_require__(/*! asn1 */ \"./node_modules/asn1/lib/index.js\").Ber;\n\nvar _ = __webpack_require__(/*! ./utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/node-rsa/src/utils.js\");\n\nvar schemes = __webpack_require__(/*! ./schemes/schemes.js */ \"./node_modules/node-rsa/src/schemes/schemes.js\");\n\nvar formats = __webpack_require__(/*! ./formats/formats.js */ \"./node_modules/node-rsa/src/formats/formats.js\");\n\nif (typeof constants.RSA_NO_PADDING === \"undefined\") {\n //patch for node v0.10.x, constants do not defined\n constants.RSA_NO_PADDING = 3;\n}\n\nmodule.exports = function () {\n var SUPPORTED_HASH_ALGORITHMS = {\n node10: ['md4', 'md5', 'ripemd160', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'],\n node: ['md4', 'md5', 'ripemd160', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'],\n iojs: ['md4', 'md5', 'ripemd160', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'],\n browser: ['md5', 'ripemd160', 'sha1', 'sha256', 'sha512']\n };\n var DEFAULT_ENCRYPTION_SCHEME = 'pkcs1_oaep';\n var DEFAULT_SIGNING_SCHEME = 'pkcs1';\n var DEFAULT_EXPORT_FORMAT = 'private';\n var EXPORT_FORMAT_ALIASES = {\n 'private': 'pkcs1-private-pem',\n 'private-der': 'pkcs1-private-der',\n 'public': 'pkcs8-public-pem',\n 'public-der': 'pkcs8-public-der'\n };\n /**\n * @param key {string|buffer|object} Key in PEM format, or data for generate key {b: bits, e: exponent}\n * @constructor\n */\n\n function NodeRSA(key, format, options) {\n if (!(this instanceof NodeRSA)) {\n return new NodeRSA(key, format, options);\n }\n\n if (_.isObject(format)) {\n options = format;\n format = undefined;\n }\n\n this.$options = {\n signingScheme: DEFAULT_SIGNING_SCHEME,\n signingSchemeOptions: {\n hash: 'sha256',\n saltLength: null\n },\n encryptionScheme: DEFAULT_ENCRYPTION_SCHEME,\n encryptionSchemeOptions: {\n hash: 'sha1',\n label: null\n },\n environment: utils.detectEnvironment(),\n rsaUtils: this\n };\n this.keyPair = new rsa.Key();\n this.$cache = {};\n\n if (Buffer.isBuffer(key) || _.isString(key)) {\n this.importKey(key, format);\n } else if (_.isObject(key)) {\n this.generateKeyPair(key.b, key.e);\n }\n\n this.setOptions(options);\n }\n /**\n * Set and validate options for key instance\n * @param options\n */\n\n\n NodeRSA.prototype.setOptions = function (options) {\n options = options || {};\n\n if (options.environment) {\n this.$options.environment = options.environment;\n }\n\n if (options.signingScheme) {\n if (_.isString(options.signingScheme)) {\n var signingScheme = options.signingScheme.toLowerCase().split('-');\n\n if (signingScheme.length == 1) {\n if (SUPPORTED_HASH_ALGORITHMS.node.indexOf(signingScheme[0]) > -1) {\n this.$options.signingSchemeOptions = {\n hash: signingScheme[0]\n };\n this.$options.signingScheme = DEFAULT_SIGNING_SCHEME;\n } else {\n this.$options.signingScheme = signingScheme[0];\n this.$options.signingSchemeOptions = {\n hash: null\n };\n }\n } else {\n this.$options.signingSchemeOptions = {\n hash: signingScheme[1]\n };\n this.$options.signingScheme = signingScheme[0];\n }\n } else if (_.isObject(options.signingScheme)) {\n this.$options.signingScheme = options.signingScheme.scheme || DEFAULT_SIGNING_SCHEME;\n this.$options.signingSchemeOptions = _.omit(options.signingScheme, 'scheme');\n }\n\n if (!schemes.isSignature(this.$options.signingScheme)) {\n throw Error('Unsupported signing scheme');\n }\n\n if (this.$options.signingSchemeOptions.hash && SUPPORTED_HASH_ALGORITHMS[this.$options.environment].indexOf(this.$options.signingSchemeOptions.hash) === -1) {\n throw Error('Unsupported hashing algorithm for ' + this.$options.environment + ' environment');\n }\n }\n\n if (options.encryptionScheme) {\n if (_.isString(options.encryptionScheme)) {\n this.$options.encryptionScheme = options.encryptionScheme.toLowerCase();\n this.$options.encryptionSchemeOptions = {};\n } else if (_.isObject(options.encryptionScheme)) {\n this.$options.encryptionScheme = options.encryptionScheme.scheme || DEFAULT_ENCRYPTION_SCHEME;\n this.$options.encryptionSchemeOptions = _.omit(options.encryptionScheme, 'scheme');\n }\n\n if (!schemes.isEncryption(this.$options.encryptionScheme)) {\n throw Error('Unsupported encryption scheme');\n }\n\n if (this.$options.encryptionSchemeOptions.hash && SUPPORTED_HASH_ALGORITHMS[this.$options.environment].indexOf(this.$options.encryptionSchemeOptions.hash) === -1) {\n throw Error('Unsupported hashing algorithm for ' + this.$options.environment + ' environment');\n }\n }\n\n this.keyPair.setOptions(this.$options);\n };\n /**\n * Generate private/public keys pair\n *\n * @param bits {int} length key in bits. Default 2048.\n * @param exp {int} public exponent. Default 65537.\n * @returns {NodeRSA}\n */\n\n\n NodeRSA.prototype.generateKeyPair = function (bits, exp) {\n bits = bits || 2048;\n exp = exp || 65537;\n\n if (bits % 8 !== 0) {\n throw Error('Key size must be a multiple of 8.');\n }\n\n this.keyPair.generate(bits, exp.toString(16));\n this.$cache = {};\n return this;\n };\n /**\n * Importing key\n * @param keyData {string|buffer|Object}\n * @param format {string}\n */\n\n\n NodeRSA.prototype.importKey = function (keyData, format) {\n if (!keyData) {\n throw Error(\"Empty key given\");\n }\n\n if (format) {\n format = EXPORT_FORMAT_ALIASES[format] || format;\n }\n\n if (!formats.detectAndImport(this.keyPair, keyData, format) && format === undefined) {\n throw Error(\"Key format must be specified\");\n }\n\n this.$cache = {};\n return this;\n };\n /**\n * Exporting key\n * @param [format] {string}\n */\n\n\n NodeRSA.prototype.exportKey = function (format) {\n format = format || DEFAULT_EXPORT_FORMAT;\n format = EXPORT_FORMAT_ALIASES[format] || format;\n\n if (!this.$cache[format]) {\n this.$cache[format] = formats.detectAndExport(this.keyPair, format);\n }\n\n return this.$cache[format];\n };\n /**\n * Check if key pair contains private key\n */\n\n\n NodeRSA.prototype.isPrivate = function () {\n return this.keyPair.isPrivate();\n };\n /**\n * Check if key pair contains public key\n * @param [strict] {boolean} - public key only, return false if have private exponent\n */\n\n\n NodeRSA.prototype.isPublic = function (strict) {\n return this.keyPair.isPublic(strict);\n };\n /**\n * Check if key pair doesn't contains any data\n */\n\n\n NodeRSA.prototype.isEmpty = function (strict) {\n return !(this.keyPair.n || this.keyPair.e || this.keyPair.d);\n };\n /**\n * Encrypting data method with public key\n *\n * @param buffer {string|number|object|array|Buffer} - data for encrypting. Object and array will convert to JSON string.\n * @param encoding {string} - optional. Encoding for output result, may be 'buffer', 'binary', 'hex' or 'base64'. Default 'buffer'.\n * @param source_encoding {string} - optional. Encoding for given string. Default utf8.\n * @returns {string|Buffer}\n */\n\n\n NodeRSA.prototype.encrypt = function (buffer, encoding, source_encoding) {\n return this.$$encryptKey(false, buffer, encoding, source_encoding);\n };\n /**\n * Decrypting data method with private key\n *\n * @param buffer {Buffer} - buffer for decrypting\n * @param encoding - encoding for result string, can also take 'json' or 'buffer' for the automatic conversion of this type\n * @returns {Buffer|object|string}\n */\n\n\n NodeRSA.prototype.decrypt = function (buffer, encoding) {\n return this.$$decryptKey(false, buffer, encoding);\n };\n /**\n * Encrypting data method with private key\n *\n * Parameters same as `encrypt` method\n */\n\n\n NodeRSA.prototype.encryptPrivate = function (buffer, encoding, source_encoding) {\n return this.$$encryptKey(true, buffer, encoding, source_encoding);\n };\n /**\n * Decrypting data method with public key\n *\n * Parameters same as `decrypt` method\n */\n\n\n NodeRSA.prototype.decryptPublic = function (buffer, encoding) {\n return this.$$decryptKey(true, buffer, encoding);\n };\n /**\n * Encrypting data method with custom key\n */\n\n\n NodeRSA.prototype.$$encryptKey = function (usePrivate, buffer, encoding, source_encoding) {\n try {\n var res = this.keyPair.encrypt(this.$getDataForEncrypt(buffer, source_encoding), usePrivate);\n\n if (encoding == 'buffer' || !encoding) {\n return res;\n } else {\n return res.toString(encoding);\n }\n } catch (e) {\n throw Error('Error during encryption. Original error: ' + e);\n }\n };\n /**\n * Decrypting data method with custom key\n */\n\n\n NodeRSA.prototype.$$decryptKey = function (usePublic, buffer, encoding) {\n try {\n buffer = _.isString(buffer) ? Buffer.from(buffer, 'base64') : buffer;\n var res = this.keyPair.decrypt(buffer, usePublic);\n\n if (res === null) {\n throw Error('Key decrypt method returns null.');\n }\n\n return this.$getDecryptedData(res, encoding);\n } catch (e) {\n throw Error('Error during decryption (probably incorrect key). Original error: ' + e);\n }\n };\n /**\n * Signing data\n *\n * @param buffer {string|number|object|array|Buffer} - data for signing. Object and array will convert to JSON string.\n * @param encoding {string} - optional. Encoding for output result, may be 'buffer', 'binary', 'hex' or 'base64'. Default 'buffer'.\n * @param source_encoding {string} - optional. Encoding for given string. Default utf8.\n * @returns {string|Buffer}\n */\n\n\n NodeRSA.prototype.sign = function (buffer, encoding, source_encoding) {\n if (!this.isPrivate()) {\n throw Error(\"This is not private key\");\n }\n\n var res = this.keyPair.sign(this.$getDataForEncrypt(buffer, source_encoding));\n\n if (encoding && encoding != 'buffer') {\n res = res.toString(encoding);\n }\n\n return res;\n };\n /**\n * Verifying signed data\n *\n * @param buffer - signed data\n * @param signature\n * @param source_encoding {string} - optional. Encoding for given string. Default utf8.\n * @param signature_encoding - optional. Encoding of given signature. May be 'buffer', 'binary', 'hex' or 'base64'. Default 'buffer'.\n * @returns {*}\n */\n\n\n NodeRSA.prototype.verify = function (buffer, signature, source_encoding, signature_encoding) {\n if (!this.isPublic()) {\n throw Error(\"This is not public key\");\n }\n\n signature_encoding = !signature_encoding || signature_encoding == 'buffer' ? null : signature_encoding;\n return this.keyPair.verify(this.$getDataForEncrypt(buffer, source_encoding), signature, signature_encoding);\n };\n /**\n * Returns key size in bits\n * @returns {int}\n */\n\n\n NodeRSA.prototype.getKeySize = function () {\n return this.keyPair.keySize;\n };\n /**\n * Returns max message length in bytes (for 1 chunk) depending on current encryption scheme\n * @returns {int}\n */\n\n\n NodeRSA.prototype.getMaxMessageSize = function () {\n return this.keyPair.maxMessageLength;\n };\n /**\n * Preparing given data for encrypting/signing. Just make new/return Buffer object.\n *\n * @param buffer {string|number|object|array|Buffer} - data for encrypting. Object and array will convert to JSON string.\n * @param encoding {string} - optional. Encoding for given string. Default utf8.\n * @returns {Buffer}\n */\n\n\n NodeRSA.prototype.$getDataForEncrypt = function (buffer, encoding) {\n if (_.isString(buffer) || _.isNumber(buffer)) {\n return Buffer.from('' + buffer, encoding || 'utf8');\n } else if (Buffer.isBuffer(buffer)) {\n return buffer;\n } else if (_.isObject(buffer)) {\n return Buffer.from(JSON.stringify(buffer));\n } else {\n throw Error(\"Unexpected data type\");\n }\n };\n /**\n *\n * @param buffer {Buffer} - decrypted data.\n * @param encoding - optional. Encoding for result output. May be 'buffer', 'json' or any of Node.js Buffer supported encoding.\n * @returns {*}\n */\n\n\n NodeRSA.prototype.$getDecryptedData = function (buffer, encoding) {\n encoding = encoding || 'buffer';\n\n if (encoding == 'buffer') {\n return buffer;\n } else if (encoding == 'json') {\n return JSON.parse(buffer.toString());\n } else {\n return buffer.toString(encoding);\n }\n };\n\n return NodeRSA;\n}();\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/NodeRSA.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/encryptEngines/encryptEngines.js": /*!********************************************************************!*\ !*** ./node_modules/node-rsa/src/encryptEngines/encryptEngines.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nmodule.exports = {\n getEngine: function getEngine(keyPair, options) {\n var engine = __webpack_require__(/*! ./js.js */ \"./node_modules/node-rsa/src/encryptEngines/js.js\");\n\n if (options.environment === 'node') {\n if (typeof crypt.publicEncrypt === 'function' && typeof crypt.privateDecrypt === 'function') {\n if (typeof crypt.privateEncrypt === 'function' && typeof crypt.publicDecrypt === 'function') {\n engine = __webpack_require__(/*! ./io.js */ \"./node_modules/node-rsa/src/encryptEngines/io.js\");\n } else {\n engine = __webpack_require__(/*! ./node12.js */ \"./node_modules/node-rsa/src/encryptEngines/node12.js\");\n }\n }\n }\n\n return engine(keyPair, options);\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/encryptEngines/encryptEngines.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/encryptEngines/io.js": /*!********************************************************!*\ !*** ./node_modules/node-rsa/src/encryptEngines/io.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var crypto = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar constants = __webpack_require__(/*! constants */ \"./node_modules/constants-browserify/constants.json\");\n\nvar schemes = __webpack_require__(/*! ../schemes/schemes.js */ \"./node_modules/node-rsa/src/schemes/schemes.js\");\n\nmodule.exports = function (keyPair, options) {\n var pkcs1Scheme = schemes.pkcs1.makeScheme(keyPair, options);\n return {\n encrypt: function encrypt(buffer, usePrivate) {\n var padding;\n\n if (usePrivate) {\n padding = constants.RSA_PKCS1_PADDING;\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n return crypto.privateEncrypt({\n key: options.rsaUtils.exportKey('private'),\n padding: padding\n }, buffer);\n } else {\n padding = constants.RSA_PKCS1_OAEP_PADDING;\n\n if (options.encryptionScheme === 'pkcs1') {\n padding = constants.RSA_PKCS1_PADDING;\n }\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n var data = buffer;\n\n if (padding === constants.RSA_NO_PADDING) {\n data = pkcs1Scheme.pkcs0pad(buffer);\n }\n\n return crypto.publicEncrypt({\n key: options.rsaUtils.exportKey('public'),\n padding: padding\n }, data);\n }\n },\n decrypt: function decrypt(buffer, usePublic) {\n var padding;\n\n if (usePublic) {\n padding = constants.RSA_PKCS1_PADDING;\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n return crypto.publicDecrypt({\n key: options.rsaUtils.exportKey('public'),\n padding: padding\n }, buffer);\n } else {\n padding = constants.RSA_PKCS1_OAEP_PADDING;\n\n if (options.encryptionScheme === 'pkcs1') {\n padding = constants.RSA_PKCS1_PADDING;\n }\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n var res = crypto.privateDecrypt({\n key: options.rsaUtils.exportKey('private'),\n padding: padding\n }, buffer);\n\n if (padding === constants.RSA_NO_PADDING) {\n return pkcs1Scheme.pkcs0unpad(res);\n }\n\n return res;\n }\n }\n };\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/encryptEngines/io.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/encryptEngines/js.js": /*!********************************************************!*\ !*** ./node_modules/node-rsa/src/encryptEngines/js.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var BigInteger = __webpack_require__(/*! ../libs/jsbn.js */ \"./node_modules/node-rsa/src/libs/jsbn.js\");\n\nvar schemes = __webpack_require__(/*! ../schemes/schemes.js */ \"./node_modules/node-rsa/src/schemes/schemes.js\");\n\nmodule.exports = function (keyPair, options) {\n var pkcs1Scheme = schemes.pkcs1.makeScheme(keyPair, options);\n return {\n encrypt: function encrypt(buffer, usePrivate) {\n var m, c;\n\n if (usePrivate) {\n /* Type 1: zeros padding for private key encrypt */\n m = new BigInteger(pkcs1Scheme.encPad(buffer, {\n type: 1\n }));\n c = keyPair.$doPrivate(m);\n } else {\n m = new BigInteger(keyPair.encryptionScheme.encPad(buffer));\n c = keyPair.$doPublic(m);\n }\n\n return c.toBuffer(keyPair.encryptedDataLength);\n },\n decrypt: function decrypt(buffer, usePublic) {\n var m,\n c = new BigInteger(buffer);\n\n if (usePublic) {\n m = keyPair.$doPublic(c);\n /* Type 1: zeros padding for private key decrypt */\n\n return pkcs1Scheme.encUnPad(m.toBuffer(keyPair.encryptedDataLength), {\n type: 1\n });\n } else {\n m = keyPair.$doPrivate(c);\n return keyPair.encryptionScheme.encUnPad(m.toBuffer(keyPair.encryptedDataLength));\n }\n }\n };\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/encryptEngines/js.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/encryptEngines/node12.js": /*!************************************************************!*\ !*** ./node_modules/node-rsa/src/encryptEngines/node12.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var crypto = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar constants = __webpack_require__(/*! constants */ \"./node_modules/constants-browserify/constants.json\");\n\nvar schemes = __webpack_require__(/*! ../schemes/schemes.js */ \"./node_modules/node-rsa/src/schemes/schemes.js\");\n\nmodule.exports = function (keyPair, options) {\n var jsEngine = __webpack_require__(/*! ./js.js */ \"./node_modules/node-rsa/src/encryptEngines/js.js\")(keyPair, options);\n\n var pkcs1Scheme = schemes.pkcs1.makeScheme(keyPair, options);\n return {\n encrypt: function encrypt(buffer, usePrivate) {\n if (usePrivate) {\n return jsEngine.encrypt(buffer, usePrivate);\n }\n\n var padding = constants.RSA_PKCS1_OAEP_PADDING;\n\n if (options.encryptionScheme === 'pkcs1') {\n padding = constants.RSA_PKCS1_PADDING;\n }\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n var data = buffer;\n\n if (padding === constants.RSA_NO_PADDING) {\n data = pkcs1Scheme.pkcs0pad(buffer);\n }\n\n return crypto.publicEncrypt({\n key: options.rsaUtils.exportKey('public'),\n padding: padding\n }, data);\n },\n decrypt: function decrypt(buffer, usePublic) {\n if (usePublic) {\n return jsEngine.decrypt(buffer, usePublic);\n }\n\n var padding = constants.RSA_PKCS1_OAEP_PADDING;\n\n if (options.encryptionScheme === 'pkcs1') {\n padding = constants.RSA_PKCS1_PADDING;\n }\n\n if (options.encryptionSchemeOptions && options.encryptionSchemeOptions.padding) {\n padding = options.encryptionSchemeOptions.padding;\n }\n\n var res = crypto.privateDecrypt({\n key: options.rsaUtils.exportKey('private'),\n padding: padding\n }, buffer);\n\n if (padding === constants.RSA_NO_PADDING) {\n return pkcs1Scheme.pkcs0unpad(res);\n }\n\n return res;\n }\n };\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/encryptEngines/node12.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/formats/components.js": /*!*********************************************************!*\ !*** ./node_modules/node-rsa/src/formats/components.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\");\n\nmodule.exports = {\n privateExport: function privateExport(key, options) {\n return {\n n: key.n.toBuffer(),\n e: key.e,\n d: key.d.toBuffer(),\n p: key.p.toBuffer(),\n q: key.q.toBuffer(),\n dmp1: key.dmp1.toBuffer(),\n dmq1: key.dmq1.toBuffer(),\n coeff: key.coeff.toBuffer()\n };\n },\n privateImport: function privateImport(key, data, options) {\n if (data.n && data.e && data.d && data.p && data.q && data.dmp1 && data.dmq1 && data.coeff) {\n key.setPrivate(data.n, data.e, data.d, data.p, data.q, data.dmp1, data.dmq1, data.coeff);\n } else {\n throw Error(\"Invalid key data\");\n }\n },\n publicExport: function publicExport(key, options) {\n return {\n n: key.n.toBuffer(),\n e: key.e\n };\n },\n publicImport: function publicImport(key, data, options) {\n if (data.n && data.e) {\n key.setPublic(data.n, data.e);\n } else {\n throw Error(\"Invalid key data\");\n }\n },\n\n /**\n * Trying autodetect and import key\n * @param key\n * @param data\n */\n autoImport: function autoImport(key, data) {\n if (data.n && data.e) {\n if (data.d && data.p && data.q && data.dmp1 && data.dmq1 && data.coeff) {\n module.exports.privateImport(key, data);\n return true;\n } else {\n module.exports.publicImport(key, data);\n return true;\n }\n }\n\n return false;\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/formats/components.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/formats/formats.js": /*!******************************************************!*\ !*** ./node_modules/node-rsa/src/formats/formats.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nfunction formatParse(format) {\n format = format.split('-');\n var keyType = 'private';\n var keyOpt = {\n type: 'default'\n };\n\n for (var i = 1; i < format.length; i++) {\n if (format[i]) {\n switch (format[i]) {\n case 'public':\n keyType = format[i];\n break;\n\n case 'private':\n keyType = format[i];\n break;\n\n case 'pem':\n keyOpt.type = format[i];\n break;\n\n case 'der':\n keyOpt.type = format[i];\n break;\n }\n }\n }\n\n return {\n scheme: format[0],\n keyType: keyType,\n keyOpt: keyOpt\n };\n}\n\nmodule.exports = {\n pkcs1: __webpack_require__(/*! ./pkcs1 */ \"./node_modules/node-rsa/src/formats/pkcs1.js\"),\n pkcs8: __webpack_require__(/*! ./pkcs8 */ \"./node_modules/node-rsa/src/formats/pkcs8.js\"),\n components: __webpack_require__(/*! ./components */ \"./node_modules/node-rsa/src/formats/components.js\"),\n isPrivateExport: function isPrivateExport(format) {\n return module.exports[format] && typeof module.exports[format].privateExport === 'function';\n },\n isPrivateImport: function isPrivateImport(format) {\n return module.exports[format] && typeof module.exports[format].privateImport === 'function';\n },\n isPublicExport: function isPublicExport(format) {\n return module.exports[format] && typeof module.exports[format].publicExport === 'function';\n },\n isPublicImport: function isPublicImport(format) {\n return module.exports[format] && typeof module.exports[format].publicImport === 'function';\n },\n detectAndImport: function detectAndImport(key, data, format) {\n if (format === undefined) {\n for (var scheme in module.exports) {\n if (typeof module.exports[scheme].autoImport === 'function' && module.exports[scheme].autoImport(key, data)) {\n return true;\n }\n }\n } else if (format) {\n var fmt = formatParse(format);\n\n if (module.exports[fmt.scheme]) {\n if (fmt.keyType === 'private') {\n module.exports[fmt.scheme].privateImport(key, data, fmt.keyOpt);\n } else {\n module.exports[fmt.scheme].publicImport(key, data, fmt.keyOpt);\n }\n } else {\n throw Error('Unsupported key format');\n }\n }\n\n return false;\n },\n detectAndExport: function detectAndExport(key, format) {\n if (format) {\n var fmt = formatParse(format);\n\n if (module.exports[fmt.scheme]) {\n if (fmt.keyType === 'private') {\n if (!key.isPrivate()) {\n throw Error(\"This is not private key\");\n }\n\n return module.exports[fmt.scheme].privateExport(key, fmt.keyOpt);\n } else {\n if (!key.isPublic()) {\n throw Error(\"This is not public key\");\n }\n\n return module.exports[fmt.scheme].publicExport(key, fmt.keyOpt);\n }\n } else {\n throw Error('Unsupported key format');\n }\n }\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/formats/formats.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/formats/pkcs1.js": /*!****************************************************!*\ !*** ./node_modules/node-rsa/src/formats/pkcs1.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var ber = __webpack_require__(/*! asn1 */ \"./node_modules/asn1/lib/index.js\").Ber;\n\nvar _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\");\n\nvar PRIVATE_OPENING_BOUNDARY = '-----BEGIN RSA PRIVATE KEY-----';\nvar PRIVATE_CLOSING_BOUNDARY = '-----END RSA PRIVATE KEY-----';\nvar PUBLIC_OPENING_BOUNDARY = '-----BEGIN RSA PUBLIC KEY-----';\nvar PUBLIC_CLOSING_BOUNDARY = '-----END RSA PUBLIC KEY-----';\nmodule.exports = {\n privateExport: function privateExport(key, options) {\n options = options || {};\n var n = key.n.toBuffer();\n var d = key.d.toBuffer();\n var p = key.p.toBuffer();\n var q = key.q.toBuffer();\n var dmp1 = key.dmp1.toBuffer();\n var dmq1 = key.dmq1.toBuffer();\n var coeff = key.coeff.toBuffer();\n var length = n.length + d.length + p.length + q.length + dmp1.length + dmq1.length + coeff.length + 512; // magic\n\n var writer = new ber.Writer({\n size: length\n });\n writer.startSequence();\n writer.writeInt(0);\n writer.writeBuffer(n, 2);\n writer.writeInt(key.e);\n writer.writeBuffer(d, 2);\n writer.writeBuffer(p, 2);\n writer.writeBuffer(q, 2);\n writer.writeBuffer(dmp1, 2);\n writer.writeBuffer(dmq1, 2);\n writer.writeBuffer(coeff, 2);\n writer.endSequence();\n\n if (options.type === 'der') {\n return writer.buffer;\n } else {\n return PRIVATE_OPENING_BOUNDARY + '\\n' + utils.linebrk(writer.buffer.toString('base64'), 64) + '\\n' + PRIVATE_CLOSING_BOUNDARY;\n }\n },\n privateImport: function privateImport(key, data, options) {\n options = options || {};\n var buffer;\n\n if (options.type !== 'der') {\n if (Buffer.isBuffer(data)) {\n data = data.toString('utf8');\n }\n\n if (_.isString(data)) {\n var pem = utils.trimSurroundingText(data, PRIVATE_OPENING_BOUNDARY, PRIVATE_CLOSING_BOUNDARY).replace(/\\s+|\\n\\r|\\n|\\r$/gm, '');\n buffer = Buffer.from(pem, 'base64');\n } else {\n throw Error('Unsupported key format');\n }\n } else if (Buffer.isBuffer(data)) {\n buffer = data;\n } else {\n throw Error('Unsupported key format');\n }\n\n var reader = new ber.Reader(buffer);\n reader.readSequence();\n reader.readString(2, true); // just zero\n\n key.setPrivate(reader.readString(2, true), // modulus\n reader.readString(2, true), // publicExponent\n reader.readString(2, true), // privateExponent\n reader.readString(2, true), // prime1\n reader.readString(2, true), // prime2\n reader.readString(2, true), // exponent1 -- d mod (p1)\n reader.readString(2, true), // exponent2 -- d mod (q-1)\n reader.readString(2, true) // coefficient -- (inverse of q) mod p\n );\n },\n publicExport: function publicExport(key, options) {\n options = options || {};\n var n = key.n.toBuffer();\n var length = n.length + 512; // magic\n\n var bodyWriter = new ber.Writer({\n size: length\n });\n bodyWriter.startSequence();\n bodyWriter.writeBuffer(n, 2);\n bodyWriter.writeInt(key.e);\n bodyWriter.endSequence();\n\n if (options.type === 'der') {\n return bodyWriter.buffer;\n } else {\n return PUBLIC_OPENING_BOUNDARY + '\\n' + utils.linebrk(bodyWriter.buffer.toString('base64'), 64) + '\\n' + PUBLIC_CLOSING_BOUNDARY;\n }\n },\n publicImport: function publicImport(key, data, options) {\n options = options || {};\n var buffer;\n\n if (options.type !== 'der') {\n if (Buffer.isBuffer(data)) {\n data = data.toString('utf8');\n }\n\n if (_.isString(data)) {\n var pem = utils.trimSurroundingText(data, PUBLIC_OPENING_BOUNDARY, PUBLIC_CLOSING_BOUNDARY).replace(/\\s+|\\n\\r|\\n|\\r$/gm, '');\n buffer = Buffer.from(pem, 'base64');\n }\n } else if (Buffer.isBuffer(data)) {\n buffer = data;\n } else {\n throw Error('Unsupported key format');\n }\n\n var body = new ber.Reader(buffer);\n body.readSequence();\n key.setPublic(body.readString(0x02, true), // modulus\n body.readString(0x02, true) // publicExponent\n );\n },\n\n /**\n * Trying autodetect and import key\n * @param key\n * @param data\n */\n autoImport: function autoImport(key, data) {\n // [\\S\\s]* matches zero or more of any character\n if (/^[\\S\\s]*-----BEGIN RSA PRIVATE KEY-----\\s*(?=(([A-Za-z0-9+/=]+\\s*)+))\\1-----END RSA PRIVATE KEY-----[\\S\\s]*$/g.test(data)) {\n module.exports.privateImport(key, data);\n return true;\n }\n\n if (/^[\\S\\s]*-----BEGIN RSA PUBLIC KEY-----\\s*(?=(([A-Za-z0-9+/=]+\\s*)+))\\1-----END RSA PUBLIC KEY-----[\\S\\s]*$/g.test(data)) {\n module.exports.publicImport(key, data);\n return true;\n }\n\n return false;\n }\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/formats/pkcs1.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/formats/pkcs8.js": /*!****************************************************!*\ !*** ./node_modules/node-rsa/src/formats/pkcs8.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var ber = __webpack_require__(/*! asn1 */ \"./node_modules/asn1/lib/index.js\").Ber;\n\nvar _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nvar PUBLIC_RSA_OID = '1.2.840.113549.1.1.1';\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\");\n\nvar PRIVATE_OPENING_BOUNDARY = '-----BEGIN PRIVATE KEY-----';\nvar PRIVATE_CLOSING_BOUNDARY = '-----END PRIVATE KEY-----';\nvar PUBLIC_OPENING_BOUNDARY = '-----BEGIN PUBLIC KEY-----';\nvar PUBLIC_CLOSING_BOUNDARY = '-----END PUBLIC KEY-----';\nmodule.exports = {\n privateExport: function privateExport(key, options) {\n options = options || {};\n var n = key.n.toBuffer();\n var d = key.d.toBuffer();\n var p = key.p.toBuffer();\n var q = key.q.toBuffer();\n var dmp1 = key.dmp1.toBuffer();\n var dmq1 = key.dmq1.toBuffer();\n var coeff = key.coeff.toBuffer();\n var length = n.length + d.length + p.length + q.length + dmp1.length + dmq1.length + coeff.length + 512; // magic\n\n var bodyWriter = new ber.Writer({\n size: length\n });\n bodyWriter.startSequence();\n bodyWriter.writeInt(0);\n bodyWriter.writeBuffer(n, 2);\n bodyWriter.writeInt(key.e);\n bodyWriter.writeBuffer(d, 2);\n bodyWriter.writeBuffer(p, 2);\n bodyWriter.writeBuffer(q, 2);\n bodyWriter.writeBuffer(dmp1, 2);\n bodyWriter.writeBuffer(dmq1, 2);\n bodyWriter.writeBuffer(coeff, 2);\n bodyWriter.endSequence();\n var writer = new ber.Writer({\n size: length\n });\n writer.startSequence();\n writer.writeInt(0);\n writer.startSequence();\n writer.writeOID(PUBLIC_RSA_OID);\n writer.writeNull();\n writer.endSequence();\n writer.writeBuffer(bodyWriter.buffer, 4);\n writer.endSequence();\n\n if (options.type === 'der') {\n return writer.buffer;\n } else {\n return PRIVATE_OPENING_BOUNDARY + '\\n' + utils.linebrk(writer.buffer.toString('base64'), 64) + '\\n' + PRIVATE_CLOSING_BOUNDARY;\n }\n },\n privateImport: function privateImport(key, data, options) {\n options = options || {};\n var buffer;\n\n if (options.type !== 'der') {\n if (Buffer.isBuffer(data)) {\n data = data.toString('utf8');\n }\n\n if (_.isString(data)) {\n var pem = utils.trimSurroundingText(data, PRIVATE_OPENING_BOUNDARY, PRIVATE_CLOSING_BOUNDARY).replace('-----END PRIVATE KEY-----', '').replace(/\\s+|\\n\\r|\\n|\\r$/gm, '');\n buffer = Buffer.from(pem, 'base64');\n } else {\n throw Error('Unsupported key format');\n }\n } else if (Buffer.isBuffer(data)) {\n buffer = data;\n } else {\n throw Error('Unsupported key format');\n }\n\n var reader = new ber.Reader(buffer);\n reader.readSequence();\n reader.readInt(0);\n var header = new ber.Reader(reader.readString(0x30, true));\n\n if (header.readOID(0x06, true) !== PUBLIC_RSA_OID) {\n throw Error('Invalid Public key format');\n }\n\n var body = new ber.Reader(reader.readString(0x04, true));\n body.readSequence();\n body.readString(2, true); // just zero\n\n key.setPrivate(body.readString(2, true), // modulus\n body.readString(2, true), // publicExponent\n body.readString(2, true), // privateExponent\n body.readString(2, true), // prime1\n body.readString(2, true), // prime2\n body.readString(2, true), // exponent1 -- d mod (p1)\n body.readString(2, true), // exponent2 -- d mod (q-1)\n body.readString(2, true) // coefficient -- (inverse of q) mod p\n );\n },\n publicExport: function publicExport(key, options) {\n options = options || {};\n var n = key.n.toBuffer();\n var length = n.length + 512; // magic\n\n var bodyWriter = new ber.Writer({\n size: length\n });\n bodyWriter.writeByte(0);\n bodyWriter.startSequence();\n bodyWriter.writeBuffer(n, 2);\n bodyWriter.writeInt(key.e);\n bodyWriter.endSequence();\n var writer = new ber.Writer({\n size: length\n });\n writer.startSequence();\n writer.startSequence();\n writer.writeOID(PUBLIC_RSA_OID);\n writer.writeNull();\n writer.endSequence();\n writer.writeBuffer(bodyWriter.buffer, 3);\n writer.endSequence();\n\n if (options.type === 'der') {\n return writer.buffer;\n } else {\n return PUBLIC_OPENING_BOUNDARY + '\\n' + utils.linebrk(writer.buffer.toString('base64'), 64) + '\\n' + PUBLIC_CLOSING_BOUNDARY;\n }\n },\n publicImport: function publicImport(key, data, options) {\n options = options || {};\n var buffer;\n\n if (options.type !== 'der') {\n if (Buffer.isBuffer(data)) {\n data = data.toString('utf8');\n }\n\n if (_.isString(data)) {\n var pem = utils.trimSurroundingText(data, PUBLIC_OPENING_BOUNDARY, PUBLIC_CLOSING_BOUNDARY).replace(/\\s+|\\n\\r|\\n|\\r$/gm, '');\n buffer = Buffer.from(pem, 'base64');\n }\n } else if (Buffer.isBuffer(data)) {\n buffer = data;\n } else {\n throw Error('Unsupported key format');\n }\n\n var reader = new ber.Reader(buffer);\n reader.readSequence();\n var header = new ber.Reader(reader.readString(0x30, true));\n\n if (header.readOID(0x06, true) !== PUBLIC_RSA_OID) {\n throw Error('Invalid Public key format');\n }\n\n var body = new ber.Reader(reader.readString(0x03, true));\n body.readByte();\n body.readSequence();\n key.setPublic(body.readString(0x02, true), // modulus\n body.readString(0x02, true) // publicExponent\n );\n },\n\n /**\n * Trying autodetect and import key\n * @param key\n * @param data\n */\n autoImport: function autoImport(key, data) {\n if (/^[\\S\\s]*-----BEGIN PRIVATE KEY-----\\s*(?=(([A-Za-z0-9+/=]+\\s*)+))\\1-----END PRIVATE KEY-----[\\S\\s]*$/g.test(data)) {\n module.exports.privateImport(key, data);\n return true;\n }\n\n if (/^[\\S\\s]*-----BEGIN PUBLIC KEY-----\\s*(?=(([A-Za-z0-9+/=]+\\s*)+))\\1-----END PUBLIC KEY-----[\\S\\s]*$/g.test(data)) {\n module.exports.publicImport(key, data);\n return true;\n }\n\n return false;\n }\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/formats/pkcs8.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/libs/jsbn.js": /*!************************************************!*\ !*** ./node_modules/node-rsa/src/libs/jsbn.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\n * Basic JavaScript BN library - subset useful for RSA encryption.\n * \n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. \n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n/*\n * Added Node.js Buffers support\n * 2014 rzcoder\n */\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._; // Bits per digit\n\n\nvar dbits; // JavaScript engine analysis\n\nvar canary = 0xdeadbeefcafe;\nvar j_lm = (canary & 0xffffff) == 0xefcafe; // (public) Constructor\n\nfunction BigInteger(a, b) {\n if (a != null) {\n if (\"number\" == typeof a) {\n this.fromNumber(a, b);\n } else if (Buffer.isBuffer(a)) {\n this.fromBuffer(a);\n } else if (b == null && \"string\" != typeof a) {\n this.fromByteArray(a);\n } else {\n this.fromString(a, b);\n }\n }\n} // return new, unset BigInteger\n\n\nfunction nbi() {\n return new BigInteger(null);\n} // am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n\n\nfunction am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n\n return c;\n} // am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n\n\nfunction am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n\n return c;\n} // Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\n\n\nfunction am3(i, x, w, j, c, n) {\n var xl = x & 0x3fff,\n xh = x >> 14;\n\n while (--n >= 0) {\n var l = this[i] & 0x3fff;\n var h = this[i++] >> 14;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n\n return c;\n} // We need to select the fastest one that works in this environment. \n//if (j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n//\tBigInteger.prototype.am = am2;\n//\tdbits = 30;\n//} else if (j_lm && (navigator.appName != \"Netscape\")) {\n//\tBigInteger.prototype.am = am1;\n//\tdbits = 26;\n//} else { // Mozilla/Netscape seems to prefer am3\n//\tBigInteger.prototype.am = am3;\n//\tdbits = 28;\n//}\n// For node.js, we pick am3 with max dbits to 28.\n\n\nBigInteger.prototype.am = am3;\ndbits = 28;\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP; // Digit conversions\n\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr, vv;\nrr = \"0\".charCodeAt(0);\n\nfor (vv = 0; vv <= 9; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nrr = \"a\".charCodeAt(0);\n\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nrr = \"A\".charCodeAt(0);\n\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\n\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n} // (protected) copy this to r\n\n\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }\n\n r.t = this.t;\n r.s = this.s;\n} // (protected) set from integer value x, -DV <= x < DV\n\n\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;else if (x < -1) this[0] = x + DV;else this.t = 0;\n} // return bigint initialized to value\n\n\nfunction nbv(i) {\n var r = nbi();\n r.fromInt(i);\n return r;\n} // (protected) set from string and radix\n\n\nfunction bnpFromString(data, radix, unsigned) {\n var k;\n\n switch (radix) {\n case 2:\n k = 1;\n break;\n\n case 4:\n k = 2;\n break;\n\n case 8:\n k = 3;\n break;\n\n case 16:\n k = 4;\n break;\n\n case 32:\n k = 5;\n break;\n\n case 256:\n k = 8;\n break;\n\n default:\n this.fromRadix(data, radix);\n return;\n }\n\n this.t = 0;\n this.s = 0;\n var i = data.length;\n var mi = false;\n var sh = 0;\n\n while (--i >= 0) {\n var x = k == 8 ? data[i] & 0xff : intAt(data, i);\n\n if (x < 0) {\n if (data.charAt(i) == \"-\") mi = true;\n continue;\n }\n\n mi = false;\n if (sh === 0) this[this.t++] = x;else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n\n if (!unsigned && k == 8 && (data[0] & 0x80) != 0) {\n this.s = -1;\n if (sh > 0) this[this.t - 1] |= (1 << this.DB - sh) - 1 << sh;\n }\n\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\nfunction bnpFromByteArray(a, unsigned) {\n this.fromString(a, 256, unsigned);\n}\n\nfunction bnpFromBuffer(a) {\n this.fromString(a, 256, true);\n} // (protected) clamp off excess high words\n\n\nfunction bnpClamp() {\n var c = this.s & this.DM;\n\n while (this.t > 0 && this[this.t - 1] == c) {\n --this.t;\n }\n} // (public) return string representation in given radix\n\n\nfunction bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n\n return m ? r : \"0\";\n} // (public) -this\n\n\nfunction bnNegate() {\n var r = nbi();\n BigInteger.ZERO.subTo(this, r);\n return r;\n} // (public) |this|\n\n\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n} // (public) return + if this > a, - if this < a, 0 if equal\n\n\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n\n while (--i >= 0) {\n if ((r = this[i] - a[i]) != 0) return r;\n }\n\n return 0;\n} // returns bit length of the integer x\n\n\nfunction nbits(x) {\n var r = 1,\n t;\n\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n\n return r;\n} // (public) return the number of bits in \"this\"\n\n\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n} // (protected) r = this << n*DB\n\n\nfunction bnpDLShiftTo(n, r) {\n var i;\n\n for (i = this.t - 1; i >= 0; --i) {\n r[i + n] = this[i];\n }\n\n for (i = n - 1; i >= 0; --i) {\n r[i] = 0;\n }\n\n r.t = this.t + n;\n r.s = this.s;\n} // (protected) r = this >> n*DB\n\n\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i) {\n r[i - n] = this[i];\n }\n\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n} // (protected) r = this << n\n\n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n\n for (i = ds - 1; i >= 0; --i) {\n r[i] = 0;\n }\n\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n} // (protected) r = this >> n\n\n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n} // (protected) r = this - a\n\n\nfunction bnpSubTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n if (a.t < this.t) {\n c -= a.s;\n\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += this.s;\n } else {\n c += this.s;\n\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c -= a.s;\n }\n\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n} // (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\n\n\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n} // (protected) r = this^2, r != this (HAC 14.16)\n\n\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n} // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\n\n\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 === 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n} // (public) this mod a\n\n\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n} // Modular reduction using \"classic\" algorithm\n\n\nfunction Classic(m) {\n this.m = m;\n}\n\nfunction cConvert(x) {\n if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);else return x;\n}\n\nfunction cRevert(x) {\n return x;\n}\n\nfunction cReduce(x) {\n x.divRemTo(this.m, null, x);\n}\n\nfunction cMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\n\nfunction cSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}\n\nClassic.prototype.convert = cConvert;\nClassic.prototype.revert = cRevert;\nClassic.prototype.reduce = cReduce;\nClassic.prototype.mulTo = cMulTo;\nClassic.prototype.sqrTo = cSqrTo; // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\n\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) === 0) return 0;\n var y = x & 3; // y == 1/x mod 2^2\n\n y = y * (2 - (x & 0xf) * y) & 0xf; // y == 1/x mod 2^4\n\n y = y * (2 - (x & 0xff) * y) & 0xff; // y == 1/x mod 2^8\n\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n\n y = y * (2 - x * y % this.DV) % this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n\n return y > 0 ? this.DV - y : -y;\n} // Montgomery reduction\n\n\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n} // xR mod m\n\n\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n} // x/R mod m\n\n\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n} // x = x/R mod m (HAC 14.32)\n\n\nfunction montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }\n\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; // use am to combine the multiply-shift-add into one call\n\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t); // propagate carry\n\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n} // r = \"x^2/R mod m\"; x != r\n\n\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n} // r = \"xy/R mod m\"; x,y != r\n\n\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even\n\nfunction bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) === 0;\n} // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n\n\nfunction bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(),\n r2 = nbi(),\n g = z.convert(this),\n i = nbits(e) - 1;\n g.copyTo(r);\n\n while (--i >= 0) {\n z.sqrTo(r, r2);\n if ((e & 1 << i) > 0) z.mulTo(r2, g, r);else {\n var t = r;\n r = r2;\n r2 = t;\n }\n }\n\n return z.revert(r);\n} // (public) this^e % m, 0 <= e < 2^32\n\n\nfunction bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n} // Copyright (c) 2005-2009 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n// Extended JavaScript BN functions, required for RSA private ops.\n// Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n// Version 1.2: square() API, isProbablePrime fix\n//(public)\n\n\nfunction bnClone() {\n var r = nbi();\n this.copyTo(r);\n return r;\n} //(public) return value as integer\n\n\nfunction bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t === 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t === 0) return 0; // assumes 16 < DB < 32\n\n\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n} //(public) return value as byte\n\n\nfunction bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n} //(public) return value as short (assumes DB>=16)\n\n\nfunction bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n} //(protected) return x s.t. r^x < DV\n\n\nfunction bnpChunkSize(r) {\n return Math.floor(Math.LN2 * this.DB / Math.log(r));\n} //(public) 0 if this === 0, 1 if this > 0\n\n\nfunction bnSigNum() {\n if (this.s < 0) return -1;else if (this.t <= 0 || this.t == 1 && this[0] <= 0) return 0;else return 1;\n} //(protected) convert to radix string\n\n\nfunction bnpToRadix(b) {\n if (b == null) b = 10;\n if (this.signum() === 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b, cs);\n var d = nbv(a),\n y = nbi(),\n z = nbi(),\n r = \"\";\n this.divRemTo(d, y, z);\n\n while (y.signum() > 0) {\n r = (a + z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d, y, z);\n }\n\n return z.intValue().toString(b) + r;\n} //(protected) convert from radix string\n\n\nfunction bnpFromRadix(s, b) {\n this.fromInt(0);\n if (b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b, cs),\n mi = false,\n j = 0,\n w = 0;\n\n for (var i = 0; i < s.length; ++i) {\n var x = intAt(s, i);\n\n if (x < 0) {\n if (s.charAt(i) == \"-\" && this.signum() === 0) mi = true;\n continue;\n }\n\n w = b * w + x;\n\n if (++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w, 0);\n j = 0;\n w = 0;\n }\n }\n\n if (j > 0) {\n this.dMultiply(Math.pow(b, j));\n this.dAddOffset(w, 0);\n }\n\n if (mi) BigInteger.ZERO.subTo(this, this);\n} //(protected) alternate constructor\n\n\nfunction bnpFromNumber(a, b) {\n if (\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if (a < 2) this.fromInt(1);else {\n this.fromNumber(a);\n if (!this.testBit(a - 1)) // force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this);\n if (this.isEven()) this.dAddOffset(1, 0); // force odd\n\n while (!this.isProbablePrime(b)) {\n this.dAddOffset(2, 0);\n if (this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a - 1), this);\n }\n }\n } else {\n // new BigInteger(int,RNG)\n var x = crypt.randomBytes((a >> 3) + 1);\n var t = a & 7;\n if (t > 0) x[0] &= (1 << t) - 1;else x[0] = 0;\n this.fromByteArray(x);\n }\n} //(public) convert to bigendian byte array\n\n\nfunction bnToByteArray() {\n var i = this.t,\n r = new Array();\n r[0] = this.s;\n var p = this.DB - i * this.DB % 8,\n d,\n k = 0;\n\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p) r[k++] = d | this.s << this.DB - p;\n\n while (i >= 0) {\n if (p < 8) {\n d = (this[i] & (1 << p) - 1) << 8 - p;\n d |= this[--i] >> (p += this.DB - 8);\n } else {\n d = this[i] >> (p -= 8) & 0xff;\n\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n\n if ((d & 0x80) != 0) d |= -256;\n if (k === 0 && (this.s & 0x80) != (d & 0x80)) ++k;\n if (k > 0 || d != this.s) r[k++] = d;\n }\n }\n\n return r;\n}\n/**\n * return Buffer object\n * @param trim {boolean} slice buffer if first element == 0\n * @returns {Buffer}\n */\n\n\nfunction bnToBuffer(trimOrSize) {\n var res = Buffer.from(this.toByteArray());\n\n if (trimOrSize === true && res[0] === 0) {\n res = res.slice(1);\n } else if (_.isNumber(trimOrSize)) {\n if (res.length > trimOrSize) {\n for (var i = 0; i < res.length - trimOrSize; i++) {\n if (res[i] !== 0) {\n return null;\n }\n }\n\n return res.slice(res.length - trimOrSize);\n } else if (res.length < trimOrSize) {\n var padded = Buffer.alloc(trimOrSize);\n padded.fill(0, 0, trimOrSize - res.length);\n res.copy(padded, trimOrSize - res.length);\n return padded;\n }\n }\n\n return res;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\nfunction bnMin(a) {\n return this.compareTo(a) < 0 ? this : a;\n}\n\nfunction bnMax(a) {\n return this.compareTo(a) > 0 ? this : a;\n} //(protected) r = this op a (bitwise)\n\n\nfunction bnpBitwiseTo(a, op, r) {\n var i,\n f,\n m = Math.min(a.t, this.t);\n\n for (i = 0; i < m; ++i) {\n r[i] = op(this[i], a[i]);\n }\n\n if (a.t < this.t) {\n f = a.s & this.DM;\n\n for (i = m; i < this.t; ++i) {\n r[i] = op(this[i], f);\n }\n\n r.t = this.t;\n } else {\n f = this.s & this.DM;\n\n for (i = m; i < a.t; ++i) {\n r[i] = op(f, a[i]);\n }\n\n r.t = a.t;\n }\n\n r.s = op(this.s, a.s);\n r.clamp();\n} //(public) this & a\n\n\nfunction op_and(x, y) {\n return x & y;\n}\n\nfunction bnAnd(a) {\n var r = nbi();\n this.bitwiseTo(a, op_and, r);\n return r;\n} //(public) this | a\n\n\nfunction op_or(x, y) {\n return x | y;\n}\n\nfunction bnOr(a) {\n var r = nbi();\n this.bitwiseTo(a, op_or, r);\n return r;\n} //(public) this ^ a\n\n\nfunction op_xor(x, y) {\n return x ^ y;\n}\n\nfunction bnXor(a) {\n var r = nbi();\n this.bitwiseTo(a, op_xor, r);\n return r;\n} //(public) this & ~a\n\n\nfunction op_andnot(x, y) {\n return x & ~y;\n}\n\nfunction bnAndNot(a) {\n var r = nbi();\n this.bitwiseTo(a, op_andnot, r);\n return r;\n} //(public) ~this\n\n\nfunction bnNot() {\n var r = nbi();\n\n for (var i = 0; i < this.t; ++i) {\n r[i] = this.DM & ~this[i];\n }\n\n r.t = this.t;\n r.s = ~this.s;\n return r;\n} //(public) this << n\n\n\nfunction bnShiftLeft(n) {\n var r = nbi();\n if (n < 0) this.rShiftTo(-n, r);else this.lShiftTo(n, r);\n return r;\n} //(public) this >> n\n\n\nfunction bnShiftRight(n) {\n var r = nbi();\n if (n < 0) this.lShiftTo(-n, r);else this.rShiftTo(n, r);\n return r;\n} //return index of lowest 1-bit in x, x < 2^31\n\n\nfunction lbit(x) {\n if (x === 0) return -1;\n var r = 0;\n\n if ((x & 0xffff) === 0) {\n x >>= 16;\n r += 16;\n }\n\n if ((x & 0xff) === 0) {\n x >>= 8;\n r += 8;\n }\n\n if ((x & 0xf) === 0) {\n x >>= 4;\n r += 4;\n }\n\n if ((x & 3) === 0) {\n x >>= 2;\n r += 2;\n }\n\n if ((x & 1) === 0) ++r;\n return r;\n} //(public) returns index of lowest 1-bit (or -1 if none)\n\n\nfunction bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }\n\n if (this.s < 0) return this.t * this.DB;\n return -1;\n} //return number of 1 bits in x\n\n\nfunction cbit(x) {\n var r = 0;\n\n while (x != 0) {\n x &= x - 1;\n ++r;\n }\n\n return r;\n} //(public) return number of set bits\n\n\nfunction bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this[i] ^ x);\n }\n\n return r;\n} //(public) true iff nth bit is set\n\n\nfunction bnTestBit(n) {\n var j = Math.floor(n / this.DB);\n if (j >= this.t) return this.s != 0;\n return (this[j] & 1 << n % this.DB) != 0;\n} //(protected) this op (1<>= this.DB;\n }\n\n if (a.t < this.t) {\n c += a.s;\n\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += this.s;\n } else {\n c += this.s;\n\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += a.s;\n }\n\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n} //(public) this + a\n\n\nfunction bnAdd(a) {\n var r = nbi();\n this.addTo(a, r);\n return r;\n} //(public) this - a\n\n\nfunction bnSubtract(a) {\n var r = nbi();\n this.subTo(a, r);\n return r;\n} //(public) this * a\n\n\nfunction bnMultiply(a) {\n var r = nbi();\n this.multiplyTo(a, r);\n return r;\n} // (public) this^2\n\n\nfunction bnSquare() {\n var r = nbi();\n this.squareTo(r);\n return r;\n} //(public) this / a\n\n\nfunction bnDivide(a) {\n var r = nbi();\n this.divRemTo(a, r, null);\n return r;\n} //(public) this % a\n\n\nfunction bnRemainder(a) {\n var r = nbi();\n this.divRemTo(a, null, r);\n return r;\n} //(public) [this/a,this%a]\n\n\nfunction bnDivideAndRemainder(a) {\n var q = nbi(),\n r = nbi();\n this.divRemTo(a, q, r);\n return new Array(q, r);\n} //(protected) this *= n, this >= 0, 1 < n < DV\n\n\nfunction bnpDMultiply(n) {\n this[this.t] = this.am(0, n - 1, this, 0, 0, this.t);\n ++this.t;\n this.clamp();\n} //(protected) this += n << w words, this >= 0\n\n\nfunction bnpDAddOffset(n, w) {\n if (n === 0) return;\n\n while (this.t <= w) {\n this[this.t++] = 0;\n }\n\n this[w] += n;\n\n while (this[w] >= this.DV) {\n this[w] -= this.DV;\n if (++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n} //A \"null\" reducer\n\n\nfunction NullExp() {}\n\nfunction nNop(x) {\n return x;\n}\n\nfunction nMulTo(x, y, r) {\n x.multiplyTo(y, r);\n}\n\nfunction nSqrTo(x, r) {\n x.squareTo(r);\n}\n\nNullExp.prototype.convert = nNop;\nNullExp.prototype.revert = nNop;\nNullExp.prototype.mulTo = nMulTo;\nNullExp.prototype.sqrTo = nSqrTo; //(public) this^e\n\nfunction bnPow(e) {\n return this.exp(e, new NullExp());\n} //(protected) r = lower n words of \"this * a\", a.t <= n\n//\"this\" should be the larger one if appropriate.\n\n\nfunction bnpMultiplyLowerTo(a, n, r) {\n var i = Math.min(this.t + a.t, n);\n r.s = 0; // assumes a,this >= 0\n\n r.t = i;\n\n while (i > 0) {\n r[--i] = 0;\n }\n\n var j;\n\n for (j = r.t - this.t; i < j; ++i) {\n r[i + this.t] = this.am(0, a[i], r, i, 0, this.t);\n }\n\n for (j = Math.min(a.t, n); i < j; ++i) {\n this.am(0, a[i], r, i, 0, n - i);\n }\n\n r.clamp();\n} //(protected) r = \"this * a\" without lower n words, n > 0\n//\"this\" should be the larger one if appropriate.\n\n\nfunction bnpMultiplyUpperTo(a, n, r) {\n --n;\n var i = r.t = this.t + a.t - n;\n r.s = 0; // assumes a,this >= 0\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = Math.max(n - this.t, 0); i < a.t; ++i) {\n r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n);\n }\n\n r.clamp();\n r.drShiftTo(1, r);\n} //Barrett modular reduction\n\n\nfunction Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2 * m.t, this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n}\n\nfunction barrettConvert(x) {\n if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m);else if (x.compareTo(this.m) < 0) return x;else {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n}\n\nfunction barrettRevert(x) {\n return x;\n} //x = x mod m (HAC 14.42)\n\n\nfunction barrettReduce(x) {\n x.drShiftTo(this.m.t - 1, this.r2);\n\n if (x.t > this.m.t + 1) {\n x.t = this.m.t + 1;\n x.clamp();\n }\n\n this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3);\n this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2);\n\n while (x.compareTo(this.r2) < 0) {\n x.dAddOffset(1, this.m.t + 1);\n }\n\n x.subTo(this.r2, x);\n\n while (x.compareTo(this.m) >= 0) {\n x.subTo(this.m, x);\n }\n} //r = x^2 mod m; x != r\n\n\nfunction barrettSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n} //r = x*y mod m; x,y != r\n\n\nfunction barrettMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\n\nBarrett.prototype.convert = barrettConvert;\nBarrett.prototype.revert = barrettRevert;\nBarrett.prototype.reduce = barrettReduce;\nBarrett.prototype.mulTo = barrettMulTo;\nBarrett.prototype.sqrTo = barrettSqrTo; //(public) this^e % m (HAC 14.85)\n\nfunction bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m); // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) === 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) === 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n return z.revert(r);\n} //(public) gcd(this,a) (HAC 14.54)\n\n\nfunction bnGCD(a) {\n var x = this.s < 0 ? this.negate() : this.clone();\n var y = a.s < 0 ? a.negate() : a.clone();\n\n if (x.compareTo(y) < 0) {\n var t = x;\n x = y;\n y = t;\n }\n\n var i = x.getLowestSetBit(),\n g = y.getLowestSetBit();\n if (g < 0) return x;\n if (i < g) g = i;\n\n if (g > 0) {\n x.rShiftTo(g, x);\n y.rShiftTo(g, y);\n }\n\n while (x.signum() > 0) {\n if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x);\n if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y);\n\n if (x.compareTo(y) >= 0) {\n x.subTo(y, x);\n x.rShiftTo(1, x);\n } else {\n y.subTo(x, y);\n y.rShiftTo(1, y);\n }\n }\n\n if (g > 0) y.lShiftTo(g, y);\n return y;\n} //(protected) this % n, n < 2^26\n\n\nfunction bnpModInt(n) {\n if (n <= 0) return 0;\n var d = this.DV % n,\n r = this.s < 0 ? n - 1 : 0;\n if (this.t > 0) if (d === 0) r = this[0] % n;else for (var i = this.t - 1; i >= 0; --i) {\n r = (d * r + this[i]) % n;\n }\n return r;\n} //(public) 1/this % m (HAC 14.61)\n\n\nfunction bnModInverse(m) {\n var ac = m.isEven();\n if (this.isEven() && ac || m.signum() === 0) return BigInteger.ZERO;\n var u = m.clone(),\n v = this.clone();\n var a = nbv(1),\n b = nbv(0),\n c = nbv(0),\n d = nbv(1);\n\n while (u.signum() != 0) {\n while (u.isEven()) {\n u.rShiftTo(1, u);\n\n if (ac) {\n if (!a.isEven() || !b.isEven()) {\n a.addTo(this, a);\n b.subTo(m, b);\n }\n\n a.rShiftTo(1, a);\n } else if (!b.isEven()) b.subTo(m, b);\n\n b.rShiftTo(1, b);\n }\n\n while (v.isEven()) {\n v.rShiftTo(1, v);\n\n if (ac) {\n if (!c.isEven() || !d.isEven()) {\n c.addTo(this, c);\n d.subTo(m, d);\n }\n\n c.rShiftTo(1, c);\n } else if (!d.isEven()) d.subTo(m, d);\n\n d.rShiftTo(1, d);\n }\n\n if (u.compareTo(v) >= 0) {\n u.subTo(v, u);\n if (ac) a.subTo(c, a);\n b.subTo(d, b);\n } else {\n v.subTo(u, v);\n if (ac) c.subTo(a, c);\n d.subTo(b, d);\n }\n }\n\n if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if (d.compareTo(m) >= 0) return d.subtract(m);\n if (d.signum() < 0) d.addTo(m, d);else return d;\n if (d.signum() < 0) return d.add(m);else return d;\n}\n\nvar lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];\nvar lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; //(public) test primality with certainty >= 1-.5^t\n\nfunction bnIsProbablePrime(t) {\n var i,\n x = this.abs();\n\n if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {\n for (i = 0; i < lowprimes.length; ++i) {\n if (x[0] == lowprimes[i]) return true;\n }\n\n return false;\n }\n\n if (x.isEven()) return false;\n i = 1;\n\n while (i < lowprimes.length) {\n var m = lowprimes[i],\n j = i + 1;\n\n while (j < lowprimes.length && m < lplim) {\n m *= lowprimes[j++];\n }\n\n m = x.modInt(m);\n\n while (i < j) {\n if (m % lowprimes[i++] === 0) return false;\n }\n }\n\n return x.millerRabin(t);\n} //(protected) true if probably prime (HAC 4.24, Miller-Rabin)\n\n\nfunction bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if (k <= 0) return false;\n var r = n1.shiftRight(k);\n t = t + 1 >> 1;\n if (t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n\n for (var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]);\n var y = a.modPow(r, this);\n\n if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n\n while (j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2, this);\n if (y.compareTo(BigInteger.ONE) === 0) return false;\n }\n\n if (y.compareTo(n1) != 0) return false;\n }\n }\n\n return true;\n} // protected\n\n\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.fromByteArray = bnpFromByteArray;\nBigInteger.prototype.fromBuffer = bnpFromBuffer;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.isEven = bnpIsEven;\nBigInteger.prototype.exp = bnpExp;\nBigInteger.prototype.chunkSize = bnpChunkSize;\nBigInteger.prototype.toRadix = bnpToRadix;\nBigInteger.prototype.fromRadix = bnpFromRadix;\nBigInteger.prototype.fromNumber = bnpFromNumber;\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\nBigInteger.prototype.changeBit = bnpChangeBit;\nBigInteger.prototype.addTo = bnpAddTo;\nBigInteger.prototype.dMultiply = bnpDMultiply;\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\nBigInteger.prototype.modInt = bnpModInt;\nBigInteger.prototype.millerRabin = bnpMillerRabin; // public\n\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.modPowInt = bnModPowInt;\nBigInteger.prototype.clone = bnClone;\nBigInteger.prototype.intValue = bnIntValue;\nBigInteger.prototype.byteValue = bnByteValue;\nBigInteger.prototype.shortValue = bnShortValue;\nBigInteger.prototype.signum = bnSigNum;\nBigInteger.prototype.toByteArray = bnToByteArray;\nBigInteger.prototype.toBuffer = bnToBuffer;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.min = bnMin;\nBigInteger.prototype.max = bnMax;\nBigInteger.prototype.and = bnAnd;\nBigInteger.prototype.or = bnOr;\nBigInteger.prototype.xor = bnXor;\nBigInteger.prototype.andNot = bnAndNot;\nBigInteger.prototype.not = bnNot;\nBigInteger.prototype.shiftLeft = bnShiftLeft;\nBigInteger.prototype.shiftRight = bnShiftRight;\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\nBigInteger.prototype.bitCount = bnBitCount;\nBigInteger.prototype.testBit = bnTestBit;\nBigInteger.prototype.setBit = bnSetBit;\nBigInteger.prototype.clearBit = bnClearBit;\nBigInteger.prototype.flipBit = bnFlipBit;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.remainder = bnRemainder;\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\nBigInteger.prototype.modPow = bnModPow;\nBigInteger.prototype.modInverse = bnModInverse;\nBigInteger.prototype.pow = bnPow;\nBigInteger.prototype.gcd = bnGCD;\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\nBigInteger.int2char = int2char; // \"constants\"\n\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1); // JSBN-specific extension\n\nBigInteger.prototype.square = bnSquare; //BigInteger interfaces not implemented in jsbn:\n//BigInteger(int signum, byte[] magnitude)\n//double doubleValue()\n//float floatValue()\n//int hashCode()\n//long longValue()\n//static BigInteger valueOf(long val)\n\nmodule.exports = BigInteger;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/libs/jsbn.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/libs/rsa.js": /*!***********************************************!*\ !*** ./node_modules/node-rsa/src/libs/rsa.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\n * RSA Encryption / Decryption with PKCS1 v2 Padding.\n * \n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. \n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n/*\n * Node.js adaptation\n * long message support implementation\n * signing/verifying\n *\n * 2014 rzcoder\n */\nvar _ = __webpack_require__(/*! ../utils */ \"./node_modules/node-rsa/src/utils.js\")._;\n\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar BigInteger = __webpack_require__(/*! ./jsbn.js */ \"./node_modules/node-rsa/src/libs/jsbn.js\");\n\nvar utils = __webpack_require__(/*! ../utils.js */ \"./node_modules/node-rsa/src/utils.js\");\n\nvar schemes = __webpack_require__(/*! ../schemes/schemes.js */ \"./node_modules/node-rsa/src/schemes/schemes.js\");\n\nvar encryptEngines = __webpack_require__(/*! ../encryptEngines/encryptEngines.js */ \"./node_modules/node-rsa/src/encryptEngines/encryptEngines.js\");\n\nexports.BigInteger = BigInteger;\n\nmodule.exports.Key = function () {\n /**\n * RSA key constructor\n *\n * n - modulus\n * e - publicExponent\n * d - privateExponent\n * p - prime1\n * q - prime2\n * dmp1 - exponent1 -- d mod (p1)\n * dmq1 - exponent2 -- d mod (q-1)\n * coeff - coefficient -- (inverse of q) mod p\n */\n function RSAKey() {\n this.n = null;\n this.e = 0;\n this.d = null;\n this.p = null;\n this.q = null;\n this.dmp1 = null;\n this.dmq1 = null;\n this.coeff = null;\n }\n\n RSAKey.prototype.setOptions = function (options) {\n var signingSchemeProvider = schemes[options.signingScheme];\n var encryptionSchemeProvider = schemes[options.encryptionScheme];\n\n if (signingSchemeProvider === encryptionSchemeProvider) {\n this.signingScheme = this.encryptionScheme = encryptionSchemeProvider.makeScheme(this, options);\n } else {\n this.encryptionScheme = encryptionSchemeProvider.makeScheme(this, options);\n this.signingScheme = signingSchemeProvider.makeScheme(this, options);\n }\n\n this.encryptEngine = encryptEngines.getEngine(this, options);\n };\n /**\n * Generate a new random private key B bits long, using public expt E\n * @param B\n * @param E\n */\n\n\n RSAKey.prototype.generate = function (B, E) {\n var qs = B >> 1;\n this.e = parseInt(E, 16);\n var ee = new BigInteger(E, 16);\n\n while (true) {\n while (true) {\n this.p = new BigInteger(B - qs, 1);\n if (this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) === 0 && this.p.isProbablePrime(10)) break;\n }\n\n while (true) {\n this.q = new BigInteger(qs, 1);\n if (this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) === 0 && this.q.isProbablePrime(10)) break;\n }\n\n if (this.p.compareTo(this.q) <= 0) {\n var t = this.p;\n this.p = this.q;\n this.q = t;\n }\n\n var p1 = this.p.subtract(BigInteger.ONE);\n var q1 = this.q.subtract(BigInteger.ONE);\n var phi = p1.multiply(q1);\n\n if (phi.gcd(ee).compareTo(BigInteger.ONE) === 0) {\n this.n = this.p.multiply(this.q);\n\n if (this.n.bitLength() < B) {\n continue;\n }\n\n this.d = ee.modInverse(phi);\n this.dmp1 = this.d.mod(p1);\n this.dmq1 = this.d.mod(q1);\n this.coeff = this.q.modInverse(this.p);\n break;\n }\n }\n\n this.$$recalculateCache();\n };\n /**\n * Set the private key fields N, e, d and CRT params from buffers\n *\n * @param N\n * @param E\n * @param D\n * @param P\n * @param Q\n * @param DP\n * @param DQ\n * @param C\n */\n\n\n RSAKey.prototype.setPrivate = function (N, E, D, P, Q, DP, DQ, C) {\n if (N && E && D && N.length > 0 && (_.isNumber(E) || E.length > 0) && D.length > 0) {\n this.n = new BigInteger(N);\n this.e = _.isNumber(E) ? E : utils.get32IntFromBuffer(E, 0);\n this.d = new BigInteger(D);\n\n if (P && Q && DP && DQ && C) {\n this.p = new BigInteger(P);\n this.q = new BigInteger(Q);\n this.dmp1 = new BigInteger(DP);\n this.dmq1 = new BigInteger(DQ);\n this.coeff = new BigInteger(C);\n } else {// TODO: re-calculate any missing CRT params\n }\n\n this.$$recalculateCache();\n } else {\n throw Error(\"Invalid RSA private key\");\n }\n };\n /**\n * Set the public key fields N and e from hex strings\n * @param N\n * @param E\n */\n\n\n RSAKey.prototype.setPublic = function (N, E) {\n if (N && E && N.length > 0 && (_.isNumber(E) || E.length > 0)) {\n this.n = new BigInteger(N);\n this.e = _.isNumber(E) ? E : utils.get32IntFromBuffer(E, 0);\n this.$$recalculateCache();\n } else {\n throw Error(\"Invalid RSA public key\");\n }\n };\n /**\n * private\n * Perform raw private operation on \"x\": return x^d (mod n)\n *\n * @param x\n * @returns {*}\n */\n\n\n RSAKey.prototype.$doPrivate = function (x) {\n if (this.p || this.q) {\n return x.modPow(this.d, this.n);\n } // TODO: re-calculate any missing CRT params\n\n\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while (xp.compareTo(xq) < 0) {\n xp = xp.add(this.p);\n }\n\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n };\n /**\n * private\n * Perform raw public operation on \"x\": return x^e (mod n)\n *\n * @param x\n * @returns {*}\n */\n\n\n RSAKey.prototype.$doPublic = function (x) {\n return x.modPowInt(this.e, this.n);\n };\n /**\n * Return the PKCS#1 RSA encryption of buffer\n * @param buffer {Buffer}\n * @returns {Buffer}\n */\n\n\n RSAKey.prototype.encrypt = function (buffer, usePrivate) {\n var buffers = [];\n var results = [];\n var bufferSize = buffer.length;\n var buffersCount = Math.ceil(bufferSize / this.maxMessageLength) || 1; // total buffers count for encrypt\n\n var dividedSize = Math.ceil(bufferSize / buffersCount || 1); // each buffer size\n\n if (buffersCount == 1) {\n buffers.push(buffer);\n } else {\n for (var bufNum = 0; bufNum < buffersCount; bufNum++) {\n buffers.push(buffer.slice(bufNum * dividedSize, (bufNum + 1) * dividedSize));\n }\n }\n\n for (var i = 0; i < buffers.length; i++) {\n results.push(this.encryptEngine.encrypt(buffers[i], usePrivate));\n }\n\n return Buffer.concat(results);\n };\n /**\n * Return the PKCS#1 RSA decryption of buffer\n * @param buffer {Buffer}\n * @returns {Buffer}\n */\n\n\n RSAKey.prototype.decrypt = function (buffer, usePublic) {\n if (buffer.length % this.encryptedDataLength > 0) {\n throw Error('Incorrect data or key');\n }\n\n var result = [];\n var offset = 0;\n var length = 0;\n var buffersCount = buffer.length / this.encryptedDataLength;\n\n for (var i = 0; i < buffersCount; i++) {\n offset = i * this.encryptedDataLength;\n length = offset + this.encryptedDataLength;\n result.push(this.encryptEngine.decrypt(buffer.slice(offset, Math.min(length, buffer.length)), usePublic));\n }\n\n return Buffer.concat(result);\n };\n\n RSAKey.prototype.sign = function (buffer) {\n return this.signingScheme.sign.apply(this.signingScheme, arguments);\n };\n\n RSAKey.prototype.verify = function (buffer, signature, signature_encoding) {\n return this.signingScheme.verify.apply(this.signingScheme, arguments);\n };\n /**\n * Check if key pair contains private key\n */\n\n\n RSAKey.prototype.isPrivate = function () {\n return this.n && this.e && this.d || false;\n };\n /**\n * Check if key pair contains public key\n * @param strict {boolean} - public key only, return false if have private exponent\n */\n\n\n RSAKey.prototype.isPublic = function (strict) {\n return this.n && this.e && !(strict && this.d) || false;\n };\n\n Object.defineProperty(RSAKey.prototype, 'keySize', {\n get: function get() {\n return this.cache.keyBitLength;\n }\n });\n Object.defineProperty(RSAKey.prototype, 'encryptedDataLength', {\n get: function get() {\n return this.cache.keyByteLength;\n }\n });\n Object.defineProperty(RSAKey.prototype, 'maxMessageLength', {\n get: function get() {\n return this.encryptionScheme.maxMessageLength();\n }\n });\n /**\n * Caching key data\n */\n\n RSAKey.prototype.$$recalculateCache = function () {\n this.cache = this.cache || {}; // Bit & byte length\n\n this.cache.keyBitLength = this.n.bitLength();\n this.cache.keyByteLength = this.cache.keyBitLength + 6 >> 3;\n };\n\n return RSAKey;\n}();\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/libs/rsa.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/schemes/oaep.js": /*!***************************************************!*\ !*** ./node_modules/node-rsa/src/schemes/oaep.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * PKCS_OAEP signature scheme\n */\nvar BigInteger = __webpack_require__(/*! ../libs/jsbn */ \"./node_modules/node-rsa/src/libs/jsbn.js\");\n\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nmodule.exports = {\n isEncryption: true,\n isSignature: false\n};\nmodule.exports.digestLength = {\n md4: 16,\n md5: 16,\n ripemd160: 20,\n rmd160: 20,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64\n};\nvar DEFAULT_HASH_FUNCTION = 'sha1';\n/*\n * OAEP Mask Generation Function 1\n * Generates a buffer full of pseudorandom bytes given seed and maskLength.\n * Giving the same seed, maskLength, and hashFunction will result in the same exact byte values in the buffer.\n *\n * https://tools.ietf.org/html/rfc3447#appendix-B.2.1\n *\n * Parameters:\n * seed\t\t\t[Buffer]\tThe pseudo random seed for this function\n * maskLength\t[int]\t\tThe length of the output\n * hashFunction\t[String]\tThe hashing function to use. Will accept any valid crypto hash. Default \"sha1\"\n *\t\tSupports \"sha1\" and \"sha256\".\n *\t\tTo add another algorythm the algorythem must be accepted by crypto.createHash, and then the length of the output of the hash function (the digest) must be added to the digestLength object below.\n *\t\tMost RSA implementations will be expecting sha1\n */\n\nmodule.exports.eme_oaep_mgf1 = function (seed, maskLength, hashFunction) {\n hashFunction = hashFunction || DEFAULT_HASH_FUNCTION;\n var hLen = module.exports.digestLength[hashFunction];\n var count = Math.ceil(maskLength / hLen);\n var T = Buffer.alloc(hLen * count);\n var c = Buffer.alloc(4);\n\n for (var i = 0; i < count; ++i) {\n var hash = crypt.createHash(hashFunction);\n hash.update(seed);\n c.writeUInt32BE(i, 0);\n hash.update(c);\n hash.digest().copy(T, i * hLen);\n }\n\n return T.slice(0, maskLength);\n};\n\nmodule.exports.makeScheme = function (key, options) {\n function Scheme(key, options) {\n this.key = key;\n this.options = options;\n }\n\n Scheme.prototype.maxMessageLength = function () {\n return this.key.encryptedDataLength - 2 * module.exports.digestLength[this.options.encryptionSchemeOptions.hash || DEFAULT_HASH_FUNCTION] - 2;\n };\n /**\n * Pad input\n * alg: PKCS1_OAEP\n *\n * https://tools.ietf.org/html/rfc3447#section-7.1.1\n */\n\n\n Scheme.prototype.encPad = function (buffer) {\n var hash = this.options.encryptionSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n var mgf = this.options.encryptionSchemeOptions.mgf || module.exports.eme_oaep_mgf1;\n var label = this.options.encryptionSchemeOptions.label || Buffer.alloc(0);\n var emLen = this.key.encryptedDataLength;\n var hLen = module.exports.digestLength[hash]; // Make sure we can put message into an encoded message of emLen bytes\n\n if (buffer.length > emLen - 2 * hLen - 2) {\n throw new Error(\"Message is too long to encode into an encoded message with a length of \" + emLen + \" bytes, increase\" + \"emLen to fix this error (minimum value for given parameters and options: \" + (emLen - 2 * hLen - 2) + \")\");\n }\n\n var lHash = crypt.createHash(hash);\n lHash.update(label);\n lHash = lHash.digest();\n var PS = Buffer.alloc(emLen - buffer.length - 2 * hLen - 1); // Padding \"String\"\n\n PS.fill(0); // Fill the buffer with octets of 0\n\n PS[PS.length - 1] = 1;\n var DB = Buffer.concat([lHash, PS, buffer]);\n var seed = crypt.randomBytes(hLen); // mask = dbMask\n\n var mask = mgf(seed, DB.length, hash); // XOR DB and dbMask together.\n\n for (var i = 0; i < DB.length; i++) {\n DB[i] ^= mask[i];\n } // DB = maskedDB\n // mask = seedMask\n\n\n mask = mgf(DB, hLen, hash); // XOR seed and seedMask together.\n\n for (i = 0; i < seed.length; i++) {\n seed[i] ^= mask[i];\n } // seed = maskedSeed\n\n\n var em = Buffer.alloc(1 + seed.length + DB.length);\n em[0] = 0;\n seed.copy(em, 1);\n DB.copy(em, 1 + seed.length);\n return em;\n };\n /**\n * Unpad input\n * alg: PKCS1_OAEP\n *\n * Note: This method works within the buffer given and modifies the values. It also returns a slice of the EM as the return Message.\n * If the implementation requires that the EM parameter be unmodified then the implementation should pass in a clone of the EM buffer.\n *\n * https://tools.ietf.org/html/rfc3447#section-7.1.2\n */\n\n\n Scheme.prototype.encUnPad = function (buffer) {\n var hash = this.options.encryptionSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n var mgf = this.options.encryptionSchemeOptions.mgf || module.exports.eme_oaep_mgf1;\n var label = this.options.encryptionSchemeOptions.label || Buffer.alloc(0);\n var hLen = module.exports.digestLength[hash]; // Check to see if buffer is a properly encoded OAEP message\n\n if (buffer.length < 2 * hLen + 2) {\n throw new Error(\"Error decoding message, the supplied message is not long enough to be a valid OAEP encoded message\");\n }\n\n var seed = buffer.slice(1, hLen + 1); // seed = maskedSeed\n\n var DB = buffer.slice(1 + hLen); // DB = maskedDB\n\n var mask = mgf(DB, hLen, hash); // seedMask\n // XOR maskedSeed and seedMask together to get the original seed.\n\n for (var i = 0; i < seed.length; i++) {\n seed[i] ^= mask[i];\n }\n\n mask = mgf(seed, DB.length, hash); // dbMask\n // XOR DB and dbMask together to get the original data block.\n\n for (i = 0; i < DB.length; i++) {\n DB[i] ^= mask[i];\n }\n\n var lHash = crypt.createHash(hash);\n lHash.update(label);\n lHash = lHash.digest();\n var lHashEM = DB.slice(0, hLen);\n\n if (lHashEM.toString(\"hex\") != lHash.toString(\"hex\")) {\n throw new Error(\"Error decoding message, the lHash calculated from the label provided and the lHash in the encrypted data do not match.\");\n } // Filter out padding\n\n\n i = hLen;\n\n while (DB[i++] === 0 && i < DB.length) {\n ;\n }\n\n if (DB[i - 1] != 1) {\n throw new Error(\"Error decoding message, there is no padding message separator byte\");\n }\n\n return DB.slice(i); // Message\n };\n\n return new Scheme(key, options);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/schemes/oaep.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/schemes/pkcs1.js": /*!****************************************************!*\ !*** ./node_modules/node-rsa/src/schemes/pkcs1.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * PKCS1 padding and signature scheme\n */\nvar BigInteger = __webpack_require__(/*! ../libs/jsbn */ \"./node_modules/node-rsa/src/libs/jsbn.js\");\n\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nvar constants = __webpack_require__(/*! constants */ \"./node_modules/constants-browserify/constants.json\");\n\nvar SIGN_INFO_HEAD = {\n md2: Buffer.from('3020300c06082a864886f70d020205000410', 'hex'),\n md5: Buffer.from('3020300c06082a864886f70d020505000410', 'hex'),\n sha1: Buffer.from('3021300906052b0e03021a05000414', 'hex'),\n sha224: Buffer.from('302d300d06096086480165030402040500041c', 'hex'),\n sha256: Buffer.from('3031300d060960864801650304020105000420', 'hex'),\n sha384: Buffer.from('3041300d060960864801650304020205000430', 'hex'),\n sha512: Buffer.from('3051300d060960864801650304020305000440', 'hex'),\n ripemd160: Buffer.from('3021300906052b2403020105000414', 'hex'),\n rmd160: Buffer.from('3021300906052b2403020105000414', 'hex')\n};\nvar SIGN_ALG_TO_HASH_ALIASES = {\n 'ripemd160': 'rmd160'\n};\nvar DEFAULT_HASH_FUNCTION = 'sha256';\nmodule.exports = {\n isEncryption: true,\n isSignature: true\n};\n\nmodule.exports.makeScheme = function (key, options) {\n function Scheme(key, options) {\n this.key = key;\n this.options = options;\n }\n\n Scheme.prototype.maxMessageLength = function () {\n if (this.options.encryptionSchemeOptions && this.options.encryptionSchemeOptions.padding == constants.RSA_NO_PADDING) {\n return this.key.encryptedDataLength;\n }\n\n return this.key.encryptedDataLength - 11;\n };\n /**\n * Pad input Buffer to encryptedDataLength bytes, and return Buffer.from\n * alg: PKCS#1\n * @param buffer\n * @returns {Buffer}\n */\n\n\n Scheme.prototype.encPad = function (buffer, options) {\n options = options || {};\n var filled;\n\n if (buffer.length > this.key.maxMessageLength) {\n throw new Error(\"Message too long for RSA (n=\" + this.key.encryptedDataLength + \", l=\" + buffer.length + \")\");\n }\n\n if (this.options.encryptionSchemeOptions && this.options.encryptionSchemeOptions.padding == constants.RSA_NO_PADDING) {\n //RSA_NO_PADDING treated like JAVA left pad with zero character\n filled = Buffer.alloc(this.key.maxMessageLength - buffer.length);\n filled.fill(0);\n return Buffer.concat([filled, buffer]);\n }\n /* Type 1: zeros padding for private key encrypt */\n\n\n if (options.type === 1) {\n filled = Buffer.alloc(this.key.encryptedDataLength - buffer.length - 1);\n filled.fill(0xff, 0, filled.length - 1);\n filled[0] = 1;\n filled[filled.length - 1] = 0;\n return Buffer.concat([filled, buffer]);\n } else {\n /* random padding for public key encrypt */\n filled = Buffer.alloc(this.key.encryptedDataLength - buffer.length);\n filled[0] = 0;\n filled[1] = 2;\n var rand = crypt.randomBytes(filled.length - 3);\n\n for (var i = 0; i < rand.length; i++) {\n var r = rand[i];\n\n while (r === 0) {\n // non-zero only\n r = crypt.randomBytes(1)[0];\n }\n\n filled[i + 2] = r;\n }\n\n filled[filled.length - 1] = 0;\n return Buffer.concat([filled, buffer]);\n }\n };\n /**\n * Unpad input Buffer and, if valid, return the Buffer object\n * alg: PKCS#1 (type 2, random)\n * @param buffer\n * @returns {Buffer}\n */\n\n\n Scheme.prototype.encUnPad = function (buffer, options) {\n options = options || {};\n var i = 0;\n\n if (this.options.encryptionSchemeOptions && this.options.encryptionSchemeOptions.padding == constants.RSA_NO_PADDING) {\n //RSA_NO_PADDING treated like JAVA left pad with zero character\n var unPad;\n\n if (typeof buffer.lastIndexOf == \"function\") {\n //patch for old node version\n unPad = buffer.slice(buffer.lastIndexOf('\\0') + 1, buffer.length);\n } else {\n unPad = buffer.slice(String.prototype.lastIndexOf.call(buffer, '\\0') + 1, buffer.length);\n }\n\n return unPad;\n }\n\n if (buffer.length < 4) {\n return null;\n }\n /* Type 1: zeros padding for private key decrypt */\n\n\n if (options.type === 1) {\n if (buffer[0] !== 0 || buffer[1] !== 1) {\n return null;\n }\n\n i = 3;\n\n while (buffer[i] !== 0) {\n if (buffer[i] != 0xFF || ++i >= buffer.length) {\n return null;\n }\n }\n } else {\n /* random padding for public key decrypt */\n if (buffer[0] !== 0 || buffer[1] !== 2) {\n return null;\n }\n\n i = 3;\n\n while (buffer[i] !== 0) {\n if (++i >= buffer.length) {\n return null;\n }\n }\n }\n\n return buffer.slice(i + 1, buffer.length);\n };\n\n Scheme.prototype.sign = function (buffer) {\n var hashAlgorithm = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n\n if (this.options.environment === 'browser') {\n hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES[hashAlgorithm] || hashAlgorithm;\n var hasher = crypt.createHash(hashAlgorithm);\n hasher.update(buffer);\n var hash = this.pkcs1pad(hasher.digest(), hashAlgorithm);\n var res = this.key.$doPrivate(new BigInteger(hash)).toBuffer(this.key.encryptedDataLength);\n return res;\n } else {\n var signer = crypt.createSign('RSA-' + hashAlgorithm.toUpperCase());\n signer.update(buffer);\n return signer.sign(this.options.rsaUtils.exportKey('private'));\n }\n };\n\n Scheme.prototype.verify = function (buffer, signature, signature_encoding) {\n if (this.options.encryptionSchemeOptions && this.options.encryptionSchemeOptions.padding == constants.RSA_NO_PADDING) {\n //RSA_NO_PADDING has no verify data\n return false;\n }\n\n var hashAlgorithm = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n\n if (this.options.environment === 'browser') {\n hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES[hashAlgorithm] || hashAlgorithm;\n\n if (signature_encoding) {\n signature = Buffer.from(signature, signature_encoding);\n }\n\n var hasher = crypt.createHash(hashAlgorithm);\n hasher.update(buffer);\n var hash = this.pkcs1pad(hasher.digest(), hashAlgorithm);\n var m = this.key.$doPublic(new BigInteger(signature));\n return m.toBuffer().toString('hex') == hash.toString('hex');\n } else {\n var verifier = crypt.createVerify('RSA-' + hashAlgorithm.toUpperCase());\n verifier.update(buffer);\n return verifier.verify(this.options.rsaUtils.exportKey('public'), signature, signature_encoding);\n }\n };\n /**\n * PKCS#1 zero pad input buffer to max data length\n * @param hashBuf\n * @param hashAlgorithm\n * @returns {*}\n */\n\n\n Scheme.prototype.pkcs0pad = function (buffer) {\n var filled = Buffer.alloc(this.key.maxMessageLength - buffer.length);\n filled.fill(0);\n return Buffer.concat([filled, buffer]);\n };\n\n Scheme.prototype.pkcs0unpad = function (buffer) {\n var unPad;\n\n if (typeof buffer.lastIndexOf == \"function\") {\n //patch for old node version\n unPad = buffer.slice(buffer.lastIndexOf('\\0') + 1, buffer.length);\n } else {\n unPad = buffer.slice(String.prototype.lastIndexOf.call(buffer, '\\0') + 1, buffer.length);\n }\n\n return unPad;\n };\n /**\n * PKCS#1 pad input buffer to max data length\n * @param hashBuf\n * @param hashAlgorithm\n * @returns {*}\n */\n\n\n Scheme.prototype.pkcs1pad = function (hashBuf, hashAlgorithm) {\n var digest = SIGN_INFO_HEAD[hashAlgorithm];\n\n if (!digest) {\n throw Error('Unsupported hash algorithm');\n }\n\n var data = Buffer.concat([digest, hashBuf]);\n\n if (data.length + 10 > this.key.encryptedDataLength) {\n throw Error('Key is too short for signing algorithm (' + hashAlgorithm + ')');\n }\n\n var filled = Buffer.alloc(this.key.encryptedDataLength - data.length - 1);\n filled.fill(0xff, 0, filled.length - 1);\n filled[0] = 1;\n filled[filled.length - 1] = 0;\n var res = Buffer.concat([filled, data]);\n return res;\n };\n\n return new Scheme(key, options);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/schemes/pkcs1.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/schemes/pss.js": /*!**************************************************!*\ !*** ./node_modules/node-rsa/src/schemes/pss.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * PSS signature scheme\n */\nvar BigInteger = __webpack_require__(/*! ../libs/jsbn */ \"./node_modules/node-rsa/src/libs/jsbn.js\");\n\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n\nmodule.exports = {\n isEncryption: false,\n isSignature: true\n};\nvar DEFAULT_HASH_FUNCTION = 'sha1';\nvar DEFAULT_SALT_LENGTH = 20;\n\nmodule.exports.makeScheme = function (key, options) {\n var OAEP = __webpack_require__(/*! ./schemes */ \"./node_modules/node-rsa/src/schemes/schemes.js\").pkcs1_oaep;\n /**\n * @param key\n * @param options\n * options [Object] An object that contains the following keys that specify certain options for encoding.\n * ā””>signingSchemeOptions\n * ā”œ>hash [String] Hash function to use when encoding and generating masks. Must be a string accepted by node's crypto.createHash function. (default = \"sha1\")\n * ā”œ>mgf [function] The mask generation function to use when encoding. (default = mgf1SHA1)\n * ā””>sLen [uint] The length of the salt to generate. (default = 20)\n * @constructor\n */\n\n\n function Scheme(key, options) {\n this.key = key;\n this.options = options;\n }\n\n Scheme.prototype.sign = function (buffer) {\n var mHash = crypt.createHash(this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION);\n mHash.update(buffer);\n var encoded = this.emsa_pss_encode(mHash.digest(), this.key.keySize - 1);\n return this.key.$doPrivate(new BigInteger(encoded)).toBuffer(this.key.encryptedDataLength);\n };\n\n Scheme.prototype.verify = function (buffer, signature, signature_encoding) {\n if (signature_encoding) {\n signature = Buffer.from(signature, signature_encoding);\n }\n\n signature = new BigInteger(signature);\n var emLen = Math.ceil((this.key.keySize - 1) / 8);\n var m = this.key.$doPublic(signature).toBuffer(emLen);\n var mHash = crypt.createHash(this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION);\n mHash.update(buffer);\n return this.emsa_pss_verify(mHash.digest(), m, this.key.keySize - 1);\n };\n /*\n * https://tools.ietf.org/html/rfc3447#section-9.1.1\n *\n * mHash\t[Buffer]\tHashed message to encode\n * emBits\t[uint]\t\tMaximum length of output in bits. Must be at least 8hLen + 8sLen + 9 (hLen = Hash digest length in bytes | sLen = length of salt in bytes)\n * @returns {Buffer} The encoded message\n */\n\n\n Scheme.prototype.emsa_pss_encode = function (mHash, emBits) {\n var hash = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n var mgf = this.options.signingSchemeOptions.mgf || OAEP.eme_oaep_mgf1;\n var sLen = this.options.signingSchemeOptions.saltLength || DEFAULT_SALT_LENGTH;\n var hLen = OAEP.digestLength[hash];\n var emLen = Math.ceil(emBits / 8);\n\n if (emLen < hLen + sLen + 2) {\n throw new Error(\"Output length passed to emBits(\" + emBits + \") is too small for the options \" + \"specified(\" + hash + \", \" + sLen + \"). To fix this issue increase the value of emBits. (minimum size: \" + (8 * hLen + 8 * sLen + 9) + \")\");\n }\n\n var salt = crypt.randomBytes(sLen);\n var Mapostrophe = Buffer.alloc(8 + hLen + sLen);\n Mapostrophe.fill(0, 0, 8);\n mHash.copy(Mapostrophe, 8);\n salt.copy(Mapostrophe, 8 + mHash.length);\n var H = crypt.createHash(hash);\n H.update(Mapostrophe);\n H = H.digest();\n var PS = Buffer.alloc(emLen - salt.length - hLen - 2);\n PS.fill(0);\n var DB = Buffer.alloc(PS.length + 1 + salt.length);\n PS.copy(DB);\n DB[PS.length] = 0x01;\n salt.copy(DB, PS.length + 1);\n var dbMask = mgf(H, DB.length, hash); // XOR DB and dbMask together\n\n var maskedDB = Buffer.alloc(DB.length);\n\n for (var i = 0; i < dbMask.length; i++) {\n maskedDB[i] = DB[i] ^ dbMask[i];\n }\n\n var bits = 8 * emLen - emBits;\n var mask = 255 ^ 255 >> 8 - bits << 8 - bits;\n maskedDB[0] = maskedDB[0] & mask;\n var EM = Buffer.alloc(maskedDB.length + H.length + 1);\n maskedDB.copy(EM, 0);\n H.copy(EM, maskedDB.length);\n EM[EM.length - 1] = 0xbc;\n return EM;\n };\n /*\n * https://tools.ietf.org/html/rfc3447#section-9.1.2\n *\n * mHash\t[Buffer]\tHashed message\n * EM\t\t[Buffer]\tSignature\n * emBits\t[uint]\t\tLength of EM in bits. Must be at least 8hLen + 8sLen + 9 to be a valid signature. (hLen = Hash digest length in bytes | sLen = length of salt in bytes)\n * @returns {Boolean} True if signature(EM) matches message(M)\n */\n\n\n Scheme.prototype.emsa_pss_verify = function (mHash, EM, emBits) {\n var hash = this.options.signingSchemeOptions.hash || DEFAULT_HASH_FUNCTION;\n var mgf = this.options.signingSchemeOptions.mgf || OAEP.eme_oaep_mgf1;\n var sLen = this.options.signingSchemeOptions.saltLength || DEFAULT_SALT_LENGTH;\n var hLen = OAEP.digestLength[hash];\n var emLen = Math.ceil(emBits / 8);\n\n if (emLen < hLen + sLen + 2 || EM[EM.length - 1] != 0xbc) {\n return false;\n }\n\n var DB = Buffer.alloc(emLen - hLen - 1);\n EM.copy(DB, 0, 0, emLen - hLen - 1);\n var mask = 0;\n\n for (var i = 0, bits = 8 * emLen - emBits; i < bits; i++) {\n mask |= 1 << 7 - i;\n }\n\n if ((DB[0] & mask) !== 0) {\n return false;\n }\n\n var H = EM.slice(emLen - hLen - 1, emLen - 1);\n var dbMask = mgf(H, DB.length, hash); // Unmask DB\n\n for (i = 0; i < DB.length; i++) {\n DB[i] ^= dbMask[i];\n }\n\n bits = 8 * emLen - emBits;\n mask = 255 ^ 255 >> 8 - bits << 8 - bits;\n DB[0] = DB[0] & mask; // Filter out padding\n\n for (i = 0; DB[i] === 0 && i < DB.length; i++) {\n ;\n }\n\n if (DB[i] != 1) {\n return false;\n }\n\n var salt = DB.slice(DB.length - sLen);\n var Mapostrophe = Buffer.alloc(8 + hLen + sLen);\n Mapostrophe.fill(0, 0, 8);\n mHash.copy(Mapostrophe, 8);\n salt.copy(Mapostrophe, 8 + mHash.length);\n var Hapostrophe = crypt.createHash(hash);\n Hapostrophe.update(Mapostrophe);\n Hapostrophe = Hapostrophe.digest();\n return H.toString(\"hex\") === Hapostrophe.toString(\"hex\");\n };\n\n return new Scheme(key, options);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/schemes/pss.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/schemes/schemes.js": /*!******************************************************!*\ !*** ./node_modules/node-rsa/src/schemes/schemes.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = {\n pkcs1: __webpack_require__(/*! ./pkcs1 */ \"./node_modules/node-rsa/src/schemes/pkcs1.js\"),\n pkcs1_oaep: __webpack_require__(/*! ./oaep */ \"./node_modules/node-rsa/src/schemes/oaep.js\"),\n pss: __webpack_require__(/*! ./pss */ \"./node_modules/node-rsa/src/schemes/pss.js\"),\n\n /**\n * Check if scheme has padding methods\n * @param scheme {string}\n * @returns {Boolean}\n */\n isEncryption: function isEncryption(scheme) {\n return module.exports[scheme] && module.exports[scheme].isEncryption;\n },\n\n /**\n * Check if scheme has sign/verify methods\n * @param scheme {string}\n * @returns {Boolean}\n */\n isSignature: function isSignature(scheme) {\n return module.exports[scheme] && module.exports[scheme].isSignature;\n }\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/schemes/schemes.js?"); /***/ }), /***/ "./node_modules/node-rsa/src/utils.js": /*!********************************************!*\ !*** ./node_modules/node-rsa/src/utils.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(process) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*\n * Utils functions\n *\n */\nvar crypt = __webpack_require__(/*! crypto */ \"./node_modules/crypto-browserify/index.js\");\n/**\n * Break string str each maxLen symbols\n * @param str\n * @param maxLen\n * @returns {string}\n */\n\n\nmodule.exports.linebrk = function (str, maxLen) {\n var res = '';\n var i = 0;\n\n while (i + maxLen < str.length) {\n res += str.substring(i, i + maxLen) + \"\\n\";\n i += maxLen;\n }\n\n return res + str.substring(i, str.length);\n};\n\nmodule.exports.detectEnvironment = function () {\n if (typeof window !== 'undefined' && window && !(process && process.title === 'node')) {\n return 'browser';\n }\n\n return 'node';\n};\n/**\n * Trying get a 32-bit unsigned integer from the partial buffer\n * @param buffer\n * @param offset\n * @returns {Number}\n */\n\n\nmodule.exports.get32IntFromBuffer = function (buffer, offset) {\n offset = offset || 0;\n var size = 0;\n\n if ((size = buffer.length - offset) > 0) {\n if (size >= 4) {\n return buffer.readUInt32BE(offset);\n } else {\n var res = 0;\n\n for (var i = offset + size, d = 0; i > offset; i--, d += 2) {\n res += buffer[i - 1] * Math.pow(16, d);\n }\n\n return res;\n }\n } else {\n return NaN;\n }\n};\n\nmodule.exports._ = {\n isObject: function isObject(value) {\n var type = _typeof(value);\n\n return !!value && (type == 'object' || type == 'function');\n },\n isString: function isString(value) {\n return typeof value == 'string' || value instanceof String;\n },\n isNumber: function isNumber(value) {\n return typeof value == 'number' || !isNaN(parseFloat(value)) && isFinite(value);\n },\n\n /**\n * Returns copy of `obj` without `removeProp` field.\n * @param obj\n * @param removeProp\n * @returns Object\n */\n omit: function omit(obj, removeProp) {\n var newObj = {};\n\n for (var prop in obj) {\n if (!obj.hasOwnProperty(prop) || prop === removeProp) {\n continue;\n }\n\n newObj[prop] = obj[prop];\n }\n\n return newObj;\n }\n};\n/**\n * Strips everything around the opening and closing lines, including the lines\n * themselves.\n */\n\nmodule.exports.trimSurroundingText = function (data, opening, closing) {\n var trimStartIndex = 0;\n var trimEndIndex = data.length;\n var openingBoundaryIndex = data.indexOf(opening);\n\n if (openingBoundaryIndex >= 0) {\n trimStartIndex = openingBoundaryIndex + opening.length;\n }\n\n var closingBoundaryIndex = data.indexOf(closing, openingBoundaryIndex);\n\n if (closingBoundaryIndex >= 0) {\n trimEndIndex = closingBoundaryIndex;\n }\n\n return data.substring(trimStartIndex, trimEndIndex);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/node-rsa/src/utils.js?"); /***/ }), /***/ "./node_modules/object-assign/index.js": /*!*********************************************!*\ !*** ./node_modules/object-assign/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n/* eslint-disable no-unused-vars */\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined');\n }\n\n return Object(val);\n}\n\nfunction shouldUseNative() {\n try {\n if (!Object.assign) {\n return false;\n } // Detect buggy property enumeration order in older V8 versions.\n // https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\n\n var test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\n test1[5] = 'de';\n\n if (Object.getOwnPropertyNames(test1)[0] === '5') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test2 = {};\n\n for (var i = 0; i < 10; i++) {\n test2['_' + String.fromCharCode(i)] = i;\n }\n\n var order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n return test2[n];\n });\n\n if (order2.join('') !== '0123456789') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test3 = {};\n 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n test3[letter] = letter;\n });\n\n if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {\n return false;\n }\n\n return true;\n } catch (err) {\n // We don't expect any of the above to throw, but better to be safe.\n return false;\n }\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n var from;\n var to = toObject(target);\n var symbols;\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s]);\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from);\n\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]];\n }\n }\n }\n }\n\n return to;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/object-assign/index.js?"); /***/ }), /***/ "./node_modules/os-browserify/browser.js": /*!***********************************************!*\ !*** ./node_modules/os-browserify/browser.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("exports.endianness = function () {\n return 'LE';\n};\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname;\n } else return '';\n};\n\nexports.loadavg = function () {\n return [];\n};\n\nexports.uptime = function () {\n return 0;\n};\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () {\n return [];\n};\n\nexports.type = function () {\n return 'Browser';\n};\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n\n return '';\n};\n\nexports.networkInterfaces = exports.getNetworkInterfaces = function () {\n return {};\n};\n\nexports.arch = function () {\n return 'javascript';\n};\n\nexports.platform = function () {\n return 'browser';\n};\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n return '/';\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/os-browserify/browser.js?"); /***/ }), /***/ "./node_modules/pako/lib/utils/common.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/utils/common.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar TYPED_OK = typeof Uint8Array !== 'undefined' && typeof Uint16Array !== 'undefined' && typeof Int32Array !== 'undefined';\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj\n/*from1, from2, from3, ...*/\n) {\n var sources = Array.prototype.slice.call(arguments, 1);\n\n while (sources.length) {\n var source = sources.shift();\n\n if (!source) {\n continue;\n }\n\n if (_typeof(source) !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n}; // reduce buffer size, avoiding mem copy\n\n\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) {\n return buf;\n }\n\n if (buf.subarray) {\n return buf.subarray(0, size);\n }\n\n buf.length = size;\n return buf;\n};\n\nvar fnTyped = {\n arraySet: function arraySet(dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n } // Fallback to ordinary array\n\n\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function flattenChunks(chunks) {\n var i, l, len, pos, chunk, result; // calculate data length\n\n len = 0;\n\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n } // join chunks\n\n\n result = new Uint8Array(len);\n pos = 0;\n\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\nvar fnUntyped = {\n arraySet: function arraySet(dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function flattenChunks(chunks) {\n return [].concat.apply([], chunks);\n }\n}; // Enable/Disable typed arrays use, for testing\n//\n\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/utils/common.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/adler32.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/zlib/adler32.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = adler & 0xffff | 0,\n s2 = adler >>> 16 & 0xffff | 0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] | 0;\n s2 = s2 + s1 | 0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 | 0;\n}\n\nmodule.exports = adler32;\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/adler32.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/constants.js": /*!*************************************************!*\ !*** ./node_modules/pako/lib/zlib/constants.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type\n\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/constants.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/crc32.js": /*!*********************************************!*\ !*** ./node_modules/pako/lib/zlib/crc32.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n// Use ordinary array, since untyped makes no boost here\n\nfunction makeTable() {\n var c,\n table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;\n }\n\n table[n] = c;\n }\n\n return table;\n} // Create table on load. Just 255 signed longs. Not a problem.\n\n\nvar crcTable = makeTable();\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return crc ^ -1; // >>> 0;\n}\n\nmodule.exports = crc32;\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/crc32.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/deflate.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/zlib/deflate.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n\nvar trees = __webpack_require__(/*! ./trees */ \"./node_modules/pako/lib/zlib/trees.js\");\n\nvar adler32 = __webpack_require__(/*! ./adler32 */ \"./node_modules/pako/lib/zlib/adler32.js\");\n\nvar crc32 = __webpack_require__(/*! ./crc32 */ \"./node_modules/pako/lib/zlib/crc32.js\");\n\nvar msg = __webpack_require__(/*! ./messages */ \"./node_modules/pako/lib/zlib/messages.js\");\n/* Public constants ==========================================================*/\n\n/* ===========================================================================*/\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n\n\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1; //var Z_SYNC_FLUSH = 2;\n\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5; //var Z_TREES = 6;\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1; //var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\n\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3; //var Z_MEM_ERROR = -4;\n\nvar Z_BUF_ERROR = -5; //var Z_VERSION_ERROR = -6;\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\n\nvar Z_DEFAULT_COMPRESSION = -1;\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\n\nvar Z_UNKNOWN = 2;\n/* The deflate compression method */\n\nvar Z_DEFLATED = 8;\n/*============================================================================*/\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\n\nvar DEF_MEM_LEVEL = 8;\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;\nvar PRESET_DICT = 0x20;\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\nvar BS_NEED_MORE = 1;\n/* block not completed, need more input or more output */\n\nvar BS_BLOCK_DONE = 2;\n/* block flush performed */\n\nvar BS_FINISH_STARTED = 3;\n/* finish started, need only more output at next deflate */\n\nvar BS_FINISH_DONE = 4;\n/* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return (f << 1) - (f > 4 ? 9 : 0);\n}\n\nfunction zero(buf) {\n var len = buf.length;\n\n while (--len >= 0) {\n buf[len] = 0;\n }\n}\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\n\n\nfunction flush_pending(strm) {\n var s = strm.state; //_tr_flush_bits(s);\n\n var len = s.pending;\n\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n\n if (len === 0) {\n return;\n }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);\n\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\n\n\nfunction putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\n\n\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) {\n len = size;\n }\n\n if (len === 0) {\n return 0;\n }\n\n strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len);\n\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n return len;\n}\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\n\n\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length;\n /* max hash chain length */\n\n var scan = s.strstart;\n /* current string */\n\n var match;\n /* matched string */\n\n var len;\n /* length of current match */\n\n var best_len = s.prev_length;\n /* best match length so far */\n\n var nice_match = s.nice_match;\n /* stop if match long enough */\n\n var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0\n /*NIL*/\n ;\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n\n\n if (nice_match > s.lookahead) {\n nice_match = s.lookahead;\n } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {\n continue;\n }\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n\n\n scan += 2;\n match++; // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n\n if (len >= nice_match) {\n break;\n }\n\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n\n return s.lookahead;\n}\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\n\n\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n}\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\n\n\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n\n\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);\n\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n } //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n\n\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_NEED_MORE;\n}\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\n\n\nfunction deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\n\n\nfunction deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\n\n\nfunction deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\n\n\nfunction deflate_huff(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n break;\n /* flush the current block */\n }\n }\n /* Output a literal byte */\n\n\n s.match_length = 0; //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\n\n\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\nconfiguration_table = [\n/* good lazy nice chain */\nnew Config(0, 0, 0, 0, deflate_stored),\n/* 0 store only */\nnew Config(4, 4, 8, 4, deflate_fast),\n/* 1 max speed, no lazy matches */\nnew Config(4, 5, 16, 8, deflate_fast),\n/* 2 */\nnew Config(4, 6, 32, 32, deflate_fast),\n/* 3 */\nnew Config(4, 4, 16, 16, deflate_slow),\n/* 4 lazy matches */\nnew Config(8, 16, 32, 32, deflate_slow),\n/* 5 */\nnew Config(8, 16, 128, 128, deflate_slow),\n/* 6 */\nnew Config(8, 32, 128, 256, deflate_slow),\n/* 7 */\nnew Config(32, 128, 258, 1024, deflate_slow),\n/* 8 */\nnew Config(32, 258, 258, 4096, deflate_slow)\n/* 9 max compression */\n];\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\n\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n /*** CLEAR_HASH(s); ***/\n\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\nfunction DeflateState() {\n this.strm = null;\n /* pointer back to this zlib stream */\n\n this.status = 0;\n /* as the name implies */\n\n this.pending_buf = null;\n /* output still pending */\n\n this.pending_buf_size = 0;\n /* size of pending_buf */\n\n this.pending_out = 0;\n /* next pending byte to output to the stream */\n\n this.pending = 0;\n /* nb of bytes in the pending buffer */\n\n this.wrap = 0;\n /* bit 0 true for zlib, bit 1 true for gzip */\n\n this.gzhead = null;\n /* gzip header information to write */\n\n this.gzindex = 0;\n /* where in extra, name, or comment */\n\n this.method = Z_DEFLATED;\n /* can only be DEFLATED */\n\n this.last_flush = -1;\n /* value of flush param for previous deflate call */\n\n this.w_size = 0;\n /* LZ77 window size (32K by default) */\n\n this.w_bits = 0;\n /* log2(w_size) (8..16) */\n\n this.w_mask = 0;\n /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null;\n /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0;\n /* hash index of string to be inserted */\n\n this.hash_size = 0;\n /* number of elements in hash table */\n\n this.hash_bits = 0;\n /* log2(hash_size) */\n\n this.hash_mask = 0;\n /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0;\n /* length of best match */\n\n this.prev_match = 0;\n /* previous match */\n\n this.match_available = 0;\n /* set if previous match exists */\n\n this.strstart = 0;\n /* start of string to insert */\n\n this.match_start = 0;\n /* start of matching string */\n\n this.lookahead = 0;\n /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0;\n /* compression level (1..9) */\n\n this.strategy = 0;\n /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0;\n /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n this.l_desc = null;\n /* desc. for literal tree */\n\n this.d_desc = null;\n /* desc. for distance tree */\n\n this.bl_desc = null;\n /* desc. for bit length tree */\n //ush bl_count[MAX_BITS+1];\n\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n\n this.heap = new utils.Buf16(2 * L_CODES + 1);\n /* heap used to build the Huffman trees */\n\n zero(this.heap);\n this.heap_len = 0;\n /* number of elements in the heap */\n\n this.heap_max = 0;\n /* element of largest frequency */\n\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0;\n /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0;\n /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0;\n /* bit length of current block with optimal trees */\n\n this.static_len = 0;\n /* bit length of current block with static trees */\n\n this.matches = 0;\n /* number of string matches in current block */\n\n this.insert = 0;\n /* bytes at end of window left to insert */\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n\n s.status = s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = s.wrap === 2 ? 0 // crc32(0, Z_NULL, 0)\n : 1; // adler32(0, Z_NULL, 0)\n\n s.last_flush = Z_NO_FLUSH;\n\n trees._tr_init(s);\n\n return Z_OK;\n}\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n\n return ret;\n}\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n\n if (strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n\n strm.state.gzhead = head;\n return Z_OK;\n}\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) {\n // === Z_NULL\n return Z_STREAM_ERROR;\n }\n\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) {\n /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n } else if (windowBits > 15) {\n wrap = 2;\n /* write gzip wrapper instead */\n\n windowBits -= 16;\n }\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n\n var s = new DeflateState();\n strm.state = s;\n s.strm = strm;\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size); // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << memLevel + 6;\n /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4; //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n\n s.pending_buf = new utils.Buf8(s.pending_buf_size); // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n\n s.d_buf = 1 * s.lit_bufsize; //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n\n s.l_buf = (1 + 2) * s.lit_bufsize;\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) {\n return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm;\n /* just in case */\n\n old_flush = s.last_flush;\n s.last_flush = flush;\n /* Write the header */\n\n if (s.status === INIT_STATE) {\n if (s.wrap === 2) {\n // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n\n if (!s.gzhead) {\n // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n } else {\n put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16));\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, s.gzhead.time >> 8 & 0xff);\n put_byte(s, s.gzhead.time >> 16 & 0xff);\n put_byte(s, s.gzhead.time >> 24 & 0xff);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, s.gzhead.os & 0xff);\n\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, s.gzhead.extra.length >> 8 & 0xff);\n }\n\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n } else // DEFLATE header\n {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n\n header |= level_flags << 6;\n\n if (s.strstart !== 0) {\n header |= PRESET_DICT;\n }\n\n header += 31 - header % 31;\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n /* Save the adler32 of the preset dictionary: */\n\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n } //#ifdef GZIP\n\n\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra\n /* != Z_NULL*/\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n flush_pending(strm);\n beg = s.pending;\n\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n } else {\n s.status = NAME_STATE;\n }\n }\n\n if (s.status === NAME_STATE) {\n if (s.gzhead.name\n /* != Z_NULL*/\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n flush_pending(strm);\n beg = s.pending;\n\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n } // JS specific: little magic to add zero terminator to end of string\n\n\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n } else {\n s.status = COMMENT_STATE;\n }\n }\n\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment\n /* != Z_NULL*/\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n flush_pending(strm);\n beg = s.pending;\n\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n } // JS specific: little magic to add zero terminator to end of string\n\n\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n } else {\n s.status = HCRC_STATE;\n }\n }\n\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, strm.adler >> 8 & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n\n s.status = BUSY_STATE;\n }\n } else {\n s.status = BUSY_STATE;\n }\n } //#endif\n\n /* Flush as much pending output as possible */\n\n\n if (s.pending !== 0) {\n flush_pending(strm);\n\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n /* User must not provide more input after the first FINISH: */\n\n\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n /* Start a new block or continue the current one.\n */\n\n\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n } else if (flush !== Z_BLOCK) {\n /* FULL_FLUSH or SYNC_FLUSH */\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n\n\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/\n\n /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n\n flush_pending(strm);\n\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR at next call, see above */\n\n return Z_OK;\n }\n }\n } //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n\n if (flush !== Z_FINISH) {\n return Z_OK;\n }\n\n if (s.wrap <= 0) {\n return Z_STREAM_END;\n }\n /* Write the trailer */\n\n\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, strm.adler >> 8 & 0xff);\n put_byte(s, strm.adler >> 16 & 0xff);\n put_byte(s, strm.adler >> 24 & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, strm.total_in >> 8 & 0xff);\n put_byte(s, strm.total_in >> 16 & 0xff);\n put_byte(s, strm.total_in >> 24 & 0xff);\n } else {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n\n if (s.wrap > 0) {\n s.wrap = -s.wrap;\n }\n /* write the trailer only once! */\n\n\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm\n /*== Z_NULL*/\n || !strm.state\n /*== Z_NULL*/\n ) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n\n if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\n\n\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm\n /*== Z_NULL*/\n || !strm.state\n /*== Z_NULL*/\n ) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n\n\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0;\n /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n\n if (dictLength >= s.w_size) {\n if (wrap === 0) {\n /* already empty otherwise */\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n\n\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n\n\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/deflate.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/inffast.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/zlib/inffast.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n// See state defs from inflate.js\n\nvar BAD = 30;\n/* got a data error -- remain here until reset */\n\nvar TYPE = 12;\n/* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\n\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n\n var _in;\n /* local strm.input */\n\n\n var last;\n /* have enough input while in < last */\n\n var _out;\n /* local strm.output */\n\n\n var beg;\n /* inflate()'s initial strm.output */\n\n var end;\n /* while out < end, enough space available */\n //#ifdef INFLATE_STRICT\n\n var dmax;\n /* maximum distance from zlib header */\n //#endif\n\n var wsize;\n /* window size or zero if not using window */\n\n var whave;\n /* valid bytes in the window */\n\n var wnext;\n /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n\n var s_window;\n /* allocated sliding window, if wsize != 0 */\n\n var hold;\n /* local strm.hold */\n\n var bits;\n /* local strm.bits */\n\n var lcode;\n /* local strm.lencode */\n\n var dcode;\n /* local strm.distcode */\n\n var lmask;\n /* mask for first level of length codes */\n\n var dmask;\n /* mask for first level of distance codes */\n\n var here;\n /* retrieved table entry */\n\n var op;\n /* code bits, operation, extra bits, or */\n\n /* window position, window bytes to copy */\n\n var len;\n /* match length, unused bytes */\n\n var dist;\n /* match distance */\n\n var from;\n /* where to copy match from */\n\n var from_source;\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n\n state = strm.state; //here = state.here;\n\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257); //#ifdef INFLATE_STRICT\n\n dmax = state.dmax; //#endif\n\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top: do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen: for (;;) {\n // Goto emulation\n op = here >>> 24\n /*here.bits*/\n ;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff\n /*here.op*/\n ;\n\n if (op === 0) {\n /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff\n /*here.val*/\n ;\n } else if (op & 16) {\n /* length base */\n len = here & 0xffff\n /*here.val*/\n ;\n op &= 15;\n /* number of extra bits */\n\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n len += hold & (1 << op) - 1;\n hold >>>= op;\n bits -= op;\n } //Tracevv((stderr, \"inflate: length %u\\n\", len));\n\n\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = dcode[hold & dmask];\n\n dodist: for (;;) {\n // goto emulation\n op = here >>> 24\n /*here.bits*/\n ;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff\n /*here.op*/\n ;\n\n if (op & 16) {\n /* distance base */\n dist = here & 0xffff\n /*here.val*/\n ;\n op &= 15;\n /* number of extra bits */\n\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n\n dist += hold & (1 << op) - 1; //#ifdef INFLATE_STRICT\n\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n } //#endif\n\n\n hold >>>= op;\n bits -= op; //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n\n op = _out - beg;\n /* max distance in output */\n\n if (dist > op) {\n /* see if copy from window */\n op = dist - op;\n /* distance back in window */\n\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n } // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // if (len <= op - whave) {\n // do {\n // output[_out++] = 0;\n // } while (--len);\n // continue top;\n // }\n // len -= op - whave;\n // do {\n // output[_out++] = 0;\n // } while (--op > whave);\n // if (op === 0) {\n // from = _out - dist;\n // do {\n // output[_out++] = output[from++];\n // } while (--len);\n // continue top;\n // }\n //#endif\n\n }\n\n from = 0; // window index\n\n from_source = s_window;\n\n if (wnext === 0) {\n /* very common case */\n from += wsize - op;\n\n if (op < len) {\n /* some from window */\n len -= op;\n\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n\n from = _out - dist;\n /* rest from output */\n\n from_source = output;\n }\n } else if (wnext < op) {\n /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n\n if (op < len) {\n /* some from end of window */\n len -= op;\n\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n\n from = 0;\n\n if (wnext < len) {\n /* some from start of window */\n op = wnext;\n len -= op;\n\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n\n from = _out - dist;\n /* rest from output */\n\n from_source = output;\n }\n }\n } else {\n /* contiguous in window */\n from += wnext - op;\n\n if (op < len) {\n /* some from window */\n len -= op;\n\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n\n from = _out - dist;\n /* rest from output */\n\n from_source = output;\n }\n }\n\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n\n if (len) {\n output[_out++] = from_source[from++];\n\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n } else {\n from = _out - dist;\n /* copy direct from output */\n\n do {\n /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n\n if (len) {\n output[_out++] = output[from++];\n\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n } else if ((op & 64) === 0) {\n /* 2nd level distance code */\n here = dcode[(here & 0xffff) + (\n /*here.val*/\n hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } else if ((op & 64) === 0) {\n /* 2nd level length code */\n here = lcode[(here & 0xffff) + (\n /*here.val*/\n hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n\n\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n /* update state and return */\n\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);\n strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/inffast.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/inflate.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/zlib/inflate.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n\nvar adler32 = __webpack_require__(/*! ./adler32 */ \"./node_modules/pako/lib/zlib/adler32.js\");\n\nvar crc32 = __webpack_require__(/*! ./crc32 */ \"./node_modules/pako/lib/zlib/crc32.js\");\n\nvar inflate_fast = __webpack_require__(/*! ./inffast */ \"./node_modules/pako/lib/zlib/inffast.js\");\n\nvar inflate_table = __webpack_require__(/*! ./inftrees */ \"./node_modules/pako/lib/zlib/inftrees.js\");\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n/* Public constants ==========================================================*/\n\n/* ===========================================================================*/\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\n\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2; //var Z_ERRNO = -1;\n\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5; //var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\n\nvar Z_DEFLATED = 8;\n/* STATES ====================================================================*/\n\n/* ===========================================================================*/\n\nvar HEAD = 1;\n/* i: waiting for magic header */\n\nvar FLAGS = 2;\n/* i: waiting for method and flags (gzip) */\n\nvar TIME = 3;\n/* i: waiting for modification time (gzip) */\n\nvar OS = 4;\n/* i: waiting for extra flags and operating system (gzip) */\n\nvar EXLEN = 5;\n/* i: waiting for extra length (gzip) */\n\nvar EXTRA = 6;\n/* i: waiting for extra bytes (gzip) */\n\nvar NAME = 7;\n/* i: waiting for end of file name (gzip) */\n\nvar COMMENT = 8;\n/* i: waiting for end of comment (gzip) */\n\nvar HCRC = 9;\n/* i: waiting for header crc (gzip) */\n\nvar DICTID = 10;\n/* i: waiting for dictionary check value */\n\nvar DICT = 11;\n/* waiting for inflateSetDictionary() call */\n\nvar TYPE = 12;\n/* i: waiting for type bits, including last-flag bit */\n\nvar TYPEDO = 13;\n/* i: same, but skip check to exit inflate on new block */\n\nvar STORED = 14;\n/* i: waiting for stored size (length and complement) */\n\nvar COPY_ = 15;\n/* i/o: same as COPY below, but only first time in */\n\nvar COPY = 16;\n/* i/o: waiting for input or output to copy stored block */\n\nvar TABLE = 17;\n/* i: waiting for dynamic block table lengths */\n\nvar LENLENS = 18;\n/* i: waiting for code length code lengths */\n\nvar CODELENS = 19;\n/* i: waiting for length/lit and distance code lengths */\n\nvar LEN_ = 20;\n/* i: same as LEN below, but only first time in */\n\nvar LEN = 21;\n/* i: waiting for length/lit/eob code */\n\nvar LENEXT = 22;\n/* i: waiting for length extra bits */\n\nvar DIST = 23;\n/* i: waiting for distance code */\n\nvar DISTEXT = 24;\n/* i: waiting for distance extra bits */\n\nvar MATCH = 25;\n/* o: waiting for output space to copy string */\n\nvar LIT = 26;\n/* o: waiting for output space to write literal */\n\nvar CHECK = 27;\n/* i: waiting for 32-bit check value */\n\nvar LENGTH = 28;\n/* i: waiting for 32-bit length (gzip) */\n\nvar DONE = 29;\n/* finished check, done -- remain here until reset */\n\nvar BAD = 30;\n/* got a data error -- remain here until reset */\n\nvar MEM = 31;\n/* got an inflate() memory error -- remain here until reset */\n\nvar SYNC = 32;\n/* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592; //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\n\nvar DEF_WBITS = MAX_WBITS;\n\nfunction zswap32(q) {\n return (q >>> 24 & 0xff) + (q >>> 8 & 0xff00) + ((q & 0xff00) << 8) + ((q & 0xff) << 24);\n}\n\nfunction InflateState() {\n this.mode = 0;\n /* current inflate mode */\n\n this.last = false;\n /* true if processing last block */\n\n this.wrap = 0;\n /* bit 0 true for zlib, bit 1 true for gzip */\n\n this.havedict = false;\n /* true if dictionary provided */\n\n this.flags = 0;\n /* gzip header method and flags (0 if zlib) */\n\n this.dmax = 0;\n /* zlib header max distance (INFLATE_STRICT) */\n\n this.check = 0;\n /* protected copy of check value */\n\n this.total = 0;\n /* protected copy of output count */\n // TODO: may be {}\n\n this.head = null;\n /* where to save gzip header information */\n\n /* sliding window */\n\n this.wbits = 0;\n /* log base 2 of requested window size */\n\n this.wsize = 0;\n /* window size or zero if not using window */\n\n this.whave = 0;\n /* valid bytes in the window */\n\n this.wnext = 0;\n /* window write index */\n\n this.window = null;\n /* allocated sliding window, if needed */\n\n /* bit accumulator */\n\n this.hold = 0;\n /* input bit accumulator */\n\n this.bits = 0;\n /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n\n this.length = 0;\n /* literal or length of data to copy */\n\n this.offset = 0;\n /* distance back to copy string from */\n\n /* for table and code decoding */\n\n this.extra = 0;\n /* extra bits needed */\n\n /* fixed and dynamic code tables */\n\n this.lencode = null;\n /* starting table for length/literal codes */\n\n this.distcode = null;\n /* starting table for distance codes */\n\n this.lenbits = 0;\n /* index bits for lencode */\n\n this.distbits = 0;\n /* index bits for distcode */\n\n /* dynamic table building */\n\n this.ncode = 0;\n /* number of code length code lengths */\n\n this.nlen = 0;\n /* number of length code lengths */\n\n this.ndist = 0;\n /* number of distance code lengths */\n\n this.have = 0;\n /* number of code lengths in lens[] */\n\n this.next = null;\n /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320);\n /* temporary storage for code lengths */\n\n this.work = new utils.Buf16(288);\n /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n\n this.lendyn = null;\n /* dynamic table for length/literal codes (JS specific) */\n\n this.distdyn = null;\n /* dynamic table for distance codes (JS specific) */\n\n this.sane = 0;\n /* if false, allow invalid distance too far */\n\n this.back = 0;\n /* bits back of last unprocessed length/lit */\n\n this.was = 0;\n /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = '';\n /*Z_NULL*/\n\n if (state.wrap) {\n /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null\n /*Z_NULL*/\n ;\n state.hold = 0;\n state.bits = 0; //state.lencode = state.distcode = state.next = state.codes;\n\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n state.sane = 1;\n state.back = -1; //Tracev((stderr, \"inflate: reset\\n\"));\n\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n /* get the state */\n\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n /* extract wrap request from windowBits parameter */\n\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n } else {\n wrap = (windowBits >> 4) + 1;\n\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n /* set number of window bits, free window if different */\n\n\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n /* update state and reset the rest of it */\n\n\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) {\n return Z_STREAM_ERROR;\n } //strm.msg = Z_NULL; /* in case we return an error */\n\n\n state = new InflateState(); //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n\n strm.state = state;\n state.window = null\n /*Z_NULL*/\n ;\n ret = inflateReset2(strm, windowBits);\n\n if (ret !== Z_OK) {\n strm.state = null\n /*Z_NULL*/\n ;\n }\n\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\n\n\nvar virgin = true;\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n /* literal/length table */\n\n sym = 0;\n\n while (sym < 144) {\n state.lens[sym++] = 8;\n }\n\n while (sym < 256) {\n state.lens[sym++] = 9;\n }\n\n while (sym < 280) {\n state.lens[sym++] = 7;\n }\n\n while (sym < 288) {\n state.lens[sym++] = 8;\n }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n });\n /* distance table */\n\n sym = 0;\n\n while (sym < 32) {\n state.lens[sym++] = 5;\n }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n });\n /* do this just once */\n\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\n\n\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n /* if it hasn't been done already, allocate space for the window */\n\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n state.window = new utils.Buf8(state.wsize);\n }\n /* copy state->wsize or less output bytes into the circular window */\n\n\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n\n if (dist > copy) {\n dist = copy;\n } //zmemcpy(state->window + state->wnext, end - copy, dist);\n\n\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n\n var next;\n /* next input INDEX */\n\n var put;\n /* next output INDEX */\n\n var have, left;\n /* available input and output */\n\n var hold;\n /* bit buffer */\n\n var bits;\n /* bits in bit buffer */\n\n var _in, _out;\n /* save starting available input and output */\n\n\n var copy;\n /* number of stored or match bytes to copy */\n\n var from;\n /* where to copy match bytes from */\n\n var from_source;\n var here = 0;\n /* current decoding table entry */\n\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n\n var len;\n /* length to copy for repeats, bits to drop */\n\n var ret;\n /* return code */\n\n var hbuf = new utils.Buf8(4);\n /* buffer for gzip header crc calculation */\n\n var opts;\n var n; // temporary var for NEED_BITS\n\n var order =\n /* permutation of code lengths */\n [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n\n if (state.mode === TYPE) {\n state.mode = TYPEDO;\n }\n /* skip check */\n //--- LOAD() ---\n\n\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits; //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n } //=== NEEDBITS(16);\n\n\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if (state.wrap & 2 && hold === 0x8b1f) {\n /* gzip header */\n state.check = 0\n /*crc32(0L, Z_NULL, 0)*/\n ; //=== CRC2(state.check, hold);\n\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0); //===//\n //=== INITBITS();\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = FLAGS;\n break;\n }\n\n state.flags = 0;\n /* expect zlib header */\n\n if (state.head) {\n state.head.done = false;\n }\n\n if (!(state.wrap & 1) ||\n /* check if zlib header allowed */\n (((hold & 0xff) <<\n /*BITS(8)*/\n 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n\n if ((hold & 0x0f) !==\n /*BITS(4)*/\n Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n } //--- DROPBITS(4) ---//\n\n\n hold >>>= 4;\n bits -= 4; //---//\n\n len = (hold & 0x0f) +\n /*BITS(4)*/\n 8;\n\n if (state.wbits === 0) {\n state.wbits = len;\n } else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n state.dmax = 1 << len; //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n\n strm.adler = state.check = 1\n /*adler32(0L, Z_NULL, 0)*/\n ;\n state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS();\n\n hold = 0;\n bits = 0; //===//\n\n break;\n\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.flags = hold;\n\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n\n if (state.head) {\n state.head.text = hold >> 8 & 1;\n }\n\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0); //===//\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = TIME;\n\n /* falls through */\n\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if (state.head) {\n state.head.time = hold;\n }\n\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n hbuf[2] = hold >>> 16 & 0xff;\n hbuf[3] = hold >>> 24 & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0); //===\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = OS;\n\n /* falls through */\n\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if (state.head) {\n state.head.xflags = hold & 0xff;\n state.head.os = hold >> 8;\n }\n\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0); //===//\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = EXLEN;\n\n /* falls through */\n\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.length = hold;\n\n if (state.head) {\n state.head.extra_len = hold;\n }\n\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0); //===//\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n } else if (state.head) {\n state.head.extra = null\n /*Z_NULL*/\n ;\n }\n\n state.mode = EXTRA;\n\n /* falls through */\n\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n\n if (copy > have) {\n copy = have;\n }\n\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n\n utils.arraySet(state.head.extra, input, next, // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len); //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n\n if (state.length) {\n break inf_leave;\n }\n }\n\n state.length = 0;\n state.mode = NAME;\n\n /* falls through */\n\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) {\n break inf_leave;\n }\n\n copy = 0;\n\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n\n if (state.head && len && state.length < 65536\n /*state.head.name_max*/\n ) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n\n have -= copy;\n next += copy;\n\n if (len) {\n break inf_leave;\n }\n } else if (state.head) {\n state.head.name = null;\n }\n\n state.length = 0;\n state.mode = COMMENT;\n\n /* falls through */\n\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) {\n break inf_leave;\n }\n\n copy = 0;\n\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n\n if (state.head && len && state.length < 65536\n /*state.head.comm_max*/\n ) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n\n have -= copy;\n next += copy;\n\n if (len) {\n break inf_leave;\n }\n } else if (state.head) {\n state.head.comment = null;\n }\n\n state.mode = HCRC;\n\n /* falls through */\n\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n }\n\n if (state.head) {\n state.head.hcrc = state.flags >> 9 & 1;\n state.head.done = true;\n }\n\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n strm.adler = state.check = zswap32(hold); //=== INITBITS();\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = DICT;\n\n /* falls through */\n\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits; //---\n\n return Z_NEED_DICT;\n }\n\n strm.adler = state.check = 1\n /*adler32(0L, Z_NULL, 0)*/\n ;\n state.mode = TYPE;\n\n /* falls through */\n\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) {\n break inf_leave;\n }\n\n /* falls through */\n\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7; //---//\n\n state.mode = CHECK;\n break;\n } //=== NEEDBITS(3); */\n\n\n while (bits < 3) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.last = hold & 0x01\n /*BITS(1)*/\n ; //--- DROPBITS(1) ---//\n\n hold >>>= 1;\n bits -= 1; //---//\n\n switch (hold & 0x03) {\n /*BITS(2)*/\n case 0:\n /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n\n case 1:\n /* fixed block */\n fixedtables(state); //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n\n state.mode = LEN_;\n /* decode codes */\n\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2; //---//\n\n break inf_leave;\n }\n\n break;\n\n case 2:\n /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n } //--- DROPBITS(2) ---//\n\n\n hold >>>= 2;\n bits -= 2; //---//\n\n break;\n\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7; //---//\n //=== NEEDBITS(32); */\n\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if ((hold & 0xffff) !== (hold >>> 16 ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n\n state.length = hold & 0xffff; //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n\n hold = 0;\n bits = 0; //===//\n\n state.mode = COPY_;\n\n if (flush === Z_TREES) {\n break inf_leave;\n }\n\n /* falls through */\n\n case COPY_:\n state.mode = COPY;\n\n /* falls through */\n\n case COPY:\n copy = state.length;\n\n if (copy) {\n if (copy > have) {\n copy = have;\n }\n\n if (copy > left) {\n copy = left;\n }\n\n if (copy === 0) {\n break inf_leave;\n } //--- zmemcpy(put, next, copy); ---\n\n\n utils.arraySet(output, input, next, copy, put); //---//\n\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n } //Tracev((stderr, \"inflate: stored end\\n\"));\n\n\n state.mode = TYPE;\n break;\n\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.nlen = (hold & 0x1f) +\n /*BITS(5)*/\n 257; //--- DROPBITS(5) ---//\n\n hold >>>= 5;\n bits -= 5; //---//\n\n state.ndist = (hold & 0x1f) +\n /*BITS(5)*/\n 1; //--- DROPBITS(5) ---//\n\n hold >>>= 5;\n bits -= 5; //---//\n\n state.ncode = (hold & 0x0f) +\n /*BITS(4)*/\n 4; //--- DROPBITS(4) ---//\n\n hold >>>= 4;\n bits -= 4; //---//\n //#ifndef PKZIP_BUG_WORKAROUND\n\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n } //#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n\n\n state.have = 0;\n state.mode = LENLENS;\n\n /* falls through */\n\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.lens[order[state.have++]] = hold & 0x07; //BITS(3);\n //--- DROPBITS(3) ---//\n\n hold >>>= 3;\n bits -= 3; //---//\n }\n\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n } // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n\n\n state.lencode = state.lendyn;\n state.lenbits = 7;\n opts = {\n bits: state.lenbits\n };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n } //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n\n\n state.have = 0;\n state.mode = CODELENS;\n\n /* falls through */\n\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & (1 << state.lenbits) - 1];\n /*BITS(state.lenbits)*/\n\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) {\n break;\n } //--- PULLBYTE() ---//\n\n\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8; //---//\n }\n\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n state.lens[state.have++] = here_val;\n } else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n //--- DROPBITS(here.bits) ---//\n\n\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03); //BITS(2);\n //--- DROPBITS(2) ---//\n\n hold >>>= 2;\n bits -= 2; //---//\n } else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n //--- DROPBITS(here.bits) ---//\n\n\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n len = 0;\n copy = 3 + (hold & 0x07); //BITS(3);\n //--- DROPBITS(3) ---//\n\n hold >>>= 3;\n bits -= 3; //---//\n } else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n //--- DROPBITS(here.bits) ---//\n\n\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n len = 0;\n copy = 11 + (hold & 0x7f); //BITS(7);\n //--- DROPBITS(7) ---//\n\n hold >>>= 7;\n bits -= 7; //---//\n }\n\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n /* handle error breaks in while */\n\n\n if (state.mode === BAD) {\n break;\n }\n /* check for end-of-block code (better have one) */\n\n\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n\n\n state.lenbits = 9;\n opts = {\n bits: state.lenbits\n };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n\n state.lenbits = opts.bits; // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6; //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n\n state.distcode = state.distdyn;\n opts = {\n bits: state.distbits\n };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n\n state.distbits = opts.bits; // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n } //Tracev((stderr, 'inflate: codes ok\\n'));\n\n\n state.mode = LEN_;\n\n if (flush === Z_TREES) {\n break inf_leave;\n }\n\n /* falls through */\n\n case LEN_:\n state.mode = LEN;\n\n /* falls through */\n\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits; //---\n\n inflate_fast(strm, _out); //--- LOAD() ---\n\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits; //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n\n break;\n }\n\n state.back = 0;\n\n for (;;) {\n here = state.lencode[hold & (1 << state.lenbits) - 1];\n /*BITS(state.lenbits)*/\n\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) {\n break;\n } //--- PULLBYTE() ---//\n\n\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8; //---//\n }\n\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n\n for (;;) {\n here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >>\n /*BITS(last.bits + last.op)*/\n last_bits)];\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n\n if (last_bits + here_bits <= bits) {\n break;\n } //--- PULLBYTE() ---//\n\n\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8; //---//\n } //--- DROPBITS(last.bits) ---//\n\n\n hold >>>= last_bits;\n bits -= last_bits; //---//\n\n state.back += last_bits;\n } //--- DROPBITS(here.bits) ---//\n\n\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n state.back += here_bits;\n state.length = here_val;\n\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n\n state.extra = here_op & 15;\n state.mode = LENEXT;\n\n /* falls through */\n\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.length += hold & (1 << state.extra) - 1\n /*BITS(state.extra)*/\n ; //--- DROPBITS(state.extra) ---//\n\n hold >>>= state.extra;\n bits -= state.extra; //---//\n\n state.back += state.extra;\n } //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n\n\n state.was = state.length;\n state.mode = DIST;\n\n /* falls through */\n\n case DIST:\n for (;;) {\n here = state.distcode[hold & (1 << state.distbits) - 1];\n /*BITS(state.distbits)*/\n\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) {\n break;\n } //--- PULLBYTE() ---//\n\n\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8; //---//\n }\n\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n\n for (;;) {\n here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >>\n /*BITS(last.bits + last.op)*/\n last_bits)];\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n\n if (last_bits + here_bits <= bits) {\n break;\n } //--- PULLBYTE() ---//\n\n\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8; //---//\n } //--- DROPBITS(last.bits) ---//\n\n\n hold >>>= last_bits;\n bits -= last_bits; //---//\n\n state.back += last_bits;\n } //--- DROPBITS(here.bits) ---//\n\n\n hold >>>= here_bits;\n bits -= here_bits; //---//\n\n state.back += here_bits;\n\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n\n state.offset = here_val;\n state.extra = here_op & 15;\n state.mode = DISTEXT;\n\n /* falls through */\n\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n state.offset += hold & (1 << state.extra) - 1\n /*BITS(state.extra)*/\n ; //--- DROPBITS(state.extra) ---//\n\n hold >>>= state.extra;\n bits -= state.extra; //---//\n\n state.back += state.extra;\n } //#ifdef INFLATE_STRICT\n\n\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n } //#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n\n\n state.mode = MATCH;\n\n /* falls through */\n\n case MATCH:\n if (left === 0) {\n break inf_leave;\n }\n\n copy = _out - left;\n\n if (state.offset > copy) {\n /* copy from window */\n copy = state.offset - copy;\n\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n } // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // Trace((stderr, \"inflate.c too far\\n\"));\n // copy -= state.whave;\n // if (copy > state.length) { copy = state.length; }\n // if (copy > left) { copy = left; }\n // left -= copy;\n // state.length -= copy;\n // do {\n // output[put++] = 0;\n // } while (--copy);\n // if (state.length === 0) { state.mode = LEN; }\n // break;\n //#endif\n\n }\n\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n } else {\n from = state.wnext - copy;\n }\n\n if (copy > state.length) {\n copy = state.length;\n }\n\n from_source = state.window;\n } else {\n /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n\n if (copy > left) {\n copy = left;\n }\n\n left -= copy;\n state.length -= copy;\n\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n\n if (state.length === 0) {\n state.mode = LEN;\n }\n\n break;\n\n case LIT:\n if (left === 0) {\n break inf_leave;\n }\n\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--; // Use '|' instead of '+' to make sure that result is signed\n\n hold |= input[next++] << bits;\n bits += 8;\n } //===//\n\n\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n }\n\n _out = left; // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n\n state.mode = LENGTH;\n\n /* falls through */\n\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n\n have--;\n hold += input[next++] << bits;\n bits += 8;\n } //===//\n\n\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n } //=== INITBITS();\n\n\n hold = 0;\n bits = 0; //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n\n state.mode = DONE;\n\n /* falls through */\n\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n\n case MEM:\n return Z_MEM_ERROR;\n\n case SYNC:\n /* falls through */\n\n default:\n return Z_STREAM_ERROR;\n }\n } // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n //--- RESTORE() ---\n\n\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits; //---\n\n if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n\n if (state.wrap && _out) {\n strm.adler = state.check =\n /*UPDATE(state.check, strm.next_out - _out, _out);*/\n state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n }\n\n strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n\n if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n\n return ret;\n}\n\nfunction inflateEnd(strm) {\n if (!strm || !strm.state\n /*|| strm->zfree == (free_func)0*/\n ) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n\n if (state.window) {\n state.window = null;\n }\n\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n /* check state */\n\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n\n if ((state.wrap & 2) === 0) {\n return Z_STREAM_ERROR;\n }\n /* save header structure */\n\n\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n var state;\n var dictid;\n var ret;\n /* check state */\n\n if (!strm\n /* == Z_NULL */\n || !strm.state\n /* == Z_NULL */\n ) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n /* check for correct dictionary identifier */\n\n\n if (state.mode === DICT) {\n dictid = 1;\n /* adler32(0, null, 0)*/\n\n /* dictid = adler32(dictid, dictionary, dictLength); */\n\n dictid = adler32(dictid, dictionary, dictLength, 0);\n\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n\n\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n\n state.havedict = 1; // Tracev((stderr, \"inflate: dictionary set\\n\"));\n\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/inflate.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/inftrees.js": /*!************************************************!*\ !*** ./node_modules/pako/lib/zlib/inftrees.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592; //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\nvar lbase = [\n/* Length codes 257..285 base */\n3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];\nvar lext = [\n/* Length codes 257..285 extra */\n16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78];\nvar dbase = [\n/* Distance codes 0..29 base */\n1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0];\nvar dext = [\n/* Distance codes 0..29 extra */\n16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits; //here = opts.here; /* table entry for duplication */\n\n var len = 0;\n /* a code's length in bits */\n\n var sym = 0;\n /* index of code symbols */\n\n var min = 0,\n max = 0;\n /* minimum and maximum code lengths */\n\n var root = 0;\n /* number of index bits for root table */\n\n var curr = 0;\n /* number of index bits for current table */\n\n var drop = 0;\n /* code bits to drop for sub-table */\n\n var left = 0;\n /* number of prefix codes available */\n\n var used = 0;\n /* code entries in table used */\n\n var huff = 0;\n /* Huffman code */\n\n var incr;\n /* for incrementing code, index */\n\n var fill;\n /* index for replicating entries */\n\n var low;\n /* low bits for current root entry */\n\n var mask;\n /* mask for low root bits */\n\n var next;\n /* next available space in table */\n\n var base = null;\n /* base value table to use */\n\n var base_index = 0; // var shoextra; /* extra bits table to use */\n\n var end;\n /* use base and extra for symbol > end */\n\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n\n var extra = null;\n var extra_index = 0;\n var here_bits, here_op, here_val;\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n /* bound code lengths, force root to be within code lengths */\n\n\n root = bits;\n\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) {\n break;\n }\n }\n\n if (root > max) {\n root = max;\n }\n\n if (max === 0) {\n /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = 1 << 24 | 64 << 16 | 0; //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n\n table[table_index++] = 1 << 24 | 64 << 16 | 0;\n opts.bits = 1;\n return 0;\n /* no symbols, but wait for decoding to report error */\n }\n\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) {\n break;\n }\n }\n\n if (root < min) {\n root = min;\n }\n /* check for an over-subscribed or incomplete set of lengths */\n\n\n left = 1;\n\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n\n if (left < 0) {\n return -1;\n }\n /* over-subscribed */\n\n }\n\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1;\n /* incomplete set */\n }\n /* generate offsets into symbol table for each length for sorting */\n\n\n offs[1] = 0;\n\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n /* sort symbols by length, by symbol order within each length */\n\n\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n\n\n if (type === CODES) {\n base = extra = work;\n /* dummy value--not used */\n\n end = 19;\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n } else {\n /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n /* initialize opts for loop */\n\n\n huff = 0;\n /* starting code */\n\n sym = 0;\n /* starting code symbol */\n\n len = min;\n /* starting code length */\n\n next = table_index;\n /* current table to fill in */\n\n curr = root;\n /* current table index bits */\n\n drop = 0;\n /* current bits to drop from code for index */\n\n low = -1;\n /* trigger new sub-table when len > root */\n\n used = 1 << root;\n /* use root table entries */\n\n mask = used - 1;\n /* mask for comparing low */\n\n /* check available table space */\n\n if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n /* process all codes and make table entries */\n\n\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n } else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n } else {\n here_op = 32 + 64;\n /* end of block */\n\n here_val = 0;\n }\n /* replicate for those indices with low len bits equal to huff */\n\n\n incr = 1 << len - drop;\n fill = 1 << curr;\n min = fill;\n /* save offset to next table */\n\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n } while (fill !== 0);\n /* backwards increment the len-bit code huff */\n\n\n incr = 1 << len - 1;\n\n while (huff & incr) {\n incr >>= 1;\n }\n\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n /* go to next symbol, update count, len */\n\n\n sym++;\n\n if (--count[len] === 0) {\n if (len === max) {\n break;\n }\n\n len = lens[lens_index + work[sym]];\n }\n /* create new sub-table if needed */\n\n\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n /* increment past last table */\n\n\n next += min;\n /* here min is 1 << curr */\n\n /* determine length of next table */\n\n curr = len - drop;\n left = 1 << curr;\n\n while (curr + drop < max) {\n left -= count[curr + drop];\n\n if (left <= 0) {\n break;\n }\n\n curr++;\n left <<= 1;\n }\n /* check for enough space */\n\n\n used += 1 << curr;\n\n if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n /* point entry in root table to sub-table */\n\n\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n\n table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n\n\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n }\n /* set return parameters */\n //opts.table_index += used;\n\n\n opts.bits = root;\n return 0;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/inftrees.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/messages.js": /*!************************************************!*\ !*** ./node_modules/pako/lib/zlib/messages.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary',\n\n /* Z_NEED_DICT 2 */\n 1: 'stream end',\n\n /* Z_STREAM_END 1 */\n 0: '',\n\n /* Z_OK 0 */\n '-1': 'file error',\n\n /* Z_ERRNO (-1) */\n '-2': 'stream error',\n\n /* Z_STREAM_ERROR (-2) */\n '-3': 'data error',\n\n /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory',\n\n /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error',\n\n /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version'\n /* Z_VERSION_ERROR (-6) */\n\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/messages.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/trees.js": /*!*********************************************!*\ !*** ./node_modules/pako/lib/zlib/trees.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n/* Public constants ==========================================================*/\n\n/* ===========================================================================*/\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\n\n\nvar Z_FIXED = 4; //var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n\nvar Z_BINARY = 0;\nvar Z_TEXT = 1; //var Z_ASCII = 1; // = Z_TEXT\n\nvar Z_UNKNOWN = 2;\n/*============================================================================*/\n\nfunction zero(buf) {\n var len = buf.length;\n\n while (--len >= 0) {\n buf[len] = 0;\n }\n} // From zutil.h\n\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n// From deflate.h\n\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\n\nvar extra_lbits =\n/* extra bits for each length code */\n[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];\nvar extra_dbits =\n/* extra bits for each distance code */\n[0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\nvar extra_blbits =\n/* extra bits for each bit length code */\n[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\nvar bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512;\n/* see definition of array dist_code below */\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\n\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\n\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree;\n /* static tree or NULL */\n\n this.extra_bits = extra_bits;\n /* extra bits for each code or NULL */\n\n this.extra_base = extra_base;\n /* base index for extra_bits */\n\n this.elems = elems;\n /* max number of elements in the tree */\n\n this.max_length = max_length;\n /* max bit length for the codes */\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n\n this.has_stree = static_tree && static_tree.length;\n}\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree;\n /* the dynamic tree */\n\n this.max_code = 0;\n /* largest code with non zero frequency */\n\n this.stat_desc = stat_desc;\n /* the corresponding static tree */\n}\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\n\n\nfunction put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n\n\nfunction send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n}\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]\n /*.Code*/\n , tree[c * 2 + 1]\n /*.Len*/\n );\n}\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\n\n\nfunction bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n}\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\n\n\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\n\n\nfunction gen_bitlen(s, desc) // deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h;\n /* heap index */\n\n var n, m;\n /* iterate over the tree elements */\n\n var bits;\n /* bit length */\n\n var xbits;\n /* extra bits */\n\n var f;\n /* frequency */\n\n var overflow = 0;\n /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n\n\n tree[s.heap[s.heap_max] * 2 + 1]\n /*.Len*/\n = 0;\n /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]\n /*.Dad*/\n * 2 + 1]\n /*.Len*/\n + 1;\n\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n\n tree[n * 2 + 1]\n /*.Len*/\n = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n }\n /* not a leaf node */\n\n\n s.bl_count[bits]++;\n xbits = 0;\n\n if (n >= base) {\n xbits = extra[n - base];\n }\n\n f = tree[n * 2]\n /*.Freq*/\n ;\n s.opt_len += f * (bits + xbits);\n\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]\n /*.Len*/\n + xbits);\n }\n }\n\n if (overflow === 0) {\n return;\n } // Trace((stderr,\"\\nbit length overflow\\n\"));\n\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n\n\n do {\n bits = max_length - 1;\n\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n\n s.bl_count[bits]--;\n /* move one leaf down the tree */\n\n s.bl_count[bits + 1] += 2;\n /* move one overflow item as its brother */\n\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n\n overflow -= 2;\n } while (overflow > 0);\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n\n\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n\n while (n !== 0) {\n m = s.heap[--h];\n\n if (m > max_code) {\n continue;\n }\n\n if (tree[m * 2 + 1]\n /*.Len*/\n !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]\n /*.Len*/\n ) * tree[m * 2]\n /*.Freq*/\n ;\n tree[m * 2 + 1]\n /*.Len*/\n = bits;\n }\n\n n--;\n }\n }\n}\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\n\n\nfunction gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n\n var code = 0;\n /* running code value */\n\n var bits;\n /* bit index */\n\n var n;\n /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n}\n/* ===========================================================================\n * Initialize a new block.\n */\n\n\nfunction init_block(s) {\n var n;\n /* iterates over tree elements */\n\n /* Initialize the trees. */\n\n for (n = 0; n < L_CODES; n++) {\n s.dyn_ltree[n * 2]\n /*.Freq*/\n = 0;\n }\n\n for (n = 0; n < D_CODES; n++) {\n s.dyn_dtree[n * 2]\n /*.Freq*/\n = 0;\n }\n\n for (n = 0; n < BL_CODES; n++) {\n s.bl_tree[n * 2]\n /*.Freq*/\n = 0;\n }\n\n s.dyn_ltree[END_BLOCK * 2]\n /*.Freq*/\n = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\n\n\nfunction bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\n\n\nfunction copy_block(s, buf, len, header) //DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n\n\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n\n var _m2 = m * 2;\n\n return tree[_n2]\n /*.Freq*/\n < tree[_m2]\n /*.Freq*/\n || tree[_n2]\n /*.Freq*/\n === tree[_m2]\n /*.Freq*/\n && depth[n] <= depth[m];\n}\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\n\n\nfunction pqdownheap(s, tree, k) // deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1;\n /* left son of k */\n\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n\n\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n /* Exchange v with the smallest son */\n\n\n s.heap[k] = s.heap[j];\n k = j;\n /* And continue down the tree, setting j to the left son of k */\n\n j <<= 1;\n }\n\n s.heap[k] = v;\n} // inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\n\n\nfunction compress_block(s, ltree, dtree) // deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist;\n /* distance of matched string */\n\n var lc;\n /* match length or unmatched char (if dist == 0) */\n\n var lx = 0;\n /* running index in l_buf */\n\n var code;\n /* the code to send */\n\n var extra;\n /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree);\n /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree);\n /* send the length code */\n\n extra = extra_lbits[code];\n\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra);\n /* send the extra length bits */\n }\n\n dist--;\n /* dist is now the match distance - 1 */\n\n code = d_code(dist); //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree);\n /* send the distance code */\n\n extra = extra_dbits[code];\n\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra);\n /* send the extra distance bits */\n }\n }\n /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\n\n\nfunction build_tree(s, desc) // deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m;\n /* iterate over heap elements */\n\n var max_code = -1;\n /* largest code with non zero frequency */\n\n var node;\n /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]\n /*.Freq*/\n !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n } else {\n tree[n * 2 + 1]\n /*.Len*/\n = 0;\n }\n }\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n\n\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n tree[node * 2]\n /*.Freq*/\n = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]\n /*.Len*/\n ;\n }\n /* node is 0 or 1 so it does not have extra bits */\n\n }\n\n desc.max_code = max_code;\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n\n for (n = s.heap_len >> 1\n /*int /2*/\n ; n >= 1; n--) {\n pqdownheap(s, tree, n);\n }\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n\n\n node = elems;\n /* next internal node of the tree */\n\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n\n /*** pqremove ***/\n n = s.heap[1\n /*SMALLEST*/\n ];\n s.heap[1\n /*SMALLEST*/\n ] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1\n /*SMALLEST*/\n );\n /***/\n\n m = s.heap[1\n /*SMALLEST*/\n ];\n /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n;\n /* keep the nodes sorted by frequency */\n\n s.heap[--s.heap_max] = m;\n /* Create a new node father of n and m */\n\n tree[node * 2]\n /*.Freq*/\n = tree[n * 2]\n /*.Freq*/\n + tree[m * 2]\n /*.Freq*/\n ;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]\n /*.Dad*/\n = tree[m * 2 + 1]\n /*.Dad*/\n = node;\n /* and insert the new node in the heap */\n\n s.heap[1\n /*SMALLEST*/\n ] = node++;\n pqdownheap(s, tree, 1\n /*SMALLEST*/\n );\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1\n /*SMALLEST*/\n ];\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n\n gen_bitlen(s, desc);\n /* The field len is now set, we can generate the bit codes */\n\n gen_codes(tree, max_code, s.bl_count);\n}\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\n\n\nfunction scan_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n tree[(max_code + 1) * 2 + 1]\n /*.Len*/\n = 0xffff;\n /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]\n /*.Freq*/\n += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\n\n\nfunction send_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\n\n\nfunction build_bl_tree(s) {\n var max_blindex;\n /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n /* Build the bit length tree: */\n\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]\n /*.Len*/\n !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n\n\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\n\n\nfunction send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank;\n /* index in bl_order */\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n\n send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]\n /*.Len*/\n , 3);\n } //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\n send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\n\n\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n /* Check for non-textual (\"black-listed\") bytes. */\n\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if (black_mask & 1 && s.dyn_ltree[n * 2]\n /*.Freq*/\n !== 0) {\n return Z_BINARY;\n }\n }\n /* Check for textual (\"white-listed\") bytes. */\n\n\n if (s.dyn_ltree[9 * 2]\n /*.Freq*/\n !== 0 || s.dyn_ltree[10 * 2]\n /*.Freq*/\n !== 0 || s.dyn_ltree[13 * 2]\n /*.Freq*/\n !== 0) {\n return Z_TEXT;\n }\n\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]\n /*.Freq*/\n !== 0) {\n return Z_TEXT;\n }\n }\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n\n\n return Z_BINARY;\n}\n\nvar static_init_done = false;\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\n\nfunction _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n /* Initialize the first block of the first file: */\n\n init_block(s);\n}\n/* ===========================================================================\n * Send a stored block\n */\n\n\nfunction _tr_stored_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);\n /* send block type */\n\n copy_block(s, buf, stored_len, true);\n /* with header */\n}\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\n\n\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\n\n\nfunction _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n init_block(s);\n\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n}\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\n\n\nfunction _tr_tally(s, dist, lc) // deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2] /*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n\n dist--;\n /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2] /*.Freq*/++;\n } // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef TRUNCATE_BLOCK\n // /* Try to guess if it is profitable to stop the current block here */\n // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n // /* Compute an upper bound for the compressed length */\n // out_length = s.last_lit*8;\n // in_length = s.strstart - s.block_start;\n //\n // for (dcode = 0; dcode < D_CODES; dcode++) {\n // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n // }\n // out_length >>>= 3;\n // //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n // // s->last_lit, in_length, out_length,\n // // 100L - out_length*100L/in_length));\n // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n // return true;\n // }\n // }\n //#endif\n\n\n return s.last_lit === s.lit_bufsize - 1;\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/trees.js?"); /***/ }), /***/ "./node_modules/pako/lib/zlib/zstream.js": /*!***********************************************!*\ !*** ./node_modules/pako/lib/zlib/zstream.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(" // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n\n this.next_in = 0;\n /* number of bytes available at input */\n\n this.avail_in = 0;\n /* total number of input bytes read so far */\n\n this.total_in = 0;\n /* next output byte should be put there */\n\n this.output = null; // JS specific, because we have no pointers\n\n this.next_out = 0;\n /* remaining free space at output */\n\n this.avail_out = 0;\n /* total number of bytes output so far */\n\n this.total_out = 0;\n /* last error message, NULL if no error */\n\n this.msg = ''\n /*Z_NULL*/\n ;\n /* not visible by applications */\n\n this.state = null;\n /* best guess about the data type: binary or text */\n\n this.data_type = 2\n /*Z_UNKNOWN*/\n ;\n /* adler32 value of the uncompressed data */\n\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n\n//# sourceURL=webpack://gramjs/./node_modules/pako/lib/zlib/zstream.js?"); /***/ }), /***/ "./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) { eval("module.exports = JSON.parse(\"{\\\"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\\\"}\");\n\n//# sourceURL=webpack://gramjs/./node_modules/parse-asn1/aesid.json?"); /***/ }), /***/ "./node_modules/parse-asn1/asn1.js": /*!*****************************************!*\ !*** ./node_modules/parse-asn1/asn1.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js\n// Fedor, you are amazing.\n\n\nvar asn1 = __webpack_require__(/*! asn1.js */ \"./node_modules/asn1.js/lib/asn1.js\");\n\nexports.certificate = __webpack_require__(/*! ./certificate */ \"./node_modules/parse-asn1/certificate.js\");\nvar RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n 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\"]());\n});\nexports.RSAPrivateKey = RSAPrivateKey;\nvar RSAPublicKey = asn1.define('RSAPublicKey', function () {\n this.seq().obj(this.key('modulus')[\"int\"](), this.key('publicExponent')[\"int\"]());\n});\nexports.RSAPublicKey = RSAPublicKey;\nvar PublicKey = asn1.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(this.key('algorithm').use(AlgorithmIdentifier), this.key('subjectPublicKey').bitstr());\n});\nexports.PublicKey = PublicKey;\nvar AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n 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());\n});\nvar PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {\n this.seq().obj(this.key('version')[\"int\"](), this.key('algorithm').use(AlgorithmIdentifier), this.key('subjectPrivateKey').octstr());\n});\nexports.PrivateKey = PrivateKeyInfo;\nvar EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {\n 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());\n});\nexports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;\nvar DSAPrivateKey = asn1.define('DSAPrivateKey', function () {\n 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\"]());\n});\nexports.DSAPrivateKey = DSAPrivateKey;\nexports.DSAparam = asn1.define('DSAparam', function () {\n this[\"int\"]();\n});\nvar ECPrivateKey = asn1.define('ECPrivateKey', function () {\n 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());\n});\nexports.ECPrivateKey = ECPrivateKey;\nvar ECParameters = asn1.define('ECParameters', function () {\n this.choice({\n namedCurve: this.objid()\n });\n});\nexports.signature = asn1.define('signature', function () {\n this.seq().obj(this.key('r')[\"int\"](), this.key('s')[\"int\"]());\n});\n\n//# sourceURL=webpack://gramjs/./node_modules/parse-asn1/asn1.js?"); /***/ }), /***/ "./node_modules/parse-asn1/certificate.js": /*!************************************************!*\ !*** ./node_modules/parse-asn1/certificate.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js\n// thanks to @Rantanen\n\n\nvar asn = __webpack_require__(/*! asn1.js */ \"./node_modules/asn1.js/lib/asn1.js\");\n\nvar Time = asn.define('Time', function () {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n });\n});\nvar AttributeTypeValue = asn.define('AttributeTypeValue', function () {\n this.seq().obj(this.key('type').objid(), this.key('value').any());\n});\nvar AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {\n this.seq().obj(this.key('algorithm').objid(), this.key('parameters').optional(), this.key('curve').objid().optional());\n});\nvar SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(this.key('algorithm').use(AlgorithmIdentifier), this.key('subjectPublicKey').bitstr());\n});\nvar RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {\n this.setof(AttributeTypeValue);\n});\nvar RDNSequence = asn.define('RDNSequence', function () {\n this.seqof(RelativeDistinguishedName);\n});\nvar Name = asn.define('Name', function () {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n });\n});\nvar Validity = asn.define('Validity', function () {\n this.seq().obj(this.key('notBefore').use(Time), this.key('notAfter').use(Time));\n});\nvar Extension = asn.define('Extension', function () {\n this.seq().obj(this.key('extnID').objid(), this.key('critical').bool().def(false), this.key('extnValue').octstr());\n});\nvar TBSCertificate = asn.define('TBSCertificate', function () {\n this.seq().obj(this.key('version').explicit(0)[\"int\"]().optional(), 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());\n});\nvar X509Certificate = asn.define('X509Certificate', function () {\n this.seq().obj(this.key('tbsCertificate').use(TBSCertificate), this.key('signatureAlgorithm').use(AlgorithmIdentifier), this.key('signatureValue').bitstr());\n});\nmodule.exports = X509Certificate;\n\n//# sourceURL=webpack://gramjs/./node_modules/parse-asn1/certificate.js?"); /***/ }), /***/ "./node_modules/parse-asn1/fixProc.js": /*!********************************************!*\ !*** ./node_modules/parse-asn1/fixProc.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// adapted from https://github.com/apatil/pemstrip\nvar findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r\\+\\/\\=]+)[\\n\\r]+/m;\nvar startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m;\nvar fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r\\+\\/\\=]+)-----END \\1-----$/m;\n\nvar evp = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\");\n\nvar ciphers = __webpack_require__(/*! browserify-aes */ \"./node_modules/browserify-aes/browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nmodule.exports = function (okey, password) {\n var key = okey.toString();\n var match = key.match(findProc);\n var decrypted;\n\n if (!match) {\n var match2 = key.match(fullRegex);\n decrypted = new Buffer(match2[2].replace(/[\\r\\n]/g, ''), 'base64');\n } else {\n var suite = 'aes' + match[1];\n var iv = Buffer.from(match[2], 'hex');\n var cipherText = Buffer.from(match[3].replace(/[\\r\\n]/g, ''), 'base64');\n var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key;\n var out = [];\n var cipher = ciphers.createDecipheriv(suite, cipherKey, iv);\n out.push(cipher.update(cipherText));\n out.push(cipher[\"final\"]());\n decrypted = Buffer.concat(out);\n }\n\n var tag = key.match(startRegex)[1];\n return {\n tag: tag,\n data: decrypted\n };\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/parse-asn1/fixProc.js?"); /***/ }), /***/ "./node_modules/parse-asn1/index.js": /*!******************************************!*\ !*** ./node_modules/parse-asn1/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar asn1 = __webpack_require__(/*! ./asn1 */ \"./node_modules/parse-asn1/asn1.js\");\n\nvar aesid = __webpack_require__(/*! ./aesid.json */ \"./node_modules/parse-asn1/aesid.json\");\n\nvar fixProc = __webpack_require__(/*! ./fixProc */ \"./node_modules/parse-asn1/fixProc.js\");\n\nvar ciphers = __webpack_require__(/*! browserify-aes */ \"./node_modules/browserify-aes/browser.js\");\n\nvar compat = __webpack_require__(/*! pbkdf2 */ \"./node_modules/pbkdf2/browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nmodule.exports = parseKeys;\n\nfunction parseKeys(buffer) {\n var password;\n\n if (_typeof(buffer) === 'object' && !Buffer.isBuffer(buffer)) {\n password = buffer.passphrase;\n buffer = buffer.key;\n }\n\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer);\n }\n\n var stripped = fixProc(buffer, password);\n var type = stripped.tag;\n var data = stripped.data;\n var subtype, ndata;\n\n switch (type) {\n case 'CERTIFICATE':\n ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo;\n // falls through\n\n case 'PUBLIC KEY':\n if (!ndata) {\n ndata = asn1.PublicKey.decode(data, 'der');\n }\n\n subtype = ndata.algorithm.algorithm.join('.');\n\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der');\n\n case '1.2.840.10045.2.1':\n ndata.subjectPrivateKey = ndata.subjectPublicKey;\n return {\n type: 'ec',\n data: ndata\n };\n\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der');\n return {\n type: 'dsa',\n data: ndata.algorithm.params\n };\n\n default:\n throw new Error('unknown key id ' + subtype);\n }\n\n throw new Error('unknown key type ' + type);\n\n case 'ENCRYPTED PRIVATE KEY':\n data = asn1.EncryptedPrivateKey.decode(data, 'der');\n data = decrypt(data, password);\n // falls through\n\n case 'PRIVATE KEY':\n ndata = asn1.PrivateKey.decode(data, 'der');\n subtype = ndata.algorithm.algorithm.join('.');\n\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der');\n\n case '1.2.840.10045.2.1':\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey\n };\n\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der');\n return {\n type: 'dsa',\n params: ndata.algorithm.params\n };\n\n default:\n throw new Error('unknown key id ' + subtype);\n }\n\n throw new Error('unknown key type ' + type);\n\n case 'RSA PUBLIC KEY':\n return asn1.RSAPublicKey.decode(data, 'der');\n\n case 'RSA PRIVATE KEY':\n return asn1.RSAPrivateKey.decode(data, 'der');\n\n case 'DSA PRIVATE KEY':\n return {\n type: 'dsa',\n params: asn1.DSAPrivateKey.decode(data, 'der')\n };\n\n case 'EC PRIVATE KEY':\n data = asn1.ECPrivateKey.decode(data, 'der');\n return {\n curve: data.parameters.value,\n privateKey: data.privateKey\n };\n\n default:\n throw new Error('unknown key type ' + type);\n }\n}\n\nparseKeys.signature = asn1.signature;\n\nfunction decrypt(data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt;\n var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10);\n var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')];\n var iv = data.algorithm.decrypt.cipher.iv;\n var cipherText = data.subjectPrivateKey;\n var keylen = parseInt(algo.split('-')[1], 10) / 8;\n var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1');\n var cipher = ciphers.createDecipheriv(algo, key, iv);\n var out = [];\n out.push(cipher.update(cipherText));\n out.push(cipher[\"final\"]());\n return Buffer.concat(out);\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/parse-asn1/index.js?"); /***/ }), /***/ "./node_modules/pbkdf2/browser.js": /*!****************************************!*\ !*** ./node_modules/pbkdf2/browser.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ \"./node_modules/pbkdf2/lib/async.js\");\nexports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ \"./node_modules/pbkdf2/lib/sync-browser.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/pbkdf2/browser.js?"); /***/ }), /***/ "./node_modules/pbkdf2/lib/async.js": /*!******************************************!*\ !*** ./node_modules/pbkdf2/lib/async.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global, process) {var checkParameters = __webpack_require__(/*! ./precondition */ \"./node_modules/pbkdf2/lib/precondition.js\");\n\nvar defaultEncoding = __webpack_require__(/*! ./default-encoding */ \"./node_modules/pbkdf2/lib/default-encoding.js\");\n\nvar sync = __webpack_require__(/*! ./sync */ \"./node_modules/pbkdf2/lib/sync-browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar ZERO_BUF;\nvar subtle = global.crypto && global.crypto.subtle;\nvar toBrowser = {\n 'sha': 'SHA-1',\n 'sha-1': 'SHA-1',\n 'sha1': 'SHA-1',\n 'sha256': 'SHA-256',\n 'sha-256': 'SHA-256',\n 'sha384': 'SHA-384',\n 'sha-384': 'SHA-384',\n 'sha-512': 'SHA-512',\n 'sha512': 'SHA-512'\n};\nvar checks = [];\n\nfunction checkNative(algo) {\n if (global.process && !global.process.browser) {\n return Promise.resolve(false);\n }\n\n if (!subtle || !subtle.importKey || !subtle.deriveBits) {\n return Promise.resolve(false);\n }\n\n if (checks[algo] !== undefined) {\n return checks[algo];\n }\n\n ZERO_BUF = ZERO_BUF || Buffer.alloc(8);\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function () {\n return true;\n })[\"catch\"](function () {\n return false;\n });\n checks[algo] = prom;\n return prom;\n}\n\nfunction browserPbkdf2(password, salt, iterations, length, algo) {\n return subtle.importKey('raw', password, {\n name: 'PBKDF2'\n }, false, ['deriveBits']).then(function (key) {\n return subtle.deriveBits({\n name: 'PBKDF2',\n salt: salt,\n iterations: iterations,\n hash: {\n name: algo\n }\n }, key, length << 3);\n }).then(function (res) {\n return Buffer.from(res);\n });\n}\n\nfunction resolvePromise(promise, callback) {\n promise.then(function (out) {\n process.nextTick(function () {\n callback(null, out);\n });\n }, function (e) {\n process.nextTick(function () {\n callback(e);\n });\n });\n}\n\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\n if (typeof digest === 'function') {\n callback = digest;\n digest = undefined;\n }\n\n digest = digest || 'sha1';\n var algo = toBrowser[digest.toLowerCase()];\n\n if (!algo || typeof global.Promise !== 'function') {\n return process.nextTick(function () {\n var out;\n\n try {\n out = sync(password, salt, iterations, keylen, digest);\n } catch (e) {\n return callback(e);\n }\n\n callback(null, out);\n });\n }\n\n checkParameters(password, salt, iterations, keylen);\n if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2');\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding);\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding);\n resolvePromise(checkNative(algo).then(function (resp) {\n if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo);\n return sync(password, salt, iterations, keylen, digest);\n }), callback);\n};\n/* 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\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/pbkdf2/lib/async.js?"); /***/ }), /***/ "./node_modules/pbkdf2/lib/default-encoding.js": /*!*****************************************************!*\ !*** ./node_modules/pbkdf2/lib/default-encoding.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding;\n/* istanbul ignore next */\n\nif (process.browser) {\n defaultEncoding = 'utf-8';\n} else {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10);\n defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary';\n}\n\nmodule.exports = defaultEncoding;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/pbkdf2/lib/default-encoding.js?"); /***/ }), /***/ "./node_modules/pbkdf2/lib/precondition.js": /*!*************************************************!*\ !*** ./node_modules/pbkdf2/lib/precondition.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var MAX_ALLOC = Math.pow(2, 30) - 1; // default in iojs\n\nfunction checkBuffer(buf, name) {\n if (typeof buf !== 'string' && !Buffer.isBuffer(buf)) {\n throw new TypeError(name + ' must be a buffer or string');\n }\n}\n\nmodule.exports = function (password, salt, iterations, keylen) {\n checkBuffer(password, 'Password');\n checkBuffer(salt, 'Salt');\n\n if (typeof iterations !== 'number') {\n throw new TypeError('Iterations not a number');\n }\n\n if (iterations < 0) {\n throw new TypeError('Bad iterations');\n }\n\n if (typeof keylen !== 'number') {\n throw new TypeError('Key length not a number');\n }\n\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) {\n /* eslint no-self-compare: 0 */\n throw new TypeError('Bad key length');\n }\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/pbkdf2/lib/precondition.js?"); /***/ }), /***/ "./node_modules/pbkdf2/lib/sync-browser.js": /*!*************************************************!*\ !*** ./node_modules/pbkdf2/lib/sync-browser.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var md5 = __webpack_require__(/*! create-hash/md5 */ \"./node_modules/create-hash/md5.js\");\n\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\");\n\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\");\n\nvar checkParameters = __webpack_require__(/*! ./precondition */ \"./node_modules/pbkdf2/lib/precondition.js\");\n\nvar defaultEncoding = __webpack_require__(/*! ./default-encoding */ \"./node_modules/pbkdf2/lib/default-encoding.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar ZEROS = Buffer.alloc(128);\nvar sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n};\n\nfunction Hmac(alg, key, saltLen) {\n var hash = getDigest(alg);\n var blocksize = alg === 'sha512' || alg === 'sha384' ? 128 : 64;\n\n if (key.length > blocksize) {\n key = hash(key);\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize);\n }\n\n var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]);\n var opad = Buffer.allocUnsafe(blocksize + sizes[alg]);\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36;\n opad[i] = key[i] ^ 0x5C;\n }\n\n var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4);\n ipad.copy(ipad1, 0, 0, blocksize);\n this.ipad1 = ipad1;\n this.ipad2 = ipad;\n this.opad = opad;\n this.alg = alg;\n this.blocksize = blocksize;\n this.hash = hash;\n this.size = sizes[alg];\n}\n\nHmac.prototype.run = function (data, ipad) {\n data.copy(ipad, this.blocksize);\n var h = this.hash(ipad);\n h.copy(this.opad, this.blocksize);\n return this.hash(this.opad);\n};\n\nfunction getDigest(alg) {\n function shaFunc(data) {\n return sha(alg).update(data).digest();\n }\n\n function rmd160Func(data) {\n return new RIPEMD160().update(data).digest();\n }\n\n if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func;\n if (alg === 'md5') return md5;\n return shaFunc;\n}\n\nfunction pbkdf2(password, salt, iterations, keylen, digest) {\n checkParameters(password, salt, iterations, keylen);\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding);\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding);\n digest = digest || 'sha1';\n var hmac = new Hmac(digest, password, salt.length);\n var DK = Buffer.allocUnsafe(keylen);\n var block1 = Buffer.allocUnsafe(salt.length + 4);\n salt.copy(block1, 0, 0, salt.length);\n var destPos = 0;\n var hLen = sizes[digest];\n var l = Math.ceil(keylen / hLen);\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length);\n var T = hmac.run(block1, hmac.ipad1);\n var U = T;\n\n for (var j = 1; j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2);\n\n for (var k = 0; k < hLen; k++) {\n T[k] ^= U[k];\n }\n }\n\n T.copy(DK, destPos);\n destPos += hLen;\n }\n\n return DK;\n}\n\nmodule.exports = pbkdf2;\n\n//# sourceURL=webpack://gramjs/./node_modules/pbkdf2/lib/sync-browser.js?"); /***/ }), /***/ "./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"; eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nif (typeof process === 'undefined' || !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = {\n nextTick: nextTick\n };\n} else {\n module.exports = process;\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n\n var len = arguments.length;\n var args, i;\n\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n\n default:\n args = new Array(len - 1);\n i = 0;\n\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/process-nextick-args/index.js?"); /***/ }), /***/ "./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/process/browser.js?"); /***/ }), /***/ "./node_modules/public-encrypt/browser.js": /*!************************************************!*\ !*** ./node_modules/public-encrypt/browser.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ \"./node_modules/public-encrypt/publicEncrypt.js\");\nexports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ \"./node_modules/public-encrypt/privateDecrypt.js\");\n\nexports.privateEncrypt = function privateEncrypt(key, buf) {\n return exports.publicEncrypt(key, buf, true);\n};\n\nexports.publicDecrypt = function publicDecrypt(key, buf) {\n return exports.privateDecrypt(key, buf, true);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/browser.js?"); /***/ }), /***/ "./node_modules/public-encrypt/mgf.js": /*!********************************************!*\ !*** ./node_modules/public-encrypt/mgf.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nmodule.exports = function (seed, len) {\n var t = Buffer.alloc(0);\n var i = 0;\n var c;\n\n while (t.length < len) {\n c = i2ops(i++);\n t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]);\n }\n\n return t.slice(0, len);\n};\n\nfunction i2ops(c) {\n var out = Buffer.allocUnsafe(4);\n out.writeUInt32BE(c, 0);\n return out;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/mgf.js?"); /***/ }), /***/ "./node_modules/public-encrypt/privateDecrypt.js": /*!*******************************************************!*\ !*** ./node_modules/public-encrypt/privateDecrypt.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\n\nvar mgf = __webpack_require__(/*! ./mgf */ \"./node_modules/public-encrypt/mgf.js\");\n\nvar xor = __webpack_require__(/*! ./xor */ \"./node_modules/public-encrypt/xor.js\");\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar crt = __webpack_require__(/*! browserify-rsa */ \"./node_modules/browserify-rsa/index.js\");\n\nvar createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\n\nvar withPublic = __webpack_require__(/*! ./withPublic */ \"./node_modules/public-encrypt/withPublic.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nmodule.exports = function privateDecrypt(privateKey, enc, reverse) {\n var padding;\n\n if (privateKey.padding) {\n padding = privateKey.padding;\n } else if (reverse) {\n padding = 1;\n } else {\n padding = 4;\n }\n\n var key = parseKeys(privateKey);\n var k = key.modulus.byteLength();\n\n if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {\n throw new Error('decryption error');\n }\n\n var msg;\n\n if (reverse) {\n msg = withPublic(new BN(enc), key);\n } else {\n msg = crt(enc, key);\n }\n\n var zBuffer = Buffer.alloc(k - msg.length);\n msg = Buffer.concat([zBuffer, msg], k);\n\n if (padding === 4) {\n return oaep(key, msg);\n } else if (padding === 1) {\n return pkcs1(key, msg, reverse);\n } else if (padding === 3) {\n return msg;\n } else {\n throw new Error('unknown padding');\n }\n};\n\nfunction oaep(key, msg) {\n var k = key.modulus.byteLength();\n var iHash = createHash('sha1').update(Buffer.alloc(0)).digest();\n var hLen = iHash.length;\n\n if (msg[0] !== 0) {\n throw new Error('decryption error');\n }\n\n var maskedSeed = msg.slice(1, hLen + 1);\n var maskedDb = msg.slice(hLen + 1);\n var seed = xor(maskedSeed, mgf(maskedDb, hLen));\n var db = xor(maskedDb, mgf(seed, k - hLen - 1));\n\n if (compare(iHash, db.slice(0, hLen))) {\n throw new Error('decryption error');\n }\n\n var i = hLen;\n\n while (db[i] === 0) {\n i++;\n }\n\n if (db[i++] !== 1) {\n throw new Error('decryption error');\n }\n\n return db.slice(i);\n}\n\nfunction pkcs1(key, msg, reverse) {\n var p1 = msg.slice(0, 2);\n var i = 2;\n var status = 0;\n\n while (msg[i++] !== 0) {\n if (i >= msg.length) {\n status++;\n break;\n }\n }\n\n var ps = msg.slice(2, i - 1);\n\n if (p1.toString('hex') !== '0002' && !reverse || p1.toString('hex') !== '0001' && reverse) {\n status++;\n }\n\n if (ps.length < 8) {\n status++;\n }\n\n if (status) {\n throw new Error('decryption error');\n }\n\n return msg.slice(i);\n}\n\nfunction compare(a, b) {\n a = Buffer.from(a);\n b = Buffer.from(b);\n var dif = 0;\n var len = a.length;\n\n if (a.length !== b.length) {\n dif++;\n len = Math.min(a.length, b.length);\n }\n\n var i = -1;\n\n while (++i < len) {\n dif += a[i] ^ b[i];\n }\n\n return dif;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/privateDecrypt.js?"); /***/ }), /***/ "./node_modules/public-encrypt/publicEncrypt.js": /*!******************************************************!*\ !*** ./node_modules/public-encrypt/publicEncrypt.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\n\nvar randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\n\nvar createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\n\nvar mgf = __webpack_require__(/*! ./mgf */ \"./node_modules/public-encrypt/mgf.js\");\n\nvar xor = __webpack_require__(/*! ./xor */ \"./node_modules/public-encrypt/xor.js\");\n\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar withPublic = __webpack_require__(/*! ./withPublic */ \"./node_modules/public-encrypt/withPublic.js\");\n\nvar crt = __webpack_require__(/*! browserify-rsa */ \"./node_modules/browserify-rsa/index.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nmodule.exports = function publicEncrypt(publicKey, msg, reverse) {\n var padding;\n\n if (publicKey.padding) {\n padding = publicKey.padding;\n } else if (reverse) {\n padding = 1;\n } else {\n padding = 4;\n }\n\n var key = parseKeys(publicKey);\n var paddedMsg;\n\n if (padding === 4) {\n paddedMsg = oaep(key, msg);\n } else if (padding === 1) {\n paddedMsg = pkcs1(key, msg, reverse);\n } else if (padding === 3) {\n paddedMsg = new BN(msg);\n\n if (paddedMsg.cmp(key.modulus) >= 0) {\n throw new Error('data too long for modulus');\n }\n } else {\n throw new Error('unknown padding');\n }\n\n if (reverse) {\n return crt(paddedMsg, key);\n } else {\n return withPublic(paddedMsg, key);\n }\n};\n\nfunction oaep(key, msg) {\n var k = key.modulus.byteLength();\n var mLen = msg.length;\n var iHash = createHash('sha1').update(Buffer.alloc(0)).digest();\n var hLen = iHash.length;\n var hLen2 = 2 * hLen;\n\n if (mLen > k - hLen2 - 2) {\n throw new Error('message too long');\n }\n\n var ps = Buffer.alloc(k - mLen - hLen2 - 2);\n var dblen = k - hLen - 1;\n var seed = randomBytes(hLen);\n var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen));\n var maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k));\n}\n\nfunction pkcs1(key, msg, reverse) {\n var mLen = msg.length;\n var k = key.modulus.byteLength();\n\n if (mLen > k - 11) {\n throw new Error('message too long');\n }\n\n var ps;\n\n if (reverse) {\n ps = Buffer.alloc(k - mLen - 3, 0xff);\n } else {\n ps = nonZero(k - mLen - 3);\n }\n\n return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k));\n}\n\nfunction nonZero(len) {\n var out = Buffer.allocUnsafe(len);\n var i = 0;\n var cache = randomBytes(len * 2);\n var cur = 0;\n var num;\n\n while (i < len) {\n if (cur === cache.length) {\n cache = randomBytes(len * 2);\n cur = 0;\n }\n\n num = cache[cur++];\n\n if (num) {\n out[i++] = num;\n }\n }\n\n return out;\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/publicEncrypt.js?"); /***/ }), /***/ "./node_modules/public-encrypt/withPublic.js": /*!***************************************************!*\ !*** ./node_modules/public-encrypt/withPublic.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nfunction withPublic(paddedMsg, key) {\n return Buffer.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());\n}\n\nmodule.exports = withPublic;\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/withPublic.js?"); /***/ }), /***/ "./node_modules/public-encrypt/xor.js": /*!********************************************!*\ !*** ./node_modules/public-encrypt/xor.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = function xor(a, b) {\n var len = a.length;\n var i = -1;\n\n while (++i < len) {\n a[i] ^= b[i];\n }\n\n return a;\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/public-encrypt/xor.js?"); /***/ }), /***/ "./node_modules/python-struct/src/browser_adapter.js": /*!***********************************************************!*\ !*** ./node_modules/python-struct/src/browser_adapter.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nmodule.exports = __webpack_require__(/*! ./core */ \"./node_modules/python-struct/src/core.js\")(Object.assign({\n Buffer: __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer,\n isLittleEndian: (typeof Uint8Array === \"undefined\" ? \"undefined\" : _typeof(Uint8Array)) !== undefined ? new Uint8Array(new Uint32Array([0x12345678]).buffer)[0] === 0x78 : true,\n is64bit: (typeof navigator === \"undefined\" ? \"undefined\" : _typeof(navigator)) !== undefined ? /WOW64|Win64|arm64|ia64|x64;|Mac OS X/i.test(navigator.userAgent) : true\n}, __webpack_require__(/*! ./long_packers.js */ \"./node_modules/python-struct/src/long_packers.js\")));\n\n//# sourceURL=webpack://gramjs/./node_modules/python-struct/src/browser_adapter.js?"); /***/ }), /***/ "./node_modules/python-struct/src/core.js": /*!************************************************!*\ !*** ./node_modules/python-struct/src/core.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Copied over from python's notes:\n\n Optional first char:\n @: native order, size & alignment (default)\n =: native order, std. size & alignment\n <: little-endian, std. size & alignment\n >: big-endian, std. size & alignment\n !: same as >\n\n The remaining chars indicate types of args and must match exactly;\n these can be preceded by a decimal repeat count:\n\n x: pad byte (no data)\n c: char\n b: signed byte\n B: unsigned byte\n h: short\n H: unsigned short\n i: int\n I: unsigned int\n l: long\n L: unsigned long\n f: float\n d: double\n s: string (array of char, preceding decimal count indicates length)\n p: pascal string (with count byte, preceding decimal count indicates length)\n P: an integer type that is wide enough to hold a pointer (only available in native format)\n q: long long (not in native mode unless 'long long' in platform C)\n Q: unsigned long long (not in native mode unless 'long long' in platform C)\n ?: boolean\n */\n\n/**\n * @template type\n * @typedef {function(data: T, pack: Buffer, pos: number)} PythonStruct~PackFunc\n */\n\n/**\n * @template type\n * @typedef {function(data: Buffer, pos: number):T} PythonStruct~UnpackFunc\n */\n\n/** */\n// Maps consist of: size, alignment, unpack function\nvar UNPACK_STRING = function UNPACK_STRING(data, pos, length) {\n var nextZero = data.indexOf(0, pos);\n var endIndex = Math.min(pos + length, nextZero === -1 ? data.length : nextZero);\n return data.slice(pos, endIndex).toString('utf8');\n};\n\nvar PACK_STRING = function PACK_STRING(data, pack, pos, length) {\n var written = pack.write(data, pos, length, 'utf8');\n\n if (written < length) {\n pack.fill(0, pos + written, pos + length);\n }\n};\n\nvar UNPACK_PASCAL_STRING = function UNPACK_PASCAL_STRING(data, pos, length) {\n var n = data[0];\n\n if (n >= length) {\n n = length - 1;\n }\n\n pos++;\n return data.slice(pos, pos + n).toString('utf8');\n};\n\nvar PACK_PASCAL_STRING = function PACK_PASCAL_STRING(data, pack, pos, length) {\n var bytes = Buffer.alloc(data, 'utf8');\n var n = bytes.length;\n\n if (n >= length) {\n n = length - 1;\n }\n\n if (n > 255) {\n n = 255;\n }\n\n bytes[pos] = n;\n bytes.copy(pack, pos + 1, 0, n);\n pack.fill(0, pos + 1 + n, pos + length);\n};\n\nvar UNPACK_UINT32_LE = function UNPACK_UINT32_LE(data, pos) {\n return data.readUInt32LE(pos, true);\n};\n\nvar UNPACK_UINT32_BE = function UNPACK_UINT32_BE(data, pos) {\n return data.readUInt32BE(pos, true);\n};\n\nvar UNPACK_INT32_LE = function UNPACK_INT32_LE(data, pos) {\n return data.readInt32LE(pos, true);\n};\n\nvar UNPACK_INT32_BE = function UNPACK_INT32_BE(data, pos) {\n return data.readInt32BE(pos, true);\n};\n\nvar PACK_UINT32_LE = function PACK_UINT32_LE(data, pack, pos) {\n pack.writeUInt32LE(data, pos, true);\n};\n\nvar PACK_UINT32_BE = function PACK_UINT32_BE(data, pack, pos) {\n pack.writeUInt32BE(data, pos, true);\n};\n\nvar PACK_INT32_LE = function PACK_INT32_LE(data, pack, pos) {\n pack.writeInt32LE(data, pos, true);\n};\n\nvar PACK_INT32_BE = function PACK_INT32_BE(data, pack, pos) {\n pack.writeInt32BE(data, pos, true);\n};\n/**\n * @param {Object} options\n * @param {typeof Buffer} options.Buffer\n * @param {boolean} [options.isLittleEndian=true]\n * @param {boolean} [options.is64bit=true]\n * @param {PythonStruct~UnpackFunc} options.unpackUInt64LE\n * @param {PythonStruct~UnpackFunc} options.unpackUInt64BE\n * @param {PythonStruct~UnpackFunc} options.unpackInt64LE\n * @param {PythonStruct~UnpackFunc} options.unpackInt64BE\n * @param {PythonStruct~PackFunc} options.packUInt64LE\n * @param {PythonStruct~PackFunc} options.packUInt64BE\n * @param {PythonStruct~PackFunc} options.packInt64LE\n * @param {PythonStruct~PackFunc} options.packInt64BE\n */\n\n\nfunction generateClass(options) {\n var Buffer = options.Buffer;\n var IS_LITTLE_ENDIAN = options.isLittleEndian === undefined ? true : !!options.isLittleEndian;\n var IS_64_BIT = options.is64bit === undefined ? true : !!options.is64bit;\n var UNPACK_UINT64_LE = options.unpackUInt64LE;\n var UNPACK_UINT64_BE = options.unpackUInt64BE;\n var UNPACK_INT64_LE = options.unpackInt64LE;\n var UNPACK_INT64_BE = options.unpackInt64BE;\n var PACK_UINT64_LE = options.packUInt64LE;\n var PACK_UINT64_BE = options.packUInt64BE;\n var PACK_INT64_LE = options.packInt64LE;\n var PACK_INT64_BE = options.packInt64BE;\n /**\n * Note: In the \"native\" map, we do not really have a way (currently) of figuring out\n * the native size & alignment of things. We default to the \"standard\" here,\n * assuming the node_adapter.js is always compiled in these architectures.\n */\n\n var NATIVE_MAP = {\n 'x': [1, 1, null, null],\n 'c': [1, 1, function (data, pos) {\n return String.fromCharCode(data[pos]);\n }, function (data, pack, pos) {\n pack[pos] = data.charCodeAt(0);\n }],\n 'b': [1, 1, function (data, pos) {\n return data.readInt8(pos);\n }, function (data, pack, pos) {\n pack.writeInt8(data, pos, true);\n }],\n 'B': [1, 1, function (data, pos) {\n return data[pos];\n }, function (data, pack, pos) {\n pack[pos] = data;\n }],\n 'h': [2, 2, IS_LITTLE_ENDIAN ? function (data, pos) {\n return data.readInt16LE(pos);\n } : function (data, pos) {\n return data.readInt16BE(pos);\n }, IS_LITTLE_ENDIAN ? function (data, pack, pos) {\n return pack.writeInt16LE(data, pos, true);\n } : function (data, pack, pos) {\n return pack.writeInt16BE(data, pos, true);\n }],\n 'H': [2, 2, IS_LITTLE_ENDIAN ? function (data, pos) {\n return data.readUInt16LE(pos);\n } : function (data, pos) {\n return data.readUInt16BE(pos);\n }, IS_LITTLE_ENDIAN ? function (data, pack, pos) {\n return pack.writeUInt16LE(data, pos, true);\n } : function (data, pack, pos) {\n return pack.writeUInt16BE(data, pos, true);\n }],\n 'i': [4, 4, IS_LITTLE_ENDIAN ? UNPACK_INT32_LE : UNPACK_INT32_BE, IS_LITTLE_ENDIAN ? PACK_INT32_LE : PACK_INT32_BE],\n 'I': [4, 4, IS_LITTLE_ENDIAN ? UNPACK_UINT32_LE : UNPACK_UINT32_BE, IS_LITTLE_ENDIAN ? PACK_UINT32_LE : PACK_UINT32_BE],\n 'l': [4, 4, IS_LITTLE_ENDIAN ? UNPACK_INT32_LE : UNPACK_INT32_BE, IS_LITTLE_ENDIAN ? PACK_INT32_LE : PACK_INT32_BE],\n 'L': [4, 4, IS_LITTLE_ENDIAN ? UNPACK_UINT32_LE : UNPACK_UINT32_BE, IS_LITTLE_ENDIAN ? PACK_UINT32_LE : PACK_UINT32_BE],\n 'f': [4, 4, IS_LITTLE_ENDIAN ? function (data, pos) {\n return data.readFloatLE(pos);\n } : function (data, pos) {\n return data.readFloatBE(pos);\n }, IS_LITTLE_ENDIAN ? function (data, pack, pos) {\n return pack.writeFloatLE(data, pos, true);\n } : function (data, pack, pos) {\n return pack.writeFloatBE(data, pos, true);\n }],\n 'd': [8, 8, IS_LITTLE_ENDIAN ? function (data, pos) {\n return data.readDoubleLE(pos);\n } : function (data, pos) {\n return data.readDoubleBE(pos);\n }, IS_LITTLE_ENDIAN ? function (data, pack, pos) {\n return pack.writeDoubleLE(data, pos, true);\n } : function (data, pack, pos) {\n return pack.writeDoubleBE(data, pos, true);\n }],\n 's': [1, 1, UNPACK_STRING, PACK_STRING],\n 'p': [1, 1, UNPACK_PASCAL_STRING, PACK_PASCAL_STRING],\n 'P': [IS_64_BIT ? 8 : 4, IS_64_BIT ? 8 : 4, IS_LITTLE_ENDIAN ? IS_64_BIT ? UNPACK_UINT64_LE : UNPACK_UINT32_LE : IS_64_BIT ? UNPACK_UINT64_BE : UNPACK_UINT32_BE, IS_LITTLE_ENDIAN ? IS_64_BIT ? PACK_UINT64_LE : PACK_UINT32_LE : IS_64_BIT ? PACK_UINT64_BE : PACK_UINT32_BE],\n 'q': [8, 8, IS_LITTLE_ENDIAN ? UNPACK_INT64_LE : UNPACK_INT64_BE, IS_LITTLE_ENDIAN ? PACK_INT64_LE : PACK_INT64_BE],\n 'Q': [8, 8, IS_LITTLE_ENDIAN ? UNPACK_UINT64_LE : UNPACK_UINT64_BE, IS_LITTLE_ENDIAN ? PACK_UINT64_LE : PACK_UINT64_BE],\n '?': [1, 1, function (data, pos) {\n return data[pos] !== 0;\n }, function (data, pack, pos) {\n pack[pos] = data ? 1 : 0;\n }]\n };\n var LITTLE_ENDIAN_MAP = {\n 'x': [1, 1, null, null],\n 'c': [1, 1, function (data, pos) {\n return String.fromCharCode(data[pos]);\n }, function (data, pack, pos) {\n pack[pos] = data.charCodeAt(0);\n }],\n 'b': [1, 1, function (data, pos) {\n return data.readInt8(pos);\n }, function (data, pack, pos) {\n pack.writeInt8(data, pos, true);\n }],\n 'B': [1, 1, function (data, pos) {\n return data[pos];\n }, function (data, pack, pos) {\n pack[pos] = data;\n }],\n 'h': [2, 1, function (data, pos) {\n return data.readInt16LE(pos);\n }, function (data, pack, pos) {\n return pack.writeInt16LE(data, pos, true);\n }],\n 'H': [2, 1, function (data, pos) {\n return data.readUInt16LE(pos);\n }, function (data, pack, pos) {\n return pack.writeUInt16LE(data, pos, true);\n }],\n 'i': [4, 1, UNPACK_INT32_LE, PACK_INT32_LE],\n 'I': [4, 1, UNPACK_UINT32_LE, PACK_UINT32_LE],\n 'l': [4, 1, UNPACK_INT32_LE, PACK_INT32_LE],\n 'L': [4, 1, UNPACK_UINT32_LE, PACK_UINT32_LE],\n 'f': [4, 1, function (data, pos) {\n return data.readFloatLE(pos);\n }, function (data, pack, pos) {\n return pack.writeFloatLE(data, pos, true);\n }],\n 'd': [8, 1, function (data, pos) {\n return data.readDoubleLE(pos);\n }, function (data, pack, pos) {\n return pack.writeDoubleLE(data, pos, true);\n }],\n 's': [1, 1, UNPACK_STRING, PACK_STRING],\n 'p': [1, 1, UNPACK_PASCAL_STRING, PACK_PASCAL_STRING],\n 'P': [IS_64_BIT ? 8 : 4, 1, IS_64_BIT ? UNPACK_UINT64_LE : UNPACK_UINT32_LE, IS_64_BIT ? PACK_UINT64_LE : PACK_UINT32_LE],\n 'q': [8, 1, UNPACK_INT64_LE, PACK_INT64_LE],\n 'Q': [8, 1, UNPACK_UINT64_LE, PACK_UINT64_LE],\n '?': [1, 1, function (data, pos) {\n return data[pos] !== 0;\n }, function (data, pack, pos) {\n pack[pos] = data ? 1 : 0;\n }]\n };\n var BIG_ENDIAN_MAP = {\n 'x': [1, 1, null, null],\n 'c': [1, 1, function (data, pos) {\n return String.fromCharCode(data[pos]);\n }, function (data, pack, pos) {\n pack[pos] = data.charCodeAt(0);\n }],\n 'b': [1, 1, function (data, pos) {\n return data.readInt8(pos);\n }, function (data, pack, pos) {\n pack.writeInt8(data, pos, true);\n }],\n 'B': [1, 1, function (data, pos) {\n return data[pos];\n }, function (data, pack, pos) {\n pack[pos] = data;\n }],\n 'h': [2, 1, function (data, pos) {\n return data.readInt16BE(pos);\n }, function (data, pack, pos) {\n return pack.writeInt16BE(data, pos, true);\n }],\n 'H': [2, 1, function (data, pos) {\n return data.readUInt16BE(pos);\n }, function (data, pack, pos) {\n return pack.writeUInt16BE(data, pos, true);\n }],\n 'i': [4, 1, UNPACK_INT32_BE, PACK_INT32_BE],\n 'I': [4, 1, UNPACK_UINT32_BE, PACK_UINT32_BE],\n 'l': [4, 1, UNPACK_INT32_BE, PACK_INT32_BE],\n 'L': [4, 1, UNPACK_UINT32_BE, PACK_UINT32_BE],\n 'f': [4, 1, function (data, pos) {\n return data.readFloatBE(pos);\n }, function (data, pack, pos) {\n return pack.writeFloatBE(data, pos, true);\n }],\n 'd': [8, 1, function (data, pos) {\n return data.readDoubleBE(pos);\n }, function (data, pack, pos) {\n return pack.writeDoubleBE(data, pos, true);\n }],\n 's': [1, 1, UNPACK_STRING, PACK_STRING],\n 'p': [1, 1, UNPACK_PASCAL_STRING, PACK_PASCAL_STRING],\n 'P': [IS_64_BIT ? 8 : 4, 1, IS_64_BIT ? UNPACK_UINT64_BE : UNPACK_UINT32_BE, IS_64_BIT ? PACK_UINT64_BE : PACK_UINT32_BE],\n 'q': [8, 1, UNPACK_INT64_BE, PACK_INT64_BE],\n 'Q': [8, 1, UNPACK_UINT64_BE, PACK_UINT64_BE],\n '?': [1, 1, function (data, pos) {\n return data[pos] !== 0;\n }, function (data, pack, pos) {\n pack[pos] = data ? 1 : 0;\n }]\n };\n\n var selectMap = function selectMap(format) {\n var c = format[0];\n var skipFirst = true;\n var map = NATIVE_MAP;\n\n switch (c) {\n case '<':\n map = LITTLE_ENDIAN_MAP;\n break;\n\n case '>':\n case '!':\n map = BIG_ENDIAN_MAP;\n break;\n\n case '=':\n map = IS_LITTLE_ENDIAN ? LITTLE_ENDIAN_MAP : BIG_ENDIAN_MAP;\n break;\n\n default:\n skipFirst = false;\n // fallthrough\n\n case '@':\n map = NATIVE_MAP;\n break;\n }\n\n return {\n map: map,\n skipFirst: skipFirst\n };\n };\n\n var PythonStruct =\n /*#__PURE__*/\n function () {\n function PythonStruct() {\n _classCallCheck(this, PythonStruct);\n }\n\n _createClass(PythonStruct, null, [{\n key: \"sizeOf\",\n value: function sizeOf(format) {\n var size = 0;\n var decimal = null;\n var i = 0,\n c,\n len,\n op,\n align;\n var selected = selectMap(format);\n var map = selected.map;\n\n if (selected.skipFirst) {\n i++;\n }\n\n for (len = format.length; i < len; i++) {\n c = format[i];\n\n if (c >= '0' && c <= '9') {\n decimal = decimal === null ? c : decimal + c;\n continue;\n }\n\n op = map[c];\n if (!op) continue; // Ignore other characters\n // Align position\n\n align = op[1];\n\n if (align > 1) {\n size = Math.ceil(size / align) * align;\n } // Update size\n\n\n decimal = decimal ? parseInt(decimal, 10) : 0;\n\n if (c === 's') {\n size += decimal || 0;\n } else if (c === 'p') {\n size += decimal || 1;\n } else {\n size += op[0] * (decimal || 1);\n }\n\n decimal = null;\n }\n\n return size;\n }\n }, {\n key: \"unpack\",\n value: function unpack(format, data, checkBounds) {\n return this.unpackFrom(format, data, checkBounds, 0);\n }\n }, {\n key: \"unpackFrom\",\n value: function unpackFrom(format, data, checkBounds, position) {\n var unpacked = [];\n var decimal = null;\n var i = 0;\n var selected = selectMap(format);\n var map = selected.map;\n\n if (selected.skipFirst) {\n i++;\n }\n\n for (var len = format.length; i < len; i++) {\n var c = format[i];\n\n if (c >= '0' && c <= '9') {\n decimal = decimal === null ? c : decimal + c;\n continue;\n }\n\n var op = map[c];\n if (!op) continue; // Ignore other characters\n\n var size = op[0]; // Align position\n\n var align = op[1];\n\n if (align > 1) {\n position = Math.ceil(position / align) * align;\n } // Unpack\n\n\n decimal = decimal ? parseInt(decimal, 10) : 0;\n /** @type number */\n\n var repeat = void 0;\n\n if (c === 's') {\n repeat = 1;\n size = decimal;\n } else if (c === 'p') {\n repeat = 1;\n size = decimal || 1;\n } else {\n repeat = decimal || 1;\n }\n\n var unpack = op[2];\n\n while (repeat > 0) {\n if (unpack) {\n if (checkBounds) {\n if (position + size >= data.length) {\n throw new Error('Reached end of buffer, can\\'t unpack anymore data.');\n }\n }\n\n unpacked.push(unpack(data, position, decimal));\n } // Update position according to size\n\n\n position += size; // Decrement repeat count\n\n repeat--;\n }\n\n decimal = null;\n }\n\n return unpacked;\n }\n }, {\n key: \"pack\",\n value: function pack(format, data, checkBounds) {\n // Support python-style argument array for data\n if (!Array.isArray(data)) {\n data = Array.prototype.slice.call(arguments, 1);\n checkBounds = true;\n }\n\n var packed = Buffer.alloc(PythonStruct.sizeOf(format));\n var position = 0;\n var decimal = null;\n var i = 0;\n var dIndex = 0;\n var selected = selectMap(format);\n var map = selected.map;\n\n if (selected.skipFirst) {\n i++;\n }\n\n for (var len = format.length; i < len; i++) {\n var c = format[i];\n\n if (c >= '0' && c <= '9') {\n decimal = decimal === null ? c : decimal + c;\n continue;\n }\n\n var op = map[c];\n if (!op) continue; // Ignore other characters\n\n var size = op[0]; // Align position\n\n var align = op[1];\n\n if (align > 1) {\n position = Math.ceil(position / align) * align;\n } // Pack\n\n\n decimal = decimal ? parseInt(decimal, 10) : 0;\n /** @type number */\n\n var repeat = void 0;\n\n if (c === 's') {\n repeat = 1;\n size = decimal;\n } else if (c === 'p') {\n repeat = 1;\n size = decimal || 1;\n } else {\n repeat = decimal || 1;\n }\n\n var pack = op[3];\n\n while (repeat > 0) {\n if (pack) {\n if (checkBounds) {\n if (dIndex >= data.length) {\n throw new Error('Reached end of data, no more elements to pack.');\n }\n }\n\n pack(data[dIndex], packed, position, decimal);\n dIndex++;\n } // Update position according to size\n\n\n position += size; // Decrement repeat count\n\n repeat--;\n }\n\n decimal = null;\n }\n\n return packed;\n }\n }]);\n\n return PythonStruct;\n }();\n\n return PythonStruct;\n}\n\nmodule.exports = generateClass;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://gramjs/./node_modules/python-struct/src/core.js?"); /***/ }), /***/ "./node_modules/python-struct/src/long_packers.js": /*!********************************************************!*\ !*** ./node_modules/python-struct/src/long_packers.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Long = __webpack_require__(/*! long */ \"./node_modules/long/src/long.js\");\n\nvar UNPACK_UINT64_LE = function UNPACK_UINT64_LE(data, pos) {\n return Long.fromBits(data.readInt32LE(pos), data.readInt32LE(pos + 4), true);\n};\n\nvar UNPACK_UINT64_BE = function UNPACK_UINT64_BE(data, pos) {\n return Long.fromBits(data.readInt32BE(pos + 4), data.readInt32BE(pos), true);\n};\n\nvar UNPACK_INT64_LE = function UNPACK_INT64_LE(data, pos) {\n return Long.fromBits(data.readInt32LE(pos), data.readInt32LE(pos + 4), false);\n};\n\nvar UNPACK_INT64_BE = function UNPACK_INT64_BE(data, pos) {\n return Long.fromBits(data.readInt32BE(pos + 4), data.readInt32BE(pos), false);\n};\n\nvar PACK_INT64_LE = function PACK_INT64_LE(data, pack, pos) {\n if (!(data instanceof Long)) {\n if (typeof data === 'number') data = Long.fromNumber(data);else data = Long.fromString(data || '');\n }\n\n pack.writeInt32LE(data.getLowBits(), pos, true);\n pack.writeInt32LE(data.getHighBits(), pos + 4, true);\n};\n\nvar PACK_INT64_BE = function PACK_INT64_BE(data, pack, pos) {\n if (!(data instanceof Long)) {\n if (typeof data === 'number') data = Long.fromNumber(data);else data = Long.fromString(data || '');\n }\n\n pack.writeInt32BE(data.getHighBits(), pos, true);\n pack.writeInt32BE(data.getLowBits(), pos + 4, true);\n};\n\nmodule.exports = {\n unpackUInt64LE: UNPACK_UINT64_LE,\n unpackUInt64BE: UNPACK_UINT64_BE,\n unpackInt64LE: UNPACK_INT64_LE,\n unpackInt64BE: UNPACK_INT64_BE,\n packUInt64LE: PACK_INT64_LE,\n packUInt64BE: PACK_INT64_BE,\n packInt64LE: PACK_INT64_LE,\n packInt64BE: PACK_INT64_BE\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/python-struct/src/long_packers.js?"); /***/ }), /***/ "./node_modules/randombytes/browser.js": /*!*********************************************!*\ !*** ./node_modules/randombytes/browser.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(global, process) { // limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n\nvar MAX_BYTES = 65536; // Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\n\nvar MAX_UINT32 = 4294967295;\n\nfunction oldBrowser() {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11');\n}\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar crypto = global.crypto || global.msCrypto;\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes;\n} else {\n module.exports = oldBrowser;\n}\n\nfunction randomBytes(size, cb) {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes');\n var bytes = Buffer.allocUnsafe(size);\n\n if (size > 0) {\n // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) {\n // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (var generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));\n }\n } else {\n crypto.getRandomValues(bytes);\n }\n }\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes);\n });\n }\n\n return bytes;\n}\n/* 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\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/randombytes/browser.js?"); /***/ }), /***/ "./node_modules/randomfill/browser.js": /*!********************************************!*\ !*** ./node_modules/randomfill/browser.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\nfunction oldBrowser() {\n throw new Error('secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11');\n}\n\nvar safeBuffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\");\n\nvar randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\n\nvar Buffer = safeBuffer.Buffer;\nvar kBufferMaxLength = safeBuffer.kMaxLength;\nvar crypto = global.crypto || global.msCrypto;\nvar kMaxUint32 = Math.pow(2, 32) - 1;\n\nfunction assertOffset(offset, length) {\n if (typeof offset !== 'number' || offset !== offset) {\n // eslint-disable-line no-self-compare\n throw new TypeError('offset must be a number');\n }\n\n if (offset > kMaxUint32 || offset < 0) {\n throw new TypeError('offset must be a uint32');\n }\n\n if (offset > kBufferMaxLength || offset > length) {\n throw new RangeError('offset out of range');\n }\n}\n\nfunction assertSize(size, offset, length) {\n if (typeof size !== 'number' || size !== size) {\n // eslint-disable-line no-self-compare\n throw new TypeError('size must be a number');\n }\n\n if (size > kMaxUint32 || size < 0) {\n throw new TypeError('size must be a uint32');\n }\n\n if (size + offset > length || size > kBufferMaxLength) {\n throw new RangeError('buffer too small');\n }\n}\n\nif (crypto && crypto.getRandomValues || !process.browser) {\n exports.randomFill = randomFill;\n exports.randomFillSync = randomFillSync;\n} else {\n exports.randomFill = oldBrowser;\n exports.randomFillSync = oldBrowser;\n}\n\nfunction randomFill(buf, offset, size, cb) {\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array');\n }\n\n if (typeof offset === 'function') {\n cb = offset;\n offset = 0;\n size = buf.length;\n } else if (typeof size === 'function') {\n cb = size;\n size = buf.length - offset;\n } else if (typeof cb !== 'function') {\n throw new TypeError('\"cb\" argument must be a function');\n }\n\n assertOffset(offset, buf.length);\n assertSize(size, offset, buf.length);\n return actualFill(buf, offset, size, cb);\n}\n\nfunction actualFill(buf, offset, size, cb) {\n if (process.browser) {\n var ourBuf = buf.buffer;\n var uint = new Uint8Array(ourBuf, offset, size);\n crypto.getRandomValues(uint);\n\n if (cb) {\n process.nextTick(function () {\n cb(null, buf);\n });\n return;\n }\n\n return buf;\n }\n\n if (cb) {\n randombytes(size, function (err, bytes) {\n if (err) {\n return cb(err);\n }\n\n bytes.copy(buf, offset);\n cb(null, buf);\n });\n return;\n }\n\n var bytes = randombytes(size);\n bytes.copy(buf, offset);\n return buf;\n}\n\nfunction randomFillSync(buf, offset, size) {\n if (typeof offset === 'undefined') {\n offset = 0;\n }\n\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array');\n }\n\n assertOffset(offset, buf.length);\n if (size === undefined) size = buf.length - offset;\n assertSize(size, offset, buf.length);\n return actualFill(buf, offset, size);\n}\n/* 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\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/randomfill/browser.js?"); /***/ }), /***/ "./node_modules/readable-stream/duplex-browser.js": /*!********************************************************!*\ !*** ./node_modules/readable-stream/duplex-browser.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/duplex-browser.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_duplex.js": /*!************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n/**/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/**/\n\n/**/\n\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n keys.push(key);\n }\n\n return keys;\n};\n/**/\n\n\nmodule.exports = Duplex;\n/**/\n\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\n\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/**/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/readable-stream/lib/_stream_readable.js\");\n\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n if (options && options.readable === false) this.readable = false;\n if (options && options.writable === false) this.writable = false;\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n}); // the no-half-open enforcer\n\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written.\n // But allow more writes to happen in this tick.\n\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/_stream_duplex.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_passthrough.js": /*!*****************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/readable-stream/lib/_stream_transform.js\");\n/**/\n\n\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\n\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/_stream_passthrough.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_readable.js": /*!**************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_readable.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/**/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/**/\n\n\nmodule.exports = Readable;\n/**/\n\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/**/\n\n/**/\n\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = __webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/**/\n\n/**/\n\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n/**/\n\n\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\n\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/**/\n\n/**/\n\nvar debugUtil = __webpack_require__(/*! util */ 0);\n\nvar debug = void 0;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/readable-stream/lib/internal/streams/BufferList.js\");\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nvar StringDecoder;\nutil.inherits(Readable, Stream);\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n var isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; // cast to ints.\n\n this.highWaterMark = Math.floor(this.highWaterMark); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n if (!(this instanceof Readable)) return new Readable(options);\n this._readableState = new ReadableState(options, this); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n\n return er;\n} // if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\n\n\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n}; // Don't raise the hwm > 8MB\n\n\nvar MAX_HWM = 0x800000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true; // emit 'readable' now to make sure it gets picked up.\n\n emitReadable(stream);\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n } // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n\n\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {}\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList; // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n return ret;\n} // Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n\n return ret;\n} // Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n list.length -= c;\n return ret;\n} // Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState; // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}\n/* 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\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/_stream_readable.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_transform.js": /*!***************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_transform.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n/**/\n\n\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\n\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n }; // start out asking for a readable event once data is transformed.\n\n this._readableState.needReadable = true; // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n } // When the writable side finishes, then flush out anything remaining.\n\n\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n}; // This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\n\n\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n}; // Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\n\n\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data); // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n return stream.push(null);\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/_stream_transform.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_writable.js": /*!**************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_writable.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n/**/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/**/\n\n\nmodule.exports = Writable;\n/* */\n\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n} // It seems a linked list but it is not\n// there will be only 2 of these for each stream\n\n\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\n\n\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/**/\n\n/**/\n\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n/**/\n\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\n\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/**/\n\n/**/\n\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/**/\n\n/**/\n\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/**/\n\n/**/\n\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n var isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; // cast to ints.\n\n this.highWaterMark = Math.floor(this.highWaterMark); // if _final has been called\n\n this.finalCalled = false; // drain event flag.\n\n this.needDrain = false; // at the start of calling end()\n\n this.ending = false; // when end() has been called, and returned\n\n this.ended = false; // when 'finish' is emitted\n\n this.finished = false; // has it been destroyed\n\n this.destroyed = false; // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n\n this.length = 0; // a flag to see when we're in the middle of a write.\n\n this.writing = false; // when true all writes will be buffered until .uncork() call\n\n this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n\n this.sync = true; // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n\n this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)\n\n this.onwrite = function (er) {\n onwrite(stream, er);\n }; // the callback that the user supplies to write(chunk,encoding,cb)\n\n\n this.writecb = null; // the amount that is being written when _write is called.\n\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null; // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n\n this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n\n this.prefinished = false; // True if the error was already emitted and should not be thrown again\n\n this.errorEmitted = false; // count buffered requests\n\n this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n\n while (current) {\n out.push(current);\n current = current.next;\n }\n\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})(); // Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\n\n\nvar realHasInstance;\n\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\"); // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this); // legacy.\n\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options[\"final\"] === 'function') this._final = options[\"final\"];\n }\n\n Stream.call(this);\n} // Otherwise people can pipe Writable streams, which is just wrong.\n\n\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb\n\n stream.emit('error', er);\n pna.nextTick(cb, er);\n} // Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\n\n\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n}); // if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\n\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.\n\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er); // this can emit finish, and it will always happen\n // after error\n\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er); // this can emit finish, but finish must\n // always follow error\n\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n} // Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\n\n\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it\n\n\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n\n state.pendingcb++;\n state.lastBufferedRequest = null;\n\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks\n\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n } // ignore unnecessary end() calls.\n\n\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\n\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n\n if (err) {\n stream.emit('error', err);\n }\n\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\n\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n\n if (need) {\n prefinish(stream, state);\n\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\n\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../timers-browserify/main.js */ \"./node_modules/timers-browserify/main.js\").setImmediate, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/_stream_writable.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/BufferList.js": /*!*************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n\nvar util = __webpack_require__(/*! util */ 1);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = {\n data: v,\n next: null\n };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = {\n data: v,\n next: this.head\n };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n\n while (p = p.next) {\n ret += s + p.data;\n }\n\n return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({\n length: this.length\n });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/internal/streams/BufferList.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/destroy.js": /*!**********************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n/**/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/**/\n// undocumented cb() API, needed for core, not for public API\n\n\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n\n return this;\n } // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n } // if this is a duplex stream mark the writable part as destroyed as well\n\n\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/internal/streams/destroy.js?"); /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/stream-browser.js": /*!*****************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter;\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/lib/internal/streams/stream-browser.js?"); /***/ }), /***/ "./node_modules/readable-stream/passthrough.js": /*!*****************************************************!*\ !*** ./node_modules/readable-stream/passthrough.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./readable */ \"./node_modules/readable-stream/readable-browser.js\").PassThrough;\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/passthrough.js?"); /***/ }), /***/ "./node_modules/readable-stream/readable-browser.js": /*!**********************************************************!*\ !*** ./node_modules/readable-stream/readable-browser.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/readable-browser.js?"); /***/ }), /***/ "./node_modules/readable-stream/transform.js": /*!***************************************************!*\ !*** ./node_modules/readable-stream/transform.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./readable */ \"./node_modules/readable-stream/readable-browser.js\").Transform;\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/transform.js?"); /***/ }), /***/ "./node_modules/readable-stream/writable-browser.js": /*!**********************************************************!*\ !*** ./node_modules/readable-stream/writable-browser.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/readable-stream/lib/_stream_writable.js\");\n\n//# sourceURL=webpack://gramjs/./node_modules/readable-stream/writable-browser.js?"); /***/ }), /***/ "./node_modules/regenerator-runtime/runtime.js": /*!*****************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar runtime = function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n return generator;\n }\n\n exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\"; // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n\n var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n\n\n var IteratorPrototype = {};\n\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n\n if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = \"GeneratorFunction\"; // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function (genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n };\n\n exports.mark = function (genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n\n genFun.prototype = Object.create(Gp);\n return genFun;\n }; // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n\n\n exports.awrap = function (arg) {\n return {\n __await: arg\n };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n\n if (value && _typeof(value) === \"object\" && hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function (unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function (error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n } // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n\n\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n\n exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n\n exports.async = function (innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));\n return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n } // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n\n\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n var record = tryCatch(innerFn, self, context);\n\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n } else if (record.type === \"throw\") {\n state = GenStateCompleted; // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n } // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (!info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).\n\n context.next = delegate.nextLoc; // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n } // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n\n\n context.delegate = null;\n return ContinueSentinel;\n } // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n\n\n defineIteratorMethods(Gp);\n Gp[toStringTagSymbol] = \"Generator\"; // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n\n Gp[iteratorSymbol] = function () {\n return this;\n };\n\n Gp.toString = function () {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{\n tryLoc: \"root\"\n }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n keys.reverse(); // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n } // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n\n\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n return next;\n };\n\n return next.next = next;\n }\n } // Return an iterator with no values.\n\n\n return {\n next: doneResult\n };\n }\n\n exports.values = values;\n\n function doneResult() {\n return {\n value: undefined,\n done: true\n };\n }\n\n Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n this.prev = 0;\n this.next = 0; // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n this.method = \"next\";\n this.arg = undefined;\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n stop: function stop() {\n this.done = true;\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" || record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n } // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n }; // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n\n return exports;\n}( // If this script is executing as a CommonJS module, use module.exports\n// as the regeneratorRuntime namespace. Otherwise create a new empty\n// object. Either way, the resulting object will be used to initialize\n// the regeneratorRuntime variable at the top of this file.\n( false ? undefined : _typeof(module)) === \"object\" ? module.exports : {});\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://gramjs/./node_modules/regenerator-runtime/runtime.js?"); /***/ }), /***/ "./node_modules/ripemd160/index.js": /*!*****************************************!*\ !*** ./node_modules/ripemd160/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar HashBase = __webpack_require__(/*! hash-base */ \"./node_modules/hash-base/index.js\");\n\nvar ARRAY16 = new Array(16);\nvar zl = [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];\nvar zr = [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];\nvar sl = [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];\nvar sr = [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];\nvar hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e];\nvar hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000];\n\nfunction RIPEMD160() {\n HashBase.call(this, 64); // state\n\n this._a = 0x67452301;\n this._b = 0xefcdab89;\n this._c = 0x98badcfe;\n this._d = 0x10325476;\n this._e = 0xc3d2e1f0;\n}\n\ninherits(RIPEMD160, HashBase);\n\nRIPEMD160.prototype._update = function () {\n var words = ARRAY16;\n\n for (var j = 0; j < 16; ++j) {\n words[j] = this._block.readInt32LE(j * 4);\n }\n\n var al = this._a | 0;\n var bl = this._b | 0;\n var cl = this._c | 0;\n var dl = this._d | 0;\n var el = this._e | 0;\n var ar = this._a | 0;\n var br = this._b | 0;\n var cr = this._c | 0;\n var dr = this._d | 0;\n var er = this._e | 0; // computation\n\n for (var i = 0; i < 80; i += 1) {\n var tl;\n var tr;\n\n if (i < 16) {\n tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]);\n tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i]);\n } else if (i < 32) {\n tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]);\n tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i]);\n } else if (i < 48) {\n tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]);\n tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i]);\n } else if (i < 64) {\n tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]);\n tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i]);\n } else {\n // if (i<80) {\n tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]);\n tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i]);\n }\n\n al = el;\n el = dl;\n dl = rotl(cl, 10);\n cl = bl;\n bl = tl;\n ar = er;\n er = dr;\n dr = rotl(cr, 10);\n cr = br;\n br = tr;\n } // update state\n\n\n var t = this._b + cl + dr | 0;\n this._b = this._c + dl + er | 0;\n this._c = this._d + el + ar | 0;\n this._d = this._e + al + br | 0;\n this._e = this._a + bl + cr | 0;\n this._a = t;\n};\n\nRIPEMD160.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80;\n\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64);\n\n this._update();\n\n this._blockOffset = 0;\n }\n\n this._block.fill(0, this._blockOffset, 56);\n\n this._block.writeUInt32LE(this._length[0], 56);\n\n this._block.writeUInt32LE(this._length[1], 60);\n\n this._update(); // produce result\n\n\n var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20);\n buffer.writeInt32LE(this._a, 0);\n buffer.writeInt32LE(this._b, 4);\n buffer.writeInt32LE(this._c, 8);\n buffer.writeInt32LE(this._d, 12);\n buffer.writeInt32LE(this._e, 16);\n return buffer;\n};\n\nfunction rotl(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction fn1(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;\n}\n\nfunction fn2(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;\n}\n\nfunction fn3(a, b, c, d, e, m, k, s) {\n return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;\n}\n\nfunction fn4(a, b, c, d, e, m, k, s) {\n return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;\n}\n\nfunction fn5(a, b, c, d, e, m, k, s) {\n return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;\n}\n\nmodule.exports = RIPEMD160;\n\n//# sourceURL=webpack://gramjs/./node_modules/ripemd160/index.js?"); /***/ }), /***/ "./node_modules/safe-buffer/index.js": /*!*******************************************!*\ !*** ./node_modules/safe-buffer/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* eslint-disable node/no-deprecated-api */\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n\nvar Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers\n\nfunction copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}\n\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer;\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports);\n exports.Buffer = SafeBuffer;\n}\n\nfunction SafeBuffer(arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length);\n} // Copy static methods from Buffer\n\n\ncopyProps(Buffer, SafeBuffer);\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number');\n }\n\n return Buffer(arg, encodingOrOffset, length);\n};\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number');\n }\n\n var buf = Buffer(size);\n\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding);\n } else {\n buf.fill(fill);\n }\n } else {\n buf.fill(0);\n }\n\n return buf;\n};\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number');\n }\n\n return Buffer(size);\n};\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number');\n }\n\n return buffer.SlowBuffer(size);\n};\n\n//# sourceURL=webpack://gramjs/./node_modules/safe-buffer/index.js?"); /***/ }), /***/ "./node_modules/safer-buffer/safer.js": /*!********************************************!*\ !*** ./node_modules/safer-buffer/safer.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable node/no-deprecated-api */\n\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\");\n\nvar Buffer = buffer.Buffer;\nvar safer = {};\nvar key;\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue;\n if (key === 'SlowBuffer' || key === 'Buffer') continue;\n safer[key] = buffer[key];\n}\n\nvar Safer = safer.Buffer = {};\n\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue;\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue;\n Safer[key] = Buffer[key];\n}\n\nsafer.Buffer.prototype = Buffer.prototype;\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + _typeof(value));\n }\n\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + _typeof(value));\n }\n\n return Buffer(value, encodingOrOffset, length);\n };\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + _typeof(size));\n }\n\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"');\n }\n\n var buf = Buffer(size);\n\n if (!fill || fill.length === 0) {\n buf.fill(0);\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding);\n } else {\n buf.fill(fill);\n }\n\n return buf;\n };\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength;\n } catch (e) {// we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n };\n\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength;\n }\n}\n\nmodule.exports = safer;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://gramjs/./node_modules/safer-buffer/safer.js?"); /***/ }), /***/ "./node_modules/setimmediate/setImmediate.js": /*!***************************************************!*\ !*** ./node_modules/setimmediate/setImmediate.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n } // Copy function arguments\n\n\n var args = new Array(arguments.length - 1);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n } // Store and register the task\n\n\n var task = {\n callback: callback,\n args: args\n };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n\n switch (args.length) {\n case 0:\n callback();\n break;\n\n case 1:\n callback(args[0]);\n break;\n\n case 2:\n callback(args[0], args[1]);\n break;\n\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n\n if (task) {\n currentlyRunningATask = true;\n\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function registerImmediate(handle) {\n process.nextTick(function () {\n runIfPresent(handle);\n });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n\n global.onmessage = function () {\n postMessageIsAsynchronous = false;\n };\n\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n\n var onGlobalMessage = function onGlobalMessage(event) {\n if (event.source === global && typeof event.data === \"string\" && event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function registerImmediate(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n\n channel.port1.onmessage = function (event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function registerImmediate(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n\n registerImmediate = function registerImmediate(handle) {\n // Create a