@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
54 lines • 172 kB
JavaScript
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href;
var Nu=Object.create;var Jt=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var Ou=Object.getOwnPropertyNames;var Iu=Object.getPrototypeOf,Au=Object.prototype.hasOwnProperty;var a=(t,e)=>Jt(t,"name",{value:e,configurable:!0});var S=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var Su=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Pu=(t,e)=>{for(var r in e)Jt(t,r,{get:e[r],enumerable:!0})},bo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ou(e))!Au.call(t,i)&&i!==r&&Jt(t,i,{get:()=>e[i],enumerable:!(n=_u(e,i))||n.enumerable});return t};var Mn=(t,e,r)=>(r=t!=null?Nu(Iu(t)):{},bo(e||!t||!t.__esModule?Jt(r,"default",{value:t,enumerable:!0}):r,t)),Cu=t=>bo(Jt({},"__esModule",{value:!0}),t);var Un=S(()=>{});function P(t){return t&&t.length===0}function ue(t){return t==null?[]:Object.keys(t)}function V(t){for(var e=[],r=Object.keys(t),n=0;n<r.length;n++)e.push(t[r[n]]);return e}function Fo(t,e){for(var r=[],n=ue(t),i=0;i<n.length;i++){var o=n[i];r.push(e.call(null,t[o],o))}return r}function T(t,e){for(var r=[],n=0;n<t.length;n++)r.push(e.call(null,t[n],n));return r}function K(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];Array.isArray(n)?e=e.concat(K(n)):e.push(n)}return e}function re(t){return P(t)?void 0:t[0]}function Cr(t){var e=t&&t.length;return e?t[e-1]:void 0}function y(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)e.call(null,t[r],r);else if(xr(t))for(var n=ue(t),r=0;r<n.length;r++){var i=n[r],o=t[i];e.call(null,o,i)}else throw Error("non exhaustive match")}function Ne(t){return typeof t=="string"}function ne(t){return t===void 0}function Ce(t){return t instanceof Function}function H(t,e){return e===void 0&&(e=1),t.slice(e,t.length)}function nt(t,e){return e===void 0&&(e=1),t.slice(0,t.length-e)}function _e(t,e){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}function We(t,e){return _e(t,function(r){return!e(r)})}function me(t,e){for(var r=Object.keys(t),n={},i=0;i<r.length;i++){var o=r[i],s=t[o];e(s)&&(n[o]=s)}return n}function N(t,e){return xr(t)?t.hasOwnProperty(e):!1}function L(t,e){return Ke(t,function(r){return r===e})!==void 0}function W(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r]);return e}function it(t){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}function Ke(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(e.call(null,n))return n}}function wo(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.call(null,i)&&r.push(i)}return r}function w(t,e,r){for(var n=Array.isArray(t),i=n?t:V(t),o=n?[]:ue(t),s=r,u=0;u<i.length;u++)s=e.call(null,s,i[u],n?u:o[u]);return s}function Ve(t){return We(t,function(e){return e==null})}function er(t,e){e===void 0&&(e=a(function(n){return n},"identity"));var r=[];return w(t,function(n,i){var o=e(i);return L(r,o)?n:(r.push(o),n.concat(i))},[])}function Ql(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=[null],i=n.concat(e);return Function.bind.apply(t,i)}function ee(t){return Array.isArray(t)}function xe(t){return t instanceof RegExp}function xr(t){return t instanceof Object}function te(t,e){for(var r=0;r<t.length;r++)if(!e(t[r],r))return!1;return!0}function dt(t,e){return We(t,function(r){return L(e,r)})}function Lr(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return!0;return!1}function Do(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1}function $l(t,e){var r=W(t);return r.sort(function(n,i){return e(n)-e(i)}),r}function Zl(t,e){if(t.length!==e.length)throw Error("can't zipObject with different number of keys and values!");for(var r={},n=0;n<t.length;n++)r[t[n]]=e[n];return r}function Ee(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=ue(i),s=0;s<o.length;s++){var u=o[s];t[u]=i[u]}return t}function xu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++)for(var i=e[n],o=ue(i),s=0;s<o.length;s++){var u=o[s];N(t,u)||(t[u]=i[u])}return t}function tr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xu.apply(null,[{}].concat(t))}function Yo(t,e){var r={};return y(t,function(n){var i=e(n),o=r[i];o?o.push(n):r[i]=[n]}),r}function bn(t,e){for(var r=it(t),n=ue(e),i=0;i<n.length;i++){var o=n[i],s=e[o];r[o]=s}return r}function X(){}function Fn(t){return t}function Bo(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(n!==void 0?n:void 0)}return e}function rr(t){console&&console.error&&console.error("Error: "+t)}function kr(t){console&&console.warn&&console.warn("Warning: "+t)}function wn(){return typeof Map=="function"}function Go(t,e){e.forEach(function(r){var n=r.prototype;Object.getOwnPropertyNames(n).forEach(function(i){if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]}})})}function Mr(toBecomeFast){function FakeConstructor(){}a(FakeConstructor,"FakeConstructor"),FakeConstructor.prototype=toBecomeFast;var fakeInstance=new FakeConstructor;function fakeAccess(){return typeof fakeInstance.bar}return a(fakeAccess,"fakeAccess"),fakeAccess(),fakeAccess(),toBecomeFast;eval(toBecomeFast)}function nr(t){return t[t.length-1]}function Ur(t){var e=new Date().getTime(),r=t(),n=new Date().getTime(),i=n-e;return{time:i,value:r}}var C=S(()=>{a(P,"isEmpty");a(ue,"keys");a(V,"values");a(Fo,"mapValues");a(T,"map");a(K,"flatten");a(re,"first");a(Cr,"last");a(y,"forEach");a(Ne,"isString");a(ne,"isUndefined");a(Ce,"isFunction");a(H,"drop");a(nt,"dropRight");a(_e,"filter");a(We,"reject");a(me,"pick");a(N,"has");a(L,"contains");a(W,"cloneArr");a(it,"cloneObj");a(Ke,"find");a(wo,"findAll");a(w,"reduce");a(Ve,"compact");a(er,"uniq");a(Ql,"partial");a(ee,"isArray");a(xe,"isRegExp");a(xr,"isObject");a(te,"every");a(dt,"difference");a(Lr,"some");a(Do,"indexOf");a($l,"sortBy");a(Zl,"zipObject");a(Ee,"assign");a(xu,"assignNoOverwrite");a(tr,"defaults");a(Yo,"groupBy");a(bn,"merge");a(X,"NOOP");a(Fn,"IDENTITY");a(Bo,"packArray");a(rr,"PRINT_ERROR");a(kr,"PRINT_WARNING");a(wn,"isES2015MapSupported");a(Go,"applyMixins");a(Mr,"toFastProperties");a(nr,"peek");a(Ur,"timer")});var Fr=Su((Ko,br)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof br=="object"&&br.exports?br.exports=e():t.regexpToAst=e()})(typeof self<"u"?self:Ko,function(){function t(){}a(t,"RegExpParser"),t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(c){this.idx=c.idx,this.input=c.input,this.groupIdx=c.groupIdx},t.prototype.pattern=function(c){this.idx=0,this.input=c,this.groupIdx=0,this.consumeChar("/");var m=this.disjunction();this.consumeChar("/");for(var g={type:"Flags",loc:{begin:this.idx,end:c.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(g,"global");break;case"i":s(g,"ignoreCase");break;case"m":s(g,"multiLine");break;case"u":s(g,"unicode");break;case"y":s(g,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:g,value:m,loc:this.loc(0)}},t.prototype.disjunction=function(){var c=[],m=this.idx;for(c.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),c.push(this.alternative());return{type:"Disjunction",value:c,loc:this.loc(m)}},t.prototype.alternative=function(){for(var c=[],m=this.idx;this.isTerm();)c.push(this.term());return{type:"Alternative",value:c,loc:this.loc(m)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var c=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(c)};case"$":return{type:"EndAnchor",loc:this.loc(c)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(c)};case"B":return{type:"NonWordBoundary",loc:this.loc(c)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var m;switch(this.popChar()){case"=":m="Lookahead";break;case"!":m="NegativeLookahead";break}u(m);var g=this.disjunction();return this.consumeChar(")"),{type:m,value:g,loc:this.loc(c)}}l()},t.prototype.quantifier=function(c){var m,g=this.idx;switch(this.popChar()){case"*":m={atLeast:0,atMost:1/0};break;case"+":m={atLeast:1,atMost:1/0};break;case"?":m={atLeast:0,atMost:1};break;case"{":var _=this.integerIncludingZero();switch(this.popChar()){case"}":m={atLeast:_,atMost:_};break;case",":var O;this.isDigit()?(O=this.integerIncludingZero(),m={atLeast:_,atMost:O}):m={atLeast:_,atMost:1/0},this.consumeChar("}");break}if(c===!0&&m===void 0)return;u(m);break}if(!(c===!0&&m===void 0))return u(m),this.peekChar(0)==="?"?(this.consumeChar("?"),m.greedy=!1):m.greedy=!0,m.type="Quantifier",m.loc=this.loc(g),m},t.prototype.atom=function(){var c,m=this.idx;switch(this.peekChar()){case".":c=this.dotAll();break;case"\\":c=this.atomEscape();break;case"[":c=this.characterClass();break;case"(":c=this.group();break}return c===void 0&&this.isPatternCharacter()&&(c=this.patternCharacter()),u(c),c.loc=this.loc(m),this.isQuantifier()&&(c.quantifier=this.quantifier()),c},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[i(`
`),i("\r"),i("\u2028"),i("\u2029")]}},t.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()}},t.prototype.decimalEscapeAtom=function(){var c=this.positiveInteger();return{type:"GroupBackReference",value:c}},t.prototype.characterClassEscape=function(){var c,m=!1;switch(this.popChar()){case"d":c=h;break;case"D":c=h,m=!0;break;case"s":c=E;break;case"S":c=E,m=!0;break;case"w":c=f;break;case"W":c=f,m=!0;break}return u(c),{type:"Set",value:c,complement:m}},t.prototype.controlEscapeAtom=function(){var c;switch(this.popChar()){case"f":c=i("\f");break;case"n":c=i(`
`);break;case"r":c=i("\r");break;case"t":c=i(" ");break;case"v":c=i("\v");break}return u(c),{type:"Character",value:c}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var c=this.popChar();if(/[a-zA-Z]/.test(c)===!1)throw Error("Invalid ");var m=c.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:m}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:i("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var c=this.popChar();return{type:"Character",value:i(c)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var c=this.popChar();return{type:"Character",value:i(c)}}},t.prototype.characterClass=function(){var c=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var g=this.classAtom(),_=g.type==="Character";if(_&&this.isRangeDash()){this.consumeChar("-");var O=this.classAtom(),R=O.type==="Character";if(R){if(O.value<g.value)throw Error("Range out of order in character class");c.push({from:g.value,to:O.value})}else o(g.value,c),c.push(i("-")),o(O.value,c)}else o(g.value,c)}return this.consumeChar("]"),{type:"Set",complement:m,value:c}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:i("\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()}},t.prototype.group=function(){var c=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),c=!1):this.groupIdx++;var m=this.disjunction();this.consumeChar(")");var g={type:"Group",capturing:c,value:m};return c&&(g.idx=this.groupIdx),g},t.prototype.positiveInteger=function(){var c=this.popChar();if(n.test(c)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)c+=this.popChar();return parseInt(c,10)},t.prototype.integerIncludingZero=function(){var c=this.popChar();if(r.test(c)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)c+=this.popChar();return parseInt(c,10)},t.prototype.patternCharacter=function(){var c=this.popChar();switch(c){case`
`: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:i(c)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(c){switch(c===void 0&&(c=0),this.peekChar(c)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.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}},t.prototype.isQuantifier=function(){var c=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(c)}},t.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(c){for(var m="",g=0;g<c;g++){var _=this.popChar();if(e.test(_)===!1)throw Error("Expecting a HexDecimal digits");m+=_}var O=parseInt(m,16);return{type:"Character",value:O}},t.prototype.peekChar=function(c){return c===void 0&&(c=0),this.input[this.idx+c]},t.prototype.popChar=function(){var c=this.peekChar(0);return this.consumeChar(),c},t.prototype.consumeChar=function(c){if(c!==void 0&&this.input[this.idx]!==c)throw Error("Expected: '"+c+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(c){return{begin:c,end:this.idx}};var e=/[0-9a-fA-F]/,r=/[0-9]/,n=/[1-9]/;function i(c){return c.charCodeAt(0)}a(i,"cc");function o(c,m){c.length!==void 0?c.forEach(function(g){m.push(g)}):m.push(c)}a(o,"insertToSet");function s(c,m){if(c[m]===!0)throw"duplicate flag "+m;c[m]=!0}a(s,"addFlag");function u(c){if(c===void 0)throw Error("Internal Error - Should never get here!")}a(u,"ASSERT_EXISTS");function l(){throw Error("Internal Error - Should never get here!")}a(l,"ASSERT_NEVER_REACH_HERE");var p,h=[];for(p=i("0");p<=i("9");p++)h.push(p);var f=[i("_")].concat(h);for(p=i("a");p<=i("z");p++)f.push(p);for(p=i("A");p<=i("Z");p++)f.push(p);var E=[i(" "),i("\f"),i(`
`),i("\r"),i(" "),i("\v"),i(" "),i("\xA0"),i("\u1680"),i("\u2000"),i("\u2001"),i("\u2002"),i("\u2003"),i("\u2004"),i("\u2005"),i("\u2006"),i("\u2007"),i("\u2008"),i("\u2009"),i("\u200A"),i("\u2028"),i("\u2029"),i("\u202F"),i("\u205F"),i("\u3000"),i("\uFEFF")];function d(){}return a(d,"BaseRegExpVisitor"),d.prototype.visitChildren=function(c){for(var m in c){var g=c[m];c.hasOwnProperty(m)&&(g.type!==void 0?this.visit(g):Array.isArray(g)&&g.forEach(function(_){this.visit(_)},this))}},d.prototype.visit=function(c){switch(c.type){case"Pattern":this.visitPattern(c);break;case"Flags":this.visitFlags(c);break;case"Disjunction":this.visitDisjunction(c);break;case"Alternative":this.visitAlternative(c);break;case"StartAnchor":this.visitStartAnchor(c);break;case"EndAnchor":this.visitEndAnchor(c);break;case"WordBoundary":this.visitWordBoundary(c);break;case"NonWordBoundary":this.visitNonWordBoundary(c);break;case"Lookahead":this.visitLookahead(c);break;case"NegativeLookahead":this.visitNegativeLookahead(c);break;case"Character":this.visitCharacter(c);break;case"Set":this.visitSet(c);break;case"Group":this.visitGroup(c);break;case"GroupBackReference":this.visitGroupBackReference(c);break;case"Quantifier":this.visitQuantifier(c);break}this.visitChildren(c)},d.prototype.visitPattern=function(c){},d.prototype.visitFlags=function(c){},d.prototype.visitDisjunction=function(c){},d.prototype.visitAlternative=function(c){},d.prototype.visitStartAnchor=function(c){},d.prototype.visitEndAnchor=function(c){},d.prototype.visitWordBoundary=function(c){},d.prototype.visitNonWordBoundary=function(c){},d.prototype.visitLookahead=function(c){},d.prototype.visitNegativeLookahead=function(c){},d.prototype.visitCharacter=function(c){},d.prototype.visitSet=function(c){},d.prototype.visitGroup=function(c){},d.prototype.visitGroupBackReference=function(c){},d.prototype.visitQuantifier=function(c){},{RegExpParser:t,BaseRegExpVisitor:d,VERSION:"0.5.0"}})});function At(t){var e=t.toString();if(wr.hasOwnProperty(e))return wr[e];var r=Lu.pattern(e);return wr[e]=r,r}function Ho(){wr={}}var Vo,wr,Lu,Dr=S(()=>{Vo=Mn(Fr()),wr={},Lu=new Vo.RegExpParser;a(At,"getRegExpAst");a(Ho,"clearRegExpParserCache")});function zo(t,e){e===void 0&&(e=!1);try{var r=At(t),n=Dn(r.value,{},r.flags.ignoreCase);return n}catch(o){if(o.message===jo)e&&kr(""+ir+(" Unable to optimize: < "+t.toString()+` >
`)+` Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";e&&(i=`
This will disable the lexer's first char optimizations.
See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),rr(ir+`
`+(" Failed parsing: < "+t.toString()+` >
`)+(" Using the regexp-to-ast library version: "+Br.VERSION+`
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}function Dn(t,e,r){switch(t.type){case"Disjunction":for(var n=0;n<t.value.length;n++)Dn(t.value[n],e,r);break;case"Alternative":for(var i=t.value,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 s=o;switch(s.type){case"Character":Yr(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(jo);y(s.value,function(p){if(typeof p=="number")Yr(p,e,r);else{var h=p;if(r===!0)for(var f=h.from;f<=h.to;f++)Yr(f,e,r);else{for(var f=h.from;f<=h.to&&f<St;f++)Yr(f,e,r);if(h.to>=St)for(var E=h.from>=St?h.from:St,d=h.to,c=Fe(E),m=Fe(d),g=c;g<=m;g++)e[g]=g}}});break;case"Group":Dn(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}var u=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Yn(s)===!1||s.type!=="Group"&&u===!1)break}break;default:throw Error("non exhaustive match!")}return V(e)}function Yr(t,e,r){var n=Fe(t);e[n]=n,r===!0&&Mu(t,e)}function Mu(t,e){var r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){var i=Fe(n.charCodeAt(0));e[i]=i}else{var o=r.toLowerCase();if(o!==r){var i=Fe(o.charCodeAt(0));e[i]=i}}}function Xo(t,e){return Ke(t.value,function(r){if(typeof r=="number")return L(e,r);var n=r;return Ke(e,function(i){return n.from<=i&&i<=n.to})!==void 0})}function Yn(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?ee(t.value)?te(t.value,Yn):Yn(t.value):!1}function Gr(t,e){if(e instanceof RegExp){var r=At(e),n=new Uu(t);return n.visit(r),n.found}else return Ke(e,function(i){return L(t,i.charCodeAt(0))})!==void 0}var Br,ku,jo,ir,Uu,qo=S(()=>{Br=Mn(Fr());C();Dr();Bn();ku=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),jo="Complement Sets are not supported for first char optimization",ir=`Unable to use "first char" lexer optimizations:
`;a(zo,"getOptimizedStartCodesIndices");a(Dn,"firstCharOptimizedIndices");a(Yr,"addOptimizedIdxToResult");a(Mu,"handleIgnoreCase");a(Xo,"findCode");a(Yn,"isWholeOptional");Uu=(function(t){ku(e,t);function e(r){var n=t.call(this)||this;return n.targetCharCodes=r,n.found=!1,n}return a(e,"CharCodeFinder"),e.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}t.prototype.visitChildren.call(this,r)}},e.prototype.visitCharacter=function(r){L(this.targetCharCodes,r.value)&&(this.found=!0)},e.prototype.visitSet=function(r){r.complement?Xo(r,this.targetCharCodes)===void 0&&(this.found=!0):Xo(r,this.targetCharCodes)!==void 0&&(this.found=!0)},e})(Br.BaseRegExpVisitor);a(Gr,"canMatchCharCode")});function Jo(t,e){e=tr(e,{useSticky:Kn,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:a(function(O,R){return R()},"tracer")});var r=e.tracer;r("initCharCodeToOptimizedIndexMap",function(){Zu()});var n;r("Reject Lexer.NA",function(){n=We(t,function(O){return O[we]===$.NA})});var i=!1,o;r("Transform Patterns",function(){i=!1,o=T(n,function(O){var R=O[we];if(xe(R)){var b=R.source;return b.length===1&&b!=="^"&&b!=="$"&&b!=="."&&!R.ignoreCase?b:b.length===2&&b[0]==="\\"&&!L(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],b[1])?b[1]:e.useSticky?$o(R):Qo(R)}else{if(Ce(R))return i=!0,{exec:R};if(N(R,"exec"))return i=!0,R;if(typeof R=="string"){if(R.length===1)return R;var M=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),he=new RegExp(M);return e.useSticky?$o(he):Qo(he)}else throw Error("non exhaustive match")}})});var s,u,l,p,h;r("misc mapping",function(){s=T(n,function(O){return O.tokenTypeIdx}),u=T(n,function(O){var R=O.GROUP;if(R!==$.SKIPPED){if(Ne(R))return R;if(ne(R))return!1;throw Error("non exhaustive match")}}),l=T(n,function(O){var R=O.LONGER_ALT;if(R){var b=Do(n,R);return b}}),p=T(n,function(O){return O.PUSH_MODE}),h=T(n,function(O){return N(O,"POP_MODE")})});var f;r("Line Terminator Handling",function(){var O=sa(e.lineTerminatorCharacters);f=T(n,function(R){return!1}),e.positionTracking!=="onlyOffset"&&(f=T(n,function(R){if(N(R,"LINE_BREAKS"))return R.LINE_BREAKS;if(aa(R,O)===!1)return Gr(O,R.PATTERN)}))});var E,d,c,m;r("Misc Mapping #2",function(){E=T(n,ia),d=T(o,Qu),c=w(n,function(O,R){var b=R.GROUP;return Ne(b)&&b!==$.SKIPPED&&(O[b]=[]),O},{}),m=T(o,function(O,R){return{pattern:o[R],longerAlt:l[R],canLineTerminator:f[R],isCustom:E[R],short:d[R],group:u[R],push:p[R],pop:h[R],tokenTypeIdx:s[R],tokenType:n[R]}})});var g=!0,_=[];return e.safeMode||r("First Char Optimization",function(){_=w(n,function(O,R,b){if(typeof R.PATTERN=="string"){var M=R.PATTERN.charCodeAt(0),he=Fe(M);Gn(O,he,m[b])}else if(ee(R.START_CHARS_HINT)){var ye;y(R.START_CHARS_HINT,function(de){var ae=typeof de=="string"?de.charCodeAt(0):de,le=Fe(ae);ye!==le&&(ye=le,Gn(O,le,m[b]))})}else if(xe(R.PATTERN))if(R.PATTERN.unicode)g=!1,e.ensureOptimizations&&rr(""+ir+(" Unable to analyze < "+R.PATTERN.toString()+` > pattern.
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var oe=zo(R.PATTERN,e.ensureOptimizations);P(oe)&&(g=!1),y(oe,function(de){Gn(O,de,m[b])})}else e.ensureOptimizations&&rr(""+ir+(" TokenType: <"+R.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
`)+` This will disable the lexer's first char optimizations.
For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return O},[])}),r("ArrayPacking",function(){_=Bo(_)}),{emptyGroups:c,patternIdxToConfig:m,charCodeToPatternIdxToConfig:_,hasCustom:i,canBeOptimized:g}}function ea(t,e){var r=[],n=Fu(t);r=r.concat(n.errors);var i=wu(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(bu(o)),r=r.concat(Hu(o)),r=r.concat(Xu(o,e)),r=r.concat(ju(o)),r}function bu(t){var e=[],r=_e(t,function(n){return xe(n[we])});return e=e.concat(Yu(r)),e=e.concat(Wu(r)),e=e.concat(Ku(r)),e=e.concat(Vu(r)),e=e.concat(Bu(r)),e}function Fu(t){var e=_e(t,function(i){return!N(i,we)}),r=T(e,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Y.MISSING_PATTERN,tokenTypes:[i]}}),n=dt(t,e);return{errors:r,valid:n}}function wu(t){var e=_e(t,function(i){var o=i[we];return!xe(o)&&!Ce(o)&&!N(o,"exec")&&!Ne(o)}),r=T(e,function(i){return{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:Y.INVALID_PATTERN,tokenTypes:[i]}}),n=dt(t,e);return{errors:r,valid:n}}function Yu(t){var e=(function(i){Zo(o,i);function o(){var s=i!==null&&i.apply(this,arguments)||this;return s.found=!1,s}return a(o,"EndAnchorFinder"),o.prototype.visitEndAnchor=function(s){this.found=!0},o})(Wn.BaseRegExpVisitor),r=_e(t,function(i){var o=i[we];try{var s=At(o),u=new e;return u.visit(s),u.found}catch{return Du.test(o.source)}}),n=T(r,function(i){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
See sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Y.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}function Bu(t){var e=_e(t,function(n){var i=n[we];return i.test("")}),r=T(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Y.EMPTY_MATCH_PATTERN,tokenTypes:[n]}});return r}function Wu(t){var e=(function(i){Zo(o,i);function o(){var s=i!==null&&i.apply(this,arguments)||this;return s.found=!1,s}return a(o,"StartAnchorFinder"),o.prototype.visitStartAnchor=function(s){this.found=!0},o})(Wn.BaseRegExpVisitor),r=_e(t,function(i){var o=i[we];try{var s=At(o),u=new e;return u.visit(s),u.found}catch{return Gu.test(o.source)}}),n=T(r,function(i){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Y.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}function Ku(t){var e=_e(t,function(n){var i=n[we];return i instanceof RegExp&&(i.multiline||i.global)}),r=T(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Y.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}});return r}function Vu(t){var e=[],r=T(t,function(o){return w(t,function(s,u){return o.PATTERN.source===u.PATTERN.source&&!L(e,u)&&u.PATTERN!==$.NA&&(e.push(u),s.push(u)),s},[])});r=Ve(r);var n=_e(r,function(o){return o.length>1}),i=T(n,function(o){var s=T(o,function(l){return l.name}),u=re(o).PATTERN;return{message:"The same RegExp pattern ->"+u+"<-"+("has been used in all of the following Token Types: "+s.join(", ")+" <-"),type:Y.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}});return i}function Hu(t){var e=_e(t,function(n){if(!N(n,"GROUP"))return!1;var i=n.GROUP;return i!==$.SKIPPED&&i!==$.NA&&!Ne(i)}),r=T(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Y.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}});return r}function Xu(t,e){var r=_e(t,function(i){return i.PUSH_MODE!==void 0&&!L(e,i.PUSH_MODE)}),n=T(r,function(i){var o="Token Type: ->"+i.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+i.PUSH_MODE+"<-which does not exist";return{message:o,type:Y.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return n}function ju(t){var e=[],r=w(t,function(n,i,o){var s=i.PATTERN;return s===$.NA||(Ne(s)?n.push({str:s,idx:o,tokenType:i}):xe(s)&&qu(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return y(t,function(n,i){y(r,function(o){var s=o.str,u=o.idx,l=o.tokenType;if(i<u&&zu(s,n.PATTERN)){var p="Token: ->"+l.name+`<- can never be matched.
`+("Because it appears AFTER the Token Type ->"+n.name+"<-")+`in the lexer's definition.
See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:p,type:Y.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),e}function zu(t,e){if(xe(e)){var r=e.exec(t);return r!==null&&r.index===0}else{if(Ce(e))return e(t,0,[],{});if(N(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function qu(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return Ke(e,function(r){return t.source.indexOf(r)!==-1})===void 0}function Qo(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function $o(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function ta(t,e,r){var n=[];return N(t,ot)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ot+`> property in its definition
`,type:Y.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),N(t,Wr)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Wr+`> property in its definition
`,type:Y.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),N(t,Wr)&&N(t,ot)&&!N(t.modes,t.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a "+ot+": <"+t.defaultMode+`>which does not exist
`,type:Y.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),N(t,Wr)&&y(t.modes,function(i,o){y(i,function(s,u){ne(s)&&n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+o+"> at index: <"+u+`>
`),type:Y.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),n}function ra(t,e,r){var n=[],i=!1,o=Ve(K(Fo(t.modes,function(l){return l}))),s=We(o,function(l){return l[we]===$.NA}),u=sa(r);return e&&y(s,function(l){var p=aa(l,u);if(p!==!1){var h=$u(l,p),f={message:h,type:p.issue,tokenType:l};n.push(f)}else N(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Gr(u,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
for details.`,type:Y.NO_LINE_BREAKS_FLAGS}),n}function na(t){var e={},r=ue(t);return y(r,function(n){var i=t[n];if(ee(i))e[n]=[];else throw Error("non exhaustive match")}),e}function ia(t){var e=t.PATTERN;if(xe(e))return!1;if(Ce(e))return!0;if(N(e,"exec"))return!0;if(Ne(e))return!1;throw Error("non exhaustive match")}function Qu(t){return Ne(t)&&t.length===1?t.charCodeAt(0):!1}function aa(t,e){if(N(t,"LINE_BREAKS"))return!1;if(xe(t.PATTERN)){try{Gr(e,t.PATTERN)}catch(r){return{issue:Y.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Ne(t.PATTERN))return!1;if(ia(t))return{issue:Y.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function $u(t,e){if(e.issue===Y.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
`+(" The problem is in the <"+t.name+`> Token Type
`)+(" Root cause: "+e.errMsg+`.
`)+" For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Y.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
`+(" The problem is in the <"+t.name+`> Token Type
`)+" For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function sa(t){var e=T(t,function(r){return Ne(r)&&r.length>0?r.charCodeAt(0):r});return e}function Gn(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function Fe(t){return t<St?t:Kr[t]}function Zu(){if(P(Kr)){Kr=new Array(65536);for(var t=0;t<65536;t++)Kr[t]=t>255?255+~~(t/255):t}}var Wn,Zo,we,ot,Wr,Kn,Du,Gu,oa,St,Kr,Bn=S(()=>{Wn=Mn(Fr());or();C();qo();Dr();Zo=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),we="PATTERN",ot="defaultMode",Wr="modes",Kn=typeof new RegExp("(?:)").sticky=="boolean";a(Jo,"analyzeTokenTypes");a(ea,"validatePatterns");a(bu,"validateRegExpPattern");a(Fu,"findMissingPatterns");a(wu,"findInvalidPatterns");Du=/[^\\][\$]/;a(Yu,"findEndOfInputAnchor");a(Bu,"findEmptyMatchRegExps");Gu=/[^\\[][\^]|^\^/;a(Wu,"findStartOfInputAnchor");a(Ku,"findUnsupportedFlags");a(Vu,"findDuplicatePatterns");a(Hu,"findInvalidGroupType");a(Xu,"findModesThatDoNotExist");a(ju,"findUnreachablePatterns");a(zu,"testTokenType");a(qu,"noMetaChar");a(Qo,"addStartOfInput");a($o,"addStickyFlag");a(ta,"performRuntimeChecks");a(ra,"performWarningRuntimeChecks");a(na,"cloneEmptyGroups");a(ia,"isCustomPattern");a(Qu,"isShortPattern");oa={test:a(function(t){for(var e=t.length,r=this.lastIndex;r<e;r++){var 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},"test"),lastIndex:0};a(aa,"checkLineBreaksIssues");a($u,"buildLineBreakIssueMessage");a(sa,"getCharCodes");a(Gn,"addToMapOfArrays");St=256;a(Fe,"charCodeToOptimizedIndex");Kr=[];a(Zu,"initCharCodeToOptimizedIndexMap")});function Pt(t,e){var r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Ct(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}function He(t){var e=Ju(t);ec(e),rc(e),tc(e),y(e,function(r){r.isParent=r.categoryMatches.length>0})}function Ju(t){for(var e=W(t),r=t,n=!0;n;){r=Ve(K(T(r,function(o){return o.CATEGORIES})));var i=dt(r,e);e=e.concat(i),P(i)?n=!1:r=i}return e}function ec(t){y(t,function(e){Vn(e)||(la[ua]=e,e.tokenTypeIdx=ua++),ca(e)&&!ee(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ca(e)||(e.CATEGORIES=[]),nc(e)||(e.categoryMatches=[]),ic(e)||(e.categoryMatchesMap={})})}function tc(t){y(t,function(e){e.categoryMatches=[],y(e.categoryMatchesMap,function(r,n){e.categoryMatches.push(la[n].tokenTypeIdx)})})}function rc(t){y(t,function(e){fa([],e)})}function fa(t,e){y(t,function(r){e.categoryMatchesMap[r.tokenTypeIdx]=!0}),y(e.CATEGORIES,function(r){var n=t.concat(e);L(n,r)||fa(n,r)})}function Vn(t){return N(t,"tokenTypeIdx")}function ca(t){return N(t,"CATEGORIES")}function nc(t){return N(t,"categoryMatches")}function ic(t){return N(t,"categoryMatchesMap")}function pa(t){return N(t,"tokenTypeIdx")}var ua,la,xt=S(()=>{C();a(Pt,"tokenStructuredMatcher");a(Ct,"tokenStructuredMatcherNoCategories");ua=1,la={};a(He,"augmentTokenTypes");a(Ju,"expandCategories");a(ec,"assignTokenDefaultProps");a(tc,"assignCategoriesTokensProp");a(rc,"assignCategoriesMapProp");a(fa,"singleAssignCategoriesToksMap");a(Vn,"hasShortKeyProperty");a(ca,"hasCategoriesProperty");a(nc,"hasExtendingTokensTypesProperty");a(ic,"hasExtendingTokensTypesMapProperty");a(pa,"isTokenType")});var Hn,Xn=S(()=>{Hn={buildUnableToPopLexerModeMessage:a(function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},"buildUnableToPopLexerModeMessage"),buildUnexpectedCharactersMessage:a(function(t,e,r,n,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+","+(" skipped "+r+" characters.")},"buildUnexpectedCharactersMessage")}});var Y,ar,$,or=S(()=>{Bn();C();xt();Xn();Dr();(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"})(Y||(Y={}));ar={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Hn,traceInitPerf:!1,skipValidations:!1};Object.freeze(ar);$=(function(){function t(e,r){var n=this;if(r===void 0&&(r=ar),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=bn(ar,r);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var o,s=!0;n.TRACE_INIT("Lexer Config handling",function(){if(n.config.lineTerminatorsPattern===ar.lineTerminatorsPattern)n.config.lineTerminatorsPattern=oa;else if(n.config.lineTerminatorCharacters===ar.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),ee(e)?(o={modes:{}},o.modes[ot]=W(e),o[ot]=ot):(s=!1,o=it(e))}),n.config.skipValidations===!1&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(ta(o,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(ra(o,n.trackStartLines,n.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},y(o.modes,function(h,f){o.modes[f]=We(h,function(E){return ne(E)})});var u=ue(o.modes);if(y(o.modes,function(h,f){n.TRACE_INIT("Mode: <"+f+"> processing",function(){if(n.modes.push(f),n.config.skipValidations===!1&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(ea(h,u))}),P(n.lexerDefinitionErrors)){He(h);var E;n.TRACE_INIT("analyzeTokenTypes",function(){E=Jo(h,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT.bind(n)})}),n.patternIdxToConfig[f]=E.patternIdxToConfig,n.charCodeToPatternIdxToConfig[f]=E.charCodeToPatternIdxToConfig,n.emptyGroups=bn(n.emptyGroups,E.emptyGroups),n.hasCustom=E.hasCustom||n.hasCustom,n.canModeBeOptimized[f]=E.canBeOptimized}})}),n.defaultMode=o.defaultMode,!P(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var l=T(n.lexerDefinitionErrors,function(h){return h.message}),p=l.join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+p)}y(n.lexerDefinitionWarning,function(h){kr(h.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if(Kn?(n.chopInput=Fn,n.match=n.matchWithTest):(n.updateLastIndex=X,n.match=n.matchWithExec),s&&(n.handleModes=X),n.trackStartLines===!1&&(n.computeNewColumn=Fn),n.trackEndLines===!1&&(n.updateTokenEndLineColumnLocation=X),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else if(/onlyOffset/i.test(n.config.positionTracking))n.createTokenInstance=n.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+n.config.positionTracking+'"');n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)}),n.TRACE_INIT("Failed Optimization Warnings",function(){var h=w(n.canModeBeOptimized,function(f,E,d){return E===!1&&f.push(d),f},[]);if(r.ensureOptimizations&&!P(h))throw Error("Lexer Modes: < "+h.join(", ")+` > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),n.TRACE_INIT("clearRegExpParserCache",function(){Ho()}),n.TRACE_INIT("toFastProperties",function(){Mr(n)})})}return a(t,"Lexer"),t.prototype.tokenize=function(e,r){if(r===void 0&&(r=this.defaultMode),!P(this.lexerDefinitionErrors)){var n=T(this.lexerDefinitionErrors,function(s){return s.message}),i=n.join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+i)}var o=this.tokenizeInternal(e,r);return o},t.prototype.tokenizeInternal=function(e,r){var n=this,i,o,s,u,l,p,h,f,E,d,c,m,g,_,O,R=e,b=R.length,M=0,he=0,ye=this.hasCustom?0:Math.floor(e.length/10),oe=new Array(ye),de=[],ae=this.trackStartLines?1:void 0,le=this.trackStartLines?1:void 0,Ge=na(this.emptyGroups),Xt=this.trackStartLines,jt=this.config.lineTerminatorsPattern,Ot=0,tt=[],zt=[],Sr=[],So=[];Object.freeze(So);var qt=void 0;function Po(){return tt}a(Po,"getPossiblePatternsSlow");function Co(se){var Zt=Fe(se),It=zt[Zt];return It===void 0?So:It}a(Co,"getPossiblePatternsOptimized");var Ru=a(function(se){if(Sr.length===1&&se.tokenType.PUSH_MODE===void 0){var Zt=n.config.errorMessageProvider.buildUnableToPopLexerModeMessage(se);de.push({offset:se.startOffset,line:se.startLine!==void 0?se.startLine:void 0,column:se.startColumn!==void 0?se.startColumn:void 0,length:se.image.length,message:Zt})}else{Sr.pop();var It=Cr(Sr);tt=n.patternIdxToConfig[It],zt=n.charCodeToPatternIdxToConfig[It],Ot=tt.length;var yu=n.canModeBeOptimized[It]&&n.config.safeMode===!1;zt&&yu?qt=Co:qt=Po}},"pop_mode");function xo(se){Sr.push(se),zt=this.charCodeToPatternIdxToConfig[se],tt=this.patternIdxToConfig[se],Ot=tt.length,Ot=tt.length;var Zt=this.canModeBeOptimized[se]&&this.config.safeMode===!1;zt&&Zt?qt=Co:qt=Po}a(xo,"push_mode"),xo.call(this,r);for(var Pe;M<b;){l=null;var Lo=R.charCodeAt(M),ko=qt(Lo),gu=ko.length;for(i=0;i<gu;i++){Pe=ko[i];var rt=Pe.pattern;p=null;var Qt=Pe.short;if(Qt!==!1?Lo===Qt&&(l=rt):Pe.isCustom===!0?(O=rt.exec(R,M,oe,Ge),O!==null?(l=O[0],O.payload!==void 0&&(p=O.payload)):l=null):(this.updateLastIndex(rt,M),l=this.match(rt,e,M)),l!==null){if(u=Pe.longerAlt,u!==void 0){var Sn=tt[u],Pn=Sn.pattern;h=null,Sn.isCustom===!0?(O=Pn.exec(R,M,oe,Ge),O!==null?(s=O[0],O.payload!==void 0&&(h=O.payload)):s=null):(this.updateLastIndex(Pn,M),s=this.match(Pn,e,M)),s&&s.length>l.length&&(l=s,p=h,Pe=Sn)}break}}if(l!==null){if(f=l.length,E=Pe.group,E!==void 0&&(d=Pe.tokenTypeIdx,c=this.createTokenInstance(l,M,d,Pe.tokenType,ae,le,f),this.handlePayload(c,p),E===!1?he=this.addToken(oe,he,c):Ge[E].push(c)),e=this.chopInput(e,f),M=M+f,le=this.computeNewColumn(le,f),Xt===!0&&Pe.canLineTerminator===!0){var Pr=0,Cn=void 0,xn=void 0;jt.lastIndex=0;do Cn=jt.test(l),Cn===!0&&(xn=jt.lastIndex-1,Pr++);while(Cn===!0);Pr!==0&&(ae=ae+Pr,le=f-xn,this.updateTokenEndLineColumnLocation(c,E,xn,Pr,ae,le,f))}this.handleModes(Pe,Ru,xo,c)}else{for(var Ln=M,Mo=ae,Uo=le,$t=!1;!$t&&M<b;)for(g=R.charCodeAt(M),e=this.chopInput(e,1),M++,o=0;o<Ot;o++){var kn=tt[o],rt=kn.pattern,Qt=kn.short;if(Qt!==!1?R.charCodeAt(M)===Qt&&($t=!0):kn.isCustom===!0?$t=rt.exec(R,M,oe,Ge)!==null:(this.updateLastIndex(rt,M),$t=rt.exec(e)!==null),$t===!0)break}m=M-Ln,_=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,Ln,m,Mo,Uo),de.push({offset:Ln,line:Mo,column:Uo,length:m,message:_})}}return this.hasCustom||(oe.length=he),{tokens:oe,groups:Ge,errors:de}},t.prototype.handleModes=function(e,r,n,i){if(e.pop===!0){var o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)},t.prototype.chopInput=function(e,r){return e.substring(r)},t.prototype.updateLastIndex=function(e,r){e.lastIndex=r},t.prototype.updateTokenEndLineColumnLocation=function(e,r,n,i,o,s,u){var l,p;r!==void 0&&(l=n===u-1,p=l?-1:0,i===1&&l===!0||(e.endLine=o+p,e.endColumn=s-1+-p))},t.prototype.computeNewColumn=function(e,r){return e+r},t.prototype.createTokenInstance=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return null},t.prototype.createOffsetOnlyToken=function(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}},t.prototype.createStartOnlyToken=function(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}},t.prototype.createFullToken=function(e,r,n,i,o,s,u){return{image:e,startOffset:r,endOffset:r+u-1,startLine:o,endLine:o,startColumn:s,endColumn:s+u-1,tokenTypeIdx:n,tokenType:i}},t.prototype.addToken=function(e,r,n){return 666},t.prototype.addTokenUsingPush=function(e,r,n){return e.push(n),r},t.prototype.addTokenUsingMemberAccess=function(e,r,n){return e[r]=n,r++,r},t.prototype.handlePayload=function(e,r){},t.prototype.handlePayloadNoCustom=function(e,r){},t.prototype.handlePayloadWithCustom=function(e,r){r!==null&&(e.payload=r)},t.prototype.match=function(e,r,n){return null},t.prototype.matchWithTest=function(e,r,n){var i=e.test(r);return i===!0?r.substring(n,e.lastIndex):null},t.prototype.matchWithExec=function(e,r){var n=e.exec(r);return n!==null?n[0]:n},t.prototype.TRACE_INIT=function(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--> <"+e+">");var i=Ur(r),o=i.time,s=i.value,u=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,s}else return r()},t.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.",t.NA=/NOT_APPLICABLE/,t})()});function Xe(t){return jn(t)?t.LABEL:t.name}function jn(t){return Ne(t.LABEL)&&t.LABEL!==""}function A(t){return ac(t)}function ac(t){var e=t.pattern,r={};if(r.name=t.name,ne(e)||(r.PATTERN=e),N(t,oc))throw`The parent property is no longer supported.
See: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.`;return N(t,ha)&&(r.CATEGORIES=t[ha]),He([r]),N(t,da)&&(r.LABEL=t[da]),N(t,ma)&&(r.GROUP=t[ma]),N(t,Ta)&&(r.POP_MODE=t[Ta]),N(t,Ea)&&(r.PUSH_MODE=t[Ea]),N(t,va)&&(r.LONGER_ALT=t[va]),N(t,Ra)&&(r.LINE_BREAKS=t[Ra]),N(t,ga)&&(r.START_CHARS_HINT=t[ga]),r}function mt(t,e,r,n,i,o,s,u){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:u,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}var oc,ha,da,ma,Ea,Ta,va,Ra,ga,Te,at=S(()=>{C();or();xt();a(Xe,"tokenLabel");a(jn,"hasTokenLabel");oc="parent",ha="categories",da="label",ma="group",Ea="push_mode",Ta="pop_mode",va="longer_alt",Ra="line_breaks",ga="start_chars_hint";a(A,"createToken");a(ac,"createTokenInternal");Te=A({name:"EOF",pattern:$.NA});He([Te]);a(mt,"createTokenInstance")});function zn(t){return T(t,sr)}function sr(t){function e(i){return T(i,sr)}if(a(e,"convertDefinition"),t instanceof B)return{type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(t instanceof D)return{type:"Alternative",definition:e(t.definition)};if(t instanceof G)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof q)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Q)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:sr(new x({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof j)return{type:"RepetitionWithSeparator",idx:t.idx,separator:sr(new x({terminalType:t.sep