"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3285],{23285:(e,t,n)=>{n.r(t),n.d(t,{bufferToString:()=>s,parseCsvBuffer:()=>u,parseTsvBuffer:()=>i});var r=n(90872);function s(e){return new TextDecoder("utf8",{fatal:!0}).decode(e)}async function o(e,t={}){return(await n.e(2460).then(n.t.bind(n,2460,23)).then((e=>e.default)))({noheader:!0,output:"csv",...t}).fromString(s(e))}function a(e,t,n){const s=e.rows[0].cells[t].text||"";let o,a="Text";try{o=(0,r.parseLocString)(s,n)}catch(e){}return o?.refName&&"number"==typeof o.start?a="LocString":/^\d+(\.\d+)?$/.test(s)&&(a="Number"),a}function c(e,t={}){const{hasColumnNameLine:n=!1,columnNameLineNumber:s=1,isValidRefName:o=(()=>!1),selectedAssemblyName:c}=t;let u=0;const i={isLoaded:!0,rows:e.map(((e,t)=>{const r=t+(n?0:1);return e.length>u&&(u=e.length),{id:String(r),cells:e.map(((e,t)=>({columnNumber:t,text:e})))}}))},l={};if(n&&void 0!==s){const[e]=i.rows.splice(s-1,1);e&&e.cells.forEach(((e,t)=>{l[t]=e.text||""}))}const f=[],m=[];for(let e=0;e<u;e+=1){m.push(e);const t=a(i,e,o);if("LocString"===t)for(const t of i.rows){const n=t.cells[e];n.extendedData=(0,r.parseLocString)(n.text,o)}f[e]={name:l[e],dataType:{type:t}}}return{rowSet:i,columnDisplayOrder:m,hasColumnNames:!!n,columns:f,assemblyName:c}}async function u(e,t){return c(await o(e),t)}async function i(e,t){return c(await o(e,{delimiter:"\t"}),t)}}}]);
//# sourceMappingURL=3285.116b49c1.chunk.js.map