/* Copyright 2017 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /** @export */ var BrotliDecode = (function() { "use strict"; /** @type {!Int8Array} */ var DICTIONARY_DATA = new Int8Array(0); /** * @constructor * @param {!Int8Array} bytes * @struct */ function InputStream(bytes) { /** @type {!Int8Array} */ this.data = bytes; /** @type {!number} */ this.offset = 0; } var CODE_LENGTH_CODE_ORDER = Int32Array.from([1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15]); var DISTANCE_SHORT_CODE_INDEX_OFFSET = Int32Array.from([3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2]); var DISTANCE_SHORT_CODE_VALUE_OFFSET = Int32Array.from([0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3]); var FIXED_TABLE = Int32Array.from([0x020000, 0x020004, 0x020003, 0x030002, 0x020000, 0x020004, 0x020003, 0x040001, 0x020000, 0x020004, 0x020003, 0x030002, 0x020000, 0x020004, 0x020003, 0x040005]); var DICTIONARY_OFFSETS_BY_LENGTH = Int32Array.from([0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536, 115968, 118528, 119872, 121280, 122016]); var DICTIONARY_SIZE_BITS_BY_LENGTH = Int32Array.from([0, 0, 0, 0, 10, 10, 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, 7, 6, 6, 5, 5]); var BLOCK_LENGTH_OFFSET = Int32Array.from([1, 5, 9, 13, 17, 25, 33, 41, 49, 65, 81, 97, 113, 145, 177, 209, 241, 305, 369, 497, 753, 1265, 2289, 4337, 8433, 16625]); var BLOCK_LENGTH_N_BITS = Int32Array.from([2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 24]); var INSERT_LENGTH_OFFSET = Int32Array.from([0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, 34, 50, 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594]); var INSERT_LENGTH_N_BITS = Int32Array.from([0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 12, 14, 24]); var COPY_LENGTH_OFFSET = Int32Array.from([2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, 22, 30, 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118]); var COPY_LENGTH_N_BITS = Int32Array.from([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 24]); var INSERT_RANGE_LUT = Int32Array.from([0, 0, 8, 8, 0, 16, 8, 16, 16]); var COPY_RANGE_LUT = Int32Array.from([0, 8, 0, 8, 16, 0, 16, 8, 16]); /** * @param {!State} s * @return {!number} */ function decodeWindowBits(s) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } if (readFewBits(s, 1) == 0) { return 16; } var /** !number */ n = readFewBits(s, 3); if (n != 0) { return 17 + n; } n = readFewBits(s, 3); if (n != 0) { return 8 + n; } return 17; } /** * @param {!State} s * @param {!InputStream} input * @return {!void} */ function initState(s, input) { if (s.runningState != 0) { throw "State MUST be uninitialized"; } s.blockTrees = new Int32Array(6480); s.input = input; initBitReader(s); var /** !number */ windowBits = decodeWindowBits(s); if (windowBits == 9) { throw "Invalid 'windowBits' code"; } s.maxRingBufferSize = 1 << windowBits; s.maxBackwardDistance = s.maxRingBufferSize - 16; s.runningState = 1; } /** * @param {!State} s * @return {!void} */ function close(s) { if (s.runningState == 0) { throw "State MUST be initialized"; } if (s.runningState == 11) { return; } s.runningState = 11; if (s.input != null) { closeInput(s.input); s.input = null; } } /** * @param {!State} s * @return {!number} */ function decodeVarLenUnsignedByte(s) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } if (readFewBits(s, 1) != 0) { var /** !number */ n = readFewBits(s, 3); if (n == 0) { return 1; } else { return readFewBits(s, n) + (1 << n); } } return 0; } /** * @param {!State} s * @return {!void} */ function decodeMetaBlockLength(s) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } s.inputEnd = readFewBits(s, 1); s.metaBlockLength = 0; s.isUncompressed = 0; s.isMetadata = 0; if ((s.inputEnd != 0) && readFewBits(s, 1) != 0) { return; } var /** !number */ sizeNibbles = readFewBits(s, 2) + 4; if (sizeNibbles == 7) { s.isMetadata = 1; if (readFewBits(s, 1) != 0) { throw "Corrupted reserved bit"; } var /** !number */ sizeBytes = readFewBits(s, 2); if (sizeBytes == 0) { return; } for (var /** !number */ i = 0; i < sizeBytes; i++) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ bits = readFewBits(s, 8); if (bits == 0 && i + 1 == sizeBytes && sizeBytes > 1) { throw "Exuberant nibble"; } s.metaBlockLength |= bits << (i * 8); } } else { for (var /** !number */ i = 0; i < sizeNibbles; i++) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ bits = readFewBits(s, 4); if (bits == 0 && i + 1 == sizeNibbles && sizeNibbles > 4) { throw "Exuberant nibble"; } s.metaBlockLength |= bits << (i * 4); } } s.metaBlockLength++; if (s.inputEnd == 0) { s.isUncompressed = readFewBits(s, 1); } } /** * @param {!Int32Array} table * @param {!number} offset * @param {!State} s * @return {!number} */ function readSymbol(table, offset, s) { var /** !number */ val = (s.accumulator32 >>> s.bitOffset); offset += val & 0xFF; var /** !number */ bits = table[offset] >> 16; var /** !number */ sym = table[offset] & 0xFFFF; if (bits <= 8) { s.bitOffset += bits; return sym; } offset += sym; var /** !number */ mask = (1 << bits) - 1; offset += (val & mask) >>> 8; s.bitOffset += ((table[offset] >> 16) + 8); return table[offset] & 0xFFFF; } /** * @param {!Int32Array} table * @param {!number} offset * @param {!State} s * @return {!number} */ function readBlockLength(table, offset, s) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ code = readSymbol(table, offset, s); var /** !number */ n = BLOCK_LENGTH_N_BITS[code]; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } return BLOCK_LENGTH_OFFSET[code] + ((n <= 16) ? readFewBits(s, n) : readManyBits(s, n)); } /** * @param {!number} code * @param {!Int32Array} ringBuffer * @param {!number} index * @return {!number} */ function translateShortCodes(code, ringBuffer, index) { if (code < 16) { index += DISTANCE_SHORT_CODE_INDEX_OFFSET[code]; index &= 3; return ringBuffer[index] + DISTANCE_SHORT_CODE_VALUE_OFFSET[code]; } return code - 16 + 1; } /** * @param {!Int32Array} v * @param {!number} index * @return {!void} */ function moveToFront(v, index) { var /** !number */ value = v[index]; for (; index > 0; index--) { v[index] = v[index - 1]; } v[0] = value; } /** * @param {!Int8Array} v * @param {!number} vLen * @return {!void} */ function inverseMoveToFrontTransform(v, vLen) { var /** !Int32Array */ mtf = new Int32Array(256); for (var /** !number */ i = 0; i < 256; i++) { mtf[i] = i; } for (var /** !number */ i = 0; i < vLen; i++) { var /** !number */ index = v[i] & 0xFF; v[i] = mtf[index]; if (index != 0) { moveToFront(mtf, index); } } } /** * @param {!Int32Array} codeLengthCodeLengths * @param {!number} numSymbols * @param {!Int32Array} codeLengths * @param {!State} s * @return {!void} */ function readHuffmanCodeLengths(codeLengthCodeLengths, numSymbols, codeLengths, s) { var /** !number */ symbol = 0; var /** !number */ prevCodeLen = 8; var /** !number */ repeat = 0; var /** !number */ repeatCodeLen = 0; var /** !number */ space = 32768; var /** !Int32Array */ table = new Int32Array(32); buildHuffmanTable(table, 0, 5, codeLengthCodeLengths, 18); while (symbol < numSymbols && space > 0) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ p = (s.accumulator32 >>> s.bitOffset) & 31; s.bitOffset += table[p] >> 16; var /** !number */ codeLen = table[p] & 0xFFFF; if (codeLen < 16) { repeat = 0; codeLengths[symbol++] = codeLen; if (codeLen != 0) { prevCodeLen = codeLen; space -= 32768 >> codeLen; } } else { var /** !number */ extraBits = codeLen - 14; var /** !number */ newLen = 0; if (codeLen == 16) { newLen = prevCodeLen; } if (repeatCodeLen != newLen) { repeat = 0; repeatCodeLen = newLen; } var /** !number */ oldRepeat = repeat; if (repeat > 0) { repeat -= 2; repeat <<= extraBits; } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } repeat += readFewBits(s, extraBits) + 3; var /** !number */ repeatDelta = repeat - oldRepeat; if (symbol + repeatDelta > numSymbols) { throw "symbol + repeatDelta > numSymbols"; } for (var /** !number */ i = 0; i < repeatDelta; i++) { codeLengths[symbol++] = repeatCodeLen; } if (repeatCodeLen != 0) { space -= repeatDelta << (15 - repeatCodeLen); } } } if (space != 0) { throw "Unused space"; } codeLengths.fill(0, symbol, numSymbols); } /** * @param {!Int32Array} symbols * @param {!number} length * @return {!number} */ function checkDupes(symbols, length) { for (var /** !number */ i = 0; i < length - 1; ++i) { for (var /** !number */ j = i + 1; j < length; ++j) { if (symbols[i] == symbols[j]) { return 0; } } } return 1; } /** * @param {!number} alphabetSize * @param {!Int32Array} table * @param {!number} offset * @param {!State} s * @return {!void} */ function readHuffmanCode(alphabetSize, table, offset, s) { var /** !number */ ok = 1; var /** !number */ simpleCodeOrSkip; if (s.halfOffset > 2030) { doReadMoreInput(s); } var /** !Int32Array */ codeLengths = new Int32Array(alphabetSize); if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } simpleCodeOrSkip = readFewBits(s, 2); if (simpleCodeOrSkip == 1) { var /** !number */ maxBitsCounter = alphabetSize - 1; var /** !number */ maxBits = 0; var /** !Int32Array */ symbols = new Int32Array(4); var /** !number */ numSymbols = readFewBits(s, 2) + 1; while (maxBitsCounter != 0) { maxBitsCounter >>= 1; maxBits++; } for (var /** !number */ i = 0; i < numSymbols; i++) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } symbols[i] = readFewBits(s, maxBits) % alphabetSize; codeLengths[symbols[i]] = 2; } codeLengths[symbols[0]] = 1; switch(numSymbols) { case 2: codeLengths[symbols[1]] = 1; break; case 4: if (readFewBits(s, 1) == 1) { codeLengths[symbols[2]] = 3; codeLengths[symbols[3]] = 3; } else { codeLengths[symbols[0]] = 2; } break; default: break; } ok = checkDupes(symbols, numSymbols); } else { var /** !Int32Array */ codeLengthCodeLengths = new Int32Array(18); var /** !number */ space = 32; var /** !number */ numCodes = 0; for (var /** !number */ i = simpleCodeOrSkip; i < 18 && space > 0; i++) { var /** !number */ codeLenIdx = CODE_LENGTH_CODE_ORDER[i]; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ p = (s.accumulator32 >>> s.bitOffset) & 15; s.bitOffset += FIXED_TABLE[p] >> 16; var /** !number */ v = FIXED_TABLE[p] & 0xFFFF; codeLengthCodeLengths[codeLenIdx] = v; if (v != 0) { space -= (32 >> v); numCodes++; } } if (space != 0 && numCodes != 1) { ok = 0; } readHuffmanCodeLengths(codeLengthCodeLengths, alphabetSize, codeLengths, s); } if (ok == 0) { throw "Can't readHuffmanCode"; } buildHuffmanTable(table, offset, 8, codeLengths, alphabetSize); } /** * @param {!number} contextMapSize * @param {!Int8Array} contextMap * @param {!State} s * @return {!number} */ function decodeContextMap(contextMapSize, contextMap, s) { if (s.halfOffset > 2030) { doReadMoreInput(s); } var /** !number */ numTrees = decodeVarLenUnsignedByte(s) + 1; if (numTrees == 1) { contextMap.fill(0, 0, contextMapSize); return numTrees; } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ useRleForZeros = readFewBits(s, 1); var /** !number */ maxRunLengthPrefix = 0; if (useRleForZeros != 0) { maxRunLengthPrefix = readFewBits(s, 4) + 1; } var /** !Int32Array */ table = new Int32Array(1080); readHuffmanCode(numTrees + maxRunLengthPrefix, table, 0, s); for (var /** !number */ i = 0; i < contextMapSize; ) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ code = readSymbol(table, 0, s); if (code == 0) { contextMap[i] = 0; i++; } else if (code <= maxRunLengthPrefix) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ reps = (1 << code) + readFewBits(s, code); while (reps != 0) { if (i >= contextMapSize) { throw "Corrupted context map"; } contextMap[i] = 0; i++; reps--; } } else { contextMap[i] = (code - maxRunLengthPrefix); i++; } } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } if (readFewBits(s, 1) == 1) { inverseMoveToFrontTransform(contextMap, contextMapSize); } return numTrees; } /** * @param {!State} s * @param {!number} treeType * @param {!number} numBlockTypes * @return {!number} */ function decodeBlockTypeAndLength(s, treeType, numBlockTypes) { var /** !Int32Array */ ringBuffers = s.rings; var /** !number */ offset = 4 + treeType * 2; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ blockType = readSymbol(s.blockTrees, treeType * 1080, s); var /** !number */ result = readBlockLength(s.blockTrees, (treeType + 3) * 1080, s); if (blockType == 1) { blockType = ringBuffers[offset + 1] + 1; } else if (blockType == 0) { blockType = ringBuffers[offset]; } else { blockType -= 2; } if (blockType >= numBlockTypes) { blockType -= numBlockTypes; } ringBuffers[offset] = ringBuffers[offset + 1]; ringBuffers[offset + 1] = blockType; return result; } /** * @param {!State} s * @return {!void} */ function decodeLiteralBlockSwitch(s) { s.literalBlockLength = decodeBlockTypeAndLength(s, 0, s.numLiteralBlockTypes); var /** !number */ literalBlockType = s.rings[5]; s.contextMapSlice = literalBlockType << 6; s.literalTreeIndex = s.contextMap[s.contextMapSlice] & 0xFF; s.literalTree = s.hGroup0[s.literalTreeIndex]; var /** !number */ contextMode = s.contextModes[literalBlockType]; s.contextLookupOffset1 = contextMode << 9; s.contextLookupOffset2 = s.contextLookupOffset1 + 256; } /** * @param {!State} s * @return {!void} */ function decodeCommandBlockSwitch(s) { s.commandBlockLength = decodeBlockTypeAndLength(s, 1, s.numCommandBlockTypes); s.treeCommandOffset = s.hGroup1[s.rings[7]]; } /** * @param {!State} s * @return {!void} */ function decodeDistanceBlockSwitch(s) { s.distanceBlockLength = decodeBlockTypeAndLength(s, 2, s.numDistanceBlockTypes); s.distContextMapSlice = s.rings[9] << 2; } /** * @param {!State} s * @return {!void} */ function maybeReallocateRingBuffer(s) { var /** !number */ newSize = s.maxRingBufferSize; if (newSize > s.expectedTotalSize) { var /** !number */ minimalNewSize = s.expectedTotalSize; while ((newSize >> 1) > minimalNewSize) { newSize >>= 1; } if ((s.inputEnd == 0) && newSize < 16384 && s.maxRingBufferSize >= 16384) { newSize = 16384; } } if (newSize <= s.ringBufferSize) { return; } var /** !number */ ringBufferSizeWithSlack = newSize + 37; var /** !Int8Array */ newBuffer = new Int8Array(ringBufferSizeWithSlack); if (s.ringBuffer.length != 0) { newBuffer.set(s.ringBuffer.subarray(0, 0 + s.ringBufferSize), 0); } s.ringBuffer = newBuffer; s.ringBufferSize = newSize; } /** * @param {!State} s * @return {!void} */ function readNextMetablockHeader(s) { if (s.inputEnd != 0) { s.nextRunningState = 10; s.bytesToWrite = s.pos; s.bytesWritten = 0; s.runningState = 12; return; } s.hGroup0 = new Int32Array(0); s.hGroup1 = new Int32Array(0); s.hGroup2 = new Int32Array(0); if (s.halfOffset > 2030) { doReadMoreInput(s); } decodeMetaBlockLength(s); if ((s.metaBlockLength == 0) && (s.isMetadata == 0)) { return; } if ((s.isUncompressed != 0) || (s.isMetadata != 0)) { jumpToByteBoundary(s); s.runningState = (s.isMetadata != 0) ? 4 : 5; } else { s.runningState = 2; } if (s.isMetadata != 0) { return; } s.expectedTotalSize += s.metaBlockLength; if (s.expectedTotalSize > 1 << 30) { s.expectedTotalSize = 1 << 30; } if (s.ringBufferSize < s.maxRingBufferSize) { maybeReallocateRingBuffer(s); } } /** * @param {!State} s * @param {!number} treeType * @param {!number} numBlockTypes * @return {!number} */ function readMetablockPartition(s, treeType, numBlockTypes) { if (numBlockTypes <= 1) { return 1 << 28; } readHuffmanCode(numBlockTypes + 2, s.blockTrees, treeType * 1080, s); readHuffmanCode(26, s.blockTrees, (treeType + 3) * 1080, s); return readBlockLength(s.blockTrees, (treeType + 3) * 1080, s); } /** * @param {!State} s * @return {!void} */ function readMetablockHuffmanCodesAndContextMaps(s) { s.numLiteralBlockTypes = decodeVarLenUnsignedByte(s) + 1; s.literalBlockLength = readMetablockPartition(s, 0, s.numLiteralBlockTypes); s.numCommandBlockTypes = decodeVarLenUnsignedByte(s) + 1; s.commandBlockLength = readMetablockPartition(s, 1, s.numCommandBlockTypes); s.numDistanceBlockTypes = decodeVarLenUnsignedByte(s) + 1; s.distanceBlockLength = readMetablockPartition(s, 2, s.numDistanceBlockTypes); if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } s.distancePostfixBits = readFewBits(s, 2); s.numDirectDistanceCodes = 16 + (readFewBits(s, 4) << s.distancePostfixBits); s.distancePostfixMask = (1 << s.distancePostfixBits) - 1; var /** !number */ numDistanceCodes = s.numDirectDistanceCodes + (48 << s.distancePostfixBits); s.contextModes = new Int8Array(s.numLiteralBlockTypes); for (var /** !number */ i = 0; i < s.numLiteralBlockTypes; ) { var /** !number */ limit = min(i + 96, s.numLiteralBlockTypes); for (; i < limit; ++i) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } s.contextModes[i] = (readFewBits(s, 2)); } if (s.halfOffset > 2030) { doReadMoreInput(s); } } s.contextMap = new Int8Array(s.numLiteralBlockTypes << 6); var /** !number */ numLiteralTrees = decodeContextMap(s.numLiteralBlockTypes << 6, s.contextMap, s); s.trivialLiteralContext = 1; for (var /** !number */ j = 0; j < s.numLiteralBlockTypes << 6; j++) { if (s.contextMap[j] != j >> 6) { s.trivialLiteralContext = 0; break; } } s.distContextMap = new Int8Array(s.numDistanceBlockTypes << 2); var /** !number */ numDistTrees = decodeContextMap(s.numDistanceBlockTypes << 2, s.distContextMap, s); s.hGroup0 = decodeHuffmanTreeGroup(256, numLiteralTrees, s); s.hGroup1 = decodeHuffmanTreeGroup(704, s.numCommandBlockTypes, s); s.hGroup2 = decodeHuffmanTreeGroup(numDistanceCodes, numDistTrees, s); s.contextMapSlice = 0; s.distContextMapSlice = 0; s.contextLookupOffset1 = (s.contextModes[0]) << 9; s.contextLookupOffset2 = s.contextLookupOffset1 + 256; s.literalTreeIndex = 0; s.literalTree = s.hGroup0[0]; s.treeCommandOffset = s.hGroup1[0]; s.rings[4] = 1; s.rings[5] = 0; s.rings[6] = 1; s.rings[7] = 0; s.rings[8] = 1; s.rings[9] = 0; } /** * @param {!State} s * @return {!void} */ function copyUncompressedData(s) { var /** !Int8Array */ ringBuffer = s.ringBuffer; if (s.metaBlockLength <= 0) { reload(s); s.runningState = 1; return; } var /** !number */ chunkLength = min(s.ringBufferSize - s.pos, s.metaBlockLength); copyBytes(s, ringBuffer, s.pos, chunkLength); s.metaBlockLength -= chunkLength; s.pos += chunkLength; if (s.pos == s.ringBufferSize) { s.nextRunningState = 5; s.bytesToWrite = s.ringBufferSize; s.bytesWritten = 0; s.runningState = 12; return; } reload(s); s.runningState = 1; } /** * @param {!State} s * @return {!number} */ function writeRingBuffer(s) { var /** !number */ toWrite = min(s.outputLength - s.outputUsed, s.bytesToWrite - s.bytesWritten); if (toWrite != 0) { s.output.set(s.ringBuffer.subarray(s.bytesWritten, s.bytesWritten + toWrite), s.outputOffset + s.outputUsed); s.outputUsed += toWrite; s.bytesWritten += toWrite; } if (s.outputUsed < s.outputLength) { return 1; } else { return 0; } } /** * @param {!number} alphabetSize * @param {!number} n * @param {!State} s * @return {!Int32Array} */ function decodeHuffmanTreeGroup(alphabetSize, n, s) { var /** !Int32Array */ group = new Int32Array(n + (n * 1080)); var /** !number */ next = n; for (var /** !number */ i = 0; i < n; i++) { group[i] = next; readHuffmanCode(alphabetSize, group, next, s); next += 1080; } return group; } /** * @param {!State} s * @return {!void} */ function decompress(s) { if (s.runningState == 0) { throw "Can't decompress until initialized"; } if (s.runningState == 11) { throw "Can't decompress after close"; } var /** !number */ ringBufferMask = s.ringBufferSize - 1; var /** !Int8Array */ ringBuffer = s.ringBuffer; while (s.runningState != 10) { switch(s.runningState) { case 1: if (s.metaBlockLength < 0) { throw "Invalid metablock length"; } readNextMetablockHeader(s); ringBufferMask = s.ringBufferSize - 1; ringBuffer = s.ringBuffer; continue; case 2: readMetablockHuffmanCodesAndContextMaps(s); s.runningState = 3; case 3: if (s.metaBlockLength <= 0) { s.runningState = 1; continue; } if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.commandBlockLength == 0) { decodeCommandBlockSwitch(s); } s.commandBlockLength--; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ cmdCode = readSymbol(s.hGroup1, s.treeCommandOffset, s); var /** !number */ rangeIdx = cmdCode >>> 6; s.distanceCode = 0; if (rangeIdx >= 2) { rangeIdx -= 2; s.distanceCode = -1; } var /** !number */ insertCode = INSERT_RANGE_LUT[rangeIdx] + ((cmdCode >>> 3) & 7); if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ insertBits = INSERT_LENGTH_N_BITS[insertCode]; var /** !number */ insertExtra = ((insertBits <= 16) ? readFewBits(s, insertBits) : readManyBits(s, insertBits)); s.insertLength = INSERT_LENGTH_OFFSET[insertCode] + insertExtra; var /** !number */ copyCode = COPY_RANGE_LUT[rangeIdx] + (cmdCode & 7); if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ copyBits = COPY_LENGTH_N_BITS[copyCode]; var /** !number */ copyExtra = ((copyBits <= 16) ? readFewBits(s, copyBits) : readManyBits(s, copyBits)); s.copyLength = COPY_LENGTH_OFFSET[copyCode] + copyExtra; s.j = 0; s.runningState = 6; case 6: if (s.trivialLiteralContext != 0) { while (s.j < s.insertLength) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.literalBlockLength == 0) { decodeLiteralBlockSwitch(s); } s.literalBlockLength--; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } ringBuffer[s.pos] = readSymbol(s.hGroup0, s.literalTree, s); s.j++; if (s.pos++ == ringBufferMask) { s.nextRunningState = 6; s.bytesToWrite = s.ringBufferSize; s.bytesWritten = 0; s.runningState = 12; break; } } } else { var /** !number */ prevByte1 = ringBuffer[(s.pos - 1) & ringBufferMask] & 0xFF; var /** !number */ prevByte2 = ringBuffer[(s.pos - 2) & ringBufferMask] & 0xFF; while (s.j < s.insertLength) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.literalBlockLength == 0) { decodeLiteralBlockSwitch(s); } var /** !number */ literalTreeIndex = s.contextMap[s.contextMapSlice + (LOOKUP[s.contextLookupOffset1 + prevByte1] | LOOKUP[s.contextLookupOffset2 + prevByte2])] & 0xFF; s.literalBlockLength--; prevByte2 = prevByte1; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } prevByte1 = readSymbol(s.hGroup0, s.hGroup0[literalTreeIndex], s); ringBuffer[s.pos] = prevByte1; s.j++; if (s.pos++ == ringBufferMask) { s.nextRunningState = 6; s.bytesToWrite = s.ringBufferSize; s.bytesWritten = 0; s.runningState = 12; break; } } } if (s.runningState != 6) { continue; } s.metaBlockLength -= s.insertLength; if (s.metaBlockLength <= 0) { s.runningState = 3; continue; } if (s.distanceCode < 0) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.distanceBlockLength == 0) { decodeDistanceBlockSwitch(s); } s.distanceBlockLength--; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } s.distanceCode = readSymbol(s.hGroup2, s.hGroup2[s.distContextMap[s.distContextMapSlice + (s.copyLength > 4 ? 3 : s.copyLength - 2)] & 0xFF], s); if (s.distanceCode >= s.numDirectDistanceCodes) { s.distanceCode -= s.numDirectDistanceCodes; var /** !number */ postfix = s.distanceCode & s.distancePostfixMask; s.distanceCode >>>= s.distancePostfixBits; var /** !number */ n = (s.distanceCode >>> 1) + 1; var /** !number */ offset = ((2 + (s.distanceCode & 1)) << n) - 4; if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } var /** !number */ distanceExtra = ((n <= 16) ? readFewBits(s, n) : readManyBits(s, n)); s.distanceCode = s.numDirectDistanceCodes + postfix + ((offset + distanceExtra) << s.distancePostfixBits); } } s.distance = translateShortCodes(s.distanceCode, s.rings, s.distRbIdx); if (s.distance < 0) { throw "Negative distance"; } if (s.maxDistance != s.maxBackwardDistance && s.pos < s.maxBackwardDistance) { s.maxDistance = s.pos; } else { s.maxDistance = s.maxBackwardDistance; } s.copyDst = s.pos; if (s.distance > s.maxDistance) { s.runningState = 9; continue; } if (s.distanceCode > 0) { s.rings[s.distRbIdx & 3] = s.distance; s.distRbIdx++; } if (s.copyLength > s.metaBlockLength) { throw "Invalid backward reference"; } s.j = 0; s.runningState = 7; case 7: var /** !number */ src = (s.pos - s.distance) & ringBufferMask; var /** !number */ dst = s.pos; var /** !number */ copyLength = s.copyLength - s.j; var /** !number */ srcEnd = src + copyLength; var /** !number */ dstEnd = dst + copyLength; if ((srcEnd < ringBufferMask) && (dstEnd < ringBufferMask)) { if (copyLength < 12 || (srcEnd > dst && dstEnd > src)) { for (var /** !number */ k = 0; k < copyLength; k += 4) { ringBuffer[dst++] = ringBuffer[src++]; ringBuffer[dst++] = ringBuffer[src++]; ringBuffer[dst++] = ringBuffer[src++]; ringBuffer[dst++] = ringBuffer[src++]; } } else { ringBuffer.copyWithin(dst, src, srcEnd); } s.j += copyLength; s.metaBlockLength -= copyLength; s.pos += copyLength; } else { for (; s.j < s.copyLength; ) { ringBuffer[s.pos] = ringBuffer[(s.pos - s.distance) & ringBufferMask]; s.metaBlockLength--; s.j++; if (s.pos++ == ringBufferMask) { s.nextRunningState = 7; s.bytesToWrite = s.ringBufferSize; s.bytesWritten = 0; s.runningState = 12; break; } } } if (s.runningState == 7) { s.runningState = 3; } continue; case 9: if (s.copyLength >= 4 && s.copyLength <= 24) { var /** !number */ offset = DICTIONARY_OFFSETS_BY_LENGTH[s.copyLength]; var /** !number */ wordId = s.distance - s.maxDistance - 1; var /** !number */ shift = DICTIONARY_SIZE_BITS_BY_LENGTH[s.copyLength]; var /** !number */ mask = (1 << shift) - 1; var /** !number */ wordIdx = wordId & mask; var /** !number */ transformIdx = wordId >>> shift; offset += wordIdx * s.copyLength; if (transformIdx < 121) { var /** !number */ len = transformDictionaryWord(ringBuffer, s.copyDst, DICTIONARY_DATA, offset, s.copyLength, transformIdx); s.copyDst += len; s.pos += len; s.metaBlockLength -= len; if (s.copyDst >= s.ringBufferSize) { s.nextRunningState = 8; s.bytesToWrite = s.ringBufferSize; s.bytesWritten = 0; s.runningState = 12; continue; } } else { throw "Invalid backward reference"; } } else { throw "Invalid backward reference"; } s.runningState = 3; continue; case 8: ringBuffer.copyWithin(0, s.ringBufferSize, s.copyDst); s.runningState = 3; continue; case 4: while (s.metaBlockLength > 0) { if (s.halfOffset > 2030) { doReadMoreInput(s); } if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } readFewBits(s, 8); s.metaBlockLength--; } s.runningState = 1; continue; case 5: copyUncompressedData(s); continue; case 12: if (writeRingBuffer(s) == 0) { return; } if (s.pos >= s.maxBackwardDistance) { s.maxDistance = s.maxBackwardDistance; } s.pos &= ringBufferMask; s.runningState = s.nextRunningState; continue; default: throw "Unexpected state " + s.runningState; } } if (s.runningState == 10) { if (s.metaBlockLength < 0) { throw "Invalid metablock length"; } jumpToByteBoundary(s); checkHealth(s, 1); } } var TRANSFORMS = new Int32Array(363); var PREFIX_SUFFIX = new Int8Array(217); var PREFIX_SUFFIX_HEADS = new Int32Array(51); /** * @param {!Int8Array} prefixSuffix * @param {!Int32Array} prefixSuffixHeads * @param {!Int32Array} transforms * @param {!string} prefixSuffixSrc * @param {!string} transformsSrc * @return {!void} */ function unpackTransforms(prefixSuffix, prefixSuffixHeads, transforms, prefixSuffixSrc, transformsSrc) { var /** !number */ n = prefixSuffixSrc.length; var /** !number */ index = 1; for (var /** !number */ i = 0; i < n; ++i) { var /** !number */ c = prefixSuffixSrc.charCodeAt(i); prefixSuffix[i] = c; if (c == 35) { prefixSuffixHeads[index++] = i + 1; prefixSuffix[i] = 0; } } for (var /** !number */ i = 0; i < 363; ++i) { transforms[i] = transformsSrc.charCodeAt(i) - 32; } } { unpackTransforms(PREFIX_SUFFIX, PREFIX_SUFFIX_HEADS, TRANSFORMS, "# #s #, #e #.# the #.com/#\u00C2\u00A0# of # and # in # to #\"#\">#\n#]# for # a # that #. # with #'# from # by #. The # on # as # is #ing #\n\t#:#ed #(# at #ly #=\"# of the #. This #,# not #er #al #='#ful #ive #less #est #ize #ous #", " !! ! , *! &! \" ! ) * * - ! # ! #!*! + ,$ ! - % . / # 0 1 . \" 2 3!* 4% ! # / 5 6 7 8 0 1 & $ 9 + : ; < ' != > ?! 4 @ 4 2 & A *# ( B C& ) % ) !*# *-% A +! *. D! %' & E *6 F G% ! *A *% H! D I!+! J!+ K +- *4! A L!*4 M N +6 O!*% +.! K *G P +%( ! G *D +D Q +# *K!*G!+D!+# +G +A +4!+% +K!+4!*D!+K!*K"); } /** * @param {!Int8Array} dst * @param {!number} dstOffset * @param {!Int8Array} data * @param {!number} wordOffset * @param {!number} len * @param {!number} transformIndex * @return {!number} */ function transformDictionaryWord(dst, dstOffset, data, wordOffset, len, transformIndex) { var /** !number */ offset = dstOffset; var /** !number */ transformOffset = 3 * transformIndex; var /** !number */ transformPrefix = PREFIX_SUFFIX_HEADS[TRANSFORMS[transformOffset]]; var /** !number */ transformType = TRANSFORMS[transformOffset + 1]; var /** !number */ transformSuffix = PREFIX_SUFFIX_HEADS[TRANSFORMS[transformOffset + 2]]; while (PREFIX_SUFFIX[transformPrefix] != 0) { dst[offset++] = PREFIX_SUFFIX[transformPrefix++]; } var /** !number */ omitFirst = transformType >= 12 ? (transformType - 11) : 0; if (omitFirst > len) { omitFirst = len; } wordOffset += omitFirst; len -= omitFirst; len -= transformType <= 9 ? transformType : 0; var /** !number */ i = len; while (i > 0) { dst[offset++] = data[wordOffset++]; i--; } if (transformType == 11 || transformType == 10) { var /** !number */ uppercaseOffset = offset - len; if (transformType == 10) { len = 1; } while (len > 0) { var /** !number */ tmp = dst[uppercaseOffset] & 0xFF; if (tmp < 0xc0) { if (tmp >= 97 && tmp <= 122) { dst[uppercaseOffset] ^= 32; } uppercaseOffset += 1; len -= 1; } else if (tmp < 0xe0) { dst[uppercaseOffset + 1] ^= 32; uppercaseOffset += 2; len -= 2; } else { dst[uppercaseOffset + 2] ^= 5; uppercaseOffset += 3; len -= 3; } } } while (PREFIX_SUFFIX[transformSuffix] != 0) { dst[offset++] = PREFIX_SUFFIX[transformSuffix++]; } return offset - dstOffset; } /** * @param {!number} key * @param {!number} len * @return {!number} */ function getNextKey(key, len) { var /** !number */ step = 1 << (len - 1); while ((key & step) != 0) { step >>= 1; } return (key & (step - 1)) + step; } /** * @param {!Int32Array} table * @param {!number} offset * @param {!number} step * @param {!number} end * @param {!number} item * @return {!void} */ function replicateValue(table, offset, step, end, item) { do { end -= step; table[offset + end] = item; } while (end > 0); } /** * @param {!Int32Array} count * @param {!number} len * @param {!number} rootBits * @return {!number} */ function nextTableBitSize(count, len, rootBits) { var /** !number */ left = 1 << (len - rootBits); while (len < 15) { left -= count[len]; if (left <= 0) { break; } len++; left <<= 1; } return len - rootBits; } /** * @param {!Int32Array} rootTable * @param {!number} tableOffset * @param {!number} rootBits * @param {!Int32Array} codeLengths * @param {!number} codeLengthsSize * @return {!void} */ function buildHuffmanTable(rootTable, tableOffset, rootBits, codeLengths, codeLengthsSize) { var /** !number */ key; var /** !Int32Array */ sorted = new Int32Array(codeLengthsSize); var /** !Int32Array */ count = new Int32Array(16); var /** !Int32Array */ offset = new Int32Array(16); var /** !number */ symbol; for (symbol = 0; symbol < codeLengthsSize; symbol++) { count[codeLengths[symbol]]++; } offset[1] = 0; for (var /** !number */ len = 1; len < 15; len++) { offset[len + 1] = offset[len] + count[len]; } for (symbol = 0; symbol < codeLengthsSize; symbol++) { if (codeLengths[symbol] != 0) { sorted[offset[codeLengths[symbol]]++] = symbol; } } var /** !number */ tableBits = rootBits; var /** !number */ tableSize = 1 << tableBits; var /** !number */ totalSize = tableSize; if (offset[15] == 1) { for (key = 0; key < totalSize; key++) { rootTable[tableOffset + key] = sorted[0]; } return; } key = 0; symbol = 0; for (var /** !number */ len = 1, step = 2; len <= rootBits; len++, step <<= 1) { for (; count[len] > 0; count[len]--) { replicateValue(rootTable, tableOffset + key, step, tableSize, len << 16 | sorted[symbol++]); key = getNextKey(key, len); } } var /** !number */ mask = totalSize - 1; var /** !number */ low = -1; var /** !number */ currentOffset = tableOffset; for (var /** !number */ len = rootBits + 1, step = 2; len <= 15; len++, step <<= 1) { for (; count[len] > 0; count[len]--) { if ((key & mask) != low) { currentOffset += tableSize; tableBits = nextTableBitSize(count, len, rootBits); tableSize = 1 << tableBits; totalSize += tableSize; low = key & mask; rootTable[tableOffset + low] = (tableBits + rootBits) << 16 | (currentOffset - tableOffset - low); } replicateValue(rootTable, currentOffset + (key >> rootBits), step, tableSize, (len - rootBits) << 16 | sorted[symbol++]); key = getNextKey(key, len); } } } /** * @param {!State} s * @return {!void} */ function doReadMoreInput(s) { if (s.endOfStreamReached != 0) { if (halfAvailable(s) >= -2) { return; } throw "No more input"; } var /** !number */ readOffset = s.halfOffset << 1; var /** !number */ bytesInBuffer = 4096 - readOffset; s.byteBuffer.copyWithin(0, readOffset, 4096); s.halfOffset = 0; while (bytesInBuffer < 4096) { var /** !number */ spaceLeft = 4096 - bytesInBuffer; var /** !number */ len = readInput(s.input, s.byteBuffer, bytesInBuffer, spaceLeft); if (len <= 0) { s.endOfStreamReached = 1; s.tailBytes = bytesInBuffer; bytesInBuffer += 1; break; } bytesInBuffer += len; } bytesToNibbles(s, bytesInBuffer); } /** * @param {!State} s * @param {!number} endOfStream * @return {!void} */ function checkHealth(s, endOfStream) { if (s.endOfStreamReached == 0) { return; } var /** !number */ byteOffset = (s.halfOffset << 1) + ((s.bitOffset + 7) >> 3) - 4; if (byteOffset > s.tailBytes) { throw "Read after end"; } if ((endOfStream != 0) && (byteOffset != s.tailBytes)) { throw "Unused bytes after end"; } } /** * @param {!State} s * @param {!number} n * @return {!number} */ function readFewBits(s, n) { var /** !number */ val = (s.accumulator32 >>> s.bitOffset) & ((1 << n) - 1); s.bitOffset += n; return val; } /** * @param {!State} s * @param {!number} n * @return {!number} */ function readManyBits(s, n) { var /** !number */ low = readFewBits(s, 16); s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; return low | (readFewBits(s, n - 16) << 16); } /** * @param {!State} s * @return {!void} */ function initBitReader(s) { s.byteBuffer = new Int8Array(4160); s.accumulator32 = 0; s.shortBuffer = new Int16Array(2080); s.bitOffset = 32; s.halfOffset = 2048; s.endOfStreamReached = 0; prepare(s); } /** * @param {!State} s * @return {!void} */ function prepare(s) { if (s.halfOffset > 2030) { doReadMoreInput(s); } checkHealth(s, 0); s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } /** * @param {!State} s * @return {!void} */ function reload(s) { if (s.bitOffset == 32) { prepare(s); } } /** * @param {!State} s * @return {!void} */ function jumpToByteBoundary(s) { var /** !number */ padding = (32 - s.bitOffset) & 7; if (padding != 0) { var /** !number */ paddingBits = readFewBits(s, padding); if (paddingBits != 0) { throw "Corrupted padding bits"; } } } /** * @param {!State} s * @return {!number} */ function halfAvailable(s) { var /** !number */ limit = 2048; if (s.endOfStreamReached != 0) { limit = (s.tailBytes + 1) >> 1; } return limit - s.halfOffset; } /** * @param {!State} s * @param {!Int8Array} data * @param {!number} offset * @param {!number} length * @return {!void} */ function copyBytes(s, data, offset, length) { if ((s.bitOffset & 7) != 0) { throw "Unaligned copyBytes"; } while ((s.bitOffset != 32) && (length != 0)) { data[offset++] = (s.accumulator32 >>> s.bitOffset); s.bitOffset += 8; length--; } if (length == 0) { return; } var /** !number */ copyNibbles = min(halfAvailable(s), length >> 1); if (copyNibbles > 0) { var /** !number */ readOffset = s.halfOffset << 1; var /** !number */ delta = copyNibbles << 1; data.set(s.byteBuffer.subarray(readOffset, readOffset + delta), offset); offset += delta; length -= delta; s.halfOffset += copyNibbles; } if (length == 0) { return; } if (halfAvailable(s) > 0) { if (s.bitOffset >= 16) { s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); s.bitOffset -= 16; } while (length != 0) { data[offset++] = (s.accumulator32 >>> s.bitOffset); s.bitOffset += 8; length--; } checkHealth(s, 0); return; } while (length > 0) { var /** !number */ len = readInput(s.input, data, offset, length); if (len == -1) { throw "Unexpected end of input"; } offset += len; length -= len; } } /** * @param {!State} s * @param {!number} byteLen * @return {!void} */ function bytesToNibbles(s, byteLen) { var /** !Int8Array */ byteBuffer = s.byteBuffer; var /** !number */ halfLen = byteLen >> 1; var /** !Int16Array */ shortBuffer = s.shortBuffer; for (var /** !number */ i = 0; i < halfLen; ++i) { shortBuffer[i] = ((byteBuffer[i * 2] & 0xFF) | ((byteBuffer[(i * 2) + 1] & 0xFF) << 8)); } } var LOOKUP = new Int32Array(2048); /** * @param {!Int32Array} lookup * @param {!string} map * @param {!string} rle * @return {!void} */ function unpackLookupTable(lookup, map, rle) { for (var /** !number */ i = 0; i < 256; ++i) { lookup[i] = i & 0x3F; lookup[512 + i] = i >> 2; lookup[1792 + i] = 2 + (i >> 6); } for (var /** !number */ i = 0; i < 128; ++i) { lookup[1024 + i] = 4 * (map.charCodeAt(i) - 32); } for (var /** !number */ i = 0; i < 64; ++i) { lookup[1152 + i] = i & 1; lookup[1216 + i] = 2 + (i & 1); } var /** !number */ offset = 1280; for (var /** !number */ k = 0; k < 19; ++k) { var /** !number */ value = k & 3; var /** !number */ rep = rle.charCodeAt(k) - 32; for (var /** !number */ i = 0; i < rep; ++i) { lookup[offset++] = value; } } for (var /** !number */ i = 0; i < 16; ++i) { lookup[1792 + i] = 1; lookup[2032 + i] = 6; } lookup[1792] = 0; lookup[2047] = 7; for (var /** !number */ i = 0; i < 256; ++i) { lookup[1536 + i] = lookup[1792 + i] << 3; } } { unpackLookupTable(LOOKUP, " !! ! \"#$##%#$&'##(#)#++++++++++((&*'##,---,---,-----,-----,-----'###.///.///./////./////./////'# ", "A/* ': & : $ \u0081 @"); } /** * @constructor * @struct */ function State() { /** @type {!Int8Array} */ this.ringBuffer = new Int8Array(0); /** @type {!Int8Array} */ this.contextModes = new Int8Array(0); /** @type {!Int8Array} */ this.contextMap = new Int8Array(0); /** @type {!Int8Array} */ this.distContextMap = new Int8Array(0); /** @type {!Int8Array} */ this.output = new Int8Array(0); /** @type {!Int8Array} */ this.byteBuffer = new Int8Array(0); /** @type {!Int16Array} */ this.shortBuffer = new Int16Array(0); /** @type {!Int32Array} */ this.intBuffer = new Int32Array(0); /** @type {!Int32Array} */ this.rings = new Int32Array(0); /** @type {!Int32Array} */ this.blockTrees = new Int32Array(0); /** @type {!Int32Array} */ this.hGroup0 = new Int32Array(0); /** @type {!Int32Array} */ this.hGroup1 = new Int32Array(0); /** @type {!Int32Array} */ this.hGroup2 = new Int32Array(0); /** @type {!number} */ this.runningState = 0; /** @type {!number} */ this.nextRunningState = 0; /** @type {!number} */ this.accumulator32 = 0; /** @type {!number} */ this.bitOffset = 0; /** @type {!number} */ this.halfOffset = 0; /** @type {!number} */ this.tailBytes = 0; /** @type {!number} */ this.endOfStreamReached = 0; /** @type {!number} */ this.metaBlockLength = 0; /** @type {!number} */ this.inputEnd = 0; /** @type {!number} */ this.isUncompressed = 0; /** @type {!number} */ this.isMetadata = 0; /** @type {!number} */ this.literalBlockLength = 0; /** @type {!number} */ this.numLiteralBlockTypes = 0; /** @type {!number} */ this.commandBlockLength = 0; /** @type {!number} */ this.numCommandBlockTypes = 0; /** @type {!number} */ this.distanceBlockLength = 0; /** @type {!number} */ this.numDistanceBlockTypes = 0; /** @type {!number} */ this.pos = 0; /** @type {!number} */ this.maxDistance = 0; /** @type {!number} */ this.distRbIdx = 0; /** @type {!number} */ this.trivialLiteralContext = 0; /** @type {!number} */ this.literalTreeIndex = 0; /** @type {!number} */ this.literalTree = 0; /** @type {!number} */ this.j = 0; /** @type {!number} */ this.insertLength = 0; /** @type {!number} */ this.contextMapSlice = 0; /** @type {!number} */ this.distContextMapSlice = 0; /** @type {!number} */ this.contextLookupOffset1 = 0; /** @type {!number} */ this.contextLookupOffset2 = 0; /** @type {!number} */ this.treeCommandOffset = 0; /** @type {!number} */ this.distanceCode = 0; /** @type {!number} */ this.numDirectDistanceCodes = 0; /** @type {!number} */ this.distancePostfixMask = 0; /** @type {!number} */ this.distancePostfixBits = 0; /** @type {!number} */ this.distance = 0; /** @type {!number} */ this.copyLength = 0; /** @type {!number} */ this.copyDst = 0; /** @type {!number} */ this.maxBackwardDistance = 0; /** @type {!number} */ this.maxRingBufferSize = 0; /** @type {!number} */ this.ringBufferSize = 0; /** @type {!number} */ this.expectedTotalSize = 0; /** @type {!number} */ this.outputOffset = 0; /** @type {!number} */ this.outputLength = 0; /** @type {!number} */ this.outputUsed = 0; /** @type {!number} */ this.bytesWritten = 0; /** @type {!number} */ this.bytesToWrite = 0; /** @type {!InputStream|null} */ this.input = null; this.ringBuffer = new Int8Array(0); this.rings = new Int32Array(10); this.rings[0] = 16; this.rings[1] = 15; this.rings[2] = 11; this.rings[3] = 4; } /** * @param {!Int8Array} dictionary * @param {!string} data0 * @param {!string} data1 * @param {!string} skipFlip * @return {!void} */ function unpackDictionaryData(dictionary, data0, data1, skipFlip) { var /** !number */ n0 = data0.length; var /** !number */ n1 = data1.length; if (n0 + n1 != dictionary.length) { throw "Corrupted brotli dictionary"; } var /** !number */ offset = 0; for (var /** !number */ i = 0; i < n0; ++i) { dictionary[offset] = data0.charCodeAt(i); offset++; } for (var /** !number */ i = 0; i < n1; ++i) { dictionary[offset] = data1.charCodeAt(i); offset++; } offset = 0; var /** !number */ n = skipFlip.length; for (var /** !number */ i = 0; i < n; i += 2) { var /** !number */ skip = skipFlip.charCodeAt(i) - 36; var /** !number */ flip = skipFlip.charCodeAt(i + 1) - 36; offset += skip; for (var /** !number */ j = 0; j < flip; ++j) { dictionary[offset] = (dictionary[offset] | 0x80); offset++; } } } { var /** !Int8Array */ dictionary = new Int8Array(122784); unpackDictionaryData(dictionary, "timedownlifeleftbackcodedatashowonlysitecityopenjustlikefreeworktextyearoverbodyloveformbookplaylivelinehelphomesidemorewordlongthemviewfindpagedaysfullheadtermeachareafromtruemarkableuponhighdatelandnewsevennextcasebothpostusedmadehandherewhatnameLinkblogsizebaseheldmakemainuser') +holdendswithNewsreadweresigntakehavegameseencallpathwellplusmenufilmpartjointhislistgoodneedwayswestjobsmindalsologorichuseslastteamarmyfoodkingwilleastwardbestfirePageknowaway.pngmovethanloadgiveselfnotemuchfeedmanyrockicononcelookhidediedHomerulehostajaxinfoclublawslesshalfsomesuchzone100%onescareTimeracebluefourweekfacehopegavehardlostwhenparkkeptpassshiproomHTMLplanTypedonesavekeepflaglinksoldfivetookratetownjumpthusdarkcardfilefearstaykillthatfallautoever.comtalkshopvotedeepmoderestturnbornbandfellroseurl(skinrolecomeactsagesmeetgold.jpgitemvaryfeltthensenddropViewcopy1.0\"stopelseliestourpack.gifpastcss?graymean>rideshotlatesaidroadvar feeljohnrickportfast'UA-deadpoorbilltypeU.S.woodmust2px;Inforankwidewantwalllead[0];paulwavesure$('#waitmassarmsgoesgainlangpaid!-- lockunitrootwalkfirmwifexml\"songtest20pxkindrowstoolfontmailsafestarmapscorerainflowbabyspansays4px;6px;artsfootrealwikiheatsteptriporg/lakeweaktoldFormcastfansbankveryrunsjulytask1px;goalgrewslowedgeid=\"sets5px;.js?40pxif (soonseatnonetubezerosentreedfactintogiftharm18pxcamehillboldzoomvoideasyringfillpeakinitcost3px;jacktagsbitsrolleditknewnearironfreddiskwentsoilputs/js/holyT22:ISBNT20:adamsees
P>Q\u0002P8P7P=P>P4P>Q\u0002P>P6P5P>P=P8Q\u0005P\u001DP0P5P5P1Q\u000BPP2Q\u000BP2P>P\u001DP>P>P1P\u001FP>P;P8P=P8P P$P\u001DP5P\u001CQ\u000BQ\u0002Q\u000BP\u001EP=P8Pthing.org/multiheardPowerstandtokensolid(thisbringshipsstafftriedcallsfullyfactsagentThis //-->adminegyptEvent15px;Emailtrue\"crossspentblogsbox\">notedleavechinasizesguestrobotheavytrue,sevengrandcrimesignsawaredancephase>\n \n \r\nname=diegopage swiss-->\n\n#fff;\">Log.com\"treatsheet) && 14px;sleepntentfiledja:c\u0003id=\"cName\"worseshots-box-delta\n<bears:48Z spendbakershops= \"\";php\">ction13px;brianhellosize=o=%2F joinmaybe, fjsimg\" \")[0]MTopBType\"newlyDanskczechtrailknowsfaq\">zh-cn10);\n-1\");type=bluestrulydavis.js';>\r\n\r\nform jesus100% menu.\r\n\t\r\nwalesrisksumentddingb-likteachgif\" vegasdanskeestishqipsuomisobredesdeentretodospuedeaC1osestC!tienehastaotrospartedondenuevohacerformamismomejormundoaquC-dC-assC3loayudafechatodastantomenosdatosotrassitiomuchoahoralugarmayorestoshorastenerantesfotosestaspaC-snuevasaludforosmedioquienmesespoderchileserC!vecesdecirjosC)estarventagrupohechoellostengoamigocosasnivelgentemismaairesjuliotemashaciafavorjuniolibrepuntobuenoautorabrilbuenatextomarzosaberlistaluegocC3moenerojuegoperC:haberestoynuncamujervalorfueralibrogustaigualvotoscasosguC-apuedosomosavisousteddebennochebuscafaltaeurosseriedichocursoclavecasasleC3nplazolargoobrasvistaapoyojuntotratavistocrearcampohemoscincocargopisosordenhacenC!readiscopedrocercapuedapapelmenorC:tilclarojorgecalleponertardenadiemarcasigueellassiglocochemotosmadreclaserestoniC1oquedapasarbancohijosviajepabloC)stevienereinodejarfondocanalnorteletracausatomarmanoslunesautosvillavendopesartipostengamarcollevapadreunidovamoszonasambosbandamariaabusomuchasubirriojavivirgradochicaallC-jovendichaestantalessalirsuelopesosfinesllamabuscoC)stalleganegroplazahumorpagarjuntadobleislasbolsabaC1ohablaluchaC\u0001readicenjugarnotasvalleallC!cargadolorabajoestC)gustomentemariofirmacostofichaplatahogarartesleyesaquelmuseobasespocosmitadcielochicomiedoganarsantoetapadebesplayaredessietecortecoreadudasdeseoviejodeseaaguas"domaincommonstatuseventsmastersystemactionbannerremovescrollupdateglobalmediumfilternumberchangeresultpublicscreenchoosenormaltravelissuessourcetargetspringmodulemobileswitchphotosborderregionitselfsocialactivecolumnrecordfollowtitle>eitherlengthfamilyfriendlayoutauthorcreatereviewsummerserverplayedplayerexpandpolicyformatdoublepointsseriespersonlivingdesignmonthsforcesuniqueweightpeopleenergynaturesearchfigurehavingcustomoffsetletterwindowsubmitrendergroupsuploadhealthmethodvideosschoolfutureshadowdebatevaluesObjectothersrightsleaguechromesimplenoticesharedendingseasonreportonlinesquarebuttonimagesenablemovinglatestwinterFranceperiodstrongrepeatLondondetailformeddemandsecurepassedtoggleplacesdevicestaticcitiesstreamyellowattackstreetflighthiddeninfo\">openedusefulvalleycausesleadersecretseconddamagesportsexceptratingsignedthingseffectfieldsstatesofficevisualeditorvolumeReportmuseummoviesparentaccessmostlymother\" id=\"marketgroundchancesurveybeforesymbolmomentspeechmotioninsidematterCenterobjectexistsmiddleEuropegrowthlegacymannerenoughcareeransweroriginportalclientselectrandomclosedtopicscomingfatheroptionsimplyraisedescapechosenchurchdefinereasoncorneroutputmemoryiframepolicemodelsNumberduringoffersstyleskilledlistedcalledsilvermargindeletebetterbrowselimitsGlobalsinglewidgetcenterbudgetnowrapcreditclaimsenginesafetychoicespirit-stylespreadmakingneededrussiapleaseextentScriptbrokenallowschargedividefactormember-basedtheoryconfigaroundworkedhelpedChurchimpactshouldalwayslogo\" bottomlist\">){var prefixorangeHeader.push(couplegardenbridgelaunchReviewtakingvisionlittledatingButtonbeautythemesforgotSearchanchoralmostloadedChangereturnstringreloadMobileincomesupplySourceordersviewed courseAbout island: The dialoghousesBEGIN MexicostartscentreheightaddingIslandassetsEmpireSchooleffortdirectnearlymanualSelect.\n\nOnejoinedmenu\">PhilipawardshandleimportOfficeregardskillsnationSportsdegreeweekly (e.g.behinddoctorloggedunitedbeyond-scaleacceptservedmarineFootercamera
P=P0P3P4P5PP3P>P4P2P>Q\u0002Q\u0002P0P
P2P0Q\u0001P2P0P
Q\u0002Q\u0003Q\u0002P=P0P4P4P=Q\u000FP\u0012P>Q\u0002Q\u0002Q\u0000P8P=P5P9P\u0012P0Q\u0001P=P8P Q\u0002Q\u0000Q\u0003P1P\u001EP=P8PP P9P4P2P5P>P=P>Q\u0001Q\u0003P4`$\u0015`%\u0007`$9`%\u0008`$\u0015`%\u0000`$8`%\u0007`$\u0015`$>`$\u0015`%\u000B`$\u0014`$0`$*`$0`$(`%\u0007`$\u000F`$\u0015`$\u0015`$?`$-`%\u0000`$\u0007`$8`$\u0015`$0`$$`%\u000B`$9`%\u000B`$\u0006`$*`$9`%\u0000`$/`$9`$/`$>`$$`$\u0015`$%`$>jagran`$\u0006`$\u001C`$\u001C`%\u000B`$\u0005`$,`$&`%\u000B`$\u0017`$\u0008`$\u001C`$>`$\u0017`$\u000F`$9`$.`$\u0007`$(`$5`$9`$/`%\u0007`$%`%\u0007`$%`%\u0000`$\u0018`$0`$\u001C`$,`$&`%\u0000`$\u0015`$\u0008`$\u001C`%\u0000`$5`%\u0007`$(`$\u0008`$(`$\u000F`$9`$0`$\t`$8`$.`%\u0007`$\u0015`$.`$5`%\u000B`$2`%\u0007`$8`$,`$.`$\u0008`$&`%\u0007`$\u0013`$0`$\u0006`$.`$,`$8`$-`$0`$,`$(`$\u001A`$2`$.`$(`$\u0006`$\u0017`$8`%\u0000`$2`%\u0000X9Y\u0004Y\tX%Y\u0004Y\tY\u0007X0X'X\"X.X1X9X/X/X'Y\u0004Y\tY\u0007X0Y\u0007X5Y\u0008X1X:Y\nX1Y\u0003X'Y\u0006Y\u0008Y\u0004X'X(Y\nY\u0006X9X1X6X0Y\u0004Y\u0003Y\u0007Y\u0006X'Y\nY\u0008Y\u0005Y\u0002X'Y\u0004X9Y\u0004Y\nX'Y\u0006X'Y\u0004Y\u0003Y\u0006X-X*Y\tY\u0002X(Y\u0004Y\u0008X-X)X'X.X1Y\u0001Y\u0002X7X9X(X/X1Y\u0003Y\u0006X%X0X'Y\u0003Y\u0005X'X'X-X/X%Y\u0004X'Y\u0001Y\nY\u0007X(X9X6Y\u0003Y\nY\u0001X(X-X+Y\u0008Y\u0005Y\u0006Y\u0008Y\u0007Y\u0008X#Y\u0006X'X,X/X'Y\u0004Y\u0007X'X3Y\u0004Y\u0005X9Y\u0006X/Y\u0004Y\nX3X9X(X1X5Y\u0004Y\tY\u0005Y\u0006X0X(Y\u0007X'X#Y\u0006Y\u0007Y\u0005X+Y\u0004Y\u0003Y\u0006X*X'Y\u0004X'X-Y\nX+Y\u0005X5X1X4X1X-X-Y\u0008Y\u0004Y\u0008Y\u0001Y\nX'X0X'Y\u0004Y\u0003Y\u0004Y\u0005X1X)X'Y\u0006X*X'Y\u0004Y\u0001X#X(Y\u0008X.X'X5X#Y\u0006X*X'Y\u0006Y\u0007X'Y\u0004Y\nX9X6Y\u0008Y\u0008Y\u0002X/X'X(Y\u0006X.Y\nX1X(Y\u0006X*Y\u0004Y\u0003Y\u0005X4X'X!Y\u0008Y\u0007Y\nX'X(Y\u0008Y\u0002X5X5Y\u0008Y\u0005X'X1Y\u0002Y\u0005X#X-X/Y\u0006X-Y\u0006X9X/Y\u0005X1X#Y\nX'X-X)Y\u0003X*X(X/Y\u0008Y\u0006Y\nX,X(Y\u0005Y\u0006Y\u0007X*X-X*X,Y\u0007X)X3Y\u0006X)Y\nX*Y\u0005Y\u0003X1X)X:X2X)Y\u0006Y\u0001X3X(Y\nX*Y\u0004Y\u0004Y\u0007Y\u0004Y\u0006X'X*Y\u0004Y\u0003Y\u0002Y\u0004X(Y\u0004Y\u0005X'X9Y\u0006Y\u0007X#Y\u0008Y\u0004X4Y\nX!Y\u0006Y\u0008X1X#Y\u0005X'Y\u0001Y\nY\u0003X(Y\u0003Y\u0004X0X'X*X1X*X(X(X#Y\u0006Y\u0007Y\u0005X3X'Y\u0006Y\u0003X(Y\nX9Y\u0001Y\u0002X/X-X3Y\u0006Y\u0004Y\u0007Y\u0005X4X9X1X#Y\u0007Y\u0004X4Y\u0007X1Y\u0002X7X1X7Y\u0004X(profileservicedefaulthimselfdetailscontentsupportstartedmessagesuccessfashion
countryaccountcreatedstoriesresultsrunningprocesswritingobjectsvisiblewelcomearticleunknownnetworkcompanydynamicbrowserprivacyproblemServicerespectdisplayrequestreservewebsitehistoryfriendsoptionsworkingversionmillionchannelwindow.addressvisitedweathercorrectproductedirectforwardyou canremovedsubjectcontrolarchivecurrentreadinglibrarylimitedmanagerfurthersummarymachineminutesprivatecontextprogramsocietynumberswrittenenabledtriggersourcesloadingelementpartnerfinallyperfectmeaningsystemskeepingculture",journalprojectsurfaces"expiresreviewsbalanceEnglishContentthroughPlease opinioncontactaverageprimaryvillageSpanishgallerydeclinemeetingmissionpopularqualitymeasuregeneralspeciessessionsectionwriterscounterinitialreportsfiguresmembersholdingdisputeearlierexpressdigitalpictureAnothermarriedtrafficleadingchangedcentralvictoryimages/reasonsstudiesfeaturelistingmust beschoolsVersionusuallyepisodeplayinggrowingobviousoverlaypresentactions\r\nwrapperalreadycertainrealitystorageanotherdesktopofferedpatternunusualDigitalcapitalWebsitefailureconnectreducedAndroiddecadesregular & animalsreleaseAutomatgettingmethodsnothingPopularcaptionletterscapturesciencelicensechangesEngland=1&History = new CentralupdatedSpecialNetworkrequirecommentwarningCollegetoolbarremainsbecauseelectedDeutschfinanceworkersquicklybetweenexactlysettingdiseaseSocietyweaponsexhibit<!--Controlclassescoveredoutlineattacksdevices(windowpurposetitle=\"Mobile killingshowingItaliandroppedheavilyeffects-1']);\nconfirmCurrentadvancesharingopeningdrawingbillionorderedGermanyrelatedincludewhetherdefinedSciencecatalogArticlebuttonslargestuniformjourneysidebarChicagoholidayGeneralpassage,"animatefeelingarrivedpassingnaturalroughly.\n\nThe but notdensityBritainChineselack oftributeIreland\" data-factorsreceivethat isLibraryhusbandin factaffairsCharlesradicalbroughtfindinglanding:lang=\"return leadersplannedpremiumpackageAmericaEdition]"Messageneed tovalue=\"complexlookingstationbelievesmaller-mobilerecordswant tokind ofFirefoxyou aresimilarstudiedmaximumheadingrapidlyclimatekingdomemergedamountsfoundedpioneerformuladynastyhow to SupportrevenueeconomyResultsbrothersoldierlargelycalling."AccountEdward segmentRobert effortsPacificlearnedup withheight:we haveAngelesnations_searchappliedacquiremassivegranted: falsetreatedbiggestbenefitdrivingStudiesminimumperhapsmorningsellingis usedreversevariant role=\"missingachievepromotestudentsomeoneextremerestorebottom:evolvedall thesitemapenglishway to AugustsymbolsCompanymattersmusicalagainstserving})();\r\npaymenttroubleconceptcompareparentsplayersregionsmonitor ''The winningexploreadaptedGalleryproduceabilityenhancecareers). The collectSearch ancientexistedfooter handlerprintedconsoleEasternexportswindowsChannelillegalneutralsuggest_headersigning.html\">settledwesterncausing-webkitclaimedJusticechaptervictimsThomas mozillapromisepartieseditionoutside:false,hundredOlympic_buttonauthorsreachedchronicdemandssecondsprotectadoptedprepareneithergreatlygreateroverallimprovecommandspecialsearch.worshipfundingthoughthighestinsteadutilityquarterCulturetestingclearlyexposedBrowserliberal} catchProjectexamplehide();FloridaanswersallowedEmperordefenseseriousfreedomSeveral-buttonFurtherout of != nulltrainedDenmarkvoid(0)/all.jspreventRequestStephen\n\nWhen observe
P6P5Q\u0002P5P4Q\u0000Q\u0003P3P8Q\u0005Q\u0001P;Q\u0003Q\u0007P0P5Q\u0001P5P9Q\u0007P0Q\u0001P2Q\u0001P5P3P4P0P P>Q\u0001Q\u0001P8Q\u000FP\u001CP>Q\u0001P:P2P5P4Q\u0000Q\u0003P3P8P5P3P>Q\u0000P>P4P0P2P>P?Q\u0000P>Q\u0001P4P0P=P=Q\u000BQ\u0005P4P>P;P6P=Q\u000BP8P P P2P>P3P>P?P>P Q\tP8Q\u0001P0P9Q\u0002P>P2P?P>Q\u0007P5P Q\tQ\u000CP4P>P;P6P=P>Q\u0001Q\u0001Q\u000BP;P:P8P1Q\u000BQ\u0001Q\u0002Q\u0000P>P4P0P=P=Q\u000BP5P P3P8P5P?Q\u0000P>P5P:Q\u0002P!P5P9Q\u0007P0Q\u0001P P4P5P;P8Q\u0002P0P:P>P3P>P>P=P;P0P9P=P3P>Q\u0000P>P4P5P2P5Q\u0000Q\u0001P8Q\u000FQ\u0001Q\u0002Q\u0000P0P=P5Q\u0004P8P;Q\u000CPQ\u0002Q\u0003P0P?Q\u0000P5P;Q\u000FP2P>P>P1Q\tP5P>P4P=P>P3P>Q\u0001P2P>P5P3P>Q\u0001Q\u0002P0Q\u0002Q\u000CP8P4Q\u0000Q\u0003P3P>P9Q\u0004P>Q\u0000Q\u0003P
P
P2P=Q\u000FQ\u0000P0P7P=Q\u000BQ\u0005P8Q\u0001P:P0Q\u0002Q\u000CP=P5P4P5P;Q\u000EQ\u000FP=P2P0Q\u0000Q\u000FP