text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rexdialogquest=e():t.rexdialogquest=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=315)}({0:function(t,e){t.exports=function(t,e,n){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var i=e.split("."),r=t,s=n,o=0;o<i.length;o++){if(!r.hasOwnProperty(i[o])){s=n;break}s=r[i[o]],r=r[i[o]]}return s}return n}return n}},1:function(t,e,n){"use strict";e.a={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter:function(){this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown()},getEventEmitter:function(){return this._eventEmitter},on:function(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once:function(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off:function(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit:function(){return this._eventEmitter&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener:function(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener:function(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners:function(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount:function(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners:function(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]}}},131:function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var n=t.length-1,i=t[e],r=e;r<n;r++)t[r]=t[r+1];return t.length=n,i}}},188:function(t,e,n){var i=n(131);t.exports=function(t,e,n,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(i(t,s),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;){var a=e[o];-1!==(s=t.indexOf(a))?(i(t,s),n&&n.call(r,a)):e.pop(),o--}return e}},197:function(t,e,n){"use strict";var i=n(1),r=n(0),s=n.n(r),o=n(76),a=n.n(o),u=n(68),h=function(t,e){if(!e)return t;for(var n in t)t[n]=e(t[n],n);return t},f=function(t,e){var n=s()(e,"delimiter",","),i=a.a.parse(t,{header:!0,delimiter:n}).data,r=s()(e,"types.question","q"),o=s()(e,"types.option",""),f=s()(e,"convert",!0);!0===f&&(f=u.a);for(var c,l,d,p,m=[],y=0,g=i.length;y<g;y++)l=(c=i[y]).type,delete c.type,l===r?(""===(d=c).key&&delete d.key,h(d,f),d.options=[],m.push(d)):l===o&&d&&(""===(p=c).key&&delete p.key,h(p,f),d.options.push(p));return m},c=n(188),l=n.n(c),d=n(9),p=n(35),m=n.n(p),y=n(70),g=n.n(y),v=n(99);function _(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var b=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setEventEmitter(s()(n,"eventEmitter",void 0)),this.questionsManager=e,this.questionKeys=[],this.resetFromJSON(n),this.start()}var e,n,i;return e=t,(n=[{key:"resetFromJSON",value:function(t){return this.setShuffleQuestionsEnable(s()(t,"shuffleQuestions",!1)),this.setShuffleOptionsEnable(s()(t,"shuffleOptions",!1)),this}},{key:"shutdown",value:function(){this.destroyEventEmitter(),this.questionsManager=void 0}},{key:"destroy",value:function(){this.shutdown()}},{key:"setShuffleQuestionsEnable",value:function(t){return void 0===t&&(t=!0),this.shuffleQuestionsEnable=t,this}},{key:"setShuffleOptionsEnable",value:function(t){return void 0===t&&(t=!0),this.shuffleOptionsEnable=t,this}},{key:"start",value:function(){return this.questionKeys.length=0,this.questionsManager.getKeys(this.questionKeys),this.shuffleQuestionsEnable&&g()(this.questionKeys),this.nextIndex=-1,this.nextKey=void 0,this}},{key:"setNextKey",value:function(t){return void 0===t?(this.nextIndex++,this.nextKey=this.questionKeys[this.nextIndex]):this.questionsManager.has(t)&&(this.nextKey=t,this.nextIndex=this.questionKeys.indexOf(t)),this}},{key:"getQuestion",value:function(){var t=this.questionsManager.get(this.nextKey);if(this.shuffleOptionsEnable){var e=t.options;e&&g()(e)}return this.emit("quest",t,this.questionsManager,this),t}},{key:"getNextQuestion",value:function(t){return this.setNextKey(t).getQuestion()}},{key:"isLastQuestion",value:function(){return this.nextIndex===this.questionKeys.length-1}},{key:"getOption",value:function(t,e){return void 0===e&&(e=t,t=this.questionsManager.get(this.nextKey)),this.questionsManager.getOption(t,e)}}])&&_(e.prototype,n),i&&_(e,i),t}();Object.assign(b.prototype,i.a,v.a);var E=b,k={newQuest:function(t){return new E(this,t)},startQuest:function(t){return this._quest?this._quest.resetFromJSON(t).start():(m()(t)||(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),this._quest=this.newQuest(t)),this},restartQuest:function(){return this._quest.start(),this},getNextQuestion:function(t){return this._quest.getNextQuestion(t)},isLastQuestion:function(){return this._quest.isLastQuestion()}};function w(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var O=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setEventEmitter(s()(e,"eventEmitter",void 0)),this.questions=[],this.questionMap={},this._quest=void 0;var n=s()(e,"questions",void 0);n&&this.add(n,e);var i=s()(e,"quest",void 0);i&&this.startQuest(i)}var e,n,i;return e=t,(n=[{key:"shutdown",value:function(){this.destroyEventEmitter(),this._quest&&(this._quest.destroy(),this._quest=void 0)}},{key:"destroy",value:function(){this.shutdown()}},{key:"add",value:function(t,e){if("string"==typeof t&&(t=f(t,e)),Array.isArray(t))for(var n=t,i=0,r=n.length;i<r;i++)this._add(n[i]);else this._add(itme);return this}},{key:"_add",value:function(t){var e=t.options;if(e)for(var n,i=0,r=e.length;i<r;i++)(n=e[i]).hasOwnProperty("key")||(n.key="_".concat(i));t.hasOwnProperty("key")||(t.key="_".concat(this.questions.length));var s=t.key;this.questionMap.hasOwnProperty(s)&&this.remove(s),this.questions.push(t),this.questionMap[s]=t}},{key:"remove",value:function(t){return this.questionMap.hasOwnProperty(t)&&(l()(this.questions,this.questionMap[t]),delete this.questionMap[t]),this}},{key:"removeAll",value:function(){this.questions.length=0,Object(d.a)(this.questionMap)}},{key:"has",value:function(t){return this.questionMap.hasOwnProperty(t)}},{key:"get",value:function(t){return this.questionMap[t]}},{key:"getKeys",value:function(t){void 0===t&&(t=[]);for(var e=0,n=this.questions.length;e<n;e++)t.push(this.questions[e].key);return t}},{key:"getOption",value:function(t,e){if("string"==typeof t&&(t=this.get(t)),!t)return null;var n=t.options;if(n)for(var i,r=0,s=n.length;r<s;r++)if((i=n[r]).key===e)return i;return null}}])&&w(e.prototype,n),i&&w(e,i),t}();Object.assign(O.prototype,i.a,k,{getData:function(t,e){return this._quest.getData(t,e)},setData:function(t,e){return this._quest.setData(t,e),this},incData:function(t,e,n){return this._quest.incData(t,e,n),this},mulData:function(t,e,n){return this._quest.mulData(t,e,n),this},clearData:function(){return this._quest.clearData(),this}});e.a=O},315:function(t,e,n){"use strict";n.r(e);var i=n(197);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=Phaser.Events.EventEmitter,h=Phaser.Utils.Objects.GetValue,f=function(t){function e(t){var n,a,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a=this,n=!(u=s(e).call(this))||"object"!==r(u)&&"function"!=typeof u?o(a):u,void 0===t&&(t={}),t.quest||(t.quest=!0),n.dialog=h(t,"dialog",void 0),n.questionManager=new i.a(t),n.questionManager.on("quest",function(t){for(var e,n=this.dialog.getElement("choices"),i=t.options,r=0,s=n.length;r<s;r++)(e=i[r])?(this.dialog.showChoice(r),this.emit("update-choice",n[r],e,this)):this.dialog.hideChoice(r);this.emit("update-dialog",this.dialog,t,this)},o(n)),n.dialog.on("button.click",function(t,e,n){var i="click-"+("choices"===e?"choice":"action");this.emit(i,t,this.dialog,this)},o(n)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,u),e}();Object.assign(f.prototype,{start:function(t){return this.questionManager.restartQuest().getNextQuestion(t),this},next:function(t){return this.questionManager.getNextQuestion(t),this},isLast:function(){return this.questionManager.isLastQuestion()}},{getData:function(t,e){return this.questionManager.getData(t,e)},setData:function(t,e){return this.questionManager.setData(t,e),this},incData:function(t,e,n){return this.questionManager.incData(t,e,n),this},mulData:function(t,e,n){return this.questionManager.mulData(t,e,n),this},clearData:function(){return this.questionManager.clearData(),this}});e.default=f},35:function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){if("object"!==n(t)||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},68:function(t,e,n){"use strict";var i=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;e.a=function(t){return"string"!=typeof t?t:(""===t?t=null:i.test(t)?t=parseFloat(t):"false"===screen?t=!1:"true"===t&&(t=!0),t)}},70:function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[n],t[n]=i}return t}},76:function(t,e,n){var i,r,s;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),r=[],void 0===(s="function"==typeof(i=function(){"use strict";var t,e,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},i=!n.document&&!!n.postMessage,r=i&&/(\?|&)papaworker(=|&|$)/.test(n.location.search),s=!1,a={},u=0,h={parse:function(e,i){var r=(i=i||{}).dynamicTyping||!1;if(O(r)&&(i.dynamicTypingFunction=r,r={}),i.dynamicTyping=r,i.transform=!!O(i.transform)&&i.transform,i.worker&&h.WORKERS_SUPPORTED){var o=function(){if(!h.WORKERS_SUPPORTED)return!1;if(!s&&null===h.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var e=h.SCRIPT_PATH||t;e+=(-1!==e.indexOf("?")?"&":"?")+"papaworker";var i=new n.Worker(e);return i.onmessage=_,i.id=u++,a[i.id]=i}();return o.userStep=i.step,o.userChunk=i.chunk,o.userComplete=i.complete,o.userError=i.error,i.step=O(i.step),i.chunk=O(i.chunk),i.complete=O(i.complete),i.error=O(i.error),delete i.worker,void o.postMessage({input:e,config:i,workerId:o.id})}var f=null;return h.NODE_STREAM_INPUT,"string"==typeof e?f=i.download?new l(i):new p(i):!0===e.readable&&O(e.read)&&O(e.on)?f=new m(i):(n.File&&e instanceof File||e instanceof Object)&&(f=new d(i)),f.stream(e)},unparse:function(t,e){var n=!1,i=!0,r=",",s="\r\n",a='"',u=!1;"object"==o(e)&&("string"!=typeof e.delimiter||h.BAD_DELIMITERS.filter(function(t){return-1!==e.delimiter.indexOf(t)}).length||(r=e.delimiter),("boolean"==typeof e.quotes||Array.isArray(e.quotes))&&(n=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(u=e.skipEmptyLines),"string"==typeof e.newline&&(s=e.newline),"string"==typeof e.quoteChar&&(a=e.quoteChar),"boolean"==typeof e.header&&(i=e.header));var f=new RegExp(g(a),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return l(null,t,u);if("object"==o(t[0]))return l(c(t[0]),t,u)}else if("object"==o(t))return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:c(t.data[0])),Array.isArray(t.data[0])||"object"==o(t.data[0])||(t.data=[t.data])),l(t.fields||[],t.data||[],u);throw"exception: Unable to serialize unrecognized input";function c(t){if("object"!=o(t))return[];var e=[];for(var n in t)e.push(n);return e}function l(t,e,n){var o="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&0<t.length,u=!Array.isArray(e[0]);if(a&&i){for(var h=0;h<t.length;h++)0<h&&(o+=r),o+=d(t[h],h);0<e.length&&(o+=s)}for(var f=0;f<e.length;f++){var c=a?t.length:e[f].length,l=!1,p=a?0===Object.keys(e[f]).length:0===e[f].length;if(n&&!a&&(l="greedy"===n?""===e[f].join("").trim():1===e[f].length&&0===e[f][0].length),"greedy"===n&&a){for(var m=[],y=0;y<c;y++){var g=u?t[y]:y;m.push(e[f][g])}l=""===m.join("").trim()}if(!l){for(var v=0;v<c;v++){0<v&&!p&&(o+=r);var _=a&&u?t[v]:v;o+=d(e[f][_],v)}f<e.length-1&&(!n||0<c&&!p)&&(o+=s)}}return o}function d(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);t=t.toString().replace(f,a+a);var i="boolean"==typeof n&&n||Array.isArray(n)&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(-1<t.indexOf(e[n]))return!0;return!1}(t,h.BAD_DELIMITERS)||-1<t.indexOf(r)||" "===t.charAt(0)||" "===t.charAt(t.length-1);return i?a+t+a:t}}};if(h.RECORD_SEP=String.fromCharCode(30),h.UNIT_SEP=String.fromCharCode(31),h.BYTE_ORDER_MARK="\ufeff",h.BAD_DELIMITERS=["\r","\n",'"',h.BYTE_ORDER_MARK],h.WORKERS_SUPPORTED=!i&&!!n.Worker,h.SCRIPT_PATH=null,h.NODE_STREAM_INPUT=1,h.LocalChunkSize=10485760,h.RemoteChunkSize=5242880,h.DefaultDelimiter=",",h.Parser=v,h.ParserHandle=y,h.NetworkStreamer=l,h.FileStreamer=d,h.StringStreamer=p,h.ReadableStreamStreamer=m,n.jQuery){var f=n.jQuery;f.fn.parse=function(t){var e=t.config||{},i=[];return this.each(function(t){if("INPUT"!==f(this).prop("tagName").toUpperCase()||"file"!==f(this).attr("type").toLowerCase()||!n.FileReader||!this.files||0===this.files.length)return!0;for(var r=0;r<this.files.length;r++)i.push({file:this.files[r],inputElem:this,instanceConfig:f.extend({},e)})}),r(),this;function r(){if(0!==i.length){var e,n,r,a,u=i[0];if(O(t.before)){var c=t.before(u.file,u.inputElem);if("object"==o(c)){if("abort"===c.action)return e="AbortError",n=u.file,r=u.inputElem,a=c.reason,void(O(t.error)&&t.error({name:e},n,r,a));if("skip"===c.action)return void s();"object"==o(c.config)&&(u.instanceConfig=f.extend(u.instanceConfig,c.config))}else if("skip"===c)return void s()}var l=u.instanceConfig.complete;u.instanceConfig.complete=function(t){O(l)&&l(t,u.file,u.inputElem),s()},h.parse(u.file,u.instanceConfig)}else O(t.complete)&&t.complete()}function s(){i.splice(0,1),r()}}}function c(t){this._handle=null,this._finished=!1,this._completed=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=k(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new y(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&O(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(t);void 0!==i&&(t=i)}this.isFirstChunk=!1;var s=this._partialLine+t;this._partialLine="";var o=this._handle.parse(s,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var a=o.meta.cursor;this._finished||(this._partialLine=s.substring(a-this._baseIndex),this._baseIndex=a),o&&o.data&&(this._rowCount+=o.data.length);var u=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)n.postMessage({results:o,workerId:h.WORKER_ID,finished:u});else if(O(this._config.chunk)&&!e){if(this._config.chunk(o,this._handle),this._handle.paused()||this._handle.aborted())return;o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),this._completed||!u||!O(this._config.complete)||o&&o.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||o&&o.meta.paused||this._nextChunk(),o}},this._sendError=function(t){O(this._config.error)?this._config.error(t):r&&this._config.error&&n.postMessage({workerId:h.WORKER_ID,error:t,finished:!1})}}function l(t){var e;(t=t||{}).chunkSize||(t.chunkSize=h.RemoteChunkSize),c.call(this,t),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),i||(e.onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)),e.open("GET",this._input,!i),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+r),e.setRequestHeader("If-None-Match","webkit-no-cache")}try{e.send()}catch(t){this._chunkError(t.message)}i&&0===e.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){var t;4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._finished=!this._config.chunkSize||this._start>(null===(t=e.getResponseHeader("Content-Range"))?-1:parseInt(t.substr(t.lastIndexOf("/")+1))),this.parseChunk(e.responseText)))},this._chunkError=function(t){var n=e.statusText||t;this._sendError(new Error(n))}}function d(t){var e,n;(t=t||{}).chunkSize||(t.chunkSize=h.LocalChunkSize),c.call(this,t);var i="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,n=t.slice||t.webkitSlice||t.mozSlice,i?((e=new FileReader).onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var r=Math.min(this._start+this._config.chunkSize,this._input.size);t=n.call(t,this._start,r)}var s=e.readAsText(t,this._config.encoding);i||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function p(t){var e;c.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,n=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(n)}}}function m(t){c.call(this,t=t||{});var e=[],n=!0,i=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):n=!0},this._streamData=w(function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}},this),this._streamError=w(function(t){this._streamCleanUp(),this._sendError(t)},this),this._streamEnd=w(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(t){var e,n,i,r=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,s=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,o=this,a=0,u=0,f=!1,c=!1,l=[],d={data:[],errors:[],meta:{}};if(O(t.step)){var p=t.step;t.step=function(e){if(d=e,_())y();else{if(y(),0===d.data.length)return;a+=e.data.length,t.preview&&a>t.preview?n.abort():p(d,o)}}}function m(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function y(){if(d&&i&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+h.DefaultDelimiter+"'"),i=!1),t.skipEmptyLines)for(var e=0;e<d.data.length;e++)m(d.data[e])&&d.data.splice(e--,1);return _()&&function(){if(d){for(var e=0;_()&&e<d.data.length;e++)for(var n=0;n<d.data[e].length;n++){var i=d.data[e][n];t.trimHeaders&&(i=i.trim()),l.push(i)}d.data.splice(0,1)}}(),function(){if(!d||!t.header&&!t.dynamicTyping&&!t.transform)return d;for(var e=0;e<d.data.length;e++){var n,i=t.header?{}:[];for(n=0;n<d.data[e].length;n++){var r=n,s=d.data[e][n];t.header&&(r=n>=l.length?"__parsed_extra":l[n]),t.transform&&(s=t.transform(s,r)),s=b(r,s),"__parsed_extra"===r?(i[r]=i[r]||[],i[r].push(s)):i[r]=s}d.data[e]=i,t.header&&(n>l.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+l.length+" fields but parsed "+n,u+e):n<l.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+l.length+" fields but parsed "+n,u+e))}return t.header&&d.meta&&(d.meta.fields=l),u+=d.data.length,d}()}function _(){return t.header&&0===l.length}function b(e,n){return i=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[i]&&(t.dynamicTyping[i]=t.dynamicTypingFunction(i)),!0===(t.dynamicTyping[i]||t.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(r.test(n)?parseFloat(n):s.test(n)?new Date(n):""===n?null:n):n;var i}function E(t,e,n,i){d.errors.push({type:t,code:e,message:n,row:i})}this.parse=function(r,s,o){var a=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var n=new RegExp(g(e)+"([^]*?)"+g(e),"gm"),i=(t=t.replace(n,"")).split("\r"),r=t.split("\n"),s=1<r.length&&r[0].length<i[0].length;if(1===i.length||s)return"\n";for(var o=0,a=0;a<i.length;a++)"\n"===i[a][0]&&o++;return o>=i.length/2?"\r\n":"\r"}(r,a)),i=!1,t.delimiter)O(t.delimiter)&&(t.delimiter=t.delimiter(r),d.meta.delimiter=t.delimiter);else{var u=function(e,n,i,r){for(var s,o,a,u=[",","\t","|",";",h.RECORD_SEP,h.UNIT_SEP],f=0;f<u.length;f++){var c=u[f],l=0,d=0,p=0;a=void 0;for(var y=new v({comments:r,delimiter:c,newline:n,preview:10}).parse(e),g=0;g<y.data.length;g++)if(i&&m(y.data[g]))p++;else{var _=y.data[g].length;d+=_,void 0!==a?1<_&&(l+=Math.abs(_-a),a=_):a=0}0<y.data.length&&(d/=y.data.length-p),(void 0===o||o<l)&&1.99<d&&(o=l,s=c)}return{successful:!!(t.delimiter=s),bestDelimiter:s}}(r,t.newline,t.skipEmptyLines,t.comments);u.successful?t.delimiter=u.bestDelimiter:(i=!0,t.delimiter=h.DefaultDelimiter),d.meta.delimiter=t.delimiter}var c=k(t);return t.preview&&t.header&&c.preview++,e=r,n=new v(c),d=n.parse(e,s,o),y(),f?{meta:{paused:!0}}:d||{meta:{paused:!1}}},this.paused=function(){return f},this.pause=function(){f=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){f=!1,o.streamer.parseChunk(e,!0)},this.aborted=function(){return c},this.abort=function(){c=!0,n.abort(),d.meta.aborted=!0,O(t.complete)&&t.complete(d),e=""}}function g(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(t){var e,n=(t=t||{}).delimiter,i=t.newline,r=t.comments,s=t.step,o=t.preview,a=t.fastMode,u=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(u=t.escapeChar),("string"!=typeof n||-1<h.BAD_DELIMITERS.indexOf(n))&&(n=","),r===n)throw"Comment character same as delimiter";!0===r?r="#":("string"!=typeof r||-1<h.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var f=0,c=!1;this.parse=function(t,h,l){if("string"!=typeof t)throw"Input must be a string";var d=t.length,p=n.length,m=i.length,y=r.length,v=O(s),_=[],b=[],E=[],k=f=0;if(!t)return j();if(a||!1!==a&&-1===t.indexOf(e)){for(var w=t.split(i),S=0;S<w.length;S++){if(E=w[S],f+=E.length,S!==w.length-1)f+=i.length;else if(l)return j();if(!r||E.substr(0,y)!==r){if(v){if(_=[],T(E.split(n)),L(),c)return j()}else T(E.split(n));if(o&&o<=S)return _=_.slice(0,o),j(!0)}}return j()}for(var x,C=t.indexOf(n,f),q=t.indexOf(i,f),D=new RegExp(g(u)+g(e),"g");;)if(t[f]!==e)if(r&&0===E.length&&t.substr(f,y)===r){if(-1===q)return j();f=q+m,q=t.indexOf(i,f),C=t.indexOf(n,f)}else if(-1!==C&&(C<q||-1===q))E.push(t.substring(f,C)),f=C+p,C=t.indexOf(n,f);else{if(-1===q)break;if(E.push(t.substring(f,q)),P(q+m),v&&(L(),c))return j();if(o&&_.length>=o)return j(!0)}else for(x=f,f++;;){if(-1===(x=t.indexOf(e,x+1)))return l||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:f}),A();if(x===d-1)return A(t.substring(f,x).replace(D,e));if(e!==u||t[x+1]!==u){if(e===u||0===x||t[x-1]!==u){var R=I(-1===q?C:Math.min(C,q));if(t[x+1+R]===n){E.push(t.substring(f,x).replace(D,e)),f=x+1+R+p,C=t.indexOf(n,f),q=t.indexOf(i,f);break}var M=I(q);if(t.substr(x+1+M,m)===i){if(E.push(t.substring(f,x).replace(D,e)),P(x+1+M+m),C=t.indexOf(n,f),v&&(L(),c))return j();if(o&&_.length>=o)return j(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:f}),x++}}else x++}return A();function T(t){_.push(t),k=f}function I(e){var n=0;if(-1!==e){var i=t.substring(x+1,e);i&&""===i.trim()&&(n=i.length)}return n}function A(e){return l||(void 0===e&&(e=t.substr(f)),E.push(e),f=d,T(E),v&&L()),j()}function P(e){f=e,T(E),E=[],q=t.indexOf(i,f)}function j(t){return{data:_,errors:b,meta:{delimiter:n,linebreak:i,aborted:c,truncated:!!t,cursor:k+(h||0)}}}function L(){s(j()),_=[],b=[]}},this.abort=function(){c=!0},this.getCharIndex=function(){return f}}function _(t){var e=t.data,n=a[e.workerId],i=!1;if(e.error)n.userError(e.error,e.file);else if(e.results&&e.results.data){var r={abort:function(){i=!0,b(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:E,resume:E};if(O(n.userStep)){for(var s=0;s<e.results.data.length&&(n.userStep({data:[e.results.data[s]],errors:e.results.errors,meta:e.results.meta},r),!i);s++);delete e.results}else O(n.userChunk)&&(n.userChunk(e.results,r,e.file),delete e.results)}e.finished&&!i&&b(e.workerId,e.results)}function b(t,e){var n=a[t];O(n.userComplete)&&n.userComplete(e),n.terminate(),delete a[t]}function E(){throw"Not implemented."}function k(t){if("object"!=o(t)||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=k(t[n]);return e}function w(t,e){return function(){t.apply(e,arguments)}}function O(t){return"function"==typeof t}return r?n.onmessage=function(t){var e=t.data;if(void 0===h.WORKER_ID&&e&&(h.WORKER_ID=e.workerId),"string"==typeof e.input)n.postMessage({workerId:h.WORKER_ID,results:h.parse(e.input,e.config),finished:!0});else if(n.File&&e.input instanceof File||e.input instanceof Object){var i=h.parse(e.input,e.config);i&&n.postMessage({workerId:h.WORKER_ID,results:i,finished:!0})}}:h.WORKERS_SUPPORTED&&(e=document.getElementsByTagName("script"),t=e.length?e[e.length-1].src:"",document.body?document.addEventListener("DOMContentLoaded",function(){s=!0},!0):s=!0),(l.prototype=Object.create(c.prototype)).constructor=l,(d.prototype=Object.create(c.prototype)).constructor=d,(p.prototype=Object.create(p.prototype)).constructor=p,(m.prototype=Object.create(c.prototype)).constructor=m,h})?i.apply(e,r):i)||(t.exports=s)},9:function(t,e,n){"use strict";e.a=function(t){if(Array.isArray(t))t.length=0;else for(var e in t)delete t[e]}},99:function(t,e,n){"use strict";var i=n(0),r=n.n(i),s=n(9);e.a={enableData:function(){return void 0===this.data&&(this.data={}),this},getData:function(t,e){return this.enableData(),void 0===t?this.data:r()(this.data,t,e)},setData:function(t,e){return this.enableData(),this.data[t]=e,this},incData:function(t,e,n){return void 0===n&&(n=0),this.enableData(),this.setData(t,this.getData(t,n)+e),this},mulData:function(t,e,n){return void 0===n&&(n=0),this.enableData(),this.setData(t,this.getData(t,n)*e),this},clearData:function(){return this.data&&Object(s.a)(this.data),this}}}}).default});