"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[5997],{45997:function(e,n,r){r.r(n),r.d(n,{bufferToString:function(){return c},parseCsvBuffer:function(){return h},parseTsvBuffer:function(){return N}});var t=r(33028),u=r(96234),a=r(34795),i=r(77162),o=r.n(i),s=r(81073);function c(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}function f(e){return m.apply(this,arguments)}function m(){return m=(0,a.Z)(o().mark((function e(n){var u,a,i=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,r.e(2745).then(r.t.bind(r,12745,23)).then((function(e){return e.default}));case 3:return a=e.sent,e.abrupt("return",a((0,t.Z)({noheader:!0,output:"csv"},u)).fromString(c(n)));case 5:case"end":return e.stop()}}),e)}))),m.apply(this,arguments)}function l(e,n,r){var t,u=e.rows[0].cells[n].text||"",a="Text";try{t=(0,s.parseLocString)(u,r)}catch(i){}return t&&t.refName&&"number"===typeof t.start?a="LocString":/^\d+(\.\d+)?$/.test(u)&&(a="Number"),a}function p(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},r=0,t={isLoaded:!0,rows:e.map((function(e,t){var u=t+(n.hasColumnNameLine?0:1);return e.length>r&&(r=e.length),{id:String(u),cells:e.map((function(e,n){return{columnNumber:n,text:e}}))}}))},a={};if(n.hasColumnNameLine&&void 0!==n.columnNameLineNumber){var i=t.rows.splice(n.columnNameLineNumber-1,1),o=(0,u.Z)(i,1),c=o[0];c&&c.cells.forEach((function(e,n){a[n]=e.text||""}))}for(var f=[],m=[],p=function(e){m.push(e);var r=l(t,e,n.isValidRefName);"LocString"===r&&t.rows.forEach((function(r){var t=r.cells[e];t.extendedData=(0,s.parseLocString)(t.text,n.isValidRefName)})),f[e]={name:a[e],dataType:{type:r}}},h=0;h<r;h+=1)p(h);return{rowSet:t,columnDisplayOrder:m,hasColumnNames:!!n.hasColumnNameLine,columns:f,assemblyName:n.selectedAssemblyName}}function h(e){return d.apply(this,arguments)}function d(){return d=(0,a.Z)(o().mark((function e(n){var r,t,u=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,f(n);case 3:return t=e.sent,e.abrupt("return",p(t,r));case 5:case"end":return e.stop()}}),e)}))),d.apply(this,arguments)}function N(e){return v.apply(this,arguments)}function v(){return v=(0,a.Z)(o().mark((function e(n){var r,t,u=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,f(n,{delimiter:"\t"});case 3:return t=e.sent,e.abrupt("return",p(t,r));case 5:case"end":return e.stop()}}),e)}))),v.apply(this,arguments)}}}]);
//# sourceMappingURL=5997.8228038d.chunk.js.map