"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[6310],{6310:(t,e,r)=>{r.r(e),r.d(e,{parseBedBuffer:()=>a});var n=r(8543),s=r(32622);function a(t){const e=(0,s.P)(t),r=e.filter(t=>!(t.startsWith("#")||t.startsWith("browser")||t.startsWith("track"))),a=e.findLast(t=>t.startsWith("#")),i=["refName","start","end"],o=Math.max(0,(r[0]?.split("\t").length||0)-i.length),c=a?.includes("\t")?a.slice(1).split("\t").slice(i.length).map(t=>t.trim()):Array.from({length:o},(t,e)=>`field_${e}`);return{columns:[...i,...c].map(t=>({name:t})),rowSet:{rows:r.map((t,e)=>{const r=t.split("\t");return{cellData:{refName:r[0],start:+r[1],end:+r[2],name:r[3],score:r[4],strand:r[5],...Object.fromEntries(c.map((t,e)=>{const s=r[e+i.length];return[t,(0,n.E)(s)?+s:s]}))},feature:{uniqueId:`bed-${e}`,refName:r[0],start:+r[1],end:+r[2],name:r[3],score:r[4],strand:(0,s.c)(r[5]),...Object.fromEntries(c.map((t,e)=>{const s=r[e+i.length];return[t,(0,n.E)(s)?+s:s]}))}}})}}}},8543:(t,e,r)=>{function n(t){return"number"==typeof t?t-t===0:"string"==typeof t&&""!==t.trim()&&Number.isFinite(+t)}r.d(e,{E:()=>n})},32622:(t,e,r)=>{function n(t){return"+"===t?1:"-"===t?-1:void 0}function s(t){return new TextDecoder("utf8").decode(t).split(/\n|\r\n|\r/).map(t=>t.trim()).filter(t=>!!t)}r.d(e,{P:()=>s,c:()=>n})}}]);
//# sourceMappingURL=6310.e1cbcd5f.chunk.js.map