"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[1590],{11590:(e,t,s)=>{s.r(t),s.d(t,{default:()=>h});var a=s(46377),i=s(99834),n=s(66885),r=s(6434),o=s(39763),c=s(68584);class h extends a.BaseSequenceAdapter{async initChromSizes(){const e=(0,c.readConfObject)(this.config,"chromSizesLocation");if("/path/to/default.chrom.sizes"!==e.uri&&""!==e.uri){const t=(0,i.openLocation)(e,this.pluginManager),s=await t.readFile("utf8");return Object.fromEntries(s.split(/\n|\r\n|\r/).filter((e=>!!e.trim())).map((e=>{const[t,s]=e.split("\t");return[t,+s]})))}}constructor(e,t,s){super(e,t,s);const a=this.pluginManager;this.chromSizesData=this.initChromSizes(),this.twobit=new o.e({filehandle:(0,i.openLocation)(this.getConf("twoBitLocation"),a)})}async getRefNames(){const e=await this.chromSizesData;return e?Object.keys(e):this.twobit.getSequenceNames()}async getRegions(){const e=await this.chromSizesData;if(e)return Object.keys(e).map((t=>({refName:t,start:0,end:e[t]})));const t=await this.twobit.getSequenceSizes();return Object.keys(t).map((e=>({refName:e,start:0,end:t[e]})))}getFeatures({refName:e,start:t,end:s}){return(0,n.ObservableCreate)((async a=>{const i=await this.twobit.getSequenceSize(e),n=void 0!==i?Math.min(i,s):s,o=await this.twobit.getSequence(e,t,n);o&&a.next(new r.A({id:`${e} ${t}-${n}`,data:{refName:e,start:t,end:n,seq:o}})),a.complete()}))}freeResources(){}}}}]);
//# sourceMappingURL=1590.87a56afb.chunk.js.map