UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

54 lines 443 kB
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href; var iy=Object.create;var Ji=Object.defineProperty;var oy=Object.getOwnPropertyDescriptor;var ay=Object.getOwnPropertyNames;var sy=Object.getPrototypeOf,cy=Object.prototype.hasOwnProperty;var c=(t,e)=>Ji(t,"name",{value:e,configurable:!0});var L=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Mt=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Af=(t,e)=>{for(var n in e)Ji(t,n,{get:e[n],enumerable:!0})},Nf=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ay(e))!cy.call(t,i)&&i!==n&&Ji(t,i,{get:()=>e[i],enumerable:!(r=oy(e,i))||r.enumerable});return t};var Jn=(t,e,n)=>(n=t!=null?iy(sy(t)):{},Nf(e||!t||!t.__esModule?Ji(n,"default",{value:t,enumerable:!0}):n,t)),ya=t=>Nf(Ji({},"__esModule",{value:!0}),t);var ro,Vc=L(()=>{ro="7.1.1"});function U(t){return t&&t.length===0}function it(t){return t==null?[]:Object.keys(t)}function Se(t){for(var e=[],n=Object.keys(t),r=0;r<n.length;r++)e.push(t[n[r]]);return e}function jf(t,e){for(var n=[],r=it(t),i=0;i<r.length;i++){var o=r[i];n.push(e.call(null,t[o],o))}return n}function N(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e.call(null,t[r],r));return n}function Ce(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];Array.isArray(r)?e=e.concat(Ce(r)):e.push(r)}return e}function qe(t){return U(t)?void 0:t[0]}function Ra(t){var e=t&&t.length;return e?t[e-1]:void 0}function R(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e.call(null,t[n],n);else if(Ca(t))for(var r=it(t),n=0;n<r.length;n++){var i=r[n],o=t[i];e.call(null,o,i)}else throw Error("non exhaustive match")}function Ft(t){return typeof t=="string"}function ze(t){return t===void 0}function Ht(t){return t instanceof Function}function Pe(t,e){return e===void 0&&(e=1),t.slice(e,t.length)}function tr(t,e){return e===void 0&&(e=1),t.slice(0,t.length-e)}function wt(t,e){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];e.call(null,i)&&n.push(i)}return n}function _n(t,e){return wt(t,function(n){return!e(n)})}function Nt(t,e){for(var n=Object.keys(t),r={},i=0;i<n.length;i++){var o=n[i],a=t[o];e(a)&&(r[o]=a)}return r}function C(t,e){return Ca(t)?t.hasOwnProperty(e):!1}function Z(t,e){return In(t,function(n){return n===e})!==void 0}function ye(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function nr(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function In(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(e.call(null,r))return r}}function Gf(t,e){for(var n=[],r=0;r<t.length;r++){var i=t[r];e.call(null,i)&&n.push(i)}return n}function pe(t,e,n){for(var r=Array.isArray(t),i=r?t:Se(t),o=r?[]:it(t),a=n,s=0;s<i.length;s++)a=e.call(null,a,i[s],r?s:o[s]);return a}function Sn(t){return _n(t,function(e){return e==null})}function io(t,e){e===void 0&&(e=c(function(r){return r},"identity"));var n=[];return pe(t,function(r,i){var o=e(i);return Z(n,o)?r:(n.push(o),r.concat(i))},[])}function SS(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=[null],i=r.concat(e);return Function.bind.apply(t,i)}function He(t){return Array.isArray(t)}function Kt(t){return t instanceof RegExp}function Ca(t){return t instanceof Object}function Ke(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0}function Ar(t,e){return _n(t,function(n){return Z(e,n)})}function _a(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}function $f(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}function PS(t,e){var n=ye(t);return n.sort(function(r,i){return e(r)-e(i)}),n}function OS(t,e){if(t.length!==e.length)throw Error("can't zipObject with different number of keys and values!");for(var n={},r=0;r<t.length;r++)n[t[r]]=e[r];return n}function xt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=it(i),a=0;a<o.length;a++){var s=o[a];t[s]=i[s]}return t}function ky(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=it(i),a=0;a<o.length;a++){var s=o[a];C(t,s)||(t[s]=i[s])}return t}function oo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ky.apply(null,[{}].concat(t))}function Bf(t,e){var n={};return R(t,function(r){var i=e(r),o=n[i];o?o.push(r):n[i]=[r]}),n}function jc(t,e){for(var n=nr(t),r=it(e),i=0;i<r.length;i++){var o=r[i],a=e[o];n[o]=a}return n}function Oe(){}function Gc(t){return t}function Wf(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r!==void 0?r:void 0)}return e}function ao(t){console&&console.error&&console.error("Error: "+t)}function Ia(t){console&&console.warn&&console.warn("Warning: "+t)}function $c(){return typeof Map=="function"}function Yf(t,e){e.forEach(function(n){var r=n.prototype;Object.getOwnPropertyNames(r).forEach(function(i){if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(r,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=n.prototype[i]}})})}function Sa(toBecomeFast){function FakeConstructor(){}c(FakeConstructor,"FakeConstructor"),FakeConstructor.prototype=toBecomeFast;var fakeInstance=new FakeConstructor;function fakeAccess(){return typeof fakeInstance.bar}return c(fakeAccess,"fakeAccess"),fakeAccess(),fakeAccess(),toBecomeFast;eval(toBecomeFast)}function so(t){return t[t.length-1]}function Pa(t){var e=new Date().getTime(),n=t(),r=new Date().getTime(),i=r-e;return{time:i,value:n}}var H=L(()=>{c(U,"isEmpty");c(it,"keys");c(Se,"values");c(jf,"mapValues");c(N,"map");c(Ce,"flatten");c(qe,"first");c(Ra,"last");c(R,"forEach");c(Ft,"isString");c(ze,"isUndefined");c(Ht,"isFunction");c(Pe,"drop");c(tr,"dropRight");c(wt,"filter");c(_n,"reject");c(Nt,"pick");c(C,"has");c(Z,"contains");c(ye,"cloneArr");c(nr,"cloneObj");c(In,"find");c(Gf,"findAll");c(pe,"reduce");c(Sn,"compact");c(io,"uniq");c(SS,"partial");c(He,"isArray");c(Kt,"isRegExp");c(Ca,"isObject");c(Ke,"every");c(Ar,"difference");c(_a,"some");c($f,"indexOf");c(PS,"sortBy");c(OS,"zipObject");c(xt,"assign");c(ky,"assignNoOverwrite");c(oo,"defaults");c(Bf,"groupBy");c(jc,"merge");c(Oe,"NOOP");c(Gc,"IDENTITY");c(Wf,"packArray");c(ao,"PRINT_ERROR");c(Ia,"PRINT_WARNING");c($c,"isES2015MapSupported");c(Yf,"applyMixins");c(Sa,"toFastProperties");c(so,"peek");c(Pa,"timer")});var ba=Mt((Kf,Oa)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Oa=="object"&&Oa.exports?Oa.exports=e():t.regexpToAst=e()})(typeof self<"u"?self:Kf,function(){function t(){}c(t,"RegExpParser"),t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(m){this.idx=m.idx,this.input=m.input,this.groupIdx=m.groupIdx},t.prototype.pattern=function(m){this.idx=0,this.input=m,this.groupIdx=0,this.consumeChar("/");var g=this.disjunction();this.consumeChar("/");for(var E={type:"Flags",loc:{begin:this.idx,end:m.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":a(E,"global");break;case"i":a(E,"ignoreCase");break;case"m":a(E,"multiLine");break;case"u":a(E,"unicode");break;case"y":a(E,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:E,value:g,loc:this.loc(0)}},t.prototype.disjunction=function(){var m=[],g=this.idx;for(m.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),m.push(this.alternative());return{type:"Disjunction",value:m,loc:this.loc(g)}},t.prototype.alternative=function(){for(var m=[],g=this.idx;this.isTerm();)m.push(this.term());return{type:"Alternative",value:m,loc:this.loc(g)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var m=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(m)};case"$":return{type:"EndAnchor",loc:this.loc(m)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(m)};case"B":return{type:"NonWordBoundary",loc:this.loc(m)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var g;switch(this.popChar()){case"=":g="Lookahead";break;case"!":g="NegativeLookahead";break}s(g);var E=this.disjunction();return this.consumeChar(")"),{type:g,value:E,loc:this.loc(m)}}u()},t.prototype.quantifier=function(m){var g,E=this.idx;switch(this.popChar()){case"*":g={atLeast:0,atMost:1/0};break;case"+":g={atLeast:1,atMost:1/0};break;case"?":g={atLeast:0,atMost:1};break;case"{":var y=this.integerIncludingZero();switch(this.popChar()){case"}":g={atLeast:y,atMost:y};break;case",":var T;this.isDigit()?(T=this.integerIncludingZero(),g={atLeast:y,atMost:T}):g={atLeast:y,atMost:1/0},this.consumeChar("}");break}if(m===!0&&g===void 0)return;s(g);break}if(!(m===!0&&g===void 0))return s(g),this.peekChar(0)==="?"?(this.consumeChar("?"),g.greedy=!1):g.greedy=!0,g.type="Quantifier",g.loc=this.loc(E),g},t.prototype.atom=function(){var m,g=this.idx;switch(this.peekChar()){case".":m=this.dotAll();break;case"\\":m=this.atomEscape();break;case"[":m=this.characterClass();break;case"(":m=this.group();break}return m===void 0&&this.isPatternCharacter()&&(m=this.patternCharacter()),s(m),m.loc=this.loc(g),this.isQuantifier()&&(m.quantifier=this.quantifier()),m},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 m=this.positiveInteger();return{type:"GroupBackReference",value:m}},t.prototype.characterClassEscape=function(){var m,g=!1;switch(this.popChar()){case"d":m=f;break;case"D":m=f,g=!0;break;case"s":m=d;break;case"S":m=d,g=!0;break;case"w":m=p;break;case"W":m=p,g=!0;break}return s(m),{type:"Set",value:m,complement:g}},t.prototype.controlEscapeAtom=function(){var m;switch(this.popChar()){case"f":m=i("\f");break;case"n":m=i(` `);break;case"r":m=i("\r");break;case"t":m=i(" ");break;case"v":m=i("\v");break}return s(m),{type:"Character",value:m}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var m=this.popChar();if(/[a-zA-Z]/.test(m)===!1)throw Error("Invalid ");var g=m.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:g}},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 m=this.popChar();return{type:"Character",value:i(m)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var m=this.popChar();return{type:"Character",value:i(m)}}},t.prototype.characterClass=function(){var m=[],g=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),g=!0);this.isClassAtom();){var E=this.classAtom(),y=E.type==="Character";if(y&&this.isRangeDash()){this.consumeChar("-");var T=this.classAtom(),A=T.type==="Character";if(A){if(T.value<E.value)throw Error("Range out of order in character class");m.push({from:E.value,to:T.value})}else o(E.value,m),m.push(i("-")),o(T.value,m)}else o(E.value,m)}return this.consumeChar("]"),{type:"Set",complement:g,value:m}},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 m=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),m=!1):this.groupIdx++;var g=this.disjunction();this.consumeChar(")");var E={type:"Group",capturing:m,value:g};return m&&(E.idx=this.groupIdx),E},t.prototype.positiveInteger=function(){var m=this.popChar();if(r.test(m)===!1)throw Error("Expecting a positive integer");for(;n.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)},t.prototype.integerIncludingZero=function(){var m=this.popChar();if(n.test(m)===!1)throw Error("Expecting an integer");for(;n.test(this.peekChar(0));)m+=this.popChar();return parseInt(m,10)},t.prototype.patternCharacter=function(){var m=this.popChar();switch(m){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(m)}}},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 n.test(this.peekChar(0))},t.prototype.isClassAtom=function(m){switch(m===void 0&&(m=0),this.peekChar(m)){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 m=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(m)}},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(m){for(var g="",E=0;E<m;E++){var y=this.popChar();if(e.test(y)===!1)throw Error("Expecting a HexDecimal digits");g+=y}var T=parseInt(g,16);return{type:"Character",value:T}},t.prototype.peekChar=function(m){return m===void 0&&(m=0),this.input[this.idx+m]},t.prototype.popChar=function(){var m=this.peekChar(0);return this.consumeChar(),m},t.prototype.consumeChar=function(m){if(m!==void 0&&this.input[this.idx]!==m)throw Error("Expected: '"+m+"' 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(m){return{begin:m,end:this.idx}};var e=/[0-9a-fA-F]/,n=/[0-9]/,r=/[1-9]/;function i(m){return m.charCodeAt(0)}c(i,"cc");function o(m,g){m.length!==void 0?m.forEach(function(E){g.push(E)}):g.push(m)}c(o,"insertToSet");function a(m,g){if(m[g]===!0)throw"duplicate flag "+g;m[g]=!0}c(a,"addFlag");function s(m){if(m===void 0)throw Error("Internal Error - Should never get here!")}c(s,"ASSERT_EXISTS");function u(){throw Error("Internal Error - Should never get here!")}c(u,"ASSERT_NEVER_REACH_HERE");var l,f=[];for(l=i("0");l<=i("9");l++)f.push(l);var p=[i("_")].concat(f);for(l=i("a");l<=i("z");l++)p.push(l);for(l=i("A");l<=i("Z");l++)p.push(l);var d=[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 h(){}return c(h,"BaseRegExpVisitor"),h.prototype.visitChildren=function(m){for(var g in m){var E=m[g];m.hasOwnProperty(g)&&(E.type!==void 0?this.visit(E):Array.isArray(E)&&E.forEach(function(y){this.visit(y)},this))}},h.prototype.visit=function(m){switch(m.type){case"Pattern":this.visitPattern(m);break;case"Flags":this.visitFlags(m);break;case"Disjunction":this.visitDisjunction(m);break;case"Alternative":this.visitAlternative(m);break;case"StartAnchor":this.visitStartAnchor(m);break;case"EndAnchor":this.visitEndAnchor(m);break;case"WordBoundary":this.visitWordBoundary(m);break;case"NonWordBoundary":this.visitNonWordBoundary(m);break;case"Lookahead":this.visitLookahead(m);break;case"NegativeLookahead":this.visitNegativeLookahead(m);break;case"Character":this.visitCharacter(m);break;case"Set":this.visitSet(m);break;case"Group":this.visitGroup(m);break;case"GroupBackReference":this.visitGroupBackReference(m);break;case"Quantifier":this.visitQuantifier(m);break}this.visitChildren(m)},h.prototype.visitPattern=function(m){},h.prototype.visitFlags=function(m){},h.prototype.visitDisjunction=function(m){},h.prototype.visitAlternative=function(m){},h.prototype.visitStartAnchor=function(m){},h.prototype.visitEndAnchor=function(m){},h.prototype.visitWordBoundary=function(m){},h.prototype.visitNonWordBoundary=function(m){},h.prototype.visitLookahead=function(m){},h.prototype.visitNegativeLookahead=function(m){},h.prototype.visitCharacter=function(m){},h.prototype.visitSet=function(m){},h.prototype.visitGroup=function(m){},h.prototype.visitGroupBackReference=function(m){},h.prototype.visitQuantifier=function(m){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});function Zr(t){var e=t.toString();if(La.hasOwnProperty(e))return La[e];var n=Fy.pattern(e);return La[e]=n,n}function qf(){La={}}var Xf,La,Fy,Ma=L(()=>{Xf=Jn(ba()),La={},Fy=new Xf.RegExpParser;c(Zr,"getRegExpAst");c(qf,"clearRegExpParserCache")});function Jf(t,e){e===void 0&&(e=!1);try{var n=Zr(t),r=Bc(n.value,{},n.flags.ignoreCase);return r}catch(o){if(o.message===Qf)e&&Ia(""+co+(" 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.`),ao(co+` `+(" Failed parsing: < "+t.toString()+` > `)+(" Using the regexp-to-ast library version: "+Fa.VERSION+` `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}function Bc(t,e,n){switch(t.type){case"Disjunction":for(var r=0;r<t.value.length;r++)Bc(t.value[r],e,n);break;case"Alternative":for(var i=t.value,r=0;r<i.length;r++){var o=i[r];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":ka(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(Qf);R(a.value,function(l){if(typeof l=="number")ka(l,e,n);else{var f=l;if(n===!0)for(var p=f.from;p<=f.to;p++)ka(p,e,n);else{for(var p=f.from;p<=f.to&&p<ei;p++)ka(p,e,n);if(f.to>=ei)for(var d=f.from>=ei?f.from:ei,h=f.to,m=cn(d),g=cn(h),E=m;E<=g;E++)e[E]=E}}});break;case"Group":Bc(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}var s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Wc(a)===!1||a.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return Se(e)}function ka(t,e,n){var r=cn(t);e[r]=r,n===!0&&Dy(t,e)}function Dy(t,e){var n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){var i=cn(r.charCodeAt(0));e[i]=i}else{var o=n.toLowerCase();if(o!==n){var i=cn(o.charCodeAt(0));e[i]=i}}}function zf(t,e){return In(t.value,function(n){if(typeof n=="number")return Z(e,n);var r=n;return In(e,function(i){return r.from<=i&&i<=r.to})!==void 0})}function Wc(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?He(t.value)?Ke(t.value,Wc):Wc(t.value):!1}function wa(t,e){if(e instanceof RegExp){var n=Zr(e),r=new Uy(t);return r.visit(n),r.found}else return In(e,function(i){return Z(t,i.charCodeAt(0))})!==void 0}var Fa,wy,Qf,co,Uy,Zf=L(()=>{Fa=Jn(ba());H();Ma();Yc();wy=(function(){var t=c(function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)},"extendStatics");return function(e,n){t(e,n);function r(){this.constructor=e}c(r,"__"),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qf="Complement Sets are not supported for first char optimization",co=`Unable to use "first char" lexer optimizations: `;c(Jf,"getOptimizedStartCodesIndices");c(Bc,"firstCharOptimizedIndices");c(ka,"addOptimizedIdxToResult");c(Dy,"handleIgnoreCase");c(zf,"findCode");c(Wc,"isWholeOptional");Uy=(function(t){wy(e,t);function e(n){var r=t.call(this)||this;return r.targetCharCodes=n,r.found=!1,r}return c(e,"CharCodeFinder"),e.prototype.visitChildren=function(n){if(this.found!==!0){switch(n.type){case"Lookahead":this.visitLookahead(n);return;case"NegativeLookahead":this.visitNegativeLookahead(n);return}t.prototype.visitChildren.call(this,n)}},e.prototype.visitCharacter=function(n){Z(this.targetCharCodes,n.value)&&(this.found=!0)},e.prototype.visitSet=function(n){n.complement?zf(n,this.targetCharCodes)===void 0&&(this.found=!0):zf(n,this.targetCharCodes)!==void 0&&(this.found=!0)},e})(Fa.BaseRegExpVisitor);c(wa,"canMatchCharCode")});function rp(t,e){e=oo(e,{useSticky:Xc,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` `],tracer:c(function(T,A){return A()},"tracer")});var n=e.tracer;n("initCharCodeToOptimizedIndexMap",function(){nT()});var r;n("Reject Lexer.NA",function(){r=_n(t,function(T){return T[un]===ot.NA})});var i=!1,o;n("Transform Patterns",function(){i=!1,o=N(r,function(T){var A=T[un];if(Kt(A)){var V=A.source;return V.length===1&&V!=="^"&&V!=="$"&&V!=="."&&!A.ignoreCase?V:V.length===2&&V[0]==="\\"&&!Z(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],V[1])?V[1]:e.useSticky?tp(A):ep(A)}else{if(Ht(A))return i=!0,{exec:A};if(C(A,"exec"))return i=!0,A;if(typeof A=="string"){if(A.length===1)return A;var j=A.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Xe=new RegExp(j);return e.useSticky?tp(Xe):ep(Xe)}else throw Error("non exhaustive match")}})});var a,s,u,l,f;n("misc mapping",function(){a=N(r,function(T){return T.tokenTypeIdx}),s=N(r,function(T){var A=T.GROUP;if(A!==ot.SKIPPED){if(Ft(A))return A;if(ze(A))return!1;throw Error("non exhaustive match")}}),u=N(r,function(T){var A=T.LONGER_ALT;if(A){var V=$f(r,A);return V}}),l=N(r,function(T){return T.PUSH_MODE}),f=N(r,function(T){return C(T,"POP_MODE")})});var p;n("Line Terminator Handling",function(){var T=fp(e.lineTerminatorCharacters);p=N(r,function(A){return!1}),e.positionTracking!=="onlyOffset"&&(p=N(r,function(A){if(C(A,"LINE_BREAKS"))return A.LINE_BREAKS;if(lp(A,T)===!1)return wa(T,A.PATTERN)}))});var d,h,m,g;n("Misc Mapping #2",function(){d=N(r,cp),h=N(o,eT),m=pe(r,function(T,A){var V=A.GROUP;return Ft(V)&&V!==ot.SKIPPED&&(T[V]=[]),T},{}),g=N(o,function(T,A){return{pattern:o[A],longerAlt:u[A],canLineTerminator:p[A],isCustom:d[A],short:h[A],group:s[A],push:l[A],pop:f[A],tokenTypeIdx:a[A],tokenType:r[A]}})});var E=!0,y=[];return e.safeMode||n("First Char Optimization",function(){y=pe(r,function(T,A,V){if(typeof A.PATTERN=="string"){var j=A.PATTERN.charCodeAt(0),Xe=cn(j);Hc(T,Xe,g[V])}else if(He(A.START_CHARS_HINT)){var ft;R(A.START_CHARS_HINT,function(tt){var nt=typeof tt=="string"?tt.charCodeAt(0):tt,pt=cn(nt);ft!==pt&&(ft=pt,Hc(T,pt,g[V]))})}else if(Kt(A.PATTERN))if(A.PATTERN.unicode)E=!1,e.ensureOptimizations&&ao(""+co+(" Unable to analyze < "+A.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 Fe=Jf(A.PATTERN,e.ensureOptimizations);U(Fe)&&(E=!1),R(Fe,function(tt){Hc(T,tt,g[V])})}else e.ensureOptimizations&&ao(""+co+(" TokenType: <"+A.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`),E=!1;return T},[])}),n("ArrayPacking",function(){y=Wf(y)}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:E}}function ip(t,e){var n=[],r=jy(t);n=n.concat(r.errors);var i=Gy(r.valid),o=i.valid;return n=n.concat(i.errors),n=n.concat(Vy(o)),n=n.concat(qy(o)),n=n.concat(zy(o,e)),n=n.concat(Qy(o)),n}function Vy(t){var e=[],n=wt(t,function(r){return Kt(r[un])});return e=e.concat(By(n)),e=e.concat(Hy(n)),e=e.concat(Ky(n)),e=e.concat(Xy(n)),e=e.concat(Wy(n)),e}function jy(t){var e=wt(t,function(i){return!C(i,un)}),n=N(e,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:de.MISSING_PATTERN,tokenTypes:[i]}}),r=Ar(t,e);return{errors:n,valid:r}}function Gy(t){var e=wt(t,function(i){var o=i[un];return!Kt(o)&&!Ht(o)&&!C(o,"exec")&&!Ft(o)}),n=N(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:de.INVALID_PATTERN,tokenTypes:[i]}}),r=Ar(t,e);return{errors:n,valid:r}}function By(t){var e=(function(i){np(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return c(o,"EndAnchorFinder"),o.prototype.visitEndAnchor=function(a){this.found=!0},o})(Kc.BaseRegExpVisitor),n=wt(t,function(i){var o=i[un];try{var a=Zr(o),s=new e;return s.visit(a),s.found}catch{return $y.test(o.source)}}),r=N(n,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:de.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Wy(t){var e=wt(t,function(r){var i=r[un];return i.test("")}),n=N(e,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:de.EMPTY_MATCH_PATTERN,tokenTypes:[r]}});return n}function Hy(t){var e=(function(i){np(o,i);function o(){var a=i!==null&&i.apply(this,arguments)||this;return a.found=!1,a}return c(o,"StartAnchorFinder"),o.prototype.visitStartAnchor=function(a){this.found=!0},o})(Kc.BaseRegExpVisitor),n=wt(t,function(i){var o=i[un];try{var a=Zr(o),s=new e;return s.visit(a),s.found}catch{return Yy.test(o.source)}}),r=N(n,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:de.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Ky(t){var e=wt(t,function(r){var i=r[un];return i instanceof RegExp&&(i.multiline||i.global)}),n=N(e,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:de.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}});return n}function Xy(t){var e=[],n=N(t,function(o){return pe(t,function(a,s){return o.PATTERN.source===s.PATTERN.source&&!Z(e,s)&&s.PATTERN!==ot.NA&&(e.push(s),a.push(s)),a},[])});n=Sn(n);var r=wt(n,function(o){return o.length>1}),i=N(r,function(o){var a=N(o,function(u){return u.name}),s=qe(o).PATTERN;return{message:"The same RegExp pattern ->"+s+"<-"+("has been used in all of the following Token Types: "+a.join(", ")+" <-"),type:de.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}});return i}function qy(t){var e=wt(t,function(r){if(!C(r,"GROUP"))return!1;var i=r.GROUP;return i!==ot.SKIPPED&&i!==ot.NA&&!Ft(i)}),n=N(e,function(r){return{message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:de.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}});return n}function zy(t,e){var n=wt(t,function(i){return i.PUSH_MODE!==void 0&&!Z(e,i.PUSH_MODE)}),r=N(n,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:de.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return r}function Qy(t){var e=[],n=pe(t,function(r,i,o){var a=i.PATTERN;return a===ot.NA||(Ft(a)?r.push({str:a,idx:o,tokenType:i}):Kt(a)&&Zy(a)&&r.push({str:a.source,idx:o,tokenType:i})),r},[]);return R(t,function(r,i){R(n,function(o){var a=o.str,s=o.idx,u=o.tokenType;if(i<s&&Jy(a,r.PATTERN)){var l="Token: ->"+u.name+`<- can never be matched. `+("Because it appears AFTER the Token Type ->"+r.name+"<-")+`in the lexer's definition. See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:de.UNREACHABLE_PATTERN,tokenTypes:[r,u]})}})}),e}function Jy(t,e){if(Kt(e)){var n=e.exec(t);return n!==null&&n.index===0}else{if(Ht(e))return e(t,0,[],{});if(C(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function Zy(t){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return In(e,function(n){return t.source.indexOf(n)!==-1})===void 0}function ep(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function tp(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function op(t,e,n){var r=[];return C(t,rr)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+rr+`> property in its definition `,type:de.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),C(t,Da)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Da+`> property in its definition `,type:de.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),C(t,Da)&&C(t,rr)&&!C(t.modes,t.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a "+rr+": <"+t.defaultMode+`>which does not exist `,type:de.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),C(t,Da)&&R(t.modes,function(i,o){R(i,function(a,s){ze(a)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+o+"> at index: <"+s+`> `),type:de.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),r}function ap(t,e,n){var r=[],i=!1,o=Sn(Ce(jf(t.modes,function(u){return u}))),a=_n(o,function(u){return u[un]===ot.NA}),s=fp(n);return e&&R(a,function(u){var l=lp(u,s);if(l!==!1){var f=tT(u,l),p={message:f,type:l.issue,tokenType:u};r.push(p)}else C(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):wa(s,u.PATTERN)&&(i=!0)}),e&&!i&&r.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:de.NO_LINE_BREAKS_FLAGS}),r}function sp(t){var e={},n=it(t);return R(n,function(r){var i=t[r];if(He(i))e[r]=[];else throw Error("non exhaustive match")}),e}function cp(t){var e=t.PATTERN;if(Kt(e))return!1;if(Ht(e))return!0;if(C(e,"exec"))return!0;if(Ft(e))return!1;throw Error("non exhaustive match")}function eT(t){return Ft(t)&&t.length===1?t.charCodeAt(0):!1}function lp(t,e){if(C(t,"LINE_BREAKS"))return!1;if(Kt(t.PATTERN)){try{wa(e,t.PATTERN)}catch(n){return{issue:de.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Ft(t.PATTERN))return!1;if(cp(t))return{issue:de.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function tT(t,e){if(e.issue===de.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===de.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 fp(t){var e=N(t,function(n){return Ft(n)&&n.length>0?n.charCodeAt(0):n});return e}function Hc(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function cn(t){return t<ei?t:Ua[t]}function nT(){if(U(Ua)){Ua=new Array(65536);for(var t=0;t<65536;t++)Ua[t]=t>255?255+~~(t/255):t}}var Kc,np,un,rr,Da,Xc,$y,Yy,up,ei,Ua,Yc=L(()=>{Kc=Jn(ba());uo();H();Zf();Ma();np=(function(){var t=c(function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)},"extendStatics");return function(e,n){t(e,n);function r(){this.constructor=e}c(r,"__"),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),un="PATTERN",rr="defaultMode",Da="modes",Xc=typeof new RegExp("(?:)").sticky=="boolean";c(rp,"analyzeTokenTypes");c(ip,"validatePatterns");c(Vy,"validateRegExpPattern");c(jy,"findMissingPatterns");c(Gy,"findInvalidPatterns");$y=/[^\\][\$]/;c(By,"findEndOfInputAnchor");c(Wy,"findEmptyMatchRegExps");Yy=/[^\\[][\^]|^\^/;c(Hy,"findStartOfInputAnchor");c(Ky,"findUnsupportedFlags");c(Xy,"findDuplicatePatterns");c(qy,"findInvalidGroupType");c(zy,"findModesThatDoNotExist");c(Qy,"findUnreachablePatterns");c(Jy,"testTokenType");c(Zy,"noMetaChar");c(ep,"addStartOfInput");c(tp,"addStickyFlag");c(op,"performRuntimeChecks");c(ap,"performWarningRuntimeChecks");c(sp,"cloneEmptyGroups");c(cp,"isCustomPattern");c(eT,"isShortPattern");up={test:c(function(t){for(var e=t.length,n=this.lastIndex;n<e;n++){var r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},"test"),lastIndex:0};c(lp,"checkLineBreaksIssues");c(tT,"buildLineBreakIssueMessage");c(fp,"getCharCodes");c(Hc,"addToMapOfArrays");ei=256;c(cn,"charCodeToOptimizedIndex");Ua=[];c(nT,"initCharCodeToOptimizedIndexMap")});function Nr(t,e){var n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function ti(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}function Pn(t){var e=rT(t);iT(e),aT(e),oT(e),R(e,function(n){n.isParent=n.categoryMatches.length>0})}function rT(t){for(var e=ye(t),n=t,r=!0;r;){n=Sn(Ce(N(n,function(o){return o.CATEGORIES})));var i=Ar(n,e);e=e.concat(i),U(i)?r=!1:n=i}return e}function iT(t){R(t,function(e){qc(e)||(mp[pp]=e,e.tokenTypeIdx=pp++),dp(e)&&!He(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),dp(e)||(e.CATEGORIES=[]),sT(e)||(e.categoryMatches=[]),cT(e)||(e.categoryMatchesMap={})})}function oT(t){R(t,function(e){e.categoryMatches=[],R(e.categoryMatchesMap,function(n,r){e.categoryMatches.push(mp[r].tokenTypeIdx)})})}function aT(t){R(t,function(e){hp([],e)})}function hp(t,e){R(t,function(n){e.categoryMatchesMap[n.tokenTypeIdx]=!0}),R(e.CATEGORIES,function(n){var r=t.concat(e);Z(r,n)||hp(r,n)})}function qc(t){return C(t,"tokenTypeIdx")}function dp(t){return C(t,"CATEGORIES")}function sT(t){return C(t,"categoryMatches")}function cT(t){return C(t,"categoryMatchesMap")}function gp(t){return C(t,"tokenTypeIdx")}var pp,mp,ni=L(()=>{H();c(Nr,"tokenStructuredMatcher");c(ti,"tokenStructuredMatcherNoCategories");pp=1,mp={};c(Pn,"augmentTokenTypes");c(rT,"expandCategories");c(iT,"assignTokenDefaultProps");c(oT,"assignCategoriesTokensProp");c(aT,"assignCategoriesMapProp");c(hp,"singleAssignCategoriesToksMap");c(qc,"hasShortKeyProperty");c(dp,"hasCategoriesProperty");c(sT,"hasExtendingTokensTypesProperty");c(cT,"hasExtendingTokensTypesMapProperty");c(gp,"isTokenType")});var Va,zc=L(()=>{Va={buildUnableToPopLexerModeMessage:c(function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},"buildUnableToPopLexerModeMessage"),buildUnexpectedCharactersMessage:c(function(t,e,n,r,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+","+(" skipped "+n+" characters.")},"buildUnexpectedCharactersMessage")}});var de,lo,ot,uo=L(()=>{Yc();H();ni();zc();Ma();(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"})(de||(de={}));lo={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Va,traceInitPerf:!1,skipValidations:!1};Object.freeze(lo);ot=(function(){function t(e,n){var r=this;if(n===void 0&&(n=lo),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 n=="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=jc(lo,n);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,a=!0;r.TRACE_INIT("Lexer Config handling",function(){if(r.config.lineTerminatorsPattern===lo.lineTerminatorsPattern)r.config.lineTerminatorsPattern=up;else if(r.config.lineTerminatorCharacters===lo.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(n.safeMode&&n.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),He(e)?(o={modes:{}},o.modes[rr]=ye(e),o[rr]=rr):(a=!1,o=nr(e))}),r.config.skipValidations===!1&&(r.TRACE_INIT("performRuntimeChecks",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(op(o,r.trackStartLines,r.config.lineTerminatorCharacters))}),r.TRACE_INIT("performWarningRuntimeChecks",function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(ap(o,r.trackStartLines,r.config.lineTerminatorCharacters))})),o.modes=o.modes?o.modes:{},R(o.modes,function(f,p){o.modes[p]=_n(f,function(d){return ze(d)})});var s=it(o.modes);if(R(o.modes,function(f,p){r.TRACE_INIT("Mode: <"+p+"> processing",function(){if(r.modes.push(p),r.config.skipValidations===!1&&r.TRACE_INIT("validatePatterns",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(ip(f,s))}),U(r.lexerDefinitionErrors)){Pn(f);var d;r.TRACE_INIT("analyzeTokenTypes",function(){d=rp(f,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:r.TRACE_INIT.bind(r)})}),r.patternIdxToConfig[p]=d.patternIdxToConfig,r.charCodeToPatternIdxToConfig[p]=d.charCodeToPatternIdxToConfig,r.emptyGroups=jc(r.emptyGroups,d.emptyGroups),r.hasCustom=d.hasCustom||r.hasCustom,r.canModeBeOptimized[p]=d.canBeOptimized}})}),r.defaultMode=o.defaultMode,!U(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var u=N(r.lexerDefinitionErrors,function(f){return f.message}),l=u.join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+l)}R(r.lexerDefinitionWarning,function(f){Ia(f.message)}),r.TRACE_INIT("Choosing sub-methods implementations",function(){if(Xc?(r.chopInput=Gc,r.match=r.matchWithTest):(r.updateLastIndex=Oe,r.match=r.matchWithExec),a&&(r.handleModes=Oe),r.trackStartLines===!1&&(r.computeNewColumn=Gc),r.trackEndLines===!1&&(r.updateTokenEndLineColumnLocation=Oe),/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))r.createTokenInstance=r.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');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 f=pe(r.canModeBeOptimized,function(p,d,h){return d===!1&&p.push(h),p},[]);if(n.ensureOptimizations&&!U(f))throw Error("Lexer Modes: < "+f.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.`)}),r.TRACE_INIT("clearRegExpParserCache",function(){qf()}),r.TRACE_INIT("toFastProperties",function(){Sa(r)})})}return c(t,"Lexer"),t.prototype.tokenize=function(e,n){if(n===void 0&&(n=this.defaultMode),!U(this.lexerDefinitionErrors)){var r=N(this.lexerDefinitionErrors,function(a){return a.message}),i=r.join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: `+i)}var o=this.tokenizeInternal(e,n);return o},t.prototype.tokenizeInternal=function(e,n){var r=this,i,o,a,s,u,l,f,p,d,h,m,g,E,y,T,A=e,V=A.length,j=0,Xe=0,ft=this.hasCustom?0:Math.floor(e.length/10),Fe=new Array(ft),tt=[],nt=this.trackStartLines?1:void 0,pt=this.trackStartLines?1:void 0,Tn=sp(this.emptyGroups),Yi=this.trackStartLines,Hi=this.config.lineTerminatorsPattern,Xr=0,zn=[],Ki=[],ga=[],df=[];Object.freeze(df);var Xi=void 0;function mf(){return zn}c(mf,"getPossiblePatternsSlow");function hf(rt){var Qi=cn(rt),qr=Ki[Qi];return qr===void 0?df:qr}c(hf,"getPossiblePatternsOptimized");var ty=c(function(rt){if(ga.length===1&&rt.tokenType.PUSH_MODE===void 0){var Qi=r.config.errorMessageProvider.buildUnableToPopLexerModeMessage(rt);tt.push({offset:rt.startOffset,line:rt.startLine!==void 0?rt.startLine:void 0,column:rt.startColumn!==void 0?rt.startColumn:void 0,length:rt.image.length,message:Qi})}else{ga.pop();var qr=Ra(ga);zn=r.patternIdxToConfig[qr],Ki=r.charCodeToPatternIdxToConfig[qr],Xr=zn.length;var ry=r.canModeBeOptimized[qr]&&r.config.safeMode===!1;Ki&&ry?Xi=hf:Xi=mf}},"pop_mode");function gf(rt){ga.push(rt),Ki=this.charCodeToPatternIdxToConfig[rt],zn=this.patternIdxToConfig[rt],Xr=zn.length,Xr=zn.length;var Qi=this.canModeBeOptimized[rt]&&this.config.safeMode===!1;Ki&&Qi?Xi=hf:Xi=mf}c(gf,"push_mode"),gf.call(this,n);for(var Wt;j<V;){u=null;var Ef=A.charCodeAt(j),yf=Xi(Ef),ny=yf.length;for(i=0;i<ny;i++){Wt=yf[i];var Qn=Wt.pattern;l=null;var qi=Wt.short;if(qi!==!1?Ef===qi&&(u=Qn):Wt.isCustom===!0?(T=Qn.exec(A,j,Fe,Tn),T!==null?(u=T[0],T.payload!==void 0&&(l=T.payload)):u=null):(this.updateLastIndex(Qn,j),u=this.match(Qn,e,j)),u!==null){if(s=Wt.longerAlt,s!==void 0){var Ac=zn[s],Nc=Ac.pattern;f=null,Ac.isCustom===!0?(T=Nc.exec(A,j,Fe,Tn),T!==null?(a=T[0],T.payload!==void 0&&(f=T.payload)):a=null):(this.updateLastIndex(Nc,j),a=this.match(Nc,e,j)),a&&a.length>u.length&&(u=a,l=f,Wt=Ac)}break}}if(u!==null){if(p=u.length,d=Wt.group,d!==void 0&&(h=Wt.tokenTypeIdx,m=this.createTokenInstance(u,j,h,Wt.tokenType,nt,pt,p),this.handlePayload(m,l),d===!1?Xe=this.addToken(Fe,Xe,m):Tn[d].push(m)),e=this.chopInput(e,p),j=j+p,pt=this.computeNewColumn(pt,p),Yi===!0&&Wt.canLineTerminator===!0){var Ea=0,xc=void 0,Rc=void 0;Hi.lastIndex=0;do xc=Hi.test(u),xc===!0&&(Rc=Hi.lastIndex-1,Ea++);while(xc===!0);Ea!==0&&(nt=nt+Ea,pt=p-Rc,this.updateTokenEndLineColumnLocation(m,d,Rc,Ea,nt,pt,p))}this.handleModes(Wt,ty,gf,m)}else{for(var Cc=j,Tf=nt,vf=pt,zi=!1;!zi&&j<V;)for(E=A.charCodeAt(j),e=this.chopInput(e,1),j++,o=0;o<Xr;o++){var _c=zn[o],Qn=_c.pattern,qi=_c.short;if(qi!==!1?A.charCodeAt(j)===qi&&(zi=!0):_c.isCustom===!0?zi=Qn.exec(A,j,Fe,Tn)!==null:(this.updateLastIndex(Qn,j),zi=Qn.exec(e)!==null),zi===!0)break}g=j-Cc,y=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(A,Cc,g,Tf,vf),tt.push({offset:Cc,line:Tf,column:vf,length:g,message:y})}}return this.hasCustom||(Fe.length=Xe),{tokens:Fe,groups:Tn,errors:tt}},t.prototype.handleModes=function(e,n,r,i){if(e.pop===!0){var o=e.push;n(i),o!==void 0&&r.call(this,o)}else e.push!==void 0&&r.call(this,e.push)},t.prototype.chopInput=function(e,n){return e.substring(n)},t.prototype.updateLastIndex=function(e,n){e.lastIndex=n},t.prototype.updateTokenEndLineColumnLocation=function(e,n,r,i,o,a,s){var u,l;n!==void 0&&(u=r===s-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=a-1+-l))},t.prototype.computeNewColumn=function(e,n){return e+n},t.prototype.createTokenInstance=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return null},t.prototype.createOffsetOnlyToken=function(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}},t.prototype.createStartOnlyToken=function(e,n,r,i,o,a){return{image:e,startOffset:n,startLine:o,startColumn:a,tokenTypeIdx:r,tokenType:i}},t.prototype.createFullToken=function(e,n,r,i,o,a,s){return{image:e,startOffset:n,endOffset:n+s-1,startLine:o,endLine:o,startColumn:a,endColumn:a+s-1,tokenTypeIdx:r,tokenType:i}},t.prototype.addToken=function(e,n,r){return 666},t.prototype.addTokenUsingPush=function(e,n,r){return e.push(r),n},t.prototype.addTokenUsingMemberAccess=function(e,n,r){return e[n]=r,n++,n},t.prototype.handlePayload=function(e,n){},t.prototype.handlePayloadNoCustom=function(e,n){},t.prototype.handlePayloadWithCustom=function(e,n){n!==null&&(e.payload=n)},t.prototype.match=function(e,n,r){return null},t.prototype.matchWithTest=function(e,n,r){var i=e.test(n);return i===!0?n.substring(r,e.lastIndex):null},t.prototype.matchWithExec=function(e,n){var r=e.exec(n);return r!==null?r[0]:r},t.prototype.TRACE_INIT=function(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+e+">");var i=Pa(n),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,a}else return n()},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 ln(t){return Qc(t)?t.LABEL:t.name}function Cp(t){return t.name}function Qc(t){return Ft(t.LABEL)&&t.LABEL!==""}function fo(t){return lT(t)}function lT(t){var e=t.pattern,n={};if(n.name=t.name,ze(e)||(n.PATTERN=e),C(t,uT))throw`The parent property is no longer supported. See: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.`;return C(t,Ep)&&(n.CATEGORIES=t[Ep]),Pn([n]),C(t,yp)&&(n.LABEL=t[yp]),C(t,Tp)&&(n.GROUP=t[Tp]),C(t,Ap)&&(n.POP_MODE=t[Ap]),C(t,vp)&&(n.PUSH_MODE=t[vp]),C(t,Np)&&(n.LONGER_ALT=t[Np]),C(t,xp)&&(n.LINE_BREAKS=t[xp]),C(t,Rp)&&(n.START_CHARS_HINT=t[Rp]),n}function ir(t,e,n,r,i,o,a,s){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function _p(t,e){return Nr(t,e)}var uT,Ep,yp,Tp,vp,Ap,Np,xp,Rp,Dt,or=L(()=>{H();uo();ni();c(ln,"tokenLabel");c(Cp,"tokenName");c(Qc,"hasTokenLabel");uT="parent",Ep="categories",yp="label",Tp="group",vp="push_mode",Ap="pop_mode",Np="longer_alt",xp="line_breaks",Rp="start_chars_hint";c(fo,"createToken");c(lT,"createTokenInternal");Dt=fo({name:"EOF",pattern:ot.NA});Pn([Dt]);c(ir,"createTokenInstance");c(_p,"tokenMatcher")});function ja(t){return N(t,ri)}function ri(t){function e(i){return N(i,ri)}if(c(e,"convertDefinition"),t instanceof ue)return{type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(t instanceof ce)return{type:"Alternative",definition:e(t.definition)};if(t instanceof le)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof _e)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie)return{type:"RepetitionMandatoryWithSeparator",idx:t.i