bailinghub 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +1 -0
- package/.gitignore +1 -0
- package/.npmignore +1 -0
- package/Dockerfile +1 -0
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/docker-compose.images.yml +2 -2
- package/docs/CHANGELOG.en.md +23 -1
- package/docs/CHANGELOG.md +23 -1
- package/docs/CORE_RELIABILITY.en.md +22 -2
- package/docs/CORE_RELIABILITY.md +22 -2
- package/docs/DOCX_DEPENDENCY.en.md +26 -0
- package/docs/DOCX_DEPENDENCY.md +26 -0
- package/docs/IMPLEMENTATION_STATUS.en.md +23 -15
- package/docs/IMPLEMENTATION_STATUS.md +23 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
- package/docs/NOTIFICATION_DURABILITY.md +47 -0
- package/docs/OPERATIONS.en.md +17 -0
- package/docs/OPERATIONS.md +16 -0
- package/docs/README.en.md +7 -1
- package/docs/README.md +7 -1
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.9.3.en.md +51 -0
- package/docs/RELEASE_NOTES_v0.9.3.md +51 -0
- package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
- package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
- package/docs/TOOLS_DESIGN.md +1 -0
- package/docs/UPGRADE_v0.9.3.en.md +63 -0
- package/docs/UPGRADE_v0.9.3.md +63 -0
- package/docs/UPGRADE_v0.9.4.en.md +57 -0
- package/docs/UPGRADE_v0.9.4.md +57 -0
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +533 -0
- package/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/node_modules/@xmldom/xmldom/index.d.ts +96 -0
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/node_modules/@xmldom/xmldom/lib/conventions.js +214 -0
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/node_modules/@xmldom/xmldom/lib/dom.js +2266 -0
- package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/node_modules/@xmldom/xmldom/lib/sax.js +683 -0
- package/node_modules/@xmldom/xmldom/package.json +75 -0
- package/node_modules/@xmldom/xmldom/readme.md +356 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bluebird/LICENSE +21 -0
- package/node_modules/bluebird/README.md +51 -0
- package/node_modules/bluebird/changelog.md +1 -0
- package/node_modules/bluebird/js/browser/bluebird.core.js +3739 -0
- package/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
- package/node_modules/bluebird/js/browser/bluebird.js +5581 -0
- package/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
- package/node_modules/bluebird/js/release/any.js +21 -0
- package/node_modules/bluebird/js/release/assert.js +55 -0
- package/node_modules/bluebird/js/release/async.js +161 -0
- package/node_modules/bluebird/js/release/bind.js +67 -0
- package/node_modules/bluebird/js/release/bluebird.js +11 -0
- package/node_modules/bluebird/js/release/call_get.js +123 -0
- package/node_modules/bluebird/js/release/cancel.js +129 -0
- package/node_modules/bluebird/js/release/catch_filter.js +42 -0
- package/node_modules/bluebird/js/release/context.js +69 -0
- package/node_modules/bluebird/js/release/debuggability.js +916 -0
- package/node_modules/bluebird/js/release/direct_resolve.js +46 -0
- package/node_modules/bluebird/js/release/each.js +30 -0
- package/node_modules/bluebird/js/release/errors.js +116 -0
- package/node_modules/bluebird/js/release/es5.js +80 -0
- package/node_modules/bluebird/js/release/filter.js +12 -0
- package/node_modules/bluebird/js/release/finally.js +111 -0
- package/node_modules/bluebird/js/release/generators.js +223 -0
- package/node_modules/bluebird/js/release/join.js +168 -0
- package/node_modules/bluebird/js/release/map.js +168 -0
- package/node_modules/bluebird/js/release/method.js +55 -0
- package/node_modules/bluebird/js/release/nodeback.js +51 -0
- package/node_modules/bluebird/js/release/nodeify.js +58 -0
- package/node_modules/bluebird/js/release/promise.js +773 -0
- package/node_modules/bluebird/js/release/promise_array.js +184 -0
- package/node_modules/bluebird/js/release/promisify.js +314 -0
- package/node_modules/bluebird/js/release/props.js +118 -0
- package/node_modules/bluebird/js/release/queue.js +73 -0
- package/node_modules/bluebird/js/release/race.js +49 -0
- package/node_modules/bluebird/js/release/reduce.js +172 -0
- package/node_modules/bluebird/js/release/schedule.js +61 -0
- package/node_modules/bluebird/js/release/settle.js +43 -0
- package/node_modules/bluebird/js/release/some.js +148 -0
- package/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
- package/node_modules/bluebird/js/release/thenables.js +86 -0
- package/node_modules/bluebird/js/release/timers.js +93 -0
- package/node_modules/bluebird/js/release/using.js +226 -0
- package/node_modules/bluebird/js/release/util.js +379 -0
- package/node_modules/bluebird/package.json +76 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/dingbat-to-unicode/README.md +79 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.d.ts +8 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.js +1066 -0
- package/node_modules/dingbat-to-unicode/dist/index.d.ts +7 -0
- package/node_modules/dingbat-to-unicode/dist/index.js +44 -0
- package/node_modules/dingbat-to-unicode/package.json +39 -0
- package/node_modules/duck/LICENSE +22 -0
- package/node_modules/duck/README.md +184 -0
- package/node_modules/duck/index.js +267 -0
- package/node_modules/duck/makefile +4 -0
- package/node_modules/duck/package.json +23 -0
- package/node_modules/duck/test/duck.test.js +160 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/lop/LICENSE +22 -0
- package/node_modules/lop/README.md +248 -0
- package/node_modules/lop/index.js +18 -0
- package/node_modules/lop/lib/StringSource.js +53 -0
- package/node_modules/lop/lib/Token.js +7 -0
- package/node_modules/lop/lib/TokenIterator.js +28 -0
- package/node_modules/lop/lib/bottom-up.js +128 -0
- package/node_modules/lop/lib/errors.js +22 -0
- package/node_modules/lop/lib/lazy-iterators.js +81 -0
- package/node_modules/lop/lib/parser.js +11 -0
- package/node_modules/lop/lib/parsing-results.js +103 -0
- package/node_modules/lop/lib/regex-tokeniser.js +70 -0
- package/node_modules/lop/lib/rules.js +313 -0
- package/node_modules/lop/lib/testing.js +69 -0
- package/node_modules/lop/makefile +4 -0
- package/node_modules/lop/package.json +24 -0
- package/node_modules/lop/test/StringSource.test.js +21 -0
- package/node_modules/lop/test/TokenIterator.test.js +17 -0
- package/node_modules/lop/test/Tokeniser.js +50 -0
- package/node_modules/lop/test/Tokeniser.test.js +38 -0
- package/node_modules/lop/test/bottom-up.test.js +187 -0
- package/node_modules/lop/test/errors.test.js +36 -0
- package/node_modules/lop/test/lazy-iterators.test.js +53 -0
- package/node_modules/lop/test/lop.test.js +27 -0
- package/node_modules/lop/test/regex-tokeniser.test.js +114 -0
- package/node_modules/lop/test/results.test.js +8 -0
- package/node_modules/lop/test/rules.test.js +617 -0
- package/node_modules/mammoth/LICENSE +22 -0
- package/node_modules/mammoth/SOURCE.json +57 -0
- package/node_modules/mammoth/browser/docx/files.js +14 -0
- package/node_modules/mammoth/browser/unzip.js +12 -0
- package/node_modules/mammoth/lib/document-to-html.js +469 -0
- package/node_modules/mammoth/lib/documents.js +254 -0
- package/node_modules/mammoth/lib/docx/body-reader.js +798 -0
- package/node_modules/mammoth/lib/docx/comments-reader.js +31 -0
- package/node_modules/mammoth/lib/docx/content-types-reader.js +58 -0
- package/node_modules/mammoth/lib/docx/document-xml-reader.js +30 -0
- package/node_modules/mammoth/lib/docx/docx-reader.js +226 -0
- package/node_modules/mammoth/lib/docx/files.js +80 -0
- package/node_modules/mammoth/lib/docx/notes-reader.js +28 -0
- package/node_modules/mammoth/lib/docx/numbering-xml.js +111 -0
- package/node_modules/mammoth/lib/docx/office-xml-reader.js +73 -0
- package/node_modules/mammoth/lib/docx/relationships-reader.js +43 -0
- package/node_modules/mammoth/lib/docx/style-map.js +75 -0
- package/node_modules/mammoth/lib/docx/styles-reader.js +90 -0
- package/node_modules/mammoth/lib/docx/uris.js +21 -0
- package/node_modules/mammoth/lib/html/ast.js +51 -0
- package/node_modules/mammoth/lib/html/index.js +41 -0
- package/node_modules/mammoth/lib/html/simplify.js +88 -0
- package/node_modules/mammoth/lib/images.js +31 -0
- package/node_modules/mammoth/lib/index.d.ts +86 -0
- package/node_modules/mammoth/lib/index.js +111 -0
- package/node_modules/mammoth/lib/options-reader.js +107 -0
- package/node_modules/mammoth/lib/promises.js +42 -0
- package/node_modules/mammoth/lib/raw-text.js +14 -0
- package/node_modules/mammoth/lib/results.js +72 -0
- package/node_modules/mammoth/lib/style-reader.js +365 -0
- package/node_modules/mammoth/lib/styles/document-matchers.js +100 -0
- package/node_modules/mammoth/lib/styles/html-paths.js +75 -0
- package/node_modules/mammoth/lib/styles/parser/tokeniser.js +30 -0
- package/node_modules/mammoth/lib/transforms.js +62 -0
- package/node_modules/mammoth/lib/underline.js +11 -0
- package/node_modules/mammoth/lib/unzip.js +20 -0
- package/node_modules/mammoth/lib/writers/html-writer.js +159 -0
- package/node_modules/mammoth/lib/writers/index.js +14 -0
- package/node_modules/mammoth/lib/writers/markdown-writer.js +163 -0
- package/node_modules/mammoth/lib/xml/index.js +8 -0
- package/node_modules/mammoth/lib/xml/nodes.js +70 -0
- package/node_modules/mammoth/lib/xml/reader.js +69 -0
- package/node_modules/mammoth/lib/xml/writer.js +61 -0
- package/node_modules/mammoth/lib/xml/xmldom.js +23 -0
- package/node_modules/mammoth/lib/zipfile.js +72 -0
- package/node_modules/mammoth/package.json +39 -0
- package/node_modules/mammoth/upstream-package.json +64 -0
- package/node_modules/option/.npmignore +1 -0
- package/node_modules/option/LICENSE +22 -0
- package/node_modules/option/README.md +101 -0
- package/node_modules/option/index.js +88 -0
- package/node_modules/option/package.json +23 -0
- package/node_modules/option/test/options.test.js +174 -0
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/underscore/LICENSE +22 -0
- package/node_modules/underscore/README.md +34 -0
- package/node_modules/underscore/amd/_baseCreate.js +21 -0
- package/node_modules/underscore/amd/_baseIteratee.js +15 -0
- package/node_modules/underscore/amd/_cb.js +12 -0
- package/node_modules/underscore/amd/_chainResult.js +10 -0
- package/node_modules/underscore/amd/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/amd/_createAssigner.js +24 -0
- package/node_modules/underscore/amd/_createEscaper.js +21 -0
- package/node_modules/underscore/amd/_createIndexFinder.js +30 -0
- package/node_modules/underscore/amd/_createPredicateIndexFinder.js +18 -0
- package/node_modules/underscore/amd/_createReduce.js +30 -0
- package/node_modules/underscore/amd/_createSizePropertyCheck.js +13 -0
- package/node_modules/underscore/amd/_deepGet.js +15 -0
- package/node_modules/underscore/amd/_escapeMap.js +15 -0
- package/node_modules/underscore/amd/_executeBound.js +16 -0
- package/node_modules/underscore/amd/_flatten.js +32 -0
- package/node_modules/underscore/amd/_getByteLength.js +8 -0
- package/node_modules/underscore/amd/_getLength.js +8 -0
- package/node_modules/underscore/amd/_group.js +18 -0
- package/node_modules/underscore/amd/_has.js +10 -0
- package/node_modules/underscore/amd/_hasObjectTag.js +7 -0
- package/node_modules/underscore/amd/_isArrayLike.js +11 -0
- package/node_modules/underscore/amd/_isBufferLike.js +9 -0
- package/node_modules/underscore/amd/_keyInObj.js +11 -0
- package/node_modules/underscore/amd/_methodFingerprint.js +44 -0
- package/node_modules/underscore/amd/_optimizeCb.js +27 -0
- package/node_modules/underscore/amd/_setup.js +70 -0
- package/node_modules/underscore/amd/_shallowProperty.js +12 -0
- package/node_modules/underscore/amd/_stringTagBug.js +19 -0
- package/node_modules/underscore/amd/_tagTester.js +13 -0
- package/node_modules/underscore/amd/_toBufferView.js +15 -0
- package/node_modules/underscore/amd/_toPath.js +11 -0
- package/node_modules/underscore/amd/_unescapeMap.js +8 -0
- package/node_modules/underscore/amd/after.js +14 -0
- package/node_modules/underscore/amd/allKeys.js +15 -0
- package/node_modules/underscore/amd/before.js +18 -0
- package/node_modules/underscore/amd/bind.js +15 -0
- package/node_modules/underscore/amd/bindAll.js +19 -0
- package/node_modules/underscore/amd/chain.js +12 -0
- package/node_modules/underscore/amd/chunk.js +17 -0
- package/node_modules/underscore/amd/clone.js +11 -0
- package/node_modules/underscore/amd/compact.js +10 -0
- package/node_modules/underscore/amd/compose.js +18 -0
- package/node_modules/underscore/amd/constant.js +12 -0
- package/node_modules/underscore/amd/contains.js +12 -0
- package/node_modules/underscore/amd/countBy.js +12 -0
- package/node_modules/underscore/amd/create.js +14 -0
- package/node_modules/underscore/amd/debounce.js +43 -0
- package/node_modules/underscore/amd/defaults.js +8 -0
- package/node_modules/underscore/amd/defer.js +9 -0
- package/node_modules/underscore/amd/delay.js +13 -0
- package/node_modules/underscore/amd/difference.js +14 -0
- package/node_modules/underscore/amd/each.js +25 -0
- package/node_modules/underscore/amd/escape.js +8 -0
- package/node_modules/underscore/amd/every.js +17 -0
- package/node_modules/underscore/amd/extend.js +8 -0
- package/node_modules/underscore/amd/extendOwn.js +10 -0
- package/node_modules/underscore/amd/filter.js +15 -0
- package/node_modules/underscore/amd/find.js +12 -0
- package/node_modules/underscore/amd/findIndex.js +8 -0
- package/node_modules/underscore/amd/findKey.js +15 -0
- package/node_modules/underscore/amd/findLastIndex.js +8 -0
- package/node_modules/underscore/amd/findWhere.js +11 -0
- package/node_modules/underscore/amd/first.js +13 -0
- package/node_modules/underscore/amd/flatten.js +11 -0
- package/node_modules/underscore/amd/functions.js +14 -0
- package/node_modules/underscore/amd/get.js +14 -0
- package/node_modules/underscore/amd/groupBy.js +11 -0
- package/node_modules/underscore/amd/has.js +19 -0
- package/node_modules/underscore/amd/identity.js +10 -0
- package/node_modules/underscore/amd/index-default.js +12 -0
- package/node_modules/underscore/amd/index.js +154 -0
- package/node_modules/underscore/amd/indexBy.js +11 -0
- package/node_modules/underscore/amd/indexOf.js +11 -0
- package/node_modules/underscore/amd/initial.js +12 -0
- package/node_modules/underscore/amd/intersection.js +22 -0
- package/node_modules/underscore/amd/invert.js +15 -0
- package/node_modules/underscore/amd/invoke.js +28 -0
- package/node_modules/underscore/amd/isArguments.js +19 -0
- package/node_modules/underscore/amd/isArray.js +9 -0
- package/node_modules/underscore/amd/isArrayBuffer.js +7 -0
- package/node_modules/underscore/amd/isBoolean.js +10 -0
- package/node_modules/underscore/amd/isDataView.js +17 -0
- package/node_modules/underscore/amd/isDate.js +7 -0
- package/node_modules/underscore/amd/isElement.js +10 -0
- package/node_modules/underscore/amd/isEmpty.js +18 -0
- package/node_modules/underscore/amd/isEqual.js +133 -0
- package/node_modules/underscore/amd/isError.js +7 -0
- package/node_modules/underscore/amd/isFinite.js +10 -0
- package/node_modules/underscore/amd/isFunction.js +18 -0
- package/node_modules/underscore/amd/isMap.js +7 -0
- package/node_modules/underscore/amd/isMatch.js +17 -0
- package/node_modules/underscore/amd/isNaN.js +10 -0
- package/node_modules/underscore/amd/isNull.js +10 -0
- package/node_modules/underscore/amd/isNumber.js +7 -0
- package/node_modules/underscore/amd/isObject.js +11 -0
- package/node_modules/underscore/amd/isRegExp.js +7 -0
- package/node_modules/underscore/amd/isSet.js +7 -0
- package/node_modules/underscore/amd/isString.js +7 -0
- package/node_modules/underscore/amd/isSymbol.js +7 -0
- package/node_modules/underscore/amd/isTypedArray.js +16 -0
- package/node_modules/underscore/amd/isUndefined.js +10 -0
- package/node_modules/underscore/amd/isWeakMap.js +7 -0
- package/node_modules/underscore/amd/isWeakSet.js +7 -0
- package/node_modules/underscore/amd/iteratee.js +13 -0
- package/node_modules/underscore/amd/keys.js +17 -0
- package/node_modules/underscore/amd/last.js +13 -0
- package/node_modules/underscore/amd/lastIndexOf.js +9 -0
- package/node_modules/underscore/amd/map.js +18 -0
- package/node_modules/underscore/amd/mapObject.js +19 -0
- package/node_modules/underscore/amd/matcher.js +14 -0
- package/node_modules/underscore/amd/max.js +30 -0
- package/node_modules/underscore/amd/memoize.js +17 -0
- package/node_modules/underscore/amd/min.js +30 -0
- package/node_modules/underscore/amd/mixin.js +18 -0
- package/node_modules/underscore/amd/negate.js +12 -0
- package/node_modules/underscore/amd/noop.js +8 -0
- package/node_modules/underscore/amd/now.js +10 -0
- package/node_modules/underscore/amd/object.js +20 -0
- package/node_modules/underscore/amd/omit.js +20 -0
- package/node_modules/underscore/amd/once.js +9 -0
- package/node_modules/underscore/amd/pairs.js +17 -0
- package/node_modules/underscore/amd/partial.js +25 -0
- package/node_modules/underscore/amd/partition.js +11 -0
- package/node_modules/underscore/amd/pick.js +25 -0
- package/node_modules/underscore/amd/pipe.js +13 -0
- package/node_modules/underscore/amd/pluck.js +10 -0
- package/node_modules/underscore/amd/property.js +14 -0
- package/node_modules/underscore/amd/propertyOf.js +13 -0
- package/node_modules/underscore/amd/random.js +14 -0
- package/node_modules/underscore/amd/range.js +27 -0
- package/node_modules/underscore/amd/reduce.js +9 -0
- package/node_modules/underscore/amd/reduceRight.js +8 -0
- package/node_modules/underscore/amd/reject.js +10 -0
- package/node_modules/underscore/amd/rest.js +12 -0
- package/node_modules/underscore/amd/restArguments.js +33 -0
- package/node_modules/underscore/amd/result.js +25 -0
- package/node_modules/underscore/amd/sample.js +27 -0
- package/node_modules/underscore/amd/shuffle.js +10 -0
- package/node_modules/underscore/amd/size.js +11 -0
- package/node_modules/underscore/amd/some.js +17 -0
- package/node_modules/underscore/amd/sortBy.js +26 -0
- package/node_modules/underscore/amd/sortedIndex.js +18 -0
- package/node_modules/underscore/amd/tap.js +13 -0
- package/node_modules/underscore/amd/template.js +103 -0
- package/node_modules/underscore/amd/templateSettings.js +13 -0
- package/node_modules/underscore/amd/throttle.js +51 -0
- package/node_modules/underscore/amd/times.js +13 -0
- package/node_modules/underscore/amd/toArray.js +18 -0
- package/node_modules/underscore/amd/toPath.js +12 -0
- package/node_modules/underscore/amd/underscore-array-methods.js +30 -0
- package/node_modules/underscore/amd/underscore.js +29 -0
- package/node_modules/underscore/amd/unescape.js +8 -0
- package/node_modules/underscore/amd/union.js +11 -0
- package/node_modules/underscore/amd/uniq.js +37 -0
- package/node_modules/underscore/amd/uniqueId.js +13 -0
- package/node_modules/underscore/amd/unzip.js +17 -0
- package/node_modules/underscore/amd/values.js +16 -0
- package/node_modules/underscore/amd/where.js +11 -0
- package/node_modules/underscore/amd/without.js +10 -0
- package/node_modules/underscore/amd/wrap.js +12 -0
- package/node_modules/underscore/amd/zip.js +9 -0
- package/node_modules/underscore/cjs/_baseCreate.js +20 -0
- package/node_modules/underscore/cjs/_baseIteratee.js +19 -0
- package/node_modules/underscore/cjs/_cb.js +12 -0
- package/node_modules/underscore/cjs/_chainResult.js +8 -0
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/cjs/_createAssigner.js +20 -0
- package/node_modules/underscore/cjs/_createEscaper.js +19 -0
- package/node_modules/underscore/cjs/_createIndexFinder.js +30 -0
- package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +17 -0
- package/node_modules/underscore/cjs/_createReduce.js +30 -0
- package/node_modules/underscore/cjs/_createSizePropertyCheck.js +11 -0
- package/node_modules/underscore/cjs/_deepGet.js +11 -0
- package/node_modules/underscore/cjs/_escapeMap.js +11 -0
- package/node_modules/underscore/cjs/_executeBound.js +15 -0
- package/node_modules/underscore/cjs/_flatten.js +33 -0
- package/node_modules/underscore/cjs/_getByteLength.js +6 -0
- package/node_modules/underscore/cjs/_getLength.js +6 -0
- package/node_modules/underscore/cjs/_group.js +17 -0
- package/node_modules/underscore/cjs/_has.js +8 -0
- package/node_modules/underscore/cjs/_hasObjectTag.js +5 -0
- package/node_modules/underscore/cjs/_isArrayLike.js +10 -0
- package/node_modules/underscore/cjs/_isBufferLike.js +8 -0
- package/node_modules/underscore/cjs/_keyInObj.js +7 -0
- package/node_modules/underscore/cjs/_methodFingerprint.js +44 -0
- package/node_modules/underscore/cjs/_optimizeCb.js +23 -0
- package/node_modules/underscore/cjs/_setup.js +66 -0
- package/node_modules/underscore/cjs/_shallowProperty.js +8 -0
- package/node_modules/underscore/cjs/_stringTagBug.js +18 -0
- package/node_modules/underscore/cjs/_tagTester.js +11 -0
- package/node_modules/underscore/cjs/_toBufferView.js +13 -0
- package/node_modules/underscore/cjs/_toPath.js +10 -0
- package/node_modules/underscore/cjs/_unescapeMap.js +7 -0
- package/node_modules/underscore/cjs/after.js +10 -0
- package/node_modules/underscore/cjs/allKeys.js +15 -0
- package/node_modules/underscore/cjs/before.js +14 -0
- package/node_modules/underscore/cjs/bind.js +15 -0
- package/node_modules/underscore/cjs/bindAll.js +19 -0
- package/node_modules/underscore/cjs/chain.js +10 -0
- package/node_modules/underscore/cjs/chunk.js +15 -0
- package/node_modules/underscore/cjs/clone.js +11 -0
- package/node_modules/underscore/cjs/compact.js +8 -0
- package/node_modules/underscore/cjs/compose.js +14 -0
- package/node_modules/underscore/cjs/constant.js +8 -0
- package/node_modules/underscore/cjs/contains.js +12 -0
- package/node_modules/underscore/cjs/countBy.js +11 -0
- package/node_modules/underscore/cjs/create.js +13 -0
- package/node_modules/underscore/cjs/debounce.js +42 -0
- package/node_modules/underscore/cjs/defaults.js +7 -0
- package/node_modules/underscore/cjs/defer.js +9 -0
- package/node_modules/underscore/cjs/delay.js +11 -0
- package/node_modules/underscore/cjs/difference.js +15 -0
- package/node_modules/underscore/cjs/each.js +25 -0
- package/node_modules/underscore/cjs/escape.js +7 -0
- package/node_modules/underscore/cjs/every.js +17 -0
- package/node_modules/underscore/cjs/extend.js +7 -0
- package/node_modules/underscore/cjs/extendOwn.js +9 -0
- package/node_modules/underscore/cjs/filter.js +14 -0
- package/node_modules/underscore/cjs/find.js +12 -0
- package/node_modules/underscore/cjs/findIndex.js +6 -0
- package/node_modules/underscore/cjs/findKey.js +14 -0
- package/node_modules/underscore/cjs/findLastIndex.js +6 -0
- package/node_modules/underscore/cjs/findWhere.js +10 -0
- package/node_modules/underscore/cjs/first.js +11 -0
- package/node_modules/underscore/cjs/flatten.js +9 -0
- package/node_modules/underscore/cjs/functions.js +12 -0
- package/node_modules/underscore/cjs/get.js +14 -0
- package/node_modules/underscore/cjs/groupBy.js +10 -0
- package/node_modules/underscore/cjs/has.js +18 -0
- package/node_modules/underscore/cjs/identity.js +6 -0
- package/node_modules/underscore/cjs/index-default.js +11 -0
- package/node_modules/underscore/cjs/index.js +278 -0
- package/node_modules/underscore/cjs/indexBy.js +9 -0
- package/node_modules/underscore/cjs/indexOf.js +11 -0
- package/node_modules/underscore/cjs/initial.js +10 -0
- package/node_modules/underscore/cjs/intersection.js +21 -0
- package/node_modules/underscore/cjs/invert.js +13 -0
- package/node_modules/underscore/cjs/invoke.js +30 -0
- package/node_modules/underscore/cjs/isArguments.js +18 -0
- package/node_modules/underscore/cjs/isArray.js +8 -0
- package/node_modules/underscore/cjs/isArrayBuffer.js +5 -0
- package/node_modules/underscore/cjs/isBoolean.js +8 -0
- package/node_modules/underscore/cjs/isDataView.js +18 -0
- package/node_modules/underscore/cjs/isDate.js +5 -0
- package/node_modules/underscore/cjs/isElement.js +6 -0
- package/node_modules/underscore/cjs/isEmpty.js +20 -0
- package/node_modules/underscore/cjs/isEqual.js +140 -0
- package/node_modules/underscore/cjs/isError.js +5 -0
- package/node_modules/underscore/cjs/isFinite.js +9 -0
- package/node_modules/underscore/cjs/isFunction.js +17 -0
- package/node_modules/underscore/cjs/isMap.js +7 -0
- package/node_modules/underscore/cjs/isMatch.js +15 -0
- package/node_modules/underscore/cjs/isNaN.js +9 -0
- package/node_modules/underscore/cjs/isNull.js +6 -0
- package/node_modules/underscore/cjs/isNumber.js +5 -0
- package/node_modules/underscore/cjs/isObject.js +7 -0
- package/node_modules/underscore/cjs/isRegExp.js +5 -0
- package/node_modules/underscore/cjs/isSet.js +7 -0
- package/node_modules/underscore/cjs/isString.js +5 -0
- package/node_modules/underscore/cjs/isSymbol.js +5 -0
- package/node_modules/underscore/cjs/isTypedArray.js +17 -0
- package/node_modules/underscore/cjs/isUndefined.js +6 -0
- package/node_modules/underscore/cjs/isWeakMap.js +7 -0
- package/node_modules/underscore/cjs/isWeakSet.js +5 -0
- package/node_modules/underscore/cjs/iteratee.js +12 -0
- package/node_modules/underscore/cjs/keys.js +18 -0
- package/node_modules/underscore/cjs/last.js +11 -0
- package/node_modules/underscore/cjs/lastIndexOf.js +8 -0
- package/node_modules/underscore/cjs/map.js +18 -0
- package/node_modules/underscore/cjs/mapObject.js +18 -0
- package/node_modules/underscore/cjs/matcher.js +13 -0
- package/node_modules/underscore/cjs/max.js +31 -0
- package/node_modules/underscore/cjs/memoize.js +15 -0
- package/node_modules/underscore/cjs/min.js +31 -0
- package/node_modules/underscore/cjs/mixin.js +20 -0
- package/node_modules/underscore/cjs/negate.js +8 -0
- package/node_modules/underscore/cjs/noop.js +4 -0
- package/node_modules/underscore/cjs/now.js +6 -0
- package/node_modules/underscore/cjs/object.js +18 -0
- package/node_modules/underscore/cjs/omit.js +24 -0
- package/node_modules/underscore/cjs/once.js +8 -0
- package/node_modules/underscore/cjs/pairs.js +15 -0
- package/node_modules/underscore/cjs/partial.js +25 -0
- package/node_modules/underscore/cjs/partition.js +9 -0
- package/node_modules/underscore/cjs/pick.js +28 -0
- package/node_modules/underscore/cjs/pipe.js +12 -0
- package/node_modules/underscore/cjs/pluck.js +9 -0
- package/node_modules/underscore/cjs/property.js +13 -0
- package/node_modules/underscore/cjs/propertyOf.js +12 -0
- package/node_modules/underscore/cjs/random.js +10 -0
- package/node_modules/underscore/cjs/range.js +23 -0
- package/node_modules/underscore/cjs/reduce.js +7 -0
- package/node_modules/underscore/cjs/reduceRight.js +6 -0
- package/node_modules/underscore/cjs/reject.js +10 -0
- package/node_modules/underscore/cjs/rest.js +10 -0
- package/node_modules/underscore/cjs/restArguments.js +29 -0
- package/node_modules/underscore/cjs/result.js +24 -0
- package/node_modules/underscore/cjs/sample.js +29 -0
- package/node_modules/underscore/cjs/shuffle.js +8 -0
- package/node_modules/underscore/cjs/size.js +10 -0
- package/node_modules/underscore/cjs/some.js +17 -0
- package/node_modules/underscore/cjs/sortBy.js +26 -0
- package/node_modules/underscore/cjs/sortedIndex.js +17 -0
- package/node_modules/underscore/cjs/tap.js +9 -0
- package/node_modules/underscore/cjs/template.js +103 -0
- package/node_modules/underscore/cjs/templateSettings.js +11 -0
- package/node_modules/underscore/cjs/throttle.js +49 -0
- package/node_modules/underscore/cjs/times.js +11 -0
- package/node_modules/underscore/cjs/toArray.js +22 -0
- package/node_modules/underscore/cjs/toPath.js +11 -0
- package/node_modules/underscore/cjs/underscore-array-methods.js +31 -0
- package/node_modules/underscore/cjs/underscore.js +27 -0
- package/node_modules/underscore/cjs/unescape.js +7 -0
- package/node_modules/underscore/cjs/union.js +11 -0
- package/node_modules/underscore/cjs/uniq.js +38 -0
- package/node_modules/underscore/cjs/uniqueId.js +9 -0
- package/node_modules/underscore/cjs/unzip.js +17 -0
- package/node_modules/underscore/cjs/values.js +14 -0
- package/node_modules/underscore/cjs/where.js +10 -0
- package/node_modules/underscore/cjs/without.js +9 -0
- package/node_modules/underscore/cjs/wrap.js +10 -0
- package/node_modules/underscore/cjs/zip.js +8 -0
- package/node_modules/underscore/modules/.eslintrc +21 -0
- package/node_modules/underscore/modules/_baseCreate.js +18 -0
- package/node_modules/underscore/modules/_baseIteratee.js +17 -0
- package/node_modules/underscore/modules/_cb.js +10 -0
- package/node_modules/underscore/modules/_chainResult.js +6 -0
- package/node_modules/underscore/modules/_collectNonEnumProps.js +40 -0
- package/node_modules/underscore/modules/_createAssigner.js +18 -0
- package/node_modules/underscore/modules/_createEscaper.js +17 -0
- package/node_modules/underscore/modules/_createIndexFinder.js +28 -0
- package/node_modules/underscore/modules/_createPredicateIndexFinder.js +15 -0
- package/node_modules/underscore/modules/_createReduce.js +28 -0
- package/node_modules/underscore/modules/_createSizePropertyCheck.js +9 -0
- package/node_modules/underscore/modules/_deepGet.js +9 -0
- package/node_modules/underscore/modules/_escapeMap.js +9 -0
- package/node_modules/underscore/modules/_executeBound.js +13 -0
- package/node_modules/underscore/modules/_flatten.js +33 -0
- package/node_modules/underscore/modules/_getByteLength.js +4 -0
- package/node_modules/underscore/modules/_getLength.js +4 -0
- package/node_modules/underscore/modules/_group.js +15 -0
- package/node_modules/underscore/modules/_has.js +6 -0
- package/node_modules/underscore/modules/_hasObjectTag.js +3 -0
- package/node_modules/underscore/modules/_isArrayLike.js +8 -0
- package/node_modules/underscore/modules/_isBufferLike.js +6 -0
- package/node_modules/underscore/modules/_keyInObj.js +5 -0
- package/node_modules/underscore/modules/_methodFingerprint.js +37 -0
- package/node_modules/underscore/modules/_optimizeCb.js +21 -0
- package/node_modules/underscore/modules/_setup.js +43 -0
- package/node_modules/underscore/modules/_shallowProperty.js +6 -0
- package/node_modules/underscore/modules/_stringTagBug.js +13 -0
- package/node_modules/underscore/modules/_tagTester.js +9 -0
- package/node_modules/underscore/modules/_toBufferView.js +11 -0
- package/node_modules/underscore/modules/_toPath.js +8 -0
- package/node_modules/underscore/modules/_unescapeMap.js +5 -0
- package/node_modules/underscore/modules/after.js +8 -0
- package/node_modules/underscore/modules/allKeys.js +13 -0
- package/node_modules/underscore/modules/before.js +12 -0
- package/node_modules/underscore/modules/bind.js +13 -0
- package/node_modules/underscore/modules/bindAll.js +17 -0
- package/node_modules/underscore/modules/chain.js +8 -0
- package/node_modules/underscore/modules/chunk.js +13 -0
- package/node_modules/underscore/modules/clone.js +9 -0
- package/node_modules/underscore/modules/compact.js +6 -0
- package/node_modules/underscore/modules/compose.js +12 -0
- package/node_modules/underscore/modules/constant.js +6 -0
- package/node_modules/underscore/modules/contains.js +10 -0
- package/node_modules/underscore/modules/countBy.js +9 -0
- package/node_modules/underscore/modules/create.js +11 -0
- package/node_modules/underscore/modules/debounce.js +40 -0
- package/node_modules/underscore/modules/defaults.js +5 -0
- package/node_modules/underscore/modules/defer.js +7 -0
- package/node_modules/underscore/modules/delay.js +9 -0
- package/node_modules/underscore/modules/difference.js +13 -0
- package/node_modules/underscore/modules/each.js +23 -0
- package/node_modules/underscore/modules/escape.js +5 -0
- package/node_modules/underscore/modules/every.js +15 -0
- package/node_modules/underscore/modules/extend.js +5 -0
- package/node_modules/underscore/modules/extendOwn.js +7 -0
- package/node_modules/underscore/modules/filter.js +12 -0
- package/node_modules/underscore/modules/find.js +10 -0
- package/node_modules/underscore/modules/findIndex.js +4 -0
- package/node_modules/underscore/modules/findKey.js +12 -0
- package/node_modules/underscore/modules/findLastIndex.js +4 -0
- package/node_modules/underscore/modules/findWhere.js +8 -0
- package/node_modules/underscore/modules/first.js +9 -0
- package/node_modules/underscore/modules/flatten.js +7 -0
- package/node_modules/underscore/modules/functions.js +10 -0
- package/node_modules/underscore/modules/get.js +12 -0
- package/node_modules/underscore/modules/groupBy.js +8 -0
- package/node_modules/underscore/modules/has.js +16 -0
- package/node_modules/underscore/modules/identity.js +4 -0
- package/node_modules/underscore/modules/index-all.js +18 -0
- package/node_modules/underscore/modules/index-default.js +27 -0
- package/node_modules/underscore/modules/index.js +200 -0
- package/node_modules/underscore/modules/indexBy.js +7 -0
- package/node_modules/underscore/modules/indexOf.js +9 -0
- package/node_modules/underscore/modules/initial.js +8 -0
- package/node_modules/underscore/modules/intersection.js +19 -0
- package/node_modules/underscore/modules/invert.js +11 -0
- package/node_modules/underscore/modules/invoke.js +28 -0
- package/node_modules/underscore/modules/isArguments.js +16 -0
- package/node_modules/underscore/modules/isArray.js +6 -0
- package/node_modules/underscore/modules/isArrayBuffer.js +3 -0
- package/node_modules/underscore/modules/isBoolean.js +6 -0
- package/node_modules/underscore/modules/isDataView.js +16 -0
- package/node_modules/underscore/modules/isDate.js +3 -0
- package/node_modules/underscore/modules/isElement.js +4 -0
- package/node_modules/underscore/modules/isEmpty.js +18 -0
- package/node_modules/underscore/modules/isEqual.js +153 -0
- package/node_modules/underscore/modules/isError.js +3 -0
- package/node_modules/underscore/modules/isFinite.js +7 -0
- package/node_modules/underscore/modules/isFunction.js +15 -0
- package/node_modules/underscore/modules/isMap.js +5 -0
- package/node_modules/underscore/modules/isMatch.js +13 -0
- package/node_modules/underscore/modules/isNaN.js +7 -0
- package/node_modules/underscore/modules/isNull.js +4 -0
- package/node_modules/underscore/modules/isNumber.js +3 -0
- package/node_modules/underscore/modules/isObject.js +5 -0
- package/node_modules/underscore/modules/isRegExp.js +3 -0
- package/node_modules/underscore/modules/isSet.js +5 -0
- package/node_modules/underscore/modules/isString.js +3 -0
- package/node_modules/underscore/modules/isSymbol.js +3 -0
- package/node_modules/underscore/modules/isTypedArray.js +15 -0
- package/node_modules/underscore/modules/isUndefined.js +4 -0
- package/node_modules/underscore/modules/isWeakMap.js +5 -0
- package/node_modules/underscore/modules/isWeakSet.js +3 -0
- package/node_modules/underscore/modules/iteratee.js +10 -0
- package/node_modules/underscore/modules/keys.js +16 -0
- package/node_modules/underscore/modules/last.js +9 -0
- package/node_modules/underscore/modules/lastIndexOf.js +6 -0
- package/node_modules/underscore/modules/map.js +16 -0
- package/node_modules/underscore/modules/mapObject.js +16 -0
- package/node_modules/underscore/modules/matcher.js +11 -0
- package/node_modules/underscore/modules/max.js +29 -0
- package/node_modules/underscore/modules/memoize.js +13 -0
- package/node_modules/underscore/modules/min.js +29 -0
- package/node_modules/underscore/modules/mixin.js +18 -0
- package/node_modules/underscore/modules/negate.js +6 -0
- package/node_modules/underscore/modules/noop.js +2 -0
- package/node_modules/underscore/modules/now.js +4 -0
- package/node_modules/underscore/modules/object.js +16 -0
- package/node_modules/underscore/modules/omit.js +22 -0
- package/node_modules/underscore/modules/once.js +6 -0
- package/node_modules/underscore/modules/package.json +1 -0
- package/node_modules/underscore/modules/pairs.js +13 -0
- package/node_modules/underscore/modules/partial.js +24 -0
- package/node_modules/underscore/modules/partition.js +7 -0
- package/node_modules/underscore/modules/pick.js +26 -0
- package/node_modules/underscore/modules/pluck.js +7 -0
- package/node_modules/underscore/modules/property.js +11 -0
- package/node_modules/underscore/modules/propertyOf.js +10 -0
- package/node_modules/underscore/modules/random.js +8 -0
- package/node_modules/underscore/modules/range.js +21 -0
- package/node_modules/underscore/modules/reduce.js +5 -0
- package/node_modules/underscore/modules/reduceRight.js +4 -0
- package/node_modules/underscore/modules/reject.js +8 -0
- package/node_modules/underscore/modules/rest.js +8 -0
- package/node_modules/underscore/modules/restArguments.js +27 -0
- package/node_modules/underscore/modules/result.js +22 -0
- package/node_modules/underscore/modules/sample.js +27 -0
- package/node_modules/underscore/modules/shuffle.js +6 -0
- package/node_modules/underscore/modules/size.js +8 -0
- package/node_modules/underscore/modules/some.js +15 -0
- package/node_modules/underscore/modules/sortBy.js +24 -0
- package/node_modules/underscore/modules/sortedIndex.js +15 -0
- package/node_modules/underscore/modules/tap.js +7 -0
- package/node_modules/underscore/modules/template.js +101 -0
- package/node_modules/underscore/modules/templateSettings.js +9 -0
- package/node_modules/underscore/modules/throttle.js +47 -0
- package/node_modules/underscore/modules/times.js +9 -0
- package/node_modules/underscore/modules/toArray.js +20 -0
- package/node_modules/underscore/modules/toPath.js +9 -0
- package/node_modules/underscore/modules/underscore-array-methods.js +31 -0
- package/node_modules/underscore/modules/underscore.js +25 -0
- package/node_modules/underscore/modules/unescape.js +5 -0
- package/node_modules/underscore/modules/union.js +9 -0
- package/node_modules/underscore/modules/uniq.js +36 -0
- package/node_modules/underscore/modules/uniqueId.js +7 -0
- package/node_modules/underscore/modules/unzip.js +15 -0
- package/node_modules/underscore/modules/values.js +12 -0
- package/node_modules/underscore/modules/where.js +8 -0
- package/node_modules/underscore/modules/without.js +7 -0
- package/node_modules/underscore/modules/wrap.js +8 -0
- package/node_modules/underscore/modules/zip.js +6 -0
- package/node_modules/underscore/package.json +124 -0
- package/node_modules/underscore/underscore-esm-min.js +5 -0
- package/node_modules/underscore/underscore-esm-min.js.map +1 -0
- package/node_modules/underscore/underscore-esm.js +2056 -0
- package/node_modules/underscore/underscore-esm.js.map +1 -0
- package/node_modules/underscore/underscore-min.js +6 -0
- package/node_modules/underscore/underscore-min.js.map +1 -0
- package/node_modules/underscore/underscore-node-f.cjs +2180 -0
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.cjs +11 -0
- package/node_modules/underscore/underscore-node.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.mjs +7 -0
- package/node_modules/underscore/underscore-node.mjs.map +1 -0
- package/node_modules/underscore/underscore-umd-min.js +6 -0
- package/node_modules/underscore/underscore-umd-min.js.map +1 -0
- package/node_modules/underscore/underscore-umd.js +2064 -0
- package/node_modules/underscore/underscore-umd.js.map +1 -0
- package/node_modules/underscore/underscore.js +2064 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/xmlbuilder/CHANGELOG.md +438 -0
- package/node_modules/xmlbuilder/LICENSE +21 -0
- package/node_modules/xmlbuilder/README.md +86 -0
- package/node_modules/xmlbuilder/appveyor.yml +20 -0
- package/node_modules/xmlbuilder/lib/Utility.js +83 -0
- package/node_modules/xmlbuilder/lib/XMLAttribute.js +41 -0
- package/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- package/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- package/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- package/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- package/node_modules/xmlbuilder/lib/XMLDocType.js +108 -0
- package/node_modules/xmlbuilder/lib/XMLDocument.js +49 -0
- package/node_modules/xmlbuilder/lib/XMLDocumentCB.js +414 -0
- package/node_modules/xmlbuilder/lib/XMLDummy.js +29 -0
- package/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- package/node_modules/xmlbuilder/lib/XMLNode.js +467 -0
- package/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLStreamWriter.js +287 -0
- package/node_modules/xmlbuilder/lib/XMLStringWriter.js +341 -0
- package/node_modules/xmlbuilder/lib/XMLStringifier.js +163 -0
- package/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLWriterBase.js +90 -0
- package/node_modules/xmlbuilder/lib/index.js +53 -0
- package/node_modules/xmlbuilder/package.json +37 -0
- package/package.json +13 -5
- package/scripts/check-doc-links.mjs +4 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-package-artifact.mjs +19 -0
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/dependency-audit.mjs +49 -96
- package/scripts/dependency-audit.test.mjs +70 -106
- package/scripts/docx-browser-test.mjs +56 -0
- package/scripts/docx-compatibility.test.mjs +39 -0
- package/scripts/docx-fixtures.mjs +19 -0
- package/scripts/export-oss.mjs +3 -0
- package/scripts/generate-third-party-notices.mjs +6 -2
- package/scripts/install.sh +1 -1
- package/scripts/notification-console-test.mjs +172 -0
- package/scripts/oss-boundary-check.mjs +3 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +9 -1
- package/scripts/vendor-mammoth.mjs +130 -0
- package/scripts/verify-github-repo.mjs +8 -0
- package/scripts/verify-oss-export.mjs +3 -0
- package/sql/067_delivery_dlq_replay.sql +10 -0
- package/sql/068_notification_outbox.sql +28 -0
- package/sql/README.en.md +14 -0
- package/sql/README.md +14 -0
- package/src/adapters/llm/file.test.ts +59 -0
- package/src/adapters/llm/file.ts +11 -4
- package/src/app/agent-tool-invocations.test.ts +3 -1
- package/src/app/approval-continuations.mysql.test.ts +1 -1
- package/src/app/approval-continuations.test.ts +27 -1
- package/src/app/approval-continuations.ts +44 -3
- package/src/app/channels-attachments.test.ts +63 -0
- package/src/app/channels.ts +7 -4
- package/src/app/delivery-dlq-replay.mysql.test.ts +139 -0
- package/src/app/delivery-dlq-replay.test.ts +75 -0
- package/src/app/delivery-dlq-replay.ts +41 -0
- package/src/app/delivery.ts +118 -3
- package/src/app/engine.ts +5 -4
- package/src/app/kernel-notification-lifecycle.test.ts +49 -0
- package/src/app/kernel-usage-lifecycle.mysql.test.ts +1 -1
- package/src/app/kernel.ts +17 -0
- package/src/app/notification-outbound.test.ts +53 -0
- package/src/app/notification-outbox.test.ts +321 -0
- package/src/app/notification-outbox.ts +123 -0
- package/src/app/operational-metrics.test.ts +52 -1
- package/src/app/operational-metrics.ts +34 -2
- package/src/app/outbound.ts +41 -2
- package/src/app/runtime-evidence-maintenance.test.ts +34 -1
- package/src/app/runtime-lifecycle-default.ts +7 -0
- package/src/app/runtime-lifecycle.test.ts +89 -0
- package/src/app/runtime-lifecycle.ts +28 -18
- package/src/app/tool-approvals.ts +69 -31
- package/src/core/contracts/delivery-replay.ts +42 -0
- package/src/core/contracts/notification-outbox.ts +54 -0
- package/src/core/contracts/tools-idempotency.test.ts +121 -5
- package/src/core/contracts/tools.ts +21 -11
- package/src/core/contracts/types.ts +2 -0
- package/src/core/observability/openmetrics.test.ts +46 -0
- package/src/core/observability/openmetrics.ts +108 -0
- package/src/core/platform/http-body.test.ts +185 -0
- package/src/core/platform/http-body.ts +58 -0
- package/src/core/runtime/finish-runtime.test.ts +22 -0
- package/src/core/runtime/finish-runtime.ts +21 -10
- package/src/core/runtime/inhub-runtime.ts +10 -2
- package/src/core/runtime/notification-background-work.test.ts +50 -0
- package/src/core/runtime/notification-background-work.ts +101 -0
- package/src/core/runtime/notification-outbox-work.ts +15 -0
- package/src/core/state/delivery-replay.ts +19 -0
- package/src/core/state/notification-outbox.ts +66 -0
- package/src/core/state/state-codec.ts +1 -0
- package/src/core/state/state-contracts.ts +7 -0
- package/src/infrastructure/config/config-approval-ledger.ts +23 -1
- package/src/infrastructure/config/config-delivery-dlq-ledger.ts +51 -12
- package/src/infrastructure/config/configstore.ts +8 -3
- package/src/infrastructure/state/notification-outbox-jsonl.ts +80 -0
- package/src/infrastructure/state/notification-outbox-mysql.ts +100 -0
- package/src/infrastructure/state/notification-outbox-storage.test.ts +325 -0
- package/src/infrastructure/state/state-jsonl.ts +80 -14
- package/src/infrastructure/state/state-mysql.ts +63 -5
- package/src/modules/usage/background-work.test.ts +28 -0
- package/src/modules/usage/background-work.ts +43 -7
- package/src/modules/usage/billing-reconciliation.test.ts +16 -2
- package/src/modules/usage/billing-repository.ts +9 -0
- package/src/modules/usage/maintenance.test.ts +18 -2
- package/src/modules/usage/maintenance.ts +8 -0
- package/src/routes/admin-notifications.test.ts +75 -0
- package/src/routes/admin-notifications.ts +77 -0
- package/src/routes/admin-runtime.test.ts +25 -0
- package/src/routes/admin-runtime.ts +29 -0
- package/src/routes/admin.ts +1 -0
- package/src/test-support/notification-outbox-journal-crash-child.ts +20 -0
- package/vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz +0 -0
- package/vendor/mammoth-library/LICENSE +22 -0
- package/vendor/mammoth-library/SOURCE.json +57 -0
- package/vendor/mammoth-library/browser/docx/files.js +14 -0
- package/vendor/mammoth-library/browser/unzip.js +12 -0
- package/vendor/mammoth-library/lib/document-to-html.js +469 -0
- package/vendor/mammoth-library/lib/documents.js +254 -0
- package/vendor/mammoth-library/lib/docx/body-reader.js +798 -0
- package/vendor/mammoth-library/lib/docx/comments-reader.js +31 -0
- package/vendor/mammoth-library/lib/docx/content-types-reader.js +58 -0
- package/vendor/mammoth-library/lib/docx/document-xml-reader.js +30 -0
- package/vendor/mammoth-library/lib/docx/docx-reader.js +226 -0
- package/vendor/mammoth-library/lib/docx/files.js +80 -0
- package/vendor/mammoth-library/lib/docx/notes-reader.js +28 -0
- package/vendor/mammoth-library/lib/docx/numbering-xml.js +111 -0
- package/vendor/mammoth-library/lib/docx/office-xml-reader.js +73 -0
- package/vendor/mammoth-library/lib/docx/relationships-reader.js +43 -0
- package/vendor/mammoth-library/lib/docx/style-map.js +75 -0
- package/vendor/mammoth-library/lib/docx/styles-reader.js +90 -0
- package/vendor/mammoth-library/lib/docx/uris.js +21 -0
- package/vendor/mammoth-library/lib/html/ast.js +51 -0
- package/vendor/mammoth-library/lib/html/index.js +41 -0
- package/vendor/mammoth-library/lib/html/simplify.js +88 -0
- package/vendor/mammoth-library/lib/images.js +31 -0
- package/vendor/mammoth-library/lib/index.d.ts +86 -0
- package/vendor/mammoth-library/lib/index.js +111 -0
- package/vendor/mammoth-library/lib/options-reader.js +107 -0
- package/vendor/mammoth-library/lib/promises.js +42 -0
- package/vendor/mammoth-library/lib/raw-text.js +14 -0
- package/vendor/mammoth-library/lib/results.js +72 -0
- package/vendor/mammoth-library/lib/style-reader.js +365 -0
- package/vendor/mammoth-library/lib/styles/document-matchers.js +100 -0
- package/vendor/mammoth-library/lib/styles/html-paths.js +75 -0
- package/vendor/mammoth-library/lib/styles/parser/tokeniser.js +30 -0
- package/vendor/mammoth-library/lib/transforms.js +62 -0
- package/vendor/mammoth-library/lib/underline.js +11 -0
- package/vendor/mammoth-library/lib/unzip.js +20 -0
- package/vendor/mammoth-library/lib/writers/html-writer.js +159 -0
- package/vendor/mammoth-library/lib/writers/index.js +14 -0
- package/vendor/mammoth-library/lib/writers/markdown-writer.js +163 -0
- package/vendor/mammoth-library/lib/xml/index.js +8 -0
- package/vendor/mammoth-library/lib/xml/nodes.js +70 -0
- package/vendor/mammoth-library/lib/xml/reader.js +69 -0
- package/vendor/mammoth-library/lib/xml/writer.js +61 -0
- package/vendor/mammoth-library/lib/xml/xmldom.js +23 -0
- package/vendor/mammoth-library/lib/zipfile.js +72 -0
- package/vendor/mammoth-library/package.json +39 -0
- package/vendor/mammoth-library/upstream-package.json +64 -0
- package/vendor/mammoth-library-distribution.json +4 -0
- package/web/console/assets/{Accounts-DKhw_QLr.js → Accounts-Dhj6PjXP.js} +1 -1
- package/web/console/assets/{AgentClients-CM4_5HaA.js → AgentClients-CMy8StAH.js} +1 -1
- package/web/console/assets/{AgentTasks-CkQgZTU5.js → AgentTasks-DA1xZdmP.js} +1 -1
- package/web/console/assets/{Approvals-B9O9TkbO.js → Approvals-DIsd7R8N.js} +1 -1
- package/web/console/assets/{Audit-2vDC1SPu.js → Audit-AUDABLTX.js} +1 -1
- package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-CffORQse.js} +1 -1
- package/web/console/assets/{Channels-A-GvkNBt.js → Channels-B8rjsM0S.js} +1 -1
- package/web/console/assets/{ChatEntries-BLxymI67.js → ChatEntries-iZjJMEUZ.js} +1 -1
- package/web/console/assets/{Clients-DeNlmvS6.js → Clients-CwgpGCSD.js} +1 -1
- package/web/console/assets/{Cost-CBq_L4Kz.js → Cost-B2tNxu71.js} +1 -1
- package/web/console/assets/{Credentials-DmtbctNj.js → Credentials-BuwFB-fV.js} +1 -1
- package/web/console/assets/{Diagnostics-BbcRDiA-.js → Diagnostics-z5glms11.js} +1 -1
- package/web/console/assets/{Executors-gGgmQrDt.js → Executors-Bc4SvjeH.js} +1 -1
- package/web/console/assets/{Kb-lgY6OXUz.js → Kb-BRbRHxLy.js} +1 -1
- package/web/console/assets/{Login-DA6BASZd.js → Login-CGgLGTE1.js} +1 -1
- package/web/console/assets/{Projects-DEbmB_sT.js → Projects-CPWw3con.js} +1 -1
- package/web/console/assets/{Routes-qS6LLoyS.js → Routes-CMIaE0Bx.js} +1 -1
- package/web/console/assets/Runs-B8HuE700.js +3 -0
- package/web/console/assets/Runs-Bv6CV_Hk.css +1 -0
- package/web/console/assets/{Setup-DEpVF5uw.js → Setup-G8RKzliR.js} +1 -1
- package/web/console/assets/{Shell-DgoPgK1E.js → Shell-DimHgraJ.js} +1 -1
- package/web/console/assets/{StorageBuckets-DJtNN769.js → StorageBuckets-CiVYXIE2.js} +1 -1
- package/web/console/assets/{SystemSettings-0DEUgeTR.js → SystemSettings-DF8sZNen.js} +1 -1
- package/web/console/assets/{SystemStatus-CR1phiPE.js → SystemStatus-BlHywK13.js} +1 -1
- package/web/console/assets/{Targets-D65l-IMB.js → Targets-BXaoPoAJ.js} +1 -1
- package/web/console/assets/{Tools-DqtrINrN.js → Tools-B22lNHXq.js} +1 -1
- package/web/console/assets/{Usage-B5njXNjx.js → Usage-C02EzoI2.js} +1 -1
- package/web/console/assets/{UsageAccess-ChnB4pjb.js → UsageAccess-DOb-cyPE.js} +1 -1
- package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-CzS2gI40.js} +1 -1
- package/web/console/assets/{index-sLKrJd_p.js → index-CK0ZCTZv.js} +2 -2
- package/web/console/assets/{request-BpaimqEb.js → request-DKycpD7z.js} +1 -1
- package/web/console/assets/{schema-D0Z4kFCZ.js → schema-SCiNxBlR.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/package-lock.json +5 -23
- package/web-admin/package.json +1 -1
- package/web-admin/src/components/NotificationOutboxPanel.vue +106 -0
- package/web-admin/src/pages/Runs.vue +8 -2
- package/security/dependency-audit-exceptions.json +0 -192
- package/web/console/assets/Runs-CvGTV8I-.css +0 -1
- package/web/console/assets/Runs-DG-VLRSc.js +0 -3
|
@@ -0,0 +1,1556 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
|
4
|
+
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
|
5
|
+
//
|
|
6
|
+
// This software is provided 'as-is', without any express or implied
|
|
7
|
+
// warranty. In no event will the authors be held liable for any damages
|
|
8
|
+
// arising from the use of this software.
|
|
9
|
+
//
|
|
10
|
+
// Permission is granted to anyone to use this software for any purpose,
|
|
11
|
+
// including commercial applications, and to alter it and redistribute it
|
|
12
|
+
// freely, subject to the following restrictions:
|
|
13
|
+
//
|
|
14
|
+
// 1. The origin of this software must not be misrepresented; you must not
|
|
15
|
+
// claim that you wrote the original software. If you use this software
|
|
16
|
+
// in a product, an acknowledgment in the product documentation would be
|
|
17
|
+
// appreciated but is not required.
|
|
18
|
+
// 2. Altered source versions must be plainly marked as such, and must not be
|
|
19
|
+
// misrepresented as being the original software.
|
|
20
|
+
// 3. This notice may not be removed or altered from any source distribution.
|
|
21
|
+
|
|
22
|
+
var utils = require('../utils/common');
|
|
23
|
+
var adler32 = require('./adler32');
|
|
24
|
+
var crc32 = require('./crc32');
|
|
25
|
+
var inflate_fast = require('./inffast');
|
|
26
|
+
var inflate_table = require('./inftrees');
|
|
27
|
+
|
|
28
|
+
var CODES = 0;
|
|
29
|
+
var LENS = 1;
|
|
30
|
+
var DISTS = 2;
|
|
31
|
+
|
|
32
|
+
/* Public constants ==========================================================*/
|
|
33
|
+
/* ===========================================================================*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/* Allowed flush values; see deflate() and inflate() below for details */
|
|
37
|
+
//var Z_NO_FLUSH = 0;
|
|
38
|
+
//var Z_PARTIAL_FLUSH = 1;
|
|
39
|
+
//var Z_SYNC_FLUSH = 2;
|
|
40
|
+
//var Z_FULL_FLUSH = 3;
|
|
41
|
+
var Z_FINISH = 4;
|
|
42
|
+
var Z_BLOCK = 5;
|
|
43
|
+
var Z_TREES = 6;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/* Return codes for the compression/decompression functions. Negative values
|
|
47
|
+
* are errors, positive values are used for special but normal events.
|
|
48
|
+
*/
|
|
49
|
+
var Z_OK = 0;
|
|
50
|
+
var Z_STREAM_END = 1;
|
|
51
|
+
var Z_NEED_DICT = 2;
|
|
52
|
+
//var Z_ERRNO = -1;
|
|
53
|
+
var Z_STREAM_ERROR = -2;
|
|
54
|
+
var Z_DATA_ERROR = -3;
|
|
55
|
+
var Z_MEM_ERROR = -4;
|
|
56
|
+
var Z_BUF_ERROR = -5;
|
|
57
|
+
//var Z_VERSION_ERROR = -6;
|
|
58
|
+
|
|
59
|
+
/* The deflate compression method */
|
|
60
|
+
var Z_DEFLATED = 8;
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* STATES ====================================================================*/
|
|
64
|
+
/* ===========================================================================*/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
var HEAD = 1; /* i: waiting for magic header */
|
|
68
|
+
var FLAGS = 2; /* i: waiting for method and flags (gzip) */
|
|
69
|
+
var TIME = 3; /* i: waiting for modification time (gzip) */
|
|
70
|
+
var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
|
|
71
|
+
var EXLEN = 5; /* i: waiting for extra length (gzip) */
|
|
72
|
+
var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
|
|
73
|
+
var NAME = 7; /* i: waiting for end of file name (gzip) */
|
|
74
|
+
var COMMENT = 8; /* i: waiting for end of comment (gzip) */
|
|
75
|
+
var HCRC = 9; /* i: waiting for header crc (gzip) */
|
|
76
|
+
var DICTID = 10; /* i: waiting for dictionary check value */
|
|
77
|
+
var DICT = 11; /* waiting for inflateSetDictionary() call */
|
|
78
|
+
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
|
|
79
|
+
var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
|
|
80
|
+
var STORED = 14; /* i: waiting for stored size (length and complement) */
|
|
81
|
+
var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
|
|
82
|
+
var COPY = 16; /* i/o: waiting for input or output to copy stored block */
|
|
83
|
+
var TABLE = 17; /* i: waiting for dynamic block table lengths */
|
|
84
|
+
var LENLENS = 18; /* i: waiting for code length code lengths */
|
|
85
|
+
var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
|
|
86
|
+
var LEN_ = 20; /* i: same as LEN below, but only first time in */
|
|
87
|
+
var LEN = 21; /* i: waiting for length/lit/eob code */
|
|
88
|
+
var LENEXT = 22; /* i: waiting for length extra bits */
|
|
89
|
+
var DIST = 23; /* i: waiting for distance code */
|
|
90
|
+
var DISTEXT = 24; /* i: waiting for distance extra bits */
|
|
91
|
+
var MATCH = 25; /* o: waiting for output space to copy string */
|
|
92
|
+
var LIT = 26; /* o: waiting for output space to write literal */
|
|
93
|
+
var CHECK = 27; /* i: waiting for 32-bit check value */
|
|
94
|
+
var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
|
|
95
|
+
var DONE = 29; /* finished check, done -- remain here until reset */
|
|
96
|
+
var BAD = 30; /* got a data error -- remain here until reset */
|
|
97
|
+
var MEM = 31; /* got an inflate() memory error -- remain here until reset */
|
|
98
|
+
var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
|
|
99
|
+
|
|
100
|
+
/* ===========================================================================*/
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
var ENOUGH_LENS = 852;
|
|
105
|
+
var ENOUGH_DISTS = 592;
|
|
106
|
+
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
|
|
107
|
+
|
|
108
|
+
var MAX_WBITS = 15;
|
|
109
|
+
/* 32K LZ77 window */
|
|
110
|
+
var DEF_WBITS = MAX_WBITS;
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
function zswap32(q) {
|
|
114
|
+
return (((q >>> 24) & 0xff) +
|
|
115
|
+
((q >>> 8) & 0xff00) +
|
|
116
|
+
((q & 0xff00) << 8) +
|
|
117
|
+
((q & 0xff) << 24));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
function InflateState() {
|
|
122
|
+
this.mode = 0; /* current inflate mode */
|
|
123
|
+
this.last = false; /* true if processing last block */
|
|
124
|
+
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
|
|
125
|
+
this.havedict = false; /* true if dictionary provided */
|
|
126
|
+
this.flags = 0; /* gzip header method and flags (0 if zlib) */
|
|
127
|
+
this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
|
|
128
|
+
this.check = 0; /* protected copy of check value */
|
|
129
|
+
this.total = 0; /* protected copy of output count */
|
|
130
|
+
// TODO: may be {}
|
|
131
|
+
this.head = null; /* where to save gzip header information */
|
|
132
|
+
|
|
133
|
+
/* sliding window */
|
|
134
|
+
this.wbits = 0; /* log base 2 of requested window size */
|
|
135
|
+
this.wsize = 0; /* window size or zero if not using window */
|
|
136
|
+
this.whave = 0; /* valid bytes in the window */
|
|
137
|
+
this.wnext = 0; /* window write index */
|
|
138
|
+
this.window = null; /* allocated sliding window, if needed */
|
|
139
|
+
|
|
140
|
+
/* bit accumulator */
|
|
141
|
+
this.hold = 0; /* input bit accumulator */
|
|
142
|
+
this.bits = 0; /* number of bits in "in" */
|
|
143
|
+
|
|
144
|
+
/* for string and stored block copying */
|
|
145
|
+
this.length = 0; /* literal or length of data to copy */
|
|
146
|
+
this.offset = 0; /* distance back to copy string from */
|
|
147
|
+
|
|
148
|
+
/* for table and code decoding */
|
|
149
|
+
this.extra = 0; /* extra bits needed */
|
|
150
|
+
|
|
151
|
+
/* fixed and dynamic code tables */
|
|
152
|
+
this.lencode = null; /* starting table for length/literal codes */
|
|
153
|
+
this.distcode = null; /* starting table for distance codes */
|
|
154
|
+
this.lenbits = 0; /* index bits for lencode */
|
|
155
|
+
this.distbits = 0; /* index bits for distcode */
|
|
156
|
+
|
|
157
|
+
/* dynamic table building */
|
|
158
|
+
this.ncode = 0; /* number of code length code lengths */
|
|
159
|
+
this.nlen = 0; /* number of length code lengths */
|
|
160
|
+
this.ndist = 0; /* number of distance code lengths */
|
|
161
|
+
this.have = 0; /* number of code lengths in lens[] */
|
|
162
|
+
this.next = null; /* next available space in codes[] */
|
|
163
|
+
|
|
164
|
+
this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
|
|
165
|
+
this.work = new utils.Buf16(288); /* work area for code table building */
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
because we don't have pointers in js, we use lencode and distcode directly
|
|
169
|
+
as buffers so we don't need codes
|
|
170
|
+
*/
|
|
171
|
+
//this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
|
|
172
|
+
this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
|
|
173
|
+
this.distdyn = null; /* dynamic table for distance codes (JS specific) */
|
|
174
|
+
this.sane = 0; /* if false, allow invalid distance too far */
|
|
175
|
+
this.back = 0; /* bits back of last unprocessed length/lit */
|
|
176
|
+
this.was = 0; /* initial length of match */
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function inflateResetKeep(strm) {
|
|
180
|
+
var state;
|
|
181
|
+
|
|
182
|
+
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
|
183
|
+
state = strm.state;
|
|
184
|
+
strm.total_in = strm.total_out = state.total = 0;
|
|
185
|
+
strm.msg = ''; /*Z_NULL*/
|
|
186
|
+
if (state.wrap) { /* to support ill-conceived Java test suite */
|
|
187
|
+
strm.adler = state.wrap & 1;
|
|
188
|
+
}
|
|
189
|
+
state.mode = HEAD;
|
|
190
|
+
state.last = 0;
|
|
191
|
+
state.havedict = 0;
|
|
192
|
+
state.dmax = 32768;
|
|
193
|
+
state.head = null/*Z_NULL*/;
|
|
194
|
+
state.hold = 0;
|
|
195
|
+
state.bits = 0;
|
|
196
|
+
//state.lencode = state.distcode = state.next = state.codes;
|
|
197
|
+
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
|
|
198
|
+
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
|
|
199
|
+
|
|
200
|
+
state.sane = 1;
|
|
201
|
+
state.back = -1;
|
|
202
|
+
//Tracev((stderr, "inflate: reset\n"));
|
|
203
|
+
return Z_OK;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function inflateReset(strm) {
|
|
207
|
+
var state;
|
|
208
|
+
|
|
209
|
+
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
|
210
|
+
state = strm.state;
|
|
211
|
+
state.wsize = 0;
|
|
212
|
+
state.whave = 0;
|
|
213
|
+
state.wnext = 0;
|
|
214
|
+
return inflateResetKeep(strm);
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function inflateReset2(strm, windowBits) {
|
|
219
|
+
var wrap;
|
|
220
|
+
var state;
|
|
221
|
+
|
|
222
|
+
/* get the state */
|
|
223
|
+
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
|
224
|
+
state = strm.state;
|
|
225
|
+
|
|
226
|
+
/* extract wrap request from windowBits parameter */
|
|
227
|
+
if (windowBits < 0) {
|
|
228
|
+
wrap = 0;
|
|
229
|
+
windowBits = -windowBits;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
wrap = (windowBits >> 4) + 1;
|
|
233
|
+
if (windowBits < 48) {
|
|
234
|
+
windowBits &= 15;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* set number of window bits, free window if different */
|
|
239
|
+
if (windowBits && (windowBits < 8 || windowBits > 15)) {
|
|
240
|
+
return Z_STREAM_ERROR;
|
|
241
|
+
}
|
|
242
|
+
if (state.window !== null && state.wbits !== windowBits) {
|
|
243
|
+
state.window = null;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* update state and reset the rest of it */
|
|
247
|
+
state.wrap = wrap;
|
|
248
|
+
state.wbits = windowBits;
|
|
249
|
+
return inflateReset(strm);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function inflateInit2(strm, windowBits) {
|
|
253
|
+
var ret;
|
|
254
|
+
var state;
|
|
255
|
+
|
|
256
|
+
if (!strm) { return Z_STREAM_ERROR; }
|
|
257
|
+
//strm.msg = Z_NULL; /* in case we return an error */
|
|
258
|
+
|
|
259
|
+
state = new InflateState();
|
|
260
|
+
|
|
261
|
+
//if (state === Z_NULL) return Z_MEM_ERROR;
|
|
262
|
+
//Tracev((stderr, "inflate: allocated\n"));
|
|
263
|
+
strm.state = state;
|
|
264
|
+
state.window = null/*Z_NULL*/;
|
|
265
|
+
ret = inflateReset2(strm, windowBits);
|
|
266
|
+
if (ret !== Z_OK) {
|
|
267
|
+
strm.state = null/*Z_NULL*/;
|
|
268
|
+
}
|
|
269
|
+
return ret;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function inflateInit(strm) {
|
|
273
|
+
return inflateInit2(strm, DEF_WBITS);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
/*
|
|
278
|
+
Return state with length and distance decoding tables and index sizes set to
|
|
279
|
+
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
|
280
|
+
If BUILDFIXED is defined, then instead this routine builds the tables the
|
|
281
|
+
first time it's called, and returns those tables the first time and
|
|
282
|
+
thereafter. This reduces the size of the code by about 2K bytes, in
|
|
283
|
+
exchange for a little execution time. However, BUILDFIXED should not be
|
|
284
|
+
used for threaded applications, since the rewriting of the tables and virgin
|
|
285
|
+
may not be thread-safe.
|
|
286
|
+
*/
|
|
287
|
+
var virgin = true;
|
|
288
|
+
|
|
289
|
+
var lenfix, distfix; // We have no pointers in JS, so keep tables separate
|
|
290
|
+
|
|
291
|
+
function fixedtables(state) {
|
|
292
|
+
/* build fixed huffman tables if first call (may not be thread safe) */
|
|
293
|
+
if (virgin) {
|
|
294
|
+
var sym;
|
|
295
|
+
|
|
296
|
+
lenfix = new utils.Buf32(512);
|
|
297
|
+
distfix = new utils.Buf32(32);
|
|
298
|
+
|
|
299
|
+
/* literal/length table */
|
|
300
|
+
sym = 0;
|
|
301
|
+
while (sym < 144) { state.lens[sym++] = 8; }
|
|
302
|
+
while (sym < 256) { state.lens[sym++] = 9; }
|
|
303
|
+
while (sym < 280) { state.lens[sym++] = 7; }
|
|
304
|
+
while (sym < 288) { state.lens[sym++] = 8; }
|
|
305
|
+
|
|
306
|
+
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
|
|
307
|
+
|
|
308
|
+
/* distance table */
|
|
309
|
+
sym = 0;
|
|
310
|
+
while (sym < 32) { state.lens[sym++] = 5; }
|
|
311
|
+
|
|
312
|
+
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
|
|
313
|
+
|
|
314
|
+
/* do this just once */
|
|
315
|
+
virgin = false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
state.lencode = lenfix;
|
|
319
|
+
state.lenbits = 9;
|
|
320
|
+
state.distcode = distfix;
|
|
321
|
+
state.distbits = 5;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
/*
|
|
326
|
+
Update the window with the last wsize (normally 32K) bytes written before
|
|
327
|
+
returning. If window does not exist yet, create it. This is only called
|
|
328
|
+
when a window is already in use, or when output has been written during this
|
|
329
|
+
inflate call, but the end of the deflate stream has not been reached yet.
|
|
330
|
+
It is also called to create a window for dictionary data when a dictionary
|
|
331
|
+
is loaded.
|
|
332
|
+
|
|
333
|
+
Providing output buffers larger than 32K to inflate() should provide a speed
|
|
334
|
+
advantage, since only the last 32K of output is copied to the sliding window
|
|
335
|
+
upon return from inflate(), and since all distances after the first 32K of
|
|
336
|
+
output will fall in the output data, making match copies simpler and faster.
|
|
337
|
+
The advantage may be dependent on the size of the processor's data caches.
|
|
338
|
+
*/
|
|
339
|
+
function updatewindow(strm, src, end, copy) {
|
|
340
|
+
var dist;
|
|
341
|
+
var state = strm.state;
|
|
342
|
+
|
|
343
|
+
/* if it hasn't been done already, allocate space for the window */
|
|
344
|
+
if (state.window === null) {
|
|
345
|
+
state.wsize = 1 << state.wbits;
|
|
346
|
+
state.wnext = 0;
|
|
347
|
+
state.whave = 0;
|
|
348
|
+
|
|
349
|
+
state.window = new utils.Buf8(state.wsize);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* copy state->wsize or less output bytes into the circular window */
|
|
353
|
+
if (copy >= state.wsize) {
|
|
354
|
+
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
|
|
355
|
+
state.wnext = 0;
|
|
356
|
+
state.whave = state.wsize;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
dist = state.wsize - state.wnext;
|
|
360
|
+
if (dist > copy) {
|
|
361
|
+
dist = copy;
|
|
362
|
+
}
|
|
363
|
+
//zmemcpy(state->window + state->wnext, end - copy, dist);
|
|
364
|
+
utils.arraySet(state.window, src, end - copy, dist, state.wnext);
|
|
365
|
+
copy -= dist;
|
|
366
|
+
if (copy) {
|
|
367
|
+
//zmemcpy(state->window, end - copy, copy);
|
|
368
|
+
utils.arraySet(state.window, src, end - copy, copy, 0);
|
|
369
|
+
state.wnext = copy;
|
|
370
|
+
state.whave = state.wsize;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
state.wnext += dist;
|
|
374
|
+
if (state.wnext === state.wsize) { state.wnext = 0; }
|
|
375
|
+
if (state.whave < state.wsize) { state.whave += dist; }
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return 0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function inflate(strm, flush) {
|
|
382
|
+
var state;
|
|
383
|
+
var input, output; // input/output buffers
|
|
384
|
+
var next; /* next input INDEX */
|
|
385
|
+
var put; /* next output INDEX */
|
|
386
|
+
var have, left; /* available input and output */
|
|
387
|
+
var hold; /* bit buffer */
|
|
388
|
+
var bits; /* bits in bit buffer */
|
|
389
|
+
var _in, _out; /* save starting available input and output */
|
|
390
|
+
var copy; /* number of stored or match bytes to copy */
|
|
391
|
+
var from; /* where to copy match bytes from */
|
|
392
|
+
var from_source;
|
|
393
|
+
var here = 0; /* current decoding table entry */
|
|
394
|
+
var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
|
|
395
|
+
//var last; /* parent table entry */
|
|
396
|
+
var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
|
|
397
|
+
var len; /* length to copy for repeats, bits to drop */
|
|
398
|
+
var ret; /* return code */
|
|
399
|
+
var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
|
|
400
|
+
var opts;
|
|
401
|
+
|
|
402
|
+
var n; // temporary var for NEED_BITS
|
|
403
|
+
|
|
404
|
+
var order = /* permutation of code lengths */
|
|
405
|
+
[ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
if (!strm || !strm.state || !strm.output ||
|
|
409
|
+
(!strm.input && strm.avail_in !== 0)) {
|
|
410
|
+
return Z_STREAM_ERROR;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
state = strm.state;
|
|
414
|
+
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
//--- LOAD() ---
|
|
418
|
+
put = strm.next_out;
|
|
419
|
+
output = strm.output;
|
|
420
|
+
left = strm.avail_out;
|
|
421
|
+
next = strm.next_in;
|
|
422
|
+
input = strm.input;
|
|
423
|
+
have = strm.avail_in;
|
|
424
|
+
hold = state.hold;
|
|
425
|
+
bits = state.bits;
|
|
426
|
+
//---
|
|
427
|
+
|
|
428
|
+
_in = have;
|
|
429
|
+
_out = left;
|
|
430
|
+
ret = Z_OK;
|
|
431
|
+
|
|
432
|
+
inf_leave: // goto emulation
|
|
433
|
+
for (;;) {
|
|
434
|
+
switch (state.mode) {
|
|
435
|
+
case HEAD:
|
|
436
|
+
if (state.wrap === 0) {
|
|
437
|
+
state.mode = TYPEDO;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
//=== NEEDBITS(16);
|
|
441
|
+
while (bits < 16) {
|
|
442
|
+
if (have === 0) { break inf_leave; }
|
|
443
|
+
have--;
|
|
444
|
+
hold += input[next++] << bits;
|
|
445
|
+
bits += 8;
|
|
446
|
+
}
|
|
447
|
+
//===//
|
|
448
|
+
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
|
|
449
|
+
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
|
|
450
|
+
//=== CRC2(state.check, hold);
|
|
451
|
+
hbuf[0] = hold & 0xff;
|
|
452
|
+
hbuf[1] = (hold >>> 8) & 0xff;
|
|
453
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
454
|
+
//===//
|
|
455
|
+
|
|
456
|
+
//=== INITBITS();
|
|
457
|
+
hold = 0;
|
|
458
|
+
bits = 0;
|
|
459
|
+
//===//
|
|
460
|
+
state.mode = FLAGS;
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
state.flags = 0; /* expect zlib header */
|
|
464
|
+
if (state.head) {
|
|
465
|
+
state.head.done = false;
|
|
466
|
+
}
|
|
467
|
+
if (!(state.wrap & 1) || /* check if zlib header allowed */
|
|
468
|
+
(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
|
|
469
|
+
strm.msg = 'incorrect header check';
|
|
470
|
+
state.mode = BAD;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
|
|
474
|
+
strm.msg = 'unknown compression method';
|
|
475
|
+
state.mode = BAD;
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
//--- DROPBITS(4) ---//
|
|
479
|
+
hold >>>= 4;
|
|
480
|
+
bits -= 4;
|
|
481
|
+
//---//
|
|
482
|
+
len = (hold & 0x0f)/*BITS(4)*/ + 8;
|
|
483
|
+
if (state.wbits === 0) {
|
|
484
|
+
state.wbits = len;
|
|
485
|
+
}
|
|
486
|
+
else if (len > state.wbits) {
|
|
487
|
+
strm.msg = 'invalid window size';
|
|
488
|
+
state.mode = BAD;
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
state.dmax = 1 << len;
|
|
492
|
+
//Tracev((stderr, "inflate: zlib header ok\n"));
|
|
493
|
+
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
|
|
494
|
+
state.mode = hold & 0x200 ? DICTID : TYPE;
|
|
495
|
+
//=== INITBITS();
|
|
496
|
+
hold = 0;
|
|
497
|
+
bits = 0;
|
|
498
|
+
//===//
|
|
499
|
+
break;
|
|
500
|
+
case FLAGS:
|
|
501
|
+
//=== NEEDBITS(16); */
|
|
502
|
+
while (bits < 16) {
|
|
503
|
+
if (have === 0) { break inf_leave; }
|
|
504
|
+
have--;
|
|
505
|
+
hold += input[next++] << bits;
|
|
506
|
+
bits += 8;
|
|
507
|
+
}
|
|
508
|
+
//===//
|
|
509
|
+
state.flags = hold;
|
|
510
|
+
if ((state.flags & 0xff) !== Z_DEFLATED) {
|
|
511
|
+
strm.msg = 'unknown compression method';
|
|
512
|
+
state.mode = BAD;
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
if (state.flags & 0xe000) {
|
|
516
|
+
strm.msg = 'unknown header flags set';
|
|
517
|
+
state.mode = BAD;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
if (state.head) {
|
|
521
|
+
state.head.text = ((hold >> 8) & 1);
|
|
522
|
+
}
|
|
523
|
+
if (state.flags & 0x0200) {
|
|
524
|
+
//=== CRC2(state.check, hold);
|
|
525
|
+
hbuf[0] = hold & 0xff;
|
|
526
|
+
hbuf[1] = (hold >>> 8) & 0xff;
|
|
527
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
528
|
+
//===//
|
|
529
|
+
}
|
|
530
|
+
//=== INITBITS();
|
|
531
|
+
hold = 0;
|
|
532
|
+
bits = 0;
|
|
533
|
+
//===//
|
|
534
|
+
state.mode = TIME;
|
|
535
|
+
/* falls through */
|
|
536
|
+
case TIME:
|
|
537
|
+
//=== NEEDBITS(32); */
|
|
538
|
+
while (bits < 32) {
|
|
539
|
+
if (have === 0) { break inf_leave; }
|
|
540
|
+
have--;
|
|
541
|
+
hold += input[next++] << bits;
|
|
542
|
+
bits += 8;
|
|
543
|
+
}
|
|
544
|
+
//===//
|
|
545
|
+
if (state.head) {
|
|
546
|
+
state.head.time = hold;
|
|
547
|
+
}
|
|
548
|
+
if (state.flags & 0x0200) {
|
|
549
|
+
//=== CRC4(state.check, hold)
|
|
550
|
+
hbuf[0] = hold & 0xff;
|
|
551
|
+
hbuf[1] = (hold >>> 8) & 0xff;
|
|
552
|
+
hbuf[2] = (hold >>> 16) & 0xff;
|
|
553
|
+
hbuf[3] = (hold >>> 24) & 0xff;
|
|
554
|
+
state.check = crc32(state.check, hbuf, 4, 0);
|
|
555
|
+
//===
|
|
556
|
+
}
|
|
557
|
+
//=== INITBITS();
|
|
558
|
+
hold = 0;
|
|
559
|
+
bits = 0;
|
|
560
|
+
//===//
|
|
561
|
+
state.mode = OS;
|
|
562
|
+
/* falls through */
|
|
563
|
+
case OS:
|
|
564
|
+
//=== NEEDBITS(16); */
|
|
565
|
+
while (bits < 16) {
|
|
566
|
+
if (have === 0) { break inf_leave; }
|
|
567
|
+
have--;
|
|
568
|
+
hold += input[next++] << bits;
|
|
569
|
+
bits += 8;
|
|
570
|
+
}
|
|
571
|
+
//===//
|
|
572
|
+
if (state.head) {
|
|
573
|
+
state.head.xflags = (hold & 0xff);
|
|
574
|
+
state.head.os = (hold >> 8);
|
|
575
|
+
}
|
|
576
|
+
if (state.flags & 0x0200) {
|
|
577
|
+
//=== CRC2(state.check, hold);
|
|
578
|
+
hbuf[0] = hold & 0xff;
|
|
579
|
+
hbuf[1] = (hold >>> 8) & 0xff;
|
|
580
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
581
|
+
//===//
|
|
582
|
+
}
|
|
583
|
+
//=== INITBITS();
|
|
584
|
+
hold = 0;
|
|
585
|
+
bits = 0;
|
|
586
|
+
//===//
|
|
587
|
+
state.mode = EXLEN;
|
|
588
|
+
/* falls through */
|
|
589
|
+
case EXLEN:
|
|
590
|
+
if (state.flags & 0x0400) {
|
|
591
|
+
//=== NEEDBITS(16); */
|
|
592
|
+
while (bits < 16) {
|
|
593
|
+
if (have === 0) { break inf_leave; }
|
|
594
|
+
have--;
|
|
595
|
+
hold += input[next++] << bits;
|
|
596
|
+
bits += 8;
|
|
597
|
+
}
|
|
598
|
+
//===//
|
|
599
|
+
state.length = hold;
|
|
600
|
+
if (state.head) {
|
|
601
|
+
state.head.extra_len = hold;
|
|
602
|
+
}
|
|
603
|
+
if (state.flags & 0x0200) {
|
|
604
|
+
//=== CRC2(state.check, hold);
|
|
605
|
+
hbuf[0] = hold & 0xff;
|
|
606
|
+
hbuf[1] = (hold >>> 8) & 0xff;
|
|
607
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
608
|
+
//===//
|
|
609
|
+
}
|
|
610
|
+
//=== INITBITS();
|
|
611
|
+
hold = 0;
|
|
612
|
+
bits = 0;
|
|
613
|
+
//===//
|
|
614
|
+
}
|
|
615
|
+
else if (state.head) {
|
|
616
|
+
state.head.extra = null/*Z_NULL*/;
|
|
617
|
+
}
|
|
618
|
+
state.mode = EXTRA;
|
|
619
|
+
/* falls through */
|
|
620
|
+
case EXTRA:
|
|
621
|
+
if (state.flags & 0x0400) {
|
|
622
|
+
copy = state.length;
|
|
623
|
+
if (copy > have) { copy = have; }
|
|
624
|
+
if (copy) {
|
|
625
|
+
if (state.head) {
|
|
626
|
+
len = state.head.extra_len - state.length;
|
|
627
|
+
if (!state.head.extra) {
|
|
628
|
+
// Use untyped array for more convenient processing later
|
|
629
|
+
state.head.extra = new Array(state.head.extra_len);
|
|
630
|
+
}
|
|
631
|
+
utils.arraySet(
|
|
632
|
+
state.head.extra,
|
|
633
|
+
input,
|
|
634
|
+
next,
|
|
635
|
+
// extra field is limited to 65536 bytes
|
|
636
|
+
// - no need for additional size check
|
|
637
|
+
copy,
|
|
638
|
+
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
|
639
|
+
len
|
|
640
|
+
);
|
|
641
|
+
//zmemcpy(state.head.extra + len, next,
|
|
642
|
+
// len + copy > state.head.extra_max ?
|
|
643
|
+
// state.head.extra_max - len : copy);
|
|
644
|
+
}
|
|
645
|
+
if (state.flags & 0x0200) {
|
|
646
|
+
state.check = crc32(state.check, input, copy, next);
|
|
647
|
+
}
|
|
648
|
+
have -= copy;
|
|
649
|
+
next += copy;
|
|
650
|
+
state.length -= copy;
|
|
651
|
+
}
|
|
652
|
+
if (state.length) { break inf_leave; }
|
|
653
|
+
}
|
|
654
|
+
state.length = 0;
|
|
655
|
+
state.mode = NAME;
|
|
656
|
+
/* falls through */
|
|
657
|
+
case NAME:
|
|
658
|
+
if (state.flags & 0x0800) {
|
|
659
|
+
if (have === 0) { break inf_leave; }
|
|
660
|
+
copy = 0;
|
|
661
|
+
do {
|
|
662
|
+
// TODO: 2 or 1 bytes?
|
|
663
|
+
len = input[next + copy++];
|
|
664
|
+
/* use constant limit because in js we should not preallocate memory */
|
|
665
|
+
if (state.head && len &&
|
|
666
|
+
(state.length < 65536 /*state.head.name_max*/)) {
|
|
667
|
+
state.head.name += String.fromCharCode(len);
|
|
668
|
+
}
|
|
669
|
+
} while (len && copy < have);
|
|
670
|
+
|
|
671
|
+
if (state.flags & 0x0200) {
|
|
672
|
+
state.check = crc32(state.check, input, copy, next);
|
|
673
|
+
}
|
|
674
|
+
have -= copy;
|
|
675
|
+
next += copy;
|
|
676
|
+
if (len) { break inf_leave; }
|
|
677
|
+
}
|
|
678
|
+
else if (state.head) {
|
|
679
|
+
state.head.name = null;
|
|
680
|
+
}
|
|
681
|
+
state.length = 0;
|
|
682
|
+
state.mode = COMMENT;
|
|
683
|
+
/* falls through */
|
|
684
|
+
case COMMENT:
|
|
685
|
+
if (state.flags & 0x1000) {
|
|
686
|
+
if (have === 0) { break inf_leave; }
|
|
687
|
+
copy = 0;
|
|
688
|
+
do {
|
|
689
|
+
len = input[next + copy++];
|
|
690
|
+
/* use constant limit because in js we should not preallocate memory */
|
|
691
|
+
if (state.head && len &&
|
|
692
|
+
(state.length < 65536 /*state.head.comm_max*/)) {
|
|
693
|
+
state.head.comment += String.fromCharCode(len);
|
|
694
|
+
}
|
|
695
|
+
} while (len && copy < have);
|
|
696
|
+
if (state.flags & 0x0200) {
|
|
697
|
+
state.check = crc32(state.check, input, copy, next);
|
|
698
|
+
}
|
|
699
|
+
have -= copy;
|
|
700
|
+
next += copy;
|
|
701
|
+
if (len) { break inf_leave; }
|
|
702
|
+
}
|
|
703
|
+
else if (state.head) {
|
|
704
|
+
state.head.comment = null;
|
|
705
|
+
}
|
|
706
|
+
state.mode = HCRC;
|
|
707
|
+
/* falls through */
|
|
708
|
+
case HCRC:
|
|
709
|
+
if (state.flags & 0x0200) {
|
|
710
|
+
//=== NEEDBITS(16); */
|
|
711
|
+
while (bits < 16) {
|
|
712
|
+
if (have === 0) { break inf_leave; }
|
|
713
|
+
have--;
|
|
714
|
+
hold += input[next++] << bits;
|
|
715
|
+
bits += 8;
|
|
716
|
+
}
|
|
717
|
+
//===//
|
|
718
|
+
if (hold !== (state.check & 0xffff)) {
|
|
719
|
+
strm.msg = 'header crc mismatch';
|
|
720
|
+
state.mode = BAD;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
//=== INITBITS();
|
|
724
|
+
hold = 0;
|
|
725
|
+
bits = 0;
|
|
726
|
+
//===//
|
|
727
|
+
}
|
|
728
|
+
if (state.head) {
|
|
729
|
+
state.head.hcrc = ((state.flags >> 9) & 1);
|
|
730
|
+
state.head.done = true;
|
|
731
|
+
}
|
|
732
|
+
strm.adler = state.check = 0;
|
|
733
|
+
state.mode = TYPE;
|
|
734
|
+
break;
|
|
735
|
+
case DICTID:
|
|
736
|
+
//=== NEEDBITS(32); */
|
|
737
|
+
while (bits < 32) {
|
|
738
|
+
if (have === 0) { break inf_leave; }
|
|
739
|
+
have--;
|
|
740
|
+
hold += input[next++] << bits;
|
|
741
|
+
bits += 8;
|
|
742
|
+
}
|
|
743
|
+
//===//
|
|
744
|
+
strm.adler = state.check = zswap32(hold);
|
|
745
|
+
//=== INITBITS();
|
|
746
|
+
hold = 0;
|
|
747
|
+
bits = 0;
|
|
748
|
+
//===//
|
|
749
|
+
state.mode = DICT;
|
|
750
|
+
/* falls through */
|
|
751
|
+
case DICT:
|
|
752
|
+
if (state.havedict === 0) {
|
|
753
|
+
//--- RESTORE() ---
|
|
754
|
+
strm.next_out = put;
|
|
755
|
+
strm.avail_out = left;
|
|
756
|
+
strm.next_in = next;
|
|
757
|
+
strm.avail_in = have;
|
|
758
|
+
state.hold = hold;
|
|
759
|
+
state.bits = bits;
|
|
760
|
+
//---
|
|
761
|
+
return Z_NEED_DICT;
|
|
762
|
+
}
|
|
763
|
+
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
|
|
764
|
+
state.mode = TYPE;
|
|
765
|
+
/* falls through */
|
|
766
|
+
case TYPE:
|
|
767
|
+
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
|
|
768
|
+
/* falls through */
|
|
769
|
+
case TYPEDO:
|
|
770
|
+
if (state.last) {
|
|
771
|
+
//--- BYTEBITS() ---//
|
|
772
|
+
hold >>>= bits & 7;
|
|
773
|
+
bits -= bits & 7;
|
|
774
|
+
//---//
|
|
775
|
+
state.mode = CHECK;
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
//=== NEEDBITS(3); */
|
|
779
|
+
while (bits < 3) {
|
|
780
|
+
if (have === 0) { break inf_leave; }
|
|
781
|
+
have--;
|
|
782
|
+
hold += input[next++] << bits;
|
|
783
|
+
bits += 8;
|
|
784
|
+
}
|
|
785
|
+
//===//
|
|
786
|
+
state.last = (hold & 0x01)/*BITS(1)*/;
|
|
787
|
+
//--- DROPBITS(1) ---//
|
|
788
|
+
hold >>>= 1;
|
|
789
|
+
bits -= 1;
|
|
790
|
+
//---//
|
|
791
|
+
|
|
792
|
+
switch ((hold & 0x03)/*BITS(2)*/) {
|
|
793
|
+
case 0: /* stored block */
|
|
794
|
+
//Tracev((stderr, "inflate: stored block%s\n",
|
|
795
|
+
// state.last ? " (last)" : ""));
|
|
796
|
+
state.mode = STORED;
|
|
797
|
+
break;
|
|
798
|
+
case 1: /* fixed block */
|
|
799
|
+
fixedtables(state);
|
|
800
|
+
//Tracev((stderr, "inflate: fixed codes block%s\n",
|
|
801
|
+
// state.last ? " (last)" : ""));
|
|
802
|
+
state.mode = LEN_; /* decode codes */
|
|
803
|
+
if (flush === Z_TREES) {
|
|
804
|
+
//--- DROPBITS(2) ---//
|
|
805
|
+
hold >>>= 2;
|
|
806
|
+
bits -= 2;
|
|
807
|
+
//---//
|
|
808
|
+
break inf_leave;
|
|
809
|
+
}
|
|
810
|
+
break;
|
|
811
|
+
case 2: /* dynamic block */
|
|
812
|
+
//Tracev((stderr, "inflate: dynamic codes block%s\n",
|
|
813
|
+
// state.last ? " (last)" : ""));
|
|
814
|
+
state.mode = TABLE;
|
|
815
|
+
break;
|
|
816
|
+
case 3:
|
|
817
|
+
strm.msg = 'invalid block type';
|
|
818
|
+
state.mode = BAD;
|
|
819
|
+
}
|
|
820
|
+
//--- DROPBITS(2) ---//
|
|
821
|
+
hold >>>= 2;
|
|
822
|
+
bits -= 2;
|
|
823
|
+
//---//
|
|
824
|
+
break;
|
|
825
|
+
case STORED:
|
|
826
|
+
//--- BYTEBITS() ---// /* go to byte boundary */
|
|
827
|
+
hold >>>= bits & 7;
|
|
828
|
+
bits -= bits & 7;
|
|
829
|
+
//---//
|
|
830
|
+
//=== NEEDBITS(32); */
|
|
831
|
+
while (bits < 32) {
|
|
832
|
+
if (have === 0) { break inf_leave; }
|
|
833
|
+
have--;
|
|
834
|
+
hold += input[next++] << bits;
|
|
835
|
+
bits += 8;
|
|
836
|
+
}
|
|
837
|
+
//===//
|
|
838
|
+
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
|
|
839
|
+
strm.msg = 'invalid stored block lengths';
|
|
840
|
+
state.mode = BAD;
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
state.length = hold & 0xffff;
|
|
844
|
+
//Tracev((stderr, "inflate: stored length %u\n",
|
|
845
|
+
// state.length));
|
|
846
|
+
//=== INITBITS();
|
|
847
|
+
hold = 0;
|
|
848
|
+
bits = 0;
|
|
849
|
+
//===//
|
|
850
|
+
state.mode = COPY_;
|
|
851
|
+
if (flush === Z_TREES) { break inf_leave; }
|
|
852
|
+
/* falls through */
|
|
853
|
+
case COPY_:
|
|
854
|
+
state.mode = COPY;
|
|
855
|
+
/* falls through */
|
|
856
|
+
case COPY:
|
|
857
|
+
copy = state.length;
|
|
858
|
+
if (copy) {
|
|
859
|
+
if (copy > have) { copy = have; }
|
|
860
|
+
if (copy > left) { copy = left; }
|
|
861
|
+
if (copy === 0) { break inf_leave; }
|
|
862
|
+
//--- zmemcpy(put, next, copy); ---
|
|
863
|
+
utils.arraySet(output, input, next, copy, put);
|
|
864
|
+
//---//
|
|
865
|
+
have -= copy;
|
|
866
|
+
next += copy;
|
|
867
|
+
left -= copy;
|
|
868
|
+
put += copy;
|
|
869
|
+
state.length -= copy;
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
//Tracev((stderr, "inflate: stored end\n"));
|
|
873
|
+
state.mode = TYPE;
|
|
874
|
+
break;
|
|
875
|
+
case TABLE:
|
|
876
|
+
//=== NEEDBITS(14); */
|
|
877
|
+
while (bits < 14) {
|
|
878
|
+
if (have === 0) { break inf_leave; }
|
|
879
|
+
have--;
|
|
880
|
+
hold += input[next++] << bits;
|
|
881
|
+
bits += 8;
|
|
882
|
+
}
|
|
883
|
+
//===//
|
|
884
|
+
state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
|
|
885
|
+
//--- DROPBITS(5) ---//
|
|
886
|
+
hold >>>= 5;
|
|
887
|
+
bits -= 5;
|
|
888
|
+
//---//
|
|
889
|
+
state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
|
|
890
|
+
//--- DROPBITS(5) ---//
|
|
891
|
+
hold >>>= 5;
|
|
892
|
+
bits -= 5;
|
|
893
|
+
//---//
|
|
894
|
+
state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
|
|
895
|
+
//--- DROPBITS(4) ---//
|
|
896
|
+
hold >>>= 4;
|
|
897
|
+
bits -= 4;
|
|
898
|
+
//---//
|
|
899
|
+
//#ifndef PKZIP_BUG_WORKAROUND
|
|
900
|
+
if (state.nlen > 286 || state.ndist > 30) {
|
|
901
|
+
strm.msg = 'too many length or distance symbols';
|
|
902
|
+
state.mode = BAD;
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
//#endif
|
|
906
|
+
//Tracev((stderr, "inflate: table sizes ok\n"));
|
|
907
|
+
state.have = 0;
|
|
908
|
+
state.mode = LENLENS;
|
|
909
|
+
/* falls through */
|
|
910
|
+
case LENLENS:
|
|
911
|
+
while (state.have < state.ncode) {
|
|
912
|
+
//=== NEEDBITS(3);
|
|
913
|
+
while (bits < 3) {
|
|
914
|
+
if (have === 0) { break inf_leave; }
|
|
915
|
+
have--;
|
|
916
|
+
hold += input[next++] << bits;
|
|
917
|
+
bits += 8;
|
|
918
|
+
}
|
|
919
|
+
//===//
|
|
920
|
+
state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
|
|
921
|
+
//--- DROPBITS(3) ---//
|
|
922
|
+
hold >>>= 3;
|
|
923
|
+
bits -= 3;
|
|
924
|
+
//---//
|
|
925
|
+
}
|
|
926
|
+
while (state.have < 19) {
|
|
927
|
+
state.lens[order[state.have++]] = 0;
|
|
928
|
+
}
|
|
929
|
+
// We have separate tables & no pointers. 2 commented lines below not needed.
|
|
930
|
+
//state.next = state.codes;
|
|
931
|
+
//state.lencode = state.next;
|
|
932
|
+
// Switch to use dynamic table
|
|
933
|
+
state.lencode = state.lendyn;
|
|
934
|
+
state.lenbits = 7;
|
|
935
|
+
|
|
936
|
+
opts = { bits: state.lenbits };
|
|
937
|
+
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
|
|
938
|
+
state.lenbits = opts.bits;
|
|
939
|
+
|
|
940
|
+
if (ret) {
|
|
941
|
+
strm.msg = 'invalid code lengths set';
|
|
942
|
+
state.mode = BAD;
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
//Tracev((stderr, "inflate: code lengths ok\n"));
|
|
946
|
+
state.have = 0;
|
|
947
|
+
state.mode = CODELENS;
|
|
948
|
+
/* falls through */
|
|
949
|
+
case CODELENS:
|
|
950
|
+
while (state.have < state.nlen + state.ndist) {
|
|
951
|
+
for (;;) {
|
|
952
|
+
here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
|
|
953
|
+
here_bits = here >>> 24;
|
|
954
|
+
here_op = (here >>> 16) & 0xff;
|
|
955
|
+
here_val = here & 0xffff;
|
|
956
|
+
|
|
957
|
+
if ((here_bits) <= bits) { break; }
|
|
958
|
+
//--- PULLBYTE() ---//
|
|
959
|
+
if (have === 0) { break inf_leave; }
|
|
960
|
+
have--;
|
|
961
|
+
hold += input[next++] << bits;
|
|
962
|
+
bits += 8;
|
|
963
|
+
//---//
|
|
964
|
+
}
|
|
965
|
+
if (here_val < 16) {
|
|
966
|
+
//--- DROPBITS(here.bits) ---//
|
|
967
|
+
hold >>>= here_bits;
|
|
968
|
+
bits -= here_bits;
|
|
969
|
+
//---//
|
|
970
|
+
state.lens[state.have++] = here_val;
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
if (here_val === 16) {
|
|
974
|
+
//=== NEEDBITS(here.bits + 2);
|
|
975
|
+
n = here_bits + 2;
|
|
976
|
+
while (bits < n) {
|
|
977
|
+
if (have === 0) { break inf_leave; }
|
|
978
|
+
have--;
|
|
979
|
+
hold += input[next++] << bits;
|
|
980
|
+
bits += 8;
|
|
981
|
+
}
|
|
982
|
+
//===//
|
|
983
|
+
//--- DROPBITS(here.bits) ---//
|
|
984
|
+
hold >>>= here_bits;
|
|
985
|
+
bits -= here_bits;
|
|
986
|
+
//---//
|
|
987
|
+
if (state.have === 0) {
|
|
988
|
+
strm.msg = 'invalid bit length repeat';
|
|
989
|
+
state.mode = BAD;
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
len = state.lens[state.have - 1];
|
|
993
|
+
copy = 3 + (hold & 0x03);//BITS(2);
|
|
994
|
+
//--- DROPBITS(2) ---//
|
|
995
|
+
hold >>>= 2;
|
|
996
|
+
bits -= 2;
|
|
997
|
+
//---//
|
|
998
|
+
}
|
|
999
|
+
else if (here_val === 17) {
|
|
1000
|
+
//=== NEEDBITS(here.bits + 3);
|
|
1001
|
+
n = here_bits + 3;
|
|
1002
|
+
while (bits < n) {
|
|
1003
|
+
if (have === 0) { break inf_leave; }
|
|
1004
|
+
have--;
|
|
1005
|
+
hold += input[next++] << bits;
|
|
1006
|
+
bits += 8;
|
|
1007
|
+
}
|
|
1008
|
+
//===//
|
|
1009
|
+
//--- DROPBITS(here.bits) ---//
|
|
1010
|
+
hold >>>= here_bits;
|
|
1011
|
+
bits -= here_bits;
|
|
1012
|
+
//---//
|
|
1013
|
+
len = 0;
|
|
1014
|
+
copy = 3 + (hold & 0x07);//BITS(3);
|
|
1015
|
+
//--- DROPBITS(3) ---//
|
|
1016
|
+
hold >>>= 3;
|
|
1017
|
+
bits -= 3;
|
|
1018
|
+
//---//
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
//=== NEEDBITS(here.bits + 7);
|
|
1022
|
+
n = here_bits + 7;
|
|
1023
|
+
while (bits < n) {
|
|
1024
|
+
if (have === 0) { break inf_leave; }
|
|
1025
|
+
have--;
|
|
1026
|
+
hold += input[next++] << bits;
|
|
1027
|
+
bits += 8;
|
|
1028
|
+
}
|
|
1029
|
+
//===//
|
|
1030
|
+
//--- DROPBITS(here.bits) ---//
|
|
1031
|
+
hold >>>= here_bits;
|
|
1032
|
+
bits -= here_bits;
|
|
1033
|
+
//---//
|
|
1034
|
+
len = 0;
|
|
1035
|
+
copy = 11 + (hold & 0x7f);//BITS(7);
|
|
1036
|
+
//--- DROPBITS(7) ---//
|
|
1037
|
+
hold >>>= 7;
|
|
1038
|
+
bits -= 7;
|
|
1039
|
+
//---//
|
|
1040
|
+
}
|
|
1041
|
+
if (state.have + copy > state.nlen + state.ndist) {
|
|
1042
|
+
strm.msg = 'invalid bit length repeat';
|
|
1043
|
+
state.mode = BAD;
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
while (copy--) {
|
|
1047
|
+
state.lens[state.have++] = len;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/* handle error breaks in while */
|
|
1053
|
+
if (state.mode === BAD) { break; }
|
|
1054
|
+
|
|
1055
|
+
/* check for end-of-block code (better have one) */
|
|
1056
|
+
if (state.lens[256] === 0) {
|
|
1057
|
+
strm.msg = 'invalid code -- missing end-of-block';
|
|
1058
|
+
state.mode = BAD;
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/* build code tables -- note: do not change the lenbits or distbits
|
|
1063
|
+
values here (9 and 6) without reading the comments in inftrees.h
|
|
1064
|
+
concerning the ENOUGH constants, which depend on those values */
|
|
1065
|
+
state.lenbits = 9;
|
|
1066
|
+
|
|
1067
|
+
opts = { bits: state.lenbits };
|
|
1068
|
+
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
|
|
1069
|
+
// We have separate tables & no pointers. 2 commented lines below not needed.
|
|
1070
|
+
// state.next_index = opts.table_index;
|
|
1071
|
+
state.lenbits = opts.bits;
|
|
1072
|
+
// state.lencode = state.next;
|
|
1073
|
+
|
|
1074
|
+
if (ret) {
|
|
1075
|
+
strm.msg = 'invalid literal/lengths set';
|
|
1076
|
+
state.mode = BAD;
|
|
1077
|
+
break;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
state.distbits = 6;
|
|
1081
|
+
//state.distcode.copy(state.codes);
|
|
1082
|
+
// Switch to use dynamic table
|
|
1083
|
+
state.distcode = state.distdyn;
|
|
1084
|
+
opts = { bits: state.distbits };
|
|
1085
|
+
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
|
|
1086
|
+
// We have separate tables & no pointers. 2 commented lines below not needed.
|
|
1087
|
+
// state.next_index = opts.table_index;
|
|
1088
|
+
state.distbits = opts.bits;
|
|
1089
|
+
// state.distcode = state.next;
|
|
1090
|
+
|
|
1091
|
+
if (ret) {
|
|
1092
|
+
strm.msg = 'invalid distances set';
|
|
1093
|
+
state.mode = BAD;
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
//Tracev((stderr, 'inflate: codes ok\n'));
|
|
1097
|
+
state.mode = LEN_;
|
|
1098
|
+
if (flush === Z_TREES) { break inf_leave; }
|
|
1099
|
+
/* falls through */
|
|
1100
|
+
case LEN_:
|
|
1101
|
+
state.mode = LEN;
|
|
1102
|
+
/* falls through */
|
|
1103
|
+
case LEN:
|
|
1104
|
+
if (have >= 6 && left >= 258) {
|
|
1105
|
+
//--- RESTORE() ---
|
|
1106
|
+
strm.next_out = put;
|
|
1107
|
+
strm.avail_out = left;
|
|
1108
|
+
strm.next_in = next;
|
|
1109
|
+
strm.avail_in = have;
|
|
1110
|
+
state.hold = hold;
|
|
1111
|
+
state.bits = bits;
|
|
1112
|
+
//---
|
|
1113
|
+
inflate_fast(strm, _out);
|
|
1114
|
+
//--- LOAD() ---
|
|
1115
|
+
put = strm.next_out;
|
|
1116
|
+
output = strm.output;
|
|
1117
|
+
left = strm.avail_out;
|
|
1118
|
+
next = strm.next_in;
|
|
1119
|
+
input = strm.input;
|
|
1120
|
+
have = strm.avail_in;
|
|
1121
|
+
hold = state.hold;
|
|
1122
|
+
bits = state.bits;
|
|
1123
|
+
//---
|
|
1124
|
+
|
|
1125
|
+
if (state.mode === TYPE) {
|
|
1126
|
+
state.back = -1;
|
|
1127
|
+
}
|
|
1128
|
+
break;
|
|
1129
|
+
}
|
|
1130
|
+
state.back = 0;
|
|
1131
|
+
for (;;) {
|
|
1132
|
+
here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
|
|
1133
|
+
here_bits = here >>> 24;
|
|
1134
|
+
here_op = (here >>> 16) & 0xff;
|
|
1135
|
+
here_val = here & 0xffff;
|
|
1136
|
+
|
|
1137
|
+
if (here_bits <= bits) { break; }
|
|
1138
|
+
//--- PULLBYTE() ---//
|
|
1139
|
+
if (have === 0) { break inf_leave; }
|
|
1140
|
+
have--;
|
|
1141
|
+
hold += input[next++] << bits;
|
|
1142
|
+
bits += 8;
|
|
1143
|
+
//---//
|
|
1144
|
+
}
|
|
1145
|
+
if (here_op && (here_op & 0xf0) === 0) {
|
|
1146
|
+
last_bits = here_bits;
|
|
1147
|
+
last_op = here_op;
|
|
1148
|
+
last_val = here_val;
|
|
1149
|
+
for (;;) {
|
|
1150
|
+
here = state.lencode[last_val +
|
|
1151
|
+
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
|
|
1152
|
+
here_bits = here >>> 24;
|
|
1153
|
+
here_op = (here >>> 16) & 0xff;
|
|
1154
|
+
here_val = here & 0xffff;
|
|
1155
|
+
|
|
1156
|
+
if ((last_bits + here_bits) <= bits) { break; }
|
|
1157
|
+
//--- PULLBYTE() ---//
|
|
1158
|
+
if (have === 0) { break inf_leave; }
|
|
1159
|
+
have--;
|
|
1160
|
+
hold += input[next++] << bits;
|
|
1161
|
+
bits += 8;
|
|
1162
|
+
//---//
|
|
1163
|
+
}
|
|
1164
|
+
//--- DROPBITS(last.bits) ---//
|
|
1165
|
+
hold >>>= last_bits;
|
|
1166
|
+
bits -= last_bits;
|
|
1167
|
+
//---//
|
|
1168
|
+
state.back += last_bits;
|
|
1169
|
+
}
|
|
1170
|
+
//--- DROPBITS(here.bits) ---//
|
|
1171
|
+
hold >>>= here_bits;
|
|
1172
|
+
bits -= here_bits;
|
|
1173
|
+
//---//
|
|
1174
|
+
state.back += here_bits;
|
|
1175
|
+
state.length = here_val;
|
|
1176
|
+
if (here_op === 0) {
|
|
1177
|
+
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
|
|
1178
|
+
// "inflate: literal '%c'\n" :
|
|
1179
|
+
// "inflate: literal 0x%02x\n", here.val));
|
|
1180
|
+
state.mode = LIT;
|
|
1181
|
+
break;
|
|
1182
|
+
}
|
|
1183
|
+
if (here_op & 32) {
|
|
1184
|
+
//Tracevv((stderr, "inflate: end of block\n"));
|
|
1185
|
+
state.back = -1;
|
|
1186
|
+
state.mode = TYPE;
|
|
1187
|
+
break;
|
|
1188
|
+
}
|
|
1189
|
+
if (here_op & 64) {
|
|
1190
|
+
strm.msg = 'invalid literal/length code';
|
|
1191
|
+
state.mode = BAD;
|
|
1192
|
+
break;
|
|
1193
|
+
}
|
|
1194
|
+
state.extra = here_op & 15;
|
|
1195
|
+
state.mode = LENEXT;
|
|
1196
|
+
/* falls through */
|
|
1197
|
+
case LENEXT:
|
|
1198
|
+
if (state.extra) {
|
|
1199
|
+
//=== NEEDBITS(state.extra);
|
|
1200
|
+
n = state.extra;
|
|
1201
|
+
while (bits < n) {
|
|
1202
|
+
if (have === 0) { break inf_leave; }
|
|
1203
|
+
have--;
|
|
1204
|
+
hold += input[next++] << bits;
|
|
1205
|
+
bits += 8;
|
|
1206
|
+
}
|
|
1207
|
+
//===//
|
|
1208
|
+
state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
|
|
1209
|
+
//--- DROPBITS(state.extra) ---//
|
|
1210
|
+
hold >>>= state.extra;
|
|
1211
|
+
bits -= state.extra;
|
|
1212
|
+
//---//
|
|
1213
|
+
state.back += state.extra;
|
|
1214
|
+
}
|
|
1215
|
+
//Tracevv((stderr, "inflate: length %u\n", state.length));
|
|
1216
|
+
state.was = state.length;
|
|
1217
|
+
state.mode = DIST;
|
|
1218
|
+
/* falls through */
|
|
1219
|
+
case DIST:
|
|
1220
|
+
for (;;) {
|
|
1221
|
+
here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
|
|
1222
|
+
here_bits = here >>> 24;
|
|
1223
|
+
here_op = (here >>> 16) & 0xff;
|
|
1224
|
+
here_val = here & 0xffff;
|
|
1225
|
+
|
|
1226
|
+
if ((here_bits) <= bits) { break; }
|
|
1227
|
+
//--- PULLBYTE() ---//
|
|
1228
|
+
if (have === 0) { break inf_leave; }
|
|
1229
|
+
have--;
|
|
1230
|
+
hold += input[next++] << bits;
|
|
1231
|
+
bits += 8;
|
|
1232
|
+
//---//
|
|
1233
|
+
}
|
|
1234
|
+
if ((here_op & 0xf0) === 0) {
|
|
1235
|
+
last_bits = here_bits;
|
|
1236
|
+
last_op = here_op;
|
|
1237
|
+
last_val = here_val;
|
|
1238
|
+
for (;;) {
|
|
1239
|
+
here = state.distcode[last_val +
|
|
1240
|
+
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
|
|
1241
|
+
here_bits = here >>> 24;
|
|
1242
|
+
here_op = (here >>> 16) & 0xff;
|
|
1243
|
+
here_val = here & 0xffff;
|
|
1244
|
+
|
|
1245
|
+
if ((last_bits + here_bits) <= bits) { break; }
|
|
1246
|
+
//--- PULLBYTE() ---//
|
|
1247
|
+
if (have === 0) { break inf_leave; }
|
|
1248
|
+
have--;
|
|
1249
|
+
hold += input[next++] << bits;
|
|
1250
|
+
bits += 8;
|
|
1251
|
+
//---//
|
|
1252
|
+
}
|
|
1253
|
+
//--- DROPBITS(last.bits) ---//
|
|
1254
|
+
hold >>>= last_bits;
|
|
1255
|
+
bits -= last_bits;
|
|
1256
|
+
//---//
|
|
1257
|
+
state.back += last_bits;
|
|
1258
|
+
}
|
|
1259
|
+
//--- DROPBITS(here.bits) ---//
|
|
1260
|
+
hold >>>= here_bits;
|
|
1261
|
+
bits -= here_bits;
|
|
1262
|
+
//---//
|
|
1263
|
+
state.back += here_bits;
|
|
1264
|
+
if (here_op & 64) {
|
|
1265
|
+
strm.msg = 'invalid distance code';
|
|
1266
|
+
state.mode = BAD;
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
state.offset = here_val;
|
|
1270
|
+
state.extra = (here_op) & 15;
|
|
1271
|
+
state.mode = DISTEXT;
|
|
1272
|
+
/* falls through */
|
|
1273
|
+
case DISTEXT:
|
|
1274
|
+
if (state.extra) {
|
|
1275
|
+
//=== NEEDBITS(state.extra);
|
|
1276
|
+
n = state.extra;
|
|
1277
|
+
while (bits < n) {
|
|
1278
|
+
if (have === 0) { break inf_leave; }
|
|
1279
|
+
have--;
|
|
1280
|
+
hold += input[next++] << bits;
|
|
1281
|
+
bits += 8;
|
|
1282
|
+
}
|
|
1283
|
+
//===//
|
|
1284
|
+
state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
|
|
1285
|
+
//--- DROPBITS(state.extra) ---//
|
|
1286
|
+
hold >>>= state.extra;
|
|
1287
|
+
bits -= state.extra;
|
|
1288
|
+
//---//
|
|
1289
|
+
state.back += state.extra;
|
|
1290
|
+
}
|
|
1291
|
+
//#ifdef INFLATE_STRICT
|
|
1292
|
+
if (state.offset > state.dmax) {
|
|
1293
|
+
strm.msg = 'invalid distance too far back';
|
|
1294
|
+
state.mode = BAD;
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
//#endif
|
|
1298
|
+
//Tracevv((stderr, "inflate: distance %u\n", state.offset));
|
|
1299
|
+
state.mode = MATCH;
|
|
1300
|
+
/* falls through */
|
|
1301
|
+
case MATCH:
|
|
1302
|
+
if (left === 0) { break inf_leave; }
|
|
1303
|
+
copy = _out - left;
|
|
1304
|
+
if (state.offset > copy) { /* copy from window */
|
|
1305
|
+
copy = state.offset - copy;
|
|
1306
|
+
if (copy > state.whave) {
|
|
1307
|
+
if (state.sane) {
|
|
1308
|
+
strm.msg = 'invalid distance too far back';
|
|
1309
|
+
state.mode = BAD;
|
|
1310
|
+
break;
|
|
1311
|
+
}
|
|
1312
|
+
// (!) This block is disabled in zlib defaults,
|
|
1313
|
+
// don't enable it for binary compatibility
|
|
1314
|
+
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
|
|
1315
|
+
// Trace((stderr, "inflate.c too far\n"));
|
|
1316
|
+
// copy -= state.whave;
|
|
1317
|
+
// if (copy > state.length) { copy = state.length; }
|
|
1318
|
+
// if (copy > left) { copy = left; }
|
|
1319
|
+
// left -= copy;
|
|
1320
|
+
// state.length -= copy;
|
|
1321
|
+
// do {
|
|
1322
|
+
// output[put++] = 0;
|
|
1323
|
+
// } while (--copy);
|
|
1324
|
+
// if (state.length === 0) { state.mode = LEN; }
|
|
1325
|
+
// break;
|
|
1326
|
+
//#endif
|
|
1327
|
+
}
|
|
1328
|
+
if (copy > state.wnext) {
|
|
1329
|
+
copy -= state.wnext;
|
|
1330
|
+
from = state.wsize - copy;
|
|
1331
|
+
}
|
|
1332
|
+
else {
|
|
1333
|
+
from = state.wnext - copy;
|
|
1334
|
+
}
|
|
1335
|
+
if (copy > state.length) { copy = state.length; }
|
|
1336
|
+
from_source = state.window;
|
|
1337
|
+
}
|
|
1338
|
+
else { /* copy from output */
|
|
1339
|
+
from_source = output;
|
|
1340
|
+
from = put - state.offset;
|
|
1341
|
+
copy = state.length;
|
|
1342
|
+
}
|
|
1343
|
+
if (copy > left) { copy = left; }
|
|
1344
|
+
left -= copy;
|
|
1345
|
+
state.length -= copy;
|
|
1346
|
+
do {
|
|
1347
|
+
output[put++] = from_source[from++];
|
|
1348
|
+
} while (--copy);
|
|
1349
|
+
if (state.length === 0) { state.mode = LEN; }
|
|
1350
|
+
break;
|
|
1351
|
+
case LIT:
|
|
1352
|
+
if (left === 0) { break inf_leave; }
|
|
1353
|
+
output[put++] = state.length;
|
|
1354
|
+
left--;
|
|
1355
|
+
state.mode = LEN;
|
|
1356
|
+
break;
|
|
1357
|
+
case CHECK:
|
|
1358
|
+
if (state.wrap) {
|
|
1359
|
+
//=== NEEDBITS(32);
|
|
1360
|
+
while (bits < 32) {
|
|
1361
|
+
if (have === 0) { break inf_leave; }
|
|
1362
|
+
have--;
|
|
1363
|
+
// Use '|' instead of '+' to make sure that result is signed
|
|
1364
|
+
hold |= input[next++] << bits;
|
|
1365
|
+
bits += 8;
|
|
1366
|
+
}
|
|
1367
|
+
//===//
|
|
1368
|
+
_out -= left;
|
|
1369
|
+
strm.total_out += _out;
|
|
1370
|
+
state.total += _out;
|
|
1371
|
+
if (_out) {
|
|
1372
|
+
strm.adler = state.check =
|
|
1373
|
+
/*UPDATE(state.check, put - _out, _out);*/
|
|
1374
|
+
(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
|
|
1375
|
+
|
|
1376
|
+
}
|
|
1377
|
+
_out = left;
|
|
1378
|
+
// NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
|
|
1379
|
+
if ((state.flags ? hold : zswap32(hold)) !== state.check) {
|
|
1380
|
+
strm.msg = 'incorrect data check';
|
|
1381
|
+
state.mode = BAD;
|
|
1382
|
+
break;
|
|
1383
|
+
}
|
|
1384
|
+
//=== INITBITS();
|
|
1385
|
+
hold = 0;
|
|
1386
|
+
bits = 0;
|
|
1387
|
+
//===//
|
|
1388
|
+
//Tracev((stderr, "inflate: check matches trailer\n"));
|
|
1389
|
+
}
|
|
1390
|
+
state.mode = LENGTH;
|
|
1391
|
+
/* falls through */
|
|
1392
|
+
case LENGTH:
|
|
1393
|
+
if (state.wrap && state.flags) {
|
|
1394
|
+
//=== NEEDBITS(32);
|
|
1395
|
+
while (bits < 32) {
|
|
1396
|
+
if (have === 0) { break inf_leave; }
|
|
1397
|
+
have--;
|
|
1398
|
+
hold += input[next++] << bits;
|
|
1399
|
+
bits += 8;
|
|
1400
|
+
}
|
|
1401
|
+
//===//
|
|
1402
|
+
if (hold !== (state.total & 0xffffffff)) {
|
|
1403
|
+
strm.msg = 'incorrect length check';
|
|
1404
|
+
state.mode = BAD;
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
//=== INITBITS();
|
|
1408
|
+
hold = 0;
|
|
1409
|
+
bits = 0;
|
|
1410
|
+
//===//
|
|
1411
|
+
//Tracev((stderr, "inflate: length matches trailer\n"));
|
|
1412
|
+
}
|
|
1413
|
+
state.mode = DONE;
|
|
1414
|
+
/* falls through */
|
|
1415
|
+
case DONE:
|
|
1416
|
+
ret = Z_STREAM_END;
|
|
1417
|
+
break inf_leave;
|
|
1418
|
+
case BAD:
|
|
1419
|
+
ret = Z_DATA_ERROR;
|
|
1420
|
+
break inf_leave;
|
|
1421
|
+
case MEM:
|
|
1422
|
+
return Z_MEM_ERROR;
|
|
1423
|
+
case SYNC:
|
|
1424
|
+
/* falls through */
|
|
1425
|
+
default:
|
|
1426
|
+
return Z_STREAM_ERROR;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
|
|
1431
|
+
|
|
1432
|
+
/*
|
|
1433
|
+
Return from inflate(), updating the total counts and the check value.
|
|
1434
|
+
If there was no progress during the inflate() call, return a buffer
|
|
1435
|
+
error. Call updatewindow() to create and/or update the window state.
|
|
1436
|
+
Note: a memory error from inflate() is non-recoverable.
|
|
1437
|
+
*/
|
|
1438
|
+
|
|
1439
|
+
//--- RESTORE() ---
|
|
1440
|
+
strm.next_out = put;
|
|
1441
|
+
strm.avail_out = left;
|
|
1442
|
+
strm.next_in = next;
|
|
1443
|
+
strm.avail_in = have;
|
|
1444
|
+
state.hold = hold;
|
|
1445
|
+
state.bits = bits;
|
|
1446
|
+
//---
|
|
1447
|
+
|
|
1448
|
+
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
|
|
1449
|
+
(state.mode < CHECK || flush !== Z_FINISH))) {
|
|
1450
|
+
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
|
|
1451
|
+
state.mode = MEM;
|
|
1452
|
+
return Z_MEM_ERROR;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
_in -= strm.avail_in;
|
|
1456
|
+
_out -= strm.avail_out;
|
|
1457
|
+
strm.total_in += _in;
|
|
1458
|
+
strm.total_out += _out;
|
|
1459
|
+
state.total += _out;
|
|
1460
|
+
if (state.wrap && _out) {
|
|
1461
|
+
strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
|
|
1462
|
+
(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
|
|
1463
|
+
}
|
|
1464
|
+
strm.data_type = state.bits + (state.last ? 64 : 0) +
|
|
1465
|
+
(state.mode === TYPE ? 128 : 0) +
|
|
1466
|
+
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
|
|
1467
|
+
if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
|
|
1468
|
+
ret = Z_BUF_ERROR;
|
|
1469
|
+
}
|
|
1470
|
+
return ret;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
function inflateEnd(strm) {
|
|
1474
|
+
|
|
1475
|
+
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
|
|
1476
|
+
return Z_STREAM_ERROR;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
var state = strm.state;
|
|
1480
|
+
if (state.window) {
|
|
1481
|
+
state.window = null;
|
|
1482
|
+
}
|
|
1483
|
+
strm.state = null;
|
|
1484
|
+
return Z_OK;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
function inflateGetHeader(strm, head) {
|
|
1488
|
+
var state;
|
|
1489
|
+
|
|
1490
|
+
/* check state */
|
|
1491
|
+
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
|
1492
|
+
state = strm.state;
|
|
1493
|
+
if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
|
|
1494
|
+
|
|
1495
|
+
/* save header structure */
|
|
1496
|
+
state.head = head;
|
|
1497
|
+
head.done = false;
|
|
1498
|
+
return Z_OK;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
function inflateSetDictionary(strm, dictionary) {
|
|
1502
|
+
var dictLength = dictionary.length;
|
|
1503
|
+
|
|
1504
|
+
var state;
|
|
1505
|
+
var dictid;
|
|
1506
|
+
var ret;
|
|
1507
|
+
|
|
1508
|
+
/* check state */
|
|
1509
|
+
if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
|
|
1510
|
+
state = strm.state;
|
|
1511
|
+
|
|
1512
|
+
if (state.wrap !== 0 && state.mode !== DICT) {
|
|
1513
|
+
return Z_STREAM_ERROR;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
/* check for correct dictionary identifier */
|
|
1517
|
+
if (state.mode === DICT) {
|
|
1518
|
+
dictid = 1; /* adler32(0, null, 0)*/
|
|
1519
|
+
/* dictid = adler32(dictid, dictionary, dictLength); */
|
|
1520
|
+
dictid = adler32(dictid, dictionary, dictLength, 0);
|
|
1521
|
+
if (dictid !== state.check) {
|
|
1522
|
+
return Z_DATA_ERROR;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
/* copy dictionary to window using updatewindow(), which will amend the
|
|
1526
|
+
existing dictionary if appropriate */
|
|
1527
|
+
ret = updatewindow(strm, dictionary, dictLength, dictLength);
|
|
1528
|
+
if (ret) {
|
|
1529
|
+
state.mode = MEM;
|
|
1530
|
+
return Z_MEM_ERROR;
|
|
1531
|
+
}
|
|
1532
|
+
state.havedict = 1;
|
|
1533
|
+
// Tracev((stderr, "inflate: dictionary set\n"));
|
|
1534
|
+
return Z_OK;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
exports.inflateReset = inflateReset;
|
|
1538
|
+
exports.inflateReset2 = inflateReset2;
|
|
1539
|
+
exports.inflateResetKeep = inflateResetKeep;
|
|
1540
|
+
exports.inflateInit = inflateInit;
|
|
1541
|
+
exports.inflateInit2 = inflateInit2;
|
|
1542
|
+
exports.inflate = inflate;
|
|
1543
|
+
exports.inflateEnd = inflateEnd;
|
|
1544
|
+
exports.inflateGetHeader = inflateGetHeader;
|
|
1545
|
+
exports.inflateSetDictionary = inflateSetDictionary;
|
|
1546
|
+
exports.inflateInfo = 'pako inflate (from Nodeca project)';
|
|
1547
|
+
|
|
1548
|
+
/* Not implemented
|
|
1549
|
+
exports.inflateCopy = inflateCopy;
|
|
1550
|
+
exports.inflateGetDictionary = inflateGetDictionary;
|
|
1551
|
+
exports.inflateMark = inflateMark;
|
|
1552
|
+
exports.inflatePrime = inflatePrime;
|
|
1553
|
+
exports.inflateSync = inflateSync;
|
|
1554
|
+
exports.inflateSyncPoint = inflateSyncPoint;
|
|
1555
|
+
exports.inflateUndermine = inflateUndermine;
|
|
1556
|
+
*/
|