(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[63],{2461: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(159),a=n(94),u=n(96),c=n(89),s=n.n(c),i=n(91),o=n(90),f=n(93),h=n(130),p=n(145),l=n(136),b=n(82),v=n(2328),d=["chromosomes"],w=function(){function t(e){Object(o.a)(this,t),this.filehandle=void 0,this.filehandle=e}return Object(f.a)(t,[{key:"read",value:function(){var t=Object(i.a)(s.a.mark((function t(n,r){var a,u,c;return s.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){var r;Object(o.a)(this,n),(r=t.call(this,e)).hic=void 0;var a=Object(b.readConfObject)(e,"hicLocation");return r.hic=new v.a({file:O(a)}),r}return Object(f.a)(n,[{key:"setup",value:function(){var e=Object(i.a)(s.a.mark((function e(t){var n,r,a;return s.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(i.a)(s.a.mark((function e(t){var n,a;return s.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(i.a)(s.a.mark((function e(t){var n;return s.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(i.a)(s.a.mark((function e(t,n){var r,a,u,c,i;return s.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)(i=a[c])<=2*t&&(u=i);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(p.ObservableCreate)(function(){var r=Object(i.a)(s.a.mark((function r(a){var u,c,i,o,f,h,p,l,b;return s.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=e.refName,c=e.start,i=e.end,o=n.resolution,f=n.bpPerPx,h=void 0===f?1:f,p=n.statusCallback,l=void 0===p?function(){}:p,r.next=4,t.getResolution(h/(o||1e3),n);case 4:return b=r.sent,l("Downloading .hic data"),r.next=8,t.hic.getContactRecords("KR",{start:c,chr:u,end:i},{start:c,chr:u,end:i},"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}(h.BaseFeatureDataAdapter)}.call(this,n(113).Buffer)}}]);
//# sourceMappingURL=63.b5fbeafb.chunk.js.map