(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[70],{2308:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"openFilehandleWrapper",(function(){return O})),n.d(t,"default",(function(){return j}));var r=n(2),a=n(91),u=n(92),c=n(86),s=n(84),i=n(12),o=n(83),f=n.n(o),p=n(121),h=n(134),l=n(110),b=n(82),v=n(2174),d=["chromosomes"],w=function(){function t(e){Object(s.a)(this,t),this.filehandle=e}return Object(i.a)(t,[{key:"read",value:function(){var t=Object(c.a)(f.a.mark((function t(n,r){var a,u,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.filehandle.read(e.allocUnsafe(r),0,r,n);case 2:return a=t.sent,u=a.buffer,c=a.bytesRead,t.abrupt("return",u.buffer.slice(u.byteOffset,u.byteOffset+c));case 6:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();function O(e){return new w(Object(l.openLocation)(e))}var j=function(e){Object(a.a)(n,e);var t=Object(u.a)(n);function n(e,r,a){var u;Object(s.a)(this,n),(u=t.call(this,e,r,a)).hic=void 0;var c=Object(b.readConfObject)(e,"hicLocation");return u.hic=new v.a({file:O(c)}),u}return Object(i.a)(n,[{key:"setup",value:function(){var e=Object(c.a)(f.a.mark((function e(t){var n,r,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(t||{}).statusCallback,(r=void 0===n?function(){}:n)("Downloading .hic header"),e.next=4,this.hic.getMetaData();case 4:return a=e.sent,r(""),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=Object(c.a)(f.a.mark((function e(t){var n,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(t);case 2:return n=e.sent,n.chromosomes,a=Object(r.a)(n,d),e.abrupt("return",a);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=Object(c.a)(f.a.mark((function e(t){var n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(t);case 2:return n=e.sent,e.abrupt("return",n.chromosomes.map((function(e){return e.name})));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getResolution",value:function(){var e=Object(c.a)(f.a.mark((function e(t,n){var r,a,u,c,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(n);case 2:for(r=e.sent,a=r.resolutions,u=a[a.length-1],c=a.length-1;c>=0;c-=1)(s=a[c])<=2*t&&(u=s);return e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(h.ObservableCreate)(function(){var r=Object(c.a)(f.a.mark((function r(a){var u,c,s,i,o,p,h,l,b;return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=e.refName,c=e.start,s=e.end,i=n.resolution,o=n.bpPerPx,p=void 0===o?1:o,h=n.statusCallback,l=void 0===h?function(){}:h,r.next=4,t.getResolution(p/(i||1e3),n);case 4:return b=r.sent,l("Downloading .hic data"),r.next=8,t.hic.getContactRecords("KR",{start:c,chr:u,end:s},{start:c,chr:u,end:s},"BP",b);case 8:r.sent.forEach((function(e){a.next(e)})),l(""),a.complete();case 12:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),n.signal)}},{key:"freeResources",value:function(){}}]),n}(p.BaseFeatureDataAdapter)}.call(this,n(103).Buffer)}}]);
//# sourceMappingURL=70.7f4874d3.chunk.js.map