"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[5312],{75312:(t,e,a)=>{a.r(e),a.d(e,{default:()=>l});var s=a(46377),n=a(99546),o=a(66885),r=a(6514),i=a(99834);class c{constructor(t){this.filehandle=t}async read(t,e){const a=await this.filehandle.read(e,t);return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}}function u(t,e){return new c((0,i.openLocation)(t,e))}class l extends s.BaseFeatureDataAdapter{constructor(t,e,a){super(t,e,a),this.hic=new r.A({file:u(this.getConf("hicLocation"),this.pluginManager)})}async setup(t){const{statusCallback:e=()=>{}}=t||{};return(0,n.updateStatus)("Downloading .hic header",e,(()=>this.hic.getMetaData()))}async getHeader(t){const{chromosomes:e,...a}=await this.setup(t);return{...a,norms:await this.hic.getNormalizationOptions()}}async getRefNames(t){return(await this.setup(t)).chromosomes.map((t=>t.name))}async getResolution(t,e){const{resolutions:a}=await this.setup(e),s=this.getConf("resolutionMultiplier");let n=a.at(-1);for(let e=a.length-1;e>=0;e-=1){const o=a[e];o<=2*t*s&&(n=o)}return n}getFeatures(t,e={}){return(0,o.ObservableCreate)((async a=>{const{refName:s,start:o,end:r}=t,{resolution:i,normalization:c="KR",bpPerPx:u=1,statusCallback:l=()=>{}}=e,h=await this.getResolution(u/(i||1e3),e);await(0,n.updateStatus)("Downloading .hic data",l,(async()=>{const t=await this.hic.getContactRecords(c,{start:o,chr:s,end:r},{start:o,chr:s,end:r},"BP",h);for(const e of t)a.next(e)})),a.complete()}),e.stopToken)}async getMultiRegionFeatureDensityStats(t){return{featureDensity:0}}}}}]);
//# sourceMappingURL=5312.e74eeced.chunk.js.map