text: (this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[6],{1118:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(753)),i=n(r(1129)),u=n(r(764)),o=n(r(1131)),s=n(r(1138)),f=n(r(178)),l=n(r(769)),c=n(r(770)),d=n(r(156)),h=n(r(771)),p=n(r(325)),v=n(r(772)),y=n(r(326)),b=n(r(773)),m=n(r(245)),x=n(r(291)),g=n(r(261)),k=n(r(189)),w=n(r(190)),_=n(r(292)),E=n(r(122)),A=n(r(131)),S=n(r(233)),I=n(r(234)),P=n(r(217)),C=n(r(286)),B=r(1165),T=n(r(1166)),R=n(r(1167)),L=r(780);function M(e,t){var r;if("undefined"===typeof o.default||null==(0,u.default)(e)){if((0,i.default)(e)||(r=function(e,t){var r;if(!e)return;if("string"===typeof e)return F(e,t);var n=(0,_.default)(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return(0,s.default)(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(e,t)}(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,f=function(){};return{s:f,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function(){r=(0,a.default)(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){d=!0,l=e},f:function(){try{c||null==r.return||r.return()}finally{if(d)throw l}}}}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){var r=(0,y.default)(e);if(v.default){var n=(0,v.default)(e);t&&(n=(0,p.default)(n).call(n,(function(t){return(0,h.default)(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)(0,d.default)(r=O(Object(n),!0)).call(r,(function(t){(0,x.default)(e,t,n[t])}));else if(c.default)(0,l.default)(e,(0,c.default)(n));else{var a;(0,d.default)(a=O(Object(n))).call(a,(function(t){(0,f.default)(e,t,(0,h.default)(n,t))}))}}return e}function U(e){var t=function(){if("undefined"===typeof Reflect||!b.default)return!1;if(b.default.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call((0,b.default)(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,P.default)(e);if(t){var a=(0,P.default)(this).constructor;r=(0,b.default)(n,arguments,a)}else r=n.apply(this,arguments);return(0,I.default)(this,r)}}var z=21578050;function q(e,t){return e-e%t}function j(e,t){return e-e%t+t}var N=function(e){(0,S.default)(r,e);var t=U(r);function r(){return(0,E.default)(this,r),t.apply(this,arguments)}return(0,A.default)(r,[{key:"parsePseudoBin",value:function(e,t){return{lineCount:(0,L.longToNumber)(C.default.fromBytesLE((0,_.default)(Array.prototype).call(e,t+16,t+24),!0))}}},{key:"lineCount",value:function(){var e=(0,w.default)(k.default.mark((function e(t){var r,n,a,i,u=arguments;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},e.next=3,this.parse(r);case 3:if(n=e.sent,a=n.indices[t]){e.next=7;break}return e.abrupt("return",-1);case 7:return i=a.stats||{},e.abrupt("return",void 0===i.lineCount?-1:i.lineCount);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_parse",value:function(){var e=(0,w.default)(k.default.mark((function e(){var t,r,n,a,i,u,o,s,f,l,c,d,h,p,v,y,b,m,x,g=arguments;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g.length>0&&void 0!==g[0]?g[0]:{},r={bai:!0,maxBlockSize:65536},e.next=4,this.filehandle.readFile(t);case 4:if((n=e.sent).readUInt32LE(0)===z){e.next=7;break}throw new Error("Not a BAI file");case 7:r.refCount=n.readInt32LE(4),a=((1<<3*(5+1))-1)/7,r.indices=new Array(r.refCount),i=8,u=0;case 13:if(!(u<r.refCount)){e.next=50;break}return e.next=16,(0,L.abortBreakPoint)(t.signal);case 16:o=n.readInt32LE(i),s=void 0,i+=4,f={},l=0;case 21:if(!(l<o)){e.next=42;break}if(c=n.readUInt32LE(i),i+=4,c!==a+1){e.next=30;break}i+=4,s=this.parsePseudoBin(n,i),i+=32,e.next=39;break;case 30:if(!(c>a+1)){e.next=34;break}throw new Error("bai index contains too many bins, please use CSI");case 34:for(d=n.readInt32LE(i),i+=4,h=new Array(d),p=0;p<d;p+=1)v=(0,B.fromBytes)(n,i),y=(0,B.fromBytes)(n,i+8),i+=16,this._findFirstData(r,v),h[p]=new T.default(v,y,c);f[c]=h;case 39:l+=1,e.next=21;break;case 42:for(b=n.readInt32LE(i),i+=4,m=new Array(b),x=0;x<b;x+=1)m[x]=(0,B.fromBytes)(n,i),i+=8,this._findFirstData(r,m[x]);r.indices[u]={binIndex:f,linearIndex:m,stats:s};case 47:u+=1,e.next=13;break;case 50:return e.abrupt("return",r);case 51:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"indexCov",value:function(){var e=(0,w.default)(k.default.mark((function e(t,r,n){var a,i,u,o,s,f,l,c,d,h,p,v,y,b,m,x=arguments;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=x.length>3&&void 0!==x[3]?x[3]:{},i=16384,u=void 0!==r,e.next=5,this.parse(a);case 5:if(o=e.sent,s=o.indices[t]){e.next=9;break}return e.abrupt("return",[]);case 9:if(f=s.linearIndex,l=void 0===f?[]:f,c=s.stats,l.length){e.next=12;break}return e.abrupt("return",[]);case 12:if(d=void 0!==n?j(n,i):(l.length-1)*i,h=void 0!==r?q(r,i):0,p=new Array(u?(d-h)/i:l.length-1),v=l[l.length-1].blockPosition,!(d>(l.length-1)*i)){e.next=18;break}throw new Error("query outside of range of linear index");case 18:for(y=l[h/i].blockPosition,b=h/i,m=0;b<d/i;b++,m++)p[m]={score:l[b+1].blockPosition-y,start:b*i,end:b*i+i},y=l[b+1].blockPosition;return e.abrupt("return",(0,g.default)(p).call(p,(function(e){return D(D({},e),{},{score:e.score*c.lineCount/v})})));case 21:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"reg2bins",value:function(e,t){return[[0,0],[1+(e>>26),1+((t-=1)>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}},{key:"blocksForRange",value:function(){var e=(0,w.default)(k.default.mark((function e(t,r,n){var a,i,u,o,s,f,l,c,d,h,p,v,y,b,x,g,w,_,E,A=arguments;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=A.length>3&&void 0!==A[3]?A[3]:{},r<0&&(r=0),e.next=4,this.parse(a);case 4:if(i=e.sent){e.next=7;break}return e.abrupt("return",[]);case 7:if(u=i.indices[t]){e.next=10;break}return e.abrupt("return",[]);case 10:o=this.reg2bins(r,n),s=[],f=M(o);try{for(f.s();!(l=f.n()).done;)for(c=(0,m.default)(l.value,2),d=c[0],h=c[1],p=d;p<=h;p++)if(u.binIndex[p])for(v=u.binIndex[p],y=0;y<v.length;++y)s.push(new T.default(v[y].minv,v[y].maxv,p))}catch(k){f.e(k)}finally{f.f()}for(b=u.linearIndex.length,x=null,g=Math.min(r>>14,b-1),w=Math.min(n>>14,b-1),_=g;_<=w;++_)(E=u.linearIndex[_])&&(!x||E.compareTo(x)<0)&&(x=E);return e.abrupt("return",(0,L.optimizeChunks)(s,x));case 20:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()}]),r}(R.default);t.default=N},1129:function(e,t,r){e.exports=r(1857)},1131:function(e,t,r){e.exports=r(1860)},1138:function(e,t,r){e.exports=r(1876)},1143:function(e,t,r){r(1892);var n=r(127).Object,a=e.exports=function(e,t){return n.getOwnPropertyDescriptor(e,t)};n.getOwnPropertyDescriptor.sham&&(a.sham=!0)},1144:function(e,t,r){r(1135);var n=r(127);e.exports=n.Object.getOwnPropertySymbols},1165:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.fromBytes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r)throw new Error("big-endian virtual file offsets not implemented");return new s(1099511627776*e[t+7]+4294967296*e[t+6]+16777216*e[t+5]+65536*e[t+4]+256*e[t+3]+e[t+2],e[t+1]<<8|e[t])},t.default=void 0;var a=n(r(202)),i=n(r(122)),u=n(r(131)),o=n(r(291)),s=function(){function e(t,r){(0,i.default)(this,e),(0,o.default)(this,"blockPosition",void 0),(0,o.default)(this,"dataPosition",void 0),this.blockPosition=t,this.dataPosition=r}return(0,u.default)(e,[{key:"toString",value:function(){var e;return(0,a.default)(e="".concat(this.blockPosition,":")).call(e,this.dataPosition)}},{key:"compareTo",value:function(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}],[{key:"min",value:function(){for(var e,t=0,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];for(;!e;t+=1)e=n[t];for(;t<n.length;t+=1)e.compareTo(n[t])>0&&(e=n[t]);return e}}]),e}();t.default=s},1166:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(202)),i=n(r(122)),u=n(r(131)),o=n(r(291)),s=function(){function e(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;(0,i.default)(this,e),(0,o.default)(this,"minv",void 0),(0,o.default)(this,"maxv",void 0),(0,o.default)(this,"bin",void 0),(0,o.default)(this,"_fetchedSize",void 0),this.minv=t,this.maxv=r,this.bin=n,this._fetchedSize=a}return(0,u.default)(e,[{key:"toUniqueString",value:function(){var e,t,r;return(0,a.default)(e=(0,a.default)(t=(0,a.default)(r="".concat(this.minv,"..")).call(r,this.maxv," (bin ")).call(t,this.bin,", fetchedSize ")).call(e,this.fetchedSize(),")")}},{key:"toString",value:function(){return this.toUniqueString()}},{key:"compareTo",value:function(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}},{key:"fetchedSize",value:function(){return void 0!==this._fetchedSize?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}]),e}();t.default=s},1167:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(178)),i=n(r(769)),u=n(r(770)),o=n(r(156)),s=n(r(771)),f=n(r(325)),l=n(r(772)),c=n(r(326)),d=n(r(189)),h=n(r(190)),p=n(r(122)),v=n(r(131)),y=n(r(291)),b=n(r(176)),m=n(r(284));function x(e,t){var r=(0,c.default)(e);if(l.default){var n=(0,l.default)(e);t&&(n=(0,f.default)(n).call(n,(function(t){return(0,s.default)(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)(0,o.default)(r=x(Object(n),!0)).call(r,(function(t){(0,y.default)(e,t,n[t])}));else if(u.default)(0,i.default)(e,(0,u.default)(n));else{var f;(0,o.default)(f=x(Object(n))).call(f,(function(t){(0,a.default)(e,t,(0,s.default)(n,t))}))}}return e}var k=function(){function e(t){var r=t.filehandle,n=t.renameRefSeq,a=void 0===n?function(e){return e}:n;(0,p.default)(this,e),(0,y.default)(this,"filehandle",void 0),(0,y.default)(this,"renameRefSeq",void 0),(0,y.default)(this,"_parseCache",void 0),this.filehandle=r,this.renameRefSeq=a}return(0,v.default)(e,[{key:"_findFirstData",value:function(e,t){var r=e.firstDataLine;e.firstDataLine=r?r.compareTo(t)>0?t:r:t}},{key:"parse",value:function(){var e=(0,h.default)(d.default.mark((function e(){var t,r=this,n=arguments;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},this._parseCache||(this._parseCache=new b.default({cache:new m.default({maxSize:1}),fill:function(e,t){return r._parse(g(g({},e),{},{signal:t}))}})),e.abrupt("return",this._parseCache.get("index",t,t.signal));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"hasRefSeq",value:function(){var e=(0,h.default)(d.default.mark((function e(t){var r,n=arguments;return d.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.next=3,this.parse(r);case 3:if(e.t1=t,e.t0=e.sent.indices[e.t1],e.t0){e.next=7;break}e.t0={};case 7:return e.abrupt("return",!!e.t0.binIndex);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();t.default=k},1170:function(e,t,r){"use strict";var n=r(1171),a=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(753)),u=a(r(1129)),o=a(r(764)),s=a(r(1131)),f=a(r(1138)),l=a(r(773)),c=a(r(202)),d=a(r(245)),h=a(r(292)),p=a(r(452)),v=a(r(189)),y=a(r(190)),b=a(r(122)),m=a(r(131)),x=a(r(779)),g=a(r(233)),k=a(r(234)),w=a(r(217)),_=a(r(291)),E=a(r(286)),A=r(328),S=n(r(1165)),I=a(r(1166)),P=r(780),C=a(r(1167));function B(e,t){var r;if("undefined"===typeof s.default||null==(0,o.default)(e)){if((0,u.default)(e)||(r=function(e,t){var r;if(!e)return;if("string"===typeof e)return T(e,t);var n=(0,h.default)(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return(0,f.default)(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(e,t)}(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function(){r=(0,i.default)(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){d=!0,l=e},f:function(){try{c||null==r.return||r.return()}finally{if(d)throw l}}}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e){var t=function(){if("undefined"===typeof Reflect||!l.default)return!1;if(l.default.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call((0,l.default)(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,w.default)(e);if(t){var a=(0,w.default)(this).constructor;r=(0,l.default)(n,arguments,a)}else r=n.apply(this,arguments);return(0,k.default)(this,r)}}function L(e,t){return Math.floor(e/Math.pow(2,t))}var M=function(e){(0,g.default)(r,e);var t=R(r);function r(e){var n;return(0,b.default)(this,r),n=t.call(this,e),(0,_.default)((0,x.default)(n),"maxBinNumber",void 0),(0,_.default)((0,x.default)(n),"depth",void 0),(0,_.default)((0,x.default)(n),"minShift",void 0),n.maxBinNumber=0,n.depth=0,n.minShift=0,n}return(0,m.default)(r,[{key:"lineCount",value:function(){var e=(0,y.default)(v.default.mark((function e(t){var r,n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.parse();case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return",-1);case 5:if(r.indices[t]){e.next=8;break}return e.abrupt("return",-1);case 8:if(!(n=r.indices[t].stats)){e.next=11;break}return e.abrupt("return",n.lineCount);case 11:return e.abrupt("return",-1);case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"indexCov",value:function(){var e=(0,y.default)(v.default.mark((function e(){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",[]);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"parseAuxData",value:function(e,t,r){if(r<30)return{};var n={};if(n.formatFlags=e.readInt32LE(t),n.coordinateType=65536&n.formatFlags?"zero-based-half-open":"1-based-closed",n.format={0:"generic",1:"SAM",2:"VCF"}[15&n.formatFlags],!n.format)throw new Error("invalid Tabix preset format flags ".concat(n.formatFlags));n.columnNumbers={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},n.metaValue=e.readInt32LE(t+16),n.metaChar=n.metaValue?String.fromCharCode(n.metaValue):"",n.skipLines=e.readInt32LE(t+20);var a=e.readInt32LE(t+24);return(0,p.default)(n,this._parseNameBytes((0,h.default)(e).call(e,t+28,t+28+a))),n}},{key:"_parseNameBytes",value:function(e){for(var t=0,r=0,n=[],a={},i=0;i<e.length;i+=1)if(!e[i]){if(r<i){var u=e.toString("utf8",r,i);u=this.renameRefSeq(u),n[t]=u,a[u]=t}r=i+1,t+=1}return{refNameToId:a,refIdToName:n}}},{key:"_parse",value:function(){var e=(0,y.default)(v.default.mark((function e(t){var r,n,a,i,u,o,s,f,l,c,d,h,y,b,m,x,g;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={csi:!0,maxBlockSize:65536},e.next=3,this.filehandle.readFile(t);case 3:return n=e.sent,e.next=6,(0,A.unzip)(n);case 6:if(21582659!==(a=e.sent).readUInt32LE(0)){e.next=11;break}r.csiVersion=1,e.next=16;break;case 11:if(38359875!==a.readUInt32LE(0)){e.next=15;break}r.csiVersion=2,e.next=16;break;case 15:throw new Error("Not a CSI file");case 16:this.minShift=a.readInt32LE(4),this.depth=a.readInt32LE(8),this.maxBinNumber=((1<<3*(this.depth+1))-1)/7,(i=a.readInt32LE(12))&&(0,p.default)(r,this.parseAuxData(a,16,i)),r.refCount=a.readInt32LE(16+i),r.indices=new Array(r.refCount),u=16+i+4,o=0;case 25:if(!(o<r.refCount)){e.next=37;break}return e.next=28,(0,P.abortBreakPoint)(t.signal);case 28:for(s=a.readInt32LE(u),u+=4,f={},l=void 0,c=0;c<s;c+=1)if((d=a.readUInt32LE(u))>this.maxBinNumber)l=this.parsePseudoBin(a,u+4),u+=48;else{for(h=(0,S.fromBytes)(a,u+4),this._findFirstData(r,h),y=a.readInt32LE(u+12),u+=16,b=new Array(y),m=0;m<y;m+=1)x=(0,S.fromBytes)(a,u),g=(0,S.fromBytes)(a,u+8),u+=16,b[m]=new I.default(x,g,d);f[d]=b}r.indices[o]={binIndex:f,stats:l};case 34:o+=1,e.next=25;break;case 37:return e.abrupt("return",r);case 38:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"parsePseudoBin",value:function(e,t){return{lineCount:(0,P.longToNumber)(E.default.fromBytesLE((0,h.default)(Array.prototype).call(e,t+28,t+36),!0))}}},{key:"blocksForRange",value:function(){var e=(0,y.default)(v.default.mark((function e(t,r,n){var a,i,u,o,s,f,l,c,h,p,y,b,m,x=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=x.length>3&&void 0!==x[3]?x[3]:{},r<0&&(r=0),e.next=4,this.parse(a);case 4:if(i=e.sent){e.next=7;break}return e.abrupt("return",[]);case 7:if(u=i.indices[t]){e.next=10;break}return e.abrupt("return",[]);case 10:o=this.reg2bins(r,n),s=[],f=B(o);try{for(f.s();!(l=f.n()).done;)for(c=(0,d.default)(l.value,2),h=c[0],p=c[1],y=h;y<=p;y++)if(u.binIndex[y])for(b=u.binIndex[y],m=0;m<b.length;++m)s.push(new I.default(b[m].minv,b[m].maxv,y))}catch(v){f.e(v)}finally{f.f()}return e.abrupt("return",(0,P.optimizeChunks)(s,new S.default(0,0)));case 15:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"reg2bins",value:function(e,t){(e-=1)<1&&(e=1),t>Math.pow(2,50)&&(t=Math.pow(2,34)),t-=1;for(var r,n=0,a=0,i=this.minShift+3*this.depth,u=[];n<=this.depth;i-=3,a+=(r=3*n,1*Math.pow(2,r)),n+=1){var o,s,f,l=a+L(e,i),d=a+L(t,i);if(d-l+u.length>this.maxBinNumber)throw new Error((0,c.default)(o=(0,c.default)(s=(0,c.default)(f="query ".concat(e,"-")).call(f,t," is too large for current binning scheme (shift ")).call(s,this.minShift,", depth ")).call(o,this.depth,"), try a smaller query or a coarser index binning scheme"));u.push([l,d])}return u}}]),r}(C.default);t.default=M},1171:function(e,t,r){var n=r(1961),a=r(775),i=r(1164),u=r(1963);function o(){if("function"!==typeof u)return null;var e=new u;return o=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!==typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},u=a&&n;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var f=u?n(e,s):null;f&&(f.get||f.set)?a(r,s,f):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}},1178:function(e,t,r){"use strict";(function(e){var n=r(107);r(178)(t,"__esModule",{value:!0}),t.default=t.BAM_MAGIC=void 0;var a=n(r(1979)),i=n(r(451)),u=n(r(325)),o=n(r(245)),s=n(r(156)),f=n(r(327)),l=n(r(261)),c=n(r(1179)),d=n(r(202)),h=n(r(189)),p=n(r(292)),v=n(r(190)),y=n(r(1180)),b=n(r(122)),m=n(r(131)),x=n(r(291)),g=n(r(1182)),k=n(r(1185)),w=n(r(1186)),_=n(r(1187)),E=n(r(176)),A=n(r(1118)),S=n(r(1170)),I=n(r(1188)),P=r(328),C=n(r(1031)),B=n(r(284)),T=r(357),R=n(r(1189)),L=r(1192),M=r(780),F=21840194;t.BAM_MAGIC=F;var O=65536,D=function(){function t(e){var r,n=e.bamFilehandle,a=e.bamPath,i=e.bamUrl,u=e.baiPath,o=e.baiFilehandle,s=e.baiUrl,f=e.csiPath,l=e.csiFilehandle,c=e.csiUrl,d=e.cacheSize,h=e.fetchSizeLimit,p=e.chunkSizeLimit,v=e.yieldThreadTime,m=void 0===v?100:v,g=e.renameRefSeqs,k=void 0===g?function(e){return e}:g;if((0,b.default)(this,t),(0,x.default)(this,"renameRefSeq",void 0),(0,x.default)(this,"bam",void 0),(0,x.default)(this,"index",void 0),(0,x.default)(this,"chunkSizeLimit",void 0),(0,x.default)(this,"fetchSizeLimit",void 0),(0,x.default)(this,"header",void 0),(0,x.default)(this,"featureCache",void 0),(0,x.default)(this,"chrToIndex",void 0),(0,x.default)(this,"indexToChr",void 0),(0,x.default)(this,"yieldThreadTime",void 0),this.renameRefSeq=k,n)this.bam=n;else if(a)this.bam=new T.LocalFile(a);else{if(!i)throw new Error("unable to initialize bam");this.bam=new T.RemoteFile(i)}if(l)this.index=new S.default({filehandle:l});else if(f)this.index=new S.default({filehandle:new T.LocalFile(f)});else if(c)this.index=new S.default({filehandle:new T.RemoteFile(c)});else if(o)this.index=new A.default({filehandle:o});else if(u)this.index=new A.default({filehandle:new T.LocalFile(u)});else if(s)this.index=new A.default({filehandle:new T.RemoteFile(s)});else if(a)this.index=new A.default({filehandle:new T.LocalFile("".concat(a,".bai"))});else{if(!i)throw new Error("unable to infer index format");this.index=new A.default({filehandle:new T.RemoteFile("".concat(i,".bai"))})}this.featureCache=new E.default({cache:new B.default({maxSize:void 0!==d?d:50}),fill:(0,y.default)(r=this._readChunk).call(r,this)}),this.fetchSizeLimit=h||5e8,this.chunkSizeLimit=p||3e8,this.yieldThreadTime=m}return(0,m.default)(t,[{key:"getHeader",value:function(){var t=(0,v.default)(h.default.mark((function t(){var r,n,a,i,u,o,s,f,l,c,d,v,y=arguments;return h.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=y.length>0&&void 0!==y[0]?y[0]:{},n=(0,M.makeOpts)(r),t.next=4,this.index.parse(n);case 4:if(a=t.sent,!(i=a.firstDataLine?a.firstDataLine.blockPosition+65535:void 0)){t.next=17;break}return t.next=9,this.bam.read(e.alloc(i+O),0,i+O,0,n);case 9:if(o=t.sent,s=o.bytesRead,u=o.buffer,s){t.next=14;break}throw new Error("Error reading header");case 14:u=s<i?(0,p.default)(u).call(u,0,s):(0,p.default)(u).call(u,0,i),t.next=20;break;case 17:return t.next=19,this.bam.readFile(n);case 19:u=t.sent;case 20:return t.next=22,(0,P.unzip)(u);case 22:if((f=t.sent).readInt32LE(0)===F){t.next=25;break}throw new Error("Not a BAM file");case 25:return l=f.readInt32LE(4),this.header=f.toString("utf8",8,8+l),t.next=29,this._readRefSeqs(l+8,65535,n);case 29:return c=t.sent,d=c.chrToIndex,v=c.indexToChr,this.chrToIndex=d,this.indexToChr=v,t.abrupt("return",(0,L.parseHeaderText)(this.header));case 35:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getHeaderText",value:function(){var e=(0,v.default)(h.default.mark((function e(){var t,r=arguments;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.next=3,this.getHeader(t);case 3:return e.abrupt("return",this.header);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_readRefSeqs",value:function(){var t=(0,v.default)(h.default.mark((function t(r,n){var a,i,u,o,s,f,l,c,d,v,y,b,m,x=arguments;return h.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=x.length>2&&void 0!==x[2]?x[2]:{},!(r>n)){t.next=3;break}return t.abrupt("return",this._readRefSeqs(r,2*n,a));case 3:return t.next=5,this.bam.read(e.alloc(n+O),0,n,0,a);case 5:if(i=t.sent,u=i.bytesRead,o=i.buffer,u){t.next=10;break}throw new Error("Error reading refseqs from header");case 10:return o=u<n?(0,p.default)(o).call(o,0,u):(0,p.default)(o).call(o,0,n),t.next=13,(0,P.unzip)(o);case 13:s=t.sent,f=s.readInt32LE(r),l=r+4,c={},d=[],v=0;case 19:if(!(v<f)){t.next=35;break}return t.next=22,(0,M.abortBreakPoint)(a.signal);case 22:if(y=s.readInt32LE(l),b=s.toString("utf8",l+4,l+4+y-1),b=this.renameRefSeq(b),m=s.readInt32LE(l+y+4),c[b]=v,d.push({refName:b,length:m}),!((l=l+8+y)>s.length)){t.next=32;break}return console.warn("BAM header is very big.  Re-fetching ".concat(n," bytes.")),t.abrupt("return",this._readRefSeqs(r,2*n,a));case 32:v+=1,t.next=19;break;case 35:return t.abrupt("return",{chrToIndex:c,indexToChr:d});case 36:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}()},{key:"getRecordsForRange",value:function(){var e=(0,v.default)(h.default.mark((function e(t,r,n){var a,i,u,o,s,f,l,c,p,v=arguments;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=v.length>3&&void 0!==v[3]?v[3]:{viewAsPairs:!1,pairAcrossChr:!1,maxInsertSize:2e5},i=[],u=!0,o=!1,e.prev=4,f=(0,_.default)(this.streamRecordsForRange(t,r,n,a));case 6:return e.next=8,f.next();case 8:return l=e.sent,u=l.done,e.next=12,l.value;case 12:if(c=e.sent,u){e.next=19;break}p=c,i=(0,d.default)(i).call(i,p);case 16:u=!0,e.next=6;break;case 19:e.next=25;break;case 21:e.prev=21,e.t0=e.catch(4),o=!0,s=e.t0;case 25:if(e.prev=25,e.prev=26,u||null==f.return){e.next=30;break}return e.next=30,f.return();case 30:if(e.prev=30,!o){e.next=33;break}throw s;case 33:return e.finish(30);case 34:return e.finish(25);case 35:return e.abrupt("return",i);case 36:case"end":return e.stop()}}),e,this,[[4,21,25,35],[26,,30,34]])})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"streamRecordsForRange",value:function(e,t,r){var n=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{viewAsPairs:!1,pairAcrossChr:!1,maxInsertSize:2e5};return(0,g.default)(h.default.mark((function i(){var u,o,s,f,p,v,y,b;return h.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a.viewAsPairs=a.viewAsPairs||!1,a.pairAcrossChr=a.pairAcrossChr||!1,a.maxInsertSize=void 0!==a.maxInsertSize?a.maxInsertSize:2e5,(o=n.chrToIndex&&n.chrToIndex[e])>=0){i.next=8;break}s=[],i.next=13;break;case 8:return i.next=10,(0,k.default)(n.index.blocksForRange(o,t-1,r,a));case 10:if(s=i.sent){i.next=13;break}throw new Error("Error in index fetch");case 13:f=0;case 14:if(!(f<s.length)){i.next=23;break}return i.next=17,(0,k.default)((0,M.abortBreakPoint)(a.signal));case 17:if(!((p=s[f].fetchedSize())>n.chunkSizeLimit)){i.next=20;break}throw new Error((0,d.default)(v="Too many BAM features. BAM chunk size ".concat(p," bytes exceeds chunkSizeLimit of ")).call(v,n.chunkSizeLimit));case 20:f+=1,i.next=14;break;case 23:if(!((y=(0,c.default)(u=(0,l.default)(s).call(s,(function(e){return e.fetchedSize()}))).call(u,(function(e,t){return e+t}),0))>n.fetchSizeLimit)){i.next=26;break}throw new Error((0,d.default)(b="data size of ".concat(y.toLocaleString()," bytes exceeded fetch size limit of ")).call(b,n.fetchSizeLimit.toLocaleString()," bytes"));case 26:return i.delegateYield((0,w.default)((0,_.default)(n._fetchChunkFeatures(s,o,t,r,a)),k.default),"t0",27);case 27:case"end":return i.stop()}}),i)})))()}},{key:"_fetchChunkFeatures",value:function(e,t,r,n,a){var i=this;return(0,g.default)(h.default.mark((function u(){var o,s,f,l,c,d,p,v,y,b,m;return h.default.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:o=[],s=!1,f=0;case 3:if(!(f<e.length)){u.next=21;break}return l=e[f],u.next=7,(0,k.default)(i.featureCache.get(l.toString(),{chunk:l,opts:a},a.signal));case 7:return c=u.sent,d=c.data,p=c.cpositions,v=c.dpositions,y=c.chunk,b=i.readBamFeatures(d,p,v,y).then((function(e){for(var a=[],i=0;i<e.length;i+=1){var u=e[i];if(u.seq_id()===t){if(u.get("start")>=n){s=!0;break}u.get("end")>=r&&a.push(u)}}return a})),o.push(b),u.next=16,(0,k.default)(b);case 16:if(!s){u.next=18;break}return u.abrupt("break",21);case 18:f++,u.next=3;break;case 21:(0,M.checkAbortSignal)(a.signal),m=0;case 23:if(!(m<o.length)){u.next=29;break}return u.next=26,o[m];case 26:m++,u.next=23;break;case 29:if((0,M.checkAbortSignal)(a.signal),!a.viewAsPairs){u.next=33;break}return u.next=33,i.fetchPairs(t,o,a);case 33:case"end":return u.stop()}}),u)})))()}},{key:"fetchPairs",value:function(){var e=(0,v.default)(h.default.mark((function e(t,r,n){var a,p,y,b,m,x,g,k,w,_,E,A,S,I,P=this;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y={},b={},e.next=4,f.default.all((0,l.default)(r).call(r,function(){var e=(0,v.default)(h.default.mark((function e(t){var r,n,a,i,u,f;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:for(n=e.sent,a={},i=0;i<n.length;i++)u=n[i].name(),f=n[i].id(),a[u]||(a[u]=0),a[u]++,b[f]=1;(0,s.default)(r=(0,C.default)(a)).call(r,(function(e){var t=(0,o.default)(e,2),r=t[0];1===t[1]&&(y[r]=!0)}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 4:return m=[],e.next=7,f.default.all((0,l.default)(r).call(r,function(){var e=(0,v.default)(h.default.mark((function e(r){var a,i,u;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r;case 2:for(a=e.sent,i=0;i<a.length;i++)u=a[i].name(),y[u]&&(n.pairAcrossChr||a[i]._next_refid()===t&&Math.abs(a[i].get("start")-a[i]._next_pos())<(n.maxInsertSize||2e5))&&m.push(P.index.blocksForRange(a[i]._next_refid(),a[i]._next_pos(),a[i]._next_pos()+1,n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:return e.next=9,f.default.all(m);case 9:for(x=e.sent,g=[],k=0;k<x.length;k++)g=(0,d.default)(g).call(g,x[k]);if(g=(0,u.default)(a=(0,i.default)(g).call(g)).call(a,(function(e,t,r){return!t||e.toString()!==r[t-1].toString()})),!((w=(0,c.default)(p=(0,l.default)(g).call(g,(function(e){return e.fetchedSize()}))).call(p,(function(e,t){return e+t}),0))>this.fetchSizeLimit)){e.next=16;break}throw new Error((0,d.default)(_="data size of ".concat(w.toLocaleString()," bytes exceeded fetch size limit of ")).call(_,this.fetchSizeLimit.toLocaleString()," bytes"));case 16:return E=(0,l.default)(g).call(g,function(){var e=(0,v.default)(h.default.mark((function e(t){var r,a,i,u,o,s,f,l,c;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P.featureCache.get(t.toString(),{chunk:t,opts:n},n.signal);case 2:return r=e.sent,a=r.data,i=r.cpositions,u=r.dpositions,o=r.chunk,e.next=9,P.readBamFeatures(a,i,u,o);case 9:for(s=e.sent,f=[],l=0;l<s.length;l+=1)c=s[l],y[c.get("name")]&&!b[c.id()]&&f.push(c);return e.abrupt("return",f);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=19,f.default.all(E);case 19:return A=e.sent,S=[],A.length&&(I=(0,c.default)(A).call(A,(function(e,t){return(0,d.default)(e).call(e,t)})),S=(0,d.default)(S).call(S,I)),e.abrupt("return",S);case 23:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_readChunk",value:function(){var t=(0,v.default)(h.default.mark((function t(r,n){var a,i,u,o,s,f,l,c,d,v,y;return h.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=r.chunk,i=r.opts,o=(u=a).fetchedSize(),t.next=5,this.bam.read(e.alloc(o),0,o,u.minv.blockPosition,i);case 5:if(s=t.sent,f=s.bytesRead,l=s.buffer,(0,M.checkAbortSignal)(n),f){t.next=11;break}return t.abrupt("return",[]);case 11:return l=f<o?(0,p.default)(l).call(l,0,f):(0,p.default)(l).call(l,0,o),t.next=14,(0,P.unzipChunkSlice)(l,a);case 14:return c=t.sent,d=c.buffer,v=c.cpositions,y=c.dpositions,(0,M.checkAbortSignal)(n),t.abrupt("return",{data:d,cpositions:v,dpositions:y,chunk:a});case 20:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}()},{key:"readBamFeatures",value:function(){var e=(0,v.default)(h.default.mark((function e(t,r,n,i){var u,o,s,f,l,c,d;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=0,o=[],s=0,f=+(0,a.default)();case 4:if(!(u+4<t.length)){e.next=18;break}if(l=t.readInt32LE(u),c=u+4+l-1,n){for(;u+i.minv.dataPosition>=n[s++];);s--}if(!(c<t.length)){e.next=15;break}if(d=new R.default({bytes:{byteArray:t,start:u,end:c},fileOffset:r?256*r[s]+(u-n[s])+i.minv.dataPosition+1:I.default.signed((0,p.default)(t).call(t,u,c))}),o.push(d),!(this.yieldThreadTime&&+(0,a.default)()-f>this.yieldThreadTime)){e.next=15;break}return e.next=14,(0,M.timeout)(1);case 14:f=+(0,a.default)();case 15:u=c+1,e.next=4;break;case 18:return e.abrupt("return",o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,r,n,a){return e.apply(this,arguments)}}()},{key:"hasRefSeq",value:function(){var e=(0,v.default)(h.default.mark((function e(t){var r;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.chrToIndex&&this.chrToIndex[t],e.abrupt("return",this.index.hasRefSeq(r));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"lineCount",value:function(){var e=(0,v.default)(h.default.mark((function e(t){var r;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.chrToIndex&&this.chrToIndex[t],e.abrupt("return",this.index.lineCount(r));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"indexCov",value:function(){var e=(0,v.default)(h.default.mark((function e(t,r,n){var a;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.index.parse();case 2:return a=this.chrToIndex&&this.chrToIndex[t],e.abrupt("return",this.index.indexCov(a,r,n));case 4:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()}]),t}();t.default=D}).call(this,r(109).Buffer)},1182:function(e,t,r){var n=r(1991);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},1183:function(e,t,r){e.exports=r(1992)},1184:function(e,t){e.exports=function(e){this.wrapped=e}},1185:function(e,t,r){var n=r(1184);e.exports=function(e){return new n(e)}},1186:function(e,t,r){var n=r(778),a=r(369),i=r(776);e.exports=function(e,t){var r={},u=!1;function o(r,n){return u=!0,n=new i((function(t){t(e[r](n))})),{done:!1,value:t(n)}}return"function"===typeof a&&n&&(r[n]=function(){return this}),r.next=function(e){return u?(u=!1,e):o("next",e)},"function"===typeof e.throw&&(r.throw=function(e){if(u)throw u=!1,e;return o("throw",e)}),"function"===typeof e.return&&(r.return=function(e){return u?(u=!1,e):o("return",e)}),r}},1187:function(e,t,r){var n=r(764),a=r(778),i=r(1183),u=r(369);e.exports=function(e){var t;if("undefined"!==typeof u){if(i&&null!=(t=e[i]))return t.call(e);if(a&&null!=(t=n(e)))return t.call(e)}throw new TypeError("Object is not async iterable")}},1189:function(e,t,r){"use strict";(function(e){var n=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(579)),u=n(r(782)),o=n(r(325)),s=n(r(326)),f=n(r(156)),l=n(r(202)),c=n(r(122)),d=n(r(131)),h=n(r(291)),p=n(r(261)),v=n(r(2003)),y=(0,p.default)(a="=ACMGRSVTWYHKDBN".split("")).call(a,(function(e){return e.charCodeAt(0)})),b="MIDNSHP=X???????".split(""),m=function(){function t(e){(0,c.default)(this,t),(0,h.default)(this,"data",void 0),(0,h.default)(this,"bytes",void 0),(0,h.default)(this,"flags",void 0),(0,h.default)(this,"_id",void 0),(0,h.default)(this,"_refID",void 0),(0,h.default)(this,"_tagOffset",void 0),(0,h.default)(this,"_tagList",[]),(0,h.default)(this,"_allTagsParsed",!1),this.data={},this.bytes={start:e.bytes.start,end:e.bytes.end,byteArray:e.bytes.byteArray},this._id=e.fileOffset;var r=this.bytes,n=r.start,a=r.byteArray;this._refID=a.readInt32LE(n+4),this.data.start=a.readInt32LE(n+8),this.flags=(4294901760&a.readInt32LE(n+16))>>16}return(0,d.default)(t,[{key:"get",value:function(e){return this[e]?(this.data[e]||(this.data[e]=this[e]()),this.data[e]):this._get(e.toLowerCase())}},{key:"end",value:function(){return this.get("start")+(this.get("length_on_ref")||this.get("seq_length")||void 0)}},{key:"seq_id",value:function(){return this._refID}},{key:"_get",value:function(e){return e in this.data||(this.data[e]=this._parseTag(e)),this.data[e]}},{key:"_tags",value:function(){var e,t=this;this._parseAllTags();var r=["seq"];this.isSegmentUnmapped()||r.push("start","end","strand","score","qual","MQ","CIGAR","length_on_ref","template_length"),this.isPaired()&&r.push("next_segment_position","pair_orientation"),r=(0,l.default)(r).call(r,this._tagList||[]),(0,f.default)(e=(0,s.default)(this.data)).call(e,(function(e){"_"!==e[0]&&"next_seq_id"!==e&&r.push(e)}));var n={};return r=(0,o.default)(r).call(r,(function(e){if(e in t.data&&void 0===t.data[e]||"CG"===e||"cg"===e)return!1;var r=e.toLowerCase(),a=n[r];return n[r]=!0,!a}))}},{key:"parent",value:function(){}},{key:"children",value:function(){return this.get("subfeatures")}},{key:"id",value:function(){return this._id}},{key:"mq",value:function(){var e=(65280&this.get("_bin_mq_nl"))>>8;return 255===e?void 0:e}},{key:"score",value:function(){return this.get("mq")}},{key:"qual",value:function(){var e;return null===(e=this.qualRaw())||void 0===e?void 0:e.join(" ")}},{key:"qualRaw",value:function(){if(!this.isSegmentUnmapped()){for(var t=this.bytes.byteArray,r=this.bytes.start+36+this.get("_l_read_name")+4*this.get("_n_cigar_op")+this.get("_seq_bytes"),n=this.get("seq_length"),a=e.allocUnsafe(n),i=0;i<n;++i)a[i]=t[r+i];return a}}},{key:"strand",value:function(){return this.isReverseComplemented()?-1:1}},{key:"multi_segment_next_segment_strand",value:function(){if(!this.isMateUnmapped())return this.isMateReverseComplemented()?-1:1}},{key:"name",value:function(){return this.get("_read_name")}},{key:"_read_name",value:function(){var e=this.get("_l_read_name");return this.bytes.byteArray.toString("ascii",this.bytes.start+36,this.bytes.start+36+e-1)}},{key:"_parseTag",value:function(e){if(!this._allTagsParsed){for(var t,r=this.bytes.byteArray,n=this._tagOffset||this.bytes.start+36+this.get("_l_read_name")+4*this.get("_n_cigar_op")+this.get("_seq_bytes")+this.get("seq_length"),a=this.bytes.end;n<a&&t!==e;){var i=String.fromCharCode(r[n],r[n+1]);t=i.toLowerCase();var u=String.fromCharCode(r[n+2]);n+=3;var o=void 0;switch(u){case"A":o=String.fromCharCode(r[n]),n+=1;break;case"i":o=r.readInt32LE(n),n+=4;break;case"I":o=r.readUInt32LE(n),n+=4;break;case"c":o=r.readInt8(n),n+=1;break;case"C":o=r.readUInt8(n),n+=1;break;case"s":o=r.readInt16LE(n),n+=2;break;case"S":o=r.readUInt16LE(n),n+=2;break;case"f":o=r.readFloatLE(n),n+=4;break;case"Z":case"H":for(o="";n<=a;){var s=r[n++];if(0===s)break;o+=String.fromCharCode(s)}break;case"B":o="";var f=r[n++],l=String.fromCharCode(f),c=r.readInt32LE(n);if(n+=4,"i"===l)if("CG"===i)for(var d=0;d<c;d++){var h=r.readInt32LE(n);o+=(h>>4)+b[15&h],n+=4}else for(var p=0;p<c;p++)o+=r.readInt32LE(n),p+1<c&&(o+=","),n+=4;if("I"===l)if("CG"===i)for(var v=0;v<c;v++){var y=r.readUInt32LE(n);o+=(y>>4)+b[15&y],n+=4}else for(var m=0;m<c;m++)o+=r.readUInt32LE(n),m+1<c&&(o+=","),n+=4;if("s"===l)for(var x=0;x<c;x++)o+=r.readInt16LE(n),x+1<c&&(o+=","),n+=2;if("S"===l)for(var g=0;g<c;g++)o+=r.readUInt16LE(n),g+1<c&&(o+=","),n+=2;if("c"===l)for(var k=0;k<c;k++)o+=r.readInt8(n),k+1<c&&(o+=","),n+=1;if("C"===l)for(var w=0;w<c;w++)o+=r.readUInt8(n),w+1<c&&(o+=","),n+=1;if("f"===l)for(var _=0;_<c;_++)o+=r.readFloatLE(n),_+1<c&&(o+=","),n+=4;break;default:console.warn("Unknown BAM tag type '".concat(u,"', tags may be incomplete")),o=void 0,n=a}if(this._tagOffset=n,this._tagList.push(i),t===e)return o;this.data[t]=o}this._allTagsParsed=!0}}},{key:"_parseAllTags",value:function(){this._parseTag("")}},{key:"_parseCigar",value:function(e){var t;return(0,p.default)(t=e.match(/\d+\D/g)).call(t,(function(e){return[e.match(/\D/)[0].toUpperCase(),(0,u.default)(e,10)]}))}},{key:"isPaired",value:function(){return!!((0,i.default)(this)&v.default.BAM_FPAIRED)}},{key:"isProperlyPaired",value:function(){return!!((0,i.default)(this)&v.default.BAM_FPROPER_PAIR)}},{key:"isSegmentUnmapped",value:function(){return!!((0,i.default)(this)&v.default.BAM_FUNMAP)}},{key:"isMateUnmapped",value:function(){return!!((0,i.default)(this)&v.default.BAM_FMUNMAP)}},{key:"isReverseComplemented",value:function(){return!!((0,i.default)(this)&v.default.BAM_FREVERSE)}},{key:"isMateReverseComplemented",value:function(){return!!((0,i.default)(this)&v.default.BAM_FMREVERSE)}},{key:"isRead1",value:function(){return!!((0,i.default)(this)&v.default.BAM_FREAD1)}},{key:"isRead2",value:function(){return!!((0,i.default)(this)&v.default.BAM_FREAD2)}},{key:"isSecondary",value:function(){return!!((0,i.default)(this)&v.default.BAM_FSECONDARY)}},{key:"isFailedQc",value:function(){return!!((0,i.default)(this)&v.default.BAM_FQCFAIL)}},{key:"isDuplicate",value:function(){return!!((0,i.default)(this)&v.default.BAM_FDUP)}},{key:"isSupplementary",value:function(){return!!((0,i.default)(this)&v.default.BAM_FSUPPLEMENTARY)}},{key:"cigar",value:function(){if(!this.isSegmentUnmapped()){var e=this.bytes,t=e.byteArray,r=e.start,n=this.get("_n_cigar_op"),a=r+36+this.get("_l_read_name"),i=this.get("seq_length"),u="",o=0,s=t.readInt32LE(a),f=s>>4,l=b[15&s];if("S"===l&&f===i)return a+=4,f=(s=t.readInt32LE(a))>>4,"N"!==(l=b[15&s])&&console.warn("CG tag with no N tag"),this.data.length_on_ref=f,this.get("CG");for(var c=0;c<n;++c)u+=(f=(s=t.readInt32LE(a))>>4)+(l=b[15&s]),"H"!==l&&"S"!==l&&"I"!==l&&(o+=f),a+=4;return this.data.length_on_ref=o,u}}},{key:"_flags",value:function(){}},{key:"length_on_ref",value:function(){return this.get("cigar"),this.data.length_on_ref}},{key:"_n_cigar_op",value:function(){return 65535&this.get("_flag_nc")}},{key:"_l_read_name",value:function(){return 255&this.get("_bin_mq_nl")}},{key:"_seq_bytes",value:function(){return this.get("seq_length")+1>>1}},{key:"getReadBases",value:function(){return this.seq()}},{key:"seq",value:function(){for(var e=this.bytes.byteArray,t=this.bytes.start+36+this.get("_l_read_name")+4*this.get("_n_cigar_op"),r=this.get("_seq_bytes"),n=this.get("seq_length"),a="",i=0,u=0;u<r;++u){var o=e[t+u];a+=String.fromCharCode(y[(240&o)>>4]),++i<n&&(a+=String.fromCharCode(y[15&o]),i++)}return a}},{key:"getPairOrientation",value:function(){if(!this.isSegmentUnmapped()&&!this.isMateUnmapped()&&this._refID===this._next_refid()){var e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var a=[];return this.template_length()>0?(a[0]=e,a[1]=r,a[2]=t,a[3]=n):(a[2]=e,a[3]=r,a[0]=t,a[1]=n),a.join("")}return null}},{key:"_bin_mq_nl",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+12)}},{key:"_flag_nc",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+16)}},{key:"seq_length",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+20)}},{key:"_next_refid",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+24)}},{key:"_next_pos",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+28)}},{key:"template_length",value:function(){return this.bytes.byteArray.readInt32LE(this.bytes.start+32)}},{key:"toJSON",value:function(){var e,t=this,r={};return(0,f.default)(e=(0,s.default)(this)).call(e,(function(e){"_"!==e.charAt(0)&&"bytes"!==e&&(r[e]=t[e])})),r}}]),t}();t.default=m}).call(this,r(109).Buffer)},1192:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.parseHeaderText=function(e){var t=e.split(/\r?\n/),r=[];return(0,s.default)(t).call(t,(function(e){var t=e.split(/\t/),n=(0,o.default)(t),s=n[0],f=(0,u.default)(n).call(n,1),l=(0,i.default)(f).call(f,(function(e){var t=e.split(":",2),r=(0,a.default)(t,2);return{tag:r[0],value:r[1]}}));s&&r.push({tag:s.substr(1),data:l})})),r};var a=n(r(245)),i=n(r(261)),u=n(r(292)),o=n(r(1193)),s=n(r(156))},178:function(e,t,r){e.exports=r(1847)},1847:function(e,t,r){var n=r(1115);e.exports=n},1857:function(e,t,r){var n=r(1130);e.exports=n},1859:function(e,t,r){r(289),r(323);var n=r(570);e.exports=n},1860:function(e,t,r){var n=r(1132);e.exports=n},1876:function(e,t,r){var n=r(1139);e.exports=n},1879:function(e,t,r){var n=r(1880);e.exports=n},1880:function(e,t,r){r(1881);var n=r(127).Object,a=e.exports=function(e,t){return n.defineProperties(e,t)};n.defineProperties.sham&&(a.sham=!0)},1881:function(e,t,r){var n=r(98),a=r(165);n({target:"Object",stat:!0,forced:!a,sham:!a},{defineProperties:r(1125)})},1882:function(e,t,r){var n=r(1883);e.exports=n},1883:function(e,t,r){r(1884);var n=r(127);e.exports=n.Object.getOwnPropertyDescriptors},1884:function(e,t,r){var n=r(98),a=r(165),i=r(1885),u=r(244),o=r(365),s=r(571);n({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,r,n=u(e),a=o.f,f=i(n),l={},c=0;f.length>c;)void 0!==(r=a(n,t=f[c++]))&&s(l,t,r);return l}})},1885:function(e,t,r){var n=r(216),a=r(767),i=r(768),u=r(128);e.exports=n("Reflect","ownKeys")||function(e){var t=a.f(u(e)),r=i.f;return r?t.concat(r(e)):t}},1891:function(e,t,r){var n=r(1143);e.exports=n},1892:function(e,t,r){var n=r(98),a=r(149),i=r(244),u=r(365).f,o=r(165),s=a((function(){u(1)}));n({target:"Object",stat:!0,forced:!o||s,sham:!o},{getOwnPropertyDescriptor:function(e,t){return u(i(e),t)}})},1897:function(e,t,r){var n=r(1144);e.exports=n},1900:function(e,t,r){var n=r(1146);e.exports=n},1957:function(e,t,r){e.exports=r(1958)},1958:function(e,t,r){r(1959);var n=r(127);e.exports=n.setTimeout},1959:function(e,t,r){var n=r(98),a=r(148),i=r(766),u=[].slice,o=function(e){return function(t,r){var n=arguments.length>2,a=n?u.call(arguments,2):void 0;return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,a)}:t,r)}};n({global:!0,bind:!0,forced:/MSIE .\./.test(i)},{setTimeout:o(a.setTimeout),setInterval:o(a.setInterval)})},1961:function(e,t,r){e.exports=r(1962)},1962:function(e,t,r){var n=r(1143);e.exports=n},1963:function(e,t,r){e.exports=r(1964)},1964:function(e,t,r){var n=r(1965);r(1969),r(1970),r(1971),r(1972),e.exports=n},1965:function(e,t,r){r(573),r(1966),r(289);var n=r(127);e.exports=n.WeakMap},1966:function(e,t,r){"use strict";var n,a=r(148),i=r(575),u=r(578),o=r(1172),s=r(1968),f=r(166),l=r(259).enforce,c=r(1119),d=!a.ActiveXObject&&"ActiveXObject"in a,h=Object.isExtensible,p=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},v=e.exports=o("WeakMap",p,s);if(c&&d){n=s.getConstructor(p,"WeakMap",!0),u.REQUIRED=!0;var y=v.prototype,b=y.delete,m=y.has,x=y.get,g=y.set;i(y,{delete:function(e){if(f(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new n),b.call(this,e)||t.frozen.delete(e)}return b.call(this,e)},has:function(e){if(f(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new n),m.call(this,e)||t.frozen.has(e)}return m.call(this,e)},get:function(e){if(f(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new n),m.call(this,e)?x.call(this,e):t.frozen.get(e)}return x.call(this,e)},set:function(e,t){if(f(e)&&!h(e)){var r=l(this);r.frozen||(r.frozen=new n),m.call(this,e)?g.call(this,e,t):r.frozen.set(e,t)}else g.call(this,e,t);return this}})}},1968:function(e,t,r){"use strict";var n=r(575),a=r(578).getWeakData,i=r(128),u=r(166),o=r(576),s=r(151),f=r(324),l=r(201),c=r(259),d=c.set,h=c.getterFor,p=f.find,v=f.findIndex,y=0,b=function(e){return e.frozen||(e.frozen=new m)},m=function(){this.entries=[]},x=function(e,t){return p(e.entries,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=x(this,e);if(t)return t[1]},has:function(e){return!!x(this,e)},set:function(e,t){var r=x(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,f){var c=e((function(e,n){o(e,c,t),d(e,{type:t,id:y++,frozen:void 0}),void 0!=n&&s(n,e[f],e,r)})),p=h(t),v=function(e,t,r){var n=p(e),u=a(i(t),!0);return!0===u?b(n).set(t,r):u[n.id]=r,e};return n(c.prototype,{delete:function(e){var t=p(this);if(!u(e))return!1;var r=a(e);return!0===r?b(t).delete(e):r&&l(r,t.id)&&delete r[t.id]},has:function(e){var t=p(this);if(!u(e))return!1;var r=a(e);return!0===r?b(t).has(e):r&&l(r,t.id)}}),n(c.prototype,r?{get:function(e){var t=p(this);if(u(e)){var r=a(e);return!0===r?b(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),c}}},1969:function(e,t,r){r(98)({target:"WeakMap",stat:!0},{from:r(1173)})},1970:function(e,t,r){r(98)({target:"WeakMap",stat:!0},{of:r(1174)})},1971:function(e,t,r){"use strict";var n=r(98),a=r(137),i=r(1175);n({target:"WeakMap",proto:!0,real:!0,forced:a},{deleteAll:function(){return i.apply(this,arguments)}})},1972:function(e,t,r){"use strict";r(98)({target:"WeakMap",proto:!0,real:!0,forced:r(137)},{upsert:r(781)})},1979:function(e,t,r){e.exports=r(1980)},1980:function(e,t,r){var n=r(1981);e.exports=n},1981:function(e,t,r){r(1982);var n=r(127);e.exports=n.Date.now},1982:function(e,t,r){r(98)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},1991:function(e,t,r){var n=r(1183),a=r(369),i=r(776),u=r(1184);function o(e){var t,r;function n(t,r){try{var o=e[t](r),s=o.value,f=s instanceof u;i.resolve(f?s.wrapped:s).then((function(e){f?n("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(l){a("throw",l)}}function a(e,a){switch(e){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,a){return new i((function(i,u){var o={key:e,arg:a,resolve:i,reject:u,next:null};r?r=r.next=o:(t=r=o,n(e,a))}))},"function"!==typeof e.return&&(this.return=void 0)}"function"===typeof a&&n&&(o.prototype[n]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o},1992:function(e,t,r){var n=r(1993);e.exports=n},1993:function(e,t,r){r(1136);var n=r(574);e.exports=n.f("asyncIterator")},2003:function(e,t,r){"use strict";r(178)(t,"__esModule",{value:!0}),t.default=void 0;t.default={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}},2004:function(e,t,r){"use strict";(function(e){var n=r(1171),a=r(107);r(178)(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(2005)),u=a(r(2014)),o=a(r(261)),s=a(r(327)),f=a(r(178)),l=a(r(769)),c=a(r(770)),d=a(r(771)),h=a(r(772)),p=a(r(326)),v=a(r(773)),y=a(r(156)),b=a(r(325)),m=a(r(189)),x=a(r(292)),g=a(r(202)),k=a(r(122)),w=a(r(131)),_=a(r(779)),E=a(r(233)),A=a(r(234)),S=a(r(217)),I=a(r(291)),P=a(r(190)),C=a(r(1182)),B=a(r(1185)),T=a(r(1187)),R=a(r(1186)),L=n(r(1178));r(2020);var M=r(328),F=r(1192);function O(e,t){var r=(0,p.default)(e);if(h.default){var n=(0,h.default)(e);t&&(n=(0,b.default)(n).call(n,(function(t){return(0,d.default)(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)(0,y.default)(r=O(Object(n),!0)).call(r,(function(t){(0,I.default)(e,t,n[t])}));else if(c.default)(0,l.default)(e,(0,c.default)(n));else{var a;(0,y.default)(a=O(Object(n))).call(a,(function(t){(0,f.default)(e,t,(0,d.default)(n,t))}))}}return e}function U(e){var t=function(){if("undefined"===typeof Reflect||!v.default)return!1;if(v.default.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call((0,v.default)(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,S.default)(e);if(t){var a=(0,S.default)(this).constructor;r=(0,v.default)(n,arguments,a)}else r=n.apply(this,arguments);return(0,A.default)(this,r)}}function z(e,t){return q.apply(this,arguments)}function q(){return(q=(0,P.default)(m.default.mark((function t(r,n){var a;return m.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.all((0,o.default)(r).call(r,function(){var t=(0,P.default)(m.default.mark((function t(r){var a,o,s,f;return m.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.url,o=r.headers,!(0,u.default)(a).call(a,"data:")){t.next=5;break}return t.abrupt("return",e.from(a.split(",")[1],"base64"));case 5:return o.referer,s=(0,i.default)(o,["referer"]),t.next=8,fetch(a,D(D({},n),{},{headers:D(D({},n.headers),s)}));case 8:if((f=t.sent).ok){t.next=11;break}throw new Error("Failed to fetch ".concat(f.statusText));case 11:return t.t0=e,t.next=14,f.arrayBuffer();case 14:return t.t1=t.sent,t.abrupt("return",t.t0.from.call(t.t0,t.t1));case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 2:return a=t.sent,t.t0=(0,g.default)(e),t.t1=e,t.next=7,s.default.all((0,o.default)(a).call(a,(function(e){return(0,M.unzip)(e)})));case 7:return t.t2=t.sent,t.abrupt("return",t.t0.call.call(t.t0,t.t1,t.t2));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var j=function(e){(0,E.default)(r,e);var t=U(r);function r(e){var n;return(0,k.default)(this,r),n=t.call(this,{bamFilehandle:"?",baiFilehandle:"?"}),(0,I.default)((0,_.default)(n),"baseUrl",void 0),(0,I.default)((0,_.default)(n),"trackId",void 0),n.baseUrl=e.baseUrl,n.trackId=e.trackId,n}return(0,w.default)(r,[{key:"streamRecordsForRange",value:function(e,t,r){var n=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{viewAsPairs:!1,pairAcrossChr:!1,maxInsertSize:2e5};return(0,C.default)(m.default.mark((function i(){var u,o,s,f,l,c,d,h,p,v,y,b;return m.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c=(0,g.default)(u="".concat(n.baseUrl,"/")).call(u,n.trackId),d=(0,g.default)(o=(0,g.default)(s=(0,g.default)(f="".concat(c,"?referenceName=")).call(f,e,"&start=")).call(s,t,"&end=")).call(o,r,"&format=BAM"),h=n.chrToIndex&&n.chrToIndex[e],i.next=5,(0,B.default)(fetch(d,D({},a)));case 5:if((p=i.sent).ok){i.next=8;break}throw new Error(p.statusText);case 8:return i.next=10,(0,B.default)(p.json());case 10:return v=i.sent,i.next=13,(0,B.default)(z((0,x.default)(l=v.htsget.urls).call(l,1),a));case 13:return y=i.sent,b={buffer:y,chunk:{minv:{dataPosition:0}},toString:function(){var n,a;return(0,g.default)(n=(0,g.default)(a="".concat(e,"_")).call(a,t,"_")).call(n,r)}},i.delegateYield((0,R.default)((0,T.default)(n._fetchChunkFeatures([b],h,t,r,a)),B.default),"t0",16);case 16:case"end":return i.stop()}}),i)})))()}},{key:"_readChunk",value:function(){var e=(0,P.default)(m.default.mark((function e(t){var r,n,a;return m.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.chunk,n=r.buffer,a=r.chunk,e.abrupt("return",{data:n,cpositions:null,dpositions:null,chunk:a});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=(0,P.default)(m.default.mark((function e(){var t,r,n,a,i,u,o,s,f,l,c,d,h=arguments;return m.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},n=(0,g.default)(t="".concat(this.baseUrl,"/")).call(t,this.trackId,"?referenceName=na&class=header"),e.next=4,fetch(n,r);case 4:if((a=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch ".concat(a.statusText));case 7:return e.next=9,a.json();case 9:return i=e.sent,e.next=12,z(i.htsget.urls,r);case 12:if((u=e.sent).readInt32LE(0)===L.BAM_MAGIC){e.next=15;break}throw new Error("Not a BAM file");case 15:return o=u.readInt32LE(4),s=u.toString("utf8",8,8+o),f=(0,F.parseHeaderText)(s),l=[],c={},d=(0,b.default)(f).call(f,(function(e){return"SQ"===e.tag})),(0,y.default)(d).call(d,(function(e,t){var r;(0,y.default)(r=e.data).call(r,(function(e){if("SN"===e.tag){var r=e.value;c[r]=t,l[t]=r}}))})),this.chrToIndex=c,this.indexToChr=l,e.abrupt("return",f);case 25:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(L.default);t.default=j}).call(this,r(109).Buffer)},2005:function(e,t,r){var n=r(783),a=r(2009),i=r(2011);e.exports=function(e,t){if(null==e)return{};var r,u,o=i(e,t);if(a){var s=a(e);for(u=0;u<s.length;u++)r=s[u],n(t).call(t,r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},2009:function(e,t,r){e.exports=r(2010)},2010:function(e,t,r){var n=r(1144);e.exports=n},2011:function(e,t,r){var n=r(783),a=r(2012);e.exports=function(e,t){if(null==e)return{};var r,i,u={},o=a(e);for(i=0;i<o.length;i++)r=o[i],n(t).call(t,r)>=0||(u[r]=e[r]);return u}},2012:function(e,t,r){e.exports=r(2013)},2013:function(e,t,r){var n=r(1145);e.exports=n},2014:function(e,t,r){e.exports=r(2015)},2015:function(e,t,r){var n=r(2016);e.exports=n},2016:function(e,t,r){var n=r(2017),a=String.prototype;e.exports=function(e){var t=e.startsWith;return"string"===typeof e||e===a||e instanceof String&&t===a.startsWith?n:t}},2017:function(e,t,r){r(2018);var n=r(188);e.exports=n("String").startsWith},2018:function(e,t,r){"use strict";var n=r(98),a=r(365).f,i=r(260),u=r(1196),o=r(367),s=r(1197),f=r(137),l="".startsWith,c=Math.min,d=s("startsWith");n({target:"String",proto:!0,forced:!(!f&&!d&&!!function(){var e=a(String.prototype,"startsWith");return e&&!e.writable}())&&!d},{startsWith:function(e){var t=String(o(this));u(e);var r=i(c(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return l?l.call(t,n,r):t.slice(r,r+n.length)===n}})},2020:function(e,t){!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,a="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,u="ArrayBuffer"in e;if(u)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!==typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?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(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=h(this);if(e)return e;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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,r=p(t);return t.readAsText(e),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=f(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[f(e)]},d.prototype.get=function(e){return e=f(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(f(e))},d.prototype.set=function(e,t){this.map[f(e)]=l(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),c(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),c(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(e,t){var r=(t=t||{}).body;if(e instanceof x){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=function(e){var t=e.toUpperCase();return m.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(a))}})),t}function k(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var a=r.join(":").trim();t.append(n,a)}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})},b.call(x.prototype),b.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];w.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(A){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(n,i){var u=new x(e,r);if(u.signal&&u.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:k(o.getAllResponseHeaders()||"")};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;n(new w(t,e))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},o.open(u.method,u.url,!0),"include"===u.credentials?o.withCredentials=!0:"omit"===u.credentials&&(o.withCredentials=!1),"responseType"in o&&a&&(o.responseType="blob"),u.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),u.signal&&(u.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&u.signal.removeEventListener("abort",s)}),o.send("undefined"===typeof u._bodyInit?null:u._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=x,e.Response=w),t.Headers=d,t.Request=x,t.Response=w,t.fetch=E}({})}("undefined"!==typeof self?self:this)},291:function(e,t,r){var n=r(775);e.exports=function(e,t,r){return t in e?n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},751:function(e,t,r){"use strict";var n=r(107),a=r(178);a(t,"__esModule",{value:!0}),a(t,"BAI",{enumerable:!0,get:function(){return i.default}}),a(t,"CSI",{enumerable:!0,get:function(){return u.default}}),a(t,"BamFile",{enumerable:!0,get:function(){return o.default}}),a(t,"HtsgetFile",{enumerable:!0,get:function(){return s.default}}),a(t,"BamRecord",{enumerable:!0,get:function(){return f.default}});var i=n(r(1118)),u=n(r(1170)),o=n(r(1178)),s=n(r(2004)),f=n(r(1189))},764:function(e,t,r){e.exports=r(1859)},769:function(e,t,r){e.exports=r(1879)},770:function(e,t,r){e.exports=r(1882)},771:function(e,t,r){e.exports=r(1891)},772:function(e,t,r){e.exports=r(1897)},773:function(e,t,r){e.exports=r(1900)},780:function(e,t,r){"use strict";var n=r(107);r(178)(t,"__esModule",{value:!0}),t.timeout=function(e){return new c.default((function(t){return(0,l.default)(t,e)}))},t.longToNumber=function(e){if(e.greaterThan(f.default)||e.lessThan(s.default))throw new Error("integer overflow");return e.toNumber()},t.checkAbortSignal=d,t.abortBreakPoint=function(e){return h.apply(this,arguments)},t.canMergeBlocks=p,t.makeOpts=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"aborted"in e?{signal:e}:e},t.optimizeChunks=function(e,t){var r=[],n=null;if(0===e.length)return e;return(0,u.default)(e).call(e,(function(e,t){var r=e.minv.blockPosition-t.minv.blockPosition;return 0!==r?r:e.minv.dataPosition-t.minv.dataPosition})),(0,i.default)(e).call(e,(function(e){(!t||e.maxv.compareTo(t)>0)&&(null===n?(r.push(e),n=e):p(n,e)?e.maxv.compareTo(n.maxv)>0&&(n.maxv=e.maxv):(r.push(e),n=e))})),r};var a=n(r(189)),i=n(r(156)),u=n(r(451)),o=n(r(190)),s=n(r(1168)),f=n(r(1169)),l=n(r(1957)),c=n(r(327));function d(e){if(e&&e.aborted){if("undefined"!==typeof DOMException)throw new DOMException("aborted","AbortError");var t=new Error("aborted");throw t.code="ERR_ABORTED",t}}function h(){return(h=(0,o.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.default.resolve();case 2:d(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}}}]);
  //# sourceMappingURL=6.cfd0156c.chunk.js.map