/*! For license information please see main.b666ae5f.js.LICENSE.txt */ (()=>{var e={476:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CacheProvider:()=>T,ClassNames:()=>V,Global:()=>L,ThemeContext:()=>A,createElement:()=>j,css:()=>F,jsx:()=>j,keyframes:()=>z,withEmotionCache:()=>D});var r=n(7387),i=n(5043);var o=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};var g=n(1324);var v=/[A-Z]|^ms/g,y=/_EMO_([^_]+?)_([^]*?)_EMO_/g,b=function(e){return 45===e.charCodeAt(1)},x=function(e){return null!=e&&"boolean"!==typeof e},w=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return b(e)?e:e.replace(v,"-$&").toLowerCase()})),E=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(y,(function(e,t,n){return S={name:t,styles:n,next:S},t}))}return 1===g.A[e]||b(e)||"number"!==typeof t||0===t?t:t+"px"};function C(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return S={name:n.name,styles:n.styles,next:S},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)S={name:i.name,styles:i.styles,next:S},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{"use strict";n.d(t,{A:()=>r});const r=function(e){function t(e,r,u,l,p){for(var d,h,m,g,x,E=0,C=0,S=0,N=0,k=0,M=0,R=m=d=0,F=0,j=0,L=0,B=0,z=u.length,U=z-1,q="",V="",$="",H="";Fd)&&(B=(q=q.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],0{"use strict";n.d(t,{A:()=>r});const r={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},854:(e,t,n)=>{e.exports=n(672)},1989:(e,t,n)=>{"use strict";var r=n(6267),i=n(3229),o=n(7903),a=n(6735),s=n(7638),u=n(3101),l=n(705),c=n(938);e.exports=function(e){return new Promise((function(t,n){var f=e.data,p=e.headers,d=e.responseType;r.isFormData(f)&&delete p["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(m+":"+g)}var v=s(e.baseURL,e.url);function y(){if(h){var r="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,o={data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h};i(t,n,o),h=null}}if(h.open(e.method.toUpperCase(),a(v,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(n(c("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){n(c("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||l(v))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}"setRequestHeader"in h&&r.forEach(p,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete p[t]:h.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),d&&"json"!==d&&(h.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),n(e),h=null)})),f||(f=null),h.send(f)}))}},672:(e,t,n)=>{"use strict";var r=n(6267),i=n(6973),o=n(8938),a=n(6438);function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var u=s(n(1550));u.Axios=o,u.create=function(e){return s(a(u.defaults,e))},u.Cancel=n(5299),u.CancelToken=n(7690),u.isCancel=n(7767),u.all=function(e){return Promise.all(e)},u.spread=n(8125),u.isAxiosError=n(8738),e.exports=u,e.exports.default=u},5299:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},7690:(e,t,n)=>{"use strict";var r=n(5299);function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},7767:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},8938:(e,t,n)=>{"use strict";var r=n(6267),i=n(6735),o=n(6664),a=n(4395),s=n(6438),u=n(2478),l=u.validators;function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean,"1.0.0"),forcedJSONParsing:l.transitional(l.boolean,"1.0.0"),clarifyTimeoutError:l.transitional(l.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"===typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!r){var c=[a,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(o),i=Promise.resolve(e);c.length;)i=i.then(c.shift(),c.shift());return i}for(var f=e;n.length;){var p=n.shift(),d=n.shift();try{f=p(f)}catch(h){d(h);break}}try{i=a(f)}catch(h){return Promise.reject(h)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},c.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=c},6664:(e,t,n)=>{"use strict";var r=n(6267);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},7638:(e,t,n)=>{"use strict";var r=n(2762),i=n(1523);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},938:(e,t,n)=>{"use strict";var r=n(9478);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},4395:(e,t,n)=>{"use strict";var r=n(6267),i=n(3024),o=n(7767),a=n(1550);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return s(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},9478:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},6438:(e,t,n)=>{"use strict";var r=n(6267);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function u(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function l(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(o,l),r.forEach(a,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(void 0,t[i])})),r.forEach(s,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var c=i.concat(o).concat(a).concat(s),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return r.forEach(f,l),n}},3229:(e,t,n)=>{"use strict";var r=n(938);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},3024:(e,t,n)=>{"use strict";var r=n(6267),i=n(1550);e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},1550:(e,t,n)=>{"use strict";var r=n(6267),i=n(2121),o=n(9478),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=n(1989)),e}(),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a){if("SyntaxError"===s.name)throw o(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},6973:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(6267);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},1523:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},7903:(e,t,n)=>{"use strict";var r=n(6267);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},2762:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},8738:e=>{"use strict";e.exports=function(e){return"object"===typeof e&&!0===e.isAxiosError}},705:(e,t,n)=>{"use strict";var r=n(6267);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},2121:(e,t,n)=>{"use strict";var r=n(6267);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},3101:(e,t,n)=>{"use strict";var r=n(6267),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},8125:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},2478:(e,t,n)=>{"use strict";var r=n(4198),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},a=r.version.split(".");function s(e,t){for(var n=t?t.split("."):a,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0;){var o=r[i],a=t[o];if(a){var s=e[o],u=void 0===s||a(s,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:i}},6267:(e,t,n)=>{"use strict";var r=n(6973),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n{"use strict";n.r(t),n.d(t,{Alternation:()=>Ne,Alternative:()=>be,CstParser:()=>An,EMPTY_ALT:()=>_n,EOF:()=>pe,EarlyExitException:()=>jt,EmbeddedActionsParser:()=>Tn,GAstVisitor:()=>De,Lexer:()=>X,LexerDefinitionErrorType:()=>J,MismatchedTokenException:()=>Rt,NoViableAltException:()=>It,NonTerminal:()=>ve,NotAllInputParsedException:()=>Ft,Option:()=>xe,Parser:()=>Vn,ParserDefinitionErrorType:()=>Sn,Repetition:()=>Ce,RepetitionMandatory:()=>we,RepetitionMandatoryWithSeparator:()=>Ee,RepetitionWithSeparator:()=>Se,Rule:()=>ye,Terminal:()=>ke,VERSION:()=>r,assignOccurrenceIndices:()=>Nt,clearCache:()=>qn,createSyntaxDiagramsCode:()=>Dn,createToken:()=>fe,createTokenInstance:()=>de,defaultGrammarResolverErrorProvider:()=>qe,defaultGrammarValidatorErrorProvider:()=>Ve,defaultLexerErrorProvider:()=>Y,defaultParserErrorProvider:()=>Ue,generateParserFactory:()=>zn,generateParserModule:()=>Un,isRecognitionException:()=>Mt,resolveGrammar:()=>Ct,serializeGrammar:()=>_e,serializeProduction:()=>Oe,tokenLabel:()=>Q,tokenMatcher:()=>he,tokenName:()=>ee,validateGrammar:()=>St});var r="7.1.2",i=n(297),o=n(5948),a={},s=new o.RegExpParser;function u(e){var t=e.toString();if(a.hasOwnProperty(t))return a[t];var n=s.pattern(t);return a[t]=n,n}var l=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c="Complement Sets are not supported for first char optimization",f='Unable to use "first char" lexer optimizations:\n';function p(e,t){void 0===t&&(t=!1);try{var n=u(e);return d(n.value,{},n.flags.ignoreCase)}catch(a){if(a.message===c)t&&(0,i.x5)(f+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var r="";t&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,i.Zi)(f+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+r)}}return[]}function d(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r=j)for(var o=r.from>=j?r.from:j,a=r.to,s=L(o),u=L(a),l=s;l<=u;l++)t[l]=l}}}));break;case"Group":d(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}var u=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===g(s)||"Group"!==s.type&&!1===u)break}break;default:throw Error("non exhaustive match!")}return(0,i.zu)(t)}function h(e,t,n){var r=L(e);t[r]=r,!0===n&&function(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){t[i=L(r.charCodeAt(0))]=i}else{var i,o=n.toLowerCase();if(o!==n)t[i=L(o.charCodeAt(0))]=i}}(e,t)}function m(e,t){return(0,i.I6)(e.value,(function(e){if("number"===typeof e)return(0,i.gR)(t,e);var n=e;return void 0!==(0,i.I6)(t,(function(e){return n.from<=e&&e<=n.to}))}))}function g(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&((0,i.cy)(e.value)?(0,i.Si)(e.value,g):g(e.value))}var v=function(e){function t(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return l(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,i.gR)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===m(e,this.targetCharCodes)&&(this.found=!0):void 0!==m(e,this.targetCharCodes)&&(this.found=!0)},t}(o.BaseRegExpVisitor);function y(e,t){if(t instanceof RegExp){var n=u(t),r=new v(e);return r.visit(n),r.found}return void 0!==(0,i.I6)(t,(function(t){return(0,i.gR)(e,t.charCodeAt(0))}))}var b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x="PATTERN",w="defaultMode",E="modes",C="boolean"===typeof new RegExp("(?:)").sticky;function S(e,t){var n,r=(t=(0,i.NT)(t,{useSticky:C,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;r("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,i.Im)(B)){B=new Array(65536);for(var e=0;e<65536;e++)B[e]=e>255?255+~~(e/255):e}}()})),r("Reject Lexer.NA",(function(){n=(0,i.ku)(e,(function(e){return e[x]===X.NA}))}));var o,a,s,u,l,c,d,h,m,g,v,b=!1;r("Transform Patterns",(function(){b=!1,o=(0,i.Tj)(n,(function(e){var n=e[x];if((0,i.gd)(n)){var r=n.source;return 1!==r.length||"^"===r||"$"===r||"."===r||n.ignoreCase?2!==r.length||"\\"!==r[0]||(0,i.gR)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?t.useSticky?A(n):O(n):r[1]:r}if((0,i.Tn)(n))return b=!0,{exec:n};if((0,i.zy)(n,"exec"))return b=!0,n;if("string"===typeof n){if(1===n.length)return n;var o=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(o);return t.useSticky?A(a):O(a)}throw Error("non exhaustive match")}))})),r("misc mapping",(function(){a=(0,i.Tj)(n,(function(e){return e.tokenTypeIdx})),s=(0,i.Tj)(n,(function(e){var t=e.GROUP;if(t!==X.SKIPPED){if((0,i.Kg)(t))return t;if((0,i.b0)(t))return!1;throw Error("non exhaustive match")}})),u=(0,i.Tj)(n,(function(e){var t=e.LONGER_ALT;if(t)return(0,i.qh)(n,t)})),l=(0,i.Tj)(n,(function(e){return e.PUSH_MODE})),c=(0,i.Tj)(n,(function(e){return(0,i.zy)(e,"POP_MODE")}))})),r("Line Terminator Handling",(function(){var e=I(t.lineTerminatorCharacters);d=(0,i.Tj)(n,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(d=(0,i.Tj)(n,(function(t){return(0,i.zy)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===R(t,e)?y(e,t.PATTERN):void 0})))})),r("Misc Mapping #2",(function(){h=(0,i.Tj)(n,D),m=(0,i.Tj)(o,M),g=(0,i.TS)(n,(function(e,t){var n=t.GROUP;return(0,i.Kg)(n)&&n!==X.SKIPPED&&(e[n]=[]),e}),{}),v=(0,i.Tj)(o,(function(e,t){return{pattern:o[t],longerAlt:u[t],canLineTerminator:d[t],isCustom:h[t],short:m[t],group:s[t],push:l[t],pop:c[t],tokenTypeIdx:a[t],tokenType:n[t]}}))}));var w=!0,E=[];return t.safeMode||r("First Char Optimization",(function(){E=(0,i.TS)(n,(function(e,n,r){if("string"===typeof n.PATTERN){var o=L(n.PATTERN.charCodeAt(0));F(e,o,v[r])}else if((0,i.cy)(n.START_CHARS_HINT)){var a;(0,i.jJ)(n.START_CHARS_HINT,(function(t){var n=L("string"===typeof t?t.charCodeAt(0):t);a!==n&&(a=n,F(e,n,v[r]))}))}else if((0,i.gd)(n.PATTERN))if(n.PATTERN.unicode)w=!1,t.ensureOptimizations&&(0,i.Zi)(f+"\tUnable to analyze < "+n.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var s=p(n.PATTERN,t.ensureOptimizations);(0,i.Im)(s)&&(w=!1),(0,i.jJ)(s,(function(t){F(e,t,v[r])}))}else t.ensureOptimizations&&(0,i.Zi)(f+"\tTokenType: <"+n.name+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),w=!1;return e}),[])})),r("ArrayPacking",(function(){E=(0,i.VS)(E)})),{emptyGroups:g,patternIdxToConfig:v,charCodeToPatternIdxToConfig:E,hasCustom:b,canBeOptimized:w}}function N(e,t){var n=[],r=function(e){var t=(0,i.pb)(e,(function(e){return!(0,i.zy)(e,x)})),n=(0,i.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:J.MISSING_PATTERN,tokenTypes:[e]}})),r=(0,i.iv)(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);var a=function(e){var t=(0,i.pb)(e,(function(e){var t=e[x];return!(0,i.gd)(t)&&!(0,i.Tn)(t)&&!(0,i.zy)(t,"exec")&&!(0,i.Kg)(t)})),n=(0,i.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:J.INVALID_PATTERN,tokenTypes:[e]}})),r=(0,i.iv)(e,t);return{errors:n,valid:r}}(r.valid),s=a.valid;return n=(n=n.concat(a.errors)).concat(function(e){var t=[],n=(0,i.pb)(e,(function(e){return(0,i.gd)(e[x])}));return t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return b(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),n=(0,i.pb)(e,(function(e){var n=e[x];try{var r=u(n),i=new t;return i.visit(r),i.found}catch(o){return k.test(n.source)}})),r=(0,i.Tj)(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:J.EOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}(n)),t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return b(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),n=(0,i.pb)(e,(function(e){var n=e[x];try{var r=u(n),i=new t;return i.visit(r),i.found}catch(o){return _.test(n.source)}})),r=(0,i.Tj)(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:J.SOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}(n)),t=t.concat(function(e){var t=(0,i.pb)(e,(function(e){var t=e[x];return t instanceof RegExp&&(t.multiline||t.global)})),n=(0,i.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:J.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}));return n}(n)),t=t.concat(function(e){var t=[],n=(0,i.Tj)(e,(function(n){return(0,i.TS)(e,(function(e,r){return n.PATTERN.source!==r.PATTERN.source||(0,i.gR)(t,r)||r.PATTERN===X.NA||(t.push(r),e.push(r)),e}),[])}));n=(0,i.oE)(n);var r=(0,i.pb)(n,(function(e){return e.length>1})),o=(0,i.Tj)(r,(function(e){var t=(0,i.Tj)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+(0,i.$1)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:J.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return o}(n)),t=t.concat(function(e){var t=(0,i.pb)(e,(function(e){return e[x].test("")})),n=(0,i.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:J.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}));return n}(n)),t}(s)),n=n.concat(function(e){var t=(0,i.pb)(e,(function(e){if(!(0,i.zy)(e,"GROUP"))return!1;var t=e.GROUP;return t!==X.SKIPPED&&t!==X.NA&&!(0,i.Kg)(t)})),n=(0,i.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:J.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}));return n}(s)),n=n.concat(function(e,t){var n=(0,i.pb)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,i.gR)(t,e.PUSH_MODE)})),r=(0,i.Tj)(n,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:J.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}));return r}(s,t)),n=n.concat(function(e){var t=[],n=(0,i.TS)(e,(function(e,t,n){var r=t.PATTERN;return r===X.NA||((0,i.Kg)(r)?e.push({str:r,idx:n,tokenType:t}):(0,i.gd)(r)&&function(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return void 0===(0,i.I6)(t,(function(t){return-1!==e.source.indexOf(t)}))}(r)&&e.push({str:r.source,idx:n,tokenType:t})),e}),[]);return(0,i.jJ)(e,(function(e,r){(0,i.jJ)(n,(function(n){var o=n.str,a=n.idx,s=n.tokenType;if(r"+e.name+"<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:u,type:J.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(s)),n}var k=/[^\\][\$]/;var _=/[^\\[][\^]|^\^/;function O(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function A(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function T(e,t,n){var r=[],o=!1,a=(0,i.oE)((0,i.Bq)((0,i.LG)(e.modes,(function(e){return e})))),s=(0,i.ku)(a,(function(e){return e[x]===X.NA})),u=I(n);return t&&(0,i.jJ)(s,(function(e){var t=R(e,u);if(!1!==t){var n=function(e,t){if(t.issue===J.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===J.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(e,t),a={message:n,type:t.issue,tokenType:e};r.push(a)}else(0,i.zy)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(o=!0):y(u,e.PATTERN)&&(o=!0)})),t&&!o&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:J.NO_LINE_BREAKS_FLAGS}),r}function D(e){var t=e.PATTERN;if((0,i.gd)(t))return!1;if((0,i.Tn)(t))return!0;if((0,i.zy)(t,"exec"))return!0;if((0,i.Kg)(t))return!1;throw Error("non exhaustive match")}function M(e){return!(!(0,i.Kg)(e)||1!==e.length)&&e.charCodeAt(0)}var P={test:function(e){for(var t=e.length,n=this.lastIndex;n0?e.charCodeAt(0):e}))}function F(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var j=256;function L(e){return e0}))}function H(e,t){(0,i.jJ)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,i.jJ)(t.CATEGORIES,(function(n){var r=e.concat(t);(0,i.gR)(r,n)||H(r,n)}))}function W(e){return(0,i.zy)(e,"tokenTypeIdx")}function K(e){return(0,i.zy)(e,"CATEGORIES")}function G(e){return(0,i.zy)(e,"tokenTypeIdx")}var J,Y={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+n+" characters."}};!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(J||(J={}));var Z={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Y,traceInitPerf:!1,skipValidations:!1};Object.freeze(Z);var X=function(){function e(e,t){var n=this;if(void 0===t&&(t=Z),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"===typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,i.h1)(Z,t);var r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"===typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var r,o=!0;n.TRACE_INIT("Lexer Config handling",(function(){if(n.config.lineTerminatorsPattern===Z.lineTerminatorsPattern)n.config.lineTerminatorsPattern=P;else if(n.config.lineTerminatorCharacters===Z.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),(0,i.cy)(e)?((r={modes:{}}).modes[w]=(0,i.T9)(e),r[w]=w):(o=!1,r=(0,i.lR)(e))})),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(function(e){var t=[];return(0,i.zy)(e,w)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+w+"> property in its definition\n",type:J.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,i.zy)(e,E)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:J.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,i.zy)(e,E)&&(0,i.zy)(e,w)&&!(0,i.zy)(e.modes,e.defaultMode)&&t.push({message:"A MultiMode Lexer cannot be initialized with a "+w+": <"+e.defaultMode+">which does not exist\n",type:J.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,i.zy)(e,E)&&(0,i.jJ)(e.modes,(function(e,n){(0,i.jJ)(e,(function(e,r){(0,i.b0)(e)&&t.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+n+"> at index: <"+r+">\n",type:J.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),t}(r,n.trackStartLines,n.config.lineTerminatorCharacters))})),n.TRACE_INIT("performWarningRuntimeChecks",(function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(T(r,n.trackStartLines,n.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},(0,i.jJ)(r.modes,(function(e,t){r.modes[t]=(0,i.ku)(e,(function(e){return(0,i.b0)(e)}))}));var s=(0,i.HP)(r.modes);if((0,i.jJ)(r.modes,(function(e,r){n.TRACE_INIT("Mode: <"+r+"> processing",(function(){var o;(n.modes.push(r),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(N(e,s))})),(0,i.Im)(n.lexerDefinitionErrors))&&($(e),n.TRACE_INIT("analyzeTokenTypes",(function(){o=S(e,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:n.TRACE_INIT.bind(n)})})),n.patternIdxToConfig[r]=o.patternIdxToConfig,n.charCodeToPatternIdxToConfig[r]=o.charCodeToPatternIdxToConfig,n.emptyGroups=(0,i.h1)(n.emptyGroups,o.emptyGroups),n.hasCustom=o.hasCustom||n.hasCustom,n.canModeBeOptimized[r]=o.canBeOptimized)}))})),n.defaultMode=r.defaultMode,!(0,i.Im)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=(0,i.Tj)(n.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+u)}(0,i.jJ)(n.lexerDefinitionWarning,(function(e){(0,i.x5)(e.message)})),n.TRACE_INIT("Choosing sub-methods implementations",(function(){if(C?(n.chopInput=i.zK,n.match=n.matchWithTest):(n.updateLastIndex=i.tE,n.match=n.matchWithExec),o&&(n.handleModes=i.tE),!1===n.trackStartLines&&(n.computeNewColumn=i.zK),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=i.tE),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)})),n.TRACE_INIT("Failed Optimization Warnings",(function(){var e=(0,i.TS)(n.canModeBeOptimized,(function(e,t,n){return!1===t&&e.push(n),e}),[]);if(t.ensureOptimizations&&!(0,i.Im)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),n.TRACE_INIT("clearRegExpParserCache",(function(){a={}})),n.TRACE_INIT("toFastProperties",(function(){(0,i.Bl)(n)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,i.Im)(this.lexerDefinitionErrors)){var n=(0,i.Tj)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var n,r,o,a,s,u,l,c,f,p,d,h,m,g,v=this,y=e,b=y.length,x=0,w=0,E=this.hasCustom?0:Math.floor(e.length/10),C=new Array(E),S=[],N=this.trackStartLines?1:void 0,k=this.trackStartLines?1:void 0,_=function(e){var t={},n=(0,i.HP)(e);return(0,i.jJ)(n,(function(n){var r=e[n];if(!(0,i.cy)(r))throw Error("non exhaustive match");t[n]=[]})),t}(this.emptyGroups),O=this.trackStartLines,A=this.config.lineTerminatorsPattern,T=0,D=[],M=[],P=[],R=[];Object.freeze(R);var I=void 0;function F(){return D}function j(e){var t=L(e),n=M[t];return void 0===n?R:n}var B,z=function(e){if(1===P.length&&void 0===e.tokenType.PUSH_MODE){var t=v.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);S.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{P.pop();var n=(0,i.HV)(P);D=v.patternIdxToConfig[n],M=v.charCodeToPatternIdxToConfig[n],T=D.length;var r=v.canModeBeOptimized[n]&&!1===v.config.safeMode;I=M&&r?j:F}};function U(e){P.push(e),M=this.charCodeToPatternIdxToConfig[e],D=this.patternIdxToConfig[e],T=D.length,T=D.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=M&&t?j:F}for(U.call(this,t);xs.length&&(s=o,u=l,B=W)}break}}if(null!==s){if(c=s.length,void 0!==(f=B.group)&&(p=B.tokenTypeIdx,d=this.createTokenInstance(s,x,p,B.tokenType,N,k,c),this.handlePayload(d,u),!1===f?w=this.addToken(C,w,d):_[f].push(d)),e=this.chopInput(e,c),x+=c,k=this.computeNewColumn(k,c),!0===O&&!0===B.canLineTerminator){var G=0,J=void 0,Y=void 0;A.lastIndex=0;do{!0===(J=A.test(s))&&(Y=A.lastIndex-1,G++)}while(!0===J);0!==G&&(N+=G,k=c-Y,this.updateTokenEndLineColumnLocation(d,f,Y,G,N,k,c))}this.handleModes(B,z,U,d)}else{for(var Z=x,X=N,Q=k,ee=!1;!ee&&x");var r=(0,i.O1)(t),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,a}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function Q(e){return te(e)?e.LABEL:e.name}function ee(e){return e.name}function te(e){return(0,i.Kg)(e.LABEL)&&""!==e.LABEL}var ne="parent",re="categories",ie="label",oe="group",ae="push_mode",se="pop_mode",ue="longer_alt",le="line_breaks",ce="start_chars_hint";function fe(e){return function(e){var t=e.pattern,n={};n.name=e.name,(0,i.b0)(t)||(n.PATTERN=t);if((0,i.zy)(e,ne))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";(0,i.zy)(e,re)&&(n.CATEGORIES=e[re]);$([n]),(0,i.zy)(e,ie)&&(n.LABEL=e[ie]);(0,i.zy)(e,oe)&&(n.GROUP=e[oe]);(0,i.zy)(e,se)&&(n.POP_MODE=e[se]);(0,i.zy)(e,ae)&&(n.PUSH_MODE=e[ae]);(0,i.zy)(e,ue)&&(n.LONGER_ALT=e[ue]);(0,i.zy)(e,le)&&(n.LINE_BREAKS=e[le]);(0,i.zy)(e,ce)&&(n.START_CHARS_HINT=e[ce]);return n}(e)}var pe=fe({name:"EOF",pattern:X.NA});function de(e,t,n,r,i,o,a,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function he(e,t){return z(e,t)}$([pe]);var me=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ge=function(){function e(e){this._definition=e}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){e.visit(this),(0,i.jJ)(this.definition,(function(t){t.accept(e)}))},e}(),ve=function(e){function t(t){var n=e.call(this,[])||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(ge),ye=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.orgText="",(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),be=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.ignoreAmbiguities=!1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),xe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),we=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),Ee=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),Ce=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),Se=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),t}(ge),Ne=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,(0,i.kp)(n,(0,i.Up)(t,(function(e){return void 0!==e}))),n}return me(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t}(ge),ke=function(){function e(e){this.idx=1,(0,i.kp)(this,(0,i.Up)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function _e(e){return(0,i.Tj)(e,Oe)}function Oe(e){function t(e){return(0,i.Tj)(e,Oe)}if(e instanceof ve)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof be)return{type:"Alternative",definition:t(e.definition)};if(e instanceof xe)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof we)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Ee)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Oe(new ke({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Se)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Oe(new ke({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Ce)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Ne)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ke){var n={type:"Terminal",name:e.terminalType.name,label:Q(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=(0,i.gd)(r)?r.source:r),n}if(e instanceof ye)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var Ae=function(){function e(){}return e.prototype.walk=function(e,t){var n=this;void 0===t&&(t=[]),(0,i.jJ)(e.definition,(function(r,o){var a=(0,i.gv)(e.definition,o+1);if(r instanceof ve)n.walkProdRef(r,a,t);else if(r instanceof ke)n.walkTerminal(r,a,t);else if(r instanceof be)n.walkFlat(r,a,t);else if(r instanceof xe)n.walkOption(r,a,t);else if(r instanceof we)n.walkAtLeastOne(r,a,t);else if(r instanceof Ee)n.walkAtLeastOneSep(r,a,t);else if(r instanceof Se)n.walkManySep(r,a,t);else if(r instanceof Ce)n.walkMany(r,a,t);else{if(!(r instanceof Ne))throw Error("non exhaustive match");n.walkOr(r,a,t)}}))},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,n){var r=[new xe({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkAtLeastOneSep=function(e,t,n){var r=Te(e,t,n);this.walk(e,r)},e.prototype.walkMany=function(e,t,n){var r=[new xe({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkManySep=function(e,t,n){var r=Te(e,t,n);this.walk(e,r)},e.prototype.walkOr=function(e,t,n){var r=this,o=t.concat(n);(0,i.jJ)(e.definition,(function(e){var t=new be({definition:[e]});r.walk(t,o)}))},e}();function Te(e,t,n){return[new xe({definition:[new ke({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var De=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case ve:return this.visitNonTerminal(t);case be:return this.visitAlternative(t);case xe:return this.visitOption(t);case we:return this.visitRepetitionMandatory(t);case Ee:return this.visitRepetitionMandatoryWithSeparator(t);case Se:return this.visitRepetitionWithSeparator(t);case Ce:return this.visitRepetition(t);case Ne:return this.visitAlternation(t);case ke:return this.visitTerminal(t);case ye:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),Me=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Pe(e,t){return void 0===t&&(t=[]),!!(e instanceof xe||e instanceof Ce||e instanceof Se)||(e instanceof Ne?(0,i.zN)(e.definition,(function(e){return Pe(e,t)})):!(e instanceof ve&&(0,i.gR)(t,e))&&(e instanceof ge&&(e instanceof ve&&t.push(e),(0,i.Si)(e.definition,(function(e){return Pe(e,t)})))))}function Re(e){if(e instanceof ve)return"SUBRULE";if(e instanceof xe)return"OPTION";if(e instanceof Ne)return"OR";if(e instanceof we)return"AT_LEAST_ONE";if(e instanceof Ee)return"AT_LEAST_ONE_SEP";if(e instanceof Se)return"MANY_SEP";if(e instanceof Ce)return"MANY";if(e instanceof ke)return"CONSUME";throw Error("non exhaustive match")}var Ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return Me(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";(0,i.zy)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";(0,i.zy)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(De),Fe=new Ie;function je(e){if(e instanceof ve)return je(e.referencedRule);if(e instanceof ke)return[e.terminalType];if(function(e){return e instanceof be||e instanceof xe||e instanceof Ce||e instanceof we||e instanceof Ee||e instanceof Se||e instanceof ke||e instanceof ye}(e))return function(e){var t,n=[],r=e.definition,o=0,a=r.length>o,s=!0;for(;a&&s;)s=Pe(t=r[o]),n=n.concat(je(t)),o+=1,a=r.length>o;return(0,i.sb)(n)}(e);if(function(e){return e instanceof Ne}(e))return function(e){var t=(0,i.Tj)(e.definition,(function(e){return je(e)}));return(0,i.sb)((0,i.Bq)(t))}(e);throw Error("non exhaustive match")}var Le="_~IN~_",Be=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ze=function(e){function t(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return Be(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,n){},t.prototype.walkProdRef=function(e,t,n){var r,i,o=(r=e.referencedRule,i=e.idx,r.name+i+Le+this.topProd.name),a=t.concat(n),s=je(new be({definition:a}));this.follows[o]=s},t}(Ae);var Ue={buildMismatchTokenMessage:function(e){var t=e.expected,n=e.actual;e.previous,e.ruleName;return"Expecting "+(te(t)?"--\x3e "+Q(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+n.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,n=e.actual,r=(e.previous,e.customUserDescription),o=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,i.$1)(n).image+"'";if(r)return o+r+a;var s=(0,i.TS)(t,(function(e,t){return e.concat(t)}),[]),u=(0,i.Tj)(s,(function(e){return"["+(0,i.Tj)(e,(function(e){return Q(e)})).join(", ")+"]"}));return o+("one of these possible Token sequences:\n"+(0,i.Tj)(u,(function(e,t){return" "+(t+1)+". "+e})).join("\n"))+a},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,n=e.actual,r=e.customUserDescription,o=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,i.$1)(n).image+"'";return r?o+r+a:o+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,i.Tj)(t,(function(e){return"["+(0,i.Tj)(e,(function(e){return Q(e)})).join(",")+"]"})).join(" ,")+">")+a}};Object.freeze(Ue);var qe={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},Ve={buildDuplicateFoundError:function(e,t){var n,r=e.name,o=(0,i.$1)(t),a=o.idx,s=Re(o),u=(n=o)instanceof ke?n.terminalType.name:n instanceof ve?n.nonTerminalName:"",l="->"+s+(a>0?a:"")+"<- "+(u?"with argument: ->"+u+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return l=(l=l.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=(0,i.Tj)(e.prefixPath,(function(e){return Q(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=(0,i.Tj)(e.prefixPath,(function(e){return Q(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx,r="Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n";return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=Re(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(t+" --\x3e "+i.Tj(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"deprecated"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof ye?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}},$e=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var He=function(e){function t(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return $e(t,e),t.prototype.resolveRefs=function(){var e=this;(0,i.jJ)((0,i.zu)(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Sn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(De),We=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ke=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName="",r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return We(t,e),t.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),i=new be({definition:r});this.possibleTokTypes=je(i),this.found=!0}},t}(function(e){function t(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName="",r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return We(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,i.T9)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,i.T9)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,n){void 0===n&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},t.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},t.prototype.updateExpectedNext=function(){(0,i.Im)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(Ae)),Ge=function(e){function t(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return We(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(Ae),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.walkMany=function(t,n,r){if(t.idx===this.occurrence){var o=(0,i.$1)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ke&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,r)},t}(Ge),Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.walkManySep=function(t,n,r){if(t.idx===this.occurrence){var o=(0,i.$1)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ke&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,r)},t}(Ge),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.walkAtLeastOne=function(t,n,r){if(t.idx===this.occurrence){var o=(0,i.$1)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ke&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,r)},t}(Ge),Xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.walkAtLeastOneSep=function(t,n,r){if(t.idx===this.occurrence){var o=(0,i.$1)(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ke&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,r)},t}(Ge);function Qe(e,t,n){void 0===n&&(n=[]),n=(0,i.T9)(n);var r=[],o=0;function a(a){var s=Qe(a.concat((0,i.gv)(e,o+1)),t,n);return r.concat(s)}for(;n.length=0;O--){var A={idx:m,def:y.definition[O].definition.concat((0,i.gv)(h)),ruleStack:g,occurrenceStack:v};p.push(A),p.push(s)}else if(y instanceof be)p.push({idx:m,def:y.definition.concat((0,i.gv)(h)),ruleStack:g,occurrenceStack:v});else{if(!(y instanceof ye))throw Error("non exhaustive match");p.push(tt(y,m,g,v))}}}else u&&(0,i.HV)(p).idx<=c&&p.pop()}return f}function tt(e,t,n,r){var o=(0,i.T9)(n);o.push(e.name);var a=(0,i.T9)(r);return a.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:a}}var nt,rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(nt||(nt={}));var it=function(e){function t(t,n,r){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=n,i.targetProdType=r,i}return rt(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)},t.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,nt.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,nt.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,nt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,nt.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,nt.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t}(Ae),ot=function(e){function t(t,n,r){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=n,i.targetRef=r,i.result=[],i}return rt(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,nt.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,nt.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,nt.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,nt.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,nt.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,nt.ALTERNATION)},t}(De);function at(e){for(var t=new Array(e),n=0;n1})),s=i.Tj(i.zu(a),(function(n){var r=i.$1(n),o=t.buildDuplicateFoundError(e,n),a=Re(r),s={message:o,type:Sn.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},u=vt(r);return u&&(s.parameter=u),s}));return s}(e,r)})),s=i.Tj(e,(function(e){return bt(e,e,r)})),u=[],l=[],c=[];(0,i.Si)(s,i.Im)&&(u=(0,i.Tj)(e,(function(e){return function(e,t){var n=new wt;e.accept(n);var r=n.alternations,o=i.TS(r,(function(n,r){var o=i.gc(r.definition),a=i.Tj(o,(function(n,o){var a=et([n],[],null,1);return i.Im(a)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:o}),type:Sn.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:o+1}:null}));return n.concat(i.oE(a))}),[]);return o}(e,r)})),l=(0,i.Tj)(e,(function(e){return function(e,t,n){var r=new wt;e.accept(r);var o=r.alternations;o=(0,i.ku)(o,(function(e){return!0===e.ignoreAmbiguities}));var a=i.TS(o,(function(r,o){var a=o.idx,s=o.maxLookahead||t,u=ct(a,e,s,o),l=function(e,t,n,r){var o=[],a=(0,i.TS)(e,(function(n,r,a){return!0===t.definition[a].ignoreAmbiguities||(0,i.jJ)(r,(function(r){var s=[a];(0,i.jJ)(e,(function(e,n){a!==n&&pt(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&s.push(n)})),s.length>1&&!pt(o,r)&&(o.push(r),n.push({alts:s,path:r}))})),n}),[]),s=i.Tj(a,(function(e){var o=(0,i.Tj)(e.alts,(function(e){return e+1}));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:o,prefixPath:e.path}),type:Sn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:[e.alts]}}));return s}(u,o,e,n),c=function(e,t,n,r){var o=[],a=(0,i.TS)(e,(function(e,t,n){var r=(0,i.Tj)(t,(function(e){return{idx:n,path:e}}));return e.concat(r)}),[]);return(0,i.jJ)(a,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var s=e.idx,u=e.path,l=(0,i.JW)(a,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:Sn.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n}),[]);return o}(e,r)})),d=(0,i.Tj)(e,(function(t){return function(e,t,n,r){var o=[],a=(0,i.TS)(t,(function(t,n){return n.name===e.name?t+1:t}),0);if(a>1){var s=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:s,type:Sn.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}(t,e,o,r)}));return i.Bq(a.concat(c,s,u,l,f,p,d))}function gt(e){return Re(e)+"_#_"+e.idx+"_#_"+vt(e)}function vt(e){return e instanceof ke?e.terminalType.name:e instanceof ve?e.nonTerminalName:""}var yt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return ht(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(De);function bt(e,t,n,r){void 0===r&&(r=[]);var o=[],a=xt(t.definition);if(i.Im(a))return[];var s=e.name;i.gR(a,e)&&o.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Sn.LEFT_RECURSION,ruleName:s});var u=i.iv(a,r.concat([e])),l=i.Tj(u,(function(t){var o=i.T9(r);return o.push(t),bt(e,t,n,o)}));return o.concat(i.Bq(l))}function xt(e){var t=[];if(i.Im(e))return t;var n=i.$1(e);if(n instanceof ve)t.push(n.referencedRule);else if(n instanceof be||n instanceof xe||n instanceof we||n instanceof Ee||n instanceof Se||n instanceof Ce)t=t.concat(xt(n.definition));else if(n instanceof Ne)t=i.Bq(i.Tj(n.definition,(function(e){return xt(e.definition)})));else if(!(n instanceof ke))throw Error("non exhaustive match");var r=Pe(n),o=e.length>1;if(r&&o){var a=i.gv(e);return t.concat(xt(a))}return t}var wt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return ht(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(De);var Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return ht(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(De);function Ct(e){e=(0,i.NT)(e,{errMsgProvider:qe});var t={};return(0,i.jJ)(e.rules,(function(e){t[e.name]=e})),function(e,t){var n=new He(e,t);return n.resolveRefs(),n.errors}(t,e.errMsgProvider)}function St(e){return mt((e=(0,i.NT)(e,{errMsgProvider:Ve})).rules,e.maxLookahead,e.tokenTypes,e.errMsgProvider,e.grammarName)}function Nt(e){(0,i.jJ)(e.rules,(function(e){var t=new Ie;e.accept(t),(0,i.jJ)(t.dslMethods,(function(e){(0,i.jJ)(e,(function(e,t){e.idx=t+1}))}))}))}var kt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t="MismatchedTokenException",Ot="NoViableAltException",At="EarlyExitException",Tt="NotAllInputParsedException",Dt=[_t,Ot,At,Tt];function Mt(e){return(0,i.gR)(Dt,e.name)}Object.freeze(Dt);var Pt=function(e){function t(t,n){var r=this.constructor,i=e.call(this,t)||this;return i.token=n,i.resyncedTokens=[],Object.setPrototypeOf(i,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return kt(t,e),t}(Error),Rt=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.previousToken=r,i.name=_t,i}return kt(t,e),t}(Pt),It=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.previousToken=r,i.name=Ot,i}return kt(t,e),t}(Pt),Ft=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=Tt,r}return kt(t,e),t}(Pt),jt=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.previousToken=r,i.name=At,i}return kt(t,e),t}(Pt),Lt={},Bt="InRuleRecoveryException";function zt(e){this.name=Bt,this.message=e}zt.prototype=Error.prototype;var Ut=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,i.zy)(e,"recoveryEnabled")?e.recoveryEnabled:Nn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=qt)},e.prototype.getTokenToInsert=function(e){var t=de(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,n,r){for(var o=this,a=this.findReSyncTokenType(),s=this.exportLexerState(),u=[],l=!1,c=this.LA(1),f=this.LA(1),p=function(){var e=o.LA(0),t=o.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:o.getCurrRuleFullName()}),n=new Rt(t,c,o.LA(0));n.resyncedTokens=(0,i.gc)(u),o.SAVE_ERROR(n)};!l;){if(this.tokenMatcher(f,r))return void p();if(n.call(this))return p(),void e.apply(this,t);this.tokenMatcher(f,a)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,u))}this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!1!==n&&(void 0!==e&&void 0!==t&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new zt("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,i.Im)(t))return!1;var r=this.LA(1);return void 0!==(0,i.I6)(t,(function(e){return n.tokenMatcher(r,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return(0,i.gR)(n,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),n=2;;){var r=t.tokenType;if((0,i.gR)(e,r))return r;t=this.LA(n),n++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return Lt;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,i.Tj)(t,(function(r,i){return 0===i?Lt:{ruleName:e.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:e.shortRuleNameToFullName(t[i-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,i.Tj)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,i.Bq)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===Lt)return[pe];var t=e.ruleName+e.idxInCallingRule+Le+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,pe)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],n=this.LA(1);!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return(0,i.gc)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,n,r,i,o,a){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,i.Tj)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)}))},e}();function qt(e,t,n,r,i,o,a){var s=this.getKeyForAutomaticLookahead(r,i),u=this.firstAfterRepMap[s];if(void 0===u){var l=this.getCurrRuleFullName();u=new o(this.getGAstProductions()[l],i).startWalking(),this.firstAfterRepMap[s]=u}var c=u.token,f=u.occurrence,p=u.isEndOfRule;1===this.RULE_STACK.length&&p&&void 0===c&&(c=pe,f=1),this.shouldInRepetitionRecoveryBeTried(c,f,a)&&this.tryInRepetitionRecovery(e,t,n,c)}var Vt=1024,$t=1280,Ht=1536;function Wt(e,t,n){return n|t|e}var Kt=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,i.zy)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Nn.dynamicTokensEnabled,this.maxLookahead=(0,i.zy)(e,"maxLookahead")?e.maxLookahead:Nn.maxLookahead,this.lookAheadFuncsCache=(0,i.rF)()?new Map:[],(0,i.rF)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,i.jJ)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var n=function(e){Fe.reset(),e.accept(Fe);var t=Fe.dslMethods;return Fe.reset(),t}(e),r=n.alternation,o=n.repetition,a=n.option,s=n.repetitionMandatory,u=n.repetitionMandatoryWithSeparator,l=n.repetitionWithSeparator;(0,i.jJ)(r,(function(n){var r=0===n.idx?"":n.idx;t.TRACE_INIT(""+Re(n)+r,(function(){var r=function(e,t,n,r,i,o){var a=ct(e,t,n);return o(a,r,dt(a)?U:z,i)}(n.idx,e,n.maxLookahead||t.maxLookahead,n.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),i=Wt(t.fullRuleNameToShort[e.name],256,n.idx);t.setLaFuncCache(i,r)}))})),(0,i.jJ)(o,(function(n){t.computeLookaheadFunc(e,n.idx,768,nt.REPETITION,n.maxLookahead,Re(n))})),(0,i.jJ)(a,(function(n){t.computeLookaheadFunc(e,n.idx,512,nt.OPTION,n.maxLookahead,Re(n))})),(0,i.jJ)(s,(function(n){t.computeLookaheadFunc(e,n.idx,Vt,nt.REPETITION_MANDATORY,n.maxLookahead,Re(n))})),(0,i.jJ)(u,(function(n){t.computeLookaheadFunc(e,n.idx,Ht,nt.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,Re(n))})),(0,i.jJ)(l,(function(n){t.computeLookaheadFunc(e,n.idx,$t,nt.REPETITION_WITH_SEPARATOR,n.maxLookahead,Re(n))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,n,r,i,o){var a=this;this.TRACE_INIT(""+o+(0===t?"":t),(function(){var o=function(e,t,n,r,i,o){var a=ft(e,t,i,n),s=dt(a)?U:z;return o(a[0],s,r)}(t,e,i||a.maxLookahead,a.dynamicTokensEnabled,r,a.lookAheadBuilderForOptional),s=Wt(a.fullRuleNameToShort[e.name],n,t);a.setLaFuncCache(s,o)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,n){return function(e,t,n){var r=(0,i.Si)(e,(function(e){return 1===e.length})),o=e.length;if(r&&!n){var a=(0,i.Bq)(e);if(1===a.length&&(0,i.Im)(a[0].categoryMatches)){var s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}var u=(0,i.TS)(a,(function(e,t,n){return e[t.tokenTypeIdx]=!0,(0,i.jJ)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===u[e.tokenTypeIdx]}}return function(){e:for(var n=0;n on "+Xt(e.constructor)+" CST Visitor.",type:Yt.MISSING_METHOD,methodName:t}}));return(0,i.oE)(n)}(e,t),r=function(e,t){var n=[];for(var r in e)!(0,i.Tn)(e[r])||(0,i.gR)(nn,r)||(0,i.gR)(t,r)||n.push({msg:"Redundant visitor method: <"+r+"> on "+Xt(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\n",type:Yt.REDUNDANT_METHOD,methodName:r});return n}(e,t);return n.concat(r)}(this,t);if(!(0,i.Im)(e)){var n=(0,i.Tj)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+Xt(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Yt||(Yt={}));var nn=["constructor","visit","validateVisitor"];var rn=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,i.zy)(e,"nodeLocationTracking")?e.nodeLocationTracking:Nn.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Jt,this.setNodeLocationFromNode=Jt,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Gt,this.setNodeLocationFromNode=Gt,this.cstPostRule=i.tE,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=i.tE,this.setNodeLocationFromNode=i.tE,this.cstPostRule=i.tE,this.setInitialNodeLocation=i.tE}else this.cstInvocationStateUpdate=i.tE,this.cstFinallyStateUpdate=i.tE,this.cstPostTerminal=i.tE,this.cstPostNonTerminal=i.tE,this.cstPostRule=i.tE},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(e,t){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var n,r,i,o=this.CST_STACK[this.CST_STACK.length-1];r=t,i=e,void 0===(n=o).children[i]?n.children[i]=[r]:n.children[i].push(r),this.setNodeLocationFromToken(o.location,t)},e.prototype.cstPostNonTerminal=function(e,t){var n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if((0,i.b0)(this.baseCstVisitorConstructor)){var e=tn(this.className,(0,i.HP)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,i.b0)(this.baseCstVisitorWithDefaultsConstructor)){var e=function(e,t,n){var r=function(){};Qt(r,e+"BaseSemanticsWithDefaults");var o=Object.create(n.prototype);return(0,i.jJ)(t,(function(e){o[e]=en})),(r.prototype=o).constructor=r,r}(this.className,(0,i.HP)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e}(),on=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Cn},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Cn:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),an=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,n){if(void 0===n&&(n=kn),(0,i.gR)(this.definedRulesNames,e)){var r={message:Ve.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Sn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(r)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.OVERRIDE_RULE=function(e,t,n){void 0===n&&(n=kn);var r=[];r=r.concat(function(e,t,n){var r,o=[];return i.gR(t,e)||(r="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->"+n+"<-as it is not defined in any of the super grammars ",o.push({message:r,type:Sn.INVALID_RULE_OVERRIDE,ruleName:e})),o}(e,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(Mt(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return _e((0,i.zu)(this.gastProductionsCache))},e}(),sn=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=Xt(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=U,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,i.zy)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,i.cy)(e)){if((0,i.Im)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"===typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,i.cy)(e))this.tokensMap=(0,i.TS)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,i.zy)(e,"modes")&&(0,i.Si)((0,i.Bq)((0,i.zu)(e.modes)),G)){var n=(0,i.Bq)((0,i.zu)(e.modes)),r=(0,i.sb)(n);this.tokensMap=(0,i.TS)(r,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,i.Gv)(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,i.lR)(e)}this.tokensMap.EOF=pe;var o=(0,i.Si)((0,i.zu)(e),(function(e){return(0,i.Im)(e.categoryMatches)}));this.tokenMatcher=o?U:z,$((0,i.zu)(this.tokensMap))},e.prototype.defineRule=function(e,t,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var r,o=(0,i.zy)(n,"resyncEnabled")?n.resyncEnabled:kn.resyncEnabled,a=(0,i.zy)(n,"recoveryValueFunc")?n.recoveryValueFunc:kn.recoveryValueFunc,s=this.ruleShortNameIdx<<12;function u(e){try{if(!0===this.outputCst){t.apply(this,e);var n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}return t.apply(this,e)}catch(r){return this.invokeRuleCatch(r,o,a)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;return(r=function(t,n){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(s,e,t),u.call(this,n)}).ruleName=e,r.originalGrammarAction=t,r},e.prototype.invokeRuleCatch=function(e,t,n){var r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Mt(e)){var o=e;if(i){var a,s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))return o.resyncedTokens=this.reSyncTo(s),this.outputCst?((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a):n();throw this.outputCst&&((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,o.partialCstResult=a),o}if(r)return this.moveToTerminatedState(),n();throw o}throw e},e.prototype.optionInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)},e.prototype.optionInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,void 0!==(i=e.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=e;if(!0===a.call(this))return r.call(this)},e.prototype.atLeastOneInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Vt,e);return this.atLeastOneInternalLogic(e,t,n)},e.prototype.atLeastOneInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(i=t.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=t;if(!0!==a.call(this))throw this.raiseEarlyExitException(e,nt.REPETITION_MANDATORY,t.ERR_MSG);for(var u=this.doSingleRepetition(r);!0===a.call(this)&&!0===u;)u=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],a,Vt,e,Ze)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Ht,e);this.atLeastOneSepFirstInternalLogic(e,t,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,nt.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);i.call(this);for(var a=function(){return r.tokenMatcher(r.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Xe],a,Ht,e,Xe)},e.prototype.manyInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)},e.prototype.manyInternalLogic=function(e,t,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(i=t.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=t;for(var u=!0;!0===a.call(this)&&!0===u;)u=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],a,768,e,Je,u)},e.prototype.manySepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead($t,e);this.manySepFirstInternalLogic(e,t,n)},e.prototype.manySepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){i.call(this);for(var a=function(){return r.tokenMatcher(r.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ye],a,$t,e,Ye)}},e.prototype.repetitionSepSecondInternal=function(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,Ht,e,i)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(256,t),r=(0,i.cy)(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,r);if(void 0!==o)return r[o].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Ft(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=e.call(this,t,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(o){this.subruleInternalError(o,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw Mt(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(o){r=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Rt(r,t,i))},e.prototype.consumeInternalRecovery=function(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(i){throw i.name===Bt?n:i}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,i.T9)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),pe)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),un=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,i.zy)(e,"errorMessageProvider")?e.errorMessageProvider:Nn.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if(Mt(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,i.T9)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return(0,i.T9)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,n){for(var r=this.getCurrRuleFullName(),i=ft(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new jt(s,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var n=this.getCurrRuleFullName(),r=ct(e,this.getGAstProductions()[n],this.maxLookahead),i=[],o=1;o<=this.maxLookahead;o++)i.push(this.LA(o));var a=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new It(s,this.LA(1),a))},e}(),ln=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var n=this.gastProductionsCache[e];if((0,i.b0)(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return et([n],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,i.$1)(e.ruleStack),n=this.getGAstProductions()[t];return new Ke(n,e).startWalking()},e}(),cn={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(cn);var fn=!0,pn=Math.pow(2,8)-1,dn=fe({name:"RECORDING_PHASE_TOKEN",pattern:X.NA});$([dn]);var hn=de(dn,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(hn);var mn={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},gn=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var n=t>0?t:"";e["CONSUME"+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e["SUBRULE"+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e["OPTION"+n]=function(e){return this.optionInternalRecord(e,t)},e["OR"+n]=function(e){return this.orInternalRecord(e,t)},e["MANY"+n]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+n]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+n]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var n=t>0?t:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return Cn},e.prototype.topLevelRuleRecord=function(e,t){try{var n=new ye({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(r){if(!0!==r.KNOWN_RECORDER_ERROR)try{r.message=r.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(i){throw r}throw r}},e.prototype.optionInternalRecord=function(e,t){return vn.call(this,xe,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){vn.call(this,we,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){vn.call(this,Ee,t,e,fn)},e.prototype.manyInternalRecord=function(e,t){vn.call(this,Ce,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){vn.call(this,Se,t,e,fn)},e.prototype.orInternalRecord=function(e,t){return yn.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,n){if(xn(t),!e||!1===(0,i.zy)(e,"ruleName")){var r=new Error(" argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=(0,i.se)(this.recordingProdStack),a=e.ruleName,s=new ve({idx:t,nonTerminalName:a,referencedRule:void 0});return o.definition.push(s),this.outputCst?mn:cn},e.prototype.consumeInternalRecord=function(e,t,n){if(xn(t),!W(e)){var r=new Error(" argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=(0,i.se)(this.recordingProdStack),a=new ke({idx:t,terminalType:e});return o.definition.push(a),hn},e}();function vn(e,t,n,r){void 0===r&&(r=!1),xn(n);var o=(0,i.se)(this.recordingProdStack),a=(0,i.Tn)(t)?t:t.DEF,s=new e({definition:[],idx:n});return r&&(s.separator=t.SEP),(0,i.zy)(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),o.definition.push(s),this.recordingProdStack.pop(),cn}function yn(e,t){var n=this;xn(t);var r=(0,i.se)(this.recordingProdStack),o=!1===(0,i.cy)(e),a=!1===o?e:e.DEF,s=new Ne({definition:[],idx:t,ignoreAmbiguities:o&&!0===e.IGNORE_AMBIGUITIES});(0,i.zy)(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);var u=(0,i.zN)(a,(function(e){return(0,i.Tn)(e.GATE)}));return s.hasPredicates=u,r.definition.push(s),(0,i.jJ)(a,(function(e){var t=new be({definition:[]});s.definition.push(t),(0,i.zy)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,i.zy)(e,"GATE")&&(t.ignoreAmbiguities=!0),n.recordingProdStack.push(t),e.ALT.call(n),n.recordingProdStack.pop()})),cn}function bn(e){return 0===e?"":""+e}function xn(e){if(e<0||e>pn){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(pn+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var wn=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,i.zy)(e,"traceInitPerf")){var t=e.traceInitPerf,n="number"===typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Nn.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent");var r=(0,i.O1)(t),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,a}return t()},e}(),En=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cn=de(pe,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Cn);var Sn,Nn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ue,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),kn=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function _n(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"}(Sn||(Sn={}));var On=function(){function e(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),(0,i.zy)(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=(0,i.zy)(t,"skipValidations")?t.skipValidations:Nn.skipValidations}return e.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var n;t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",(function(){(0,i.Bl)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,i.jJ)(t.definedRulesNames,(function(e){var n=t[e].originalGrammarAction,r=void 0;t.TRACE_INIT(e+" Rule",(function(){r=t.topLevelRuleRecord(e,n)})),t.gastProductionsCache[e]=r}))}finally{t.disableRecording()}}));var o=[];if(t.TRACE_INIT("Grammar Resolving",(function(){o=Ct({rules:(0,i.zu)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,o)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,i.Im)(o)&&!1===t.skipValidations){var e=St({rules:(0,i.zu)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:(0,i.zu)(t.tokensMap),errMsgProvider:Ve,grammarName:r});t.definitionErrors.push.apply(t.definitionErrors,e)}})),(0,i.Im)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=function(e){var t={};return(0,i.jJ)(e,(function(e){var n=new ze(e).startWalking();(0,i.kp)(t,n)})),t}((0,i.zu)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions((0,i.zu)(t.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,i.Im)(t.definitionErrors))throw n=(0,i.Tj)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();(0,i.XJ)(On,[Ut,Kt,rn,on,sn,an,un,ln,gn,wn]);var An=function(e){function t(t,n){void 0===n&&(n=Nn);var r=(0,i.lR)(n);return r.outputCst=!0,e.call(this,t,r)||this}return En(t,e),t}(On),Tn=function(e){function t(t,n){void 0===n&&(n=Nn);var r=(0,i.lR)(n);return r.outputCst=!1,e.call(this,t,r)||this}return En(t,e),t}(On);function Dn(e,t){var n=void 0===t?{}:t,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r+"/diagrams/":i,a=n.css;return'\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n'+("\n\n")+("\n