"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9742],{29742:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u,openFilehandleWrapper:()=>l});var s=a(56798),n=a(16979),r=a(59062),o=a(16605),i=a(41762).lW;class c{constructor(e){this.filehandle=e}async read(e,t){const{buffer:a,bytesRead:s}=await this.filehandle.read(i.allocUnsafe(t),0,t,e);return a.buffer.slice(a.byteOffset,a.byteOffset+s)}}function l(e,t){return new c((0,r.openLocation)(e,t))}class u extends s.BaseFeatureDataAdapter{constructor(e,t,a){super(e,t,a);const s=this.getConf("hicLocation");this.hic=new o.Z({file:l(s,this.pluginManager)})}async setup(e){const{statusCallback:t=(()=>{})}=e||{};t("Downloading .hic header");const a=await this.hic.getMetaData();return t(""),a}async getHeader(e){const t=await this.setup(e),{chromosomes:a,...s}=t;return s}async getRefNames(e){return(await this.setup(e)).chromosomes.map((e=>e.name))}async getResolution(e,t){const{resolutions:a}=await this.setup(t);let s=a.at(-1);for(let t=a.length-1;t>=0;t-=1){const n=a[t];n<=2*e&&(s=n)}return s}getFeatures(e,t={}){return(0,n.ObservableCreate)((async a=>{const{refName:s,start:n,end:r}=e,{resolution:o,bpPerPx:i=1,statusCallback:c=(()=>{})}=t,l=await this.getResolution(i/(o||1e3),t);c("Downloading .hic data"),(await this.hic.getContactRecords("KR",{start:n,chr:s,end:r},{start:n,chr:s,end:r},"BP",l)).forEach((e=>{a.next(e)})),c(""),a.complete()}),t.signal)}async getMultiRegionFeatureDensityStats(e){return{featureDensity:0}}freeResources(){}}}}]);
//# sourceMappingURL=9742.5088796c.chunk.js.map