@gmod/cram 1.5.9 → 1.6.2
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/CHANGELOG.md +90 -0
- package/README.md +182 -172
- package/dist/craiIndex.d.ts +37 -0
- package/dist/craiIndex.js +196 -301
- package/dist/craiIndex.js.map +1 -0
- package/dist/cram-bundle.js +6 -15
- package/dist/cramFile/codecs/_base.d.ts +6 -0
- package/dist/cramFile/codecs/_base.js +44 -53
- package/dist/cramFile/codecs/_base.js.map +1 -0
- package/dist/cramFile/codecs/beta.d.ts +4 -0
- package/dist/cramFile/codecs/beta.js +38 -48
- package/dist/cramFile/codecs/beta.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/dist/cramFile/codecs/byteArrayLength.js +58 -78
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/dist/cramFile/codecs/byteArrayStop.js +62 -76
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/dist/cramFile/codecs/external.d.ts +7 -0
- package/dist/cramFile/codecs/external.js +63 -81
- package/dist/cramFile/codecs/external.js.map +1 -0
- package/dist/cramFile/codecs/gamma.d.ts +4 -0
- package/dist/cramFile/codecs/gamma.js +43 -56
- package/dist/cramFile/codecs/gamma.js.map +1 -0
- package/dist/cramFile/codecs/huffman.d.ts +17 -0
- package/dist/cramFile/codecs/huffman.js +126 -199
- package/dist/cramFile/codecs/huffman.js.map +1 -0
- package/dist/cramFile/codecs/index.d.ts +2 -0
- package/dist/cramFile/codecs/index.js +31 -38
- package/dist/cramFile/codecs/index.js.map +1 -0
- package/dist/cramFile/codecs/subexp.d.ts +4 -0
- package/dist/cramFile/codecs/subexp.js +51 -64
- package/dist/cramFile/codecs/subexp.js.map +1 -0
- package/dist/cramFile/constants.d.ts +36 -0
- package/dist/cramFile/constants.js +52 -50
- package/dist/cramFile/constants.js.map +1 -0
- package/dist/cramFile/container/compressionScheme.d.ts +23 -0
- package/dist/cramFile/container/compressionScheme.js +115 -153
- package/dist/cramFile/container/compressionScheme.js.map +1 -0
- package/dist/cramFile/container/index.d.ts +13 -0
- package/dist/cramFile/container/index.js +169 -283
- package/dist/cramFile/container/index.js.map +1 -0
- package/dist/cramFile/file.d.ts +63 -0
- package/dist/cramFile/file.js +440 -766
- package/dist/cramFile/file.js.map +1 -0
- package/dist/cramFile/index.d.ts +2 -0
- package/dist/cramFile/index.js +7 -4
- package/dist/cramFile/index.js.map +1 -0
- package/dist/cramFile/record.d.ts +79 -0
- package/dist/cramFile/record.js +253 -308
- package/dist/cramFile/record.js.map +1 -0
- package/dist/cramFile/sectionParsers.d.ts +18 -0
- package/dist/cramFile/sectionParsers.js +324 -362
- package/dist/cramFile/sectionParsers.js.map +1 -0
- package/dist/cramFile/slice/decodeRecord.d.ts +2 -0
- package/dist/cramFile/slice/decodeRecord.js +278 -298
- package/dist/cramFile/slice/decodeRecord.js.map +1 -0
- package/dist/cramFile/slice/index.d.ts +20 -0
- package/dist/cramFile/slice/index.js +488 -789
- package/dist/cramFile/slice/index.js.map +1 -0
- package/dist/cramFile/util.d.ts +5 -0
- package/dist/cramFile/util.js +158 -144
- package/dist/cramFile/util.js.map +1 -0
- package/dist/errors.d.ts +23 -0
- package/dist/errors.js +66 -103
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -0
- package/dist/indexedCramFile.d.ts +39 -0
- package/dist/indexedCramFile.js +213 -315
- package/dist/indexedCramFile.js.map +1 -0
- package/dist/io/bufferCache.d.ts +12 -0
- package/dist/io/bufferCache.js +108 -128
- package/dist/io/bufferCache.js.map +1 -0
- package/dist/io/index.d.ts +5 -0
- package/dist/io/index.js +29 -27
- package/dist/io/index.js.map +1 -0
- package/dist/io/localFile.d.ts +10 -0
- package/dist/io/localFile.js +105 -162
- package/dist/io/localFile.js.map +1 -0
- package/dist/io/remoteFile.d.ts +16 -0
- package/dist/io/remoteFile.js +137 -206
- package/dist/io/remoteFile.js.map +1 -0
- package/dist/rans/constants.d.ts +3 -0
- package/dist/rans/constants.js +6 -6
- package/dist/rans/constants.js.map +1 -0
- package/dist/rans/d04.d.ts +1 -0
- package/dist/rans/d04.js +70 -99
- package/dist/rans/d04.js.map +1 -0
- package/dist/rans/d14.d.ts +1 -0
- package/dist/rans/d14.js +55 -93
- package/dist/rans/d14.js.map +1 -0
- package/dist/rans/decoding.d.ts +30 -0
- package/dist/rans/decoding.js +112 -159
- package/dist/rans/decoding.js.map +1 -0
- package/dist/rans/frequencies.d.ts +2 -0
- package/dist/rans/frequencies.js +110 -119
- package/dist/rans/frequencies.js.map +1 -0
- package/dist/rans/index.d.ts +1 -0
- package/dist/rans/index.js +111 -174
- package/dist/rans/index.js.map +1 -0
- package/dist/sam.d.ts +1 -0
- package/dist/sam.js +16 -41
- package/dist/sam.js.map +1 -0
- package/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +9 -0
- package/dist/unzip-pako.js.map +1 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +6 -0
- package/dist/unzip.js.map +1 -0
- package/errors.js +66 -103
- package/esm/craiIndex.d.ts +37 -0
- package/esm/craiIndex.js +158 -0
- package/esm/craiIndex.js.map +1 -0
- package/esm/cramFile/codecs/_base.d.ts +6 -0
- package/esm/cramFile/codecs/_base.js +42 -0
- package/esm/cramFile/codecs/_base.js.map +1 -0
- package/esm/cramFile/codecs/beta.d.ts +4 -0
- package/esm/cramFile/codecs/beta.js +15 -0
- package/esm/cramFile/codecs/beta.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/esm/cramFile/codecs/byteArrayLength.js +35 -0
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/esm/cramFile/codecs/byteArrayStop.js +40 -0
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/esm/cramFile/codecs/external.d.ts +7 -0
- package/esm/cramFile/codecs/external.js +40 -0
- package/esm/cramFile/codecs/external.js.map +1 -0
- package/esm/cramFile/codecs/gamma.d.ts +4 -0
- package/esm/cramFile/codecs/gamma.js +20 -0
- package/esm/cramFile/codecs/gamma.js.map +1 -0
- package/esm/cramFile/codecs/huffman.d.ts +17 -0
- package/esm/cramFile/codecs/huffman.js +107 -0
- package/esm/cramFile/codecs/huffman.js.map +1 -0
- package/esm/cramFile/codecs/index.d.ts +2 -0
- package/esm/cramFile/codecs/index.js +30 -0
- package/esm/cramFile/codecs/index.js.map +1 -0
- package/esm/cramFile/codecs/subexp.d.ts +4 -0
- package/esm/cramFile/codecs/subexp.js +28 -0
- package/esm/cramFile/codecs/subexp.js.map +1 -0
- package/esm/cramFile/constants.d.ts +36 -0
- package/esm/cramFile/constants.js +51 -0
- package/esm/cramFile/constants.js.map +1 -0
- package/esm/cramFile/container/compressionScheme.d.ts +23 -0
- package/esm/cramFile/container/compressionScheme.js +123 -0
- package/esm/cramFile/container/compressionScheme.js.map +1 -0
- package/esm/cramFile/container/index.d.ts +13 -0
- package/esm/cramFile/container/index.js +84 -0
- package/esm/cramFile/container/index.js.map +1 -0
- package/esm/cramFile/file.d.ts +63 -0
- package/esm/cramFile/file.js +281 -0
- package/esm/cramFile/file.js.map +1 -0
- package/esm/cramFile/index.d.ts +2 -0
- package/esm/cramFile/index.js +3 -0
- package/esm/cramFile/index.js.map +1 -0
- package/esm/cramFile/record.d.ts +79 -0
- package/esm/cramFile/record.js +297 -0
- package/esm/cramFile/record.js.map +1 -0
- package/esm/cramFile/sectionParsers.d.ts +18 -0
- package/esm/cramFile/sectionParsers.js +347 -0
- package/esm/cramFile/sectionParsers.js.map +1 -0
- package/esm/cramFile/slice/decodeRecord.d.ts +2 -0
- package/esm/cramFile/slice/decodeRecord.js +299 -0
- package/esm/cramFile/slice/decodeRecord.js.map +1 -0
- package/esm/cramFile/slice/index.d.ts +20 -0
- package/esm/cramFile/slice/index.js +364 -0
- package/esm/cramFile/slice/index.js.map +1 -0
- package/esm/cramFile/util.d.ts +5 -0
- package/esm/cramFile/util.js +161 -0
- package/esm/cramFile/util.js.map +1 -0
- package/esm/errors.d.ts +23 -0
- package/esm/errors.js +24 -0
- package/esm/errors.js.map +1 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -0
- package/esm/indexedCramFile.d.ts +39 -0
- package/esm/indexedCramFile.js +155 -0
- package/esm/indexedCramFile.js.map +1 -0
- package/esm/io/bufferCache.d.ts +12 -0
- package/esm/io/bufferCache.js +54 -0
- package/esm/io/bufferCache.js.map +1 -0
- package/esm/io/index.d.ts +5 -0
- package/esm/io/index.js +24 -0
- package/esm/io/index.js.map +1 -0
- package/esm/io/localFile.d.ts +10 -0
- package/esm/io/localFile.js +31 -0
- package/esm/io/localFile.js.map +1 -0
- package/esm/io/remoteFile.d.ts +16 -0
- package/esm/io/remoteFile.js +64 -0
- package/esm/io/remoteFile.js.map +1 -0
- package/esm/rans/constants.d.ts +3 -0
- package/esm/rans/constants.js +5 -0
- package/esm/rans/constants.js.map +1 -0
- package/esm/rans/d04.d.ts +1 -0
- package/esm/rans/d04.js +67 -0
- package/esm/rans/d04.js.map +1 -0
- package/esm/rans/d14.d.ts +1 -0
- package/esm/rans/d14.js +52 -0
- package/esm/rans/d14.js.map +1 -0
- package/esm/rans/decoding.d.ts +30 -0
- package/esm/rans/decoding.js +118 -0
- package/esm/rans/decoding.js.map +1 -0
- package/esm/rans/frequencies.d.ts +2 -0
- package/esm/rans/frequencies.js +110 -0
- package/esm/rans/frequencies.js.map +1 -0
- package/esm/rans/index.d.ts +1 -0
- package/esm/rans/index.js +195 -0
- package/esm/rans/index.js.map +1 -0
- package/esm/sam.d.ts +1 -0
- package/esm/sam.js +16 -0
- package/esm/sam.js.map +1 -0
- package/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +5 -0
- package/esm/unzip-pako.js.map +1 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +3 -0
- package/esm/unzip.js.map +1 -0
- package/package.json +38 -35
- package/src/craiIndex.js +180 -0
- package/src/cramFile/codecs/_base.js +49 -0
- package/src/cramFile/codecs/beta.js +23 -0
- package/src/cramFile/codecs/byteArrayLength.js +55 -0
- package/src/cramFile/codecs/byteArrayStop.js +50 -0
- package/src/cramFile/codecs/external.js +54 -0
- package/src/cramFile/codecs/gamma.js +30 -0
- package/src/cramFile/codecs/huffman.js +137 -0
- package/src/cramFile/codecs/index.js +38 -0
- package/src/cramFile/codecs/subexp.js +32 -0
- package/src/cramFile/constants.js +55 -0
- package/src/cramFile/container/compressionScheme.js +144 -0
- package/src/cramFile/container/index.js +119 -0
- package/src/cramFile/file.js +347 -0
- package/src/cramFile/index.js +3 -0
- package/src/cramFile/record.js +337 -0
- package/src/cramFile/sectionParsers.js +379 -0
- package/src/cramFile/slice/decodeRecord.js +362 -0
- package/src/cramFile/slice/index.js +497 -0
- package/src/cramFile/util.js +169 -0
- package/src/errors.js +22 -0
- package/src/index.js +5 -0
- package/src/indexedCramFile.js +191 -0
- package/src/io/bufferCache.js +66 -0
- package/src/io/index.js +26 -0
- package/src/io/localFile.js +35 -0
- package/src/io/remoteFile.js +71 -0
- package/src/rans/README.md +1 -0
- package/src/rans/constants.js +5 -0
- package/src/rans/d04.js +83 -0
- package/src/rans/d14.js +59 -0
- package/src/rans/decoding.js +141 -0
- package/src/rans/frequencies.js +121 -0
- package/src/rans/index.js +249 -0
- package/src/sam.js +15 -0
- package/src/unzip-pako.ts +5 -0
- package/src/unzip.ts +2 -0
package/dist/cram-bundle.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
window.gmodCRAM=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=
|
|
1
|
+
window.gmodCRAM=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=31)}([function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.CramArgumentError=e.CramSizeLimitError=e.CramBufferOverrunError=e.CramMalformedError=e.CramUnimplementedError=e.CramError=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(Error);e.CramError=o;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(Error);e.CramUnimplementedError=a;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramMalformedError=s;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(s);e.CramBufferOverrunError=f;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramSizeLimitError=u;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramArgumentError=c},function(t,e,r){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
|
-
* @author Feross Aboukhadijeh <
|
|
5
|
+
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var n=r(165),i=r(166),o=r(105);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return f(this,t,e,r)}function f(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=s(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(c(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|d(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(f(t,o)===f(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(f(t,o+h)!==f(e,h)){l=!1;break}if(l)return o}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return Z(D(e,t.length-r),t,r,n)}function w(t,e,r,n){return Z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return w(t,e,r,n)}function E(t,e,r,n){return Z(q(e),t,r,n)}function S(t,e,r,n){return Z(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,u,f=t[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return f(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),l=0;l<s;++l)if(f[l]!==c[l]){o=f[l],a=c[l];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U(t[o]);return i}function I(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function F(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,o){return o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=u.isBuffer(t)?t:D(new u(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(23))},function(t,e,r){t.exports=r(167)},function(t,e,r){var n=r(12);t.exports=!n((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,r){var n=r(3);t.exports=function(t){return n[t+"Prototype"]}},function(t,e,r){var n=r(18),i=r(21),o=r(43);t.exports=n?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(18),i=r(106),o=r(2),a=r(62),s=Object.defineProperty;e.f=n?s:function(t,e,r){if(o(t),e=a(e,!0),o(r),i)try{return s(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(49);t.exports=function(t){return Object(n(t))}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var n=r(4),i=r(142);t.exports=n?i:function(t){return Map.prototype.entries.call(t)}},function(t,e,r){var n=r(3),i=r(13),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t])||o(i[t]):n[t]&&n[t][e]||i[t]&&i[t][e]}},function(t,e,r){var n=r(256),i=r(139);function o(e){return t.exports=o=i?n:function(t){return t.__proto__||n(t)},o(e)}t.exports=o},function(t,e,r){var n=r(60),i=r(49);t.exports=function(t){return n(i(t))}},function(t,e,r){var n=r(82),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},function(t,e,r){t.exports=r(184)},function(t,e,r){var n=r(185);function i(t,e,r,i,o,a,s){try{var u=t[a](s),f=u.value}catch(t){return void r(t)}u.done?e(f):n.resolve(f).then(i,o)}t.exports=function(t){return function(){var e=this,r=arguments;return new n((function(n,o){var a=t.apply(e,r);function s(t){i(a,n,o,s,u,"next",t)}function u(t){i(a,n,o,s,u,"throw",t)}s(void 0)}))}}},function(t,e,r){var n=r(226),i=r(255);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},function(t,e,r){var n=r(140),i=r(96);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=n(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports={}},function(t,e,r){var n=r(21).f,i=r(20),o=r(24),a=r(174),s=r(6)("toStringTag"),u=a!=={}.toString;t.exports=function(t,e,r,f){if(t){var c=r?t:t.prototype;o(c,s)||n(c,s,{configurable:!0,value:e}),f&&u&&i(c,"toString",a)}}},function(t,e,r){t.exports=r(181)},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,f=[],c=!1,l=-1;function h(){c&&u&&(c=!1,u.length?f=u.concat(f):l=-1,f.length&&d())}function d(){if(!c){var t=s(h);c=!0;for(var e=f.length;e;){for(u=f,f=[];++l<e;)u&&u[l].run();l=-1,e=f.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new p(t,e)),1!==f.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";var n=r(70),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(57);o.inherits=r(47);var a=r(127),s=r(93);o.inherits(l,a);for(var u=i(s.prototype),f=0;f<u.length;f++){var c=u[f];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(t){if(!(this instanceof l))return new l(t);a.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},function(t,e,r){"use strict";var n=r(1),i=n(r(7)),o=n(r(10)),a=r(9).CramBufferOverrunError,s={int:!0,byte:!0,long:!0,byteArray:!0,byteArrayBlock:!0},u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if((0,i.default)(this,t),this.parameters=e,this.dataType=r,!r)throw new TypeError("must provide a data type to codec constructor");if(!s[r])throw new TypeError("invalid data type ".concat(r))}return(0,o.default)(t,[{key:"_getBits",value:function(t,e,r){var n=0;if(e.bytePosition+(7-e.bitPosition+r)/8>t.length)throw new a("read error during decoding. the file seems to be truncated.");for(var i=r;i;i-=1)n<<=1,n|=t[e.bytePosition]>>e.bitPosition&1,e.bitPosition-=1,e.bitPosition<0&&(e.bytePosition+=1),e.bitPosition&=7;return n}}]),t}();t.exports=u},function(t,e,r){r(168);var n=r(176),i=r(13),o=r(20),a=r(35),s=r(6)("toStringTag");for(var u in n){var f=i[u],c=f&&f.prototype;c&&!c[s]&&o(c,s,u),a[u]=a.Array}},function(t,e,r){var n,i,o,a=r(169),s=r(13),u=r(14),f=r(20),c=r(24),l=r(63),h=r(50),d=s.WeakMap;if(a){var p=new d,g=p.get,v=p.has,y=p.set;n=function(t,e){return y.call(p,t,e),e},i=function(t){return g.call(p,t)||{}},o=function(t){return v.call(p,t)}}else{var m=l("state");h[m]=!0,n=function(t,e){return f(t,m,e),e},i=function(t){return c(t,m)?t[m]:{}},o=function(t){return c(t,m)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){var n=r(2),i=r(173),o=r(84),a=r(50),s=r(112),u=r(78),f=r(63)("IE_PROTO"),c=function(){},l=function(){var t,e=u("iframe"),r=o.length;for(e.style.display="none",s.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[o[r]];return l()};t.exports=Object.create||function(t,e){var r;return null!==t?(c.prototype=n(t),r=new c,c.prototype=null,r[f]=t):r=l(),void 0===e?r:i(r,e)},a[f]=!0},function(t,e,r){var n=r(15),i=r(60),o=r(22),a=r(29),s=r(113),u=[].push,f=function(t){var e=1==t,r=2==t,f=3==t,c=4==t,l=6==t,h=5==t||l;return function(d,p,g,v){for(var y,m,b=o(d),_=i(b),w=n(p,g,3),x=a(_.length),E=0,S=v||s,k=e?S(d,x):r?S(d,0):void 0;x>E;E++)if((h||E in _)&&(m=w(y=_[E],E,b),t))if(e)k[E]=m;else if(m)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:u.call(k,y)}else if(c)return!1;return l?-1:f||c?c:k}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6)}},function(t,e,r){"use strict";var n=r(187).charAt,i=r(42),o=r(79),a=i.set,s=i.getterFor("String Iterator");o(String,"String",(function(t){a(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=s(this),r=e.string,i=e.index;return i>=r.length?{value:void 0,done:!0}:(t=n(r,i),e.index+=t.length,{value:t,done:!1})}))},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){var n=r(157),i=r(385),o=r(158);t.exports=function(t,e){return n(t)||i(t,e)||o()}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports={}},function(t,e,r){var n=r(111),i=r(84);t.exports=Object.keys||function(t){return n(t,i)}},function(t,e,r){var n=r(20);t.exports=function(t,e,r,i){i&&i.enumerable?t[e]=r:n(t,e,r)}},function(t,e,r){var n=r(34);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(12);t.exports=function(t,e){var r=[][t];return!r||!n((function(){r.call(null,e||function(){throw 1},1)}))}},function(t,e,r){var n=r(2),i=r(5),o=r(6)("species");t.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||null==(r=n(a)[o])?e:i(r)}},function(t,e,r){"use strict";var n=r(5),i=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new i(t)}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(16).Buffer)},function(t,e,r){"use strict";var n=r(1)(r(75)),i=r(332),o=r(9).CramBufferOverrunError;t.exports={itf8Size:function(t){return-128&t?-16384&t?-2097152&t?-268435456&t?5:4:3:2:1},parseItf8:function(t,e){var r,n=e,i=t[n];if(i<128?(r=i,n+=1):i<192?(r=16383&(i<<8|t[n+1]),n+=2):i<224?(r=2097151&(i<<16|t[n+1]<<8|t[n+2]),n+=3):i<240?(r=268435455&(i<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),n+=4):(r=(15&i)<<28|t[n+1]<<20|t[n+2]<<12|t[n+3]<<4|15&t[n+4],n+=5),n>t.length)throw new o("Attempted to read beyond end of buffer; this file seems truncated.");return[r,n-e]},parseItem:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=e.parse(t),o=i.offset,a=i.result;return a._endPosition=o+n,a._size=o-r,a},tinyMemoize:function(t,e){var r=t.prototype[e],i="_memo_".concat(e);t.prototype[e]=function(){var t=this;if(!(i in this)){var e=r.call(this);this[i]=e,n.default.resolve(e).catch((function(){delete t[i]}))}return this[i]}},sequenceMD5:function(t){return i(t.toUpperCase().replace(/[^\x21-\x7e]/g,""))}}},function(t,e,r){var n=r(352),i=r(152),o=r(363);t.exports=function(t){return n(t)||i(t)||o()}},function(t,e,r){var n=r(12),i=r(34),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},function(t,e,r){var n=r(13),i=r(171),o=r(4),a=n["__core-js_shared__"]||i("__core-js_shared__",{});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.2.1",mode:o?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,r){var n=r(14);t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(61),i=r(64),o=n("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+n).toString(36)}},function(t,e,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},function(t,e,r){var n=r(24),i=r(22),o=r(63),a=r(109),s=o("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=i(t),n(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,r){var n=r(34),i=r(6)("toStringTag"),o="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?r:o?n(e):"Object"==(a=n(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,r){var n=r(12),i=r(6)("species");t.exports=function(t){return!n((function(){var e=[];return(e.constructor={})[i]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e,r){"use strict";(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this,r(38))},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,a;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(a=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],a.set(o,i),i+=o.length;return a}},a={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(n)},function(t,e,r){"use strict";var n=r(1)(r(7)),i=r(9).CramMalformedError,o=r(73),a=function t(){(0,n.default)(this,t),this.F=void 0,this.C=void 0};function s(t,e,r,n){return r*(t>>n)+(t&(1<<n)-1)-e}var u={FC:a,AriDecoder:function t(){(0,n.default)(this,t),this.fc=new Array(256);for(var e=0;e<this.fc.length;e+=1)this.fc[e]=new a;this.R=null},Symbol:function t(){(0,n.default)(this,t),this.start=void 0,this.freq=void 0},symbolInit:function(t,e,r){if(!(e<=65536))throw new i("assertion failed: start <= 1<<16");if(!(r<=65536-e))throw new i("assertion failed: freq <= 1<<16");t.start=e,t.freq=r},advanceStep:s,advanceSymbolStep:function(t,e,r){return s(t,e.start,e.freq,r)},get:function(t,e){return t&(1<<e)-1},advanceSymbol:function(t,e,r,n){return function(t,e,r,n,i){if((t=n*(t>>i)+(t&(1<<i)-1)-r)<o.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<o.RANS_BYTE_L);return t}(t,e,r.start,r.freq,n)},renormalize:function(t,e){if(t<o.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<o.RANS_BYTE_L);return t}};t.exports=u},function(t,e,r){"use strict";t.exports={TF_SHIFT:12,TOTFREQ:4096,RANS_BYTE_L:1<<23}},function(t,e,r){t.exports=r(323)},function(t,e,r){t.exports=r(331)},function(t,e,r){t.exports=r(348)},function(t,e){t.exports=function(){}},function(t,e,r){var n=r(13),i=r(14),o=n.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,r){"use strict";var n=r(0),i=r(172),o=r(66),a=r(85),s=r(36),u=r(20),f=r(52),c=r(6),l=r(4),h=r(35),d=r(108),p=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,v=c("iterator"),y=function(){return this};t.exports=function(t,e,r,c,d,m,b){i(r,e,c);var _,w,x,E=function(t){if(t===d&&T)return T;if(!g&&t in A)return A[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},S=e+" Iterator",k=!1,A=t.prototype,C=A[v]||A["@@iterator"]||d&&A[d],T=!g&&C||E(d),R="Array"==e&&A.entries||C;if(R&&(_=o(R.call(new t)),p!==Object.prototype&&_.next&&(l||o(_)===p||(a?a(_,p):"function"!=typeof _[v]&&u(_,v,y)),s(_,S,!0,!0),l&&(h[S]=y))),"values"==d&&C&&"values"!==C.name&&(k=!0,T=function(){return C.call(this)}),l&&!b||A[v]===T||u(A,v,T),h[e]=T,d)if(w={values:E("values"),keys:m?T:E("keys"),entries:E("entries")},b)for(x in w)!g&&!k&&x in A||f(A,x,w[x]);else n({target:e,proto:!0,forced:g||k},w);return w}},function(t,e,r){var n=r(18),i=r(65),o=r(43),a=r(28),s=r(62),u=r(24),f=r(106),c=Object.getOwnPropertyDescriptor;e.f=n?c:function(t,e){if(t=a(t),e=s(e,!0),f)try{return c(t,e)}catch(t){}if(u(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,r){var n=r(28),i=r(29),o=r(83),a=function(t){return function(e,r,a){var s,u=n(e),f=i(u.length),c=o(a,f);if(t&&r!=r){for(;f>c;)if((s=u[c++])!=s)return!0}else for(;f>c;c++)if((t||c in u)&&u[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){var n=r(82),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,r){var n=r(2),i=r(175);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,o){return n(r),i(o),e?t.call(r,o):r.__proto__=o,r}}():void 0)},function(t,e,r){"use strict";var n=r(62),i=r(21),o=r(43);t.exports=function(t,e,r){var a=n(e);a in t?i.f(t,a,o(0,r)):t[a]=r}},function(t,e){},function(t,e){t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},function(t,e,r){var n=r(67),i=r(35),o=r(6)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function l(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,t))}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):g(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var f=u.length,c=g(u,f);for(r=0;r<f;++r)o(c[r],this,e)}return!0},s.prototype.addListener=function(t,e){return c(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return c(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,h(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,h(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,i,o,a;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){(e=t.exports=r(127)).Stream=e,e.Readable=e,e.Writable=r(93),e.Duplex=r(39),e.Transform=r(131),e.PassThrough=r(208)},function(t,e,r){var n=r(16),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e,n,i){var o=r(70);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;m.WritableState=y;var f=r(57);f.inherits=r(47);var c={deprecate:r(206)},l=r(128),h=r(92).Buffer,d=i.Uint8Array||function(){};var p,g=r(129);function v(){}function y(t,e){s=s||r(39),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,i);else{var a=x(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(_,t,r,a,i):_(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(t){if(s=s||r(39),!(p.call(m,this)||this instanceof s))return new m(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function b(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,b(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(b(t,e,!1,e.objectMode?1:f.length,f,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)}))}function S(t,e){var r=x(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}f.inherits(m,l),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===m&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else b(t,e,!1,s,n,i,o);return u}(this,i,s,t,e,r)),a},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},m.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(38),r(204).setImmediate,r(23))},function(t,e,r){"use strict";t.exports=class{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const e=this.oldCache.get(t);return this._set(t,e),e}}set(t,e){return this.cache.has(t)?this.cache.set(t,e):this._set(t,e),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){return this.cache.has(t)?this.cache.get(t):this.oldCache.has(t)?this.oldCache.get(t):void 0}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[e]=t;this.cache.has(e)||(yield t)}}get size(){let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return this._size+t}}},function(t,e,r){e.f=r(6)},function(t,e,r){var n=r(139);function i(e,r){return t.exports=i=n||function(t,e){return t.__proto__=e,t},i(e,r)}t.exports=i},function(t,e,r){t.exports=r(311)},function(t,e,r){t.exports=r(320)},function(t,e,r){t.exports=r(343)},function(t,e,r){"use strict";t.exports={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},function(t,e,r){t.exports=r(369)},function(t,e,r){t.exports=r(397)},function(t,e,r){t.exports=r(400)},function(t,e,r){"use strict";var n=r(164);t.exports=n},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(18),i=r(12),o=r(78);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,r){var n=r(12),i=/#|\.prototype\./,o=function(t,e){var r=s[a(t)];return r==f||r!=u&&("function"==typeof e?n(e):!!e)},a=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",f=o.POLYFILL="P";t.exports=o},function(t,e,r){"use strict";var n,i,o,a=r(66),s=r(20),u=r(24),f=r(6),c=r(4),l=f("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(n=i):h=!0),null==n&&(n={}),c||u(n,l)||s(n,l,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},function(t,e,r){var n=r(12);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,r){var n=r(12);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(t,e,r){var n=r(24),i=r(28),o=r(81).indexOf,a=r(50);t.exports=function(t,e){var r,s=i(t),u=0,f=[];for(r in s)!n(a,r)&&n(s,r)&&f.push(r);for(;e.length>u;)n(s,r=e[u++])&&(~o(f,r)||f.push(r));return f}},function(t,e,r){var n=r(26);t.exports=n("document","documentElement")},function(t,e,r){var n=r(14),i=r(53),o=r(6)("species");t.exports=function(t,e){var r;return i(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!i(r.prototype)?n(r)&&null===(r=r[o])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)}},function(t,e,r){"use strict";var n=r(0),i=r(12),o=r(53),a=r(14),s=r(22),u=r(29),f=r(86),c=r(113),l=r(68),h=r(6)("isConcatSpreadable"),d=!i((function(){var t=[];return t[h]=!1,t.concat()[0]!==t})),p=l("concat"),g=function(t){if(!a(t))return!1;var e=t[h];return void 0!==e?!!e:o(t)};n({target:"Array",proto:!0,forced:!d||!p},{concat:function(t){var e,r,n,i,o,a=s(this),l=c(a,0),h=0;for(e=-1,n=arguments.length;e<n;e++)if(o=-1===e?a:arguments[e],g(o)){if(h+(i=u(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<i;r++,h++)r in o&&f(l,h,o[r])}else{if(h>=9007199254740991)throw TypeError("Maximum allowed index exceeded");f(l,h++,o)}return l.length=h,l}})},function(t,e,r){r(87),r(46),r(41),r(188),r(125),r(191);var n=r(3);t.exports=n.Promise},function(t,e,r){var n=r(13);t.exports=n.Promise},function(t,e,r){var n=r(52);t.exports=function(t,e,r){for(var i in e)r&&r.unsafe&&t[i]?t[i]=e[i]:n(t,i,e[i],r);return t}},function(t,e,r){"use strict";var n=r(26),i=r(21),o=r(6),a=r(18),s=o("species");t.exports=function(t){var e=n(t),r=i.f;a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n=r(6),i=r(35),o=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},function(t,e,r){var n=r(2);t.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&n(o.call(t)),e}}},function(t,e,r){var n=r(6)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},function(t,e,r){var n,i,o,a=r(13),s=r(12),u=r(34),f=r(15),c=r(112),l=r(78),h=a.location,d=a.setImmediate,p=a.clearImmediate,g=a.process,v=a.MessageChannel,y=a.Dispatch,m=0,b={},_=function(t){if(b.hasOwnProperty(t)){var e=b[t];delete b[t],e()}},w=function(t){return function(){_(t)}},x=function(t){_(t.data)},E=function(t){a.postMessage(t+"",h.protocol+"//"+h.host)};d&&p||(d=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return b[++m]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},n(m),m},p=function(t){delete b[t]},"process"==u(g)?n=function(t){g.nextTick(w(t))}:y&&y.now?n=function(t){y.now(w(t))}:v?(o=(i=new v).port2,i.port1.onmessage=x,n=f(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(E)?n="onreadystatechange"in l("script")?function(t){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),_(t)}}:function(t){setTimeout(w(t),0)}:(n=E,a.addEventListener("message",x,!1))),t.exports={set:d,clear:p}},function(t,e,r){var n=r(26);t.exports=n("navigator","userAgent")||""},function(t,e,r){var n=r(2),i=r(14),o=r(56);t.exports=function(t,e){if(n(t),i(e)&&e.constructor===t)return e;var r=o.f(t);return(0,r.resolve)(e),r.promise}},function(t,e,r){"use strict";var n=r(0),i=r(5),o=r(56),a=r(69),s=r(8);n({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=o.f(e),n=r.resolve,u=r.reject,f=a((function(){var r=i(e.resolve),o=[],a=0,u=1;s(t,(function(t){var i=a++,s=!1;o.push(void 0),u++,r.call(e,t).then((function(t){s||(s=!0,o[i]={status:"fulfilled",value:t},--u||n(o))}),(function(t){s||(s=!0,o[i]={status:"rejected",reason:t},--u||n(o))}))})),--u||n(o)}));return f.error&&u(f.value),r.promise}})},function(t,e,r){"use strict";(function(t){var n=r(16).Buffer,i=r(200).Transform,o=r(213),a=r(133),s=r(132).ok,u=r(16).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),l=0;l<c.length;l++){var h=c[l];h.match(/^Z/)&&Object.defineProperty(e,h,{enumerable:!0,value:o[h],writable:!1})}for(var d={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},p=Object.keys(d),g=0;g<p.length;g++){var v=p[g];d[d[v]]=v}function y(t,e,r){var i=[],o=0;function a(){for(var e;null!==(e=t.read());)i.push(e),o+=e.length;t.once("readable",a)}function s(){var e,a=null;o>=u?a=new RangeError(f):e=n.concat(i,o),i=[],t.close(),r(a,e)}t.on("error",(function(e){t.removeListener("end",s),t.removeListener("readable",a),r(e)})),t.on("end",s),t.end(e),a()}function m(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function b(t){if(!(this instanceof b))return new b(t);C.call(this,t,o.DEFLATE)}function _(t){if(!(this instanceof _))return new _(t);C.call(this,t,o.INFLATE)}function w(t){if(!(this instanceof w))return new w(t);C.call(this,t,o.GZIP)}function x(t){if(!(this instanceof x))return new x(t);C.call(this,t,o.GUNZIP)}function E(t){if(!(this instanceof E))return new E(t);C.call(this,t,o.DEFLATERAW)}function S(t){if(!(this instanceof S))return new S(t);C.call(this,t,o.INFLATERAW)}function k(t){if(!(this instanceof k))return new k(t);C.call(this,t,o.UNZIP)}function A(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function C(t,r){var a=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||e.Z_DEFAULT_CHUNK,i.call(this,t),t.flush&&!A(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!A(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSize<e.Z_MIN_CHUNK||t.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBits<e.Z_MIN_WINDOWBITS||t.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.level<e.Z_MIN_LEVEL||t.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevel<e.Z_MIN_MEMLEVEL||t.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=e.Z_FILTERED&&t.strategy!=e.Z_HUFFMAN_ONLY&&t.strategy!=e.Z_RLE&&t.strategy!=e.Z_FIXED&&t.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(t,r){T(s),s._hadError=!0;var n=new Error(t);n.errno=r,n.code=e.codes[r],s.emit("error",n)};var u=e.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(u=t.level);var f=e.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(f=t.strategy),this._handle.init(t.windowBits||e.Z_DEFAULT_WINDOWBITS,u,t.memLevel||e.Z_DEFAULT_MEMLEVEL,f,t.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=f,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function T(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function R(t){t.emit("close")}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),e.Deflate=b,e.Inflate=_,e.Gzip=w,e.Gunzip=x,e.DeflateRaw=E,e.InflateRaw=S,e.Unzip=k,e.createDeflate=function(t){return new b(t)},e.createInflate=function(t){return new _(t)},e.createDeflateRaw=function(t){return new E(t)},e.createInflateRaw=function(t){return new S(t)},e.createGzip=function(t){return new w(t)},e.createGunzip=function(t){return new x(t)},e.createUnzip=function(t){return new k(t)},e.deflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new b(e),t,r)},e.deflateSync=function(t,e){return m(new b(e),t)},e.gzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new w(e),t,r)},e.gzipSync=function(t,e){return m(new w(e),t)},e.deflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new E(e),t,r)},e.deflateRawSync=function(t,e){return m(new E(e),t)},e.unzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new k(e),t,r)},e.unzipSync=function(t,e){return m(new k(e),t)},e.inflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new _(e),t,r)},e.inflateSync=function(t,e){return m(new _(e),t)},e.gunzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new x(e),t,r)},e.gunzipSync=function(t,e){return m(new x(e),t)},e.inflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),y(new S(e),t,r)},e.inflateRawSync=function(t,e){return m(new S(e),t)},a.inherits(C,i),C.prototype.params=function(r,n,i){if(r<e.Z_MIN_LEVEL||r>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(n!=e.Z_FILTERED&&n!=e.Z_HUFFMAN_ONLY&&n!=e.Z_RLE&&n!=e.Z_FIXED&&n!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==r||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,(function(){s(a._handle,"zlib binding closed"),a._handle.params(r,n),a._hadError||(a._level=r,a._strategy=n,i&&i())}))}else t.nextTick(i)},C.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},C.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},C.prototype.flush=function(e,r){var i=this,a=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=o.Z_FULL_FLUSH),a.ended?r&&t.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",(function(){return i.flush(e,r)})):(this._flushFlag=e,this.write(n.alloc(0),"",r))},C.prototype.close=function(e){T(this,e),t.nextTick(R,this)},C.prototype._transform=function(t,e,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!t||a.length===t.length);return null===t||n.isBuffer(t)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},C.prototype._processChunk=function(t,e,r){var i=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,l="function"==typeof r;if(!l){var h,d=[],p=0;this.on("error",(function(t){h=t})),s(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(e,t,a,i,this._buffer,this._offset,o)}while(!this._hadError&&m(g[0],g[1]));if(this._hadError)throw h;if(p>=u)throw T(this),new RangeError(f);var v=n.concat(d,p);return T(this),v}s(this._handle,"zlib binding closed");var y=this._handle.write(e,t,a,i,this._buffer,this._offset,o);function m(u,f){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=o-f;if(s(h>=0,"have should not go down"),h>0){var g=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,l?c.push(g):(d.push(g),p+=g.length)}if((0===f||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===f){if(a+=i-u,i=u,!l)return!0;var v=c._handle.write(e,t,a,i,c._buffer,c._offset,c._chunkSize);return v.callback=m,void(v.buffer=t)}if(!l)return!1;r()}}y.buffer=t,y.callback=m},a.inherits(b,C),a.inherits(_,C),a.inherits(w,C),a.inherits(x,C),a.inherits(E,C),a.inherits(S,C),a.inherits(k,C)}).call(this,r(38))},function(t,e,r){"use strict";(function(e,n){var i=r(70);t.exports=b;var o,a=r(105);b.ReadableState=m;r(90).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(128),f=r(92).Buffer,c=e.Uint8Array||function(){};var l=r(57);l.inherits=r(47);var h=r(201),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,g=r(202),v=r(129);l.inherits(b,u);var y=["error","close","destroy","pause","resume"];function m(t,e){t=t||{};var n=e instanceof(o=o||r(39));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(130).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||r(39),!(this instanceof b))return new b(t);this._readableState=new m(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function _(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,a)):(i||(o=function(t,e){var r;n=e,f.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===f.prototype||(e=function(t){return f.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):A(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function w(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),A(t,e)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(t,e){this.push(null),e(t)},b.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=f.from(t,e),e=""),r=!0),_(this,t,e,!1,r)},b.prototype.unshift=function(t){return _(this,t,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(t){return p||(p=r(130).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var x=8388608;function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(k,t):k(t))}function k(t){d("emit readable"),t.emit("readable"),O(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function T(t){d("readable nexttick read 0"),t.read(0)}function R(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function I(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function L(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}b.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):S(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&L(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",i=!0),e.ended||e.reading?d("reading or ended",i=!1):i&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(n=t>0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&L(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?c:b;function f(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",v),t.removeListener("unpipe",f),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",g),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function c(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",f);var l=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",l);var h=!1;var p=!1;function g(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(e){d("onerror",e),b(),t.removeListener("error",v),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",m),b()}function m(){d("onfinish"),t.removeListener("close",y),b()}function b(){d("unpipe"),r.unpipe(t)}return r.on("data",g),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",y),t.once("finish",m),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=P(e.pipes,t);return-1===a?this:(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},b.prototype.on=function(t,e){var r=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(T,this))}return r},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(R,t,e))}(this,t)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<y.length;o++)t.on(y[o],this.emit.bind(this,y[o]));return this._read=function(e){d("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=I}).call(this,r(23),r(38))},function(t,e,r){t.exports=r(90).EventEmitter},function(t,e,r){"use strict";var n=r(70);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){"use strict";var n=r(207).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=l,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=a(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";t.exports=a;var n=r(39),i=r(57);function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);n.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){u(t,e,r)})):u(this,null,null)}function u(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=r(47),i.inherits(a,n),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},a.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},function(t,e,r){"use strict";(function(e){var n=r(214);
|
|
9
|
-
/*!
|
|
10
|
-
* The buffer module from node.js, for the browser.
|
|
11
|
-
*
|
|
12
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
13
|
-
* @license MIT
|
|
14
|
-
*/function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function o(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(133),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,f="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function l(t){return!o(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=t.exports=m,d=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(a.isFunction(t)){if(f)return t.name;var e=t.toString().match(d);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function v(t){if(f||!a.isFunction(t))return a.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function y(t,e,r,n,i){throw new h.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function m(t,e){t||y(t,!0,e,"==",h.ok)}function b(t,e,r,n){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(l(t)&&l(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=_(t),o=_(e);if(i&&!o||!i&&o)return!1;if(i)return t=u.call(t),e=u.call(e),b(t,e,r);var s,f,c=E(t),l=E(e);if(c.length!==l.length)return!1;for(c.sort(),l.sort(),f=c.length-1;f>=0;f--)if(c[f]!==l[f])return!1;for(f=c.length-1;f>=0;f--)if(s=c[f],!b(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&y(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&w(i,r)||s)&&y(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}h.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(v(t.actual),128)+" "+t.operator+" "+g(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=p(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=y,h.ok=m,h.equal=function(t,e,r){t!=e&&y(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&y(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){b(t,e,!1)||y(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){b(t,e,!0)||y(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){b(t,e,!1)&&y(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&y(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&y(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&y(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){x(!0,t,e,r)},h.doesNotThrow=function(t,e,r){x(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||y(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var E=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,r(23))},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<o;u=n[++r])g(u)||!_(u)?a+=" "+u:a+=" "+s(u);return a},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function s(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function f(t,e){return t}function c(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=c(t,i,n)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return l(r)}var f,_="",S=!1,k=["{","}"];(d(r)&&(S=!0,k=["[","]"]),E(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),x(r)&&(_=" "+l(r)),0!==a.length||S&&0!=r.length?n<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),f=S?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)T(e,String(a))?o.push(h(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))})),o}(t,r,n,s,a):a.map((function(e){return h(t,r,n,s,e,S)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return 0,e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(f,_,k)):k[0]+_+k[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),T(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return"number"==typeof t}function y(t){return"string"==typeof t}function m(t){return void 0===t}function b(t){return _(t)&&"[object RegExp]"===S(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===S(t)}function x(t){return _(t)&&("[object Error]"===S(t)||t instanceof Error)}function E(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(m(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=b,e.isObject=_,e.isDate=w,e.isError=x,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(215);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=r(216),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=R,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(O,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(38))},function(t,e,r){"use strict";t.exports=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}},function(t,e,r){r(11)("iterator")},function(t,e,r){var n=r(111),i=r(84).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){t.exports=r(260)},function(t,e,r){t.exports=r(263)},function(t,e,r){var n=r(50),i=r(14),o=r(24),a=r(21).f,s=r(64),u=r(272),f=s("meta"),c=0,l=Object.isExtensible||function(){return!0},h=function(t){a(t,f,{value:{objectID:"O"+ ++c,weakData:{}}})},d=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,f)){if(!l(t))return"F";if(!e)return"E";h(t)}return t[f].objectID},getWeakData:function(t,e){if(!o(t,f)){if(!l(t))return!0;if(!e)return!1;h(t)}return t[f].weakData},onFreeze:function(t){return u&&d.REQUIRED&&l(t)&&!o(t,f)&&h(t),t}};n[f]=!0},function(t,e,r){var n=r(2),i=r(89);t.exports=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return n(e.call(t))}},function(t,e,r){var n=r(299),i=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===i||t instanceof Array&&e===i.indexOf?n:e}},function(t,e,r){var n=r(304),i=Function.prototype;t.exports=function(t){var e=t.bind;return t===i||t instanceof Function&&e===i.bind?n:e}},function(t,e,r){"use strict";var n=r(5),i=r(14),o=[].slice,a={},s=function(t,e,r){if(!(e in a)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";a[e]=Function("C,a","return new C("+n.join(",")+")")}return a[e](t,r)};t.exports=Function.bind||function(t){var e=n(this),r=o.call(arguments,1),a=function(){var n=r.concat(o.call(arguments));return this instanceof a?s(e,n.length,n):e.apply(t,n)};return i(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=a[t])?n:(r=f(t,(0|t)<0?-1:0,!0),i&&(a[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=f(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function u(t,e){if(isNaN(t))return e?m:y;if(e){if(t<0)return m;if(t>=p)return E}else{if(t<=-g)return S;if(t+1>=g)return x}return t<0?u(-t,e).neg():f(t%d|0,t/d|0,e)}function f(t,e,r){return new n(t,e,r)}n.fromInt=s,n.fromNumber=u,n.fromBits=f;var c=Math.pow;function l(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return y;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(t.substring(1),e,r).neg();for(var i=u(c(r,8)),o=y,a=0;a<t.length;a+=8){var s=Math.min(8,t.length-a),f=parseInt(t.substring(a,a+s),r);if(s<8){var h=u(c(r,s));o=o.mul(h).add(u(f))}else o=(o=o.mul(i)).add(u(f))}return o.unsigned=e,o}function h(t,e){return"number"==typeof t?u(t,e):"string"==typeof t?l(t,e):f(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=l,n.fromValue=h;var d=4294967296,p=d*d,g=p/2,v=s(1<<24),y=s(0);n.ZERO=y;var m=s(0,!0);n.UZERO=m;var b=s(1);n.ONE=b;var _=s(1,!0);n.UONE=_;var w=s(-1);n.NEG_ONE=w;var x=f(-1,2147483647,!1);n.MAX_VALUE=x;var E=f(-1,-1,!0);n.MAX_UNSIGNED_VALUE=E;var S=f(0,-2147483648,!1);n.MIN_VALUE=S;var k=n.prototype;k.toInt=function(){return this.unsigned?this.low>>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var e=u(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=u(c(t,6),this.unsigned),o=this,a="";;){var s=o.div(i),f=(o.sub(s.mul(i)).toInt()>>>0).toString(t);if((o=s).isZero())return f+a;for(;f.length<6;)f="0"+f;a=""+f+a}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},k.isZero=function(){return 0===this.high&&0===this.low},k.eqz=k.isZero,k.isNegative=function(){return!this.unsigned&&this.high<0},k.isPositive=function(){return this.unsigned||this.high>=0},k.isOdd=function(){return 1==(1&this.low)},k.isEven=function(){return 0==(1&this.low)},k.equals=function(t){return i(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},k.eq=k.equals,k.notEquals=function(t){return!this.eq(t)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(t){return this.comp(t)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(t){return this.comp(t)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(t){return this.comp(t)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(t){return this.comp(t)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.compare=function(t){if(i(t)||(t=h(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(b)},k.neg=k.negate,k.add=function(t){i(t)||(t=h(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,u=t.low>>>16,c=0,l=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,l+=(d+=n+u)>>>16,c+=(l+=r+s)>>>16,c+=e+a,f((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},k.subtract=function(t){return i(t)||(t=h(t)),this.add(t.neg())},k.sub=k.subtract,k.multiply=function(t){if(this.isZero())return y;if(i(t)||(t=h(t)),r)return f(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return y;if(this.eq(S))return t.isOdd()?S:y;if(t.eq(S))return this.isOdd()?S:y;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return u(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=t.high>>>16,c=65535&t.high,l=t.low>>>16,d=65535&t.low,p=0,g=0,m=0,b=0;return m+=(b+=a*d)>>>16,g+=(m+=o*d)>>>16,m&=65535,g+=(m+=a*l)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=o*l)>>>16,g&=65535,p+=(g+=a*c)>>>16,p+=e*d+n*l+o*c+a*s,f((m&=65535)<<16|(b&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(t){if(i(t)||(t=h(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?f((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:y;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(S))return t.eq(b)||t.eq(w)?S:t.eq(S)?b:(e=this.shr(1).div(t).shl(1)).eq(y)?t.isNegative()?b:w:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(S))return this.unsigned?m:y;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=y}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(e)/Math.LN2),s=a<=48?1:c(2,a-48),l=u(e),d=l.mul(t);d.isNegative()||d.gt(n);)d=(l=u(e-=s,this.unsigned)).mul(t);l.isZero()&&(l=b),o=o.add(l),n=n.sub(d)}return o},k.div=k.divide,k.modulo=function(t){return i(t)||(t=h(t)),r?f((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return f(~this.low,~this.high,this.unsigned)},k.and=function(t){return i(t)||(t=h(t)),f(this.low&t.low,this.high&t.high,this.unsigned)},k.or=function(t){return i(t)||(t=h(t)),f(this.low|t.low,this.high|t.high,this.unsigned)},k.xor=function(t){return i(t)||(t=h(t)),f(this.low^t.low,this.high^t.high,this.unsigned)},k.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?f(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):f(0,this.low<<t-32,this.unsigned)},k.shl=k.shiftLeft,k.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?f(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):f(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},k.shr=k.shiftRight,k.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?f(this.low>>>t|e<<32-t,e>>>t,this.unsigned):f(32===t?e:e>>>t-32,0,this.unsigned)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?f(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:f(this.low,this.high,!0)},k.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},k.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},k.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){t.exports=r(336)},function(t,e,r){var n=r(18),i=r(51),o=r(28),a=r(65).f,s=function(t){return function(e){for(var r,s=o(e),u=i(s),f=u.length,c=0,l=[];f>c;)r=u[c++],n&&!a.call(s,r)||l.push(t?[r,s[r]]:s[r]);return l}};t.exports={entries:s(!0),values:s(!1)}},function(t,e,r){t.exports=r(339)},function(t,e,r){t.exports=r(353)},function(t,e,r){var n=r(356),i=r(153);t.exports=function(t){if(i(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return n(t)}},function(t,e,r){t.exports=r(361)},function(t,e,r){t.exports=r(373)},function(t,e,r){var n=r(13),i=r(376).trim,o=r(156),a=n.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");t.exports=u?function(t,e){var r=i(String(t));return a(r,e>>>0||(s.test(r)?16:10))}:a},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,r){var n=r(151);t.exports=function(t){if(n(t))return t}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,r){t.exports=r(394)},function(t,e,r){"use strict";var n=r(420),i=r(427),o=r(430);function a(t){var e=n.parse(t),r=e.protocol,a=e.pathname;return"file:"===r?new o(unescape(a)):new i(t)}t.exports={LocalFile:o,RemoteFile:i,fromUrl:a,open:function(t,e,r){if(r)return r;if(t)return a(t);if(e)return new o(e);throw new Error("no url, path, or filehandle provided, cannot open")}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.promisify=i;var n="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function i(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t[n],r=i.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return new r((function(r,i){o.push((function(t){if(t)return i(t);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];if(1===o.length||!e)return r(o[0]);var s={};o.forEach((function(t,r){var n=e[r];n&&(s[n]=t)})),r(s)})),t.call.apply(t,[n].concat(o))}))}}i.argumentNames=n,i.Promise=void 0},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(450),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")},o=void 0===i().AbortController?n.AbortController:i().AbortController;e.AbortController=o;var a=void 0===i().AbortController?n.AbortSignal:i().AbortSignal;e.AbortSignal=a}).call(this,r(23))},function(t,e,r){"use strict";var n=r(104),i=r(433),o=r(440);t.exports={CramFile:n,IndexedCramFile:i,CraiIndex:o}},function(t,e,r){"use strict";(function(e){var n,i=r(1),o=i(r(17)),a=i(r(37)),s=i(r(30)),u=i(r(31)),f=i(r(7)),c=i(r(10)),l=r(126),h=r(225),d=r(94),p=r(9),g=p.CramUnimplementedError,v=p.CramMalformedError,y=r(310),m=r(319),b=m.cramFileDefinition,_=m.getSectionParsers,w=r(330),x=r(160).open,E=r(58),S=E.parseItem,k=E.tinyMemoize,A=r(431).parseHeaderText,C=function(){function t(e){(0,f.default)(this,t),this.file=x(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:!1!==e.checkSequenceMD5,cacheSize:void 0!==e.cacheSize?e.cacheSize:2e4},this.featureCache=new d({maxSize:this.options.cacheSize})}var r,n,i,o,p,m,E,k,C,T;return(0,c.default)(t,[{key:"toString",value:function(){return this.file.filename?this.file.filename:this.file.url?this.file.url:"(cram file)"}},{key:"read",value:function(t,e,r,n){return this.file.read(t,e,r,n)}},{key:"stat",value:function(){return this.file.stat()}},{key:"getDefinition",value:(T=(0,u.default)(s.default.mark((function t(){var r,n;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.allocUnsafe(b.maxLength),t.next=3,this.file.read(r,0,b.maxLength,0);case 3:if(2===(n=b.parser.parse(r).result).majorVersion||3===n.majorVersion){t.next=6;break}throw new g("CRAM version ".concat(n.majorVersion," not supported"));case 6:return t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)}))),function(){return T.apply(this,arguments)})},{key:"getSamHeader",value:(C=(0,u.default)(s.default.mark((function t(){var e,r,n,i,o;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getContainerById(0);case 2:if(e=t.sent){t.next=5;break}throw new v("file contains no containers");case 5:return t.next=7,e.getFirstBlock();case 7:return r=t.sent,n=r.content,i=n.readInt32LE(0),o=n.toString("utf8",4,4+i),this.header=o,t.abrupt("return",A(o));case 14:case"end":return t.stop()}}),t,this)}))),function(){return C.apply(this,arguments)})},{key:"getHeaderText",value:(k=(0,u.default)(s.default.mark((function t(){return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getSamHeader();case 2:return t.abrupt("return",this.header);case 3:case"end":return t.stop()}}),t,this)}))),function(){return k.apply(this,arguments)})},{key:"getSectionParsers",value:(E=(0,u.default)(s.default.mark((function t(){var e,r;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getDefinition();case 2:return e=t.sent,r=e.majorVersion,t.abrupt("return",_(r));case 5:case"end":return t.stop()}}),t,this)}))),function(){return E.apply(this,arguments)})},{key:"getContainerById",value:(m=(0,u.default)(s.default.mark((function t(e){var r,n,i,o,a,u,f,c,l,h;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getSectionParsers();case 2:return r=t.sent,n=r.cramFileDefinition.maxLength,t.next=6,this.file.stat();case 6:i=t.sent,o=i.size,a=r.cramContainerHeader1,f=0;case 10:if(!(f<=e)){t.next=36;break}if(!(n+a.maxLength+8>=o)){t.next=13;break}return t.abrupt("return",void 0);case 13:return u=this.getContainerAtPosition(n),t.next=16,u.getHeader();case 16:if(c=t.sent){t.next=19;break}throw new v("container ".concat(e," not found in file"));case 19:if(0!==f){t.next=32;break}n=c._endPosition,l=0;case 22:if(!(l<c.numBlocks)){t.next=30;break}return t.next=25,this.readBlock(n);case 25:h=t.sent,n=h._endPosition;case 27:l+=1,t.next=22;break;case 30:t.next=33;break;case 32:n+=c._size+c.length;case 33:f+=1,t.next=10;break;case 36:return t.abrupt("return",u);case 37:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"checkCrc32",value:(p=(0,u.default)(s.default.mark((function t(r,n,i,o){var u,f,c,l;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=e.allocUnsafe(n),t.next=3,this.file.read(u,0,n,r);case 3:if((f=h.unsigned(u))===i){t.next=6;break}throw new v((0,a.default)(c=(0,a.default)(l="crc mismatch in ".concat(o,": recorded CRC32 = ")).call(l,i,", but calculated CRC32 = ")).call(c,f));case 6:case"end":return t.stop()}}),t,this)}))),function(t,e,r,n){return p.apply(this,arguments)})},{key:"containerCount",value:(o=(0,u.default)(s.default.mark((function t(){var e,r,n,i,o,a,u,f,c;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getSectionParsers();case 2:return e=t.sent,t.next=5,this.file.stat();case 5:r=t.sent,n=r.size,i=e.cramContainerHeader1,o=0,a=e.cramFileDefinition.maxLength;case 10:if(!(a+i.maxLength+8<n)){t.next=33;break}return t.next=13,this.getContainerAtPosition(a).getHeader();case 13:if(u=t.sent){t.next=16;break}return t.abrupt("break",33);case 16:if(0!==o){t.next=29;break}a=u._endPosition,f=0;case 19:if(!(f<u.numBlocks)){t.next=27;break}return t.next=22,this.readBlock(a);case 22:c=t.sent,a=c._endPosition;case 24:f+=1,t.next=19;break;case 27:t.next=30;break;case 29:a+=u._size+u.length;case 30:o+=1,t.next=10;break;case 33:return t.abrupt("return",o);case 34:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getContainerAtPosition",value:function(t){return new w(this,t)}},{key:"readBlockHeader",value:(i=(0,u.default)(s.default.mark((function t(r){var n,i,o,a,u;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getSectionParsers();case 2:return n=t.sent,i=n.cramBlockHeader,t.next=6,this.file.stat();case 6:if(o=t.sent,a=o.size,!(r+i.maxLength>=a)){t.next=10;break}return t.abrupt("return",void 0);case 10:return u=e.allocUnsafe(i.maxLength),t.next=13,this.file.read(u,0,i.maxLength,r);case 13:return t.abrupt("return",S(u,i.parser,0,r));case 14:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"_parseSection",value:(n=(0,u.default)(s.default.mark((function t(r,n){var i,o,u,f,c,l,h,d=arguments;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=d.length>2&&void 0!==d[2]?d[2]:r.maxLength,!(u=d.length>3?d[3]:void 0)){t.next=6;break}f=u,t.next=15;break;case 6:return t.next=8,this.file.stat();case 8:if(c=t.sent,l=c.size,!(n+o>=l)){t.next=12;break}return t.abrupt("return",void 0);case 12:return f=e.allocUnsafe(o),t.next=15,this.file.read(f,0,o,n);case 15:if((h=S(f,r.parser,0,n))._size===o){t.next=18;break}throw new v((0,a.default)(i="section read error: requested size ".concat(o," does not equal parsed size ")).call(i,h._size));case 18:return t.abrupt("return",h);case 19:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"_uncompress",value:function(t,e,r){if("gzip"===t){l.gunzipSync(e).copy(r)}else{if("rans"!==t)throw new g("".concat(t," decompression not yet implemented"));y.uncompress(e,r)}}},{key:"readBlock",value:(r=(0,u.default)(s.default.mark((function t(r){var n,i,o,a,u,f,c,l;return s.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getDefinition();case 2:return n=t.sent,i=n.majorVersion,t.next=6,this.getSectionParsers();case 6:return o=t.sent,t.next=9,this.readBlockHeader(r);case 9:if(a=t.sent,u=a._endPosition,a.contentPosition=a._endPosition,f=e.allocUnsafe(a.uncompressedSize),"raw"===a.compressionMethod){t.next=20;break}return c=e.allocUnsafe(a.compressedSize),t.next=17,this.read(c,0,a.compressedSize,u);case 17:this._uncompress(a.compressionMethod,c,f),t.next=22;break;case 20:return t.next=22,this.read(f,0,a.uncompressedSize,u);case 22:if(a.content=f,!(i>=3)){t.next=35;break}return t.next=26,this._parseSection(o.cramBlockCrc32,u+a.compressedSize);case 26:if(l=t.sent,a.crc32=l.crc32,!this.validateChecksums){t.next=31;break}return t.next=31,this.checkCrc32(r,a._size+a.compressedSize,a.crc32,"block data");case 31:a._endPosition=l._endPosition,a._size=a.compressedSize+o.cramBlockCrc32.maxLength,t.next=37;break;case 35:a._endPosition=u+a.compressedSize,a._size=a.compressedSize;case 37:return t.abrupt("return",a);case 38:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})}]),t}();(0,o.default)(n="getDefinition getSectionParsers getSamHeader".split(" ")).call(n,(function(t){return k(C,t)})),t.exports=C}).call(this,r(16).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[c++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*g}},function(t,e,r){r(41);var n=r(177),i=r(67),o=Array.prototype,a={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.forEach;return t===o||t instanceof Array&&e===o.forEach||a.hasOwnProperty(i(t))?n:e}},function(t,e,r){"use strict";var n=r(28),i=r(77),o=r(35),a=r(42),s=r(79),u=a.set,f=a.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,r){var n=r(13),i=r(170),o=n.WeakMap;t.exports="function"==typeof o&&/native code/.test(i.call(o))},function(t,e,r){var n=r(61);t.exports=n("native-function-to-string",Function.toString)},function(t,e,r){var n=r(13),i=r(20);t.exports=function(t,e){try{i(n,t,e)}catch(r){n[t]=e}return e}},function(t,e,r){"use strict";var n=r(108).IteratorPrototype,i=r(44),o=r(43),a=r(36),s=r(35),u=function(){return this};t.exports=function(t,e,r){var f=e+" Iterator";return t.prototype=i(n,{next:o(1,r)}),a(t,f,!1,!0),s[f]=u,t}},function(t,e,r){var n=r(18),i=r(21),o=r(2),a=r(51);t.exports=n?Object.defineProperties:function(t,e){o(t);for(var r,n=a(e),s=n.length,u=0;s>u;)i.f(t,r=n[u++],e[r]);return t}},function(t,e,r){"use strict";var n=r(67),i={};i[r(6)("toStringTag")]="z",t.exports="[object z]"!==String(i)?function(){return"[object "+n(this)+"]"}:i.toString},function(t,e,r){var n=r(14);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,r){t.exports=r(178)},function(t,e,r){r(179);var n=r(19);t.exports=n("Array").forEach},function(t,e,r){"use strict";var n=r(0),i=r(180);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},function(t,e,r){"use strict";var n=r(45).forEach,i=r(54);t.exports=i("forEach")?function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach},function(t,e,r){t.exports=r(182)},function(t,e,r){var n=r(183),i=Array.prototype;t.exports=function(t){var e=t.concat;return t===i||t instanceof Array&&e===i.concat?n:e}},function(t,e,r){r(114);var n=r(19);t.exports=n("Array").concat},function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),a=new C(n||[]);return o._invoke=function(t,e,r){var n=c;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return R()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===c)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?d:l,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),o}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",l="suspendedYield",h="executing",d="completed",p={};function g(){}function v(){}function y(){}var m={};m[o]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(T([])));_&&_!==r&&n.call(_,o)&&(m=_);var w=y.prototype=g.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function E(t){var e;this._invoke=function(r,i){function o(){return new Promise((function(e,o){!function e(r,i,o,a){var s=f(t[r],t,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?Promise.resolve(c.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(c).then((function(t){u.value=t,o(u)}),(function(t){return e("throw",t,o,a)}))}a(s.arg)}(r,i,e,o)}))}return e=e?e.then(o,o):o()}}function S(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=f(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,p;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:e,done:!0}}return v.prototype=w.constructor=y,y.constructor=v,y[s]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(E.prototype),E.prototype[a]=function(){return this},t.AsyncIterator=E,t.async=function(e,r,n,i){var o=new E(u(e,r,n,i));return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(w),w[s]="Generator",w[o]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){t.exports=r(186)},function(t,e,r){t.exports=r(115),r(192),r(193),r(194),r(195)},function(t,e,r){var n=r(82),i=r(49),o=function(t){return function(e,r){var o,a,s=String(i(e)),u=n(r),f=s.length;return u<0||u>=f?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===f||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e,r){"use strict";var n,i,o,a,s=r(0),u=r(4),f=r(13),c=r(3),l=r(116),h=r(52),d=r(117),p=r(36),g=r(118),v=r(14),y=r(5),m=r(88),b=r(34),_=r(8),w=r(121),x=r(55),E=r(122).set,S=r(189),k=r(124),A=r(190),C=r(56),T=r(69),R=r(123),O=r(42),I=r(107),L=r(6)("species"),B="Promise",P=O.get,F=O.set,N=O.getterFor(B),M=l,j=f.TypeError,z=f.document,U=f.process,D=f.fetch,q=U&&U.versions,Z=q&&q.v8||"",H=C.f,V=H,G="process"==b(U),Y=!!(z&&z.createEvent&&f.dispatchEvent),W=I(B,(function(){var t=M.resolve(1),e=function(){},r=(t.constructor={})[L]=function(t){t(e,e)};return!((G||"function"==typeof PromiseRejectionEvent)&&(!u||t.finally)&&t.then(e)instanceof r&&0!==Z.indexOf("6.6")&&-1===R.indexOf("Chrome/66"))})),K=W||!w((function(t){M.all(t).catch((function(){}))})),Q=function(t){var e;return!(!v(t)||"function"!=typeof(e=t.then))&&e},X=function(t,e,r){if(!e.notified){e.notified=!0;var n=e.reactions;S((function(){for(var i=e.value,o=1==e.state,a=0;n.length>a;){var s,u,f,c=n[a++],l=o?c.ok:c.fail,h=c.resolve,d=c.reject,p=c.domain;try{l?(o||(2===e.rejection&&et(t,e),e.rejection=1),!0===l?s=i:(p&&p.enter(),s=l(i),p&&(p.exit(),f=!0)),s===c.promise?d(j("Promise-chain cycle")):(u=Q(s))?u.call(s,h,d):h(s)):d(i)}catch(t){p&&!f&&p.exit(),d(t)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&J(t,e)}))}},$=function(t,e,r){var n,i;Y?((n=z.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),f.dispatchEvent(n)):n={promise:e,reason:r},(i=f["on"+t])?i(n):"unhandledrejection"===t&&A("Unhandled promise rejection",r)},J=function(t,e){E.call(f,(function(){var r,n=e.value;if(tt(e)&&(r=T((function(){G?U.emit("unhandledRejection",n,t):$("unhandledrejection",t,n)})),e.rejection=G||tt(e)?2:1,r.error))throw r.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},et=function(t,e){E.call(f,(function(){G?U.emit("rejectionHandled",t):$("rejectionhandled",t,e.value)}))},rt=function(t,e,r,n){return function(i){t(e,r,i,n)}},nt=function(t,e,r,n){e.done||(e.done=!0,n&&(e=n),e.value=r,e.state=2,X(t,e,!0))},it=function(t,e,r,n){if(!e.done){e.done=!0,n&&(e=n);try{if(t===r)throw j("Promise can't be resolved itself");var i=Q(r);i?S((function(){var n={done:!1};try{i.call(r,rt(it,t,n,e),rt(nt,t,n,e))}catch(r){nt(t,n,r,e)}})):(e.value=r,e.state=1,X(t,e,!1))}catch(r){nt(t,{done:!1},r,e)}}};W&&(M=function(t){m(this,M,B),y(t),n.call(this);var e=P(this);try{t(rt(it,this,e),rt(nt,this,e))}catch(t){nt(this,e,t)}},(n=function(t){F(this,{type:B,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(M.prototype,{then:function(t,e){var r=N(this),n=H(x(this,M));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=G?U.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&X(this,r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new n,e=P(t);this.promise=t,this.resolve=rt(it,t,e),this.reject=rt(nt,t,e)},C.f=H=function(t){return t===M||t===o?new i(t):V(t)},u||"function"!=typeof l||(a=l.prototype.then,h(l.prototype,"then",(function(t,e){var r=this;return new M((function(t,e){a.call(r,t,e)})).then(t,e)})),"function"==typeof D&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return k(M,D.apply(f,arguments))}}))),s({global:!0,wrap:!0,forced:W},{Promise:M}),p(M,B,!1,!0),g(B),o=c.Promise,s({target:B,stat:!0,forced:W},{reject:function(t){var e=H(this);return e.reject.call(void 0,t),e.promise}}),s({target:B,stat:!0,forced:u||W},{resolve:function(t){return k(u&&this===o?M:this,t)}}),s({target:B,stat:!0,forced:K},{all:function(t){var e=this,r=H(e),n=r.resolve,i=r.reject,o=T((function(){var r=y(e.resolve),o=[],a=0,s=1;_(t,(function(t){var u=a++,f=!1;o.push(void 0),s++,r.call(e,t).then((function(t){f||(f=!0,o[u]=t,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(t){var e=this,r=H(e),n=r.reject,i=T((function(){var i=y(e.resolve);_(t,(function(t){i.call(e,t).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},function(t,e,r){var n,i,o,a,s,u,f,c,l=r(13),h=r(80).f,d=r(34),p=r(122).set,g=r(123),v=l.MutationObserver||l.WebKitMutationObserver,y=l.process,m=l.Promise,b="process"==d(y),_=h(l,"queueMicrotask"),w=_&&_.value;w||(n=function(){var t,e;for(b&&(t=y.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(t){throw i?a():o=void 0,t}}o=void 0,t&&t.enter()},b?a=function(){y.nextTick(n)}:v&&!/(iphone|ipod|ipad).*applewebkit/i.test(g)?(s=!0,u=document.createTextNode(""),new v(n).observe(u,{characterData:!0}),a=function(){u.data=s=!s}):m&&m.resolve?(f=m.resolve(void 0),c=f.then,a=function(){c.call(f,n)}):a=function(){p.call(l,n)}),t.exports=w||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,a()),o=e}},function(t,e,r){var n=r(13);t.exports=function(t,e){var r=n.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(116),a=r(26),s=r(55),u=r(124),f=r(52);n({target:"Promise",proto:!0,real:!0},{finally:function(t){var e=s(this,a("Promise")),r="function"==typeof t;return this.then(r?function(r){return u(e,t()).then((function(){return r}))}:t,r?function(r){return u(e,t()).then((function(){throw r}))}:t)}}),i||"function"!=typeof o||o.prototype.finally||f(o.prototype,"finally",a("Promise").prototype.finally)},function(t,e,r){var n=r(0),i=r(66),o=r(85),a=r(44),s=r(43),u=r(8),f=r(20),c=function(t,e){var r=this;if(!(r instanceof c))return new c(t,e);o&&(r=o(new Error(e),i(r)));var n=[];return u(t,n.push,n),f(r,"errors",n),void 0!==e&&f(r,"message",String(e)),r};c.prototype=a(Error.prototype,{constructor:s(5,c),name:s(5,"AggregateError")}),n({global:!0},{AggregateError:c})},function(t,e,r){r(125)},function(t,e,r){"use strict";var n=r(0),i=r(56),o=r(69);n({target:"Promise",stat:!0},{try:function(t){var e=i.f(this),r=o(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},function(t,e,r){"use strict";var n=r(0),i=r(5),o=r(26),a=r(56),s=r(69),u=r(8);n({target:"Promise",stat:!0},{any:function(t){var e=this,r=a.f(e),n=r.resolve,f=r.reject,c=s((function(){var r=i(e.resolve),a=[],s=0,c=1,l=!1;u(t,(function(t){var i=s++,u=!1;a.push(void 0),c++,r.call(e,t).then((function(t){u||l||(l=!0,n(t))}),(function(t){u||l||(u=!0,a[i]=t,--c||f(new(o("AggregateError"))(a,"No one promise resolved")))}))})),--c||f(new(o("AggregateError"))(a,"No one promise resolved"))}));return c.error&&f(c.value),r.promise}})},function(t,e,r){t.exports=r(197)},function(t,e,r){t.exports=r(198)},function(t,e,r){r(199);var n=r(3).Object,i=t.exports=function(t,e,r){return n.defineProperty(t,e,r)};n.defineProperty.sham&&(i.sham=!0)},function(t,e,r){var n=r(0),i=r(18);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:r(21).f})},function(t,e,r){t.exports=i;var n=r(90).EventEmitter;function i(){n.call(this)}r(47)(i,n),i.Readable=r(91),i.Writable=r(209),i.Duplex=r(210),i.Transform=r(211),i.PassThrough=r(212),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",f),t.on("error",f),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},function(t,e){},function(t,e,r){"use strict";var n=r(92).Buffer,i=r(203);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(205),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(23))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,u=1,f={},c=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(t){var e=l.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return f[u]=i,n(u),u++},h.clearImmediate=d}function d(t){delete f[t]}function p(t){if(c)setTimeout(p,0,t);else{var e=f[t];if(e){c=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}(e)}finally{d(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(23),r(38))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(23))},function(t,e,r){var n=r(16),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";t.exports=o;var n=r(131),i=r(57);function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(47),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(93)},function(t,e,r){t.exports=r(39)},function(t,e,r){t.exports=r(91).Transform},function(t,e,r){t.exports=r(91).PassThrough},function(t,e,r){"use strict";(function(t,n){var i=r(132),o=r(217),a=r(218),s=r(221),u=r(224);for(var f in u)e[f]=u[f];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;function c(t){if("number"!=typeof t||t<e.DEFLATE||t>e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==e.INFLATE&&this.mode!==e.GUNZIP&&this.mode!==e.INFLATERAW&&this.mode!==e.UNZIP||s.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null)},c.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},c.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},c.prototype._write=function(r,o,a,s,u,f,c,l){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==e.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==e.Z_NO_FLUSH&&o!==e.Z_PARTIAL_FLUSH&&o!==e.Z_SYNC_FLUSH&&o!==e.Z_FULL_FLUSH&&o!==e.Z_FINISH&&o!==e.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=t.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=f,this.strm.next_out=c,this.flush=o,!r)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return n.nextTick((function(){h._process(),h._after()})),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=e.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,r,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(r>=-1&&r<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===e.Z_FILTERED||o===e.Z_HUFFMAN_ONLY||o===e.Z_RLE||o===e.Z_FIXED||o===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,t,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,r,n,i,u){switch(this.level=t,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,this.mode!==e.GZIP&&this.mode!==e.GUNZIP||(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),this.mode!==e.DEFLATERAW&&this.mode!==e.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=u,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=a.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=c}).call(this,r(16).Buffer,r(38))},function(t,e,r){"use strict";
|
|
15
|
-
/*
|
|
16
|
-
object-assign
|
|
17
|
-
(c) Sindre Sorhus
|
|
18
|
-
@license MIT
|
|
19
|
-
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,u=a(t),f=1;f<arguments.length;f++){for(var c in r=Object(arguments[f]))i.call(r,c)&&(u[c]=r[c]);if(n){s=n(r);for(var l=0;l<s.length;l++)o.call(r,s[l])&&(u[s[l]]=r[s[l]])}}return u}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){"use strict";var n,i=r(71),o=r(219),a=r(134),s=r(135),u=r(220),f=0,c=1,l=3,h=4,d=5,p=0,g=1,v=-2,y=-3,m=-5,b=-1,_=1,w=2,x=3,E=4,S=0,k=2,A=8,C=9,T=15,R=8,O=286,I=30,L=19,B=2*O+1,P=15,F=3,N=258,M=N+F+1,j=32,z=42,U=69,D=73,q=91,Z=103,H=113,V=666,G=1,Y=2,W=3,K=4,Q=3;function X(t,e){return t.msg=u[e],e}function $(t){return(t<<1)-(t>4?9:0)}function J(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-M?t.strstart-(t.w_size-M):0,f=t.window,c=t.w_mask,l=t.prev,h=t.strstart+N,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]===p&&f[r+a-1]===d&&f[r]===f[o]&&f[++r]===f[o+1]){o+=2,r++;do{}while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&o<h);if(n=N-(h-o),o=h-N,n>a){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}}while((e=l[e&c])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ot(t){var e,r,n,o,u,f,c,l,h,d,p=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-M)){i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=p?n-p:0}while(--r);e=r=p;do{n=t.prev[--e],t.prev[e]=n>=p?n-p:0}while(--r);o+=p}if(0===t.strm.avail_in)break;if(f=t.strm,c=t.window,l=t.strstart+t.lookahead,h=o,d=void 0,(d=f.avail_in)>h&&(d=h),r=0===d?0:(f.avail_in-=d,i.arraySet(c,f.input,f.next_in,d,l),1===f.state.wrap?f.adler=a(f.adler,c,d,l):2===f.state.wrap&&(f.adler=s(f.adler,c,d,l)),f.next_in+=d,f.total_in+=d,d),t.lookahead+=r,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+F-1])&t.hash_mask,t.prev[u&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=u,u++,t.insert--,!(t.lookahead+t.insert<F)););}while(t.lookahead<M&&0!==t.strm.avail_in)}function at(t,e){for(var r,n;;){if(t.lookahead<M){if(ot(t),t.lookahead<M&&e===f)return G;if(0===t.lookahead)break}if(r=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-M&&(t.match_length=it(t,r)),t.match_length>=F)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(et(t,!1),0===t.strm.avail_out))return G}return t.insert=t.strstart<F-1?t.strstart:F-1,e===h?(et(t,!0),0===t.strm.avail_out?W:K):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?G:Y}function st(t,e){for(var r,n,i;;){if(t.lookahead<M){if(ot(t),t.lookahead<M&&e===f)return G;if(0===t.lookahead)break}if(r=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=F-1,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-M&&(t.match_length=it(t,r),t.match_length<=5&&(t.strategy===_||t.match_length===F&&t.strstart-t.match_start>4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-F,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=F-1,t.strstart++,n&&(et(t,!1),0===t.strm.avail_out))return G}else if(t.match_available){if((n=o._tr_tally(t,0,t.window[t.strstart-1]))&&et(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return G}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<F-1?t.strstart:F-1,e===h?(et(t,!0),0===t.strm.avail_out?W:K):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?G:Y}function ut(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function ft(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*B),this.dyn_dtree=new i.Buf16(2*(2*I+1)),this.bl_tree=new i.Buf16(2*(2*L+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(P+1),this.heap=new i.Buf16(2*O+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*O+1),J(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ct(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=k,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?z:H,t.adler=2===e.wrap?0:1,e.last_flush=f,o._tr_init(e),p):X(t,v)}function lt(t){var e,r=ct(t);return r===p&&((e=t.state).window_size=2*e.w_size,J(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=F-1,e.match_available=0,e.ins_h=0),r}function ht(t,e,r,n,o,a){if(!t)return v;var s=1;if(e===b&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>C||r!==A||n<8||n>15||e<0||e>9||a<0||a>E)return X(t,v);8===n&&(n=9);var u=new ft;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+F-1)/F),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=a,u.method=r,lt(t)}n=[new ut(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===f)return G;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,et(t,!1),0===t.strm.avail_out))return G;if(t.strstart-t.block_start>=t.w_size-M&&(et(t,!1),0===t.strm.avail_out))return G}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?W:K):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),G)})),new ut(4,4,8,4,at),new ut(4,5,16,8,at),new ut(4,6,32,32,at),new ut(4,4,16,16,st),new ut(8,16,32,32,st),new ut(8,16,128,128,st),new ut(8,32,128,256,st),new ut(32,128,258,1024,st),new ut(32,258,258,4096,st)],e.deflateInit=function(t,e){return ht(t,e,A,T,R,S)},e.deflateInit2=ht,e.deflateReset=lt,e.deflateResetKeep=ct,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?v:(t.state.gzhead=e,p):v},e.deflate=function(t,e){var r,i,a,u;if(!t||!t.state||e>d||e<0)return t?X(t,v):v;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===V&&e!==h)return X(t,0===t.avail_out?m:v);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===z)if(2===i.wrap)t.adler=0,rt(i,31),rt(i,139),rt(i,8),i.gzhead?(rt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),rt(i,255&i.gzhead.time),rt(i,i.gzhead.time>>8&255),rt(i,i.gzhead.time>>16&255),rt(i,i.gzhead.time>>24&255),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(rt(i,255&i.gzhead.extra.length),rt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,Q),i.status=H);else{var y=A+(i.w_bits-8<<4)<<8;y|=(i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(y|=j),y+=31-y%31,i.status=H,nt(i,y),0!==i.strstart&&(nt(i,t.adler>>>16),nt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending!==i.pending_buf_size));)rt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=D)}else i.status=D;if(i.status===D)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,rt(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=q)}else i.status=q;if(i.status===q)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,rt(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=Z)}else i.status=Z;if(i.status===Z&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(rt(i,255&t.adler),rt(i,t.adler>>8&255),t.adler=0,i.status=H)):i.status=H),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,p}else if(0===t.avail_in&&$(e)<=$(r)&&e!==h)return X(t,m);if(i.status===V&&0!==t.avail_in)return X(t,m);if(0!==t.avail_in||0!==i.lookahead||e!==f&&i.status!==V){var b=i.strategy===w?function(t,e){for(var r;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===f)return G;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(et(t,!1),0===t.strm.avail_out))return G}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?W:K):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?G:Y}(i,e):i.strategy===x?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=N){if(ot(t),t.lookahead<=N&&e===f)return G;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+N;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);t.match_length=N-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(r=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(et(t,!1),0===t.strm.avail_out))return G}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?W:K):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?G:Y}(i,e):n[i.level].func(i,e);if(b!==W&&b!==K||(i.status=V),b===G||b===W)return 0===t.avail_out&&(i.last_flush=-1),p;if(b===Y&&(e===c?o._tr_align(i):e!==d&&(o._tr_stored_block(i,0,0,!1),e===l&&(J(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,p}return e!==h?p:i.wrap<=0?g:(2===i.wrap?(rt(i,255&t.adler),rt(i,t.adler>>8&255),rt(i,t.adler>>16&255),rt(i,t.adler>>24&255),rt(i,255&t.total_in),rt(i,t.total_in>>8&255),rt(i,t.total_in>>16&255),rt(i,t.total_in>>24&255)):(nt(i,t.adler>>>16),nt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?p:g)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==z&&e!==U&&e!==D&&e!==q&&e!==Z&&e!==H&&e!==V?X(t,v):(t.state=null,e===H?X(t,y):p):v},e.deflateSetDictionary=function(t,e){var r,n,o,s,u,f,c,l,h=e.length;if(!t||!t.state)return v;if(2===(s=(r=t.state).wrap)||1===s&&r.status!==z||r.lookahead)return v;for(1===s&&(t.adler=a(t.adler,e,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(J(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,e,h-r.w_size,r.w_size,0),e=l,h=r.w_size),u=t.avail_in,f=t.next_in,c=t.input,t.avail_in=h,t.next_in=0,t.input=e,ot(r);r.lookahead>=F;){n=r.strstart,o=r.lookahead-(F-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+F-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=F-1,ot(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=F-1,r.match_available=0,t.next_in=f,t.input=c,t.avail_in=u,r.wrap=s,p},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,r){"use strict";var n=r(71),i=4,o=0,a=1,s=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var f=0,c=1,l=2,h=29,d=256,p=d+1+h,g=30,v=19,y=2*p+1,m=15,b=16,_=7,w=256,x=16,E=17,S=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=new Array(2*(p+2));u(R);var O=new Array(2*g);u(O);var I=new Array(512);u(I);var L=new Array(256);u(L);var B=new Array(h);u(B);var P,F,N,M=new Array(g);function j(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function z(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?I[t]:I[256+(t>>>7)]}function D(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function q(t,e,r){t.bi_valid>b-r?(t.bi_buf|=e<<t.bi_valid&65535,D(t,t.bi_buf),t.bi_buf=e>>b-t.bi_valid,t.bi_valid+=r-b):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function Z(t,e,r){q(t,r[2*e],r[2*e+1])}function H(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function V(t,e,r){var n,i,o=new Array(m+1),a=0;for(n=1;n<=m;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=H(o[s]++,s))}}function G(t){var e;for(e=0;e<p;e++)t.dyn_ltree[2*e]=0;for(e=0;e<g;e++)t.dyn_dtree[2*e]=0;for(e=0;e<v;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*w]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Y(t){t.bi_valid>8?D(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function W(t,e,r,n){var i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]}function K(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&W(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!W(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function Q(t,e,r){var n,i,o,a,s=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*s]<<8|t.pending_buf[t.d_buf+2*s+1],i=t.pending_buf[t.l_buf+s],s++,0===n?Z(t,i,e):(Z(t,(o=L[i])+d+1,e),0!==(a=k[o])&&q(t,i-=B[o],a),Z(t,o=U(--n),r),0!==(a=A[o])&&q(t,n-=M[o],a))}while(s<t.last_lit);Z(t,w,e)}function X(t,e){var r,n,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,f=-1;for(t.heap_len=0,t.heap_max=y,r=0;r<u;r++)0!==o[2*r]?(t.heap[++t.heap_len]=f=r,t.depth[r]=0):o[2*r+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=f<2?++f:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=f,r=t.heap_len>>1;r>=1;r--)K(t,o,r);i=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],K(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,K(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,u=e.dyn_tree,f=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=m;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<y;r++)(o=u[2*u[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,g++),u[2*n+1]=o,n>f||(t.bl_count[o]++,a=0,n>=d&&(a=h[n-d]),s=u[2*n],t.opt_len+=s*(o+a),l&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>f||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(t,e),V(o,f,t.bl_count)}function $(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s<u&&i===a||(s<f?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*x]++):s<=10?t.bl_tree[2*E]++:t.bl_tree[2*S]++,s=0,o=i,0===a?(u=138,f=3):i===a?(u=6,f=3):(u=7,f=4))}function J(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s<u&&i===a)){if(s<f)do{Z(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Z(t,i,t.bl_tree),s--),Z(t,x,t.bl_tree),q(t,s-3,2)):s<=10?(Z(t,E,t.bl_tree),q(t,s-3,3)):(Z(t,S,t.bl_tree),q(t,s-11,7));s=0,o=i,0===a?(u=138,f=3):i===a?(u=6,f=3):(u=7,f=4)}}u(M);var tt=!1;function et(t,e,r,i){q(t,(f<<1)+(i?1:0),3),function(t,e,r,i){Y(t),i&&(D(t,r),D(t,~r)),n.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r,!0)}e._tr_init=function(t){tt||(!function(){var t,e,r,n,i,o=new Array(m+1);for(r=0,n=0;n<h-1;n++)for(B[n]=r,t=0;t<1<<k[n];t++)L[r++]=n;for(L[r-1]=n,i=0,n=0;n<16;n++)for(M[n]=i,t=0;t<1<<A[n];t++)I[i++]=n;for(i>>=7;n<g;n++)for(M[n]=i<<7,t=0;t<1<<A[n]-7;t++)I[256+i++]=n;for(e=0;e<=m;e++)o[e]=0;for(t=0;t<=143;)R[2*t+1]=8,t++,o[8]++;for(;t<=255;)R[2*t+1]=9,t++,o[9]++;for(;t<=279;)R[2*t+1]=7,t++,o[7]++;for(;t<=287;)R[2*t+1]=8,t++,o[8]++;for(V(R,p+1,o),t=0;t<g;t++)O[2*t+1]=5,O[2*t]=H(t,5);P=new j(R,k,d+1,p,m),F=new j(O,A,0,g,m),N=new j(new Array(0),C,0,v,_)}(),tt=!0),t.l_desc=new z(t.dyn_ltree,P),t.d_desc=new z(t.dyn_dtree,F),t.bl_desc=new z(t.bl_tree,N),t.bi_buf=0,t.bi_valid=0,G(t)},e._tr_stored_block=et,e._tr_flush_block=function(t,e,r,n){var u,f,h=0;t.level>0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e<d;e++)if(0!==t.dyn_ltree[2*e])return a;return o}(t)),X(t,t.l_desc),X(t,t.d_desc),h=function(t){var e;for($(t,t.dyn_ltree,t.l_desc.max_code),$(t,t.dyn_dtree,t.d_desc.max_code),X(t,t.bl_desc),e=v-1;e>=3&&0===t.bl_tree[2*T[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(f=t.static_len+3+7>>>3)<=u&&(u=f)):u=f=r+5,r+4<=u&&-1!==e?et(t,e,r,n):t.strategy===i||f===u?(q(t,(c<<1)+(n?1:0),3),Q(t,R,O)):(q(t,(l<<1)+(n?1:0),3),function(t,e,r,n){var i;for(q(t,e-257,5),q(t,r-1,5),q(t,n-4,4),i=0;i<n;i++)q(t,t.bl_tree[2*T[i]+1],3);J(t,t.dyn_ltree,e-1),J(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),Q(t,t.dyn_ltree,t.dyn_dtree)),G(t),n&&Y(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(L[r]+d+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){q(t,c<<1,3),Z(t,w,R),function(t){16===t.bi_valid?(D(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,r){"use strict";var n=r(71),i=r(134),o=r(135),a=r(222),s=r(223),u=0,f=1,c=2,l=4,h=5,d=6,p=0,g=1,v=2,y=-2,m=-3,b=-4,_=-5,w=8,x=1,E=2,S=3,k=4,A=5,C=6,T=7,R=8,O=9,I=10,L=11,B=12,P=13,F=14,N=15,M=16,j=17,z=18,U=19,D=20,q=21,Z=22,H=23,V=24,G=25,Y=26,W=27,K=28,Q=29,X=30,$=31,J=32,tt=852,et=592,rt=15;function nt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ot(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=x,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,p):y}function at(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,ot(t)):y}function st(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?y:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,at(t))):y}function ut(t,e){var r,n;return t?(n=new it,t.state=n,n.window=null,(r=st(t,e))!==p&&(t.state=null),r):y}var ft,ct,lt=!0;function ht(t){if(lt){var e;for(ft=new n.Buf32(512),ct=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(f,t.lens,0,288,ft,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,ct,0,t.work,{bits:5}),lt=!1}t.lencode=ft,t.lenbits=9,t.distcode=ct,t.distbits=5}function dt(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}e.inflateReset=at,e.inflateReset2=st,e.inflateResetKeep=ot,e.inflateInit=function(t){return ut(t,rt)},e.inflateInit2=ut,e.inflate=function(t,e){var r,tt,et,rt,it,ot,at,st,ut,ft,ct,lt,pt,gt,vt,yt,mt,bt,_t,wt,xt,Et,St,kt,At=0,Ct=new n.Buf8(4),Tt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return y;(r=t.state).mode===B&&(r.mode=P),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,ut=r.bits,ft=ot,ct=at,Et=p;t:for(;;)switch(r.mode){case x:if(0===r.wrap){r.mode=P;break}for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(2&r.wrap&&35615===st){r.check=0,Ct[0]=255&st,Ct[1]=st>>>8&255,r.check=o(r.check,Ct,2,0),st=0,ut=0,r.mode=E;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",r.mode=X;break}if((15&st)!==w){t.msg="unknown compression method",r.mode=X;break}if(ut-=4,xt=8+(15&(st>>>=4)),0===r.wbits)r.wbits=xt;else if(xt>r.wbits){t.msg="invalid window size",r.mode=X;break}r.dmax=1<<xt,t.adler=r.check=1,r.mode=512&st?I:B,st=0,ut=0;break;case E:for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(r.flags=st,(255&r.flags)!==w){t.msg="unknown compression method",r.mode=X;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=X;break}r.head&&(r.head.text=st>>8&1),512&r.flags&&(Ct[0]=255&st,Ct[1]=st>>>8&255,r.check=o(r.check,Ct,2,0)),st=0,ut=0,r.mode=S;case S:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.head&&(r.head.time=st),512&r.flags&&(Ct[0]=255&st,Ct[1]=st>>>8&255,Ct[2]=st>>>16&255,Ct[3]=st>>>24&255,r.check=o(r.check,Ct,4,0)),st=0,ut=0,r.mode=k;case k:for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.head&&(r.head.xflags=255&st,r.head.os=st>>8),512&r.flags&&(Ct[0]=255&st,Ct[1]=st>>>8&255,r.check=o(r.check,Ct,2,0)),st=0,ut=0,r.mode=A;case A:if(1024&r.flags){for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.length=st,r.head&&(r.head.extra_len=st),512&r.flags&&(Ct[0]=255&st,Ct[1]=st>>>8&255,r.check=o(r.check,Ct,2,0)),st=0,ut=0}else r.head&&(r.head.extra=null);r.mode=C;case C:if(1024&r.flags&&((lt=r.length)>ot&&(lt=ot),lt&&(r.head&&(xt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,tt,rt,lt,xt)),512&r.flags&&(r.check=o(r.check,tt,lt,rt)),ot-=lt,rt+=lt,r.length-=lt),r.length))break t;r.length=0,r.mode=T;case T:if(2048&r.flags){if(0===ot)break t;lt=0;do{xt=tt[rt+lt++],r.head&&xt&&r.length<65536&&(r.head.name+=String.fromCharCode(xt))}while(xt&<<ot);if(512&r.flags&&(r.check=o(r.check,tt,lt,rt)),ot-=lt,rt+=lt,xt)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=R;case R:if(4096&r.flags){if(0===ot)break t;lt=0;do{xt=tt[rt+lt++],r.head&&xt&&r.length<65536&&(r.head.comment+=String.fromCharCode(xt))}while(xt&<<ot);if(512&r.flags&&(r.check=o(r.check,tt,lt,rt)),ot-=lt,rt+=lt,xt)break t}else r.head&&(r.head.comment=null);r.mode=O;case O:if(512&r.flags){for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(st!==(65535&r.check)){t.msg="header crc mismatch",r.mode=X;break}st=0,ut=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=B;break;case I:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}t.adler=r.check=nt(st),st=0,ut=0,r.mode=L;case L:if(0===r.havedict)return t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,v;t.adler=r.check=1,r.mode=B;case B:if(e===h||e===d)break t;case P:if(r.last){st>>>=7&ut,ut-=7&ut,r.mode=W;break}for(;ut<3;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}switch(r.last=1&st,ut-=1,3&(st>>>=1)){case 0:r.mode=F;break;case 1:if(ht(r),r.mode=D,e===d){st>>>=2,ut-=2;break t}break;case 2:r.mode=j;break;case 3:t.msg="invalid block type",r.mode=X}st>>>=2,ut-=2;break;case F:for(st>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if((65535&st)!=(st>>>16^65535)){t.msg="invalid stored block lengths",r.mode=X;break}if(r.length=65535&st,st=0,ut=0,r.mode=N,e===d)break t;case N:r.mode=M;case M:if(lt=r.length){if(lt>ot&&(lt=ot),lt>at&&(lt=at),0===lt)break t;n.arraySet(et,tt,rt,lt,it),ot-=lt,rt+=lt,at-=lt,it+=lt,r.length-=lt;break}r.mode=B;break;case j:for(;ut<14;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(r.nlen=257+(31&st),st>>>=5,ut-=5,r.ndist=1+(31&st),st>>>=5,ut-=5,r.ncode=4+(15&st),st>>>=4,ut-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=X;break}r.have=0,r.mode=z;case z:for(;r.have<r.ncode;){for(;ut<3;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.lens[Tt[r.have++]]=7&st,st>>>=3,ut-=3}for(;r.have<19;)r.lens[Tt[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,St={bits:r.lenbits},Et=s(u,r.lens,0,19,r.lencode,0,r.work,St),r.lenbits=St.bits,Et){t.msg="invalid code lengths set",r.mode=X;break}r.have=0,r.mode=U;case U:for(;r.have<r.nlen+r.ndist;){for(;yt=(At=r.lencode[st&(1<<r.lenbits)-1])>>>16&255,mt=65535&At,!((vt=At>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(mt<16)st>>>=vt,ut-=vt,r.lens[r.have++]=mt;else{if(16===mt){for(kt=vt+2;ut<kt;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(st>>>=vt,ut-=vt,0===r.have){t.msg="invalid bit length repeat",r.mode=X;break}xt=r.lens[r.have-1],lt=3+(3&st),st>>>=2,ut-=2}else if(17===mt){for(kt=vt+3;ut<kt;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}ut-=vt,xt=0,lt=3+(7&(st>>>=vt)),st>>>=3,ut-=3}else{for(kt=vt+7;ut<kt;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}ut-=vt,xt=0,lt=11+(127&(st>>>=vt)),st>>>=7,ut-=7}if(r.have+lt>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=X;break}for(;lt--;)r.lens[r.have++]=xt}}if(r.mode===X)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=X;break}if(r.lenbits=9,St={bits:r.lenbits},Et=s(f,r.lens,0,r.nlen,r.lencode,0,r.work,St),r.lenbits=St.bits,Et){t.msg="invalid literal/lengths set",r.mode=X;break}if(r.distbits=6,r.distcode=r.distdyn,St={bits:r.distbits},Et=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,St),r.distbits=St.bits,Et){t.msg="invalid distances set",r.mode=X;break}if(r.mode=D,e===d)break t;case D:r.mode=q;case q:if(ot>=6&&at>=258){t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,a(t,ct),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,ut=r.bits,r.mode===B&&(r.back=-1);break}for(r.back=0;yt=(At=r.lencode[st&(1<<r.lenbits)-1])>>>16&255,mt=65535&At,!((vt=At>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(yt&&0==(240&yt)){for(bt=vt,_t=yt,wt=mt;yt=(At=r.lencode[wt+((st&(1<<bt+_t)-1)>>bt)])>>>16&255,mt=65535&At,!(bt+(vt=At>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}st>>>=bt,ut-=bt,r.back+=bt}if(st>>>=vt,ut-=vt,r.back+=vt,r.length=mt,0===yt){r.mode=Y;break}if(32&yt){r.back=-1,r.mode=B;break}if(64&yt){t.msg="invalid literal/length code",r.mode=X;break}r.extra=15&yt,r.mode=Z;case Z:if(r.extra){for(kt=r.extra;ut<kt;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.length+=st&(1<<r.extra)-1,st>>>=r.extra,ut-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;yt=(At=r.distcode[st&(1<<r.distbits)-1])>>>16&255,mt=65535&At,!((vt=At>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(0==(240&yt)){for(bt=vt,_t=yt,wt=mt;yt=(At=r.distcode[wt+((st&(1<<bt+_t)-1)>>bt)])>>>16&255,mt=65535&At,!(bt+(vt=At>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}st>>>=bt,ut-=bt,r.back+=bt}if(st>>>=vt,ut-=vt,r.back+=vt,64&yt){t.msg="invalid distance code",r.mode=X;break}r.offset=mt,r.extra=15&yt,r.mode=V;case V:if(r.extra){for(kt=r.extra;ut<kt;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}r.offset+=st&(1<<r.extra)-1,st>>>=r.extra,ut-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=X;break}r.mode=G;case G:if(0===at)break t;if(lt=ct-at,r.offset>lt){if((lt=r.offset-lt)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=X;break}lt>r.wnext?(lt-=r.wnext,pt=r.wsize-lt):pt=r.wnext-lt,lt>r.length&&(lt=r.length),gt=r.window}else gt=et,pt=it-r.offset,lt=r.length;lt>at&&(lt=at),at-=lt,r.length-=lt;do{et[it++]=gt[pt++]}while(--lt);0===r.length&&(r.mode=q);break;case Y:if(0===at)break t;et[it++]=r.length,at--,r.mode=q;break;case W:if(r.wrap){for(;ut<32;){if(0===ot)break t;ot--,st|=tt[rt++]<<ut,ut+=8}if(ct-=at,t.total_out+=ct,r.total+=ct,ct&&(t.adler=r.check=r.flags?o(r.check,et,ct,it-ct):i(r.check,et,ct,it-ct)),ct=at,(r.flags?st:nt(st))!==r.check){t.msg="incorrect data check",r.mode=X;break}st=0,ut=0}r.mode=K;case K:if(r.wrap&&r.flags){for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<<ut,ut+=8}if(st!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=X;break}st=0,ut=0}r.mode=Q;case Q:Et=g;break t;case X:Et=m;break t;case $:return b;case J:default:return y}return t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,(r.wsize||ct!==t.avail_out&&r.mode<X&&(r.mode<W||e!==l))&&dt(t,t.output,t.next_out,ct-t.avail_out)?(r.mode=$,b):(ft-=t.avail_in,ct-=t.avail_out,t.total_in+=ft,t.total_out+=ct,r.total+=ct,r.wrap&&ct&&(t.adler=r.check=r.flags?o(r.check,et,ct,t.next_out-ct):i(r.check,et,ct,t.next_out-ct)),t.data_type=r.bits+(r.last?64:0)+(r.mode===B?128:0)+(r.mode===D||r.mode===N?256:0),(0===ft&&0===ct||e===l)&&Et===p&&(Et=_),Et)},e.inflateEnd=function(t){if(!t||!t.state)return y;var e=t.state;return e.window&&(e.window=null),t.state=null,p},e.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?y:(r.head=e,e.done=!1,p):y},e.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&r.mode!==L?y:r.mode===L&&i(1,e,n,0)!==r.check?m:dt(t,e,n,n)?(r.mode=$,b):(r.havedict=1,p):y},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,r){"use strict";t.exports=function(t,e){var r,n,i,o,a,s,u,f,c,l,h,d,p,g,v,y,m,b,_,w,x,E,S,k,A;r=t.state,n=t.next_in,k=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=r.dmax,f=r.wsize,c=r.whave,l=r.wnext,h=r.window,d=r.hold,p=r.bits,g=r.lencode,v=r.distcode,y=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;t:do{p<15&&(d+=k[n++]<<p,p+=8,d+=k[n++]<<p,p+=8),b=g[d&y];e:for(;;){if(d>>>=_=b>>>24,p-=_,0===(_=b>>>16&255))A[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue e}if(32&_){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}w=65535&b,(_&=15)&&(p<_&&(d+=k[n++]<<p,p+=8),w+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=k[n++]<<p,p+=8,d+=k[n++]<<p,p+=8),b=v[d&m];r:for(;;){if(d>>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=v[(65535&b)+(d&(1<<_)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(x=65535&b,p<(_&=15)&&(d+=k[n++]<<p,(p+=8)<_&&(d+=k[n++]<<p,p+=8)),(x+=d&(1<<_)-1)>u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,x>(_=o-a)){if((_=x-_)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,S=h,0===l){if(E+=f-_,_<w){w-=_;do{A[o++]=h[E++]}while(--_);E=o-x,S=A}}else if(l<_){if(E+=f+l-_,(_-=l)<w){w-=_;do{A[o++]=h[E++]}while(--_);if(E=0,l<w){w-=_=l;do{A[o++]=h[E++]}while(--_);E=o-x,S=A}}}else if(E+=l-_,_<w){w-=_;do{A[o++]=h[E++]}while(--_);E=o-x,S=A}for(;w>2;)A[o++]=S[E++],A[o++]=S[E++],A[o++]=S[E++],w-=3;w&&(A[o++]=S[E++],w>1&&(A[o++]=S[E++]))}else{E=o-x;do{A[o++]=A[E++],A[o++]=A[E++],A[o++]=A[E++],w-=3}while(w>2);w&&(A[o++]=A[E++],w>1&&(A[o++]=A[E++]))}break}}break}}while(n<i&&o<s);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},function(t,e,r){"use strict";var n=r(71),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,u,f,c,l,h){var d,p,g,v,y,m,b,_,w,x=h.bits,E=0,S=0,k=0,A=0,C=0,T=0,R=0,O=0,I=0,L=0,B=null,P=0,F=new n.Buf16(16),N=new n.Buf16(16),M=null,j=0;for(E=0;E<=15;E++)F[E]=0;for(S=0;S<u;S++)F[e[r+S]]++;for(C=x,A=15;A>=1&&0===F[A];A--);if(C>A&&(C=A),0===A)return f[c++]=20971520,f[c++]=20971520,h.bits=1,0;for(k=1;k<A&&0===F[k];k++);for(C<k&&(C=k),O=1,E=1;E<=15;E++)if(O<<=1,(O-=F[E])<0)return-1;if(O>0&&(0===t||1!==A))return-1;for(N[1]=0,E=1;E<15;E++)N[E+1]=N[E]+F[E];for(S=0;S<u;S++)0!==e[r+S]&&(l[N[e[r+S]]++]=S);if(0===t?(B=M=l,m=19):1===t?(B=i,P-=257,M=o,j-=257,m=256):(B=a,M=s,m=-1),L=0,S=0,E=k,y=c,T=C,R=0,g=-1,v=(I=1<<C)-1,1===t&&I>852||2===t&&I>592)return 1;for(;;){b=E-R,l[S]<m?(_=0,w=l[S]):l[S]>m?(_=M[j+l[S]],w=B[P+l[S]]):(_=96,w=0),d=1<<E-R,k=p=1<<T;do{f[y+(L>>R)+(p-=d)]=b<<24|_<<16|w|0}while(0!==p);for(d=1<<E-1;L&d;)d>>=1;if(0!==d?(L&=d-1,L+=d):L=0,S++,0==--F[E]){if(E===A)break;E=e[r+l[S]]}if(E>C&&(L&v)!==g){for(0===R&&(R=C),y+=k,O=1<<(T=E-R);T+R<A&&!((O-=F[T+R])<=0);)T++,O<<=1;if(I+=1<<T,1===t&&I>852||2===t&&I>592)return 1;f[g=L&v]=C<<24|T<<16|y-c|0}}return 0!==L&&(f[y+L]=E-R<<24|64<<16|0),h.bits=C,0}},function(t,e,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,r){var n=r(16).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(t){if(n.isBuffer(t))return t;var e="function"==typeof n.alloc&&"function"==typeof n.from;if("number"==typeof t)return e?n.alloc(t):new n(t);if("string"==typeof t)return e?n.from(t):new n(t);throw new Error("input must be buffer, number, or string, received "+typeof t)}function a(t,e){t=o(t),n.isBuffer(e)&&(e=e.readUInt32BE(0));for(var r=-1^~~e,a=0;a<t.length;a++)r=i[255&(r^t[a])]^r>>>8;return-1^r}function s(){return t=a.apply(null,arguments),(e=o(4)).writeInt32BE(t,0),e;var t,e}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),s.signed=function(){return a.apply(null,arguments)},s.unsigned=function(){return a.apply(null,arguments)>>>0},t.exports=s},function(t,e,r){var n=r(227),i=r(230);function o(t){return(o="function"==typeof i&&"symbol"==typeof n?function(t){return typeof t}:function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":typeof t})(t)}function a(e){return"function"==typeof i&&"symbol"===o(n)?t.exports=a=function(t){return o(t)}:t.exports=a=function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":o(t)},a(e)}t.exports=a},function(t,e,r){t.exports=r(228)},function(t,e,r){t.exports=r(229)},function(t,e,r){r(136),r(46),r(41);var n=r(95);t.exports=n.f("iterator")},function(t,e,r){t.exports=r(231)},function(t,e,r){t.exports=r(232),r(250),r(251),r(252),r(253),r(254)},function(t,e,r){r(114),r(87),r(233),r(235),r(236),r(237),r(238),r(136),r(239),r(240),r(241),r(242),r(243),r(244),r(245),r(246),r(247),r(248),r(249);var n=r(3);t.exports=n.Symbol},function(t,e,r){"use strict";var n=r(0),i=r(13),o=r(4),a=r(18),s=r(110),u=r(12),f=r(24),c=r(53),l=r(14),h=r(2),d=r(22),p=r(28),g=r(62),v=r(43),y=r(44),m=r(51),b=r(137),_=r(234),w=r(138),x=r(80),E=r(21),S=r(65),k=r(20),A=r(52),C=r(61),T=r(63),R=r(50),O=r(64),I=r(6),L=r(95),B=r(11),P=r(36),F=r(42),N=r(45).forEach,M=T("hidden"),j=I("toPrimitive"),z=F.set,U=F.getterFor("Symbol"),D=Object.prototype,q=i.Symbol,Z=i.JSON,H=Z&&Z.stringify,V=x.f,G=E.f,Y=_.f,W=S.f,K=C("symbols"),Q=C("op-symbols"),X=C("string-to-symbol-registry"),$=C("symbol-to-string-registry"),J=C("wks"),tt=i.QObject,et=!tt||!tt.prototype||!tt.prototype.findChild,rt=a&&u((function(){return 7!=y(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=V(D,e);n&&delete D[e],G(t,e,r),n&&t!==D&&G(D,e,n)}:G,nt=function(t,e){var r=K[t]=y(q.prototype);return z(r,{type:"Symbol",tag:t,description:e}),a||(r.description=e),r},it=s&&"symbol"==typeof q.iterator?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof q},ot=function(t,e,r){t===D&&ot(Q,e,r),h(t);var n=g(e,!0);return h(r),f(K,n)?(r.enumerable?(f(t,M)&&t[M][n]&&(t[M][n]=!1),r=y(r,{enumerable:v(0,!1)})):(f(t,M)||G(t,M,v(1,{})),t[M][n]=!0),rt(t,n,r)):G(t,n,r)},at=function(t,e){h(t);var r=p(e),n=m(r).concat(ct(r));return N(n,(function(e){a&&!st.call(r,e)||ot(t,e,r[e])})),t},st=function(t){var e=g(t,!0),r=W.call(this,e);return!(this===D&&f(K,e)&&!f(Q,e))&&(!(r||!f(this,e)||!f(K,e)||f(this,M)&&this[M][e])||r)},ut=function(t,e){var r=p(t),n=g(e,!0);if(r!==D||!f(K,n)||f(Q,n)){var i=V(r,n);return!i||!f(K,n)||f(r,M)&&r[M][n]||(i.enumerable=!0),i}},ft=function(t){var e=Y(p(t)),r=[];return N(e,(function(t){f(K,t)||f(R,t)||r.push(t)})),r},ct=function(t){var e=t===D,r=Y(e?Q:p(t)),n=[];return N(r,(function(t){!f(K,t)||e&&!f(D,t)||n.push(K[t])})),n};s||(A((q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=O(t),r=function(t){this===D&&r.call(Q,t),f(this,M)&&f(this[M],e)&&(this[M][e]=!1),rt(this,e,v(1,t))};return a&&et&&rt(D,e,{configurable:!0,set:r}),nt(e,t)}).prototype,"toString",(function(){return U(this).tag})),S.f=st,E.f=ot,x.f=ut,b.f=_.f=ft,w.f=ct,a&&(G(q.prototype,"description",{configurable:!0,get:function(){return U(this).description}}),o||A(D,"propertyIsEnumerable",st,{unsafe:!0})),L.f=function(t){return nt(I(t),t)}),n({global:!0,wrap:!0,forced:!s,sham:!s},{Symbol:q}),N(m(J),(function(t){B(t)})),n({target:"Symbol",stat:!0,forced:!s},{for:function(t){var e=String(t);if(f(X,e))return X[e];var r=q(e);return X[e]=r,$[r]=e,r},keyFor:function(t){if(!it(t))throw TypeError(t+" is not a symbol");if(f($,t))return $[t]},useSetter:function(){et=!0},useSimple:function(){et=!1}}),n({target:"Object",stat:!0,forced:!s,sham:!a},{create:function(t,e){return void 0===e?y(t):at(y(t),e)},defineProperty:ot,defineProperties:at,getOwnPropertyDescriptor:ut}),n({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:ft,getOwnPropertySymbols:ct}),n({target:"Object",stat:!0,forced:u((function(){w.f(1)}))},{getOwnPropertySymbols:function(t){return w.f(d(t))}}),Z&&n({target:"JSON",stat:!0,forced:!s||u((function(){var t=q();return"[null]"!=H([t])||"{}"!=H({a:t})||"{}"!=H(Object(t))}))},{stringify:function(t){for(var e,r,n=[t],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=e=n[1],(l(e)||void 0!==t)&&!it(t))return c(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!it(e))return e}),n[1]=e,H.apply(Z,n)}}),q.prototype[j]||k(q.prototype,j,q.prototype.valueOf),P(q,"Symbol"),R[M]=!0},function(t,e,r){var n=r(28),i=r(137).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(n(t))}},function(t,e,r){r(11)("asyncIterator")},function(t,e){},function(t,e,r){r(11)("hasInstance")},function(t,e,r){r(11)("isConcatSpreadable")},function(t,e,r){r(11)("match")},function(t,e,r){r(11)("matchAll")},function(t,e,r){r(11)("replace")},function(t,e,r){r(11)("search")},function(t,e,r){r(11)("species")},function(t,e,r){r(11)("split")},function(t,e,r){r(11)("toPrimitive")},function(t,e,r){r(11)("toStringTag")},function(t,e,r){r(11)("unscopables")},function(t,e,r){r(36)(Math,"Math",!0)},function(t,e,r){var n=r(13);r(36)(n.JSON,"JSON",!0)},function(t,e,r){r(11)("asyncDispose")},function(t,e,r){r(11)("dispose")},function(t,e,r){r(11)("observable")},function(t,e,r){r(11)("patternMatch")},function(t,e,r){r(11)("replaceAll")},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,r){t.exports=r(257)},function(t,e,r){t.exports=r(258)},function(t,e,r){r(259);var n=r(3);t.exports=n.Object.getPrototypeOf},function(t,e,r){var n=r(0),i=r(12),o=r(22),a=r(66),s=r(109);n({target:"Object",stat:!0,forced:i((function(){a(1)})),sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},function(t,e,r){t.exports=r(261)},function(t,e,r){r(262);var n=r(3);t.exports=n.Object.setPrototypeOf},function(t,e,r){r(0)({target:"Object",stat:!0},{setPrototypeOf:r(85)})},function(t,e,r){t.exports=r(264)},function(t,e,r){r(265);var n=r(3).Object;t.exports=function(t,e){return n.create(t,e)}},function(t,e,r){r(0)({target:"Object",stat:!0,sham:!r(18)},{create:r(44)})},function(t,e,r){var n=r(140),i=r(267),o=r(27),a=r(96),s=r(296),u=r(301);function f(e){var r="function"==typeof i?new i:void 0;return t.exports=f=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return u(t,arguments,o(this).constructor)}return e.prototype=n(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a(e,t)},f(e)}t.exports=f},function(t,e,r){t.exports=r(268)},function(t,e,r){t.exports=r(269),r(274),r(276),r(278),r(280),r(281),r(282),r(283),r(284),r(285),r(287),r(288),r(289),r(290),r(291),r(292),r(293),r(294),r(295)},function(t,e,r){r(270),r(87),r(46),r(41);var n=r(3);t.exports=n.Map},function(t,e,r){"use strict";var n=r(271),i=r(273);t.exports=n("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),i,!0)},function(t,e,r){"use strict";var n=r(0),i=r(13),o=r(141),a=r(12),s=r(20),u=r(8),f=r(88),c=r(14),l=r(36),h=r(21).f,d=r(45).forEach,p=r(18),g=r(42),v=g.set,y=g.getterFor;t.exports=function(t,e,r,g,m){var b,_=i[t],w=_&&_.prototype,x=g?"set":"add",E={};if(p&&"function"==typeof _&&(m||w.forEach&&!a((function(){(new _).entries().next()})))){b=e((function(e,r){v(f(e,b,t),{type:t,collection:new _}),null!=r&&u(r,e[x],e,g)}));var S=y(t);d(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var e="add"==t||"set"==t;t in w&&(!m||"clear"!=t)&&s(b.prototype,t,(function(r,n){var i=S(this).collection;if(!e&&m&&!c(r))return"get"==t&&void 0;var o=i[t](0===r?0:r,n);return e?this:o}))})),m||h(b.prototype,"size",{get:function(){return S(this).collection.size}})}else b=r.getConstructor(e,t,g,x),o.REQUIRED=!0;return l(b,t,!1,!0),E[t]=b,n({global:!0,forced:!0},E),m||r.setStrong(b,t,g),b}},function(t,e,r){var n=r(12);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,e,r){"use strict";var n=r(21).f,i=r(44),o=r(117),a=r(15),s=r(88),u=r(8),f=r(79),c=r(118),l=r(18),h=r(141).fastKey,d=r(42),p=d.set,g=d.getterFor;t.exports={getConstructor:function(t,e,r,f){var c=t((function(t,n){s(t,c,e),p(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),l||(t.size=0),null!=n&&u(n,t[f],t,r)})),d=g(e),v=function(t,e,r){var n,i,o=d(t),a=y(t,e);return a?a.value=r:(o.last=a={index:i=h(e,!0),key:e,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),l?o.size++:t.size++,"F"!==i&&(o.index[i]=a)),t},y=function(t,e){var r,n=d(t),i=h(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return o(c.prototype,{clear:function(){for(var t=d(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,l?t.size=0:this.size=0},delete:function(t){var e=d(this),r=y(this,t);if(r){var n=r.next,i=r.previous;delete e.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),e.first==r&&(e.first=n),e.last==r&&(e.last=i),l?e.size--:this.size--}return!!r},forEach:function(t){for(var e,r=d(this),n=a(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!y(this,t)}}),o(c.prototype,r?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return v(this,0===t?0:t,e)}}:{add:function(t){return v(this,t=0===t?0:t,t)}}),l&&n(c.prototype,"size",{get:function(){return d(this).size}}),c},setStrong:function(t,e,r){var n=e+" Iterator",i=g(e),o=g(n);f(t,e,(function(t,e){p(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),c(e)}}},function(t,e,r){r(0)({target:"Map",stat:!0},{from:r(275)})},function(t,e,r){"use strict";var n=r(5),i=r(15),o=r(8);t.exports=function(t){var e,r,a,s,u=arguments.length,f=u>1?arguments[1]:void 0;return n(this),(e=void 0!==f)&&n(f),null==t?new this:(r=[],e?(a=0,s=i(f,u>2?arguments[2]:void 0,2),o(t,(function(t){r.push(s(t,a++))}))):o(t,r.push,r),new this(r))}},function(t,e,r){r(0)({target:"Map",stat:!0},{of:r(277)})},function(t,e,r){"use strict";t.exports=function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(279);n({target:"Map",proto:!0,real:!0,forced:i},{deleteAll:function(){return o.apply(this,arguments)}})},function(t,e,r){"use strict";var n=r(2),i=r(5);t.exports=function(){for(var t,e=n(this),r=i(e.delete),o=!0,a=0,s=arguments.length;a<s;a++)t=r.call(e,arguments[a]),o=o&&t;return!!o}},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(15),s=r(25),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{every:function(t){var e=o(this),r=s(e),n=a(t,arguments.length>1?arguments[1]:void 0,3);return!u(r,(function(t,r){if(!n(r,t,e))return u.stop()}),void 0,!0,!0).stopped}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(26),a=r(2),s=r(5),u=r(15),f=r(55),c=r(25),l=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{filter:function(t){var e=a(this),r=c(e),n=u(t,arguments.length>1?arguments[1]:void 0,3),i=new(f(e,o("Map"))),h=s(i.set);return l(r,(function(t,r){n(r,t,e)&&h.call(i,t,r)}),void 0,!0,!0),i}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(15),s=r(25),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{find:function(t){var e=o(this),r=s(e),n=a(t,arguments.length>1?arguments[1]:void 0,3);return u(r,(function(t,r){if(n(r,t,e))return u.stop(r)}),void 0,!0,!0).result}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(15),s=r(25),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{findKey:function(t){var e=o(this),r=s(e),n=a(t,arguments.length>1?arguments[1]:void 0,3);return u(r,(function(t,r){if(n(r,t,e))return u.stop(t)}),void 0,!0,!0).result}})},function(t,e,r){"use strict";var n=r(0),i=r(8),o=r(5);n({target:"Map",stat:!0},{groupBy:function(t,e){var r=new this;o(e);var n=o(r.has),a=o(r.get),s=o(r.set);return i(t,(function(t){var i=e(t);n.call(r,i)?a.call(r,i).push(t):s.call(r,i,[t])})),r}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(25),s=r(286),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{includes:function(t){return u(a(o(this)),(function(e,r){if(s(r,t))return u.stop()}),void 0,!0,!0).stopped}})},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){"use strict";var n=r(0),i=r(8),o=r(5);n({target:"Map",stat:!0},{keyBy:function(t,e){var r=new this;o(e);var n=o(r.set);return i(t,(function(t){n.call(r,e(t),t)})),r}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(25),s=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function(t){return s(a(o(this)),(function(e,r){if(r===t)return s.stop(e)}),void 0,!0,!0).result}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(26),a=r(2),s=r(5),u=r(15),f=r(55),c=r(25),l=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{mapKeys:function(t){var e=a(this),r=c(e),n=u(t,arguments.length>1?arguments[1]:void 0,3),i=new(f(e,o("Map"))),h=s(i.set);return l(r,(function(t,r){h.call(i,n(r,t,e),r)}),void 0,!0,!0),i}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(26),a=r(2),s=r(5),u=r(15),f=r(55),c=r(25),l=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{mapValues:function(t){var e=a(this),r=c(e),n=u(t,arguments.length>1?arguments[1]:void 0,3),i=new(f(e,o("Map"))),h=s(i.set);return l(r,(function(t,r){h.call(i,t,n(r,t,e))}),void 0,!0,!0),i}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(5),s=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{merge:function(t){for(var e=o(this),r=a(e.set),n=0;n<arguments.length;)s(arguments[n++],r,e,!0);return e}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(5),s=r(25),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{reduce:function(t){var e,r,n=o(this),i=s(n);if(a(t),arguments.length>1)e=arguments[1];else{if((r=i.next()).done)throw TypeError("Reduce of empty map with no initial value");e=r.value[1]}return u(i,(function(r,i){e=t(e,i,r,n)}),void 0,!0,!0),e}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(15),s=r(25),u=r(8);n({target:"Map",proto:!0,real:!0,forced:i},{some:function(t){var e=o(this),r=s(e),n=a(t,arguments.length>1?arguments[1]:void 0,3);return u(r,(function(t,r){if(n(r,t,e))return u.stop()}),void 0,!0,!0).stopped}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(5);n({target:"Map",proto:!0,real:!0,forced:i},{update:function(t,e){var r=o(this),n=arguments.length;a(e);var i=r.has(t);if(!i&&n<3)throw TypeError("Updating absent value");var s=i?r.get(t):a(n>2?arguments[2]:void 0)(t,r);return r.set(t,e(s,t,r)),r}})},function(t,e,r){"use strict";var n=r(0),i=r(4),o=r(2),a=r(5);n({target:"Map",proto:!0,real:!0,forced:i},{updateOrInsert:function(t,e,r){var n=o(this);a(e),a(r);var i=n.has(t)?e(n.get(t)):r();return n.set(t,i),i}})},function(t,e,r){var n=r(297);t.exports=function(t){var e;return-1!==n(e=Function.toString.call(t)).call(e,"[native code]")}},function(t,e,r){t.exports=r(298)},function(t,e,r){t.exports=r(143)},function(t,e,r){r(300);var n=r(19);t.exports=n("Array").indexOf},function(t,e,r){"use strict";var n=r(0),i=r(81).indexOf,o=r(54),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,u=o("indexOf");n({target:"Array",proto:!0,forced:s||u},{indexOf:function(t){return s?a.apply(this,arguments)||0:i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){var n=r(302),i=r(306),o=r(96);function a(e,r,s){return!function(){if("undefined"==typeof Reflect||!i)return!1;if(i.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(i(Date,[],(function(){}))),!0}catch(t){return!1}}()?t.exports=a=function(t,e,r){var i=[null];i.push.apply(i,e);var a=new(n(Function).apply(t,i));return r&&o(a,r.prototype),a}:t.exports=a=i,a.apply(null,arguments)}t.exports=a},function(t,e,r){t.exports=r(303)},function(t,e,r){t.exports=r(144)},function(t,e,r){r(305);var n=r(19);t.exports=n("Function").bind},function(t,e,r){r(0)({target:"Function",proto:!0},{bind:r(145)})},function(t,e,r){t.exports=r(307)},function(t,e,r){t.exports=r(308)},function(t,e,r){r(309);var n=r(3);t.exports=n.Reflect.construct},function(t,e,r){var n=r(0),i=r(26),o=r(5),a=r(2),s=r(14),u=r(44),f=r(145),c=r(12),l=i("Reflect","construct"),h=c((function(){function t(){}return!(l((function(){}),[],t)instanceof t)})),d=!c((function(){l((function(){}))})),p=h||d;n({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function(t,e){o(t),a(e);var r=arguments.length<3?t:o(arguments[2]);if(d&&!h)return l(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(f.apply(t,n))}var i=r.prototype,c=u(s(i)?i:Object.prototype),p=Function.apply.call(t,c,e);return s(p)?p:c}})},function(t,e,r){"use strict";(function(e){var n=r(1),i=n(r(97)),o=n(r(7)),a=n(r(10)),s=r(9).CramMalformedError,u=r(72),f=r(316),c=r(317),l=r(318),h=4;var d=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,o.default)(this,t),this._buffer=e,this._position=r,this.length=e.length}return(0,a.default)(t,[{key:"get",value:function(){var t=this._buffer[this._position];return this._position+=1,t}},{key:"getByte",value:function(){return this.get()}},{key:"getByteAt",value:function(t){return this._buffer[t]}},{key:"position",value:function(){return this._position}},{key:"put",value:function(t){return this._buffer[this._position]=t,this._position+=1,t}},{key:"putAt",value:function(t,e){return this._buffer[t]=e,e}},{key:"setPosition",value:function(t){return this._position=t,t}},{key:"getInt",value:function(){var t=this._buffer.readInt32LE(this._position);return this._position+=4,t}},{key:"remaining",value:function(){return this._buffer.length-this._position}}]),t}();t.exports={uncompress:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===t.length)return(0,i.default)(r).call(r,0),r;var o=new d(t,n),a=o.get();if(0!==a&&1!==a)throw new s("Invalid rANS order ".concat(a));if(o.getInt()!==o.remaining()-h)throw new s("Incorrect input length.");var p=o.getInt(),g=new d(r||e.allocUnsafe(p));if(g.length<p)throw new s("Output buffer too small to fit ".concat(p," bytes."));switch(a){case 0:return function(t,e){for(var r=new u.AriDecoder,n=new Array(256),i=0;i<n.length;i+=1)n[i]=new u.Symbol;return f.readStatsO0(t,r,n),c.uncompress(t,r,n,e),e}(o,g);case 1:return function(t,e){for(var r=new Array(256),n=0;n<r.length;n+=1)r[n]=new u.AriDecoder;for(var i=new Array(256),o=0;o<i.length;o+=1){i[o]=new Array(256);for(var a=0;a<i[o].length;a+=1)i[o][a]=new u.Symbol}return f.readStatsO1(t,r,i),l.uncompress(t,e,r,i),e}(o,g);default:throw new s("Invalid rANS order: ".concat(a))}}}}).call(this,r(16).Buffer)},function(t,e,r){t.exports=r(312)},function(t,e,r){var n=r(313),i=Array.prototype;t.exports=function(t){var e=t.fill;return t===i||t instanceof Array&&e===i.fill?n:e}},function(t,e,r){r(314);var n=r(19);t.exports=n("Array").fill},function(t,e,r){var n=r(0),i=r(315),o=r(77);n({target:"Array",proto:!0},{fill:i}),o("fill")},function(t,e,r){"use strict";var n=r(22),i=r(83),o=r(29);t.exports=function(t){for(var e=n(this),r=o(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,r),u=a>2?arguments[2]:void 0,f=void 0===u?r:i(u,r);f>s;)e[s++]=t;return e}},function(t,e,r){"use strict";var n=r(1)(r(97)),i=r(9).CramMalformedError,o=r(73),a=r(72);function s(t){if(!t)throw new i("assertion failed")}t.exports={readStatsO0:function(t,e,r){var i=0,u=0,f=255&t.get();do{var c;null==e.fc[f]&&(e.fc[f]=new a.FC),e.fc[f].F=255&t.get(),e.fc[f].F>=128&&(e.fc[f].F&=-129,e.fc[f].F=(127&e.fc[f].F)<<8|255&t.get()),e.fc[f].C=u,a.symbolInit(r[f],e.fc[f].C,e.fc[f].F),e.R||(e.R=new Array(o.TOTFREQ)),(0,n.default)(c=e.R).call(c,f,u,u+e.fc[f].F),u+=e.fc[f].F,0===i&&f+1===(255&t.getByteAt(t.position()))?(f=255&t.get(),i=255&t.get()):0!==i?(i-=1,f+=1):f=255&t.get()}while(0!==f);s(u<o.TOTFREQ)},readStatsO1:function(t,e,r){var i=0,u=255&t.get();do{var f=0,c=0,l=255&t.get();null==e[u]&&(e[u]=new a.AriDecoder);do{var h;null==e[u].fc[l]&&(e[u].fc[l]=new a.FC),e[u].fc[l].F=255&t.get(),e[u].fc[l].F>=128&&(e[u].fc[l].F&=-129,e[u].fc[l].F=(127&e[u].fc[l].F)<<8|255&t.get()),e[u].fc[l].C=c,0===e[u].fc[l].F&&(e[u].fc[l].F=o.TOTFREQ),null==r[u][l]&&(r[u][l]=new a.RansDecSymbol),a.symbolInit(r[u][l],e[u].fc[l].C,e[u].fc[l].F),null==e[u].R&&(e[u].R=new Array(o.TOTFREQ)),(0,n.default)(h=e[u].R).call(h,l,c,c+e[u].fc[l].F),s((c+=e[u].fc[l].F)<=o.TOTFREQ),0===f&&l+1===(255&t.getByteAt(t.position()))?(l=255&t.get(),f=255&t.get()):0!==f?(f-=1,l+=1):l=255&t.get()}while(0!==l);0===i&&u+1===(255&t.getByteAt(t.position()))?(u=255&t.get(),i=255&t.get()):0!==i?(i-=1,u+=1):u=255&t.get()}while(0!==u)}}},function(t,e,r){"use strict";var n=r(9).CramMalformedError,i=r(73),o=r(72);t.exports={uncompress:function(t,e,r,a){for(var s,u=t.getInt(),f=t.getInt(),c=t.getInt(),l=t.getInt(),h=a.remaining(),d=-4&h,p=0;p<d;p+=4){var g=e.R[o.get(u,i.TF_SHIFT)],v=e.R[o.get(f,i.TF_SHIFT)],y=e.R[o.get(c,i.TF_SHIFT)],m=e.R[o.get(l,i.TF_SHIFT)];a.putAt(p,g),a.putAt(p+1,v),a.putAt(p+2,y),a.putAt(p+3,m),u=o.advanceSymbolStep(u,r[255&g],i.TF_SHIFT),f=o.advanceSymbolStep(f,r[255&v],i.TF_SHIFT),c=o.advanceSymbolStep(c,r[255&y],i.TF_SHIFT),l=o.advanceSymbolStep(l,r[255&m],i.TF_SHIFT),u=o.renormalize(u,t),f=o.renormalize(f,t),c=o.renormalize(c,t),l=o.renormalize(l,t)}switch(a.setPosition(d),3&h){case 0:break;case 1:s=e.R[o.get(u,i.TF_SHIFT)],o.advanceSymbol(u,t,r[255&s],i.TF_SHIFT),a.put(s);break;case 2:s=e.R[o.get(u,i.TF_SHIFT)],o.advanceSymbol(u,t,r[255&s],i.TF_SHIFT),a.put(s),s=e.R[o.get(f,i.TF_SHIFT)],o.advanceSymbol(f,t,r[255&s],i.TF_SHIFT),a.put(s);break;case 3:s=e.R[o.get(u,i.TF_SHIFT)],o.advanceSymbol(u,t,r[255&s],i.TF_SHIFT),a.put(s),s=e.R[o.get(f,i.TF_SHIFT)],o.advanceSymbol(f,t,r[255&s],i.TF_SHIFT),a.put(s),s=e.R[o.get(c,i.TF_SHIFT)],o.advanceSymbol(c,t,r[255&s],i.TF_SHIFT),a.put(s);break;default:throw new n("invalid output size encountered during rANS decoding")}a.setPosition(0)}}},function(t,e,r){"use strict";var n=r(73),i=r(72);t.exports={uncompress:function(t,e,r,o){for(var a=e.remaining(),s=t.getInt(),u=t.getInt(),f=t.getInt(),c=t.getInt(),l=a>>2,h=0,d=l,p=2*l,g=3*l,v=0,y=0,m=0,b=0;h<l;h+=1,d+=1,p+=1,g+=1){var _=255&r[v].R[i.get(s,n.TF_SHIFT)],w=255&r[y].R[i.get(u,n.TF_SHIFT)],x=255&r[m].R[i.get(f,n.TF_SHIFT)],E=255&r[b].R[i.get(c,n.TF_SHIFT)];e.putAt(h,_),e.putAt(d,w),e.putAt(p,x),e.putAt(g,E),s=i.advanceSymbolStep(s,o[v][_],n.TF_SHIFT),u=i.advanceSymbolStep(u,o[y][w],n.TF_SHIFT),f=i.advanceSymbolStep(f,o[m][x],n.TF_SHIFT),c=i.advanceSymbolStep(c,o[b][E],n.TF_SHIFT),s=i.renormalize(s,t),u=i.renormalize(u,t),f=i.renormalize(f,t),c=i.renormalize(c,t),v=_,y=w,m=x,b=E}for(;g<a;g+=1){var S=255&r[b].R[i.get(c,n.TF_SHIFT)];e.putAt(g,S),c=i.advanceSymbol(c,t,o[b][S],n.TF_SHIFT),b=S}}}},function(t,e,r){"use strict";var n=r(1),i=n(r(98)),o=n(r(17)),a=n(r(74)),s=r(327).Parser,u=(new s).itf8(),f={parser:(new s).string("magic",{length:4}).uint8("majorVersion").uint8("minorVersion").string("fileId",{length:20,stripNull:!0}),maxLength:26},c={parser:(new s).uint8("compressionMethod",{formatter:function(t){var e=["raw","gzip","bzip2","lzma","rans"][t];if(!e)throw new Error("compression method number ".concat(t," not implemented"));return e}}).uint8("contentType",{formatter:function(t){var e=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][t];if(!e)throw new Error("invalid block content type id ".concat(t));return e}}).itf8("contentId").itf8("compressedSize").itf8("uncompressedSize"),maxLength:17},l={parser:(new s).uint32("crc32"),maxLength:4},h=(new s).itf8("size").buffer("ents",{length:"size",formatter:function(t){function e(e,r){for(var n=t.toString("utf8",e,r),i=[],o=0;o<n.length;o+=3)i.push(n.substr(o,3));return i}var r,n=[],i=0;for(r=0;r<t.length;r+=1)t[r]||(n.push(e(i,r)),i=r+1);return r>i&&n.push(e(i,r)),n}}),d=(new s).uint8(null,{formatter:function(t){return!!t}}),p=(new s).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new s).string("key",{length:2,stripNull:!1}).choice("value",{tag:"key",choices:{MI:d,UI:d,PI:d,RN:d,AP:d,RR:d,SM:(new s).array(null,{type:"uint8",length:5}),TD:(new s).nest(null,{type:h,formatter:function(t){return t.ents}})}})});function g(t){for(var e={},r=0;r<t.ents.length;r+=1){var n=t.ents[r],i=n.key,o=n.value;e[i]&&console.warn("duplicate key ".concat(i," in map")),e[i]=o}return e}var v={cramFileDefinition:f,cramBlockHeader:c,cramBlockCrc32:l},y={cramUnmappedSliceHeader:function(t){var e=0,r=(new s).itf8("numRecords");e+=5,t>=3?(r=r.ltf8("recordCounter"),e+=9):2===t&&(r=r.itf8("recordCounter"),e+=5),r=r.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:u,length:"numContentIds"}),e+=10,t>=2&&(r=r.array("md5",{type:"uint8",length:16}),e+=16);return{parser:r,maxLength:function(t){return e+5*t}}},cramMappedSliceHeader:function(t){var e=(new s).itf8("refSeqId").itf8("refSeqStart").itf8("refSeqSpan").itf8("numRecords"),r=20;t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),e=e.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:u,length:"numContentIds"}).itf8("refBaseBlockId"),r+=15,t>=2&&(e=e.array("md5",{type:"uint8",length:16}),r+=16);return{parser:e,maxLength:function(t){return r+5*t}}},cramEncoding:function(t){return{parser:(new s).namely("cramEncoding").itf8("codecId").itf8("parametersBytes").choice("parameters",{tag:"codecId",choices:{0:new s,1:(new s).itf8("blockContentId"),2:(new s).itf8("offset").itf8("M"),3:s.start().itf8("numCodes").array("symbols",{length:"numCodes",type:u}).itf8("numLengths").array("bitLengths",{length:"numLengths",type:u}),4:s.start().nest("lengthsEncoding",{type:"cramEncoding"}).nest("valuesEncoding",{type:"cramEncoding"}),5:(new s).uint8("stopByte")[t>1?"itf8":"int"]("blockContentId"),6:(new s).itf8("offset").itf8("length"),7:(new s).itf8("offset").itf8("K"),8:(new s).itf8("offset").itf8("log2m"),9:(new s).itf8("offset")}})}},cramDataSeriesEncodingMap:function(t){return(new s).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new s).string("key",{length:2,stripNull:!1}).nest("value",{type:this.cramEncoding(t).parser})})},cramTagEncodingMap:function(t){return(new s).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new s).itf8("key",{formatter:function(t){return String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}}).nest("value",{type:this.cramEncoding(t).parser})})},cramCompressionHeader:function(t){var e=new s;return{parser:e=e.nest("preservation",{type:p,formatter:g}).nest("dataSeriesEncoding",{type:this.cramDataSeriesEncodingMap(t),formatter:g}).nest("tagEncoding",{type:this.cramTagEncodingMap(t),formatter:g})}},cramContainerHeader1:function(t){var e=(new s).int32("length").itf8("refSeqId").itf8("refSeqStart").itf8("alignmentSpan").itf8("numRecords"),r=24;return t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),t>1&&(e=e.ltf8("numBases"),r+=9),{parser:e=e.itf8("numBlocks").itf8("numLandmarks"),maxLength:r+=10}},cramContainerHeader2:function(t){var e=(new s).itf8("numLandmarks").array("landmarks",{type:(new s).itf8(),length:"numLandmarks"}),r=0;return t>=3&&(e=e.uint32("crc32"),r=4),{parser:e,maxLength:function(t){return 5+5*t+r}}}};t.exports={cramFileDefinition:f,getSectionParsers:function(t){var e,r=(0,a.default)({},v);return(0,o.default)(e=(0,i.default)(y)).call(e,(function(e){r[e]=y[e](t)})),r}}},function(t,e,r){t.exports=r(321)},function(t,e,r){r(322);var n=r(3);t.exports=n.Object.keys},function(t,e,r){var n=r(0),i=r(22),o=r(51);n({target:"Object",stat:!0,forced:r(12)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},function(t,e,r){t.exports=r(324)},function(t,e,r){r(325);var n=r(3);t.exports=n.Object.assign},function(t,e,r){var n=r(0),i=r(326);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},function(t,e,r){"use strict";var n=r(18),i=r(12),o=r(51),a=r(138),s=r(65),u=r(22),f=r(60),c=Object.assign;t.exports=!c||i((function(){var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=c({},t)[r]||"abcdefghijklmnopqrst"!=o(c({},e)).join("")}))?function(t,e){for(var r=u(t),i=arguments.length,c=1,l=a.f,h=s.f;i>c;)for(var d,p=f(arguments[c++]),g=l?o(p).concat(l(p)):o(p),v=g.length,y=0;v>y;)d=g[y++],n&&!h.call(p,d)||(r[d]=p[d]);return r}:c},function(t,e,r){"use strict";(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(328),o=r(329).Context,a=r(146);"undefined"!=typeof window&&(window.Buffer=t),"undefined"!=typeof self&&(self.Buffer=t);var s={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8,UInt64:8,Int64:8},u={},f=[];!function(){var t;for(t=1;t<=32;t++)f.push(t)}();var c={};Object.keys(s).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(t){c[t.toLowerCase()]=t}));var l=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};l.start=function(){return new l},Object.keys(s).forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){return this.setNextParser(t.toLowerCase(),e,r)};var e=t.replace(/BE|LE/,"").toLowerCase();e in l.prototype||(l.prototype[e]=function(t,r){return this[e+this.endian](t,r)})})),f.forEach((function(t){l.prototype["bit".concat(t.toString())]=function(e,r){return r||(r={}),r.length=t,this.setNextParser("bit",e,r)}})),l.prototype.namely=function(t){return u[t]=this,this.alias=t,this},l.prototype.skip=function(t,e){if(e&&e.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:t})},l.prototype.string=function(t,e){if(!e.zeroTerminated&&!e.length&&!e.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((e.zeroTerminated||e.length)&&e.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(e.stripNull&&!e.length&&!e.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return e.encoding=e.encoding||"utf8",this.setNextParser("string",t,e)},l.prototype.buffer=function(t,e){if(!e.length&&!e.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",t,e)},l.prototype.array=function(t,e){if(!e.readUntil&&!e.length&&!e.lengthInBytes)throw new Error("Length option of array is not defined.");if(!e.type)throw new Error("Type option of array is not defined.");if("string"==typeof e.type&&!u[e.type]&&Object.keys(s).indexOf(c[e.type])<0)throw new Error('Specified primitive type "'.concat(e.type,'" is not supported.'));return this.setNextParser("array",t,e)},l.prototype.choice=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.tag)throw new Error("Tag option of array is not defined.");if(!e.choices)throw new Error("Choices option of array is not defined.");return Object.keys(e.choices).forEach((function(r){if(!e.choices[r])throw new Error("Choice Case ".concat(r," of ").concat(t," is not valid."));if("string"==typeof e.choices[r]&&!u[e.choices[r]]&&Object.keys(s).indexOf(c[e.choices[r]])<0)throw new Error('Specified primitive type "'.concat(e.choices[r],'" is not supported.'))}),this),this.setNextParser("choice",t,e)},l.prototype.nest=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.type)throw new Error("Type option of nest is not defined.");if(!(e.type instanceof l||u[e.type]))throw new Error("Type option of nest must be a Parser object.");if(!(e.type instanceof l||t))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",t,e)},l.prototype.endianess=function(t){switch(t.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: ".concat(t))}return this},l.prototype.create=function(t){if(!(t instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=t,this},l.prototype.getCode=function(){var t=new o;return t.pushCode("if (!Buffer.isBuffer(buffer)) {"),t.generateError('"argument buffer is not a Buffer object"'),t.pushCode("}"),this.alias?this.addAliasedCode(t):this.addRawCode(t),this.alias?t.pushCode("return {0}(0)","___parser_"+this.alias):t.pushCode("return { offset: offset, result: vars };"),t.code},l.prototype.addRawCode=function(t){t.pushCode("var offset = 0;"),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };")},l.prototype.addAliasedCode=function(t){return t.pushCode("function {0}(offset) {","___parser_"+this.alias),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),t.markResolved(this.alias),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };"),t.pushCode("}"),t},l.prototype.resolveReferences=function(t){var e=t.getUnresolvedReferences();t.markRequested(e),e.forEach((function(e){u[e].addAliasedCode(t)}))},l.prototype.compile=function(){var t="(function(buffer, constructorFn, Long) { ".concat(this.getCode()," })");this.compiled=i.runInThisContext(t)},l.prototype.sizeOf=function(){var t=NaN;if(Object.keys(s).indexOf(this.type)>=0)t=s[this.type];else if("String"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var e=NaN;"string"==typeof this.options.type?e=s[c[this.options.type]]:this.options.type instanceof l&&(e=this.options.type.sizeOf()),t=this.options.length*e}else"Skip"===this.type?t=this.options.length:"Nest"===this.type?t=this.options.type.sizeOf():this.type||(t=0);return this.next&&(t+=this.next.sizeOf()),t},l.prototype.parse=function(t){return this.compiled||this.compile(),this.compiled(t,this.constructorFn,a)},l.prototype.setNextParser=function(t,e,r){var n=new l;return n.type=c[t],n.varName=e,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},l.prototype.generate=function(t){this.type&&(this["generate".concat(this.type)](t),this.generateAssert(t));var e=t.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(t,e,this.options.formatter),this.generateNext(t)},l.prototype.generateAssert=function(t){if(this.options.assert){var e=t.generateVariable(this.varName);switch(n(this.options.assert)){case"function":t.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,e);break;case"number":t.pushCode("if ({0} !== {1}) {",this.options.assert,e);break;case"string":t.pushCode('if ("{0}" !== {1}) {',this.options.assert,e);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}t.generateError('"Assert error: {0} is " + {0}',e),t.pushCode("}")}},l.prototype.generateNext=function(t){return this.next&&(t=this.next.generate(t)),t},Object.keys(s).forEach((function(t){l.prototype["generate".concat(t)]=function(e){"UInt64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):"Int64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),t),e.pushCode("offset += {0};",s[t])}})),l.prototype.generateBit=function(t){var e=JSON.parse(JSON.stringify(this));if(e.varName=t.generateVariable(e.varName),t.bitFields.push(e),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;t.bitFields.forEach((function(t){r+=t.options.length}));var n=t.generateTmpVariable();if(r<=8)t.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)t.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var i=t.generateTmpVariable(),o=t.generateTmpVariable();t.pushCode("var {0} = buffer.readUInt16BE(offset);",i),t.pushCode("var {0} = buffer.readUInt8(offset + 2);",o),t.pushCode("var {2} = ({0} << 8) | {1};",i,o,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");t.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}t.pushCode("offset += {0};",r/8);var a=0,s="be"===this.endian;t.bitFields.forEach((function(e){t.pushCode("{0} = {1} >> {2} & {3};",e.varName,n,s?r-a-e.options.length:a,(1<<e.options.length)-1),a+=e.options.length})),t.bitFields=[]}},l.prototype.generateSkip=function(t){var e=t.generateOption(this.options.length);t.pushCode("offset += {0};",e)},l.prototype.generateString=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();this.options.length&&this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0 && offset - {0} < {1});",r,this.options.length),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - {2} < {3} ? offset - 1 : offset);",e,this.options.encoding,r,this.options.length)):this.options.length?(t.pushCode("{0} = buffer.toString('{1}', offset, offset + {2});",e,this.options.encoding,t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))):this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - 1);",e,this.options.encoding,r)):this.options.greedy&&(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.length > offset++);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset);",e,this.options.encoding,r)),this.options.stripNull&&t.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",e)},l.prototype.generateBuffer=function(t){"eof"===this.options.readUntil?t.pushCode("{0} = buffer.slice(offset);",t.generateVariable(this.varName)):(t.pushCode("{0} = buffer.slice(offset, offset + {1});",t.generateVariable(this.varName),t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))),this.options.clone&&t.pushCode("{0} = Buffer.from({0});",t.generateVariable(this.varName))},l.prototype.generateArray=function(t){var e=t.generateOption(this.options.length),r=t.generateOption(this.options.lengthInBytes),n=this.options.type,i=t.generateTmpVariable(),o=t.generateVariable(this.varName),a=t.generateTmpVariable(),f=this.options.key,h="string"==typeof f;if(h?t.pushCode("{0} = {};",o):t.pushCode("{0} = [];",o),"function"==typeof this.options.readUntil?t.pushCode("do {"):"eof"===this.options.readUntil?t.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",i):void 0!==r?t.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",i,r):t.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",i,e),"string"==typeof n)if(u[n]){var d=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",d,"___parser_"+n),t.pushCode("var {0} = {1}.result; offset = {1}.offset;",a,d),n!==this.alias&&t.addReference(n)}else t.pushCode("var {0} = buffer.read{1}(offset);",a,c[n]),t.pushCode("offset += {0};",s[c[n]]);else n instanceof l&&(t.pushCode("var {0} = {};",a),t.pushScope(a),n.generate(t),t.popScope());h?t.pushCode("{0}[{2}.{1}] = {2};",o,f,a):t.pushCode("{0}.push({1});",o,a),t.pushCode("}"),"function"==typeof this.options.readUntil&&t.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,a)},l.prototype.generateChoiceCase=function(t,e,r){if("string"==typeof r)if(u[r]){var n=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",n,"___parser_"+r),t.pushCode("{0} = {1}.result; offset = {1}.offset;",t.generateVariable(this.varName),n),r!==this.alias&&t.addReference(r)}else t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),c[r]),t.pushCode("offset += {0};",s[c[r]]);else r instanceof l&&(t.pushPath(e),r.generate(t),t.popPath(e))},l.prototype.generateChoice=function(t){var e=t.generateOption(this.options.tag);this.varName&&t.pushCode("{0} = {};",t.generateVariable(this.varName)),t.pushCode("switch({0}) {",e),Object.keys(this.options.choices).forEach((function(e){var r=this.options.choices[e];Number.isNaN(parseInt(e,10))?t.pushCode("case '{0}':",e):t.pushCode("case {0}:",e),this.generateChoiceCase(t,this.varName,r),t.pushCode("break;")}),this),t.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(t,this.varName,this.options.defaultChoice):t.generateError('"Met undefined tag value " + {0} + " at choice"',e),t.pushCode("}")},l.prototype.generateNest=function(t){var e=t.generateVariable(this.varName);if(this.options.type instanceof l)this.varName&&t.pushCode("{0} = {};",e),t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName);else if(u[this.options.type]){var r=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",r,"___parser_"+this.options.type),t.pushCode("{0} = {1}.result; offset = {1}.offset;",e,r),this.options.type!==this.alias&&t.addReference(this.options.type)}},l.prototype.generateFormatter=function(t,e,r){"function"==typeof r&&t.pushCode("{0} = ({1}).call(this, {0});",e,r)},l.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.generateItf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) | buffer[offset+2]) & 0x1fffff;\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4\n } else {\n ").concat(e," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5\n }\n "))},l.prototype.ltf8=function(t,e){return this.setNextParser("ltf8",t,e)},l.prototype.generateLtf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n ").concat(e," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4;\n } else if (").concat(r," < 0xf8) {\n ").concat(e," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5;\n } else if (").concat(r," < 0xfc) {\n ").concat(e," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n offset += 6;\n } else if (").concat(r," < 0xfe) {\n ").concat(e," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n offset += 7;\n } else if (").concat(r," < 0xff) {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 8;\n } else {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 9;\n }\n "))},e.Parser=l}).call(this,r(16).Buffer)},function(module,exports){var indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1},Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,r){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(t){return function(t,e,r){t[e]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var r=e.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(t),(function(e){r[e]=t[e]})),forEach(globals,(function(e){t[e]&&(r[e]=t[e])}));var o=Object_keys(r),a=n.call(r,this.code);return forEach(Object_keys(r),(function(e){(e in t||-1===indexOf(o,e))&&(t[e]=r[e])})),forEach(globals,(function(e){e in t||defineProp(t,e,r[e])})),document.body.removeChild(e),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),r=this.runInContext(e);return t&&forEach(Object_keys(e),(function(r){t[r]=e[r]})),r},forEach(Object_keys(Script.prototype),(function(t){exports[t]=Script[t]=function(e){var r=Script(e);return r[t].apply(r,[].slice.call(arguments,1))}})),exports.isContext=function(t){return t instanceof Context},exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return"object"==typeof t&&forEach(Object_keys(t),(function(r){e[r]=t[r]})),e}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};i.prototype.generateVariable=function(t){var e=[];for(Array.prototype.push.apply(e,this.scopes[this.scopes.length-1]);/^\$parent\./.test(t);)e.pop(),t=t.replace(/^\$parent\./,"");return t&&e.push(t),e.join(".")},i.prototype.generateOption=function(t){switch(n(t)){case"number":return t.toString();case"string":return this.generateVariable(t);case"function":return"(".concat(t,").call(").concat(this.generateVariable(),", vars)");default:return}},i.prototype.generateError=function(){var t=Array.prototype.slice.call(arguments),e=i.interpolate.apply(this,t);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error(".concat(e,"), vars); });")):this.pushCode("throw new Error(".concat(e,");"))},i.prototype.generateTmpVariable=function(){return"$tmp".concat(this.tmpVariableCount++)},i.prototype.pushCode=function(){var t=Array.prototype.slice.call(arguments);this.code+="".concat(i.interpolate.apply(this,t),"\n")},i.prototype.pushPath=function(t){t&&this.scopes[this.scopes.length-1].push(t)},i.prototype.popPath=function(t){t&&this.scopes[this.scopes.length-1].pop()},i.prototype.pushScope=function(t){this.scopes.push([t])},i.prototype.popScope=function(){this.scopes.pop()},i.prototype.addReference=function(t){this.references[t]||(this.references[t]={resolved:!1,requested:!1})},i.prototype.markResolved=function(t){this.references[t].resolved=!0},i.prototype.markRequested=function(t){t.forEach(function(t){this.references[t].requested=!0}.bind(this))},i.prototype.getUnresolvedReferences=function(){var t=this.references;return Object.keys(this.references).filter((function(e){return!t[e].resolved&&!t[e].requested}))},i.interpolate=function(t){var e=/{\d+}/g,r=t.match(e),n=Array.prototype.slice.call(arguments,1);return r&&r.forEach((function(e){var r=parseInt(e.substr(1,e.length-2),10);t=t.replace(e,n[r].toString())})),t},e.Context=i},function(t,e,r){"use strict";(function(e){var n,i=r(1),o=i(r(17)),a=i(r(74)),s=i(r(37)),u=i(r(30)),f=i(r(31)),c=i(r(7)),l=i(r(10)),h=r(9).CramMalformedError,d=r(58),p=d.itf8Size,g=d.parseItem,v=d.tinyMemoize,y=r(335),m=r(391),b=function(){function t(e,r){(0,c.default)(this,t),this.file=e,this.filePosition=r}var r,n,i,o;return(0,l.default)(t,[{key:"getHeader",value:function(){return this._readContainerHeader(this.filePosition)}},{key:"getCompressionHeaderBlock",value:(o=(0,f.default)(u.default.mark((function t(){var e,r,n;return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getHeader();case 2:if(t.sent.numRecords){t.next=5;break}return t.abrupt("return",null);case 5:return t.next=7,this.file.getSectionParsers();case 7:return e=t.sent,t.next=10,this.getFirstBlock();case 10:if("COMPRESSION_HEADER"===(r=t.sent).contentType){t.next=13;break}throw new h("invalid content type ".concat(r.contentType," in what is supposed to be the compression header block"));case 13:return n=g(r.content,e.cramCompressionHeader.parser,0,r.contentPosition),r.content=n,t.abrupt("return",r);case 16:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getFirstBlock",value:(i=(0,f.default)(u.default.mark((function t(){var e;return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getHeader();case 2:return e=t.sent,t.abrupt("return",this.file.readBlock(e._endPosition));case 4:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getCompressionScheme",value:(n=(0,f.default)(u.default.mark((function t(){var e;return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getCompressionHeaderBlock();case 2:if(e=t.sent){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.abrupt("return",new m(e.content));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getSlice",value:function(t,e){return new y(this,t,e)}},{key:"_readContainerHeader",value:(r=(0,f.default)(u.default.mark((function t(r){var n,i,o,f,c,l,h,d,v,y,m,b,_;return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.file.getSectionParsers();case 2:return n=t.sent,i=n.cramContainerHeader1,o=n.cramContainerHeader2,t.next=6,this.file.stat();case 6:if(f=t.sent,c=f.size,!(r>=c)){t.next=10;break}return t.abrupt("return",void 0);case 10:return l=e.allocUnsafe(i.maxLength),t.next=13,this.file.read(l,0,i.maxLength,r);case 13:if(h=g(l,i.parser),d=p(h.numLandmarks),!(r+h.length>=c)){t.next=18;break}return console.warn((0,s.default)(v=(0,s.default)(y="".concat(this.file,": container header at ")).call(y,r," indicates that the container has length ")).call(v,h.length,", which extends beyond the length of the file. Skipping this container.")),t.abrupt("return",void 0);case 18:return m=e.allocUnsafe(o.maxLength(h.numLandmarks)),t.next=21,this.file.read(m,0,o.maxLength(h.numLandmarks),r+h._size-d);case 21:if(b=g(m,o.parser),!this.file.validateChecksums||void 0===b.crc32){t.next=25;break}return t.next=25,this.file.checkCrc32(r,h._size+b._size-d-4,b.crc32,"container header beginning at position ".concat(r));case 25:return _=(0,a.default)(h,b,{_size:h._size+b._size-d,_endPosition:h._size+b._size-d+r}),t.abrupt("return",_);case 27:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})}]),t}();(0,o.default)(n="getHeader getCompressionHeaderBlock getCompressionScheme".split(" ")).call(n,(function(t){return v(b,t)})),t.exports=b}).call(this,r(16).Buffer)},function(t,e,r){t.exports=r(115)},function(t,e,r){var n,i,o,a,s;n=r(333),i=r(147).utf8,o=r(334),a=r(147).bin,(s=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):i.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());for(var r=n.bytesToWords(t),u=8*t.length,f=1732584193,c=-271733879,l=-1732584194,h=271733878,d=0;d<r.length;d++)r[d]=16711935&(r[d]<<8|r[d]>>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[u>>>5]|=128<<u%32,r[14+(u+64>>>9<<4)]=u;var p=s._ff,g=s._gg,v=s._hh,y=s._ii;for(d=0;d<r.length;d+=16){var m=f,b=c,_=l,w=h;f=p(f,c,l,h,r[d+0],7,-680876936),h=p(h,f,c,l,r[d+1],12,-389564586),l=p(l,h,f,c,r[d+2],17,606105819),c=p(c,l,h,f,r[d+3],22,-1044525330),f=p(f,c,l,h,r[d+4],7,-176418897),h=p(h,f,c,l,r[d+5],12,1200080426),l=p(l,h,f,c,r[d+6],17,-1473231341),c=p(c,l,h,f,r[d+7],22,-45705983),f=p(f,c,l,h,r[d+8],7,1770035416),h=p(h,f,c,l,r[d+9],12,-1958414417),l=p(l,h,f,c,r[d+10],17,-42063),c=p(c,l,h,f,r[d+11],22,-1990404162),f=p(f,c,l,h,r[d+12],7,1804603682),h=p(h,f,c,l,r[d+13],12,-40341101),l=p(l,h,f,c,r[d+14],17,-1502002290),f=g(f,c=p(c,l,h,f,r[d+15],22,1236535329),l,h,r[d+1],5,-165796510),h=g(h,f,c,l,r[d+6],9,-1069501632),l=g(l,h,f,c,r[d+11],14,643717713),c=g(c,l,h,f,r[d+0],20,-373897302),f=g(f,c,l,h,r[d+5],5,-701558691),h=g(h,f,c,l,r[d+10],9,38016083),l=g(l,h,f,c,r[d+15],14,-660478335),c=g(c,l,h,f,r[d+4],20,-405537848),f=g(f,c,l,h,r[d+9],5,568446438),h=g(h,f,c,l,r[d+14],9,-1019803690),l=g(l,h,f,c,r[d+3],14,-187363961),c=g(c,l,h,f,r[d+8],20,1163531501),f=g(f,c,l,h,r[d+13],5,-1444681467),h=g(h,f,c,l,r[d+2],9,-51403784),l=g(l,h,f,c,r[d+7],14,1735328473),f=v(f,c=g(c,l,h,f,r[d+12],20,-1926607734),l,h,r[d+5],4,-378558),h=v(h,f,c,l,r[d+8],11,-2022574463),l=v(l,h,f,c,r[d+11],16,1839030562),c=v(c,l,h,f,r[d+14],23,-35309556),f=v(f,c,l,h,r[d+1],4,-1530992060),h=v(h,f,c,l,r[d+4],11,1272893353),l=v(l,h,f,c,r[d+7],16,-155497632),c=v(c,l,h,f,r[d+10],23,-1094730640),f=v(f,c,l,h,r[d+13],4,681279174),h=v(h,f,c,l,r[d+0],11,-358537222),l=v(l,h,f,c,r[d+3],16,-722521979),c=v(c,l,h,f,r[d+6],23,76029189),f=v(f,c,l,h,r[d+9],4,-640364487),h=v(h,f,c,l,r[d+12],11,-421815835),l=v(l,h,f,c,r[d+15],16,530742520),f=y(f,c=v(c,l,h,f,r[d+2],23,-995338651),l,h,r[d+0],6,-198630844),h=y(h,f,c,l,r[d+7],10,1126891415),l=y(l,h,f,c,r[d+14],15,-1416354905),c=y(c,l,h,f,r[d+5],21,-57434055),f=y(f,c,l,h,r[d+12],6,1700485571),h=y(h,f,c,l,r[d+3],10,-1894986606),l=y(l,h,f,c,r[d+10],15,-1051523),c=y(c,l,h,f,r[d+1],21,-2054922799),f=y(f,c,l,h,r[d+8],6,1873313359),h=y(h,f,c,l,r[d+15],10,-30611744),l=y(l,h,f,c,r[d+6],15,-1560198380),c=y(c,l,h,f,r[d+13],21,1309151649),f=y(f,c,l,h,r[d+4],6,-145523070),h=y(h,f,c,l,r[d+11],10,-1120210379),l=y(l,h,f,c,r[d+2],15,718787259),c=y(c,l,h,f,r[d+9],21,-343485551),f=f+m>>>0,c=c+b>>>0,l=l+_>>>0,h=h+w>>>0}return n.endian([f,c,l,h])})._ff=function(t,e,r,n,i,o,a){var s=t+(e&r|~e&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._gg=function(t,e,r,n,i,o,a){var s=t+(e&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._hh=function(t,e,r,n,i,o,a){var s=t+(e^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._ii=function(t,e,r,n,i,o,a){var s=t+(r^(e|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(s(t,e));return e&&e.asBytes?r:e&&e.asString?a.bytesToString(r):n.bytesToHex(r)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?e.push(r.charAt(i>>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(t.charAt(n))>>>6-2*i);return e}},t.exports=n},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
|
|
8
|
+
var n=r(33),i=r(34),o=r(35);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(f.isBuffer(e)){var r=0|d(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=s(t,e<0?0:0|d(e)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,l=0;l<f;l++)if(u(t,o+l)!==u(e,l)){h=!1;break}if(h)return o}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return j(D(e,t.length-r),t,r,n)}function w(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return w(t,e,r,n)}function E(t,e,r,n){return j(q(e),t,r,n)}function A(t,e,r,n){return j(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function C(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=f,e.SlowBuffer=function(t){+t!=t&&(t=0);return f.alloc(+t)},e.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,r){return u(null,t,e,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},f.allocUnsafe=function(t){return h(null,t)},f.allocUnsafeSlow=function(t){return h(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!f.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?B(this,0,t):g.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,r,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=z(t[o]);return i}function M(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||F(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||F(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;r=new f(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},f.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:D(new f(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(9))},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,a;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(a=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],a.set(o,i),i+=o.length;return a}},a={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(n)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i={int:!0,byte:!0,long:!0,byteArray:!0,byteArrayBlock:!0},o=function(){function t(t,e){if(void 0===t&&(t={}),this.parameters=t,this.dataType=e,!e)throw new TypeError("must provide a data type to codec constructor");if(!i[e])throw new TypeError("invalid data type ".concat(e))}return t.prototype._getBits=function(t,e,r){var i=0;if(e.bytePosition+(7-e.bitPosition+r)/8>t.length)throw new n.CramBufferOverrunError("read error during decoding. the file seems to be truncated.");for(var o=r;o;o-=1)i<<=1,i|=t[e.bytePosition]>>e.bitPosition&1,e.bitPosition-=1,e.bitPosition<0&&(e.bytePosition+=1),e.bitPosition&=7;return i},t}();e.default=o},function(t,e,r){(function(e){t.exports=class{constructor(t,r=0,n=0){0!=n?(this.buf=e.allocUnsafe(n),this.length=n):(this.buf=t,this.length=t.length),this.pos=r}EOF(){return this.pos>=this.length}ReadData(t){var e=this.buf.slice(this.pos,this.pos+t);return this.pos+=t,e}ReadByte(){const t=this.buf[this.pos];return this.pos++,t}ReadChar(){const t=this.buf[this.pos];return this.pos++,String.fromCharCode(t)}ReadUint16(){var t=this.ReadByte();return t|=this.ReadByte()<<8}ReadUint32(){const t=this.buf.readInt32LE(this.pos);return this.pos+=4,t}ReadString(){var t="";do{var e=this.buf[this.pos++];e&&(t+=String.fromCharCode(e))}while(e);return t}ReadUint7(){var t=0;do{var e=this.ReadByte();t=t<<7|127&e}while(128&e);return t}ReadITF8(){var t=this.buf[this.pos];return this.pos++,t>=240?(t=(15&t)<<28,t+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):t>=224?(t=(15&t)<<24,t+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(this.buf[this.pos+2]<<0),this.pos+=3):t>=192?(t=(31&t)<<16,t+=(this.buf[this.pos+0]<<8)+(this.buf[this.pos+1]<<0),this.pos+=2):t>=128&&(t=(63&t)<<8,t+=this.buf[this.pos],this.pos++),t}WriteByte(t){this.buf[this.pos++]=t}WriteChar(t){this.buf[this.pos++]=t.charCodeAt(0)}WriteString(t){for(var e=0;e<t.length;e++)this.buf[this.pos++]=t.charCodeAt(e);this.buf[this.pos++]=0}WriteData(t,e){for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]}WriteStream(t){this.WriteData(t.buf,t.pos)}WriteUint16(t){this.WriteByte(255&t),this.WriteByte(t>>8&255)}WriteUint32(t){this.buf.writeInt32LE(t,this.pos),this.pos+=4}WriteUint7(t){var e=0,r=t;do{e+=7,r>>=7}while(r>0);do{e-=7,this.WriteByte((t>>e&127)+((e>0)<<7))}while(e>0)}WriteITF8(t){t<0&&(t=1+t),t<=127?this.buf[this.pos++]=t:t<=16383?(this.buf[this.pos++]=128|Math.floor(t/256),this.buf[this.pos++]=255&t):t<131071?(this.buf[this.pos++]=192|Math.floor(t/65536),this.buf[this.pos++]=255&Math.floor(t/256),this.buf[this.pos++]=255&t):t<268435455?(this.buf[this.pos++]=224|Math.floor(t/16777216),this.buf[this.pos++]=255&Math.floor(t/65536),this.buf[this.pos++]=255&Math.floor(t/256),this.buf[this.pos++]=255&t):(this.buf[this.pos++]=240|Math.floor(t/268435456),this.buf[this.pos++]=255&Math.floor(t/1048576),this.buf[this.pos++]=255&Math.floor(t/4096),this.buf[this.pos++]=255&Math.floor(t/4),this.buf[this.pos++]=15&t)}WriteByteNeg(t){this.buf[--this.pos]=t}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.sequenceMD5=e.tinyMemoize=e.parseItem=e.parseItf8=e.itf8Size=void 0;var i=n(r(61)),o=r(0);e.itf8Size=function(t){return-128&t?-16384&t?-2097152&t?-268435456&t?5:4:3:2:1},e.parseItf8=function(t,e){var r,n=e,i=t[n];if(i<128?(r=i,n+=1):i<192?(r=16383&(i<<8|t[n+1]),n+=2):i<224?(r=2097151&(i<<16|t[n+1]<<8|t[n+2]),n+=3):i<240?(r=268435455&(i<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),n+=4):(r=(15&i)<<28|t[n+1]<<20|t[n+2]<<12|t[n+3]<<4|15&t[n+4],n+=5),n>t.length)throw new o.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[r,n-e]},e.parseItem=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=e.parse(t),o=i.offset,a=i.result;return a._endPosition=o+n,a._size=o-r,a},e.tinyMemoize=function(t,e){var r=t.prototype[e],n="_memo_".concat(e);t.prototype[e]=function(){var t=this;if(!(n in this)){var e=r.call(this);this[n]=e,Promise.resolve(e).catch((function(){delete t[n]}))}return this[n]}},e.sequenceMD5=function(t){return(0,i.default)(t.toUpperCase().replace(/[^\x21-\x7e]/g,""))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(7),o=function(){this.F=void 0,this.C=void 0},a=function(){this.fc=new Array(256);for(var t=0;t<this.fc.length;t+=1)this.fc[t]=new o;this.R=null};function s(t,e,r,n){return r*(t>>n)+(t&(1<<n)-1)-e}var f={FC:o,AriDecoder:a,Symbol:function(){this.start=void 0,this.freq=void 0},symbolInit:function(t,e,r){if(!(e<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(r<=65536-e))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");t.start=e,t.freq=r},advanceStep:s,advanceSymbolStep:function(t,e,r){return s(t,e.start,e.freq,r)},get:function(t,e){return t&(1<<e)-1},advanceSymbol:function(t,e,r,n){return function(t,e,r,n,o){if((t=n*(t>>o)+(t&(1<<o)-1)-r)<i.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<i.RANS_BYTE_L);return t}(t,e,r.start,r.freq,n)},renormalize:function(t,e){if(t<i.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<i.RANS_BYTE_L);return t}};e.default=f},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RANS_BYTE_L=e.TOTFREQ=e.TF_SHIFT=void 0;e.TF_SHIFT=12;e.TOTFREQ=4096;e.RANS_BYTE_L=1<<23},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,r){"use strict";class n{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const e=this.oldCache.get(t);return this._set(t,e),e}}set(t,e){return this.cache.has(t)?this.cache.set(t,e):this._set(t,e),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){return this.cache.has(t)?this.cache.get(t):this.oldCache.has(t)?this.oldCache.get(t):void 0}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[e]=t;this.cache.has(e)||(yield t)}}get size(){let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return this._size+t}}t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(32));e.default=i.default},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.unzip=void 0;var n=r(36);e.unzip=function(e){return t.from((0,n.inflate)(e))}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";t.exports=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}},function(t,e,r){"use strict";var n=r(2),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function f(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a<e;a++)r+=String.fromCharCode(t[a]);return r}a[254]=a[254]=1,e.string2buf=function(t){var e,r,i,o,a,s=t.length,f=0;for(o=0;o<s;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),f+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(f),a=0,o=0;a<f;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|63&r):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|63&r):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|63&r);return e},e.buf2binstring=function(t){return f(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,n,i,o,s=e||t.length,u=new Array(2*s);for(n=0,r=0;r<s;)if((i=t[r++])<128)u[n++]=i;else if((o=a[i])>4)u[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<s;)i=i<<6|63&t[r++],o--;o>1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return f(u,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},function(t,e,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=a[t])?n:(r=u(t,(0|t)<0?-1:0,!0),i&&(a[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=u(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function f(t,e){if(isNaN(t))return e?m:v;if(e){if(t<0)return m;if(t>=p)return E}else{if(t<=-g)return A;if(t+1>=g)return S}return t<0?f(-t,e).neg():u(t%d|0,t/d|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=s,n.fromNumber=f,n.fromBits=u;var c=Math.pow;function h(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(t.substring(1),e,r).neg();for(var i=f(c(r,8)),o=v,a=0;a<t.length;a+=8){var s=Math.min(8,t.length-a),u=parseInt(t.substring(a,a+s),r);if(s<8){var l=f(c(r,s));o=o.mul(l).add(f(u))}else o=(o=o.mul(i)).add(f(u))}return o.unsigned=e,o}function l(t,e){return"number"==typeof t?f(t,e):"string"==typeof t?h(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=h,n.fromValue=l;var d=4294967296,p=d*d,g=p/2,y=s(1<<24),v=s(0);n.ZERO=v;var m=s(0,!0);n.UZERO=m;var b=s(1);n.ONE=b;var _=s(1,!0);n.UONE=_;var w=s(-1);n.NEG_ONE=w;var S=u(-1,2147483647,!1);n.MAX_VALUE=S;var E=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=E;var A=u(0,-2147483648,!1);n.MIN_VALUE=A;var C=n.prototype;C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){var e=f(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=f(c(t,6),this.unsigned),o=this,a="";;){var s=o.div(i),u=(o.sub(s.mul(i)).toInt()>>>0).toString(t);if((o=s).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},C.isZero=function(){return 0===this.high&&0===this.low},C.eqz=C.isZero,C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1==(1&this.low)},C.isEven=function(){return 0==(1&this.low)},C.equals=function(t){return i(t)||(t=l(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},C.eq=C.equals,C.notEquals=function(t){return!this.eq(t)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(t){return this.comp(t)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(t){return this.comp(t)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(t){return this.comp(t)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(t){return this.comp(t)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(t){if(i(t)||(t=l(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(b)},C.neg=C.negate,C.add=function(t){i(t)||(t=l(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,f=t.low>>>16,c=0,h=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,h+=(d+=n+f)>>>16,c+=(h+=r+s)>>>16,c+=e+a,u((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},C.subtract=function(t){return i(t)||(t=l(t)),this.add(t.neg())},C.sub=C.subtract,C.multiply=function(t){if(this.isZero())return v;if(i(t)||(t=l(t)),r)return u(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return v;if(this.eq(A))return t.isOdd()?A:v;if(t.eq(A))return this.isOdd()?A:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(y)&&t.lt(y))return f(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=t.high>>>16,c=65535&t.high,h=t.low>>>16,d=65535&t.low,p=0,g=0,m=0,b=0;return m+=(b+=a*d)>>>16,g+=(m+=o*d)>>>16,m&=65535,g+=(m+=a*h)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=o*h)>>>16,g&=65535,p+=(g+=a*c)>>>16,p+=e*d+n*h+o*c+a*s,u((m&=65535)<<16|(b&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(t){if(i(t)||(t=l(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(A))return t.eq(b)||t.eq(w)?A:t.eq(A)?b:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?b:w:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(A))return this.unsigned?m:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=v}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(e)/Math.LN2),s=a<=48?1:c(2,a-48),h=f(e),d=h.mul(t);d.isNegative()||d.gt(n);)d=(h=f(e-=s,this.unsigned)).mul(t);h.isZero()&&(h=b),o=o.add(h),n=n.sub(d)}return o},C.div=C.divide,C.modulo=function(t){return i(t)||(t=l(t)),r?u((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return u(~this.low,~this.high,this.unsigned)},C.and=function(t){return i(t)||(t=l(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},C.or=function(t){return i(t)||(t=l(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},C.xor=function(t){return i(t)||(t=l(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},C.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},C.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},C.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e,r){(function(e){const n=r(4);function i(t,e){return t&(1<<e)-1}function o(t,e){for(var r=0;e>=t[r+1];)r++;return r}function a(t,e){for(var r=1<<e,n=new Array(r),i=0,o=0;o<r;o++){for(;o>=t[i+1];)i++;n[o]=i}return n}function s(t,e,r,n){return r*(t>>n)+(t&(1<<n)-1)-e}function f(t,e){return e<32768&&(e=(e<<16)+t.ReadUint16()),e}function u(t,e){e.WriteByteNeg(t>>24&255),e.WriteByteNeg(t>>16&255),e.WriteByteNeg(t>>8&255),e.WriteByteNeg(t>>0&255)}function c(t,e,r,n,i){return t=function(t,e,r,n){for(var i=(1<<31-n)*r;t>=i;)e.WriteByteNeg(t>>8&255),e.WriteByteNeg(255&t),t>>=16;return t}(t,e,n,i),t=(Math.floor(t/n)<<i)+t%n+r}function h(t,e,r){0==r&&(r=4);for(var i=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(e.length/r)+(e.length%r>a),i[a]=new Array(o[a]);for(var s=0,f=0;f<e.length;f+=r,s++)for(var u=0;u<r;u++)s<i[u].length&&(i[u][s]=e[f+u]);var c=new Array(r),h=0;for(a=0;a<r;a++){var l=d(i[a],0),p=d(i[a],1);c[a]=p.length<l.length?p:l,h+=c[a].length}var g=new n("",0,h+5*r+1);g.WriteByte(r);for(a=0;a<r;a++)g.WriteUint7(c[a].length);for(a=0;a<r;a++)g.WriteData(c[a],c[a].length);return g.buf.slice(0,g.buf.pos)}function l(t,r){var u=t.ReadByte(),c=1&u,h=8&u,d=32&u,y=64&u,m=128&u;if(16&u||(r=t.ReadUint7()),h)return function(t,r){for(var n=t.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=t.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=l(t,o[a]);var f=new e.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}(t,r);if(m)var b=r,[_,w,r]=function(t){for(var e=t.ReadByte(),r=new Array(e),n=0;n<e;n++)r[n]=t.ReadByte();return[r,e,t.ReadUint7()]}(t);if(y)var S=r,[E,A,r]=function(t){var e=t.ReadUint7(),r=t.ReadUint7();if(1&e)var i=t.ReadData((e-1)/2);else{var o=t.ReadUint7();i=t.ReadData(o);i=g(new n(i),e/2)}i=new n(i);var a=new Array(256),s=i.ReadByte();0==s&&(s=256);for(var f=0;f<s;f++)a[i.ReadByte()]=1;return[a,i,r]}(t);if(d)var C=t.ReadData(r);else if(0==c)C=g(t,r);else C=function(t,r){var u=(d=t.ReadByte())>>4,c=t;if(1&d){var h=t.ReadUint7(),l=t.ReadUint7(),d=new n(t.ReadData(l));c=new n(g(d,h))}var y=new Array(256),m=new Array(256);!function(t,e,r,n){for(var i=0;i<256;i++){e[i]=new Array(256),r[i]=new Array(256);for(var o=0;o<256;o++)e[i][o]=0}var a=p(t);for(i=0;i<256;i++)if(a[i]){var s=0;for(o=0;o<256;o++)a[o]&&(s>0?s--:(e[i][o]=t.ReadUint7(),0==e[i][o]&&(s=t.ReadByte())));v(e[i],n),r[i][0]=0;for(o=0;o<256;o++)r[i][o+1]=r[i][o]+e[i][o]}}(c,y,m,u);for(var b=new Array(256),_=0;_<256;_++)b[_]=a(m[_],u);for(var w=new Array(4),S=new Array(4),E=0;E<4;E++)w[E]=t.ReadUint32(),S[E]=0;var A=new e.allocUnsafe(r),C=Math.floor(r/4);for(_=0;_<C;_++)for(E=0;E<4;E++){var B=i(w[E],u),R=b[S[E]][B];A[_+E*C]=R,w[E]=s(w[E],m[S[E]][R],y[S[E]][R],u),w[E]=f(t,w[E]),S[E]=R}_*=4;for(;_<r;){B=i(w[3],u),R=o(m[S[3]],B);A[_++]=R,w[3]=s(w[3],m[S[3]][R],y[S[3]][R],u),w[3]=f(t,w[3]),S[3]=R}return A}(t,r);return y&&(C=function(t,r,i,o){new n(t);for(var a=new e.allocUnsafe(o),s=0,f=0;s<o;f++){var u=t[f];if(r[u])for(var c=i.ReadUint7(),h=0;h<=c;h++)a[s++]=u;else a[s++]=u}return a}(C,E,A,S)),m&&(C=function(t,r,n,i){var o=new e.allocUnsafe(i),a=0;if(n<=1)for(var s=0;s<i;s++)o[s]=r[0];else if(n<=2)for(s=0;s<i;s++){if(s%8==0)var f=t[a++];o[s]=r[1&f],f>>=1}else if(n<=4)for(s=0;s<i;s++){if(s%4==0)f=t[a++];o[s]=r[3&f],f>>=2}else if(n<=16)for(s=0;s<i;s++){if(s%2==0)f=t[a++];o[s]=r[15&f],f>>=4}return o}(C,_,w,b)),C}function d(t,r){var i=new n("",0,10);i.WriteByte(r);var o=1&r,a=8&r,s=32&r,f=64&r,l=128&r,d=r>>8;if(16&r||i.WriteUint7(t.length),a)return e.concat([i.buf.slice(0,i.pos),h(0,t,d)]);var p=new e.alloc(0);l&&([p,t]=function(t){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;for(i=0;i<t.length;i++)r[t[i]]++;var o=new Array(256),a=0;for(i=0;i<256;i++)r[i]>0&&(o[i]=a++);if(!(a>16)){if(a<=1)var s=new e.allocUnsafe(0);else if(a<=2){s=new e.allocUnsafe(Math.ceil(t.length/8));var f=-1;for(i=0;i<t.length;i++)i%8==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%8}else if(a<=4){s=new e.allocUnsafe(Math.ceil(t.length/4)),f=-1;for(i=0;i<t.length;i++)i%4==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%4*2}else{s=new e.allocUnsafe(Math.ceil(t.length/2)),f=-1;for(i=0;i<t.length;i++)i%2==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%2*4}var u=new n("",0,a+5);u.WriteByte(a);for(f=0,i=0;i<256;i++)r[i]>0&&(r[i]=f++,u.WriteByte(i));return u.WriteUint7(s.length),[u.buf.slice(0,u.pos),s]}}(t));var g=new e.alloc(0);if(f&&([g,t]=function(t){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;var o=-1;for(i=0;i<t.length;i++)r[t[i]]+=t[i]==o?1:-1,o=t[i];var a=0;for(i=0;i<256;i++)r[i]>0&&a++;for(a||(a=1,r[0]=1),(c=new n("",0,a+1+t.length)).WriteByte(a),i=0;i<256;i++)r[i]>0&&c.WriteByte(i);var s=new e.allocUnsafe(t.length),f=0;for(i=0;i<t.length;i++)if(s[f++]=t[i],r[t[i]]>0){o=t[i];for(var u=0;i+u+1<t.length&&t[i+u+1]==o;)u++;c.WriteUint7(u),i+=u}var c,h=b(c.buf.slice(0,c.pos)),l=new n("",0,16);return l.WriteUint7(2*c.pos),l.WriteUint7(f),l.WriteUint7(h.length),[c=e.concat([l.buf.slice(0,l.pos),h]),s.slice(0,f)]}(t)),t.length<4&&1==o&&(o=0,i.buf[0]&=-2),s)var _=t;else if(0==o)_=b(t);else _=function(t){const r=t.length;for(var i=new n("",0,198156),o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(t,e,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)e[n][i]=0}var o=0;for(n=0;n<t.length;n++)r[o]++,e[o][t[n]]++,o=t[n];r[o]++,e[0][t[1*(t.length>>2)]]++,e[0][t[2*(t.length>>2)]]++,e[0][t[3*(t.length>>2)]]++,r[0]+=3})(t,a,o),function(t,e,r){for(var n=0;n<256;n++)if(e[n]){var i=Math.ceil(Math.log2(e[n]));i>r&&(i=r),y(t[n],i)}}(a,o,12);var h=new n("",0,198156);!function(t,e,r){m(t,r);for(var n=0;n<256;n++)if(r[n])for(var i=0,o=0;o<256;o++)if(r[o])if(i)i--;else if(t.WriteUint7(e[n][o]),!e[n][o]){for(var a=o+1;a<256;a++)if(r[a]){if(0!=e[n][a])break;i++}t.WriteByte(i)}}(h,a,o);var l=b(h.buf.slice(0,h.pos));l.length<h.pos?(i.WriteByte(193),i.WriteUint7(h.pos),i.WriteUint7(l.length),i.WriteData(l,l.length)):(i.WriteByte(192),i.WriteData(h.buf,h.pos));!function(t,e,r){for(var n=0;n<256;n++)e[n]&&v(t[n],r)}(a,o,12);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var d=1;d<256;d++)s[f][d]=s[f][d-1]+a[f][d-1]}var p=new Array(4),g=new Array(4);for(d=0;d<4;d++)p[d]=32768,g[d]=0;var _=new n("",1.05*r+100>>0,1.05*r+100>>0),w=Math.floor(r/4),S=new Array(4),E=new Array(4);for(d=0;d<4;d++)S[d]=(d+1)*w-2,E[d]=t[S[d]+1];E[3]=t[r-1];for(f=r-2;f>4*w-2;f--)p[3]=c(p[3],_,s[t[f]][E[3]],a[t[f]][E[3]],12),E[3]=t[f];for(;S[0]>=0;)for(d=3;d>=0;d--){var A=t[S[d]];p[d]=c(p[d],_,s[A][E[d]],a[A][E[d]],12),E[d]=A,S[d]--}for(d=3;d>=0;d--)p[d]=c(p[d],_,s[0][E[d]],a[0][E[d]],12);for(f=3;f>=0;f--)u(p[f],_);return e.concat([i.buf.slice(0,i.pos),_.buf.slice(_.pos,_.length)],i.pos+_.length-_.pos)}(t);return e.concat([i.buf.slice(0,i.pos),p,g,_])}function p(t){for(var e=new Array(256),r=0;r<256;r++)e[r]=0;var n=0,i=t.ReadByte(),o=i;do{e[i]=1,n>0?(n--,i++):(i=t.ReadByte())==o+1&&(n=t.ReadByte()),o=i}while(0!=i);return e}function g(t,r){var n=new Array(256),o=new Array(256);!function(t,e,r){for(var n=0;n<256;n++)e[n]=0;var i=p(t);for(n=0;n<256;n++)i[n]>0&&(e[n]=t.ReadUint7());for(v(e,12),r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+e[n]}(t,n,o);for(var u=a(o,12),c=new Array(4),h=0;h<4;h++)c[h]=t.ReadUint32();var l=new e.allocUnsafe(r);for(h=0;h<r;h++){var d=h%4,g=u[i(c[d],12)];l[h]=g,c[d]=s(c[d],o[g],n[g],12),c[d]=f(t,c[d])}return l}function y(t,e){for(var r=0,n=0;n<256;n++)r+=t[n];const i=1<<e;var o=i/r;do{var a=0,s=0,f=0;r=0;for(n=0;n<256;n++)0!=t[n]&&(a<t[n]&&(a=t[n],s=n),t[n]=Math.floor(t[n]*o),0==t[n]&&(t[n]=1),r+=t[n]);r<i?t[s]+=i-r:r-i<t[s]/2&&t[s]>2?t[s]-=r-i:r!=i&&(o=i/r,f=1)}while(f)}function v(t,e){for(var r=0,n=0;n<256;n++)r+=t[n];if(0!=r&&r!=1<<e){for(var i=0;r<1<<e;)r*=2,i++;for(n=0;n<256;n++)t[n]<<=i}}function m(t,e){for(var r=0,n=0;n<256;n++)if(e[n])if(r>0)r--;else if(t.WriteByte(n),n>0&&e[n-1]>0){for(r=n+1;r<256&&e[r];r++);r-=n+1,t.WriteByte(r)}t.WriteByte(0)}function b(t){const r=t.length;var i=new n("",0,780),o=new Array(256);!function(t,e){for(var r=0;r<256;r++)e[r]=0;for(r=0;r<t.length;r++)e[t[r]]++}(t,o);var a=Math.ceil(Math.log2(r));a>12&&(a=12),y(o,a),function(t,e){m(t,e);for(var r=0;r<256;r++)e[r]&&t.WriteUint7(e[r])}(i,o),y(o,12);var s=new Array(256);s[0]=0;for(var f=1;f<256;f++)s[f]=s[f-1]+o[f-1];var h=new Array(4);for(f=0;f<4;f++)h[f]=32768;var l=new n("",1.05*r+100>>0,1.05*r+100>>0);for(f=r-1;f>=0;f--)h[f%4]=c(h[f%4],l,s[t[f]],o[t[f]],12);for(f=3;f>=0;f--)u(h[f],l);return e.concat([i.buf.slice(0,i.pos),l.buf.slice(l.pos,l.length)],i.pos+l.length-l.pos)}t.exports={decode:function(t){return l(new n(t),0)},encode:d}}).call(this,r(1).Buffer)},function(t,e,r){(function(e){const n=r(26),i=r(4),o=r(27),a=r(56);t.exports=class{decode(t){return this.stream=new i(t),this.decodeStream(this.stream)}decodeStream(t,e=0){var r=this.stream.ReadByte();16&r||(e=this.stream.ReadUint7());var n,i=e,o=1&r;if(8&r)return this.decodeStripe(this.stream,e);128&r&&([n,i]=this.decodePackMeta(this.stream));if(32&r)var a=this.decodeCat(this.stream,i);else if(4&r)a=this.decodeExt(this.stream,i);else if(64&r)a=o?this.decodeRLE1(this.stream,i):this.decodeRLE0(this.stream,i);else a=o?this.decode1(this.stream,i):this.decode0(this.stream,i);return 128&r&&(a=this.decodePack(a,n,e)),a}encode(t,r){if(this.stream=new i("",0,1.1*t.length+100),this.stream.WriteByte(r),16&r||this.stream.WriteUint7(t.length),8&r)return e.concat([this.stream.buf.slice(0,this.stream.pos),this.encodeStripe(this.stream,t,r>>8)]);var n,o=1&r,a=t.length;return 128&r&&([n,t,a]=this.encodePack(t)),128&r&&this.stream.WriteStream(n),64&r?o?this.encodeRLE1(t,a,this.stream):this.encodeRLE0(t,a,this.stream):o?this.encode1(t,a,this.stream):this.encode0(t,a,this.stream)}decode0(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);var s=new o(a),f=new n(t);f.RangeStartDecode(t);for(var u=0;u<r;u++)i[u]=s.ModelDecode(t,f);return i}encode0(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new o(i);r.WriteByte(i);var f=new n(r);for(a=0;a<e;a++)s.ModelEncode(r,f,t[a]);return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decode1(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new n(t);u.RangeStartDecode(t);var c=0;for(f=0;f<r;f++)i[f]=s[c].ModelDecode(t,u),c=i[f];return i}encode1(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);r.WriteByte(i);var f=new n(r),u=0;for(a=0;a<e;a++)s[u].ModelEncode(r,f,t[a]),u=t[a];return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeExt(t,r){var n=new e.allocUnsafe(r),i=a.array(t.buf.slice(t.pos)),o=a.header(i),s=0;do{var f=a.decompress(i,o);-1!=f&&(e.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f);return n}encodeExt(t,e){}decodeRLE0(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new o(a),f=new Array(258),u=0;u<=257;u++)f[u]=new o(4);var c=new n(t);c.RangeStartDecode(t);for(u=0;u<r;){i[u]=s.ModelDecode(t,c);for(var h=f[i[u]].ModelDecode(t,c),l=h,d=256;3==h;)h=f[d].ModelDecode(t,c),d=257,l+=h;for(var p=1;p<=l;p++)i[u+p]=i[u];u+=l+1}return i}encodeRLE0(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new o(i),f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);var u=new n(r);for(a=0;a<e;){s.ModelEncode(r,u,t[a]);for(var c=1;a+c<e&&t[a+c]==t[a];)c++;c--;var h=t[a];t[a];a+=c+1;var l=c>=3?3:c;for(f[h].ModelEncode(r,u,l),c-=l,h=256;3==l;)l=c>=3?3:c,f[h].ModelEncode(r,u,l),h=257,c-=l}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeRLE1(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new Array(258);for(f=0;f<=257;f++)u[f]=new o(4);var c=new n(t);c.RangeStartDecode(t);var h=0;for(f=0;f<r;){i[f]=s[h].ModelDecode(t,c),h=i[f];for(var l=u[i[f]].ModelDecode(t,c),d=l,p=256;3==l;)l=u[p].ModelDecode(t,c),p=257,d+=l;for(var g=1;g<=d;g++)i[f+g]=i[f];f+=d+1}return i}encodeRLE1(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);var f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);for(var u=new n(r),c=(a=0,0);a<e;){s[c].ModelEncode(r,u,t[a]);for(var h=1;a+h<e&&t[a+h]==t[a];)h++;h--;var l=t[a];c=t[a],a+=h+1;var d=h>=3?3:h;for(f[l].ModelEncode(r,u,d),h-=d,l=256;3==d;)d=h>=3?3:h,f[l].ModelEncode(r,u,d),l=257,h-=d}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodePackMeta(t){this.nsym=t.ReadByte();for(var e=new Array(this.nsym),r=0;r<this.nsym;r++)e[r]=t.ReadByte();return[e,t.ReadUint7()]}decodePack(t,r,n){var i=new e.allocUnsafe(n);if(this.nsym<=1)for(var o=0;o<n;o++)i[o]=r[0];else if(this.nsym<=2){o=0;for(var a=0;o<n;o++){if(o%8==0)var s=t[a++];i[o]=r[1&s],s>>=1}}else if(this.nsym<=4)for(o=0,a=0;o<n;o++){if(o%4==0)s=t[a++];i[o]=r[3&s],s>>=2}else{if(!(this.nsym<=16))return t;for(o=0,a=0;o<n;o++){if(o%2==0)s=t[a++];i[o]=r[15&s],s>>=4}}return i}packMeta(t){for(var e=new i("",0,1024),r=new Array(256),n=0;n<t.length;n++)r[t[n]]=1;var o=0;for(n=0;n<256;n++)r[n]&&(r[n]=++o);e.WriteByte(o);for(n=0;n<256;n++)r[n]&&(e.WriteByte(n),r[n]--);return[e,r,o]}encodePack(t){var r,n,i;[r,n,i]=this.packMeta(t);var o=t.length,a=0;if(i<=1)return r.WriteUint7(0),[r,new e.allocUnsafe(0),0];if(i<=2){for(var s=new e.allocUnsafe(Math.floor((o+7)/8)),f=(a=0,0);a<(-8&o);a+=8,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<1)+(n[t[a+2]]<<2)+(n[t[a+3]]<<3)+(n[t[a+4]]<<4)+(n[t[a+5]]<<5)+(n[t[a+6]]<<6)+(n[t[a+7]]<<7);if(a<o){s[f]=0;for(var u=0;a<o;)s[f]|=n[t[a++]]<<u,u++;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=4){for(s=new e.allocUnsafe(Math.floor((o+3)/4)),a=0,f=0;a<(-4&o);a+=4,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<2)+(n[t[a+2]]<<4)+(n[t[a+3]]<<6);if(a<o){s[f]=0;for(u=0;a<o;)s[f]|=n[t[a++]]<<u,u+=2;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=16){for(s=new e.allocUnsafe(Math.floor((o+1)/2)),a=0,f=0;a<(-2&o);a+=2,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<4);return a<o&&(s[f++]=n[t[a++]]),r.WriteUint7(f),[r,s,s.length]}return r.WriteUint7(t.length),[r,t,t.length]}encodeStripe(t,e,r){0==r&&(r=4);for(var n=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(e.length/r)+(e.length%r>a),n[a]=new Array(o[a]);for(var s=0,f=0;f<e.length;f+=r,s++)for(var u=0;u<r;u++)s<n[u].length&&(n[u][s]=e[f+u]);var c=new Array(r),h=0;for(a=0;a<r;a++){var l=this.encode(n[a],0),d=this.encode(n[a],1);c[a]=d.length<l.length?d:l,h+=c[a].length}var p=new i("",0,h+5*r+1);p.WriteByte(r);for(a=0;a<r;a++)p.WriteUint7(c[a].length);for(a=0;a<r;a++)p.WriteData(c[a],c[a].length);return p.buf.slice(0,p.buf.pos)}decodeStripe(t,r){for(var n=t.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=t.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=this.decodeStream(t,o[a]);var f=new e.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}decodeCat(t,r){for(var n=new e.allocUnsafe(r),i=0;i<r;i++)n[i]=t.ReadByte();return n}}}).call(this,r(1).Buffer)},function(t,e){t.exports=class{constructor(t){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(t){for(var e=0;e<5;e++)this.code=(this.code<<8)+t.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(t){return this.range=Math.floor(this.range/t),Math.floor(this.code/this.range)}RangeDecode(t,e,r,n){for(this.code-=e*this.range,this.range*=r;this.range<1<<24;)this.range*=256,this.code=256*this.code+t.ReadByte()}RangeShiftLow(t){if(this.low<4278190080|this.carry){for(t.WriteByte(this.cache+this.carry);this.FFnum;)t.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(t,e,r,n){var i=this.low;for(this.range=Math.floor(this.range/n),this.low+=e*this.range,this.low>>>=0,this.range*=r,this.low<i&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(t)}RangeFinishEncode(t){for(var e=0;e<5;e++)this.RangeShiftLow(t)}}},function(t,e){t.exports=class{constructor(t=256){this.total_freq=t,this.max_sym=t-1,this.S=new Array,this.F=new Array;for(var e=0;e<=this.max_sym;e++)this.S[e]=e,this.F[e]=1}ModelDecode(t,e){for(var r=e.RangeGetFrequency(this.total_freq),n=0,i=0;n+this.F[i]<=r;)n+=this.F[i++];e.RangeDecode(t,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var o=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var a=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=a,a=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=a}return o}ModelRenormalise(){this.total_freq=0;for(var t=0;t<=this.max_sym;t++)this.F[t]-=Math.floor(this.F[t]/2),this.total_freq+=this.F[t]}ModelEncode(t,e,r){for(var n=0,i=0;this.S[i]!=r;i++)n+=this.F[i];e.RangeEncode(t,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();r=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var o=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=o,o=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=o}}}},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.open=e.fromUrl=e.RemoteFile=e.LocalFile=void 0;var i=n(r(76)),o=n(r(83));e.RemoteFile=o.default;var a=n(r(86));function s(t){var e=i.default.parse(t),r=e.protocol,n=e.pathname;return"file:"===r?new a.default(unescape(n)):new o.default(t)}e.LocalFile=a.default,e.fromUrl=s,e.open=function(t,e,r){if(r)return r;if(t)return s(t);if(e)return new a.default(e);throw new Error("no url, path, or filehandle provided, cannot open")}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.AbortSignal=e.AbortController=void 0;var n=r(93),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")},o=void 0===i().AbortController?n.AbortController:i().AbortController;e.AbortController=o;var a=void 0===i().AbortController?n.AbortSignal:i().AbortSignal;e.AbortSignal=a}).call(this,r(9))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CraiIndex=e.IndexedCramFile=e.CramFile=void 0;var i=n(r(16));e.CramFile=i.default;var o=n(r(88));e.IndexedCramFile=o.default;var a=n(r(89));e.CraiIndex=a.default},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(17),s=o(r(45)),f=o(r(11)),u=r(0),c=o(r(46)),h=r(50),l=o(r(54)),d=o(r(60)),p=r(29),g=r(5),y=r(87),v=function(){function e(t){this.file=(0,p.open)(t.url,t.path,t.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=t.seqFetch,this.options={checkSequenceMD5:!1!==t.checkSequenceMD5,cacheSize:void 0!==t.cacheSize?t.cacheSize:2e4},this.featureCache=new f.default({maxSize:this.options.cacheSize})}return e.prototype.toString=function(){return this.file.filename?this.file.filename:this.file.url?this.file.url:"(cram file)"},e.prototype.read=function(t,e,r,n){return this.file.read(t,e,r,n)},e.prototype.stat=function(){return this.file.stat()},e.prototype.getDefinition=function(){return n(this,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return e=t.allocUnsafe(h.cramFileDefinition.maxLength),[4,this.file.read(e,0,h.cramFileDefinition.maxLength,0)];case 1:if(n.sent(),2!==(r=h.cramFileDefinition.parser.parse(e).result).majorVersion&&3!==r.majorVersion)throw new u.CramUnimplementedError("CRAM version ".concat(r.majorVersion," not supported"));return[2,r]}}))}))},e.prototype.getSamHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getContainerById(0)];case 1:if(!(t=i.sent()))throw new u.CramMalformedError("file contains no containers");return[4,t.getFirstBlock()];case 2:return e=i.sent().content,r=e.readInt32LE(0),4,n=e.toString("utf8",4,4+r),this.header=n,[2,(0,y.parseHeaderText)(n)]}}))}))},e.prototype.getHeaderText=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getSamHeader()];case 1:return t.sent(),[2,this.header]}}))}))},e.prototype.getSectionParsers=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getDefinition()];case 1:return t=e.sent().majorVersion,[2,(0,h.getSectionParsers)(t)]}}))}))},e.prototype.getContainerById=function(t){return n(this,void 0,void 0,(function(){var e,r,n,o,a,s,f,c,h;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return e=i.sent(),r=e.cramFileDefinition.maxLength,[4,this.file.stat()];case 2:n=i.sent().size,o=e.cramContainerHeader1,s=0,i.label=3;case 3:return s<=t?r+o.maxLength+8>=n?[2,void 0]:[4,(a=this.getContainerAtPosition(r)).getHeader()]:[3,11];case 4:if(!(f=i.sent()))throw new u.CramMalformedError("container ".concat(t," not found in file"));if(0!==s)return[3,9];r=f._endPosition,c=0,i.label=5;case 5:return c<f.numBlocks?[4,this.readBlock(r)]:[3,8];case 6:h=i.sent(),r=h._endPosition,i.label=7;case 7:return c+=1,[3,5];case 8:return[3,10];case 9:r+=f._size+f.length,i.label=10;case 10:return s+=1,[3,3];case 11:return[2,a]}}))}))},e.prototype.checkCrc32=function(e,r,o,a){return n(this,void 0,void 0,(function(){var n,f;return i(this,(function(i){switch(i.label){case 0:return n=t.allocUnsafe(r),[4,this.file.read(n,0,r,e)];case 1:if(i.sent(),(f=s.default.unsigned(n))!==o)throw new u.CramMalformedError("crc mismatch in ".concat(a,": recorded CRC32 = ").concat(o,", but calculated CRC32 = ").concat(f));return[2]}}))}))},e.prototype.containerCount=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a,s,f;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return t=i.sent(),[4,this.file.stat()];case 2:e=i.sent().size,r=t.cramContainerHeader1,n=0,o=t.cramFileDefinition.maxLength,i.label=3;case 3:return o+r.maxLength+8<e?[4,this.getContainerAtPosition(o).getHeader()]:[3,11];case 4:if(!(a=i.sent()))return[3,11];if(0!==n)return[3,9];o=a._endPosition,s=0,i.label=5;case 5:return s<a.numBlocks?[4,this.readBlock(o)]:[3,8];case 6:f=i.sent(),o=f._endPosition,i.label=7;case 7:return s+=1,[3,5];case 8:return[3,10];case 9:o+=a._size+a.length,i.label=10;case 10:return n+=1,[3,3];case 11:return[2,n]}}))}))},e.prototype.getContainerAtPosition=function(t){return new d.default(this,t)},e.prototype.readBlockHeader=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return r=i.sent(),n=r.cramBlockHeader,[4,this.file.stat()];case 2:return o=i.sent().size,e+n.maxLength>=o?[2,void 0]:(a=t.allocUnsafe(n.maxLength),[4,this.file.read(a,0,n.maxLength,e)]);case 3:return i.sent(),[2,(0,g.parseItem)(a,n.parser,0,e)]}}))}))},e.prototype._parseSection=function(e,r,o,a){return void 0===o&&(o=e.maxLength),n(this,void 0,void 0,(function(){var n,s,f;return i(this,(function(i){switch(i.label){case 0:return a?(n=a,[3,4]):[3,1];case 1:return[4,this.file.stat()];case 2:return s=i.sent().size,r+o>=s?[2,void 0]:(n=t.allocUnsafe(o),[4,this.file.read(n,0,o,r)]);case 3:i.sent(),i.label=4;case 4:if((f=(0,g.parseItem)(n,e.parser,0,r))._size!==o)throw new u.CramMalformedError("section read error: requested size ".concat(o," does not equal parsed size ").concat(f._size));return[2,f]}}))}))},e.prototype._uncompress=function(e,r,n){if("gzip"===e)(0,a.unzip)(r).copy(n);else if("bzip2"===e){var i=bzip2.array(r),o=bzip2.header(i),s=0;do{var f=bzip2.decompress(i,o);-1!=f&&(t.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f)}else if("rans"===e)(0,c.default)(r,n);else if("rans4x16"===e)l.default.r4x16_uncompress(r,n);else if("arith"===e)l.default.arith_uncompress(r,n);else if("fqzcomp"===e)l.default.fqzcomp_uncompress(r,n);else{if("tok3"!==e)throw new u.CramUnimplementedError("".concat(e," decompression not yet implemented"));l.default.tok3_uncompress(r,n)}},e.prototype.readBlock=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a,s,f,u;return i(this,(function(i){switch(i.label){case 0:return[4,this.getDefinition()];case 1:return r=i.sent().majorVersion,[4,this.getSectionParsers()];case 2:return n=i.sent(),[4,this.readBlockHeader(e)];case 3:return o=i.sent(),a=o._endPosition,o.contentPosition=o._endPosition,s=t.allocUnsafe(o.uncompressedSize),"raw"===o.compressionMethod?[3,5]:(f=t.allocUnsafe(o.compressedSize),[4,this.read(f,0,o.compressedSize,a)]);case 4:return i.sent(),this._uncompress(o.compressionMethod,f,s),[3,7];case 5:return[4,this.read(s,0,o.uncompressedSize,a)];case 6:i.sent(),i.label=7;case 7:return o.content=s,r>=3?[4,this._parseSection(n.cramBlockCrc32,a+o.compressedSize)]:[3,11];case 8:return u=i.sent(),o.crc32=u.crc32,this.validateChecksums?[4,this.checkCrc32(e,o._size+o.compressedSize,o.crc32,"block data")]:[3,10];case 9:i.sent(),i.label=10;case 10:return o._endPosition=u._endPosition,o._size=o.compressedSize+n.cramBlockCrc32.maxLength,[3,12];case 11:o._endPosition=a+o.compressedSize,o._size=o.compressedSize,i.label=12;case 12:return[2,o]}}))}))},e}();e.default=v,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((function(t){return(0,g.tinyMemoize)(v,t)}))}).call(this,r(1).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=u(t),a=n[0],s=n[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[c++]=e>>16&255,f[c++]=e>>8&255,f[c++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[c++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[c++]=e>>8&255,f[c++]=255&e);return f},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=a.length;s<f;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
9
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
10
|
+
e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=l,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<<u)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*f-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+d]=255&a,d+=p,a/=256,u-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n={};(0,r(2).assign)(n,r(37),r(40),r(22)),t.exports=n},function(t,e,r){"use strict";var n=r(38),i=r(2),o=r(20),a=r(10),s=r(21),f=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(a[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===f.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=n.deflateSetDictionary(this.strm,c)))throw new Error(a[r]);this._dict_set=!0}}function c(t,e){var r=new u(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}u.prototype.push=function(t,e){var r,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===f.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),s.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=c,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},function(t,e,r){"use strict";var n,i=r(2),o=r(39),a=r(18),s=r(19),f=r(10);function u(t,e){return t.msg=f[e],e}function c(t){return(t<<1)-(t>4?9:0)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function l(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function d(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,l(t.strm)}function p(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function y(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),0===o?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function v(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,f=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,c=t.w_mask,h=t.prev,l=t.strstart+258,d=u[o+a-1],p=u[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===d&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<l);if(n=258-(l-o),o=l-258,n>a){if(t.match_start=e,a=n,n>=s)break;d=u[o+a-1],p=u[o+a]}}}while((e=h[e&c])>f&&0!=--i);return a<=t.lookahead?a:t.lookahead}function m(t){var e,r,n,o,a,s=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-262)){i.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--r);e=r=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--r);o+=s}if(0===t.strm.avail_in)break;if(r=y(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+3-1])&t.hash_mask,t.prev[a&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=a,a++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function b(t,e){for(var r,n;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=v(t,r)),t.match_length>=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}function _(t,e){for(var r,n,i;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=v(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(d(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=o._tr_tally(t,0,t.window[t.strstart-1]))&&d(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}function w(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),h(this.dyn_ltree),h(this.dyn_dtree),h(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),h(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),h(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function E(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):u(t,-2)}function A(t){var e,r=E(t);return 0===r&&((e=t.state).window_size=2*e.w_size,h(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function C(t,e,r,n,o,a){if(!t)return-2;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return u(t,-2);8===n&&(n=9);var f=new S;return t.state=f,f.strm=t,f.wrap=s,f.gzhead=null,f.w_bits=n,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=o+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+3-1)/3),f.window=new i.Buf8(2*f.w_size),f.head=new i.Buf16(f.hash_size),f.prev=new i.Buf16(f.w_size),f.lit_bufsize=1<<o+6,f.pending_buf_size=4*f.lit_bufsize,f.pending_buf=new i.Buf8(f.pending_buf_size),f.d_buf=1*f.lit_bufsize,f.l_buf=3*f.lit_bufsize,f.level=e,f.strategy=a,f.method=r,A(t)}n=[new w(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(m(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,d(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(d(t,!1),t.strm.avail_out),1)})),new w(4,4,8,4,b),new w(4,5,16,8,b),new w(4,6,32,32,b),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],e.deflateInit=function(t,e){return C(t,e,8,15,8,0)},e.deflateInit2=C,e.deflateReset=A,e.deflateResetKeep=E,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},e.deflate=function(t,e){var r,i,a,f;if(!t||!t.state||e>5||e<0)return t?u(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return u(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var y=8+(i.w_bits-8<<4)<<8;y|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(y|=32),y+=31-y%31,i.status=113,g(i,y),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&l(t),i.pending+2<=i.pending_buf_size&&(p(i,255&t.adler),p(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(l(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return u(t,-5);if(666===i.status&&0!==t.avail_in)return u(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var v=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(m(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(m(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);t.match_length=258-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==v&&4!==v||(i.status=666),1===v||3===v)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===v&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),l(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&t.adler),p(i,t.adler>>8&255),p(i,t.adler>>16&255),p(i,t.adler>>24&255),p(i,255&t.total_in),p(i,t.total_in>>8&255),p(i,t.total_in>>16&255),p(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),l(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?u(t,-2):(t.state=null,113===e?u(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var r,n,o,s,f,u,c,l,d=e.length;if(!t||!t.state)return-2;if(2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return-2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,e,d-r.w_size,r.w_size,0),e=l,d=r.w_size),f=t.avail_in,u=t.next_in,c=t.input,t.avail_in=d,t.next_in=0,t.input=e,m(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=2,m(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=u,t.input=c,t.avail_in=f,r.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,r){"use strict";var n=r(2);function i(t){for(var e=t.length;--e>=0;)t[e]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var c=new Array(60);i(c);var h=new Array(512);i(h);var l=new Array(256);i(l);var d=new Array(29);i(d);var p,g,y,v=new Array(30);function m(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?h[t]:h[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function S(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function E(t,e,r){S(t,r[2*e],r[2*e+1])}function A(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function C(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=A(o[s]++,s))}}function B(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function k(t,e,r,n){var i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]}function x(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&k(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!k(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function M(t,e,r){var n,i,s,f,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],i=t.pending_buf[t.l_buf+u],u++,0===n?E(t,i,e):(E(t,(s=l[i])+256+1,e),0!==(f=o[s])&&S(t,i-=d[s],f),E(t,s=_(--n),r),0!==(f=a[s])&&S(t,n-=v[s],f))}while(u<t.last_lit);E(t,256,e)}function T(t,e){var r,n,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,f=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<f;r++)0!==o[2*r]?(t.heap[++t.heap_len]=u=r,t.depth[r]=0):o[2*r+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=u,r=t.heap_len>>1;r>=1;r--)x(t,o,r);i=f;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],x(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,x(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=f[2*f[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,g++),f[2*n+1]=o,n>u||(t.bl_count[o]++,a=0,n>=d&&(a=l[n-d]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>u||(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),C(o,u,t.bl_count)}function I(t,e,r){var n,i,o=-1,a=e[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s<f&&i===a||(s<u?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4))}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s<f&&i===a)){if(s<u)do{E(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(E(t,i,t.bl_tree),s--),E(t,16,t.bl_tree),S(t,s-3,2)):s<=10?(E(t,17,t.bl_tree),S(t,s-3,3)):(E(t,18,t.bl_tree),S(t,s-11,7));s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4)}}i(v);var O=!1;function F(t,e,r,i){S(t,0+(i?1:0),3),function(t,e,r,i){R(t),i&&(w(t,r),w(t,~r)),n.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r,!0)}e._tr_init=function(t){O||(!function(){var t,e,r,n,i,f=new Array(16);for(r=0,n=0;n<28;n++)for(d[n]=r,t=0;t<1<<o[n];t++)l[r++]=n;for(l[r-1]=n,i=0,n=0;n<16;n++)for(v[n]=i,t=0;t<1<<a[n];t++)h[i++]=n;for(i>>=7;n<30;n++)for(v[n]=i<<7,t=0;t<1<<a[n]-7;t++)h[256+i++]=n;for(e=0;e<=15;e++)f[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,f[8]++;for(;t<=255;)u[2*t+1]=9,t++,f[9]++;for(;t<=279;)u[2*t+1]=7,t++,f[7]++;for(;t<=287;)u[2*t+1]=8,t++,f[8]++;for(C(u,287,f),t=0;t<30;t++)c[2*t+1]=5,c[2*t]=A(t,5);p=new m(u,o,257,286,15),g=new m(c,a,0,30,15),y=new m(new Array(0),s,0,19,7)}(),O=!0),t.l_desc=new b(t.dyn_ltree,p),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,B(t)},e._tr_stored_block=F,e._tr_flush_block=function(t,e,r,n){var i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),a=function(t){var e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||o===i?(S(t,2+(n?1:0),3),M(t,u,c)):(S(t,4+(n?1:0),3),function(t,e,r,n){var i;for(S(t,e-257,5),S(t,r-1,5),S(t,n-4,4),i=0;i<n;i++)S(t,t.bl_tree[2*f[i]+1],3);P(t,t.dyn_ltree,e-1),P(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),M(t,t.dyn_ltree,t.dyn_dtree)),B(t),n&&R(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(l[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){S(t,2,3),E(t,256,u),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,r){"use strict";var n=r(41),i=r(2),o=r(20),a=r(22),s=r(10),f=r(21),u=r(44),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(s[r])}function l(t,e){var r=new h(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(t,e){var r,s,f,u,h,l=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?l.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?l.input=new Uint8Array(t):l.input=t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new i.Buf8(d),l.next_out=0,l.avail_out=d),(r=n.inflate(l,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&r!==a.Z_STREAM_END&&(0!==l.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(f=o.utf8border(l.output,l.next_out),u=l.next_out-f,h=o.buf2string(l.output,f),l.next_out=u,l.avail_out=d-u,u&&i.arraySet(l.output,l.output,f,u,0),this.onData(h)):this.onData(i.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(g=!0)}while((l.avail_in>0||0===l.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),l.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=l,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.ungzip=l},function(t,e,r){"use strict";var n=r(2),i=r(18),o=r(19),a=r(42),s=r(43);function f(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function h(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,c(t)):-2}function l(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,h(t))):-2}function d(t,e){var r,n;return t?(n=new u,t.state=n,n.window=null,0!==(r=l(t,e))&&(t.state=null),r):-2}var p,g,y=!0;function v(t){if(y){var e;for(p=new n.Buf32(512),g=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,g,0,t.work,{bits:5}),y=!1}t.lencode=p,t.lenbits=9,t.distcode=g,t.distbits=5}function m(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}e.inflateReset=h,e.inflateReset2=l,e.inflateResetKeep=c,e.inflateInit=function(t){return d(t,15)},e.inflateInit2=d,e.inflate=function(t,e){var r,u,c,h,l,d,p,g,y,b,_,w,S,E,A,C,B,R,k,x,M,T,I,P,O=0,F=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(r=t.state).mode&&(r.mode=13),l=t.next_out,c=t.output,p=t.avail_out,h=t.next_in,u=t.input,d=t.avail_in,g=r.hold,y=r.bits,b=d,_=p,T=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(2&r.wrap&&35615===g){r.check=0,F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0),g=0,y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(y-=4,M=8+(15&(g>>>=4)),0===r.wbits)r.wbits=M;else if(M>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<M,t.adler=r.check=1,r.mode=512&g?10:12,g=0,y=0;break;case 2:for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(r.flags=g,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0,r.mode=3;case 3:for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.head&&(r.head.time=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=o(r.check,F,4,0)),g=0,y=0,r.mode=4;case 4:for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((w=r.length)>d&&(w=d),w&&(r.head&&(M=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,h,w,M)),512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,r.length-=w),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;w=0;do{M=u[h+w++],r.head&&M&&r.length<65536&&(r.head.name+=String.fromCharCode(M))}while(M&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,M)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break t;w=0;do{M=u[h+w++],r.head&&M&&r.length<65536&&(r.head.comment+=String.fromCharCode(M))}while(M&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,M)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}g=0,y=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}t.adler=r.check=f(g),g=0,y=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){g>>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}switch(r.last=1&g,y-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(v(r),r.mode=20,6===e){g>>>=2,y-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,y-=2;break;case 14:for(g>>>=7&y,y-=7&y;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(w=r.length){if(w>d&&(w=d),w>p&&(w=p),0===w)break t;n.arraySet(c,u,h,w,l),d-=w,h+=w,p-=w,l+=w,r.length-=w;break}r.mode=12;break;case 17:for(;y<14;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(r.nlen=257+(31&g),g>>>=5,y-=5,r.ndist=1+(31&g),g>>>=5,y-=5,r.ncode=4+(15&g),g>>>=4,y-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;y<3;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.lens[U[r.have++]]=7&g,g>>>=3,y-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=s(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;C=(O=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,B=65535&O,!((A=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(B<16)g>>>=A,y-=A,r.lens[r.have++]=B;else{if(16===B){for(P=A+2;y<P;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g>>>=A,y-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}M=r.lens[r.have-1],w=3+(3&g),g>>>=2,y-=2}else if(17===B){for(P=A+3;y<P;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}y-=A,M=0,w=3+(7&(g>>>=A)),g>>>=3,y-=3}else{for(P=A+7;y<P;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}y-=A,M=0,w=11+(127&(g>>>=A)),g>>>=7,y-=7}if(r.have+w>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;w--;)r.lens[r.have++]=M}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,I={bits:r.lenbits},T=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(d>=6&&p>=258){t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,a(t,_),l=t.next_out,c=t.output,p=t.avail_out,h=t.next_in,u=t.input,d=t.avail_in,g=r.hold,y=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;C=(O=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,B=65535&O,!((A=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(C&&0==(240&C)){for(R=A,k=C,x=B;C=(O=r.lencode[x+((g&(1<<R+k)-1)>>R)])>>>16&255,B=65535&O,!(R+(A=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}g>>>=R,y-=R,r.back+=R}if(g>>>=A,y-=A,r.back+=A,r.length=B,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=12;break}if(64&C){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(P=r.extra;y<P;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(O=r.distcode[g&(1<<r.distbits)-1])>>>16&255,B=65535&O,!((A=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(0==(240&C)){for(R=A,k=C,x=B;C=(O=r.distcode[x+((g&(1<<R+k)-1)>>R)])>>>16&255,B=65535&O,!(R+(A=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}g>>>=R,y-=R,r.back+=R}if(g>>>=A,y-=A,r.back+=A,64&C){t.msg="invalid distance code",r.mode=30;break}r.offset=B,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(P=r.extra;y<P;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break t;if(w=_-p,r.offset>w){if((w=r.offset-w)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}w>r.wnext?(w-=r.wnext,S=r.wsize-w):S=r.wnext-w,w>r.length&&(w=r.length),E=r.window}else E=c,S=l-r.offset,w=r.length;w>p&&(w=p),p-=w,r.length-=w;do{c[l++]=E[S++]}while(--w);0===r.length&&(r.mode=21);break;case 26:if(0===p)break t;c[l++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===d)break t;d--,g|=u[h++]<<y,y+=8}if(_-=p,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?o(r.check,c,_,l-_):i(r.check,c,_,l-_)),_=p,(r.flags?g:f(g))!==r.check){t.msg="incorrect data check",r.mode=30;break}g=0,y=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}g=0,y=0}r.mode=29;case 29:T=1;break t;case 30:T=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,(r.wsize||_!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,_-t.avail_out)?(r.mode=31,-4):(b-=t.avail_in,_-=t.avail_out,t.total_in+=b,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?o(r.check,c,_,t.next_out-_):i(r.check,c,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===b&&0===_||4===e)&&0===T&&(T=-5),T)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?-2:(r.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,r){"use strict";t.exports=function(t,e){var r,n,i,o,a,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,S,E,A,C,B;r=t.state,n=t.next_in,C=t.input,i=n+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),f=r.dmax,u=r.wsize,c=r.whave,h=r.wnext,l=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;t:do{p<15&&(d+=C[n++]<<p,p+=8,d+=C[n++]<<p,p+=8),b=g[d&v];e:for(;;){if(d>>>=_=b>>>24,p-=_,0===(_=b>>>16&255))B[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue e}if(32&_){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}w=65535&b,(_&=15)&&(p<_&&(d+=C[n++]<<p,p+=8),w+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=C[n++]<<p,p+=8,d+=C[n++]<<p,p+=8),b=y[d&m];r:for(;;){if(d>>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=y[(65535&b)+(d&(1<<_)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(S=65535&b,p<(_&=15)&&(d+=C[n++]<<p,(p+=8)<_&&(d+=C[n++]<<p,p+=8)),(S+=d&(1<<_)-1)>f){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,S>(_=o-a)){if((_=S-_)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,A=l,0===h){if(E+=u-_,_<w){w-=_;do{B[o++]=l[E++]}while(--_);E=o-S,A=B}}else if(h<_){if(E+=u+h-_,(_-=h)<w){w-=_;do{B[o++]=l[E++]}while(--_);if(E=0,h<w){w-=_=h;do{B[o++]=l[E++]}while(--_);E=o-S,A=B}}}else if(E+=h-_,_<w){w-=_;do{B[o++]=l[E++]}while(--_);E=o-S,A=B}for(;w>2;)B[o++]=A[E++],B[o++]=A[E++],B[o++]=A[E++],w-=3;w&&(B[o++]=A[E++],w>1&&(B[o++]=A[E++]))}else{E=o-S;do{B[o++]=B[E++],B[o++]=B[E++],B[o++]=B[E++],w-=3}while(w>2);w&&(B[o++]=B[E++],w>1&&(B[o++]=B[E++]))}break}}break}}while(n<i&&o<s);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},function(t,e,r){"use strict";var n=r(2),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,f,u,c,h,l){var d,p,g,y,v,m,b,_,w,S=l.bits,E=0,A=0,C=0,B=0,R=0,k=0,x=0,M=0,T=0,I=0,P=null,O=0,F=new n.Buf16(16),U=new n.Buf16(16),L=null,N=0;for(E=0;E<=15;E++)F[E]=0;for(A=0;A<f;A++)F[e[r+A]]++;for(R=S,B=15;B>=1&&0===F[B];B--);if(R>B&&(R=B),0===B)return u[c++]=20971520,u[c++]=20971520,l.bits=1,0;for(C=1;C<B&&0===F[C];C++);for(R<C&&(R=C),M=1,E=1;E<=15;E++)if(M<<=1,(M-=F[E])<0)return-1;if(M>0&&(0===t||1!==B))return-1;for(U[1]=0,E=1;E<15;E++)U[E+1]=U[E]+F[E];for(A=0;A<f;A++)0!==e[r+A]&&(h[U[e[r+A]]++]=A);if(0===t?(P=L=h,m=19):1===t?(P=i,O-=257,L=o,N-=257,m=256):(P=a,L=s,m=-1),I=0,A=0,E=C,v=c,k=R,x=0,g=-1,y=(T=1<<R)-1,1===t&&T>852||2===t&&T>592)return 1;for(;;){b=E-x,h[A]<m?(_=0,w=h[A]):h[A]>m?(_=L[N+h[A]],w=P[O+h[A]]):(_=96,w=0),d=1<<E-x,C=p=1<<k;do{u[v+(I>>x)+(p-=d)]=b<<24|_<<16|w|0}while(0!==p);for(d=1<<E-1;I&d;)d>>=1;if(0!==d?(I&=d-1,I+=d):I=0,A++,0==--F[E]){if(E===B)break;E=e[r+h[A]]}if(E>R&&(I&y)!==g){for(0===x&&(x=R),v+=C,M=1<<(k=E-x);k+x<B&&!((M-=F[k+x])<=0);)k++,M<<=1;if(T+=1<<k,1===t&&T>852||2===t&&T>592)return 1;u[g=I&y]=R<<24|k<<16|v-c|0}}return 0!==I&&(u[v+I]=E-x<<24|64<<16|0),l.bits=R,0}},function(t,e,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,r){var n=r(1).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(t){if(n.isBuffer(t))return t;var e="function"==typeof n.alloc&&"function"==typeof n.from;if("number"==typeof t)return e?n.alloc(t):new n(t);if("string"==typeof t)return e?n.from(t):new n(t);throw new Error("input must be buffer, number, or string, received "+typeof t)}function a(t){var e=o(4);return e.writeInt32BE(t,0),e}function s(t,e){t=o(t),n.isBuffer(e)&&(e=e.readUInt32BE(0));for(var r=-1^~~e,a=0;a<t.length;a++)r=i[255&(r^t[a])]^r>>>8;return-1^r}function f(){return a(s.apply(null,arguments))}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),f.signed=function(){return s.apply(null,arguments)},f.unsigned=function(){return s.apply(null,arguments)>>>0},t.exports=f},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=n(r(6)),a=r(47),s=n(r(48)),f=n(r(49));var u=function(){function t(t,e){void 0===e&&(e=0),this._buffer=t,this._position=e,this.length=t.length}return t.prototype.get=function(){var t=this._buffer[this._position];return this._position+=1,t},t.prototype.getByte=function(){return this.get()},t.prototype.getByteAt=function(t){return this._buffer[t]},t.prototype.position=function(){return this._position},t.prototype.put=function(t){return this._buffer[this._position]=t,this._position+=1,t},t.prototype.putAt=function(t,e){return this._buffer[t]=e,e},t.prototype.setPosition=function(t){return this._position=t,t},t.prototype.getInt=function(){var t=this._buffer.readInt32LE(this._position);return this._position+=4,t},t.prototype.remaining=function(){return this._buffer.length-this._position},t}();e.default=function(e,r,n){if(void 0===n&&(n=0),0===e.length)return r.fill(0),r;var c=new u(e,n),h=c.get();if(0!==h&&1!==h)throw new i.CramMalformedError("Invalid rANS order ".concat(h));if(c.getInt()!==c.remaining()-4)throw new i.CramMalformedError("Incorrect input length.");var l=c.getInt(),d=new u(r||t.allocUnsafe(l));if(d.length<l)throw new i.CramMalformedError("Output buffer too small to fit ".concat(l," bytes."));switch(h){case 0:return function(t,e){for(var r=new o.default.AriDecoder,n=new Array(256),i=0;i<n.length;i+=1)n[i]=new o.default.Symbol;return(0,a.readStatsO0)(t,r,n),(0,s.default)(t,r,n,e),e}(c,d);case 1:return function(t,e){for(var r=new Array(256),n=0;n<r.length;n+=1)r[n]=new o.default.AriDecoder;var i=new Array(256);for(n=0;n<i.length;n+=1){i[n]=new Array(256);for(var s=0;s<i[n].length;s+=1)i[n][s]=new o.default.Symbol}return(0,a.readStatsO1)(t,r,i),(0,f.default)(t,e,r,i),e}(c,d);default:throw new i.CramMalformedError("Invalid rANS order: ".concat(h))}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.readStatsO1=e.readStatsO0=void 0;var i=r(0),o=r(7),a=n(r(6));function s(t){if(!t)throw new i.CramMalformedError("assertion failed")}e.readStatsO0=function(t,e,r){var n=0,i=0,f=255&t.get();do{null==e.fc[f]&&(e.fc[f]=new a.default.FC),e.fc[f].F=255&t.get(),e.fc[f].F>=128&&(e.fc[f].F&=-129,e.fc[f].F=(127&e.fc[f].F)<<8|255&t.get()),e.fc[f].C=i,a.default.symbolInit(r[f],e.fc[f].C,e.fc[f].F),e.R||(e.R=new Array(o.TOTFREQ)),e.R.fill(f,i,i+e.fc[f].F),i+=e.fc[f].F,0===n&&f+1===(255&t.getByteAt(t.position()))?(f=255&t.get(),n=255&t.get()):0!==n?(n-=1,f+=1):f=255&t.get()}while(0!==f);s(i<o.TOTFREQ)},e.readStatsO1=function(t,e,r){var n=0,i=255&t.get();do{var f=0,u=0,c=255&t.get();null==e[i]&&(e[i]=new a.default.AriDecoder);do{null==e[i].fc[c]&&(e[i].fc[c]=new a.default.FC),e[i].fc[c].F=255&t.get(),e[i].fc[c].F>=128&&(e[i].fc[c].F&=-129,e[i].fc[c].F=(127&e[i].fc[c].F)<<8|255&t.get()),e[i].fc[c].C=u,0===e[i].fc[c].F&&(e[i].fc[c].F=o.TOTFREQ),null==r[i][c]&&(r[i][c]=new a.default.RansDecSymbol),a.default.symbolInit(r[i][c],e[i].fc[c].C,e[i].fc[c].F),null==e[i].R&&(e[i].R=new Array(o.TOTFREQ)),e[i].R.fill(c,u,u+e[i].fc[c].F),s((u+=e[i].fc[c].F)<=o.TOTFREQ),0===f&&c+1===(255&t.getByteAt(t.position()))?(c=255&t.get(),f=255&t.get()):0!==f?(f-=1,c+=1):c=255&t.get()}while(0!==c);0===n&&i+1===(255&t.getByteAt(t.position()))?(i=255&t.get(),n=255&t.get()):0!==n?(n-=1,i+=1):i=255&t.get()}while(0!==i)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=r(7),a=n(r(6));e.default=function(t,e,r,n){for(var s,f=t.getInt(),u=t.getInt(),c=t.getInt(),h=t.getInt(),l=n.remaining(),d=-4&l,p=0;p<d;p+=4){var g=e.R[a.default.get(f,o.TF_SHIFT)],y=e.R[a.default.get(u,o.TF_SHIFT)],v=e.R[a.default.get(c,o.TF_SHIFT)],m=e.R[a.default.get(h,o.TF_SHIFT)];n.putAt(p,g),n.putAt(p+1,y),n.putAt(p+2,v),n.putAt(p+3,m),f=a.default.advanceSymbolStep(f,r[255&g],o.TF_SHIFT),u=a.default.advanceSymbolStep(u,r[255&y],o.TF_SHIFT),c=a.default.advanceSymbolStep(c,r[255&v],o.TF_SHIFT),h=a.default.advanceSymbolStep(h,r[255&m],o.TF_SHIFT),f=a.default.renormalize(f,t),u=a.default.renormalize(u,t),c=a.default.renormalize(c,t),h=a.default.renormalize(h,t)}switch(n.setPosition(d),3&l){case 0:break;case 1:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s);break;case 2:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,t,r[255&s],o.TF_SHIFT),n.put(s);break;case 3:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(c,o.TF_SHIFT)],a.default.advanceSymbol(c,t,r[255&s],o.TF_SHIFT),n.put(s);break;default:throw new i.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(7),o=n(r(6));e.default=function(t,e,r,n){for(var a=e.remaining(),s=t.getInt(),f=t.getInt(),u=t.getInt(),c=t.getInt(),h=a>>2,l=0,d=h,p=2*h,g=3*h,y=0,v=0,m=0,b=0;l<h;l+=1,d+=1,p+=1,g+=1){var _=255&r[y].R[o.default.get(s,i.TF_SHIFT)],w=255&r[v].R[o.default.get(f,i.TF_SHIFT)],S=255&r[m].R[o.default.get(u,i.TF_SHIFT)],E=255&r[b].R[o.default.get(c,i.TF_SHIFT)];e.putAt(l,_),e.putAt(d,w),e.putAt(p,S),e.putAt(g,E),s=o.default.advanceSymbolStep(s,n[y][_],i.TF_SHIFT),f=o.default.advanceSymbolStep(f,n[v][w],i.TF_SHIFT),u=o.default.advanceSymbolStep(u,n[m][S],i.TF_SHIFT),c=o.default.advanceSymbolStep(c,n[b][E],i.TF_SHIFT),s=o.default.renormalize(s,t),f=o.default.renormalize(f,t),u=o.default.renormalize(u,t),c=o.default.renormalize(c,t),y=_,v=w,m=S,b=E}for(;g<a;g+=1){E=255&r[b].R[o.default.get(c,i.TF_SHIFT)];e.putAt(g,E),c=o.default.advanceSymbol(c,t,n[b][E],i.TF_SHIFT),b=E}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSectionParsers=e.cramFileDefinition=void 0;var n=r(51),i=(new n.Parser).itf8(),o={parser:(new n.Parser).string("magic",{length:4}).uint8("majorVersion").uint8("minorVersion").string("fileId",{length:20,stripNull:!0}),maxLength:26};e.cramFileDefinition=o;var a={parser:(new n.Parser).uint8("compressionMethod",{formatter:function(t){var e=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][t];if(!e)throw new Error("compression method number ".concat(t," not implemented"));return e}}).uint8("contentType",{formatter:function(t){var e=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][t];if(!e)throw new Error("invalid block content type id ".concat(t));return e}}).itf8("contentId").itf8("compressedSize").itf8("uncompressedSize"),maxLength:17},s={parser:(new n.Parser).uint32("crc32"),maxLength:4},f=(new n.Parser).itf8("size").buffer("ents",{length:"size",formatter:function(t){function e(e,r){for(var n=t.toString("utf8",e,r),i=[],o=0;o<n.length;o+=3)i.push(n.substr(o,3));return i}var r,n=[],i=0;for(r=0;r<t.length;r+=1)t[r]||(n.push(e(i,r)),i=r+1);return r>i&&n.push(e(i,r)),n}}),u=(new n.Parser).uint8(null,{formatter:function(t){return!!t}}),c=(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).choice("value",{tag:"key",choices:{MI:u,UI:u,PI:u,RN:u,AP:u,RR:u,SM:(new n.Parser).array(null,{type:"uint8",length:5}),TD:(new n.Parser).nest(null,{type:f,formatter:function(t){return t.ents}})}})});function h(t){for(var e={},r=0;r<t.ents.length;r+=1){var n=t.ents[r],i=n.key,o=n.value;e[i]&&console.warn("duplicate key ".concat(i," in map")),e[i]=o}return e}var l={cramFileDefinition:o,cramBlockHeader:a,cramBlockCrc32:s},d={cramUnmappedSliceHeader:function(t){var e=0,r=(new n.Parser).itf8("numRecords");e+=5,t>=3?(r=r.ltf8("recordCounter"),e+=9):2===t&&(r=r.itf8("recordCounter"),e+=5),r=r.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}),e+=10,t>=2&&(r=r.array("md5",{type:"uint8",length:16}),e+=16);return{parser:r,maxLength:function(t){return e+5*t}}},cramMappedSliceHeader:function(t){var e=(new n.Parser).itf8("refSeqId").itf8("refSeqStart").itf8("refSeqSpan").itf8("numRecords"),r=20;t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),e=e.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}).itf8("refBaseBlockId"),r+=15,t>=2&&(e=e.array("md5",{type:"uint8",length:16}),r+=16);return{parser:e,maxLength:function(t){return r+5*t}}},cramEncoding:function(t){return{parser:(new n.Parser).namely("cramEncoding").itf8("codecId").itf8("parametersBytes").choice("parameters",{tag:"codecId",choices:{0:new n.Parser,1:(new n.Parser).itf8("blockContentId"),2:(new n.Parser).itf8("offset").itf8("M"),3:n.Parser.start().itf8("numCodes").array("symbols",{length:"numCodes",type:i}).itf8("numLengths").array("bitLengths",{length:"numLengths",type:i}),4:n.Parser.start().nest("lengthsEncoding",{type:"cramEncoding"}).nest("valuesEncoding",{type:"cramEncoding"}),5:(new n.Parser).uint8("stopByte")[t>1?"itf8":"int"]("blockContentId"),6:(new n.Parser).itf8("offset").itf8("length"),7:(new n.Parser).itf8("offset").itf8("K"),8:(new n.Parser).itf8("offset").itf8("log2m"),9:(new n.Parser).itf8("offset")}})}},cramDataSeriesEncodingMap:function(t){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).nest("value",{type:this.cramEncoding(t).parser})})},cramTagEncodingMap:function(t){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).itf8("key",{formatter:function(t){return String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}}).nest("value",{type:this.cramEncoding(t).parser})})},cramCompressionHeader:function(t){var e=new n.Parser;return{parser:e=e.nest("preservation",{type:c,formatter:h}).nest("dataSeriesEncoding",{type:this.cramDataSeriesEncodingMap(t),formatter:h}).nest("tagEncoding",{type:this.cramTagEncodingMap(t),formatter:h})}},cramContainerHeader1:function(t){var e=(new n.Parser).int32("length").itf8("refSeqId").itf8("refSeqStart").itf8("alignmentSpan").itf8("numRecords"),r=24;return t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),t>1&&(e=e.ltf8("numBases"),r+=9),{parser:e=e.itf8("numBlocks").itf8("numLandmarks"),maxLength:r+=10}},cramContainerHeader2:function(t){var e=(new n.Parser).itf8("numLandmarks").array("landmarks",{type:(new n.Parser).itf8(),length:"numLandmarks"}),r=0;return t>=3&&(e=e.uint32("crc32"),r=4),{parser:e,maxLength:function(t){return 5+5*t+r}}}};e.getSectionParsers=function(t){var e=Object.assign({},l);return Object.keys(d).forEach((function(r){e[r]=d[r](t)})),e}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(1).Buffer,o=r(52),a=r(53).Context,s=r(23);"undefined"!=typeof window&&(window.Buffer=i),"undefined"!=typeof self&&(self.Buffer=i);var f={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8,UInt64:8,Int64:8},u={},c=[];!function(){var t;for(t=1;t<=32;t++)c.push(t)}();var h={};Object.keys(f).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(t){h[t.toLowerCase()]=t}));var l=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};l.start=function(){return new l},Object.keys(f).forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){return this.setNextParser(t.toLowerCase(),e,r)};var e=t.replace(/BE|LE/,"").toLowerCase();e in l.prototype||(l.prototype[e]=function(t,r){return this[e+this.endian](t,r)})})),c.forEach((function(t){l.prototype["bit".concat(t.toString())]=function(e,r){return r||(r={}),r.length=t,this.setNextParser("bit",e,r)}})),l.prototype.namely=function(t){return u[t]=this,this.alias=t,this},l.prototype.skip=function(t,e){if(e&&e.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:t})},l.prototype.string=function(t,e){if(!e.zeroTerminated&&!e.length&&!e.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((e.zeroTerminated||e.length)&&e.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(e.stripNull&&!e.length&&!e.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return e.encoding=e.encoding||"utf8",this.setNextParser("string",t,e)},l.prototype.buffer=function(t,e){if(!e.length&&!e.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",t,e)},l.prototype.array=function(t,e){if(!e.readUntil&&!e.length&&!e.lengthInBytes)throw new Error("Length option of array is not defined.");if(!e.type)throw new Error("Type option of array is not defined.");if("string"==typeof e.type&&!u[e.type]&&Object.keys(f).indexOf(h[e.type])<0)throw new Error('Specified primitive type "'.concat(e.type,'" is not supported.'));return this.setNextParser("array",t,e)},l.prototype.choice=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.tag)throw new Error("Tag option of array is not defined.");if(!e.choices)throw new Error("Choices option of array is not defined.");return Object.keys(e.choices).forEach((function(r){if(!e.choices[r])throw new Error("Choice Case ".concat(r," of ").concat(t," is not valid."));if("string"==typeof e.choices[r]&&!u[e.choices[r]]&&Object.keys(f).indexOf(h[e.choices[r]])<0)throw new Error('Specified primitive type "'.concat(e.choices[r],'" is not supported.'))}),this),this.setNextParser("choice",t,e)},l.prototype.nest=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.type)throw new Error("Type option of nest is not defined.");if(!(e.type instanceof l||u[e.type]))throw new Error("Type option of nest must be a Parser object.");if(!(e.type instanceof l||t))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",t,e)},l.prototype.endianess=function(t){switch(t.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: ".concat(t))}return this},l.prototype.create=function(t){if(!(t instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=t,this},l.prototype.getCode=function(){var t=new a;return t.pushCode("if (!Buffer.isBuffer(buffer)) {"),t.generateError('"argument buffer is not a Buffer object"'),t.pushCode("}"),this.alias?this.addAliasedCode(t):this.addRawCode(t),this.alias?t.pushCode("return {0}(0)","___parser_"+this.alias):t.pushCode("return { offset: offset, result: vars };"),t.code},l.prototype.addRawCode=function(t){t.pushCode("var offset = 0;"),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };")},l.prototype.addAliasedCode=function(t){return t.pushCode("function {0}(offset) {","___parser_"+this.alias),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),t.markResolved(this.alias),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };"),t.pushCode("}"),t},l.prototype.resolveReferences=function(t){var e=t.getUnresolvedReferences();t.markRequested(e),e.forEach((function(e){u[e].addAliasedCode(t)}))},l.prototype.compile=function(){var t="(function(buffer, constructorFn, Long) { ".concat(this.getCode()," })");this.compiled=o.runInThisContext(t)},l.prototype.sizeOf=function(){var t=NaN;if(Object.keys(f).indexOf(this.type)>=0)t=f[this.type];else if("String"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var e=NaN;"string"==typeof this.options.type?e=f[h[this.options.type]]:this.options.type instanceof l&&(e=this.options.type.sizeOf()),t=this.options.length*e}else"Skip"===this.type?t=this.options.length:"Nest"===this.type?t=this.options.type.sizeOf():this.type||(t=0);return this.next&&(t+=this.next.sizeOf()),t},l.prototype.parse=function(t){return this.compiled||this.compile(),this.compiled(t,this.constructorFn,s)},l.prototype.setNextParser=function(t,e,r){var n=new l;return n.type=h[t],n.varName=e,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},l.prototype.generate=function(t){this.type&&(this["generate".concat(this.type)](t),this.generateAssert(t));var e=t.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(t,e,this.options.formatter),this.generateNext(t)},l.prototype.generateAssert=function(t){if(this.options.assert){var e=t.generateVariable(this.varName);switch(n(this.options.assert)){case"function":t.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,e);break;case"number":t.pushCode("if ({0} !== {1}) {",this.options.assert,e);break;case"string":t.pushCode('if ("{0}" !== {1}) {',this.options.assert,e);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}t.generateError('"Assert error: {0} is " + {0}',e),t.pushCode("}")}},l.prototype.generateNext=function(t){return this.next&&(t=this.next.generate(t)),t},Object.keys(f).forEach((function(t){l.prototype["generate".concat(t)]=function(e){"UInt64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):"Int64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),t),e.pushCode("offset += {0};",f[t])}})),l.prototype.generateBit=function(t){var e=JSON.parse(JSON.stringify(this));if(e.varName=t.generateVariable(e.varName),t.bitFields.push(e),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;t.bitFields.forEach((function(t){r+=t.options.length}));var n=t.generateTmpVariable();if(r<=8)t.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)t.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var i=t.generateTmpVariable(),o=t.generateTmpVariable();t.pushCode("var {0} = buffer.readUInt16BE(offset);",i),t.pushCode("var {0} = buffer.readUInt8(offset + 2);",o),t.pushCode("var {2} = ({0} << 8) | {1};",i,o,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");t.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}t.pushCode("offset += {0};",r/8);var a=0,s="be"===this.endian;t.bitFields.forEach((function(e){t.pushCode("{0} = {1} >> {2} & {3};",e.varName,n,s?r-a-e.options.length:a,(1<<e.options.length)-1),a+=e.options.length})),t.bitFields=[]}},l.prototype.generateSkip=function(t){var e=t.generateOption(this.options.length);t.pushCode("offset += {0};",e)},l.prototype.generateString=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();this.options.length&&this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0 && offset - {0} < {1});",r,this.options.length),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - {2} < {3} ? offset - 1 : offset);",e,this.options.encoding,r,this.options.length)):this.options.length?(t.pushCode("{0} = buffer.toString('{1}', offset, offset + {2});",e,this.options.encoding,t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))):this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - 1);",e,this.options.encoding,r)):this.options.greedy&&(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.length > offset++);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset);",e,this.options.encoding,r)),this.options.stripNull&&t.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",e)},l.prototype.generateBuffer=function(t){"eof"===this.options.readUntil?t.pushCode("{0} = buffer.slice(offset);",t.generateVariable(this.varName)):(t.pushCode("{0} = buffer.slice(offset, offset + {1});",t.generateVariable(this.varName),t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))),this.options.clone&&t.pushCode("{0} = Buffer.from({0});",t.generateVariable(this.varName))},l.prototype.generateArray=function(t){var e=t.generateOption(this.options.length),r=t.generateOption(this.options.lengthInBytes),n=this.options.type,i=t.generateTmpVariable(),o=t.generateVariable(this.varName),a=t.generateTmpVariable(),s=this.options.key,c="string"==typeof s;if(c?t.pushCode("{0} = {};",o):t.pushCode("{0} = [];",o),"function"==typeof this.options.readUntil?t.pushCode("do {"):"eof"===this.options.readUntil?t.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",i):void 0!==r?t.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",i,r):t.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",i,e),"string"==typeof n)if(u[n]){var d=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",d,"___parser_"+n),t.pushCode("var {0} = {1}.result; offset = {1}.offset;",a,d),n!==this.alias&&t.addReference(n)}else t.pushCode("var {0} = buffer.read{1}(offset);",a,h[n]),t.pushCode("offset += {0};",f[h[n]]);else n instanceof l&&(t.pushCode("var {0} = {};",a),t.pushScope(a),n.generate(t),t.popScope());c?t.pushCode("{0}[{2}.{1}] = {2};",o,s,a):t.pushCode("{0}.push({1});",o,a),t.pushCode("}"),"function"==typeof this.options.readUntil&&t.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,a)},l.prototype.generateChoiceCase=function(t,e,r){if("string"==typeof r)if(u[r]){var n=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",n,"___parser_"+r),t.pushCode("{0} = {1}.result; offset = {1}.offset;",t.generateVariable(this.varName),n),r!==this.alias&&t.addReference(r)}else t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),h[r]),t.pushCode("offset += {0};",f[h[r]]);else r instanceof l&&(t.pushPath(e),r.generate(t),t.popPath(e))},l.prototype.generateChoice=function(t){var e=t.generateOption(this.options.tag);this.varName&&t.pushCode("{0} = {};",t.generateVariable(this.varName)),t.pushCode("switch({0}) {",e),Object.keys(this.options.choices).forEach((function(e){var r=this.options.choices[e];Number.isNaN(parseInt(e,10))?t.pushCode("case '{0}':",e):t.pushCode("case {0}:",e),this.generateChoiceCase(t,this.varName,r),t.pushCode("break;")}),this),t.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(t,this.varName,this.options.defaultChoice):t.generateError('"Met undefined tag value " + {0} + " at choice"',e),t.pushCode("}")},l.prototype.generateNest=function(t){var e=t.generateVariable(this.varName);if(this.options.type instanceof l)this.varName&&t.pushCode("{0} = {};",e),t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName);else if(u[this.options.type]){var r=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",r,"___parser_"+this.options.type),t.pushCode("{0} = {1}.result; offset = {1}.offset;",e,r),this.options.type!==this.alias&&t.addReference(this.options.type)}},l.prototype.generateFormatter=function(t,e,r){"function"==typeof r&&t.pushCode("{0} = ({1}).call(this, {0});",e,r)},l.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.generateItf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) | buffer[offset+2]) & 0x1fffff;\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4\n } else {\n ").concat(e," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5\n }\n "))},l.prototype.ltf8=function(t,e){return this.setNextParser("ltf8",t,e)},l.prototype.generateLtf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n ").concat(e," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4;\n } else if (").concat(r," < 0xf8) {\n ").concat(e," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5;\n } else if (").concat(r," < 0xfc) {\n ").concat(e," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n offset += 6;\n } else if (").concat(r," < 0xfe) {\n ").concat(e," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n offset += 7;\n } else if (").concat(r," < 0xff) {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 8;\n } else {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 9;\n }\n "))},e.Parser=l},function(t,e){t.exports.runInThisContext=function(t){return new Function("code","return eval(code);").call(globalThis,t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};i.prototype.generateVariable=function(t){var e=[];for(Array.prototype.push.apply(e,this.scopes[this.scopes.length-1]);/^\$parent\./.test(t);)e.pop(),t=t.replace(/^\$parent\./,"");return t&&e.push(t),e.join(".")},i.prototype.generateOption=function(t){switch(n(t)){case"number":return t.toString();case"string":return this.generateVariable(t);case"function":return"(".concat(t,").call(").concat(this.generateVariable(),", vars)");default:return}},i.prototype.generateError=function(){var t=Array.prototype.slice.call(arguments),e=i.interpolate.apply(this,t);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error(".concat(e,"), vars); });")):this.pushCode("throw new Error(".concat(e,");"))},i.prototype.generateTmpVariable=function(){return"$tmp".concat(this.tmpVariableCount++)},i.prototype.pushCode=function(){var t=Array.prototype.slice.call(arguments);this.code+="".concat(i.interpolate.apply(this,t),"\n")},i.prototype.pushPath=function(t){t&&this.scopes[this.scopes.length-1].push(t)},i.prototype.popPath=function(t){t&&this.scopes[this.scopes.length-1].pop()},i.prototype.pushScope=function(t){this.scopes.push([t])},i.prototype.popScope=function(){this.scopes.pop()},i.prototype.addReference=function(t){this.references[t]||(this.references[t]={resolved:!1,requested:!1})},i.prototype.markResolved=function(t){this.references[t].resolved=!0},i.prototype.markRequested=function(t){t.forEach(function(t){this.references[t].requested=!0}.bind(this))},i.prototype.getUnresolvedReferences=function(){var t=this.references;return Object.keys(this.references).filter((function(e){return!t[e].resolved&&!t[e].requested}))},i.interpolate=function(t){var e=/{\d+}/g,r=t.match(e),n=Array.prototype.slice.call(arguments,1);return r&&r.forEach((function(e){var r=parseInt(e.substr(1,e.length-2),10);t=t.replace(e,n[r].toString())})),t},e.Context=i},function(t,e,r){"use strict";(function(e){var n=r(55),i=r(24),o=r(25),a=r(57),s=r(59);t.exports={r4x8_uncompress:function(t,e){n.decode(t).copy(e,0,0)},r4x16_uncompress:function(t,e){i.decode(t).copy(e,0,0)},arith_uncompress:function(t,e){o.decode(t).copy(e,0,0)},fqzcomp_uncompress:function(t,e){var r=new Array;a.decode(t,r).copy(e,0,0)},tok3_uncompress:function(t,r){var n=s.decode(t,0,"\0");e.from(n,"binary").copy(r,0,0)}}}).call(this,r(1).Buffer)},function(t,e,r){(function(e){const n=r(4);function i(t){return 4095&t}function o(t,e){for(var r=0;e>=t[r+1];)r++;return r}function a(t){for(var e=new Array(4096),r=0,n=0;n<4096;n++){for(;n>=t[r+1];)r++;e[n]=r}return e}function s(t,e,r){return r*(t>>12)+(4095&t)-e}function f(t,e){for(;e<1<<23;)e=(e<<8)+t.ReadByte();return e}function u(t,e){e.WriteByteNeg(t>>24&255),e.WriteByteNeg(t>>16&255),e.WriteByteNeg(t>>8&255),e.WriteByteNeg(t>>0&255)}function c(t,e,r,n,i){return t=function(t,e,r,n){for(var i=(1<<23>>n<<8)*r;t>=i;)e.WriteByteNeg(255&t),t>>=8;return t}(t,e,n,i),t=(Math.floor(t/n)<<i)+t%n+r}function h(t,e,r){for(var n=0;n<256;n++)e[n]=0;var i=t.ReadByte(),o=i,a=0;do{var s=t.ReadITF8();e[i]=s,a>0?(a--,i++):(i=t.ReadByte())==o+1&&(a=t.ReadByte()),o=i}while(0!=i);r[0]=0;for(n=0;n<=255;n++)r[n+1]=r[n]+e[n]}function l(t){for(var e=0,r=0;r<256;r++)e+=t[r];var n=4096/e;do{var i=0,o=0,a=0;e=0;for(r=0;r<256;r++)0!=t[r]&&(i<t[r]&&(i=t[r],o=r),t[r]=Math.floor(t[r]*n),0==t[r]&&(t[r]=1),e+=t[r]);e<4096?t[o]+=4096-e:e-4096<t[o]/2&&t[o]>2?t[o]-=e-4096:4096!=e&&(n*=.99,a=1)}while(a)}function d(t,e){for(var r=0,n=0;n<256;n++)if(e[n]){if(r>0)r--;else if(t.WriteByte(n),n>0&&e[n-1]>0){for(r=n+1;r<256&&e[r];r++);r-=n+1,t.WriteByte(r)}t.WriteITF8(e[n])}t.WriteByte(0)}t.exports={decode:function(t){var r=new n(t),u=r.ReadByte(),c=(r.ReadUint32(),r.ReadUint32());return 0==u?function(t,r){var n=new Array(256),o=new Array(256);h(t,n,o);for(var u=a(o),c=new Array(4),l=0;l<4;l++)c[l]=t.ReadUint32();var d=new e.allocUnsafe(r);for(l=0;l<r;l++){var p=l%4,g=i(c[p]),y=u[g];d[l]=y,c[p]=s(c[p],o[y],n[y]),c[p]=f(t,c[p])}return d}(r,c):function(t,r){var n=new Array(256),u=new Array(256);!function(t,e,r){for(var n=0;n<256;n++){e[n]=new Array(256),r[n]=new Array(256);for(var i=0;i<256;i++)e[n][i]=0}var o=t.ReadByte(),a=o,s=0;do{h(t,e[o],r[o]),s>0?(s--,o++):(o=t.ReadByte())==a+1&&(s=t.ReadByte()),a=o}while(0!=o)}(t,n,u);for(var c=new Array(256),l=0;l<256;l++)c[l]=a(u[l]);for(var d=new Array(4),p=new Array(4),g=0;g<4;g++)d[g]=t.ReadUint32(),p[g]=0;var y=new e.allocUnsafe(r),v=Math.floor(r/4);for(l=0;l<v;l++)for(g=0;g<4;g++){var m=i(d[g]),b=c[p[g]][m];y[l+g*v]=b,d[g]=s(d[g],u[p[g]][b],n[p[g]][b]),d[g]=f(t,d[g]),p[g]=b}l*=4;for(;l<r;){m=i(d[3]),b=o(u[p[3]],m);y[l++]=b,d[3]=s(d[3],u[p[3]][b],n[p[3]][b]),d[3]=f(t,d[3]),p[3]=b}return y}(r,c)},encode:function(t,r){return 0==r?function(t){const r=t.length;var i=new n("",0,780);i.WriteByte(0),i.WriteUint32(0),i.WriteUint32(0);var o=new Array(256);(function(t,e){for(var r=0;r<256;r++)e[r]=0;for(r=0;r<t.length;r++)e[t[r]]++})(t,o),l(o),d(i,o);var a=new Array(256);a[0]=0;for(var s=1;s<256;s++)a[s]=a[s-1]+o[s-1];var f=new Array(4);for(s=0;s<4;s++)f[s]=1<<23;var h=Math.floor(1.05*r+100),p=new n("",h,h);for(s=r-1;s>=0;s--)f[s%4]=c(f[s%4],p,a[t[s]],o[t[s]],12);for(s=3;s>=0;s--)u(f[s],p);var g=i.pos;return i.buf.writeInt32LE(g-9+(p.length-p.pos),1),i.buf.writeInt32LE(r,5),e.concat([i.buf.slice(0,i.pos),p.buf.slice(p.pos,p.length)],i.pos+p.length-p.pos)}(t):function(t){const r=t.length;var i=new n("",0,198156);i.WriteByte(1),i.WriteUint32(0),i.WriteUint32(0);for(var o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(t,e,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)e[n][i]=0}var o=0;for(n=0;n<t.length;n++)r[t[n]]++,e[o][t[n]]++,o=t[n];e[0][t[1*(t.length>>2)]]++,e[0][t[2*(t.length>>2)]]++,e[0][t[3*(t.length>>2)]]++,r[0]+=3})(t,a,o),function(t,e){for(var r=0;r<256;r++)e[r]&&l(t[r])}(a,o),function(t,e,r){for(var n=0,i=0;i<256;i++)if(r[i]){if(n>0)n--;else if(t.WriteByte(i),i>0&&r[i-1]>0){for(n=i+1;n<256&&r[n];n++);n-=i+1,t.WriteByte(n)}d(t,e[i])}t.WriteByte(0)}(i,a,o);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var h=1;h<256;h++)s[f][h]=s[f][h-1]+a[f][h-1]}var p=new Array(4),g=new Array(4);for(h=0;h<4;h++)p[h]=1<<23,g[h]=0;var y=new n("",r,r),v=Math.floor(r/4),m=new Array(4),b=new Array(4);for(h=0;h<4;h++)m[h]=(h+1)*v-2,b[h]=t[m[h]+1];b[3]=t[r-1];for(f=r-2;f>4*v-2;f--)p[3]=c(p[3],y,s[t[f]][b[3]],a[t[f]][b[3]],12),b[3]=t[f];for(;m[0]>=0;)for(h=3;h>=0;h--){var _=t[m[h]];p[h]=c(p[h],y,s[_][b[h]],a[_][b[h]],12),b[h]=_,m[h]--}for(h=3;h>=0;h--)p[h]=c(p[h],y,s[0][b[h]],a[0][b[h]],12);for(f=3;f>=0;f--)u(p[f],y);var w=i.pos;return i.buf.writeInt32LE(w-9+(y.length-y.pos),1),i.buf.writeInt32LE(r,5),e.concat([i.buf.slice(0,i.pos),y.buf.slice(y.pos,y.length)],i.pos+y.length-y.pos)}(t)}}}).call(this,r(1).Buffer)},function(t,e){var r={array:function(t){var e=0,r=0,n=[0,1,3,7,15,31,63,127,255];return function(i){for(var o=0;i>0;){var a=8-e;i>=a?(o<<=a,o|=n[a]&t[r++],e=0,i-=a):(o<<=i,o|=(t[r]&n[i]<<8-i-e)>>8-i-e,e+=i,i=0)}return o}},simple:function(t){var e,n,i=r.header(t),o=[],a=0;do{-1!=(n=r.decompress(t,i))&&(o.push(n),a+=n.byteLength)}while(-1!=n);e=new Uint8Array(a),a=0;for(var s=0;s<o.length;++s)n=o[s],e.set(n,a),a+=n.byteLength;return e},header:function(t){if(4348520!=t(24))throw"No magic number found";var e=t(8)-48;if(e<1||e>9)throw"Not a BZIP archive";return e},decompress:function(t,e,r){for(var n="",i=0;i<6;i++)n+=t(8).toString(16);if("177245385090"==n)return-1;if("314159265359"!=n)throw"eek not valid bzip data";if(t(32),t(1))throw"unsupported obsolete version";var o=t(24);if(o>9e5)throw"Initial position larger than buffer size";var a=t(16),s=new Uint8Array(256),f=0;for(i=0;i<16;i++)if(a&1<<15-i){var u=t(16);for(p=0;p<16;p++)u&1<<15-p&&(s[f++]=16*i+p)}var c=t(3);if(c<2||c>6)throw"another error";var h=t(15);if(0==h)throw"meh";var l=[];for(i=0;i<c;i++)l[i]=i;var d=new Uint8Array(32768);for(i=0;i<h;i++){for(var p=0;t(1);p++)if(p>=c)throw"whoops another error";var g=l[p];l.splice(p,1),l.splice(0,0,g),d[i]=g}var y=f+2,v=[];for(p=0;p<c;p++){var m,b,_,w=new Uint8Array(258),S=new Uint8Array(21);a=t(5);for(i=0;i<y;i++){for(;;){if(a<1||a>20)throw"I gave up a while ago on writing error messages";if(!t(1))break;t(1)?a--:a++}w[i]=a}m=b=w[0];for(i=1;i<y;i++)w[i]>b?b=w[i]:w[i]<m&&(m=w[i]);(_=v[p]={}).permute=new Uint32Array(258),_.limit=new Uint32Array(21),_.base=new Uint32Array(21),_.minLen=m,_.maxLen=b;var E=_.base.subarray(1),A=_.limit.subarray(1),C=0;for(i=m;i<=b;i++)for(a=0;a<y;a++)w[a]==i&&(_.permute[C++]=a);for(i=m;i<=b;i++)S[i]=A[i]=0;for(i=0;i<y;i++)S[w[i]]++;for(C=a=0,i=m;i<b;i++)C+=S[i],A[i]=C-1,C<<=1,E[i+1]=C-(a+=S[i]);A[b]=C+S[b]-1,E[m]=0}var B,R,k,x=new Uint32Array(256);for(i=0;i<256;i++)l[i]=i;B=R=y=k=0;for(var M=new Uint32Array(9e5);;){if(!y--){if(y=49,k>=h)throw"meow i'm a kitty, that's an error";E=(_=v[d[k++]]).base.subarray(1),A=_.limit.subarray(1)}for(p=t(i=_.minLen);;){if(i>_.maxLen)throw"rawr i'm a dinosaur";if(p<=A[i])break;i++,p=p<<1|t(1)}if((p-=E[i])<0||p>=258)throw"moo i'm a cow";var T=_.permute[p];if(0!=T&&1!=T){if(B){if(B=0,R+a>=9e5)throw"Boom.";for(x[g=s[l[0]]]+=a;a--;)M[R++]=g}if(T>f)break;if(R>=9e5)throw"I can't think of anything. Error";g=l[i=T-1],l.splice(i,1),l.splice(0,0,g),x[g=s[g]]++,M[R++]=g}else B||(B=1,a=0),a+=0==T?B:2*B,B<<=1}if(o<0||o>=R)throw"I'm a monkey and I'm throwing something at someone, namely you";for(p=0,i=0;i<256;i++)u=p+x[i],x[i]=p,p=u;for(i=0;i<R;i++)M[x[g=255&M[i]]]|=i<<8,x[g]++;var I=0,P=0,O=0;R&&(P=255&(I=M[o]),I>>=8,O=-1),R=R;var F,U,L,N=new Uint8Array(9e5),z=0;for(r||(r=1/0);R;){for(R--,U=P,P=255&(I=M[I]),I>>=8,3==O++?(F=P,L=U,P=-1):(F=1,L=P);F--;)if(N[z++]=L,!--r)return N;P!=U&&(O=0)}return N.subarray(0,z)}};t.exports=r},function(t,e,r){(function(e,n){const i=r(4),o=r(27),a=r(26);function s(t,e,r){for(var n=0,i=0,o=-1,a=new Array(1024);i<r;){var s=t.ReadByte();if(a[n++]=s,i+=s,s==o){var f=t.ReadByte();for(i+=s*f;f--;)a[n++]=s}o=s}var u=0;for(n=0,i=0;i<r;){var c=0;do{var h=a[n++];c+=h}while(255==h);for(;c--;)e[i++]=u;u++}}function f(t,e,r){var n=t.context;return e.qctx=(e.qctx<<t.qshift)+t.qtab[r],n+=(e.qctx&(1<<t.qbits)-1)<<t.qloc,t.do_pos&&(n+=t.ptab[Math.min(e.p,1023)]<<t.ploc),t.do_delta&&(n+=t.dtab[Math.min(e.delta,255)]<<t.dloc,e.delta+=e.prevq!=r?1:0,e.prevq=r),t.do_sel&&(n+=e.s<<t.sloc),e.p--,65535&n}function u(t){var e={};e.context=t.ReadUint16(),e.pflags=t.ReadByte(),e.do_dedup=2&e.pflags,e.fixed_len=4&e.pflags,e.do_sel=8&e.pflags,e.do_qmap=16&e.pflags,e.do_pos=32&e.pflags,e.do_delta=64&e.pflags,e.do_qtab=128&e.pflags,e.max_sym=t.ReadByte();var r=t.ReadByte();if(e.qbits=r>>4,e.qshift=15&r,r=t.ReadByte(),e.qloc=r>>4,e.sloc=15&r,r=t.ReadByte(),e.ploc=r>>4,e.dloc=15&r,e.qmap=new Array(256),16&e.pflags)for(var n=0;n<e.max_sym;n++)e.qmap[n]=t.ReadByte();else for(n=0;n<256;n++)e.qmap[n]=n;if(e.qtab=new Array(1024),e.qbits>0&&128&e.pflags)s(t,e.qtab,256);else for(n=0;n<256;n++)e.qtab[n]=n;return e.ptab=new Array(1024),32&e.pflags&&s(t,e.ptab,1024),e.dtab=new Array(256),64&e.pflags&&s(t,e.dtab,256),e}function c(t,e,r,n,i,o){r.max_sel>0?i.s=n.sel.ModelDecode(t,e):i.s=0,i.x=r.stab[i.s];var a=r.params[i.x];if(a.fixed_len>=0){var s=n.len[0].ModelDecode(t,e);s|=n.len[1].ModelDecode(t,e)<<8,s|=n.len[2].ModelDecode(t,e)<<16,s|=n.len[3].ModelDecode(t,e)<<24,a.fixed_len>0&&(a.fixed_len=-s)}else s=-a.fixed_len;i.len=s,r.do_rev&&(o[i.rec]=n.rev.ModelDecode(t,e)),i.is_dup=0,2&a.pflags&&n.dup.ModelDecode(t,e)&&(i.is_dup=1),i.p=s,i.delta=0,i.qctx=0,i.prevq=0,i.rec++}function h(t,r){var n=t.ReadUint7(),i=function(t){var e={max_sym:0};if(5==t.ReadByte()){var r=t.ReadByte(),n=1&r?t.ReadByte():1,i=r.nparam>1?r.nparam-1:0,o=new Array(256);if(2&r)i=t.ReadByte(),s(t,o,256);else{for(var a=0;a<n;a++)o[a]=a;for(;a<256;a++)o[a]=n-1}e.do_rev=4&r,e.stab=o,e.max_sel=i,e.params=new Array(e.nparam);for(var f=0;f<n;f++)e.params[f]=u(t),e.max_sym<e.params[f].max_sym&&(e.max_sym=e.params[f].max_sym);return e}console.error("Invalid FQZComp version number")}(t);if(i){var h=i.params,l=new Array(r.length),d=function(t){var e={};e.qual=new Array(65536);for(var r=0;r<65536;r++)e.qual[r]=new o(t.max_sym+1);for(e.len=new Array(4),r=0;r<4;r++)e.len[r]=new o(256);return e.rev=new o(2),e.dup=new o(2),t.max_sel>0&&(e.sel=new o(t.max_sel+1)),e}(i),p=new a(t);p.RangeStartDecode(t);for(var g=new e.allocUnsafe(n),y={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},v=0;v<n;){if(0==y.p){if(c(t,p,i,d,y,l),y.is_dup>0&&d.dup.ModelDecode(t,p)){for(var m=0;m<len;m++)g[v+m]=g[v+m-y.len];v+=y.len,y.p=0;continue}r.push(y.len);var b=(h=i.params[y.x]).context}var _=d.qual[b].ModelDecode(t,p);g[v++]=h.qmap[_],b=f(h,y,_)}return i.do_rev&&function(t,e,r,n){var i=0,o=0;for(;o<e;){if(r[i])for(var a=0,s=n[i]-1;a<s;){var f=t[o+a];t[o+a]=t[o+s],t[o+s]=f,a++,s--}o+=n[i++]}}(g,n,l,r),g}}function l(t,e,r){for(var n=0,i=0,o=new Array(2*r),a=0;n<r;){for(var s=n;n<r&&e[n]==i;)n++;var f=n-s;do{var u=Math.min(255,f);o[a++]=u,f-=u}while(255==u);i++}var c=-1,h=new Array(2*r),l=0;for(n=0;n<a;){var d=o[n++];if(h[l++]=d,d==c){for(s=n;n<a&&o[n]==c&&n-s<255;)n++;h[l++]=n-s}else c=d}t.WriteData(h,l)}t.exports={decode:function(t,e){return h(new i(t),e)},encode:function(t,e,r){for(var s=new Array(2),f=new Array(2),u=new Array(2),c=new Array(2),h=new Array(256),d=0;d<2;d++)s[d]=new Array(256),f[d]=new Array(256),u[d]=new Array(1024),c[d]=new Array(256);(p=new i("",0,1.1*t.length+100)).WriteUint7(t.length);var p,g=function(t,e,r,n){for(var i=r[0],o=0;o<r.length&&r[o]==i;o++);var a=o==r.length?1:0,s=0,f=0;for(o=0;o<256;o++)n[0][o]=0;var u=0,c=0;for(o=0;o<t.length;o++)0==c&&(c=e[u<e.length-1?u++:u]),n[0][t[o]]++,c--;for(o=0;o<256;o++)n[0][o]&&(f<o&&(f=o),s++);var h=5,l=0;return s<=16&&(l=1,h=s<=2?1:s<=4?2:s<=8?3:4),[{qbits:8+(h>4),qshift:h,qloc:7,pbits:7,pshift:e[0]>128?1:0,ploc:0,dbits:h>4?0:1,dshift:3,dloc:15,sbits:0,sloc:15,do_stab:0,context:0,max_sym:f,nsym:s,do_qmap:l,do_dedup:0,fixed_len:1==e.length?1:0,do_sel:0,do_rev:0,do_pos:1,do_delta:h<=4?1:0,do_qtab:0,qbits:8+(h>4)-(0==a),sbits:1,sloc:15-(h<=4),do_stab:1,do_sel:1}]}(t,e,r,s);return function(t,e,r,i,s,f,u,c,h,l){var d=1<<s[0].sbits;d>0&&d--;for(var p=e.length,g=0,y=0;y<s.length;y++)g<s[y].max_sym&&(g=s[y].max_sym);for(var v=new Array(65536),m=0;m<65536;m++)v[m]=new o(g+1);var b=new Array(4);for(m=0;m<4;m++)b[m]=new o(256);new o(2),new o(2);for(var _=new o(d+1),w=new a(e),S=(y=0,m=0,0);m<p;){if(0==y){var E=i[S];s[0].sbits>0&&_.ModelEncode(t,w,E);var A=l[E],C=r[Math.min(r.length-1,S++)];s[A].fixed_len?s[A].fixed_len>0&&(b[0].ModelEncode(t,w,255&C),b[1].ModelEncode(t,w,C>>8&255),b[2].ModelEncode(t,w,C>>16&255),b[3].ModelEncode(t,w,C>>24&255),s[A].fixed_len=-1):(b[0].ModelEncode(t,w,255&C),b[1].ModelEncode(t,w,C>>8&255),b[2].ModelEncode(t,w,C>>16&255),b[3].ModelEncode(t,w,C>>24&255)),s[A].do_dedup&&n.exit(1),y=C;var B=0,R=s[A].context,k=0,x=0}var M=e[m++],T=f[A][M];v[R].ModelEncode(t,w,T),k=(k<<s[A].qshift)+u[A][T],R=s[A].context,R+=(k&(1<<s[A].qbits)-1)<<s[A].qloc,s[A].pbits>0&&(R+=c[A][Math.min(y,1023)]<<s[A].ploc),s[A].dbits>0&&(R+=h[A][Math.min(B,255)]<<s[A].dloc,B+=x!=T?1:0,x=T),s[A].do_sel&&(R+=E<<s[A].sloc),R&=65535,y--}return w.RangeFinishEncode(t),t.buf.slice(0,t.pos)}(p=function(t,e,r,n,i,o,a){for(var s=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],f=0;f<e.length;f++)a[f]=f;for(;f<256;f++)a[f]=e.length-1;t.WriteByte(5);var u=(e.length>1?1:0)|(e[0].do_stab?2:0);if(t.WriteByte(u),1&u&&t.WriteByte(e.length),2&u){var c=1<<e[0].sbits;c>0&&c--,t.WriteByte(c),l(t,a,256)}for(var h=0;h<e.length;h++){if(t.WriteUint16(e[h].context),t.WriteByte((e[h].do_qtab?128:0)|(e[h].do_delta?64:0)|(e[h].do_pos?32:0)|(e[h].do_qmap?16:0)|(e[h].do_sel?8:0)|(e[h].fixed_len?4:0)|(e[h].do_dedup?2:0)),e[h].do_qmap?t.WriteByte(e[h].nsym):t.WriteByte(e[h].max_sym),t.WriteByte(e[h].qbits<<4|e[h].qshift),t.WriteByte(e[h].qloc<<4|e[h].sloc),t.WriteByte(e[h].ploc<<4|e[h].dloc),e[h].do_qmap){e[h].max_sym=e[h].nsym;var d=0;for(f=0;f<256;f++)r[h][f]&&(t.WriteByte(f),r[h][f]=d++);for(;d<e[h].nsym;d++)t.WriteByte(0)}else for(f=0;f<256;f++)r[h][f]=f;if(e[h].qbits>0){for(f=0;f<256;f++)n[h][f]=f;e[h].do_qtab&&l(t,n[h],256)}if(e[h].pbits>0){for(f=0;f<1024;f++)i[h][f]=Math.min((1<<e[h].pbits)-1,f>>e[h].pshift);l(t,i[h],1024)}if(e[h].dbits>0){for(f=0;f<256;f++)s[f]>(1<<e[h].dbits)-1&&(s[f]=(1<<e[h].dbits)-1);for(f=0;f<256;f++)o[h][f]=s[Math.min(s.length-1,f>>e[h].dshift)];l(t,o[h],256)}}return t}(p,g,s,f,u,c,h),t,e,r,g,s,f,u,c,h)}}}).call(this,r(1).Buffer,r(58))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var f,u=[],c=!1,h=-1;function l(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&d())}function d(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(f=u,u=[];++h<e;)f&&f[h].run();h=-1,e=u.length}f=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){(function(e){const n=r(4),i=r(24);var o=new(r(25));function a(t,e){for(var r=t+"";r.length<e;)r="0"+r;return r}function s(t,e,r,n){var i=t[0][0].ReadByte(),o=n-t[0][i].ReadUint32();if(5==i)return e[n]=e[o],r[n]=r[o],e[n];var s=1;e[n]="",r[n]=new Array(256);do{switch(i=t[s][0].ReadByte()){case 2:r[n][s]=t[s][2].ReadChar();break;case 1:r[n][s]=t[s][1].ReadString();break;case 7:r[n][s]=t[s][7].ReadUint32();break;case 3:var f=t[s][3].ReadUint32(),u=t[s][4].ReadByte();r[n][s]=a(f,u);break;case 8:r[n][s]=(r[o][s]>>0)+t[s][8].ReadByte();break;case 9:f=(r[o][s]>>0)+t[s][9].ReadByte(),u=r[o][s].length;r[n][s]=a(f,u);break;case 10:r[n][s]=r[o][s];break;default:r[n][s]=""}e[n]+=r[n][s++]}while(12!=i);return e[n]}function f(t,e,r,n,i,o){for(var a=0;a<n.length;a++)if(!(r>0&&5==e[a][0].type)&&e[a][r])switch(t[0].WriteByte(e[a][r].type),e[a][r].type){case 6:t[6].WriteUint32(e[a][r].val);break;case 5:t[5].WriteUint32(e[a][r].val);break;case 1:t[1].WriteString(e[a][r].val);break;case 2:t[2].WriteChar(e[a][r].val);break;case 7:t[7].WriteUint32(e[a][r].val);break;case 3:t[3].WriteUint32(e[a][r].val),t[4].WriteByte(e[a][r].val.length);break;case 8:case 9:t[e[a][r].type].WriteByte(e[a][r].val)}}function u(t,e,r,n){for(var i=0;i<=12;i++)if(!(t[i].pos<=0)){n.WriteByte(i+(0==i?128:0)),t[i]=t[i].buf.slice(0,t[i].pos);var o=c(t[i],r);n.WriteUint7(o.length),n.WriteData(o,o.length)}}function c(t,e){var r,n=1<<30,a=[0,1,64,65,128,129,201];for(var s in a){var f=a[s];if(!(1&f&&t.length<100)&&!(8&f&&t.length%4!=0)){try{var u=e?o.encode(t,f):i.encode(t,f)}catch(t){u=0}u&&n>u.length&&(n=u.length,r=u)}}return r}function h(t,e,r,n,i){var o=0,a=i-1;t[i]=new Array(256),e[n]?t[i][0]={type:5,val:i-e[n]}:t[i][0]={type:6,val:0==i?0:1},e[n]=i;for(var s=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),f=0;f<s.length;f++){var u=f+1,c=1,h=s[f];if(s[f].match(/^0+[0-9]*$/g)?c=3:s[f].match(/^[0-9]+$/g)?c=7:1==s[f].length&&(c=2),a>=0&&t[a][u])if(t[a][u].str==s[f])c=10,h="";else if(7==t[a][u].type||8==t[a][u].type){var l=h-t[a][u].str;r[u]++,l>=0&&l<256&&r[u]>i/2&&(c=8,h=l)}else if((3==t[a][u].type||9==t[a][u].type)&&t[a][u].str.length==h.length){l=h-t[a][u].str;r[u]++,l>=0&&l<256&&r[u]>i/2&&(c=9,h=l)}t[i][u]={str:s[f],val:h,type:c},o<t[i][u].val.length+3&&(o=t[i][u].val.length+3)}return t[i][++u]={type:12},[u+1,o]}t.exports={encode:function(t,e){var r=t.toString();"\n"==r[r.length-1]&&(r=r.substring(0,r.length-1));var i=r.split("\n"),o=new n("",0,2*r.length+1e4);o.WriteUint32(r.length),o.WriteUint32(i.length),o.WriteByte(e);for(var a=new Array(i.length),s={},c=new Array(256).fill(0),l=0,d=0,p=0;p<i.length;p++){var[g,y]=h(a,s,c,i[p],p);l<g&&(l=g),d<y&&(d=y)}for(var v=0;v<l;v++){for(var m=new Array(13),b=0;b<=12;b++)m[b]=new n("",0,i.length*d);f(m,a,v,i,l,d),u(m,v,e,o)}return o.buf.slice(0,o.pos)},decode:function(t,r,a){(t=new n(t)).ReadUint32();var f=t.ReadUint32(),u=t.ReadByte(),c=function(t,r,a,s){for(var f=-1,u=new Array(256);!t.EOF();){var c=t.ReadByte(),h=128&c,l=64&c,d=63&c;if(h&&(u[++f]=new Array(13)),0!=d&&h){var p=new Array(s-1).fill(10);u[f][0]=new n(e.from([d].concat(p)))}if(l){var g=t.ReadByte(),y=t.ReadByte();u[f][d]=new n(u[g][y].buf)}else{var v=t.ReadUint7(),m=t.ReadData(v);u[f][d]=a?o.decode(m):i.decode(m),u[f][d]=new n(u[f][d])}}return u}(t,0,u,f),h=new Array(f),l=new Array(f),d="";void 0===a&&(a="\n");for(var p=0;p<f;p++)d+=s(c,h,l,p)+a;return d}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(64)),u=o(r(67)),c=function(){function e(t,e){this.file=t,this.filePosition=e}return e.prototype.getHeader=function(){return this._readContainerHeader(this.filePosition)},e.prototype.getCompressionHeaderBlock=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getHeader()];case 1:return n.sent().numRecords?[4,this.file.getSectionParsers()]:[2,null];case 2:return t=n.sent(),[4,this.getFirstBlock()];case 3:if("COMPRESSION_HEADER"!==(e=n.sent()).contentType)throw new a.CramMalformedError("invalid content type ".concat(e.contentType," in what is supposed to be the compression header block"));return r=(0,s.parseItem)(e.content,t.cramCompressionHeader.parser,0,e.contentPosition),e.content=r,[2,e]}}))}))},e.prototype.getFirstBlock=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getHeader()];case 1:return t=e.sent(),[2,this.file.readBlock(t._endPosition)]}}))}))},e.prototype.getCompressionScheme=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getCompressionHeaderBlock()];case 1:return(t=e.sent())?[2,new u.default(t.content)]:[2,void 0]}}))}))},e.prototype.getSlice=function(t,e){return new f.default(this,t,e)},e.prototype._readContainerHeader=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a,f,u,c,h,l;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getSectionParsers()];case 1:return r=i.sent(),n=r.cramContainerHeader1,o=r.cramContainerHeader2,[4,this.file.stat()];case 2:return a=i.sent().size,e>=a?[2,void 0]:(f=t.allocUnsafe(n.maxLength),[4,this.file.read(f,0,n.maxLength,e)]);case 3:return i.sent(),u=(0,s.parseItem)(f,n.parser),c=(0,s.itf8Size)(u.numLandmarks),e+u.length>=a?(console.warn("".concat(this.file,": container header at ").concat(e," indicates that the container has length ").concat(u.length,", which extends beyond the length of the file. Skipping this container.")),[2,void 0]):(h=t.allocUnsafe(o.maxLength(u.numLandmarks)),[4,this.file.read(h,0,o.maxLength(u.numLandmarks),e+u._size-c)]);case 4:return i.sent(),l=(0,s.parseItem)(h,o.parser),this.file.validateChecksums&&void 0!==l.crc32?[4,this.file.checkCrc32(e,u._size+l._size-c-4,l.crc32,"container header beginning at position ".concat(e))]:[3,6];case 5:i.sent(),i.label=6;case 6:return[2,Object.assign(u,l,{_size:u._size+l._size-c,_endPosition:u._size+l._size-c+e})]}}))}))},e}();e.default=c,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((function(t){return(0,s.tinyMemoize)(c,t)}))}).call(this,r(1).Buffer)},function(t,e,r){var n,i,o,a,s;n=r(62),i=r(28).utf8,o=r(63),a=r(28).bin,(s=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):i.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),f=8*t.length,u=1732584193,c=-271733879,h=-1732584194,l=271733878,d=0;d<r.length;d++)r[d]=16711935&(r[d]<<8|r[d]>>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[f>>>5]|=128<<f%32,r[14+(f+64>>>9<<4)]=f;var p=s._ff,g=s._gg,y=s._hh,v=s._ii;for(d=0;d<r.length;d+=16){var m=u,b=c,_=h,w=l;u=p(u,c,h,l,r[d+0],7,-680876936),l=p(l,u,c,h,r[d+1],12,-389564586),h=p(h,l,u,c,r[d+2],17,606105819),c=p(c,h,l,u,r[d+3],22,-1044525330),u=p(u,c,h,l,r[d+4],7,-176418897),l=p(l,u,c,h,r[d+5],12,1200080426),h=p(h,l,u,c,r[d+6],17,-1473231341),c=p(c,h,l,u,r[d+7],22,-45705983),u=p(u,c,h,l,r[d+8],7,1770035416),l=p(l,u,c,h,r[d+9],12,-1958414417),h=p(h,l,u,c,r[d+10],17,-42063),c=p(c,h,l,u,r[d+11],22,-1990404162),u=p(u,c,h,l,r[d+12],7,1804603682),l=p(l,u,c,h,r[d+13],12,-40341101),h=p(h,l,u,c,r[d+14],17,-1502002290),u=g(u,c=p(c,h,l,u,r[d+15],22,1236535329),h,l,r[d+1],5,-165796510),l=g(l,u,c,h,r[d+6],9,-1069501632),h=g(h,l,u,c,r[d+11],14,643717713),c=g(c,h,l,u,r[d+0],20,-373897302),u=g(u,c,h,l,r[d+5],5,-701558691),l=g(l,u,c,h,r[d+10],9,38016083),h=g(h,l,u,c,r[d+15],14,-660478335),c=g(c,h,l,u,r[d+4],20,-405537848),u=g(u,c,h,l,r[d+9],5,568446438),l=g(l,u,c,h,r[d+14],9,-1019803690),h=g(h,l,u,c,r[d+3],14,-187363961),c=g(c,h,l,u,r[d+8],20,1163531501),u=g(u,c,h,l,r[d+13],5,-1444681467),l=g(l,u,c,h,r[d+2],9,-51403784),h=g(h,l,u,c,r[d+7],14,1735328473),u=y(u,c=g(c,h,l,u,r[d+12],20,-1926607734),h,l,r[d+5],4,-378558),l=y(l,u,c,h,r[d+8],11,-2022574463),h=y(h,l,u,c,r[d+11],16,1839030562),c=y(c,h,l,u,r[d+14],23,-35309556),u=y(u,c,h,l,r[d+1],4,-1530992060),l=y(l,u,c,h,r[d+4],11,1272893353),h=y(h,l,u,c,r[d+7],16,-155497632),c=y(c,h,l,u,r[d+10],23,-1094730640),u=y(u,c,h,l,r[d+13],4,681279174),l=y(l,u,c,h,r[d+0],11,-358537222),h=y(h,l,u,c,r[d+3],16,-722521979),c=y(c,h,l,u,r[d+6],23,76029189),u=y(u,c,h,l,r[d+9],4,-640364487),l=y(l,u,c,h,r[d+12],11,-421815835),h=y(h,l,u,c,r[d+15],16,530742520),u=v(u,c=y(c,h,l,u,r[d+2],23,-995338651),h,l,r[d+0],6,-198630844),l=v(l,u,c,h,r[d+7],10,1126891415),h=v(h,l,u,c,r[d+14],15,-1416354905),c=v(c,h,l,u,r[d+5],21,-57434055),u=v(u,c,h,l,r[d+12],6,1700485571),l=v(l,u,c,h,r[d+3],10,-1894986606),h=v(h,l,u,c,r[d+10],15,-1051523),c=v(c,h,l,u,r[d+1],21,-2054922799),u=v(u,c,h,l,r[d+8],6,1873313359),l=v(l,u,c,h,r[d+15],10,-30611744),h=v(h,l,u,c,r[d+6],15,-1560198380),c=v(c,h,l,u,r[d+13],21,1309151649),u=v(u,c,h,l,r[d+4],6,-145523070),l=v(l,u,c,h,r[d+11],10,-1120210379),h=v(h,l,u,c,r[d+2],15,718787259),c=v(c,h,l,u,r[d+9],21,-343485551),u=u+m>>>0,c=c+b>>>0,h=h+_>>>0,l=l+w>>>0}return n.endian([u,c,h,l])})._ff=function(t,e,r,n,i,o,a){var s=t+(e&r|~e&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._gg=function(t,e,r,n,i,o,a){var s=t+(e&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._hh=function(t,e,r,n,i,o,a){var s=t+(e^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._ii=function(t,e,r,n,i,o,a){var s=t+(r^(e|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(s(t,e));return e&&e.asBytes?r:e&&e.asString?a.bytesToString(r):n.bytesToHex(r)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?e.push(r.charAt(i>>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(t.charAt(n))>>>6-2*i);return e}},t.exports=n},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
|
|
20
11
|
/*!
|
|
21
12
|
* Determine if an object is a Buffer
|
|
22
13
|
*
|
|
23
14
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
24
15
|
* @license MIT
|
|
25
16
|
*/
|
|
26
|
-
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n,i=r(1),o=i(r(148)),a=i(r(75)),s=i(r(150)),u=i(r(37)),f=i(r(30)),c=i(r(31)),l=i(r(7)),h=i(r(10)),d=i(r(99)),p=i(r(17)),g=i(r(76)),v=i(r(59)),y=r(9),m=y.CramMalformedError,b=y.CramBufferOverrunError,_=y.CramArgumentError,w=r(58),x=w.parseItem,E=w.tinyMemoize,S=w.sequenceMD5,k=r(100),A=r(364);function C(t,e,r,n){if(!n)throw new m("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==e);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=k.BAM_FPAIRED,(0,d.default)(n)&k.BAM_FUNMAP&&(r.flags|=k.BAM_FMUNMAP),(0,d.default)(r)&k.BAM_FUNMAP&&(n.flags|=k.BAM_FMUNMAP),(0,d.default)(n)&k.BAM_FREVERSE&&(r.flags|=k.BAM_FMREVERSE),(0,d.default)(r)&k.BAM_FREVERSE&&(n.flags|=k.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(t,e,r){var n=function e(r){var n=[r];if(r.mateRecordNumber>=0){var i=t[r.mateRecordNumber];if(!i)throw new m("intra-slice mate record not found, this file seems malformed");n.push.apply(n,(0,v.default)(e(i)))}return n}(r),i=(0,g.default)(n).call(n,(function(t){return t.alignmentStart})),o=(0,g.default)(n).call(n,(function(t){return t.alignmentStart+t.readLength-1})),a=Math.max.apply(Math,(0,v.default)(o))-Math.min.apply(Math,(0,v.default)(i))+1;a>=0&&(0,p.default)(n).call(n,(function(t){if(void 0!==t.templateLength)throw new m("mate pair group has some members that have template lengths already, this file seems malformed");t.templateLength=a}))}(t,0,r):function(t,e){var r=Math.min(t.alignmentStart,e.alignmentStart),n=Math.max(t.alignmentStart+t.readLength-1,e.alignmentStart+e.readLength-1)-r+1;t.templateLength=n,e.templateLength=n}(r,n)),delete r.mateRecordNumber}var T=function(){function t(e,r){(0,l.default)(this,t),this.container=e,this.file=e.file,this.containerPosition=r}var e,r,n,i,d,v,y,w;return(0,h.default)(t,[{key:"getHeader",value:(w=(0,c.default)(f.default.mark((function t(){var e,r,n;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.file.getSectionParsers();case 2:return e=t.sent,t.next=5,this.container.getHeader();case 5:return r=t.sent,t.next=8,this.file.readBlock(r._endPosition+this.containerPosition);case 8:if("MAPPED_SLICE_HEADER"!==(n=t.sent).contentType){t.next=13;break}n.content=x(n.content,e.cramMappedSliceHeader.parser,0,r._endPosition),t.next=18;break;case 13:if("UNMAPPED_SLICE_HEADER"!==n.contentType){t.next=17;break}n.content=x(n.content,e.cramUnmappedSliceHeader.parser,0,r._endPosition),t.next=18;break;case 17:throw new m("error reading slice header block, invalid content type ".concat(n._contentType));case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this)}))),function(){return w.apply(this,arguments)})},{key:"getBlocks",value:(y=(0,c.default)(f.default.mark((function t(){var e,r,n,i;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getHeader();case 2:e=t.sent,r=e._endPosition,n=new Array(e.content.numBlocks),i=0;case 6:if(!(i<n.length)){t.next=14;break}return t.next=9,this.file.readBlock(r);case 9:n[i]=t.sent,r=n[i]._endPosition;case 11:i+=1,t.next=6;break;case 14:return t.abrupt("return",n);case 15:case"end":return t.stop()}}),t,this)}))),function(){return y.apply(this,arguments)})},{key:"getCoreDataBlock",value:(v=(0,c.default)(f.default.mark((function t(){var e;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getBlocks();case 2:return e=t.sent,t.abrupt("return",e[0]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return v.apply(this,arguments)})},{key:"_getBlocksContentIdIndex",value:(d=(0,c.default)(f.default.mark((function t(){var e,r;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getBlocks();case 2:return e=t.sent,r={},(0,p.default)(e).call(e,(function(t){"EXTERNAL_DATA"===t.contentType&&(r[t.contentId]=t)})),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(){return d.apply(this,arguments)})},{key:"getBlockByContentId",value:(i=(0,c.default)(f.default.mark((function t(e){var r;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._getBlocksContentIdIndex();case 2:return r=t.sent,t.abrupt("return",r[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"getReferenceRegion",value:(n=(0,c.default)(f.default.mark((function t(){var e,r,n,i;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getHeader();case 2:if(!((e=t.sent.content).refSeqId<0)){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.next=7,this.container.getCompressionScheme();case 7:if(r=t.sent,!(e.refBaseBlockId>=0)){t.next=15;break}if(n=this.getBlockByContentId(e.refBaseBlockId)){t.next=12;break}throw new m("embedded reference specified, but reference block does not exist");case 12:if(!(e.span>n.uncompressedSize)){t.next=14;break}throw new m("Embedded reference is too small");case 14:return t.abrupt("return",{seq:n.data.toString("utf8"),start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan});case 15:if(!r.referenceRequired&&!this.file.fetchReferenceSequenceCallback){t.next=24;break}if(this.file.fetchReferenceSequenceCallback){t.next=18;break}throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");case 18:return t.next=20,this.file.fetchReferenceSequenceCallback(e.refSeqId,e.refSeqStart,e.refSeqStart+e.refSeqSpan-1);case 20:if((i=t.sent).length===e.refSeqSpan){t.next=23;break}throw new _("seqFetch callback returned a reference sequence of the wrong length");case 23:return t.abrupt("return",{seq:i,start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan});case 24:return t.abrupt("return",void 0);case 25:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getAllRecords",value:function(){return this.getRecords((function(){return!0}))}},{key:"_fetchRecords",value:(r=(0,c.default)(f.default.mark((function t(){var e,r,n,i,o,a,c,l,h,d,p,v,y,_,w,x,E,k,T,R,O,I,L,B=this;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.file.getDefinition();case 2:return e=t.sent,r=e.majorVersion,t.next=6,this.container.getCompressionScheme();case 6:return n=t.sent,t.next=9,this.getHeader();case 9:return i=t.sent,t.next=12,this._getBlocksContentIdIndex();case 12:if(o=t.sent,!(r>1&&this.file.options.checkSequenceMD5&&i.content.refSeqId>=0&&"0000000000000000"!==i.content.md5.join(""))){t.next=23;break}return t.next=16,this.getReferenceRegion();case 16:if(!(a=t.sent)){t.next=23;break}if(v=a.seq,y=a.start,_=a.end,w=S(v),x=(0,g.default)(c=i.content.md5).call(c,(function(t){return(t<16?"0":"")+t.toString(16)})).join(""),w===x){t.next=23;break}throw new m((0,u.default)(l=(0,u.default)(h=(0,u.default)(d=(0,u.default)(p="MD5 checksum reference mismatch for ref ".concat(i.content.refSeqId," pos ")).call(p,y,"..")).call(d,_,". recorded MD5: ")).call(h,x,", calculated MD5: ")).call(l,w));case 23:return t.next=25,this.getCoreDataBlock();case 25:E=t.sent,k={lastAlignmentStart:i.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{getCursor:function(t){return this[t]||(this[t]={bitPosition:7,bytePosition:0}),this[t]}}},T=function(t){var e=n.getCodecForDataSeries(t);if(!e)throw new m("no codec defined for ".concat(t," data series"));return e.decode(B,E,o,k)},R=new Array(i.content.numRecords),O=0;case 30:if(!(O<R.length)){t.next=48;break}t.prev=31,R[O]=A(this,T,n,i,E,o,k,r,O),R[O].uniqueId=i.contentPosition+i.content.recordCounter+O+1,t.next=45;break;case 36:if(t.prev=36,t.t0=t.catch(31),!(t.t0 instanceof b)){t.next=44;break}return console.warn("read attempted beyond end of buffer, file seems truncated."),R=(0,s.default)(R).call(R,(function(t){return!!t})),t.abrupt("break",48);case 44:throw t.t0;case 45:O+=1,t.next=30;break;case 48:for(I=0;I<R.length;I+=1)(L=R[I].mateRecordNumber)>=0&&C(R,I,R[I],R[L]);return t.abrupt("return",R);case 50:case"end":return t.stop()}}),t,this,[[31,36]])}))),function(){return r.apply(this,arguments)})},{key:"getRecords",value:(e=(0,c.default)(f.default.mark((function t(e){var r,n,i,u,l,h,d,p,v,y,m,b,_,w,x,E,S=this;return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.container.filePosition+this.containerPosition,(i=this.file.featureCache.get(n))||(i=this._fetchRecords(),this.file.featureCache.set(n,i)),t.t0=s.default,t.next=6,i;case 6:if(t.t1=r=t.sent,t.t2=r,t.t3=e,!(u=(0,t.t0)(t.t1).call(t.t2,t.t3)).length||!this.file.fetchReferenceSequenceCallback){t.next=24;break}return t.next=13,this.getHeader();case 13:if(!((l=t.sent).content.refSeqId>=0||-2===l.content.refSeqId)){t.next=24;break}return d=l.content.refSeqId>=0?l.content.refSeqId:void 0,t.next=18,this.container.getCompressionScheme();case 18:for(p=t.sent,v={},y=0;y<u.length;y+=1)m=void 0!==d?d:u[y].sequenceId,(b=v[m])||(b={id:m,start:u[y].alignmentStart,end:-1/0},v[m]=b),(_=u[y].alignmentStart+(u[y].lengthOnRef||u[y].readLength)-1)>b.end&&(b.end=_),u[y].alignmentStart<b.start&&(b.start=u[y].alignmentStart);return t.next=23,a.default.all((0,g.default)(h=(0,o.default)(v)).call(h,function(){var t=(0,c.default)(f.default.mark((function t(e){return f.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(-1!==e.id&&e.start<=e.end)){t.next=4;break}return t.next=3,S.file.fetchReferenceSequenceCallback(e.id,e.start,e.end);case 3:e.seq=t.sent;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 23:for(w=0;w<u.length;w+=1)x=void 0!==d?d:u[w].sequenceId,(E=v[x])&&E.seq&&u[w].addReferenceSequence(E,p);case 24:return t.abrupt("return",u);case 25:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();(0,p.default)(n="getHeader getBlocks _getBlocksContentIdIndex".split(" ")).call(n,(function(t){return E(T,t)})),t.exports=T},function(t,e,r){t.exports=r(337)},function(t,e,r){r(338);var n=r(3);t.exports=n.Object.values},function(t,e,r){var n=r(0),i=r(149).values;n({target:"Object",stat:!0},{values:function(t){return i(t)}})},function(t,e,r){t.exports=r(340)},function(t,e,r){var n=r(341),i=Array.prototype;t.exports=function(t){var e=t.filter;return t===i||t instanceof Array&&e===i.filter?n:e}},function(t,e,r){r(342);var n=r(19);t.exports=n("Array").filter},function(t,e,r){"use strict";var n=r(0),i=r(45).filter;n({target:"Array",proto:!0,forced:!r(68)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){t.exports=r(344)},function(t,e,r){var n=r(345),i=RegExp.prototype;t.exports=function(t){return!(t===i||t instanceof RegExp)||"flags"in t?t.flags:n(t)}},function(t,e,r){r(346);var n=r(347);t.exports=function(t){return n.call(t)}},function(t,e){},function(t,e,r){"use strict";var n=r(2);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,r){t.exports=r(349)},function(t,e,r){var n=r(350),i=Array.prototype;t.exports=function(t){var e=t.map;return t===i||t instanceof Array&&e===i.map?n:e}},function(t,e,r){r(351);var n=r(19);t.exports=n("Array").map},function(t,e,r){"use strict";var n=r(0),i=r(45).map;n({target:"Array",proto:!0,forced:!r(68)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){var n=r(151);t.exports=function(t){if(n(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e,r){t.exports=r(354)},function(t,e,r){r(355);var n=r(3);t.exports=n.Array.isArray},function(t,e,r){r(0)({target:"Array",stat:!0},{isArray:r(53)})},function(t,e,r){t.exports=r(357)},function(t,e,r){t.exports=r(358)},function(t,e,r){r(46),r(359);var n=r(3);t.exports=n.Array.from},function(t,e,r){var n=r(0),i=r(360);n({target:"Array",stat:!0,forced:!r(121)((function(t){Array.from(t)}))},{from:i})},function(t,e,r){"use strict";var n=r(15),i=r(22),o=r(120),a=r(119),s=r(29),u=r(86),f=r(89);t.exports=function(t){var e,r,c,l,h=i(t),d="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,v=void 0!==g,y=0,m=f(h);if(v&&(g=n(g,p>2?arguments[2]:void 0,2)),null==m||d==Array&&a(m))for(r=new d(e=s(h.length));e>y;y++)u(r,y,v?g(h[y],y):h[y]);else for(l=m.call(h),r=new d;!(c=l.next()).done;y++)u(r,y,v?o(l,g,[c.value,y],!0):c.value);return r.length=y,r}},function(t,e,r){r(41),r(46),t.exports=r(362)},function(t,e,r){var n=r(67),i=r(6),o=r(35),a=i("iterator");t.exports=function(t){var e=Object(t);return void 0!==e[a]||"@@iterator"in e||o.hasOwnProperty(n(e))}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,r){"use strict";(function(e){var n=r(1),i=n(r(37)),o=n(r(365)),a=n(r(17)),s=n(r(99)),u=n(r(101)),f=n(r(59)),c=n(r(154)),l=n(r(377)),h=n(r(381)),d=n(r(48)),p=n(r(388)),g=r(146),v=r(9),y=v.CramMalformedError,m=v.CramUnimplementedError,b=r(390),_=r(100);function w(t){var e=(0,p.default)(t).call(t,0);return-1===e?t.toString("utf8"):t.toString("utf8",0,e)}function x(t,r){if(r.readInt32LE||(r=e.from(r)),"Z"===t)return w(r);if("A"===t)return String.fromCharCode(r[0]);if("I"===t){var n=g.fromBytesLE(r);if(n.greaterThan(h.default)||n.lessThan(l.default))throw new m("integer overflow");return n.toNumber()}if("i"===t)return r.readInt32LE(0);if("s"===t)return r.readInt16LE(0);if("S"===t)return r.readUInt16LE(0);if("c"===t)return r.readInt8(0);if("C"===t)return r.readUInt8(0);if("f"===t)return r.readFloatLE(0);if("H"===t){var i=w(r);return(0,c.default)(i.replace(/^0x/,""),16)}if("B"===t)return function(t){var e=String.fromCharCode(t[0]),r=t.readInt32LE(1),n={c:["readInt8",1],C:["readUInt8",1],s:["readInt16LE",2],S:["readUInt16LE",2],i:["readInt32LE",4],I:["readUInt32LE",4],f:["readFloatLE",4]}[e];if(!n)throw new y("invalid tag value array type '".concat(e,"'"));for(var i=(0,d.default)(n,2),o=i[0],a=i[1],s=new Array(r),u=5,f=0;f<r;f+=1)s[f]=t[o](u),u+=a;return s}(r);throw new y("Unrecognized tag type ".concat(t))}function E(t){if(t instanceof e)return w(t);if(t.length&&(0,p.default)(t)){if(!t[t.length-1]){var r=(0,p.default)(t).call(t,0);return String.fromCharCode.apply(String,(0,f.default)((0,u.default)(t).call(t,0,r)))}return String.fromCharCode.apply(String,(0,f.default)(t))}return String(t)}t.exports=function(t,e,r,n,u,f,c,l,h){var p=new b;if(p.flags=e("BF"),p.cramFlags=e("CF"),l>1&&-2===n.content.refSeqId?p.sequenceId=e("RI"):p.sequenceId=n.content.refSeqId,p.readLength=e("RL"),p.alignmentStart=e("AP"),r.APdelta&&(p.alignmentStart+=c.lastAlignmentStart),c.lastAlignmentStart=p.alignmentStart,p.readGroupId=e("RG"),r.readNamesIncluded&&(p.readName=E(e("RN"))),p.isDetached()){var g={};g.flags=e("MF"),r.readNamesIncluded||(g.readName=E(e("RN")),p.readName=g.readName),g.sequenceId=e("NS"),g.alignmentStart=e("NP"),((0,s.default)(g)||g.sequenceId>-1)&&(p.mate=g),p.templateSize=e("TS"),(0,s.default)(g)&_.CRAM_M_UNMAP&&(p.flags|=_.BAM_FMUNMAP),(0,s.default)(g)&_.CRAM_M_REVERSE&&(p.flags|=_.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=e("NF")+h+1);var v=e("TL");if(v<0)throw new y("invalid TL index");for(var m=r.getTagNames(v),w=m.length,S=0;S<w;S+=1){var k=m[S],A=k.substr(0,2),C=k.substr(2,1),T=r.getCodecForTag(k);if(!T)throw new y("no codec defined for auxiliary tag ".concat(k));var R=T.decode(t,u,f,c);p.tags[A]=x(C,R)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(var O=new Array(p.readLength),I=0;I<O.length;I+=1)O[I]=e("BA");if(p.readBases=String.fromCharCode.apply(String,O),p.isPreservingQualityScores()){for(var L=0;L<O.length;L+=1)O[L]=e("QS");p.qualityScores=O}}else{var B,P=e("FN");P&&(p.readFeatures=function(t,e,r,n,i){var o=0,a=t.alignmentStart-1,s=new Array(e);function u(t){var e=(0,d.default)(t,2),n=e[0],i=e[1],o=r(i);return"character"===n?String.fromCharCode(o):"string"===n?o.toString("utf8"):"numArray"===n?o.toArray():o}for(var f=0;f<e;f+=1){var c=String.fromCharCode(r("FC")),l=r("FP"),h={code:c},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[c];if(!p)throw new y('invalid read feature code "'.concat(c,'"'));h.data=u(p);var g={B:["number","QS"]}[c];g&&(h.data=[h.data,u(g)]),o+=l,h.pos=o,a+=l,h.refPos=a,"D"===c||"N"===c?a+=h.data:"I"===c||"S"===c?a-=h.data.length:"i"===c&&(a-=1),s[f]=h}return s}(p,P,e,0,l));var F,N=p.readLength;if(p.readFeatures&&(0,a.default)(B=p.readFeatures).call(B,(function(t){var e=t.code,r=t.data;"D"===e||"N"===e?N+=r:"I"===e||"S"===e?N-=r.length:"i"===e&&(N-=1)})),(0,o.default)(N))console.warn("".concat(p.readName||(0,i.default)(F="".concat(p.sequenceId,":")).call(F,p.alignmentStart)," record has invalid read features")),N=p.readLength;if(p.lengthOnRef=N,p.mappingQuality=e("MQ"),p.isPreservingQualityScores()){for(var M=new Array(p.readLength),j=0;j<M.length;j+=1)M[j]=e("QS");p.qualityScores=M}}return p}}).call(this,r(16).Buffer)},function(t,e,r){t.exports=r(366)},function(t,e,r){t.exports=r(367)},function(t,e,r){r(368);var n=r(3);t.exports=n.Number.isNaN},function(t,e,r){r(0)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},function(t,e,r){t.exports=r(370)},function(t,e,r){var n=r(371),i=Array.prototype;t.exports=function(t){var e=t.slice;return t===i||t instanceof Array&&e===i.slice?n:e}},function(t,e,r){r(372);var n=r(19);t.exports=n("Array").slice},function(t,e,r){"use strict";var n=r(0),i=r(14),o=r(53),a=r(83),s=r(29),u=r(28),f=r(86),c=r(68),l=r(6)("species"),h=[].slice,d=Math.max;n({target:"Array",proto:!0,forced:!c("slice")},{slice:function(t,e){var r,n,c,p=u(this),g=s(p.length),v=a(t,g),y=a(void 0===e?g:e,g);if(o(p)&&("function"!=typeof(r=p.constructor)||r!==Array&&!o(r.prototype)?i(r)&&null===(r=r[l])&&(r=void 0):r=void 0,r===Array||void 0===r))return h.call(p,v,y);for(n=new(void 0===r?Array:r)(d(y-v,0)),c=0;v<y;v++,c++)v in p&&f(n,c,p[v]);return n.length=c,n}})},function(t,e,r){t.exports=r(374)},function(t,e,r){r(375);var n=r(3);t.exports=n.Number.parseInt},function(t,e,r){var n=r(0),i=r(155);n({target:"Number",stat:!0,forced:Number.parseInt!=i},{parseInt:i})},function(t,e,r){var n=r(49),i="["+r(156)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(t){return function(e){var r=String(n(e));return 1&t&&(r=r.replace(o,"")),2&t&&(r=r.replace(a,"")),r}};t.exports={start:s(1),end:s(2),trim:s(3)}},function(t,e,r){t.exports=r(378)},function(t,e,r){t.exports=r(379)},function(t,e,r){r(380),t.exports=-9007199254740991},function(t,e,r){r(0)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,r){t.exports=r(382)},function(t,e,r){t.exports=r(383)},function(t,e,r){r(384),t.exports=9007199254740991},function(t,e,r){r(0)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,r){var n=r(386),i=r(153);t.exports=function(t,e){if(i(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],o=!0,a=!1,s=void 0;try{for(var u,f=n(t);!(o=(u=f.next()).done)&&(r.push(u.value),!e||r.length!==e);o=!0);}catch(t){a=!0,s=t}finally{try{o||null==f.return||f.return()}finally{if(a)throw s}}return r}}},function(t,e,r){t.exports=r(387)},function(t,e,r){r(41),r(46),t.exports=r(142)},function(t,e,r){t.exports=r(389)},function(t,e,r){t.exports=r(143)},function(t,e,r){"use strict";var n=r(1),i=n(r(98)),o=n(r(17)),a=n(r(99)),s=n(r(7)),u=n(r(10)),f=n(r(59)),c=r(100);var l={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var h=function(){function t(){(0,s.default)(this,t),this.tags={}}return(0,u.default)(t,[{key:"isPaired",value:function(){return!!((0,a.default)(this)&c.BAM_FPAIRED)}},{key:"isProperlyPaired",value:function(){return!!((0,a.default)(this)&c.BAM_FPROPER_PAIR)}},{key:"isSegmentUnmapped",value:function(){return!!((0,a.default)(this)&c.BAM_FUNMAP)}},{key:"isMateUnmapped",value:function(){return!!((0,a.default)(this)&c.BAM_FMUNMAP)}},{key:"isReverseComplemented",value:function(){return!!((0,a.default)(this)&c.BAM_FREVERSE)}},{key:"isMateReverseComplemented",value:function(){return!!((0,a.default)(this)&c.BAM_FMREVERSE)}},{key:"isRead1",value:function(){return!!((0,a.default)(this)&c.BAM_FREAD1)}},{key:"isRead2",value:function(){return!!((0,a.default)(this)&c.BAM_FREAD2)}},{key:"isSecondary",value:function(){return!!((0,a.default)(this)&c.BAM_FSECONDARY)}},{key:"isFailedQc",value:function(){return!!((0,a.default)(this)&c.BAM_FQCFAIL)}},{key:"isDuplicate",value:function(){return!!((0,a.default)(this)&c.BAM_FDUP)}},{key:"isSupplementary",value:function(){return!!((0,a.default)(this)&c.BAM_FSUPPLEMENTARY)}},{key:"isDetached",value:function(){return!!(this.cramFlags&c.CRAM_FLAG_DETACHED)}},{key:"hasMateDownStream",value:function(){return!!(this.cramFlags&c.CRAM_FLAG_MATE_DOWNSTREAM)}},{key:"isPreservingQualityScores",value:function(){return!!(this.cramFlags&c.CRAM_FLAG_PRESERVE_QUAL_SCORES)}},{key:"isUnknownBases",value:function(){return!!(this.cramFlags&c.CRAM_FLAG_NO_SEQ)}},{key:"getReadBases",value:function(){return!this.readBases&&this._refRegion&&(this.readBases=function(t,e){if((t.lengthOnRef||t.readLength)&&!t.isUnknownBases()){var r=t.alignmentStart-e.start;if(!t.readFeatures)return e.seq.substr(r,t.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<t.readLength;)if(o<t.readFeatures.length){var a=t.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),u=String.fromCharCode.apply(String,(0,f.default)(s));n+=u,i+=u.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<t.readFeatures.length){var c=e.seq.substr(i,t.readFeatures[o].pos-n.length-1);n+=c,i+=c.length}}else{var l=e.seq.substr(i,t.readLength-n.length);n+=l,i+=l.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases}},{key:"getPairOrientation",value:function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var t=this.isReverseComplemented()?"R":"F",e=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=t,i[1]=r,i[2]=e,i[3]=n):(i[2]=t,i[3]=r,i[0]=e,i[1]=n),i.join("")}return null}},{key:"addReferenceSequence",value:function(t,e){var r;this.readFeatures&&(0,o.default)(r=this.readFeatures).call(r,(function(r){"X"===r.code&&function(t,e,r,n){if(e){var i=n.refPos-e.start,o=e.seq.charAt(i);o&&(n.ref=o);var a=l[o];void 0===a&&(a=4);var s=r.substitutionMatrix[a][n.data];s&&(n.sub=s)}}(0,t,e,r)}));!this.readBases&&t.start<=this.alignmentStart&&t.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=t)}},{key:"toJSON",value:function(){var t,e=this,r={};return(0,o.default)(t=(0,i.default)(this)).call(t,(function(t){"_"!==t.charAt(0)&&(r[t]=e[t])})),r.readBases=this.getReadBases(),r}}]),t}();t.exports=h},function(t,e,r){"use strict";var n=r(1),i=n(r(98)),o=n(r(17)),a=n(r(74)),s=n(r(7)),u=n(r(10)),f=r(9).CramMalformedError,c=r(392).instantiateCodec,l={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var h=function(){function t(e){(0,s.default)(this,t),(0,a.default)(this,e),this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(t){for(var e=new Array(5),r=0;r<5;r+=1)e[r]=new Array(4);return e[0][t[0]>>6&3]="C",e[0][t[0]>>4&3]="G",e[0][t[0]>>2&3]="T",e[0][t[0]>>0&3]="N",e[1][t[1]>>6&3]="A",e[1][t[1]>>4&3]="G",e[1][t[1]>>2&3]="T",e[1][t[1]>>0&3]="N",e[2][t[2]>>6&3]="A",e[2][t[2]>>4&3]="C",e[2][t[2]>>2&3]="T",e[2][t[2]>>0&3]="N",e[3][t[3]>>6&3]="A",e[3][t[3]>>4&3]="C",e[3][t[3]>>2&3]="G",e[3][t[3]>>0&3]="N",e[4][t[4]>>6&3]="A",e[4][t[4]>>4&3]="C",e[4][t[4]>>2&3]="G",e[4][t[4]>>0&3]="T",e}(e.preservation.SM),this.dataSeriesCodecCache={},this.tagCodecCache={}}return(0,u.default)(t,[{key:"getCodecForTag",value:function(t){if(!this.tagCodecCache[t]){var e=this.tagEncoding[t];e&&(this.tagCodecCache[t]=c(e,"byteArray"))}return this.tagCodecCache[t]}},{key:"getTagNames",value:function(t){return this.tagIdsDictionary[t]}},{key:"getCodecForDataSeries",value:function(t){if(!this.dataSeriesCodecCache[t]){var e=this.dataSeriesEncoding[t];if(e){var r=l[t];if(!r)throw new f("data series name ".concat(t," not defined in file compression header"));this.dataSeriesCodecCache[t]=c(e,r)}}return this.dataSeriesCodecCache[t]}},{key:"toJSON",value:function(){var t,e=this,r={};return(0,o.default)(t=(0,i.default)(this)).call(t,(function(t){/Cache$/.test(t)||(r[t]=e[t])})),r}}]),t}();t.exports=h},function(t,e,r){"use strict";var n=r(9).CramUnimplementedError,i=r(393),o=r(414),a=r(415),s=r(416),u=r(417),f=r(418),c={1:o,3:i,4:s,5:a,6:u,7:r(419),9:f};function l(t){return c[t]}t.exports={getCodecClassWithId:l,instantiateCodec:function t(e,r){var i=l("ignore"===r?0:e.codecId);if(!i)throw new n("no codec implemented for codec ID ".concat(e.codecId));return new i(e.parameters,r,t)}}},function(t,e,r){"use strict";var n=r(1),i=n(r(97)),o=n(r(59)),a=n(r(76)),s=n(r(148)),u=n(r(159)),f=n(r(48)),c=n(r(102)),l=n(r(17)),h=n(r(103)),d=n(r(404)),p=n(r(7)),g=n(r(10)),v=n(r(32)),y=n(r(27)),m=n(r(33)),b=r(9).CramMalformedError;var _=function(t){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if((0,p.default)(this,e),r=(0,v.default)(this,(0,y.default)(e).call(this,n,i)),!(0,d.default)(t=["byte","int"]).call(t,r.dataType))throw new TypeError("".concat(r.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return r.buildCodeBook(),r.buildCodes(),r.buildCaches(),0===r.sortedCodes[0].bitLength&&(r._decode=r._decodeZeroLengthCode),r}return(0,m.default)(e,t),(0,g.default)(e,[{key:"buildCodeBook",value:function(){for(var t=this,e=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)e[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};e=(0,h.default)(e).call(e,(function(t,e){return t.bitLength-e.bitLength||t.symbol-e.symbol})),this.codeBook={},(0,l.default)(e).call(e,(function(e){t.codeBook[e.bitLength]||(t.codeBook[e.bitLength]=[]),t.codeBook[e.bitLength].push(e.symbol)}))}},{key:"buildCodes",value:function(){var t,e=this;this.codes={};var r=0,n=-1;(0,l.default)(t=(0,c.default)(this.codeBook)).call(t,(function(t){var i=(0,f.default)(t,2),o=i[0],a=i[1];o=(0,u.default)(o,10),(0,l.default)(a).call(a,(function(t){var i={bitLength:o,value:t};n+=1;var a,s,u=o-r;if(n<<=u,i.bitCode=n,r+=u,16843009*((s=(858993459&(s=(a=n)-(a>>1)&1431655765))+(s>>2&858993459))+(s>>4)&252645135)>>24>o)throw new b("Symbol out of range");e.codes[t]=i}))}))}},{key:"buildCaches",value:function(){var t,e,r,n,u,f;this.sortedCodes=(0,h.default)(t=(0,s.default)(this.codes)).call(t,(function(t,e){return t.bitLength-e.bitLength||t.bitCode-e.bitCode})),this.sortedByValue=(0,h.default)(e=(0,s.default)(this.codes)).call(e,(function(t,e){return t.value-e.value})),this.sortedValuesByBitCode=(0,a.default)(r=this.sortedCodes).call(r,(function(t){return t.value})),this.sortedBitCodes=(0,a.default)(n=this.sortedCodes).call(n,(function(t){return t.bitCode})),this.sortedBitLengthsByBitCode=(0,a.default)(u=this.sortedCodes).call(u,(function(t){return t.bitLength}));var c=Math.max.apply(Math,(0,o.default)(this.sortedBitCodes));this.bitCodeToValue=(0,i.default)(f=new Array(c+1)).call(f,-1);for(var l=0;l<this.sortedBitCodes.length;l+=1)this.bitCodeToValue[this.sortedCodes[l].bitCode]=l}},{key:"decode",value:function(t,e,r,n){return this._decode(t,e,n.coreBlock)}},{key:"_decodeZeroLengthCode",value:function(){return this.sortedCodes[0].value}},{key:"_decode",value:function(t,e,r){for(var n=e.content,i=0,o=0,a=0;a<this.sortedCodes.length;a+=1){var s=this.sortedCodes[a].bitLength;o<<=s-i,o|=this._getBits(n,r,s-i),i=s;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===s)return this.sortedValuesByBitCode[u];for(var f=a;this.sortedCodes[f+1].bitLength===s&&f<this.sortedCodes.length;f+=1)a+=1}throw new b("Huffman symbol not found.")}}]),e}(r(40));t.exports=_},function(t,e,r){t.exports=r(395)},function(t,e,r){r(396);var n=r(3);t.exports=n.parseInt},function(t,e,r){var n=r(0),i=r(155);n({global:!0,forced:parseInt!=i},{parseInt:i})},function(t,e,r){t.exports=r(398)},function(t,e,r){r(399);var n=r(3);t.exports=n.Object.entries},function(t,e,r){var n=r(0),i=r(149).entries;n({target:"Object",stat:!0},{entries:function(t){return i(t)}})},function(t,e,r){t.exports=r(401)},function(t,e,r){var n=r(402),i=Array.prototype;t.exports=function(t){var e=t.sort;return t===i||t instanceof Array&&e===i.sort?n:e}},function(t,e,r){r(403);var n=r(19);t.exports=n("Array").sort},function(t,e,r){"use strict";var n=r(0),i=r(5),o=r(22),a=r(12),s=r(54),u=[].sort,f=[1,2,3],c=a((function(){f.sort(void 0)})),l=a((function(){f.sort(null)})),h=s("sort");n({target:"Array",proto:!0,forced:c||!l||h},{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},function(t,e,r){t.exports=r(405)},function(t,e,r){t.exports=r(406)},function(t,e,r){var n=r(407),i=r(409),o=Array.prototype,a=String.prototype;t.exports=function(t){var e=t.includes;return t===o||t instanceof Array&&e===o.includes?n:"string"==typeof t||t===a||t instanceof String&&e===a.includes?i:e}},function(t,e,r){r(408);var n=r(19);t.exports=n("Array").includes},function(t,e,r){"use strict";var n=r(0),i=r(81).includes,o=r(77);n({target:"Array",proto:!0},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},function(t,e,r){r(410);var n=r(19);t.exports=n("String").includes},function(t,e,r){"use strict";var n=r(0),i=r(411),o=r(49);n({target:"String",proto:!0,forced:!r(413)("includes")},{includes:function(t){return!!~String(o(this)).indexOf(i(t),arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){var n=r(412);t.exports=function(t){if(n(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,r){var n=r(14),i=r(34),o=r(6)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,r){var n=r(6)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e,r){"use strict";var n=r(1),i=n(r(48)),o=n(r(7)),a=n(r(10)),s=n(r(32)),u=n(r(27)),f=n(r(33)),c=r(9),l=c.CramUnimplementedError,h=c.CramMalformedError,d=c.CramBufferOverrunError,p=r(40),g=r(58).parseItf8,v=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if((0,o.default)(this,e),"int"===(t=(0,s.default)(this,(0,u.default)(e).call(this,r,n))).dataType)t._decodeData=t._decodeInt;else{if("byte"!==t.dataType)throw new l("".concat(t.dataType," decoding not yet implemented by EXTERNAL codec"));t._decodeData=t._decodeByte}return t}return(0,f.default)(e,t),(0,a.default)(e,[{key:"decode",value:function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new h("no block found with content ID ".concat(i));var a=n.externalBlocks.getCursor(i);return this._decodeData(o,a)}},{key:"_decodeInt",value:function(t,e){var r=g(t.content,e.bytePosition),n=(0,i.default)(r,2),o=n[0],a=n[1];return e.bytePosition+=a,o}},{key:"_decodeByte",value:function(t,e){if(e.bytePosition>=t.content.length)throw new d("attempted to read beyond end of block. this file seems truncated.");var r=t.content[e.bytePosition];return e.bytePosition+=1,r}}]),e}(p);t.exports=v},function(t,e,r){"use strict";var n=r(1),i=n(r(101)),o=n(r(7)),a=n(r(10)),s=n(r(32)),u=n(r(27)),f=n(r(33)),c=r(9),l=c.CramBufferOverrunError,h=c.CramMalformedError,d=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if((0,o.default)(this,e),t=(0,s.default)(this,(0,u.default)(e).call(this,r,n)),"byteArray"!==n)throw new TypeError("byteArrayStop codec does not support data type ".concat(n));return t._decode=t._decodeByteArray,t}return(0,f.default)(e,t),(0,a.default)(e,[{key:"decode",value:function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new h("no block found with content ID ".concat(i));var a=n.externalBlocks.getCursor(i);return this._decode(o,a)}},{key:"_decodeByteArray",value:function(t,e){for(var r=t.content,n=this.parameters.stopByte,o=e.bytePosition,a=e.bytePosition;r[a]!==n&&a<r.length;){if(a===r.length)throw new l("byteArrayStop reading beyond length of data buffer?");a+=1}return e.bytePosition=a+1,(0,i.default)(r).call(r,o,a)}}]),e}(r(40));t.exports=d},function(t,e,r){"use strict";var n,i=r(1),o=i(r(17)),a=i(r(7)),s=i(r(10)),u=i(r(32)),f=i(r(27)),c=i(r(33)),l=r(58).tinyMemoize,h=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if((0,a.default)(this,e),(t=(0,u.default)(this,(0,f.default)(e).call(this,r,n))).instantiateCodec=i,"byteArray"!==n)throw new TypeError("byteArrayLength does not support data type ".concat(n));return t}return(0,c.default)(e,t),(0,s.default)(e,[{key:"decode",value:function(t,e,r,n){for(var i=this._getLengthCodec().decode(t,e,r,n),o=this._getDataCodec(),a=new Array(i),s=0;s<i;s+=1)a[s]=o.decode(t,e,r,n);return a}},{key:"_getLengthCodec",value:function(){var t=this.parameters.lengthsEncoding;return this.instantiateCodec(t,"int")}},{key:"_getDataCodec",value:function(){var t=this.parameters.valuesEncoding;return this.instantiateCodec(t,"byte")}}]),e}(r(40));(0,o.default)(n="_getLengthCodec _getDataCodec".split(" ")).call(n,(function(t){return l(h,t)})),t.exports=h},function(t,e,r){"use strict";var n=r(1),i=n(r(7)),o=n(r(10)),a=n(r(32)),s=n(r(27)),u=n(r(33)),f=r(9).CramUnimplementedError,c=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if((0,i.default)(this,e),"int"!==(t=(0,a.default)(this,(0,s.default)(e).call(this,r,n))).dataType)throw new f("".concat(t.dataType," decoding not yet implemented by BETA codec"));return t}return(0,u.default)(e,t),(0,o.default)(e,[{key:"decode",value:function(t,e,r,n){return this._getBits(e.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}]),e}(r(40));t.exports=c},function(t,e,r){"use strict";var n=r(1),i=n(r(7)),o=n(r(10)),a=n(r(32)),s=n(r(27)),u=n(r(33)),f=r(9).CramUnimplementedError,c=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if((0,i.default)(this,e),"int"!==(t=(0,a.default)(this,(0,s.default)(e).call(this,r,n))).dataType)throw new f("".concat(t.dataType," decoding not yet implemented by GAMMA codec"));return t}return(0,u.default)(e,t),(0,o.default)(e,[{key:"decode",value:function(t,e,r,n){for(var i=1;0===this._getBits(e.content,n.coreBlock,1);)i+=1;return(this._getBits(e.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset}}]),e}(r(40));t.exports=c},function(t,e,r){"use strict";var n=r(1),i=n(r(7)),o=n(r(10)),a=n(r(32)),s=n(r(27)),u=n(r(33)),f=r(9).CramUnimplementedError,c=function(t){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if((0,i.default)(this,e),"int"!==(t=(0,a.default)(this,(0,s.default)(e).call(this,r,n))).dataType)throw new f("".concat(t.dataType," decoding not yet implemented by SUBEXP codec"));return t}return(0,u.default)(e,t),(0,o.default)(e,[{key:"decode",value:function(t,e,r,n){for(var i,o,a=0;this._getBits(e.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(e.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(e.content,n.coreBlock,i),o-this.parameters.offset}}]),e}(r(40));t.exports=c},function(t,e,r){"use strict";var n=r(421),i=r(423);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(f),l=["%","/","?",";","#"].concat(c),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(424);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",f=t.split(s);f[0]=f[0].replace(/\\/g,"/");var b=t=f.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||w&&v[w]||(b=b.substr(2),this.slashes=!0)}if(!v[w]&&(E||w&&!y[w])){for(var S,k,A=-1,C=0;C<h.length;C++){-1!==(T=b.indexOf(h[C]))&&(-1===A||T<A)&&(A=T)}-1!==(k=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(S=b.slice(0,k),b=b.slice(k+1),this.auth=decodeURIComponent(S)),A=-1;for(C=0;C<l.length;C++){var T;-1!==(T=b.indexOf(l[C]))&&(-1===A||T<A)&&(A=T)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var O=this.hostname.split(/\./),I=(C=0,O.length);C<I;C++){var L=O[C];if(L&&!L.match(d)){for(var B="",P=0,F=L.length;P<F;P++)L.charCodeAt(P)>127?B+="x":B+=L[P];if(!B.match(d)){var N=O.slice(0,C),M=O.slice(C+1),j=L.match(p);j&&(N.push(j[1]),M.unshift(j[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+z,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[x])for(C=0,I=c.length;C<I;C++){var D=c[C];if(-1!==b.indexOf(D)){var q=encodeURIComponent(D);q===D&&(q=escape(D)),b=b.split(D).join(q)}}var Z=b.indexOf("#");-1!==Z&&(this.hash=b.substr(Z),b=b.slice(0,Z));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,H)):e&&(this.search="",this.query={}),b&&(this.pathname=b),y[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var V=this.search||"";this.path=z+V}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),f=0;f<u.length;f++){var c=u[f];"protocol"!==c&&(r[c]=t[c])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!y[t.protocol]){for(var l=Object.keys(t),h=0;h<l.length;h++){var d=l[h];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||r.host&&t.pathname,x=w,E=r.pathname&&r.pathname.split("/")||[],S=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(S&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),w=w&&(""===p[0]||""===E[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(S)r.hostname=r.host=E.shift(),(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=E.slice(-1)[0],A=(r.host||t.host||E.length>1)&&("."===k||".."===k)||""===k,C=0,T=E.length;T>=0;T--)"."===(k=E[T])?E.splice(T,1):".."===k?(E.splice(T,1),C++):C&&(E.splice(T,1),C--);if(!w&&!x)for(;C--;C)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var R,O=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(r.hostname=r.host=O?"":E.length?E.shift():"",(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift()));return(w=w||r.host&&E.length)&&!O&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,f=36,c=1,l=26,h=38,d=700,p=72,g=128,v="-",y=/^xn--/,m=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=f-c,x=Math.floor,E=String.fromCharCode;function S(t){throw new RangeError(_[t])}function k(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+k((t=t.replace(b,".")).split("."),e).join(".")}function C(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function T(t){return k(t,(function(t){var e="";return t>65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)})).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function O(t,e,r){var n=0;for(t=r?x(t/d):t>>1,t+=x(t/e);t>w*l>>1;n+=f)t=x(t/w);return x(n+(w+1)*t/(t+h))}function I(t){var e,r,n,i,o,a,s,h,d,y,m,b=[],_=t.length,w=0,E=g,k=p;for((r=t.lastIndexOf(v))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&S("not-basic"),b.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<_;){for(o=w,a=1,s=f;i>=_&&S("invalid-input"),((h=(m=t.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:f)>=f||h>x((u-w)/a))&&S("overflow"),w+=h*a,!(h<(d=s<=k?c:s>=k+l?l:s-k));s+=f)a>x(u/(y=f-d))&&S("overflow"),a*=y;k=O(w-o,e=b.length+1,0==o),x(w/e)>u-E&&S("overflow"),E+=x(w/e),w%=e,b.splice(w++,0,E)}return T(b)}function L(t){var e,r,n,i,o,a,s,h,d,y,m,b,_,w,k,A=[];for(b=(t=C(t)).length,e=g,r=0,o=p,a=0;a<b;++a)(m=t[a])<128&&A.push(E(m));for(n=i=A.length,i&&A.push(v);n<b;){for(s=u,a=0;a<b;++a)(m=t[a])>=e&&m<s&&(s=m);for(s-e>x((u-r)/(_=n+1))&&S("overflow"),r+=(s-e)*_,e=s,a=0;a<b;++a)if((m=t[a])<e&&++r>u&&S("overflow"),m==e){for(h=r,d=f;!(h<(y=d<=o?c:d>=o+l?l:d-o));d+=f)k=h-y,w=f-y,A.push(E(R(y+k%w,0))),h=x(k/w);A.push(E(R(h,0))),o=O(r,_,n==i),r=0,++n}++r,++e}return A.join("")}s={version:"1.4.1",ucs2:{decode:C,encode:T},decode:I,encode:L,toASCII:function(t){return A(t,(function(t){return m.test(t)?"xn--"+L(t):t}))},toUnicode:function(t){return A(t,(function(t){return y.test(t)?I(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(422)(t),r(23))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(425),e.encode=e.stringify=r(426)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var f=t.length;u>0&&f>u&&(f=u);for(var c=0;c<f;++c){var l,h,d,p,g=t[c].replace(s,"%20"),v=g.indexOf(r);v>=0?(l=g.substr(0,v),h=g.substr(v+1)):(l=g,h=""),d=decodeURIComponent(l),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";(function(e){var n=r(1),i=n(r(30)),o=n(r(159)),a=n(r(37)),s=n(r(31)),u=n(r(7)),f=n(r(10)),c=r(428),l=r(429),h=function(){function t(e){var r=this;(0,u.default)(this,t),this.position=0,this.url=e,this.cache=new l({fetch:function(t,e){return r._fetch(t,e)}})}var r,n,h;return(0,f.default)(t,[{key:"_fetch",value:(h=(0,s.default)(i.default.mark((function t(r,n){var s,u,f,l,h,d;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u={},n<1/0?u.range=(0,a.default)(f="bytes=".concat(r,"-")).call(f,r+n):n===1/0&&0!==r&&(u.range="bytes=".concat(r,"-")),t.next=4,c(this.url,{method:"GET",headers:u,redirect:"follow",mode:"cors"});case 4:if((200!==(l=t.sent).status||0!==r)&&206!==l.status){t.next=14;break}return t.t0=e,t.next=9,l.arrayBuffer();case 9:return t.t1=t.sent,h=t.t0.from.call(t.t0,t.t1),(d=/\/(\d+)$/.exec(l.headers.get("content-range")))[1]&&(this._stat={size:(0,o.default)(d[1],10)}),t.abrupt("return",h);case 14:throw new Error((0,a.default)(s="HTTP ".concat(l.status," fetching ")).call(s,this.url));case 15:case"end":return t.stop()}}),t,this)}))),function(t,e){return h.apply(this,arguments)})},{key:"read",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n;return null===i&&(i=this.position,this.position+=r),this.cache.get(t,e,r,n)}},{key:"readFile",value:(n=(0,s.default)(i.default.mark((function t(){var r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c(this.url,{method:"GET",redirect:"follow",mode:"cors"});case 2:return r=t.sent,t.t0=e,t.next=6,r.arrayBuffer();case 6:return t.t1=t.sent,t.abrupt("return",t.t0.from.call(t.t0,t.t1));case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"stat",value:(r=(0,s.default)(i.default.mark((function t(){var r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._stat){t.next=6;break}return r=e.allocUnsafe(10),t.next=4,this.read(r,0,10,0);case 4:if(this._stat){t.next=6;break}throw new Error("unable to determine size of file at ".concat(this.url));case 6:return t.abrupt("return",this._stat);case 7:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}]),t}();t.exports=h}).call(this,r(16).Buffer)},function(t,e){var r=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:this);!function(t){!function(e){var r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function l(t){var e=new FileReader,r=c(e);return e.readAsArrayBuffer(t),r}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,e,r,n=f(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=c(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=o(t),e=a(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[o(t)]},u.prototype.get=function(t){return t=o(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},u.prototype.set=function(t,e){this.map[o(t)]=a(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),s(t)},u.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},u.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),s(t)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var r,n,i=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new u(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function y(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];y.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(t,n){return new Promise((function(i,o){var a=new g(t,n);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var n="response"in s?s.response:s.responseText;i(new y(n,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}b.polyfill=!0,t.fetch||(t.fetch=b,t.Headers=u,t.Request=g,t.Response=y),e.Headers=u,e.Request=g,e.Response=y,e.fetch=b}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e},function(t,e,r){"use strict";var n=r(1),i=n(r(30)),o=n(r(17)),a=n(r(75)),s=n(r(31)),u=n(r(7)),f=n(r(10)),c=r(94),l=function(){function t(e){var r=e.fetch,n=e.size,i=void 0===n?1e7:n,o=e.chunkSize,a=void 0===o?32768:o;if((0,u.default)(this,t),!r)throw new Error("fetch function required");this.fetch=r,this.chunkSize=a,this.lruCache=new c({maxSize:Math.floor(i/a)})}var e;return(0,f.default)(t,[{key:"get",value:(e=(0,s.default)(i.default.mark((function t(e,r,n,s){var u,f,c,l,h,d,p,g=this;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.length<r+n)){t.next=2;break}throw new Error("output buffer not big enough for request");case 2:for(u=Math.floor(s/this.chunkSize),f=Math.floor((s+n)/this.chunkSize),c=new Array(f-u+1),l=function(t){c[t-u]=g._getChunk(t).then((function(e){return{data:e,chunkNumber:t}}))},h=u;h<=f;h+=1)l(h);return t.next=9,a.default.all(c);case 9:d=t.sent,p=s-d[0].chunkNumber*this.chunkSize,(0,o.default)(d).call(d,(function(t){var i=t.data,o=t.chunkNumber,a=o*g.chunkSize,c=0,l=g.chunkSize,h=r+(o-u)*g.chunkSize-p;o===u&&(h=r,c=p),o===f&&(l=s+n-a),i.copy(e,h,c,l)}));case 12:case"end":return t.stop()}}),t,this)}))),function(t,r,n,i){return e.apply(this,arguments)})},{key:"_getChunk",value:function(t){var e=this.lruCache.get(t);if(e)return e;var r=this.fetch(t*this.chunkSize,this.chunkSize);return this.lruCache.set(t,r),r}}]),t}();t.exports=l},function(t,e,r){"use strict";var n=r(1),i=n(r(30)),o=n(r(31)),a=n(r(7)),s=n(r(10)),u=(r(161).promisify,null),f=u,c=function(){function t(e){(0,a.default)(this,t),this.position=0,this.filename=e,this.fd=f(this.filename,"r")}var e,r,n;return(0,s.default)(t,[{key:"read",value:(n=(0,o.default)(i.default.mark((function t(e){var r,n,o,a=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:0,n=a.length>2?a[2]:void 0,null===(o=a.length>3?a[3]:void 0)&&(this.position,this.position+=n),t.t0=null,t.next=8,this.fd;case 8:return t.t1=t.sent,t.t2=e,t.t3=r,t.t4=n,t.t5=o,t.abrupt("return",(0,t.t0)(t.t1,t.t2,t.t3,t.t4,t.t5));case 14:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"readFile",value:(r=(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=null,t.next=3,this.fd;case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"stat",value:(e=(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._stat){t.next=8;break}return t.t0=null,t.next=4,this.fd;case 4:return t.t1=t.sent,t.next=7,(0,t.t0)(t.t1);case 7:this._stat=t.sent;case 8:return t.abrupt("return",this._stat);case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}();t.exports=c},function(t,e,r){"use strict";var n=r(1),i=n(r(48)),o=n(r(76)),a=n(r(101)),s=n(r(432)),u=n(r(17));t.exports={parseHeaderText:function(t){var e=t.split(/\r?\n/),r=[];return(0,u.default)(e).call(e,(function(t){var e=t.split(/\t/),n=(0,s.default)(e),u=n[0],f=(0,a.default)(n).call(n,1),c=(0,o.default)(f).call(f,(function(t){var e=t.split(":",2),r=(0,i.default)(e,2);return{tag:r[0],value:r[1]}}));u&&r.push({tag:u.substr(1),data:c})})),r}}},function(t,e,r){var n=r(157),i=r(152),o=r(158);t.exports=function(t){return n(t)||i(t)||o()}},function(t,e,r){"use strict";var n=r(1),i=n(r(30)),o=n(r(103)),a=n(r(150)),s=n(r(48)),u=n(r(102)),f=n(r(17)),c=n(r(59)),l=n(r(75)),h=n(r(37)),d=n(r(76)),p=n(r(434)),g=n(r(31)),v=n(r(7)),y=n(r(10)),m=r(9),b=m.CramUnimplementedError,_=m.CramSizeLimitError,w=r(104),x=function(){function t(e){if((0,v.default)(this,t),e.cram?this.cram=e.cram:this.cram=new w({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof w))throw new Error("invalid arguments: no cramfile");if(this.index=e.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=e.fetchSizeLimit||3e6}var e;return(0,y.default)(t,[{key:"getRecordsForRange",value:(e=(0,g.default)(i.default.mark((function t(e,r,n){var g,v,y,m,w,x,E,S,k,A,C,T,R,O,I,L,B,P,F,N,M,j,z,U,D,q,Z,H,V,G,Y,W,K,Q,X,$=this,J=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((x=J.length>3&&void 0!==J[3]?J[3]:{}).viewAsPairs=x.viewAsPairs||!1,x.pairAcrossChr=x.pairAcrossChr||!1,x.maxInsertSize=x.maxInsertSize||2e5,"string"!=typeof e){t.next=6;break}throw new b("string sequence names not yet supported");case 6:return E=e,t.next=9,this.index.getEntriesForRange(E,r,n);case 9:if(S=t.sent,!((k=(0,p.default)(g=(0,d.default)(S).call(S,(function(t){return t.sliceBytes}))).call(g,(function(t,e){return t+e}),0))>this.fetchSizeLimit)){t.next=13;break}throw new _((0,h.default)(v="data size of ".concat(k.toLocaleString()," bytes exceeded fetch size limit of ")).call(v,this.fetchSizeLimit.toLocaleString()," bytes"));case 13:return A=function(t){return t.sequenceId===e&&t.alignmentStart<=n&&t.alignmentStart+t.lengthOnRef-1>=r},t.next=16,l.default.all((0,d.default)(S).call(S,(function(t){return $.getRecordsInSlice(t,A)})));case 16:if(C=t.sent,T=(m=(0,h.default)(y=Array.prototype)).call.apply(m,(0,h.default)(w=[y]).call(w,(0,c.default)(C))),!x.viewAsPairs){t.next=42;break}for(L={},B={},P=0;P<T.length;P+=1)F=T[P].readName,N=T[P].uniqueId,L[F]||(L[F]=0),L[F]+=1,B[N]=1;for(M={},(0,f.default)(R=(0,u.default)(L)).call(R,(function(t){var e=(0,s.default)(t,2),r=e[0];1===e[1]&&(M[r]=!0)})),j=[],z=0;z<T.length;z+=1)U=T[z].readName,M[U]&&T[z].mate&&(T[z].mate.sequenceId===E||x.pairAcrossChr)&&Math.abs(T[z].alignmentStart-T[z].mate.alignmentStart)<x.maxInsertSize&&(D=this.index.getEntriesForRange(T[z].mate.sequenceId,T[z].mate.alignmentStart,T[z].mate.alignmentStart+1),j.push(D));return t.next=28,l.default.all(j);case 28:for(q=t.sent,Z=[],H=0;H<q.length;H+=1)(V=Z).push.apply(V,(0,c.default)(q[H]));if(Z=(0,a.default)(O=(0,o.default)(Z).call(Z,(function(t,e){return t.toString().localeCompare(e.toString())}))).call(O,(function(t,e,r){return!e||t.toString()!==r[e-1].toString()})),G=[],Y=[],!((W=(0,p.default)(I=(0,d.default)(Z).call(Z,(function(t){return t.sliceBytes}))).call(I,(function(t,e){return t+e}),0))>this.fetchSizeLimit)){t.next=37;break}throw new Error((0,h.default)(K="mate data size of ".concat(W.toLocaleString()," bytes exceeded fetch size limit of ")).call(K,this.fetchSizeLimit.toLocaleString()," bytes"));case 37:return(0,f.default)(Z).call(Z,(function(t){var e=$.cram.featureCache.get(t.toString());e||(e=$.getRecordsInSlice(t,(function(){return!0})),$.cram.featureCache.set(t.toString(),e)),G.push(e);var r=e.then((function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t[r];M[n.readName]&&!B[n.uniqueId]&&e.push(n)}return e}));Y.push(r)})),t.next=40,l.default.all(Y);case 40:(Q=t.sent).length&&(X=(0,p.default)(Q).call(Q,(function(t,e){return(0,h.default)(t).call(t,e)})),T=(0,h.default)(T).call(T,X));case 42:return t.abrupt("return",T);case 43:case"end":return t.stop()}}),t,this)}))),function(t,r,n){return e.apply(this,arguments)})},{key:"getRecordsInSlice",value:function(t,e){var r=t.containerStart,n=t.sliceStart,i=t.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(e)}},{key:"hasDataForReferenceSequence",value:function(t){return this.index.hasDataForReferenceSequence(t)}}]),t}();t.exports=x},function(t,e,r){t.exports=r(435)},function(t,e,r){t.exports=r(436)},function(t,e,r){var n=r(437),i=Array.prototype;t.exports=function(t){var e=t.reduce;return t===i||t instanceof Array&&e===i.reduce?n:e}},function(t,e,r){r(438);var n=r(19);t.exports=n("Array").reduce},function(t,e,r){"use strict";var n=r(0),i=r(439).left;n({target:"Array",proto:!0,forced:r(54)("reduce")},{reduce:function(t){return i(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){var n=r(5),i=r(22),o=r(60),a=r(29),s=function(t){return function(e,r,s,u){n(r);var f=i(e),c=o(f),l=a(f.length),h=t?l-1:0,d=t?-1:1;if(s<2)for(;;){if(h in c){u=c[h],h+=d;break}if(h+=d,t?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;t?h>=0:l>h;h+=d)h in c&&(u=r(u,c[h],h,f));return u}};t.exports={left:s(!1),right:s(!0)}},function(t,e,r){"use strict";var n=r(1),i=n(r(30)),o=n(r(31)),a=n(r(103)),s=n(r(102)),u=n(r(17)),f=n(r(154)),c=n(r(441)),l=n(r(48)),h=n(r(443)),d=n(r(37)),p=n(r(74)),g=n(r(7)),v=n(r(10)),y=r(448).default,m=r(94),b=(0,r(161).promisify)(r(126).gunzip),_=r(160).open,w=r(9).CramMalformedError,x=function(){function t(e){(0,g.default)(this,t),(0,p.default)(this,e)}return(0,v.default)(t,[{key:"toString",value:function(){var t,e,r,n;return(0,d.default)(t=(0,d.default)(e=(0,d.default)(r=(0,d.default)(n="".concat(this.start,":")).call(n,this.span,":")).call(r,this.containerStart,":")).call(e,this.sliceStart,":")).call(t,this.sliceBytes)}}]),t}();function E(t,e){if((0,h.default)(e).call(e,(function(t){return void 0===t})))throw new w("invalid .crai index file");var r=(0,l.default)(e,6),n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5];t[n]||(t[n]=[]),t[n].push(new x({start:i,span:o,containerStart:a,sliceStart:s,sliceBytes:u}))}var S=function(){function t(e){var r,n=this;(0,g.default)(this,t);var i=_(e.url,e.path,e.filehandle);this._parseCache=new y({cache:new m({maxSize:1}),fill:function(t,e){return n.parseIndex({signal:e})}}),this.readFile=(0,c.default)(r=i.readFile).call(r,i)}var e,r;return(0,v.default)(t,[{key:"parseIndex",value:function(){var t={};return this.readFile().then((function(t){return 31===t[0]&&139===t[1]?b(t):t})).then((function(e){var r;if(e.length>4&&21578050===e.readUInt32LE(0))throw new w("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var n=[],i="",o=0;o<e.length;o+=1){var c=e[o];if(c>=48&&c<=57||!i&&45===c)i+=String.fromCharCode(c);else if(9===c)n.push((0,f.default)(i,10)),i="";else if(10===c)n.push((0,f.default)(i,10)),i="",E(t,n),n=[];else if(13!==c&&32!==c)throw new w("invalid .crai index file")}return i&&n.push((0,f.default)(i,10)),6===n.length&&E(t,n),(0,u.default)(r=(0,s.default)(t)).call(r,(function(e){var r=(0,l.default)(e,2),n=r[0],i=r[1];t[n]=(0,a.default)(i).call(i,(function(t,e){return t.start-e.start||t.span-e.span}))})),t}))}},{key:"getIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._parseCache.get("index",null,t.signal)}},{key:"hasDataForReferenceSequence",value:(r=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getIndex();case 2:return t.t0=e,t.abrupt("return",!!t.sent[t.t0]);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"getEntriesForRange",value:(e=(0,o.default)(i.default.mark((function t(e,r,n){var o,a,s,u;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getIndex();case 2:if(t.t0=e,o=t.sent[t.t0]){t.next=6;break}return t.abrupt("return",[]);case 6:for(a=function(t){var e=t.start,i=t.start+t.span;return e>=n?-1:i<=r?1:0},s=[],u=0;u<o.length;u+=1)0===a(o[u])&&s.push(o[u]);return t.abrupt("return",s);case 10:case"end":return t.stop()}}),t,this)}))),function(t,r,n){return e.apply(this,arguments)})}]),t}();t.exports=S},function(t,e,r){t.exports=r(442)},function(t,e,r){t.exports=r(144)},function(t,e,r){t.exports=r(444)},function(t,e,r){t.exports=r(445)},function(t,e,r){var n=r(446),i=Array.prototype;t.exports=function(t){var e=t.some;return t===i||t instanceof Array&&e===i.some?n:e}},function(t,e,r){r(447);var n=r(19);t.exports=n("Array").some},function(t,e,r){"use strict";var n=r(0),i=r(45).some;n({target:"Array",proto:!0,forced:r(54)("some")},{some:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(449));e.default=i.default},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(162),o=n(r(451)),a=function(){function t(t){var e=t.fill,r=t.cache;if("function"!=typeof e)throw new TypeError("must pass a fill function");if("object"!=typeof r)throw new TypeError("must pass a cache object");if("function"!=typeof r.get||"function"!=typeof r.set||"function"!=typeof r.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=r,this.fillCallback=e}return t.isAbortException=function(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message},t.prototype.evict=function(t,e){this.cache.get(t)===e&&this.cache.delete(t)},t.prototype.fill=function(t,e,r){var n=this,i=new o.default,a={aborter:i,promise:this.fillCallback(e,i.signal),settled:!1,get aborted(){return this.aborter.signal.aborted}};a.aborter.addSignal(r),a.aborter.signal.addEventListener("abort",(function(){n.evict(t,a)})),a.promise.then((function(){a.settled=!0}),(function(e){a.settled=!0,n.evict(t,a)})).catch((function(t){throw console.error(t),t})),this.cache.set(t,a)},t.checkSinglePromise=function(t,e){function r(){if(e&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((function(t){return r(),t}),(function(t){throw r(),t}))},t.prototype.has=function(t){return this.cache.has(t)},t.prototype.get=function(e,r,n){if(!n&&r instanceof i.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(e);return o?o.aborted?(this.evict(e,o),this.get(e,r,n)):o.settled?o.promise:(o.aborter.addSignal(n),t.checkSinglePromise(o.promise,n)):(this.fill(e,r,n),t.checkSinglePromise(this.cache.get(e).promise,n))},t.prototype.delete=function(t){var e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))},t.prototype.clear=function(){for(var t=this.cache.keys(),e=0,r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e},t}();e.default=a},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t,e,r){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}Object.defineProperty(e,"__esModule",{value:!0});var c=function(){function t(){n(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(t,[{key:"addEventListener",value:function(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,i=r.length;n<i;n++)if(r[n]===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){var e=this;if(t.type in this.listeners){for(var r=function(r){setTimeout((function(){return r.call(e,t)}))},n=this.listeners[t.type],i=0,o=n.length;i<o;i++)r(n[i]);return!t.defaultPrevented}}}]),t}(),l=function(t){function e(){var t;return n(this,e),(t=function(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?u(t):e}(this,a(e).call(this))).listeners||c.call(u(t)),Object.defineProperty(u(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(u(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,t),o(e,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),f(a(e.prototype),"dispatchEvent",this).call(this,t)}}]),e}(c),h=function(){function t(){n(this,t),Object.defineProperty(this,"signal",{value:new l,writable:!0,configurable:!0})}return o(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(h.prototype[Symbol.toStringTag]="AbortController",l.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortController=h,e.AbortSignal=l,e.abortableFetch=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,i=void 0===n?r.Request:n,o=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:u};var u=i;(u&&!u.prototype.hasOwnProperty("signal")||s)&&((u=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new i(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var f=r;return{fetch:function(t,e){var r=u&&u.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([i,f(t,e)])}return f(t,e)},Request:u}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(162),i=function(){},o=function(){function t(){this.signals=new Set,this.abortController=new n.AbortController}return t.prototype.addSignal=function(t){var e=this;if(void 0===t&&(t=new i),this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):"function"==typeof t.addEventListener&&t.addEventListener("abort",(function(){e.handleAborted(t)}))},t.prototype.handleAborted=function(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()},Object.defineProperty(t.prototype,"signal",{get:function(){return this.abortController.signal},enumerable:!0,configurable:!0}),t.prototype.abort=function(){this.abortController.abort()},t}();e.default=o}]);
|
|
17
|
+
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(12)),u=o(r(65));function c(t,e,r,n){if(!n)throw new a.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==e);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=f.default.BAM_FPAIRED,n.flags&f.default.BAM_FUNMAP&&(r.flags|=f.default.BAM_FMUNMAP),r.flags&f.default.BAM_FUNMAP&&(n.flags|=f.default.BAM_FMUNMAP),n.flags&f.default.BAM_FREVERSE&&(r.flags|=f.default.BAM_FMREVERSE),r.flags&f.default.BAM_FREVERSE&&(n.flags|=f.default.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(t,e,r){var n=function e(r){var n=[r];if(r.mateRecordNumber>=0){var i=t[r.mateRecordNumber];if(!i)throw new a.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push.apply(n,e(i))}return n}(r),i=n.map((function(t){return t.alignmentStart})),o=n.map((function(t){return t.alignmentStart+t.readLength-1})),s=Math.max.apply(Math,o)-Math.min.apply(Math,i)+1;s>=0&&n.forEach((function(t){if(void 0!==t.templateLength)throw new a.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");t.templateLength=s}))}(t,0,r):function(t,e){var r=Math.min(t.alignmentStart,e.alignmentStart),n=Math.max(t.alignmentStart+t.readLength-1,e.alignmentStart+e.readLength-1)-r+1;t.templateLength=n,e.templateLength=n}(r,n)),delete r.mateRecordNumber}var h=function(){function t(t,e){this.container=t,this.file=t.file,this.containerPosition=e}return t.prototype.getHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.file.getSectionParsers()];case 1:return t=n.sent(),[4,this.container.getHeader()];case 2:return e=n.sent(),[4,this.file.readBlock(e._endPosition+this.containerPosition)];case 3:if("MAPPED_SLICE_HEADER"===(r=n.sent()).contentType)r.content=(0,s.parseItem)(r.content,t.cramMappedSliceHeader.parser,0,e._endPosition);else{if("UNMAPPED_SLICE_HEADER"!==r.contentType)throw new a.CramMalformedError("error reading slice header block, invalid content type ".concat(r._contentType));r.content=(0,s.parseItem)(r.content,t.cramUnmappedSliceHeader.parser,0,e._endPosition)}return[2,r]}}))}))},t.prototype.getBlocks=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:t=i.sent(),e=t._endPosition,r=new Array(t.content.numBlocks),n=0,i.label=2;case 2:return n<r.length?(o=r,a=n,[4,this.file.readBlock(e)]):[3,5];case 3:o[a]=i.sent(),e=r[n]._endPosition,i.label=4;case 4:return n+=1,[3,2];case 5:return[2,r]}}))}))},t.prototype.getCoreDataBlock=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getBlocks()];case 1:return[2,t.sent()[0]]}}))}))},t.prototype._getBlocksContentIdIndex=function(){return n(this,void 0,void 0,(function(){var t,e;return i(this,(function(r){switch(r.label){case 0:return[4,this.getBlocks()];case 1:return t=r.sent(),e={},t.forEach((function(t){"EXTERNAL_DATA"===t.contentType&&(e[t.contentId]=t)})),[2,e]}}))}))},t.prototype.getBlockByContentId=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getBlocksContentIdIndex()];case 1:return[2,e.sent()[t]]}}))}))},t.prototype.getReferenceRegion=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:return(t=i.sent().content).refSeqId<0?[2,void 0]:[4,this.container.getCompressionScheme()];case 2:if(e=i.sent(),t.refBaseBlockId>=0){if(!(r=this.getBlockByContentId(t.refBaseBlockId)))throw new a.CramMalformedError("embedded reference specified, but reference block does not exist");if(t.span>r.uncompressedSize)throw new a.CramMalformedError("Embedded reference is too small");return[2,{seq:r.data.toString("utf8"),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}]}if(!e.referenceRequired&&!this.file.fetchReferenceSequenceCallback)return[3,4];if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");return[4,this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1)];case 3:if((n=i.sent()).length!==t.refSeqSpan)throw new a.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return[2,{seq:n,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}];case 4:return[2,void 0]}}))}))},t.prototype.getAllRecords=function(){return this.getRecords((function(){return!0}))},t.prototype._fetchRecords=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,f,h,l,d,p,g,y,v,m,b,_,w=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getDefinition()];case 1:return t=i.sent().majorVersion,[4,this.container.getCompressionScheme()];case 2:return e=i.sent(),[4,this.getHeader()];case 3:return r=i.sent(),[4,this._getBlocksContentIdIndex()];case 4:return n=i.sent(),t>1&&this.file.options.checkSequenceMD5&&r.content.refSeqId>=0&&"0000000000000000"!==r.content.md5.join("")?[4,this.getReferenceRegion()]:[3,6];case 5:if((o=i.sent())&&(f=o.seq,h=o.start,l=o.end,d=(0,s.sequenceMD5)(f),p=r.content.md5.map((function(t){return(t<16?"0":"")+t.toString(16)})).join(""),d!==p))throw new a.CramMalformedError("MD5 checksum reference mismatch for ref ".concat(r.content.refSeqId," pos ").concat(h,"..").concat(l,". recorded MD5: ").concat(p,", calculated MD5: ").concat(d));i.label=6;case 6:return[4,this.getCoreDataBlock()];case 7:for(g=i.sent(),y={lastAlignmentStart:r.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{getCursor:function(t){return this[t]||(this[t]={bitPosition:7,bytePosition:0}),this[t]}}},v=function(t){var r=e.getCodecForDataSeries(t);if(!r)throw new a.CramMalformedError("no codec defined for ".concat(t," data series"));return r.decode(w,g,n,y)},m=new Array(r.content.numRecords),b=0;b<m.length;b+=1)try{m[b]=(0,u.default)(this,v,e,r,g,n,y,t,b),m[b].uniqueId=r.contentPosition+r.content.recordCounter+b+1}catch(t){if(t instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((function(t){return!!t}));break}throw t}for(b=0;b<m.length;b+=1)(_=m[b].mateRecordNumber)>=0&&c(m,b,m[b],m[_]);return[2,m]}}))}))},t.prototype.getRecords=function(t){return n(this,void 0,void 0,(function(){var e,r,o,a,s,f,u,c,h,l,d,p=this;return i(this,(function(g){switch(g.label){case 0:return e=this.container.filePosition+this.containerPosition,(r=this.file.featureCache.get(e))||(r=this._fetchRecords(),this.file.featureCache.set(e,r)),[4,r];case 1:return(o=g.sent().filter(t)).length&&this.file.fetchReferenceSequenceCallback?[4,this.getHeader()]:[3,5];case 2:return(a=g.sent()).content.refSeqId>=0||-2===a.content.refSeqId?(s=a.content.refSeqId>=0?a.content.refSeqId:void 0,[4,this.container.getCompressionScheme()]):[3,5];case 3:for(f=g.sent(),u={},h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])||(d={id:l,start:o[h].alignmentStart,end:-1/0},u[l]=d),(c=o[h].alignmentStart+(o[h].lengthOnRef||o[h].readLength)-1)>d.end&&(d.end=c),o[h].alignmentStart<d.start&&(d.start=o[h].alignmentStart);return[4,Promise.all(Object.values(u).map((function(t){return n(p,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return-1!==t.id&&t.start<=t.end?(e=t,[4,this.file.fetchReferenceSequenceCallback(t.id,t.start,t.end)]):[3,2];case 1:e.seq=r.sent(),r.label=2;case 2:return[2]}}))}))})))];case 4:for(g.sent(),h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])&&d.seq&&o[h].addReferenceSequence(d,f);g.label=5;case 5:return[2,o]}}))}))},t}();e.default=h,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(t){return(0,s.tinyMemoize)(h,t)}))},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(23)),o=r(0),a=n(r(66)),s=n(r(12));function f(t){var e=t.indexOf(0);return-1===e?t.toString("utf8"):t.toString("utf8",0,e)}function u(e,r){if(r.readInt32LE||(r=t.from(r)),"Z"===e)return f(r);if("A"===e)return String.fromCharCode(r[0]);if("I"===e){var n=i.default.fromBytesLE(r);if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new o.CramUnimplementedError("integer overflow");return n.toNumber()}if("i"===e)return r.readInt32LE(0);if("s"===e)return r.readInt16LE(0);if("S"===e)return r.readUInt16LE(0);if("c"===e)return r.readInt8(0);if("C"===e)return r.readUInt8(0);if("f"===e)return r.readFloatLE(0);if("H"===e){var a=f(r);return Number.parseInt(a.replace(/^0x/,""),16)}if("B"===e)return function(t){var e=String.fromCharCode(t[0]),r=t.readInt32LE(1),n={c:["readInt8",1],C:["readUInt8",1],s:["readInt16LE",2],S:["readUInt16LE",2],i:["readInt32LE",4],I:["readUInt32LE",4],f:["readFloatLE",4]}[e];if(!n)throw new o.CramMalformedError("invalid tag value array type '".concat(e,"'"));for(var i=n[0],a=n[1],s=new Array(r),f=5,u=0;u<r;u+=1)s[u]=t[i](f),f+=a;return s}(r);throw new o.CramMalformedError("Unrecognized tag type ".concat(e))}function c(e){if(e instanceof t)return f(e);if(e.length&&e.indexOf){if(!e[e.length-1]){var r=e.indexOf(0);return String.fromCharCode.apply(String,e.slice(0,r))}return String.fromCharCode.apply(String,e)}return String(e)}e.default=function(t,e,r,n,i,f,h,l,d){var p=new a.default;if(p.flags=e("BF"),p.cramFlags=e("CF"),l>1&&-2===n.content.refSeqId?p.sequenceId=e("RI"):p.sequenceId=n.content.refSeqId,p.readLength=e("RL"),p.alignmentStart=e("AP"),r.APdelta&&(p.alignmentStart+=h.lastAlignmentStart),h.lastAlignmentStart=p.alignmentStart,p.readGroupId=e("RG"),r.readNamesIncluded&&(p.readName=c(e("RN"))),p.isDetached()){var g={};g.flags=e("MF"),r.readNamesIncluded||(g.readName=c(e("RN")),p.readName=g.readName),g.sequenceId=e("NS"),g.alignmentStart=e("NP"),(g.flags||g.sequenceId>-1)&&(p.mate=g),p.templateSize=e("TS"),g.flags&s.default.CRAM_M_UNMAP&&(p.flags|=s.default.BAM_FMUNMAP),g.flags&s.default.CRAM_M_REVERSE&&(p.flags|=s.default.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=e("NF")+d+1);var y=e("TL");if(y<0)throw new o.CramMalformedError("invalid TL index");for(var v=r.getTagNames(y),m=v.length,b=0;b<m;b+=1){var _=v[b],w=_.substr(0,2),S=_.substr(2,1),E=r.getCodecForTag(_);if(!E)throw new o.CramMalformedError("no codec defined for auxiliary tag ".concat(_));var A=E.decode(t,i,f,h);p.tags[w]=u(S,A)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(R=new Array(p.readLength),b=0;b<R.length;b+=1)R[b]=e("BA");if(p.readBases=String.fromCharCode.apply(String,R),p.isPreservingQualityScores()){for(b=0;b<R.length;b+=1)R[b]=e("QS");p.qualityScores=R}}else{var C=e("FN");C&&(p.readFeatures=function(t,e,r,n,i){var a=0,s=t.alignmentStart-1,f=new Array(e);function u(t){var e=t[0],n=t[1],i=r(n);return"character"===e?String.fromCharCode(i):"string"===e?i.toString("utf8"):"numArray"===e?i.toArray():i}for(var c=0;c<e;c+=1){var h=String.fromCharCode(r("FC")),l=r("FP"),d={code:h},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[h];if(!p)throw new o.CramMalformedError('invalid read feature code "'.concat(h,'"'));d.data=u(p);var g={B:["number","QS"]}[h];g&&(d.data=[d.data,u(g)]),a+=l,d.pos=a,s+=l,d.refPos=s,"D"===h||"N"===h?s+=d.data:"I"===h||"S"===h?s-=d.data.length:"i"===h&&(s-=1),f[c]=d}return f}(p,C,e,0,l));var B=p.readLength;if(p.readFeatures&&p.readFeatures.forEach((function(t){var e=t.code,r=t.data;"D"===e||"N"===e?B+=r:"I"===e||"S"===e?B-=r.length:"i"===e&&(B-=1)})),Number.isNaN(B)&&(console.warn("".concat(p.readName||"".concat(p.sequenceId,":").concat(p.alignmentStart)," record has invalid read features")),B=p.readLength),p.lengthOnRef=B,p.mappingQuality=e("MQ"),p.isPreservingQualityScores()){for(var R=new Array(p.readLength),b=0;b<R.length;b+=1)R[b]=e("QS");p.qualityScores=R}}return p}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(12));var o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var a=function(){function t(){this.tags={}}return t.prototype.isPaired=function(){return!!(this.flags&i.default.BAM_FPAIRED)},t.prototype.isProperlyPaired=function(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)},t.prototype.isSegmentUnmapped=function(){return!!(this.flags&i.default.BAM_FUNMAP)},t.prototype.isMateUnmapped=function(){return!!(this.flags&i.default.BAM_FMUNMAP)},t.prototype.isReverseComplemented=function(){return!!(this.flags&i.default.BAM_FREVERSE)},t.prototype.isMateReverseComplemented=function(){return!!(this.flags&i.default.BAM_FMREVERSE)},t.prototype.isRead1=function(){return!!(this.flags&i.default.BAM_FREAD1)},t.prototype.isRead2=function(){return!!(this.flags&i.default.BAM_FREAD2)},t.prototype.isSecondary=function(){return!!(this.flags&i.default.BAM_FSECONDARY)},t.prototype.isFailedQc=function(){return!!(this.flags&i.default.BAM_FQCFAIL)},t.prototype.isDuplicate=function(){return!!(this.flags&i.default.BAM_FDUP)},t.prototype.isSupplementary=function(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)},t.prototype.isDetached=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)},t.prototype.hasMateDownStream=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)},t.prototype.isPreservingQualityScores=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)},t.prototype.isUnknownBases=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)},t.prototype.getReadBases=function(){return!this.readBases&&this._refRegion&&(this.readBases=function(t,e){if((t.lengthOnRef||t.readLength)&&!t.isUnknownBases()){var r=t.alignmentStart-e.start;if(!t.readFeatures)return e.seq.substr(r,t.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<t.readLength;)if(o<t.readFeatures.length){var a=t.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),f=String.fromCharCode.apply(String,s);n+=f,i+=f.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<t.readFeatures.length){n+=u=e.seq.substr(i,t.readFeatures[o].pos-n.length-1),i+=u.length}}else{var u;n+=u=e.seq.substr(i,t.readLength-n.length),i+=u.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases},t.prototype.getPairOrientation=function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var t=this.isReverseComplemented()?"R":"F",e=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=t,i[1]=r,i[2]=e,i[3]=n):(i[2]=t,i[3]=r,i[0]=e,i[1]=n),i.join("")}return null},t.prototype.addReferenceSequence=function(t,e){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(t,e,r,n){if(e){var i=n.refPos-e.start,a=e.seq.charAt(i);a&&(n.ref=a);var s=o[a];void 0===s&&(s=4);var f=r.substitutionMatrix[s][n.data];f&&(n.sub=f)}}(0,t,e,r)})),!this.readBases&&t.start<=this.alignmentStart&&t.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=t)},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(e[r]=t[r])})),e.readBases=this.getReadBases(),e},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(68),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var a=function(){function t(t){Object.assign(this,t),this.readNamesIncluded=t.preservation.RN,this.APdelta=t.preservation.AP,this.referenceRequired=!!t.preservation.RR,this.tagIdsDictionary=t.preservation.TD,this.substitutionMatrix=function(t){for(var e=new Array(5),r=0;r<5;r+=1)e[r]=new Array(4);return e[0][t[0]>>6&3]="C",e[0][t[0]>>4&3]="G",e[0][t[0]>>2&3]="T",e[0][t[0]>>0&3]="N",e[1][t[1]>>6&3]="A",e[1][t[1]>>4&3]="G",e[1][t[1]>>2&3]="T",e[1][t[1]>>0&3]="N",e[2][t[2]>>6&3]="A",e[2][t[2]>>4&3]="C",e[2][t[2]>>2&3]="T",e[2][t[2]>>0&3]="N",e[3][t[3]>>6&3]="A",e[3][t[3]>>4&3]="C",e[3][t[3]>>2&3]="G",e[3][t[3]>>0&3]="N",e[4][t[4]>>6&3]="A",e[4][t[4]>>4&3]="C",e[4][t[4]>>2&3]="G",e[4][t[4]>>0&3]="T",e}(t.preservation.SM),this.dataSeriesCodecCache={},this.tagCodecCache={}}return t.prototype.getCodecForTag=function(t){if(!this.tagCodecCache[t]){var e=this.tagEncoding[t];e&&(this.tagCodecCache[t]=(0,i.instantiateCodec)(e,"byteArray"))}return this.tagCodecCache[t]},t.prototype.getTagNames=function(t){return this.tagIdsDictionary[t]},t.prototype.getCodecForDataSeries=function(t){if(!this.dataSeriesCodecCache[t]){var e=this.dataSeriesEncoding[t];if(e){var r=o[t];if(!r)throw new n.CramMalformedError("data series name ".concat(t," not defined in file compression header"));this.dataSeriesCodecCache[t]=(0,i.instantiateCodec)(e,r)}}return this.dataSeriesCodecCache[t]},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(e[r]=t[r])})),e},t}();e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.instantiateCodec=e.getCodecClassWithId=void 0;var i=r(0),o=n(r(69)),a=n(r(70)),s=n(r(71)),f=n(r(72)),u=n(r(73)),c=n(r(74)),h=n(r(75)),l={1:a.default,3:o.default,4:f.default,5:s.default,6:u.default,7:h.default,9:c.default};function d(t){return l[t]}e.getCodecClassWithId=d,e.instantiateCodec=function t(e,r){var n=d("ignore"===r?0:e.codecId);if(!n)throw new i.CramUnimplementedError("no codec implemented for codec ID ".concat(e.codecId));return new n(e.parameters,r,t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0);var s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if(!["byte","int"].includes(n.dataType))throw new TypeError("".concat(n.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return n.buildCodeBook(),n.buildCodes(),n.buildCaches(),0===n.sortedCodes[0].bitLength&&(n._decode=n._decodeZeroLengthCode),n}return i(e,t),e.prototype.buildCodeBook=function(){for(var t=this,e=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)e[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};e=e.sort((function(t,e){return t.bitLength-e.bitLength||t.symbol-e.symbol})),this.codeBook={},e.forEach((function(e){t.codeBook[e.bitLength]||(t.codeBook[e.bitLength]=[]),t.codeBook[e.bitLength].push(e.symbol)}))},e.prototype.buildCodes=function(){var t=this;this.codes={};var e=0,r=-1;Object.entries(this.codeBook).forEach((function(n){var i=n[0],o=n[1];i=parseInt(i,10),o.forEach((function(n){var o={bitLength:i,value:n};r+=1;var s,f,u=i-e;if(r<<=u,o.bitCode=r,e+=u,16843009*((f=(858993459&(f=(s=r)-(s>>1)&1431655765))+(f>>2&858993459))+(f>>4)&252645135)>>24>i)throw new a.CramMalformedError("Symbol out of range");t.codes[n]=o}))}))},e.prototype.buildCaches=function(){this.sortedCodes=Object.values(this.codes).sort((function(t,e){return t.bitLength-e.bitLength||t.bitCode-e.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(t,e){return t.value-e.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(t){return t.value})),this.sortedBitCodes=this.sortedCodes.map((function(t){return t.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(t){return t.bitLength}));var t=Math.max.apply(Math,this.sortedBitCodes);this.bitCodeToValue=new Array(t+1).fill(-1);for(var e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e},e.prototype.decode=function(t,e,r,n){return this._decode(t,e,n.coreBlock)},e.prototype._decodeZeroLengthCode=function(){return this.sortedCodes[0].value},e.prototype._decode=function(t,e,r){for(var n=e.content,i=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var f=this.sortedCodes[s].bitLength;o<<=f-i,o|=this._getBits(n,r,f-i),i=f;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===f)return this.sortedValuesByBitCode[u];for(var c=s;this.sortedCodes[c+1].bitLength===f&&c<this.sortedCodes.length;c+=1)s+=1}throw new a.CramMalformedError("Huffman symbol not found.")},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(3)),f=r(5),u=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"===n.dataType)n._decodeData=n._decodeInt;else{if("byte"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by EXTERNAL codec"));n._decodeData=n._decodeByte}return n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)},e.prototype._decodeInt=function(t,e){var r=(0,f.parseItf8)(t.content,e.bytePosition),n=r[0],i=r[1];return e.bytePosition+=i,n},e.prototype._decodeByte=function(t,e){if(e.bytePosition>=t.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");var r=t.content[e.bytePosition];return e.bytePosition+=1,r},e}(s.default);e.default=u},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("byteArray"!==r)throw new TypeError("byteArrayStop codec does not support data type ".concat(r));return n._decode=n._decodeByteArray,n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)},e.prototype._decodeByteArray=function(t,e){for(var r=t.content,n=this.parameters.stopByte,i=e.bytePosition,o=e.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new a.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return e.bytePosition=o+1,r.slice(i,o)},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(5),s=function(t){function e(e,r,n){void 0===e&&(e={});var i=t.call(this,e,r)||this;if(i.instantiateCodec=n,"byteArray"!==r)throw new TypeError("byteArrayLength does not support data type ".concat(r));return i}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=this._getLengthCodec().decode(t,e,r,n),o=this._getDataCodec(),a=new Array(i),s=0;s<i;s+=1)a[s]=o.decode(t,e,r,n);return a},e.prototype._getLengthCodec=function(){var t=this.parameters.lengthsEncoding;return this.instantiateCodec(t,"int")},e.prototype._getDataCodec=function(){var t=this.parameters.valuesEncoding;return this.instantiateCodec(t,"byte")},e}(o(r(3)).default);e.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((function(t){return(0,a.tinyMemoize)(s,t)}))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by BETA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){return this._getBits(e.content,n.coreBlock,this.parameters.length)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by GAMMA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=1;0===this._getBits(e.content,n.coreBlock,1);)i+=1;return(this._getBits(e.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by SUBEXP codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i,o,a=0;this._getBits(e.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(e.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(e.content,n.coreBlock,i),o-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n=r(77),i=r(79);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),l=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(80);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var b=t=u.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var _=f.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(E||w&&!v[w])){for(var A,C,B=-1,R=0;R<l.length;R++){-1!==(k=b.indexOf(l[R]))&&(-1===B||k<B)&&(B=k)}-1!==(C=-1===B?b.lastIndexOf("@"):b.lastIndexOf("@",B))&&(A=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(A)),B=-1;for(R=0;R<h.length;R++){var k;-1!==(k=b.indexOf(h[R]))&&(-1===B||k<B)&&(B=k)}-1===B&&(B=b.length),this.host=b.slice(0,B),b=b.slice(B),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var M=this.hostname.split(/\./),T=(R=0,M.length);R<T;R++){var I=M[R];if(I&&!I.match(d)){for(var P="",O=0,F=I.length;O<F;O++)I.charCodeAt(O)>127?P+="x":P+=I[O];if(!P.match(d)){var U=M.slice(0,R),L=M.slice(R+1),N=I.match(p);N&&(U.push(N[1]),L.unshift(N[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+z,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[S])for(R=0,T=c.length;R<T;R++){var q=c[R];if(-1!==b.indexOf(q)){var j=encodeURIComponent(q);j===q&&(j=escape(q)),b=b.split(q).join(j)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,W)):e&&(this.search="",this.query={}),b&&(this.pathname=b),v[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var V=this.search||"";this.path=z+V}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var f=Object.keys(t),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=t[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!v[t.protocol]){for(var h=Object.keys(t),l=0;l<h.length;l++){var d=h[l];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||y[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||r.host&&t.pathname,S=w,E=r.pathname&&r.pathname.split("/")||[],A=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),w=w&&(""===p[0]||""===E[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(A)r.hostname=r.host=E.shift(),(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=E.slice(-1)[0],B=(r.host||t.host||E.length>1)&&("."===C||".."===C)||""===C,R=0,k=E.length;k>=0;k--)"."===(C=E[k])?E.splice(k,1):".."===C?(E.splice(k,1),R++):R&&(E.splice(k,1),R--);if(!w&&!S)for(;R--;R)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),B&&"/"!==E.join("/").substr(-1)&&E.push("");var x,M=""===E[0]||E[0]&&"/"===E[0].charAt(0);A&&(r.hostname=r.host=M?"":E.length?E.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift()));return(w=w||r.host&&E.length)&&!M&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,f=2147483647,u=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw RangeError(l[t])}function y(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function m(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function b(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function S(t){var e,r,n,i,o,a,s,u,c,h,l,p=[],y=t.length,v=0,m=128,_=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&g("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=v,a=1,s=36;i>=y&&g("invalid-input"),((u=(l=t.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:36)>=36||u>d((f-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>d(f/(h=36-c))&&g("overflow"),a*=h;_=w(v-o,e=p.length+1,0==o),d(v/e)>f-m&&g("overflow"),m+=d(v/e),v%=e,p.splice(v++,0,m)}return b(p)}function E(t){var e,r,n,i,o,a,s,u,c,h,l,y,v,b,S,E=[];for(y=(t=m(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(l=t[a])<128&&E.push(p(l));for(n=i=E.length,i&&E.push("-");n<y;){for(s=f,a=0;a<y;++a)(l=t[a])>=e&&l<s&&(s=l);for(s-e>d((f-r)/(v=n+1))&&g("overflow"),r+=(s-e)*v,e=s,a=0;a<y;++a)if((l=t[a])<e&&++r>f&&g("overflow"),l==e){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)S=u-h,b=36-h,E.push(p(_(h+S%b,0))),u=d(S/b);E.push(p(_(u,0))),o=w(r,v,n==i),r=0,++n}++r,++e}return E.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:b},decode:S,encode:E,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?S(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(78)(t),r(9))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(81),e.encode=e.stringify=r(82)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=t.length;f>0&&u>f&&(u=f);for(var c=0;c<u;++c){var h,l,d,p,g=t[c].replace(s,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),d=decodeURIComponent(h),p=decodeURIComponent(l),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(84)),s=o(r(85)),f=function(){function e(t){var e=this;this.position=0,this.url=t,this.cache=new s.default({fetch:function(t,r){return e._fetch(t,r)}})}return e.prototype._fetch=function(e,r){return n(this,void 0,void 0,(function(){var n,o,s,f,u,c;return i(this,(function(i){switch(i.label){case 0:return n={},r<1/0?n.range="bytes=".concat(e,"-").concat(e+r):r===1/0&&0!==e&&(n.range="bytes=".concat(e,"-")),[4,(0,a.default)(this.url,{method:"GET",headers:n,redirect:"follow",mode:"cors"})];case 1:return 200===(o=i.sent()).status&&0===e||206===o.status?(u=(f=t).from,[4,o.arrayBuffer()]):[3,3];case 2:return s=u.apply(f,[i.sent()]),(c=/\/(\d+)$/.exec(o.headers.get("content-range")))[1]&&(this._stat={size:parseInt(c[1],10)}),[2,s];case 3:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url))}}))}))},e.prototype.read=function(t,e,r,n){void 0===e&&(e=0),void 0===r&&(r=1/0),void 0===n&&(n=0);return null===n&&(this.position,this.position+=r),this.cache.get(t,e,r,n)},e.prototype.readFile=function(){return n(this,void 0,void 0,(function(){var e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,a.default)(this.url,{method:"GET",redirect:"follow",mode:"cors"})];case 1:return e=i.sent(),n=(r=t).from,[4,e.arrayBuffer()];case 2:return[2,n.apply(r,[i.sent()])]}}))}))},e.prototype.stat=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return this._stat?[3,2]:(e=t.allocUnsafe(10),[4,this.read(e,0,10,0)]);case 1:if(r.sent(),!this._stat)throw new Error("unable to determine size of file at ".concat(this.url));r.label=2;case 2:return[2,this._stat]}}))}))},e}();e.default=f}).call(this,r(1).Buffer)},function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function g(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[u(t)]},l.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},l.prototype.set=function(t,e){this.map[u(t)]=c(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var S=[301,302,303,307,308];w.redirect=function(t,e){if(-1===S.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=l,t.Request=b,t.Response=w),e.Headers=l,e.Request=b,e.Response=w,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(11)),s=function(){function t(t){var e=t.fetch,r=t.size,n=void 0===r?1e7:r,i=t.chunkSize,o=void 0===i?32768:i;if(!e)throw new Error("fetch function required");this.fetch=e,this.chunkSize=o,this.lruCache=new a.default({maxSize:Math.floor(n/o)})}return t.prototype.get=function(t,e,r,o){return n(this,void 0,void 0,(function(){var n,a,s,f,u,c,h,l,d=this;return i(this,(function(i){switch(i.label){case 0:if(t.length<e+r)throw new Error("output buffer not big enough for request");for(n=Math.floor(o/this.chunkSize),a=Math.floor((o+r)/this.chunkSize),s=new Array(a-n+1),f=function(t){s[t-n]=u._getChunk(t).then((function(e){return{data:e,chunkNumber:t}}))},u=this,c=n;c<=a;c+=1)f(c);return[4,Promise.all(s)];case 1:return h=i.sent(),l=o-h[0].chunkNumber*this.chunkSize,h.forEach((function(i){var s=i.data,f=i.chunkNumber,u=f*d.chunkSize,c=0,h=d.chunkSize,p=e+(f-n)*d.chunkSize-l;f===n&&(p=e,c=l),f===a&&(h=o+r-u),s.copy(t,p,c,h)})),[2]}}))}))},t.prototype._getChunk=function(t){var e=this.lruCache.get(t);if(e)return e;var r=this.fetch(t*this.chunkSize,this.chunkSize);return this.lruCache.set(t,r),r},t}();e.default=s},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHeaderText=void 0,e.parseHeaderText=function(t){var e=t.split(/\r?\n/),r=[];return e.forEach((function(t){var e=t.split(/\t/),n=e[0],i=e.slice(1).map((function(t){var e=t.split(":",2);return{tag:e[0],value:e[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(16)),f=function(){function t(t){if(t.cram?this.cram=t.cram:this.cram=new s.default({url:t.cramUrl,path:t.cramPath,filehandle:t.cramFilehandle,seqFetch:t.seqFetch,checkSequenceMD5:t.checkSequenceMD5,cacheSize:t.cacheSize}),!(this.cram instanceof s.default))throw new Error("invalid arguments: no cramfile");if(this.index=t.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=t.fetchSizeLimit||3e6}return t.prototype.getRecordsForRange=function(t,e,r,o){return void 0===o&&(o={}),n(this,void 0,void 0,(function(){var n,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,S,E,A,C,B,R,k,x=this;return i(this,(function(i){switch(i.label){case 0:if(o.viewAsPairs=o.viewAsPairs||!1,o.pairAcrossChr=o.pairAcrossChr||!1,o.maxInsertSize=o.maxInsertSize||2e5,"string"==typeof t)throw new a.CramUnimplementedError("string sequence names not yet supported");return n=t,[4,this.index.getEntriesForRange(n,e,r)];case 1:if(s=i.sent(),(f=s.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new a.CramSizeLimitError("data size of ".concat(f.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return u=function(n){return n.sequenceId===t&&n.alignmentStart<=r&&n.alignmentStart+n.lengthOnRef-1>=e},[4,Promise.all(s.map((function(t){return x.getRecordsInSlice(t,u)})))];case 2:if(c=i.sent(),h=(k=Array.prototype).concat.apply(k,c),!o.viewAsPairs)return[3,5];for(l={},d={},S=0;S<h.length;S+=1)p=h[S].readName,g=h[S].uniqueId,l[p]||(l[p]=0),l[p]+=1,d[g]=1;for(y={},Object.entries(l).forEach((function(t){var e=t[0];1===t[1]&&(y[e]=!0)})),v=[],S=0;S<h.length;S+=1)m=h[S].readName,y[m]&&h[S].mate&&(h[S].mate.sequenceId===n||o.pairAcrossChr)&&Math.abs(h[S].alignmentStart-h[S].mate.alignmentStart)<o.maxInsertSize&&(b=this.index.getEntriesForRange(h[S].mate.sequenceId,h[S].mate.alignmentStart,h[S].mate.alignmentStart+1),v.push(b));return[4,Promise.all(v)];case 3:for(_=i.sent(),w=[],S=0;S<_.length;S+=1)w.push.apply(w,_[S]);if(w=w.sort((function(t,e){return t.toString().localeCompare(e.toString())})).filter((function(t,e,r){return!e||t.toString()!==r[e-1].toString()})),E=[],A=[],(C=w.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new Error("mate data size of ".concat(C.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return w.forEach((function(t){var e=x.cram.featureCache.get(t.toString());e||(e=x.getRecordsInSlice(t,(function(){return!0})),x.cram.featureCache.set(t.toString(),e)),E.push(e);var r=e.then((function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t[r];y[n.readName]&&!d[n.uniqueId]&&e.push(n)}return e}));A.push(r)})),[4,Promise.all(A)];case 4:(B=i.sent()).length&&(R=B.reduce((function(t,e){return t.concat(e)})),h=h.concat(R)),i.label=5;case 5:return[2,h]}}))}))},t.prototype.getRecordsInSlice=function(t,e){var r=t.containerStart,n=t.sliceStart,i=t.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(e)},t.prototype.hasDataForReferenceSequence=function(t){return this.index.hasDataForReferenceSequence(t)},t}();e.default=f},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(90)),s=o(r(11)),f=r(17),u=r(29),c=r(0),h=function(){function t(t){Object.assign(this,t)}return t.prototype.toString=function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)},t}();function l(t,e){if(e.some((function(t){return void 0===t})))throw new c.CramMalformedError("invalid .crai index file");var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5];t[r]||(t[r]=[]),t[r].push(new h({start:n,span:i,containerStart:o,sliceStart:a,sliceBytes:s}))}var d=function(){function t(t){var e=this,r=(0,u.open)(t.url,t.path,t.filehandle);this._parseCache=new a.default({cache:new s.default({maxSize:1}),fill:function(t,r){return e.parseIndex({signal:r})}}),this.readFile=r.readFile.bind(r)}return t.prototype.parseIndex=function(){var t={};return this.readFile().then((function(t){return 31===t[0]&&139===t[1]?(0,f.unzip)(t):t})).then((function(e){if(e.length>4&&21578050===e.readUInt32LE(0))throw new c.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var r=[],n="",i=0;i<e.length;i+=1){var o=e[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",l(t,r),r=[];else if(13!==o&&32!==o)throw new c.CramMalformedError("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&l(t,r),Object.entries(t).forEach((function(e){var r=e[0],n=e[1];t[r]=n.sort((function(t,e){return t.start-e.start||t.span-e.span}))})),t}))},t.prototype.getIndex=function(t){return void 0===t&&(t={}),this._parseCache.get("index",null,t.signal)},t.prototype.hasDataForReferenceSequence=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getIndex()];case 1:return[2,!!e.sent()[t]]}}))}))},t.prototype.getEntriesForRange=function(t,e,r){return n(this,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getIndex()];case 1:if(!(n=i.sent()[t]))return[2,[]];for(o=function(t){var n=t.start,i=t.start+t.span;return n>=r?-1:i<=e?1:0},a=[],s=0;s<n.length;s+=1)0===o(n[s])&&a.push(n[s]);return[2,a]}}))}))},t}();e.default=d},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(91)).default;e.default=i},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(92)),o=n(r(13)),a=n(r(14)),s=n(r(15)),f=r(30),u=n(r(94)),c=n(r(95)),h=function(){function t(e){var r=e.fill,n=e.cache;if((0,o.default)(this,t),(0,s.default)(this,"cache",void 0),(0,s.default)(this,"fillCallback",void 0),"function"!=typeof r)throw new TypeError("must pass a fill function");if("object"!==(0,i.default)(n))throw new TypeError("must pass a cache object");if("function"!=typeof n.get||"function"!=typeof n.set||"function"!=typeof n.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=r}return(0,a.default)(t,[{key:"evict",value:function(t,e){this.cache.get(t)===e&&this.cache.delete(t)}},{key:"fill",value:function(t,e,r,n){var i=this,o=new u.default,a=new c.default;a.addCallback(n);var s={aborter:o,promise:this.fillCallback(e,o.signal,(function(t){a.callback(t)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",(function(){s.settled||i.evict(t,s)})),s.promise.then((function(){s.settled=!0}),(function(e){s.settled=!0,i.evict(t,s)})).catch((function(t){throw console.error(t),t})),this.cache.set(t,s)}},{key:"has",value:function(t){return this.cache.has(t)}},{key:"get",value:function(e,r,n,i){if(!n&&r instanceof f.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(e);return o?o.aborted&&!o.settled?(this.evict(e,o),this.get(e,r,n,i)):o.settled?o.promise:(o.aborter.addSignal(n),o.statusReporter.addCallback(i),t.checkSinglePromise(o.promise,n)):(this.fill(e,r,n,i),t.checkSinglePromise(this.cache.get(e).promise,n))}},{key:"delete",value:function(t){var e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}},{key:"clear",value:function(){for(var t=this.cache.keys(),e=0,r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e}}],[{key:"isAbortException",value:function(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message}},{key:"checkSinglePromise",value:function(t,e){function r(){if(e&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((function(t){return r(),t}),(function(t){throw r(),t}))}}]),t}();e.default=h},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?f(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function h(t,e,r){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(){n(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(t,[{key:"addEventListener",value:function(t,e,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:e,options:r})}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,i=r.length;n<i;n++)if(r[n].callback===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){if(t.type in this.listeners){for(var e=this.listeners[t.type].slice(),r=0,n=e.length;r<n;r++){var i=e[r];try{i.callback.call(this,t)}catch(t){Promise.resolve().then((function(){throw t}))}i.options&&i.options.once&&this.removeEventListener(t.type,i.callback)}return!t.defaultPrevented}}}]),t}(),d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e=c(r);function r(){var t;return n(this,r),(t=e.call(this)).listeners||l.call(f(t)),Object.defineProperty(f(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(f(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return o(r,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),h(a(r.prototype),"dispatchEvent",this).call(this,t)}}]),r}(l),p=function(){function t(){n(this,t),Object.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return o(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortController=p,e.AbortSignal=d,e.abortableFetch=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,i=void 0===n?r.Request:n,o=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:f};var f=i;(f&&!f.prototype.hasOwnProperty("signal")||s)&&((f=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new i(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var u=r;return{fetch:function(t,e){var r=f&&f.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([i,u(t,e)])}return u(t,e)},Request:f}}},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(14)),o=n(r(15)),a=n(r(13)),s=r(30),f=function t(){(0,a.default)(this,t)},u=function(){function t(){(0,a.default)(this,t),(0,o.default)(this,"signals",new Set),(0,o.default)(this,"abortController",new s.AbortController)}return(0,i.default)(t,[{key:"addSignal",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new f;if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):"function"==typeof e.addEventListener&&e.addEventListener("abort",(function(){t.handleAborted(e)}))}},{key:"handleAborted",value:function(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()}},{key:"abort",value:function(){this.abortController.abort()}},{key:"signal",get:function(){return this.abortController.signal}}]),t}();e.default=u},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(13)),o=n(r(14)),a=n(r(15)),s=function(){function t(){(0,i.default)(this,t),(0,a.default)(this,"callbacks",new Set),(0,a.default)(this,"currentMessage",void 0)}return(0,o.default)(t,[{key:"addCallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.callbacks.add(t),t(this.currentMessage)}},{key:"callback",value:function(t){this.currentMessage=t,this.callbacks.forEach((function(e){e(t)}))}}]),t}();e.default=s}]);
|