phaser4-rex-plugins
Version:
9 lines • 66.7 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rexquestplugin=t()}(void 0,(function(){var e={setEventEmitter(e,t){return void 0===t&&(t=Phaser.Events.EventEmitter),this._privateEE=!0===e||void 0===e,this._eventEmitter=this._privateEE?new t:e,this},destroyEventEmitter(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter(){return this._eventEmitter},on(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit(e){return this._eventEmitter&&e&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}},t=function(e,t,n){if(!e||"number"==typeof e)return n;if("string"==typeof t){if(e.hasOwnProperty(t))return e[t];if(-1===t.indexOf("."))return n;t=t.split(".")}for(var i=t,r=e,s=n,o=0;o<i.length;o++){if(t=i[o],!r.hasOwnProperty(t)){s=n;break}r=s=r[t]}return s};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i={exports:{}};
/* @license
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/!function(e){e.exports=function e(){var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,i=t.IS_PAPA_WORKER||!1,r={},s=0,o={parse:function(n,i){var a=(i=i||{}).dynamicTyping||!1;if(k(a)&&(i.dynamicTypingFunction=a,a={}),i.dynamicTyping=a,i.transform=!!k(i.transform)&&i.transform,i.worker&&o.WORKERS_SUPPORTED){var u=function(){if(!o.WORKERS_SUPPORTED)return!1;var n,i,a=(n=t.URL||t.webkitURL||null,i=e.toString(),o.BLOB_URL||(o.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",i,")();"],{type:"text/javascript"})))),u=new t.Worker(a);return u.onmessage=m,u.id=s++,r[u.id]=u}();return u.userStep=i.step,u.userChunk=i.chunk,u.userComplete=i.complete,u.userError=i.error,i.step=k(i.step),i.chunk=k(i.chunk),i.complete=k(i.complete),i.error=k(i.error),delete i.worker,void u.postMessage({input:n,config:i,workerId:u.id})}var f=null;return o.NODE_STREAM_INPUT,"string"==typeof n?(n=function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}(n),f=i.download?new l(i):new h(i)):!0===n.readable&&k(n.read)&&k(n.on)?f=new p(i):(t.File&&n instanceof File||n instanceof Object)&&(f=new c(i)),f.stream(n)},unparse:function(e,t){var n=!1,i=!0,r=",",s="\r\n",a='"',u=a+a,l=!1,c=null,h=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(r=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(l=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(i=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");c=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+a),("boolean"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(h=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var p=new RegExp(d(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,l);if("object"==typeof e[0])return f(c||Object.keys(e[0]),e,l)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||c),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],l);throw new Error("Unable to serialize unrecognized input");function f(e,t,n){var o="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0<e.length,u=!Array.isArray(t[0]);if(a&&i){for(var l=0;l<e.length;l++)0<l&&(o+=r),o+=g(e[l],l);0<t.length&&(o+=s)}for(var c=0;c<t.length;c++){var h=a?e.length:t[c].length,p=!1,f=a?0===Object.keys(t[c]).length:0===t[c].length;if(n&&!a&&(p="greedy"===n?""===t[c].join("").trim():1===t[c].length&&0===t[c][0].length),"greedy"===n&&a){for(var d=[],m=0;m<h;m++){var y=u?e[m]:m;d.push(t[c][y])}p=""===d.join("").trim()}if(!p){for(var v=0;v<h;v++){0<v&&!f&&(o+=r);var _=a&&u?e[v]:v;o+=g(t[c][_],v)}c<t.length-1&&(!n||0<h&&!f)&&(o+=s)}}return o}function g(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);var i=!1;h&&"string"==typeof e&&h.test(e)&&(e="'"+e,i=!0);var s=e.toString().replace(p,u);return(i=i||!0===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1}(s,o.BAD_DELIMITERS)||-1<s.indexOf(r)||" "===s.charAt(0)||" "===s.charAt(s.length-1))?a+s+a:s}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!n&&!!t.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=f,o.NetworkStreamer=l,o.FileStreamer=c,o.StringStreamer=h,o.ReadableStreamStreamer=p,t.jQuery){var a=t.jQuery;a.fn.parse=function(e){var n=e.config||{},i=[];return this.each((function(e){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!t.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:a.extend({},n)})})),r(),this;function r(){if(0!==i.length){var t,n,r,u,l=i[0];if(k(e.before)){var c=e.before(l.file,l.inputElem);if("object"==typeof c){if("abort"===c.action)return t="AbortError",n=l.file,r=l.inputElem,u=c.reason,void(k(e.error)&&e.error({name:t},n,r,u));if("skip"===c.action)return void s();"object"==typeof c.config&&(l.instanceConfig=a.extend(l.instanceConfig,c.config))}else if("skip"===c)return void s()}var h=l.instanceConfig.complete;l.instanceConfig.complete=function(e){k(h)&&h(e,l.file,l.inputElem),s()},o.parse(l.file,l.instanceConfig)}else k(e.complete)&&e.complete()}function s(){i.splice(0,1),r()}}}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!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(e){var t=_(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new f(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(e);void 0!==r&&(e=r)}this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e;this._partialLine="";var a=this._handle.parse(s,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var u=a.meta.cursor;this._finished||(this._partialLine=s.substring(u-this._baseIndex),this._baseIndex=u),a&&a.data&&(this._rowCount+=a.data.length);var l=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)t.postMessage({results:a,workerId:o.WORKER_ID,finished:l});else if(k(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!l||!k(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),l||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):i&&this._config.error&&t.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var i in e)t.setRequestHeader(i,e[i])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+r)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function c(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),u.call(this,e);var i="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,i?((t=new FileReader).onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var r=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,r)}var s=t.readAsText(e,this._config.encoding);i||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function h(e){var t;u.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function p(e){u.call(this,e=e||{});var t=[],n=!0,i=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=b((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=b((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=b((function(){this._streamCleanUp(),i=!0,this._streamData("")}),this),this._streamCleanUp=b((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,i,r=Math.pow(2,53),s=-r,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^((\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)))$/,l=this,c=0,h=0,p=!1,f=!1,m=[],y={data:[],errors:[],meta:{}};if(k(e.step)){var v=e.step;e.step=function(t){if(y=t,A())w();else{if(w(),0===y.data.length)return;c+=t.data.length,e.preview&&c>e.preview?n.abort():(y.data=y.data[0],v(y,l))}}}function b(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){return y&&i&&(x("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),i=!1),e.skipEmptyLines&&(y.data=y.data.filter((function(e){return!b(e)}))),A()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;A()&&t<y.data.length;t++)y.data[t].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(t,n){k(e.transformHeader)&&(t=e.transformHeader(t,n)),m.push(t)}}(),function(){if(!y||!e.header&&!e.dynamicTyping&&!e.transform)return y;function t(t,n){var i,r=e.header?{}:[];for(i=0;i<t.length;i++){var s=i,o=t[i];e.header&&(s=i>=m.length?"__parsed_extra":m[i]),e.transform&&(o=e.transform(o,s)),o=E(s,o),"__parsed_extra"===s?(r[s]=r[s]||[],r[s].push(o)):r[s]=o}return e.header&&(i>m.length?x("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+i,h+n):i<m.length&&x("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+i,h+n)),r}var n=1;return!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(t),n=y.data.length):y.data=t(y.data,0),e.header&&y.meta&&(y.meta.fields=m),h+=n,y}()}function A(){return e.header&&0===m.length}function E(t,n){return i=t,e.dynamicTypingFunction&&void 0===e.dynamicTyping[i]&&(e.dynamicTyping[i]=e.dynamicTypingFunction(i)),!0===(e.dynamicTyping[i]||e.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(function(e){if(a.test(e)){var t=parseFloat(e);if(s<t&&t<r)return!0}return!1}(n)?parseFloat(n):u.test(n)?new Date(n):""===n?null:n):n;var i}function x(e,t,n,i){var r={type:e,code:t,message:n};void 0!==i&&(r.row=i),y.errors.push(r)}this.parse=function(r,s,a){var u=e.quoteChar||'"';if(e.newline||(e.newline=function(e,t){e=e.substring(0,1048576);var n=new RegExp(d(t)+"([^]*?)"+d(t),"gm"),i=(e=e.replace(n,"")).split("\r"),r=e.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,u)),i=!1,e.delimiter)k(e.delimiter)&&(e.delimiter=e.delimiter(r),y.meta.delimiter=e.delimiter);else{var l=function(t,n,i,r,s){var a,u,l,c;s=s||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h<s.length;h++){var p=s[h],f=0,d=0,m=0;l=void 0;for(var y=new g({comments:r,delimiter:p,newline:n,preview:10}).parse(t),v=0;v<y.data.length;v++)if(i&&b(y.data[v]))m++;else{var _=y.data[v].length;d+=_,void 0!==l?0<_&&(f+=Math.abs(_-l),l=_):l=_}0<y.data.length&&(d/=y.data.length-m),(void 0===u||f<=u)&&(void 0===c||c<d)&&1.99<d&&(u=f,a=p,c=d)}return{successful:!!(e.delimiter=a),bestDelimiter:a}}(r,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);l.successful?e.delimiter=l.bestDelimiter:(i=!0,e.delimiter=o.DefaultDelimiter),y.meta.delimiter=e.delimiter}var c=_(e);return e.preview&&e.header&&c.preview++,t=r,n=new g(c),y=n.parse(t,s,a),w(),p?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return p},this.pause=function(){p=!0,n.abort(),t=k(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){l.streamer._halted?(p=!1,l.streamer.parseChunk(t,!0)):setTimeout(l.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),y.meta.aborted=!0,k(e.complete)&&e.complete(y),t=""}}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t,n=(e=e||{}).delimiter,i=e.newline,r=e.comments,s=e.step,a=e.preview,u=e.fastMode,l=t=void 0===e.quoteChar||null===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(l=e.escapeChar),("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=","),r===n)throw new Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<o.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var c=0,h=!1;this.parse=function(o,p,f){if("string"!=typeof o)throw new Error("Input must be a string");var g=o.length,m=n.length,y=i.length,v=r.length,_=k(s),b=[],w=[],A=[],E=c=0;if(!o)return Y();if(e.header&&!p){var x=o.split(i)[0].split(n),C=[],O={},S=!1;for(var I in x){var T=x[I];k(e.transformHeader)&&(T=e.transformHeader(T,I));var j=T,L=O[T]||0;for(0<L&&(S=!0,j=T+"_"+L),O[T]=L+1;C.includes(j);)j=j+"_"+L;C.push(j)}if(S){var M=o.split(i);M[0]=C.join(n),o=M.join(i)}}if(u||!1!==u&&-1===o.indexOf(t)){for(var q=o.split(i),F=0;F<q.length;F++){if(A=q[F],c+=A.length,F!==q.length-1)c+=i.length;else if(f)return Y();if(!r||A.substring(0,v)!==r){if(_){if(b=[],z(A.split(n)),$(),h)return Y()}else z(A.split(n));if(a&&a<=F)return b=b.slice(0,a),Y(!0)}}return Y()}for(var R=o.indexOf(n,c),D=o.indexOf(i,c),N=new RegExp(d(l)+d(t),"g"),P=o.indexOf(t,c);;)if(o[c]!==t)if(r&&0===A.length&&o.substring(c,c+v)===r){if(-1===D)return Y();c=D+y,D=o.indexOf(i,c),R=o.indexOf(n,c)}else if(-1!==R&&(R<D||-1===D))A.push(o.substring(c,R)),c=R+m,R=o.indexOf(n,c);else{if(-1===D)break;if(A.push(o.substring(c,D)),W(D+y),_&&($(),h))return Y();if(a&&b.length>=a)return Y(!0)}else for(P=c,c++;;){if(-1===(P=o.indexOf(t,P+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:c}),B();if(P===g-1)return B(o.substring(c,P).replace(N,t));if(t!==l||o[P+1]!==l){if(t===l||0===P||o[P-1]!==l){-1!==R&&R<P+1&&(R=o.indexOf(n,P+1)),-1!==D&&D<P+1&&(D=o.indexOf(i,P+1));var U=Q(-1===D?R:Math.min(R,D));if(o.substr(P+1+U,m)===n){A.push(o.substring(c,P).replace(N,t)),o[c=P+1+U+m]!==t&&(P=o.indexOf(t,c)),R=o.indexOf(n,c),D=o.indexOf(i,c);break}var K=Q(D);if(o.substring(P+1+K,P+1+K+y)===i){if(A.push(o.substring(c,P).replace(N,t)),W(P+1+K+y),R=o.indexOf(n,c),P=o.indexOf(t,c),_&&($(),h))return Y();if(a&&b.length>=a)return Y(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:c}),P++}}else P++}return B();function z(e){b.push(e),E=c}function Q(e){var t=0;if(-1!==e){var n=o.substring(P+1,e);n&&""===n.trim()&&(t=n.length)}return t}function B(e){return f||(void 0===e&&(e=o.substring(c)),A.push(e),c=g,z(A),_&&$()),Y()}function W(e){c=e,z(A),A=[],D=o.indexOf(i,c)}function Y(e){return{data:b,errors:w,meta:{delimiter:n,linebreak:i,aborted:h,truncated:!!e,cursor:E+(p||0)}}}function $(){s(Y()),b=[],w=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return c}}function m(e){var t=e.data,n=r[t.workerId],i=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){i=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(k(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},s),!i);o++);delete t.results}else k(n.userChunk)&&(n.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!i&&y(t.workerId,t.results)}function y(e,t){var n=r[e];k(n.userComplete)&&n.userComplete(t),n.terminate(),delete r[e]}function v(){throw new Error("Not implemented.")}function _(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var n in e)t[n]=_(e[n]);return t}function b(e,t){return function(){e.apply(t,arguments)}}function k(e){return"function"==typeof e}return i&&(t.onmessage=function(e){var n=e.data;if(void 0===o.WORKER_ID&&n&&(o.WORKER_ID=n.workerId),"string"==typeof n.input)t.postMessage({workerId:o.WORKER_ID,results:o.parse(n.input,n.config),finished:!0});else if(t.File&&n.input instanceof File||n.input instanceof Object){var i=o.parse(n.input,n.config);i&&t.postMessage({workerId:o.WORKER_ID,results:i,finished:!0})}}),(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(u.prototype)).constructor=c,(h.prototype=Object.create(h.prototype)).constructor=h,(p.prototype=Object.create(u.prototype)).constructor=p,o}()}(i);var r=n(i.exports),s=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=/^0x[0-9A-F]+$/i,a=function(e){if("string"!=typeof e)return e;if(""===e)e=null;else if(s.test(e))e=parseFloat(e);else if(o.test(e))e=parseInt(e,16);else switch(e){case"false":e=!1;break;case"true":e=!0;break;case"null":e=null;break;case"undefined":e=void 0}return e},u=function(e,t){if(!t)return e;for(var n in e)e[n]=t(e[n],n);return e};
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function l(e){return null==e}var c={isNothing:l,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:l(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,i,r,s;if(t)for(n=0,i=(s=Object.keys(t)).length;n<i;n+=1)e[r=s[n]]=t[r];return e}};function h(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function p(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=h(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.toString=function(e){return this.name+": "+h(this,e)};var f=p;function d(e,t,n,i,r){var s="",o="",a=Math.floor(r/2)-1;return i-t>a&&(t=i-a+(s=" ... ").length),n-i>a&&(n=i+a-(o=" ...").length),{str:s+e.slice(t,n).replace(/\t/g,"→")+o,pos:i-t+s.length}}function g(e,t){return c.repeat(" ",t-e.length)+e}var m=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],s=[],o=-1;n=i.exec(e.buffer);)s.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a,u,l="",h=Math.min(e.line+t.linesAfter,s.length).toString().length,p=t.maxLength-(t.indent+h+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)u=d(e.buffer,r[o-a],s[o-a],e.position-(r[o]-r[o-a]),p),l=c.repeat(" ",t.indent)+g((e.line-a+1).toString(),h)+" | "+u.str+"\n"+l;for(u=d(e.buffer,r[o],s[o],e.position,p),l+=c.repeat(" ",t.indent)+g((e.line+1).toString(),h)+" | "+u.str+"\n",l+=c.repeat("-",t.indent+h+3+u.pos)+"^\n",a=1;a<=t.linesAfter&&!(o+a>=s.length);a++)u=d(e.buffer,r[o+a],s[o+a],e.position-(r[o]-r[o+a]),p),l+=c.repeat(" ",t.indent)+g((e.line+a+1).toString(),h)+" | "+u.str+"\n";return l.replace(/\n$/,"")},y=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],v=["scalar","sequence","mapping"];var _=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===y.indexOf(t))throw new f('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===v.indexOf(this.kind))throw new f('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function b(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function k(e){return this.extend(e)}k.prototype.extend=function(e){var t=[],n=[];if(e instanceof _)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new f("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof _))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new f("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new f("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof _))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(k.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=b(i,"implicit"),i.compiledExplicit=b(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var w=k,A=new _("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),E=new _("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),x=new _("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),C=new w({explicit:[A,E,x]});var O=new _("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var S=new _("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function I(e){return 48<=e&&e<=55}function T(e){return 48<=e&&e<=57}var j=new _("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,r=0,s=!1;if(!i)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===i)return!0;if("b"===(t=e[++r])){for(r++;r<i;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(r++;r<i;r++)if("_"!==(t=e[r])){if(!(48<=(n=e.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(r++;r<i;r++)if("_"!==(t=e[r])){if(!I(e.charCodeAt(r)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;r<i;r++)if("_"!==(t=e[r])){if(!T(e.charCodeAt(r)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(i=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!c.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),L=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var M=/^[-+]?[0-9]+e/;var q=new _("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!L.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||c.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(c.isNegativeZero(e))return"-0.0";return n=e.toString(10),M.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),F=C.extend({implicit:[O,S,j,q]}),R=F,D=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),N=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var P=new _("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==D.exec(e)||null!==N.exec(e))},construct:function(e){var t,n,i,r,s,o,a,u,l=0,c=null;if(null===(t=D.exec(e))&&(t=N.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(c=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(c=-c)),u=new Date(Date.UTC(n,i,r,s,o,a,l)),c&&u.setTime(u.getTime()-c),u},instanceOf:Date,represent:function(e){return e.toISOString()}});var U=new _("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var z=new _("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,s=K;for(n=0;n<r;n++)if(!((t=s.indexOf(e.charAt(n)))>64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=K,o=0,a=[];for(t=0;t<r;t++)t%4==0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|s.indexOf(i.charAt(t));return 0===(n=r%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===n?(a.push(o>>10&255),a.push(o>>2&255)):12===n&&a.push(o>>4&255),new Uint8Array(a)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,s=e.length,o=K;for(t=0;t<s;t++)t%3==0&&t&&(i+=o[r>>18&63],i+=o[r>>12&63],i+=o[r>>6&63],i+=o[63&r]),r=(r<<8)+e[t];return 0===(n=s%3)?(i+=o[r>>18&63],i+=o[r>>12&63],i+=o[r>>6&63],i+=o[63&r]):2===n?(i+=o[r>>10&63],i+=o[r>>4&63],i+=o[r<<2&63],i+=o[64]):1===n&&(i+=o[r>>2&63],i+=o[r<<4&63],i+=o[64],i+=o[64]),i}}),Q=Object.prototype.hasOwnProperty,B=Object.prototype.toString;var W=new _("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,o=[],a=e;for(t=0,n=a.length;t<n;t+=1){if(i=a[t],s=!1,"[object Object]"!==B.call(i))return!1;for(r in i)if(Q.call(i,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==o.indexOf(r))return!1;o.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),Y=Object.prototype.toString;var $=new _("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(i=o[t],"[object Object]"!==Y.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;s[t]=[r[0],i[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)i=o[t],r=Object.keys(i),s[t]=[r[0],i[r[0]]];return s}}),H=Object.prototype.hasOwnProperty;var J=new _("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(H.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),G=R.extend({implicit:[P,U],explicit:[z,W,$,J]}),Z=Object.prototype.hasOwnProperty,V=1,X=2,ee=3,te=4,ne=1,ie=2,re=3,se=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,oe=/[\x85\u2028\u2029]/,ae=/[,\[\]\{\}]/,ue=/^(?:!|!!|![a-z\-]+!)$/i,le=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ce(e){return Object.prototype.toString.call(e)}function he(e){return 10===e||13===e}function pe(e){return 9===e||32===e}function fe(e){return 9===e||32===e||10===e||13===e}function de(e){return 44===e||91===e||93===e||123===e||125===e}function ge(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function me(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function ye(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var ve=new Array(256),_e=new Array(256),be=0;be<256;be++)ve[be]=me(be)?1:0,_e[be]=me(be);function ke(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||G,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function we(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=m(n),new f(t,n)}function Ae(e,t){throw we(e,t)}function Ee(e,t){e.onWarning&&e.onWarning.call(null,we(e,t))}var xe={YAML:function(e,t,n){var i,r,s;null!==e.version&&Ae(e,"duplication of %YAML directive"),1!==n.length&&Ae(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Ae(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&Ae(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Ee(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&Ae(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],ue.test(i)||Ae(e,"ill-formed tag handle (first argument) of the TAG directive"),Z.call(e.tagMap,i)&&Ae(e,'there is a previously declared suffix for "'+i+'" tag handle'),le.test(r)||Ae(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ae(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function Ce(e,t,n,i){var r,s,o,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,s=a.length;r<s;r+=1)9===(o=a.charCodeAt(r))||32<=o&&o<=1114111||Ae(e,"expected valid JSON character");else se.test(a)&&Ae(e,"the stream contains non-printable characters");e.result+=a}}function Oe(e,t,n,i){var r,s,o,a;for(c.isObject(n)||Ae(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,a=(r=Object.keys(n)).length;o<a;o+=1)s=r[o],Z.call(t,s)||(t[s]=n[s],i[s]=!0)}function Se(e,t,n,i,r,s,o,a,u){var l,c;if(Array.isArray(r))for(l=0,c=(r=Array.prototype.slice.call(r)).length;l<c;l+=1)Array.isArray(r[l])&&Ae(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===ce(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===ce(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(s))for(l=0,c=s.length;l<c;l+=1)Oe(e,t,s[l],n);else Oe(e,t,s,n);else e.json||Z.call(n,r)||!Z.call(t,r)||(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=u||e.position,Ae(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete n[r];return t}function Ie(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):Ae(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Te(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;pe(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!he(r))break;for(Ie(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&Ee(e,"deficient indentation"),i}function je(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!fe(t)))}function Le(e,t){1===t?e.result+=" ":t>1&&(e.result+=c.repeat("\n",t-1))}function Me(e,t){var n,i,r=e.tag,s=e.anchor,o=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Ae(e,"tab characters must not be used in indentation")),45===i)&&fe(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,Te(e,!0,-1)&&e.lineIndent<=t)o.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,Re(e,t,ee,!1,!0),o.push(e.result),Te(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)Ae(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=r,e.anchor=s,e.kind="sequence",e.result=o,!0)}function qe(e){var t,n,i,r,s=!1,o=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&Ae(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(s=!0,r=e.input.charCodeAt(++e.position)):33===r?(o=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(i=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):Ae(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!fe(r);)33===r&&(o?Ae(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ue.test(n)||Ae(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),ae.test(i)&&Ae(e,"tag suffix cannot contain flow indicator characters")}i&&!le.test(i)&&Ae(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(t){Ae(e,"tag name is malformed: "+i)}return s?e.tag=i:Z.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:Ae(e,'undeclared tag handle "'+n+'"'),!0}function Fe(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&Ae(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!fe(n)&&!de(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ae(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Re(e,t,n,i,r){var s,o,a,u,l,h,p,f,d,g=1,m=!1,y=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=te===n||ee===n,i&&Te(e,!0,-1)&&(m=!0,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)),1===g)for(;qe(e)||Fe(e);)Te(e,!0,-1)?(m=!0,a=s,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)):a=!1;if(a&&(a=m||r),1!==g&&te!==n||(f=V===n||X===n?t:t+1,d=e.position-e.lineStart,1===g?a&&(Me(e,d)||function(e,t,n){var i,r,s,o,a,u,l,c=e.tag,h=e.anchor,p={},f=Object.create(null),d=null,g=null,m=null,y=!1,v=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,Ae(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,63!==l&&58!==l||!fe(i)){if(o=e.line,a=e.lineStart,u=e.position,!Re(e,n,X,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);pe(l);)l=e.input.charCodeAt(++e.position);if(58===l)fe(l=e.input.charCodeAt(++e.position))||Ae(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Se(e,p,f,d,g,null,o,a,u),d=g=m=null),v=!0,y=!1,r=!1,d=e.tag,g=e.result;else{if(!v)return e.tag=c,e.anchor=h,!0;Ae(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return e.tag=c,e.anchor=h,!0;Ae(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(Se(e,p,f,d,g,null,o,a,u),d=g=m=null),v=!0,y=!0,r=!0):y?(y=!1,r=!0):Ae(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=i;if((e.line===s||e.lineIndent>t)&&(y&&(o=e.line,a=e.lineStart,u=e.position),Re(e,t,te,!0,r)&&(y?g=e.result:m=e.result),y||(Se(e,p,f,d,g,m,o,a,u),d=g=m=null),Te(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Ae(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Se(e,p,f,d,g,null,o,a,u),v&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=p),v}(e,d,f))||function(e,t){var n,i,r,s,o,a,u,l,c,h,p,f,d=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(f=e.input.charCodeAt(e.position)))o=93,l=!1,s=[];else{if(123!==f)return!1;o=125,l=!0,s={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),f=e.input.charCodeAt(++e.position);0!==f;){if(Te(e,!0,t),(f=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=g,e.anchor=m,e.kind=l?"mapping":"sequence",e.result=s,!0;d?44===f&&Ae(e,"expected the node content, but found ','"):Ae(e,"missed comma between flow collection entries"),p=null,a=u=!1,63===f&&fe(e.input.charCodeAt(e.position+1))&&(a=u=!0,e.position++,Te(e,!0,t)),n=e.line,i=e.lineStart,r=e.position,Re(e,t,V,!1,!0),h=e.tag,c=e.result,Te(e,!0,t),f=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==f||(a=!0,f=e.input.charCodeAt(++e.position),Te(e,!0,t),Re(e,t,V,!1,!0),p=e.result),l?Se(e,s,y,h,c,p,n,i,r):a?s.push(Se(e,null,y,h,c,p,n,i,r)):s.push(c),Te(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(d=!0,f=e.input.charCodeAt(++e.position)):d=!1}Ae(e,"unexpected end of the stream within a flow collection")}(e,f)?y=!0:(o&&function(e,t){var n,i,r,s,o,a=ne,u=!1,l=!1,h=t,p=0,f=!1;if(124===(s=e.input.charCodeAt(e.position)))i=!1;else{if(62!==s)return!1;i=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)ne===a?a=43===s?re:ie:Ae(e,"repeat of a chomping mode identifier");else{if(!((r=48<=(o=s)&&o<=57?o-48:-1)>=0))break;0===r?Ae(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Ae(e,"repeat of an indentation width identifier"):(h=t+r-1,l=!0)}if(pe(s)){do{s=e.input.charCodeAt(++e.position)}while(pe(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!he(s)&&0!==s)}for(;0!==s;){for(Ie(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!l||e.lineIndent<h)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>h&&(h=e.lineIndent),he(s))p++;else{if(e.lineIndent<h){a===re?e.result+=c.repeat("\n",u?1+p:p):a===ne&&u&&(e.result+="\n");break}for(i?pe(s)?(f=!0,e.result+=c.repeat("\n",u?1+p:p)):f?(f=!1,e.result+=c.repeat("\n",p+1)):0===p?u&&(e.result+=" "):e.result+=c.repeat("\n",p):e.result+=c.repeat("\n",u?1+p:p),u=!0,l=!0,p=0,n=e.position;!he(s)&&0!==s;)s=e.input.charCodeAt(++e.position);Ce(e,n,e.position,!1)}}return!0}(e,f)||function(e,t){var n,i,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(Ce(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,r=e.position}else he(n)?(Ce(e,i,r,!0),Le(e,Te(e,!1,t)),i=r=e.position):e.position===e.lineStart&&je(e)?Ae(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);Ae(e,"unexpected end of the stream within a single quoted scalar")}(e,f)||function(e,t){var n,i,r,s,o,a,u;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return Ce(e,n,e.position,!0),e.position++,!0;if(92===a){if(Ce(e,n,e.position,!0),he(a=e.input.charCodeAt(++e.position)))Te(e,!1,t);else if(a<256&&ve[a])e.result+=_e[a],e.position++;else if((o=120===(u=a)?2:117===u?4:85===u?8:0)>0){for(r=o,s=0;r>0;r--)(o=ge(a=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+o:Ae(e,"expected hexadecimal character");e.result+=ye(s),e.position++}else Ae(e,"unknown escape sequence");n=i=e.position}else he(a)?(Ce(e,n,i,!0),Le(e,Te(e,!1,t)),n=i=e.position):e.position===e.lineStart&&je(e)?Ae(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Ae(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!fe(i)&&!de(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Ae(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Z.call(e.anchorMap,n)||Ae(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Te(e,!0,-1),!0}(e)?function(e,t,n){var i,r,s,o,a,u,l,c,h=e.kind,p=e.result;if(fe(c=e.input.charCodeAt(e.position))||de(c)||35===c||38===c||42===c||33===c||124===c||62===c||39===c||34===c||37===c||64===c||96===c)return!1;if((63===c||45===c)&&(fe(i=e.input.charCodeAt(e.position+1))||n&&de(i)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,o=!1;0!==c;){if(58===c){if(fe(i=e.input.charCodeAt(e.position+1))||n&&de(i))break}else if(35===c){if(fe(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&je(e)||n&&de(c))break;if(he(c)){if(a=e.line,u=e.lineStart,l=e.lineIndent,Te(e,!1,-1),e.lineIndent>=t){o=!0,c=e.input.charCodeAt(e.position);continue}e.position=s,e.line=a,e.lineStart=u,e.lineIndent=l;break}}o&&(Ce(e,r,s,!1),Le(e,e.line-a),r=s=e.position,o=!1),pe(c)||(s=e.position+1),c=e.input.charCodeAt(++e.position)}return Ce(e,r,s,!1),!!e.result||(e.kind=h,e.result=p,!1)}(e,f,V===n)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||Ae(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=a&&Me(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Ae(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,l=e.implicitTypes.length;u<l;u+=1)if((p=e.implicitTypes[u]).resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(Z.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,u=0,l=(h=e.typeMap.multi[e.kind||"fallback"]).length;u<l;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){p=h[u];break}p||Ae(e,"unknown tag !<"+e.tag+">"),null!==e.result&&p.kind!==e.kind&&Ae(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Ae(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function De(e){var t,n,i,r,s=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(Te(e,!0,-1),r=e.input.charCodeAt(e.positi