"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/defineProperty");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(e),s=i(r),u=i(t),o=i(n);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){o.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var c=s.default((function e(){var r=this;u.default(this,e),o.default(this,"getConfiguration",(function(e){var t=null,n=null,i=null,s=!1;e.forEach((function(e){if(e.toLowerCase().startsWith("~version"))s=!0;else if(e.toLowerCase().startsWith("~"))s=!1;else{if(s){var u=e.split(" ").filter(Boolean),o=a.default(u,3),l=o[0],f=o[1],c=o[2];switch(l){case"VERS.":t=f;break;case"WRAP.":n=f;break;case"DLM":i=c}}r.config={version:t,wrap:n,delimiter:i}}}))})),o.default(this,"parseHeaders",(function(e){var t=e.split("\n");r.getConfiguration(t);var n=!1;return t.reduce((function(e,r){if(r.toLowerCase().startsWith("~curve"))return n=!0,e;if(r.startsWith("~")&&(n=!1),n&&!r.startsWith("#")&&!r.startsWith("\r")){var t=r.split(" ").filter(Boolean);return t?e.push(t[0]):e}return e}),[])})),o.default(this,"parseData",(function(e,r,t){var n=e.split("\n"),i=!1;return n.reduce((function(e,n){if(n.toLowerCase().startsWith("~a"))return i=!0,e;if(n.startsWith("~")&&(i=!1),i){var a=n.split(/[\t\s,]/).filter(Boolean).reduce((function(e,n,i){var a=r[i],s=t.find((function(e){return e.parsingKey===a}));if(s){var u=s.innerKey;return f(f({},e),{},o.default({},u,parseFloat(n,2)))}return e}),{});return a.isEmpty()?e:e.push(a)}return e}),[])})),this.config={version:null,wrap:null,delimiter:null}}));exports.LasParser=c,exports.default=c;
//# sourceMappingURL=lasParser.js.map
