@jetstreamapp/soql-parser-js 6.1.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -3
- package/dist/cjs/index.js +143 -2
- package/dist/cli/index.js +148 -113
- package/dist/esm/index.mjs +143 -0
- package/dist/{cjs/src → types}/index.d.ts +1 -1
- package/package.json +23 -25
- package/dist/cjs/index.js.LICENSE.txt +0 -1
- package/dist/cjs/main.licenses.txt +0 -898
- package/dist/cjs/src/api/api-models.js +0 -2
- package/dist/cjs/src/api/public-utils.js +0 -175
- package/dist/cjs/src/composer/composer.js +0 -295
- package/dist/cjs/src/formatter/formatter.js +0 -236
- package/dist/cjs/src/index.js +0 -23
- package/dist/cjs/src/models.js +0 -2
- package/dist/cjs/src/parser/lexer.js +0 -954
- package/dist/cjs/src/parser/parser.js +0 -697
- package/dist/cjs/src/parser/visitor.js +0 -856
- package/dist/cjs/src/utils.js +0 -245
- package/dist/esm/api/api-models.js +0 -1
- package/dist/esm/api/public-utils.js +0 -153
- package/dist/esm/composer/composer.js +0 -273
- package/dist/esm/formatter/formatter.js +0 -223
- package/dist/esm/index.js +0 -4
- package/dist/esm/models.js +0 -1
- package/dist/esm/parser/lexer.js +0 -947
- package/dist/esm/parser/parser.js +0 -667
- package/dist/esm/parser/visitor.js +0 -823
- package/dist/esm/utils.js +0 -200
- package/dist/src/api/api-models.js +0 -2
- package/dist/src/api/public-utils.js +0 -203
- package/dist/src/composer/composer.js +0 -358
- package/dist/src/formatter/formatter.js +0 -263
- package/dist/src/index.js +0 -28
- package/dist/src/models.js +0 -2
- package/dist/src/parser/lexer.js +0 -997
- package/dist/src/parser/parser.js +0 -711
- package/dist/src/parser/visitor.js +0 -862
- package/dist/src/utils.js +0 -251
- /package/dist/{cjs/src → types}/api/api-models.d.ts +0 -0
- /package/dist/{cjs/src → types}/api/public-utils.d.ts +0 -0
- /package/dist/{cjs/src → types}/composer/composer.d.ts +0 -0
- /package/dist/{cjs/src → types}/formatter/formatter.d.ts +0 -0
- /package/dist/{cjs/src → types}/models.d.ts +0 -0
- /package/dist/{cjs/src → types}/parser/lexer.d.ts +0 -0
- /package/dist/{cjs/src → types}/parser/parser.d.ts +0 -0
- /package/dist/{cjs/src → types}/parser/visitor.d.ts +0 -0
- /package/dist/{cjs/src → types}/utils.d.ts +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,143 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("soqlParserJs",[],t):"object"==typeof exports?exports.soqlParserJs=t():e.soqlParserJs=t()}("undefined"!=typeof self?self:this,(()=>(()=>{var e={5173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFlattenedFields=t.getField=t.getComposedField=t.isWhereOrHavingClauseWithRightCondition=t.isWhereClauseWithRightCondition=t.isValueWithDateNLiteralCondition=t.isValueWithDateLiteralCondition=t.isValueQueryCondition=t.isValueFunctionCondition=t.isValueCondition=t.isSubquery=t.isString=t.isOrderByFn=t.isOrderByField=t.isNegationCondition=t.isHavingClauseWithRightCondition=t.isGroupByFn=t.isGroupByField=t.isFieldSubquery=t.hasAlias=void 0;var n=r(168);function i(e){if("string"==typeof e)return{type:"Field",field:e};if((0,n.isComposeFieldFunction)(e)){var t=[];return e.parameters&&(t=Array.isArray(e.parameters)?e.parameters:[e.parameters]),{type:"FieldFunctionExpression",functionName:e.functionName||e.fn,parameters:t,alias:e.alias}}if((0,n.isComposeFieldRelationship)(e))return{type:"FieldRelationship",field:e.field,relationships:e.relationships,objectPrefix:e.objectPrefix};if((0,n.isComposeFieldSubquery)(e))return{type:"FieldSubquery",subquery:e.subquery};if((0,n.isComposeFieldTypeof)(e))return{type:"FieldTypeof",field:e.field,conditions:e.conditions};if((0,n.isComposeField)(e))return{type:"Field",field:e.field,objectPrefix:e.objectPrefix};throw new TypeError("The input object provided did not match any valid field types")}Object.defineProperty(t,"hasAlias",{enumerable:!0,get:function(){return n.hasAlias}}),Object.defineProperty(t,"isFieldSubquery",{enumerable:!0,get:function(){return n.isFieldSubquery}}),Object.defineProperty(t,"isGroupByField",{enumerable:!0,get:function(){return n.isGroupByField}}),Object.defineProperty(t,"isGroupByFn",{enumerable:!0,get:function(){return n.isGroupByFn}}),Object.defineProperty(t,"isHavingClauseWithRightCondition",{enumerable:!0,get:function(){return n.isHavingClauseWithRightCondition}}),Object.defineProperty(t,"isNegationCondition",{enumerable:!0,get:function(){return n.isNegationCondition}}),Object.defineProperty(t,"isOrderByField",{enumerable:!0,get:function(){return n.isOrderByField}}),Object.defineProperty(t,"isOrderByFn",{enumerable:!0,get:function(){return n.isOrderByFn}}),Object.defineProperty(t,"isString",{enumerable:!0,get:function(){return n.isString}}),Object.defineProperty(t,"isSubquery",{enumerable:!0,get:function(){return n.isSubquery}}),Object.defineProperty(t,"isValueCondition",{enumerable:!0,get:function(){return n.isValueCondition}}),Object.defineProperty(t,"isValueFunctionCondition",{enumerable:!0,get:function(){return n.isValueFunctionCondition}}),Object.defineProperty(t,"isValueQueryCondition",{enumerable:!0,get:function(){return n.isValueQueryCondition}}),Object.defineProperty(t,"isValueWithDateLiteralCondition",{enumerable:!0,get:function(){return n.isValueWithDateLiteralCondition}}),Object.defineProperty(t,"isValueWithDateNLiteralCondition",{enumerable:!0,get:function(){return n.isValueWithDateNLiteralCondition}}),Object.defineProperty(t,"isWhereClauseWithRightCondition",{enumerable:!0,get:function(){return n.isWhereClauseWithRightCondition}}),Object.defineProperty(t,"isWhereOrHavingClauseWithRightCondition",{enumerable:!0,get:function(){return n.isWhereOrHavingClauseWithRightCondition}}),t.getComposedField=function(e){return i(e)},t.getField=i,t.getFlattenedFields=function(e,t){if(!e)return[];var r=(e=(0,n.isFieldSubquery)(e)?e.subquery:e).fields;if(!r)return[];var i={};e.groupBy&&(i=(Array.isArray(e.groupBy)?e.groupBy:[e.groupBy]).reduce((function(e,t){return(0,n.isGroupByField)(t)&&(e[t.field.toLocaleLowerCase()]=t.field),e}),{}));var o=-1,a=((0,n.isSubquery)(e)?e.relationshipName:e.sObject||"").toLowerCase(),s=(e.sObjectAlias||"").toLowerCase();return r.flatMap((function(e){switch(e.type){case"Field":return e.alias||e.field;case"FieldFunctionExpression":var r=(0,n.getParams)(e);if(r=r.map((function(e){if(e.includes(".")){var t=e.split("."),r=t[0].toLowerCase();return r!==s&&r!==a||(t=t.slice(1)),t.join(".")}return e})),e.alias&&(e.isAggregateFn||t))return e.alias;if(e.alias){var u=r[0];return u.includes(".")?((r=u.split(".").slice(0,-1)).push(e.alias),r.join(".")):e.alias}return e.isAggregateFn||(0,n.isNestedParamAggregateFunction)(e)||t?(o++,"expr".concat(o)):r.length>0?r.join("."):e.functionName;case"FieldRelationship":var c=e.relationships[0].toLowerCase();return(0,n.hasAlias)(e)?e.alias:e.rawValue&&i[e.rawValue.toLocaleLowerCase()]?e.field:c===s||c===a?e.relationships.concat([e.field]).slice(1).join("."):e.relationships.concat([e.field]).join(".");case"FieldSubquery":return e.subquery.relationshipName;case"FieldTypeof":var l=new Set,f=[];return e.conditions.forEach((function(t){t.fieldList.forEach((function(t){l.has(t)||(l.add(t),f.push("".concat(e.field,".").concat(t)))}))})),f}})).filter((function(e){return(0,n.isString)(e)}))}},308:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Compose=t.composeQuery=t.formatQuery=void 0;var i=r(168),o=r(4446),a=r(4159);function s(e,t){if(void 0===t&&(t={}),!e)return"";(t=t||{}).format=!!t.format,t.logging&&(console.time("composer"),console.log("Composing Query:",e),console.log("Format output:",t.format));var r=new u(e,t).query;return t.logging&&console.timeEnd("composer"),r}t.formatQuery=function(e,t,r){return s((0,a.parseQuery)(e,r),{format:!0,formatOptions:t})},t.composeQuery=s;var u=function(){function e(e,t){void 0===t&&(t={}),this.soql=e,this.logging=!1,this.format=!1;var r=(t=n({autoCompose:!0},t)).logging,i=t.format;this.logging=!!r,this.format=!!i,this.query="",this.formatter=new o.Formatter(this.format,n({logging:this.logging},t.formatOptions)),t.autoCompose&&this.start()}return e.prototype.start=function(){this.query=this.parseQuery(this.soql)},e.prototype.log=function(e){this.logging&&console.log("Current SOQL:",e)},e.prototype.parseFn=function(e){var t,r=this;return e.rawValue?t=e.rawValue:(t=e.functionName,t+="(".concat((e.parameters||[]).map((function(e){return i.isString(e)?e:r.parseFn(e)})).join(", "),")")),e.alias&&(t+=" ".concat(e.alias)),t},e.prototype.parseQuery=function(e){var t=this,r={fields:this.parseFields(e.fields||[]).map((function(e){return{text:e.text,typeOfClause:e.typeOfClause,isSubquery:e.text.startsWith("("),prefix:"",suffix:""}})),isSubquery:i.isSubquery(e),lineBreaks:[]},n="";e.fields&&(n+=this.formatter.formatClause("SELECT").trimStart()),this.formatter.formatFields(r);var o="";if(r.fields.forEach((function(e){Array.isArray(e.typeOfClause)?o+="".concat(e.prefix).concat(t.formatter.formatTyeOfField(e.text,e.typeOfClause)).concat(e.suffix):o+="".concat(e.prefix).concat(e.text).concat(e.suffix)})),n+=this.formatter.formatText(o),(i.isSubquery(e)?e.relationshipName:e.sObject)&&(n+=this.formatter.formatClause("FROM")),i.isSubquery(e)){var a=e.sObjectPrefix||[];a.push(e.relationshipName),n+=this.formatter.formatText("".concat(a.join(".")).concat(i.get(e.sObjectAlias,""," ")))}else e.sObject&&(n+=this.formatter.formatText("".concat(e.sObject).concat(i.get(e.sObjectAlias,""," "))));return this.log(n),e.usingScope&&(n+=this.formatter.formatClause("USING SCOPE"),n+=this.formatter.formatText(e.usingScope),this.log(n)),e.where&&(n+=this.formatter.formatClause("WHERE"),n+=this.formatter.formatText(this.parseWhereOrHavingClause(e.where)),this.log(n)),e.groupBy&&(n+=this.formatter.formatClause("GROUP BY"),n+=this.formatter.formatText(this.parseGroupByClause(e.groupBy)),this.log(n),e.having&&(n+=this.formatter.formatClause("HAVING"),n+=this.formatter.formatText(this.parseWhereOrHavingClause(e.having)),this.log(n))),e.orderBy&&(!Array.isArray(e.orderBy)||e.orderBy.length>0)&&(n+=this.formatter.formatClause("ORDER BY"),n+=this.formatter.formatText(this.parseOrderBy(e.orderBy)),this.log(n)),i.isNumber(e.limit)&&(n+=this.formatter.formatClause("LIMIT"),n+=this.formatter.formatText("".concat(e.limit)),this.log(n)),i.isNumber(e.offset)&&(n+=this.formatter.formatClause("OFFSET"),n+=this.formatter.formatText("".concat(e.offset)),this.log(n)),e.withDataCategory&&(n+=this.formatter.formatClause("WITH DATA CATEGORY"),n+=this.formatter.formatText(this.parseWithDataCategory(e.withDataCategory)),this.log(n)),e.withSecurityEnforced&&(n+=this.formatter.formatClause("WITH SECURITY_ENFORCED"),this.log(n)),e.withAccessLevel&&(n+=this.formatter.formatClause("WITH ".concat(e.withAccessLevel)),this.log(n)),e.for&&(n+=this.formatter.formatClause("FOR"),n+=this.formatter.formatText(e.for),this.log(n)),e.update&&(n+=this.formatter.formatClause("UPDATE"),n+=this.formatter.formatText(e.update),this.log(n)),n.trim()},e.prototype.parseFields=function(e){var t=this;return e.map((function(e){var r,n="",o=e.objectPrefix?"".concat(e.objectPrefix,"."):"";switch(e.type){case"Field":n="".concat(o).concat(e.field).concat(e.alias?" ".concat(e.alias):"");break;case"FieldFunctionExpression":var a="";e.parameters&&(a=e.parameters.map((function(e){return i.isString(e)?e:t.parseFields([e]).map((function(e){return e.text}))})).join(", ")),n="".concat(e.functionName,"(").concat(a,")").concat(e.alias?" ".concat(e.alias):"");break;case"FieldRelationship":n="".concat(o).concat(e.relationships.join("."),".").concat(e.field).concat(i.hasAlias(e)?" ".concat(e.alias):"");break;case"FieldSubquery":n=t.formatter.formatSubquery(t.parseQuery(e.subquery));break;case"FieldTypeof":n=(r=t.parseTypeOfField(e)).join(" ")}return{text:n,typeOfClause:r}}))},e.prototype.parseTypeOfField=function(e){var t=this,r=["TYPEOF ".concat(e.field)].concat(e.conditions.map((function(e){return t.formatter.formatTypeofFieldCondition(e)})));return r.push("END"),r},e.prototype.parseWhereOrHavingClause=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=!1);var n="",o=e.left,a=!1;if(o&&(n+=this.formatter.formatParens(o.openParen,"(",i.isNegationCondition(o)),!i.isNegationCondition(o))){t=t+(o.openParen||0)-(o.closeParen||0),r&&t++;var s="";s+=i.isValueFunctionCondition(o)?this.parseFn(o.fn):o.field,s+=" ".concat(o.operator," "),i.isValueQueryCondition(o)?s+=this.formatter.formatSubquery(this.parseQuery(o.valueQuery),1,!0):s+=i.getAsArrayStr(i.getWhereValue(o.value,o.literalType,o.operator)),n+=this.formatter.formatWithIndent(s),n+=this.formatter.formatParens(o.closeParen,")",r)}if(i.isWhereOrHavingClauseWithRightCondition(e)){var u=i.get(e.operator);a="NOT"===u;var c=this.formatter.formatWhereClauseOperators(u,this.parseWhereOrHavingClause(e.right,t,i.isNegationCondition(o)),t);return"".concat(a?n.trimRight():n).concat(c).trim()}return n.trim()},e.prototype.parseGroupByClause=function(e){var t=this;return(Array.isArray(e)?e:[e]).map((function(e){return i.isGroupByField(e)?e.field:t.parseFn(e.fn)})).join(", ")},e.prototype.parseOrderBy=function(e){var t=this;if(Array.isArray(e))return this.formatter.formatOrderByArray(e.map((function(e){return t.parseOrderBy(e)})));var r="";return i.isOrderByField(e)?r="".concat(i.get(e.field," ")):r+="".concat(this.parseFn(e.fn)," "),(r+="".concat(i.get(e.order," ")).concat(i.get(e.nulls,"","NULLS "))).trim()},e.prototype.parseWithDataCategory=function(e){return e.conditions.map((function(e){var t=e.parameters.length>1?"(".concat(e.parameters.join(", "),")"):"".concat(e.parameters.join(", "));return"".concat(e.groupName," ").concat(e.selector," ").concat(t)})).join(" AND ")},e}();t.Compose=u},4446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Formatter=void 0;var n=r(168),i=function(){function e(e,t){var r,n,i,o,a;this.currIndent=1,this.enabled=e,this.options={numIndent:null!==(r=t.numIndent)&&void 0!==r?r:1,fieldMaxLineLength:null!==(n=t.fieldMaxLineLength)&&void 0!==n?n:60,fieldSubqueryParensOnOwnLine:null===(i=t.fieldSubqueryParensOnOwnLine)||void 0===i||i,whereClauseOperatorsIndented:!0,newLineAfterKeywords:null!==(o=t.newLineAfterKeywords)&&void 0!==o&&o,logging:null!==(a=t.logging)&&void 0!==a&&a},this.options.newLineAfterKeywords&&(this.options.fieldSubqueryParensOnOwnLine=!0)}return e.prototype.log=function(e){this.options.logging&&console.log(e)},e.prototype.getIndent=function(e){return void 0===e&&(e=0),this.repeatChar((this.currIndent+e)*(this.options.numIndent||1),"\t")},e.prototype.repeatChar=function(e,t){return new Array(e).fill(t).join("")},e.prototype.setSubquery=function(e){this.currIndent=e?this.currIndent+=1:this.currIndent-=1},e.prototype.stepCurrIndex=function(e){this.currIndent+=e},e.prototype.formatFields=function(e){var t=this;function r(t){e.fields[t-1]&&(e.fields[t-1].suffix=e.fields[t-1].suffix.trim())}if(e.fields.forEach((function(t,r){t.suffix=e.fields.length-1===r?"":", "})),this.enabled){var i=0,o=!1;e.fields.forEach((function(a,s){a.isSubquery?(r(s),a.prefix="\n".concat(t.getIndent()),a.suffix=e.fields.length-1===s?"":", ",i=0,o=!0):Array.isArray(a.typeOfClause)?(r(s),a.prefix="\n".concat(t.getIndent()),o=!0):(0,n.isNumber)(t.options.fieldMaxLineLength)&&((i+=a.text.length+a.suffix.length)>t.options.fieldMaxLineLength||o)&&(r(s),(!t.options.newLineAfterKeywords||s>0)&&(a.prefix+="\n".concat(t.getIndent())),i=0,o=!1),t.log(a)}))}},e.prototype.formatTyeOfField=function(e,t){var r=this;return this.enabled&&this.options.newLineAfterKeywords?t.map((function(e,n){return 0===n?e:n===t.length-1?"".concat(r.getIndent()).concat(e):"".concat(r.getIndent(),"\t").concat(e)})).join("\n"):e},e.prototype.formatTypeofFieldCondition=function(e){var t="",r=e.fieldList.join(", ");if(this.enabled&&this.options.newLineAfterKeywords){var n=this.getIndent();t="".concat(e.type),e.objectType?t+="\n".concat(n,"\t\t").concat(e.objectType,"\n").concat(n,"\tTHEN\n").concat(n,"\t\t").concat(r):t+="\n".concat(n,"\t\t").concat(r)}else t=e.type,e.objectType?t+=" ".concat(e.objectType," THEN ").concat(r):t+=" ".concat(r);return t},e.prototype.formatSubquery=function(e,t,r){void 0===t&&(t=2),void 0===r&&(r=!1),r&&t++;var n="(",i=")";return this.enabled&&(this.options.fieldSubqueryParensOnOwnLine||this.options.newLineAfterKeywords?(e=e.replace(/\n/g,"\n".concat(this.repeatChar(t,"\t"))),n="(\n".concat(this.repeatChar(t,"\t")),i="\n".concat(this.repeatChar(t-1,"\t"),")")):e=e.replace(/\n/g,"\n\t")),"".concat(n).concat(e).concat(i)},e.prototype.formatClause=function(e){return this.enabled?this.options.newLineAfterKeywords?"\n".concat(e,"\n\t"):"\n".concat(e):" ".concat(e)},e.prototype.formatText=function(e){return this.enabled&&(this.options.newLineAfterKeywords||e.startsWith("\n"))?e:" ".concat(e)},e.prototype.formatWithIndent=function(e){return this.enabled?"".concat(this.getIndent()).concat(e):e},e.prototype.formatOrderByArray=function(e){var t=this;if(this.enabled){var r=0,n="";return e.forEach((function(i,o){var a=e[o+1];r+=i.length,a&&(r+a.length>(t.options.fieldMaxLineLength||0)||t.options.newLineAfterKeywords)?(n+="".concat(i,",\n\t"),r=0):n+="".concat(i).concat(a?", ":"")})),n}return e.join(", ")},e.prototype.formatParens=function(e,t,r){void 0===r&&(r=!1);var i="";if((0,n.isNumber)(e)&&e>0)if(this.enabled)if("("===t){for(var o=0;o<e;o++)r&&o===e-1?i+="(":0===o?i+="(\n":(this.currIndent++,i+="".concat(this.getIndent(),"(\n"));(!r||e>1)&&this.currIndent++}else for(o=e-1;o>=0;o--)r&&o===e-1?i+=")":(this.currIndent--,i+="\n".concat(this.getIndent(),")"));else i+=(0,n.generateParens)(e,t);return i},e.prototype.formatWhereClauseOperators=function(e,t,r){void 0===r&&(r=0);var n="NOT"===e;return this.enabled&&!n?"\n".concat(this.getIndent(r)).concat(e," ").concat(t):"".concat(n?"":" ").concat(e," ").concat(t)},e.prototype.formatAddNewLine=function(e,t){return void 0===e&&(e=" "),this.enabled&&!t?"\n":e},e}();t.Formatter=i},2093:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isQueryValid=t.parseQuery=void 0;var o=r(4159);Object.defineProperty(t,"parseQuery",{enumerable:!0,get:function(){return o.parseQuery}}),Object.defineProperty(t,"isQueryValid",{enumerable:!0,get:function(){return o.isQueryValid}}),i(r(5173),t),i(r(5945),t),i(r(308),t)},1963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Where=t.Using=t.True=t.Select=t.Rollup=t.Or=t.Nulls=t.Null=t.Not=t.Limit=t.Like=t.Last=t.Includes=t.In=t.Having=t.GroupBy=t.From=t.First=t.False=t.Excludes=t.Else=t.Cube=t.OrderBy=t.Asc=t.Desc=t.As=t.And=t.WhiteSpace=t.StringIdentifier=t.Identifier=t.RParenMismatch=t.UsingScopeEnumeration=t.IdentifierNotKeyword=t.IntegerNumberIdentifier=t.DecimalNumberIdentifier=t.NumberIdentifier=t.DateIdentifier=t.SymbolIdentifier=t.RelationalOperator=t.DateNLiteral=t.DateLiteralNotIdentifier=t.DateLiteral=t.OtherFunction=t.FieldsFunctionParamIdentifier=t.FieldsFunction=t.LocationFunction=t.AggregateFunction=t.DateFunction=t.Keyword=t.ReservedKeyword=void 0,t.All=t.Grouping=t.ConvertCurrency=t.ConvertTimeZone=t.Tolabel=t.Format=t.Fields=t.Geolocation=t.Distance=t.Sum=t.Max=t.Min=t.CountDistinct=t.Count=t.Avg=t.WeekInYear=t.WeekInMonth=t.HourInDay=t.FiscalYear=t.FiscalQuarter=t.FiscalMonth=t.DayOnly=t.DayInYear=t.DayInWeek=t.DayInMonth=t.CalendarYear=t.CalendarQuarter=t.CalendarMonth=t.UserMode=t.SystemMode=t.SecurityEnforced=t.When=t.Viewstat=t.View=t.Typeof=t.Then=t.Tracking=t.Scope=t.Reference=t.Offset=t.End=t.DataCategory=t.Below=t.At=t.ApexNew=t.AboveOrBelow=t.Above=t.Update=t.For=t.With=void 0,t.LessThanOrEqual=t.LessThan=t.NotEqual=t.Equal=t.NFiscalYearsAgo=t.LastNFiscalYears=t.NextNFiscalYears=t.NFiscalQuartersAgo=t.LastNFiscalQuarters=t.NextNFiscalQuarters=t.NYearsAgo=t.LastNYears=t.NextNYears=t.NQuartersAgo=t.LastNQuarters=t.NextNQuarters=t.NMonthsAgo=t.LastNMonths=t.NextNMonths=t.NWeeksAgo=t.LastNWeeks=t.NextNWeeks=t.NDaysAgo=t.LastNDays=t.NextNDays=t.NextFiscalYear=t.LastFiscalYear=t.ThisFiscalYear=t.NextFiscalQuarter=t.LastFiscalQuarter=t.ThisFiscalQuarter=t.NextYear=t.LastYear=t.ThisYear=t.NextQuarter=t.LastQuarter=t.ThisQuarter=t.Next90_days=t.Last90_days=t.NextMonth=t.ThisMonth=t.LastMonth=t.NextWeek=t.ThisWeek=t.LastWeek=t.Tomorrow=t.Today=t.Yesterday=t.Standard=t.Custom=void 0,t.lex=t.allTokens=t.AllPrivate=t.Team=t.MyTeamTerritory=t.MyTerritory=t.Mine=t.MineAndMyGroups=t.Everything=t.Delegated=t.UnsignedInteger=t.GeolocationUnit=t.SignedInteger=t.CurrencyPrefixedInteger=t.UnsignedDecimal=t.SignedDecimal=t.CurrencyPrefixedDecimal=t.DateToken=t.DateTime=t.Minus=t.Plus=t.RSquareBracket=t.LSquareBracket=t.RParen=t.LParen=t.Asterisk=t.Comma=t.Semicolon=t.Colon=t.Decimal=t.GreaterThanOrEqual=t.GreaterThan=void 0;var n=r(6210);t.ReservedKeyword=(0,n.createToken)({name:"KeywordReserved",pattern:n.Lexer.NA}),t.Keyword=(0,n.createToken)({name:"Keyword",pattern:n.Lexer.NA}),t.DateFunction=(0,n.createToken)({name:"DateFunction",pattern:n.Lexer.NA}),t.AggregateFunction=(0,n.createToken)({name:"AggregateFunction",pattern:n.Lexer.NA}),t.LocationFunction=(0,n.createToken)({name:"LocationFunction",pattern:n.Lexer.NA}),t.FieldsFunction=(0,n.createToken)({name:"FieldsFunction",pattern:n.Lexer.NA}),t.FieldsFunctionParamIdentifier=(0,n.createToken)({name:"FieldsFunctionParamIdentifier",pattern:n.Lexer.NA}),t.OtherFunction=(0,n.createToken)({name:"OtherFunction",pattern:n.Lexer.NA}),t.DateLiteral=(0,n.createToken)({name:"DateLiteral",pattern:n.Lexer.NA}),t.DateLiteralNotIdentifier=(0,n.createToken)({name:"DateLiteralNotIdentifier",pattern:n.Lexer.NA}),t.DateNLiteral=(0,n.createToken)({name:"DateNLiteral",pattern:n.Lexer.NA}),t.RelationalOperator=(0,n.createToken)({name:"RelationalOperator",pattern:n.Lexer.NA}),t.SymbolIdentifier=(0,n.createToken)({name:"SymbolIdentifier",pattern:n.Lexer.NA}),t.DateIdentifier=(0,n.createToken)({name:"DateIdentifier",pattern:n.Lexer.NA}),t.NumberIdentifier=(0,n.createToken)({name:"NumberIdentifier",pattern:n.Lexer.NA}),t.DecimalNumberIdentifier=(0,n.createToken)({name:"DecimalNumberIdentifier",pattern:n.Lexer.NA}),t.IntegerNumberIdentifier=(0,n.createToken)({name:"IntegerNumberIdentifier",pattern:n.Lexer.NA}),t.IdentifierNotKeyword=(0,n.createToken)({name:"IdentifierNotKeyword",pattern:n.Lexer.NA}),t.UsingScopeEnumeration=(0,n.createToken)({name:"UsingScopeEnumeration",pattern:n.Lexer.NA}),t.RParenMismatch=(0,n.createToken)({name:"RParenMismatch",pattern:n.Lexer.NA});var i=/[a-zA-Z][a-zA-Z0-9_.]*/y;t.Identifier=(0,n.createToken)({name:"Identifier",pattern:function(e,t){i.lastIndex=t;var r=i.exec(e);return r&&r[0].includes("..")?null:r},line_breaks:!1,categories:[t.IdentifierNotKeyword],start_chars_hint:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]}),t.StringIdentifier=(0,n.createToken)({name:"StringIdentifier",line_breaks:!0,pattern:/(')(?:(?=(\\?))\2.)*?\1/}),t.WhiteSpace=(0,n.createToken)({name:"WhiteSpace",pattern:/\s+/,group:n.Lexer.SKIPPED}),t.And=(0,n.createToken)({name:"AND",pattern:/AND/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.As=(0,n.createToken)({name:"AS",pattern:/AS/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Desc=(0,n.createToken)({name:"DESC",pattern:/DESC/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Asc=(0,n.createToken)({name:"ASC",pattern:/ASC/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.OrderBy=(0,n.createToken)({name:"ORDER_BY",pattern:/ORDER BY/i,longer_alt:t.Identifier}),t.Cube=(0,n.createToken)({name:"CUBE",pattern:/CUBE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Else=(0,n.createToken)({name:"ELSE",pattern:/ELSE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Excludes=(0,n.createToken)({name:"EXCLUDES",pattern:/EXCLUDES/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.False=(0,n.createToken)({name:"FALSE",pattern:/FALSE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.First=(0,n.createToken)({name:"FIRST",pattern:/FIRST/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.From=(0,n.createToken)({name:"FROM",pattern:/FROM/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.GroupBy=(0,n.createToken)({name:"GROUP_BY",pattern:/GROUP BY/i,longer_alt:t.Identifier}),t.Having=(0,n.createToken)({name:"HAVING",pattern:/HAVING/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.In=(0,n.createToken)({name:"IN",pattern:/IN/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Includes=(0,n.createToken)({name:"INCLUDES",pattern:/INCLUDES/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Last=(0,n.createToken)({name:"LAST",pattern:/LAST/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Like=(0,n.createToken)({name:"LIKE",pattern:/LIKE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Limit=(0,n.createToken)({name:"LIMIT",pattern:/LIMIT/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Not=(0,n.createToken)({name:"NOT",pattern:/NOT/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Null=(0,n.createToken)({name:"NULL",pattern:/NULL/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Nulls=(0,n.createToken)({name:"NULLS",pattern:/NULLS/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Or=(0,n.createToken)({name:"OR",pattern:/OR/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Rollup=(0,n.createToken)({name:"ROLLUP",pattern:/ROLLUP/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Select=(0,n.createToken)({name:"SELECT",pattern:/SELECT/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.True=(0,n.createToken)({name:"TRUE",pattern:/TRUE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Using=(0,n.createToken)({name:"USING",pattern:/USING/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Where=(0,n.createToken)({name:"WHERE",pattern:/WHERE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.With=(0,n.createToken)({name:"WITH",pattern:/WITH/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.For=(0,n.createToken)({name:"FOR",pattern:/FOR/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Update=(0,n.createToken)({name:"UPDATE",pattern:/UPDATE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.ReservedKeyword]}),t.Above=(0,n.createToken)({name:"ABOVE",pattern:/ABOVE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.AboveOrBelow=(0,n.createToken)({name:"ABOVE_OR_BELOW",pattern:/ABOVE_OR_BELOW/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.ApexNew=(0,n.createToken)({name:"new",pattern:/new/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.At=(0,n.createToken)({name:"AT",pattern:/AT/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Below=(0,n.createToken)({name:"BELOW",pattern:/BELOW/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.DataCategory=(0,n.createToken)({name:"DATA_CATEGORY",pattern:/DATA CATEGORY/i,longer_alt:t.Identifier,categories:[t.Keyword]}),t.End=(0,n.createToken)({name:"END",pattern:/END/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Offset=(0,n.createToken)({name:"OFFSET",pattern:/OFFSET/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Reference=(0,n.createToken)({name:"REFERENCE",pattern:/REFERENCE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Scope=(0,n.createToken)({name:"SCOPE",pattern:/SCOPE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Tracking=(0,n.createToken)({name:"TRACKING",pattern:/TRACKING/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Then=(0,n.createToken)({name:"THEN",pattern:/THEN/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Typeof=(0,n.createToken)({name:"TYPEOF",pattern:/TYPEOF/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.View=(0,n.createToken)({name:"VIEW",pattern:/VIEW/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.Viewstat=(0,n.createToken)({name:"VIEWSTAT",pattern:/VIEWSTAT/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.When=(0,n.createToken)({name:"WHEN",pattern:/WHEN/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.SecurityEnforced=(0,n.createToken)({name:"SECURITY_ENFORCED",pattern:/SECURITY_ENFORCED/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.SystemMode=(0,n.createToken)({name:"SYSTEM_MODE",pattern:/SYSTEM_MODE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.UserMode=(0,n.createToken)({name:"USER_MODE",pattern:/USER_MODE/i,longer_alt:t.Identifier,categories:[t.Keyword,t.Identifier]}),t.CalendarMonth=(0,n.createToken)({name:"CALENDAR_MONTH",pattern:/CALENDAR_MONTH/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.CalendarQuarter=(0,n.createToken)({name:"CALENDAR_QUARTER",pattern:/CALENDAR_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.CalendarYear=(0,n.createToken)({name:"CALENDAR_YEAR",pattern:/CALENDAR_YEAR/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.DayInMonth=(0,n.createToken)({name:"DAY_IN_MONTH",pattern:/DAY_IN_MONTH/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.DayInWeek=(0,n.createToken)({name:"DAY_IN_WEEK",pattern:/DAY_IN_WEEK/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.DayInYear=(0,n.createToken)({name:"DAY_IN_YEAR",pattern:/DAY_IN_YEAR/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.DayOnly=(0,n.createToken)({name:"DAY_ONLY",pattern:/DAY_ONLY/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.FiscalMonth=(0,n.createToken)({name:"FISCAL_MONTH",pattern:/FISCAL_MONTH/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.FiscalQuarter=(0,n.createToken)({name:"FISCAL_QUARTER",pattern:/FISCAL_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.FiscalYear=(0,n.createToken)({name:"FISCAL_YEAR",pattern:/FISCAL_YEAR/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.HourInDay=(0,n.createToken)({name:"HOUR_IN_DAY",pattern:/HOUR_IN_DAY/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.WeekInMonth=(0,n.createToken)({name:"WEEK_IN_MONTH",pattern:/WEEK_IN_MONTH/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.WeekInYear=(0,n.createToken)({name:"WEEK_IN_YEAR",pattern:/WEEK_IN_YEAR/i,longer_alt:t.Identifier,categories:[t.DateFunction,t.Identifier]}),t.Avg=(0,n.createToken)({name:"AVG",pattern:/AVG/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.Count=(0,n.createToken)({name:"COUNT",pattern:/COUNT/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.CountDistinct=(0,n.createToken)({name:"COUNT_DISTINCT",pattern:/COUNT_DISTINCT/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.Min=(0,n.createToken)({name:"MIN",pattern:/MIN/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.Max=(0,n.createToken)({name:"MAX",pattern:/MAX/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.Sum=(0,n.createToken)({name:"SUM",pattern:/SUM/i,longer_alt:t.Identifier,categories:[t.AggregateFunction,t.Identifier]}),t.Distance=(0,n.createToken)({name:"DISTANCE",pattern:/DISTANCE/i,longer_alt:t.Identifier,categories:[t.LocationFunction,t.Identifier]}),t.Geolocation=(0,n.createToken)({name:"GEOLOCATION",pattern:/GEOLOCATION/i,longer_alt:t.Identifier,categories:[t.LocationFunction,t.Identifier]}),t.Fields=(0,n.createToken)({name:"FIELDS",pattern:/FIELDS/i,longer_alt:t.Identifier,categories:[t.FieldsFunction,t.Identifier]}),t.Format=(0,n.createToken)({name:"FORMAT",pattern:/FORMAT/i,longer_alt:t.Identifier,categories:[t.OtherFunction,t.Identifier]}),t.Tolabel=(0,n.createToken)({name:"toLabel",pattern:/TOLABEL/i,longer_alt:t.Identifier,categories:[t.OtherFunction,t.Identifier]}),t.ConvertTimeZone=(0,n.createToken)({name:"convertTimezone",pattern:/CONVERTTIMEZONE/i,longer_alt:t.Identifier,categories:[t.OtherFunction,t.Identifier]}),t.ConvertCurrency=(0,n.createToken)({name:"convertCurrency",pattern:/CONVERTCURRENCY/i,longer_alt:t.Identifier,categories:[t.OtherFunction,t.Identifier]}),t.Grouping=(0,n.createToken)({name:"GROUPING",pattern:/GROUPING/i,longer_alt:t.Identifier,categories:[t.OtherFunction,t.Identifier]}),t.All=(0,n.createToken)({name:"ALL",pattern:/ALL/i,longer_alt:t.Identifier,categories:[t.FieldsFunctionParamIdentifier,t.Identifier]}),t.Custom=(0,n.createToken)({name:"CUSTOM",pattern:/CUSTOM/i,longer_alt:t.Identifier,categories:[t.FieldsFunctionParamIdentifier,t.Identifier]}),t.Standard=(0,n.createToken)({name:"STANDARD",pattern:/STANDARD/i,longer_alt:t.Identifier,categories:[t.FieldsFunctionParamIdentifier,t.Identifier]}),t.Yesterday=(0,n.createToken)({name:"YESTERDAY",pattern:/YESTERDAY/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.Today=(0,n.createToken)({name:"TODAY",pattern:/TODAY/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.Tomorrow=(0,n.createToken)({name:"TOMORROW",pattern:/TOMORROW/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastWeek=(0,n.createToken)({name:"LAST_WEEK",pattern:/LAST_WEEK/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisWeek=(0,n.createToken)({name:"THIS_WEEK",pattern:/THIS_WEEK/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextWeek=(0,n.createToken)({name:"NEXT_WEEK",pattern:/NEXT_WEEK/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastMonth=(0,n.createToken)({name:"LAST_MONTH",pattern:/LAST_MONTH/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisMonth=(0,n.createToken)({name:"THIS_MONTH",pattern:/THIS_MONTH/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextMonth=(0,n.createToken)({name:"NEXT_MONTH",pattern:/NEXT_MONTH/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.Last90_days=(0,n.createToken)({name:"LAST_90_DAYS",pattern:/LAST_90_DAYS/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.Next90_days=(0,n.createToken)({name:"NEXT_90_DAYS",pattern:/NEXT_90_DAYS/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisQuarter=(0,n.createToken)({name:"THIS_QUARTER",pattern:/THIS_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastQuarter=(0,n.createToken)({name:"LAST_QUARTER",pattern:/LAST_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextQuarter=(0,n.createToken)({name:"NEXT_QUARTER",pattern:/NEXT_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisYear=(0,n.createToken)({name:"THIS_YEAR",pattern:/THIS_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastYear=(0,n.createToken)({name:"LAST_YEAR",pattern:/LAST_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextYear=(0,n.createToken)({name:"NEXT_YEAR",pattern:/NEXT_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisFiscalQuarter=(0,n.createToken)({name:"THIS_FISCAL_QUARTER",pattern:/THIS_FISCAL_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastFiscalQuarter=(0,n.createToken)({name:"LAST_FISCAL_QUARTER",pattern:/LAST_FISCAL_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextFiscalQuarter=(0,n.createToken)({name:"NEXT_FISCAL_QUARTER",pattern:/NEXT_FISCAL_QUARTER/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.ThisFiscalYear=(0,n.createToken)({name:"THIS_FISCAL_YEAR",pattern:/THIS_FISCAL_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.LastFiscalYear=(0,n.createToken)({name:"LAST_FISCAL_YEAR",pattern:/LAST_FISCAL_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextFiscalYear=(0,n.createToken)({name:"NEXT_FISCAL_YEAR",pattern:/NEXT_FISCAL_YEAR/i,longer_alt:t.Identifier,categories:[t.DateLiteral,t.Identifier,t.DateLiteralNotIdentifier]}),t.NextNDays=(0,n.createToken)({name:"NEXT_N_DAYS",pattern:/NEXT_N_DAYS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNDays=(0,n.createToken)({name:"LAST_N_DAYS",pattern:/LAST_N_DAYS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NDaysAgo=(0,n.createToken)({name:"N_DAYS_AGO",pattern:/N_DAYS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNWeeks=(0,n.createToken)({name:"NEXT_N_WEEKS",pattern:/NEXT_N_WEEKS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNWeeks=(0,n.createToken)({name:"LAST_N_WEEKS",pattern:/LAST_N_WEEKS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NWeeksAgo=(0,n.createToken)({name:"N_WEEKS_AGO",pattern:/N_WEEKS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNMonths=(0,n.createToken)({name:"NEXT_N_MONTHS",pattern:/NEXT_N_MONTHS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNMonths=(0,n.createToken)({name:"LAST_N_MONTHS",pattern:/LAST_N_MONTHS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NMonthsAgo=(0,n.createToken)({name:"N_MONTHS_AGO",pattern:/N_MONTHS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNQuarters=(0,n.createToken)({name:"NEXT_N_QUARTERS",pattern:/NEXT_N_QUARTERS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNQuarters=(0,n.createToken)({name:"LAST_N_QUARTERS",pattern:/LAST_N_QUARTERS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NQuartersAgo=(0,n.createToken)({name:"N_QUARTERS_AGO",pattern:/N_QUARTERS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNYears=(0,n.createToken)({name:"NEXT_N_YEARS",pattern:/NEXT_N_YEARS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNYears=(0,n.createToken)({name:"LAST_N_YEARS",pattern:/LAST_N_YEARS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NYearsAgo=(0,n.createToken)({name:"N_YEARS_AGO",pattern:/N_YEARS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNFiscalQuarters=(0,n.createToken)({name:"NEXT_N_FISCAL_QUARTERS",pattern:/NEXT_N_FISCAL_QUARTERS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNFiscalQuarters=(0,n.createToken)({name:"LAST_N_FISCAL_QUARTERS",pattern:/LAST_N_FISCAL_QUARTERS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NFiscalQuartersAgo=(0,n.createToken)({name:"N_FISCAL_QUARTERS_AGO",pattern:/N_FISCAL_QUARTERS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NextNFiscalYears=(0,n.createToken)({name:"NEXT_N_FISCAL_YEARS",pattern:/NEXT_N_FISCAL_YEARS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.LastNFiscalYears=(0,n.createToken)({name:"LAST_N_FISCAL_YEARS",pattern:/LAST_N_FISCAL_YEARS/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.NFiscalYearsAgo=(0,n.createToken)({name:"N_FISCAL_YEARS_AGO",pattern:/N_FISCAL_YEARS_AGO/i,longer_alt:t.Identifier,categories:[t.DateNLiteral,t.Identifier]}),t.Equal=(0,n.createToken)({name:"EQUAL",pattern:"=",categories:[t.RelationalOperator]}),t.NotEqual=(0,n.createToken)({name:"NOT_EQUAL",pattern:/!=|<>/,categories:[t.RelationalOperator]}),t.LessThan=(0,n.createToken)({name:"LESS_THAN",pattern:"<",categories:[t.RelationalOperator]}),t.LessThanOrEqual=(0,n.createToken)({name:"LESS_THAN_OR_EQUAL",pattern:"<=",categories:[t.RelationalOperator]}),t.GreaterThan=(0,n.createToken)({name:"GREATER_THAN",pattern:">",categories:[t.RelationalOperator]}),t.GreaterThanOrEqual=(0,n.createToken)({name:"GREATER_THAN_OR_EQUAL",pattern:">=",categories:[t.RelationalOperator]}),t.Decimal=(0,n.createToken)({name:"DECIMAL",pattern:".",categories:[t.SymbolIdentifier]}),t.Colon=(0,n.createToken)({name:"COLON",pattern:":",categories:[t.SymbolIdentifier]}),t.Semicolon=(0,n.createToken)({name:"SEMICOLON",pattern:";",categories:[t.SymbolIdentifier]}),t.Comma=(0,n.createToken)({name:"COMMA",pattern:",",categories:[t.SymbolIdentifier]}),t.Asterisk=(0,n.createToken)({name:"ASTERISK",pattern:"*",categories:[t.SymbolIdentifier]}),t.LParen=(0,n.createToken)({name:"L_PAREN",pattern:"(",categories:[t.SymbolIdentifier]}),t.RParen=(0,n.createToken)({name:"R_PAREN",pattern:")",categories:[t.SymbolIdentifier]}),t.LSquareBracket=(0,n.createToken)({name:"L_SQUARE_BRACKET",pattern:"[",categories:[t.SymbolIdentifier]}),t.RSquareBracket=(0,n.createToken)({name:"R_SQUARE_BRACKET",pattern:"]",categories:[t.SymbolIdentifier]}),t.Plus=(0,n.createToken)({name:"PLUS",pattern:"+",categories:[t.SymbolIdentifier]}),t.Minus=(0,n.createToken)({name:"MINUS",pattern:"-",categories:[t.SymbolIdentifier]}),t.DateTime=(0,n.createToken)({name:"DATETIME",pattern:/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(\Z|\.[0-9]+Z|\+[0-9]{2}:[0-9]{2}|\-[0-9]{2}:[0-9]{2}|\+[0-9]{4}|\-[0-9]{4})/i,categories:[t.DateIdentifier]}),t.DateToken=(0,n.createToken)({name:"DATE",pattern:/[0-9]{4}-[0-9]{2}-[0-9]{2}/,categories:[t.DateIdentifier]}),t.CurrencyPrefixedDecimal=(0,n.createToken)({name:"CURRENCY_PREFIXED_DECIMAL",pattern:/[a-zA-Z]{3}[0-9]+\.\d+/,longer_alt:t.Identifier,categories:[t.DecimalNumberIdentifier]}),t.SignedDecimal=(0,n.createToken)({name:"SIGNED_DECIMAL",pattern:/(\-|\+)[0-9]*\.\d+/,categories:[t.NumberIdentifier,t.DecimalNumberIdentifier]}),t.UnsignedDecimal=(0,n.createToken)({name:"UNSIGNED_DECIMAL",pattern:/[0-9]*\.\d+/,categories:[t.NumberIdentifier,t.DecimalNumberIdentifier]}),t.CurrencyPrefixedInteger=(0,n.createToken)({name:"CURRENCY_PREFIXED_INTEGER",pattern:/[a-zA-Z]{3}-?[0-9]+/,longer_alt:t.Identifier,categories:[t.DecimalNumberIdentifier,t.Identifier]}),t.SignedInteger=(0,n.createToken)({name:"SIGNED_INTEGER",pattern:/(\-|\+)[0-9]+/,categories:[t.NumberIdentifier,t.IntegerNumberIdentifier]}),t.GeolocationUnit=(0,n.createToken)({name:"GEOLOCATION_UNIT",pattern:/'(mi|km)'/i,longer_alt:t.Identifier,categories:[t.Identifier]}),t.UnsignedInteger=(0,n.createToken)({name:"UNSIGNED_INTEGER",pattern:/0|[1-9]\d*/,categories:[t.NumberIdentifier,t.IntegerNumberIdentifier]}),t.Delegated=(0,n.createToken)({name:"Delegated",pattern:/DELEGATED/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["D","d"]}),t.Everything=(0,n.createToken)({name:"Everything",pattern:/EVERYTHING/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["E","e"]}),t.MineAndMyGroups=(0,n.createToken)({name:"MineAndMyGroups",pattern:/MINEANDMYGROUPS/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["M","m"]}),t.Mine=(0,n.createToken)({name:"Mine",pattern:/MINE/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["M","m"]}),t.MyTerritory=(0,n.createToken)({name:"MyTerritory",pattern:/MY_TERRITORY/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["M","m"]}),t.MyTeamTerritory=(0,n.createToken)({name:"MyTeamTerritory",pattern:/MY_TEAM_TERRITORY/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["M","m"]}),t.Team=(0,n.createToken)({name:"Team",pattern:/TEAM/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["T","t"]}),t.AllPrivate=(0,n.createToken)({name:"AllPrivate",pattern:/ALLPRIVATE/i,longer_alt:t.Identifier,categories:[t.UsingScopeEnumeration,t.Identifier],start_chars_hint:["A","a"]}),t.allTokens=[t.WhiteSpace,t.And,t.Asc,t.As,t.OrderBy,t.Cube,t.Desc,t.Else,t.Excludes,t.False,t.First,t.From,t.Grouping,t.GroupBy,t.Having,t.Includes,t.Like,t.Limit,t.Nulls,t.Null,t.Rollup,t.Select,t.True,t.Using,t.Where,t.With,t.Update,t.Delegated,t.Everything,t.MineAndMyGroups,t.Mine,t.MyTerritory,t.MyTeamTerritory,t.Team,t.AllPrivate,t.AboveOrBelow,t.Above,t.ApexNew,t.At,t.Below,t.DataCategory,t.End,t.Offset,t.Reference,t.Scope,t.Tracking,t.Then,t.Typeof,t.Viewstat,t.View,t.When,t.SecurityEnforced,t.SystemMode,t.UserMode,t.CalendarMonth,t.CalendarQuarter,t.CalendarYear,t.DayInMonth,t.DayInWeek,t.DayInYear,t.DayOnly,t.FiscalMonth,t.FiscalQuarter,t.FiscalYear,t.HourInDay,t.WeekInMonth,t.WeekInYear,t.Avg,t.CountDistinct,t.Count,t.Min,t.Max,t.Sum,t.Distance,t.Geolocation,t.Fields,t.Format,t.Tolabel,t.ConvertTimeZone,t.ConvertCurrency,t.Yesterday,t.Today,t.Tomorrow,t.LastWeek,t.ThisWeek,t.NextWeek,t.LastMonth,t.ThisMonth,t.NextMonth,t.Last90_days,t.Next90_days,t.ThisQuarter,t.LastQuarter,t.NextQuarter,t.ThisYear,t.LastYear,t.NextYear,t.ThisFiscalQuarter,t.LastFiscalQuarter,t.NextFiscalQuarter,t.ThisFiscalYear,t.LastFiscalYear,t.NextFiscalYear,t.NextNDays,t.LastNDays,t.NDaysAgo,t.NextNWeeks,t.LastNWeeks,t.NWeeksAgo,t.NextNMonths,t.LastNMonths,t.NMonthsAgo,t.NextNQuarters,t.LastNQuarters,t.NQuartersAgo,t.NextNYears,t.LastNYears,t.NYearsAgo,t.NextNFiscalQuarters,t.LastNFiscalQuarters,t.NFiscalQuartersAgo,t.NextNFiscalYears,t.LastNFiscalYears,t.NFiscalYearsAgo,t.GeolocationUnit,t.All,t.Custom,t.Standard,t.In,t.For,t.Or,t.Last,t.Not,t.CurrencyPrefixedDecimal,t.CurrencyPrefixedInteger,t.StringIdentifier,t.Identifier,t.DateTime,t.DateToken,t.SignedDecimal,t.UnsignedDecimal,t.UnsignedInteger,t.SignedInteger,t.Equal,t.NotEqual,t.LessThanOrEqual,t.LessThan,t.GreaterThanOrEqual,t.GreaterThan,t.Decimal,t.Colon,t.Semicolon,t.Comma,t.Asterisk,t.LParen,t.RParen,t.LSquareBracket,t.RSquareBracket,t.Plus,t.Minus];var o=new n.Lexer(t.allTokens,{ensureOptimizations:!0,skipValidations:!0});t.lex=function(e){return o.tokenize(e)}},3438:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SoqlParser=void 0;var o=r(6210),a=r(1963),s=function(e){function t(t){var r=e.call(this,"".concat(t.message," (").concat(t.line,":").concat(t.column,")"))||this;return r.name="LexingError",r}return i(t,e),t}(Error),u=function(e){function t(t){var r=e.call(this,t.message)||this;return r.name=t.name,r}return i(t,e),t}(Error),c=function(e){function t(t){var r=(void 0===t?{ignoreParseErrors:!1}:t).ignoreParseErrors,n=e.call(this,a.allTokens,{skipValidations:!0,recoveryEnabled:!!r})||this;return n.$_dateFunctionOr=void 0,n.$_aggregateFunction=void 0,n.$_otherFunction=void 0,n.$_atomicExpression=void 0,n.$_apexBindVariableExpression=void 0,n.$_arrayExpression=void 0,n.$_relationalOperator=void 0,n.$_selectClause=void 0,n.$_selectClauseFunctionIdentifier=void 0,n.$_withDataCategoryArr=void 0,n.allowApexBindVariables=!1,n.ignoreParseErrors=!1,n.selectStatement=n.RULE("selectStatement",(function(){n.SUBRULE(n.selectClause),n.SUBRULE(n.fromClause),n.SUBRULE(n.clauseStatements)})),n.selectStatementPartial=n.RULE("selectStatementPartial",(function(){n.OPTION((function(){n.SUBRULE(n.selectClause)})),n.OPTION1((function(){n.SUBRULE(n.fromClause)})),n.SUBRULE(n.clauseStatements)})),n.clauseStatements=n.RULE("clauseStatements",(function(){n.OPTION((function(){n.SUBRULE(n.usingScopeClause)})),n.OPTION1((function(){n.SUBRULE(n.whereClause)})),n.OPTION2((function(){n.MANY({DEF:function(){n.SUBRULE(n.withClause)}})})),n.OPTION3((function(){n.SUBRULE(n.groupByClause),n.OPTION4((function(){n.SUBRULE(n.havingClause)}))})),n.OPTION5((function(){n.SUBRULE(n.orderByClause)})),n.OPTION6((function(){n.SUBRULE(n.limitClause)})),n.OPTION7((function(){n.SUBRULE(n.offsetClause)})),n.OPTION8((function(){n.SUBRULE(n.forViewOrReference)})),n.OPTION9((function(){n.SUBRULE(n.updateTrackingViewstat)}))})),n.selectClause=n.RULE("selectClause",(function(){n.CONSUME(a.Select),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.OR(n.$_selectClause||(n.$_selectClause=[{ALT:function(){return n.SUBRULE(n.selectClauseFunctionIdentifier,{LABEL:"field"})}},{ALT:function(){return n.SUBRULE(n.selectClauseSubqueryIdentifier,{LABEL:"field"})}},{ALT:function(){return n.SUBRULE(n.selectClauseTypeOf,{LABEL:"field"})}},{ALT:function(){return n.SUBRULE(n.selectClauseIdentifier,{LABEL:"field"})}}]))}})}),{resyncEnabled:!1}),n.selectClauseFunctionIdentifier=n.RULE("selectClauseFunctionIdentifier",(function(){n.OR(n.$_selectClauseFunctionIdentifier||(n.$_selectClauseFunctionIdentifier=[{ALT:function(){return n.SUBRULE(n.dateFunction,{LABEL:"fn"})}},{ALT:function(){return n.SUBRULE(n.aggregateFunction,{LABEL:"fn"})}},{ALT:function(){return n.SUBRULE(n.locationFunction,{LABEL:"fn"})}},{ALT:function(){return n.SUBRULE(n.fieldsFunction,{LABEL:"fn"})}},{ALT:function(){return n.SUBRULE(n.otherFunction,{LABEL:"fn"})}}])),n.OPTION((function(){return n.CONSUME(a.Identifier,{LABEL:"alias"})}))}),{resyncEnabled:!1}),n.selectClauseSubqueryIdentifier=n.RULE("selectClauseSubqueryIdentifier",(function(){n.CONSUME(a.LParen),n.SUBRULE(n.selectStatement),n.CONSUME(a.RParen)}),{resyncEnabled:!1}),n.selectClauseTypeOf=n.RULE("selectClauseTypeOf",(function(){n.CONSUME(a.Typeof),n.CONSUME(a.Identifier,{LABEL:"typeOfField"}),n.AT_LEAST_ONE({DEF:function(){n.SUBRULE(n.selectClauseTypeOfThen)}}),n.OPTION((function(){n.SUBRULE(n.selectClauseTypeOfElse)})),n.CONSUME(a.End)}),{resyncEnabled:!1}),n.selectClauseIdentifier=n.RULE("selectClauseIdentifier",(function(){n.CONSUME(a.Identifier,{LABEL:"field"}),n.OPTION((function(){return n.CONSUME1(a.Identifier,{LABEL:"alias"})}))}),{resyncEnabled:!1}),n.selectClauseTypeOfThen=n.RULE("selectClauseTypeOfThen",(function(){n.CONSUME(a.When),n.CONSUME(a.Identifier,{LABEL:"typeOfField"}),n.CONSUME(a.Then),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.CONSUME1(a.Identifier,{LABEL:"field"})}})}),{resyncEnabled:!1}),n.selectClauseTypeOfElse=n.RULE("selectClauseTypeOfElse",(function(){n.CONSUME(a.Else),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.CONSUME(a.Identifier,{LABEL:"field"})}})}),{resyncEnabled:!1}),n.fromClause=n.RULE("fromClause",(function(){n.CONSUME(a.From),n.CONSUME(a.Identifier),n.OPTION({GATE:function(){return!(n.LA(1).tokenType===a.Offset&&n.LA(2).tokenType===a.UnsignedInteger)},DEF:function(){return n.CONSUME1(a.Identifier,{LABEL:"alias"})}})}),{resyncEnabled:!1}),n.usingScopeClause=n.RULE("usingScopeClause",(function(){n.CONSUME(a.Using),n.CONSUME(a.Scope),n.CONSUME(a.UsingScopeEnumeration)})),n.whereClause=n.RULE("whereClause",(function(){n.CONSUME(a.Where);var e=n.getParenCount();n.AT_LEAST_ONE({DEF:function(){n.SUBRULE(n.conditionExpression,{ARGS:[e,!0,!0]})}}),n.$_checkBalancedParens(e)})),n.whereClauseSubqueryIdentifier=n.RULE("whereClauseSubqueryIdentifier",(function(){n.CONSUME(a.LParen),n.SUBRULE(n.selectStatement),n.CONSUME(a.RParen)})),n.conditionExpression=n.RULE("conditionExpression",(function(e,t,r){e=n.getParenCount(e),n.OPTION((function(){n.OR([{ALT:function(){return n.CONSUME(a.And,{LABEL:"logicalOperator"})}},{ALT:function(){return n.CONSUME(a.Or,{LABEL:"logicalOperator"})}}])})),n.MANY({MAX_LOOKAHEAD:10,DEF:function(){return n.SUBRULE(n.expressionPartWithNegation,{ARGS:[e],LABEL:"expressionNegation"})}}),n.OR1({MAX_LOOKAHEAD:10,DEF:[{ALT:function(){return n.SUBRULE(n.expression,{ARGS:[e,!1,t,r]})}}]})})),n.withClause=n.RULE("withClause",(function(){n.CONSUME(a.With),n.OR([{ALT:function(){return n.CONSUME(a.SecurityEnforced,{LABEL:"withSecurityEnforced"})}},{ALT:function(){return n.CONSUME(a.UserMode,{LABEL:"withAccessLevel"})}},{ALT:function(){return n.CONSUME(a.SystemMode,{LABEL:"withAccessLevel"})}},{ALT:function(){return n.SUBRULE(n.withDataCategory)}}])})),n.withDataCategory=n.RULE("withDataCategory",(function(){n.CONSUME(a.DataCategory),n.AT_LEAST_ONE_SEP({SEP:a.And,DEF:function(){n.SUBRULE(n.withDataCategoryArr)}})})),n.withDataCategoryArr=n.RULE("withDataCategoryArr",(function(){n.CONSUME(a.Identifier,{LABEL:"dataCategoryGroupName"}),n.OR(n.$_withDataCategoryArr||(n.$_withDataCategoryArr=[{ALT:function(){return n.CONSUME(a.At,{LABEL:"filteringSelector"})}},{ALT:function(){return n.CONSUME(a.Above,{LABEL:"filteringSelector"})}},{ALT:function(){return n.CONSUME(a.Below,{LABEL:"filteringSelector"})}},{ALT:function(){return n.CONSUME(a.AboveOrBelow,{LABEL:"filteringSelector"})}}])),n.OPTION((function(){n.CONSUME1(a.LParen)})),n.AT_LEAST_ONE_SEP1({SEP:a.Comma,DEF:function(){n.CONSUME1(a.Identifier,{LABEL:"dataCategoryName"})}}),n.OPTION1((function(){n.CONSUME2(a.RParen)}))})),n.groupByClause=n.RULE("groupByClause",(function(){n.CONSUME(a.GroupBy),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.OR([{ALT:function(){return n.SUBRULE(n.cubeFunction,{LABEL:"groupBy"})}},{ALT:function(){return n.SUBRULE(n.rollupFunction,{LABEL:"groupBy"})}},{ALT:function(){return n.SUBRULE(n.dateFunction,{LABEL:"groupBy"})}},{ALT:function(){return n.CONSUME(a.Identifier,{LABEL:"groupBy"})}}])}})})),n.havingClause=n.RULE("havingClause",(function(){n.CONSUME(a.Having);var e=n.getParenCount();n.AT_LEAST_ONE({DEF:function(){n.SUBRULE(n.conditionExpression,{ARGS:[e,!0,!1]})}}),n.$_checkBalancedParens(e)})),n.orderByClause=n.RULE("orderByClause",(function(){n.CONSUME(a.OrderBy),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.OR([{ALT:function(){return n.SUBRULE(n.orderByGroupingFunctionExpression,{LABEL:"orderByExpressionOrFn"})}},{ALT:function(){return n.SUBRULE(n.orderBySpecialFunctionExpression,{LABEL:"orderByExpressionOrFn"})}},{ALT:function(){return n.SUBRULE(n.orderByExpression,{LABEL:"orderByExpressionOrFn"})}}])}})})),n.orderByExpression=n.RULE("orderByExpression",(function(){n.CONSUME(a.Identifier),n.OPTION((function(){n.OR([{ALT:function(){return n.CONSUME(a.Asc,{LABEL:"order"})}},{ALT:function(){return n.CONSUME(a.Desc,{LABEL:"order"})}}])})),n.OPTION1((function(){n.CONSUME(a.Nulls),n.OR1([{ALT:function(){return n.CONSUME(a.First,{LABEL:"nulls"})}},{ALT:function(){return n.CONSUME(a.Last,{LABEL:"nulls"})}}])}))})),n.orderByGroupingFunctionExpression=n.RULE("orderByGroupingFunctionExpression",(function(){n.CONSUME(a.Grouping,{LABEL:"fn"}),n.SUBRULE(n.functionExpression)})),n.orderBySpecialFunctionExpression=n.RULE("orderBySpecialFunctionExpression",(function(){n.OR([{ALT:function(){return n.SUBRULE(n.aggregateFunction)}},{ALT:function(){return n.SUBRULE(n.dateFunction)}},{ALT:function(){return n.SUBRULE(n.locationFunction)}}]),n.OPTION((function(){n.OR1([{ALT:function(){return n.CONSUME(a.Asc,{LABEL:"order"})}},{ALT:function(){return n.CONSUME(a.Desc,{LABEL:"order"})}}])})),n.OPTION1((function(){n.CONSUME(a.Nulls),n.OR2([{ALT:function(){return n.CONSUME(a.First,{LABEL:"nulls"})}},{ALT:function(){return n.CONSUME(a.Last,{LABEL:"nulls"})}}])}))})),n.limitClause=n.RULE("limitClause",(function(){n.CONSUME(a.Limit),n.CONSUME(a.UnsignedInteger,{LABEL:"value"})})),n.offsetClause=n.RULE("offsetClause",(function(){n.CONSUME(a.Offset),n.CONSUME(a.UnsignedInteger,{LABEL:"value"})})),n.dateFunction=n.RULE("dateFunction",(function(){n.OR(n.$_dateFunctionOr||(n.$_dateFunctionOr=[{ALT:function(){return n.CONSUME(a.CalendarMonth,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.CalendarQuarter,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.CalendarYear,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.DayInMonth,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.DayInWeek,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.DayInYear,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.DayOnly,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.FiscalMonth,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.FiscalQuarter,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.FiscalYear,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.HourInDay,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.WeekInMonth,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.WeekInYear,{LABEL:"fn"})}}])),n.SUBRULE(n.functionExpression)})),n.aggregateFunction=n.RULE("aggregateFunction",(function(){n.OR(n.$_aggregateFunction||(n.$_aggregateFunction=[{ALT:function(){return n.CONSUME(a.Avg,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Count,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.CountDistinct,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Min,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Max,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Sum,{LABEL:"fn"})}}])),n.SUBRULE(n.functionExpression,{ARGS:[!0]})})),n.fieldsFunction=n.RULE("fieldsFunction",(function(){n.CONSUME(a.Fields,{LABEL:"fn"}),n.CONSUME(a.LParen),n.CONSUME(a.FieldsFunctionParamIdentifier,{LABEL:"params"}),n.CONSUME(a.RParen)})),n.otherFunction=n.RULE("otherFunction",(function(){n.OR(n.$_otherFunction||(n.$_otherFunction=[{ALT:function(){return n.CONSUME(a.Format,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Tolabel,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.ConvertTimeZone,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.ConvertCurrency,{LABEL:"fn"})}},{ALT:function(){return n.CONSUME(a.Grouping,{LABEL:"fn"})}}])),n.SUBRULE(n.functionExpression)})),n.cubeFunction=n.RULE("cubeFunction",(function(){n.CONSUME(a.Cube,{LABEL:"fn"}),n.SUBRULE(n.functionExpression)})),n.rollupFunction=n.RULE("rollupFunction",(function(){n.CONSUME(a.Rollup,{LABEL:"fn"}),n.SUBRULE(n.functionExpression)})),n.functionExpression=n.RULE("functionExpression",(function(e){n.CONSUME(a.LParen),n.MANY_SEP({SEP:a.Comma,DEF:function(){n.OR([{GATE:function(){return!e},ALT:function(){return n.SUBRULE(n.aggregateFunction,{LABEL:"params"})}},{ALT:function(){return n.SUBRULE(n.otherFunction,{LABEL:"params"})}},{ALT:function(){return n.CONSUME(a.StringIdentifier,{LABEL:"params"})}},{ALT:function(){return n.CONSUME(a.NumberIdentifier,{LABEL:"params"})}},{ALT:function(){return n.CONSUME(a.Identifier,{LABEL:"params"})}}])}}),n.CONSUME(a.RParen)})),n.locationFunction=n.RULE("locationFunction",(function(){n.CONSUME(a.Distance),n.CONSUME(a.LParen),n.CONSUME(a.Identifier,{LABEL:"location1"}),n.CONSUME(a.Comma),n.OR([{ALT:function(){return n.SUBRULE(n.geolocationFunction,{LABEL:"location2"})}},{ALT:function(){return n.CONSUME1(a.Identifier,{LABEL:"location2"})}}]),n.CONSUME1(a.Comma),n.CONSUME(a.GeolocationUnit,{LABEL:"unit"}),n.CONSUME(a.RParen)})),n.geolocationFunction=n.RULE("geolocationFunction",(function(){n.CONSUME(a.Geolocation),n.CONSUME(a.LParen),n.CONSUME(a.NumberIdentifier,{LABEL:"latitude"}),n.CONSUME(a.Comma),n.CONSUME1(a.NumberIdentifier,{LABEL:"longitude"}),n.CONSUME(a.RParen)})),n.expressionPartWithNegation=n.RULE("expressionPartWithNegation",(function(e){var t=0;n.MANY((function(){n.CONSUME(a.LParen),t++})),n.CONSUME(a.Not,{LABEL:"expressionNegation"}),e&&t&&(e.left+=t)})),n.expression=n.RULE("expression",(function(e,t,r,i){n.OPTION1((function(){n.MANY1((function(){n.CONSUME(a.LParen),e&&e.left++}))})),n.OR1([{GATE:function(){return!!r},ALT:function(){return n.SUBRULE(n.aggregateFunction,{LABEL:"lhs"})}},{GATE:function(){return!!i},ALT:function(){return n.SUBRULE(n.locationFunction,{LABEL:"lhs"})}},{ALT:function(){return n.SUBRULE(n.dateFunction,{LABEL:"lhs"})}},{ALT:function(){return n.SUBRULE(n.otherFunction,{LABEL:"lhs"})}},{ALT:function(){return n.CONSUME(a.Identifier,{LABEL:"lhs"})}}]),n.OR2([{ALT:function(){return n.SUBRULE(n.expressionWithRelationalOperator,{LABEL:"operator"})}},{ALT:function(){return n.SUBRULE(n.expressionWithSetOperator,{LABEL:"operator",ARGS:[t]})}}]),n.OPTION3((function(){n.MANY2({GATE:function(){return!e||e.left>e.right},DEF:function(){n.CONSUME(a.RParen),e&&e.right++}})}))})),n.expressionWithRelationalOperator=n.RULE("expressionWithRelationalOperator",(function(){n.SUBRULE(n.relationalOperator),n.SUBRULE(n.atomicExpression,{LABEL:"rhs"})})),n.expressionWithSetOperator=n.RULE("expressionWithSetOperator",(function(e){n.SUBRULE(n.setOperator),n.SUBRULE2(n.atomicExpression,{LABEL:"rhs",ARGS:[!0,e]})})),n.atomicExpression=n.RULE("atomicExpression",(function(e,t){n.OR(n.$_atomicExpression||(n.$_atomicExpression=[{GATE:function(){return n.allowApexBindVariables},ALT:function(){return n.SUBRULE(n.apexBindVariableExpression)}},{GATE:function(){return e},ALT:function(){return n.SUBRULE(n.arrayExpression)}},{GATE:function(){return e&&t},ALT:function(){return n.SUBRULE(n.whereClauseSubqueryIdentifier)}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.DateIdentifier)}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.CurrencyPrefixedDecimal,{LABEL:"CurrencyPrefixedDecimal"})}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.CurrencyPrefixedInteger,{LABEL:"CurrencyPrefixedInteger"})}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.NumberIdentifier)}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.Null)}},{GATE:function(){return!e},ALT:function(){return n.SUBRULE(n.booleanValue)}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.DateLiteral)}},{GATE:function(){return!e},ALT:function(){return n.SUBRULE(n.dateNLiteral)}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.GeolocationUnit,{LABEL:"StringIdentifier"})}},{GATE:function(){return!e},ALT:function(){return n.CONSUME(a.StringIdentifier)}}]))})),n.apexBindVariableExpression=n.RULE("apexBindVariableExpression",(function(){n.CONSUME(a.Colon),n.OPTION((function(){n.SUBRULE(n.apexBindVariableNewInstantiation,{LABEL:"apex"}),n.OPTION1((function(){n.CONSUME(a.Decimal)}))})),n.MANY_SEP({SEP:a.Decimal,DEF:function(){n.OR(n.$_apexBindVariableExpression||(n.$_apexBindVariableExpression=[{ALT:function(){return n.SUBRULE(n.apexBindVariableFunctionCall,{LABEL:"apex"})}},{ALT:function(){return n.SUBRULE(n.apexBindVariableIdentifier,{LABEL:"apex"})}}]))}})})),n.apexBindVariableIdentifier=n.RULE("apexBindVariableIdentifier",(function(){n.CONSUME(a.Identifier),n.OPTION((function(){return n.SUBRULE(n.apexBindVariableFunctionArrayAccessor)}))})),n.apexBindVariableNewInstantiation=n.RULE("apexBindVariableNewInstantiation",(function(){n.CONSUME(a.ApexNew,{LABEL:"new"}),n.CONSUME(a.Identifier,{LABEL:"function"}),n.OPTION((function(){n.SUBRULE(n.apexBindVariableGeneric)})),n.SUBRULE(n.apexBindVariableFunctionParams),n.OPTION1((function(){return n.SUBRULE(n.apexBindVariableFunctionArrayAccessor)}))})),n.apexBindVariableFunctionCall=n.RULE("apexBindVariableFunctionCall",(function(){n.CONSUME(a.Identifier,{LABEL:"function"}),n.SUBRULE(n.apexBindVariableFunctionParams),n.OPTION((function(){return n.SUBRULE(n.apexBindVariableFunctionArrayAccessor)}))})),n.apexBindVariableGeneric=n.RULE("apexBindVariableGeneric",(function(){n.CONSUME(a.LessThan),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.CONSUME(a.Identifier,{LABEL:"parameter"})}}),n.CONSUME(a.GreaterThan)})),n.apexBindVariableFunctionParams=n.RULE("apexBindVariableFunctionParams",(function(){n.CONSUME(a.LParen),n.MANY_SEP({SEP:a.Comma,DEF:function(){n.CONSUME(a.Identifier,{LABEL:"parameter"})}}),n.CONSUME(a.RParen)})),n.apexBindVariableFunctionArrayAccessor=n.RULE("apexBindVariableFunctionArrayAccessor",(function(){n.CONSUME(a.LSquareBracket),n.OR([{ALT:function(){return n.CONSUME(a.UnsignedInteger,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.Identifier,{LABEL:"value"})}}]),n.CONSUME(a.RSquareBracket)})),n.arrayExpression=n.RULE("arrayExpression",(function(){n.CONSUME(a.LParen),n.AT_LEAST_ONE_SEP({SEP:a.Comma,DEF:function(){n.OR(n.$_arrayExpression||(n.$_arrayExpression=[{ALT:function(){return n.CONSUME(a.CurrencyPrefixedDecimal,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.CurrencyPrefixedInteger,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.NumberIdentifier,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.DateIdentifier,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.Null,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.True,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.False,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.DateLiteral,{LABEL:"value"})}},{ALT:function(){return n.SUBRULE(n.dateNLiteral,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.GeolocationUnit,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.StringIdentifier,{LABEL:"value"})}}]))}}),n.CONSUME(a.RParen)})),n.relationalOperator=n.RULE("relationalOperator",(function(){n.OR(n.$_relationalOperator||(n.$_relationalOperator=[{ALT:function(){return n.CONSUME(a.Equal,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.NotEqual,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.GreaterThan,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.GreaterThanOrEqual,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.LessThan,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.LessThanOrEqual,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.Like,{LABEL:"operator"})}}]))})),n.setOperator=n.RULE("setOperator",(function(){n.OR([{ALT:function(){return n.CONSUME(a.In,{LABEL:"operator"})}},{ALT:function(){return n.SUBRULE(n.notInOperator,{LABEL:"notIn"})}},{ALT:function(){return n.CONSUME(a.Includes,{LABEL:"operator"})}},{ALT:function(){return n.CONSUME(a.Excludes,{LABEL:"operator"})}}])})),n.notInOperator=n.RULE("notInOperator",(function(){n.CONSUME(a.Not,{LABEL:"operator"}),n.CONSUME(a.In,{LABEL:"operator"})})),n.booleanValue=n.RULE("booleanValue",(function(){n.OR([{ALT:function(){return n.CONSUME(a.True,{LABEL:"boolean"})}},{ALT:function(){return n.CONSUME(a.False,{LABEL:"boolean"})}}])})),n.dateNLiteral=n.RULE("dateNLiteral",(function(){n.CONSUME(a.DateNLiteral,{LABEL:"dateNLiteral"}),n.CONSUME(a.Colon),n.OR1([{ALT:function(){return n.CONSUME(a.UnsignedInteger,{LABEL:"variable"})}},{ALT:function(){return n.CONSUME(a.SignedInteger,{LABEL:"variable"})}}])})),n.forViewOrReference=n.RULE("forViewOrReference",(function(){n.CONSUME(a.For),n.OR([{ALT:function(){return n.CONSUME(a.View,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.Reference,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.Update,{LABEL:"value"})}}])})),n.updateTrackingViewstat=n.RULE("updateTrackingViewstat",(function(){n.CONSUME(a.Update),n.OR([{ALT:function(){return n.CONSUME(a.Tracking,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(a.Viewstat,{LABEL:"value"})}}])})),n.ignoreParseErrors=!!r,n.performSelfAnalysis(),n}return i(t,e),t.prototype.$_checkBalancedParens=function(e){!this.RECORDING_PHASE&&e&&0!=e.left-e.right&&this.CONSUME(a.RParenMismatch,{ERR_MSG:"Expecting a token type of --\x3e RParen <-- but found --\x3e '' <--"})},t.prototype.getParenCount=function(e){return e||{right:0,left:0}},t}(o.CstParser);t.SoqlParser=c;var l=new c;t.parse=function(e,t){var r,n=t||{allowApexBindVariables:!1,logErrors:!1,ignoreParseErrors:!1},i=n.allowApexBindVariables,o=n.logErrors,f=n.ignoreParseErrors,p=n.allowPartialQuery,d=a.lex(e);if(d.errors.length>0)throw o&&(console.log("Lexing Errors:"),console.log(d.errors)),new s(d.errors[0]);if(l.ignoreParseErrors!==f&&(l=new c({ignoreParseErrors:f})),l.input=d.tokens,l.allowApexBindVariables=i||!1,r=p?l.selectStatementPartial():l.selectStatement(),l.errors.length>0&&(o&&(console.log("Parsing Errors:"),console.log(l.errors)),!f))throw new u(l.errors[0]);return{cst:r,parseErrors:l.errors.map((function(e){return new u(e)}))}}},4159:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.isQueryValid=t.parseQuery=void 0;var a=r(168),s=r(3438),u=(new s.SoqlParser).getBaseCstVisitorConstructor(),c=["TRUE","FALSE"],l=["YESTERDAY","TODAY","TOMORROW","LAST_WEEK","THIS_WEEK","NEXT_WEEK","LAST_MONTH","THIS_MONTH","NEXT_MONTH","LAST_90_DAYS","NEXT_90_DAYS","THIS_QUARTER","LAST_QUARTER","NEXT_QUARTER","THIS_YEAR","LAST_YEAR","NEXT_YEAR","THIS_FISCAL_QUARTER","LAST_FISCAL_QUARTER","NEXT_FISCAL_QUARTER","THIS_FISCAL_YEAR","LAST_FISCAL_YEAR","NEXT_FISCAL_YEAR"],f=["NEXT_N_DAYS","LAST_N_DAYS","N_DAYS_AGO","NEXT_N_WEEKS","LAST_N_WEEKS","N_WEEKS_AGO","NEXT_N_MONTHS","LAST_N_MONTHS","N_MONTHS_AGO","NEXT_N_QUARTERS","LAST_N_QUARTERS","N_QUARTERS_AGO","NEXT_N_YEARS","LAST_N_YEARS","N_YEARS_AGO","NEXT_N_FISCAL_QUARTERS","LAST_N_FISCAL_QUARTERS","N_FISCAL_QUARTERS_AGO","NEXT_N_FISCAL_YEARS","LAST_N_FISCAL_YEARS","N_FISCAL_YEARS_AGO"],p=new(function(e){function t(){var t=e.call(this)||this;return t.helpers={$_getFieldFunction:function(e,r,n){void 0===r&&(r=!1),void 0===n&&(n=!0);var i=e.functionExpression?e.functionExpression.map((function(e){return t.visit(e,{includeType:n})})).flat():[],o={};return n&&(o.type="FieldFunctionExpression"),o.functionName=e.fn[0].tokenType.name,o.parameters=i,n&&r&&(o.isAggregateFn=r),o.rawValue="".concat(e.fn[0].image,"(").concat(i.map((function(e){return"string"==typeof e?e:e.rawValue})).join(", "),")"),o},$_getLiteralTypeFromTokenType:function(e){return"REAL_NUMBER"===e?"DECIMAL":"CURRENCY_PREFIXED_DECIMAL"===e?"DECIMAL_WITH_CURRENCY_PREFIX":"CURRENCY_PREFIXED_INTEGER"===e?"INTEGER_WITH_CURRENCY_PREFIX":"SIGNED_DECIMAL"===e||"UNSIGNED_DECIMAL"===e?"DECIMAL":"UNSIGNED_INTEGER"===e||"SIGNED_INTEGER"===e?"INTEGER":"DATETIME"===e?"DATETIME":"DATE"===e?"DATE":"NULL"===e?"NULL":"StringIdentifier"===e||"Identifier"===e?"STRING":c.includes(e)?"BOOLEAN":l.includes(e)?"DATE_LITERAL":f.includes(e)?"DATE_N_LITERAL":"STRING"},$_parseSelect:function(e,t){var r=(t||{isSubquery:!1}).isSubquery,n={};if(e.selectClause&&(n.fields=this.visit(e.selectClause)),e.fromClause)if((0,a.isSubqueryFromFlag)(n,r)){var i=this.visit(e.fromClause),s=i.sObject,u=i.alias,c=i.sObjectPrefix;n.relationshipName=s,u&&(n.sObjectAlias=u),c&&(n.sObjectPrefix=c)}else{var l=this.visit(e.fromClause);s=l.sObject,u=l.alias,n.sObject=s,u&&(n.sObjectAlias=u)}return Array.isArray(n.fields)&&n.sObjectAlias&&n.fields.forEach((function(e){e.relationships&&e.relationships[0]===n.sObjectAlias&&(e.relationships=e.relationships.slice(1),e.objectPrefix=n.sObjectAlias),e.relationships&&0===e.relationships.length&&(delete e.relationships,e.type="Field")})),n=o(o({},n),this.visit(e.clauseStatements))}},t.validateVisitor(),t}return i(t,e),t.prototype.selectStatement=function(e,t){return this.helpers.$_parseSelect.bind(this)(e,t)},t.prototype.selectStatementPartial=function(e,t){return this.helpers.$_parseSelect.bind(this)(e,t)},t.prototype.clauseStatements=function(e){var t=this,r={};return e.usingScopeClause&&!e.usingScopeClause[0].recoveredNode&&(r.usingScope=this.visit(e.usingScopeClause)),e.whereClause&&!e.whereClause[0].recoveredNode&&(r.where=this.visit(e.whereClause)),e.withClause&&e.withClause.filter((function(e){return!e.recoveredNode})).forEach((function(e){var n=t.visit(e),i=n.withSecurityEnforced,o=n.withAccessLevel,a=n.withDataCategory;i&&(r.withSecurityEnforced=i),o&&(r.withAccessLevel=o),a&&(r.withDataCategory=a)})),e.groupByClause&&!e.groupByClause[0].recoveredNode&&(r.groupBy=this.visit(e.groupByClause)),e.havingClause&&!e.havingClause[0].recoveredNode&&(r.having=this.visit(e.havingClause)),e.orderByClause&&!e.orderByClause[0].recoveredNode&&(r.orderBy=this.visit(e.orderByClause)),e.limitClause&&!e.limitClause[0].recoveredNode&&(r.limit=Number(this.visit(e.limitClause))),e.offsetClause&&!e.offsetClause[0].recoveredNode&&(r.offset=Number(this.visit(e.offsetClause))),e.forViewOrReference&&!e.forViewOrReference[0].recoveredNode&&(r.for=this.visit(e.forViewOrReference)),e.updateTrackingViewstat&&!e.updateTrackingViewstat[0].recoveredNode&&(r.update=this.visit(e.updateTrackingViewstat)),r},t.prototype.selectClause=function(e){var t=this;return e.field?e.field.map((function(e){if((0,a.isToken)(e)){var r=e.image,n=void 0;if(r.includes(".")){var i=r.split(".");n={type:"FieldRelationship",field:i[i.length-1],relationships:i.slice(0,i.length-1),rawValue:r}}else n={type:"Field",field:r};return n}return t.visit(e)})):[]},t.prototype.selectClauseFunctionIdentifier=function(e){var t=o({},this.visit(e.fn));return e.alias&&(t.alias=e.alias[0].image),t},t.prototype.selectClauseSubqueryIdentifier=function(e){return{type:"FieldSubquery",subquery:this.visit(e.selectStatement,{isSubquery:!0})}},t.prototype.selectClauseTypeOf=function(e){var t=this,r=e.selectClauseTypeOfThen.map((function(e){return t.visit(e)}));return e.selectClauseTypeOfElse&&r.push(this.visit(e.selectClauseTypeOfElse)),{type:"FieldTypeof",field:e.typeOfField[0].image,conditions:r}},t.prototype.selectClauseIdentifier=function(e){var t,r=e.field[0],n=e.alias?e.alias[0].image:void 0,i=r.image;if(i.includes(".")){var o=i.split(".");t={type:"FieldRelationship",field:o[o.length-1],relationships:o.slice(0,o.length-1),rawValue:i}}else t={type:"Field",field:i};return n&&(t.alias=n),t},t.prototype.selectClauseTypeOfThen=function(e){return{type:"WHEN",objectType:e.typeOfField[0].image,fieldList:e.field.map((function(e){return e.image}))}},t.prototype.selectClauseTypeOfElse=function(e){return{type:"ELSE",fieldList:e.field.map((function(e){return e.image}))}},t.prototype.fromClause=function(e){var t,r=e.Identifier[0].image;if(r.includes(".")){var n=r.split(".");t={sObjectPrefix:n.slice(0,n.length-1),sObject:n[n.length-1]}}else t={sObject:r};return e.alias&&e.alias[0]&&(t.alias=e.alias[0].image),t},t.prototype.usingScopeClause=function(e){return e.UsingScopeEnumeration[0].image},t.prototype.whereClauseSubqueryIdentifier=function(e){return this.visit(e.selectStatement,{isSubquery:!1})},t.prototype.whereClause=function(e){var t=this;return e.conditionExpression.reduce((function(e,r){var n;e.expressionTree?(n=t.visit(r,{prevExpression:e.prevExpression}),e.prevExpression.right=n):(n=t.visit(r),e.expressionTree=n),n.right;for(var i=n.right;(0,a.isWhereClauseWithRightCondition)(i);)i=i.right;return e.prevExpression=i||n,e}),{prevExpression:void 0,expressionTree:void 0}).expressionTree},t.prototype.conditionExpression=function(e,t){var r=this;(t=t||{}).prevExpression&&e.logicalOperator&&(t.prevExpression.operator=e.logicalOperator[0].tokenType.name);var n={},i=n;if(Array.isArray(e.expressionNegation))if(1===e.expressionNegation.length)n=this.visit(e.expressionNegation),i=n.right;else{var o=n=this.visit(e.expressionNegation[0]);e.expressionNegation.slice(1).forEach((function(e){o.right=r.visit(e),i=o.right.right}))}return i.left=this.visit(e.expression),n},t.prototype.withClause=function(e){return e.withSecurityEnforced?{withSecurityEnforced:!0}:e.withAccessLevel?{withAccessLevel:e.withAccessLevel[0].image}:{withDataCategory:{conditions:this.visit(e.withDataCategory)}}},t.prototype.withDataCategory=function(e){var t=this;return e.withDataCategoryArr.map((function(e){return t.visit(e)}))},t.prototype.withDataCategoryArr=function(e){return{groupName:e.dataCategoryGroupName[0].image,selector:e.filteringSelector[0].image,parameters:e.dataCategoryName.map((function(e){return e.image}))}},t.prototype.groupByClause=function(e){var t=this;return e.groupBy.map((function(e){return(0,a.isToken)(e)?{field:e.image}:{fn:t.visit(e,{includeType:!1})}}))},t.prototype.havingClause=function(e){var t=this;return e.conditionExpression.reduce((function(e,r){return e.expressionTree?(e.prevExpression.right=t.visit(r,{prevExpression:e.prevExpression}),e.prevExpression=e.prevExpression.right):(e.expressionTree=t.visit(r),e.prevExpression=e.expressionTree),e}),{prevExpression:void 0,expressionTree:void 0}).expressionTree},t.prototype.orderByClause=function(e){var t=this;return e.orderByExpressionOrFn.map((function(e){return t.visit(e)}))},t.prototype.orderByExpression=function(e){var t={field:e.Identifier[0].image};return e.order&&e.order[0]&&(t.order=e.order[0].tokenType.name),e.nulls&&e.nulls[0]&&(t.nulls=e.nulls[0].tokenType.name),t},t.prototype.orderByGroupingFunctionExpression=function(e){var t={fn:this.helpers.$_getFieldFunction(e,!1,!1)};return e.order&&e.order[0]&&(t.order=e.order[0].tokenType.name),e.nulls&&e.nulls[0]&&(t.nulls=e.nulls[0].tokenType.name),t},t.prototype.orderBySpecialFunctionExpression=function(e){var t={};return e.aggregateFunction?t.fn=this.visit(e.aggregateFunction,{includeType:!1}):e.dateFunction?t.fn=this.visit(e.dateFunction,{includeType:!1}):e.locationFunction&&(t.fn=this.visit(e.locationFunction,{includeType:!1})),e.order&&e.order[0]&&(t.order=e.order[0].tokenType.name),e.nulls&&e.nulls[0]&&(t.nulls=e.nulls[0].tokenType.name),t},t.prototype.limitClause=function(e){return e.value[0].image},t.prototype.offsetClause=function(e){return e.value[0].image},t.prototype.dateFunction=function(e,t){return void 0===t&&(t={includeType:!0}),this.helpers.$_getFieldFunction(e,!0,t.includeType)},t.prototype.aggregateFunction=function(e,t){return void 0===t&&(t={includeType:!0}),this.helpers.$_getFieldFunction(e,!0,t.includeType)},t.prototype.fieldsFunction=function(e,t){void 0===t&&(t={includeType:!0});var r={};return t.includeType&&(r.type="FieldFunctionExpression"),(r=o(o({},r),{functionName:"FIELDS",parameters:[e.params[0].image]})).rawValue="FIELDS(".concat(r.parameters[0],")"),r},t.prototype.otherFunction=function(e,t){return void 0===t&&(t={includeType:!0}),this.helpers.$_getFieldFunction(e,!1,t.includeType)},t.prototype.cubeFunction=function(e){return this.helpers.$_getFieldFunction(e,!1,!1)},t.prototype.rollupFunction=function(e){return this.helpers.$_getFieldFunction(e,!1,!1)},t.prototype.locationFunction=function(e,t){void 0===t&&(t={includeType:!0});var r={};return t.includeType&&(r.type="FieldFunctionExpression"),r=o(o({},r),{functionName:"DISTANCE",parameters:[e.location1[0].image,(0,a.isToken)(e.location2)?e.location2[0].image:this.visit(e.location2,t),e.unit[0].image]}),t.includeType&&(r.isAggregateFn=!0),r.rawValue="DISTANCE(".concat(r.parameters[0],", ").concat((0,a.isString)(r.parameters[1])?r.parameters[1]:r.parameters[1].rawValue,", ").concat(r.parameters[2],")"),r},t.prototype.geolocationFunction=function(e,t){void 0===t&&(t={includeType:!0});var r={};return t.includeType&&(r.type="FieldFunctionExpression"),o(o({},r),{functionName:"GEOLOCATION",parameters:[e.latitude[0].image,e.longitude[0].image],rawValue:"GEOLOCATION(".concat(e.latitude[0].image,", ").concat(e.longitude[0].image,")")})},t.prototype.functionExpression=function(e,t){var r=this;return void 0===t&&(t={includeType:!0}),e.params?e.params.map((function(e){return e.image?e.image:r.visit(e,t)})):[]},t.prototype.expression=function(e){var t=this.visit(e.operator,{returnLiteralType:!0}),r=t.value,n=t.literalType,i=t.dateLiteralVariable,o=t.operator,s={};return(0,a.isToken)(e.lhs)?s.field=e.lhs[0].image:s.fn=this.visit(e.lhs,{includeType:!1}),s.operator=o,s.literalType=n,"SUBQUERY"===n?s.valueQuery=r:s.value=r,i&&(s.dateLiteralVariable=i),e.L_PAREN&&(s.openParen=e.L_PAREN.length),e.R_PAREN&&(s.closeParen=e.R_PAREN.length),s},t.prototype.expressionPartWithNegation=function(e){return{left:e.L_PAREN?{openParen:e.L_PAREN.length}:null,operator:"NOT",right:{left:{}}}},t.prototype.expressionWithRelationalOperator=function(e){return e.relationalOperator?o({operator:this.visit(e.relationalOperator)},this.visit(e.rhs,{returnLiteralType:!0})):o({operator:this.visit(e.setOperator)},this.visit(e.rhs,{returnLiteralType:!0}))},t.prototype.expressionWithSetOperator=function(e){return e.relationalOperator?o({operator:this.visit(e.relationalOperator)},this.visit(e.rhs,{returnLiteralType:!0})):o({operator:this.visit(e.setOperator)},this.visit(e.rhs,{returnLiteralType:!0}))},t.prototype.atomicExpression=function(e,t){var r,n,i,o=this;if(t=t||{},e.apexBindVariableExpression)r=this.visit(e.apexBindVariableExpression),n="APEX_BIND_VARIABLE";else if(e.NumberIdentifier)r=e.NumberIdentifier[0].image,n=this.helpers.$_getLiteralTypeFromTokenType(e.NumberIdentifier[0].tokenType.name);else if(e.UnsignedInteger)r=e.UnsignedInteger[0].image,n="INTEGER";else if(e.SignedInteger)r=e.SignedInteger[0].image,n="INTEGER";else if(e.RealNumber)r=e.RealNumber[0].image,n="DECIMAL";else if(e.DateIdentifier)r=e.DateIdentifier[0].image,n=this.helpers.$_getLiteralTypeFromTokenType(e.DateIdentifier[0].tokenType.name);else if(e.CurrencyPrefixedInteger)r=e.CurrencyPrefixedInteger[0].image,n="INTEGER_WITH_CURRENCY_PREFIX";else if(e.CurrencyPrefixedDecimal)r=e.CurrencyPrefixedDecimal[0].image,n="DECIMAL_WITH_CURRENCY_PREFIX";else if(e.DateTime)r=e.DateTime[0].image,n="DATETIME";else if(e.date)r=e.DateToken[0].image,n="DATE";else if(e.NULL)r="NULL",n="NULL";else if(e.StringIdentifier)r=e.StringIdentifier[0].image,n="STRING";else if(e.Identifier)r=e.Identifier[0].image,n="STRING";else if(e.booleanValue)r=this.visit(e.booleanValue),n="BOOLEAN";else if(e.DateLiteral)r=e.DateLiteral[0].image,n="DATE_LITERAL";else if(e.dateNLiteral){var a=this.visit(e.dateNLiteral);r=a.value,i=a.variable,n="DATE_N_LITERAL"}else if(e.arrayExpression){var s=this.visit(e.arrayExpression);r=s.map((function(e){return e.value}));var u=s.map((function(e){return e.variable||null}));u.some((function(e){return null!==e}))&&(i=u),n=(n=1===new Set(s.map((function(e){return e.type}))).size?this.helpers.$_getLiteralTypeFromTokenType(s[0].type):s.map((function(e){return o.helpers.$_getLiteralTypeFromTokenType(e.type)})))||"STRING"}else e.whereClauseSubqueryIdentifier&&(r=this.visit(e.whereClauseSubqueryIdentifier),n="SUBQUERY");return t.returnLiteralType?{value:r,literalType:n,dateLiteralVariable:i}:r},t.prototype.apexBindVariableExpression=function(e){var t=this;return e.apex.map((function(e){return t.visit(e)})).join(".")},t.prototype.apexBindVariableIdentifier=function(e){var t=e.Identifier[0].image;return e.apexBindVariableFunctionArrayAccessor&&(t+=this.visit(e.apexBindVariableFunctionArrayAccessor[0])),t},t.prototype.apexBindVariableNewInstantiation=function(e){var t="new ".concat(e.function[0].image);return e.apexBindVariableGeneric&&(t+=this.visit(e.apexBindVariableGeneric[0])),t+=this.visit(e.apexBindVariableFunctionParams[0]),e.apexBindVariableFunctionArrayAccessor&&(t+=this.visit(e.apexBindVariableFunctionArrayAccessor[0])),t},t.prototype.apexBindVariableFunctionCall=function(e){var t="".concat(e.function[0].image).concat(this.visit(e.apexBindVariableFunctionParams[0]));return e.apexBindVariableFunctionArrayAccessor&&(t+=this.visit(e.apexBindVariableFunctionArrayAccessor[0])),t},t.prototype.apexBindVariableGeneric=function(e){return"<".concat(e.parameter.map((function(e){return e.image})).join(", "),">")},t.prototype.apexBindVariableFunctionParams=function(e){var t=Array.isArray(e.parameter)?e.parameter:[];return"(".concat(t.map((function(e){return e.image})).join(", "),")")},t.prototype.apexBindVariableFunctionArrayAccessor=function(e){return"[".concat(e.value[0].image,"]")},t.prototype.arrayExpression=function(e){var t=this;return e.value.map((function(e){return(0,a.isToken)(e)?{type:e.tokenType.name,value:e.image}:t.visit(e,{includeType:!0})}))},t.prototype.relationalOperator=function(e){return e.operator[0].image},t.prototype.setOperator=function(e){return Array.isArray(e.operator)?e.operator[0].tokenType.name.replace("_"," "):Array.isArray(e.notIn)?this.visit(e.notIn):void 0},t.prototype.notInOperator=function(e){return"NOT IN"},t.prototype.booleanValue=function(e){return e.boolean[0].tokenType.name},t.prototype.dateNLiteral=function(e,t){var r={value:"".concat(e.dateNLiteral[0].image,":").concat(e.variable[0].image),variable:Number(e.variable[0].image)};return t&&t.includeType&&(r.type=e.dateNLiteral[0].tokenType.name),r},t.prototype.forViewOrReference=function(e){return e.value[0].tokenType.name},t.prototype.updateTrackingViewstat=function(e){return e.value[0].tokenType.name},t}(u));t.parseQuery=function(e,t){var r=(0,s.parse)(e,t).cst;return p.visit(r)},t.isQueryValid=function(e,t){try{return 0===(0,s.parse)(e,t).parseErrors.length}catch(e){return!1}}},168:(e,t)=>{"use strict";function r(e){return"string"==typeof e}function n(e){return!!e&&e.every((function(e){return r(e)}))}function i(e){return Number.isFinite(e)}function o(e){return"boolean"==typeof e}function a(e){return null==e}function s(e){return["IN","NOT IN","INCLUDES","EXCLUDES"].includes(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWhereValue=t.isArrayOperator=t.isGroupByFn=t.isGroupByField=t.isOrderByFn=t.isOrderByField=t.isValueQueryCondition=t.isNegationCondition=t.isValueFunctionCondition=t.isValueWithDateNLiteralCondition=t.isValueWithDateLiteralCondition=t.isValueCondition=t.isWhereOrHavingClauseWithRightCondition=t.isHavingClauseWithRightCondition=t.isWhereClauseWithRightCondition=t.isFieldSubquery=t.isSubquery=t.isComposeFieldTypeof=t.isComposeFieldSubquery=t.isComposeFieldRelationship=t.isComposeFieldFunction=t.isComposeField=t.hasAlias=t.isNestedParamAggregateFunction=t.getParams=t.generateParens=t.pad=t.getAsArrayStr=t.getLastItem=t.getIfTrue=t.get=t.isNil=t.isObject=t.isBoolean=t.isNumber=t.isStringArray=t.isString=t.isSubqueryFromFlag=t.isToken=void 0,t.isToken=function(e){return(e=Array.isArray(e)?e[0]:e).image&&!0},t.isSubqueryFromFlag=function(e,t){return t},t.isString=r,t.isStringArray=n,t.isNumber=i,t.isBoolean=o,t.isObject=function(e){return e instanceof Object},t.isNil=a,t.get=function(e,t,r){return a(e)?"":"".concat(r||"").concat(e).concat(t||"")},t.getIfTrue=function(e,t){return o(e)&&e?t:""},t.getLastItem=function(e){return e[e.length-1]},t.getAsArrayStr=function(e,t){return void 0===t&&(t=!1),Array.isArray(e)?e.length>0?"(".concat(e.join(", "),")"):t?"()":"":t?"(".concat(e||"",")"):e||""},t.pad=function(e,t,r){void 0===r&&(r=0);var n=r>0?new Array(r).fill(" ").join(""):"";return e.length>t?"".concat(n).concat(e):"".concat(n).concat(e).concat(new Array(t-e.length).fill(" ").join(""))},t.generateParens=function(e,t,r){return void 0===r&&(r=""),i(e)&&e>0?new Array(e).fill(t).join(r):""},t.getParams=function e(t){return t.parameters&&0!==t.parameters.length?n(t.parameters)?t.parameters:r(t.parameters[0])?[t.parameters[0]]:e(t.parameters[0]):[]},t.isNestedParamAggregateFunction=function(e){if(!e.parameters||0===e.parameters.length)return!1;var t=e.parameters[0];return!r(t)&&!!t.isAggregateFn},t.hasAlias=function(e){return e&&!a(e.alias)},t.isComposeField=function(e){return r(e.field)&&!Array.isArray(e.relationships)&&!Array.isArray(e.conditions)},t.isComposeFieldFunction=function(e){return!a(e.functionName||e.fn)},t.isComposeFieldRelationship=function(e){return r(e.field)&&Array.isArray(e.relationships)},t.isComposeFieldSubquery=function(e){return!a(e.subquery)},t.isComposeFieldTypeof=function(e){return r(e.field)&&Array.isArray(e.conditions)},t.isSubquery=function(e){return r(e.relationshipName)},t.isFieldSubquery=function(e){return!!e&&!!e.type&&"FieldSubquery"===e.type},t.isWhereClauseWithRightCondition=function(e){return!!e&&!!e.operator&&!!e.right},t.isHavingClauseWithRightCondition=function(e){return!!e&&!!e.operator&&!!e.right},t.isWhereOrHavingClauseWithRightCondition=function(e){return!!e&&!!e.operator&&!!e.right},t.isValueCondition=function(e){return e&&r(e.field)&&r(e.operator)&&!a(e.value)},t.isValueWithDateLiteralCondition=function(e){return e&&r(e.field)&&r(e.operator)&&!a(e.value)&&("DATE_LITERAL"===e.literalType||Array.isArray(e.literalType)&&"DATE_LITERAL"===e.literalType[0])},t.isValueWithDateNLiteralCondition=function(e){return e&&r(e.field)&&r(e.operator)&&!a(e.value)&&!a(e.dateLiteralVariable)},t.isValueFunctionCondition=function(e){return e&&!a(e.fn)&&r(e.operator)&&!a(e.value)},t.isNegationCondition=function(e){return e&&i(e.openParen)&&a(e.operator)&&a(e.field)&&a(e.fn)&&a(e.closeParen)},t.isValueQueryCondition=function(e){return e&&r(e.field)&&r(e.operator)&&!a(e.valueQuery)&&a(e.value)},t.isOrderByField=function(e){return e&&!a(e.field)},t.isOrderByFn=function(e){return e&&!a(e.fn)},t.isGroupByField=function(e){return e&&!a(e.field)},t.isGroupByFn=function(e){return e&&!a(e.fn)},t.isArrayOperator=s,t.getWhereValue=function(e,t,n){if(a(t))return e;if(n&&"APEX_BIND_VARIABLE"!==t&&s(n)&&!Array.isArray(e)&&(e=[e],t=Array.isArray(t)?t:[t]),Array.isArray(t)&&Array.isArray(e))return e.map((function(e,n){return function(e,t){return"STRING"===t?r(e)&&e.startsWith("'")?e:"'".concat(null!=e?e:"","'"):e}(e,null==t?void 0:t[n])}));switch(Array.isArray(t)&&(t=t[0]),t){case"STRING":return Array.isArray(e)?e.filter(Boolean).map((function(e){return r(e)&&e.startsWith("'")?e:"'".concat(null!=e?e:"","'")})):r(e=String(null!=e?e:""))&&e.startsWith("'")?e:"'".concat(null!=e?e:"","'");case"APEX_BIND_VARIABLE":return":".concat(e);default:return e}}},1684:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.generateCstDts=void 0;var i=r(4405),o=r(4941),a={includeVisitorInterface:!0,visitorInterfaceName:"ICstNodeVisitor"};t.generateCstDts=function(e,t){var r=n(n({},a),t),s=(0,i.buildModel)(e);return(0,o.genDts)(s,r)}},4941:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.genDts=void 0;var i=n(r(3187)),o=n(r(788)),a=n(r(9075)),s=n(r(2167)),u=n(r(2256)),c=n(r(7872));function l(e){return"token"===e.kind?"IToken":f(e.name)}function f(e){return(0,c.default)(e)+"CstNode"}function p(e){return(0,c.default)(e)+"CstChildren"}t.genDts=function(e,t){var r,n,c=[];return c=(c=c.concat('import type { CstNode, ICstVisitor, IToken } from "chevrotain";')).concat((0,i.default)((0,a.default)(e,(function(e){return function(e){var t=function(e){var t=f(e.name),r=p(e.name);return"export interface ".concat(t,' extends CstNode {\n name: "').concat(e.name,'";\n children: ').concat(r,";\n}")}(e),r=function(e){var t=p(e.name);return"export type ".concat(t," = {\n ").concat((0,a.default)(e.properties,(function(e){return function(e){var t=function(e){if((0,o.default)(e)){var t=(0,u.default)((0,a.default)(e,(function(e){return l(e)})));return"("+(0,s.default)(t,(function(e,t){return e+" | "+t}))+")"}return l(e)}(e.type);return"".concat(e.name).concat(e.optional?"?":"",": ").concat(t,"[];")}(e)})).join("\n "),"\n};")}(e);return[t,r]}(e)})))),t.includeVisitorInterface&&(c=c.concat((r=t.visitorInterfaceName,n=e,"export interface ".concat(r,"<IN, OUT> extends ICstVisitor<IN, OUT> {\n ").concat((0,a.default)(n,(function(e){return function(e){var t=p(e.name);return"".concat(e.name,"(children: ").concat(t,", param?: IN): OUT;")}(e)})).join("\n "),"\n}")))),c.join("\n\n")+"\n"}},4405:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.buildModel=void 0;var a=r(5262),s=o(r(9075)),u=o(r(3187)),c=o(r(4071)),l=o(r(5797)),f=o(r(395)),p=o(r(7696));t.buildModel=function(e){var t=new d,r=(0,c.default)(e);return(0,s.default)(r,(function(e){return t.visitRule(e)}))};var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.visitRule=function(e){var t=this.visitEach(e.definition),r=(0,f.default)(t,(function(e){return e.propertyName})),n=(0,s.default)(r,(function(e,t){var r=!(0,l.default)(e,(function(e){return!e.canBeNull})),n=e[0].type;return e.length>1&&(n=(0,s.default)(e,(function(e){return e.type}))),{name:t,type:n,optional:r}}));return{name:e.name,properties:n}},t.prototype.visitAlternative=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitOption=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetition=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetitionMandatory=function(e){return this.visitEach(e.definition)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){return this.visitEach(e.definition).concat({propertyName:e.separator.name,canBeNull:!0,type:h(e.separator)})},t.prototype.visitRepetitionWithSeparator=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0}).concat({propertyName:e.separator.name,canBeNull:!0,type:h(e.separator)})},t.prototype.visitAlternation=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitTerminal=function(e){return[{propertyName:e.label||e.terminalType.name,canBeNull:!1,type:h(e)}]},t.prototype.visitNonTerminal=function(e){return[{propertyName:e.label||e.nonTerminalName,canBeNull:!1,type:h(e)}]},t.prototype.visitEachAndOverrideWith=function(e,t){return(0,s.default)(this.visitEach(e),(function(e){return(0,p.default)({},e,t)}))},t.prototype.visitEach=function(e){var t=this;return(0,u.default)((0,s.default)(e,(function(e){return t.visit(e)})))},t}(a.GAstVisitor);function h(e){return e instanceof a.NonTerminal?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}},5262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSequenceProd=t.isBranchingProd=t.isOptionalProd=t.getProductionDslName=t.GAstVisitor=t.serializeProduction=t.serializeGrammar=t.Alternative=t.Alternation=t.RepetitionWithSeparator=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Repetition=t.Option=t.NonTerminal=t.Terminal=t.Rule=void 0;var n=r(3059);Object.defineProperty(t,"Rule",{enumerable:!0,get:function(){return n.Rule}}),Object.defineProperty(t,"Terminal",{enumerable:!0,get:function(){return n.Terminal}}),Object.defineProperty(t,"NonTerminal",{enumerable:!0,get:function(){return n.NonTerminal}}),Object.defineProperty(t,"Option",{enumerable:!0,get:function(){return n.Option}}),Object.defineProperty(t,"Repetition",{enumerable:!0,get:function(){return n.Repetition}}),Object.defineProperty(t,"RepetitionMandatory",{enumerable:!0,get:function(){return n.RepetitionMandatory}}),Object.defineProperty(t,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return n.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"RepetitionWithSeparator",{enumerable:!0,get:function(){return n.RepetitionWithSeparator}}),Object.defineProperty(t,"Alternation",{enumerable:!0,get:function(){return n.Alternation}}),Object.defineProperty(t,"Alternative",{enumerable:!0,get:function(){return n.Alternative}}),Object.defineProperty(t,"serializeGrammar",{enumerable:!0,get:function(){return n.serializeGrammar}}),Object.defineProperty(t,"serializeProduction",{enumerable:!0,get:function(){return n.serializeProduction}});var i=r(9103);Object.defineProperty(t,"GAstVisitor",{enumerable:!0,get:function(){return i.GAstVisitor}});var o=r(8791);Object.defineProperty(t,"getProductionDslName",{enumerable:!0,get:function(){return o.getProductionDslName}}),Object.defineProperty(t,"isOptionalProd",{enumerable:!0,get:function(){return o.isOptionalProd}}),Object.defineProperty(t,"isBranchingProd",{enumerable:!0,get:function(){return o.isBranchingProd}}),Object.defineProperty(t,"isSequenceProd",{enumerable:!0,get:function(){return o.isSequenceProd}})},8791:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getProductionDslName=t.isBranchingProd=t.isOptionalProd=t.isSequenceProd=void 0;var i=n(r(5797)),o=n(r(6906)),a=n(r(8416)),s=r(3059);t.isSequenceProd=function(e){return e instanceof s.Alternative||e instanceof s.Option||e instanceof s.Repetition||e instanceof s.RepetitionMandatory||e instanceof s.RepetitionMandatoryWithSeparator||e instanceof s.RepetitionWithSeparator||e instanceof s.Terminal||e instanceof s.Rule},t.isOptionalProd=function e(t,r){return void 0===r&&(r=[]),!!(t instanceof s.Option||t instanceof s.Repetition||t instanceof s.RepetitionWithSeparator)||(t instanceof s.Alternation?(0,i.default)(t.definition,(function(t){return e(t,r)})):!(t instanceof s.NonTerminal&&(0,a.default)(r,t))&&t instanceof s.AbstractProduction&&(t instanceof s.NonTerminal&&r.push(t),(0,o.default)(t.definition,(function(t){return e(t,r)}))))},t.isBranchingProd=function(e){return e instanceof s.Alternation},t.getProductionDslName=function(e){if(e instanceof s.NonTerminal)return"SUBRULE";if(e instanceof s.Option)return"OPTION";if(e instanceof s.Alternation)return"OR";if(e instanceof s.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof s.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof s.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof s.Repetition)return"MANY";if(e instanceof s.Terminal)return"CONSUME";throw Error("non exhaustive match")}},3059:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.serializeProduction=t.serializeGrammar=t.Terminal=t.Alternation=t.RepetitionWithSeparator=t.Repetition=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Option=t.Alternative=t.Rule=t.NonTerminal=t.AbstractProduction=void 0;var a=o(r(9075)),s=o(r(5491)),u=o(r(3948)),c=o(r(3136)),l=o(r(5753)),f=o(r(7696));var p=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,s.default)(this.definition,(function(t){t.accept(e)}))},e}();t.AbstractProduction=p;var d=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(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}(p);t.NonTerminal=d;var h=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Rule=h;var E=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Alternative=E;var y=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Option=y;var T=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatory=T;var v=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatoryWithSeparator=v;var m=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Repetition=m;var g=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionWithSeparator=g;var A=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,f.default)(r,(0,l.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t}(p);t.Alternation=A;var _=function(){function e(e){this.idx=1,(0,f.default)(this,(0,l.default)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function L(e){function t(e){return(0,a.default)(e,L)}if(e instanceof d){var r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,u.default)(e.label)&&(r.label=e.label),r}if(e instanceof E)return{type:"Alternative",definition:t(e.definition)};if(e instanceof y)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof T)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof v)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:L(new _({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof g)return{type:"RepetitionWithSeparator",idx:e.idx,separator:L(new _({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof m)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof A)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof _){var n={type:"Terminal",name:e.terminalType.name,label:(o=e.terminalType,s=o,(0,u.default)(s.LABEL)&&""!==s.LABEL?o.LABEL:o.name),idx:e.idx};(0,u.default)(e.label)&&(n.terminalLabel=e.label);var i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=(0,c.default)(i)?i.source:i),n}var o,s;if(e instanceof h)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}t.Terminal=_,t.serializeGrammar=function(e){return(0,a.default)(e,L)},t.serializeProduction=L},9103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GAstVisitor=void 0;var n=r(3059),i=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Alternative:return this.visitAlternative(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule: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}();t.GAstVisitor=i},7736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=t.timer=t.PRINT_ERROR=t.PRINT_WARNING=void 0;var n=r(43);Object.defineProperty(t,"PRINT_WARNING",{enumerable:!0,get:function(){return n.PRINT_WARNING}}),Object.defineProperty(t,"PRINT_ERROR",{enumerable:!0,get:function(){return n.PRINT_ERROR}});var i=r(3145);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return i.timer}});var o=r(1762);Object.defineProperty(t,"toFastProperties",{enumerable:!0,get:function(){return o.toFastProperties}})},43:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRINT_WARNING=t.PRINT_ERROR=void 0,t.PRINT_ERROR=function(e){console&&console.error&&console.error("Error: ".concat(e))},t.PRINT_WARNING=function(e){console&&console.warn&&console.warn("Warning: ".concat(e))}},3145:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0,t.timer=function(e){var t=(new Date).getTime(),r=e();return{time:(new Date).getTime()-t,value:r}}},1762:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=void 0,t.toFastProperties=function(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.bar}return n(),n(),e}},6210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=t.createSyntaxDiagramsCode=t.clearCache=t.generateCstDts=t.GAstVisitor=t.serializeProduction=t.serializeGrammar=t.Terminal=t.Rule=t.RepetitionWithSeparator=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Repetition=t.Option=t.NonTerminal=t.Alternative=t.Alternation=t.defaultLexerErrorProvider=t.NoViableAltException=t.NotAllInputParsedException=t.MismatchedTokenException=t.isRecognitionException=t.EarlyExitException=t.defaultParserErrorProvider=t.LLkLookaheadStrategy=t.getLookaheadPaths=t.tokenName=t.tokenMatcher=t.tokenLabel=t.EOF=t.createTokenInstance=t.createToken=t.LexerDefinitionErrorType=t.Lexer=t.EMPTY_ALT=t.ParserDefinitionErrorType=t.EmbeddedActionsParser=t.CstParser=t.VERSION=void 0;var n=r(9766);Object.defineProperty(t,"VERSION",{enumerable:!0,get:function(){return n.VERSION}});var i=r(4249);Object.defineProperty(t,"CstParser",{enumerable:!0,get:function(){return i.CstParser}}),Object.defineProperty(t,"EmbeddedActionsParser",{enumerable:!0,get:function(){return i.EmbeddedActionsParser}}),Object.defineProperty(t,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return i.ParserDefinitionErrorType}}),Object.defineProperty(t,"EMPTY_ALT",{enumerable:!0,get:function(){return i.EMPTY_ALT}});var o=r(3734);Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return o.Lexer}}),Object.defineProperty(t,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return o.LexerDefinitionErrorType}});var a=r(8516);Object.defineProperty(t,"createToken",{enumerable:!0,get:function(){return a.createToken}}),Object.defineProperty(t,"createTokenInstance",{enumerable:!0,get:function(){return a.createTokenInstance}}),Object.defineProperty(t,"EOF",{enumerable:!0,get:function(){return a.EOF}}),Object.defineProperty(t,"tokenLabel",{enumerable:!0,get:function(){return a.tokenLabel}}),Object.defineProperty(t,"tokenMatcher",{enumerable:!0,get:function(){return a.tokenMatcher}}),Object.defineProperty(t,"tokenName",{enumerable:!0,get:function(){return a.tokenName}});var s=r(8132);Object.defineProperty(t,"getLookaheadPaths",{enumerable:!0,get:function(){return s.getLookaheadPaths}});var u=r(7698);Object.defineProperty(t,"LLkLookaheadStrategy",{enumerable:!0,get:function(){return u.LLkLookaheadStrategy}});var c=r(6311);Object.defineProperty(t,"defaultParserErrorProvider",{enumerable:!0,get:function(){return c.defaultParserErrorProvider}});var l=r(9996);Object.defineProperty(t,"EarlyExitException",{enumerable:!0,get:function(){return l.EarlyExitException}}),Object.defineProperty(t,"isRecognitionException",{enumerable:!0,get:function(){return l.isRecognitionException}}),Object.defineProperty(t,"MismatchedTokenException",{enumerable:!0,get:function(){return l.MismatchedTokenException}}),Object.defineProperty(t,"NotAllInputParsedException",{enumerable:!0,get:function(){return l.NotAllInputParsedException}}),Object.defineProperty(t,"NoViableAltException",{enumerable:!0,get:function(){return l.NoViableAltException}});var f=r(1574);Object.defineProperty(t,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return f.defaultLexerErrorProvider}});var p=r(5262);Object.defineProperty(t,"Alternation",{enumerable:!0,get:function(){return p.Alternation}}),Object.defineProperty(t,"Alternative",{enumerable:!0,get:function(){return p.Alternative}}),Object.defineProperty(t,"NonTerminal",{enumerable:!0,get:function(){return p.NonTerminal}}),Object.defineProperty(t,"Option",{enumerable:!0,get:function(){return p.Option}}),Object.defineProperty(t,"Repetition",{enumerable:!0,get:function(){return p.Repetition}}),Object.defineProperty(t,"RepetitionMandatory",{enumerable:!0,get:function(){return p.RepetitionMandatory}}),Object.defineProperty(t,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return p.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"RepetitionWithSeparator",{enumerable:!0,get:function(){return p.RepetitionWithSeparator}}),Object.defineProperty(t,"Rule",{enumerable:!0,get:function(){return p.Rule}}),Object.defineProperty(t,"Terminal",{enumerable:!0,get:function(){return p.Terminal}});var d=r(5262);Object.defineProperty(t,"serializeGrammar",{enumerable:!0,get:function(){return d.serializeGrammar}}),Object.defineProperty(t,"serializeProduction",{enumerable:!0,get:function(){return d.serializeProduction}}),Object.defineProperty(t,"GAstVisitor",{enumerable:!0,get:function(){return d.GAstVisitor}});var h=r(1684);Object.defineProperty(t,"generateCstDts",{enumerable:!0,get:function(){return h.generateCstDts}}),t.clearCache=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")};var E=r(5433);Object.defineProperty(t,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return E.createSyntaxDiagramsCode}});t.Parser=function(){throw new Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.\t\nSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0")}},5433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSyntaxDiagramsCode=void 0;var n=r(9766);t.createSyntaxDiagramsCode=function(e,t){var r=void 0===t?{}:t,i=r.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/"):i,a=r.css,s=void 0===a?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/diagrams.css"):a;return'\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset="utf-8">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n'+"\n<link rel='stylesheet' href='".concat(s,"'>\n")+"\n<script src='".concat(o,"vendor/railroad-diagrams.js'><\/script>\n<script src='").concat(o,"src/diagrams_builder.js'><\/script>\n<script src='").concat(o,"src/diagrams_behavior.js'><\/script>\n<script src='").concat(o,"src/main.js'><\/script>\n")+'\n<div id="diagrams" align="center"></div> \n'+"\n<script>\n window.serializedGrammar = ".concat(JSON.stringify(e,null," "),";\n<\/script>\n")+'\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}},8744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineNameProp=void 0,t.defineNameProp=function(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}},3147:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IN=void 0,t.IN="_~IN~_"},8985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addNoneTerminalToCst=t.addTerminalToCst=t.setNodeLocationFull=t.setNodeLocationOnlyOffset=void 0,t.setNodeLocationOnlyOffset=function(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset)},t.setNodeLocationFull=function(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)},t.addTerminalToCst=function(e,t,r){void 0===e.children[r]?e.children[r]=[t]:e.children[r].push(t)},t.addNoneTerminalToCst=function(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}},9960:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateMissingCstMethods=t.validateVisitor=t.CstVisitorDefinitionError=t.createBaseVisitorConstructorWithDefaults=t.createBaseSemanticVisitorConstructor=t.defaultVisit=void 0;var i,o=n(r(2496)),a=n(r(3956)),s=n(r(788)),u=n(r(9075)),c=n(r(5491)),l=n(r(4435)),f=n(r(8465)),p=n(r(8957)),d=n(r(2189)),h=r(8744);function E(e,t){for(var r=(0,f.default)(e),n=r.length,i=0;i<n;i++)for(var o=e[r[i]],a=o.length,s=0;s<a;s++){var u=o[s];void 0===u.tokenTypeIdx&&this[u.name](u.children,t)}}function y(e,t){return T(e,t)}function T(e,t){var r=(0,l.default)(t,(function(t){return!1===(0,p.default)(e[t])})),n=(0,u.default)(r,(function(t){return{msg:"Missing visitor method: <".concat(t,"> on ").concat(e.constructor.name," CST Visitor."),type:i.MISSING_METHOD,methodName:t}}));return(0,a.default)(n)}t.defaultVisit=E,t.createBaseSemanticVisitorConstructor=function(e,t){var r=function(){};return(0,h.defineNameProp)(r,e+"BaseSemantics"),(r.prototype={visit:function(e,t){if((0,s.default)(e)&&(e=e[0]),!(0,d.default)(e))return this[e.name](e.children,t)},validateVisitor:function(){var e=y(this,t);if(!(0,o.default)(e)){var r=(0,u.default)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <".concat(this.constructor.name,">:\n\t")+"".concat(r.join("\n\n").replace(/\n/g,"\n\t")))}}}).constructor=r,r._RULE_NAMES=t,r},t.createBaseVisitorConstructorWithDefaults=function(e,t,r){var n=function(){};(0,h.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,c.default)(t,(function(e){i[e]=E})),(n.prototype=i).constructor=n,n},function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(i=t.CstVisitorDefinitionError||(t.CstVisitorDefinitionError={})),t.validateVisitor=y,t.validateMissingCstMethods=T},6311:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultGrammarValidatorErrorProvider=t.defaultGrammarResolverErrorProvider=t.defaultParserErrorProvider=void 0;var i=r(8516),o=n(r(8892)),a=n(r(9075)),s=n(r(2167)),u=r(5262),c=r(5262);t.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual,n=(e.previous,e.ruleName,(0,i.hasTokenLabel)(t)?"--\x3e ".concat((0,i.tokenLabel)(t)," <--"):"token of type --\x3e ".concat(t.name," <--"));return"Expecting ".concat(n," but found --\x3e '").concat(r.image,"' <--")},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;return e.ruleName,"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,n=(e.previous,e.customUserDescription),u=(e.ruleName,"Expecting: "),c="\nbut found: '"+(0,o.default)(r).image+"'";if(n)return u+n+c;var l=(0,s.default)(t,(function(e,t){return e.concat(t)}),[]),f=(0,a.default)(l,(function(e){return"[".concat((0,a.default)(e,(function(e){return(0,i.tokenLabel)(e)})).join(", "),"]")})),p=(0,a.default)(f,(function(e,t){return" ".concat(t+1,". ").concat(e)}));return u+"one of these possible Token sequences:\n".concat(p.join("\n"))+c},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,n=e.customUserDescription,s=(e.ruleName,"Expecting: "),u="\nbut found: '"+(0,o.default)(r).image+"'";if(n)return s+n+u;var c=(0,a.default)(t,(function(e){return"[".concat((0,a.default)(e,(function(e){return(0,i.tokenLabel)(e)})).join(","),"]")}));return s+"expecting at least one iteration which starts with one of these possible Token sequences::\n "+"<".concat(c.join(" ,"),">")+u}},Object.freeze(t.defaultParserErrorProvider),t.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},t.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){var r,n=e.name,i=(0,o.default)(t),a=i.idx,s=(0,c.getProductionDslName)(i),l=(r=i)instanceof u.Terminal?r.terminalType.name:r instanceof u.NonTerminal?r.nonTerminalName:"",f=a>0,p="->".concat(s).concat(f?a:"","<- ").concat(l?"with argument: ->".concat(l,"<-"):"","\n appears more than once (").concat(t.length," times) in the top level rule: ->").concat(n,"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ");return(p=p.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\n"+"The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <".concat(e.name,">.\n")+"To 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,a.default)(e.prefixPath,(function(e){return(0,i.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <".concat(e.ambiguityIndices.join(" ,"),"> due to common lookahead prefix\n")+"in <OR".concat(r,"> inside <").concat(e.topLevelRule.name,"> Rule,\n")+"<".concat(t,"> may appears as a prefix path in all these alternatives.\n")+"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=(0,a.default)(e.prefixPath,(function(e){return(0,i.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous Alternatives Detected: <".concat(e.ambiguityIndices.join(" ,"),"> in <OR").concat(r,">")+" inside <".concat(e.topLevelRule.name,"> Rule,\n")+"<".concat(t,"> may appears as a prefix path in all these alternatives.\n")+"See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=(0,c.getProductionDslName)(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <".concat(t,"> within Rule <").concat(e.topLevelRule.name,"> can never consume any tokens.\n")+"This could lead to an infinite loop."},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <".concat(e.emptyChoiceIdx+1,">")+" in <OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,"> Rule.\n")+"Only the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n"+"<OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,"> Rule.\n has ").concat(e.alternation.definition.length+1," alternatives.")},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=(0,a.default)(e.leftRecursionPath,(function(e){return e.name})),n="".concat(t," --\x3e ").concat(r.concat([t]).join(" --\x3e "));return"Left Recursion found in grammar.\n"+"rule: <".concat(t,"> can be invoked from itself (directly or indirectly)\n")+"without consuming any Tokens. The grammar path that causes this is: \n ".concat(n,"\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){var t;return t=e.topLevelRule instanceof u.Rule?e.topLevelRule.name:e.topLevelRule,"Duplicate definition, rule: ->".concat(t,"<- is already defined in the grammar: ->").concat(e.grammarName,"<-")}}},9996:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EarlyExitException=t.NotAllInputParsedException=t.NoViableAltException=t.MismatchedTokenException=t.isRecognitionException=void 0;var a=o(r(8416)),s="MismatchedTokenException",u="NoViableAltException",c="EarlyExitException",l="NotAllInputParsedException",f=[s,u,c,l];Object.freeze(f),t.isRecognitionException=function(e){return(0,a.default)(f,e.name)};var p=function(e){function t(t,r){var n=this.constructor,i=e.call(this,t)||this;return i.token=r,i.resyncedTokens=[],Object.setPrototypeOf(i,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return i(t,e),t}(Error),d=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=s,i}return i(t,e),t}(p);t.MismatchedTokenException=d;var h=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=u,i}return i(t,e),t}(p);t.NoViableAltException=h;var E=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.name=l,n}return i(t,e),t}(p);t.NotAllInputParsedException=E;var y=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.previousToken=n,i.name=c,i}return i(t,e),t}(p);t.EarlyExitException=y},1935:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkPrefixAlternativesAmbiguities=t.validateSomeNonEmptyLookaheadPath=t.validateTooManyAlts=t.RepetitionCollector=t.validateAmbiguousAlternationAlternatives=t.validateEmptyOrAlternative=t.getFirstNoneTerminal=t.validateNoLeftRecursion=t.validateRuleIsOverridden=t.validateRuleDoesNotAlreadyExist=t.OccurrenceValidationCollector=t.identifyProductionForDuplicates=t.validateGrammar=t.validateLookahead=void 0;var s=a(r(8892)),u=a(r(2496)),c=a(r(6388)),l=a(r(3187)),f=a(r(4435)),p=a(r(346)),d=a(r(2986)),h=a(r(9075)),E=a(r(5491)),y=a(r(395)),T=a(r(2167)),v=a(r(5753)),m=a(r(4071)),g=a(r(8416)),A=a(r(9394)),_=a(r(6860)),L=r(4249),O=r(5262),N=r(8132),I=r(2010),R=r(5262),S=r(5262),C=a(r(1104)),x=a(r(3956)),P=r(38);function b(e){return"".concat((0,O.getProductionDslName)(e),"_#_").concat(e.idx,"_#_").concat(k(e))}function k(e){return e instanceof R.Terminal?e.terminalType.name:e instanceof R.NonTerminal?e.nonTerminalName:""}t.validateLookahead=function(e){var t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return(0,h.default)(t,(function(e){return o({type:L.ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION},e)}))},t.validateGrammar=function(e,t,r,n){var i=(0,A.default)(e,(function(e){return function(e,t){var r=new M;e.accept(r);var n=r.allProductions,i=(0,y.default)(n,b),o=(0,v.default)(i,(function(e){return e.length>1}));return(0,h.default)((0,m.default)(o),(function(r){var n=(0,s.default)(r),i=t.buildDuplicateFoundError(e,r),o=(0,O.getProductionDslName)(n),a={message:i,type:L.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:o,occurrence:n.idx},u=k(n);return u&&(a.parameter=u),a}))}(e,r)})),o=function(e,t,r){var n=[],i=(0,h.default)(t,(function(e){return e.name}));return(0,E.default)(e,(function(e){var t=e.name;if((0,g.default)(i,t)){var o=r.buildNamespaceConflictError(e);n.push({message:o,type:L.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,t,r),a=(0,A.default)(e,(function(e){return B(e,r)})),u=(0,A.default)(e,(function(t){return F(t,e,n,r)}));return i.concat(o,a,u)},t.identifyProductionForDuplicates=b;var M=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return i(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}(S.GAstVisitor);function F(e,t,r,n){var i=[];if((0,T.default)(t,(function(t,r){return r.name===e.name?t+1:t}),0)>1){var o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:o,type:L.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function U(e){var t=[];if((0,u.default)(e))return t;var r=(0,s.default)(e);if(r instanceof R.NonTerminal)t.push(r.referencedRule);else if(r instanceof R.Alternative||r instanceof R.Option||r instanceof R.RepetitionMandatory||r instanceof R.RepetitionMandatoryWithSeparator||r instanceof R.RepetitionWithSeparator||r instanceof R.Repetition)t=t.concat(U(r.definition));else if(r instanceof R.Alternation)t=(0,l.default)((0,h.default)(r.definition,(function(e){return U(e.definition)})));else if(!(r instanceof R.Terminal))throw Error("non exhaustive match");var n=(0,O.isOptionalProd)(r),i=e.length>1;if(n&&i){var o=(0,c.default)(e);return t.concat(U(o))}return t}t.OccurrenceValidationCollector=M,t.validateRuleDoesNotAlreadyExist=F,t.validateRuleIsOverridden=function(e,t,r){var n,i=[];return(0,g.default)(t,e)||(n="Invalid rule override, rule: ->".concat(e,"<- cannot be overridden in the grammar: ->").concat(r,"<-")+"as it is not defined in any of the super grammars ",i.push({message:n,type:L.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),i},t.validateNoLeftRecursion=function e(t,r,n,i){void 0===i&&(i=[]);var o=[],a=U(r.definition);if((0,u.default)(a))return[];var s=t.name;(0,g.default)(a,t)&&o.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:i}),type:L.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:s});var c=(0,d.default)(a,i.concat([t])),l=(0,A.default)(c,(function(r){var o=(0,_.default)(i);return o.push(r),e(t,r,n,o)}));return o.concat(l)},t.getFirstNoneTerminal=U;var D=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return i(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(S.GAstVisitor);t.validateEmptyOrAlternative=function(e,t){var r=new D;e.accept(r);var n=r.alternations;return(0,A.default)(n,(function(r){var n=(0,C.default)(r.definition);return(0,A.default)(n,(function(n,i){var o=(0,I.nextPossibleTokensAfter)([n],[],P.tokenStructuredMatcher,1);return(0,u.default)(o)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:i}),type:L.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:i+1}]:[]}))}))},t.validateAmbiguousAlternationAlternatives=function(e,t,r){var n=new D;e.accept(n);var i=n.alternations;return i=(0,p.default)(i,(function(e){return!0===e.ignoreAmbiguities})),(0,A.default)(i,(function(n){var i=n.idx,o=n.maxLookahead||t,a=(0,N.getLookaheadPathsForOr)(i,e,o,n),s=function(e,t,r,n){var i=[],o=(0,T.default)(e,(function(r,n,o){return!0===t.definition[o].ignoreAmbiguities||(0,E.default)(n,(function(n){var a=[o];(0,E.default)(e,(function(e,r){o!==r&&(0,N.containsPath)(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&a.push(r)})),a.length>1&&!(0,N.containsPath)(i,n)&&(i.push(n),r.push({alts:a,path:n}))})),r}),[]);return(0,h.default)(o,(function(e){var i=(0,h.default)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:L.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:e.alts}}))}(a,n,e,r),u=j(a,n,e,r);return s.concat(u)}))};var w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return i(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}(S.GAstVisitor);function B(e,t){var r=new D;e.accept(r);var n=r.alternations;return(0,A.default)(n,(function(r){return r.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:L.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}]:[]}))}function j(e,t,r,n){var i=(0,T.default)(e,(function(e,t,r){var n=(0,h.default)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return(0,x.default)((0,A.default)(i,(function(e){if(!0===t.definition[e.idx].ignoreAmbiguities)return[];var o=e.idx,a=e.path,s=(0,f.default)(i,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<o&&(0,N.isStrictPrefixOfPath)(e.path,a)}));return(0,h.default)(s,(function(e){var i=[e.idx+1,o+1],a=0===t.idx?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:L.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:a,alternatives:i}}))})))}t.RepetitionCollector=w,t.validateTooManyAlts=B,t.validateSomeNonEmptyLookaheadPath=function(e,t,r){var n=[];return(0,E.default)(e,(function(e){var i=new w;e.accept(i);var o=i.allProductions;(0,E.default)(o,(function(i){var o=(0,N.getProdType)(i),a=i.maxLookahead||t,s=i.idx,c=(0,N.getLookaheadPathsForOptionalProd)(s,e,o,a)[0];if((0,u.default)((0,l.default)(c))){var f=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:f,type:L.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n},t.checkPrefixAlternativesAmbiguities=j},1446:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.firstForTerminal=t.firstForBranching=t.firstForSequence=t.first=void 0;var i=n(r(3187)),o=n(r(2256)),a=n(r(9075)),s=r(5262),u=r(5262);function c(e){if(e instanceof s.NonTerminal)return c(e.referencedRule);if(e instanceof s.Terminal)return p(e);if((0,u.isSequenceProd)(e))return l(e);if((0,u.isBranchingProd)(e))return f(e);throw Error("non exhaustive match")}function l(e){for(var t,r=[],n=e.definition,i=0,a=n.length>i,s=!0;a&&s;)t=n[i],s=(0,u.isOptionalProd)(t),r=r.concat(c(t)),i+=1,a=n.length>i;return(0,o.default)(r)}function f(e){var t=(0,a.default)(e.definition,(function(e){return c(e)}));return(0,o.default)((0,i.default)(t))}function p(e){return[e.terminalType]}t.first=c,t.firstForSequence=l,t.firstForBranching=f,t.firstForTerminal=p},4315:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.buildInProdFollowPrefix=t.buildBetweenProdsFollowPrefix=t.computeAllProdsFollows=t.ResyncFollowsWalker=void 0;var a=r(2576),s=r(1446),u=o(r(5491)),c=o(r(7696)),l=r(3147),f=r(5262),p=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,r){},t.prototype.walkProdRef=function(e,t,r){var n=d(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(r),o=new f.Alternative({definition:i}),a=(0,s.first)(o);this.follows[n]=a},t}(a.RestWalker);function d(e,t){return e.name+t+l.IN}t.ResyncFollowsWalker=p,t.computeAllProdsFollows=function(e){var t={};return(0,u.default)(e,(function(e){var r=new p(e).startWalking();(0,c.default)(t,r)})),t},t.buildBetweenProdsFollowPrefix=d,t.buildInProdFollowPrefix=function(e){return e.terminalType.name+e.idx+l.IN}},3798:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateGrammar=t.resolveGrammar=void 0;var i=n(r(5491)),o=n(r(6139)),a=r(4660),s=r(1935),u=r(6311);t.resolveGrammar=function(e){var t=(0,o.default)(e,{errMsgProvider:u.defaultGrammarResolverErrorProvider}),r={};return(0,i.default)(e.rules,(function(e){r[e.name]=e})),(0,a.resolveGrammar)(r,t.errMsgProvider)},t.validateGrammar=function(e){return e=(0,o.default)(e,{errMsgProvider:u.defaultGrammarValidatorErrorProvider}),(0,s.validateGrammar)(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}},2010:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.nextPossibleTokensAfter=t.possiblePathsFrom=t.NextTerminalAfterAtLeastOneSepWalker=t.NextTerminalAfterAtLeastOneWalker=t.NextTerminalAfterManySepWalker=t.NextTerminalAfterManyWalker=t.AbstractNextTerminalAfterProductionWalker=t.NextAfterTokenWalker=t.AbstractNextPossibleTokensWalker=void 0;var a=r(2576),s=o(r(8892)),u=o(r(2496)),c=o(r(1104)),l=o(r(6388)),f=o(r(8513)),p=o(r(5491)),d=o(r(6860)),h=r(1446),E=r(5262),y=function(e){function t(t,r){var n=e.call(this)||this;return n.topProd=t,n.path=r,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return i(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,d.default)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,d.default)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,r){void 0===r&&(r=[]),this.found||e.prototype.walk.call(this,t,r)},t.prototype.walkProdRef=function(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}},t.prototype.updateExpectedNext=function(){(0,u.default)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(a.RestWalker);t.AbstractNextPossibleTokensWalker=y;var T=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.path=r,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return i(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var n=t.concat(r),i=new E.Alternative({definition:n});this.possibleTokTypes=(0,h.first)(i),this.found=!0}},t}(y);t.NextAfterTokenWalker=T;var v=function(e){function t(t,r){var n=e.call(this)||this;return n.topRule=t,n.occurrence=r,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(a.RestWalker);t.AbstractNextTerminalAfterProductionWalker=v;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkMany=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof E.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkMany.call(this,t,r,n)},t}(v);t.NextTerminalAfterManyWalker=m;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkManySep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof E.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkManySep.call(this,t,r,n)},t}(v);t.NextTerminalAfterManySepWalker=g;var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkAtLeastOne=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof E.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,n)},t}(v);t.NextTerminalAfterAtLeastOneWalker=A;var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.walkAtLeastOneSep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.default)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof E.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,n)},t}(v);function L(e,t,r,n){var i=(0,d.default)(r);i.push(e.name);var o=(0,d.default)(n);return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}t.NextTerminalAfterAtLeastOneSepWalker=_,t.possiblePathsFrom=function e(t,r,n){void 0===n&&(n=[]),n=(0,d.default)(n);var i=[],o=0;function a(a){var s=e(a.concat((0,l.default)(t,o+1)),r,n);return i.concat(s)}for(;n.length<r&&o<t.length;){var s=t[o];if(s instanceof E.Alternative)return a(s.definition);if(s instanceof E.NonTerminal)return a(s.definition);if(s instanceof E.Option)i=a(s.definition);else{if(s instanceof E.RepetitionMandatory)return a(c=s.definition.concat([new E.Repetition({definition:s.definition})]));if(s instanceof E.RepetitionMandatoryWithSeparator)return a(c=[new E.Alternative({definition:s.definition}),new E.Repetition({definition:[new E.Terminal({terminalType:s.separator})].concat(s.definition)})]);if(s instanceof E.RepetitionWithSeparator){var c=s.definition.concat([new E.Repetition({definition:[new E.Terminal({terminalType:s.separator})].concat(s.definition)})]);i=a(c)}else if(s instanceof E.Repetition)c=s.definition.concat([new E.Repetition({definition:s.definition})]),i=a(c);else{if(s instanceof E.Alternation)return(0,p.default)(s.definition,(function(e){!1===(0,u.default)(e.definition)&&(i=a(e.definition))})),i;if(!(s instanceof E.Terminal))throw Error("non exhaustive match");n.push(s.terminalType)}}o++}return i.push({partialPath:n,suffixDef:(0,l.default)(t,o)}),i},t.nextPossibleTokensAfter=function(e,t,r,n){var i="EXIT_NONE_TERMINAL",o=[i],a="EXIT_ALTERNATIVE",s=!1,p=t.length,h=p-n-1,y=[],T=[];for(T.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,u.default)(T);){var v=T.pop();if(v!==a){var m=v.def,g=v.idx,A=v.ruleStack,_=v.occurrenceStack;if(!(0,u.default)(m)){var O=m[0];if(O===i){var N={idx:g,def:(0,l.default)(m),ruleStack:(0,c.default)(A),occurrenceStack:(0,c.default)(_)};T.push(N)}else if(O instanceof E.Terminal)if(g<p-1){var I=g+1;r(t[I],O.terminalType)&&(N={idx:I,def:(0,l.default)(m),ruleStack:A,occurrenceStack:_},T.push(N))}else{if(g!==p-1)throw Error("non exhaustive match");y.push({nextTokenType:O.terminalType,nextTokenOccurrence:O.idx,ruleStack:A,occurrenceStack:_}),s=!0}else if(O instanceof E.NonTerminal){var R=(0,d.default)(A);R.push(O.nonTerminalName);var S=(0,d.default)(_);S.push(O.idx),N={idx:g,def:O.definition.concat(o,(0,l.default)(m)),ruleStack:R,occurrenceStack:S},T.push(N)}else if(O instanceof E.Option){var C={idx:g,def:(0,l.default)(m),ruleStack:A,occurrenceStack:_};T.push(C),T.push(a);var x={idx:g,def:O.definition.concat((0,l.default)(m)),ruleStack:A,occurrenceStack:_};T.push(x)}else if(O instanceof E.RepetitionMandatory){var P=new E.Repetition({definition:O.definition,idx:O.idx});N={idx:g,def:O.definition.concat([P],(0,l.default)(m)),ruleStack:A,occurrenceStack:_},T.push(N)}else if(O instanceof E.RepetitionMandatoryWithSeparator){var b=new E.Terminal({terminalType:O.separator});P=new E.Repetition({definition:[b].concat(O.definition),idx:O.idx}),N={idx:g,def:O.definition.concat([P],(0,l.default)(m)),ruleStack:A,occurrenceStack:_},T.push(N)}else if(O instanceof E.RepetitionWithSeparator){C={idx:g,def:(0,l.default)(m),ruleStack:A,occurrenceStack:_},T.push(C),T.push(a),b=new E.Terminal({terminalType:O.separator});var k=new E.Repetition({definition:[b].concat(O.definition),idx:O.idx});x={idx:g,def:O.definition.concat([k],(0,l.default)(m)),ruleStack:A,occurrenceStack:_},T.push(x)}else if(O instanceof E.Repetition)C={idx:g,def:(0,l.default)(m),ruleStack:A,occurrenceStack:_},T.push(C),T.push(a),k=new E.Repetition({definition:O.definition,idx:O.idx}),x={idx:g,def:O.definition.concat([k],(0,l.default)(m)),ruleStack:A,occurrenceStack:_},T.push(x);else if(O instanceof E.Alternation)for(var M=O.definition.length-1;M>=0;M--){var F={idx:g,def:O.definition[M].definition.concat((0,l.default)(m)),ruleStack:A,occurrenceStack:_};T.push(F),T.push(a)}else if(O instanceof E.Alternative)T.push({idx:g,def:O.definition.concat((0,l.default)(m)),ruleStack:A,occurrenceStack:_});else{if(!(O instanceof E.Rule))throw Error("non exhaustive match");T.push(L(O,g,A,_))}}}else s&&(0,f.default)(T).idx<=h&&T.pop()}return y}},4858:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKeyForAutomaticLookahead=t.AT_LEAST_ONE_SEP_IDX=t.MANY_SEP_IDX=t.AT_LEAST_ONE_IDX=t.MANY_IDX=t.OPTION_IDX=t.OR_IDX=t.BITS_FOR_ALT_IDX=t.BITS_FOR_RULE_IDX=t.BITS_FOR_OCCURRENCE_IDX=t.BITS_FOR_METHOD_TYPE=void 0,t.BITS_FOR_METHOD_TYPE=4,t.BITS_FOR_OCCURRENCE_IDX=8,t.BITS_FOR_RULE_IDX=12,t.BITS_FOR_ALT_IDX=8,t.OR_IDX=1<<t.BITS_FOR_OCCURRENCE_IDX,t.OPTION_IDX=2<<t.BITS_FOR_OCCURRENCE_IDX,t.MANY_IDX=3<<t.BITS_FOR_OCCURRENCE_IDX,t.AT_LEAST_ONE_IDX=4<<t.BITS_FOR_OCCURRENCE_IDX,t.MANY_SEP_IDX=5<<t.BITS_FOR_OCCURRENCE_IDX,t.AT_LEAST_ONE_SEP_IDX=6<<t.BITS_FOR_OCCURRENCE_IDX,t.getKeyForAutomaticLookahead=function(e,t,r){return r|t|e},t.BITS_FOR_ALT_IDX},7698:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LLkLookaheadStrategy=void 0;var o=i(r(9394)),a=i(r(2496)),s=r(6311),u=r(4249),c=r(1935),l=r(8132),f=function(){function e(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:u.DEFAULT_PARSER_CONFIG.maxLookahead}return e.prototype.validate=function(e){var t=this.validateNoLeftRecursion(e.rules);if((0,a.default)(t)){var r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return n(n(n(n([],t,!0),r,!0),i,!0),o,!0)}return t},e.prototype.validateNoLeftRecursion=function(e){return(0,o.default)(e,(function(e){return(0,c.validateNoLeftRecursion)(e,e,s.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateEmptyOrAlternatives=function(e){return(0,o.default)(e,(function(e){return(0,c.validateEmptyOrAlternative)(e,s.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateAmbiguousAlternationAlternatives=function(e,t){return(0,o.default)(e,(function(e){return(0,c.validateAmbiguousAlternationAlternatives)(e,t,s.defaultGrammarValidatorErrorProvider)}))},e.prototype.validateSomeNonEmptyLookaheadPath=function(e,t){return(0,c.validateSomeNonEmptyLookaheadPath)(e,t,s.defaultGrammarValidatorErrorProvider)},e.prototype.buildLookaheadForAlternation=function(e){return(0,l.buildLookaheadFuncForOr)(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,l.buildAlternativesLookAheadFunc)},e.prototype.buildLookaheadForOptional=function(e){return(0,l.buildLookaheadFuncForOptionalProd)(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,(0,l.getProdType)(e.prodType),l.buildSingleAlternativeLookaheadFunction)},e}();t.LLkLookaheadStrategy=f},8132:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.areTokenCategoriesNotUsed=t.isStrictPrefixOfPath=t.containsPath=t.getLookaheadPathsForOptionalProd=t.getLookaheadPathsForOr=t.lookAheadSequenceFromAlternatives=t.buildSingleAlternativeLookaheadFunction=t.buildAlternativesLookAheadFunc=t.buildLookaheadFuncForOptionalProd=t.buildLookaheadFuncForOr=t.getLookaheadPaths=t.getProdType=t.PROD_TYPE=void 0;var a,s=o(r(2496)),u=o(r(3187)),c=o(r(6906)),l=o(r(9075)),f=o(r(5491)),p=o(r(1893)),d=o(r(2167)),h=r(2010),E=r(2576),y=r(38),T=r(5262),v=r(5262);function m(e){if(e instanceof T.Option||"Option"===e)return a.OPTION;if(e instanceof T.Repetition||"Repetition"===e)return a.REPETITION;if(e instanceof T.RepetitionMandatory||"RepetitionMandatory"===e)return a.REPETITION_MANDATORY;if(e instanceof T.RepetitionMandatoryWithSeparator||"RepetitionMandatoryWithSeparator"===e)return a.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof T.RepetitionWithSeparator||"RepetitionWithSeparator"===e)return a.REPETITION_WITH_SEPARATOR;if(e instanceof T.Alternation||"Alternation"===e)return a.ALTERNATION;throw Error("non exhaustive match")}!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"}(a=t.PROD_TYPE||(t.PROD_TYPE={})),t.getProdType=m,t.getLookaheadPaths=function(e){var t=e.occurrence,r=e.rule,n=e.prodType,i=e.maxLookahead,o=m(n);return o===a.ALTERNATION?I(t,r,i):R(t,r,o,i)},t.buildLookaheadFuncForOr=function(e,t,r,n,i,o){var a=I(e,t,r);return o(a,n,C(a)?y.tokenStructuredMatcherNoCategories:y.tokenStructuredMatcher,i)},t.buildLookaheadFuncForOptionalProd=function(e,t,r,n,i,o){var a=R(e,t,i,r),s=C(a)?y.tokenStructuredMatcherNoCategories:y.tokenStructuredMatcher;return o(a[0],s,n)},t.buildAlternativesLookAheadFunc=function(e,t,r,n){var i=e.length,o=(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var n=(0,l.default)(t,(function(e){return e.GATE})),o=0;o<i;o++){var a=e[o],s=a.length,u=n[o];if(void 0===u||!1!==u.call(this))e:for(var c=0;c<s;c++){for(var f=a[c],p=f.length,d=0;d<p;d++){var h=this.LA(d+1);if(!1===r(h,f[d]))continue e}return o}}};if(o&&!n){var a=(0,l.default)(e,(function(e){return(0,u.default)(e)})),s=(0,d.default)(a,(function(e,t,r){return(0,f.default)(t,(function(t){(0,p.default)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),(0,f.default)(t.categoryMatches,(function(t){(0,p.default)(e,t)||(e[t]=r)}))})),e}),{});return function(){var e=this.LA(1);return s[e.tokenTypeIdx]}}return function(){for(var t=0;t<i;t++){var n=e[t],o=n.length;e:for(var a=0;a<o;a++){for(var s=n[a],u=s.length,c=0;c<u;c++){var l=this.LA(c+1);if(!1===r(l,s[c]))continue e}return t}}}},t.buildSingleAlternativeLookaheadFunction=function(e,t,r){var n=(0,c.default)(e,(function(e){return 1===e.length})),i=e.length;if(n&&!r){var o=(0,u.default)(e);if(1===o.length&&(0,s.default)(o[0].categoryMatches)){var a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}var l=(0,d.default)(o,(function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,f.default)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===l[e.tokenTypeIdx]}}return function(){e:for(var r=0;r<i;r++){for(var n=e[r],o=n.length,a=0;a<o;a++){var s=this.LA(a+1);if(!1===t(s,n[a]))continue e}return!0}return!1}};var g=function(e){function t(t,r,n){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=r,i.targetProdType=n,i}return i(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(n),!0)},t.prototype.walkOption=function(t,r,n){this.checkIsTarget(t,a.OPTION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOne=function(t,r,n){this.checkIsTarget(t,a.REPETITION_MANDATORY,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOneSep=function(t,r,n){this.checkIsTarget(t,a.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkMany=function(t,r,n){this.checkIsTarget(t,a.REPETITION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkManySep=function(t,r,n){this.checkIsTarget(t,a.REPETITION_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t}(E.RestWalker),A=function(e){function t(t,r,n){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=r,i.targetRef=n,i.result=[],i}return i(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,a.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,a.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,a.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,a.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,a.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,a.ALTERNATION)},t}(v.GAstVisitor);function _(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}function L(e){for(var t=[""],r=0;r<e.length;r++){for(var n=e[r],i=[],o=0;o<t.length;o++){var a=t[o];i.push(a+"_"+n.tokenTypeIdx);for(var s=0;s<n.categoryMatches.length;s++){var u="_"+n.categoryMatches[s];i.push(a+u)}}t=i}return t}function O(e,t,r){for(var n=0;n<e.length;n++)if(n!==r)for(var i=e[n],o=0;o<t.length;o++)if(!0===i[t[o]])return!1;return!0}function N(e,t){for(var r=(0,l.default)(e,(function(e){return(0,h.possiblePathsFrom)([e],1)})),n=_(r.length),i=(0,l.default)(r,(function(e){var t={};return(0,f.default)(e,(function(e){var r=L(e.partialPath);(0,f.default)(r,(function(e){t[e]=!0}))})),t})),o=r,a=1;a<=t;a++){var u=o;o=_(u.length);for(var c=function(e){for(var r=u[e],c=0;c<r.length;c++){var l=r[c].partialPath,p=r[c].suffixDef,d=L(l);if(O(i,d,e)||(0,s.default)(p)||l.length===t){var E=n[e];if(!1===S(E,l)){E.push(l);for(var y=0;y<d.length;y++){var T=d[y];i[e][T]=!0}}}else{var v=(0,h.possiblePathsFrom)(p,a+1,l);o[e]=o[e].concat(v),(0,f.default)(v,(function(t){var r=L(t.partialPath);(0,f.default)(r,(function(t){i[e][t]=!0}))}))}}},p=0;p<u.length;p++)c(p)}return n}function I(e,t,r,n){var i=new A(e,a.ALTERNATION,n);return t.accept(i),N(i.result,r)}function R(e,t,r,n){var i=new A(e,r);t.accept(i);var o=i.result,a=new g(t,e,r).startWalking();return N([new T.Alternative({definition:o}),new T.Alternative({definition:a})],n)}function S(e,t){e:for(var r=0;r<e.length;r++){var n=e[r];if(n.length===t.length){for(var i=0;i<n.length;i++){var o=t[i],a=n[i];if(!1==(o===a||void 0!==a.categoryMatchesMap[o.tokenTypeIdx]))continue e}return!0}}return!1}function C(e){return(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return(0,c.default)(e,(function(e){return(0,s.default)(e.categoryMatches)}))}))}))}t.lookAheadSequenceFromAlternatives=N,t.getLookaheadPathsForOr=I,t.getLookaheadPathsForOptionalProd=R,t.containsPath=S,t.isStrictPrefixOfPath=function(e,t){return e.length<t.length&&(0,c.default)(e,(function(e,r){var n=t[r];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}))},t.areTokenCategoriesNotUsed=C},4660:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GastRefResolverVisitor=t.resolveGrammar=void 0;var a=r(4249),s=o(r(5491)),u=o(r(4071)),c=r(5262);t.resolveGrammar=function(e,t){var r=new l(e,t);return r.resolveRefs(),r.errors};var l=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return i(t,e),t.prototype.resolveRefs=function(){var e=this;(0,s.default)((0,u.default)(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 r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:a.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(c.GAstVisitor);t.GastRefResolverVisitor=l},2576:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RestWalker=void 0;var i=n(r(6388)),o=n(r(5491)),a=r(5262),s=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,o.default)(e.definition,(function(n,o){var s=(0,i.default)(e.definition,o+1);if(n instanceof a.NonTerminal)r.walkProdRef(n,s,t);else if(n instanceof a.Terminal)r.walkTerminal(n,s,t);else if(n instanceof a.Alternative)r.walkFlat(n,s,t);else if(n instanceof a.Option)r.walkOption(n,s,t);else if(n instanceof a.RepetitionMandatory)r.walkAtLeastOne(n,s,t);else if(n instanceof a.RepetitionMandatoryWithSeparator)r.walkAtLeastOneSep(n,s,t);else if(n instanceof a.RepetitionWithSeparator)r.walkManySep(n,s,t);else if(n instanceof a.Repetition)r.walkMany(n,s,t);else{if(!(n instanceof a.Alternation))throw Error("non exhaustive match");r.walkOr(n,s,t)}}))},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkOption=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkAtLeastOne=function(e,t,r){var n=[new a.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkAtLeastOneSep=function(e,t,r){var n=u(e,t,r);this.walk(e,n)},e.prototype.walkMany=function(e,t,r){var n=[new a.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkManySep=function(e,t,r){var n=u(e,t,r);this.walk(e,n)},e.prototype.walkOr=function(e,t,r){var n=this,i=t.concat(r);(0,o.default)(e.definition,(function(e){var t=new a.Alternative({definition:[e]});n.walk(t,i)}))},e}();function u(e,t,r){return[new a.Option({definition:[new a.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}t.RestWalker=s},4249:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedActionsParser=t.CstParser=t.Parser=t.EMPTY_ALT=t.ParserDefinitionErrorType=t.DEFAULT_RULE_CONFIG=t.DEFAULT_PARSER_CONFIG=t.END_OF_FILE=void 0;var a,s=o(r(2496)),u=o(r(9075)),c=o(r(5491)),l=o(r(4071)),f=o(r(1893)),p=o(r(6860)),d=r(7736),h=r(4315),E=r(8516),y=r(6311),T=r(3798),v=r(4003),m=r(2919),g=r(6198),A=r(7966),_=r(9095),L=r(109),O=r(9873),N=r(6249),I=r(5966),R=r(4989),S=r(8095),C=r(1935);t.END_OF_FILE=(0,E.createTokenInstance)(E.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(t.END_OF_FILE),t.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:y.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!0}),t.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(a=t.ParserDefinitionErrorType||(t.ParserDefinitionErrorType={}))[a.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",a[a.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",a[a.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",a[a.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",a[a.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",a[a.LEFT_RECURSION=5]="LEFT_RECURSION",a[a.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",a[a.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",a[a.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",a[a.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",a[a.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",a[a.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",a[a.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",a[a.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION",t.EMPTY_ALT=function(e){return void 0===e&&(e=void 0),function(){return e}};var x=function(){function e(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),(0,f.default)(r,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> 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,f.default)(r,"skipValidations")?r.skipValidations:t.DEFAULT_PARSER_CONFIG.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 r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){(0,d.toFastProperties)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,c.default)(t.definedRulesNames,(function(e){var r,n=t[e].originalGrammarAction;t.TRACE_INIT("".concat(e," Rule"),(function(){r=t.topLevelRuleRecord(e,n)})),t.gastProductionsCache[e]=r}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=(0,T.resolveGrammar)({rules:(0,l.default)(t.gastProductionsCache)}),t.definitionErrors=t.definitionErrors.concat(i)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,s.default)(i)&&!1===t.skipValidations){var e=(0,T.validateGrammar)({rules:(0,l.default)(t.gastProductionsCache),tokenTypes:(0,l.default)(t.tokensMap),errMsgProvider:y.defaultGrammarValidatorErrorProvider,grammarName:n}),r=(0,C.validateLookahead)({lookaheadStrategy:t.lookaheadStrategy,rules:(0,l.default)(t.gastProductionsCache),tokenTypes:(0,l.default)(t.tokensMap),grammarName:n});t.definitionErrors=t.definitionErrors.concat(e,r)}})),(0,s.default)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=(0,h.computeAllProdsFollows)((0,l.default)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){var e,r;null===(r=(e=t.lookaheadStrategy).initialize)||void 0===r||r.call(e,{rules:(0,l.default)(t.gastProductionsCache)}),t.preComputeLookaheadFunctions((0,l.default)(t.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,s.default)(t.definitionErrors))throw r=(0,u.default)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n ".concat(r.join("\n-------------------------------\n")))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();t.Parser=x,(0,S.applyMixins)(x,[v.Recoverable,m.LooksAhead,g.TreeBuilder,A.LexerAdapter,L.RecognizerEngine,_.RecognizerApi,O.ErrorHandler,N.ContentAssist,I.GastRecorder,R.PerformanceTracer]);var P=function(e){function r(r,n){void 0===n&&(n=t.DEFAULT_PARSER_CONFIG);var i=(0,p.default)(n);return i.outputCst=!0,e.call(this,r,i)||this}return i(r,e),r}(x);t.CstParser=P;var b=function(e){function r(r,n){void 0===n&&(n=t.DEFAULT_PARSER_CONFIG);var i=(0,p.default)(n);return i.outputCst=!1,e.call(this,r,i)||this}return i(r,e),r}(x);t.EmbeddedActionsParser=b},6249:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentAssist=void 0;var i=r(2010),o=n(r(8892)),a=n(r(2189)),s=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,a.default)(r))throw Error("Rule ->".concat(e,"<- does not exist in this grammar."));return(0,i.nextPossibleTokensAfter)([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,o.default)(e.ruleStack),r=this.getGAstProductions()[t];return new i.NextAfterTokenWalker(r,e).startWalking()},e}();t.ContentAssist=s},9873:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorHandler=void 0;var i=r(9996),o=n(r(1893)),a=n(r(6860)),s=r(8132),u=r(4249),c=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,o.default)(e,"errorMessageProvider")?e.errorMessageProvider:u.DEFAULT_PARSER_CONFIG.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if((0,i.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,a.default)(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,a.default)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var n=this.getCurrRuleFullName(),o=this.getGAstProductions()[n],a=(0,s.getLookaheadPathsForOptionalProd)(e,o,t,this.maxLookahead)[0],u=[],c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new i.EarlyExitException(l,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],o=(0,s.getLookaheadPathsForOr)(e,n,this.maxLookahead),a=[],u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));var c=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:a,previous:c,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new i.NoViableAltException(l,this.LA(1),c))},e}();t.ErrorHandler=c},5966:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GastRecorder=void 0;var i=n(r(8513)),o=n(r(788)),a=n(r(5797)),s=n(r(5491)),u=n(r(8957)),c=n(r(1893)),l=r(5262),f=r(3734),p=r(38),d=r(8516),h=r(4249),E=r(4858),y={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(y);var T=Math.pow(2,E.BITS_FOR_OCCURRENCE_IDX)-1,v=(0,d.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:f.Lexer.NA});(0,p.augmentTokenTypes)([v]);var m=(0,d.createTokenInstance)(v,"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(m);var g={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},A=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 r=t>0?t:"";e["CONSUME".concat(r)]=function(e,r){return this.consumeInternalRecord(e,t,r)},e["SUBRULE".concat(r)]=function(e,r){return this.subruleInternalRecord(e,t,r)},e["OPTION".concat(r)]=function(e){return this.optionInternalRecord(e,t)},e["OR".concat(r)]=function(e){return this.orInternalRecord(e,t)},e["MANY".concat(r)]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP".concat(r)]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE".concat(r)]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP".concat(r)]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},r=0;r<10;r++)t(r);e.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},e.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},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=e,r=0;r<10;r++){var n=r>0?r:"";delete t["CONSUME".concat(n)],delete t["SUBRULE".concat(n)],delete t["OPTION".concat(n)],delete t["OR".concat(n)],delete t["MANY".concat(n)],delete t["MANY_SEP".concat(n)],delete t["AT_LEAST_ONE".concat(n)],delete t["AT_LEAST_ONE_SEP".concat(n)]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.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 h.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new l.Rule({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.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(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return _.call(this,l.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){_.call(this,l.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){_.call(this,l.RepetitionMandatoryWithSeparator,t,e,!0)},e.prototype.manyInternalRecord=function(e,t){_.call(this,l.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){_.call(this,l.RepetitionWithSeparator,t,e,!0)},e.prototype.orInternalRecord=function(e,t){return L.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(N(t),!e||!1===(0,c.default)(e,"ruleName")){var n=new Error("<SUBRULE".concat(O(t),"> argument is invalid")+" expecting a Parser method reference but got: <".concat(JSON.stringify(e),">")+"\n inside top level rule: <".concat(this.recordingProdStack[0].name,">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var o=(0,i.default)(this.recordingProdStack),a=e.ruleName,s=new l.NonTerminal({idx:t,nonTerminalName:a,label:null==r?void 0:r.LABEL,referencedRule:void 0});return o.definition.push(s),this.outputCst?g:y},e.prototype.consumeInternalRecord=function(e,t,r){if(N(t),!(0,p.hasShortKeyProperty)(e)){var n=new Error("<CONSUME".concat(O(t),"> argument is invalid")+" expecting a TokenType reference but got: <".concat(JSON.stringify(e),">")+"\n inside top level rule: <".concat(this.recordingProdStack[0].name,">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var o=(0,i.default)(this.recordingProdStack),a=new l.Terminal({idx:t,terminalType:e,label:null==r?void 0:r.LABEL});return o.definition.push(a),m},e}();function _(e,t,r,n){void 0===n&&(n=!1),N(r);var o=(0,i.default)(this.recordingProdStack),a=(0,u.default)(t)?t:t.DEF,s=new e({definition:[],idx:r});return n&&(s.separator=t.SEP),(0,c.default)(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),o.definition.push(s),this.recordingProdStack.pop(),y}function L(e,t){var r=this;N(t);var n=(0,i.default)(this.recordingProdStack),f=!1===(0,o.default)(e),p=!1===f?e:e.DEF,d=new l.Alternation({definition:[],idx:t,ignoreAmbiguities:f&&!0===e.IGNORE_AMBIGUITIES});(0,c.default)(e,"MAX_LOOKAHEAD")&&(d.maxLookahead=e.MAX_LOOKAHEAD);var h=(0,a.default)(p,(function(e){return(0,u.default)(e.GATE)}));return d.hasPredicates=h,n.definition.push(d),(0,s.default)(p,(function(e){var t=new l.Alternative({definition:[]});d.definition.push(t),(0,c.default)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,c.default)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),y}function O(e){return 0===e?"":"".concat(e)}function N(e){if(e<0||e>T){var t=new Error("Invalid DSL Method idx value: <".concat(e,">\n\t")+"Idx value must be a none negative value smaller than ".concat(T+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}t.GastRecorder=A},7966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LexerAdapter=void 0;var n=r(4249),i=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 <performSelfAnalysis> 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)):n.END_OF_FILE},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?n.END_OF_FILE: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}();t.LexerAdapter=i},2919:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.collectMethods=t.LooksAhead=void 0;var a=o(r(5491)),s=o(r(1893)),u=r(4249),c=r(4858),l=r(5262),f=r(5262),p=r(7698),d=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,s.default)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:u.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,s.default)(e,"maxLookahead")?e.maxLookahead:u.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookaheadStrategy=(0,s.default)(e,"lookaheadStrategy")?e.lookaheadStrategy:new p.LLkLookaheadStrategy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,a.default)(e,(function(e){t.TRACE_INIT("".concat(e.name," Rule Lookahead"),(function(){var r=y(e),n=r.alternation,i=r.repetition,o=r.option,s=r.repetitionMandatory,u=r.repetitionMandatoryWithSeparator,l=r.repetitionWithSeparator;(0,a.default)(n,(function(r){var n=0===r.idx?"":r.idx;t.TRACE_INIT("".concat((0,f.getProductionDslName)(r)).concat(n),(function(){var n=t.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:r.idx,rule:e,maxLookahead:r.maxLookahead||t.maxLookahead,hasPredicates:r.hasPredicates,dynamicTokensEnabled:t.dynamicTokensEnabled}),i=(0,c.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[e.name],c.OR_IDX,r.idx);t.setLaFuncCache(i,n)}))})),(0,a.default)(i,(function(r){t.computeLookaheadFunc(e,r.idx,c.MANY_IDX,"Repetition",r.maxLookahead,(0,f.getProductionDslName)(r))})),(0,a.default)(o,(function(r){t.computeLookaheadFunc(e,r.idx,c.OPTION_IDX,"Option",r.maxLookahead,(0,f.getProductionDslName)(r))})),(0,a.default)(s,(function(r){t.computeLookaheadFunc(e,r.idx,c.AT_LEAST_ONE_IDX,"RepetitionMandatory",r.maxLookahead,(0,f.getProductionDslName)(r))})),(0,a.default)(u,(function(r){t.computeLookaheadFunc(e,r.idx,c.AT_LEAST_ONE_SEP_IDX,"RepetitionMandatoryWithSeparator",r.maxLookahead,(0,f.getProductionDslName)(r))})),(0,a.default)(l,(function(r){t.computeLookaheadFunc(e,r.idx,c.MANY_SEP_IDX,"RepetitionWithSeparator",r.maxLookahead,(0,f.getProductionDslName)(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,n,i,o){var a=this;this.TRACE_INIT("".concat(o).concat(0===t?"":t),(function(){var o=a.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||a.maxLookahead,dynamicTokensEnabled:a.dynamicTokensEnabled,prodType:n}),s=(0,c.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],r,t);a.setLaFuncCache(s,o)}))},e.prototype.getKeyForAutomaticLookahead=function(e,t){var r=this.getLastExplicitRuleShortName();return(0,c.getKeyForAutomaticLookahead)(r,e,t)},e.prototype.getLaFuncFromCache=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.setLaFuncCache=function(e,t){this.lookAheadFuncsCache.set(e,t)},e}();t.LooksAhead=d;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return i(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},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}(l.GAstVisitor),E=new h;function y(e){E.reset(),e.accept(E);var t=E.dslMethods;return E.reset(),t}t.collectMethods=y},4989:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PerformanceTracer=void 0;var i=n(r(1893)),o=r(7736),a=r(4249),s=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,i.default)(e,"traceInitPerf")){var t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=a.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log("".concat(r,"--\x3e <").concat(e,">"));var n=(0,o.timer)(t),i=n.time,a=n.value,s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s("".concat(r,"<-- <").concat(e,"> time: ").concat(i,"ms")),this.traceInitIndent--,a}return t()},e}();t.PerformanceTracer=s},9095:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerApi=void 0;var i=n(r(4071)),o=n(r(8416)),a=r(9996),s=r(4249),u=r(6311),c=r(1935),l=r(5262),f=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,r){return this.consumeInternal(t,e,r)},e.prototype.subrule=function(e,t,r){return this.subruleInternal(t,e,r)},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,r){if(void 0===r&&(r=s.DEFAULT_RULE_CONFIG),(0,o.default)(this.definedRulesNames,e)){var n={message:u.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(n)}this.definedRulesNames.push(e);var i=this.defineRule(e,t,r);return this[e]=i,i},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=s.DEFAULT_RULE_CONFIG);var n=(0,c.validateRuleIsOverridden)(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);var i=this.defineRule(e,t,r);return this[e]=i,i},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if((0,a.isRecognitionException)(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return(0,l.serializeGrammar)((0,i.default)(this.gastProductionsCache))},e}();t.RecognizerApi=f},109:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerEngine=void 0;var i=n(r(2496)),o=n(r(788)),a=n(r(3187)),s=n(r(6906)),u=n(r(2256)),c=n(r(2478)),l=n(r(1893)),f=n(r(4071)),p=n(r(2167)),d=n(r(6860)),h=r(4858),E=r(9996),y=r(8132),T=r(2010),v=r(4249),m=r(4003),g=r(8516),A=r(38),_=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=A.tokenStructuredMatcherNoCategories,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,l.default)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,o.default)(e)){if((0,i.default)(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,o.default)(e))this.tokensMap=(0,p.default)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,l.default)(e,"modes")&&(0,s.default)((0,a.default)((0,f.default)(e.modes)),A.isTokenType)){var r=(0,a.default)((0,f.default)(e.modes)),n=(0,u.default)(r);this.tokensMap=(0,p.default)(n,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,c.default)(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,d.default)(e)}this.tokensMap.EOF=g.EOF;var h=(0,l.default)(e,"modes")?(0,a.default)((0,f.default)(e.modes)):(0,f.default)(e),E=(0,s.default)(h,(function(e){return(0,i.default)(e.categoryMatches)}));this.tokenMatcher=E?A.tokenStructuredMatcherNoCategories:A.tokenStructuredMatcher,(0,A.augmentTokenTypes)((0,f.default)(this.tokensMap))},e.prototype.defineRule=function(e,t,r){if(this.selfAnalysisDone)throw Error("Grammar rule <".concat(e,"> may not be defined after the 'performSelfAnalysis' method has been called'\n")+"Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var n,i=(0,l.default)(r,"resyncEnabled")?r.resyncEnabled:v.DEFAULT_RULE_CONFIG.resyncEnabled,o=(0,l.default)(r,"recoveryValueFunc")?r.recoveryValueFunc:v.DEFAULT_RULE_CONFIG.recoveryValueFunc,a=this.ruleShortNameIdx<<h.BITS_FOR_METHOD_TYPE+h.BITS_FOR_OCCURRENCE_IDX;return this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,n=!0===this.outputCst?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r);var s=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(s),s}catch(e){return this.invokeRuleCatch(e,i,o)}finally{this.ruleFinallyStateUpdate()}}:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,r)}catch(e){return this.invokeRuleCatch(e,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(n,{ruleName:e,originalGrammarAction:t})},e.prototype.invokeRuleCatch=function(e,t,r){var n=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,E.isRecognitionException)(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):r(e);throw this.outputCst&&((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,o.partialCstResult=a),o}if(n)return this.moveToTerminatedState(),r(e);throw o}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(h.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var n,i=this,o=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;var a=e.GATE;if(void 0!==a){var s=o;o=function(){return a.call(i)&&s.call(i)}}}else n=e;if(!0===o.call(this))return n.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(h.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var n,i=this,o=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;var a=t.GATE;if(void 0!==a){var s=o;o=function(){return a.call(i)&&s.call(i)}}}else n=t;if(!0!==o.call(this))throw this.raiseEarlyExitException(e,y.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);for(var u=this.doSingleRepetition(n);!0===o.call(this)&&!0===u;)u=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],o,h.AT_LEAST_ONE_IDX,e,T.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(h.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var n=this,i=t.DEF,o=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,y.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);i.call(this);for(var a=function(){return n.tokenMatcher(n.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,T.NextTerminalAfterAtLeastOneSepWalker],a,h.AT_LEAST_ONE_SEP_IDX,e,T.NextTerminalAfterAtLeastOneSepWalker)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(h.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var n,i=this,o=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;var a=t.GATE;if(void 0!==a){var s=o;o=function(){return a.call(i)&&s.call(i)}}}else n=t;for(var u=!0;!0===o.call(this)&&!0===u;)u=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],o,h.MANY_IDX,e,T.NextTerminalAfterManyWalker,u)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(h.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var n=this,i=t.DEF,o=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){i.call(this);for(var a=function(){return n.tokenMatcher(n.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,T.NextTerminalAfterManySepWalker],a,h.MANY_SEP_IDX,e,T.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,n,i){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,i],r,h.AT_LEAST_ONE_SEP_IDX,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 r=this.getKeyForAutomaticLookahead(h.OR_IDX,t),n=(0,o.default)(e)?e:e.DEF,i=this.getLaFuncFromCache(r).call(this,n);if(void 0!==i)return n[i].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 E.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var i=void 0!==r?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,i),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){throw this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw(0,E.isRecognitionException)(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,r){var n;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),n=i):this.consumeInternalError(e,i,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,i=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new E.MismatchedTokenException(n,t,i))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===m.IN_RULE_RECOVERY_EXCEPTION?r:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,d.default)(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,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)},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),g.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}();t.RecognizerEngine=_},4003:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.attemptInRepetitionRecovery=t.Recoverable=t.InRuleRecoveryException=t.IN_RULE_RECOVERY_EXCEPTION=t.EOF_FOLLOW_KEY=void 0;var a=r(8516),s=o(r(2496)),u=o(r(1104)),c=o(r(3187)),l=o(r(9075)),f=o(r(3454)),p=o(r(1893)),d=o(r(8416)),h=o(r(6860)),E=r(9996),y=r(3147),T=r(4249);t.EOF_FOLLOW_KEY={},t.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";var v=function(e){function r(r){var n=e.call(this,r)||this;return n.name=t.IN_RULE_RECOVERY_EXCEPTION,n}return i(r,e),r}(Error);t.InRuleRecoveryException=v;var m=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,p.default)(e,"recoveryEnabled")?e.recoveryEnabled:T.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=g)},e.prototype.getTokenToInsert=function(e){var t=(0,a.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.canTokenTypeBeDeletedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,r,n){for(var i=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),s=[],c=!1,l=this.LA(1),f=this.LA(1),p=function(){var e=i.LA(0),t=i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:l,previous:e,ruleName:i.getCurrRuleFullName()}),r=new E.MismatchedTokenException(t,l,i.LA(0));r.resyncedTokens=(0,u.default)(s),i.SAVE_ERROR(r)};!c;){if(this.tokenMatcher(f,n))return void p();if(r.call(this))return p(),void e.apply(this,t);this.tokenMatcher(f,o)?c=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,s))}this.importLexerState(a)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,r){return!1!==r&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new v("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,s.default)(t))return!1;var n=this.LA(1);return void 0!==(0,f.default)(t,(function(e){return r.tokenMatcher(n,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return(0,d.default)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=(0,f.default)(e,(function(e){return(0,a.tokenMatcher)(t,e)}));if(void 0!==n)return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return t.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,r=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,l.default)(r,(function(i,o){return 0===o?t.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(i),idxInCallingRule:n[o],inRule:e.shortRuleNameToFullName(r[o-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,l.default)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,c.default)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===t.EOF_FOLLOW_KEY)return[a.EOF];var r=e.ruleName+e.idxInCallingRule+y.IN+e.inRule;return this.resyncFollows[r]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,a.EOF)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return(0,u.default)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,i,o,a){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,h.default)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,l.default)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)}))},e}();function g(e,t,r,n,i,o,s){var u=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[u];if(void 0===c){var l=this.getCurrRuleFullName();c=new o(this.getGAstProductions()[l],i).startWalking(),this.firstAfterRepMap[u]=c}var f=c.token,p=c.occurrence,d=c.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===f&&(f=a.EOF,p=1),void 0!==f&&void 0!==p&&this.shouldInRepetitionRecoveryBeTried(f,p,s)&&this.tryInRepetitionRecovery(e,t,r,f)}t.Recoverable=m,t.attemptInRepetitionRecovery=g},6198:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TreeBuilder=void 0;var i=r(8985),o=n(r(7729)),a=n(r(1893)),s=n(r(8465)),u=n(r(2189)),c=r(9960),l=r(4249),f=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,a.default)(e,"nodeLocationTracking")?e.nodeLocationTracking:l.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=i.setNodeLocationFull,this.setNodeLocationFromNode=i.setNodeLocationFull,this.cstPostRule=o.default,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=o.default,this.setNodeLocationFromNode=o.default,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=i.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=i.setNodeLocationOnlyOffset,this.cstPostRule=o.default,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=o.default,this.setNodeLocationFromNode=o.default,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'.concat(e.nodeLocationTracking,'"'));this.setNodeLocationFromToken=o.default,this.setNodeLocationFromNode=o.default,this.cstPostRule=o.default,this.setInitialNodeLocation=o.default}else this.cstInvocationStateUpdate=o.default,this.cstFinallyStateUpdate=o.default,this.cstPostTerminal=o.default,this.cstPostNonTerminal=o.default,this.cstPostRule=o.default},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){var t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==1?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==1?r.endOffset=t.endOffset:r.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];(0,i.addTerminalToCst)(r,t,e),this.setNodeLocationFromToken(r.location,t)},e.prototype.cstPostNonTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];(0,i.addNoneTerminalToCst)(r,t,e),this.setNodeLocationFromNode(r.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if((0,u.default)(this.baseCstVisitorConstructor)){var e=(0,c.createBaseSemanticVisitorConstructor)(this.className,(0,s.default)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,u.default)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,c.createBaseVisitorConstructorWithDefaults)(this.className,(0,s.default)(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}();t.TreeBuilder=f},8095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyMixins=void 0,t.applyMixins=function(e,t){t.forEach((function(t){var r=t.prototype;Object.getOwnPropertyNames(r).forEach((function(n){if("constructor"!==n){var i=Object.getOwnPropertyDescriptor(r,n);i&&(i.get||i.set)?Object.defineProperty(e.prototype,n,i):e.prototype[n]=t.prototype[n]}}))}))}},328:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.charCodeToOptimizedIndex=t.minOptimizationVal=t.buildLineBreakIssueMessage=t.LineTerminatorOptimizedTester=t.isShortPattern=t.isCustomPattern=t.cloneEmptyGroups=t.performWarningRuntimeChecks=t.performRuntimeChecks=t.addStickyFlag=t.addStartOfInput=t.findUnreachablePatterns=t.findModesThatDoNotExist=t.findInvalidGroupType=t.findDuplicatePatterns=t.findUnsupportedFlags=t.findStartOfInputAnchor=t.findEmptyMatchRegExps=t.findEndOfInputAnchor=t.findInvalidPatterns=t.findMissingPatterns=t.validatePatterns=t.analyzeTokenTypes=t.enableSticky=t.disableSticky=t.SUPPORT_STICKY=t.MODES=t.DEFAULT_MODE=void 0;var a=r(9852),s=r(3734),u=o(r(8892)),c=o(r(2496)),l=o(r(3956)),f=o(r(788)),p=o(r(4071)),d=o(r(3187)),h=o(r(346)),E=o(r(2986)),y=o(r(5799)),T=o(r(9075)),v=o(r(5491)),m=o(r(3948)),g=o(r(8957)),A=o(r(2189)),_=o(r(3454)),L=o(r(1893)),O=o(r(8465)),N=o(r(3136)),I=o(r(4435)),R=o(r(6139)),S=o(r(2167)),C=o(r(8416)),x=r(7736),P=r(1904),b=r(3864),k="PATTERN";function M(e){var t=(0,I.default)(e,(function(e){return!(0,L.default)(e,k)}));return{errors:(0,T.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:s.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}})),valid:(0,E.default)(e,t)}}function F(e){var t=(0,I.default)(e,(function(e){var t=e[k];return!((0,N.default)(t)||(0,g.default)(t)||(0,L.default)(t,"exec")||(0,m.default)(t))}));return{errors:(0,T.default)(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:s.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}})),valid:(0,E.default)(e,t)}}t.DEFAULT_MODE="defaultMode",t.MODES="modes",t.SUPPORT_STICKY="boolean"==typeof new RegExp("(?:)").sticky,t.disableSticky=function(){t.SUPPORT_STICKY=!1},t.enableSticky=function(){t.SUPPORT_STICKY=!0},t.analyzeTokenTypes=function(e,r){var n,i=(r=(0,R.default)(r,{useSticky:t.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;i("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,c.default)(ee)){ee=new Array(65536);for(var e=0;e<65536;e++)ee[e]=e>255?255+~~(e/255):e}}()})),i("Reject Lexer.NA",(function(){n=(0,h.default)(e,(function(e){return e[k]===s.Lexer.NA}))}));var o,a,u,l,p,d,E,_,O,I,b,M=!1;i("Transform Patterns",(function(){M=!1,o=(0,T.default)(n,(function(e){var t=e[k];if((0,N.default)(t)){var n=t.source;return 1!==n.length||"^"===n||"$"===n||"."===n||t.ignoreCase?2!==n.length||"\\"!==n[0]||(0,C.default)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?r.useSticky?z(t):H(t):n[1]:n}if((0,g.default)(t))return M=!0,{exec:t};if("object"==typeof t)return M=!0,t;if("string"==typeof t){if(1===t.length)return t;var i=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(i);return r.useSticky?z(o):H(o)}throw Error("non exhaustive match")}))})),i("misc mapping",(function(){a=(0,T.default)(n,(function(e){return e.tokenTypeIdx})),u=(0,T.default)(n,(function(e){var t=e.GROUP;if(t!==s.Lexer.SKIPPED){if((0,m.default)(t))return t;if((0,A.default)(t))return!1;throw Error("non exhaustive match")}})),l=(0,T.default)(n,(function(e){var t=e.LONGER_ALT;if(t)return(0,f.default)(t)?(0,T.default)(t,(function(e){return(0,y.default)(n,e)})):[(0,y.default)(n,t)]})),p=(0,T.default)(n,(function(e){return e.PUSH_MODE})),d=(0,T.default)(n,(function(e){return(0,L.default)(e,"POP_MODE")}))})),i("Line Terminator Handling",(function(){var e=Z(r.lineTerminatorCharacters);E=(0,T.default)(n,(function(e){return!1})),"onlyOffset"!==r.positionTracking&&(E=(0,T.default)(n,(function(t){return(0,L.default)(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===q(t,e)&&(0,P.canMatchCharCode)(e,t.PATTERN)})))})),i("Misc Mapping #2",(function(){_=(0,T.default)(n,X),O=(0,T.default)(o,Q),I=(0,S.default)(n,(function(e,t){var r=t.GROUP;return(0,m.default)(r)&&r!==s.Lexer.SKIPPED&&(e[r]=[]),e}),{}),b=(0,T.default)(o,(function(e,t){return{pattern:o[t],longerAlt:l[t],canLineTerminator:E[t],isCustom:_[t],short:O[t],group:u[t],push:p[t],pop:d[t],tokenTypeIdx:a[t],tokenType:n[t]}}))}));var F=!0,U=[];return r.safeMode||i("First Char Optimization",(function(){U=(0,S.default)(n,(function(e,t,n){if("string"==typeof t.PATTERN){var i=te(t.PATTERN.charCodeAt(0));J(e,i,b[n])}else if((0,f.default)(t.START_CHARS_HINT)){var o;(0,v.default)(t.START_CHARS_HINT,(function(t){var r=te("string"==typeof t?t.charCodeAt(0):t);o!==r&&(o=r,J(e,r,b[n]))}))}else if((0,N.default)(t.PATTERN))if(t.PATTERN.unicode)F=!1,r.ensureOptimizations&&(0,x.PRINT_ERROR)("".concat(P.failedOptimizationPrefixMsg)+"\tUnable to analyze < ".concat(t.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 a=(0,P.getOptimizedStartCodesIndices)(t.PATTERN,r.ensureOptimizations);(0,c.default)(a)&&(F=!1),(0,v.default)(a,(function(t){J(e,t,b[n])}))}else r.ensureOptimizations&&(0,x.PRINT_ERROR)("".concat(P.failedOptimizationPrefixMsg)+"\tTokenType: <".concat(t.name,"> is using a custom token pattern without providing <start_chars_hint> 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"),F=!1;return e}),[])})),{emptyGroups:I,patternIdxToConfig:b,charCodeToPatternIdxToConfig:U,hasCustom:M,canBeOptimized:F}},t.validatePatterns=function(e,t){var r=[],n=M(e);r=r.concat(n.errors);var i=F(n.valid),o=i.valid;return(r=(r=(r=(r=r.concat(i.errors)).concat(function(e){var t=[],r=(0,I.default)(e,(function(e){return(0,N.default)(e[k])}));return t=(t=(t=(t=(t=t.concat(D(r))).concat(j(r))).concat(G(r))).concat(W(r))).concat(w(r))}(o))).concat(V(o))).concat(Y(o,t))).concat(K(o))},t.findMissingPatterns=M,t.findInvalidPatterns=F;var U=/[^\\][$]/;function D(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return i(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(a.BaseRegExpVisitor),r=(0,I.default)(e,(function(e){var r=e.PATTERN;try{var n=(0,b.getRegExpAst)(r),i=new t;return i.visit(n),i.found}catch(e){return U.test(r.source)}}));return(0,T.default)(r,(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:s.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function w(e){var t=(0,I.default)(e,(function(e){return e.PATTERN.test("")}));return(0,T.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:s.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}t.findEndOfInputAnchor=D,t.findEmptyMatchRegExps=w;var B=/[^\\[][\^]|^\^/;function j(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return i(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(a.BaseRegExpVisitor),r=(0,I.default)(e,(function(e){var r=e.PATTERN;try{var n=(0,b.getRegExpAst)(r),i=new t;return i.visit(n),i.found}catch(e){return B.test(r.source)}}));return(0,T.default)(r,(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:s.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function G(e){var t=(0,I.default)(e,(function(e){var t=e[k];return t instanceof RegExp&&(t.multiline||t.global)}));return(0,T.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:s.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}function W(e){var t=[],r=(0,T.default)(e,(function(r){return(0,S.default)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||(0,C.default)(t,n)||n.PATTERN===s.Lexer.NA||(t.push(n),e.push(n)),e}),[])}));r=(0,l.default)(r);var n=(0,I.default)(r,(function(e){return e.length>1}));return(0,T.default)(n,(function(e){var t=(0,T.default)(e,(function(e){return e.name})),r=(0,u.default)(e).PATTERN;return{message:"The same RegExp pattern ->".concat(r,"<-")+"has been used in all of the following Token Types: ".concat(t.join(", ")," <-"),type:s.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}function V(e){var t=(0,I.default)(e,(function(e){if(!(0,L.default)(e,"GROUP"))return!1;var t=e.GROUP;return t!==s.Lexer.SKIPPED&&t!==s.Lexer.NA&&!(0,m.default)(t)}));return(0,T.default)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:s.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}function Y(e,t){var r=(0,I.default)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,C.default)(t,e.PUSH_MODE)}));return(0,T.default)(r,(function(e){return{message:"Token Type: ->".concat(e.name,"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->").concat(e.PUSH_MODE,"<-")+"which does not exist",type:s.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}function K(e){var t=[],r=(0,S.default)(e,(function(e,t,r){var n,i,o=t.PATTERN;return o===s.Lexer.NA||((0,m.default)(o)?e.push({str:o,idx:r,tokenType:t}):(0,N.default)(o)&&(n=o,i=[".","\\","[","]","|","^","$","(",")","?","*","+","{"],void 0===(0,_.default)(i,(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:o.source,idx:r,tokenType:t})),e}),[]);return(0,v.default)(e,(function(e,n){(0,v.default)(r,(function(r){var i=r.str,o=r.idx,a=r.tokenType;if(n<o&&function(e,t){if((0,N.default)(t)){var r=t.exec(e);return null!==r&&0===r.index}if((0,g.default)(t))return t(e,0,[],{});if((0,L.default)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(i,e.PATTERN)){var u="Token: ->".concat(a.name,"<- can never be matched.\n")+"Because it appears AFTER the Token Type ->".concat(e.name,"<-")+"in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:u,type:s.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}}))})),t}function H(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:".concat(e.source,")"),t)}function z(e){var t=e.ignoreCase?"iy":"y";return new RegExp("".concat(e.source),t)}function X(e){var t=e.PATTERN;if((0,N.default)(t))return!1;if((0,g.default)(t))return!0;if((0,L.default)(t,"exec"))return!0;if((0,m.default)(t))return!1;throw Error("non exhaustive match")}function Q(e){return!(!(0,m.default)(e)||1!==e.length)&&e.charCodeAt(0)}function q(e,t){if((0,L.default)(e,"LINE_BREAKS"))return!1;if((0,N.default)(e.PATTERN)){try{(0,P.canMatchCharCode)(t,e.PATTERN)}catch(e){return{issue:s.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if((0,m.default)(e.PATTERN))return!1;if(X(e))return{issue:s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function $(e,t){if(t.issue===s.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n"+"\tThe problem is in the <".concat(e.name,"> Token Type\n")+"\t Root cause: ".concat(t.errMsg,".\n")+"\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n"+"\tThe problem is in the <".concat(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")}function Z(e){return(0,T.default)(e,(function(e){return(0,m.default)(e)?e.charCodeAt(0):e}))}function J(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}t.findStartOfInputAnchor=j,t.findUnsupportedFlags=G,t.findDuplicatePatterns=W,t.findInvalidGroupType=V,t.findModesThatDoNotExist=Y,t.findUnreachablePatterns=K,t.addStartOfInput=H,t.addStickyFlag=z,t.performRuntimeChecks=function(e,r,n){var i=[];return(0,L.default)(e,t.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+t.DEFAULT_MODE+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,L.default)(e,t.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+t.MODES+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,L.default)(e,t.MODES)&&(0,L.default)(e,t.DEFAULT_MODE)&&!(0,L.default)(e.modes,e.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a ".concat(t.DEFAULT_MODE,": <").concat(e.defaultMode,">")+"which does not exist\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,L.default)(e,t.MODES)&&(0,v.default)(e.modes,(function(e,t){(0,v.default)(e,(function(r,n){if((0,A.default)(r))i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+"<".concat(t,"> at index: <").concat(n,">\n"),type:s.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,L.default)(r,"LONGER_ALT")){var o=(0,f.default)(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];(0,v.default)(o,(function(n){(0,A.default)(n)||(0,C.default)(e,n)||i.push({message:"A MultiMode Lexer cannot be initialized with a longer_alt <".concat(n.name,"> on token <").concat(r.name,"> outside of mode <").concat(t,">\n"),type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),i},t.performWarningRuntimeChecks=function(e,t,r){var n=[],i=!1,o=(0,l.default)((0,d.default)((0,p.default)(e.modes))),a=(0,h.default)(o,(function(e){return e[k]===s.Lexer.NA})),u=Z(r);return t&&(0,v.default)(a,(function(e){var t=q(e,u);if(!1!==t){var r={message:$(e,t),type:t.issue,tokenType:e};n.push(r)}else(0,L.default)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):(0,P.canMatchCharCode)(u,e.PATTERN)&&(i=!0)})),t&&!i&&n.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:s.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n},t.cloneEmptyGroups=function(e){var t={},r=(0,O.default)(e);return(0,v.default)(r,(function(r){var n=e[r];if(!(0,f.default)(n))throw Error("non exhaustive match");t[r]=[]})),t},t.isCustomPattern=X,t.isShortPattern=Q,t.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(10===n)return this.lastIndex=r+1,!0;if(13===n)return 10===e.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0},t.buildLineBreakIssueMessage=$,t.minOptimizationVal=256;var ee=[];function te(e){return e<t.minOptimizationVal?e:ee[e]}t.charCodeToOptimizedIndex=te},1574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLexerErrorProvider=void 0,t.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->".concat(e.image,"<- The Mode Stack is empty")},buildUnexpectedCharactersMessage:function(e,t,r,n,i){return"unexpected character: ->".concat(e.charAt(t),"<- at offset: ").concat(t,",")+" skipped ".concat(r," characters.")}}},3734:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=t.LexerDefinitionErrorType=void 0;var i,o=r(328),a=n(r(7729)),s=n(r(2496)),u=n(r(788)),c=n(r(8513)),l=n(r(346)),f=n(r(9075)),p=n(r(5491)),d=n(r(8465)),h=n(r(2189)),E=n(r(7055)),y=n(r(7696)),T=n(r(2167)),v=n(r(6860)),m=r(7736),g=r(38),A=r(1574),_=r(3864);(i=t.LexerDefinitionErrorType||(t.LexerDefinitionErrorType={}))[i.MISSING_PATTERN=0]="MISSING_PATTERN",i[i.INVALID_PATTERN=1]="INVALID_PATTERN",i[i.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",i[i.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",i[i.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",i[i.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",i[i.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",i[i.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",i[i.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",i[i.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",i[i.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",i[i.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",i[i.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",i[i.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",i[i.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",i[i.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",i[i.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",i[i.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var L={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:A.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!0,recoveryEnabled:!0};Object.freeze(L);var O=function(){function e(e,t){void 0===t&&(t=L);var r=this;if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=function(e,t){if(!0===r.traceInitPerf){r.traceInitIndent++;var n=new Array(r.traceInitIndent+1).join("\t");r.traceInitIndent<r.traceInitMaxIdent&&console.log("".concat(n,"--\x3e <").concat(e,">"));var i=(0,m.timer)(t),o=i.time,a=i.value,s=o>10?console.warn:console.log;return r.traceInitIndent<r.traceInitMaxIdent&&s("".concat(n,"<-- <").concat(e,"> time: ").concat(o,"ms")),r.traceInitIndent--,a}return t()},"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,y.default)({},L,t);var n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var n,i=!0;r.TRACE_INIT("Lexer Config handling",(function(){if(r.config.lineTerminatorsPattern===L.lineTerminatorsPattern)r.config.lineTerminatorsPattern=o.LineTerminatorOptimizedTester;else if(r.config.lineTerminatorCharacters===L.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> 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.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),(0,u.default)(e)?n={modes:{defaultMode:(0,v.default)(e)},defaultMode:o.DEFAULT_MODE}:(i=!1,n=(0,v.default)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,o.performRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat((0,o.performWarningRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,p.default)(n.modes,(function(e,t){n.modes[t]=(0,l.default)(e,(function(e){return(0,h.default)(e)}))}));var c=(0,d.default)(n.modes);if((0,p.default)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <".concat(n,"> processing"),(function(){var i;r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,o.validatePatterns)(e,c))})),(0,s.default)(r.lexerDefinitionErrors)&&((0,g.augmentTokenTypes)(e),r.TRACE_INIT("analyzeTokenTypes",(function(){i=(0,o.analyzeTokenTypes)(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT})})),r.patternIdxToConfig[n]=i.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=i.charCodeToPatternIdxToConfig,r.emptyGroups=(0,y.default)({},r.emptyGroups,i.emptyGroups),r.hasCustom=i.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=i.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!(0,s.default)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var A=(0,f.default)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+A)}(0,p.default)(r.lexerDefinitionWarning,(function(e){(0,m.PRINT_WARNING)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(o.SUPPORT_STICKY?(r.chopInput=E.default,r.match=r.matchWithTest):(r.updateLastIndex=a.default,r.match=r.matchWithExec),i&&(r.handleModes=a.default),!1===r.trackStartLines&&(r.computeNewColumn=E.default),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=a.default),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else{if(!/onlyOffset/i.test(r.config.positionTracking))throw Error('Invalid <positionTracking> config option: "'.concat(r.config.positionTracking,'"'));r.createTokenInstance=r.createOffsetOnlyToken}r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)})),r.TRACE_INIT("Failed Optimization Warnings",(function(){var e=(0,T.default)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!(0,s.default)(e))throw Error("Lexer Modes: < ".concat(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.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){(0,_.clearRegExpParserCache)()})),r.TRACE_INIT("toFastProperties",(function(){(0,m.toFastProperties)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,s.default)(this.lexerDefinitionErrors)){var r=(0,f.default)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,i,a,s,u,l,f,p,d,h,E,y,T,v,m,g=this,A=e,_=A.length,L=0,O=0,N=this.hasCustom?0:Math.floor(e.length/10),I=new Array(N),R=[],S=this.trackStartLines?1:void 0,C=this.trackStartLines?1:void 0,x=(0,o.cloneEmptyGroups)(this.emptyGroups),P=this.trackStartLines,b=this.config.lineTerminatorsPattern,k=0,M=[],F=[],U=[],D=[];function w(){return M}function B(e){var t=(0,o.charCodeToOptimizedIndex)(e),r=F[t];return void 0===r?D:r}Object.freeze(D);var j,G=function(e){if(1===U.length&&void 0===e.tokenType.PUSH_MODE){var t=g.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);R.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{U.pop();var r=(0,c.default)(U);M=g.patternIdxToConfig[r],F=g.charCodeToPatternIdxToConfig[r],k=M.length;var n=g.canModeBeOptimized[r]&&!1===g.config.safeMode;m=F&&n?B:w}};function W(e){U.push(e),F=this.charCodeToPatternIdxToConfig[e],M=this.patternIdxToConfig[e],k=M.length,k=M.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;m=F&&t?B:w}W.call(this,t);for(var V=this.config.recoveryEnabled;L<_;){u=null;var Y=A.charCodeAt(L),K=m(Y),H=K.length;for(r=0;r<H;r++){var z=(j=K[r]).pattern;if(l=null,!1!==(ie=j.short)?Y===ie&&(u=z):!0===j.isCustom?null!==(v=z.exec(A,L,I,x))?(u=v[0],void 0!==v.payload&&(l=v.payload)):u=null:(this.updateLastIndex(z,L),u=this.match(z,e,L)),null!==u){if(void 0!==(s=j.longerAlt)){var X=s.length;for(i=0;i<X;i++){var Q=M[s[i]],q=Q.pattern;if(f=null,!0===Q.isCustom?null!==(v=q.exec(A,L,I,x))?(a=v[0],void 0!==v.payload&&(f=v.payload)):a=null:(this.updateLastIndex(q,L),a=this.match(q,e,L)),a&&a.length>u.length){u=a,l=f,j=Q;break}}}break}}if(null!==u){if(p=u.length,void 0!==(d=j.group)&&(h=j.tokenTypeIdx,E=this.createTokenInstance(u,L,h,j.tokenType,S,C,p),this.handlePayload(E,l),!1===d?O=this.addToken(I,O,E):x[d].push(E)),e=this.chopInput(e,p),L+=p,C=this.computeNewColumn(C,p),!0===P&&!0===j.canLineTerminator){var $=0,Z=void 0,J=void 0;b.lastIndex=0;do{!0===(Z=b.test(u))&&(J=b.lastIndex-1,$++)}while(!0===Z);0!==$&&(S+=$,C=p-J,this.updateTokenEndLineColumnLocation(E,d,J,$,S,C,p))}this.handleModes(j,G,W,E)}else{for(var ee=L,te=S,re=C,ne=!1===V;!1===ne&&L<_;)for(e=this.chopInput(e,1),L++,n=0;n<k;n++){var ie,oe=M[n];if(z=oe.pattern,!1!==(ie=oe.short)?A.charCodeAt(L)===ie&&(ne=!0):!0===oe.isCustom?ne=null!==z.exec(A,L,I,x):(this.updateLastIndex(z,L),ne=null!==z.exec(e)),!0===ne)break}if(y=L-ee,T=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(A,ee,y,te,re),R.push({offset:ee,line:te,column:re,length:y,message:T}),!1===V)break}}return this.hasCustom||(I.length=O),{tokens:I,groups:x,errors:R}},e.prototype.handleModes=function(e,t,r,n){if(!0===e.pop){var i=e.push;t(n),void 0!==i&&r.call(this,i)}else void 0!==e.push&&r.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,r,n,i,o,a){var s,u;void 0!==t&&(u=(s=r===a-1)?-1:0,1===n&&!0===s||(e.endLine=i+u,e.endColumn=o-1-u))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createOffsetOnlyToken=function(e,t,r,n){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:n}},e.prototype.createStartOnlyToken=function(e,t,r,n,i,o){return{image:e,startOffset:t,startLine:i,startColumn:o,tokenTypeIdx:r,tokenType:n}},e.prototype.createFullToken=function(e,t,r,n,i,o,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:i,endLine:i,startColumn:o,endColumn:o+a-1,tokenTypeIdx:r,tokenType:n}},e.prototype.addTokenUsingPush=function(e,t,r){return e.push(r),t},e.prototype.addTokenUsingMemberAccess=function(e,t,r){return e[t]=r,++t},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){null!==t&&(e.payload=t)},e.prototype.matchWithTest=function(e,t,r){return!0===e.test(t)?t.substring(r,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var r=e.exec(t);return null!==r?r[0]:null},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}();t.Lexer=O},1904:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.canMatchCharCode=t.firstCharOptimizedIndices=t.getOptimizedStartCodesIndices=t.failedOptimizationPrefixMsg=void 0;var a=r(9852),s=o(r(788)),u=o(r(6906)),c=o(r(5491)),l=o(r(3454)),f=o(r(4071)),p=o(r(8416)),d=r(7736),h=r(3864),E=r(328),y="Complement Sets are not supported for first char optimization";function T(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)T(e.value[n],t,r);break;case"Alternative":var i=e.value;for(n=0;n<i.length;n++){var o=i[n];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var a=o;switch(a.type){case"Character":v(a.value,t,r);break;case"Set":if(!0===a.complement)throw Error(y);(0,c.default)(a.value,(function(e){if("number"==typeof e)v(e,t,r);else{var n=e;if(!0===r)for(var i=n.from;i<=n.to;i++)v(i,t,r);else{for(i=n.from;i<=n.to&&i<E.minOptimizationVal;i++)v(i,t,r);if(n.to>=E.minOptimizationVal)for(var o=n.from>=E.minOptimizationVal?n.from:E.minOptimizationVal,a=n.to,s=(0,E.charCodeToOptimizedIndex)(o),u=(0,E.charCodeToOptimizedIndex)(a),c=s;c<=u;c++)t[c]=c}}}));break;case"Group":T(a.value,t,r);break;default:throw Error("Non Exhaustive Match")}var s=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===g(a)||"Group"!==a.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return(0,f.default)(t)}function v(e,t,r){var n=(0,E.charCodeToOptimizedIndex)(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r)t[i=(0,E.charCodeToOptimizedIndex)(n.charCodeAt(0))]=i;else{var i,o=r.toLowerCase();o!==r&&(t[i=(0,E.charCodeToOptimizedIndex)(o.charCodeAt(0))]=i)}}(e,t)}function m(e,t){return(0,l.default)(e.value,(function(e){if("number"==typeof e)return(0,p.default)(t,e);var r=e;return void 0!==(0,l.default)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function g(e){var t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&((0,s.default)(e.value)?(0,u.default)(e.value,g):g(e.value))}t.failedOptimizationPrefixMsg='Unable to use "first char" lexer optimizations:\n',t.getOptimizedStartCodesIndices=function(e,r){void 0===r&&(r=!1);try{var n=(0,h.getRegExpAst)(e);return T(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===y)r&&(0,d.PRINT_WARNING)("".concat(t.failedOptimizationPrefixMsg)+"\tUnable to optimize: < ".concat(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 i="";r&&(i="\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,d.PRINT_ERROR)("".concat(t.failedOptimizationPrefixMsg,"\n")+"\tFailed parsing: < ".concat(e.toString()," >\n")+"\tUsing the regexp-to-ast library version: ".concat(a.VERSION,"\n")+"\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]},t.firstCharOptimizedIndices=T;var A=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return i(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,p.default)(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}(a.BaseRegExpVisitor);t.canMatchCharCode=function(e,t){if(t instanceof RegExp){var r=(0,h.getRegExpAst)(t),n=new A(e);return n.visit(r),n.found}return void 0!==(0,l.default)(t,(function(t){return(0,p.default)(e,t.charCodeAt(0))}))}},3864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearRegExpParserCache=t.getRegExpAst=void 0;var n=r(9852),i={},o=new n.RegExpParser;t.getRegExpAst=function(e){var t=e.toString();if(i.hasOwnProperty(t))return i[t];var r=o.pattern(t);return i[t]=r,r},t.clearRegExpParserCache=function(){i={}}},38:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isTokenType=t.hasExtendingTokensTypesMapProperty=t.hasExtendingTokensTypesProperty=t.hasCategoriesProperty=t.hasShortKeyProperty=t.singleAssignCategoriesToksMap=t.assignCategoriesMapProp=t.assignCategoriesTokensProp=t.assignTokenDefaultProps=t.expandCategories=t.augmentTokenTypes=t.tokenIdxToClass=t.tokenShortNameIdx=t.tokenStructuredMatcherNoCategories=t.tokenStructuredMatcher=void 0;var i=n(r(2496)),o=n(r(3956)),a=n(r(788)),s=n(r(3187)),u=n(r(2986)),c=n(r(9075)),l=n(r(5491)),f=n(r(1893)),p=n(r(8416)),d=n(r(6860));function h(e){for(var t=(0,d.default)(e),r=e,n=!0;n;){r=(0,o.default)((0,s.default)((0,c.default)(r,(function(e){return e.CATEGORIES}))));var a=(0,u.default)(r,t);t=t.concat(a),(0,i.default)(a)?n=!1:r=a}return t}function E(e){(0,l.default)(e,(function(e){m(e)||(t.tokenIdxToClass[t.tokenShortNameIdx]=e,e.tokenTypeIdx=t.tokenShortNameIdx++),g(e)&&!(0,a.default)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),g(e)||(e.CATEGORIES=[]),A(e)||(e.categoryMatches=[]),_(e)||(e.categoryMatchesMap={})}))}function y(e){(0,l.default)(e,(function(e){e.categoryMatches=[],(0,l.default)(e.categoryMatchesMap,(function(r,n){e.categoryMatches.push(t.tokenIdxToClass[n].tokenTypeIdx)}))}))}function T(e){(0,l.default)(e,(function(e){v([],e)}))}function v(e,t){(0,l.default)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,l.default)(t.CATEGORIES,(function(r){var n=e.concat(t);(0,p.default)(n,r)||v(n,r)}))}function m(e){return(0,f.default)(e,"tokenTypeIdx")}function g(e){return(0,f.default)(e,"CATEGORIES")}function A(e){return(0,f.default)(e,"categoryMatches")}function _(e){return(0,f.default)(e,"categoryMatchesMap")}t.tokenStructuredMatcher=function(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]},t.tokenStructuredMatcherNoCategories=function(e,t){return e.tokenTypeIdx===t.tokenTypeIdx},t.tokenShortNameIdx=1,t.tokenIdxToClass={},t.augmentTokenTypes=function(e){var t=h(e);E(t),T(t),y(t),(0,l.default)(t,(function(e){e.isParent=e.categoryMatches.length>0}))},t.expandCategories=h,t.assignTokenDefaultProps=E,t.assignCategoriesTokensProp=y,t.assignCategoriesMapProp=T,t.singleAssignCategoriesToksMap=v,t.hasShortKeyProperty=m,t.hasCategoriesProperty=g,t.hasExtendingTokensTypesProperty=A,t.hasExtendingTokensTypesMapProperty=_,t.isTokenType=function(e){return(0,f.default)(e,"tokenTypeIdx")}},8516:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenMatcher=t.createTokenInstance=t.EOF=t.createToken=t.hasTokenLabel=t.tokenName=t.tokenLabel=void 0;var i=n(r(3948)),o=n(r(1893)),a=n(r(2189)),s=r(3734),u=r(38);function c(e){return(0,i.default)(e.LABEL)&&""!==e.LABEL}t.tokenLabel=function(e){return c(e)?e.LABEL:e.name},t.tokenName=function(e){return e.name},t.hasTokenLabel=c;var l="categories",f="label",p="group",d="push_mode",h="pop_mode",E="longer_alt",y="line_breaks",T="start_chars_hint";function v(e){return function(e){var t=e.pattern,r={};if(r.name=e.name,(0,a.default)(t)||(r.PATTERN=t),(0,o.default)(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return(0,o.default)(e,l)&&(r.CATEGORIES=e[l]),(0,u.augmentTokenTypes)([r]),(0,o.default)(e,f)&&(r.LABEL=e[f]),(0,o.default)(e,p)&&(r.GROUP=e[p]),(0,o.default)(e,h)&&(r.POP_MODE=e[h]),(0,o.default)(e,d)&&(r.PUSH_MODE=e[d]),(0,o.default)(e,E)&&(r.LONGER_ALT=e[E]),(0,o.default)(e,y)&&(r.LINE_BREAKS=e[y]),(0,o.default)(e,T)&&(r.START_CHARS_HINT=e[T]),r}(e)}t.createToken=v,t.EOF=v({name:"EOF",pattern:s.Lexer.NA}),(0,u.augmentTokenTypes)([t.EOF]),t.createTokenInstance=function(e,t,r,n,i,o,a,s){return{image:t,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}},t.tokenMatcher=function(e,t){return(0,u.tokenStructuredMatcher)(e,t)}},9766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="10.5.0"},741:(e,t,r)=>{var n=r(4913)(r(8088),"DataView");e.exports=n},7220:(e,t,r)=>{var n=r(4991),i=r(3467),o=r(4138),a=r(6174),s=r(3830);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},2216:(e,t,r)=>{var n=r(7643),i=r(8319),o=r(7310),a=r(2026),s=r(7634);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},2164:(e,t,r)=>{var n=r(4913)(r(8088),"Map");e.exports=n},8768:(e,t,r)=>{var n=r(307),i=r(8839),o=r(4182),a=r(2306),s=r(9450);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},8475:(e,t,r)=>{var n=r(4913)(r(8088),"Promise");e.exports=n},3606:(e,t,r)=>{var n=r(4913)(r(8088),"Set");e.exports=n},3942:(e,t,r)=>{var n=r(8768),i=r(2851),o=r(8624);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},8130:(e,t,r)=>{var n=r(2216),i=r(2321),o=r(6953),a=r(1808),s=r(3828),u=r(6724);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},820:(e,t,r)=>{var n=r(8088).Symbol;e.exports=n},4145:(e,t,r)=>{var n=r(8088).Uint8Array;e.exports=n},5304:(e,t,r)=>{var n=r(4913)(r(8088),"WeakMap");e.exports=n},7874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},8870:e=>{e.exports=function(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}},166:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4060:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}},2217:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}},5322:(e,t,r)=>{var n=r(4212);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},7785:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}},4564:(e,t,r)=>{var n=r(8975),i=r(5065),o=r(788),a=r(7727),s=r(1258),u=r(1412),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),l=!r&&i(e),f=!r&&!l&&a(e),p=!r&&!l&&!f&&u(e),d=r||l||f||p,h=d?n(e.length,String):[],E=h.length;for(var y in e)!t&&!c.call(e,y)||d&&("length"==y||f&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,E))||h.push(y);return h}},9733:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},6079:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},5517:e=>{e.exports=function(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}},9019:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},5503:e=>{e.exports=function(e){return e.split("")}},2052:(e,t,r)=>{var n=r(9407),i=r(619),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},1484:(e,t,r)=>{var n=r(619);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},1176:(e,t,r)=>{var n=r(6196);e.exports=function(e,t,r,i){return n(e,(function(e,n,o){t(i,e,r(e),o)})),i}},6384:(e,t,r)=>{var n=r(2326),i=r(8465);e.exports=function(e,t){return e&&n(t,i(t),e)}},5455:(e,t,r)=>{var n=r(2326),i=r(9274);e.exports=function(e,t){return e&&n(t,i(t),e)}},9407:(e,t,r)=>{var n=r(4262);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},1420:(e,t,r)=>{var n=r(8130),i=r(166),o=r(2052),a=r(6384),s=r(5455),u=r(5729),c=r(8284),l=r(1660),f=r(3091),p=r(7507),d=r(6240),h=r(8124),E=r(1324),y=r(5110),T=r(6534),v=r(788),m=r(7727),g=r(127),A=r(2478),_=r(4801),L=r(8465),O=r(9274),N="[object Arguments]",I="[object Function]",R="[object Object]",S={};S[N]=S["[object Array]"]=S["[object ArrayBuffer]"]=S["[object DataView]"]=S["[object Boolean]"]=S["[object Date]"]=S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Map]"]=S["[object Number]"]=S[R]=S["[object RegExp]"]=S["[object Set]"]=S["[object String]"]=S["[object Symbol]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S["[object Error]"]=S[I]=S["[object WeakMap]"]=!1,e.exports=function e(t,r,C,x,P,b){var k,M=1&r,F=2&r,U=4&r;if(C&&(k=P?C(t,x,P,b):C(t)),void 0!==k)return k;if(!A(t))return t;var D=v(t);if(D){if(k=E(t),!M)return c(t,k)}else{var w=h(t),B=w==I||"[object GeneratorFunction]"==w;if(m(t))return u(t,M);if(w==R||w==N||B&&!P){if(k=F||B?{}:T(t),!M)return F?f(t,s(k,t)):l(t,a(k,t))}else{if(!S[w])return P?t:{};k=y(t,w,M)}}b||(b=new n);var j=b.get(t);if(j)return j;b.set(t,k),_(t)?t.forEach((function(n){k.add(e(n,r,C,n,t,b))})):g(t)&&t.forEach((function(n,i){k.set(i,e(n,r,C,i,t,b))}));var G=D?void 0:(U?F?d:p:F?O:L)(t);return i(G||t,(function(n,i){G&&(n=t[i=n]),o(k,i,e(n,r,C,i,t,b))})),k}},9145:(e,t,r)=>{var n=r(2478),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},1130:(e,t,r)=>{var n=r(3942),i=r(5322),o=r(7785),a=r(9733),s=r(6486),u=r(8610);e.exports=function(e,t,r,c){var l=-1,f=i,p=!0,d=e.length,h=[],E=t.length;if(!d)return h;r&&(t=a(t,s(r))),c?(f=o,p=!1):t.length>=200&&(f=u,p=!1,t=new n(t));e:for(;++l<d;){var y=e[l],T=null==r?y:r(y);if(y=c||0!==y?y:0,p&&T==T){for(var v=E;v--;)if(t[v]===T)continue e;h.push(y)}else f(t,T,c)||h.push(y)}return h}},6196:(e,t,r)=>{var n=r(1240),i=r(260)(n);e.exports=i},7434:(e,t,r)=>{var n=r(6196);e.exports=function(e,t){var r=!0;return n(e,(function(e,n,i){return r=!!t(e,n,i)})),r}},4979:(e,t,r)=>{var n=r(6196);e.exports=function(e,t){var r=[];return n(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}},7352:e=>{e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},2723:(e,t,r)=>{var n=r(6079),i=r(4652);e.exports=function e(t,r,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];r>0&&o(l)?r>1?e(l,r-1,o,a,s):n(s,l):a||(s[s.length]=l)}return s}},9234:(e,t,r)=>{var n=r(1218)();e.exports=n},1240:(e,t,r)=>{var n=r(9234),i=r(8465);e.exports=function(e,t){return e&&n(e,t,i)}},1353:(e,t,r)=>{var n=r(7327),i=r(9698);e.exports=function(e,t){for(var r=0,o=(t=n(t,e)).length;null!=e&&r<o;)e=e[i(t[r++])];return r&&r==o?e:void 0}},4662:(e,t,r)=>{var n=r(6079),i=r(788);e.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},7281:(e,t,r)=>{var n=r(820),i=r(8872),o=r(7519),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},1397:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,r){return null!=e&&t.call(e,r)}},9718:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},4212:(e,t,r)=>{var n=r(7352),i=r(7012),o=r(8372);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},5737:(e,t,r)=>{var n=r(7281),i=r(8201);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},6605:(e,t,r)=>{var n=r(6511),i=r(8201);e.exports=function e(t,r,o,a,s){return t===r||(null==t||null==r||!i(t)&&!i(r)?t!=t&&r!=r:n(t,r,o,a,e,s))}},6511:(e,t,r)=>{var n=r(8130),i=r(3700),o=r(851),a=r(4760),s=r(8124),u=r(788),c=r(7727),l=r(1412),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,E,y,T){var v=u(e),m=u(t),g=v?p:s(e),A=m?p:s(t),_=(g=g==f?d:g)==d,L=(A=A==f?d:A)==d,O=g==A;if(O&&c(e)){if(!c(t))return!1;v=!0,_=!1}if(O&&!_)return T||(T=new n),v||l(e)?i(e,t,r,E,y,T):o(e,t,g,r,E,y,T);if(!(1&r)){var N=_&&h.call(e,"__wrapped__"),I=L&&h.call(t,"__wrapped__");if(N||I){var R=N?e.value():e,S=I?t.value():t;return T||(T=new n),y(R,S,r,E,T)}}return!!O&&(T||(T=new n),a(e,t,r,E,y,T))}},4607:(e,t,r)=>{var n=r(8124),i=r(8201);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},9444:(e,t,r)=>{var n=r(8130),i=r(6605);e.exports=function(e,t,r,o){var a=r.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=r[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=r[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new n;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},7012:e=>{e.exports=function(e){return e!=e}},5482:(e,t,r)=>{var n=r(8957),i=r(3953),o=r(2478),a=r(3732),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?p:s).test(a(e))}},2336:(e,t,r)=>{var n=r(7281),i=r(8201);e.exports=function(e){return i(e)&&"[object RegExp]"==n(e)}},977:(e,t,r)=>{var n=r(8124),i=r(8201);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},5924:(e,t,r)=>{var n=r(7281),i=r(5309),o=r(8201),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},7432:(e,t,r)=>{var n=r(1560),i=r(4037),o=r(7055),a=r(788),s=r(1836);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):n(e):s(e)}},7137:(e,t,r)=>{var n=r(9708),i=r(1687),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},9642:(e,t,r)=>{var n=r(2478),i=r(9708),o=r(2476),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},6355:(e,t,r)=>{var n=r(6196),i=r(2411);e.exports=function(e,t){var r=-1,o=i(e)?Array(e.length):[];return n(e,(function(e,n,i){o[++r]=t(e,n,i)})),o}},1560:(e,t,r)=>{var n=r(9444),i=r(6389),o=r(4350);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},4037:(e,t,r)=>{var n=r(6605),i=r(1001),o=r(3686),a=r(4917),s=r(8137),u=r(4350),c=r(9698);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(r){var a=i(r,e);return void 0===a&&a===t?o(r,e):n(t,a,3)}}},6409:(e,t,r)=>{var n=r(1353),i=r(2525),o=r(7327);e.exports=function(e,t,r){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=n(e,c);r(l,c)&&i(u,o(c,e),l)}return u}},2908:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},66:(e,t,r)=>{var n=r(1353);e.exports=function(e){return function(t){return n(t,e)}}},6535:e=>{e.exports=function(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}},2415:(e,t,r)=>{var n=r(7055),i=r(9924),o=r(942);e.exports=function(e,t){return o(i(e,t,n),e+"")}},2525:(e,t,r)=>{var n=r(2052),i=r(7327),o=r(1258),a=r(2478),s=r(9698);e.exports=function(e,t,r,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var d=s(t[c]),h=r;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(c!=f){var E=p[d];void 0===(h=u?u(E,d,p):void 0)&&(h=a(E)?E:o(t[c+1])?[]:{})}n(p,d,h),p=p[d]}return e}},9349:(e,t,r)=>{var n=r(4765),i=r(4262),o=r(7055),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},3759:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}},5877:(e,t,r)=>{var n=r(6196);e.exports=function(e,t){var r;return n(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}},8975:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},1533:(e,t,r)=>{var n=r(820),i=r(9733),o=r(788),a=r(4865),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},5477:(e,t,r)=>{var n=r(4639),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},6486:e=>{e.exports=function(e){return function(t){return e(t)}}},5056:(e,t,r)=>{var n=r(3942),i=r(5322),o=r(7785),a=r(8610),s=r(7830),u=r(5338);e.exports=function(e,t,r){var c=-1,l=i,f=e.length,p=!0,d=[],h=d;if(r)p=!1,l=o;else if(f>=200){var E=t?null:s(e);if(E)return u(E);p=!1,l=a,h=new n}else h=t?[]:d;e:for(;++c<f;){var y=e[c],T=t?t(y):y;if(y=r||0!==y?y:0,p&&T==T){for(var v=h.length;v--;)if(h[v]===T)continue e;t&&h.push(T),d.push(y)}else l(h,T,r)||(h!==d&&h.push(T),d.push(y))}return d}},2487:(e,t,r)=>{var n=r(9733);e.exports=function(e,t){return n(t,(function(t){return e[t]}))}},8610:e=>{e.exports=function(e,t){return e.has(t)}},7831:(e,t,r)=>{var n=r(7055);e.exports=function(e){return"function"==typeof e?e:n}},7327:(e,t,r)=>{var n=r(788),i=r(4917),o=r(5647),a=r(6077);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},1885:(e,t,r)=>{var n=r(3759);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},524:(e,t,r)=>{var n=r(4145);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},5729:(e,t,r)=>{e=r.nmd(e);var n=r(8088),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},1305:(e,t,r)=>{var n=r(524);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},2850:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},1103:(e,t,r)=>{var n=r(820),i=n?n.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},2742:(e,t,r)=>{var n=r(524);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},8284:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},2326:(e,t,r)=>{var n=r(2052),i=r(9407);e.exports=function(e,t,r,o){var a=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=o?o(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),a?i(r,c,l):n(r,c,l)}return r}},1660:(e,t,r)=>{var n=r(2326),i=r(9829);e.exports=function(e,t){return n(e,i(e),t)}},3091:(e,t,r)=>{var n=r(2326),i=r(2262);e.exports=function(e,t){return n(e,i(e),t)}},3408:(e,t,r)=>{var n=r(8088)["__core-js_shared__"];e.exports=n},8489:(e,t,r)=>{var n=r(8870),i=r(1176),o=r(7432),a=r(788);e.exports=function(e,t){return function(r,s){var u=a(r)?n:i,c=t?t():{};return u(r,e,o(s,2),c)}}},8202:(e,t,r)=>{var n=r(2415),i=r(417);e.exports=function(e){return n((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var u=r[n];u&&e(t,u,n,a)}return t}))}},260:(e,t,r)=>{var n=r(2411);e.exports=function(e,t){return function(r,i){if(null==r)return r;if(!n(r))return e(r,i);for(var o=r.length,a=t?o:-1,s=Object(r);(t?a--:++a<o)&&!1!==i(s[a],a,s););return r}}},1218:e=>{e.exports=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}},8396:(e,t,r)=>{var n=r(1885),i=r(1383),o=r(3291),a=r(6077);e.exports=function(e){return function(t){t=a(t);var r=i(t)?o(t):void 0,s=r?r[0]:t.charAt(0),u=r?n(r,1).join(""):t.slice(1);return s[e]()+u}}},7051:(e,t,r)=>{var n=r(7432),i=r(2411),o=r(8465);e.exports=function(e){return function(t,r,a){var s=Object(t);if(!i(t)){var u=n(r,3);t=o(t),r=function(e){return u(s[e],e,s)}}var c=e(t,r,a);return c>-1?s[u?t[c]:c]:void 0}}},7830:(e,t,r)=>{var n=r(3606),i=r(7729),o=r(5338),a=n&&1/o(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=a},4262:(e,t,r)=>{var n=r(4913),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},3700:(e,t,r)=>{var n=r(3942),i=r(9019),o=r(8610);e.exports=function(e,t,r,a,s,u){var c=1&r,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var p=u.get(e),d=u.get(t);if(p&&d)return p==t&&d==e;var h=-1,E=!0,y=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var T=e[h],v=t[h];if(a)var m=c?a(v,T,h,t,e,u):a(T,v,h,e,t,u);if(void 0!==m){if(m)continue;E=!1;break}if(y){if(!i(t,(function(e,t){if(!o(y,t)&&(T===e||s(T,e,r,a,u)))return y.push(t)}))){E=!1;break}}else if(T!==v&&!s(T,v,r,a,u)){E=!1;break}}return u.delete(e),u.delete(t),E}},851:(e,t,r)=>{var n=r(820),i=r(4145),o=r(619),a=r(3700),s=r(2992),u=r(5338),c=n?n.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,r,n,c,f,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=s;case"[object Set]":var h=1&n;if(d||(d=u),e.size!=t.size&&!h)return!1;var E=p.get(e);if(E)return E==t;n|=2,p.set(e,t);var y=a(d(e),d(t),n,c,f,p);return p.delete(e),y;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},4760:(e,t,r)=>{var n=r(7507),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,o,a,s){var u=1&r,c=n(e),l=c.length;if(l!=n(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var E=!0;s.set(e,t),s.set(t,e);for(var y=u;++f<l;){var T=e[p=c[f]],v=t[p];if(o)var m=u?o(v,T,p,t,e,s):o(T,v,p,e,t,s);if(!(void 0===m?T===v||a(T,v,r,o,s):m)){E=!1;break}y||(y="constructor"==p)}if(E&&!y){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(E=!1)}return s.delete(e),s.delete(t),E}},2417:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},7507:(e,t,r)=>{var n=r(4662),i=r(9829),o=r(8465);e.exports=function(e){return n(e,o,i)}},6240:(e,t,r)=>{var n=r(4662),i=r(2262),o=r(9274);e.exports=function(e){return n(e,o,i)}},4830:(e,t,r)=>{var n=r(7921);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},6389:(e,t,r)=>{var n=r(8137),i=r(8465);e.exports=function(e){for(var t=i(e),r=t.length;r--;){var o=t[r],a=e[o];t[r]=[o,a,n(a)]}return t}},4913:(e,t,r)=>{var n=r(5482),i=r(2273);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},7494:(e,t,r)=>{var n=r(8180)(Object.getPrototypeOf,Object);e.exports=n},8872:(e,t,r)=>{var n=r(820),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},9829:(e,t,r)=>{var n=r(2217),i=r(9668),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},2262:(e,t,r)=>{var n=r(6079),i=r(7494),o=r(9829),a=r(9668),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:a;e.exports=s},8124:(e,t,r)=>{var n=r(741),i=r(2164),o=r(8475),a=r(3606),s=r(5304),u=r(7281),c=r(3732),l="[object Map]",f="[object Promise]",p="[object Set]",d="[object WeakMap]",h="[object DataView]",E=c(n),y=c(i),T=c(o),v=c(a),m=c(s),g=u;(n&&g(new n(new ArrayBuffer(1)))!=h||i&&g(new i)!=l||o&&g(o.resolve())!=f||a&&g(new a)!=p||s&&g(new s)!=d)&&(g=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case E:return h;case y:return l;case T:return f;case v:return p;case m:return d}return t}),e.exports=g},2273:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},6609:(e,t,r)=>{var n=r(7327),i=r(5065),o=r(788),a=r(1258),s=r(5309),u=r(9698);e.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&r(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},1383:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},4991:(e,t,r)=>{var n=r(2071);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},3467:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},4138:(e,t,r)=>{var n=r(2071),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},6174:(e,t,r)=>{var n=r(2071),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},3830:(e,t,r)=>{var n=r(2071);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},1324:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},5110:(e,t,r)=>{var n=r(524),i=r(1305),o=r(2850),a=r(1103),s=r(2742);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},6534:(e,t,r)=>{var n=r(9145),i=r(7494),o=r(9708);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},4652:(e,t,r)=>{var n=r(820),i=r(5065),o=r(788),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},1258:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},417:(e,t,r)=>{var n=r(619),i=r(2411),o=r(1258),a=r(2478);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&o(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},4917:(e,t,r)=>{var n=r(788),i=r(4865),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},7921:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},3953:(e,t,r)=>{var n,i=r(3408),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},9708:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8137:(e,t,r)=>{var n=r(2478);e.exports=function(e){return e==e&&!n(e)}},7643:e=>{e.exports=function(){this.__data__=[],this.size=0}},8319:(e,t,r)=>{var n=r(1484),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},7310:(e,t,r)=>{var n=r(1484);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},2026:(e,t,r)=>{var n=r(1484);e.exports=function(e){return n(this.__data__,e)>-1}},7634:(e,t,r)=>{var n=r(1484);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},307:(e,t,r)=>{var n=r(7220),i=r(2216),o=r(2164);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},8839:(e,t,r)=>{var n=r(4830);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},4182:(e,t,r)=>{var n=r(4830);e.exports=function(e){return n(this,e).get(e)}},2306:(e,t,r)=>{var n=r(4830);e.exports=function(e){return n(this,e).has(e)}},9450:(e,t,r)=>{var n=r(4830);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},2992:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},4350:e=>{e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},6691:(e,t,r)=>{var n=r(1685);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},2071:(e,t,r)=>{var n=r(4913)(Object,"create");e.exports=n},1687:(e,t,r)=>{var n=r(8180)(Object.keys,Object);e.exports=n},2476:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},7664:(e,t,r)=>{e=r.nmd(e);var n=r(2417),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},7519:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},8180:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},9924:(e,t,r)=>{var n=r(7874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(u),n(e,this,c)}}},8088:(e,t,r)=>{var n=r(2417),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},2851:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},8624:e=>{e.exports=function(e){return this.__data__.has(e)}},5338:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},942:(e,t,r)=>{var n=r(9349),i=r(5842)(n);e.exports=i},5842:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},2321:(e,t,r)=>{var n=r(2216);e.exports=function(){this.__data__=new n,this.size=0}},6953:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},1808:e=>{e.exports=function(e){return this.__data__.get(e)}},3828:e=>{e.exports=function(e){return this.__data__.has(e)}},6724:(e,t,r)=>{var n=r(2216),i=r(2164),o=r(8768);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},8372:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},3291:(e,t,r)=>{var n=r(5503),i=r(1383),o=r(9483);e.exports=function(e){return i(e)?o(e):n(e)}},5647:(e,t,r)=>{var n=r(6691),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}));e.exports=a},9698:(e,t,r)=>{var n=r(4865);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},3732:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4639:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},9483:e=>{var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*",f="(?:"+[o+n+"?",n,a,s,r].join("|")+")",p=RegExp(i+"(?="+i+")|"+f+l,"g");e.exports=function(e){return e.match(p)||[]}},7696:(e,t,r)=>{var n=r(2052),i=r(2326),o=r(8202),a=r(2411),s=r(9708),u=r(8465),c=Object.prototype.hasOwnProperty,l=o((function(e,t){if(s(t)||a(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},6860:(e,t,r)=>{var n=r(1420);e.exports=function(e){return n(e,4)}},3956:e=>{e.exports=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i}},4765:e=>{e.exports=function(e){return function(){return e}}},6139:(e,t,r)=>{var n=r(2415),i=r(619),o=r(417),a=r(9274),s=Object.prototype,u=s.hasOwnProperty,c=n((function(e,t){e=Object(e);var r=-1,n=t.length,c=n>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(n=1);++r<n;)for(var l=t[r],f=a(l),p=-1,d=f.length;++p<d;){var h=f[p],E=e[h];(void 0===E||i(E,s[h])&&!u.call(e,h))&&(e[h]=l[h])}return e}));e.exports=c},2986:(e,t,r)=>{var n=r(1130),i=r(2723),o=r(2415),a=r(5824),s=o((function(e,t){return a(e)?n(e,i(t,1,a,!0)):[]}));e.exports=s},6388:(e,t,r)=>{var n=r(3759),i=r(8676);e.exports=function(e,t,r){var o=null==e?0:e.length;return o?(t=r||void 0===t?1:i(t),n(e,t<0?0:t,o)):[]}},1104:(e,t,r)=>{var n=r(3759),i=r(8676);e.exports=function(e,t,r){var o=null==e?0:e.length;return o?(t=r||void 0===t?1:i(t),n(e,0,(t=o-t)<0?0:t)):[]}},619:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6906:(e,t,r)=>{var n=r(4060),i=r(7434),o=r(7432),a=r(788),s=r(417);e.exports=function(e,t,r){var u=a(e)?n:i;return r&&s(e,t,r)&&(t=void 0),u(e,o(t,3))}},4435:(e,t,r)=>{var n=r(2217),i=r(4979),o=r(7432),a=r(788);e.exports=function(e,t){return(a(e)?n:i)(e,o(t,3))}},3454:(e,t,r)=>{var n=r(7051)(r(1528));e.exports=n},1528:(e,t,r)=>{var n=r(7352),i=r(7432),o=r(8676),a=Math.max;e.exports=function(e,t,r){var s=null==e?0:e.length;if(!s)return-1;var u=null==r?0:o(r);return u<0&&(u=a(s+u,0)),n(e,i(t,3),u)}},8892:(e,t,r)=>{e.exports=r(2611)},9394:(e,t,r)=>{var n=r(2723),i=r(9075);e.exports=function(e,t){return n(i(e,t),1)}},3187:(e,t,r)=>{var n=r(2723);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},5491:(e,t,r)=>{var n=r(166),i=r(6196),o=r(7831),a=r(788);e.exports=function(e,t){return(a(e)?n:i)(e,o(t))}},1001:(e,t,r)=>{var n=r(1353);e.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},395:(e,t,r)=>{var n=r(9407),i=r(8489),o=Object.prototype.hasOwnProperty,a=i((function(e,t,r){o.call(e,r)?e[r].push(t):n(e,r,[t])}));e.exports=a},1893:(e,t,r)=>{var n=r(1397),i=r(6609);e.exports=function(e,t){return null!=e&&i(e,t,n)}},3686:(e,t,r)=>{var n=r(9718),i=r(6609);e.exports=function(e,t){return null!=e&&i(e,t,n)}},2611:e=>{e.exports=function(e){return e&&e.length?e[0]:void 0}},7055:e=>{e.exports=function(e){return e}},8416:(e,t,r)=>{var n=r(4212),i=r(2411),o=r(3948),a=r(8676),s=r(4071),u=Math.max;e.exports=function(e,t,r,c){e=i(e)?e:s(e),r=r&&!c?a(r):0;var l=e.length;return r<0&&(r=u(l+r,0)),o(e)?r<=l&&e.indexOf(t,r)>-1:!!l&&n(e,t,r)>-1}},5799:(e,t,r)=>{var n=r(4212),i=r(8676),o=Math.max;e.exports=function(e,t,r){var a=null==e?0:e.length;if(!a)return-1;var s=null==r?0:i(r);return s<0&&(s=o(a+s,0)),n(e,t,s)}},5065:(e,t,r)=>{var n=r(5737),i=r(8201),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},788:e=>{var t=Array.isArray;e.exports=t},2411:(e,t,r)=>{var n=r(8957),i=r(5309);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},5824:(e,t,r)=>{var n=r(2411),i=r(8201);e.exports=function(e){return i(e)&&n(e)}},7727:(e,t,r)=>{e=r.nmd(e);var n=r(8088),i=r(9422),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},2496:(e,t,r)=>{var n=r(7137),i=r(8124),o=r(5065),a=r(788),s=r(2411),u=r(7727),c=r(9708),l=r(1412),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!n(e).length;for(var r in e)if(f.call(e,r))return!1;return!0}},8957:(e,t,r)=>{var n=r(7281),i=r(2478);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},5309:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},127:(e,t,r)=>{var n=r(4607),i=r(6486),o=r(7664),a=o&&o.isMap,s=a?i(a):n;e.exports=s},2478:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},8201:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3136:(e,t,r)=>{var n=r(2336),i=r(6486),o=r(7664),a=o&&o.isRegExp,s=a?i(a):n;e.exports=s},4801:(e,t,r)=>{var n=r(977),i=r(6486),o=r(7664),a=o&&o.isSet,s=a?i(a):n;e.exports=s},3948:(e,t,r)=>{var n=r(7281),i=r(788),o=r(8201);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==n(e)}},4865:(e,t,r)=>{var n=r(7281),i=r(8201);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},1412:(e,t,r)=>{var n=r(5924),i=r(6486),o=r(7664),a=o&&o.isTypedArray,s=a?i(a):n;e.exports=s},2189:e=>{e.exports=function(e){return void 0===e}},8465:(e,t,r)=>{var n=r(4564),i=r(7137),o=r(2411);e.exports=function(e){return o(e)?n(e):i(e)}},9274:(e,t,r)=>{var n=r(4564),i=r(9642),o=r(2411);e.exports=function(e){return o(e)?n(e,!0):i(e)}},8513:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},9075:(e,t,r)=>{var n=r(9733),i=r(7432),o=r(6355),a=r(788);e.exports=function(e,t){return(a(e)?n:o)(e,i(t,3))}},1685:(e,t,r)=>{var n=r(8768);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2979:e=>{e.exports=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},7729:e=>{e.exports=function(){}},5753:(e,t,r)=>{var n=r(9733),i=r(7432),o=r(6409),a=r(6240);e.exports=function(e,t){if(null==e)return{};var r=n(a(e),(function(e){return[e]}));return t=i(t),o(e,r,(function(e,r){return t(e,r[0])}))}},1836:(e,t,r)=>{var n=r(2908),i=r(66),o=r(4917),a=r(9698);e.exports=function(e){return o(e)?n(a(e)):i(e)}},2167:(e,t,r)=>{var n=r(5517),i=r(6196),o=r(7432),a=r(6535),s=r(788);e.exports=function(e,t,r){var u=s(e)?n:a,c=arguments.length<3;return u(e,o(t,4),r,c,i)}},346:(e,t,r)=>{var n=r(2217),i=r(4979),o=r(7432),a=r(788),s=r(2979);e.exports=function(e,t){return(a(e)?n:i)(e,s(o(t,3)))}},5797:(e,t,r)=>{var n=r(9019),i=r(7432),o=r(5877),a=r(788),s=r(417);e.exports=function(e,t,r){var u=a(e)?n:o;return r&&s(e,t,r)&&(t=void 0),u(e,i(t,3))}},9668:e=>{e.exports=function(){return[]}},9422:e=>{e.exports=function(){return!1}},3719:(e,t,r)=>{var n=r(8401);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},8676:(e,t,r)=>{var n=r(3719);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8401:(e,t,r)=>{var n=r(5477),i=r(2478),o=r(4865),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},6077:(e,t,r)=>{var n=r(1533);e.exports=function(e){return null==e?"":n(e)}},2256:(e,t,r)=>{var n=r(5056);e.exports=function(e){return e&&e.length?n(e):[]}},7872:(e,t,r)=>{var n=r(8396)("toUpperCase");e.exports=n},4071:(e,t,r)=>{var n=r(2487),i=r(8465);e.exports=function(e){return null==e?[]:n(e,i(e))}},9852:function(e,t){var r,n;"undefined"!=typeof self&&self,void 0===(n="function"==typeof(r=function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(r,"global");break;case"i":s(r,"ignoreCase");break;case"m":s(r,"multiLine");break;case"u":s(r,"unicode");break;case"y":s(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}},e.prototype.disjunction=function(){var e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}},e.prototype.alternative=function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}u(t);var r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}!function(){throw Error("Internal Error - Should never get here!")}()},e.prototype.quantifier=function(e){var t,r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":t=this.isDigit()?{atLeast:n,atMost:this.integerIncludingZero()}:{atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;u(t)}if(!0!==e||void 0!==t)return u(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t},e.prototype.atom=function(){var e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),u(e),e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){return{type:"GroupBackReference",value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case"d":e=c;break;case"D":e=c,t=!0;break;case"s":e=f;break;case"S":e=f,t=!0;break;case"w":e=l;break;case"W":e=l,t=!0}return u(e),{type:"Set",value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case"f":e=o("\f");break;case"n":e=o("\n");break;case"r":e=o("\r");break;case"t":e=o("\t");break;case"v":e=o("\v")}return u(e),{type:"Character",value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:"Character",value:o(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:o(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){var r=this.classAtom();if("Character"===r.type&&this.isRangeDash()){this.consumeChar("-");var n=this.classAtom();if("Character"===n.type){if(n.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:n.value})}else a(r.value,e),e.push(o("-")),a(n.value,e)}else a(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:o("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var e=!0;this.consumeChar("("),"?"===this.peekChar(0)?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;var t=this.disjunction();this.consumeChar(")");var r={type:"Group",capturing:e,value:t};return e&&(r.idx=this.groupIdx),r},e.prototype.positiveInteger=function(){var e=this.popChar();if(!1===i.test(e))throw Error("Expecting a positive integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===n.test(e))throw Error("Expecting an integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:o(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},e.prototype.isDigit=function(){return n.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(void 0===e&&(e=0),this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var t="",n=0;n<e;n++){var i=this.popChar();if(!1===r.test(i))throw Error("Expecting a HexDecimal digits");t+=i}return{type:"Character",value:parseInt(t,16)}},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},e.prototype.loc=function(e){return{begin:e,end:this.idx}};var t,r=/[0-9a-fA-F]/,n=/[0-9]/,i=/[1-9]/;function o(e){return e.charCodeAt(0)}function a(e,t){void 0!==e.length?e.forEach((function(e){t.push(e)})):t.push(e)}function s(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}function u(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}var c=[];for(t=o("0");t<=o("9");t++)c.push(t);var l=[o("_")].concat(c);for(t=o("a");t<=o("z");t++)l.push(t);for(t=o("A");t<=o("Z");t++)l.push(t);var f=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function p(){}return p.prototype.visitChildren=function(e){for(var t in e){var r=e[t];e.hasOwnProperty(t)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((function(e){this.visit(e)}),this))}},p.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:"0.5.0"}})?r.apply(t,[]):r)||(e.exports=n)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(2093)})()));
|
|
1
|
+
"use strict";var po=Object.defineProperty;var Jf=Object.getOwnPropertyDescriptor;var ep=Object.getOwnPropertyNames;var tp=Object.prototype.hasOwnProperty;var rp=(t,e)=>{for(var r in e)po(t,r,{get:e[r],enumerable:!0})},np=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ep(e))!tp.call(t,i)&&i!==r&&po(t,i,{get:()=>e[i],enumerable:!(n=Jf(e,i))||n.enumerable});return t};var ip=t=>np(po({},"__esModule",{value:!0}),t);var mC={};rp(mC,{Compose:()=>so,composeQuery:()=>zf,formatQuery:()=>dC,getComposedField:()=>pC,getField:()=>qf,getFlattenedFields:()=>hC,hasAlias:()=>Dr,isFieldSubquery:()=>mo,isGroupByField:()=>Gr,isGroupByFn:()=>Ds,isHavingClauseWithRightCondition:()=>Ms,isNegationCondition:()=>Qt,isOrderByField:()=>Nn,isOrderByFn:()=>Bs,isQueryValid:()=>Xf,isString:()=>k,isSubquery:()=>Bt,isValueCondition:()=>Us,isValueFunctionCondition:()=>Ln,isValueQueryCondition:()=>yn,isValueWithDateLiteralCondition:()=>ks,isValueWithDateNLiteralCondition:()=>ws,isWhereClauseWithRightCondition:()=>Sn,isWhereOrHavingClauseWithRightCondition:()=>Cn,parseQuery:()=>oo});module.exports=ip(mC);function zt(t){return t=Array.isArray(t)?t[0]:t,t.image&&!0}function Ns(t,e){return e}function k(t){return typeof t=="string"}function op(t){return t?t.every(e=>k(e)):!1}function xt(t){return Number.isFinite(t)}function ee(t){return t==null}function wt(t,e,r){return ee(t)?"":`${r||""}${t}${e||""}`}function Os(t,e=!1){return Array.isArray(t)?t.length>0?`(${t.join(", ")})`:e?"()":"":e?`(${t||""})`:t||""}function Rs(t,e,r=""){return xt(t)&&t>0?new Array(t).fill(e).join(r):""}function ho(t){return!t.parameters||t.parameters.length===0?[]:op(t.parameters)?t.parameters:k(t.parameters[0])?[t.parameters[0]]:ho(t.parameters[0])}function Is(t){if(!t.parameters||t.parameters.length===0)return!1;let e=t.parameters[0];return k(e)?!1:!!e.isAggregateFn}function Dr(t){return t&&!ee(t.alias)}function _s(t){return k(t.field)&&!Array.isArray(t.relationships)&&!Array.isArray(t.conditions)}function bs(t){return!ee(t.functionName||t.fn)}function vs(t){return k(t.field)&&Array.isArray(t.relationships)}function Ps(t){return!ee(t.subquery)}function Fs(t){return k(t.field)&&Array.isArray(t.conditions)}function Bt(t){return k(t.relationshipName)}function mo(t){return!!t&&!!t.type&&t.type==="FieldSubquery"}function Sn(t){return!!t&&!!t.operator&&!!t.right}function Ms(t){return!!t&&!!t.operator&&!!t.right}function Cn(t){return!!t&&!!t.operator&&!!t.right}function Us(t){return t&&k(t.field)&&k(t.operator)&&!ee(t.value)}function ks(t){return t&&k(t.field)&&k(t.operator)&&!ee(t.value)&&(t.literalType==="DATE_LITERAL"||Array.isArray(t.literalType)&&t.literalType[0]==="DATE_LITERAL")}function ws(t){return t&&k(t.field)&&k(t.operator)&&!ee(t.value)&&!ee(t.dateLiteralVariable)}function Ln(t){return t&&!ee(t.fn)&&k(t.operator)&&!ee(t.value)}function Qt(t){return t&&xt(t.openParen)&&ee(t.operator)&&ee(t.field)&&ee(t.fn)&&ee(t.closeParen)}function yn(t){return t&&k(t.field)&&k(t.operator)&&!ee(t.valueQuery)&&ee(t.value)}function Nn(t){return t&&!ee(t.field)}function Bs(t){return t&&!ee(t.fn)}function Gr(t){return t&&!ee(t.field)}function Ds(t){return t&&!ee(t.fn)}function ap(t){return["IN","NOT IN","INCLUDES","EXCLUDES"].includes(t)}function Gs(t,e,r){if(ee(e))return t;if(r&&e!=="APEX_BIND_VARIABLE"&&ap(r)&&!Array.isArray(t)&&(t=[t],e=Array.isArray(e)?e:[e]),Array.isArray(e)&&Array.isArray(t))return t.map((n,i)=>sp(n,e?.[i]));switch(Array.isArray(e)&&(e=e[0]),e){case"STRING":return Array.isArray(t)?t.filter(Boolean).map(n=>k(n)&&n.startsWith("'")?n:`'${n??""}'`):(t=String(t??""),k(t)&&t.startsWith("'")?t:`'${t??""}'`);case"APEX_BIND_VARIABLE":return`:${t}`;default:return t}}function sp(t,e){switch(e){case"STRING":return k(t)&&t.startsWith("'")?t:`'${t??""}'`;default:return t}}var up=typeof global=="object"&&global&&global.Object===Object&&global,On=up;var cp=typeof self=="object"&&self&&self.Object===Object&&self,fp=On||cp||Function("return this")(),oe=fp;var pp=oe.Symbol,pe=pp;var Ws=Object.prototype,hp=Ws.hasOwnProperty,dp=Ws.toString,Wr=pe?pe.toStringTag:void 0;function mp(t){var e=hp.call(t,Wr),r=t[Wr];try{t[Wr]=void 0;var n=!0}catch{}var i=dp.call(t);return n&&(e?t[Wr]=r:delete t[Wr]),i}var $s=mp;var Ep=Object.prototype,gp=Ep.toString;function xp(t){return gp.call(t)}var Vs=xp;var Ap="[object Null]",Tp="[object Undefined]",js=pe?pe.toStringTag:void 0;function Sp(t){return t==null?t===void 0?Tp:Ap:js&&js in Object(t)?$s(t):Vs(t)}var Ae=Sp;function Cp(t){return t!=null&&typeof t=="object"}var te=Cp;var Lp="[object Symbol]";function yp(t){return typeof t=="symbol"||te(t)&&Ae(t)==Lp}var At=yp;function Np(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Ke=Np;var Op=Array.isArray,C=Op;var Rp=1/0,Hs=pe?pe.prototype:void 0,Ks=Hs?Hs.toString:void 0;function Ys(t){if(typeof t=="string")return t;if(C(t))return Ke(t,Ys)+"";if(At(t))return Ks?Ks.call(t):"";var e=t+"";return e=="0"&&1/t==-Rp?"-0":e}var Xs=Ys;var Ip=/\s/;function _p(t){for(var e=t.length;e--&&Ip.test(t.charAt(e)););return e}var qs=_p;var bp=/^\s+/;function vp(t){return t&&t.slice(0,qs(t)+1).replace(bp,"")}var zs=vp;function Pp(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Y=Pp;var Qs=NaN,Fp=/^[-+]0x[0-9a-f]+$/i,Mp=/^0b[01]+$/i,Up=/^0o[0-7]+$/i,kp=parseInt;function wp(t){if(typeof t=="number")return t;if(At(t))return Qs;if(Y(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Y(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=zs(t);var r=Mp.test(t);return r||Up.test(t)?kp(t.slice(2),r?2:8):Fp.test(t)?Qs:+t}var Zs=wp;var Js=1/0,Bp=17976931348623157e292;function Dp(t){if(!t)return t===0?t:0;if(t=Zs(t),t===Js||t===-Js){var e=t<0?-1:1;return e*Bp}return t===t?t:0}var el=Dp;function Gp(t){var e=el(t),r=e%1;return e===e?r?e-r:e:0}var Ye=Gp;function Wp(t){return t}var ke=Wp;var $p="[object AsyncFunction]",Vp="[object Function]",jp="[object GeneratorFunction]",Hp="[object Proxy]";function Kp(t){if(!Y(t))return!1;var e=Ae(t);return e==Vp||e==jp||e==$p||e==Hp}var Te=Kp;var Yp=oe["__core-js_shared__"],Rn=Yp;var tl=function(){var t=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Xp(t){return!!tl&&tl in t}var rl=Xp;var qp=Function.prototype,zp=qp.toString;function Qp(t){if(t!=null){try{return zp.call(t)}catch{}try{return t+""}catch{}}return""}var lt=Qp;var Zp=/[\\^$.*+?()[\]{}|]/g,Jp=/^\[object .+?Constructor\]$/,eh=Function.prototype,th=Object.prototype,rh=eh.toString,nh=th.hasOwnProperty,ih=RegExp("^"+rh.call(nh).replace(Zp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oh(t){if(!Y(t)||rl(t))return!1;var e=Te(t)?ih:Jp;return e.test(lt(t))}var nl=oh;function ah(t,e){return t?.[e]}var il=ah;function sh(t,e){var r=il(t,e);return nl(r)?r:void 0}var Oe=sh;var lh=Oe(oe,"WeakMap"),In=lh;var ol=Object.create,uh=function(){function t(){}return function(e){if(!Y(e))return{};if(ol)return ol(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),al=uh;function ch(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var sl=ch;function fh(){}var X=fh;function ph(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ll=ph;var hh=800,dh=16,mh=Date.now;function Eh(t){var e=0,r=0;return function(){var n=mh(),i=dh-(n-r);if(r=n,i>0){if(++e>=hh)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var ul=Eh;function gh(t){return function(){return t}}var cl=gh;var xh=function(){try{var t=Oe(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Zt=xh;var Ah=Zt?function(t,e){return Zt(t,"toString",{configurable:!0,enumerable:!1,value:cl(e),writable:!0})}:ke,fl=Ah;var Th=ul(fl),pl=Th;function Sh(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var _n=Sh;function Ch(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var bn=Ch;function Lh(t){return t!==t}var hl=Lh;function yh(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var dl=yh;function Nh(t,e,r){return e===e?dl(t,e,r):bn(t,hl,r)}var Jt=Nh;function Oh(t,e){var r=t==null?0:t.length;return!!r&&Jt(t,e,0)>-1}var vn=Oh;var Rh=9007199254740991,Ih=/^(?:0|[1-9]\d*)$/;function _h(t,e){var r=typeof t;return e=e??Rh,!!e&&(r=="number"||r!="symbol"&&Ih.test(t))&&t>-1&&t%1==0&&t<e}var Tt=_h;function bh(t,e,r){e=="__proto__"&&Zt?Zt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var er=bh;function vh(t,e){return t===e||t!==t&&e!==e}var Xe=vh;var Ph=Object.prototype,Fh=Ph.hasOwnProperty;function Mh(t,e,r){var n=t[e];(!(Fh.call(t,e)&&Xe(n,r))||r===void 0&&!(e in t))&&er(t,e,r)}var St=Mh;function Uh(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=n?n(r[s],t[s],s,r,t):void 0;l===void 0&&(l=t[s]),i?er(r,s,l):St(r,s,l)}return r}var qe=Uh;var ml=Math.max;function kh(t,e,r){return e=ml(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=ml(n.length-e,0),a=Array(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),sl(t,this,s)}}var El=kh;function wh(t,e){return pl(El(t,e,ke),t+"")}var tr=wh;var Bh=9007199254740991;function Dh(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Bh}var rr=Dh;function Gh(t){return t!=null&&rr(t.length)&&!Te(t)}var ae=Gh;function Wh(t,e,r){if(!Y(r))return!1;var n=typeof e;return(n=="number"?ae(r)&&Tt(e,r.length):n=="string"&&e in r)?Xe(r[e],t):!1}var Ct=Wh;function $h(t){return tr(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&Ct(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,o)}return e})}var gl=$h;var Vh=Object.prototype;function jh(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Vh;return t===r}var ze=jh;function Hh(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var xl=Hh;var Kh="[object Arguments]";function Yh(t){return te(t)&&Ae(t)==Kh}var Eo=Yh;var Al=Object.prototype,Xh=Al.hasOwnProperty,qh=Al.propertyIsEnumerable,zh=Eo(function(){return arguments}())?Eo:function(t){return te(t)&&Xh.call(t,"callee")&&!qh.call(t,"callee")},Lt=zh;function Qh(){return!1}var Tl=Qh;var Ll=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sl=Ll&&typeof module=="object"&&module&&!module.nodeType&&module,Zh=Sl&&Sl.exports===Ll,Cl=Zh?oe.Buffer:void 0,Jh=Cl?Cl.isBuffer:void 0,ed=Jh||Tl,ut=ed;var td="[object Arguments]",rd="[object Array]",nd="[object Boolean]",id="[object Date]",od="[object Error]",ad="[object Function]",sd="[object Map]",ld="[object Number]",ud="[object Object]",cd="[object RegExp]",fd="[object Set]",pd="[object String]",hd="[object WeakMap]",dd="[object ArrayBuffer]",md="[object DataView]",Ed="[object Float32Array]",gd="[object Float64Array]",xd="[object Int8Array]",Ad="[object Int16Array]",Td="[object Int32Array]",Sd="[object Uint8Array]",Cd="[object Uint8ClampedArray]",Ld="[object Uint16Array]",yd="[object Uint32Array]",V={};V[Ed]=V[gd]=V[xd]=V[Ad]=V[Td]=V[Sd]=V[Cd]=V[Ld]=V[yd]=!0;V[td]=V[rd]=V[dd]=V[nd]=V[md]=V[id]=V[od]=V[ad]=V[sd]=V[ld]=V[ud]=V[cd]=V[fd]=V[pd]=V[hd]=!1;function Nd(t){return te(t)&&rr(t.length)&&!!V[Ae(t)]}var yl=Nd;function Od(t){return function(e){return t(e)}}var Qe=Od;var Nl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$r=Nl&&typeof module=="object"&&module&&!module.nodeType&&module,Rd=$r&&$r.exports===Nl,go=Rd&&On.process,Id=function(){try{var t=$r&&$r.require&&$r.require("util").types;return t||go&&go.binding&&go.binding("util")}catch{}}(),we=Id;var Ol=we&&we.isTypedArray,_d=Ol?Qe(Ol):yl,nr=_d;var bd=Object.prototype,vd=bd.hasOwnProperty;function Pd(t,e){var r=C(t),n=!r&&Lt(t),i=!r&&!n&&ut(t),o=!r&&!n&&!i&&nr(t),a=r||n||i||o,s=a?xl(t.length,String):[],l=s.length;for(var c in t)(e||vd.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Tt(c,l)))&&s.push(c);return s}var Pn=Pd;function Fd(t,e){return function(r){return t(e(r))}}var Fn=Fd;var Md=Fn(Object.keys,Object),Rl=Md;var Ud=Object.prototype,kd=Ud.hasOwnProperty;function wd(t){if(!ze(t))return Rl(t);var e=[];for(var r in Object(t))kd.call(t,r)&&r!="constructor"&&e.push(r);return e}var Mn=wd;function Bd(t){return ae(t)?Pn(t):Mn(t)}var w=Bd;var Dd=Object.prototype,Gd=Dd.hasOwnProperty,Wd=gl(function(t,e){if(ze(e)||ae(e)){qe(e,w(e),t);return}for(var r in e)Gd.call(e,r)&&St(t,r,e[r])}),de=Wd;function $d(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Il=$d;var Vd=Object.prototype,jd=Vd.hasOwnProperty;function Hd(t){if(!Y(t))return Il(t);var e=ze(t),r=[];for(var n in t)n=="constructor"&&(e||!jd.call(t,n))||r.push(n);return r}var _l=Hd;function Kd(t){return ae(t)?Pn(t,!0):_l(t)}var yt=Kd;var Yd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xd=/^\w*$/;function qd(t,e){if(C(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||At(t)?!0:Xd.test(t)||!Yd.test(t)||e!=null&&t in Object(e)}var ir=qd;var zd=Oe(Object,"create"),ct=zd;function Qd(){this.__data__=ct?ct(null):{},this.size=0}var bl=Qd;function Zd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var vl=Zd;var Jd="__lodash_hash_undefined__",em=Object.prototype,tm=em.hasOwnProperty;function rm(t){var e=this.__data__;if(ct){var r=e[t];return r===Jd?void 0:r}return tm.call(e,t)?e[t]:void 0}var Pl=rm;var nm=Object.prototype,im=nm.hasOwnProperty;function om(t){var e=this.__data__;return ct?e[t]!==void 0:im.call(e,t)}var Fl=om;var am="__lodash_hash_undefined__";function sm(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ct&&e===void 0?am:e,this}var Ml=sm;function or(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}or.prototype.clear=bl;or.prototype.delete=vl;or.prototype.get=Pl;or.prototype.has=Fl;or.prototype.set=Ml;var xo=or;function lm(){this.__data__=[],this.size=0}var Ul=lm;function um(t,e){for(var r=t.length;r--;)if(Xe(t[r][0],e))return r;return-1}var Nt=um;var cm=Array.prototype,fm=cm.splice;function pm(t){var e=this.__data__,r=Nt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():fm.call(e,r,1),--this.size,!0}var kl=pm;function hm(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]}var wl=hm;function dm(t){return Nt(this.__data__,t)>-1}var Bl=dm;function mm(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Dl=mm;function ar(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ar.prototype.clear=Ul;ar.prototype.delete=kl;ar.prototype.get=wl;ar.prototype.has=Bl;ar.prototype.set=Dl;var Ot=ar;var Em=Oe(oe,"Map"),Rt=Em;function gm(){this.size=0,this.__data__={hash:new xo,map:new(Rt||Ot),string:new xo}}var Gl=gm;function xm(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Wl=xm;function Am(t,e){var r=t.__data__;return Wl(e)?r[typeof e=="string"?"string":"hash"]:r.map}var It=Am;function Tm(t){var e=It(this,t).delete(t);return this.size-=e?1:0,e}var $l=Tm;function Sm(t){return It(this,t).get(t)}var Vl=Sm;function Cm(t){return It(this,t).has(t)}var jl=Cm;function Lm(t,e){var r=It(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Hl=Lm;function sr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}sr.prototype.clear=Gl;sr.prototype.delete=$l;sr.prototype.get=Vl;sr.prototype.has=jl;sr.prototype.set=Hl;var Dt=sr;var ym="Expected a function";function Ao(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ym);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ao.Cache||Dt),r}Ao.Cache=Dt;var Kl=Ao;var Nm=500;function Om(t){var e=Kl(t,function(n){return r.size===Nm&&r.clear(),n}),r=e.cache;return e}var Yl=Om;var Rm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Im=/\\(\\)?/g,_m=Yl(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Rm,function(r,n,i,o){e.push(i?o.replace(Im,"$1"):n||r)}),e}),Xl=_m;function bm(t){return t==null?"":Xs(t)}var ql=bm;function vm(t,e){return C(t)?t:ir(t,e)?[t]:Xl(ql(t))}var _t=vm;var Pm=1/0;function Fm(t){if(typeof t=="string"||At(t))return t;var e=t+"";return e=="0"&&1/t==-Pm?"-0":e}var Ze=Fm;function Mm(t,e){e=_t(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ze(e[r++])];return r&&r==n?t:void 0}var lr=Mm;function Um(t,e,r){var n=t==null?void 0:lr(t,e);return n===void 0?r:n}var zl=Um;function km(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var ur=km;var Ql=pe?pe.isConcatSpreadable:void 0;function wm(t){return C(t)||Lt(t)||!!(Ql&&t&&t[Ql])}var Zl=wm;function Jl(t,e,r,n,i){var o=-1,a=t.length;for(r||(r=Zl),i||(i=[]);++o<a;){var s=t[o];e>0&&r(s)?e>1?Jl(s,e-1,r,n,i):ur(i,s):n||(i[i.length]=s)}return i}var cr=Jl;function Bm(t){var e=t==null?0:t.length;return e?cr(t,1):[]}var ue=Bm;var Dm=Fn(Object.getPrototypeOf,Object),Un=Dm;function Gm(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var kn=Gm;function Wm(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var eu=Wm;function $m(){this.__data__=new Ot,this.size=0}var tu=$m;function Vm(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ru=Vm;function jm(t){return this.__data__.get(t)}var nu=jm;function Hm(t){return this.__data__.has(t)}var iu=Hm;var Km=200;function Ym(t,e){var r=this.__data__;if(r instanceof Ot){var n=r.__data__;if(!Rt||n.length<Km-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}var ou=Ym;function fr(t){var e=this.__data__=new Ot(t);this.size=e.size}fr.prototype.clear=tu;fr.prototype.delete=ru;fr.prototype.get=nu;fr.prototype.has=iu;fr.prototype.set=ou;var bt=fr;function Xm(t,e){return t&&qe(e,w(e),t)}var au=Xm;function qm(t,e){return t&&qe(e,yt(e),t)}var su=qm;var fu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lu=fu&&typeof module=="object"&&module&&!module.nodeType&&module,zm=lu&&lu.exports===fu,uu=zm?oe.Buffer:void 0,cu=uu?uu.allocUnsafe:void 0;function Qm(t,e){if(e)return t.slice();var r=t.length,n=cu?cu(r):new t.constructor(r);return t.copy(n),n}var pu=Qm;function Zm(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var a=t[r];e(a,r,t)&&(o[i++]=a)}return o}var pr=Zm;function Jm(){return[]}var wn=Jm;var eE=Object.prototype,tE=eE.propertyIsEnumerable,hu=Object.getOwnPropertySymbols,rE=hu?function(t){return t==null?[]:(t=Object(t),pr(hu(t),function(e){return tE.call(t,e)}))}:wn,hr=rE;function nE(t,e){return qe(t,hr(t),e)}var du=nE;var iE=Object.getOwnPropertySymbols,oE=iE?function(t){for(var e=[];t;)ur(e,hr(t)),t=Un(t);return e}:wn,Bn=oE;function aE(t,e){return qe(t,Bn(t),e)}var mu=aE;function sE(t,e,r){var n=e(t);return C(t)?n:ur(n,r(t))}var Dn=sE;function lE(t){return Dn(t,w,hr)}var Vr=lE;function uE(t){return Dn(t,yt,Bn)}var Gn=uE;var cE=Oe(oe,"DataView"),Wn=cE;var fE=Oe(oe,"Promise"),$n=fE;var pE=Oe(oe,"Set"),vt=pE;var Eu="[object Map]",hE="[object Object]",gu="[object Promise]",xu="[object Set]",Au="[object WeakMap]",Tu="[object DataView]",dE=lt(Wn),mE=lt(Rt),EE=lt($n),gE=lt(vt),xE=lt(In),Gt=Ae;(Wn&&Gt(new Wn(new ArrayBuffer(1)))!=Tu||Rt&&Gt(new Rt)!=Eu||$n&&Gt($n.resolve())!=gu||vt&&Gt(new vt)!=xu||In&&Gt(new In)!=Au)&&(Gt=function(t){var e=Ae(t),r=e==hE?t.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case dE:return Tu;case mE:return Eu;case EE:return gu;case gE:return xu;case xE:return Au}return e});var We=Gt;var AE=Object.prototype,TE=AE.hasOwnProperty;function SE(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&TE.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Su=SE;var CE=oe.Uint8Array,dr=CE;function LE(t){var e=new t.constructor(t.byteLength);return new dr(e).set(new dr(t)),e}var mr=LE;function yE(t,e){var r=e?mr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Cu=yE;var NE=/\w*$/;function OE(t){var e=new t.constructor(t.source,NE.exec(t));return e.lastIndex=t.lastIndex,e}var Lu=OE;var yu=pe?pe.prototype:void 0,Nu=yu?yu.valueOf:void 0;function RE(t){return Nu?Object(Nu.call(t)):{}}var Ou=RE;function IE(t,e){var r=e?mr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Ru=IE;var _E="[object Boolean]",bE="[object Date]",vE="[object Map]",PE="[object Number]",FE="[object RegExp]",ME="[object Set]",UE="[object String]",kE="[object Symbol]",wE="[object ArrayBuffer]",BE="[object DataView]",DE="[object Float32Array]",GE="[object Float64Array]",WE="[object Int8Array]",$E="[object Int16Array]",VE="[object Int32Array]",jE="[object Uint8Array]",HE="[object Uint8ClampedArray]",KE="[object Uint16Array]",YE="[object Uint32Array]";function XE(t,e,r){var n=t.constructor;switch(e){case wE:return mr(t);case _E:case bE:return new n(+t);case BE:return Cu(t,r);case DE:case GE:case WE:case $E:case VE:case jE:case HE:case KE:case YE:return Ru(t,r);case vE:return new n;case PE:case UE:return new n(t);case FE:return Lu(t);case ME:return new n;case kE:return Ou(t)}}var Iu=XE;function qE(t){return typeof t.constructor=="function"&&!ze(t)?al(Un(t)):{}}var _u=qE;var zE="[object Map]";function QE(t){return te(t)&&We(t)==zE}var bu=QE;var vu=we&&we.isMap,ZE=vu?Qe(vu):bu,Pu=ZE;var JE="[object Set]";function eg(t){return te(t)&&We(t)==JE}var Fu=eg;var Mu=we&&we.isSet,tg=Mu?Qe(Mu):Fu,Uu=tg;var rg=1,ng=2,ig=4,ku="[object Arguments]",og="[object Array]",ag="[object Boolean]",sg="[object Date]",lg="[object Error]",wu="[object Function]",ug="[object GeneratorFunction]",cg="[object Map]",fg="[object Number]",Bu="[object Object]",pg="[object RegExp]",hg="[object Set]",dg="[object String]",mg="[object Symbol]",Eg="[object WeakMap]",gg="[object ArrayBuffer]",xg="[object DataView]",Ag="[object Float32Array]",Tg="[object Float64Array]",Sg="[object Int8Array]",Cg="[object Int16Array]",Lg="[object Int32Array]",yg="[object Uint8Array]",Ng="[object Uint8ClampedArray]",Og="[object Uint16Array]",Rg="[object Uint32Array]",B={};B[ku]=B[og]=B[gg]=B[xg]=B[ag]=B[sg]=B[Ag]=B[Tg]=B[Sg]=B[Cg]=B[Lg]=B[cg]=B[fg]=B[Bu]=B[pg]=B[hg]=B[dg]=B[mg]=B[yg]=B[Ng]=B[Og]=B[Rg]=!0;B[lg]=B[wu]=B[Eg]=!1;function Vn(t,e,r,n,i,o){var a,s=e&rg,l=e&ng,c=e&ig;if(r&&(a=i?r(t,n,i,o):r(t)),a!==void 0)return a;if(!Y(t))return t;var p=C(t);if(p){if(a=Su(t),!s)return ll(t,a)}else{var h=We(t),d=h==wu||h==ug;if(ut(t))return pu(t,s);if(h==Bu||h==ku||d&&!i){if(a=l||d?{}:_u(t),!s)return l?mu(t,su(a,t)):du(t,au(a,t))}else{if(!B[h])return i?t:{};a=Iu(t,h,s)}}o||(o=new bt);var A=o.get(t);if(A)return A;o.set(t,a),Uu(t)?t.forEach(function(O){a.add(Vn(O,e,r,O,t,o))}):Pu(t)&&t.forEach(function(O,S){a.set(S,Vn(O,e,r,S,t,o))});var L=c?l?Gn:Vr:l?yt:w,y=p?void 0:L(t);return _n(y||t,function(O,S){y&&(S=O,O=t[S]),St(a,S,Vn(O,e,r,S,t,o))}),a}var Du=Vn;var Ig=4;function _g(t){return Du(t,Ig)}var D=_g;function bg(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Je=bg;var vg="__lodash_hash_undefined__";function Pg(t){return this.__data__.set(t,vg),this}var Gu=Pg;function Fg(t){return this.__data__.has(t)}var Wu=Fg;function jn(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Dt;++e<r;)this.add(t[e])}jn.prototype.add=jn.prototype.push=Gu;jn.prototype.has=Wu;var Er=jn;function Mg(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Hn=Mg;function Ug(t,e){return t.has(e)}var gr=Ug;var kg=1,wg=2;function Bg(t,e,r,n,i,o){var a=r&kg,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),p=o.get(e);if(c&&p)return c==e&&p==t;var h=-1,d=!0,A=r&wg?new Er:void 0;for(o.set(t,e),o.set(e,t);++h<s;){var L=t[h],y=e[h];if(n)var O=a?n(y,L,h,e,t,o):n(L,y,h,t,e,o);if(O!==void 0){if(O)continue;d=!1;break}if(A){if(!Hn(e,function(S,g){if(!gr(A,g)&&(L===S||i(L,S,r,n,o)))return A.push(g)})){d=!1;break}}else if(!(L===y||i(L,y,r,n,o))){d=!1;break}}return o.delete(t),o.delete(e),d}var Kn=Bg;function Dg(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var $u=Dg;function Gg(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var xr=Gg;var Wg=1,$g=2,Vg="[object Boolean]",jg="[object Date]",Hg="[object Error]",Kg="[object Map]",Yg="[object Number]",Xg="[object RegExp]",qg="[object Set]",zg="[object String]",Qg="[object Symbol]",Zg="[object ArrayBuffer]",Jg="[object DataView]",Vu=pe?pe.prototype:void 0,To=Vu?Vu.valueOf:void 0;function ex(t,e,r,n,i,o,a){switch(r){case Jg:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Zg:return!(t.byteLength!=e.byteLength||!o(new dr(t),new dr(e)));case Vg:case jg:case Yg:return Xe(+t,+e);case Hg:return t.name==e.name&&t.message==e.message;case Xg:case zg:return t==e+"";case Kg:var s=$u;case qg:var l=n&Wg;if(s||(s=xr),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;n|=$g,a.set(t,e);var p=Kn(s(t),s(e),n,i,o,a);return a.delete(t),p;case Qg:if(To)return To.call(t)==To.call(e)}return!1}var ju=ex;var tx=1,rx=Object.prototype,nx=rx.hasOwnProperty;function ix(t,e,r,n,i,o){var a=r&tx,s=Vr(t),l=s.length,c=Vr(e),p=c.length;if(l!=p&&!a)return!1;for(var h=l;h--;){var d=s[h];if(!(a?d in e:nx.call(e,d)))return!1}var A=o.get(t),L=o.get(e);if(A&&L)return A==e&&L==t;var y=!0;o.set(t,e),o.set(e,t);for(var O=a;++h<l;){d=s[h];var S=t[d],g=e[d];if(n)var m=a?n(g,S,d,e,t,o):n(S,g,d,t,e,o);if(!(m===void 0?S===g||i(S,g,r,n,o):m)){y=!1;break}O||(O=d=="constructor")}if(y&&!O){var I=t.constructor,_=e.constructor;I!=_&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof _=="function"&&_ instanceof _)&&(y=!1)}return o.delete(t),o.delete(e),y}var Hu=ix;var ox=1,Ku="[object Arguments]",Yu="[object Array]",Yn="[object Object]",ax=Object.prototype,Xu=ax.hasOwnProperty;function sx(t,e,r,n,i,o){var a=C(t),s=C(e),l=a?Yu:We(t),c=s?Yu:We(e);l=l==Ku?Yn:l,c=c==Ku?Yn:c;var p=l==Yn,h=c==Yn,d=l==c;if(d&&ut(t)){if(!ut(e))return!1;a=!0,p=!1}if(d&&!p)return o||(o=new bt),a||nr(t)?Kn(t,e,r,n,i,o):ju(t,e,l,r,n,i,o);if(!(r&ox)){var A=p&&Xu.call(t,"__wrapped__"),L=h&&Xu.call(e,"__wrapped__");if(A||L){var y=A?t.value():t,O=L?e.value():e;return o||(o=new bt),i(y,O,r,n,o)}}return d?(o||(o=new bt),Hu(t,e,r,n,i,o)):!1}var qu=sx;function zu(t,e,r,n,i){return t===e?!0:t==null||e==null||!te(t)&&!te(e)?t!==t&&e!==e:qu(t,e,r,n,zu,i)}var Xn=zu;var lx=1,ux=2;function cx(t,e,r,n){var i=r.length,o=i,a=!n;if(t==null)return!o;for(t=Object(t);i--;){var s=r[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=r[i];var l=s[0],c=t[l],p=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var h=new bt;if(n)var d=n(c,p,l,t,e,h);if(!(d===void 0?Xn(p,c,lx|ux,n,h):d))return!1}}return!0}var Qu=cx;function fx(t){return t===t&&!Y(t)}var qn=fx;function px(t){for(var e=w(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,qn(i)]}return e}var Zu=px;function hx(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var zn=hx;function dx(t){var e=Zu(t);return e.length==1&&e[0][2]?zn(e[0][0],e[0][1]):function(r){return r===t||Qu(r,t,e)}}var Ju=dx;function mx(t,e){return t!=null&&e in Object(t)}var ec=mx;function Ex(t,e,r){e=_t(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var a=Ze(e[n]);if(!(o=t!=null&&r(t,a)))break;t=t[a]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&rr(i)&&Tt(a,i)&&(C(t)||Lt(t)))}var Qn=Ex;function gx(t,e){return t!=null&&Qn(t,e,ec)}var tc=gx;var xx=1,Ax=2;function Tx(t,e){return ir(t)&&qn(e)?zn(Ze(t),e):function(r){var n=zl(r,t);return n===void 0&&n===e?tc(r,t):Xn(e,n,xx|Ax)}}var rc=Tx;function Sx(t){return function(e){return e?.[t]}}var nc=Sx;function Cx(t){return function(e){return lr(e,t)}}var ic=Cx;function Lx(t){return ir(t)?nc(Ze(t)):ic(t)}var oc=Lx;function yx(t){return typeof t=="function"?t:t==null?ke:typeof t=="object"?C(t)?rc(t[0],t[1]):Ju(t):oc(t)}var se=yx;function Nx(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(n,a,r(a),t)}return n}var ac=Nx;function Ox(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var l=a[t?s:++i];if(r(o[l],l,o)===!1)break}return e}}var sc=Ox;var Rx=sc(),lc=Rx;function Ix(t,e){return t&&lc(t,e,w)}var uc=Ix;function _x(t,e){return function(r,n){if(r==null)return r;if(!ae(r))return t(r,n);for(var i=r.length,o=e?i:-1,a=Object(r);(e?o--:++o<i)&&n(a[o],o,a)!==!1;);return r}}var cc=_x;var bx=cc(uc),Re=bx;function vx(t,e,r,n){return Re(t,function(i,o,a){e(n,i,r(i),a)}),n}var fc=vx;function Px(t,e){return function(r,n){var i=C(r)?ac:fc,o=e?e():{};return i(r,t,se(n,2),o)}}var pc=Px;var hc=Object.prototype,Fx=hc.hasOwnProperty,Mx=tr(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Ct(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],a=yt(o),s=-1,l=a.length;++s<l;){var c=a[s],p=t[c];(p===void 0||Xe(p,hc[c])&&!Fx.call(t,c))&&(t[c]=o[c])}return t}),Ar=Mx;function Ux(t){return te(t)&&ae(t)}var So=Ux;function kx(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var Zn=kx;var wx=200;function Bx(t,e,r,n){var i=-1,o=vn,a=!0,s=t.length,l=[],c=e.length;if(!s)return l;r&&(e=Ke(e,Qe(r))),n?(o=Zn,a=!1):e.length>=wx&&(o=gr,a=!1,e=new Er(e));e:for(;++i<s;){var p=t[i],h=r==null?p:r(p);if(p=n||p!==0?p:0,a&&h===h){for(var d=c;d--;)if(e[d]===h)continue e;l.push(p)}else o(e,h,n)||l.push(p)}return l}var dc=Bx;var Dx=tr(function(t,e){return So(t)?dc(t,cr(e,1,So,!0)):[]}),Pt=Dx;function Gx(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var et=Gx;function Wx(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ye(e),kn(t,e<0?0:e,n)):[]}var re=Wx;function $x(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ye(e),e=n-e,kn(t,0,e<0?0:e)):[]}var ft=$x;function Vx(t){return typeof t=="function"?t:ke}var mc=Vx;function jx(t,e){var r=C(t)?_n:Re;return r(t,mc(e))}var x=jx;function Hx(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Ec=Hx;function Kx(t,e){var r=!0;return Re(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var gc=Kx;function Yx(t,e,r){var n=C(t)?Ec:gc;return r&&Ct(t,e,r)&&(e=void 0),n(t,se(e,3))}var Ee=Yx;function Xx(t,e){var r=[];return Re(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Jn=Xx;function qx(t,e){var r=C(t)?pr:Jn;return r(t,se(e,3))}var ge=qx;function zx(t){return function(e,r,n){var i=Object(e);if(!ae(e)){var o=se(r,3);e=w(e),r=function(s){return o(i[s],s,i)}}var a=t(e,r,n);return a>-1?i[o?e[a]:a]:void 0}}var xc=zx;var Qx=Math.max;function Zx(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ye(r);return i<0&&(i=Qx(n+i,0)),bn(t,se(e,3),i)}var Ac=Zx;var Jx=xc(Ac),tt=Jx;function eA(t){return t&&t.length?t[0]:void 0}var he=eA;function tA(t,e){var r=-1,n=ae(t)?Array(t.length):[];return Re(t,function(i,o,a){n[++r]=e(i,o,a)}),n}var Tc=tA;function rA(t,e){var r=C(t)?Ke:Tc;return r(t,se(e,3))}var E=rA;function nA(t,e){return cr(E(t,e),1)}var Se=nA;var iA=Object.prototype,oA=iA.hasOwnProperty,aA=pc(function(t,e,r){oA.call(t,r)?t[r].push(e):er(t,r,[e])}),Co=aA;var sA=Object.prototype,lA=sA.hasOwnProperty;function uA(t,e){return t!=null&&lA.call(t,e)}var Sc=uA;function cA(t,e){return t!=null&&Qn(t,e,Sc)}var T=cA;var fA="[object String]";function pA(t){return typeof t=="string"||!C(t)&&te(t)&&Ae(t)==fA}var ce=pA;function hA(t,e){return Ke(e,function(r){return t[r]})}var Cc=hA;function dA(t){return t==null?[]:Cc(t,w(t))}var M=dA;var mA=Math.max;function EA(t,e,r,n){t=ae(t)?t:M(t),r=r&&!n?Ye(r):0;var i=t.length;return r<0&&(r=mA(i+r,0)),ce(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Jt(t,e,r)>-1}var H=EA;var gA=Math.max;function xA(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ye(r);return i<0&&(i=gA(n+i,0)),Jt(t,e,i)}var ei=xA;var AA="[object Map]",TA="[object Set]",SA=Object.prototype,CA=SA.hasOwnProperty;function LA(t){if(t==null)return!0;if(ae(t)&&(C(t)||typeof t=="string"||typeof t.splice=="function"||ut(t)||nr(t)||Lt(t)))return!t.length;var e=We(t);if(e==AA||e==TA)return!t.size;if(ze(t))return!Mn(t).length;for(var r in t)if(CA.call(t,r))return!1;return!0}var v=LA;var yA="[object RegExp]";function NA(t){return te(t)&&Ae(t)==yA}var Lc=NA;var yc=we&&we.isRegExp,OA=yc?Qe(yc):Lc,Be=OA;function RA(t){return t===void 0}var xe=RA;var IA="Expected a function";function _A(t){if(typeof t!="function")throw new TypeError(IA);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Nc=_A;function bA(t,e,r,n){if(!Y(t))return t;e=_t(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Ze(e[i]),c=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var p=s[l];c=n?n(p,l,s):void 0,c===void 0&&(c=Y(p)?p:Tt(e[i+1])?[]:{})}St(s,l,c),s=s[l]}return t}var Oc=bA;function vA(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var a=e[n],s=lr(t,a);r(s,a)&&Oc(o,_t(a,t),s)}return o}var Rc=vA;function PA(t,e){if(t==null)return{};var r=Ke(Gn(t),function(n){return[n]});return e=se(e),Rc(t,r,function(n,i){return e(n,i[0])})}var Ie=PA;function FA(t,e,r,n,i){return i(t,function(o,a,s){r=n?(n=!1,o):e(r,o,a,s)}),r}var Ic=FA;function MA(t,e,r){var n=C(t)?eu:Ic,i=arguments.length<3;return n(t,se(e,4),r,i,Re)}var le=MA;function UA(t,e){var r=C(t)?pr:Jn;return r(t,Nc(se(e,3)))}var Ft=UA;function kA(t,e){var r;return Re(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var _c=kA;function wA(t,e,r){var n=C(t)?Hn:_c;return r&&Ct(t,e,r)&&(e=void 0),n(t,se(e,3))}var jr=wA;var BA=1/0,DA=vt&&1/xr(new vt([,-0]))[1]==BA?function(t){return new vt(t)}:X,bc=DA;var GA=200;function WA(t,e,r){var n=-1,i=vn,o=t.length,a=!0,s=[],l=s;if(r)a=!1,i=Zn;else if(o>=GA){var c=e?null:bc(t);if(c)return xr(c);a=!1,i=gr,l=new Er}else l=e?[]:s;e:for(;++n<o;){var p=t[n],h=e?e(p):p;if(p=r||p!==0?p:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue e;e&&l.push(h),s.push(p)}else i(l,h,r)||(l!==s&&l.push(h),s.push(p))}return s}var vc=WA;function $A(t){return t&&t.length?vc(t):[]}var Tr=$A;function Sr(t){console&&console.error&&console.error(`Error: ${t}`)}function Hr(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Kr(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Yr(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function VA(t){return jA(t)?t.LABEL:t.name}function jA(t){return ce(t.LABEL)&&t.LABEL!==""}var Pe=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),x(this.definition,r=>{r.accept(e)})}},G=class extends Pe{constructor(e){super([]),this.idx=1,de(this,Ie(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ce=class extends Pe{constructor(e){super(e.definition),this.orgText="",de(this,Ie(e,r=>r!==void 0))}},W=class extends Pe{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,de(this,Ie(e,r=>r!==void 0))}},j=class extends Pe{constructor(e){super(e.definition),this.idx=1,de(this,Ie(e,r=>r!==void 0))}},ne=class extends Pe{constructor(e){super(e.definition),this.idx=1,de(this,Ie(e,r=>r!==void 0))}},ie=class extends Pe{constructor(e){super(e.definition),this.idx=1,de(this,Ie(e,r=>r!==void 0))}},F=class extends Pe{constructor(e){super(e.definition),this.idx=1,de(this,Ie(e,r=>r!==void 0))}},Z=class extends Pe{constructor(e){super(e.definition),this.idx=1,de(this,Ie(e,r=>r!==void 0))}},J=class extends Pe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,de(this,Ie(e,r=>r!==void 0))}},P=class{constructor(e){this.idx=1,de(this,Ie(e,r=>r!==void 0))}accept(e){e.visit(this)}};function ti(t){return E(t,Cr)}function Cr(t){function e(r){return E(r,Cr)}if(t instanceof G){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return ce(t.label)&&(r.label=t.label),r}else{if(t instanceof W)return{type:"Alternative",definition:e(t.definition)};if(t instanceof j)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof ne)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ie)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Cr(new P({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Z)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Cr(new P({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof F)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof J)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof P){let r={type:"Terminal",name:t.terminalType.name,label:VA(t.terminalType),idx:t.idx};ce(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Be(n)?n.source:n),r}else{if(t instanceof Ce)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var Le=class{visit(e){let r=e;switch(r.constructor){case G:return this.visitNonTerminal(r);case W:return this.visitAlternative(r);case j:return this.visitOption(r);case ne:return this.visitRepetitionMandatory(r);case ie:return this.visitRepetitionMandatoryWithSeparator(r);case Z:return this.visitRepetitionWithSeparator(r);case F:return this.visitRepetition(r);case J:return this.visitAlternation(r);case P:return this.visitTerminal(r);case Ce:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function Lo(t){return t instanceof W||t instanceof j||t instanceof F||t instanceof ne||t instanceof ie||t instanceof Z||t instanceof P||t instanceof Ce}function Wt(t,e=[]){return t instanceof j||t instanceof F||t instanceof Z?!0:t instanceof J?jr(t.definition,n=>Wt(n,e)):t instanceof G&&H(e,t)?!1:t instanceof Pe?(t instanceof G&&e.push(t),Ee(t.definition,n=>Wt(n,e))):!1}function yo(t){return t instanceof J}function _e(t){if(t instanceof G)return"SUBRULE";if(t instanceof j)return"OPTION";if(t instanceof J)return"OR";if(t instanceof ne)return"AT_LEAST_ONE";if(t instanceof ie)return"AT_LEAST_ONE_SEP";if(t instanceof Z)return"MANY_SEP";if(t instanceof F)return"MANY";if(t instanceof P)return"CONSUME";throw Error("non exhaustive match")}var pt=class{walk(e,r=[]){x(e.definition,(n,i)=>{let o=re(e.definition,i+1);if(n instanceof G)this.walkProdRef(n,o,r);else if(n instanceof P)this.walkTerminal(n,o,r);else if(n instanceof W)this.walkFlat(n,o,r);else if(n instanceof j)this.walkOption(n,o,r);else if(n instanceof ne)this.walkAtLeastOne(n,o,r);else if(n instanceof ie)this.walkAtLeastOneSep(n,o,r);else if(n instanceof Z)this.walkManySep(n,o,r);else if(n instanceof F)this.walkMany(n,o,r);else if(n instanceof J)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new j({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=Pc(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new j({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=Pc(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);x(e.definition,o=>{let a=new W({definition:[o]});this.walk(a,i)})}};function Pc(t,e,r){return[new j({definition:[new P({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function $t(t){if(t instanceof G)return $t(t.referencedRule);if(t instanceof P)return YA(t);if(Lo(t))return HA(t);if(yo(t))return KA(t);throw Error("non exhaustive match")}function HA(t){let e=[],r=t.definition,n=0,i=r.length>n,o,a=!0;for(;i&&a;)o=r[n],a=Wt(o),e=e.concat($t(o)),n=n+1,i=r.length>n;return Tr(e)}function KA(t){let e=E(t.definition,r=>$t(r));return Tr(ue(e))}function YA(t){return[t.terminalType]}var ri="_~IN~_";var No=class extends pt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=XA(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),a=new W({definition:o}),s=$t(a);this.follows[i]=s}};function Fc(t){let e={};return x(t,r=>{let n=new No(r).startWalking();de(e,n)}),e}function XA(t,e){return t.name+e+ri}function N(t){return t.charCodeAt(0)}function ni(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Lr(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Vt(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Xr(){throw Error("Internal Error - Should never get here!")}function Oo(t){return t.type==="Character"}var qr=[];for(let t=N("0");t<=N("9");t++)qr.push(t);var zr=[N("_")].concat(qr);for(let t=N("a");t<=N("z");t++)zr.push(t);for(let t=N("A");t<=N("Z");t++)zr.push(t);var Ro=[N(" "),N("\f"),N(`
|
|
2
|
+
`),N("\r"),N(" "),N("\v"),N(" "),N("\xA0"),N("\u1680"),N("\u2000"),N("\u2001"),N("\u2002"),N("\u2003"),N("\u2004"),N("\u2005"),N("\u2006"),N("\u2007"),N("\u2008"),N("\u2009"),N("\u200A"),N("\u2028"),N("\u2029"),N("\u202F"),N("\u205F"),N("\u3000"),N("\uFEFF")];var qA=/[0-9a-fA-F]/,ii=/[0-9]/,zA=/[1-9]/,Qr=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Lr(n,"global");break;case"i":Lr(n,"ignoreCase");break;case"m":Lr(n,"multiLine");break;case"u":Lr(n,"unicode");break;case"y":Lr(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Vt(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Xr()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Vt(r);break}if(!(e===!0&&r===void 0)&&Vt(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Vt(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Xr()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[N(`
|
|
3
|
+
`),N("\r"),N("\u2028"),N("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=qr;break;case"D":e=qr,r=!0;break;case"s":e=Ro;break;case"S":e=Ro,r=!0;break;case"w":e=zr;break;case"W":e=zr,r=!0;break}return Vt(e)?{type:"Set",value:e,complement:r}:Xr()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=N("\f");break;case"n":e=N(`
|
|
4
|
+
`);break;case"r":e=N("\r");break;case"t":e=N(" ");break;case"v":e=N("\v");break}return Vt(e)?{type:"Character",value:e}:Xr()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:N("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:N(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:N(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(Oo(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),a=o.type==="Character";if(Oo(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else ni(n.value,e),e.push(N("-")),ni(o.value,e)}else ni(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:N("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(zA.test(e)===!1)throw Error("Expecting a positive integer");for(;ii.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(ii.test(e)===!1)throw Error("Expecting an integer");for(;ii.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:N(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return ii.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(qA.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Mt=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var oi={},QA=new Qr;function yr(t){let e=t.toString();if(oi.hasOwnProperty(e))return oi[e];{let r=QA.pattern(e);return oi[e]=r,r}}function Mc(){oi={}}var kc="Complement Sets are not supported for first char optimization",Zr=`Unable to use "first char" lexer optimizations:
|
|
10
|
+
`;function wc(t,e=!1){try{let r=yr(t);return Io(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===kc)e&&Hr(`${Zr} Unable to optimize: < ${t.toString()} >
|
|
11
|
+
Complement Sets cannot be automatically optimized.
|
|
12
|
+
This will disable the lexer's first char optimizations.
|
|
13
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
|
|
14
|
+
This will disable the lexer's first char optimizations.
|
|
15
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Sr(`${Zr}
|
|
16
|
+
Failed parsing: < ${t.toString()} >
|
|
17
|
+
Using the @chevrotain/regexp-to-ast library
|
|
18
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Io(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Io(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let a=o;switch(a.type){case"Character":ai(a.value,e,r);break;case"Set":if(a.complement===!0)throw Error(kc);x(a.value,l=>{if(typeof l=="number")ai(l,e,r);else{let c=l;if(r===!0)for(let p=c.from;p<=c.to;p++)ai(p,e,r);else{for(let p=c.from;p<=c.to&&p<Nr;p++)ai(p,e,r);if(c.to>=Nr){let p=c.from>=Nr?c.from:Nr,h=c.to,d=rt(p),A=rt(h);for(let L=d;L<=A;L++)e[L]=L}}}});break;case"Group":Io(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}let s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&_o(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return M(e)}function ai(t,e,r){let n=rt(t);e[n]=n,r===!0&&ZA(t,e)}function ZA(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=rt(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=rt(i.charCodeAt(0));e[o]=o}}}function Uc(t,e){return tt(t.value,r=>{if(typeof r=="number")return H(e,r);{let n=r;return tt(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function _o(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?C(t.value)?Ee(t.value,_o):_o(t.value):!1}var bo=class extends Mt{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){H(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Uc(e,this.targetCharCodes)===void 0&&(this.found=!0):Uc(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function si(t,e){if(e instanceof RegExp){let r=yr(e),n=new bo(t);return n.visit(r),n.found}else return tt(e,r=>H(t,r.charCodeAt(0)))!==void 0}var jt="PATTERN",Or="defaultMode",li="modes",Po=typeof new RegExp("(?:)").sticky=="boolean";function Gc(t,e){e=Ar(e,{useSticky:Po,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
19
|
+
`],tracer:(g,m)=>m()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{ET()});let n;r("Reject Lexer.NA",()=>{n=Ft(t,g=>g[jt]===b.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=E(n,g=>{let m=g[jt];if(Be(m)){let I=m.source;return I.length===1&&I!=="^"&&I!=="$"&&I!=="."&&!m.ignoreCase?I:I.length===2&&I[0]==="\\"&&!H(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],I[1])?I[1]:e.useSticky?Dc(m):Bc(m)}else{if(Te(m))return i=!0,{exec:m};if(typeof m=="object")return i=!0,m;if(typeof m=="string"){if(m.length===1)return m;{let I=m.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),_=new RegExp(I);return e.useSticky?Dc(_):Bc(_)}}else throw Error("non exhaustive match")}})});let a,s,l,c,p;r("misc mapping",()=>{a=E(n,g=>g.tokenTypeIdx),s=E(n,g=>{let m=g.GROUP;if(m!==b.SKIPPED){if(ce(m))return m;if(xe(m))return!1;throw Error("non exhaustive match")}}),l=E(n,g=>{let m=g.LONGER_ALT;if(m)return C(m)?E(m,_=>ei(n,_)):[ei(n,m)]}),c=E(n,g=>g.PUSH_MODE),p=E(n,g=>T(g,"POP_MODE"))});let h;r("Line Terminator Handling",()=>{let g=Xc(e.lineTerminatorCharacters);h=E(n,m=>!1),e.positionTracking!=="onlyOffset"&&(h=E(n,m=>T(m,"LINE_BREAKS")?!!m.LINE_BREAKS:Yc(m,g)===!1&&si(g,m.PATTERN)))});let d,A,L,y;r("Misc Mapping #2",()=>{d=E(n,Hc),A=E(o,dT),L=le(n,(g,m)=>{let I=m.GROUP;return ce(I)&&I!==b.SKIPPED&&(g[I]=[]),g},{}),y=E(o,(g,m)=>({pattern:o[m],longerAlt:l[m],canLineTerminator:h[m],isCustom:d[m],short:A[m],group:s[m],push:c[m],pop:p[m],tokenTypeIdx:a[m],tokenType:n[m]}))});let O=!0,S=[];return e.safeMode||r("First Char Optimization",()=>{S=le(n,(g,m,I)=>{if(typeof m.PATTERN=="string"){let _=m.PATTERN.charCodeAt(0),be=rt(_);vo(g,be,y[I])}else if(C(m.START_CHARS_HINT)){let _;x(m.START_CHARS_HINT,be=>{let lo=typeof be=="string"?be.charCodeAt(0):be,He=rt(lo);_!==He&&(_=He,vo(g,He,y[I]))})}else if(Be(m.PATTERN))if(m.PATTERN.unicode)O=!1,e.ensureOptimizations&&Sr(`${Zr} Unable to analyze < ${m.PATTERN.toString()} > pattern.
|
|
20
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
21
|
+
This will disable the lexer's first char optimizations.
|
|
22
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let _=wc(m.PATTERN,e.ensureOptimizations);v(_)&&(O=!1),x(_,be=>{vo(g,be,y[I])})}else e.ensureOptimizations&&Sr(`${Zr} TokenType: <${m.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
23
|
+
This will disable the lexer's first char optimizations.
|
|
24
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),O=!1;return g},[])}),{emptyGroups:L,patternIdxToConfig:y,charCodeToPatternIdxToConfig:S,hasCustom:i,canBeOptimized:O}}function Wc(t,e){let r=[],n=eT(t);r=r.concat(n.errors);let i=tT(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(JA(o)),r=r.concat(uT(o)),r=r.concat(cT(o,e)),r=r.concat(fT(o)),r}function JA(t){let e=[],r=ge(t,n=>Be(n[jt]));return e=e.concat(nT(r)),e=e.concat(aT(r)),e=e.concat(sT(r)),e=e.concat(lT(r)),e=e.concat(iT(r)),e}function eT(t){let e=ge(t,i=>!T(i,jt)),r=E(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:K.MISSING_PATTERN,tokenTypes:[i]})),n=Pt(t,e);return{errors:r,valid:n}}function tT(t){let e=ge(t,i=>{let o=i[jt];return!Be(o)&&!Te(o)&&!T(o,"exec")&&!ce(o)}),r=E(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:K.INVALID_PATTERN,tokenTypes:[i]})),n=Pt(t,e);return{errors:r,valid:n}}var rT=/[^\\][$]/;function nT(t){class e extends Mt{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=ge(t,i=>{let o=i.PATTERN;try{let a=yr(o),s=new e;return s.visit(a),s.found}catch{return rT.test(o.source)}});return E(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
25
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
26
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:K.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function iT(t){let e=ge(t,n=>n.PATTERN.test(""));return E(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:K.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var oT=/[^\\[][\^]|^\^/;function aT(t){class e extends Mt{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=ge(t,i=>{let o=i.PATTERN;try{let a=yr(o),s=new e;return s.visit(a),s.found}catch{return oT.test(o.source)}});return E(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
27
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
28
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:K.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function sT(t){let e=ge(t,n=>{let i=n[jt];return i instanceof RegExp&&(i.multiline||i.global)});return E(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:K.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function lT(t){let e=[],r=E(t,o=>le(t,(a,s)=>(o.PATTERN.source===s.PATTERN.source&&!H(e,s)&&s.PATTERN!==b.NA&&(e.push(s),a.push(s)),a),[]));r=Je(r);let n=ge(r,o=>o.length>1);return E(n,o=>{let a=E(o,l=>l.name);return{message:`The same RegExp pattern ->${he(o).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:K.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function uT(t){let e=ge(t,n=>{if(!T(n,"GROUP"))return!1;let i=n.GROUP;return i!==b.SKIPPED&&i!==b.NA&&!ce(i)});return E(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:K.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function cT(t,e){let r=ge(t,i=>i.PUSH_MODE!==void 0&&!H(e,i.PUSH_MODE));return E(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:K.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function fT(t){let e=[],r=le(t,(n,i,o)=>{let a=i.PATTERN;return a===b.NA||(ce(a)?n.push({str:a,idx:o,tokenType:i}):Be(a)&&hT(a)&&n.push({str:a.source,idx:o,tokenType:i})),n},[]);return x(t,(n,i)=>{x(r,({str:o,idx:a,tokenType:s})=>{if(i<a&&pT(o,n.PATTERN)){let l=`Token: ->${s.name}<- can never be matched.
|
|
29
|
+
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
30
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:K.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),e}function pT(t,e){if(Be(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Te(e))return e(t,0,[],{});if(T(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function hT(t){return tt([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function Bc(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function Dc(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function $c(t,e,r){let n=[];return T(t,Or)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Or+`> property in its definition
|
|
31
|
+
`,type:K.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),T(t,li)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+li+`> property in its definition
|
|
32
|
+
`,type:K.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),T(t,li)&&T(t,Or)&&!T(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Or}: <${t.defaultMode}>which does not exist
|
|
33
|
+
`,type:K.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),T(t,li)&&x(t.modes,(i,o)=>{x(i,(a,s)=>{if(xe(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${s}>
|
|
34
|
+
`,type:K.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(T(a,"LONGER_ALT")){let l=C(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];x(l,c=>{!xe(c)&&!H(i,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${a.name}> outside of mode <${o}>
|
|
35
|
+
`,type:K.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function Vc(t,e,r){let n=[],i=!1,o=Je(ue(M(t.modes))),a=Ft(o,l=>l[jt]===b.NA),s=Xc(r);return e&&x(a,l=>{let c=Yc(l,s);if(c!==!1){let h={message:mT(l,c),type:c.issue,tokenType:l};n.push(h)}else T(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):si(s,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
36
|
+
This Lexer has been defined to track line and column information,
|
|
37
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
38
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
39
|
+
for details.`,type:K.NO_LINE_BREAKS_FLAGS}),n}function jc(t){let e={},r=w(t);return x(r,n=>{let i=t[n];if(C(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Hc(t){let e=t.PATTERN;if(Be(e))return!1;if(Te(e))return!0;if(T(e,"exec"))return!0;if(ce(e))return!1;throw Error("non exhaustive match")}function dT(t){return ce(t)&&t.length===1?t.charCodeAt(0):!1}var Kc={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function Yc(t,e){if(T(t,"LINE_BREAKS"))return!1;if(Be(t.PATTERN)){try{si(e,t.PATTERN)}catch(r){return{issue:K.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(ce(t.PATTERN))return!1;if(Hc(t))return{issue:K.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function mT(t,e){if(e.issue===K.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
40
|
+
The problem is in the <${t.name}> Token Type
|
|
41
|
+
Root cause: ${e.errMsg}.
|
|
42
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===K.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Xc(t){return E(t,r=>ce(r)?r.charCodeAt(0):r)}function vo(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Nr=256,ui=[];function rt(t){return t<Nr?t:ui[t]}function ET(){if(v(ui)){ui=new Array(65536);for(let t=0;t<65536;t++)ui[t]=t>255?255+~~(t/255):t}}function ht(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Rr(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var qc=1,Qc={};function dt(t){let e=gT(t);xT(e),TT(e),AT(e),x(e,r=>{r.isParent=r.categoryMatches.length>0})}function gT(t){let e=D(t),r=t,n=!0;for(;n;){r=Je(ue(E(r,o=>o.CATEGORIES)));let i=Pt(r,e);e=e.concat(i),v(i)?n=!1:r=i}return e}function xT(t){x(t,e=>{Fo(e)||(Qc[qc]=e,e.tokenTypeIdx=qc++),zc(e)&&!C(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),zc(e)||(e.CATEGORIES=[]),ST(e)||(e.categoryMatches=[]),CT(e)||(e.categoryMatchesMap={})})}function AT(t){x(t,e=>{e.categoryMatches=[],x(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Qc[n].tokenTypeIdx)})})}function TT(t){x(t,e=>{Zc([],e)})}function Zc(t,e){x(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),x(e.CATEGORIES,r=>{let n=t.concat(e);H(n,r)||Zc(n,r)})}function Fo(t){return T(t,"tokenTypeIdx")}function zc(t){return T(t,"CATEGORIES")}function ST(t){return T(t,"categoryMatches")}function CT(t){return T(t,"categoryMatchesMap")}function Jc(t){return T(t,"tokenTypeIdx")}var Mo={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var K;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(K||(K={}));var Jr={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
45
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Mo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Jr);var b=class{constructor(e,r=Jr){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);let{time:s,value:l}=Kr(o),c=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${a}<-- <${i}> time: ${s}ms`),this.traceInitIndent--,l}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
46
|
+
a boolean 2nd argument is no longer supported`);this.config=de({},Jr,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Jr.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Kc;else if(this.config.lineTerminatorCharacters===Jr.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),C(e)?i={modes:{defaultMode:D(e)},defaultMode:Or}:(o=!1,i=D(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat($c(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Vc(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},x(i.modes,(s,l)=>{i.modes[l]=Ft(s,c=>xe(c))});let a=w(i.modes);if(x(i.modes,(s,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Wc(s,a))}),v(this.lexerDefinitionErrors)){dt(s);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=Gc(s,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=de({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!v(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let l=E(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
|
|
48
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
49
|
+
`+l)}x(this.lexerDefinitionWarning,s=>{Hr(s.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Po?(this.chopInput=ke,this.match=this.matchWithTest):(this.updateLastIndex=X,this.match=this.matchWithExec),o&&(this.handleModes=X),this.trackStartLines===!1&&(this.computeNewColumn=ke),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=X),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let s=le(this.canModeBeOptimized,(l,c,p)=>(c===!1&&l.push(p),l),[]);if(r.ensureOptimizations&&!v(s))throw Error(`Lexer Modes: < ${s.join(", ")} > cannot be optimized.
|
|
50
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
51
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Mc()}),this.TRACE_INIT("toFastProperties",()=>{Yr(this)})})}tokenize(e,r=this.defaultMode){if(!v(this.lexerDefinitionErrors)){let i=E(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
|
|
52
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
53
|
+
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,a,s,l,c,p,h,d,A,L,y,O,S,g,m=e,I=m.length,_=0,be=0,lo=this.hasCustom?0:Math.floor(e.length/10),He=new Array(lo),uo=[],Ur=this.trackStartLines?1:void 0,mt=this.trackStartLines?1:void 0,kr=jc(this.emptyGroups),Qf=this.trackStartLines,co=this.config.lineTerminatorsPattern,An=0,Et=[],wr=[],Tn=[],As=[];Object.freeze(As);let Br;function Ts(){return Et}function Ss(me){let Ue=rt(me),qt=wr[Ue];return qt===void 0?As:qt}let Zf=me=>{if(Tn.length===1&&me.tokenType.PUSH_MODE===void 0){let Ue=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(me);uo.push({offset:me.startOffset,line:me.startLine,column:me.startColumn,length:me.image.length,message:Ue})}else{Tn.pop();let Ue=et(Tn);Et=this.patternIdxToConfig[Ue],wr=this.charCodeToPatternIdxToConfig[Ue],An=Et.length;let qt=this.canModeBeOptimized[Ue]&&this.config.safeMode===!1;wr&&qt?Br=Ss:Br=Ts}};function Cs(me){Tn.push(me),wr=this.charCodeToPatternIdxToConfig[me],Et=this.patternIdxToConfig[me],An=Et.length,An=Et.length;let Ue=this.canModeBeOptimized[me]&&this.config.safeMode===!1;wr&&Ue?Br=Ss:Br=Ts}Cs.call(this,r);let Ge,Ls=this.config.recoveryEnabled;for(;_<I;){l=null;let me=m.charCodeAt(_),Ue=Br(me),qt=Ue.length;for(n=0;n<qt;n++){Ge=Ue[n];let ve=Ge.pattern;c=null;let at=Ge.short;if(at!==!1?me===at&&(l=ve):Ge.isCustom===!0?(g=ve.exec(m,_,He,kr),g!==null?(l=g[0],g.payload!==void 0&&(c=g.payload)):l=null):(this.updateLastIndex(ve,_),l=this.match(ve,e,_)),l!==null){if(s=Ge.longerAlt,s!==void 0){let gt=s.length;for(o=0;o<gt;o++){let st=Et[s[o]],kt=st.pattern;if(p=null,st.isCustom===!0?(g=kt.exec(m,_,He,kr),g!==null?(a=g[0],g.payload!==void 0&&(p=g.payload)):a=null):(this.updateLastIndex(kt,_),a=this.match(kt,e,_)),a&&a.length>l.length){l=a,c=p,Ge=st;break}}}break}}if(l!==null){if(h=l.length,d=Ge.group,d!==void 0&&(A=Ge.tokenTypeIdx,L=this.createTokenInstance(l,_,A,Ge.tokenType,Ur,mt,h),this.handlePayload(L,c),d===!1?be=this.addToken(He,be,L):kr[d].push(L)),e=this.chopInput(e,h),_=_+h,mt=this.computeNewColumn(mt,h),Qf===!0&&Ge.canLineTerminator===!0){let ve=0,at,gt;co.lastIndex=0;do at=co.test(l),at===!0&&(gt=co.lastIndex-1,ve++);while(at===!0);ve!==0&&(Ur=Ur+ve,mt=h-gt,this.updateTokenEndLineColumnLocation(L,d,gt,ve,Ur,mt,h))}this.handleModes(Ge,Zf,Cs,L)}else{let ve=_,at=Ur,gt=mt,st=Ls===!1;for(;st===!1&&_<I;)for(e=this.chopInput(e,1),_++,i=0;i<An;i++){let kt=Et[i],fo=kt.pattern,ys=kt.short;if(ys!==!1?m.charCodeAt(_)===ys&&(st=!0):kt.isCustom===!0?st=fo.exec(m,_,He,kr)!==null:(this.updateLastIndex(fo,_),st=fo.exec(e)!==null),st===!0)break}if(y=_-ve,mt=this.computeNewColumn(mt,y),S=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(m,ve,y,at,gt),uo.push({offset:ve,line:at,column:gt,length:y,message:S}),Ls===!1)break}}return this.hasCustom||(He.length=be),{tokens:He,groups:kr,errors:uo}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,a,s){let l,c;r!==void 0&&(l=n===s-1,c=l?-1:0,i===1&&l===!0||(e.endLine=o+c,e.endColumn=a-1+-c))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,a){return{image:e,startOffset:r,startLine:o,startColumn:a,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:r+s-1,startLine:o,endLine:o,startColumn:a,endColumn:a+s-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};b.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.";b.NA=/NOT_APPLICABLE/;function Ht(t){return Uo(t)?t.LABEL:t.name}function Uo(t){return ce(t.LABEL)&&t.LABEL!==""}var LT="parent",ef="categories",tf="label",rf="group",nf="push_mode",of="pop_mode",af="longer_alt",sf="line_breaks",lf="start_chars_hint";function f(t){return yT(t)}function yT(t){let e=t.pattern,r={};if(r.name=t.name,xe(e)||(r.PATTERN=e),T(t,LT))throw`The parent property is no longer supported.
|
|
54
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return T(t,ef)&&(r.CATEGORIES=t[ef]),dt([r]),T(t,tf)&&(r.LABEL=t[tf]),T(t,rf)&&(r.GROUP=t[rf]),T(t,of)&&(r.POP_MODE=t[of]),T(t,nf)&&(r.PUSH_MODE=t[nf]),T(t,af)&&(r.LONGER_ALT=t[af]),T(t,sf)&&(r.LINE_BREAKS=t[sf]),T(t,lf)&&(r.START_CHARS_HINT=t[lf]),r}var $e=f({name:"EOF",pattern:b.NA});dt([$e]);function Kt(t,e,r,n,i,o,a,s){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function ko(t,e){return ht(t,e)}var ci={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Uo(t)?`--> ${Ht(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",s=`
|
|
55
|
+
but found: '`+he(e).image+"'";if(n)return o+n+s;{let l=le(t,(d,A)=>d.concat(A),[]),c=E(l,d=>`[${E(d,A=>Ht(A)).join(", ")}]`),h=`one of these possible Token sequences:
|
|
56
|
+
${E(c,(d,A)=>` ${A+1}. ${d}`).join(`
|
|
57
|
+
`)}`;return o+h+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",a=`
|
|
58
|
+
but found: '`+he(e).image+"'";if(r)return i+r+a;{let l=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
59
|
+
<${E(t,c=>`[${E(c,p=>Ht(p)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(ci);var uf={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
60
|
+
inside top level rule: ->`+t.name+"<-"}},Ve={buildDuplicateFoundError(t,e){function r(p){return p instanceof P?p.terminalType.name:p instanceof G?p.nonTerminalName:""}let n=t.name,i=he(e),o=i.idx,a=_e(i),s=r(i),l=o>0,c=`->${a}${l?o:""}<- ${s?`with argument: ->${s}<-`:""}
|
|
61
|
+
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
|
|
62
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
63
|
+
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
|
64
|
+
`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
65
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
66
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
67
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
68
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=E(t.prefixPath,i=>Ht(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
69
|
+
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
70
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
71
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
72
|
+
For Further details.`},buildAlternationAmbiguityError(t){let e=E(t.prefixPath,i=>Ht(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
75
|
+
For Further details.`,n},buildEmptyRepetitionError(t){let e=_e(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
76
|
+
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
77
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
78
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
79
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=E(t.leftRecursionPath,o=>o.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
80
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
81
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
82
|
+
${n}
|
|
83
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
84
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ce?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function cf(t,e){let r=new wo(t,e);return r.resolveRefs(),r.errors}var wo=class extends Le{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){x(M(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:fe.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Bo=class extends pt{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){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=D(this.path.ruleStack).reverse(),this.occurrenceStack=D(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){v(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},fi=class extends Bo{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new W({definition:i});this.possibleTokTypes=$t(o),this.found=!0}}},Ir=class extends pt{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},pi=class extends Ir{walkMany(e,r,n){if(e.idx===this.occurrence){let i=he(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof P&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},en=class extends Ir{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=he(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof P&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},hi=class extends Ir{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=he(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof P&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},tn=class extends Ir{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=he(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof P&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function di(t,e,r=[]){r=D(r);let n=[],i=0;function o(s){return s.concat(re(t,i+1))}function a(s){let l=di(o(s),e,r);return n.concat(l)}for(;r.length<e&&i<t.length;){let s=t[i];if(s instanceof W)return a(s.definition);if(s instanceof G)return a(s.definition);if(s instanceof j)n=a(s.definition);else if(s instanceof ne){let l=s.definition.concat([new F({definition:s.definition})]);return a(l)}else if(s instanceof ie){let l=[new W({definition:s.definition}),new F({definition:[new P({terminalType:s.separator})].concat(s.definition)})];return a(l)}else if(s instanceof Z){let l=s.definition.concat([new F({definition:[new P({terminalType:s.separator})].concat(s.definition)})]);n=a(l)}else if(s instanceof F){let l=s.definition.concat([new F({definition:s.definition})]);n=a(l)}else{if(s instanceof J)return x(s.definition,l=>{v(l.definition)===!1&&(n=a(l.definition))}),n;if(s instanceof P)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:re(t,i)}),n}function mi(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],a="EXIT_ALTERNATIVE",s=!1,l=e.length,c=l-n-1,p=[],h=[];for(h.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!v(h);){let d=h.pop();if(d===a){s&&et(h).idx<=c&&h.pop();continue}let A=d.def,L=d.idx,y=d.ruleStack,O=d.occurrenceStack;if(v(A))continue;let S=A[0];if(S===i){let g={idx:L,def:re(A),ruleStack:ft(y),occurrenceStack:ft(O)};h.push(g)}else if(S instanceof P)if(L<l-1){let g=L+1,m=e[g];if(r(m,S.terminalType)){let I={idx:g,def:re(A),ruleStack:y,occurrenceStack:O};h.push(I)}}else if(L===l-1)p.push({nextTokenType:S.terminalType,nextTokenOccurrence:S.idx,ruleStack:y,occurrenceStack:O}),s=!0;else throw Error("non exhaustive match");else if(S instanceof G){let g=D(y);g.push(S.nonTerminalName);let m=D(O);m.push(S.idx);let I={idx:L,def:S.definition.concat(o,re(A)),ruleStack:g,occurrenceStack:m};h.push(I)}else if(S instanceof j){let g={idx:L,def:re(A),ruleStack:y,occurrenceStack:O};h.push(g),h.push(a);let m={idx:L,def:S.definition.concat(re(A)),ruleStack:y,occurrenceStack:O};h.push(m)}else if(S instanceof ne){let g=new F({definition:S.definition,idx:S.idx}),m=S.definition.concat([g],re(A)),I={idx:L,def:m,ruleStack:y,occurrenceStack:O};h.push(I)}else if(S instanceof ie){let g=new P({terminalType:S.separator}),m=new F({definition:[g].concat(S.definition),idx:S.idx}),I=S.definition.concat([m],re(A)),_={idx:L,def:I,ruleStack:y,occurrenceStack:O};h.push(_)}else if(S instanceof Z){let g={idx:L,def:re(A),ruleStack:y,occurrenceStack:O};h.push(g),h.push(a);let m=new P({terminalType:S.separator}),I=new F({definition:[m].concat(S.definition),idx:S.idx}),_=S.definition.concat([I],re(A)),be={idx:L,def:_,ruleStack:y,occurrenceStack:O};h.push(be)}else if(S instanceof F){let g={idx:L,def:re(A),ruleStack:y,occurrenceStack:O};h.push(g),h.push(a);let m=new F({definition:S.definition,idx:S.idx}),I=S.definition.concat([m],re(A)),_={idx:L,def:I,ruleStack:y,occurrenceStack:O};h.push(_)}else if(S instanceof J)for(let g=S.definition.length-1;g>=0;g--){let m=S.definition[g],I={idx:L,def:m.definition.concat(re(A)),ruleStack:y,occurrenceStack:O};h.push(I),h.push(a)}else if(S instanceof W)h.push({idx:L,def:S.definition.concat(re(A)),ruleStack:y,occurrenceStack:O});else if(S instanceof Ce)h.push(NT(S,L,y,O));else throw Error("non exhaustive match")}return p}function NT(t,e,r,n){let i=D(r);i.push(t.name);let o=D(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var q;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(q||(q={}));function gi(t){if(t instanceof j||t==="Option")return q.OPTION;if(t instanceof F||t==="Repetition")return q.REPETITION;if(t instanceof ne||t==="RepetitionMandatory")return q.REPETITION_MANDATORY;if(t instanceof ie||t==="RepetitionMandatoryWithSeparator")return q.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Z||t==="RepetitionWithSeparator")return q.REPETITION_WITH_SEPARATOR;if(t instanceof J||t==="Alternation")return q.ALTERNATION;throw Error("non exhaustive match")}function pf(t,e,r,n,i,o){let a=rn(t,e,r),s=xf(a)?Rr:ht;return o(a,n,s,i)}function hf(t,e,r,n,i,o){let a=nn(t,e,i,r),s=xf(a)?Rr:ht;return o(a[0],s,n)}function df(t,e,r,n){let i=t.length,o=Ee(t,a=>Ee(a,s=>s.length===1));if(e)return function(a){let s=E(a,l=>l.GATE);for(let l=0;l<i;l++){let c=t[l],p=c.length,h=s[l];if(!(h!==void 0&&h.call(this)===!1))e:for(let d=0;d<p;d++){let A=c[d],L=A.length;for(let y=0;y<L;y++){let O=this.LA(y+1);if(r(O,A[y])===!1)continue e}return l}}};if(o&&!n){let a=E(t,l=>ue(l)),s=le(a,(l,c,p)=>(x(c,h=>{T(l,h.tokenTypeIdx)||(l[h.tokenTypeIdx]=p),x(h.categoryMatches,d=>{T(l,d)||(l[d]=p)})}),l),{});return function(){let l=this.LA(1);return s[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){let s=t[a],l=s.length;e:for(let c=0;c<l;c++){let p=s[c],h=p.length;for(let d=0;d<h;d++){let A=this.LA(d+1);if(r(A,p[d])===!1)continue e}return a}}}}function mf(t,e,r){let n=Ee(t,o=>o.length===1),i=t.length;if(n&&!r){let o=ue(t);if(o.length===1&&v(o[0].categoryMatches)){let s=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{let a=le(o,(s,l,c)=>(s[l.tokenTypeIdx]=!0,x(l.categoryMatches,p=>{s[p]=!0}),s),[]);return function(){let s=this.LA(1);return a[s.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let a=t[o],s=a.length;for(let l=0;l<s;l++){let c=this.LA(l+1);if(e(c,a[l])===!1)continue e}return!0}return!1}}var Go=class extends pt{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,q.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,q.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,q.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,q.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,q.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},Ei=class extends Le{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,q.OPTION)}visitRepetition(e){this.checkIsTarget(e,q.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,q.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,q.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,q.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,q.ALTERNATION)}};function ff(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Do(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let a=e[o];i.push(a+"_"+n.tokenTypeIdx);for(let s=0;s<n.categoryMatches.length;s++){let l="_"+n.categoryMatches[s];i.push(a+l)}}e=i}return e}function OT(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let a=e[o];if(i[a]===!0)return!1}}return!0}function Ef(t,e){let r=E(t,a=>di([a],1)),n=ff(r.length),i=E(r,a=>{let s={};return x(a,l=>{let c=Do(l.partialPath);x(c,p=>{s[p]=!0})}),s}),o=r;for(let a=1;a<=e;a++){let s=o;o=ff(s.length);for(let l=0;l<s.length;l++){let c=s[l];for(let p=0;p<c.length;p++){let h=c[p].partialPath,d=c[p].suffixDef,A=Do(h);if(OT(i,A,l)||v(d)||h.length===e){let y=n[l];if(xi(y,h)===!1){y.push(h);for(let O=0;O<A.length;O++){let S=A[O];i[l][S]=!0}}}else{let y=di(d,a+1,h);o[l]=o[l].concat(y),x(y,O=>{let S=Do(O.partialPath);x(S,g=>{i[l][g]=!0})})}}}}return n}function rn(t,e,r,n){let i=new Ei(t,q.ALTERNATION,n);return e.accept(i),Ef(i.result,r)}function nn(t,e,r,n){let i=new Ei(t,r);e.accept(i);let o=i.result,s=new Go(e,t,r).startWalking(),l=new W({definition:o}),c=new W({definition:s});return Ef([l,c],n)}function xi(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],a=n[i];if((o===a||a.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function gf(t,e){return t.length<e.length&&Ee(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function xf(t){return Ee(t,e=>Ee(e,r=>Ee(r,n=>v(n.categoryMatches))))}function Af(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return E(e,r=>Object.assign({type:fe.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Tf(t,e,r,n){let i=Se(t,l=>RT(l,r)),o=FT(t,e,r),a=Se(t,l=>bT(l,r)),s=Se(t,l=>_T(l,t,n,r));return i.concat(o,a,s)}function RT(t,e){let r=new Wo;t.accept(r);let n=r.allProductions,i=Co(n,IT),o=Ie(i,s=>s.length>1);return E(M(o),s=>{let l=he(s),c=e.buildDuplicateFoundError(t,s),p=_e(l),h={message:c,type:fe.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:p,occurrence:l.idx},d=Sf(l);return d&&(h.parameter=d),h})}function IT(t){return`${_e(t)}_#_${t.idx}_#_${Sf(t)}`}function Sf(t){return t instanceof P?t.terminalType.name:t instanceof G?t.nonTerminalName:""}var Wo=class extends Le{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function _T(t,e,r,n){let i=[];if(le(e,(a,s)=>s.name===t.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:fe.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Cf(t,e,r){let n=[],i;return H(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:fe.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Vo(t,e,r,n=[]){let i=[],o=Ai(e.definition);if(v(o))return[];{let a=t.name;H(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:fe.LEFT_RECURSION,ruleName:a});let l=Pt(o,n.concat([t])),c=Se(l,p=>{let h=D(n);return h.push(p),Vo(t,p,r,h)});return i.concat(c)}}function Ai(t){let e=[];if(v(t))return e;let r=he(t);if(r instanceof G)e.push(r.referencedRule);else if(r instanceof W||r instanceof j||r instanceof ne||r instanceof ie||r instanceof Z||r instanceof F)e=e.concat(Ai(r.definition));else if(r instanceof J)e=ue(E(r.definition,o=>Ai(o.definition)));else if(!(r instanceof P))throw Error("non exhaustive match");let n=Wt(r),i=t.length>1;if(n&&i){let o=re(t);return e.concat(Ai(o))}else return e}var on=class extends Le{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Lf(t,e){let r=new on;t.accept(r);let n=r.alternations;return Se(n,o=>{let a=ft(o.definition);return Se(a,(s,l)=>{let c=mi([s],[],ht,1);return v(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:l}),type:fe.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:l+1}]:[]})})}function yf(t,e,r){let n=new on;t.accept(n);let i=n.alternations;return i=Ft(i,a=>a.ignoreAmbiguities===!0),Se(i,a=>{let s=a.idx,l=a.maxLookahead||e,c=rn(s,t,l,a),p=vT(c,a,t,r),h=PT(c,a,t,r);return p.concat(h)})}var $o=class extends Le{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function bT(t,e){let r=new on;t.accept(r);let n=r.alternations;return Se(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:fe.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function Nf(t,e,r){let n=[];return x(t,i=>{let o=new $o;i.accept(o);let a=o.allProductions;x(a,s=>{let l=gi(s),c=s.maxLookahead||e,p=s.idx,d=nn(p,i,l,c)[0];if(v(ue(d))){let A=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:A,type:fe.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function vT(t,e,r,n){let i=[],o=le(t,(s,l,c)=>(e.definition[c].ignoreAmbiguities===!0||x(l,p=>{let h=[c];x(t,(d,A)=>{c!==A&&xi(d,p)&&e.definition[A].ignoreAmbiguities!==!0&&h.push(A)}),h.length>1&&!xi(i,p)&&(i.push(p),s.push({alts:h,path:p}))}),s),[]);return E(o,s=>{let l=E(s.alts,p=>p+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:s.path}),type:fe.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:s.alts}})}function PT(t,e,r,n){let i=le(t,(a,s,l)=>{let c=E(s,p=>({idx:l,path:p}));return a.concat(c)},[]);return Je(Se(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];let l=a.idx,c=a.path,p=ge(i,d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<l&&gf(d.path,c));return E(p,d=>{let A=[d.idx+1,l+1],L=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:A,prefixPath:d.path}),type:fe.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:L,alternatives:A}})}))}function FT(t,e,r){let n=[],i=E(e,o=>o.name);return x(t,o=>{let a=o.name;if(H(i,a)){let s=r.buildNamespaceConflictError(o);n.push({message:s,type:fe.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}function Of(t){let e=Ar(t,{errMsgProvider:uf}),r={};return x(t.rules,n=>{r[n.name]=n}),cf(r,e.errMsgProvider)}function Rf(t){return t=Ar(t,{errMsgProvider:Ve}),Tf(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var If="MismatchedTokenException",_f="NoViableAltException",bf="EarlyExitException",vf="NotAllInputParsedException",Pf=[If,_f,bf,vf];Object.freeze(Pf);function Ut(t){return H(Pf,t.name)}var _r=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Yt=class extends _r{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=If}},an=class extends _r{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=_f}},sn=class extends _r{constructor(e,r){super(e,r),this.name=vf}},ln=class extends _r{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=bf}};var jo={},Ko="InRuleRecoveryException",Ho=class extends Error{constructor(e){super(e),this.name=Ko}},Ti=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=T(e,"recoveryEnabled")?e.recoveryEnabled:ye.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=MT)}getTokenToInsert(e){let r=Kt(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),a=this.exportLexerState(),s=[],l=!1,c=this.LA(1),p=this.LA(1),h=()=>{let d=this.LA(0),A=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),L=new Yt(A,c,this.LA(0));L.resyncedTokens=ft(s),this.SAVE_ERROR(L)};for(;!l;)if(this.tokenMatcher(p,i)){h();return}else if(n.call(this)){h(),e.apply(this,r);return}else this.tokenMatcher(p,o)?l=!0:(p=this.SKIP_TOKEN(),this.addToResyncTokens(p,s));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Ho("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||v(r))return!1;let n=this.LA(1);return tt(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return H(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=tt(e,o=>ko(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return jo;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return E(e,(n,i)=>i===0?jo:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=E(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return ue(e)}getFollowSetFromFollowKey(e){if(e===jo)return[$e];let r=e.ruleName+e.idxInCallingRule+ri+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,$e)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return ft(r)}attemptInRepetitionRecovery(e,r,n,i,o,a,s){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=D(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return E(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function MT(t,e,r,n,i,o,a){let s=this.getKeyForAutomaticLookahead(n,i),l=this.firstAfterRepMap[s];if(l===void 0){let d=this.getCurrRuleFullName(),A=this.getGAstProductions()[d];l=new o(A,i).startWalking(),this.firstAfterRepMap[s]=l}let c=l.token,p=l.occurrence,h=l.isEndOfRule;this.RULE_STACK.length===1&&h&&c===void 0&&(c=$e,p=1),!(c===void 0||p===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,p,a)&&this.tryInRepetitionRecovery(t,e,r,c)}function Si(t,e,r){return r|e|t}var un=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:ye.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(v(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Se(e,r=>Vo(r,r,Ve))}validateEmptyOrAlternatives(e){return Se(e,r=>Lf(r,Ve))}validateAmbiguousAlternationAlternatives(e,r){return Se(e,n=>yf(n,r,Ve))}validateSomeNonEmptyLookaheadPath(e,r){return Nf(e,r,Ve)}buildLookaheadForAlternation(e){return pf(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,df)}buildLookaheadForOptional(e){return hf(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,gi(e.prodType),mf)}};var Li=class{initLooksAhead(e){this.dynamicTokensEnabled=T(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ye.dynamicTokensEnabled,this.maxLookahead=T(e,"maxLookahead")?e.maxLookahead:ye.maxLookahead,this.lookaheadStrategy=T(e,"lookaheadStrategy")?e.lookaheadStrategy:new un({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){x(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:a,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:l}=UT(r);x(n,c=>{let p=c.idx===0?"":c.idx;this.TRACE_INIT(`${_e(c)}${p}`,()=>{let h=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Si(this.fullRuleNameToShort[r.name],256,c.idx);this.setLaFuncCache(d,h)})}),x(i,c=>{this.computeLookaheadFunc(r,c.idx,768,"Repetition",c.maxLookahead,_e(c))}),x(o,c=>{this.computeLookaheadFunc(r,c.idx,512,"Option",c.maxLookahead,_e(c))}),x(a,c=>{this.computeLookaheadFunc(r,c.idx,1024,"RepetitionMandatory",c.maxLookahead,_e(c))}),x(s,c=>{this.computeLookaheadFunc(r,c.idx,1536,"RepetitionMandatoryWithSeparator",c.maxLookahead,_e(c))}),x(l,c=>{this.computeLookaheadFunc(r,c.idx,1280,"RepetitionWithSeparator",c.maxLookahead,_e(c))})})})}computeLookaheadFunc(e,r,n,i,o,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{let s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Si(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,s)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return Si(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Yo=class extends Le{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Ci=new Yo;function UT(t){Ci.reset(),t.accept(Ci);let e=Ci.dslMethods;return Ci.reset(),e}function zo(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Qo(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function Ff(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function Mf(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var kT="name";function Zo(t,e){Object.defineProperty(t,kT,{enumerable:!1,configurable:!0,writable:!1,value:e})}function wT(t,e){let r=w(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],a=t[o],s=a.length;for(let l=0;l<s;l++){let c=a[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function Uf(t,e){let r=function(){};Zo(r,t+"BaseSemantics");let n={visit:function(i,o){if(C(i)&&(i=i[0]),!xe(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=BT(this,e);if(!v(i)){let o=E(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
85
|
+
${o.join(`
|
|
86
|
+
|
|
87
|
+
`).replace(/\n/g,`
|
|
88
|
+
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function kf(t,e,r){let n=function(){};Zo(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return x(e,o=>{i[o]=wT}),n.prototype=i,n.prototype.constructor=n,n}var Jo;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Jo||(Jo={}));function BT(t,e){return DT(t,e)}function DT(t,e){let r=ge(e,i=>Te(t[i])===!1),n=E(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Jo.MISSING_METHOD,methodName:i}));return Je(n)}var Ri=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=T(e,"nodeLocationTracking")?e.nodeLocationTracking:ye.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=X,this.cstFinallyStateUpdate=X,this.cstPostTerminal=X,this.cstPostNonTerminal=X,this.cstPostRule=X;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Qo,this.setNodeLocationFromNode=Qo,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=zo,this.setNodeLocationFromNode=zo,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=X,this.setInitialNodeLocation=X;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Ff(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Mf(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(xe(this.baseCstVisitorConstructor)){let e=Uf(this.className,w(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(xe(this.baseCstVisitorWithDefaultsConstructor)){let e=kf(this.className,w(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var Ii=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):br}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?br:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var _i=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=vr){if(H(this.definedRulesNames,e)){let a={message:Ve.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:fe.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=vr){let i=Cf(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(Ut(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return ti(M(this.gastProductionsCache))}};var bi=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Rr,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},T(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
89
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
90
|
+
For Further details.`);if(C(e)){if(v(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
91
|
+
Note that the first argument for the parser constructor
|
|
92
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
93
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
94
|
+
For Further details.`)}if(C(e))this.tokensMap=le(e,(o,a)=>(o[a.name]=a,o),{});else if(T(e,"modes")&&Ee(ue(M(e.modes)),Jc)){let o=ue(M(e.modes)),a=Tr(o);this.tokensMap=le(a,(s,l)=>(s[l.name]=l,s),{})}else if(Y(e))this.tokensMap=D(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=$e;let n=T(e,"modes")?ue(M(e.modes)):M(e),i=Ee(n,o=>v(o.categoryMatches));this.tokenMatcher=i?Rr:ht,dt(M(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
95
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=T(n,"resyncEnabled")?n.resyncEnabled:vr.resyncEnabled,o=T(n,"recoveryValueFunc")?n.recoveryValueFunc:vr.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let s;return this.outputCst===!0?s=function(...p){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,p);let h=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(h),h}catch(h){return this.invokeRuleCatch(h,i,o)}finally{this.ruleFinallyStateUpdate()}}:s=function(...p){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),r.apply(this,p)}catch(h){return this.invokeRuleCatch(h,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(s,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Ut(e)){let a=e;if(o){let s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(a.resyncedTokens=this.reSyncTo(s),this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,a.partialCstResult=l}throw a}}else{if(i)return this.moveToTerminatedState(),n(e);throw a}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let a=e.GATE;if(a!==void 0){let s=i;i=()=>a.call(this)&&s.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let s=i;i=()=>a.call(this)&&s.call(this)}}else o=r;if(i.call(this)===!0){let a=this.doSingleRepetition(o);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,q.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,hi)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let s=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,s,i,tn],s,1536,e,tn)}else throw this.raiseEarlyExitException(e,q.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let l=i;i=()=>s.call(this)&&l.call(this)}}else o=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,pi,a)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let s=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,s,i,en],s,1280,e,en)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=C(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new sn(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw Ut(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Yt(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Ko?n:o}}else throw n}saveRecogState(){let e=this.errors,r=D(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),$e)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var vi=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=T(e,"errorMessageProvider")?e.errorMessageProvider:ye.errorMessageProvider}SAVE_ERROR(e){if(Ut(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:D(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return D(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],s=nn(e,o,r,this.maxLookahead)[0],l=[];for(let p=1;p<=this.maxLookahead;p++)l.push(this.LA(p));let c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new ln(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=rn(e,i,this.maxLookahead),a=[];for(let c=1;c<=this.maxLookahead;c++)a.push(this.LA(c));let s=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:a,previous:s,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new an(l,this.LA(1),s))}};var Pi=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(xe(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return mi([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=he(e.ruleStack),i=this.getGAstProductions()[r];return new fi(i,e).startWalking()}};var Ui={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ui);var wf=!0,Bf=Math.pow(2,8)-1,Gf=f({name:"RECORDING_PHASE_TOKEN",pattern:b.NA});dt([Gf]);var Wf=Kt(Gf,`This IToken indicates the Parser is in Recording Phase
|
|
96
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Wf);var WT={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
97
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Fi=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";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})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return br}topLevelRuleRecord(e,r){try{let n=new Ce({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
98
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
99
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return fn.call(this,j,e,r)}atLeastOneInternalRecord(e,r){fn.call(this,ne,r,e)}atLeastOneSepFirstInternalRecord(e,r){fn.call(this,ie,r,e,wf)}manyInternalRecord(e,r){fn.call(this,F,r,e)}manySepFirstInternalRecord(e,r){fn.call(this,Z,r,e,wf)}orInternalRecord(e,r){return $T.call(this,e,r)}subruleInternalRecord(e,r,n){if(Mi(r),!e||T(e,"ruleName")===!1){let s=new Error(`<SUBRULE${Df(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
100
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=et(this.recordingProdStack),o=e.ruleName,a=new G({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?WT:Ui}consumeInternalRecord(e,r,n){if(Mi(r),!Fo(e)){let a=new Error(`<CONSUME${Df(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
101
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=et(this.recordingProdStack),o=new P({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),Wf}};function fn(t,e,r,n=!1){Mi(r);let i=et(this.recordingProdStack),o=Te(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),T(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),o.call(this),i.definition.push(a),this.recordingProdStack.pop(),Ui}function $T(t,e){Mi(e);let r=et(this.recordingProdStack),n=C(t)===!1,i=n===!1?t:t.DEF,o=new J({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});T(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let a=jr(i,s=>Te(s.GATE));return o.hasPredicates=a,r.definition.push(o),x(i,s=>{let l=new W({definition:[]});o.definition.push(l),T(s,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=s.IGNORE_AMBIGUITIES:T(s,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),s.ALT.call(this),this.recordingProdStack.pop()}),Ui}function Df(t){return t===0?"":`${t}`}function Mi(t){if(t<0||t>Bf){let e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
102
|
+
Idx value must be a none negative value smaller than ${Bf+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var ki=class{initPerformanceTracer(e){if(T(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=ye.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Kr(r),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function $f(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var br=Kt($e,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(br);var ye=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ci,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),vr=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),fe;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(fe||(fe={}));var pn=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Yr(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),x(this.definedRulesNames,i=>{let a=this[i].originalGrammarAction,s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Of({rules:M(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(v(n)&&this.skipValidations===!1){let i=Rf({rules:M(this.gastProductionsCache),tokenTypes:M(this.tokensMap),errMsgProvider:Ve,grammarName:r}),o=Af({lookaheadStrategy:this.lookaheadStrategy,rules:M(this.gastProductionsCache),tokenTypes:M(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),v(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Fc(M(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:M(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(M(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!v(this.definitionErrors))throw e=E(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
103
|
+
${e.join(`
|
|
104
|
+
-------------------------------
|
|
105
|
+
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),T(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
106
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
107
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
108
|
+
For further details.`);this.skipValidations=T(r,"skipValidations")?r.skipValidations:ye.skipValidations}};pn.DEFER_DEFINITION_ERRORS_HANDLING=!1;$f(pn,[Ti,Li,Ri,Ii,bi,_i,vi,Pi,Fi,ki]);var hn=class extends pn{constructor(e,r=ye){let n=D(r);n.outputCst=!0,super(e,n)}};var U=f({name:"KeywordReserved",pattern:b.NA}),R=f({name:"Keyword",pattern:b.NA}),Fe=f({name:"DateFunction",pattern:b.NA}),Pr=f({name:"AggregateFunction",pattern:b.NA}),jf=f({name:"LocationFunction",pattern:b.NA}),jT=f({name:"FieldsFunction",pattern:b.NA}),dn=f({name:"FieldsFunctionParamIdentifier",pattern:b.NA}),mn=f({name:"OtherFunction",pattern:b.NA}),$=f({name:"DateLiteral",pattern:b.NA}),z=f({name:"DateLiteralNotIdentifier",pattern:b.NA}),Q=f({name:"DateNLiteral",pattern:b.NA}),Fr=f({name:"RelationalOperator",pattern:b.NA}),je=f({name:"SymbolIdentifier",pattern:b.NA}),En=f({name:"DateIdentifier",pattern:b.NA}),nt=f({name:"NumberIdentifier",pattern:b.NA}),wi=f({name:"DecimalNumberIdentifier",pattern:b.NA}),Hf=f({name:"IntegerNumberIdentifier",pattern:b.NA}),HT=f({name:"IdentifierNotKeyword",pattern:b.NA}),it=f({name:"UsingScopeEnumeration",pattern:b.NA}),Kf=f({name:"RParenMismatch",pattern:b.NA}),Vf=/[a-zA-Z][a-zA-Z0-9_.]*/y;function KT(t,e){Vf.lastIndex=e;let r=Vf.exec(t);return r&&r[0].includes("..")?null:r}var u=f({name:"Identifier",pattern:KT,line_breaks:!1,categories:[HT],start_chars_hint:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]}),gn=f({name:"StringIdentifier",line_breaks:!0,pattern:/(')(?:(?=(\\?))\2.)*?\1/}),YT=f({name:"WhiteSpace",pattern:/\s+/,group:b.SKIPPED}),Bi=f({name:"AND",pattern:/AND/i,longer_alt:u,categories:[R,U]}),XT=f({name:"AS",pattern:/AS/i,longer_alt:u,categories:[R,U]}),Di=f({name:"DESC",pattern:/DESC/i,longer_alt:u,categories:[R,U]}),Gi=f({name:"ASC",pattern:/ASC/i,longer_alt:u,categories:[R,U]}),ta=f({name:"ORDER_BY",pattern:/ORDER BY/i,longer_alt:u}),ra=f({name:"CUBE",pattern:/CUBE/i,longer_alt:u,categories:[R,U]}),na=f({name:"ELSE",pattern:/ELSE/i,longer_alt:u,categories:[R,U]}),ia=f({name:"EXCLUDES",pattern:/EXCLUDES/i,longer_alt:u,categories:[R,U]}),Wi=f({name:"FALSE",pattern:/FALSE/i,longer_alt:u,categories:[R,U]}),$i=f({name:"FIRST",pattern:/FIRST/i,longer_alt:u,categories:[R,U]}),oa=f({name:"FROM",pattern:/FROM/i,longer_alt:u,categories:[R,U]}),aa=f({name:"GROUP_BY",pattern:/GROUP BY/i,longer_alt:u}),sa=f({name:"HAVING",pattern:/HAVING/i,longer_alt:u,categories:[R,U]}),Vi=f({name:"IN",pattern:/IN/i,longer_alt:u,categories:[R,U]}),la=f({name:"INCLUDES",pattern:/INCLUDES/i,longer_alt:u,categories:[R,U]}),ji=f({name:"LAST",pattern:/LAST/i,longer_alt:u,categories:[R,U]}),ua=f({name:"LIKE",pattern:/LIKE/i,longer_alt:u,categories:[R,U]}),ca=f({name:"LIMIT",pattern:/LIMIT/i,longer_alt:u,categories:[R,U]}),Hi=f({name:"NOT",pattern:/NOT/i,longer_alt:u,categories:[R,U]}),Ki=f({name:"NULL",pattern:/NULL/i,longer_alt:u,categories:[R,U]}),Yi=f({name:"NULLS",pattern:/NULLS/i,longer_alt:u,categories:[R,U]}),fa=f({name:"OR",pattern:/OR/i,longer_alt:u,categories:[R,U]}),pa=f({name:"ROLLUP",pattern:/ROLLUP/i,longer_alt:u,categories:[R,U]}),ha=f({name:"SELECT",pattern:/SELECT/i,longer_alt:u,categories:[R,U]}),Xi=f({name:"TRUE",pattern:/TRUE/i,longer_alt:u,categories:[R,U]}),da=f({name:"USING",pattern:/USING/i,longer_alt:u,categories:[R,U]}),ma=f({name:"WHERE",pattern:/WHERE/i,longer_alt:u,categories:[R,U]}),Ea=f({name:"WITH",pattern:/WITH/i,longer_alt:u,categories:[R,U]}),ga=f({name:"FOR",pattern:/FOR/i,longer_alt:u,categories:[R,U]}),qi=f({name:"UPDATE",pattern:/UPDATE/i,longer_alt:u,categories:[R,U]}),xa=f({name:"ABOVE",pattern:/ABOVE/i,longer_alt:u,categories:[R,u]}),Aa=f({name:"ABOVE_OR_BELOW",pattern:/ABOVE_OR_BELOW/i,longer_alt:u,categories:[R,u]}),Ta=f({name:"new",pattern:/new/i,longer_alt:u,categories:[R,u]}),Sa=f({name:"AT",pattern:/AT/i,longer_alt:u,categories:[R,u]}),Ca=f({name:"BELOW",pattern:/BELOW/i,longer_alt:u,categories:[R,u]}),La=f({name:"DATA_CATEGORY",pattern:/DATA CATEGORY/i,longer_alt:u,categories:[R]}),ya=f({name:"END",pattern:/END/i,longer_alt:u,categories:[R,u]}),zi=f({name:"OFFSET",pattern:/OFFSET/i,longer_alt:u,categories:[R,u]}),Na=f({name:"REFERENCE",pattern:/REFERENCE/i,longer_alt:u,categories:[R,u]}),Oa=f({name:"SCOPE",pattern:/SCOPE/i,longer_alt:u,categories:[R,u]}),Ra=f({name:"TRACKING",pattern:/TRACKING/i,longer_alt:u,categories:[R,u]}),Ia=f({name:"THEN",pattern:/THEN/i,longer_alt:u,categories:[R,u]}),_a=f({name:"TYPEOF",pattern:/TYPEOF/i,longer_alt:u,categories:[R,u]}),ba=f({name:"VIEW",pattern:/VIEW/i,longer_alt:u,categories:[R,u]}),va=f({name:"VIEWSTAT",pattern:/VIEWSTAT/i,longer_alt:u,categories:[R,u]}),Pa=f({name:"WHEN",pattern:/WHEN/i,longer_alt:u,categories:[R,u]}),Fa=f({name:"SECURITY_ENFORCED",pattern:/SECURITY_ENFORCED/i,longer_alt:u,categories:[R,u]}),Ma=f({name:"SYSTEM_MODE",pattern:/SYSTEM_MODE/i,longer_alt:u,categories:[R,u]}),Ua=f({name:"USER_MODE",pattern:/USER_MODE/i,longer_alt:u,categories:[R,u]}),ka=f({name:"CALENDAR_MONTH",pattern:/CALENDAR_MONTH/i,longer_alt:u,categories:[Fe,u]}),wa=f({name:"CALENDAR_QUARTER",pattern:/CALENDAR_QUARTER/i,longer_alt:u,categories:[Fe,u]}),Ba=f({name:"CALENDAR_YEAR",pattern:/CALENDAR_YEAR/i,longer_alt:u,categories:[Fe,u]}),Da=f({name:"DAY_IN_MONTH",pattern:/DAY_IN_MONTH/i,longer_alt:u,categories:[Fe,u]}),Ga=f({name:"DAY_IN_WEEK",pattern:/DAY_IN_WEEK/i,longer_alt:u,categories:[Fe,u]}),Wa=f({name:"DAY_IN_YEAR",pattern:/DAY_IN_YEAR/i,longer_alt:u,categories:[Fe,u]}),$a=f({name:"DAY_ONLY",pattern:/DAY_ONLY/i,longer_alt:u,categories:[Fe,u]}),Va=f({name:"FISCAL_MONTH",pattern:/FISCAL_MONTH/i,longer_alt:u,categories:[Fe,u]}),ja=f({name:"FISCAL_QUARTER",pattern:/FISCAL_QUARTER/i,longer_alt:u,categories:[Fe,u]}),Ha=f({name:"FISCAL_YEAR",pattern:/FISCAL_YEAR/i,longer_alt:u,categories:[Fe,u]}),Ka=f({name:"HOUR_IN_DAY",pattern:/HOUR_IN_DAY/i,longer_alt:u,categories:[Fe,u]}),Ya=f({name:"WEEK_IN_MONTH",pattern:/WEEK_IN_MONTH/i,longer_alt:u,categories:[Fe,u]}),Xa=f({name:"WEEK_IN_YEAR",pattern:/WEEK_IN_YEAR/i,longer_alt:u,categories:[Fe,u]}),qa=f({name:"AVG",pattern:/AVG/i,longer_alt:u,categories:[Pr,u]}),za=f({name:"COUNT",pattern:/COUNT/i,longer_alt:u,categories:[Pr,u]}),Qa=f({name:"COUNT_DISTINCT",pattern:/COUNT_DISTINCT/i,longer_alt:u,categories:[Pr,u]}),Za=f({name:"MIN",pattern:/MIN/i,longer_alt:u,categories:[Pr,u]}),Ja=f({name:"MAX",pattern:/MAX/i,longer_alt:u,categories:[Pr,u]}),es=f({name:"SUM",pattern:/SUM/i,longer_alt:u,categories:[Pr,u]}),ts=f({name:"DISTANCE",pattern:/DISTANCE/i,longer_alt:u,categories:[jf,u]}),rs=f({name:"GEOLOCATION",pattern:/GEOLOCATION/i,longer_alt:u,categories:[jf,u]}),ns=f({name:"FIELDS",pattern:/FIELDS/i,longer_alt:u,categories:[jT,u]}),is=f({name:"FORMAT",pattern:/FORMAT/i,longer_alt:u,categories:[mn,u]}),os=f({name:"toLabel",pattern:/TOLABEL/i,longer_alt:u,categories:[mn,u]}),as=f({name:"convertTimezone",pattern:/CONVERTTIMEZONE/i,longer_alt:u,categories:[mn,u]}),ss=f({name:"convertCurrency",pattern:/CONVERTCURRENCY/i,longer_alt:u,categories:[mn,u]}),Qi=f({name:"GROUPING",pattern:/GROUPING/i,longer_alt:u,categories:[mn,u]}),qT=f({name:"ALL",pattern:/ALL/i,longer_alt:u,categories:[dn,u]}),zT=f({name:"CUSTOM",pattern:/CUSTOM/i,longer_alt:u,categories:[dn,u]}),QT=f({name:"STANDARD",pattern:/STANDARD/i,longer_alt:u,categories:[dn,u]}),ZT=f({name:"YESTERDAY",pattern:/YESTERDAY/i,longer_alt:u,categories:[$,u,z]}),JT=f({name:"TODAY",pattern:/TODAY/i,longer_alt:u,categories:[$,u,z]}),eS=f({name:"TOMORROW",pattern:/TOMORROW/i,longer_alt:u,categories:[$,u,z]}),tS=f({name:"LAST_WEEK",pattern:/LAST_WEEK/i,longer_alt:u,categories:[$,u,z]}),rS=f({name:"THIS_WEEK",pattern:/THIS_WEEK/i,longer_alt:u,categories:[$,u,z]}),nS=f({name:"NEXT_WEEK",pattern:/NEXT_WEEK/i,longer_alt:u,categories:[$,u,z]}),iS=f({name:"LAST_MONTH",pattern:/LAST_MONTH/i,longer_alt:u,categories:[$,u,z]}),oS=f({name:"THIS_MONTH",pattern:/THIS_MONTH/i,longer_alt:u,categories:[$,u,z]}),aS=f({name:"NEXT_MONTH",pattern:/NEXT_MONTH/i,longer_alt:u,categories:[$,u,z]}),sS=f({name:"LAST_90_DAYS",pattern:/LAST_90_DAYS/i,longer_alt:u,categories:[$,u,z]}),lS=f({name:"NEXT_90_DAYS",pattern:/NEXT_90_DAYS/i,longer_alt:u,categories:[$,u,z]}),uS=f({name:"THIS_QUARTER",pattern:/THIS_QUARTER/i,longer_alt:u,categories:[$,u,z]}),cS=f({name:"LAST_QUARTER",pattern:/LAST_QUARTER/i,longer_alt:u,categories:[$,u,z]}),fS=f({name:"NEXT_QUARTER",pattern:/NEXT_QUARTER/i,longer_alt:u,categories:[$,u,z]}),pS=f({name:"THIS_YEAR",pattern:/THIS_YEAR/i,longer_alt:u,categories:[$,u,z]}),hS=f({name:"LAST_YEAR",pattern:/LAST_YEAR/i,longer_alt:u,categories:[$,u,z]}),dS=f({name:"NEXT_YEAR",pattern:/NEXT_YEAR/i,longer_alt:u,categories:[$,u,z]}),mS=f({name:"THIS_FISCAL_QUARTER",pattern:/THIS_FISCAL_QUARTER/i,longer_alt:u,categories:[$,u,z]}),ES=f({name:"LAST_FISCAL_QUARTER",pattern:/LAST_FISCAL_QUARTER/i,longer_alt:u,categories:[$,u,z]}),gS=f({name:"NEXT_FISCAL_QUARTER",pattern:/NEXT_FISCAL_QUARTER/i,longer_alt:u,categories:[$,u,z]}),xS=f({name:"THIS_FISCAL_YEAR",pattern:/THIS_FISCAL_YEAR/i,longer_alt:u,categories:[$,u,z]}),AS=f({name:"LAST_FISCAL_YEAR",pattern:/LAST_FISCAL_YEAR/i,longer_alt:u,categories:[$,u,z]}),TS=f({name:"NEXT_FISCAL_YEAR",pattern:/NEXT_FISCAL_YEAR/i,longer_alt:u,categories:[$,u,z]}),SS=f({name:"NEXT_N_DAYS",pattern:/NEXT_N_DAYS/i,longer_alt:u,categories:[Q,u]}),CS=f({name:"LAST_N_DAYS",pattern:/LAST_N_DAYS/i,longer_alt:u,categories:[Q,u]}),LS=f({name:"N_DAYS_AGO",pattern:/N_DAYS_AGO/i,longer_alt:u,categories:[Q,u]}),yS=f({name:"NEXT_N_WEEKS",pattern:/NEXT_N_WEEKS/i,longer_alt:u,categories:[Q,u]}),NS=f({name:"LAST_N_WEEKS",pattern:/LAST_N_WEEKS/i,longer_alt:u,categories:[Q,u]}),OS=f({name:"N_WEEKS_AGO",pattern:/N_WEEKS_AGO/i,longer_alt:u,categories:[Q,u]}),RS=f({name:"NEXT_N_MONTHS",pattern:/NEXT_N_MONTHS/i,longer_alt:u,categories:[Q,u]}),IS=f({name:"LAST_N_MONTHS",pattern:/LAST_N_MONTHS/i,longer_alt:u,categories:[Q,u]}),_S=f({name:"N_MONTHS_AGO",pattern:/N_MONTHS_AGO/i,longer_alt:u,categories:[Q,u]}),bS=f({name:"NEXT_N_QUARTERS",pattern:/NEXT_N_QUARTERS/i,longer_alt:u,categories:[Q,u]}),vS=f({name:"LAST_N_QUARTERS",pattern:/LAST_N_QUARTERS/i,longer_alt:u,categories:[Q,u]}),PS=f({name:"N_QUARTERS_AGO",pattern:/N_QUARTERS_AGO/i,longer_alt:u,categories:[Q,u]}),FS=f({name:"NEXT_N_YEARS",pattern:/NEXT_N_YEARS/i,longer_alt:u,categories:[Q,u]}),MS=f({name:"LAST_N_YEARS",pattern:/LAST_N_YEARS/i,longer_alt:u,categories:[Q,u]}),US=f({name:"N_YEARS_AGO",pattern:/N_YEARS_AGO/i,longer_alt:u,categories:[Q,u]}),kS=f({name:"NEXT_N_FISCAL_QUARTERS",pattern:/NEXT_N_FISCAL_QUARTERS/i,longer_alt:u,categories:[Q,u]}),wS=f({name:"LAST_N_FISCAL_QUARTERS",pattern:/LAST_N_FISCAL_QUARTERS/i,longer_alt:u,categories:[Q,u]}),BS=f({name:"N_FISCAL_QUARTERS_AGO",pattern:/N_FISCAL_QUARTERS_AGO/i,longer_alt:u,categories:[Q,u]}),DS=f({name:"NEXT_N_FISCAL_YEARS",pattern:/NEXT_N_FISCAL_YEARS/i,longer_alt:u,categories:[Q,u]}),GS=f({name:"LAST_N_FISCAL_YEARS",pattern:/LAST_N_FISCAL_YEARS/i,longer_alt:u,categories:[Q,u]}),WS=f({name:"N_FISCAL_YEARS_AGO",pattern:/N_FISCAL_YEARS_AGO/i,longer_alt:u,categories:[Q,u]}),ls=f({name:"EQUAL",pattern:"=",categories:[Fr]}),us=f({name:"NOT_EQUAL",pattern:/!=|<>/,categories:[Fr]}),Zi=f({name:"LESS_THAN",pattern:"<",categories:[Fr]}),cs=f({name:"LESS_THAN_OR_EQUAL",pattern:"<=",categories:[Fr]}),Ji=f({name:"GREATER_THAN",pattern:">",categories:[Fr]}),fs=f({name:"GREATER_THAN_OR_EQUAL",pattern:">=",categories:[Fr]}),eo=f({name:"DECIMAL",pattern:".",categories:[je]}),to=f({name:"COLON",pattern:":",categories:[je]}),$S=f({name:"SEMICOLON",pattern:";",categories:[je]}),Ne=f({name:"COMMA",pattern:",",categories:[je]}),VS=f({name:"ASTERISK",pattern:"*",categories:[je]}),Me=f({name:"L_PAREN",pattern:"(",categories:[je]}),De=f({name:"R_PAREN",pattern:")",categories:[je]}),ps=f({name:"L_SQUARE_BRACKET",pattern:"[",categories:[je]}),hs=f({name:"R_SQUARE_BRACKET",pattern:"]",categories:[je]}),jS=f({name:"PLUS",pattern:"+",categories:[je]}),HS=f({name:"MINUS",pattern:"-",categories:[je]}),KS=f({name:"DATETIME",pattern:/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(\Z|\.[0-9]+Z|\+[0-9]{2}:[0-9]{2}|\-[0-9]{2}:[0-9]{2}|\+[0-9]{4}|\-[0-9]{4})/i,categories:[En]}),YS=f({name:"DATE",pattern:/[0-9]{4}-[0-9]{2}-[0-9]{2}/,categories:[En]}),ro=f({name:"CURRENCY_PREFIXED_DECIMAL",pattern:/[a-zA-Z]{3}[0-9]+\.\d+/,longer_alt:u,categories:[wi]}),XS=f({name:"SIGNED_DECIMAL",pattern:/(\-|\+)[0-9]*\.\d+/,categories:[nt,wi]}),qS=f({name:"UNSIGNED_DECIMAL",pattern:/[0-9]*\.\d+/,categories:[nt,wi]}),no=f({name:"CURRENCY_PREFIXED_INTEGER",pattern:/[a-zA-Z]{3}-?[0-9]+/,longer_alt:u,categories:[wi,u]}),ds=f({name:"SIGNED_INTEGER",pattern:/(\-|\+)[0-9]+/,categories:[nt,Hf]}),xn=f({name:"GEOLOCATION_UNIT",pattern:/'(mi|km)'/i,longer_alt:u,categories:[u]}),Xt=f({name:"UNSIGNED_INTEGER",pattern:/0|[1-9]\d*/,categories:[nt,Hf]}),zS=f({name:"Delegated",pattern:/DELEGATED/i,longer_alt:u,categories:[it,u],start_chars_hint:["D","d"]}),QS=f({name:"Everything",pattern:/EVERYTHING/i,longer_alt:u,categories:[it,u],start_chars_hint:["E","e"]}),ZS=f({name:"MineAndMyGroups",pattern:/MINEANDMYGROUPS/i,longer_alt:u,categories:[it,u],start_chars_hint:["M","m"]}),JS=f({name:"Mine",pattern:/MINE/i,longer_alt:u,categories:[it,u],start_chars_hint:["M","m"]}),eC=f({name:"MyTerritory",pattern:/MY_TERRITORY/i,longer_alt:u,categories:[it,u],start_chars_hint:["M","m"]}),tC=f({name:"MyTeamTerritory",pattern:/MY_TEAM_TERRITORY/i,longer_alt:u,categories:[it,u],start_chars_hint:["M","m"]}),rC=f({name:"Team",pattern:/TEAM/i,longer_alt:u,categories:[it,u],start_chars_hint:["T","t"]}),nC=f({name:"AllPrivate",pattern:/ALLPRIVATE/i,longer_alt:u,categories:[it,u],start_chars_hint:["A","a"]}),ms=[YT,Bi,Gi,XT,ta,ra,Di,na,ia,Wi,$i,oa,Qi,aa,sa,la,ua,ca,Yi,Ki,pa,ha,Xi,da,ma,Ea,qi,zS,QS,ZS,JS,eC,tC,rC,nC,Aa,xa,Ta,Sa,Ca,La,ya,zi,Na,Oa,Ra,Ia,_a,va,ba,Pa,Fa,Ma,Ua,ka,wa,Ba,Da,Ga,Wa,$a,Va,ja,Ha,Ka,Ya,Xa,qa,Qa,za,Za,Ja,es,ts,rs,ns,is,os,as,ss,ZT,JT,eS,tS,rS,nS,iS,oS,aS,sS,lS,uS,cS,fS,pS,hS,dS,mS,ES,gS,xS,AS,TS,SS,CS,LS,yS,NS,OS,RS,IS,_S,bS,vS,PS,FS,MS,US,kS,wS,BS,DS,GS,WS,xn,qT,zT,QT,Vi,ga,fa,ji,Hi,ro,no,gn,u,KS,YS,XS,qS,Xt,ds,ls,us,cs,Zi,fs,Ji,eo,to,$S,Ne,VS,Me,De,ps,hs,jS,HS],iC=new b(ms,{ensureOptimizations:!0,skipValidations:!1});function Yf(t){return iC.tokenize(t)}var Es=class extends Error{constructor(e){super(`${e.message} (${e.line}:${e.column})`),this.name="LexingError"}},io=class extends Error{constructor(e){super(e.message),this.name=e.name}},Mr=class extends hn{constructor({ignoreParseErrors:r}={ignoreParseErrors:!1}){super(ms,{skipValidations:!1,recoveryEnabled:!!r});this.$_dateFunctionOr=void 0;this.$_aggregateFunction=void 0;this.$_otherFunction=void 0;this.$_atomicExpression=void 0;this.$_apexBindVariableExpression=void 0;this.$_arrayExpression=void 0;this.$_relationalOperator=void 0;this.$_selectClause=void 0;this.$_selectClauseFunctionIdentifier=void 0;this.$_withDataCategoryArr=void 0;this.allowApexBindVariables=!1;this.ignoreParseErrors=!1;this.selectStatement=this.RULE("selectStatement",()=>{this.SUBRULE(this.selectClause),this.SUBRULE(this.fromClause),this.SUBRULE(this.clauseStatements)});this.selectStatementPartial=this.RULE("selectStatementPartial",()=>{this.OPTION(()=>{this.SUBRULE(this.selectClause)}),this.OPTION1(()=>{this.SUBRULE(this.fromClause)}),this.SUBRULE(this.clauseStatements)});this.clauseStatements=this.RULE("clauseStatements",()=>{this.OPTION(()=>{this.SUBRULE(this.usingScopeClause)}),this.OPTION1(()=>{this.SUBRULE(this.whereClause)}),this.OPTION2(()=>{this.MANY({DEF:()=>{this.SUBRULE(this.withClause)}})}),this.OPTION3(()=>{this.SUBRULE(this.groupByClause),this.OPTION4(()=>{this.SUBRULE(this.havingClause)})}),this.OPTION5(()=>{this.SUBRULE(this.orderByClause)}),this.OPTION6(()=>{this.SUBRULE(this.limitClause)}),this.OPTION7(()=>{this.SUBRULE(this.offsetClause)}),this.OPTION8(()=>{this.SUBRULE(this.forViewOrReference)}),this.OPTION9(()=>{this.SUBRULE(this.updateTrackingViewstat)})});this.selectClause=this.RULE("selectClause",()=>{this.CONSUME(ha),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.OR(this.$_selectClause||(this.$_selectClause=[{ALT:()=>this.SUBRULE(this.selectClauseFunctionIdentifier,{LABEL:"field"})},{ALT:()=>this.SUBRULE(this.selectClauseSubqueryIdentifier,{LABEL:"field"})},{ALT:()=>this.SUBRULE(this.selectClauseTypeOf,{LABEL:"field"})},{ALT:()=>this.SUBRULE(this.selectClauseIdentifier,{LABEL:"field"})}]))}})},{resyncEnabled:!1});this.selectClauseFunctionIdentifier=this.RULE("selectClauseFunctionIdentifier",()=>{this.OR(this.$_selectClauseFunctionIdentifier||(this.$_selectClauseFunctionIdentifier=[{ALT:()=>this.SUBRULE(this.dateFunction,{LABEL:"fn"})},{ALT:()=>this.SUBRULE(this.aggregateFunction,{LABEL:"fn"})},{ALT:()=>this.SUBRULE(this.locationFunction,{LABEL:"fn"})},{ALT:()=>this.SUBRULE(this.fieldsFunction,{LABEL:"fn"})},{ALT:()=>this.SUBRULE(this.otherFunction,{LABEL:"fn"})}])),this.OPTION(()=>this.CONSUME(u,{LABEL:"alias"}))},{resyncEnabled:!1});this.selectClauseSubqueryIdentifier=this.RULE("selectClauseSubqueryIdentifier",()=>{this.CONSUME(Me),this.SUBRULE(this.selectStatement),this.CONSUME(De)},{resyncEnabled:!1});this.selectClauseTypeOf=this.RULE("selectClauseTypeOf",()=>{this.CONSUME(_a),this.CONSUME(u,{LABEL:"typeOfField"}),this.AT_LEAST_ONE({DEF:()=>{this.SUBRULE(this.selectClauseTypeOfThen)}}),this.OPTION(()=>{this.SUBRULE(this.selectClauseTypeOfElse)}),this.CONSUME(ya)},{resyncEnabled:!1});this.selectClauseIdentifier=this.RULE("selectClauseIdentifier",()=>{this.CONSUME(u,{LABEL:"field"}),this.OPTION(()=>this.CONSUME1(u,{LABEL:"alias"}))},{resyncEnabled:!1});this.selectClauseTypeOfThen=this.RULE("selectClauseTypeOfThen",()=>{this.CONSUME(Pa),this.CONSUME(u,{LABEL:"typeOfField"}),this.CONSUME(Ia),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.CONSUME1(u,{LABEL:"field"})}})},{resyncEnabled:!1});this.selectClauseTypeOfElse=this.RULE("selectClauseTypeOfElse",()=>{this.CONSUME(na),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.CONSUME(u,{LABEL:"field"})}})},{resyncEnabled:!1});this.fromClause=this.RULE("fromClause",()=>{this.CONSUME(oa),this.CONSUME(u),this.OPTION({GATE:()=>!(this.LA(1).tokenType===zi&&this.LA(2).tokenType===Xt),DEF:()=>this.CONSUME1(u,{LABEL:"alias"})})},{resyncEnabled:!1});this.usingScopeClause=this.RULE("usingScopeClause",()=>{this.CONSUME(da),this.CONSUME(Oa),this.CONSUME(it)});this.whereClause=this.RULE("whereClause",()=>{this.CONSUME(ma);let r=this.getParenCount();this.AT_LEAST_ONE({DEF:()=>{this.SUBRULE(this.conditionExpression,{ARGS:[r,!0,!0]})}}),this.$_checkBalancedParens(r)});this.whereClauseSubqueryIdentifier=this.RULE("whereClauseSubqueryIdentifier",()=>{this.CONSUME(Me),this.SUBRULE(this.selectStatement),this.CONSUME(De)});this.conditionExpression=this.RULE("conditionExpression",(r,n,i)=>{r=this.getParenCount(r),this.OPTION(()=>{this.OR([{ALT:()=>this.CONSUME(Bi,{LABEL:"logicalOperator"})},{ALT:()=>this.CONSUME(fa,{LABEL:"logicalOperator"})}])}),this.MANY({MAX_LOOKAHEAD:10,DEF:()=>this.SUBRULE(this.expressionPartWithNegation,{ARGS:[r],LABEL:"expressionNegation"})}),this.OR1({MAX_LOOKAHEAD:10,DEF:[{ALT:()=>this.SUBRULE(this.expression,{ARGS:[r,!1,n,i]})}]})});this.withClause=this.RULE("withClause",()=>{this.CONSUME(Ea),this.OR([{ALT:()=>this.CONSUME(Fa,{LABEL:"withSecurityEnforced"})},{ALT:()=>this.CONSUME(Ua,{LABEL:"withAccessLevel"})},{ALT:()=>this.CONSUME(Ma,{LABEL:"withAccessLevel"})},{ALT:()=>this.SUBRULE(this.withDataCategory)}])});this.withDataCategory=this.RULE("withDataCategory",()=>{this.CONSUME(La),this.AT_LEAST_ONE_SEP({SEP:Bi,DEF:()=>{this.SUBRULE(this.withDataCategoryArr)}})});this.withDataCategoryArr=this.RULE("withDataCategoryArr",()=>{this.CONSUME(u,{LABEL:"dataCategoryGroupName"}),this.OR(this.$_withDataCategoryArr||(this.$_withDataCategoryArr=[{ALT:()=>this.CONSUME(Sa,{LABEL:"filteringSelector"})},{ALT:()=>this.CONSUME(xa,{LABEL:"filteringSelector"})},{ALT:()=>this.CONSUME(Ca,{LABEL:"filteringSelector"})},{ALT:()=>this.CONSUME(Aa,{LABEL:"filteringSelector"})}])),this.OPTION(()=>{this.CONSUME1(Me)}),this.AT_LEAST_ONE_SEP1({SEP:Ne,DEF:()=>{this.CONSUME1(u,{LABEL:"dataCategoryName"})}}),this.OPTION1(()=>{this.CONSUME2(De)})});this.groupByClause=this.RULE("groupByClause",()=>{this.CONSUME(aa),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.OR([{ALT:()=>this.SUBRULE(this.cubeFunction,{LABEL:"groupBy"})},{ALT:()=>this.SUBRULE(this.rollupFunction,{LABEL:"groupBy"})},{ALT:()=>this.SUBRULE(this.dateFunction,{LABEL:"groupBy"})},{ALT:()=>this.CONSUME(u,{LABEL:"groupBy"})}])}})});this.havingClause=this.RULE("havingClause",()=>{this.CONSUME(sa);let r=this.getParenCount();this.AT_LEAST_ONE({DEF:()=>{this.SUBRULE(this.conditionExpression,{ARGS:[r,!0,!1]})}}),this.$_checkBalancedParens(r)});this.orderByClause=this.RULE("orderByClause",()=>{this.CONSUME(ta),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.OR([{ALT:()=>this.SUBRULE(this.orderByGroupingFunctionExpression,{LABEL:"orderByExpressionOrFn"})},{ALT:()=>this.SUBRULE(this.orderBySpecialFunctionExpression,{LABEL:"orderByExpressionOrFn"})},{ALT:()=>this.SUBRULE(this.orderByExpression,{LABEL:"orderByExpressionOrFn"})}])}})});this.orderByExpression=this.RULE("orderByExpression",()=>{this.CONSUME(u),this.OPTION(()=>{this.OR([{ALT:()=>this.CONSUME(Gi,{LABEL:"order"})},{ALT:()=>this.CONSUME(Di,{LABEL:"order"})}])}),this.OPTION1(()=>{this.CONSUME(Yi),this.OR1([{ALT:()=>this.CONSUME($i,{LABEL:"nulls"})},{ALT:()=>this.CONSUME(ji,{LABEL:"nulls"})}])})});this.orderByGroupingFunctionExpression=this.RULE("orderByGroupingFunctionExpression",()=>{this.CONSUME(Qi,{LABEL:"fn"}),this.SUBRULE(this.functionExpression)});this.orderBySpecialFunctionExpression=this.RULE("orderBySpecialFunctionExpression",()=>{this.OR([{ALT:()=>this.SUBRULE(this.aggregateFunction)},{ALT:()=>this.SUBRULE(this.dateFunction)},{ALT:()=>this.SUBRULE(this.locationFunction)}]),this.OPTION(()=>{this.OR1([{ALT:()=>this.CONSUME(Gi,{LABEL:"order"})},{ALT:()=>this.CONSUME(Di,{LABEL:"order"})}])}),this.OPTION1(()=>{this.CONSUME(Yi),this.OR2([{ALT:()=>this.CONSUME($i,{LABEL:"nulls"})},{ALT:()=>this.CONSUME(ji,{LABEL:"nulls"})}])})});this.limitClause=this.RULE("limitClause",()=>{this.CONSUME(ca),this.CONSUME(Xt,{LABEL:"value"})});this.offsetClause=this.RULE("offsetClause",()=>{this.CONSUME(zi),this.CONSUME(Xt,{LABEL:"value"})});this.dateFunction=this.RULE("dateFunction",()=>{this.OR(this.$_dateFunctionOr||(this.$_dateFunctionOr=[{ALT:()=>this.CONSUME(ka,{LABEL:"fn"})},{ALT:()=>this.CONSUME(wa,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ba,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Da,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ga,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Wa,{LABEL:"fn"})},{ALT:()=>this.CONSUME($a,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Va,{LABEL:"fn"})},{ALT:()=>this.CONSUME(ja,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ha,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ka,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ya,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Xa,{LABEL:"fn"})}])),this.SUBRULE(this.functionExpression)});this.aggregateFunction=this.RULE("aggregateFunction",()=>{this.OR(this.$_aggregateFunction||(this.$_aggregateFunction=[{ALT:()=>this.CONSUME(qa,{LABEL:"fn"})},{ALT:()=>this.CONSUME(za,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Qa,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Za,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Ja,{LABEL:"fn"})},{ALT:()=>this.CONSUME(es,{LABEL:"fn"})}])),this.SUBRULE(this.functionExpression,{ARGS:[!0]})});this.fieldsFunction=this.RULE("fieldsFunction",()=>{this.CONSUME(ns,{LABEL:"fn"}),this.CONSUME(Me),this.CONSUME(dn,{LABEL:"params"}),this.CONSUME(De)});this.otherFunction=this.RULE("otherFunction",()=>{this.OR(this.$_otherFunction||(this.$_otherFunction=[{ALT:()=>this.CONSUME(is,{LABEL:"fn"})},{ALT:()=>this.CONSUME(os,{LABEL:"fn"})},{ALT:()=>this.CONSUME(as,{LABEL:"fn"})},{ALT:()=>this.CONSUME(ss,{LABEL:"fn"})},{ALT:()=>this.CONSUME(Qi,{LABEL:"fn"})}])),this.SUBRULE(this.functionExpression)});this.cubeFunction=this.RULE("cubeFunction",()=>{this.CONSUME(ra,{LABEL:"fn"}),this.SUBRULE(this.functionExpression)});this.rollupFunction=this.RULE("rollupFunction",()=>{this.CONSUME(pa,{LABEL:"fn"}),this.SUBRULE(this.functionExpression)});this.functionExpression=this.RULE("functionExpression",r=>{this.CONSUME(Me),this.MANY_SEP({SEP:Ne,DEF:()=>{this.OR([{GATE:()=>!r,ALT:()=>this.SUBRULE(this.aggregateFunction,{LABEL:"params"})},{ALT:()=>this.SUBRULE(this.otherFunction,{LABEL:"params"})},{ALT:()=>this.CONSUME(gn,{LABEL:"params"})},{ALT:()=>this.CONSUME(nt,{LABEL:"params"})},{ALT:()=>this.CONSUME(u,{LABEL:"params"})}])}}),this.CONSUME(De)});this.locationFunction=this.RULE("locationFunction",()=>{this.CONSUME(ts),this.CONSUME(Me),this.CONSUME(u,{LABEL:"location1"}),this.CONSUME(Ne),this.OR([{ALT:()=>this.SUBRULE(this.geolocationFunction,{LABEL:"location2"})},{ALT:()=>this.CONSUME1(u,{LABEL:"location2"})}]),this.CONSUME1(Ne),this.CONSUME(xn,{LABEL:"unit"}),this.CONSUME(De)});this.geolocationFunction=this.RULE("geolocationFunction",()=>{this.CONSUME(rs),this.CONSUME(Me),this.CONSUME(nt,{LABEL:"latitude"}),this.CONSUME(Ne),this.CONSUME1(nt,{LABEL:"longitude"}),this.CONSUME(De)});this.expressionPartWithNegation=this.RULE("expressionPartWithNegation",r=>{let n=0;this.MANY(()=>{this.CONSUME(Me),n++}),this.CONSUME(Hi,{LABEL:"expressionNegation"}),r&&n&&(r.left+=n)});this.expression=this.RULE("expression",(r,n,i,o)=>{this.OPTION1(()=>{this.MANY1(()=>{this.CONSUME(Me),r&&r.left++})}),this.OR1([{GATE:()=>!!i,ALT:()=>this.SUBRULE(this.aggregateFunction,{LABEL:"lhs"})},{GATE:()=>!!o,ALT:()=>this.SUBRULE(this.locationFunction,{LABEL:"lhs"})},{ALT:()=>this.SUBRULE(this.dateFunction,{LABEL:"lhs"})},{ALT:()=>this.SUBRULE(this.otherFunction,{LABEL:"lhs"})},{ALT:()=>this.CONSUME(u,{LABEL:"lhs"})}]),this.OR2([{ALT:()=>this.SUBRULE(this.expressionWithRelationalOperator,{LABEL:"operator"})},{ALT:()=>this.SUBRULE(this.expressionWithSetOperator,{LABEL:"operator",ARGS:[n]})}]),this.OPTION3(()=>{this.MANY2({GATE:()=>r?r.left>r.right:!0,DEF:()=>{this.CONSUME(De),r&&r.right++}})})});this.expressionWithRelationalOperator=this.RULE("expressionWithRelationalOperator",()=>{this.SUBRULE(this.relationalOperator),this.SUBRULE(this.atomicExpression,{LABEL:"rhs"})});this.expressionWithSetOperator=this.RULE("expressionWithSetOperator",r=>{this.SUBRULE(this.setOperator),this.SUBRULE2(this.atomicExpression,{LABEL:"rhs",ARGS:[!0,r]})});this.atomicExpression=this.RULE("atomicExpression",(r,n)=>{this.OR(this.$_atomicExpression||(this.$_atomicExpression=[{GATE:()=>this.allowApexBindVariables,ALT:()=>this.SUBRULE(this.apexBindVariableExpression)},{GATE:()=>r,ALT:()=>this.SUBRULE(this.arrayExpression)},{GATE:()=>r&&n,ALT:()=>this.SUBRULE(this.whereClauseSubqueryIdentifier)},{GATE:()=>!r,ALT:()=>this.CONSUME(En)},{GATE:()=>!r,ALT:()=>this.CONSUME(ro,{LABEL:"CurrencyPrefixedDecimal"})},{GATE:()=>!r,ALT:()=>this.CONSUME(no,{LABEL:"CurrencyPrefixedInteger"})},{GATE:()=>!r,ALT:()=>this.CONSUME(nt)},{GATE:()=>!r,ALT:()=>this.CONSUME(Ki)},{GATE:()=>!r,ALT:()=>this.SUBRULE(this.booleanValue)},{GATE:()=>!r,ALT:()=>this.CONSUME($)},{GATE:()=>!r,ALT:()=>this.SUBRULE(this.dateNLiteral)},{GATE:()=>!r,ALT:()=>this.CONSUME(xn,{LABEL:"StringIdentifier"})},{GATE:()=>!r,ALT:()=>this.CONSUME(gn)}]))});this.apexBindVariableExpression=this.RULE("apexBindVariableExpression",()=>{this.CONSUME(to),this.OPTION(()=>{this.SUBRULE(this.apexBindVariableNewInstantiation,{LABEL:"apex"}),this.OPTION1(()=>{this.CONSUME(eo)})}),this.MANY_SEP({SEP:eo,DEF:()=>{this.OR(this.$_apexBindVariableExpression||(this.$_apexBindVariableExpression=[{ALT:()=>this.SUBRULE(this.apexBindVariableFunctionCall,{LABEL:"apex"})},{ALT:()=>this.SUBRULE(this.apexBindVariableIdentifier,{LABEL:"apex"})}]))}})});this.apexBindVariableIdentifier=this.RULE("apexBindVariableIdentifier",()=>{this.CONSUME(u),this.OPTION(()=>this.SUBRULE(this.apexBindVariableFunctionArrayAccessor))});this.apexBindVariableNewInstantiation=this.RULE("apexBindVariableNewInstantiation",()=>{this.CONSUME(Ta,{LABEL:"new"}),this.CONSUME(u,{LABEL:"function"}),this.OPTION(()=>{this.SUBRULE(this.apexBindVariableGeneric)}),this.SUBRULE(this.apexBindVariableFunctionParams),this.OPTION1(()=>this.SUBRULE(this.apexBindVariableFunctionArrayAccessor))});this.apexBindVariableFunctionCall=this.RULE("apexBindVariableFunctionCall",()=>{this.CONSUME(u,{LABEL:"function"}),this.SUBRULE(this.apexBindVariableFunctionParams),this.OPTION(()=>this.SUBRULE(this.apexBindVariableFunctionArrayAccessor))});this.apexBindVariableGeneric=this.RULE("apexBindVariableGeneric",()=>{this.CONSUME(Zi),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.CONSUME(u,{LABEL:"parameter"})}}),this.CONSUME(Ji)});this.apexBindVariableFunctionParams=this.RULE("apexBindVariableFunctionParams",()=>{this.CONSUME(Me),this.MANY_SEP({SEP:Ne,DEF:()=>{this.CONSUME(u,{LABEL:"parameter"})}}),this.CONSUME(De)});this.apexBindVariableFunctionArrayAccessor=this.RULE("apexBindVariableFunctionArrayAccessor",()=>{this.CONSUME(ps),this.OR([{ALT:()=>this.CONSUME(Xt,{LABEL:"value"})},{ALT:()=>this.CONSUME(u,{LABEL:"value"})}]),this.CONSUME(hs)});this.arrayExpression=this.RULE("arrayExpression",()=>{this.CONSUME(Me),this.AT_LEAST_ONE_SEP({SEP:Ne,DEF:()=>{this.OR(this.$_arrayExpression||(this.$_arrayExpression=[{ALT:()=>this.CONSUME(ro,{LABEL:"value"})},{ALT:()=>this.CONSUME(no,{LABEL:"value"})},{ALT:()=>this.CONSUME(nt,{LABEL:"value"})},{ALT:()=>this.CONSUME(En,{LABEL:"value"})},{ALT:()=>this.CONSUME(Ki,{LABEL:"value"})},{ALT:()=>this.CONSUME(Xi,{LABEL:"value"})},{ALT:()=>this.CONSUME(Wi,{LABEL:"value"})},{ALT:()=>this.CONSUME($,{LABEL:"value"})},{ALT:()=>this.SUBRULE(this.dateNLiteral,{LABEL:"value"})},{ALT:()=>this.CONSUME(xn,{LABEL:"value"})},{ALT:()=>this.CONSUME(gn,{LABEL:"value"})}]))}}),this.CONSUME(De)});this.relationalOperator=this.RULE("relationalOperator",()=>{this.OR(this.$_relationalOperator||(this.$_relationalOperator=[{ALT:()=>this.CONSUME(ls,{LABEL:"operator"})},{ALT:()=>this.CONSUME(us,{LABEL:"operator"})},{ALT:()=>this.CONSUME(Ji,{LABEL:"operator"})},{ALT:()=>this.CONSUME(fs,{LABEL:"operator"})},{ALT:()=>this.CONSUME(Zi,{LABEL:"operator"})},{ALT:()=>this.CONSUME(cs,{LABEL:"operator"})},{ALT:()=>this.CONSUME(ua,{LABEL:"operator"})}]))});this.setOperator=this.RULE("setOperator",()=>{this.OR([{ALT:()=>this.CONSUME(Vi,{LABEL:"operator"})},{ALT:()=>this.SUBRULE(this.notInOperator,{LABEL:"notIn"})},{ALT:()=>this.CONSUME(la,{LABEL:"operator"})},{ALT:()=>this.CONSUME(ia,{LABEL:"operator"})}])});this.notInOperator=this.RULE("notInOperator",()=>{this.CONSUME(Hi,{LABEL:"operator"}),this.CONSUME(Vi,{LABEL:"operator"})});this.booleanValue=this.RULE("booleanValue",()=>{this.OR([{ALT:()=>this.CONSUME(Xi,{LABEL:"boolean"})},{ALT:()=>this.CONSUME(Wi,{LABEL:"boolean"})}])});this.dateNLiteral=this.RULE("dateNLiteral",()=>{this.CONSUME(Q,{LABEL:"dateNLiteral"}),this.CONSUME(to),this.OR1([{ALT:()=>this.CONSUME(Xt,{LABEL:"variable"})},{ALT:()=>this.CONSUME(ds,{LABEL:"variable"})}])});this.forViewOrReference=this.RULE("forViewOrReference",()=>{this.CONSUME(ga),this.OR([{ALT:()=>this.CONSUME(ba,{LABEL:"value"})},{ALT:()=>this.CONSUME(Na,{LABEL:"value"})},{ALT:()=>this.CONSUME(qi,{LABEL:"value"})}])});this.updateTrackingViewstat=this.RULE("updateTrackingViewstat",()=>{this.CONSUME(qi),this.OR([{ALT:()=>this.CONSUME(Ra,{LABEL:"value"})},{ALT:()=>this.CONSUME(va,{LABEL:"value"})}])});this.ignoreParseErrors=!!r,this.performSelfAnalysis()}$_checkBalancedParens(r){!this.RECORDING_PHASE&&r&&r.left-r.right!==0&&this.CONSUME(Kf,{ERR_MSG:"Expecting a token type of --> RParen <-- but found --> '' <--"})}getParenCount(r){return r||{right:0,left:0}}},ot=new Mr;function gs(t,e){let{allowApexBindVariables:r,logErrors:n,ignoreParseErrors:i,allowPartialQuery:o}=e||{allowApexBindVariables:!1,logErrors:!1,ignoreParseErrors:!1},a=Yf(t);if(a.errors.length>0)throw n&&(console.log("Lexing Errors:"),console.log(a.errors)),new Es(a.errors[0]);ot.ignoreParseErrors!==i&&(ot=new Mr({ignoreParseErrors:i})),ot.input=a.tokens,ot.allowApexBindVariables=r||!1;let s;if(o?s=ot.selectStatementPartial():s=ot.selectStatement(),ot.errors.length>0&&(n&&(console.log("Parsing Errors:"),console.log(ot.errors)),!i))throw new io(ot.errors[0]);return{cst:s,parseErrors:ot.errors.map(l=>new io(l))}}var aC=new Mr,sC=aC.getBaseCstVisitorConstructor(),lC=["TRUE","FALSE"],uC=["YESTERDAY","TODAY","TOMORROW","LAST_WEEK","THIS_WEEK","NEXT_WEEK","LAST_MONTH","THIS_MONTH","NEXT_MONTH","LAST_90_DAYS","NEXT_90_DAYS","THIS_QUARTER","LAST_QUARTER","NEXT_QUARTER","THIS_YEAR","LAST_YEAR","NEXT_YEAR","THIS_FISCAL_QUARTER","LAST_FISCAL_QUARTER","NEXT_FISCAL_QUARTER","THIS_FISCAL_YEAR","LAST_FISCAL_YEAR","NEXT_FISCAL_YEAR"],cC=["NEXT_N_DAYS","LAST_N_DAYS","N_DAYS_AGO","NEXT_N_WEEKS","LAST_N_WEEKS","N_WEEKS_AGO","NEXT_N_MONTHS","LAST_N_MONTHS","N_MONTHS_AGO","NEXT_N_QUARTERS","LAST_N_QUARTERS","N_QUARTERS_AGO","NEXT_N_YEARS","LAST_N_YEARS","N_YEARS_AGO","NEXT_N_FISCAL_QUARTERS","LAST_N_FISCAL_QUARTERS","N_FISCAL_QUARTERS_AGO","NEXT_N_FISCAL_YEARS","LAST_N_FISCAL_YEARS","N_FISCAL_YEARS_AGO"],xs=class extends sC{constructor(){super();this.helpers={$_getFieldFunction:(r,n=!1,i=!0)=>{let o=r.functionExpression?r.functionExpression.map(s=>this.visit(s,{includeType:i})).flat():[],a={};return i&&(a.type="FieldFunctionExpression"),a.functionName=r.fn[0].tokenType.name,a.parameters=o,i&&n&&(a.isAggregateFn=n),a.rawValue=`${r.fn[0].image}(${o.map(s=>typeof s=="string"?s:s.rawValue).join(", ")})`,a},$_getLiteralTypeFromTokenType:r=>r==="REAL_NUMBER"?"DECIMAL":r==="CURRENCY_PREFIXED_DECIMAL"?"DECIMAL_WITH_CURRENCY_PREFIX":r==="CURRENCY_PREFIXED_INTEGER"?"INTEGER_WITH_CURRENCY_PREFIX":r==="SIGNED_DECIMAL"||r==="UNSIGNED_DECIMAL"?"DECIMAL":r==="UNSIGNED_INTEGER"||r==="SIGNED_INTEGER"?"INTEGER":r==="DATETIME"?"DATETIME":r==="DATE"?"DATE":r==="NULL"?"NULL":r==="StringIdentifier"||r==="Identifier"?"STRING":lC.includes(r)?"BOOLEAN":uC.includes(r)?"DATE_LITERAL":cC.includes(r)?"DATE_N_LITERAL":"STRING",$_parseSelect(r,n){let{isSubquery:i}=n||{isSubquery:!1},o={};if(r.selectClause&&(o.fields=this.visit(r.selectClause)),r.fromClause)if(Ns(o,i)){let{sObject:a,alias:s,sObjectPrefix:l}=this.visit(r.fromClause);o.relationshipName=a,s&&(o.sObjectAlias=s),l&&(o.sObjectPrefix=l)}else{let{sObject:a,alias:s}=this.visit(r.fromClause);o.sObject=a,s&&(o.sObjectAlias=s)}return Array.isArray(o.fields)&&o.sObjectAlias&&o.fields.forEach(a=>{a.relationships&&a.relationships[0]===o.sObjectAlias&&(a.relationships=a.relationships.slice(1),a.objectPrefix=o.sObjectAlias),a.relationships&&a.relationships.length===0&&(delete a.relationships,a.type="Field")}),o={...o,...this.visit(r.clauseStatements)},o}};this.validateVisitor()}selectStatement(r,n){return this.helpers.$_parseSelect.bind(this)(r,n)}selectStatementPartial(r,n){return this.helpers.$_parseSelect.bind(this)(r,n)}clauseStatements(r){let n={};return r.usingScopeClause&&!r.usingScopeClause[0].recoveredNode&&(n.usingScope=this.visit(r.usingScopeClause)),r.whereClause&&!r.whereClause[0].recoveredNode&&(n.where=this.visit(r.whereClause)),r.withClause&&r.withClause.filter(i=>!i.recoveredNode).forEach(i=>{let{withSecurityEnforced:o,withAccessLevel:a,withDataCategory:s}=this.visit(i);o&&(n.withSecurityEnforced=o),a&&(n.withAccessLevel=a),s&&(n.withDataCategory=s)}),r.groupByClause&&!r.groupByClause[0].recoveredNode&&(n.groupBy=this.visit(r.groupByClause)),r.havingClause&&!r.havingClause[0].recoveredNode&&(n.having=this.visit(r.havingClause)),r.orderByClause&&!r.orderByClause[0].recoveredNode&&(n.orderBy=this.visit(r.orderByClause)),r.limitClause&&!r.limitClause[0].recoveredNode&&(n.limit=Number(this.visit(r.limitClause))),r.offsetClause&&!r.offsetClause[0].recoveredNode&&(n.offset=Number(this.visit(r.offsetClause))),r.forViewOrReference&&!r.forViewOrReference[0].recoveredNode&&(n.for=this.visit(r.forViewOrReference)),r.updateTrackingViewstat&&!r.updateTrackingViewstat[0].recoveredNode&&(n.update=this.visit(r.updateTrackingViewstat)),n}selectClause(r){return r.field?r.field.map(n=>{if(zt(n)){let i=n.image,o;if(!i.includes("."))o={type:"Field",field:i};else{let a=i.split(".");o={type:"FieldRelationship",field:a[a.length-1],relationships:a.slice(0,a.length-1),rawValue:i}}return o}else return this.visit(n)}):[]}selectClauseFunctionIdentifier(r){let n={...this.visit(r.fn)};return r.alias&&(n.alias=r.alias[0].image),n}selectClauseSubqueryIdentifier(r){return{type:"FieldSubquery",subquery:this.visit(r.selectStatement,{isSubquery:!0})}}selectClauseTypeOf(r){let n=r.selectClauseTypeOfThen.map(i=>this.visit(i));return r.selectClauseTypeOfElse&&n.push(this.visit(r.selectClauseTypeOfElse)),{type:"FieldTypeof",field:r.typeOfField[0].image,conditions:n}}selectClauseIdentifier(r){let n=r.field[0],i=r.alias?r.alias[0].image:void 0,o=n.image,a;if(!o.includes("."))a={type:"Field",field:o};else{let s=o.split(".");a={type:"FieldRelationship",field:s[s.length-1],relationships:s.slice(0,s.length-1),rawValue:o}}return i&&(a.alias=i),a}selectClauseTypeOfThen(r){return{type:"WHEN",objectType:r.typeOfField[0].image,fieldList:r.field.map(n=>n.image)}}selectClauseTypeOfElse(r){return{type:"ELSE",fieldList:r.field.map(n=>n.image)}}fromClause(r){let n=r.Identifier[0].image,i;if(n.includes(".")){let o=n.split(".");i={sObjectPrefix:o.slice(0,o.length-1),sObject:o[o.length-1]}}else i={sObject:n};return r.alias&&r.alias[0]&&(i.alias=r.alias[0].image),i}usingScopeClause(r){return r.UsingScopeEnumeration[0].image}whereClauseSubqueryIdentifier(r){return this.visit(r.selectStatement,{isSubquery:!1})}whereClause(r){return r.conditionExpression.reduce((i,o)=>{let a;i.expressionTree?(a=this.visit(o,{prevExpression:i.prevExpression}),i.prevExpression.right=a):(a=this.visit(o),i.expressionTree=a);let s=a.right,l=a.right;for(;Sn(l);)s=l,l=l.right;return i.prevExpression=l||a,i},{prevExpression:void 0,expressionTree:void 0}).expressionTree}conditionExpression(r,n){n=n||{},n.prevExpression&&r.logicalOperator&&(n.prevExpression.operator=r.logicalOperator[0].tokenType.name);let i={},o=i;if(Array.isArray(r.expressionNegation))if(r.expressionNegation.length===1)i=this.visit(r.expressionNegation),o=i.right;else{i=this.visit(r.expressionNegation[0]);let a=i;r.expressionNegation.slice(1).forEach(s=>{a.right=this.visit(s),o=a.right.right})}return o.left=this.visit(r.expression),i}withClause(r){return r.withSecurityEnforced?{withSecurityEnforced:!0}:r.withAccessLevel?{withAccessLevel:r.withAccessLevel[0].image}:{withDataCategory:{conditions:this.visit(r.withDataCategory)}}}withDataCategory(r){return r.withDataCategoryArr.map(n=>this.visit(n))}withDataCategoryArr(r){return{groupName:r.dataCategoryGroupName[0].image,selector:r.filteringSelector[0].image,parameters:r.dataCategoryName.map(n=>n.image)}}groupByClause(r){return r.groupBy.map(n=>zt(n)?{field:n.image}:{fn:this.visit(n,{includeType:!1})})}havingClause(r){return r.conditionExpression.reduce((i,o)=>(i.expressionTree?(i.prevExpression.right=this.visit(o,{prevExpression:i.prevExpression}),i.prevExpression=i.prevExpression.right):(i.expressionTree=this.visit(o),i.prevExpression=i.expressionTree),i),{prevExpression:void 0,expressionTree:void 0}).expressionTree}orderByClause(r){return r.orderByExpressionOrFn.map(n=>this.visit(n))}orderByExpression(r){let n={field:r.Identifier[0].image};return r.order&&r.order[0]&&(n.order=r.order[0].tokenType.name),r.nulls&&r.nulls[0]&&(n.nulls=r.nulls[0].tokenType.name),n}orderByGroupingFunctionExpression(r){let n={fn:this.helpers.$_getFieldFunction(r,!1,!1)};return r.order&&r.order[0]&&(n.order=r.order[0].tokenType.name),r.nulls&&r.nulls[0]&&(n.nulls=r.nulls[0].tokenType.name),n}orderBySpecialFunctionExpression(r){let n={};return r.aggregateFunction?n.fn=this.visit(r.aggregateFunction,{includeType:!1}):r.dateFunction?n.fn=this.visit(r.dateFunction,{includeType:!1}):r.locationFunction&&(n.fn=this.visit(r.locationFunction,{includeType:!1})),r.order&&r.order[0]&&(n.order=r.order[0].tokenType.name),r.nulls&&r.nulls[0]&&(n.nulls=r.nulls[0].tokenType.name),n}limitClause(r){return r.value[0].image}offsetClause(r){return r.value[0].image}dateFunction(r,n={includeType:!0}){return this.helpers.$_getFieldFunction(r,!0,n.includeType)}aggregateFunction(r,n={includeType:!0}){return this.helpers.$_getFieldFunction(r,!0,n.includeType)}fieldsFunction(r,n={includeType:!0}){let i={};return n.includeType&&(i.type="FieldFunctionExpression"),i={...i,functionName:"FIELDS",parameters:[r.params[0].image]},i.rawValue=`FIELDS(${i.parameters[0]})`,i}otherFunction(r,n={includeType:!0}){return this.helpers.$_getFieldFunction(r,!1,n.includeType)}cubeFunction(r){return this.helpers.$_getFieldFunction(r,!1,!1)}rollupFunction(r){return this.helpers.$_getFieldFunction(r,!1,!1)}locationFunction(r,n={includeType:!0}){let i={};return n.includeType&&(i.type="FieldFunctionExpression"),i={...i,functionName:"DISTANCE",parameters:[r.location1[0].image,zt(r.location2)?r.location2[0].image:this.visit(r.location2,n),r.unit[0].image]},n.includeType&&(i.isAggregateFn=!0),i.rawValue=`DISTANCE(${i.parameters[0]}, ${k(i.parameters[1])?i.parameters[1]:i.parameters[1].rawValue}, ${i.parameters[2]})`,i}geolocationFunction(r,n={includeType:!0}){let i={};return n.includeType&&(i.type="FieldFunctionExpression"),i={...i,functionName:"GEOLOCATION",parameters:[r.latitude[0].image,r.longitude[0].image],rawValue:`GEOLOCATION(${r.latitude[0].image}, ${r.longitude[0].image})`},i}functionExpression(r,n={includeType:!0}){return r.params?r.params.map(i=>i.image?i.image:this.visit(i,n)):[]}expression(r){let{value:n,literalType:i,dateLiteralVariable:o,operator:a}=this.visit(r.operator,{returnLiteralType:!0}),s={};return zt(r.lhs)?s.field=r.lhs[0].image:s.fn=this.visit(r.lhs,{includeType:!1}),s.operator=a,s.literalType=i,i==="SUBQUERY"?s.valueQuery=n:s.value=n,o&&(s.dateLiteralVariable=o),r.L_PAREN&&(s.openParen=r.L_PAREN.length),r.R_PAREN&&(s.closeParen=r.R_PAREN.length),s}expressionPartWithNegation(r){return{left:r.L_PAREN?{openParen:r.L_PAREN.length}:null,operator:"NOT",right:{left:{}}}}expressionWithRelationalOperator(r){return r.relationalOperator?{operator:this.visit(r.relationalOperator),...this.visit(r.rhs,{returnLiteralType:!0})}:{operator:this.visit(r.setOperator),...this.visit(r.rhs,{returnLiteralType:!0})}}expressionWithSetOperator(r){return r.relationalOperator?{operator:this.visit(r.relationalOperator),...this.visit(r.rhs,{returnLiteralType:!0})}:{operator:this.visit(r.setOperator),...this.visit(r.rhs,{returnLiteralType:!0})}}atomicExpression(r,n){n=n||{};let i,o,a;if(r.apexBindVariableExpression)i=this.visit(r.apexBindVariableExpression),o="APEX_BIND_VARIABLE";else if(r.NumberIdentifier)i=r.NumberIdentifier[0].image,o=this.helpers.$_getLiteralTypeFromTokenType(r.NumberIdentifier[0].tokenType.name);else if(r.UnsignedInteger)i=r.UnsignedInteger[0].image,o="INTEGER";else if(r.SignedInteger)i=r.SignedInteger[0].image,o="INTEGER";else if(r.RealNumber)i=r.RealNumber[0].image,o="DECIMAL";else if(r.DateIdentifier)i=r.DateIdentifier[0].image,o=this.helpers.$_getLiteralTypeFromTokenType(r.DateIdentifier[0].tokenType.name);else if(r.CurrencyPrefixedInteger)i=r.CurrencyPrefixedInteger[0].image,o="INTEGER_WITH_CURRENCY_PREFIX";else if(r.CurrencyPrefixedDecimal)i=r.CurrencyPrefixedDecimal[0].image,o="DECIMAL_WITH_CURRENCY_PREFIX";else if(r.DateTime)i=r.DateTime[0].image,o="DATETIME";else if(r.date)i=r.DateToken[0].image,o="DATE";else if(r.NULL)i="NULL",o="NULL";else if(r.StringIdentifier)i=r.StringIdentifier[0].image,o="STRING";else if(r.Identifier)i=r.Identifier[0].image,o="STRING";else if(r.booleanValue)i=this.visit(r.booleanValue),o="BOOLEAN";else if(r.DateLiteral)i=r.DateLiteral[0].image,o="DATE_LITERAL";else if(r.dateNLiteral){let s=this.visit(r.dateNLiteral);i=s.value,a=s.variable,o="DATE_N_LITERAL"}else if(r.arrayExpression){let s=this.visit(r.arrayExpression);i=s.map(p=>p.value);let l=s.map(p=>p.variable||null),c=l.some(p=>p!==null);new Set(s.map(p=>p.type)).size===1?o=this.helpers.$_getLiteralTypeFromTokenType(s[0].type):o=s.map(p=>this.helpers.$_getLiteralTypeFromTokenType(p.type)),c&&(a=l),o=o||"STRING"}else r.whereClauseSubqueryIdentifier&&(i=this.visit(r.whereClauseSubqueryIdentifier),o="SUBQUERY");return n.returnLiteralType?{value:i,literalType:o,dateLiteralVariable:a}:i}apexBindVariableExpression(r){return r.apex.map(n=>this.visit(n)).join(".")}apexBindVariableIdentifier(r){let n=r.Identifier[0].image;return r.apexBindVariableFunctionArrayAccessor&&(n+=this.visit(r.apexBindVariableFunctionArrayAccessor[0])),n}apexBindVariableNewInstantiation(r){let n=`new ${r.function[0].image}`;return r.apexBindVariableGeneric&&(n+=this.visit(r.apexBindVariableGeneric[0])),n+=this.visit(r.apexBindVariableFunctionParams[0]),r.apexBindVariableFunctionArrayAccessor&&(n+=this.visit(r.apexBindVariableFunctionArrayAccessor[0])),n}apexBindVariableFunctionCall(r){let n=`${r.function[0].image}${this.visit(r.apexBindVariableFunctionParams[0])}`;return r.apexBindVariableFunctionArrayAccessor&&(n+=this.visit(r.apexBindVariableFunctionArrayAccessor[0])),n}apexBindVariableGeneric(r){return`<${r.parameter.map(n=>n.image).join(", ")}>`}apexBindVariableFunctionParams(r){return`(${(Array.isArray(r.parameter)?r.parameter:[]).map(i=>i.image).join(", ")})`}apexBindVariableFunctionArrayAccessor(r){return`[${r.value[0].image}]`}arrayExpression(r){return r.value.map(n=>zt(n)?{type:n.tokenType.name,value:n.image}:this.visit(n,{includeType:!0}))}relationalOperator(r){return r.operator[0].image}setOperator(r){if(Array.isArray(r.operator))return r.operator[0].tokenType.name.replace("_"," ");if(Array.isArray(r.notIn))return this.visit(r.notIn)}notInOperator(r){return"NOT IN"}booleanValue(r){return r.boolean[0].tokenType.name}dateNLiteral(r,n){let i={value:`${r.dateNLiteral[0].image}:${r.variable[0].image}`,variable:Number(r.variable[0].image)};return n&&n.includeType&&(i.type=r.dateNLiteral[0].tokenType.name),i}forViewOrReference(r){return r.value[0].tokenType.name}updateTrackingViewstat(r){return r.value[0].tokenType.name}},fC=new xs;function oo(t,e){let{cst:r}=gs(t,e);return fC.visit(r)}function Xf(t,e){try{let{parseErrors:r}=gs(t,e);return r.length===0}catch{return!1}}function pC(t){return qf(t)}function qf(t){if(typeof t=="string")return{type:"Field",field:t};if(bs(t)){let e=[];return t.parameters&&(e=Array.isArray(t.parameters)?t.parameters:[t.parameters]),{type:"FieldFunctionExpression",functionName:t.functionName||t.fn,parameters:e,alias:t.alias}}else{if(vs(t))return{type:"FieldRelationship",field:t.field,relationships:t.relationships,objectPrefix:t.objectPrefix};if(Ps(t))return{type:"FieldSubquery",subquery:t.subquery};if(Fs(t))return{type:"FieldTypeof",field:t.field,conditions:t.conditions};if(_s(t))return{type:"Field",field:t.field,objectPrefix:t.objectPrefix};throw new TypeError("The input object provided did not match any valid field types")}}function hC(t,e){if(!t)return[];t=mo(t)?t.subquery:t;let r=t.fields;if(!r)return[];let n={};t.groupBy&&(n=(Array.isArray(t.groupBy)?t.groupBy:[t.groupBy]).reduce((l,c)=>(Gr(c)&&(l[c.field.toLocaleLowerCase()]=c.field),l),{}));let i=-1,o=(Bt(t)?t.relationshipName:t.sObject||"").toLowerCase(),a=(t.sObjectAlias||"").toLowerCase();return r.flatMap(l=>{switch(l.type){case"Field":return l.alias||l.field;case"FieldFunctionExpression":{let c=ho(l);if(c=c.map(p=>{if(p.includes(".")){let h=p.split("."),d=h[0].toLowerCase();return(d===a||d===o)&&(h=h.slice(1)),h.join(".")}return p}),l.alias&&(l.isAggregateFn||e))return l.alias;if(l.alias){let p=c[0];return p.includes(".")?(c=p.split(".").slice(0,-1),c.push(l.alias),c.join(".")):l.alias}return l.isAggregateFn||Is(l)||e?(i++,`expr${i}`):c.length>0?c.join("."):l.functionName}case"FieldRelationship":{let c=l.relationships[0].toLowerCase();return Dr(l)?l.alias:l.rawValue&&n[l.rawValue.toLocaleLowerCase()]?l.field:c===a||c===o?l.relationships.concat([l.field]).slice(1).join("."):l.relationships.concat([l.field]).join(".")}case"FieldSubquery":return l.subquery.relationshipName;case"FieldTypeof":{let c=new Set,p=[];return l.conditions.forEach(h=>{h.fieldList.forEach(d=>{c.has(d)||(c.add(d),p.push(`${l.field}.${d}`))})}),p}default:break}}).filter(l=>k(l))}var ao=class{constructor(e,r){this.currIndent=1;this.enabled=e,this.options={numIndent:r.numIndent??1,fieldMaxLineLength:r.fieldMaxLineLength??60,fieldSubqueryParensOnOwnLine:r.fieldSubqueryParensOnOwnLine??!0,whereClauseOperatorsIndented:!0,newLineAfterKeywords:r.newLineAfterKeywords??!1,logging:r.logging??!1},this.options.newLineAfterKeywords&&(this.options.fieldSubqueryParensOnOwnLine=!0)}log(e){this.options.logging&&console.log(e)}getIndent(e=0){return this.repeatChar((this.currIndent+e)*(this.options.numIndent||1)," ")}repeatChar(e,r){return new Array(e).fill(r).join("")}setSubquery(e){this.currIndent=e?this.currIndent+=1:this.currIndent-=1}stepCurrIndex(e){this.currIndent+=e}formatFields(e){function r(n){e.fields[n-1]&&(e.fields[n-1].suffix=e.fields[n-1].suffix.trim())}if(e.fields.forEach((n,i)=>{n.suffix=e.fields.length-1===i?"":", "}),this.enabled){let n=0,i=!1;e.fields.forEach((o,a)=>{o.isSubquery?(r(a),o.prefix=`
|
|
109
|
+
${this.getIndent()}`,o.suffix=e.fields.length-1===a?"":", ",n=0,i=!0):Array.isArray(o.typeOfClause)?(r(a),o.prefix=`
|
|
110
|
+
${this.getIndent()}`,i=!0):xt(this.options.fieldMaxLineLength)&&(n+=o.text.length+o.suffix.length,(n>this.options.fieldMaxLineLength||i)&&(r(a),(!this.options.newLineAfterKeywords||a>0)&&(o.prefix+=`
|
|
111
|
+
${this.getIndent()}`),n=0,i=!1)),this.log(o)})}}formatTyeOfField(e,r){return this.enabled&&this.options.newLineAfterKeywords?r.map((n,i)=>i===0?n:i===r.length-1?`${this.getIndent()}${n}`:`${this.getIndent()} ${n}`).join(`
|
|
112
|
+
`):e}formatTypeofFieldCondition(e){let r="",n=e.fieldList.join(", ");if(this.enabled&&this.options.newLineAfterKeywords){let i=this.getIndent();r=`${e.type}`,e.objectType?r+=`
|
|
113
|
+
${i} ${e.objectType}
|
|
114
|
+
${i} THEN
|
|
115
|
+
${i} ${n}`:r+=`
|
|
116
|
+
${i} ${n}`}else r=e.type,e.objectType?r+=` ${e.objectType} THEN ${n}`:r+=` ${n}`;return r}formatSubquery(e,r=2,n=!1){n&&r++;let i="(",o=")";return this.enabled&&(this.options.fieldSubqueryParensOnOwnLine||this.options.newLineAfterKeywords?(e=e.replace(/\n/g,`
|
|
117
|
+
${this.repeatChar(r," ")}`),i=`(
|
|
118
|
+
${this.repeatChar(r," ")}`,o=`
|
|
119
|
+
${this.repeatChar(r-1," ")})`):e=e.replace(/\n/g,`
|
|
120
|
+
`)),`${i}${e}${o}`}formatClause(e){return this.enabled?this.options.newLineAfterKeywords?`
|
|
121
|
+
${e}
|
|
122
|
+
`:`
|
|
123
|
+
${e}`:` ${e}`}formatText(e){return this.enabled&&(this.options.newLineAfterKeywords||e.startsWith(`
|
|
124
|
+
`))?e:` ${e}`}formatWithIndent(e){return this.enabled?`${this.getIndent()}${e}`:e}formatOrderByArray(e){if(this.enabled){let r=0,n="";return e.forEach((i,o)=>{let a=e[o+1];r+=i.length,a&&(r+a.length>(this.options.fieldMaxLineLength||0)||this.options.newLineAfterKeywords)?(n+=`${i},
|
|
125
|
+
`,r=0):n+=`${i}${a?", ":""}`}),n}else return e.join(", ")}formatParens(e,r,n=!1){let i="";if(xt(e)&&e>0)if(this.enabled)if(r==="("){for(let o=0;o<e;o++)n&&o===e-1?i+="(":o===0?i+=`(
|
|
126
|
+
`:(this.currIndent++,i+=`${this.getIndent()}(
|
|
127
|
+
`);(!n||e>1)&&this.currIndent++}else for(let o=e-1;o>=0;o--)n&&o===e-1?i+=")":(this.currIndent--,i+=`
|
|
128
|
+
${this.getIndent()})`);else i+=Rs(e,r);return i}formatWhereClauseOperators(e,r,n=0){let i=e==="NOT";return this.enabled&&!i?`
|
|
129
|
+
${this.getIndent(n)}${e} ${r}`:`${i?"":" "}${e} ${r}`}formatAddNewLine(e=" ",r){return this.enabled&&!r?`
|
|
130
|
+
`:e}};function dC(t,e,r){return zf(oo(t,r),{format:!0,formatOptions:e})}function zf(t,e={}){if(!t)return"";e=e||{},e.format=!!e.format,e.logging&&(console.time("composer"),console.log("Composing Query:",t),console.log("Format output:",e.format));let r=new so(t,e).query;return e.logging&&console.timeEnd("composer"),r}var so=class{constructor(e,r={}){this.soql=e;this.logging=!1;this.format=!1;r={autoCompose:!0,...r};let{logging:n,format:i}=r;this.logging=!!n,this.format=!!i,this.query="",this.formatter=new ao(this.format,{logging:this.logging,...r.formatOptions}),r.autoCompose&&this.start()}start(){this.query=this.parseQuery(this.soql)}log(e){this.logging&&console.log("Current SOQL:",e)}parseFn(e){let r;return e.rawValue?r=e.rawValue:(r=e.functionName,r+=`(${(e.parameters||[]).map(n=>k(n)?n:this.parseFn(n)).join(", ")})`),e.alias&&(r+=` ${e.alias}`),r}parseQuery(e){let r={fields:this.parseFields(e.fields||[]).map(o=>({text:o.text,typeOfClause:o.typeOfClause,isSubquery:o.text.startsWith("("),prefix:"",suffix:""})),isSubquery:Bt(e),lineBreaks:[]},n="";e.fields&&(n+=this.formatter.formatClause("SELECT").trimStart()),this.formatter.formatFields(r);let i="";if(r.fields.forEach(o=>{Array.isArray(o.typeOfClause)?i+=`${o.prefix}${this.formatter.formatTyeOfField(o.text,o.typeOfClause)}${o.suffix}`:i+=`${o.prefix}${o.text}${o.suffix}`}),n+=this.formatter.formatText(i),(Bt(e)?e.relationshipName:e.sObject)&&(n+=this.formatter.formatClause("FROM")),Bt(e)){let o=e.sObjectPrefix||[];o.push(e.relationshipName),n+=this.formatter.formatText(`${o.join(".")}${wt(e.sObjectAlias,""," ")}`)}else e.sObject&&(n+=this.formatter.formatText(`${e.sObject}${wt(e.sObjectAlias,""," ")}`));return this.log(n),e.usingScope&&(n+=this.formatter.formatClause("USING SCOPE"),n+=this.formatter.formatText(e.usingScope),this.log(n)),e.where&&(n+=this.formatter.formatClause("WHERE"),n+=this.formatter.formatText(this.parseWhereOrHavingClause(e.where)),this.log(n)),e.groupBy&&(n+=this.formatter.formatClause("GROUP BY"),n+=this.formatter.formatText(this.parseGroupByClause(e.groupBy)),this.log(n),e.having&&(n+=this.formatter.formatClause("HAVING"),n+=this.formatter.formatText(this.parseWhereOrHavingClause(e.having)),this.log(n))),e.orderBy&&(!Array.isArray(e.orderBy)||e.orderBy.length>0)&&(n+=this.formatter.formatClause("ORDER BY"),n+=this.formatter.formatText(this.parseOrderBy(e.orderBy)),this.log(n)),xt(e.limit)&&(n+=this.formatter.formatClause("LIMIT"),n+=this.formatter.formatText(`${e.limit}`),this.log(n)),xt(e.offset)&&(n+=this.formatter.formatClause("OFFSET"),n+=this.formatter.formatText(`${e.offset}`),this.log(n)),e.withDataCategory&&(n+=this.formatter.formatClause("WITH DATA CATEGORY"),n+=this.formatter.formatText(this.parseWithDataCategory(e.withDataCategory)),this.log(n)),e.withSecurityEnforced&&(n+=this.formatter.formatClause("WITH SECURITY_ENFORCED"),this.log(n)),e.withAccessLevel&&(n+=this.formatter.formatClause(`WITH ${e.withAccessLevel}`),this.log(n)),e.for&&(n+=this.formatter.formatClause("FOR"),n+=this.formatter.formatText(e.for),this.log(n)),e.update&&(n+=this.formatter.formatClause("UPDATE"),n+=this.formatter.formatText(e.update),this.log(n)),n.trim()}parseFields(e){return e.map(r=>{let n="",i,o=r.objectPrefix?`${r.objectPrefix}.`:"";switch(r.type){case"Field":{n=`${o}${r.field}${r.alias?` ${r.alias}`:""}`;break}case"FieldFunctionExpression":{let a="";r.parameters&&(a=r.parameters.map(s=>k(s)?s:this.parseFields([s]).map(l=>l.text)).join(", ")),n=`${r.functionName}(${a})${r.alias?` ${r.alias}`:""}`;break}case"FieldRelationship":{n=`${o}${r.relationships.join(".")}.${r.field}${Dr(r)?` ${r.alias}`:""}`;break}case"FieldSubquery":{n=this.formatter.formatSubquery(this.parseQuery(r.subquery));break}case"FieldTypeof":{i=this.parseTypeOfField(r),n=i.join(" ");break}default:break}return{text:n,typeOfClause:i}})}parseTypeOfField(e){let r=[`TYPEOF ${e.field}`].concat(e.conditions.map(n=>this.formatter.formatTypeofFieldCondition(n)));return r.push("END"),r}parseWhereOrHavingClause(e,r=0,n=!1){let i="",o=e.left,a=!1;if(o&&(i+=this.formatter.formatParens(o.openParen,"(",Qt(o)),!Qt(o))){r=r+(o.openParen||0)-(o.closeParen||0),n&&r++;let s="";s+=Ln(o)?this.parseFn(o.fn):o.field,s+=` ${o.operator} `,yn(o)?s+=this.formatter.formatSubquery(this.parseQuery(o.valueQuery),1,!0):s+=Os(Gs(o.value,o.literalType,o.operator)),i+=this.formatter.formatWithIndent(s),i+=this.formatter.formatParens(o.closeParen,")",n)}if(Cn(e)){let s=wt(e.operator);a=s==="NOT";let l=this.formatter.formatWhereClauseOperators(s,this.parseWhereOrHavingClause(e.right,r,Qt(o)),r);return`${a?i.trimRight():i}${l}`.trim()}else return i.trim()}parseGroupByClause(e){return(Array.isArray(e)?e:[e]).map(r=>Gr(r)?r.field:this.parseFn(r.fn)).join(", ")}parseOrderBy(e){if(Array.isArray(e))return this.formatter.formatOrderByArray(e.map(r=>this.parseOrderBy(r)));{let r="";return Nn(e)?r=`${wt(e.field," ")}`:r+=`${this.parseFn(e.fn)} `,r+=`${wt(e.order," ")}${wt(e.nulls,"","NULLS ")}`,r.trim()}}parseWithDataCategory(e){return e.conditions.map(r=>{let n=r.parameters.length>1?`(${r.parameters.join(", ")})`:`${r.parameters.join(", ")}`;return`${r.groupName} ${r.selector} ${n}`}).join(" AND ")}};
|
|
131
|
+
/*! Bundled license information:
|
|
132
|
+
|
|
133
|
+
lodash-es/lodash.js:
|
|
134
|
+
(**
|
|
135
|
+
* @license
|
|
136
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
137
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
138
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
139
|
+
* Released under MIT license <https://lodash.com/license>
|
|
140
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
141
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
142
|
+
*)
|
|
143
|
+
*/
|