h&&(h=e.string[s]);break;case t.TRG:S+=1,e.minh&&(h=e.max);break;default:throw new Error("generateSource: unrecognized opcode")}}))})),m.sort(),i.length>0&&(i.forEach((e=>{g.push(e.lower)})),g.sort()),u+="// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved
\n",u+="// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
\n",u+="//\n",u+="// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)\n",o?o.funcName?u+=`const ${o.funcName} = function grammar(){\n`:u+=l?"export function grammar(){\n":d?"export default function grammar(){\n":"module.exports = function grammar(){\n":u+="module.exports = function grammar(){\n",u+=" // ```\n",u+=" // SUMMARY\n",u+=` // rules = ${r.length}\n`,u+=` // udts = ${i.length}\n`,u+=` // opcodes = ${f}\n`,u+=" // --- ABNF original opcodes\n",u+=` // ALT = ${b}\n`,u+=` // CAT = ${v}\n`,u+=` // REP = ${A}\n`,u+=` // RNM = ${w}\n`,u+=` // TLS = ${k}\n`,u+=` // TBS = ${T}\n`,u+=` // TRG = ${S}\n`,u+=" // --- SABNF superset opcodes\n",u+=` // UDT = ${x}\n`,u+=` // AND = ${E}\n`,u+=` // NOT = ${_}\n`,d||(u+=` // BKA = ${I}\n`,u+=` // BKN = ${O}\n`,u+=` // BKR = ${C}\n`,u+=` // ABG = ${R}\n`,u+=` // AEN = ${D}\n`),u+=" // characters = [",u+=k+T+S===0?" none defined ]":`${p} - ${h}]`,x>0&&(u+=" + user defined"),u+="\n",u+=" // ```\n",u+=" /* OBJECT IDENTIFIER (for internal parser use) */\n",u+=" this.grammarObject = 'grammarObject';\n",u+="\n",u+=" /* RULES */\n",u+=" this.rules = [];\n",r.forEach(((e,t)=>{let n=" this.rules[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* UDTS */\n",u+=" this.udts = [];\n",i.length>0&&i.forEach(((e,t)=>{let n=" this.udts[";n+=t,n+="] = { name: '",n+=e.name,n+="', lower: '",n+=e.lower,n+="', index: ",n+=e.index,n+=", empty: ",n+=e.empty,n+=", isBkr: ",n+=e.isBkr,n+=" };\n",u+=n})),u+="\n",u+=" /* OPCODES */\n",r.forEach(((e,n)=>{n>0&&(u+="\n"),u+=` /* ${e.name} */\n`,u+=` this.rules[${n}].opcodes = [];\n`,e.opcodes.forEach(((e,o)=>{let s;switch(e.type){case t.ALT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// ALT\n`;break;case t.CAT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, children: [${e.children.toString()}] };// CAT\n`;break;case t.RNM:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index} };// RNM(${r[e.index].name})\n`;break;case t.BKR:e.index>=r.length?(a=i[e.index-r.length].name,c=i[e.index-r.length].lower):(a=r[e.index].name,c=r[e.index].lower),s="%i",e.bkrCase===t.BKR_MODE_CS&&(s="%s"),e.bkrMode===t.BKR_MODE_UM?s+="%u":s+="%p",a=s+a,u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, index: ${e.index}, lower: '${c}', bkrCase: ${e.bkrCase}, bkrMode: ${e.bkrMode} };// BKR(\\${a})\n`;break;case t.UDT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, empty: ${e.empty}, index: ${e.index} };// UDT(${i[e.index].name})\n`;break;case t.REP:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// REP\n`;break;case t.AND:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AND\n`;break;case t.NOT:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// NOT\n`;break;case t.ABG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// ABG(%^)\n`;break;case t.AEN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// AEN(%$)\n`;break;case t.BKA:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKA\n`;break;case t.BKN:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type} };// BKN\n`;break;case t.TLS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TLS\n`;break;case t.TBS:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, string: [${e.string.toString()}] };// TBS\n`;break;case t.TRG:u+=` this.rules[${n}].opcodes[${o}] = { type: ${e.type}, min: ${e.min}, max: ${e.max} };// TRG\n`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}}))})),u+="\n",u+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",u+=" this.toString = function toString(){\n",u+=' let str = "";\n',n.forEach((t=>{const n=t.beginChar+t.length;y="",u+=' str += "';for(let r=t.beginChar;r{i.push(e.lower)})),i.sort(),n.length>0&&(n.forEach((e=>{o.push(e.lower)})),o.sort()),r.callbacks=[],i.forEach((e=>{r.callbacks[e]=!1})),n.length>0&&o.forEach((e=>{r.callbacks[e]=!1})),r.rules=t,r.udts=n,r.toString=function(){return s},r}}},94246:function(e,t,n){e.exports=function(){const e=n(58276);let t=null;function r(e){return!(e.left||e.nested||e.right||e.cyclic)&&e.empty}function i(e){return!!(e.left||e.nested||e.right||e.cyclic)}function o(e,t,n,o){let a=0;const c=t[n],u=c.children.length,l=[];for(a=0;a=0;n-=1){if(e[n].right)return!0;if(!e[n].empty)return!1}return!1}(l,u),o.nested=function(e,t){let n=0,o=0,s=0;for(n=0;n=0;n-=1)if(e[n].left&&!e[n].leaf)for(o=n-1;o>=0;o-=1)if(!r(e[o]))return!0;for(n=0;n=e.ruleCount?(r.empty=e.udts[i.index-e.ruleCount].empty,r.finite=!0):(a(e,i.index,r),r.left=!1,r.nested=!1,r.right=!1,r.cyclic=!1)}(t,n,r,i);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:s(t,n,r+1,i),i.empty=!0;break;case e.TLS:i.empty=!n[r].string.length,i.finite=!0,i.cyclic=!1;break;case e.TBS:case e.TRG:i.empty=!1,i.finite=!0,i.cyclic=!1;break;case e.UDT:i.empty=c.empty,i.finite=!0,i.cyclic=!1;break;case e.ABG:case e.AEN:i.empty=!0,i.finite=!0,i.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}function a(e,t,n){const r=e.attrsWorking[t];r.isComplete?e.attrCopy(n,r):r.isOpen?t===e.startRule?t===e.startRule&&(n.left=!0,n.right=!0,n.cyclic=!0,n.leaf=!0):n.finite=!0:(r.isOpen=!0,s(e,r.rule.opcodes,0,n),r.left=n.left,r.right=n.right,r.nested=n.nested,r.empty=n.empty,r.finite=n.finite,r.cyclic=n.cyclic,r.leaf=!1,r.isOpen=!1,r.isComplete=!0)}const c=e=>e?"t":"f",u=e=>e?"e":"f",l=(n,r,i,o)=>{let s=`${n}:${r}:`;return s+=`${u(i.left)} `,s+=`${c(i.nested)} `,s+=`${c(i.right)} `,s+=`${u(i.cyclic)} `,s+=(i.finite?"t":"e")+" ",s+=`${c(i.empty)}:`,s+=`${t.typeToString(o.recursiveType)}:`,s+=o.recursiveType===e.ATTR_MR?o.groupNumber:"-",s+=`:${i.rule.name}\n`,s},d=()=>{let e="LEGEND - t=true, f=false, e=error\n";return e+="sequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n","LEGEND - t=true, f=false, e=error\nsequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n"},f=e=>{let n=0,r=0,i=null,o=null,s="",{ruleIndexes:a}=t;for(97===e?a=t.ruleAlphaIndexes:116===e&&(a=t.ruleTypeIndexes),n=0;n{t=e;let n=0,r=0;const i=t.attrGen();for(n=0;n{if(!t.attributesComplete)throw new Error("rule-attributes.js:showAttributes: attributes not available");let n="";const r="RULE ATTRIBUTES\n";return 97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=r,n+=d(),n+=f(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=r,n+=d(),n+=f(116)):(n+="ordered by rule index\n",n+=r,n+=d(),n+=f()),n},showAttributeErrors:()=>{let e=null,n=null,r="";if(r+="RULE ATTRIBUTES WITH ERRORS\n",r+=d(),t.attrsErrorCount)for(let i=0;i\n";return r}}}()},37008:function(e,t,n){e.exports=(()=>{const e=n(58276);let t=null;const r=(t,n,i,o)=>{let s=0,a=0;const c=n[i];o[i]=!0;const u=c.rule.opcodes;for(s=0;s{let n=0,r=0,i=0,o=0;const s=t.ruleCount-1,a=t.udtCount-1;let c="",u="";const l="=> ";let d=!1,f=null,{ruleIndexes:p}=t,{udtIndexes:h}=t;for(97===e?(p=t.ruleAlphaIndexes,h=t.udtAlphaIndexes):116===e&&(p=t.ruleTypeIndexes,h=t.udtAlphaIndexes),n=0;n-1?f.groupNumber:"-",u+=":"),u+=" ",c+=`${u+t.rules[p[n]].name}\n`,d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);if(t.udtCount)for(r=0;r100&&r!==a&&(c+=`\n${u}=> `,o=c.length);for(0===i&&(c+="=> \n"),!1===d&&(c+="\n"),d=!0,i=0,o=c.length,c+=u,r=0;r100&&r!==s&&(c+=`\n${u}=> `,o=c.length);0===i&&(c+="<= \n"),!1===d&&(c+="\n"),c+="\n"}return c};return{ruleDependencies:n=>{t=n;let i=0,o=0,s=0,a=null,c=null,u=!1;t.dependenciesComplete=!1;const l=t.falseArray(t.ruleCount);for(i=0;i-1,t.ruleAlphaIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesType),t.isMutuallyRecursive&&t.ruleTypeIndexes.sort(t.compRulesGroup),t.udtCount&&t.udtAlphaIndexes.sort(t.compUdtsAlpha),t.dependenciesComplete=!0},showRuleDependencies:(e="index")=>{let n="RULE DEPENDENCIES(index:type:[group number:])\n";return n+="=> refers to rule names\n",n+="<= referenced by rule names\n",t.dependenciesComplete?(97===e.charCodeAt(0)?(n+="alphabetical by rule name\n",n+=i(97)):116===e.charCodeAt(0)?(n+="ordered by rule type\n",n+=i(116)):(n+="ordered by rule index\n",n+=i(null)),n):n}}})()},33610:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=function(){let e="";return e+=";\n",e+="; ABNF for JavaScript APG 2.0 SABNF\n",e+="; RFC 5234 with some restrictions and additions.\n",e+="; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n",e+='; - accepts %s"string" as a case-sensitive string\n',e+='; - accepts %i"string" as a case-insensitive string\n',e+='; - accepts "string" as a case-insensitive string\n',e+=";\n",e+="; Some restrictions:\n",e+="; 1. Rules must begin at first character of each line.\n",e+="; Indentations on first rule and rules thereafter are not allowed.\n",e+="; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n",e+="; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n",e+="; However, a working parser cannot be generated from them.\n",e+=";\n",e+="; Super set (SABNF) additions:\n",e+="; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n",e+="; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n",e+="; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n",e+="; e.g. &%d13 or &rule or !(A / B)\n",e+="; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n",e+="; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n",e+="; u_name may be used as an element but no rule definition is given.\n",e+="; e.g. rule = A / u_myUdt\n",e+='; A = "a"\n',e+="; would be a valid grammar.\n",e+="; 3. Case-sensitive, single-quoted strings are accepted.\n",e+="; e.g. 'abc' would be equivalent to %d97.98.99\n",e+='; (kept for backward compatibility, but superseded by %s"abc") \n',e+="; New 12/26/2015\n",e+="; 4. Look-behind operators are accepted as element prefixes.\n",e+="; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n",e+="; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n",e+="; e.g. &&%d13 or &&rule or !!(A / B)\n",e+="; 5. Back reference operators, i.e. \\rulename, are accepted.\n",e+="; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n",e+="; to match is a phrase previously matched by the rule 'rulename'.\n",e+="; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n",e+="; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n",e+="; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n",e+="; Back reference modifiers can be used to specify case and mode.\n",e+="; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n",e+="; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n",e+="; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n",e+="; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n",e+="; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+="; 8. String end anchor, AEN(%$) matches the end of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+=";\n",e+="File = *(BlankLine / Rule / RuleError)\n",e+="BlankLine = *(%d32/%d9) [comment] LineEnd\n",e+="Rule = RuleLookup owsp Alternation ((owsp LineEnd)\n",e+=" / (LineEndError LineEnd))\n",e+="RuleLookup = RuleNameTest owsp DefinedAsTest\n",e+="RuleNameTest = RuleName/RuleNameError\n",e+="RuleName = alphanum\n",e+="RuleNameError = 1*(%d33-60/%d62-126)\n",e+="DefinedAsTest = DefinedAs / DefinedAsError\n",e+="DefinedAsError = 1*2%d33-126\n",e+="DefinedAs = IncAlt / Defined\n",e+="Defined = %d61\n",e+="IncAlt = %d61.47\n",e+="RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\n",e+="LineEndError = 1*(%d32-126 / %d9 / LineContinue)\n",e+="Alternation = Concatenation *(owsp AltOp Concatenation)\n",e+="Concatenation = Repetition *(CatOp Repetition)\n",e+="Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\n",e+="Modifier = (Predicate [RepOp])\n",e+=" / RepOp\n",e+="Predicate = BkaOp\n",e+=" / BknOp\n",e+=" / AndOp\n",e+=" / NotOp\n",e+="BasicElement = UdtOp\n",e+=" / RnmOp\n",e+=" / TrgOp\n",e+=" / TbsOp\n",e+=" / TlsOp\n",e+=" / ClsOp\n",e+=" / BkrOp\n",e+=" / AbgOp\n",e+=" / AenOp\n",e+=" / ProsVal\n",e+="BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\n",e+="Group = GroupOpen Alternation (GroupClose / GroupError)\n",e+="GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="GroupOpen = %d40 owsp\n",e+="GroupClose = owsp %d41\n",e+="Option = OptionOpen Alternation (OptionClose / OptionError)\n",e+="OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="OptionOpen = %d91 owsp\n",e+="OptionClose = owsp %d93\n",e+="RnmOp = alphanum\n",e+="BkrOp = %d92 [bkrModifier] bkr-name\n",e+="bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\n",e+="cs = '%s'\n",e+="ci = '%i'\n",e+="um = '%u'\n",e+="pm = '%p'\n",e+="bkr-name = uname / ename / rname\n",e+="rname = alphanum\n",e+="uname = %d117.95 alphanum\n",e+="ename = %d101.95 alphanum\n",e+="UdtOp = udt-empty\n",e+=" / udt-non-empty\n",e+="udt-non-empty = %d117.95 alphanum\n",e+="udt-empty = %d101.95 alphanum\n",e+="RepOp = (rep-min StarOp rep-max)\n",e+=" / (rep-min StarOp)\n",e+=" / (StarOp rep-max)\n",e+=" / StarOp\n",e+=" / rep-min-max\n",e+="AltOp = %d47 owsp\n",e+="CatOp = wsp\n",e+="StarOp = %d42\n",e+="AndOp = %d38\n",e+="NotOp = %d33\n",e+="BkaOp = %d38.38\n",e+="BknOp = %d33.33\n",e+="AbgOp = %d37.94\n",e+="AenOp = %d37.36\n",e+="TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\n",e+="TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\n",e+="TlsOp = TlsCase TlsOpen TlsString TlsClose\n",e+='TlsCase = ["%i" / "%s"]\n',e+="TlsOpen = %d34\n",e+="TlsClose = %d34\n",e+="TlsString = *(%d32-33/%d35-126/StringTab)\n",e+="StringTab = %d9\n",e+="ClsOp = ClsOpen ClsString ClsClose\n",e+="ClsOpen = %d39\n",e+="ClsClose = %d39\n",e+="ClsString = *(%d32-38/%d40-126/StringTab)\n",e+="ProsVal = ProsValOpen ProsValString ProsValClose\n",e+="ProsValOpen = %d60\n",e+="ProsValString = *(%d32-61/%d63-126/StringTab)\n",e+="ProsValClose = %d62\n",e+="rep-min = rep-num\n",e+="rep-min-max = rep-num\n",e+="rep-max = rep-num\n",e+="rep-num = 1*(%d48-57)\n",e+="dString = dnum\n",e+="xString = xnum\n",e+="bString = bnum\n",e+="Dec = (%d68/%d100)\n",e+="Hex = (%d88/%d120)\n",e+="Bin = (%d66/%d98)\n",e+="dmin = dnum\n",e+="dmax = dnum\n",e+="bmin = bnum\n",e+="bmax = bnum\n",e+="xmin = xnum\n",e+="xmax = xnum\n",e+="dnum = 1*(%d48-57)\n",e+="bnum = 1*%d48-49\n",e+="xnum = 1*(%d48-57 / %d65-70 / %d97-102)\n",e+=";\n",e+="; Basics\n",e+="alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\n",e+="owsp = *space\n",e+="wsp = 1*space\n",e+="space = %d32\n",e+=" / %d9\n",e+=" / comment\n",e+=" / LineContinue\n",e+="comment = %d59 *(%d32-126 / %d9)\n",e+="LineEnd = %d13.10\n",e+=" / %d10\n",e+=" / %d13\n",e+="LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n",";\n; ABNF for JavaScript APG 2.0 SABNF\n; RFC 5234 with some restrictions and additions.\n; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n; - accepts %s\"string\" as a case-sensitive string\n; - accepts %i\"string\" as a case-insensitive string\n; - accepts \"string\" as a case-insensitive string\n;\n; Some restrictions:\n; 1. Rules must begin at first character of each line.\n; Indentations on first rule and rules thereafter are not allowed.\n; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n; 3. Prose values, i.e. , are accepted as valid grammar syntax.\n; However, a working parser cannot be generated from them.\n;\n; Super set (SABNF) additions:\n; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n; e.g. &%d13 or &rule or !(A / B)\n; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n; u_name may be used as an element but no rule definition is given.\n; e.g. rule = A / u_myUdt\n; A = \"a\"\n; would be a valid grammar.\n; 3. Case-sensitive, single-quoted strings are accepted.\n; e.g. 'abc' would be equivalent to %d97.98.99\n; (kept for backward compatibility, but superseded by %s\"abc\") \n; New 12/26/2015\n; 4. Look-behind operators are accepted as element prefixes.\n; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n; e.g. &&%d13 or &&rule or !!(A / B)\n; 5. Back reference operators, i.e. \\rulename, are accepted.\n; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n; to match is a phrase previously matched by the rule 'rulename'.\n; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n; Back reference modifiers can be used to specify case and mode.\n; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n; 8. String end anchor, AEN(%$) matches the end of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n;\nFile = *(BlankLine / Rule / RuleError)\nBlankLine = *(%d32/%d9) [comment] LineEnd\nRule = RuleLookup owsp Alternation ((owsp LineEnd)\n / (LineEndError LineEnd))\nRuleLookup = RuleNameTest owsp DefinedAsTest\nRuleNameTest = RuleName/RuleNameError\nRuleName = alphanum\nRuleNameError = 1*(%d33-60/%d62-126)\nDefinedAsTest = DefinedAs / DefinedAsError\nDefinedAsError = 1*2%d33-126\nDefinedAs = IncAlt / Defined\nDefined = %d61\nIncAlt = %d61.47\nRuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\nLineEndError = 1*(%d32-126 / %d9 / LineContinue)\nAlternation = Concatenation *(owsp AltOp Concatenation)\nConcatenation = Repetition *(CatOp Repetition)\nRepetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\nModifier = (Predicate [RepOp])\n / RepOp\nPredicate = BkaOp\n / BknOp\n / AndOp\n / NotOp\nBasicElement = UdtOp\n / RnmOp\n / TrgOp\n / TbsOp\n / TlsOp\n / ClsOp\n / BkrOp\n / AbgOp\n / AenOp\n / ProsVal\nBasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\nGroup = GroupOpen Alternation (GroupClose / GroupError)\nGroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nGroupOpen = %d40 owsp\nGroupClose = owsp %d41\nOption = OptionOpen Alternation (OptionClose / OptionError)\nOptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nOptionOpen = %d91 owsp\nOptionClose = owsp %d93\nRnmOp = alphanum\nBkrOp = %d92 [bkrModifier] bkr-name\nbkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\ncs = '%s'\nci = '%i'\num = '%u'\npm = '%p'\nbkr-name = uname / ename / rname\nrname = alphanum\nuname = %d117.95 alphanum\nename = %d101.95 alphanum\nUdtOp = udt-empty\n / udt-non-empty\nudt-non-empty = %d117.95 alphanum\nudt-empty = %d101.95 alphanum\nRepOp = (rep-min StarOp rep-max)\n / (rep-min StarOp)\n / (StarOp rep-max)\n / StarOp\n / rep-min-max\nAltOp = %d47 owsp\nCatOp = wsp\nStarOp = %d42\nAndOp = %d38\nNotOp = %d33\nBkaOp = %d38.38\nBknOp = %d33.33\nAbgOp = %d37.94\nAenOp = %d37.36\nTrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\nTbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\nTlsOp = TlsCase TlsOpen TlsString TlsClose\nTlsCase = [\"%i\" / \"%s\"]\nTlsOpen = %d34\nTlsClose = %d34\nTlsString = *(%d32-33/%d35-126/StringTab)\nStringTab = %d9\nClsOp = ClsOpen ClsString ClsClose\nClsOpen = %d39\nClsClose = %d39\nClsString = *(%d32-38/%d40-126/StringTab)\nProsVal = ProsValOpen ProsValString ProsValClose\nProsValOpen = %d60\nProsValString = *(%d32-61/%d63-126/StringTab)\nProsValClose = %d62\nrep-min = rep-num\nrep-min-max = rep-num\nrep-max = rep-num\nrep-num = 1*(%d48-57)\ndString = dnum\nxString = xnum\nbString = bnum\nDec = (%d68/%d100)\nHex = (%d88/%d120)\nBin = (%d66/%d98)\ndmin = dnum\ndmax = dnum\nbmin = bnum\nbmax = bnum\nxmin = xnum\nxmax = xnum\ndnum = 1*(%d48-57)\nbnum = 1*%d48-49\nxnum = 1*(%d48-57 / %d65-70 / %d97-102)\n;\n; Basics\nalphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\nowsp = *space\nwsp = 1*space\nspace = %d32\n / %d9\n / comment\n / LineContinue\ncomment = %d59 *(%d32-126 / %d9)\nLineEnd = %d13.10\n / %d10\n / %d13\nLineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n"}}},73479:function(e,t,n){const r=n(58276),i=n(8544);const o=[];o.line=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:o.textLength,endType:o.endType,invalidChars:o.invalidCount}),r.SEM_OK},o["line-text"]=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.textLength=i),r.SEM_OK},o["last-line"]=function(e,t,n,i,o){return e===r.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.strict?(o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:i,endType:"none",invalidChars:o.invalidCount}),o.errors.push({line:o.lineNo,char:n+i,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(t.push(10),o.lines.push({lineNo:o.lines.length,beginChar:n,length:i+1,textLength:i,endType:"LF",invalidChars:o.invalidCount})),r.SEM_OK},o.invalid=function(e,t,n,o,s){return e===r.SEM_PRE&&s.errors.push({line:s.lineNo,char:n,msg:`invalid character found '\\x${i.charToHex(t[n])}'`}),r.SEM_OK},o.end=function(e,t,n,i,o){return e===r.SEM_POST&&(o.lineNo+=1),r.SEM_OK},o.lf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="LF",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.cr=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CR",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),r.SEM_OK},o.crlf=function(e,t,n,i,o){return e===r.SEM_PRE&&(o.endType="CRLF"),r.SEM_OK},t.callbacks=o},66410:function(e){e.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=function(){let e="";return e+="file = *line [last-line]\n",e+="line = line-text end\n",e+="line-text = *(valid/invalid)\n",e+="last-line = 1*(valid/invalid)\n",e+="valid = %d32-126 / %d9\n",e+="invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\n",e+="end = CRLF / LF / CR\n",e+="CRLF = %d13.10\n",e+="LF = %d10\n",e+="CR = %d13\n","file = *line [last-line]\nline = line-text end\nline-text = *(valid/invalid)\nlast-line = 1*(valid/invalid)\nvalid = %d32-126 / %d9\ninvalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\nend = CRLF / LF / CR\nCRLF = %d13.10\nLF = %d10\nCR = %d13\n"}}},1789:function(e,t,n){e.exports=function(e,t,r,i){const o=n(28737),s=new(n(66410)),{callbacks:a}=n(73479),c=[],u=new o.parser;if(u.ast=new o.ast,u.ast.callbacks=a,i){if("traceObject"!==i.traceObject)throw new TypeError("scanner.js: trace argument is not a trace object");u.trace=i}if(!0!==u.parse(s,"file",e).success)return void t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});const l={lines:c,lineNo:0,errors:t,strict:!!r};return u.ast.translate(l),c}},11832:function(e,t,n){e.exports=function(){const e=n(28737),t=e.ids,r=function(){this.names=[],this.add=function(e){let t=-1;return-1===this.get(e)&&(t={name:e,lower:e.toLowerCase(),index:this.names.length},this.names.push(t)),t},this.get=function(e){let t=-1;const n=e.toLowerCase();for(let r=0;r=48&&t<=57)t-=48;else if(t>=65&&t<=70)t-=55;else{if(!(t>=97&&t<=102))throw new Error("hexnum out of range");t-=87}r=16*r+t}return r};this.callbacks=[],this.callbacks.abgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.ABG}),s},this.callbacks.aenop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AEN}),s},this.callbacks.alternation=function(e,n,r,i,o){let s=t.SEM_OK;if(e===t.SEM_PRE){const e=!0;for(;e;){if(null===o.definedas){s=t.SEM_SKIP;break}if(null===o.topStack){if("="===o.definedas){o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}o.topStack={alt:o.opcodes[0],cat:null},o.altStack.push(o.topStack);break}o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}}else e===t.SEM_POST&&(o.altStack.pop(),o.altStack.length>0?o.topStack=o.altStack[o.altStack.length-1]:o.topStack=null);return s},this.callbacks.andop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AND}),s},this.callbacks.bmax=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=o(n,r,i)),a},this.callbacks.bmin=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=o(n,r,i)),a},this.callbacks.bkaop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKA}),s},this.callbacks.bknop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKN}),s},this.callbacks.bkrop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE?(s.ci=!0,s.cs=!1,s.um=!0,s.pm=!1):n===t.SEM_POST&&s.opcodes.push({type:t.BKR,bkrCase:!0===s.cs?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:!0===s.pm?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:s.bkrname.phraseIndex,name:e.utils.charsToString(r,s.bkrname.phraseIndex,s.bkrname.phraseLength)}}),a},this.callbacks["bkr-name"]=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.bkrname={phraseIndex:r,phraseLength:i}),s},this.callbacks.bstring=function(e,n,r,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(o(n,r,i)),a},this.callbacks.clsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(i<=2?o.opcodes.push({type:t.TLS,string:[]}):o.opcodes.push({type:t.TBS,string:n.slice(r+1,r+i-1)})),s},this.callbacks.ci=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.ci=!0),s},this.callbacks.cs=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.cs=!0),s},this.callbacks.um=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.um=!0),s},this.callbacks.pm=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.pm=!0),s},this.callbacks.concatenation=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.topStack.alt.children.push(o.opcodes.length),o.topStack.cat={type:t.CAT,children:[]},o.opcodes.push(o.topStack.cat)):e===t.SEM_POST&&(o.topStack.cat=null),s},this.callbacks.defined=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="="),s},this.callbacks.dmax=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks.dmin=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks.dstring=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(i(n,r,o)),a},this.callbacks.file=function(e,n,i,o,s){const a=t.SEM_OK;if(e===t.SEM_PRE)s.ruleNames=new r,s.udtNames=new r,s.rules=[],s.udts=[],s.rulesLineMap=[],s.opcodes=[],s.altStack=[],s.topStack=null,s.topRule=null;else if(e===t.SEM_POST){let e;s.rules.forEach((n=>{n.isBkr=!1,n.opcodes.forEach((n=>{n.type===t.RNM&&(e=s.ruleNames.get(n.index.name),-1===e?(s.errors.push({line:s.findLine(s.lines,n.index.phraseIndex,s.charsLength),char:n.index.phraseIndex,msg:`Rule name '${n.index.name}' used but not defined.`}),n.index=-1):n.index=e.index)}))})),s.udts.forEach((e=>{e.isBkr=!1})),s.rules.forEach((n=>{n.opcodes.forEach((r=>{r.type===t.BKR&&(n.hasBkr=!0,e=s.ruleNames.get(r.index.name),-1!==e?(s.rules[e.index].isBkr=!0,r.index=e.index):(e=s.udtNames.get(r.index.name),-1!==e?(s.udts[e.index].isBkr=!0,r.index=s.rules.length+e.index):(s.errors.push({line:s.findLine(s.lines,r.index.phraseIndex,s.charsLength),char:r.index.phraseIndex,msg:`Back reference name '${r.index.name}' refers to undefined rule or unamed UDT.`}),r.index=-1)))}))}))}return a},this.callbacks.incalt=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="=/"),s},this.callbacks.notop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.NOT}),s},this.callbacks.optionopen=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.REP,min:0,max:1,char:r}),s},this.callbacks["rep-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o)),a},this.callbacks["rep-min"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(n,r,o)),a},this.callbacks["rep-min-max"]=function(e,n,r,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(n,r,o),s.min=s.max),a},this.callbacks.repetition=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&o.topStack.cat.children.push(o.opcodes.length),s},this.callbacks.repop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=1/0,o.topRep={type:t.REP,min:0,max:1/0},o.opcodes.push(o.topRep)):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`repetition min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.topRep.min=o.min,o.topRep.max=o.max),s},this.callbacks.rnmop=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_POST&&s.opcodes.push({type:t.RNM,index:{phraseIndex:i,name:e.utils.charsToString(r,i,o)}}),a},this.callbacks.rule=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.altStack.length=0,o.topStack=null,o.rulesLineMap.push({line:o.findLine(o.lines,r,o.charsLength),char:r})),s},this.callbacks.rulelookup=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_PRE)o.ruleName="",o.definedas="";else if(e===t.SEM_POST){let e;"="===o.definedas?(e=o.ruleNames.add(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' previously defined.`})):(o.topRule={name:e.name,lower:e.lower,opcodes:[],index:e.index},o.rules.push(o.topRule),o.opcodes=o.topRule.opcodes)):(e=o.ruleNames.get(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`Rule name '${o.ruleName}' for incremental alternate not previously defined.`})):(o.topRule=o.rules[e.index],o.opcodes=o.topRule.opcodes))}return s},this.callbacks.rulename=function(n,r,i,o,s){const a=t.SEM_OK;return n===t.SEM_PRE&&(s.ruleName=e.utils.charsToString(r,i,o)),a},this.callbacks.tbsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?o.tbsstr=[]:e===t.SEM_POST&&o.opcodes.push({type:t.TBS,string:o.tbsstr}),s},this.callbacks.tlscase=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&i>0&&(83===n[r+1]||115===n[r+1])&&(o.tlscase=!1),s},this.callbacks.tlsstring=function(e,n,r,i,o){const s=t.SEM_OK;if(e===t.SEM_POST)if(o.tlscase){const e=n.slice(r,r+i);for(let t=0;t=65&&e[t]<=90&&(e[t]+=32);o.opcodes.push({type:t.TLS,string:e})}else o.opcodes.push({type:t.TBS,string:n.slice(r,r+i)});return s},this.callbacks.tlsop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.tlscase=!0),s},this.callbacks.trgop=function(e,n,r,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=0):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,r,o.charsLength),char:r,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.opcodes.push({type:t.TRG,min:o.min,max:o.max})),s},this.callbacks["udt-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!0});s.opcodes.push({type:t.UDT,empty:!0,index:a.index})}return a},this.callbacks["udt-non-empty"]=function(n,r,i,o,s){const a=t.SEM_OK;if(n===t.SEM_POST){const n=e.utils.charsToString(r,i,o);let a=s.udtNames.add(n);if(-1===a){if(a=s.udtNames.get(n),-1===a)throw new Error("semUdtNonEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!1});s.opcodes.push({type:t.UDT,empty:!1,index:a.index,syntax:null,semantic:null})}return a},this.callbacks.xmax=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.max=s(n,r,i)),a},this.callbacks.xmin=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&(o.min=s(n,r,i)),a},this.callbacks.xstring=function(e,n,r,i,o){const a=t.SEM_OK;return e===t.SEM_POST&&o.tbsstr.push(s(n,r,i)),a}}},2595:function(e){e.exports=function(e=[],t=[],n="index"){let r=[],i=[];const o=[],s=[],a=e,c=t,u=e.length,l=t.length;let d,f="RULE/UDT NAMES";if(!Array.isArray(e)||!e.length)throw new Error("show-rules.js:showRules: rules arg must be array with length > 0");if(!Array.isArray(t))throw new Error("show-rules.js:showRules: udts arg must be array");for(d=0;da[t].lower?1:0})),l){for(d=0;dc[t].lower?1:0}))}if(97===n.charCodeAt(0)){for(f+=" - alphabetical by rule/UDT name\n",d=0;d) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case r.MATCH:s.errors.push({line:s.findLine(s.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.prosValOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.prosvalstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.repetition=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:case r.MATCH:o.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rule=function(t,n,o,s){switch(t.state){case r.ACTIVE:s.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(i);break;case r.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case r.NOMATCH:break;case r.MATCH:s.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.ruleerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.rulenameerror=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.stringtab=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.stringTabChar=i;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsclose=function(t,n,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case r.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsopen=function(t,n,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:i.tlsOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.tlsstring=function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.udtop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`UDT operator found(${e}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkaop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bknop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.bkrop=function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - strict ABNF specified.`})}else if(s.lite){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.abgop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},this.callbacks.aenop=function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict?o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - strict ABNF specified."}):o.lite&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}}},20979:function(e,t,n){const{Buffer:r}=n(48764),i=n(46322),o="UTF8",s="UTF16",a="UTF16BE",c="UTF16LE",u="UTF32",l="UTF32BE",d="UTF32LE",f="UINT7",p="ASCII",h="BINARY",m="UINT8",g="UINT16",y="UINT16LE",b="UINT16BE",v="UINT32",w="UINT32LE",x="UINT32BE",A="ESCAPED",E="STRING",_=function(e,t){const n=function(e){const t={type:"",base64:!1},n=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(e);return n&&(n[2]&&(t.type=n[2].toUpperCase()),n[1]&&(t.base64=!0)),t}(e.toUpperCase());if(n.base64){if(n.type===E)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type STRING`);if(r.isBuffer(t))n.data=i.base64.decode(t);else{if("string"!==typeof t)throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`);{const e=r.from(t,"ascii");n.data=i.base64.decode(e)}}}else n.data=t;switch(n.type){case o:!function(e){e.type=o;const t=e.data;e.bom=0,t.length>=3&&239===t[0]&&187===t[1]&&191===t[2]&&(e.bom=3)}(n);break;case s:case a:case c:!function(e){const t=e.data;switch(e.bom=0,e.type){case s:e.type=a,t.length>=2&&(254===t[0]&&255===t[1]?e.bom=2:255===t[0]&&254===t[1]&&(e.type=c,e.bom=2));break;case a:if(e.type=a,t.length>=2)if(254===t[0]&&255===t[1])e.bom=2;else if(255===t[0]&&254===t[1])throw new TypeError('src type: "UTF16BE" specified but BOM is for "UTF16LE"');break;case c:if(e.type=c,t.length>=0){if(254===t[0]&&255===t[1])throw new TypeError('src type: "UTF16LE" specified but BOM is for "UTF16BE"');255===t[0]&&254===t[1]&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}}(n);break;case u:case l:case d:!function(e){const t=e.data;switch(e.bom=0,e.type){case u:e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.type=d,e.bom=4));break;case l:if(e.type=l,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]))throw new TypeError('src type: UTF32BE specified but BOM is for UTF32LE"');break;case d:if(e.type=d,t.length>=4){if(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3])throw new TypeError('src type: "UTF32LE" specified but BOM is for "UTF32BE"');255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}}(n);break;case g:n.type=b;break;case v:n.type=x;break;case p:n.type=f;break;case h:n.type=m;break;case f:case m:case y:case b:case w:case x:case E:case A:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(n.type===E){if("string"!==typeof n.data)throw new TypeError(`type: "${e}" but data is not a string`)}else if(!r.isBuffer(n.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return n},k=function(e,t){switch(e){case o:return i.utf8.encode(t);case a:return i.utf16be.encode(t);case c:return i.utf16le.encode(t);case l:return i.utf32be.encode(t);case d:return i.utf32le.encode(t);case f:return i.uint7.encode(t);case m:return i.uint8.encode(t);case b:return i.uint16be.encode(t);case y:return i.uint16le.encode(t);case x:return i.uint32be.encode(t);case w:return i.uint32le.encode(t);case E:return i.string.encode(t);case A:return i.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}};t.decode=function(e,t){return function(e){switch(e.type){case o:return i.utf8.decode(e.data,e.bom);case c:return i.utf16le.decode(e.data,e.bom);case a:return i.utf16be.decode(e.data,e.bom);case l:return i.utf32be.decode(e.data,e.bom);case d:return i.utf32le.decode(e.data,e.bom);case f:return i.uint7.decode(e.data);case m:return i.uint8.decode(e.data);case b:return i.uint16be.decode(e.data);case y:return i.uint16le.decode(e.data);case x:return i.uint32be.decode(e.data);case w:return i.uint32le.decode(e.data);case E:return i.string.decode(e.data);case A:return i.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}}(_(e,t))},t.encode=function(e,t){let n,r;const _=function(e,t){if(!Array.isArray(t))throw new TypeError('dst chars: not array: "'+typeof t);if("string"!==typeof e)throw new TypeError('dst type: not string: "'+typeof e);const n=function(e){let t,n;const r={crlf:!1,lf:!1,base64:!1,type:""};for(;;){if(n=e,t=e.slice(0,5),"CRLF:"===t){r.crlf=!0,n=e.slice(5);break}if(t=e.slice(0,3),"LF:"===t){r.lf=!0,n=e.slice(3);break}break}return t=n.split(":"),1===t.length?r.type=t[0]:2===t.length&&"BASE64"===t[1]&&(r.base64=!0,r.type=t[0]),r}(e.toUpperCase());switch(n.type){case o:case a:case c:case l:case d:case f:case m:case y:case b:case w:case x:case A:break;case E:if(n.base64)throw new TypeError('":BASE64" suffix not allowed with type STRING');break;case p:n.type=f;break;case h:n.type=m;break;case s:n.type=a;break;case u:n.type=l;break;case g:n.type=b;break;case v:n.type=x;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return n}(e,t);return _.crlf?(n=i.lineEnds.crlf(t),r=k(_.type,n)):_.lf?(n=i.lineEnds.lf(t),r=k(_.type,n)):r=k(_.type,t),_.base64&&(r=i.base64.encode(r)),r};t.convert=function(e,n,r){return t.encode(r,t.decode(e,n))}},46322:function(e,t,n){const{Buffer:r}=n(48764),i=4294967292,o=4294967293,s=4294967294,a=4294967295,c=[0,1,3,7,15,31,63,127,255,511,1023],u=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),d=[];l.forEach((e=>{d.push(e.charCodeAt(0))})),t.utf8={encode(e){const t=[];return e.forEach((e=>{if(e>=0&&e<=127)t.push(e);else if(e<=2047)t.push(192+(e>>6&c[5])),t.push(128+(e&c[6]));else if(e<55296||e>57343&&e<=65535)t.push(224+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]));else{if(!(e>=65536&&e<=1114111))throw new RangeError(`utf8.encode: character out of range: char: ${e}`);{const n=e>>16&c[5];t.push(240+(n>>2)),t.push(128+((n&c[2])<<4)+(e>>12&c[4])),t.push(128+(e>>6&c[6])),t.push(128+(e&c[6]))}}})),r.from(t)},decode(e,t){function n(e,t){if(128!==(192&t))return o;const n=((e&c[5])<<6)+(t&c[6]);return n<128?i:n}function r(e,t,n){if(128!==(192&n)||128!==(192&t))return o;const r=((e&c[4])<<12)+((t&c[6])<<6)+(n&c[6]);return r<2048?i:r>=55296&&r<=57343?s:r}function u(e,t,n,r){if(128!==(192&r)||128!==(192&n)||128!==(192&t))return o;const a=(((e&c[3])<<2)+(t>>4&c[2])<<16)+((t&c[4])<<12)+((n&c[6])<<6)+(r&c[6]);return a<65536?i:a>1114111?s:a}let l,d,f,p,h,m;const g=e.length;let y=t?3:0;const b=[];for(;y=0&&d<=127){l=d,m=1;break}if(f=y+1,f=194&&d<=223){l=n(d,e[f]),m=2;break}if(p=y+2,p=224&&d<=239){l=r(d,e[f],e[p]),m=3;break}if(h=y+3,h=240&&d<=244){l=u(d,e[f],e[p],e[h]),m=4;break}break}if(l>1114111){const e=`byte[${y}]`;if(l===a)throw new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${e}`);if(l===o)throw new RangeError(`utf8.decode: illegal trailing byte found at: ${e}`);if(l===s)throw new RangeError(`utf8.decode: code point out of range found at: ${e}`);if(l===i)throw new RangeError(`utf8.decode: non-shortest form found at: ${e}`);throw new RangeError(`utf8.decode: unrecognized error found at: ${e}`)}b.push(l),y+=m}return b}},t.utf16be={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n>>8&c[8]),t.push(n&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i>>8&c[8]),t.push(i&c[8]),t.push(o>>8&c[8]),t.push(o&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf16le={encode(e){const t=[];let n,i,o;for(let r=0;r=0&&n<=55295||n>=57344&&n<=65535)t.push(n&c[8]),t.push(n>>8&c[8]);else{if(!(n>=65536&&n<=1114111))throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${r}]: ${n}`);o=n-65536,i=55296+(o>>10),o=56320+(o&c[10]),t.push(i&c[8]),t.push(i>>8&c[8]),t.push(o&c[8]),t.push(o>>8&c[8])}return r.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${e.length}`);const n=[],r=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l57343){i=c,o=2;break}if(a=l+3,a=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${l}]`)}n[d++]=i,l+=o}return n}},t.utf32be={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${n/4}]: ${e}`);t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.utf32le={encode(e){const t=r.alloc(4*e.length);let n=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${e.length}`);const n=[];let r=t?4:0;for(;r=55296&&t<=57343||t>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${t}`);n.push(t)}return n}},t.uint7={encode(e){const t=r.alloc(e.length);for(let n=0;n127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${n}]: ${e[n]}`);t[n]=e[n]}return t}},t.uint8={encode(e){const t=r.alloc(e.length);for(let n=0;n255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${n}]: ${e[n]}`);t[n]=e[n]}return t},decode(e){const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${n/2}]: ${e}`);t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{if(e>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${n/2}]: ${e}`);t[n++]=e&c[8],t[n++]=e>>8&c[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e>>24&c[8],t[n++]=e>>16&c[8],t[n++]=e>>8&c[8],t[n++]=e&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;n{t[n++]=e&c[8],t[n++]=e>>8&c[8],t[n++]=e>>16&c[8],t[n++]=e>>24&c[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let n=0;nt.utf16le.encode(e).toString("utf16le"),decode:e=>t.utf16le.decode(r.from(e,"utf16le"),0)},t.escaped={encode(e){const t=[];for(let n=0;n=32&&i<=126)t.push(i);else{let e="";if(i>=0&&i<=31)e+=`\`x${u[i]}`;else if(i>=127&&i<=255)e+=`\`x${u[i]}`;else if(i>=256&&i<=65535)e+=`\`u${u[i>>8&c[8]]}${u[i&c[8]]}`;else{if(!(i>=65536&&i<=4294967295))throw new Error("escape.encode(char): char > 0xffffffff not allowed");{e+="`u{";const t=i>>24&c[8];t>0&&(e+=u[t]),e+=`${u[i>>16&c[8]]+u[i>>8&c[8]]+u[i&c[8]]}}`}}r.from(e).forEach((e=>{t.push(e)}))}}return r.from(t)},decode(e){function t(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function n(e,n,r){const i={char:null,nexti:e+2,error:!0};if(e+1=s)break;if(96===e[a]){o.push(96),l+=2,u=!1;break}if(120===e[a]){if(c=n(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(117===e[a]){if(123===e[a+1]){if(c=i(a+2,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(c=r(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return o}};const f=10;t.lineEnds={crlf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&(t.push(13),t.push(f)),t},lf(e){const t=[];let n=0;for(;n0&&t[t.length-1]!==f&&t.push(f),t}},t.base64={encode(e){if(0===e.length)return r.alloc(0);let t,n,i,o=e.length%3;o=o>0?3-o:0;let s=(e.length+o)/3;const a=r.alloc(4*s);o>0&&(s-=1),t=0,n=0;for(let r=0;r>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n++]=d[i&c[6]];return 0===o?a:1===o?(i=e[t++]<<16,i+=e[t]<<8,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[i>>6&c[6]],a[n]=d[64],a):2===o?(i=e[t]<<16,a[n++]=d[i>>18&c[6]],a[n++]=d[i>>12&c[6]],a[n++]=d[64],a[n]=d[64],a):void 0},decode(e){if(0===e.length)return r.alloc(0);const t=function(e){const t=[];let n=0;for(let r=0;r=65&&i<=90){t.push(i-65);break}if(i>=97&&i<=122){t.push(i-71);break}if(i>=48&&i<=57){t.push(i+4);break}if(43===i){t.push(62);break}if(47===i){t.push(63);break}if(61===i){t.push(64),n+=1;break}throw new RangeError(`base64.decode: invalid character buf[${r}]: ${i}`)}}if(t.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${t.length}`);switch(n){case 0:break;case 1:if(64!==t[t.length-1])throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(64!==t[t.length-1]||64!==t[t.length-2])throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${n}`)}return{tail:n,buf:r.from(t)}}(e),{tail:n}=t,i=t.buf;let o,s,a,u=i.length/4;const l=r.alloc(3*u-n);n>0&&(u-=1),s=0,o=0;for(let r=0;r>16&c[8],l[s++]=a>>8&c[8],l[s++]=a&c[8];return 1===n&&(a=i[o++]<<18,a+=i[o++]<<12,a+=i[o]<<6,l[s++]=a>>16&c[8],l[s]=a>>8&c[8]),2===n&&(a=i[o++]<<18,a+=i[o++]<<12,l[s]=a>>16&c[8]),l},toString(e){if(e.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${e.length}`);let t="",n=0;function r(e,r,i,o){switch(n){case 76:t+=`\r\n${e}${r}${i}${o}`,n=4;break;case 75:t+=`${e}\r\n${r}${i}${o}`,n=3;break;case 74:t+=`${e+r}\r\n${i}${o}`,n=2;break;case 73:t+=`${e+r+i}\r\n${o}`,n=1;break;default:t+=e+r+i+o,n+=4}}for(let o=0;o=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||43===i||47===i||61===i))throw new RangeError(`base64.toString: buf[${t}]: ${e[t]} : not valid base64 character code`);r(String.fromCharCode(e[o]),String.fromCharCode(e[o+1]),String.fromCharCode(e[o+2]),String.fromCharCode(e[o+3]))}var i;return t}}},90580:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=this;let i=null,o=null,s=null,a=0;const c=[],u=[],l=[],d=[];function f(e){let t="";for(let n=0;n0?d[e-1].stack:0},this.getLength=function(){return d.length},this.toXml=function(n){let r=t.charsToDec,i="decimal integer character codes";if("string"===typeof n&&n.length>=3){const e=n.slice(0,3).toLowerCase();"asc"===e?(r=t.charsToAscii,i="ASCII for printing characters, hex for non-printing"):"hex"===e?(r=t.charsToHex,i="hexadecimal integer character codes"):"uni"===e&&(r=t.charsToUnicode,i="Unicode UTF-32 integer character codes")}let o="",a=0;return o+='\n',o+=`\n`,o+=`\x3c!-- input string, ${i} --\x3e\n`,o+=f(a+2),o+=r(s),o+="\n",d.forEach((t=>{t.state===e.SEM_PRE?(a+=1,o+=f(a),o+=`\n`,o+=f(a+2),o+=r(s,t.phraseIndex,t.phraseLength),o+="\n"):(o+=f(a),o+=`\x3c!-- name="${t.name}" --\x3e\n`,a-=1)})),o+="\n",o},this.phrases=function(){const t={};let n,r;for(n=0;n 0");t=Math.ceil(n),e=-1},this.increment=function(){return e+=1,(e+t)%t},this.maxSize=function(){return t},this.items=function(){return e+1},this.getListIndex=function(n){return-1===e||n<0||n>e||e-n>=t?-1:(n+t)%t},this.forEach=function(n){if(-1!==e)if(e=g.length)throw new Error(`${o}rule index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.RNM,index:t}),i(s,n,r),u.pop()},E=function(t,n,r){const o="parser.js: evaluateUdt(): ";if(t>=y.length)throw new Error(`${o}udt index: ${t} out of range`);if(n>=a)throw new Error(`${o}phrase index: ${n} out of range`);const{length:s}=u;u.push({type:e.UDT,empty:y[t].empty,index:t}),i(s,n,r),u.pop()},_=function(){d=0,f=0,p=0,v=0,c=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],g=null,y=null,l=null,o=0,s=0,a=0,h=null,m=null,b=null,u=null},k=function(){const e=[];this.push=function(){e.push(function(){const t=e[e.length-1],n={};for(const e in t)n[e]=t[e];return n}())},this.pop=function(t){let n=t;if(n||(n=e.length-1),n<1||n>e.length)throw new Error(`parser.js: backRef.pop(): bad length: ${n}`);return e.length=n,e[e.length-1]},this.length=function(){return e.length},this.savePhrase=function(t,n,r){e[e.length-1][t]={phraseIndex:n,phraseLength:r}},this.getPhrase=function(t){return e[e.length-1][t]},function(){const t={};g.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),y.length>0&&y.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),e.push(t)}()},T=function(){const t=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=c[c.length-1],this.uFrame=new k,this.pFrame=new k,this.evaluateRule=A,this.evaluateUdt=E,this.refresh=function(){t.state=e.ACTIVE,t.phraseLength=0,t.lookAround=c[c.length-1]}},S=function(){return c[c.length-1]},C=function(){return c.length>1},I=function(e,n,r){const i="parser.js: initializeInputChars(): ";let c=e,u=n,d=r;if(void 0===c)throw new Error(`${i}input string is undefined`);if(null===c)throw new Error(`${i}input string is null`);if("string"===typeof c)c=t.stringToChars(c);else if(!Array.isArray(c))throw new Error(`${i}input string is not a string or array`);if(c.length>0&&"number"!==typeof c[0])throw new Error(`${i}input string not an array of integers`);if("number"!==typeof u)u=0;else if(u=Math.floor(u),u<0||u>c.length)throw new Error(`${i}input beginning index out of range: ${u}`);if("number"!==typeof d)d=c.length-u;else if(d=Math.floor(d),d<0||d>c.length-u)throw new Error(`${i}input length out of range: ${d}`);l=c,o=u,s=d,a=o+s};this.setMaxTreeDepth=function(e){if("number"!==typeof e)throw new Error(`parser: max tree depth must be integer > 0: ${e}`);if(w=Math.floor(e),w<=0)throw new Error(`parser: max tree depth must be integer > 0: ${e}`)},this.setMaxNodeHits=function(e){if("number"!==typeof e)throw new Error(`parser: max node hits must be integer > 0: ${e}`);if(x=Math.floor(e),x<=0)throw new Error(`parser: max node hits must be integer > 0: ${e}`)};const O=function(t,n,c){let d;!function(e){const t="parser.js: initializeGrammar(): ";if(!e)throw new Error(`${t}grammar object undefined`);if("grammarObject"!==e.grammarObject)throw new Error(`${t}bad grammar object`);g=e.rules,y=e.udts}(t);const w=function(e){const t="parser.js: initializeStartRule(): ";let n=null;if("number"===typeof e){if(e>=g.length)throw new Error(`${t}start rule index too large: max: ${g.length}: index: ${e}`);n=e}else{if("string"!==typeof e)throw new Error(`${t}type of start rule '${typeof e}' not recognized`);{const r=e.toLowerCase();for(let e=0;er){let e=`parser.js: opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:if(!0!==i)throw new Error(`parser.js: opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:n.phraseLength=0;break;case e.MATCH:0===n.phraseLength&&(n.state=e.EMPTY);break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opRNM(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}},P=function(t,n,o){let s,c,d,f,p,m;const y=u[t],v=g[y.index],w=h[v.index],x=!C();if(x&&(c=r.ast&&r.ast.ruleDefined(y.index),c&&(s=r.ast.getLength(),r.ast.down(y.index,g[y.index].name)),f=o.uFrame.length(),p=o.pFrame.length(),o.uFrame.push(),o.pFrame.push(),m=o.pFrame,o.pFrame=new k),null===w)d=u,u=v.opcodes,i(0,n,o),u=d;else{const t=a-n;o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!0),o.state===e.ACTIVE&&(d=u,u=v.opcodes,i(0,n,o),u=d,o.ruleIndex=v.index,w(o,l,n,b),D(v,o,t,!1))}x&&(c&&(o.state===e.NOMATCH?r.ast.setLength(s):r.ast.up(y.index,v.name,n,o.phraseLength)),o.pFrame=m,o.state===e.NOMATCH?(o.uFrame.pop(f),o.pFrame.pop(p)):v.isBkr&&(o.pFrame.savePhrase(v.lower,n,o.phraseLength),o.uFrame.savePhrase(v.lower,n,o.phraseLength)))},B=function(t,n,i){let o,s,c,d,f,p;const h=u[t],v=y[h.index];i.UdtIndex=v.index;const w=!C();w&&(c=r.ast&&r.ast.udtDefined(h.index),c&&(s=g.length+h.index,o=r.ast.getLength(),r.ast.down(s,v.name)),d=i.uFrame.length(),f=i.pFrame.length(),i.uFrame.push(),i.pFrame.push(),p=i.pFrame,i.pFrame=new k);const x=a-n;m[h.index](i,l,n,b),function(t,n,r){if(n.phraseLength>r){let e=`parser.js: opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${n.phraseLength}`,e+=` must be <= remaining chars: ${r}`,new Error(e)}switch(n.state){case e.ACTIVE:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.phraseLength=0;break;case e.MATCH:if(0===n.phraseLength){if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);n.state=e.EMPTY}break;case e.NOMATCH:n.phraseLength=0;break;default:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. Unrecognized return state: ${n.state}`)}}(v,i,x),w&&(c&&(i.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(s,v.name,n,i.phraseLength)),i.pFrame=p,i.state===e.NOMATCH?(i.uFrame.pop(d),i.pFrame.pop(f)):v.isBkr&&(i.pFrame.savePhrase(v.lower,n,i.phraseLength),i.uFrame.savePhrase(v.lower,n,i.phraseLength)))},M=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${r.state}`)}},N=function(t,n,r){c.push({lookAround:e.LOOKAROUND_AHEAD,anchor:n,charsEnd:a,charsLength:s}),a=l.length,s=l.length-o,i(t+1,n,r);const u=c.pop();switch(a=u.charsEnd,s=u.charsLength,r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${r.state}`)}},F=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=0===n?e.EMPTY:e.NOMATCH},L=function(t,n,r){r.state=e.NOMATCH,r.phraseLength=0,r.state=n===l.length?e.EMPTY:e.NOMATCH},j=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.EMPTY;break;case e.NOMATCH:r.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${r.state}`)}},U=function(t,n,r){switch(c.push({lookAround:e.LOOKAROUND_BEHIND,anchor:n}),i(t+1,n,r),c.pop(),r.phraseLength=0,r.state){case e.EMPTY:case e.MATCH:r.state=e.NOMATCH;break;case e.NOMATCH:r.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${r.state}`)}};i=function(t,n,o){let s=!0;const h=u[t];if(p+=1,p>x)throw new Error(`parser: maximum number of node hits exceeded: ${x}`);if(d+=1,d>f&&(f=d,f>w))throw new Error(`parser: maximum parse tree depth exceeded: ${w}`);if(o.refresh(),null!==r.trace){const e=S();r.trace.down(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}if(c[c.length-1].lookAround===e.LOOKAROUND_BEHIND)switch(h.type){case e.ALT:R(t,n,o);break;case e.CAT:!function(t,n,o){let s,a,c,l;const d=u[t],f=o.uFrame.length(),p=o.pFrame.length();r.ast&&(a=r.ast.getLength()),s=!0,c=n,l=0;for(let r=d.children.length-1;r>=0;r-=1)if(i(d.children[r],c,o),c-=o.phraseLength,l+=o.phraseLength,o.state===e.NOMATCH){s=!1;break}s?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(a))}(t,n,o);break;case e.REP:!function(t,n,o){let s,a,c,l;const d=u[t];a=n,c=0,l=0;const f=o.uFrame.length(),p=o.pFrame.length();for(r.ast&&(s=r.ast.getLength());!(a<=0)&&(i(t+1,a,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(l+=1,c+=o.phraseLength,a-=o.phraseLength,l!==d.max););o.state===e.EMPTY||l>=d.min?(o.state=0===c?e.EMPTY:e.MATCH,o.phraseLength=c):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(p),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];if(r.state=e.NOMATCH,r.phraseLength=0,n>0){const t=l[n-1];i.min<=t&&t<=i.max&&(r.state=e.MATCH,r.phraseLength=1)}}(t,n,o);break;case e.TBS:!function(t,n,r){let i;const o=u[t];r.state=e.NOMATCH;const s=o.string.length,a=n-s;if(a>=0){for(i=0;i=0){for(let e=0;e=65&&i<=90&&(i+=32),i!==o.string[e])return;r.state=e.MATCH,r.phraseLength=s}}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,a;const c=u[t];r.state=e.NOMATCH,r.phraseLength=0,a=c.index=0){if(f){for(i=0;i=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=h}else for(i=0;i=a)&&(i(t+1,c,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(d+=1,l+=o.phraseLength,c+=o.phraseLength,d!==f.max););o.state===e.EMPTY||d>=f.min?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(p),o.pFrame.pop(h),r.ast&&r.ast.setLength(s))}(t,n,o);break;case e.RNM:P(t,n,o);break;case e.UDT:B(t,n,o);break;case e.AND:M(t,n,o);break;case e.NOT:N(t,n,o);break;case e.TRG:!function(t,n,r){const i=u[t];r.state=e.NOMATCH,n=65&&o<=90&&(o+=32),o!==s.string[i])return;r.state=e.MATCH,r.phraseLength=c}}else r.state=e.EMPTY}(t,n,o);break;case e.BKR:!function(t,n,r){let i,o,s,c;const d=u[t];r.state=e.NOMATCH,c=d.index=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;r.state=e.MATCH,r.phraseLength=m}else for(i=0;iv&&(v=n+o.phraseLength),null!==r.stats&&r.stats.collect(h,o),null!==r.trace){const e=S();r.trace.up(h,o.state,n,o.phraseLength,e.anchor,e.lookAround)}return d-=1,s}}},35403:function(e,t,n){e.exports=function(){const e=n(58276),t=n(8544),r=n(93932);let i=[],o=[];const s=[];let a;const c=[],u=[];this.statsObject="statsObject";const l=function(e,t){return e.lowert.lower?1:0},d=function(e,t){return e.totalt.total?-1:l(e,t)},f=function(e,t){return e.indext.index?1:0},p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},h=function(t,n){switch(t.total+=1,n){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`stats.js: collect(): incStat(): unrecognized state: ${n}`)}},m=function(e,t){let n="";return n+="",n+=`${e} | `,n+=`${t.empty} | `,n+=`${t.match} | `,n+=`${t.nomatch} | `,n+=`${t.total} | `,n+="
\n",n},g=function(){let t="";return t+=m("ALT",s[e.ALT]),t+=m("CAT",s[e.CAT]),t+=m("REP",s[e.REP]),t+=m("RNM",s[e.RNM]),t+=m("TRG",s[e.TRG]),t+=m("TBS",s[e.TBS]),t+=m("TLS",s[e.TLS]),t+=m("UDT",s[e.UDT]),t+=m("AND",s[e.AND]),t+=m("NOT",s[e.NOT]),t+=m("BKR",s[e.BKR]),t+=m("BKA",s[e.BKA]),t+=m("BKN",s[e.BKN]),t+=m("ABG",s[e.ABG]),t+=m("AEN",s[e.AEN]),t+=m("totals",a),t},y=function(){let e="";e+=" | | | | |
\n",e+="rules | | | | |
\n";for(let t=0;t0&&(e+="",e+=`${c[t].name} | `,e+=`${c[t].empty} | `,e+=`${c[t].match} | `,e+=`${c[t].nomatch} | `,e+=`${c[t].total} | `,e+="
\n");if(o.length>0){e+=" | | | | |
\n",e+="udts | | | | |
\n";for(let t=0;t0&&(e+="",e+=`${u[t].name} | `,e+=`${u[t].empty} | `,e+=`${u[t].match} | `,e+=`${u[t].nomatch} | `,e+=`${u[t].total} | `,e+="
\n")}return e};this.validate=function(e){let t=!1;return"string"===typeof e&&"stats"===e&&(t=!0),t},this.init=function(t,n){i=t,o=n,function(){s.length=0,a=new p,s[e.ALT]=new p,s[e.CAT]=new p,s[e.REP]=new p,s[e.RNM]=new p,s[e.TRG]=new p,s[e.TBS]=new p,s[e.TLS]=new p,s[e.UDT]=new p,s[e.AND]=new p,s[e.NOT]=new p,s[e.BKR]=new p,s[e.BKA]=new p,s[e.BKN]=new p,s[e.ABG]=new p,s[e.AEN]=new p,c.length=0;for(let e=0;e0){u.length=0;for(let e=0;e\n`,"string"===typeof t&&(n+=`${t}\n`),n+=`ops | \n`,n+=`EMPTY | \n`,n+=`MATCH | \n`,n+=`NOMATCH | \n`,n+=`totals |
\n`;for(;;){if(void 0===e){n+=g();break}if(null===e){n+=g();break}if("ops"===e){n+=g();break}if("index"===e){c.sort(f),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("hits"===e){c.sort(d),u.length>0&&u.sort(f),n+=g(),n+=y();break}if("alpha"===e){c.sort(l),u.length>0&&u.sort(l),n+=g(),n+=y();break}break}return n+="\n",n},this.toHtmlPage=function(e,n,r){return t.htmlToPage(this.toHtml(e,n),r)}}},93932:function(e){e.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}},99290:function(e,t,n){e.exports=function(){const e=n(8544),t=n(93932),r=new(n(42761)),i=n(58276),o=this,s=16,a=80,c=[];let u=5e3,l=-1,d=0,f=0;const p=[];let h=null,m=null,g=null;const y=[],b=[],v=`•`,w=`…`,x=`𝜺`;this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(e,t){l=-1,"number"===typeof e&&e>0?(u=Math.ceil(e),"number"===typeof t&&(l=Math.floor(t),l<0&&(l=-1))):u=0},this.getMaxRecords=function(){return u},this.getLastRecord=function(){return l},this.init=function(e,t,n){c.length=0,p.length=0,d=0,f=0,h=n,m=e,g=t,function(){const e=function(e){y[i.ALT]=e,y[i.CAT]=e,y[i.REP]=e,y[i.TLS]=e,y[i.TBS]=e,y[i.TRG]=e,y[i.AND]=e,y[i.NOT]=e,y[i.BKR]=e,y[i.BKA]=e,y[i.BKN]=e,y[i.ABG]=e,y[i.AEN]=e};let t=0;for(const n in o.filter.operators)t+=1;if(0!==t){for(const t in o.filter.operators){const n=t.toUpperCase();if(""===n)return void e(!0);if(""===n)return void e(!1)}e(!1);for(const e in o.filter.operators){const t=e.toUpperCase();if("ALT"===t)y[i.ALT]=!0===o.filter.operators[e];else if("CAT"===t)y[i.CAT]=!0===o.filter.operators[e];else if("REP"===t)y[i.REP]=!0===o.filter.operators[e];else if("AND"===t)y[i.AND]=!0===o.filter.operators[e];else if("NOT"===t)y[i.NOT]=!0===o.filter.operators[e];else if("TLS"===t)y[i.TLS]=!0===o.filter.operators[e];else if("TBS"===t)y[i.TBS]=!0===o.filter.operators[e];else if("TRG"===t)y[i.TRG]=!0===o.filter.operators[e];else if("BKR"===t)y[i.BKR]=!0===o.filter.operators[e];else if("BKA"===t)y[i.BKA]=!0===o.filter.operators[e];else if("BKN"===t)y[i.BKN]=!0===o.filter.operators[e];else if("ABG"===t)y[i.ABG]=!0===o.filter.operators[e];else{if("AEN"!==t)throw new Error(`trace.js: initOpratorFilter: '${e}' not a valid operator name. Must be , , alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`);y[i.AEN]=!0===o.filter.operators[e]}}}else e(!1)}(),function(){const e=function(e){y[i.RNM]=e,y[i.UDT]=e;const t=m.length+g.length;b.length=0;for(let n=0;n"===n)return void e(!0);if(""===n)return void e(!1)}e(!1),y[i.RNM]=!0,y[i.UDT]=!0;for(const e in o.filter.rules){const t=e.toLowerCase();if(n=r.indexOf(t),n<0)throw new Error(`trace.js: initRuleFilter: '${e}' not a valid rule or udt name`);b[n]=!0===o.filter.rules[e]}}else e(!0)}(),r.init(u)};const A=function(e){let t=!1;return t=e.type===i.RNM?!(!y[e.type]||!b[e.index]):e.type===i.UDT?!(!y[e.type]||!b[m.length+e.index]):y[e.type],t},E=function(e){return-1===l||e<=l};this.down=function(e,t,n,i,o,s){E(d)&&A(e)&&(p.push(d),c[r.increment()]={dirUp:!1,depth:f,thisLine:d,thatLine:void 0,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1,f+=1)},this.up=function(e,t,n,i,o,s){if(E(d)&&A(e)){const a=d,u=p.pop(),l=r.getListIndex(u);-1!==l&&(c[l].thatLine=a),f-=1,c[r.increment()]={dirUp:!0,depth:f,thisLine:a,thatLine:u,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},d+=1}};this.toTree=function(t){const n=function(){function t(t,n){let r,o,s;if(n)switch(t.op={id:n.type,name:e.opcodeToString(n.type)},t.opData=void 0,n.type){case i.RNM:t.opData=m[n.index].name;break;case i.UDT:t.opData=g[n.index].name;break;case i.BKR:r=n.index{if(w=c[e],x&&(x=!1,w.depth>0)){const e=w.dirUp?w.depth+1:w.depth;for(let t=0;t1;)b=p.pop(),a(b,null);if(0===A.children.length)throw new Error("trace.toTree(): parse tree has no nodes");if(0===p.length)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");y=A.children[0];let E=y;for(;y&&!y.down&&!y.up;)E=y,y=y.children[0];y=E,y.leftMost=!0,y.rightMost=!0,function e(t){if(l+=1,t.branch=d,l>f&&(f=l),0===t.children.length)u+=1;else for(let n=0;n0&&(d+=1),t.children[n].leftMost=!1,t.children[n].rightMost=!1,t.leftMost&&(t.children[n].leftMost=0===n),t.rightMost&&(t.children[n].rightMost=n===t.children.length-1),e(t.children[n]);l-=1}(y),y.branch=0;const _={string:[]};for(let e=0;e`,g="";let y=!1;switch(r){case i.EMPTY:p+=x;case i.NOMATCH:case i.ACTIVE:u=o,l=0,d=o,f=n.length-d;break;case i.MATCH:u=o,l=s,d=o+l,f=n.length-d;break;default:throw new Error("unrecognized state")}return h=v,l>a?(l=a,h=w,f=0):l+f>a&&(h=w,f=a-l),l>0&&(p+=c,p+=_(e,n,u,l,y),p+=g,y=!0),f>0&&(p+=m,p+=_(e,n,d,f,y),p+=g),p+h},T=function(n){if(null===m)return"";let u,l,d,f,p,y,b="";return b+="(a) | (b) | (c) | (d) | (e) | (f) | ",b+="operator | phrase |
\n",r.forEach((r=>{const A=c[r];switch(u=A.thisLine,l=void 0!==A.thatLine?A.thatLine:"--",d=!1,f=!1,p=!1,A.lookAround===i.LOOKAROUND_AHEAD&&(d=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.AND&&A.opcode.type!==i.NOT||(d=!0,p=!0,y=A.phraseIndex),A.lookAround===i.LOOKAROUND_BEHIND&&(f=!0,p=!0,y=A.lookAnchor),A.opcode.type!==i.BKA&&A.opcode.type!==i.BKN||(f=!0,p=!0,y=A.phraseIndex),b+="",b+=`${u} | ${l} | `,b+=`${A.phraseIndex} | `,b+=`${A.phraseLength} | `,b+=`${A.depth} | `,b+="",A.state){case i.ACTIVE:b+=`↓ `;break;case i.MATCH:b+=`↑M`;break;case i.NOMATCH:b+=`↑N`;break;case i.EMPTY:b+=`↑E`;break;default:b+=`--`}if(b+=" | ",b+="",b+=o.indent(A.depth),d?b+=``:f&&(b+=``),b+=e.opcodeToString(A.opcode.type),A.opcode.type===i.RNM&&(b+=`(${m[A.opcode.index].name}) `),A.opcode.type===i.BKR){const e=A.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",t=A.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";b+=`(\\${e}${t}${m[A.opcode.index].name}) `}A.opcode.type===i.UDT&&(b+=`(${g[A.opcode.index].name}) `),A.opcode.type===i.TRG&&(b+=`(${function(e,t){let n="";if(t.type===i.TRG)if(e===s||32===e){let r=t.min.toString(16).toUpperCase();r.length%2!==0&&(r=`0${r}`),n+=e===s?"%x":"U+",n+=r,r=t.max.toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=`–${r}`}else n=`%d${t.min.toString(10)}–${t.max.toString(10)}`;return n}(n,A.opcode)}) `),A.opcode.type===i.TBS&&(b+=`(${function(e,t){let n="";if(t.type===i.TBS){const r=Math.min(t.string.length,10);if(e===s||32===e){n+=e===s?"%x":"U+";for(let e=0;e0&&(n+="."),r=t.string[e].toString(16).toUpperCase(),r.length%2!==0&&(r=`0${r}`),n+=r}}else{n="%d";for(let e=0;e0&&(n+="."),n+=t.string[e].toString(10)}r |