"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2635],{2635:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var r=a(32598),s=a(46377),n=a(99546),i=a(99834),o=a(66885),c=a(6434),l=a(52645),d=a(77744),u=a(18340);class f extends s.BaseFeatureDataAdapter{calculatedIntervalTreeMap={};async loadDataP(e){const{statusCallback:t=()=>{}}=e||{},a=await(0,n.fetchAndMaybeUnzip)((0,i.openLocation)(this.getConf("gffLocation"),this.pluginManager),e),{header:s,featureMap:o}=function(e,t=()=>{}){const a=[],r={};return(0,u.P)(e,e=>{if(e.startsWith("#"))a.push(e);else{if(e.startsWith(">"))return!1;{const t=e.indexOf("\t"),a=e.slice(0,t);r[a]||(r[a]=""),r[a]+=`${e}\n`}}return!0},t),{header:a.join("\n"),featureMap:r}}(a,t);return{header:s,intervalTreeMap:Object.fromEntries(Object.entries(o).map(([e,t])=>[e,a=>{if(!this.calculatedIntervalTreeMap[e]){a?.("Parsing GFF data");const s=new r.Ay;for(const a of(0,l.g)(t).flat().map((t,a)=>new c.A({data:(0,d.d)(t),id:`${this.id}-${e}-${a}`})))s.insert([a.get("start"),a.get("end")],a);this.calculatedIntervalTreeMap[e]=s}return this.calculatedIntervalTreeMap[e]}]))}}async loadData(e){return this.gffFeatures||(this.gffFeatures=this.loadDataP(e).catch(e=>{throw this.gffFeatures=void 0,e})),this.gffFeatures}async getRefNames(e={}){const{intervalTreeMap:t}=await this.loadData(e);return Object.keys(t)}async getHeader(e={}){const{header:t}=await this.loadData(e);return t}getFeatures(e,t={}){return(0,o.ObservableCreate)(async a=>{try{const{start:r,end:s,refName:n}=e,{intervalTreeMap:i}=await this.loadData(t);for(const e of i[n]?.(t.statusCallback).search([r,s])||[])a.next(e);a.complete()}catch(e){a.error(e)}},t.stopToken)}}},18340:(e,t,a)=>{a.d(t,{P:()=>s});var r=a(99546);function s(e,t,a=()=>{}){const s=new TextDecoder("utf8");let n=0,i=0;for(;n<e.length;){const o=e.indexOf(10,n),c=-1===o?e.length:o,l=e.subarray(n,c),d=s.decode(l).trim();if(d&&!1===t(d,i))break;i++%1e4==0&&a(`Loading ${(0,r.getProgressDisplayStr)(n,e.length)}`),n=c+1}}},77744:(e,t,a)=>{function r(e){const{end:t,start:a,child_features:s,derived_features:n,attributes:i,type:o,source:c,phase:l,seq_id:d,score:u,strand:f}=e;let h;"+"===f?h=1:"-"===f?h=-1:"."===f&&(h=0);const p=new Set(["start","end","seq_id","score","type","source","phase","strand"]),g=i||{},b={};for(const e of Object.keys(g)){let t=e.toLowerCase();if(p.has(t)&&(t+="2"),g[e]&&"_lineHash"!==e){let a=g[e];Array.isArray(a)&&1===a.length&&([a]=a),b[t]=a}}return{...b,start:a-1,end:t,strand:h,type:o,source:c,refName:d,derived_features:n,phase:null===l?void 0:Number(l),score:null===u?void 0:u,subfeatures:s.flatMap(e=>e.map(e=>r(e)))}}a.d(t,{d:()=>r})}}]);
//# sourceMappingURL=2635.05192aef.chunk.js.map