"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9756],{49756:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var s=a(46377),r=a(99546),n=a(66885),o=a(37347),c=a(44728),i=a(82088);class u extends s.BaseFeatureDataAdapter{gcMode="content";static capabilities=["hasLocalStats"];async configure(){const e=await(this.getSubAdapter?.(this.getConf("sequenceAdapter")));if(!e)throw new Error("Error getting subadapter");return e.dataAdapter}async getRefNames(e){return(await this.configure()).getRefNames(e)}getFeatures(e,t){const{statusCallback:a=()=>{},stopToken:s}=t||{};return(0,n.ObservableCreate)((async n=>{const u=await this.configure(),l=this.getConf("windowSize"),g=this.getConf("windowDelta"),w=1===l?1:Math.ceil(l/2),d=1===l,f=Math.max(0,Math.floor((e.start-w)/l)*l),h=Math.ceil((e.end+w)/l)*l;if(h<0||f>h)return void n.complete();const p=await(0,c._)(u.getFeatures({...e,start:f,end:h},t).pipe((0,i.$)())),b=p[0]?.get("seq")||"";let m=performance.now();await(0,r.updateStatus)("Calculating GC",a,(()=>{for(let t=w;t<b.length-w;t+=g){performance.now()-m>400&&((0,o.SW)(s),m=performance.now());const a=d?b[t]:b.slice(t-w,t+w);let c=0,i=0,u=0;for(const e of a)"c"===e||"C"===e?c++:"g"!==e&&"G"!==e||i++,"N"!==e&&u++;const l=f,h="content"===this.gcMode?(i+c)/(u||1):"skew"===this.gcMode?(i-c)/(i+c||1):0;n.next(new r.SimpleFeature({uniqueId:`${this.id}_${l+t}`,refName:e.refName,start:l+t,end:l+t+g,score:h}))}})),n.complete()}))}freeResources(){}}}}]);
//# sourceMappingURL=9756.7e306b4c.chunk.js.map