"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3578],{93578:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var s=a(68584),n=a(46377),r=a(99546),i=a(99834),u=a(66885);class c extends n.BaseSequenceAdapter{async getRefNames(e){const{fasta:t}=await this.setup(e);return[...t.keys()]}async getRegions(e){const{fasta:t}=await this.setup(e);return[...t.entries()].map(([e,t])=>({refName:e,start:0,end:t.sequence.length}))}async setupPre(e){const t=this.getConf("fastaLocation"),a=(n=await(0,i.openLocation)(t,this.pluginManager).readFile("utf8"),new Map(n.split(">").filter(e=>/\S/.test(e)).map(e=>{const[t,...a]=e.split("\n"),[s,...n]=t.split(" "),r=a.join("").replace(/\s/g,"");return[s,{description:n.join(" "),sequence:r}]})));var n;return{fasta:new Map([...a.entries()].map(([e,t])=>[(0,s.readConfObject)(this.config,"rewriteRefNames",{refName:e})||e,t]))}}async getHeader(){const e=this.getConf("metadataLocation");return""===e.uri||"/path/to/fa.metadata.yaml"===e.uri?null:(0,i.openLocation)(e,this.pluginManager).readFile("utf8")}async setup(e){return this.setupP||(this.setupP=this.setupPre(e).catch(e=>{throw this.setupP=void 0,e})),this.setupP}getFeatures(e,t){const{refName:a,start:s,end:n}=e;return(0,u.ObservableCreate)(async e=>{const{fasta:i}=await this.setup(t),u=i.get(a);u&&e.next(new r.SimpleFeature({id:`${a}-${s}-${n}`,data:{refName:a,start:s,end:n,seq:u.sequence.slice(s,n)}})),e.complete()})}}}}]);
//# sourceMappingURL=3578.ea7325b7.chunk.js.map