@prisma/cli-dev 0.0.0-dev.202510101240 → 0.0.0-dev.202510101255
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accelerate-6C2KDCGF.js +164 -0
- package/dist/chunk-6CY7FTXB.js +12 -0
- package/dist/chunk-7LVVKN3Q.js +2 -0
- package/dist/chunk-C743SY2X.js +2 -0
- package/dist/chunk-IUA2KLPR.js +34 -0
- package/dist/chunk-J2EYU3K5.js +2 -0
- package/dist/chunk-MKAOBCJL.js +2 -0
- package/dist/chunk-PKHPXFYF.js +4 -0
- package/dist/chunk-VMZVNK7U.js +2 -0
- package/dist/chunk-VN3SER5K.js +2 -0
- package/dist/chunk-WAQNVDRS.js +15 -0
- package/dist/chunk-ZZ7TGN5J.js +2 -0
- package/dist/client-ROT4AZYN.js +2 -0
- package/dist/dist-44BN73S3.js +24 -0
- package/dist/dist-FF6JPL3Y.js +2 -0
- package/dist/dist-OWTPHSRP.js +2 -0
- package/dist/http-exception-IXDDLQOJ.js +2 -0
- package/dist/index.js +100 -18
- package/dist/list-AF7WT6HT.js +5 -0
- package/dist/logger-5NORX5VG.js +2 -0
- package/dist/nodefs-MQZB2OFY.js +2 -0
- package/dist/opfs-ahp-W7WVBYAH.js +4 -0
- package/dist/pg_dump-F2HW5KLY.js +3 -0
- package/dist/prompt-AVJG6SAC.js +46 -0
- package/dist/proxy-signals-TJILVQAL.js +2 -0
- package/dist/remove-BWVQMMM4.js +9 -0
- package/dist/stop-XM5K7ZMT.js +5 -0
- package/dist/tiny-4VNDEAK3.js +2 -0
- package/dist/utility-5QZDATLM.js +2 -0
- package/package.json +8 -10
- package/dist/chunk-D5MRRGDK.js +0 -12
- package/dist/chunk-XOIFSEIB.js +0 -2
- package/dist/chunk-ZKMEOIRF.js +0 -2
- package/dist/list-K5DAVLAS.js +0 -3
- package/dist/remove-6QJTZ5SK.js +0 -9
- package/dist/stop-CRL2UWAK.js +0 -5
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as iu}from"./chunk-MKAOBCJL.js";import{a as Da}from"./chunk-VN3SER5K.js";import"./chunk-VMZVNK7U.js";import{b as jt,d as nu,e as Kn}from"./chunk-PKHPXFYF.js";import{a as Ma,b as Js,c as wa,g as Qs,h as eu,i as tu,j as Wn,k as Vn,l as ru,m as Vr,n as Hn,o as Hr,p as Kr}from"./chunk-C743SY2X.js";import{a as Fa}from"./chunk-ZZ7TGN5J.js";import{a as Ot,b as l,d as Zs}from"./chunk-J2EYU3K5.js";var Ua=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.VERSION=void 0;zn.VERSION="10.5.0"});var Bt=l((Oj,uu)=>{"use strict";var LE=Object.prototype;function PE(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||LE;return e===r}uu.exports=PE});var ja=l((Rj,cu)=>{"use strict";function xE(e,t){return function(r){return e(t(r))}}cu.exports=xE});var fu=l((Sj,lu)=>{"use strict";var CE=ja(),kE=CE(Object.keys,Object);lu.exports=kE});var Ba=l((bj,pu)=>{"use strict";var qE=Bt(),ME=fu(),wE=Object.prototype,FE=wE.hasOwnProperty;function DE(e){if(!qE(e))return ME(e);var t=[];for(var r in Object(e))FE.call(e,r)&&r!="constructor"&&t.push(r);return t}pu.exports=DE});var Ga=l((Nj,du)=>{"use strict";var UE=typeof global=="object"&&global&&global.Object===Object&&global;du.exports=UE});var Ae=l((Ij,hu)=>{"use strict";var jE=Ga(),BE=typeof self=="object"&&self&&self.Object===Object&&self,GE=jE||BE||Function("return this")();hu.exports=GE});var St=l((Lj,vu)=>{"use strict";var WE=Ae(),VE=WE.Symbol;vu.exports=VE});var _u=l((Pj,gu)=>{"use strict";var mu=St(),yu=Object.prototype,HE=yu.hasOwnProperty,KE=yu.toString,zr=mu?mu.toStringTag:void 0;function zE(e){var t=HE.call(e,zr),r=e[zr];try{e[zr]=void 0;var n=!0}catch{}var i=KE.call(e);return n&&(t?e[zr]=r:delete e[zr]),i}gu.exports=zE});var Tu=l((xj,Eu)=>{"use strict";var YE=Object.prototype,XE=YE.toString;function $E(e){return XE.call(e)}Eu.exports=$E});var lt=l((Cj,Ru)=>{"use strict";var Au=St(),ZE=_u(),JE=Tu(),QE="[object Null]",eT="[object Undefined]",Ou=Au?Au.toStringTag:void 0;function tT(e){return e==null?e===void 0?eT:QE:Ou&&Ou in Object(e)?ZE(e):JE(e)}Ru.exports=tT});var Oe=l((kj,Su)=>{"use strict";function rT(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}Su.exports=rT});var Gt=l((qj,bu)=>{"use strict";var nT=lt(),iT=Oe(),aT="[object AsyncFunction]",oT="[object Function]",sT="[object GeneratorFunction]",uT="[object Proxy]";function cT(e){if(!iT(e))return!1;var t=nT(e);return t==oT||t==sT||t==aT||t==uT}bu.exports=cT});var Iu=l((Mj,Nu)=>{"use strict";var lT=Ae(),fT=lT["__core-js_shared__"];Nu.exports=fT});var xu=l((wj,Pu)=>{"use strict";var Wa=Iu(),Lu=function(){var e=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function pT(e){return!!Lu&&Lu in e}Pu.exports=pT});var Va=l((Fj,Cu)=>{"use strict";var dT=Function.prototype,hT=dT.toString;function vT(e){if(e!=null){try{return hT.call(e)}catch{}try{return e+""}catch{}}return""}Cu.exports=vT});var qu=l((Dj,ku)=>{"use strict";var mT=Gt(),yT=xu(),gT=Oe(),_T=Va(),ET=/[\\^$.*+?()[\]{}|]/g,TT=/^\[object .+?Constructor\]$/,AT=Function.prototype,OT=Object.prototype,RT=AT.toString,ST=OT.hasOwnProperty,bT=RegExp("^"+RT.call(ST).replace(ET,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NT(e){if(!gT(e)||yT(e))return!1;var t=mT(e)?bT:TT;return t.test(_T(e))}ku.exports=NT});var wu=l((Uj,Mu)=>{"use strict";function IT(e,t){return e?.[t]}Mu.exports=IT});var ft=l((jj,Fu)=>{"use strict";var LT=qu(),PT=wu();function xT(e,t){var r=PT(e,t);return LT(r)?r:void 0}Fu.exports=xT});var Uu=l((Bj,Du)=>{"use strict";var CT=ft(),kT=Ae(),qT=CT(kT,"DataView");Du.exports=qT});var Yn=l((Gj,ju)=>{"use strict";var MT=ft(),wT=Ae(),FT=MT(wT,"Map");ju.exports=FT});var Gu=l((Wj,Bu)=>{"use strict";var DT=ft(),UT=Ae(),jT=DT(UT,"Promise");Bu.exports=jT});var Ha=l((Vj,Wu)=>{"use strict";var BT=ft(),GT=Ae(),WT=BT(GT,"Set");Wu.exports=WT});var Hu=l((Hj,Vu)=>{"use strict";var VT=ft(),HT=Ae(),KT=VT(HT,"WeakMap");Vu.exports=KT});var Vt=l((Kj,Ju)=>{"use strict";var Ka=Uu(),za=Yn(),Ya=Gu(),Xa=Ha(),$a=Hu(),Zu=lt(),Wt=Va(),Ku="[object Map]",zT="[object Object]",zu="[object Promise]",Yu="[object Set]",Xu="[object WeakMap]",$u="[object DataView]",YT=Wt(Ka),XT=Wt(za),$T=Wt(Ya),ZT=Wt(Xa),JT=Wt($a),bt=Zu;(Ka&&bt(new Ka(new ArrayBuffer(1)))!=$u||za&&bt(new za)!=Ku||Ya&&bt(Ya.resolve())!=zu||Xa&&bt(new Xa)!=Yu||$a&&bt(new $a)!=Xu)&&(bt=function(e){var t=Zu(e),r=t==zT?e.constructor:void 0,n=r?Wt(r):"";if(n)switch(n){case YT:return $u;case XT:return Ku;case $T:return zu;case ZT:return Yu;case JT:return Xu}return t});Ju.exports=bt});var Re=l((zj,Qu)=>{"use strict";function QT(e){return e!=null&&typeof e=="object"}Qu.exports=QT});var tc=l((Yj,ec)=>{"use strict";var eA=lt(),tA=Re(),rA="[object Arguments]";function nA(e){return tA(e)&&eA(e)==rA}ec.exports=nA});var Yr=l((Xj,ic)=>{"use strict";var rc=tc(),iA=Re(),nc=Object.prototype,aA=nc.hasOwnProperty,oA=nc.propertyIsEnumerable,sA=rc(function(){return arguments}())?rc:function(e){return iA(e)&&aA.call(e,"callee")&&!oA.call(e,"callee")};ic.exports=sA});var k=l(($j,ac)=>{"use strict";var uA=Array.isArray;ac.exports=uA});var Xn=l((Zj,oc)=>{"use strict";var cA=9007199254740991;function lA(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=cA}oc.exports=lA});var Se=l((Jj,sc)=>{"use strict";var fA=Gt(),pA=Xn();function dA(e){return e!=null&&pA(e.length)&&!fA(e)}sc.exports=dA});var cc=l((Qj,uc)=>{"use strict";function hA(){return!1}uc.exports=hA});var $r=l((Xr,Ht)=>{"use strict";var vA=Ae(),mA=cc(),pc=typeof Xr=="object"&&Xr&&!Xr.nodeType&&Xr,lc=pc&&typeof Ht=="object"&&Ht&&!Ht.nodeType&&Ht,yA=lc&&lc.exports===pc,fc=yA?vA.Buffer:void 0,gA=fc?fc.isBuffer:void 0,_A=gA||mA;Ht.exports=_A});var hc=l((eB,dc)=>{"use strict";var EA=lt(),TA=Xn(),AA=Re(),OA="[object Arguments]",RA="[object Array]",SA="[object Boolean]",bA="[object Date]",NA="[object Error]",IA="[object Function]",LA="[object Map]",PA="[object Number]",xA="[object Object]",CA="[object RegExp]",kA="[object Set]",qA="[object String]",MA="[object WeakMap]",wA="[object ArrayBuffer]",FA="[object DataView]",DA="[object Float32Array]",UA="[object Float64Array]",jA="[object Int8Array]",BA="[object Int16Array]",GA="[object Int32Array]",WA="[object Uint8Array]",VA="[object Uint8ClampedArray]",HA="[object Uint16Array]",KA="[object Uint32Array]",D={};D[DA]=D[UA]=D[jA]=D[BA]=D[GA]=D[WA]=D[VA]=D[HA]=D[KA]=!0;D[OA]=D[RA]=D[wA]=D[SA]=D[FA]=D[bA]=D[NA]=D[IA]=D[LA]=D[PA]=D[xA]=D[CA]=D[kA]=D[qA]=D[MA]=!1;function zA(e){return AA(e)&&TA(e.length)&&!!D[EA(e)]}dc.exports=zA});var Kt=l((tB,vc)=>{"use strict";function YA(e){return function(t){return e(t)}}vc.exports=YA});var Qr=l((Zr,zt)=>{"use strict";var XA=Ga(),mc=typeof Zr=="object"&&Zr&&!Zr.nodeType&&Zr,Jr=mc&&typeof zt=="object"&&zt&&!zt.nodeType&&zt,$A=Jr&&Jr.exports===mc,Za=$A&&XA.process,ZA=function(){try{var e=Jr&&Jr.require&&Jr.require("util").types;return e||Za&&Za.binding&&Za.binding("util")}catch{}}();zt.exports=ZA});var $n=l((rB,_c)=>{"use strict";var JA=hc(),QA=Kt(),yc=Qr(),gc=yc&&yc.isTypedArray,eO=gc?QA(gc):JA;_c.exports=eO});var ye=l((nB,Ec)=>{"use strict";var tO=Ba(),rO=Vt(),nO=Yr(),iO=k(),aO=Se(),oO=$r(),sO=Bt(),uO=$n(),cO="[object Map]",lO="[object Set]",fO=Object.prototype,pO=fO.hasOwnProperty;function dO(e){if(e==null)return!0;if(aO(e)&&(iO(e)||typeof e=="string"||typeof e.splice=="function"||oO(e)||uO(e)||nO(e)))return!e.length;var t=rO(e);if(t==cO||t==lO)return!e.size;if(sO(e))return!tO(e).length;for(var r in e)if(pO.call(e,r))return!1;return!0}Ec.exports=dO});var Yt=l((iB,Tc)=>{"use strict";function hO(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}Tc.exports=hO});var Oc=l((aB,Ac)=>{"use strict";function vO(){this.__data__=[],this.size=0}Ac.exports=vO});var Xt=l((oB,Rc)=>{"use strict";function mO(e,t){return e===t||e!==e&&t!==t}Rc.exports=mO});var en=l((sB,Sc)=>{"use strict";var yO=Xt();function gO(e,t){for(var r=e.length;r--;)if(yO(e[r][0],t))return r;return-1}Sc.exports=gO});var Nc=l((uB,bc)=>{"use strict";var _O=en(),EO=Array.prototype,TO=EO.splice;function AO(e){var t=this.__data__,r=_O(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():TO.call(t,r,1),--this.size,!0}bc.exports=AO});var Lc=l((cB,Ic)=>{"use strict";var OO=en();function RO(e){var t=this.__data__,r=OO(t,e);return r<0?void 0:t[r][1]}Ic.exports=RO});var xc=l((lB,Pc)=>{"use strict";var SO=en();function bO(e){return SO(this.__data__,e)>-1}Pc.exports=bO});var kc=l((fB,Cc)=>{"use strict";var NO=en();function IO(e,t){var r=this.__data__,n=NO(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}Cc.exports=IO});var tn=l((pB,qc)=>{"use strict";var LO=Oc(),PO=Nc(),xO=Lc(),CO=xc(),kO=kc();function $t(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}$t.prototype.clear=LO;$t.prototype.delete=PO;$t.prototype.get=xO;$t.prototype.has=CO;$t.prototype.set=kO;qc.exports=$t});var wc=l((dB,Mc)=>{"use strict";var qO=tn();function MO(){this.__data__=new qO,this.size=0}Mc.exports=MO});var Dc=l((hB,Fc)=>{"use strict";function wO(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}Fc.exports=wO});var jc=l((vB,Uc)=>{"use strict";function FO(e){return this.__data__.get(e)}Uc.exports=FO});var Gc=l((mB,Bc)=>{"use strict";function DO(e){return this.__data__.has(e)}Bc.exports=DO});var rn=l((yB,Wc)=>{"use strict";var UO=ft(),jO=UO(Object,"create");Wc.exports=jO});var Kc=l((gB,Hc)=>{"use strict";var Vc=rn();function BO(){this.__data__=Vc?Vc(null):{},this.size=0}Hc.exports=BO});var Yc=l((_B,zc)=>{"use strict";function GO(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}zc.exports=GO});var $c=l((EB,Xc)=>{"use strict";var WO=rn(),VO="__lodash_hash_undefined__",HO=Object.prototype,KO=HO.hasOwnProperty;function zO(e){var t=this.__data__;if(WO){var r=t[e];return r===VO?void 0:r}return KO.call(t,e)?t[e]:void 0}Xc.exports=zO});var Jc=l((TB,Zc)=>{"use strict";var YO=rn(),XO=Object.prototype,$O=XO.hasOwnProperty;function ZO(e){var t=this.__data__;return YO?t[e]!==void 0:$O.call(t,e)}Zc.exports=ZO});var el=l((AB,Qc)=>{"use strict";var JO=rn(),QO="__lodash_hash_undefined__";function eR(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=JO&&t===void 0?QO:t,this}Qc.exports=eR});var rl=l((OB,tl)=>{"use strict";var tR=Kc(),rR=Yc(),nR=$c(),iR=Jc(),aR=el();function Zt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zt.prototype.clear=tR;Zt.prototype.delete=rR;Zt.prototype.get=nR;Zt.prototype.has=iR;Zt.prototype.set=aR;tl.exports=Zt});var al=l((RB,il)=>{"use strict";var nl=rl(),oR=tn(),sR=Yn();function uR(){this.size=0,this.__data__={hash:new nl,map:new(sR||oR),string:new nl}}il.exports=uR});var sl=l((SB,ol)=>{"use strict";function cR(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}ol.exports=cR});var nn=l((bB,ul)=>{"use strict";var lR=sl();function fR(e,t){var r=e.__data__;return lR(t)?r[typeof t=="string"?"string":"hash"]:r.map}ul.exports=fR});var ll=l((NB,cl)=>{"use strict";var pR=nn();function dR(e){var t=pR(this,e).delete(e);return this.size-=t?1:0,t}cl.exports=dR});var pl=l((IB,fl)=>{"use strict";var hR=nn();function vR(e){return hR(this,e).get(e)}fl.exports=vR});var hl=l((LB,dl)=>{"use strict";var mR=nn();function yR(e){return mR(this,e).has(e)}dl.exports=yR});var ml=l((PB,vl)=>{"use strict";var gR=nn();function _R(e,t){var r=gR(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}vl.exports=_R});var Zn=l((xB,yl)=>{"use strict";var ER=al(),TR=ll(),AR=pl(),OR=hl(),RR=ml();function Jt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Jt.prototype.clear=ER;Jt.prototype.delete=TR;Jt.prototype.get=AR;Jt.prototype.has=OR;Jt.prototype.set=RR;yl.exports=Jt});var _l=l((CB,gl)=>{"use strict";var SR=tn(),bR=Yn(),NR=Zn(),IR=200;function LR(e,t){var r=this.__data__;if(r instanceof SR){var n=r.__data__;if(!bR||n.length<IR-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new NR(n)}return r.set(e,t),this.size=r.size,this}gl.exports=LR});var Jn=l((kB,El)=>{"use strict";var PR=tn(),xR=wc(),CR=Dc(),kR=jc(),qR=Gc(),MR=_l();function Qt(e){var t=this.__data__=new PR(e);this.size=t.size}Qt.prototype.clear=xR;Qt.prototype.delete=CR;Qt.prototype.get=kR;Qt.prototype.has=qR;Qt.prototype.set=MR;El.exports=Qt});var Al=l((qB,Tl)=>{"use strict";var wR="__lodash_hash_undefined__";function FR(e){return this.__data__.set(e,wR),this}Tl.exports=FR});var Rl=l((MB,Ol)=>{"use strict";function DR(e){return this.__data__.has(e)}Ol.exports=DR});var ei=l((wB,Sl)=>{"use strict";var UR=Zn(),jR=Al(),BR=Rl();function Qn(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new UR;++t<r;)this.add(e[t])}Qn.prototype.add=Qn.prototype.push=jR;Qn.prototype.has=BR;Sl.exports=Qn});var Ja=l((FB,bl)=>{"use strict";function GR(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}bl.exports=GR});var ti=l((DB,Nl)=>{"use strict";function WR(e,t){return e.has(t)}Nl.exports=WR});var Qa=l((UB,Il)=>{"use strict";var VR=ei(),HR=Ja(),KR=ti(),zR=1,YR=2;function XR(e,t,r,n,i,a){var o=r&zR,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var c=a.get(e),f=a.get(t);if(c&&f)return c==t&&f==e;var d=-1,h=!0,m=r&YR?new VR:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var p=e[d],v=t[d];if(n)var y=o?n(v,p,d,t,e,a):n(p,v,d,e,t,a);if(y!==void 0){if(y)continue;h=!1;break}if(m){if(!HR(t,function(g,A){if(!KR(m,A)&&(p===g||i(p,g,r,n,a)))return m.push(A)})){h=!1;break}}else if(!(p===v||i(p,v,r,n,a))){h=!1;break}}return a.delete(e),a.delete(t),h}Il.exports=XR});var eo=l((jB,Ll)=>{"use strict";var $R=Ae(),ZR=$R.Uint8Array;Ll.exports=ZR});var xl=l((BB,Pl)=>{"use strict";function JR(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}Pl.exports=JR});var ri=l((GB,Cl)=>{"use strict";function QR(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}Cl.exports=QR});var Fl=l((WB,wl)=>{"use strict";var kl=St(),ql=eo(),eS=Xt(),tS=Qa(),rS=xl(),nS=ri(),iS=1,aS=2,oS="[object Boolean]",sS="[object Date]",uS="[object Error]",cS="[object Map]",lS="[object Number]",fS="[object RegExp]",pS="[object Set]",dS="[object String]",hS="[object Symbol]",vS="[object ArrayBuffer]",mS="[object DataView]",Ml=kl?kl.prototype:void 0,to=Ml?Ml.valueOf:void 0;function yS(e,t,r,n,i,a,o){switch(r){case mS:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vS:return!(e.byteLength!=t.byteLength||!a(new ql(e),new ql(t)));case oS:case sS:case lS:return eS(+e,+t);case uS:return e.name==t.name&&e.message==t.message;case fS:case dS:return e==t+"";case cS:var s=rS;case pS:var u=n&iS;if(s||(s=nS),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;n|=aS,o.set(e,t);var f=tS(s(e),s(t),n,i,a,o);return o.delete(e),f;case hS:if(to)return to.call(e)==to.call(t)}return!1}wl.exports=yS});var ni=l((VB,Dl)=>{"use strict";function gS(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}Dl.exports=gS});var ro=l((HB,Ul)=>{"use strict";var _S=ni(),ES=k();function TS(e,t,r){var n=t(e);return ES(e)?n:_S(n,r(e))}Ul.exports=TS});var ii=l((KB,jl)=>{"use strict";function AS(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}jl.exports=AS});var no=l((zB,Bl)=>{"use strict";function OS(){return[]}Bl.exports=OS});var ai=l((YB,Wl)=>{"use strict";var RS=ii(),SS=no(),bS=Object.prototype,NS=bS.propertyIsEnumerable,Gl=Object.getOwnPropertySymbols,IS=Gl?function(e){return e==null?[]:(e=Object(e),RS(Gl(e),function(t){return NS.call(e,t)}))}:SS;Wl.exports=IS});var Hl=l((XB,Vl)=>{"use strict";function LS(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}Vl.exports=LS});var an=l(($B,Kl)=>{"use strict";var PS=9007199254740991,xS=/^(?:0|[1-9]\d*)$/;function CS(e,t){var r=typeof e;return t=t??PS,!!t&&(r=="number"||r!="symbol"&&xS.test(e))&&e>-1&&e%1==0&&e<t}Kl.exports=CS});var io=l((ZB,zl)=>{"use strict";var kS=Hl(),qS=Yr(),MS=k(),wS=$r(),FS=an(),DS=$n(),US=Object.prototype,jS=US.hasOwnProperty;function BS(e,t){var r=MS(e),n=!r&&qS(e),i=!r&&!n&&wS(e),a=!r&&!n&&!i&&DS(e),o=r||n||i||a,s=o?kS(e.length,String):[],u=s.length;for(var c in e)(t||jS.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||FS(c,u)))&&s.push(c);return s}zl.exports=BS});var de=l((JB,Yl)=>{"use strict";var GS=io(),WS=Ba(),VS=Se();function HS(e){return VS(e)?GS(e):WS(e)}Yl.exports=HS});var ao=l((QB,Xl)=>{"use strict";var KS=ro(),zS=ai(),YS=de();function XS(e){return KS(e,YS,zS)}Xl.exports=XS});var Jl=l((eG,Zl)=>{"use strict";var $l=ao(),$S=1,ZS=Object.prototype,JS=ZS.hasOwnProperty;function QS(e,t,r,n,i,a){var o=r&$S,s=$l(e),u=s.length,c=$l(t),f=c.length;if(u!=f&&!o)return!1;for(var d=u;d--;){var h=s[d];if(!(o?h in t:JS.call(t,h)))return!1}var m=a.get(e),p=a.get(t);if(m&&p)return m==t&&p==e;var v=!0;a.set(e,t),a.set(t,e);for(var y=o;++d<u;){h=s[d];var g=e[h],A=t[h];if(n)var _=o?n(A,g,h,t,e,a):n(g,A,h,e,t,a);if(!(_===void 0?g===A||i(g,A,r,n,a):_)){v=!1;break}y||(y=h=="constructor")}if(v&&!y){var S=e.constructor,Y=t.constructor;S!=Y&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof Y=="function"&&Y instanceof Y)&&(v=!1)}return a.delete(e),a.delete(t),v}Zl.exports=QS});var sf=l((tG,of)=>{"use strict";var oo=Jn(),eb=Qa(),tb=Fl(),rb=Jl(),Ql=Vt(),ef=k(),tf=$r(),nb=$n(),ib=1,rf="[object Arguments]",nf="[object Array]",oi="[object Object]",ab=Object.prototype,af=ab.hasOwnProperty;function ob(e,t,r,n,i,a){var o=ef(e),s=ef(t),u=o?nf:Ql(e),c=s?nf:Ql(t);u=u==rf?oi:u,c=c==rf?oi:c;var f=u==oi,d=c==oi,h=u==c;if(h&&tf(e)){if(!tf(t))return!1;o=!0,f=!1}if(h&&!f)return a||(a=new oo),o||nb(e)?eb(e,t,r,n,i,a):tb(e,t,u,r,n,i,a);if(!(r&ib)){var m=f&&af.call(e,"__wrapped__"),p=d&&af.call(t,"__wrapped__");if(m||p){var v=m?e.value():e,y=p?t.value():t;return a||(a=new oo),i(v,y,r,n,a)}}return h?(a||(a=new oo),rb(e,t,r,n,i,a)):!1}of.exports=ob});var so=l((rG,lf)=>{"use strict";var sb=sf(),uf=Re();function cf(e,t,r,n,i){return e===t?!0:e==null||t==null||!uf(e)&&!uf(t)?e!==e&&t!==t:sb(e,t,r,n,cf,i)}lf.exports=cf});var pf=l((nG,ff)=>{"use strict";var ub=Jn(),cb=so(),lb=1,fb=2;function pb(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var s=r[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=r[i];var u=s[0],c=e[u],f=s[1];if(o&&s[2]){if(c===void 0&&!(u in e))return!1}else{var d=new ub;if(n)var h=n(c,f,u,e,t,d);if(!(h===void 0?cb(f,c,lb|fb,n,d):h))return!1}}return!0}ff.exports=pb});var uo=l((iG,df)=>{"use strict";var db=Oe();function hb(e){return e===e&&!db(e)}df.exports=hb});var vf=l((aG,hf)=>{"use strict";var vb=uo(),mb=de();function yb(e){for(var t=mb(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,vb(i)]}return t}hf.exports=yb});var co=l((oG,mf)=>{"use strict";function gb(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}mf.exports=gb});var gf=l((sG,yf)=>{"use strict";var _b=pf(),Eb=vf(),Tb=co();function Ab(e){var t=Eb(e);return t.length==1&&t[0][2]?Tb(t[0][0],t[0][1]):function(r){return r===e||_b(r,e,t)}}yf.exports=Ab});var on=l((uG,_f)=>{"use strict";var Ob=lt(),Rb=Re(),Sb="[object Symbol]";function bb(e){return typeof e=="symbol"||Rb(e)&&Ob(e)==Sb}_f.exports=bb});var si=l((cG,Ef)=>{"use strict";var Nb=k(),Ib=on(),Lb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pb=/^\w*$/;function xb(e,t){if(Nb(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Ib(e)?!0:Pb.test(e)||!Lb.test(e)||t!=null&&e in Object(t)}Ef.exports=xb});var Of=l((lG,Af)=>{"use strict";var Tf=Zn(),Cb="Expected a function";function lo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Cb);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(lo.Cache||Tf),r}lo.Cache=Tf;Af.exports=lo});var Sf=l((fG,Rf)=>{"use strict";var kb=Of(),qb=500;function Mb(e){var t=kb(e,function(n){return r.size===qb&&r.clear(),n}),r=t.cache;return t}Rf.exports=Mb});var Nf=l((pG,bf)=>{"use strict";var wb=Sf(),Fb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Db=/\\(\\)?/g,Ub=wb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Fb,function(r,n,i,a){t.push(i?a.replace(Db,"$1"):n||r)}),t});bf.exports=Ub});var kf=l((dG,Cf)=>{"use strict";var If=St(),jb=Yt(),Bb=k(),Gb=on(),Wb=1/0,Lf=If?If.prototype:void 0,Pf=Lf?Lf.toString:void 0;function xf(e){if(typeof e=="string")return e;if(Bb(e))return jb(e,xf)+"";if(Gb(e))return Pf?Pf.call(e):"";var t=e+"";return t=="0"&&1/e==-Wb?"-0":t}Cf.exports=xf});var fo=l((hG,qf)=>{"use strict";var Vb=kf();function Hb(e){return e==null?"":Vb(e)}qf.exports=Hb});var sn=l((vG,Mf)=>{"use strict";var Kb=k(),zb=si(),Yb=Nf(),Xb=fo();function $b(e,t){return Kb(e)?e:zb(e,t)?[e]:Yb(Xb(e))}Mf.exports=$b});var er=l((mG,wf)=>{"use strict";var Zb=on(),Jb=1/0;function Qb(e){if(typeof e=="string"||Zb(e))return e;var t=e+"";return t=="0"&&1/e==-Jb?"-0":t}wf.exports=Qb});var ui=l((yG,Ff)=>{"use strict";var eN=sn(),tN=er();function rN(e,t){t=eN(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[tN(t[r++])];return r&&r==n?e:void 0}Ff.exports=rN});var Uf=l((gG,Df)=>{"use strict";var nN=ui();function iN(e,t,r){var n=e==null?void 0:nN(e,t);return n===void 0?r:n}Df.exports=iN});var Bf=l((_G,jf)=>{"use strict";function aN(e,t){return e!=null&&t in Object(e)}jf.exports=aN});var po=l((EG,Gf)=>{"use strict";var oN=sn(),sN=Yr(),uN=k(),cN=an(),lN=Xn(),fN=er();function pN(e,t,r){t=oN(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=fN(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&lN(i)&&cN(o,i)&&(uN(e)||sN(e)))}Gf.exports=pN});var Vf=l((TG,Wf)=>{"use strict";var dN=Bf(),hN=po();function vN(e,t){return e!=null&&hN(e,t,dN)}Wf.exports=vN});var Kf=l((AG,Hf)=>{"use strict";var mN=so(),yN=Uf(),gN=Vf(),_N=si(),EN=uo(),TN=co(),AN=er(),ON=1,RN=2;function SN(e,t){return _N(e)&&EN(t)?TN(AN(e),t):function(r){var n=yN(r,e);return n===void 0&&n===t?gN(r,e):mN(t,n,ON|RN)}}Hf.exports=SN});var tr=l((OG,zf)=>{"use strict";function bN(e){return e}zf.exports=bN});var Xf=l((RG,Yf)=>{"use strict";function NN(e){return function(t){return t?.[e]}}Yf.exports=NN});var Zf=l((SG,$f)=>{"use strict";var IN=ui();function LN(e){return function(t){return IN(t,e)}}$f.exports=LN});var Qf=l((bG,Jf)=>{"use strict";var PN=Xf(),xN=Zf(),CN=si(),kN=er();function qN(e){return CN(e)?PN(kN(e)):xN(e)}Jf.exports=qN});var be=l((NG,ep)=>{"use strict";var MN=gf(),wN=Kf(),FN=tr(),DN=k(),UN=Qf();function jN(e){return typeof e=="function"?e:e==null?FN:typeof e=="object"?DN(e)?wN(e[0],e[1]):MN(e):UN(e)}ep.exports=jN});var rp=l((IG,tp)=>{"use strict";function BN(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(r(a[u],u,a)===!1)break}return t}}tp.exports=BN});var ip=l((LG,np)=>{"use strict";var GN=rp(),WN=GN();np.exports=WN});var op=l((PG,ap)=>{"use strict";var VN=ip(),HN=de();function KN(e,t){return e&&VN(e,t,HN)}ap.exports=KN});var up=l((xG,sp)=>{"use strict";var zN=Se();function YN(e,t){return function(r,n){if(r==null)return r;if(!zN(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}sp.exports=YN});var pt=l((CG,cp)=>{"use strict";var XN=op(),$N=up(),ZN=$N(XN);cp.exports=ZN});var fp=l((kG,lp)=>{"use strict";var JN=pt(),QN=Se();function eI(e,t){var r=-1,n=QN(e)?Array(e.length):[];return JN(e,function(i,a,o){n[++r]=t(i,a,o)}),n}lp.exports=eI});var re=l((qG,pp)=>{"use strict";var tI=Yt(),rI=be(),nI=fp(),iI=k();function aI(e,t){var r=iI(e)?tI:nI;return r(e,rI(t,3))}pp.exports=aI});var ho=l((MG,dp)=>{"use strict";function oI(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}dp.exports=oI});var vp=l((wG,hp)=>{"use strict";var sI=tr();function uI(e){return typeof e=="function"?e:sI}hp.exports=uI});var $=l((FG,mp)=>{"use strict";var cI=ho(),lI=pt(),fI=vp(),pI=k();function dI(e,t){var r=pI(e)?cI:lI;return r(e,fI(t))}mp.exports=dI});var gp=l((DG,yp)=>{"use strict";var hI=Yt();function vI(e,t){return hI(t,function(r){return e[r]})}yp.exports=vI});var Ce=l((UG,_p)=>{"use strict";var mI=gp(),yI=de();function gI(e){return e==null?[]:mI(e,yI(e))}_p.exports=gI});var Tp=l((jG,Ep)=>{"use strict";var _I=Object.prototype,EI=_I.hasOwnProperty;function TI(e,t){return e!=null&&EI.call(e,t)}Ep.exports=TI});var he=l((BG,Ap)=>{"use strict";var AI=Tp(),OI=po();function RI(e,t){return e!=null&&OI(e,t,AI)}Ap.exports=RI});var vo=l((GG,Op)=>{"use strict";var SI=ft(),bI=function(){try{var e=SI(Object,"defineProperty");return e({},"",{}),e}catch{}}();Op.exports=bI});var ci=l((WG,Sp)=>{"use strict";var Rp=vo();function NI(e,t,r){t=="__proto__"&&Rp?Rp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}Sp.exports=NI});var un=l((VG,bp)=>{"use strict";var II=ci(),LI=Xt(),PI=Object.prototype,xI=PI.hasOwnProperty;function CI(e,t,r){var n=e[t];(!(xI.call(e,t)&&LI(n,r))||r===void 0&&!(t in e))&&II(e,t,r)}bp.exports=CI});var rr=l((HG,Np)=>{"use strict";var kI=un(),qI=ci();function MI(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;u===void 0&&(u=e[s]),i?qI(r,s,u):kI(r,s,u)}return r}Np.exports=MI});var Lp=l((KG,Ip)=>{"use strict";var wI=rr(),FI=de();function DI(e,t){return e&&wI(t,FI(t),e)}Ip.exports=DI});var xp=l((zG,Pp)=>{"use strict";function UI(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}Pp.exports=UI});var kp=l((YG,Cp)=>{"use strict";var jI=Oe(),BI=Bt(),GI=xp(),WI=Object.prototype,VI=WI.hasOwnProperty;function HI(e){if(!jI(e))return GI(e);var t=BI(e),r=[];for(var n in e)n=="constructor"&&(t||!VI.call(e,n))||r.push(n);return r}Cp.exports=HI});var cn=l((XG,qp)=>{"use strict";var KI=io(),zI=kp(),YI=Se();function XI(e){return YI(e)?KI(e,!0):zI(e)}qp.exports=XI});var wp=l(($G,Mp)=>{"use strict";var $I=rr(),ZI=cn();function JI(e,t){return e&&$I(t,ZI(t),e)}Mp.exports=JI});var Bp=l((ln,nr)=>{"use strict";var QI=Ae(),jp=typeof ln=="object"&&ln&&!ln.nodeType&&ln,Fp=jp&&typeof nr=="object"&&nr&&!nr.nodeType&&nr,eL=Fp&&Fp.exports===jp,Dp=eL?QI.Buffer:void 0,Up=Dp?Dp.allocUnsafe:void 0;function tL(e,t){if(t)return e.slice();var r=e.length,n=Up?Up(r):new e.constructor(r);return e.copy(n),n}nr.exports=tL});var Wp=l((ZG,Gp)=>{"use strict";function rL(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}Gp.exports=rL});var Hp=l((JG,Vp)=>{"use strict";var nL=rr(),iL=ai();function aL(e,t){return nL(e,iL(e),t)}Vp.exports=aL});var mo=l((QG,Kp)=>{"use strict";var oL=ja(),sL=oL(Object.getPrototypeOf,Object);Kp.exports=sL});var yo=l((eW,zp)=>{"use strict";var uL=ni(),cL=mo(),lL=ai(),fL=no(),pL=Object.getOwnPropertySymbols,dL=pL?function(e){for(var t=[];e;)uL(t,lL(e)),e=cL(e);return t}:fL;zp.exports=dL});var Xp=l((tW,Yp)=>{"use strict";var hL=rr(),vL=yo();function mL(e,t){return hL(e,vL(e),t)}Yp.exports=mL});var go=l((rW,$p)=>{"use strict";var yL=ro(),gL=yo(),_L=cn();function EL(e){return yL(e,_L,gL)}$p.exports=EL});var Jp=l((nW,Zp)=>{"use strict";var TL=Object.prototype,AL=TL.hasOwnProperty;function OL(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&AL.call(e,"index")&&(r.index=e.index,r.input=e.input),r}Zp.exports=OL});var li=l((iW,ed)=>{"use strict";var Qp=eo();function RL(e){var t=new e.constructor(e.byteLength);return new Qp(t).set(new Qp(e)),t}ed.exports=RL});var rd=l((aW,td)=>{"use strict";var SL=li();function bL(e,t){var r=t?SL(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}td.exports=bL});var id=l((oW,nd)=>{"use strict";var NL=/\w*$/;function IL(e){var t=new e.constructor(e.source,NL.exec(e));return t.lastIndex=e.lastIndex,t}nd.exports=IL});var cd=l((sW,ud)=>{"use strict";var ad=St(),od=ad?ad.prototype:void 0,sd=od?od.valueOf:void 0;function LL(e){return sd?Object(sd.call(e)):{}}ud.exports=LL});var fd=l((uW,ld)=>{"use strict";var PL=li();function xL(e,t){var r=t?PL(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}ld.exports=xL});var dd=l((cW,pd)=>{"use strict";var CL=li(),kL=rd(),qL=id(),ML=cd(),wL=fd(),FL="[object Boolean]",DL="[object Date]",UL="[object Map]",jL="[object Number]",BL="[object RegExp]",GL="[object Set]",WL="[object String]",VL="[object Symbol]",HL="[object ArrayBuffer]",KL="[object DataView]",zL="[object Float32Array]",YL="[object Float64Array]",XL="[object Int8Array]",$L="[object Int16Array]",ZL="[object Int32Array]",JL="[object Uint8Array]",QL="[object Uint8ClampedArray]",e0="[object Uint16Array]",t0="[object Uint32Array]";function r0(e,t,r){var n=e.constructor;switch(t){case HL:return CL(e);case FL:case DL:return new n(+e);case KL:return kL(e,r);case zL:case YL:case XL:case $L:case ZL:case JL:case QL:case e0:case t0:return wL(e,r);case UL:return new n;case jL:case WL:return new n(e);case BL:return qL(e);case GL:return new n;case VL:return ML(e)}}pd.exports=r0});var md=l((lW,vd)=>{"use strict";var n0=Oe(),hd=Object.create,i0=function(){function e(){}return function(t){if(!n0(t))return{};if(hd)return hd(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();vd.exports=i0});var gd=l((fW,yd)=>{"use strict";var a0=md(),o0=mo(),s0=Bt();function u0(e){return typeof e.constructor=="function"&&!s0(e)?a0(o0(e)):{}}yd.exports=u0});var Ed=l((pW,_d)=>{"use strict";var c0=Vt(),l0=Re(),f0="[object Map]";function p0(e){return l0(e)&&c0(e)==f0}_d.exports=p0});var Rd=l((dW,Od)=>{"use strict";var d0=Ed(),h0=Kt(),Td=Qr(),Ad=Td&&Td.isMap,v0=Ad?h0(Ad):d0;Od.exports=v0});var bd=l((hW,Sd)=>{"use strict";var m0=Vt(),y0=Re(),g0="[object Set]";function _0(e){return y0(e)&&m0(e)==g0}Sd.exports=_0});var Pd=l((vW,Ld)=>{"use strict";var E0=bd(),T0=Kt(),Nd=Qr(),Id=Nd&&Nd.isSet,A0=Id?T0(Id):E0;Ld.exports=A0});var Md=l((mW,qd)=>{"use strict";var O0=Jn(),R0=ho(),S0=un(),b0=Lp(),N0=wp(),I0=Bp(),L0=Wp(),P0=Hp(),x0=Xp(),C0=ao(),k0=go(),q0=Vt(),M0=Jp(),w0=dd(),F0=gd(),D0=k(),U0=$r(),j0=Rd(),B0=Oe(),G0=Pd(),W0=de(),V0=cn(),H0=1,K0=2,z0=4,xd="[object Arguments]",Y0="[object Array]",X0="[object Boolean]",$0="[object Date]",Z0="[object Error]",Cd="[object Function]",J0="[object GeneratorFunction]",Q0="[object Map]",eP="[object Number]",kd="[object Object]",tP="[object RegExp]",rP="[object Set]",nP="[object String]",iP="[object Symbol]",aP="[object WeakMap]",oP="[object ArrayBuffer]",sP="[object DataView]",uP="[object Float32Array]",cP="[object Float64Array]",lP="[object Int8Array]",fP="[object Int16Array]",pP="[object Int32Array]",dP="[object Uint8Array]",hP="[object Uint8ClampedArray]",vP="[object Uint16Array]",mP="[object Uint32Array]",F={};F[xd]=F[Y0]=F[oP]=F[sP]=F[X0]=F[$0]=F[uP]=F[cP]=F[lP]=F[fP]=F[pP]=F[Q0]=F[eP]=F[kd]=F[tP]=F[rP]=F[nP]=F[iP]=F[dP]=F[hP]=F[vP]=F[mP]=!0;F[Z0]=F[Cd]=F[aP]=!1;function fi(e,t,r,n,i,a){var o,s=t&H0,u=t&K0,c=t&z0;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!B0(e))return e;var f=D0(e);if(f){if(o=M0(e),!s)return L0(e,o)}else{var d=q0(e),h=d==Cd||d==J0;if(U0(e))return I0(e,s);if(d==kd||d==xd||h&&!i){if(o=u||h?{}:F0(e),!s)return u?x0(e,N0(o,e)):P0(e,b0(o,e))}else{if(!F[d])return i?e:{};o=w0(e,d,s)}}a||(a=new O0);var m=a.get(e);if(m)return m;a.set(e,o),G0(e)?e.forEach(function(y){o.add(fi(y,t,r,y,e,a))}):j0(e)&&e.forEach(function(y,g){o.set(g,fi(y,t,r,g,e,a))});var p=c?u?k0:C0:u?V0:W0,v=f?void 0:p(e);return R0(v||e,function(y,g){v&&(g=y,y=e[g]),S0(o,g,fi(y,t,r,g,e,a))}),o}qd.exports=fi});var Xe=l((yW,wd)=>{"use strict";var yP=Md(),gP=4;function _P(e){return yP(e,gP)}wd.exports=_P});var Fd=l(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.PRINT_WARNING=ir.PRINT_ERROR=void 0;function EP(e){console&&console.error&&console.error("Error: ".concat(e))}ir.PRINT_ERROR=EP;function TP(e){console&&console.warn&&console.warn("Warning: ".concat(e))}ir.PRINT_WARNING=TP});var Dd=l(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.timer=void 0;function AP(e){var t=new Date().getTime(),r=e(),n=new Date().getTime(),i=n-t;return{time:i,value:r}}pi.timer=AP});var Ud=l((exports,module)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.toFastProperties=void 0;function toFastProperties(toBecomeFast){function FakeConstructor(){}FakeConstructor.prototype=toBecomeFast;var fakeInstance=new FakeConstructor;function fakeAccess(){return typeof fakeInstance.bar}return fakeAccess(),fakeAccess(),toBecomeFast;eval(toBecomeFast)}exports.toFastProperties=toFastProperties});var ar=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.toFastProperties=ke.timer=ke.PRINT_ERROR=ke.PRINT_WARNING=void 0;var jd=Fd();Object.defineProperty(ke,"PRINT_WARNING",{enumerable:!0,get:function(){return jd.PRINT_WARNING}});Object.defineProperty(ke,"PRINT_ERROR",{enumerable:!0,get:function(){return jd.PRINT_ERROR}});var OP=Dd();Object.defineProperty(ke,"timer",{enumerable:!0,get:function(){return OP.timer}});var RP=Ud();Object.defineProperty(ke,"toFastProperties",{enumerable:!0,get:function(){return RP.toFastProperties}})});var di=l((TW,Bd)=>{"use strict";function SP(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}Bd.exports=SP});var Wd=l((AW,Gd)=>{"use strict";var bP=/\s/;function NP(e){for(var t=e.length;t--&&bP.test(e.charAt(t)););return t}Gd.exports=NP});var Hd=l((OW,Vd)=>{"use strict";var IP=Wd(),LP=/^\s+/;function PP(e){return e&&e.slice(0,IP(e)+1).replace(LP,"")}Vd.exports=PP});var Xd=l((RW,Yd)=>{"use strict";var xP=Hd(),Kd=Oe(),CP=on(),zd=NaN,kP=/^[-+]0x[0-9a-f]+$/i,qP=/^0b[01]+$/i,MP=/^0o[0-7]+$/i,wP=parseInt;function FP(e){if(typeof e=="number")return e;if(CP(e))return zd;if(Kd(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kd(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xP(e);var r=qP.test(e);return r||MP.test(e)?wP(e.slice(2),r?2:8):kP.test(e)?zd:+e}Yd.exports=FP});var Jd=l((SW,Zd)=>{"use strict";var DP=Xd(),$d=1/0,UP=17976931348623157e292;function jP(e){if(!e)return e===0?e:0;if(e=DP(e),e===$d||e===-$d){var t=e<0?-1:1;return t*UP}return e===e?e:0}Zd.exports=jP});var or=l((bW,Qd)=>{"use strict";var BP=Jd();function GP(e){var t=BP(e),r=t%1;return t===t?r?t-r:t:0}Qd.exports=GP});var hi=l((NW,eh)=>{"use strict";var WP=di(),VP=or();function HP(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:VP(t),WP(e,t<0?0:t,n)):[]}eh.exports=HP});var fn=l((IW,th)=>{"use strict";var KP=lt(),zP=k(),YP=Re(),XP="[object String]";function $P(e){return typeof e=="string"||!zP(e)&&YP(e)&&KP(e)==XP}th.exports=$P});var nh=l((LW,rh)=>{"use strict";var ZP=lt(),JP=Re(),QP="[object RegExp]";function ex(e){return JP(e)&&ZP(e)==QP}rh.exports=ex});var _o=l((PW,oh)=>{"use strict";var tx=nh(),rx=Kt(),ih=Qr(),ah=ih&&ih.isRegExp,nx=ah?rx(ah):tx;oh.exports=nx});var ch=l((xW,uh)=>{"use strict";var ix=un(),ax=sn(),ox=an(),sh=Oe(),sx=er();function ux(e,t,r,n){if(!sh(e))return e;t=ax(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var u=sx(t[i]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var f=s[u];c=n?n(f,u,s):void 0,c===void 0&&(c=sh(f)?f:ox(t[i+1])?[]:{})}ix(s,u,c),s=s[u]}return e}uh.exports=ux});var fh=l((CW,lh)=>{"use strict";var cx=ui(),lx=ch(),fx=sn();function px(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],s=cx(e,o);r(s,o)&&lx(a,fx(o,e),s)}return a}lh.exports=px});var Eo=l((kW,ph)=>{"use strict";var dx=Yt(),hx=be(),vx=fh(),mx=go();function yx(e,t){if(e==null)return{};var r=dx(mx(e),function(n){return[n]});return t=hx(t),vx(e,r,function(n,i){return t(n,i[0])})}ph.exports=yx});var hh=l((qW,dh)=>{"use strict";function gx(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}dh.exports=gx});var yh=l((MW,mh)=>{"use strict";var _x=hh(),vh=Math.max;function Ex(e,t,r){return t=vh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=vh(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),_x(e,this,s)}}mh.exports=Ex});var _h=l((wW,gh)=>{"use strict";function Tx(e){return function(){return e}}gh.exports=Tx});var Ah=l((FW,Th)=>{"use strict";var Ax=_h(),Eh=vo(),Ox=tr(),Rx=Eh?function(e,t){return Eh(e,"toString",{configurable:!0,enumerable:!1,value:Ax(t),writable:!0})}:Ox;Th.exports=Rx});var Rh=l((DW,Oh)=>{"use strict";var Sx=800,bx=16,Nx=Date.now;function Ix(e){var t=0,r=0;return function(){var n=Nx(),i=bx-(n-r);if(r=n,i>0){if(++t>=Sx)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}Oh.exports=Ix});var bh=l((UW,Sh)=>{"use strict";var Lx=Ah(),Px=Rh(),xx=Px(Lx);Sh.exports=xx});var vi=l((jW,Nh)=>{"use strict";var Cx=tr(),kx=yh(),qx=bh();function Mx(e,t){return qx(kx(e,t,Cx),e+"")}Nh.exports=Mx});var pn=l((BW,Ih)=>{"use strict";var wx=Xt(),Fx=Se(),Dx=an(),Ux=Oe();function jx(e,t,r){if(!Ux(r))return!1;var n=typeof t;return(n=="number"?Fx(r)&&Dx(t,r.length):n=="string"&&t in r)?wx(r[t],e):!1}Ih.exports=jx});var Ph=l((GW,Lh)=>{"use strict";var Bx=vi(),Gx=pn();function Wx(e){return Bx(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&Gx(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t})}Lh.exports=Wx});var dn=l((WW,xh)=>{"use strict";var Vx=un(),Hx=rr(),Kx=Ph(),zx=Se(),Yx=Bt(),Xx=de(),$x=Object.prototype,Zx=$x.hasOwnProperty,Jx=Kx(function(e,t){if(Yx(t)||zx(t)){Hx(t,Xx(t),e);return}for(var r in t)Zx.call(t,r)&&Vx(e,r,t[r])});xh.exports=Jx});var yi=l(P=>{"use strict";var $e=P&&P.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),sr=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P,"__esModule",{value:!0});P.serializeProduction=P.serializeGrammar=P.Terminal=P.Alternation=P.RepetitionWithSeparator=P.Repetition=P.RepetitionMandatoryWithSeparator=P.RepetitionMandatory=P.Option=P.Alternative=P.Rule=P.NonTerminal=P.AbstractProduction=void 0;var Ch=sr(re()),Qx=sr($()),To=sr(fn()),eC=sr(_o()),qe=sr(Eo()),Me=sr(dn());function tC(e){return rC(e)?e.LABEL:e.name}function rC(e){return(0,To.default)(e.LABEL)&&e.LABEL!==""}var we=function(){function e(t){this._definition=t}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this),(0,Qx.default)(this.definition,function(r){r.accept(t)})},e}();P.AbstractProduction=we;var kh=function(e){$e(t,e);function t(r){var n=e.call(this,[])||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return Object.defineProperty(t.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(r){},enumerable:!1,configurable:!0}),t.prototype.accept=function(r){r.visit(this)},t}(we);P.NonTerminal=kh;var qh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.orgText="",(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.Rule=qh;var Mh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.ignoreAmbiguities=!1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.Alternative=Mh;var wh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.Option=wh;var Fh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.RepetitionMandatory=Fh;var Dh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.RepetitionMandatoryWithSeparator=Dh;var Uh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.Repetition=Uh;var jh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return t}(we);P.RepetitionWithSeparator=jh;var Bh=function(e){$e(t,e);function t(r){var n=e.call(this,r.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,(0,Me.default)(n,(0,qe.default)(r,function(i){return i!==void 0})),n}return Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(r){this._definition=r},enumerable:!1,configurable:!0}),t}(we);P.Alternation=Bh;var mi=function(){function e(t){this.idx=1,(0,Me.default)(this,(0,qe.default)(t,function(r){return r!==void 0}))}return e.prototype.accept=function(t){t.visit(this)},e}();P.Terminal=mi;function nC(e){return(0,Ch.default)(e,hn)}P.serializeGrammar=nC;function hn(e){function t(a){return(0,Ch.default)(a,hn)}if(e instanceof kh){var r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,To.default)(e.label)&&(r.label=e.label),r}else{if(e instanceof Mh)return{type:"Alternative",definition:t(e.definition)};if(e instanceof wh)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Fh)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Dh)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:hn(new mi({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof jh)return{type:"RepetitionWithSeparator",idx:e.idx,separator:hn(new mi({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Uh)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Bh)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof mi){var n={type:"Terminal",name:e.terminalType.name,label:tC(e.terminalType),idx:e.idx};(0,To.default)(e.label)&&(n.terminalLabel=e.label);var i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=(0,eC.default)(i)?i.source:i),n}else{if(e instanceof qh)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}P.serializeProduction=hn});var Gh=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.GAstVisitor=void 0;var Fe=yi(),iC=function(){function e(){}return e.prototype.visit=function(t){var r=t;switch(r.constructor){case Fe.NonTerminal:return this.visitNonTerminal(r);case Fe.Alternative:return this.visitAlternative(r);case Fe.Option:return this.visitOption(r);case Fe.RepetitionMandatory:return this.visitRepetitionMandatory(r);case Fe.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(r);case Fe.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(r);case Fe.Repetition:return this.visitRepetition(r);case Fe.Alternation:return this.visitAlternation(r);case Fe.Terminal:return this.visitTerminal(r);case Fe.Rule:return this.visitRule(r);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(t){},e.prototype.visitAlternative=function(t){},e.prototype.visitOption=function(t){},e.prototype.visitRepetition=function(t){},e.prototype.visitRepetitionMandatory=function(t){},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){},e.prototype.visitRepetitionWithSeparator=function(t){},e.prototype.visitAlternation=function(t){},e.prototype.visitTerminal=function(t){},e.prototype.visitRule=function(t){},e}();gi.GAstVisitor=iC});var Vh=l((KW,Wh)=>{"use strict";var aC=pt();function oC(e,t){var r;return aC(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}Wh.exports=oC});var _i=l((zW,Hh)=>{"use strict";var sC=Ja(),uC=be(),cC=Vh(),lC=k(),fC=pn();function pC(e,t,r){var n=lC(e)?sC:cC;return r&&fC(e,t,r)&&(t=void 0),n(e,uC(t,3))}Hh.exports=pC});var zh=l((YW,Kh)=>{"use strict";function dC(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}Kh.exports=dC});var Xh=l((XW,Yh)=>{"use strict";var hC=pt();function vC(e,t){var r=!0;return hC(e,function(n,i,a){return r=!!t(n,i,a),r}),r}Yh.exports=vC});var vn=l(($W,$h)=>{"use strict";var mC=zh(),yC=Xh(),gC=be(),_C=k(),EC=pn();function TC(e,t,r){var n=_C(e)?mC:yC;return r&&EC(e,t,r)&&(t=void 0),n(e,gC(t,3))}$h.exports=TC});var Ao=l((ZW,Zh)=>{"use strict";function AC(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}Zh.exports=AC});var Qh=l((JW,Jh)=>{"use strict";function OC(e){return e!==e}Jh.exports=OC});var tv=l((QW,ev)=>{"use strict";function RC(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}ev.exports=RC});var Ei=l((eV,rv)=>{"use strict";var SC=Ao(),bC=Qh(),NC=tv();function IC(e,t,r){return t===t?NC(e,t,r):SC(e,bC,r)}rv.exports=IC});var Ze=l((tV,nv)=>{"use strict";var LC=Ei(),PC=Se(),xC=fn(),CC=or(),kC=Ce(),qC=Math.max;function MC(e,t,r,n){e=PC(e)?e:kC(e),r=r&&!n?CC(r):0;var i=e.length;return r<0&&(r=qC(i+r,0)),xC(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&LC(e,t,r)>-1}nv.exports=MC});var iv=l(ge=>{"use strict";var Ro=ge&&ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ge,"__esModule",{value:!0});ge.getProductionDslName=ge.isBranchingProd=ge.isOptionalProd=ge.isSequenceProd=void 0;var wC=Ro(_i()),FC=Ro(vn()),DC=Ro(Ze()),U=yi();function UC(e){return e instanceof U.Alternative||e instanceof U.Option||e instanceof U.Repetition||e instanceof U.RepetitionMandatory||e instanceof U.RepetitionMandatoryWithSeparator||e instanceof U.RepetitionWithSeparator||e instanceof U.Terminal||e instanceof U.Rule}ge.isSequenceProd=UC;function Oo(e,t){t===void 0&&(t=[]);var r=e instanceof U.Option||e instanceof U.Repetition||e instanceof U.RepetitionWithSeparator;return r?!0:e instanceof U.Alternation?(0,wC.default)(e.definition,function(n){return Oo(n,t)}):e instanceof U.NonTerminal&&(0,DC.default)(t,e)?!1:e instanceof U.AbstractProduction?(e instanceof U.NonTerminal&&t.push(e),(0,FC.default)(e.definition,function(n){return Oo(n,t)})):!1}ge.isOptionalProd=Oo;function jC(e){return e instanceof U.Alternation}ge.isBranchingProd=jC;function BC(e){if(e instanceof U.NonTerminal)return"SUBRULE";if(e instanceof U.Option)return"OPTION";if(e instanceof U.Alternation)return"OR";if(e instanceof U.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof U.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof U.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof U.Repetition)return"MANY";if(e instanceof U.Terminal)return"CONSUME";throw Error("non exhaustive match")}ge.getProductionDslName=BC});var W=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.isSequenceProd=N.isBranchingProd=N.isOptionalProd=N.getProductionDslName=N.GAstVisitor=N.serializeProduction=N.serializeGrammar=N.Alternative=N.Alternation=N.RepetitionWithSeparator=N.RepetitionMandatoryWithSeparator=N.RepetitionMandatory=N.Repetition=N.Option=N.NonTerminal=N.Terminal=N.Rule=void 0;var _e=yi();Object.defineProperty(N,"Rule",{enumerable:!0,get:function(){return _e.Rule}});Object.defineProperty(N,"Terminal",{enumerable:!0,get:function(){return _e.Terminal}});Object.defineProperty(N,"NonTerminal",{enumerable:!0,get:function(){return _e.NonTerminal}});Object.defineProperty(N,"Option",{enumerable:!0,get:function(){return _e.Option}});Object.defineProperty(N,"Repetition",{enumerable:!0,get:function(){return _e.Repetition}});Object.defineProperty(N,"RepetitionMandatory",{enumerable:!0,get:function(){return _e.RepetitionMandatory}});Object.defineProperty(N,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return _e.RepetitionMandatoryWithSeparator}});Object.defineProperty(N,"RepetitionWithSeparator",{enumerable:!0,get:function(){return _e.RepetitionWithSeparator}});Object.defineProperty(N,"Alternation",{enumerable:!0,get:function(){return _e.Alternation}});Object.defineProperty(N,"Alternative",{enumerable:!0,get:function(){return _e.Alternative}});Object.defineProperty(N,"serializeGrammar",{enumerable:!0,get:function(){return _e.serializeGrammar}});Object.defineProperty(N,"serializeProduction",{enumerable:!0,get:function(){return _e.serializeProduction}});var GC=Gh();Object.defineProperty(N,"GAstVisitor",{enumerable:!0,get:function(){return GC.GAstVisitor}});var Ti=iv();Object.defineProperty(N,"getProductionDslName",{enumerable:!0,get:function(){return Ti.getProductionDslName}});Object.defineProperty(N,"isOptionalProd",{enumerable:!0,get:function(){return Ti.isOptionalProd}});Object.defineProperty(N,"isBranchingProd",{enumerable:!0,get:function(){return Ti.isBranchingProd}});Object.defineProperty(N,"isSequenceProd",{enumerable:!0,get:function(){return Ti.isSequenceProd}})});var Ai=l(ur=>{"use strict";var sv=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.RestWalker=void 0;var WC=sv(hi()),av=sv($()),oe=W(),VC=function(){function e(){}return e.prototype.walk=function(t,r){var n=this;r===void 0&&(r=[]),(0,av.default)(t.definition,function(i,a){var o=(0,WC.default)(t.definition,a+1);if(i instanceof oe.NonTerminal)n.walkProdRef(i,o,r);else if(i instanceof oe.Terminal)n.walkTerminal(i,o,r);else if(i instanceof oe.Alternative)n.walkFlat(i,o,r);else if(i instanceof oe.Option)n.walkOption(i,o,r);else if(i instanceof oe.RepetitionMandatory)n.walkAtLeastOne(i,o,r);else if(i instanceof oe.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(i,o,r);else if(i instanceof oe.RepetitionWithSeparator)n.walkManySep(i,o,r);else if(i instanceof oe.Repetition)n.walkMany(i,o,r);else if(i instanceof oe.Alternation)n.walkOr(i,o,r);else throw Error("non exhaustive match")})},e.prototype.walkTerminal=function(t,r,n){},e.prototype.walkProdRef=function(t,r,n){},e.prototype.walkFlat=function(t,r,n){var i=r.concat(n);this.walk(t,i)},e.prototype.walkOption=function(t,r,n){var i=r.concat(n);this.walk(t,i)},e.prototype.walkAtLeastOne=function(t,r,n){var i=[new oe.Option({definition:t.definition})].concat(r,n);this.walk(t,i)},e.prototype.walkAtLeastOneSep=function(t,r,n){var i=ov(t,r,n);this.walk(t,i)},e.prototype.walkMany=function(t,r,n){var i=[new oe.Option({definition:t.definition})].concat(r,n);this.walk(t,i)},e.prototype.walkManySep=function(t,r,n){var i=ov(t,r,n);this.walk(t,i)},e.prototype.walkOr=function(t,r,n){var i=this,a=r.concat(n);(0,av.default)(t.definition,function(o){var s=new oe.Alternative({definition:[o]});i.walk(s,a)})},e}();ur.RestWalker=VC;function ov(e,t,r){var n=[new oe.Option({definition:[new oe.Terminal({terminalType:e.separator})].concat(e.definition)})],i=n.concat(t,r);return i}});var fv=l((aV,lv)=>{"use strict";var uv=St(),HC=Yr(),KC=k(),cv=uv?uv.isConcatSpreadable:void 0;function zC(e){return KC(e)||HC(e)||!!(cv&&e&&e[cv])}lv.exports=zC});var Oi=l((oV,dv)=>{"use strict";var YC=ni(),XC=fv();function pv(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=XC),i||(i=[]);++a<o;){var s=e[a];t>0&&r(s)?t>1?pv(s,t-1,r,n,i):YC(i,s):n||(i[i.length]=s)}return i}dv.exports=pv});var De=l((sV,hv)=>{"use strict";var $C=Oi();function ZC(e){var t=e==null?0:e.length;return t?$C(e,1):[]}hv.exports=ZC});var So=l((uV,vv)=>{"use strict";var JC=Ei();function QC(e,t){var r=e==null?0:e.length;return!!r&&JC(e,t,0)>-1}vv.exports=QC});var bo=l((cV,mv)=>{"use strict";function ek(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}mv.exports=ek});var Ri=l((lV,yv)=>{"use strict";function tk(){}yv.exports=tk});var _v=l((fV,gv)=>{"use strict";var No=Ha(),rk=Ri(),nk=ri(),ik=1/0,ak=No&&1/nk(new No([,-0]))[1]==ik?function(e){return new No(e)}:rk;gv.exports=ak});var Tv=l((pV,Ev)=>{"use strict";var ok=ei(),sk=So(),uk=bo(),ck=ti(),lk=_v(),fk=ri(),pk=200;function dk(e,t,r){var n=-1,i=sk,a=e.length,o=!0,s=[],u=s;if(r)o=!1,i=uk;else if(a>=pk){var c=t?null:lk(e);if(c)return fk(c);o=!1,i=ck,u=new ok}else u=t?[]:s;e:for(;++n<a;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,o&&d===d){for(var h=u.length;h--;)if(u[h]===d)continue e;t&&u.push(d),s.push(f)}else i(u,d,r)||(u!==s&&u.push(d),s.push(f))}return s}Ev.exports=dk});var Si=l((dV,Av)=>{"use strict";var hk=Tv();function vk(e){return e&&e.length?hk(e):[]}Av.exports=vk});var Po=l(Ee=>{"use strict";var Lo=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.firstForTerminal=Ee.firstForBranching=Ee.firstForSequence=Ee.first=void 0;var mk=Lo(De()),Rv=Lo(Si()),yk=Lo(re()),Ov=W(),Io=W();function bi(e){if(e instanceof Ov.NonTerminal)return bi(e.referencedRule);if(e instanceof Ov.Terminal)return Nv(e);if((0,Io.isSequenceProd)(e))return Sv(e);if((0,Io.isBranchingProd)(e))return bv(e);throw Error("non exhaustive match")}Ee.first=bi;function Sv(e){for(var t=[],r=e.definition,n=0,i=r.length>n,a,o=!0;i&&o;)a=r[n],o=(0,Io.isOptionalProd)(a),t=t.concat(bi(a)),n=n+1,i=r.length>n;return(0,Rv.default)(t)}Ee.firstForSequence=Sv;function bv(e){var t=(0,yk.default)(e.definition,function(r){return bi(r)});return(0,Rv.default)((0,mk.default)(t))}Ee.firstForBranching=bv;function Nv(e){return[e.terminalType]}Ee.firstForTerminal=Nv});var xo=l(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.IN=void 0;Ni.IN="_~IN~_"});var Cv=l(se=>{"use strict";var gk=se&&se.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Iv=se&&se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(se,"__esModule",{value:!0});se.buildInProdFollowPrefix=se.buildBetweenProdsFollowPrefix=se.computeAllProdsFollows=se.ResyncFollowsWalker=void 0;var _k=Ai(),Ek=Po(),Tk=Iv($()),Ak=Iv(dn()),Lv=xo(),Ok=W(),Pv=function(e){gk(t,e);function t(r){var n=e.call(this)||this;return n.topProd=r,n.follows={},n}return t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(r,n,i){},t.prototype.walkProdRef=function(r,n,i){var a=xv(r.referencedRule,r.idx)+this.topProd.name,o=n.concat(i),s=new Ok.Alternative({definition:o}),u=(0,Ek.first)(s);this.follows[a]=u},t}(_k.RestWalker);se.ResyncFollowsWalker=Pv;function Rk(e){var t={};return(0,Tk.default)(e,function(r){var n=new Pv(r).startWalking();(0,Ak.default)(t,n)}),t}se.computeAllProdsFollows=Rk;function xv(e,t){return e.name+t+Lv.IN}se.buildBetweenProdsFollowPrefix=xv;function Sk(e){var t=e.terminalType.name;return t+e.idx+Lv.IN}se.buildInProdFollowPrefix=Sk});var Nt=l((yV,kv)=>{"use strict";function bk(e){return e===void 0}kv.exports=bk});var Li=l((qv,Ii)=>{"use strict";(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Ii=="object"&&Ii.exports?Ii.exports=t():e.regexpToAst=t()})(typeof self<"u"?self:qv,function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(p){this.idx=p.idx,this.input=p.input,this.groupIdx=p.groupIdx},e.prototype.pattern=function(p){this.idx=0,this.input=p,this.groupIdx=0,this.consumeChar("/");var v=this.disjunction();this.consumeChar("/");for(var y={type:"Flags",loc:{begin:this.idx,end:p.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(y,"global");break;case"i":o(y,"ignoreCase");break;case"m":o(y,"multiLine");break;case"u":o(y,"unicode");break;case"y":o(y,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:y,value:v,loc:this.loc(0)}},e.prototype.disjunction=function(){var p=[],v=this.idx;for(p.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),p.push(this.alternative());return{type:"Disjunction",value:p,loc:this.loc(v)}},e.prototype.alternative=function(){for(var p=[],v=this.idx;this.isTerm();)p.push(this.term());return{type:"Alternative",value:p,loc:this.loc(v)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var p=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(p)};case"$":return{type:"EndAnchor",loc:this.loc(p)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(p)};case"B":return{type:"NonWordBoundary",loc:this.loc(p)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var v;switch(this.popChar()){case"=":v="Lookahead";break;case"!":v="NegativeLookahead";break}s(v);var y=this.disjunction();return this.consumeChar(")"),{type:v,value:y,loc:this.loc(p)}}u()},e.prototype.quantifier=function(p){var v,y=this.idx;switch(this.popChar()){case"*":v={atLeast:0,atMost:1/0};break;case"+":v={atLeast:1,atMost:1/0};break;case"?":v={atLeast:0,atMost:1};break;case"{":var g=this.integerIncludingZero();switch(this.popChar()){case"}":v={atLeast:g,atMost:g};break;case",":var A;this.isDigit()?(A=this.integerIncludingZero(),v={atLeast:g,atMost:A}):v={atLeast:g,atMost:1/0},this.consumeChar("}");break}if(p===!0&&v===void 0)return;s(v);break}if(!(p===!0&&v===void 0))return s(v),this.peekChar(0)==="?"?(this.consumeChar("?"),v.greedy=!1):v.greedy=!0,v.type="Quantifier",v.loc=this.loc(y),v},e.prototype.atom=function(){var p,v=this.idx;switch(this.peekChar()){case".":p=this.dotAll();break;case"\\":p=this.atomEscape();break;case"[":p=this.characterClass();break;case"(":p=this.group();break}return p===void 0&&this.isPatternCharacter()&&(p=this.patternCharacter()),s(p),p.loc=this.loc(v),this.isQuantifier()&&(p.quantifier=this.quantifier()),p},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[i(`
|
|
3
|
+
`),i("\r"),i("\u2028"),i("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},e.prototype.characterClassEscape=function(){var p,v=!1;switch(this.popChar()){case"d":p=f;break;case"D":p=f,v=!0;break;case"s":p=h;break;case"S":p=h,v=!0;break;case"w":p=d;break;case"W":p=d,v=!0;break}return s(p),{type:"Set",value:p,complement:v}},e.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=i("\f");break;case"n":p=i(`
|
|
4
|
+
`);break;case"r":p=i("\r");break;case"t":p=i(" ");break;case"v":p=i("\v");break}return s(p),{type:"Character",value:p}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var v=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:v}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:i("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:i(p)}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:i(p)}}},e.prototype.characterClass=function(){var p=[],v=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),v=!0);this.isClassAtom();){var y=this.classAtom(),g=y.type==="Character";if(g&&this.isRangeDash()){this.consumeChar("-");var A=this.classAtom(),_=A.type==="Character";if(_){if(A.value<y.value)throw Error("Range out of order in character class");p.push({from:y.value,to:A.value})}else a(y.value,p),p.push(i("-")),a(A.value,p)}else a(y.value,p)}return this.consumeChar("]"),{type:"Set",complement:v,value:p}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:i("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var p=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),p=!1;break;default:this.groupIdx++;break}var v=this.disjunction();this.consumeChar(")");var y={type:"Group",capturing:p,value:v};return p&&(y.idx=this.groupIdx),y},e.prototype.positiveInteger=function(){var p=this.popChar();if(n.test(p)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},e.prototype.integerIncludingZero=function(){var p=this.popChar();if(r.test(p)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)p+=this.popChar();return parseInt(p,10)},e.prototype.patternCharacter=function(){var p=this.popChar();switch(p){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:i(p)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},e.prototype.isDigit=function(){return r.test(this.peekChar(0))},e.prototype.isClassAtom=function(p){switch(p===void 0&&(p=0),this.peekChar(p)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},e.prototype.isQuantifier=function(){var p=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(p)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(p){for(var v="",y=0;y<p;y++){var g=this.popChar();if(t.test(g)===!1)throw Error("Expecting a HexDecimal digits");v+=g}var A=parseInt(v,16);return{type:"Character",value:A}},e.prototype.peekChar=function(p){return p===void 0&&(p=0),this.input[this.idx+p]},e.prototype.popChar=function(){var p=this.peekChar(0);return this.consumeChar(),p},e.prototype.consumeChar=function(p){if(p!==void 0&&this.input[this.idx]!==p)throw Error("Expected: '"+p+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},e.prototype.loc=function(p){return{begin:p,end:this.idx}};var t=/[0-9a-fA-F]/,r=/[0-9]/,n=/[1-9]/;function i(p){return p.charCodeAt(0)}function a(p,v){p.length!==void 0?p.forEach(function(y){v.push(y)}):v.push(p)}function o(p,v){if(p[v]===!0)throw"duplicate flag "+v;p[v]=!0}function s(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function u(){throw Error("Internal Error - Should never get here!")}var c,f=[];for(c=i("0");c<=i("9");c++)f.push(c);var d=[i("_")].concat(f);for(c=i("a");c<=i("z");c++)d.push(c);for(c=i("A");c<=i("Z");c++)d.push(c);var h=[i(" "),i("\f"),i(`
|
|
10
|
+
`),i("\r"),i(" "),i("\v"),i(" "),i("\xA0"),i("\u1680"),i("\u2000"),i("\u2001"),i("\u2002"),i("\u2003"),i("\u2004"),i("\u2005"),i("\u2006"),i("\u2007"),i("\u2008"),i("\u2009"),i("\u200A"),i("\u2028"),i("\u2029"),i("\u202F"),i("\u205F"),i("\u3000"),i("\uFEFF")];function m(){}return m.prototype.visitChildren=function(p){for(var v in p){var y=p[v];p.hasOwnProperty(v)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(g){this.visit(g)},this))}},m.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},m.prototype.visitPattern=function(p){},m.prototype.visitFlags=function(p){},m.prototype.visitDisjunction=function(p){},m.prototype.visitAlternative=function(p){},m.prototype.visitStartAnchor=function(p){},m.prototype.visitEndAnchor=function(p){},m.prototype.visitWordBoundary=function(p){},m.prototype.visitNonWordBoundary=function(p){},m.prototype.visitLookahead=function(p){},m.prototype.visitNegativeLookahead=function(p){},m.prototype.visitCharacter=function(p){},m.prototype.visitSet=function(p){},m.prototype.visitGroup=function(p){},m.prototype.visitGroupBackReference=function(p){},m.prototype.visitQuantifier=function(p){},{RegExpParser:e,BaseRegExpVisitor:m,VERSION:"0.5.0"}})});var wv=l((gV,Mv)=>{"use strict";function Nk(e){return e&&e.length?e[0]:void 0}Mv.exports=Nk});var cr=l((_V,Fv)=>{"use strict";Fv.exports=wv()});var mn=l((EV,Dv)=>{"use strict";function Ik(e){for(var t=-1,r=e==null?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i}Dv.exports=Ik});var Co=l((TV,Uv)=>{"use strict";var Lk=pt();function Pk(e,t){var r=[];return Lk(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}Uv.exports=Pk});var Bv=l((AV,jv)=>{"use strict";var xk="Expected a function";function Ck(e){if(typeof e!="function")throw new TypeError(xk);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}jv.exports=Ck});var Pi=l((OV,Gv)=>{"use strict";var kk=ii(),qk=Co(),Mk=be(),wk=k(),Fk=Bv();function Dk(e,t){var r=wk(e)?kk:qk;return r(e,Fk(Mk(t,3)))}Gv.exports=Dk});var Vv=l((RV,Wv)=>{"use strict";var Uk=ei(),jk=So(),Bk=bo(),Gk=Yt(),Wk=Kt(),Vk=ti(),Hk=200;function Kk(e,t,r,n){var i=-1,a=jk,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;r&&(t=Gk(t,Wk(r))),n?(a=Bk,o=!1):t.length>=Hk&&(a=Vk,o=!1,t=new Uk(t));e:for(;++i<s;){var f=e[i],d=r==null?f:r(f);if(f=n||f!==0?f:0,o&&d===d){for(var h=c;h--;)if(t[h]===d)continue e;u.push(f)}else a(t,d,n)||u.push(f)}return u}Wv.exports=Kk});var Kv=l((SV,Hv)=>{"use strict";var zk=Se(),Yk=Re();function Xk(e){return Yk(e)&&zk(e)}Hv.exports=Xk});var xi=l((bV,Yv)=>{"use strict";var $k=Vv(),Zk=Oi(),Jk=vi(),zv=Kv(),Qk=Jk(function(e,t){return zv(e)?$k(e,Zk(t,1,zv,!0)):[]});Yv.exports=Qk});var $v=l((NV,Xv)=>{"use strict";var eq=Ei(),tq=or(),rq=Math.max;function nq(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:tq(r);return i<0&&(i=rq(n+i,0)),eq(e,t,i)}Xv.exports=nq});var Jv=l((IV,Zv)=>{"use strict";var iq=be(),aq=Se(),oq=de();function sq(e){return function(t,r,n){var i=Object(t);if(!aq(t)){var a=iq(r,3);t=oq(t),r=function(s){return a(i[s],s,i)}}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}Zv.exports=sq});var em=l((LV,Qv)=>{"use strict";var uq=Ao(),cq=be(),lq=or(),fq=Math.max;function pq(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:lq(r);return i<0&&(i=fq(n+i,0)),uq(e,cq(t,3),i)}Qv.exports=pq});var Ci=l((PV,tm)=>{"use strict";var dq=Jv(),hq=em(),vq=dq(hq);tm.exports=vq});var ki=l((xV,rm)=>{"use strict";var mq=ii(),yq=Co(),gq=be(),_q=k();function Eq(e,t){var r=_q(e)?mq:yq;return r(e,gq(t,3))}rm.exports=Eq});var ko=l((CV,im)=>{"use strict";var Tq=vi(),Aq=Xt(),Oq=pn(),Rq=cn(),nm=Object.prototype,Sq=nm.hasOwnProperty,bq=Tq(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Oq(t[0],t[1],i)&&(n=1);++r<n;)for(var a=t[r],o=Rq(a),s=-1,u=o.length;++s<u;){var c=o[s],f=e[c];(f===void 0||Aq(f,nm[c])&&!Sq.call(e,c))&&(e[c]=a[c])}return e});im.exports=bq});var om=l((kV,am)=>{"use strict";function Nq(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}am.exports=Nq});var um=l((qV,sm)=>{"use strict";function Iq(e,t,r,n,i){return i(e,function(a,o,s){r=n?(n=!1,a):t(r,a,o,s)}),r}sm.exports=Iq});var dt=l((MV,cm)=>{"use strict";var Lq=om(),Pq=pt(),xq=be(),Cq=um(),kq=k();function qq(e,t,r){var n=kq(e)?Lq:Cq,i=arguments.length<3;return n(e,xq(t,4),r,i,Pq)}cm.exports=qq});var Mi=l(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.clearRegExpParserCache=lr.getRegExpAst=void 0;var Mq=Li(),qi={},wq=new Mq.RegExpParser;function Fq(e){var t=e.toString();if(qi.hasOwnProperty(t))return qi[t];var r=wq.pattern(t);return qi[t]=r,r}lr.getRegExpAst=Fq;function Dq(){qi={}}lr.clearRegExpParserCache=Dq});var vm=l(Q=>{"use strict";var Uq=Q&&Q.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),fr=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q,"__esModule",{value:!0});Q.canMatchCharCode=Q.firstCharOptimizedIndices=Q.getOptimizedStartCodesIndices=Q.failedOptimizationPrefixMsg=void 0;var pm=Li(),jq=fr(k()),Bq=fr(vn()),Gq=fr($()),qo=fr(Ci()),Wq=fr(Ce()),wo=fr(Ze()),lm=ar(),dm=Mi(),Je=Fo(),hm="Complement Sets are not supported for first char optimization";Q.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|
11
|
+
`;function Vq(e,t){t===void 0&&(t=!1);try{var r=(0,dm.getRegExpAst)(e),n=Fi(r.value,{},r.flags.ignoreCase);return n}catch(a){if(a.message===hm)t&&(0,lm.PRINT_WARNING)("".concat(Q.failedOptimizationPrefixMsg)+" Unable to optimize: < ".concat(e.toString(),` >
|
|
12
|
+
`)+` Complement Sets cannot be automatically optimized.
|
|
13
|
+
This will disable the lexer's first char optimizations.
|
|
14
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";t&&(i=`
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,lm.PRINT_ERROR)("".concat(Q.failedOptimizationPrefixMsg,`
|
|
17
|
+
`)+" Failed parsing: < ".concat(e.toString(),` >
|
|
18
|
+
`)+" Using the regexp-to-ast library version: ".concat(pm.VERSION,`
|
|
19
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}Q.getOptimizedStartCodesIndices=Vq;function Fi(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)Fi(e.value[n],t,r);break;case"Alternative":for(var i=e.value,n=0;n<i.length;n++){var a=i[n];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=a;switch(o.type){case"Character":wi(o.value,t,r);break;case"Set":if(o.complement===!0)throw Error(hm);(0,Gq.default)(o.value,function(c){if(typeof c=="number")wi(c,t,r);else{var f=c;if(r===!0)for(var d=f.from;d<=f.to;d++)wi(d,t,r);else{for(var d=f.from;d<=f.to&&d<Je.minOptimizationVal;d++)wi(d,t,r);if(f.to>=Je.minOptimizationVal)for(var h=f.from>=Je.minOptimizationVal?f.from:Je.minOptimizationVal,m=f.to,p=(0,Je.charCodeToOptimizedIndex)(h),v=(0,Je.charCodeToOptimizedIndex)(m),y=p;y<=v;y++)t[y]=y}}});break;case"Group":Fi(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}var s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Mo(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return(0,Wq.default)(t)}Q.firstCharOptimizedIndices=Fi;function wi(e,t,r){var n=(0,Je.charCodeToOptimizedIndex)(e);t[n]=n,r===!0&&Hq(e,t)}function Hq(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){var i=(0,Je.charCodeToOptimizedIndex)(n.charCodeAt(0));t[i]=i}else{var a=r.toLowerCase();if(a!==r){var i=(0,Je.charCodeToOptimizedIndex)(a.charCodeAt(0));t[i]=i}}}function fm(e,t){return(0,qo.default)(e.value,function(r){if(typeof r=="number")return(0,wo.default)(t,r);var n=r;return(0,qo.default)(t,function(i){return n.from<=i&&i<=n.to})!==void 0})}function Mo(e){var t=e.quantifier;return t&&t.atLeast===0?!0:e.value?(0,jq.default)(e.value)?(0,Bq.default)(e.value,Mo):Mo(e.value):!1}var Kq=function(e){Uq(t,e);function t(r){var n=e.call(this)||this;return n.targetCharCodes=r,n.found=!1,n}return t.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}e.prototype.visitChildren.call(this,r)}},t.prototype.visitCharacter=function(r){(0,wo.default)(this.targetCharCodes,r.value)&&(this.found=!0)},t.prototype.visitSet=function(r){r.complement?fm(r,this.targetCharCodes)===void 0&&(this.found=!0):fm(r,this.targetCharCodes)!==void 0&&(this.found=!0)},t}(pm.BaseRegExpVisitor);function zq(e,t){if(t instanceof RegExp){var r=(0,dm.getRegExpAst)(t),n=new Kq(e);return n.visit(r),n.found}else return(0,qo.default)(t,function(i){return(0,wo.default)(e,i.charCodeAt(0))})!==void 0}Q.canMatchCharCode=zq});var Fo=l(T=>{"use strict";var gm=T&&T.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),G=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T,"__esModule",{value:!0});T.charCodeToOptimizedIndex=T.minOptimizationVal=T.buildLineBreakIssueMessage=T.LineTerminatorOptimizedTester=T.isShortPattern=T.isCustomPattern=T.cloneEmptyGroups=T.performWarningRuntimeChecks=T.performRuntimeChecks=T.addStickyFlag=T.addStartOfInput=T.findUnreachablePatterns=T.findModesThatDoNotExist=T.findInvalidGroupType=T.findDuplicatePatterns=T.findUnsupportedFlags=T.findStartOfInputAnchor=T.findEmptyMatchRegExps=T.findEndOfInputAnchor=T.findInvalidPatterns=T.findMissingPatterns=T.validatePatterns=T.analyzeTokenTypes=T.enableSticky=T.disableSticky=T.SUPPORT_STICKY=T.MODES=T.DEFAULT_MODE=void 0;var _m=Li(),M=yn(),Yq=G(cr()),Em=G(ye()),Tm=G(mn()),Ui=G(k()),Xq=G(Ce()),$q=G(De()),Am=G(Pi()),Om=G(xi()),mm=G($v()),j=G(re()),Qe=G($()),et=G(fn()),Bi=G(Gt()),Uo=G(Nt()),Zq=G(Ci()),ee=G(he()),Jq=G(de()),ht=G(_o()),Ue=G(ki()),Qq=G(ko()),ji=G(dt()),Gi=G(Ze()),ym=ar(),pr=vm(),Rm=Mi(),It="PATTERN";T.DEFAULT_MODE="defaultMode";T.MODES="modes";T.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function eM(){T.SUPPORT_STICKY=!1}T.disableSticky=eM;function tM(){T.SUPPORT_STICKY=!0}T.enableSticky=tM;function rM(e,t){t=(0,Qq.default)(t,{useSticky:T.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
20
|
+
`],tracer:function(A,_){return _()}});var r=t.tracer;r("initCharCodeToOptimizedIndexMap",function(){pM()});var n;r("Reject Lexer.NA",function(){n=(0,Am.default)(e,function(A){return A[It]===M.Lexer.NA})});var i=!1,a;r("Transform Patterns",function(){i=!1,a=(0,j.default)(n,function(A){var _=A[It];if((0,ht.default)(_)){var S=_.source;return S.length===1&&S!=="^"&&S!=="$"&&S!=="."&&!_.ignoreCase?S:S.length===2&&S[0]==="\\"&&!(0,Gi.default)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],S[1])?S[1]:t.useSticky?Bo(_):jo(_)}else{if((0,Bi.default)(_))return i=!0,{exec:_};if(typeof _=="object")return i=!0,_;if(typeof _=="string"){if(_.length===1)return _;var Y=_.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),q=new RegExp(Y);return t.useSticky?Bo(q):jo(q)}else throw Error("non exhaustive match")}})});var o,s,u,c,f;r("misc mapping",function(){o=(0,j.default)(n,function(A){return A.tokenTypeIdx}),s=(0,j.default)(n,function(A){var _=A.GROUP;if(_!==M.Lexer.SKIPPED){if((0,et.default)(_))return _;if((0,Uo.default)(_))return!1;throw Error("non exhaustive match")}}),u=(0,j.default)(n,function(A){var _=A.LONGER_ALT;if(_){var S=(0,Ui.default)(_)?(0,j.default)(_,function(Y){return(0,mm.default)(n,Y)}):[(0,mm.default)(n,_)];return S}}),c=(0,j.default)(n,function(A){return A.PUSH_MODE}),f=(0,j.default)(n,function(A){return(0,ee.default)(A,"POP_MODE")})});var d;r("Line Terminator Handling",function(){var A=Dm(t.lineTerminatorCharacters);d=(0,j.default)(n,function(_){return!1}),t.positionTracking!=="onlyOffset"&&(d=(0,j.default)(n,function(_){return(0,ee.default)(_,"LINE_BREAKS")?!!_.LINE_BREAKS:wm(_,A)===!1&&(0,pr.canMatchCharCode)(A,_.PATTERN)}))});var h,m,p,v;r("Misc Mapping #2",function(){h=(0,j.default)(n,Wo),m=(0,j.default)(a,Mm),p=(0,ji.default)(n,function(A,_){var S=_.GROUP;return(0,et.default)(S)&&S!==M.Lexer.SKIPPED&&(A[S]=[]),A},{}),v=(0,j.default)(a,function(A,_){return{pattern:a[_],longerAlt:u[_],canLineTerminator:d[_],isCustom:h[_],short:m[_],group:s[_],push:c[_],pop:f[_],tokenTypeIdx:o[_],tokenType:n[_]}})});var y=!0,g=[];return t.safeMode||r("First Char Optimization",function(){g=(0,ji.default)(n,function(A,_,S){if(typeof _.PATTERN=="string"){var Y=_.PATTERN.charCodeAt(0),q=Go(Y);Do(A,q,v[S])}else if((0,Ui.default)(_.START_CHARS_HINT)){var ae;(0,Qe.default)(_.START_CHARS_HINT,function(J){var le=typeof J=="string"?J.charCodeAt(0):J,fe=Go(le);ae!==fe&&(ae=fe,Do(A,fe,v[S]))})}else if((0,ht.default)(_.PATTERN))if(_.PATTERN.unicode)y=!1,t.ensureOptimizations&&(0,ym.PRINT_ERROR)("".concat(pr.failedOptimizationPrefixMsg)+" Unable to analyze < ".concat(_.PATTERN.toString(),` > pattern.
|
|
21
|
+
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
22
|
+
This will disable the lexer's first char optimizations.
|
|
23
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var Pe=(0,pr.getOptimizedStartCodesIndices)(_.PATTERN,t.ensureOptimizations);(0,Em.default)(Pe)&&(y=!1),(0,Qe.default)(Pe,function(J){Do(A,J,v[S])})}else t.ensureOptimizations&&(0,ym.PRINT_ERROR)("".concat(pr.failedOptimizationPrefixMsg)+" TokenType: <".concat(_.name,`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
24
|
+
`)+` This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return A},[])}),{emptyGroups:p,patternIdxToConfig:v,charCodeToPatternIdxToConfig:g,hasCustom:i,canBeOptimized:y}}T.analyzeTokenTypes=rM;function nM(e,t){var r=[],n=Sm(e);r=r.concat(n.errors);var i=bm(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(iM(a)),r=r.concat(Cm(a)),r=r.concat(km(a,t)),r=r.concat(qm(a)),r}T.validatePatterns=nM;function iM(e){var t=[],r=(0,Ue.default)(e,function(n){return(0,ht.default)(n[It])});return t=t.concat(Nm(r)),t=t.concat(Lm(r)),t=t.concat(Pm(r)),t=t.concat(xm(r)),t=t.concat(Im(r)),t}function Sm(e){var t=(0,Ue.default)(e,function(i){return!(0,ee.default)(i,It)}),r=(0,j.default)(t,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:M.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[i]}}),n=(0,Om.default)(e,t);return{errors:r,valid:n}}T.findMissingPatterns=Sm;function bm(e){var t=(0,Ue.default)(e,function(i){var a=i[It];return!(0,ht.default)(a)&&!(0,Bi.default)(a)&&!(0,ee.default)(a,"exec")&&!(0,et.default)(a)}),r=(0,j.default)(t,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:M.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[i]}}),n=(0,Om.default)(e,t);return{errors:r,valid:n}}T.findInvalidPatterns=bm;var aM=/[^\\][$]/;function Nm(e){var t=function(i){gm(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitEndAnchor=function(o){this.found=!0},a}(_m.BaseRegExpVisitor),r=(0,Ue.default)(e,function(i){var a=i.PATTERN;try{var o=(0,Rm.getRegExpAst)(a),s=new t;return s.visit(o),s.found}catch{return aM.test(a.source)}}),n=(0,j.default)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
|
|
26
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
27
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:M.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}T.findEndOfInputAnchor=Nm;function Im(e){var t=(0,Ue.default)(e,function(n){var i=n.PATTERN;return i.test("")}),r=(0,j.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:M.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[n]}});return r}T.findEmptyMatchRegExps=Im;var oM=/[^\\[][\^]|^\^/;function Lm(e){var t=function(i){gm(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitStartAnchor=function(o){this.found=!0},a}(_m.BaseRegExpVisitor),r=(0,Ue.default)(e,function(i){var a=i.PATTERN;try{var o=(0,Rm.getRegExpAst)(a),s=new t;return s.visit(o),s.found}catch{return oM.test(a.source)}}),n=(0,j.default)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
29
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:M.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}T.findStartOfInputAnchor=Lm;function Pm(e){var t=(0,Ue.default)(e,function(n){var i=n[It];return i instanceof RegExp&&(i.multiline||i.global)}),r=(0,j.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:M.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}});return r}T.findUnsupportedFlags=Pm;function xm(e){var t=[],r=(0,j.default)(e,function(a){return(0,ji.default)(e,function(o,s){return a.PATTERN.source===s.PATTERN.source&&!(0,Gi.default)(t,s)&&s.PATTERN!==M.Lexer.NA&&(t.push(s),o.push(s)),o},[])});r=(0,Tm.default)(r);var n=(0,Ue.default)(r,function(a){return a.length>1}),i=(0,j.default)(n,function(a){var o=(0,j.default)(a,function(u){return u.name}),s=(0,Yq.default)(a).PATTERN;return{message:"The same RegExp pattern ->".concat(s,"<-")+"has been used in all of the following Token Types: ".concat(o.join(", ")," <-"),type:M.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}});return i}T.findDuplicatePatterns=xm;function Cm(e){var t=(0,Ue.default)(e,function(n){if(!(0,ee.default)(n,"GROUP"))return!1;var i=n.GROUP;return i!==M.Lexer.SKIPPED&&i!==M.Lexer.NA&&!(0,et.default)(i)}),r=(0,j.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:M.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}});return r}T.findInvalidGroupType=Cm;function km(e,t){var r=(0,Ue.default)(e,function(i){return i.PUSH_MODE!==void 0&&!(0,Gi.default)(t,i.PUSH_MODE)}),n=(0,j.default)(r,function(i){var a="Token Type: ->".concat(i.name,"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->").concat(i.PUSH_MODE,"<-")+"which does not exist";return{message:a,type:M.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return n}T.findModesThatDoNotExist=km;function qm(e){var t=[],r=(0,ji.default)(e,function(n,i,a){var o=i.PATTERN;return o===M.Lexer.NA||((0,et.default)(o)?n.push({str:o,idx:a,tokenType:i}):(0,ht.default)(o)&&uM(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return(0,Qe.default)(e,function(n,i){(0,Qe.default)(r,function(a){var o=a.str,s=a.idx,u=a.tokenType;if(i<s&&sM(o,n.PATTERN)){var c="Token: ->".concat(u.name,`<- can never be matched.
|
|
30
|
+
`)+"Because it appears AFTER the Token Type ->".concat(n.name,"<-")+`in the lexer's definition.
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:M.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),t}T.findUnreachablePatterns=qm;function sM(e,t){if((0,ht.default)(t)){var r=t.exec(e);return r!==null&&r.index===0}else{if((0,Bi.default)(t))return t(e,0,[],{});if((0,ee.default)(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function uM(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Zq.default)(t,function(r){return e.source.indexOf(r)!==-1})===void 0}function jo(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:".concat(e.source,")"),t)}T.addStartOfInput=jo;function Bo(e){var t=e.ignoreCase?"iy":"y";return new RegExp("".concat(e.source),t)}T.addStickyFlag=Bo;function cM(e,t,r){var n=[];return(0,ee.default)(e,T.DEFAULT_MODE)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+T.DEFAULT_MODE+`> property in its definition
|
|
32
|
+
`,type:M.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,ee.default)(e,T.MODES)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+T.MODES+`> property in its definition
|
|
33
|
+
`,type:M.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,ee.default)(e,T.MODES)&&(0,ee.default)(e,T.DEFAULT_MODE)&&!(0,ee.default)(e.modes,e.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a ".concat(T.DEFAULT_MODE,": <").concat(e.defaultMode,">")+`which does not exist
|
|
34
|
+
`,type:M.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,ee.default)(e,T.MODES)&&(0,Qe.default)(e.modes,function(i,a){(0,Qe.default)(i,function(o,s){if((0,Uo.default)(o))n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+"<".concat(a,"> at index: <").concat(s,`>
|
|
35
|
+
`),type:M.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,ee.default)(o,"LONGER_ALT")){var u=(0,Ui.default)(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];(0,Qe.default)(u,function(c){!(0,Uo.default)(c)&&!(0,Gi.default)(i,c)&&n.push({message:"A MultiMode Lexer cannot be initialized with a longer_alt <".concat(c.name,"> on token <").concat(o.name,"> outside of mode <").concat(a,`>
|
|
36
|
+
`),type:M.LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}T.performRuntimeChecks=cM;function lM(e,t,r){var n=[],i=!1,a=(0,Tm.default)((0,$q.default)((0,Xq.default)(e.modes))),o=(0,Am.default)(a,function(u){return u[It]===M.Lexer.NA}),s=Dm(r);return t&&(0,Qe.default)(o,function(u){var c=wm(u,s);if(c!==!1){var f=Fm(u,c),d={message:f,type:c.issue,tokenType:u};n.push(d)}else(0,ee.default)(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):(0,pr.canMatchCharCode)(s,u.PATTERN)&&(i=!0)}),t&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
37
|
+
This Lexer has been defined to track line and column information,
|
|
38
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
39
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
40
|
+
for details.`,type:M.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}T.performWarningRuntimeChecks=lM;function fM(e){var t={},r=(0,Jq.default)(e);return(0,Qe.default)(r,function(n){var i=e[n];if((0,Ui.default)(i))t[n]=[];else throw Error("non exhaustive match")}),t}T.cloneEmptyGroups=fM;function Wo(e){var t=e.PATTERN;if((0,ht.default)(t))return!1;if((0,Bi.default)(t))return!0;if((0,ee.default)(t,"exec"))return!0;if((0,et.default)(t))return!1;throw Error("non exhaustive match")}T.isCustomPattern=Wo;function Mm(e){return(0,et.default)(e)&&e.length===1?e.charCodeAt(0):!1}T.isShortPattern=Mm;T.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return e.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function wm(e,t){if((0,ee.default)(e,"LINE_BREAKS"))return!1;if((0,ht.default)(e.PATTERN)){try{(0,pr.canMatchCharCode)(t,e.PATTERN)}catch(r){return{issue:M.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if((0,et.default)(e.PATTERN))return!1;if(Wo(e))return{issue:M.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Fm(e,t){if(t.issue===M.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
41
|
+
`+" The problem is in the <".concat(e.name,`> Token Type
|
|
42
|
+
`)+" Root cause: ".concat(t.errMsg,`.
|
|
43
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===M.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
44
|
+
`+" The problem is in the <".concat(e.name,`> Token Type
|
|
45
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}T.buildLineBreakIssueMessage=Fm;function Dm(e){var t=(0,j.default)(e,function(r){return(0,et.default)(r)?r.charCodeAt(0):r});return t}function Do(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}T.minOptimizationVal=256;var Di=[];function Go(e){return e<T.minOptimizationVal?e:Di[e]}T.charCodeToOptimizedIndex=Go;function pM(){if((0,Em.default)(Di)){Di=new Array(65536);for(var e=0;e<65536;e++)Di[e]=e>255?255+~~(e/255):e}}});var Wi=l((UV,Um)=>{"use strict";function dM(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}Um.exports=dM});var Pt=l(R=>{"use strict";var je=R&&R.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(R,"__esModule",{value:!0});R.isTokenType=R.hasExtendingTokensTypesMapProperty=R.hasExtendingTokensTypesProperty=R.hasCategoriesProperty=R.hasShortKeyProperty=R.singleAssignCategoriesToksMap=R.assignCategoriesMapProp=R.assignCategoriesTokensProp=R.assignTokenDefaultProps=R.expandCategories=R.augmentTokenTypes=R.tokenIdxToClass=R.tokenShortNameIdx=R.tokenStructuredMatcherNoCategories=R.tokenStructuredMatcher=void 0;var hM=je(ye()),vM=je(mn()),mM=je(k()),yM=je(De()),gM=je(xi()),_M=je(re()),Lt=je($()),gn=je(he()),EM=je(Ze()),TM=je(Xe());function AM(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}R.tokenStructuredMatcher=AM;function OM(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}R.tokenStructuredMatcherNoCategories=OM;R.tokenShortNameIdx=1;R.tokenIdxToClass={};function RM(e){var t=jm(e);Bm(t),Wm(t),Gm(t),(0,Lt.default)(t,function(r){r.isParent=r.categoryMatches.length>0})}R.augmentTokenTypes=RM;function jm(e){for(var t=(0,TM.default)(e),r=e,n=!0;n;){r=(0,vM.default)((0,yM.default)((0,_M.default)(r,function(a){return a.CATEGORIES})));var i=(0,gM.default)(r,t);t=t.concat(i),(0,hM.default)(i)?n=!1:r=i}return t}R.expandCategories=jm;function Bm(e){(0,Lt.default)(e,function(t){Vm(t)||(R.tokenIdxToClass[R.tokenShortNameIdx]=t,t.tokenTypeIdx=R.tokenShortNameIdx++),Vo(t)&&!(0,mM.default)(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),Vo(t)||(t.CATEGORIES=[]),Hm(t)||(t.categoryMatches=[]),Km(t)||(t.categoryMatchesMap={})})}R.assignTokenDefaultProps=Bm;function Gm(e){(0,Lt.default)(e,function(t){t.categoryMatches=[],(0,Lt.default)(t.categoryMatchesMap,function(r,n){t.categoryMatches.push(R.tokenIdxToClass[n].tokenTypeIdx)})})}R.assignCategoriesTokensProp=Gm;function Wm(e){(0,Lt.default)(e,function(t){Ho([],t)})}R.assignCategoriesMapProp=Wm;function Ho(e,t){(0,Lt.default)(e,function(r){t.categoryMatchesMap[r.tokenTypeIdx]=!0}),(0,Lt.default)(t.CATEGORIES,function(r){var n=e.concat(t);(0,EM.default)(n,r)||Ho(n,r)})}R.singleAssignCategoriesToksMap=Ho;function Vm(e){return(0,gn.default)(e,"tokenTypeIdx")}R.hasShortKeyProperty=Vm;function Vo(e){return(0,gn.default)(e,"CATEGORIES")}R.hasCategoriesProperty=Vo;function Hm(e){return(0,gn.default)(e,"categoryMatches")}R.hasExtendingTokensTypesProperty=Hm;function Km(e){return(0,gn.default)(e,"categoryMatchesMap")}R.hasExtendingTokensTypesMapProperty=Km;function SM(e){return(0,gn.default)(e,"tokenTypeIdx")}R.isTokenType=SM});var Ko=l(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.defaultLexerErrorProvider=void 0;Vi.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->".concat(e.image,"<- The Mode Stack is empty")},buildUnexpectedCharactersMessage:function(e,t,r,n,i){return"unexpected character: ->".concat(e.charAt(t),"<- at offset: ").concat(t,",")+" skipped ".concat(r," characters.")}}});var yn=l(rt=>{"use strict";var ve=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rt,"__esModule",{value:!0});rt.Lexer=rt.LexerDefinitionErrorType=void 0;var tt=Fo(),zo=ve(Ri()),Hi=ve(ye()),bM=ve(k()),NM=ve(Wi()),IM=ve(Pi()),zm=ve(re()),Yo=ve($()),LM=ve(de()),PM=ve(Nt()),Ym=ve(tr()),Xm=ve(dn()),xM=ve(dt()),$m=ve(Xe()),Xo=ar(),CM=Pt(),kM=Ko(),qM=Mi(),MM;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(MM=rt.LexerDefinitionErrorType||(rt.LexerDefinitionErrorType={}));var _n={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
46
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:kM.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_n);var wM=function(){function e(t,r){r===void 0&&(r=_n);var n=this;if(this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=function(a,o){if(n.traceInitPerf===!0){n.traceInitIndent++;var s=new Array(n.traceInitIndent+1).join(" ");n.traceInitIndent<n.traceInitMaxIdent&&console.log("".concat(s,"--> <").concat(a,">"));var u=(0,Xo.timer)(o),c=u.time,f=u.value,d=c>10?console.warn:console.log;return n.traceInitIndent<n.traceInitMaxIdent&&d("".concat(s,"<-- <").concat(a,"> time: ").concat(c,"ms")),n.traceInitIndent--,f}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
47
|
+
a boolean 2nd argument is no longer supported`);this.config=(0,Xm.default)({},_n,r);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var a,o=!0;n.TRACE_INIT("Lexer Config handling",function(){if(n.config.lineTerminatorsPattern===_n.lineTerminatorsPattern)n.config.lineTerminatorsPattern=tt.LineTerminatorOptimizedTester;else if(n.config.lineTerminatorCharacters===_n.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
48
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),(0,bM.default)(t)?a={modes:{defaultMode:(0,$m.default)(t)},defaultMode:tt.DEFAULT_MODE}:(o=!1,a=(0,$m.default)(t))}),n.config.skipValidations===!1&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,tt.performRuntimeChecks)(a,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat((0,tt.performWarningRuntimeChecks)(a,n.trackStartLines,n.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},(0,Yo.default)(a.modes,function(f,d){a.modes[d]=(0,IM.default)(f,function(h){return(0,PM.default)(h)})});var s=(0,LM.default)(a.modes);if((0,Yo.default)(a.modes,function(f,d){n.TRACE_INIT("Mode: <".concat(d,"> processing"),function(){if(n.modes.push(d),n.config.skipValidations===!1&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,tt.validatePatterns)(f,s))}),(0,Hi.default)(n.lexerDefinitionErrors)){(0,CM.augmentTokenTypes)(f);var h;n.TRACE_INIT("analyzeTokenTypes",function(){h=(0,tt.analyzeTokenTypes)(f,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT})}),n.patternIdxToConfig[d]=h.patternIdxToConfig,n.charCodeToPatternIdxToConfig[d]=h.charCodeToPatternIdxToConfig,n.emptyGroups=(0,Xm.default)({},n.emptyGroups,h.emptyGroups),n.hasCustom=h.hasCustom||n.hasCustom,n.canModeBeOptimized[d]=h.canBeOptimized}})}),n.defaultMode=a.defaultMode,!(0,Hi.default)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=(0,zm.default)(n.lexerDefinitionErrors,function(f){return f.message}),c=u.join(`-----------------------
|
|
49
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
50
|
+
`+c)}(0,Yo.default)(n.lexerDefinitionWarning,function(f){(0,Xo.PRINT_WARNING)(f.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if(tt.SUPPORT_STICKY?(n.chopInput=Ym.default,n.match=n.matchWithTest):(n.updateLastIndex=zo.default,n.match=n.matchWithExec),o&&(n.handleModes=zo.default),n.trackStartLines===!1&&(n.computeNewColumn=Ym.default),n.trackEndLines===!1&&(n.updateTokenEndLineColumnLocation=zo.default),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else if(/onlyOffset/i.test(n.config.positionTracking))n.createTokenInstance=n.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'.concat(n.config.positionTracking,'"'));n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)}),n.TRACE_INIT("Failed Optimization Warnings",function(){var f=(0,xM.default)(n.canModeBeOptimized,function(d,h,m){return h===!1&&d.push(m),d},[]);if(r.ensureOptimizations&&!(0,Hi.default)(f))throw Error("Lexer Modes: < ".concat(f.join(", "),` > cannot be optimized.
|
|
51
|
+
`)+` Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
52
|
+
Or inspect the console log for details on how to resolve these issues.`)}),n.TRACE_INIT("clearRegExpParserCache",function(){(0,qM.clearRegExpParserCache)()}),n.TRACE_INIT("toFastProperties",function(){(0,Xo.toFastProperties)(n)})})}return e.prototype.tokenize=function(t,r){if(r===void 0&&(r=this.defaultMode),!(0,Hi.default)(this.lexerDefinitionErrors)){var n=(0,zm.default)(this.lexerDefinitionErrors,function(a){return a.message}),i=n.join(`-----------------------
|
|
53
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
54
|
+
`+i)}return this.tokenizeInternal(t,r)},e.prototype.tokenizeInternal=function(t,r){var n=this,i,a,o,s,u,c,f,d,h,m,p,v,y,g,A,_,S=t,Y=S.length,q=0,ae=0,Pe=this.hasCustom?0:Math.floor(t.length/10),J=new Array(Pe),le=[],fe=this.trackStartLines?1:void 0,xe=this.trackStartLines?1:void 0,Ye=(0,tt.cloneEmptyGroups)(this.emptyGroups),Ia=this.trackStartLines,Dr=this.config.lineTerminatorsPattern,jn=0,ut=[],Ur=[],Bn=[],Gs=[];Object.freeze(Gs);var jr;function Ws(){return ut}function Vs(pe){var Wr=(0,tt.charCodeToOptimizedIndex)(pe),Ut=Ur[Wr];return Ut===void 0?Gs:Ut}var TE=function(pe){if(Bn.length===1&&pe.tokenType.PUSH_MODE===void 0){var Wr=n.config.errorMessageProvider.buildUnableToPopLexerModeMessage(pe);le.push({offset:pe.startOffset,line:pe.startLine,column:pe.startColumn,length:pe.image.length,message:Wr})}else{Bn.pop();var Ut=(0,NM.default)(Bn);ut=n.patternIdxToConfig[Ut],Ur=n.charCodeToPatternIdxToConfig[Ut],jn=ut.length;var RE=n.canModeBeOptimized[Ut]&&n.config.safeMode===!1;Ur&&RE?jr=Vs:jr=Ws}};function Hs(pe){Bn.push(pe),Ur=this.charCodeToPatternIdxToConfig[pe],ut=this.patternIdxToConfig[pe],jn=ut.length,jn=ut.length;var Wr=this.canModeBeOptimized[pe]&&this.config.safeMode===!1;Ur&&Wr?jr=Vs:jr=Ws}Hs.call(this,r);for(var Te,Ks=this.config.recoveryEnabled;q<Y;){c=null;var zs=S.charCodeAt(q),Ys=jr(zs),AE=Ys.length;for(i=0;i<AE;i++){Te=Ys[i];var ct=Te.pattern;f=null;var Br=Te.short;if(Br!==!1?zs===Br&&(c=ct):Te.isCustom===!0?(_=ct.exec(S,q,J,Ye),_!==null?(c=_[0],_.payload!==void 0&&(f=_.payload)):c=null):(this.updateLastIndex(ct,q),c=this.match(ct,t,q)),c!==null){if(u=Te.longerAlt,u!==void 0){var OE=u.length;for(o=0;o<OE;o++){var La=ut[u[o]],Pa=La.pattern;if(d=null,La.isCustom===!0?(_=Pa.exec(S,q,J,Ye),_!==null?(s=_[0],_.payload!==void 0&&(d=_.payload)):s=null):(this.updateLastIndex(Pa,q),s=this.match(Pa,t,q)),s&&s.length>c.length){c=s,f=d,Te=La;break}}}break}}if(c!==null){if(h=c.length,m=Te.group,m!==void 0&&(p=Te.tokenTypeIdx,v=this.createTokenInstance(c,q,p,Te.tokenType,fe,xe,h),this.handlePayload(v,f),m===!1?ae=this.addToken(J,ae,v):Ye[m].push(v)),t=this.chopInput(t,h),q=q+h,xe=this.computeNewColumn(xe,h),Ia===!0&&Te.canLineTerminator===!0){var Gn=0,xa=void 0,Ca=void 0;Dr.lastIndex=0;do xa=Dr.test(c),xa===!0&&(Ca=Dr.lastIndex-1,Gn++);while(xa===!0);Gn!==0&&(fe=fe+Gn,xe=h-Ca,this.updateTokenEndLineColumnLocation(v,m,Ca,Gn,fe,xe,h))}this.handleModes(Te,TE,Hs,v)}else{for(var ka=q,Xs=fe,$s=xe,Gr=Ks===!1;Gr===!1&&q<Y;)for(t=this.chopInput(t,1),q++,a=0;a<jn;a++){var qa=ut[a],ct=qa.pattern,Br=qa.short;if(Br!==!1?S.charCodeAt(q)===Br&&(Gr=!0):qa.isCustom===!0?Gr=ct.exec(S,q,J,Ye)!==null:(this.updateLastIndex(ct,q),Gr=ct.exec(t)!==null),Gr===!0)break}if(y=q-ka,A=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(S,ka,y,Xs,$s),le.push({offset:ka,line:Xs,column:$s,length:y,message:A}),Ks===!1)break}}return this.hasCustom||(J.length=ae),{tokens:J,groups:Ye,errors:le}},e.prototype.handleModes=function(t,r,n,i){if(t.pop===!0){var a=t.push;r(i),a!==void 0&&n.call(this,a)}else t.push!==void 0&&n.call(this,t.push)},e.prototype.chopInput=function(t,r){return t.substring(r)},e.prototype.updateLastIndex=function(t,r){t.lastIndex=r},e.prototype.updateTokenEndLineColumnLocation=function(t,r,n,i,a,o,s){var u,c;r!==void 0&&(u=n===s-1,c=u?-1:0,i===1&&u===!0||(t.endLine=a+c,t.endColumn=o-1+-c))},e.prototype.computeNewColumn=function(t,r){return t+r},e.prototype.createOffsetOnlyToken=function(t,r,n,i){return{image:t,startOffset:r,tokenTypeIdx:n,tokenType:i}},e.prototype.createStartOnlyToken=function(t,r,n,i,a,o){return{image:t,startOffset:r,startLine:a,startColumn:o,tokenTypeIdx:n,tokenType:i}},e.prototype.createFullToken=function(t,r,n,i,a,o,s){return{image:t,startOffset:r,endOffset:r+s-1,startLine:a,endLine:a,startColumn:o,endColumn:o+s-1,tokenTypeIdx:n,tokenType:i}},e.prototype.addTokenUsingPush=function(t,r,n){return t.push(n),r},e.prototype.addTokenUsingMemberAccess=function(t,r,n){return t[r]=n,r++,r},e.prototype.handlePayloadNoCustom=function(t,r){},e.prototype.handlePayloadWithCustom=function(t,r){r!==null&&(t.payload=r)},e.prototype.matchWithTest=function(t,r,n){var i=t.test(r);return i===!0?r.substring(n,t.lastIndex):null},e.prototype.matchWithExec=function(t,r){var n=t.exec(r);return n!==null?n[0]:null},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();rt.Lexer=wM});var xt=l(z=>{"use strict";var $o=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.tokenMatcher=z.createTokenInstance=z.EOF=z.createToken=z.hasTokenLabel=z.tokenName=z.tokenLabel=void 0;var FM=$o(fn()),nt=$o(he()),DM=$o(Nt()),UM=yn(),Zo=Pt();function jM(e){return ay(e)?e.LABEL:e.name}z.tokenLabel=jM;function BM(e){return e.name}z.tokenName=BM;function ay(e){return(0,FM.default)(e.LABEL)&&e.LABEL!==""}z.hasTokenLabel=ay;var GM="parent",Zm="categories",Jm="label",Qm="group",ey="push_mode",ty="pop_mode",ry="longer_alt",ny="line_breaks",iy="start_chars_hint";function oy(e){return WM(e)}z.createToken=oy;function WM(e){var t=e.pattern,r={};if(r.name=e.name,(0,DM.default)(t)||(r.PATTERN=t),(0,nt.default)(e,GM))throw`The parent property is no longer supported.
|
|
55
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,nt.default)(e,Zm)&&(r.CATEGORIES=e[Zm]),(0,Zo.augmentTokenTypes)([r]),(0,nt.default)(e,Jm)&&(r.LABEL=e[Jm]),(0,nt.default)(e,Qm)&&(r.GROUP=e[Qm]),(0,nt.default)(e,ty)&&(r.POP_MODE=e[ty]),(0,nt.default)(e,ey)&&(r.PUSH_MODE=e[ey]),(0,nt.default)(e,ry)&&(r.LONGER_ALT=e[ry]),(0,nt.default)(e,ny)&&(r.LINE_BREAKS=e[ny]),(0,nt.default)(e,iy)&&(r.START_CHARS_HINT=e[iy]),r}z.EOF=oy({name:"EOF",pattern:UM.Lexer.NA});(0,Zo.augmentTokenTypes)([z.EOF]);function VM(e,t,r,n,i,a,o,s){return{image:t,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}z.createTokenInstance=VM;function HM(e,t){return(0,Zo.tokenStructuredMatcher)(e,t)}z.tokenMatcher=HM});var hr=l(Ne=>{"use strict";var es=Ne&&Ne.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.defaultGrammarValidatorErrorProvider=Ne.defaultGrammarResolverErrorProvider=Ne.defaultParserErrorProvider=void 0;var dr=xt(),Qo=es(cr()),vt=es(re()),KM=es(dt()),Jo=W(),sy=W();Ne.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual,n=e.previous,i=e.ruleName,a=(0,dr.hasTokenLabel)(t),o=a?"--> ".concat((0,dr.tokenLabel)(t)," <--"):"token of type --> ".concat(t.name," <--"),s="Expecting ".concat(o," but found --> '").concat(r.image,"' <--");return s},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant,r=e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,n=e.previous,i=e.customUserDescription,a=e.ruleName,o="Expecting: ",s=(0,Qo.default)(r).image,u=`
|
|
56
|
+
but found: '`+s+"'";if(i)return o+i+u;var c=(0,KM.default)(t,function(m,p){return m.concat(p)},[]),f=(0,vt.default)(c,function(m){return"[".concat((0,vt.default)(m,function(p){return(0,dr.tokenLabel)(p)}).join(", "),"]")}),d=(0,vt.default)(f,function(m,p){return" ".concat(p+1,". ").concat(m)}),h=`one of these possible Token sequences:
|
|
57
|
+
`.concat(d.join(`
|
|
58
|
+
`));return o+h+u},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,n=e.customUserDescription,i=e.ruleName,a="Expecting: ",o=(0,Qo.default)(r).image,s=`
|
|
59
|
+
but found: '`+o+"'";if(n)return a+n+s;var u=(0,vt.default)(t,function(f){return"[".concat((0,vt.default)(f,function(d){return(0,dr.tokenLabel)(d)}).join(","),"]")}),c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
60
|
+
`+"<".concat(u.join(" ,"),">");return a+c+s}};Object.freeze(Ne.defaultParserErrorProvider);Ne.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){var r="Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
|
|
61
|
+
inside top level rule: ->`+e.name+"<-";return r}};Ne.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){function r(f){return f instanceof Jo.Terminal?f.terminalType.name:f instanceof Jo.NonTerminal?f.nonTerminalName:""}var n=e.name,i=(0,Qo.default)(t),a=i.idx,o=(0,sy.getProductionDslName)(i),s=r(i),u=a>0,c="->".concat(o).concat(u?a:"","<- ").concat(s?"with argument: ->".concat(s,"<-"):"",`
|
|
62
|
+
appears more than once (`).concat(t.length," times) in the top level rule: ->").concat(n,`<-.
|
|
63
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
64
|
+
`);return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
|
65
|
+
`),c},buildNamespaceConflictError:function(e){var t=`Namespace conflict found in grammar.
|
|
66
|
+
`+"The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <".concat(e.name,`>.
|
|
67
|
+
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
68
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
69
|
+
and Non-Terminal names start with a lower case letter.`;return t},buildAlternationPrefixAmbiguityError:function(e){var t=(0,vt.default)(e.prefixPath,function(i){return(0,dr.tokenLabel)(i)}).join(", "),r=e.alternation.idx===0?"":e.alternation.idx,n="Ambiguous alternatives: <".concat(e.ambiguityIndices.join(" ,"),`> due to common lookahead prefix
|
|
70
|
+
`)+"in <OR".concat(r,"> inside <").concat(e.topLevelRule.name,`> Rule,
|
|
71
|
+
`)+"<".concat(t,`> may appears as a prefix path in all these alternatives.
|
|
72
|
+
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
73
|
+
For Further details.`;return n},buildAlternationAmbiguityError:function(e){var t=(0,vt.default)(e.prefixPath,function(i){return(0,dr.tokenLabel)(i)}).join(", "),r=e.alternation.idx===0?"":e.alternation.idx,n="Ambiguous Alternatives Detected: <".concat(e.ambiguityIndices.join(" ,"),"> in <OR").concat(r,">")+" inside <".concat(e.topLevelRule.name,`> Rule,
|
|
74
|
+
`)+"<".concat(t,`> may appears as a prefix path in all these alternatives.
|
|
75
|
+
`);return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
76
|
+
For Further details.`,n},buildEmptyRepetitionError:function(e){var t=(0,sy.getProductionDslName)(e.repetition);e.repetition.idx!==0&&(t+=e.repetition.idx);var r="The repetition <".concat(t,"> within Rule <").concat(e.topLevelRule.name,`> can never consume any tokens.
|
|
77
|
+
`)+"This could lead to an infinite loop.";return r},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){var t="Ambiguous empty alternative: <".concat(e.emptyChoiceIdx+1,">")+" in <OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,`> Rule.
|
|
78
|
+
`)+"Only the last alternative may be an empty alternative.";return t},buildTooManyAlternativesError:function(e){var t=`An Alternation cannot have more than 256 alternatives:
|
|
79
|
+
`+"<OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,`> Rule.
|
|
80
|
+
has `).concat(e.alternation.definition.length+1," alternatives.");return t},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=(0,vt.default)(e.leftRecursionPath,function(a){return a.name}),n="".concat(t," --> ").concat(r.concat([t]).join(" --> ")),i=`Left Recursion found in grammar.
|
|
81
|
+
`+"rule: <".concat(t,`> can be invoked from itself (directly or indirectly)
|
|
82
|
+
`)+`without consuming any Tokens. The grammar path that causes this is:
|
|
83
|
+
`.concat(n,`
|
|
84
|
+
`)+` To fix this refactor your grammar to remove the left recursion.
|
|
85
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;return i},buildInvalidRuleNameError:function(e){return"deprecated"},buildDuplicateRuleNameError:function(e){var t;e.topLevelRule instanceof Jo.Rule?t=e.topLevelRule.name:t=e.topLevelRule;var r="Duplicate definition, rule: ->".concat(t,"<- is already defined in the grammar: ->").concat(e.grammarName,"<-");return r}}});var ly=l(Be=>{"use strict";var zM=Be&&Be.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),uy=Be&&Be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Be,"__esModule",{value:!0});Be.GastRefResolverVisitor=Be.resolveGrammar=void 0;var YM=ue(),XM=uy($()),$M=uy(Ce()),ZM=W();function JM(e,t){var r=new cy(e,t);return r.resolveRefs(),r.errors}Be.resolveGrammar=JM;var cy=function(e){zM(t,e);function t(r,n){var i=e.call(this)||this;return i.nameToTopRule=r,i.errMsgProvider=n,i.errors=[],i}return t.prototype.resolveRefs=function(){var r=this;(0,XM.default)((0,$M.default)(this.nameToTopRule),function(n){r.currTopLevel=n,n.accept(r)})},t.prototype.visitNonTerminal=function(r){var n=this.nameToTopRule[r.nonTerminalName];if(n)r.referencedRule=n;else{var i=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:i,type:YM.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},t}(ZM.GAstVisitor);Be.GastRefResolverVisitor=cy});var py=l((KV,fy)=>{"use strict";function QM(e,t,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(n,o,r(o),e)}return n}fy.exports=QM});var hy=l((zV,dy)=>{"use strict";var ew=pt();function tw(e,t,r,n){return ew(e,function(i,a,o){t(n,i,r(i),o)}),n}dy.exports=tw});var my=l((YV,vy)=>{"use strict";var rw=py(),nw=hy(),iw=be(),aw=k();function ow(e,t){return function(r,n){var i=aw(r)?rw:nw,a=t?t():{};return i(r,e,iw(n,2),a)}}vy.exports=ow});var ts=l((XV,yy)=>{"use strict";var sw=ci(),uw=my(),cw=Object.prototype,lw=cw.hasOwnProperty,fw=uw(function(e,t,r){lw.call(e,r)?e[r].push(t):sw(e,r,[t])});yy.exports=fw});var rs=l(($V,gy)=>{"use strict";var pw=Oi(),dw=re();function hw(e,t){return pw(dw(e,t),1)}gy.exports=hw});var Ki=l((ZV,_y)=>{"use strict";var vw=di(),mw=or();function yw(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:mw(t),t=n-t,vw(e,0,t<0?0:t)):[]}_y.exports=yw});var Tn=l(B=>{"use strict";var kt=B&&B.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),qt=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(B,"__esModule",{value:!0});B.nextPossibleTokensAfter=B.possiblePathsFrom=B.NextTerminalAfterAtLeastOneSepWalker=B.NextTerminalAfterAtLeastOneWalker=B.NextTerminalAfterManySepWalker=B.NextTerminalAfterManyWalker=B.AbstractNextTerminalAfterProductionWalker=B.NextAfterTokenWalker=B.AbstractNextPossibleTokensWalker=void 0;var Ty=Ai(),Yi=qt(cr()),zi=qt(ye()),Ey=qt(Ki()),ne=qt(hi()),gw=qt(Wi()),_w=qt($()),Ct=qt(Xe()),Ew=Po(),b=W(),Ay=function(e){kt(t,e);function t(r,n){var i=e.call(this)||this;return i.topProd=r,i.path=n,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Ct.default)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ct.default)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(r,n){n===void 0&&(n=[]),this.found||e.prototype.walk.call(this,r,n)},t.prototype.walkProdRef=function(r,n,i){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var a=n.concat(i);this.updateExpectedNext(),this.walk(r.referencedRule,a)}},t.prototype.updateExpectedNext=function(){(0,zi.default)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(Ty.RestWalker);B.AbstractNextPossibleTokensWalker=Ay;var Tw=function(e){kt(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.path=n,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return t.prototype.walkTerminal=function(r,n,i){if(this.isAtEndOfPath&&r.terminalType.name===this.nextTerminalName&&r.idx===this.nextTerminalOccurrence&&!this.found){var a=n.concat(i),o=new b.Alternative({definition:a});this.possibleTokTypes=(0,Ew.first)(o),this.found=!0}},t}(Ay);B.NextAfterTokenWalker=Tw;var En=function(e){kt(t,e);function t(r,n){var i=e.call(this)||this;return i.topRule=r,i.occurrence=n,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(Ty.RestWalker);B.AbstractNextTerminalAfterProductionWalker=En;var Aw=function(e){kt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.walkMany=function(r,n,i){if(r.idx===this.occurrence){var a=(0,Yi.default)(n.concat(i));this.result.isEndOfRule=a===void 0,a instanceof b.Terminal&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else e.prototype.walkMany.call(this,r,n,i)},t}(En);B.NextTerminalAfterManyWalker=Aw;var Ow=function(e){kt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.walkManySep=function(r,n,i){if(r.idx===this.occurrence){var a=(0,Yi.default)(n.concat(i));this.result.isEndOfRule=a===void 0,a instanceof b.Terminal&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else e.prototype.walkManySep.call(this,r,n,i)},t}(En);B.NextTerminalAfterManySepWalker=Ow;var Rw=function(e){kt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.walkAtLeastOne=function(r,n,i){if(r.idx===this.occurrence){var a=(0,Yi.default)(n.concat(i));this.result.isEndOfRule=a===void 0,a instanceof b.Terminal&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else e.prototype.walkAtLeastOne.call(this,r,n,i)},t}(En);B.NextTerminalAfterAtLeastOneWalker=Rw;var Sw=function(e){kt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.walkAtLeastOneSep=function(r,n,i){if(r.idx===this.occurrence){var a=(0,Yi.default)(n.concat(i));this.result.isEndOfRule=a===void 0,a instanceof b.Terminal&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else e.prototype.walkAtLeastOneSep.call(this,r,n,i)},t}(En);B.NextTerminalAfterAtLeastOneSepWalker=Sw;function Oy(e,t,r){r===void 0&&(r=[]),r=(0,Ct.default)(r);var n=[],i=0;function a(c){return c.concat((0,ne.default)(e,i+1))}function o(c){var f=Oy(a(c),t,r);return n.concat(f)}for(;r.length<t&&i<e.length;){var s=e[i];if(s instanceof b.Alternative)return o(s.definition);if(s instanceof b.NonTerminal)return o(s.definition);if(s instanceof b.Option)n=o(s.definition);else if(s instanceof b.RepetitionMandatory){var u=s.definition.concat([new b.Repetition({definition:s.definition})]);return o(u)}else if(s instanceof b.RepetitionMandatoryWithSeparator){var u=[new b.Alternative({definition:s.definition}),new b.Repetition({definition:[new b.Terminal({terminalType:s.separator})].concat(s.definition)})];return o(u)}else if(s instanceof b.RepetitionWithSeparator){var u=s.definition.concat([new b.Repetition({definition:[new b.Terminal({terminalType:s.separator})].concat(s.definition)})]);n=o(u)}else if(s instanceof b.Repetition){var u=s.definition.concat([new b.Repetition({definition:s.definition})]);n=o(u)}else{if(s instanceof b.Alternation)return(0,_w.default)(s.definition,function(c){(0,zi.default)(c.definition)===!1&&(n=o(c.definition))}),n;if(s instanceof b.Terminal)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:(0,ne.default)(e,i)}),n}B.possiblePathsFrom=Oy;function bw(e,t,r,n){var i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE",s=!1,u=t.length,c=u-n-1,f=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,zi.default)(d);){var h=d.pop();if(h===o){s&&(0,gw.default)(d).idx<=c&&d.pop();continue}var m=h.def,p=h.idx,v=h.ruleStack,y=h.occurrenceStack;if(!(0,zi.default)(m)){var g=m[0];if(g===i){var A={idx:p,def:(0,ne.default)(m),ruleStack:(0,Ey.default)(v),occurrenceStack:(0,Ey.default)(y)};d.push(A)}else if(g instanceof b.Terminal)if(p<u-1){var _=p+1,S=t[_];if(r(S,g.terminalType)){var A={idx:_,def:(0,ne.default)(m),ruleStack:v,occurrenceStack:y};d.push(A)}}else if(p===u-1)f.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:v,occurrenceStack:y}),s=!0;else throw Error("non exhaustive match");else if(g instanceof b.NonTerminal){var Y=(0,Ct.default)(v);Y.push(g.nonTerminalName);var q=(0,Ct.default)(y);q.push(g.idx);var A={idx:p,def:g.definition.concat(a,(0,ne.default)(m)),ruleStack:Y,occurrenceStack:q};d.push(A)}else if(g instanceof b.Option){var ae={idx:p,def:(0,ne.default)(m),ruleStack:v,occurrenceStack:y};d.push(ae),d.push(o);var Pe={idx:p,def:g.definition.concat((0,ne.default)(m)),ruleStack:v,occurrenceStack:y};d.push(Pe)}else if(g instanceof b.RepetitionMandatory){var J=new b.Repetition({definition:g.definition,idx:g.idx}),le=g.definition.concat([J],(0,ne.default)(m)),A={idx:p,def:le,ruleStack:v,occurrenceStack:y};d.push(A)}else if(g instanceof b.RepetitionMandatoryWithSeparator){var fe=new b.Terminal({terminalType:g.separator}),J=new b.Repetition({definition:[fe].concat(g.definition),idx:g.idx}),le=g.definition.concat([J],(0,ne.default)(m)),A={idx:p,def:le,ruleStack:v,occurrenceStack:y};d.push(A)}else if(g instanceof b.RepetitionWithSeparator){var ae={idx:p,def:(0,ne.default)(m),ruleStack:v,occurrenceStack:y};d.push(ae),d.push(o);var fe=new b.Terminal({terminalType:g.separator}),xe=new b.Repetition({definition:[fe].concat(g.definition),idx:g.idx}),le=g.definition.concat([xe],(0,ne.default)(m)),Pe={idx:p,def:le,ruleStack:v,occurrenceStack:y};d.push(Pe)}else if(g instanceof b.Repetition){var ae={idx:p,def:(0,ne.default)(m),ruleStack:v,occurrenceStack:y};d.push(ae),d.push(o);var xe=new b.Repetition({definition:g.definition,idx:g.idx}),le=g.definition.concat([xe],(0,ne.default)(m)),Pe={idx:p,def:le,ruleStack:v,occurrenceStack:y};d.push(Pe)}else if(g instanceof b.Alternation)for(var Ye=g.definition.length-1;Ye>=0;Ye--){var Ia=g.definition[Ye],Dr={idx:p,def:Ia.definition.concat((0,ne.default)(m)),ruleStack:v,occurrenceStack:y};d.push(Dr),d.push(o)}else if(g instanceof b.Alternative)d.push({idx:p,def:g.definition.concat((0,ne.default)(m)),ruleStack:v,occurrenceStack:y});else if(g instanceof b.Rule)d.push(Nw(g,p,v,y));else throw Error("non exhaustive match")}}return f}B.nextPossibleTokensAfter=bw;function Nw(e,t,r,n){var i=(0,Ct.default)(r);i.push(e.name);var a=(0,Ct.default)(n);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}});var vr=l(L=>{"use strict";var Ny=L&&L.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ft=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L,"__esModule",{value:!0});L.areTokenCategoriesNotUsed=L.isStrictPrefixOfPath=L.containsPath=L.getLookaheadPathsForOptionalProd=L.getLookaheadPathsForOr=L.lookAheadSequenceFromAlternatives=L.buildSingleAlternativeLookaheadFunction=L.buildAlternativesLookAheadFunc=L.buildLookaheadFuncForOptionalProd=L.buildLookaheadFuncForOr=L.getLookaheadPaths=L.getProdType=L.PROD_TYPE=void 0;var is=Ft(ye()),Iy=Ft(De()),wt=Ft(vn()),Xi=Ft(re()),Mt=Ft($()),Ry=Ft(he()),Ly=Ft(dt()),Sy=Tn(),Iw=Ai(),$i=Pt(),mt=W(),Lw=W(),V;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(V=L.PROD_TYPE||(L.PROD_TYPE={}));function Py(e){if(e instanceof mt.Option||e==="Option")return V.OPTION;if(e instanceof mt.Repetition||e==="Repetition")return V.REPETITION;if(e instanceof mt.RepetitionMandatory||e==="RepetitionMandatory")return V.REPETITION_MANDATORY;if(e instanceof mt.RepetitionMandatoryWithSeparator||e==="RepetitionMandatoryWithSeparator")return V.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof mt.RepetitionWithSeparator||e==="RepetitionWithSeparator")return V.REPETITION_WITH_SEPARATOR;if(e instanceof mt.Alternation||e==="Alternation")return V.ALTERNATION;throw Error("non exhaustive match")}L.getProdType=Py;function Pw(e){var t=e.occurrence,r=e.rule,n=e.prodType,i=e.maxLookahead,a=Py(n);return a===V.ALTERNATION?os(t,r,i):ss(t,r,a,i)}L.getLookaheadPaths=Pw;function xw(e,t,r,n,i,a){var o=os(e,t,r),s=us(o)?$i.tokenStructuredMatcherNoCategories:$i.tokenStructuredMatcher;return a(o,n,s,i)}L.buildLookaheadFuncForOr=xw;function Cw(e,t,r,n,i,a){var o=ss(e,t,i,r),s=us(o)?$i.tokenStructuredMatcherNoCategories:$i.tokenStructuredMatcher;return a(o[0],s,n)}L.buildLookaheadFuncForOptionalProd=Cw;function kw(e,t,r,n){var i=e.length,a=(0,wt.default)(e,function(u){return(0,wt.default)(u,function(c){return c.length===1})});if(t)return function(u){for(var c=(0,Xi.default)(u,function(_){return _.GATE}),f=0;f<i;f++){var d=e[f],h=d.length,m=c[f];if(!(m!==void 0&&m.call(this)===!1))e:for(var p=0;p<h;p++){for(var v=d[p],y=v.length,g=0;g<y;g++){var A=this.LA(g+1);if(r(A,v[g])===!1)continue e}return f}}};if(a&&!n){var o=(0,Xi.default)(e,function(u){return(0,Iy.default)(u)}),s=(0,Ly.default)(o,function(u,c,f){return(0,Mt.default)(c,function(d){(0,Ry.default)(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),(0,Mt.default)(d.categoryMatches,function(h){(0,Ry.default)(u,h)||(u[h]=f)})}),u},{});return function(){var u=this.LA(1);return s[u.tokenTypeIdx]}}else return function(){for(var u=0;u<i;u++){var c=e[u],f=c.length;e:for(var d=0;d<f;d++){for(var h=c[d],m=h.length,p=0;p<m;p++){var v=this.LA(p+1);if(r(v,h[p])===!1)continue e}return u}}}}L.buildAlternativesLookAheadFunc=kw;function qw(e,t,r){var n=(0,wt.default)(e,function(c){return c.length===1}),i=e.length;if(n&&!r){var a=(0,Iy.default)(e);if(a.length===1&&(0,is.default)(a[0].categoryMatches)){var o=a[0],s=o.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{var u=(0,Ly.default)(a,function(c,f,d){return c[f.tokenTypeIdx]=!0,(0,Mt.default)(f.categoryMatches,function(h){c[h]=!0}),c},[]);return function(){var c=this.LA(1);return u[c.tokenTypeIdx]===!0}}}else return function(){e:for(var c=0;c<i;c++){for(var f=e[c],d=f.length,h=0;h<d;h++){var m=this.LA(h+1);if(t(m,f[h])===!1)continue e}return!0}return!1}}L.buildSingleAlternativeLookaheadFunction=qw;var Mw=function(e){Ny(t,e);function t(r,n,i){var a=e.call(this)||this;return a.topProd=r,a.targetOccurrence=n,a.targetProdType=i,a}return t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(r,n,i,a){return r.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=i.concat(a),!0):!1},t.prototype.walkOption=function(r,n,i){this.checkIsTarget(r,V.OPTION,n,i)||e.prototype.walkOption.call(this,r,n,i)},t.prototype.walkAtLeastOne=function(r,n,i){this.checkIsTarget(r,V.REPETITION_MANDATORY,n,i)||e.prototype.walkOption.call(this,r,n,i)},t.prototype.walkAtLeastOneSep=function(r,n,i){this.checkIsTarget(r,V.REPETITION_MANDATORY_WITH_SEPARATOR,n,i)||e.prototype.walkOption.call(this,r,n,i)},t.prototype.walkMany=function(r,n,i){this.checkIsTarget(r,V.REPETITION,n,i)||e.prototype.walkOption.call(this,r,n,i)},t.prototype.walkManySep=function(r,n,i){this.checkIsTarget(r,V.REPETITION_WITH_SEPARATOR,n,i)||e.prototype.walkOption.call(this,r,n,i)},t}(Iw.RestWalker),xy=function(e){Ny(t,e);function t(r,n,i){var a=e.call(this)||this;return a.targetOccurrence=r,a.targetProdType=n,a.targetRef=i,a.result=[],a}return t.prototype.checkIsTarget=function(r,n){r.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||r===this.targetRef)&&(this.result=r.definition)},t.prototype.visitOption=function(r){this.checkIsTarget(r,V.OPTION)},t.prototype.visitRepetition=function(r){this.checkIsTarget(r,V.REPETITION)},t.prototype.visitRepetitionMandatory=function(r){this.checkIsTarget(r,V.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.checkIsTarget(r,V.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(r){this.checkIsTarget(r,V.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(r){this.checkIsTarget(r,V.ALTERNATION)},t}(Lw.GAstVisitor);function by(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}function ns(e){for(var t=[""],r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<t.length;a++){var o=t[a];i.push(o+"_"+n.tokenTypeIdx);for(var s=0;s<n.categoryMatches.length;s++){var u="_"+n.categoryMatches[s];i.push(o+u)}}t=i}return t}function ww(e,t,r){for(var n=0;n<e.length;n++)if(n!==r)for(var i=e[n],a=0;a<t.length;a++){var o=t[a];if(i[o]===!0)return!1}return!0}function as(e,t){for(var r=(0,Xi.default)(e,function(f){return(0,Sy.possiblePathsFrom)([f],1)}),n=by(r.length),i=(0,Xi.default)(r,function(f){var d={};return(0,Mt.default)(f,function(h){var m=ns(h.partialPath);(0,Mt.default)(m,function(p){d[p]=!0})}),d}),a=r,o=1;o<=t;o++){var s=a;a=by(s.length);for(var u=function(f){for(var d=s[f],h=0;h<d.length;h++){var m=d[h].partialPath,p=d[h].suffixDef,v=ns(m),y=ww(i,v,f);if(y||(0,is.default)(p)||m.length===t){var g=n[f];if(Cy(g,m)===!1){g.push(m);for(var A=0;A<v.length;A++){var _=v[A];i[f][_]=!0}}}else{var S=(0,Sy.possiblePathsFrom)(p,o+1,m);a[f]=a[f].concat(S),(0,Mt.default)(S,function(Y){var q=ns(Y.partialPath);(0,Mt.default)(q,function(ae){i[f][ae]=!0})})}}},c=0;c<s.length;c++)u(c)}return n}L.lookAheadSequenceFromAlternatives=as;function os(e,t,r,n){var i=new xy(e,V.ALTERNATION,n);return t.accept(i),as(i.result,r)}L.getLookaheadPathsForOr=os;function ss(e,t,r,n){var i=new xy(e,r);t.accept(i);var a=i.result,o=new Mw(t,e,r),s=o.startWalking(),u=new mt.Alternative({definition:a}),c=new mt.Alternative({definition:s});return as([u,c],n)}L.getLookaheadPathsForOptionalProd=ss;function Cy(e,t){e:for(var r=0;r<e.length;r++){var n=e[r];if(n.length===t.length){for(var i=0;i<n.length;i++){var a=t[i],o=n[i],s=a===o||o.categoryMatchesMap[a.tokenTypeIdx]!==void 0;if(s===!1)continue e}return!0}}return!1}L.containsPath=Cy;function Fw(e,t){return e.length<t.length&&(0,wt.default)(e,function(r,n){var i=t[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}L.isStrictPrefixOfPath=Fw;function us(e){return(0,wt.default)(e,function(t){return(0,wt.default)(t,function(r){return(0,wt.default)(r,function(n){return(0,is.default)(n.categoryMatches)})})})}L.areTokenCategoriesNotUsed=us});var Rn=l(I=>{"use strict";var ls=I&&I.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),cs=I&&I.__assign||function(){return cs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},cs.apply(this,arguments)},X=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I,"__esModule",{value:!0});I.checkPrefixAlternativesAmbiguities=I.validateSomeNonEmptyLookaheadPath=I.validateTooManyAlts=I.RepetitionCollector=I.validateAmbiguousAlternationAlternatives=I.validateEmptyOrAlternative=I.getFirstNoneTerminal=I.validateNoLeftRecursion=I.validateRuleIsOverridden=I.validateRuleDoesNotAlreadyExist=I.OccurrenceValidationCollector=I.identifyProductionForDuplicates=I.validateGrammar=I.validateLookahead=void 0;var ky=X(cr()),Zi=X(ye()),Dw=X(hi()),qy=X(De()),Uw=X(ki()),jw=X(Pi()),Bw=X(xi()),yt=X(re()),On=X($()),Gw=X(ts()),fs=X(dt()),Ww=X(Eo()),Vw=X(Ce()),ps=X(Ze()),it=X(rs()),Hw=X(Xe()),Le=ue(),ds=W(),mr=vr(),Kw=Tn(),Ie=W(),hs=W(),zw=X(Ki()),Yw=X(mn()),Xw=Pt();function $w(e){var t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return(0,yt.default)(t,function(r){return cs({type:Le.ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION},r)})}I.validateLookahead=$w;function Zw(e,t,r,n){var i=(0,it.default)(e,function(u){return Jw(u,r)}),a=i1(e,t,r),o=(0,it.default)(e,function(u){return By(u,r)}),s=(0,it.default)(e,function(u){return Dy(u,e,n,r)});return i.concat(a,o,s)}I.validateGrammar=Zw;function Jw(e,t){var r=new Fy;e.accept(r);var n=r.allProductions,i=(0,Gw.default)(n,My),a=(0,Ww.default)(i,function(s){return s.length>1}),o=(0,yt.default)((0,Vw.default)(a),function(s){var u=(0,ky.default)(s),c=t.buildDuplicateFoundError(e,s),f=(0,ds.getProductionDslName)(u),d={message:c,type:Le.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:f,occurrence:u.idx},h=wy(u);return h&&(d.parameter=h),d});return o}function My(e){return"".concat((0,ds.getProductionDslName)(e),"_#_").concat(e.idx,"_#_").concat(wy(e))}I.identifyProductionForDuplicates=My;function wy(e){return e instanceof Ie.Terminal?e.terminalType.name:e instanceof Ie.NonTerminal?e.nonTerminalName:""}var Fy=function(e){ls(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.allProductions=[],r}return t.prototype.visitNonTerminal=function(r){this.allProductions.push(r)},t.prototype.visitOption=function(r){this.allProductions.push(r)},t.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},t.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},t.prototype.visitRepetition=function(r){this.allProductions.push(r)},t.prototype.visitAlternation=function(r){this.allProductions.push(r)},t.prototype.visitTerminal=function(r){this.allProductions.push(r)},t}(hs.GAstVisitor);I.OccurrenceValidationCollector=Fy;function Dy(e,t,r,n){var i=[],a=(0,fs.default)(t,function(s,u){return u.name===e.name?s+1:s},0);if(a>1){var o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:o,type:Le.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}I.validateRuleDoesNotAlreadyExist=Dy;function Qw(e,t,r){var n=[],i;return(0,ps.default)(t,e)||(i="Invalid rule override, rule: ->".concat(e,"<- cannot be overridden in the grammar: ->").concat(r,"<-")+"as it is not defined in any of the super grammars ",n.push({message:i,type:Le.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),n}I.validateRuleIsOverridden=Qw;function Uy(e,t,r,n){n===void 0&&(n=[]);var i=[],a=An(t.definition);if((0,Zi.default)(a))return[];var o=e.name,s=(0,ps.default)(a,e);s&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Le.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var u=(0,Bw.default)(a,n.concat([e])),c=(0,it.default)(u,function(f){var d=(0,Hw.default)(n);return d.push(f),Uy(e,f,r,d)});return i.concat(c)}I.validateNoLeftRecursion=Uy;function An(e){var t=[];if((0,Zi.default)(e))return t;var r=(0,ky.default)(e);if(r instanceof Ie.NonTerminal)t.push(r.referencedRule);else if(r instanceof Ie.Alternative||r instanceof Ie.Option||r instanceof Ie.RepetitionMandatory||r instanceof Ie.RepetitionMandatoryWithSeparator||r instanceof Ie.RepetitionWithSeparator||r instanceof Ie.Repetition)t=t.concat(An(r.definition));else if(r instanceof Ie.Alternation)t=(0,qy.default)((0,yt.default)(r.definition,function(o){return An(o.definition)}));else if(!(r instanceof Ie.Terminal))throw Error("non exhaustive match");var n=(0,ds.isOptionalProd)(r),i=e.length>1;if(n&&i){var a=(0,Dw.default)(e);return t.concat(An(a))}else return t}I.getFirstNoneTerminal=An;var vs=function(e){ls(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.alternations=[],r}return t.prototype.visitAlternation=function(r){this.alternations.push(r)},t}(hs.GAstVisitor);function e1(e,t){var r=new vs;e.accept(r);var n=r.alternations,i=(0,it.default)(n,function(a){var o=(0,zw.default)(a.definition);return(0,it.default)(o,function(s,u){var c=(0,Kw.nextPossibleTokensAfter)([s],[],Xw.tokenStructuredMatcher,1);return(0,Zi.default)(c)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:a,emptyChoiceIdx:u}),type:Le.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:a.idx,alternative:u+1}]:[]})});return i}I.validateEmptyOrAlternative=e1;function t1(e,t,r){var n=new vs;e.accept(n);var i=n.alternations;i=(0,jw.default)(i,function(o){return o.ignoreAmbiguities===!0});var a=(0,it.default)(i,function(o){var s=o.idx,u=o.maxLookahead||t,c=(0,mr.getLookaheadPathsForOr)(s,e,u,o),f=n1(c,o,e,r),d=Gy(c,o,e,r);return f.concat(d)});return a}I.validateAmbiguousAlternationAlternatives=t1;var jy=function(e){ls(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.allProductions=[],r}return t.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},t.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},t.prototype.visitRepetition=function(r){this.allProductions.push(r)},t}(hs.GAstVisitor);I.RepetitionCollector=jy;function By(e,t){var r=new vs;e.accept(r);var n=r.alternations,i=(0,it.default)(n,function(a){return a.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:a}),type:Le.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:a.idx}]:[]});return i}I.validateTooManyAlts=By;function r1(e,t,r){var n=[];return(0,On.default)(e,function(i){var a=new jy;i.accept(a);var o=a.allProductions;(0,On.default)(o,function(s){var u=(0,mr.getProdType)(s),c=s.maxLookahead||t,f=s.idx,d=(0,mr.getLookaheadPathsForOptionalProd)(f,i,u,c),h=d[0];if((0,Zi.default)((0,qy.default)(h))){var m=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:m,type:Le.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}I.validateSomeNonEmptyLookaheadPath=r1;function n1(e,t,r,n){var i=[],a=(0,fs.default)(e,function(s,u,c){return t.definition[c].ignoreAmbiguities===!0||(0,On.default)(u,function(f){var d=[c];(0,On.default)(e,function(h,m){c!==m&&(0,mr.containsPath)(h,f)&&t.definition[m].ignoreAmbiguities!==!0&&d.push(m)}),d.length>1&&!(0,mr.containsPath)(i,f)&&(i.push(f),s.push({alts:d,path:f}))}),s},[]),o=(0,yt.default)(a,function(s){var u=(0,yt.default)(s.alts,function(f){return f+1}),c=n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:u,prefixPath:s.path});return{message:c,type:Le.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:s.alts}});return o}function Gy(e,t,r,n){var i=(0,fs.default)(e,function(o,s,u){var c=(0,yt.default)(s,function(f){return{idx:u,path:f}});return o.concat(c)},[]),a=(0,Yw.default)((0,it.default)(i,function(o){var s=t.definition[o.idx];if(s.ignoreAmbiguities===!0)return[];var u=o.idx,c=o.path,f=(0,Uw.default)(i,function(h){return t.definition[h.idx].ignoreAmbiguities!==!0&&h.idx<u&&(0,mr.isStrictPrefixOfPath)(h.path,c)}),d=(0,yt.default)(f,function(h){var m=[h.idx+1,u+1],p=t.idx===0?"":t.idx,v=n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:m,prefixPath:h.path});return{message:v,type:Le.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:p,alternatives:m}});return d}));return a}I.checkPrefixAlternativesAmbiguities=Gy;function i1(e,t,r){var n=[],i=(0,yt.default)(t,function(a){return a.name});return(0,On.default)(e,function(a){var o=a.name;if((0,ps.default)(i,o)){var s=r.buildNamespaceConflictError(a);n.push({message:s,type:Le.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}});var Ky=l(gt=>{"use strict";var Wy=gt&>.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gt,"__esModule",{value:!0});gt.validateGrammar=gt.resolveGrammar=void 0;var a1=Wy($()),Vy=Wy(ko()),o1=ly(),s1=Rn(),Hy=hr();function u1(e){var t=(0,Vy.default)(e,{errMsgProvider:Hy.defaultGrammarResolverErrorProvider}),r={};return(0,a1.default)(e.rules,function(n){r[n.name]=n}),(0,o1.resolveGrammar)(r,t.errMsgProvider)}gt.resolveGrammar=u1;function c1(e){return e=(0,Vy.default)(e,{errMsgProvider:Hy.defaultGrammarValidatorErrorProvider}),(0,s1.validateGrammar)(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}gt.validateGrammar=c1});var yr=l(te=>{"use strict";var Sn=te&&te.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),l1=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.EarlyExitException=te.NotAllInputParsedException=te.NoViableAltException=te.MismatchedTokenException=te.isRecognitionException=void 0;var f1=l1(Ze()),zy="MismatchedTokenException",Yy="NoViableAltException",Xy="EarlyExitException",$y="NotAllInputParsedException",Zy=[zy,Yy,Xy,$y];Object.freeze(Zy);function p1(e){return(0,f1.default)(Zy,e.name)}te.isRecognitionException=p1;var Ji=function(e){Sn(t,e);function t(r,n){var i=this.constructor,a=e.call(this,r)||this;return a.token=n,a.resyncedTokens=[],Object.setPrototypeOf(a,i.prototype),Error.captureStackTrace&&Error.captureStackTrace(a,a.constructor),a}return t}(Error),d1=function(e){Sn(t,e);function t(r,n,i){var a=e.call(this,r,n)||this;return a.previousToken=i,a.name=zy,a}return t}(Ji);te.MismatchedTokenException=d1;var h1=function(e){Sn(t,e);function t(r,n,i){var a=e.call(this,r,n)||this;return a.previousToken=i,a.name=Yy,a}return t}(Ji);te.NoViableAltException=h1;var v1=function(e){Sn(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.name=$y,i}return t}(Ji);te.NotAllInputParsedException=v1;var m1=function(e){Sn(t,e);function t(r,n,i){var a=e.call(this,r,n)||this;return a.previousToken=i,a.name=Xy,a}return t}(Ji);te.EarlyExitException=m1});var ys=l(H=>{"use strict";var y1=H&&H.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),_t=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H,"__esModule",{value:!0});H.attemptInRepetitionRecovery=H.Recoverable=H.InRuleRecoveryException=H.IN_RULE_RECOVERY_EXCEPTION=H.EOF_FOLLOW_KEY=void 0;var bn=xt(),g1=_t(ye()),Jy=_t(Ki()),_1=_t(De()),ms=_t(re()),Qy=_t(Ci()),E1=_t(he()),T1=_t(Ze()),A1=_t(Xe()),O1=yr(),R1=xo(),S1=ue();H.EOF_FOLLOW_KEY={};H.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";var eg=function(e){y1(t,e);function t(r){var n=e.call(this,r)||this;return n.name=H.IN_RULE_RECOVERY_EXCEPTION,n}return t}(Error);H.InRuleRecoveryException=eg;var b1=function(){function e(){}return e.prototype.initRecoverable=function(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,E1.default)(t,"recoveryEnabled")?t.recoveryEnabled:S1.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=tg)},e.prototype.getTokenToInsert=function(t){var r=(0,bn.createTokenInstance)(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r},e.prototype.canTokenTypeBeInsertedInRecovery=function(t){return!0},e.prototype.canTokenTypeBeDeletedInRecovery=function(t){return!0},e.prototype.tryInRepetitionRecovery=function(t,r,n,i){for(var a=this,o=this.findReSyncTokenType(),s=this.exportLexerState(),u=[],c=!1,f=this.LA(1),d=this.LA(1),h=function(){var m=a.LA(0),p=a.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:f,previous:m,ruleName:a.getCurrRuleFullName()}),v=new O1.MismatchedTokenException(p,f,a.LA(0));v.resyncedTokens=(0,Jy.default)(u),a.SAVE_ERROR(v)};!c;)if(this.tokenMatcher(d,i)){h();return}else if(n.call(this)){h(),t.apply(this,r);return}else this.tokenMatcher(d,o)?c=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,u));this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(t,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,r)))},e.prototype.getFollowsForInRuleRecovery=function(t,r){var n=this.getCurrentGrammarPath(t,r),i=this.getNextPossibleTokenTypes(n);return i},e.prototype.tryInRuleRecovery=function(t,r){if(this.canRecoverWithSingleTokenInsertion(t,r)){var n=this.getTokenToInsert(t);return n}if(this.canRecoverWithSingleTokenDeletion(t)){var i=this.SKIP_TOKEN();return this.consumeToken(),i}throw new eg("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(t,r){return this.canRecoverWithSingleTokenInsertion(t,r)||this.canRecoverWithSingleTokenDeletion(t)},e.prototype.canRecoverWithSingleTokenInsertion=function(t,r){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(t)||(0,g1.default)(r))return!1;var i=this.LA(1),a=(0,Qy.default)(r,function(o){return n.tokenMatcher(i,o)})!==void 0;return a},e.prototype.canRecoverWithSingleTokenDeletion=function(t){if(!this.canTokenTypeBeDeletedInRecovery(t))return!1;var r=this.tokenMatcher(this.LA(2),t);return r},e.prototype.isInCurrentRuleReSyncSet=function(t){var r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return(0,T1.default)(n,t)},e.prototype.findReSyncTokenType=function(){for(var t=this.flattenFollowSet(),r=this.LA(1),n=2;;){var i=(0,Qy.default)(t,function(a){var o=(0,bn.tokenMatcher)(r,a);return o});if(i!==void 0)return i;r=this.LA(n),n++}},e.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return H.EOF_FOLLOW_KEY;var t=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var t=this,r=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return(0,ms.default)(r,function(i,a){return a===0?H.EOF_FOLLOW_KEY:{ruleName:t.shortRuleNameToFullName(i),idxInCallingRule:n[a],inRule:t.shortRuleNameToFullName(r[a-1])}})},e.prototype.flattenFollowSet=function(){var t=this,r=(0,ms.default)(this.buildFullFollowKeyStack(),function(n){return t.getFollowSetFromFollowKey(n)});return(0,_1.default)(r)},e.prototype.getFollowSetFromFollowKey=function(t){if(t===H.EOF_FOLLOW_KEY)return[bn.EOF];var r=t.ruleName+t.idxInCallingRule+R1.IN+t.inRule;return this.resyncFollows[r]},e.prototype.addToResyncTokens=function(t,r){return this.tokenMatcher(t,bn.EOF)||r.push(t),r},e.prototype.reSyncTo=function(t){for(var r=[],n=this.LA(1);this.tokenMatcher(n,t)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return(0,Jy.default)(r)},e.prototype.attemptInRepetitionRecovery=function(t,r,n,i,a,o,s){},e.prototype.getCurrentGrammarPath=function(t,r){var n=this.getHumanReadableRuleStack(),i=(0,A1.default)(this.RULE_OCCURRENCE_STACK),a={ruleStack:n,occurrenceStack:i,lastTok:t,lastTokOccurrence:r};return a},e.prototype.getHumanReadableRuleStack=function(){var t=this;return(0,ms.default)(this.RULE_STACK,function(r){return t.shortRuleNameToFullName(r)})},e}();H.Recoverable=b1;function tg(e,t,r,n,i,a,o){var s=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[s];if(u===void 0){var c=this.getCurrRuleFullName(),f=this.getGAstProductions()[c],d=new a(f,i);u=d.startWalking(),this.firstAfterRepMap[s]=u}var h=u.token,m=u.occurrence,p=u.isEndOfRule;this.RULE_STACK.length===1&&p&&h===void 0&&(h=bn.EOF,m=1),!(h===void 0||m===void 0)&&this.shouldInRepetitionRecoveryBeTried(h,m,o)&&this.tryInRepetitionRecovery(e,t,r,h)}H.attemptInRepetitionRecovery=tg});var Qi=l(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.getKeyForAutomaticLookahead=C.AT_LEAST_ONE_SEP_IDX=C.MANY_SEP_IDX=C.AT_LEAST_ONE_IDX=C.MANY_IDX=C.OPTION_IDX=C.OR_IDX=C.BITS_FOR_ALT_IDX=C.BITS_FOR_RULE_IDX=C.BITS_FOR_OCCURRENCE_IDX=C.BITS_FOR_METHOD_TYPE=void 0;C.BITS_FOR_METHOD_TYPE=4;C.BITS_FOR_OCCURRENCE_IDX=8;C.BITS_FOR_RULE_IDX=12;C.BITS_FOR_ALT_IDX=8;C.OR_IDX=1<<C.BITS_FOR_OCCURRENCE_IDX;C.OPTION_IDX=2<<C.BITS_FOR_OCCURRENCE_IDX;C.MANY_IDX=3<<C.BITS_FOR_OCCURRENCE_IDX;C.AT_LEAST_ONE_IDX=4<<C.BITS_FOR_OCCURRENCE_IDX;C.MANY_SEP_IDX=5<<C.BITS_FOR_OCCURRENCE_IDX;C.AT_LEAST_ONE_SEP_IDX=6<<C.BITS_FOR_OCCURRENCE_IDX;function N1(e,t,r){return r|t|e}C.getKeyForAutomaticLookahead=N1;var iH=32-C.BITS_FOR_ALT_IDX});var _s=l(Et=>{"use strict";var ea=Et&&Et.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))},rg=Et&&Et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.LLkLookaheadStrategy=void 0;var gs=rg(rs()),I1=rg(ye()),ta=hr(),L1=ue(),ra=Rn(),Nn=vr(),P1=function(){function e(t){var r;this.maxLookahead=(r=t?.maxLookahead)!==null&&r!==void 0?r:L1.DEFAULT_PARSER_CONFIG.maxLookahead}return e.prototype.validate=function(t){var r=this.validateNoLeftRecursion(t.rules);if((0,I1.default)(r)){var n=this.validateEmptyOrAlternatives(t.rules),i=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead),o=ea(ea(ea(ea([],r,!0),n,!0),i,!0),a,!0);return o}return r},e.prototype.validateNoLeftRecursion=function(t){return(0,gs.default)(t,function(r){return(0,ra.validateNoLeftRecursion)(r,r,ta.defaultGrammarValidatorErrorProvider)})},e.prototype.validateEmptyOrAlternatives=function(t){return(0,gs.default)(t,function(r){return(0,ra.validateEmptyOrAlternative)(r,ta.defaultGrammarValidatorErrorProvider)})},e.prototype.validateAmbiguousAlternationAlternatives=function(t,r){return(0,gs.default)(t,function(n){return(0,ra.validateAmbiguousAlternationAlternatives)(n,r,ta.defaultGrammarValidatorErrorProvider)})},e.prototype.validateSomeNonEmptyLookaheadPath=function(t,r){return(0,ra.validateSomeNonEmptyLookaheadPath)(t,r,ta.defaultGrammarValidatorErrorProvider)},e.prototype.buildLookaheadForAlternation=function(t){return(0,Nn.buildLookaheadFuncForOr)(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,Nn.buildAlternativesLookAheadFunc)},e.prototype.buildLookaheadForOptional=function(t){return(0,Nn.buildLookaheadFuncForOptionalProd)(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,(0,Nn.getProdType)(t.prodType),Nn.buildSingleAlternativeLookaheadFunction)},e}();Et.LLkLookaheadStrategy=P1});var og=l(Ge=>{"use strict";var x1=Ge&&Ge.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ig=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.collectMethods=Ge.LooksAhead=void 0;var Dt=ig($()),Es=ig(he()),ng=ue(),at=Qi(),C1=W(),gr=W(),k1=_s(),q1=function(){function e(){}return e.prototype.initLooksAhead=function(t){this.dynamicTokensEnabled=(0,Es.default)(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:ng.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,Es.default)(t,"maxLookahead")?t.maxLookahead:ng.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookaheadStrategy=(0,Es.default)(t,"lookaheadStrategy")?t.lookaheadStrategy:new k1.LLkLookaheadStrategy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map},e.prototype.preComputeLookaheadFunctions=function(t){var r=this;(0,Dt.default)(t,function(n){r.TRACE_INIT("".concat(n.name," Rule Lookahead"),function(){var i=ag(n),a=i.alternation,o=i.repetition,s=i.option,u=i.repetitionMandatory,c=i.repetitionMandatoryWithSeparator,f=i.repetitionWithSeparator;(0,Dt.default)(a,function(d){var h=d.idx===0?"":d.idx;r.TRACE_INIT("".concat((0,gr.getProductionDslName)(d)).concat(h),function(){var m=r.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:d.idx,rule:n,maxLookahead:d.maxLookahead||r.maxLookahead,hasPredicates:d.hasPredicates,dynamicTokensEnabled:r.dynamicTokensEnabled}),p=(0,at.getKeyForAutomaticLookahead)(r.fullRuleNameToShort[n.name],at.OR_IDX,d.idx);r.setLaFuncCache(p,m)})}),(0,Dt.default)(o,function(d){r.computeLookaheadFunc(n,d.idx,at.MANY_IDX,"Repetition",d.maxLookahead,(0,gr.getProductionDslName)(d))}),(0,Dt.default)(s,function(d){r.computeLookaheadFunc(n,d.idx,at.OPTION_IDX,"Option",d.maxLookahead,(0,gr.getProductionDslName)(d))}),(0,Dt.default)(u,function(d){r.computeLookaheadFunc(n,d.idx,at.AT_LEAST_ONE_IDX,"RepetitionMandatory",d.maxLookahead,(0,gr.getProductionDslName)(d))}),(0,Dt.default)(c,function(d){r.computeLookaheadFunc(n,d.idx,at.AT_LEAST_ONE_SEP_IDX,"RepetitionMandatoryWithSeparator",d.maxLookahead,(0,gr.getProductionDslName)(d))}),(0,Dt.default)(f,function(d){r.computeLookaheadFunc(n,d.idx,at.MANY_SEP_IDX,"RepetitionWithSeparator",d.maxLookahead,(0,gr.getProductionDslName)(d))})})})},e.prototype.computeLookaheadFunc=function(t,r,n,i,a,o){var s=this;this.TRACE_INIT("".concat(o).concat(r===0?"":r),function(){var u=s.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:t,maxLookahead:a||s.maxLookahead,dynamicTokensEnabled:s.dynamicTokensEnabled,prodType:i}),c=(0,at.getKeyForAutomaticLookahead)(s.fullRuleNameToShort[t.name],n,r);s.setLaFuncCache(c,u)})},e.prototype.getKeyForAutomaticLookahead=function(t,r){var n=this.getLastExplicitRuleShortName();return(0,at.getKeyForAutomaticLookahead)(n,t,r)},e.prototype.getLaFuncFromCache=function(t){return this.lookAheadFuncsCache.get(t)},e.prototype.setLaFuncCache=function(t,r){this.lookAheadFuncsCache.set(t,r)},e}();Ge.LooksAhead=q1;var M1=function(e){x1(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},r}return t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitOption=function(r){this.dslMethods.option.push(r)},t.prototype.visitRepetitionWithSeparator=function(r){this.dslMethods.repetitionWithSeparator.push(r)},t.prototype.visitRepetitionMandatory=function(r){this.dslMethods.repetitionMandatory.push(r)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.dslMethods.repetitionMandatoryWithSeparator.push(r)},t.prototype.visitRepetition=function(r){this.dslMethods.repetition.push(r)},t.prototype.visitAlternation=function(r){this.dslMethods.alternation.push(r)},t}(C1.GAstVisitor),na=new M1;function ag(e){na.reset(),e.accept(na);var t=na.dslMethods;return na.reset(),t}Ge.collectMethods=ag});var sg=l(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.addNoneTerminalToCst=We.addTerminalToCst=We.setNodeLocationFull=We.setNodeLocationOnlyOffset=void 0;function w1(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}We.setNodeLocationOnlyOffset=w1;function F1(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}We.setNodeLocationFull=F1;function D1(e,t,r){e.children[r]===void 0?e.children[r]=[t]:e.children[r].push(t)}We.addTerminalToCst=D1;function U1(e,t,r){e.children[t]===void 0?e.children[t]=[r]:e.children[t].push(r)}We.addNoneTerminalToCst=U1});var ug=l(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.defineNameProp=void 0;var j1="name";function B1(e,t){Object.defineProperty(e,j1,{enumerable:!1,configurable:!0,writable:!1,value:t})}ia.defineNameProp=B1});var vg=l(Z=>{"use strict";var ot=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z,"__esModule",{value:!0});Z.validateMissingCstMethods=Z.validateVisitor=Z.CstVisitorDefinitionError=Z.createBaseVisitorConstructorWithDefaults=Z.createBaseSemanticVisitorConstructor=Z.defaultVisit=void 0;var G1=ot(ye()),W1=ot(mn()),V1=ot(k()),cg=ot(re()),H1=ot($()),K1=ot(ki()),z1=ot(de()),Y1=ot(Gt()),X1=ot(Nt()),lg=ug();function fg(e,t){for(var r=(0,z1.default)(e),n=r.length,i=0;i<n;i++)for(var a=r[i],o=e[a],s=o.length,u=0;u<s;u++){var c=o[u];c.tokenTypeIdx===void 0&&this[c.name](c.children,t)}}Z.defaultVisit=fg;function $1(e,t){var r=function(){};(0,lg.defineNameProp)(r,e+"BaseSemantics");var n={visit:function(i,a){if((0,V1.default)(i)&&(i=i[0]),!(0,X1.default)(i))return this[i.name](i.children,a)},validateVisitor:function(){var i=dg(this,t);if(!(0,G1.default)(i)){var a=(0,cg.default)(i,function(o){return o.msg});throw Error("Errors Detected in CST Visitor <".concat(this.constructor.name,`>:
|
|
86
|
+
`)+"".concat(a.join(`
|
|
87
|
+
|
|
88
|
+
`).replace(/\n/g,`
|
|
89
|
+
`)))}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}Z.createBaseSemanticVisitorConstructor=$1;function Z1(e,t,r){var n=function(){};(0,lg.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,H1.default)(t,function(a){i[a]=fg}),n.prototype=i,n.prototype.constructor=n,n}Z.createBaseVisitorConstructorWithDefaults=Z1;var pg;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(pg=Z.CstVisitorDefinitionError||(Z.CstVisitorDefinitionError={}));function dg(e,t){var r=hg(e,t);return r}Z.validateVisitor=dg;function hg(e,t){var r=(0,K1.default)(t,function(i){return(0,Y1.default)(e[i])===!1}),n=(0,cg.default)(r,function(i){return{msg:"Missing visitor method: <".concat(i,"> on ").concat(e.constructor.name," CST Visitor."),type:pg.MISSING_METHOD,methodName:i}});return(0,W1.default)(n)}Z.validateMissingCstMethods=hg});var _g=l(Er=>{"use strict";var aa=Er&&Er.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0});Er.TreeBuilder=void 0;var _r=sg(),ie=aa(Ri()),J1=aa(he()),mg=aa(de()),yg=aa(Nt()),gg=vg(),Q1=ue(),eF=function(){function e(){}return e.prototype.initTreeBuilder=function(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=(0,J1.default)(t,"nodeLocationTracking")?t.nodeLocationTracking:Q1.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ie.default,this.cstFinallyStateUpdate=ie.default,this.cstPostTerminal=ie.default,this.cstPostNonTerminal=ie.default,this.cstPostRule=ie.default;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_r.setNodeLocationFull,this.setNodeLocationFromNode=_r.setNodeLocationFull,this.cstPostRule=ie.default,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ie.default,this.setNodeLocationFromNode=ie.default,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_r.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=_r.setNodeLocationOnlyOffset,this.cstPostRule=ie.default,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ie.default,this.setNodeLocationFromNode=ie.default,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ie.default,this.setNodeLocationFromNode=ie.default,this.cstPostRule=ie.default,this.setInitialNodeLocation=ie.default;else throw Error('Invalid <nodeLocationTracking> config option: "'.concat(t.nodeLocationTracking,'"'))},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(t){t.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(t){var r=this.LA(1);t.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(t){var r={name:t,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(t){var r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(t){var r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(t,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,_r.addTerminalToCst)(n,r,t),this.setNodeLocationFromToken(n.location,r)},e.prototype.cstPostNonTerminal=function(t,r){var n=this.CST_STACK[this.CST_STACK.length-1];(0,_r.addNoneTerminalToCst)(n,r,t),this.setNodeLocationFromNode(n.location,t.location)},e.prototype.getBaseCstVisitorConstructor=function(){if((0,yg.default)(this.baseCstVisitorConstructor)){var t=(0,gg.createBaseSemanticVisitorConstructor)(this.className,(0,mg.default)(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,yg.default)(this.baseCstVisitorWithDefaultsConstructor)){var t=(0,gg.createBaseVisitorConstructorWithDefaults)(this.className,(0,mg.default)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var t=this.RULE_STACK;return t[t.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var t=this.RULE_STACK;return t[t.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]},e}();Er.TreeBuilder=eF});var Tg=l(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.LexerAdapter=void 0;var Eg=ue(),tF=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(t){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Eg.END_OF_FILE},e.prototype.LA=function(t){var r=this.currIdx+t;return r<0||this.tokVectorLength<=r?Eg.END_OF_FILE:this.tokVector[r]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(t){this.currIdx=t},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}();oa.LexerAdapter=tF});var Og=l(Tr=>{"use strict";var Ag=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.RecognizerApi=void 0;var rF=Ag(Ce()),nF=Ag(Ze()),iF=yr(),Ts=ue(),aF=hr(),oF=Rn(),sF=W(),uF=function(){function e(){}return e.prototype.ACTION=function(t){return t.call(this)},e.prototype.consume=function(t,r,n){return this.consumeInternal(r,t,n)},e.prototype.subrule=function(t,r,n){return this.subruleInternal(r,t,n)},e.prototype.option=function(t,r){return this.optionInternal(r,t)},e.prototype.or=function(t,r){return this.orInternal(r,t)},e.prototype.many=function(t,r){return this.manyInternal(t,r)},e.prototype.atLeastOne=function(t,r){return this.atLeastOneInternal(t,r)},e.prototype.CONSUME=function(t,r){return this.consumeInternal(t,0,r)},e.prototype.CONSUME1=function(t,r){return this.consumeInternal(t,1,r)},e.prototype.CONSUME2=function(t,r){return this.consumeInternal(t,2,r)},e.prototype.CONSUME3=function(t,r){return this.consumeInternal(t,3,r)},e.prototype.CONSUME4=function(t,r){return this.consumeInternal(t,4,r)},e.prototype.CONSUME5=function(t,r){return this.consumeInternal(t,5,r)},e.prototype.CONSUME6=function(t,r){return this.consumeInternal(t,6,r)},e.prototype.CONSUME7=function(t,r){return this.consumeInternal(t,7,r)},e.prototype.CONSUME8=function(t,r){return this.consumeInternal(t,8,r)},e.prototype.CONSUME9=function(t,r){return this.consumeInternal(t,9,r)},e.prototype.SUBRULE=function(t,r){return this.subruleInternal(t,0,r)},e.prototype.SUBRULE1=function(t,r){return this.subruleInternal(t,1,r)},e.prototype.SUBRULE2=function(t,r){return this.subruleInternal(t,2,r)},e.prototype.SUBRULE3=function(t,r){return this.subruleInternal(t,3,r)},e.prototype.SUBRULE4=function(t,r){return this.subruleInternal(t,4,r)},e.prototype.SUBRULE5=function(t,r){return this.subruleInternal(t,5,r)},e.prototype.SUBRULE6=function(t,r){return this.subruleInternal(t,6,r)},e.prototype.SUBRULE7=function(t,r){return this.subruleInternal(t,7,r)},e.prototype.SUBRULE8=function(t,r){return this.subruleInternal(t,8,r)},e.prototype.SUBRULE9=function(t,r){return this.subruleInternal(t,9,r)},e.prototype.OPTION=function(t){return this.optionInternal(t,0)},e.prototype.OPTION1=function(t){return this.optionInternal(t,1)},e.prototype.OPTION2=function(t){return this.optionInternal(t,2)},e.prototype.OPTION3=function(t){return this.optionInternal(t,3)},e.prototype.OPTION4=function(t){return this.optionInternal(t,4)},e.prototype.OPTION5=function(t){return this.optionInternal(t,5)},e.prototype.OPTION6=function(t){return this.optionInternal(t,6)},e.prototype.OPTION7=function(t){return this.optionInternal(t,7)},e.prototype.OPTION8=function(t){return this.optionInternal(t,8)},e.prototype.OPTION9=function(t){return this.optionInternal(t,9)},e.prototype.OR=function(t){return this.orInternal(t,0)},e.prototype.OR1=function(t){return this.orInternal(t,1)},e.prototype.OR2=function(t){return this.orInternal(t,2)},e.prototype.OR3=function(t){return this.orInternal(t,3)},e.prototype.OR4=function(t){return this.orInternal(t,4)},e.prototype.OR5=function(t){return this.orInternal(t,5)},e.prototype.OR6=function(t){return this.orInternal(t,6)},e.prototype.OR7=function(t){return this.orInternal(t,7)},e.prototype.OR8=function(t){return this.orInternal(t,8)},e.prototype.OR9=function(t){return this.orInternal(t,9)},e.prototype.MANY=function(t){this.manyInternal(0,t)},e.prototype.MANY1=function(t){this.manyInternal(1,t)},e.prototype.MANY2=function(t){this.manyInternal(2,t)},e.prototype.MANY3=function(t){this.manyInternal(3,t)},e.prototype.MANY4=function(t){this.manyInternal(4,t)},e.prototype.MANY5=function(t){this.manyInternal(5,t)},e.prototype.MANY6=function(t){this.manyInternal(6,t)},e.prototype.MANY7=function(t){this.manyInternal(7,t)},e.prototype.MANY8=function(t){this.manyInternal(8,t)},e.prototype.MANY9=function(t){this.manyInternal(9,t)},e.prototype.MANY_SEP=function(t){this.manySepFirstInternal(0,t)},e.prototype.MANY_SEP1=function(t){this.manySepFirstInternal(1,t)},e.prototype.MANY_SEP2=function(t){this.manySepFirstInternal(2,t)},e.prototype.MANY_SEP3=function(t){this.manySepFirstInternal(3,t)},e.prototype.MANY_SEP4=function(t){this.manySepFirstInternal(4,t)},e.prototype.MANY_SEP5=function(t){this.manySepFirstInternal(5,t)},e.prototype.MANY_SEP6=function(t){this.manySepFirstInternal(6,t)},e.prototype.MANY_SEP7=function(t){this.manySepFirstInternal(7,t)},e.prototype.MANY_SEP8=function(t){this.manySepFirstInternal(8,t)},e.prototype.MANY_SEP9=function(t){this.manySepFirstInternal(9,t)},e.prototype.AT_LEAST_ONE=function(t){this.atLeastOneInternal(0,t)},e.prototype.AT_LEAST_ONE1=function(t){return this.atLeastOneInternal(1,t)},e.prototype.AT_LEAST_ONE2=function(t){this.atLeastOneInternal(2,t)},e.prototype.AT_LEAST_ONE3=function(t){this.atLeastOneInternal(3,t)},e.prototype.AT_LEAST_ONE4=function(t){this.atLeastOneInternal(4,t)},e.prototype.AT_LEAST_ONE5=function(t){this.atLeastOneInternal(5,t)},e.prototype.AT_LEAST_ONE6=function(t){this.atLeastOneInternal(6,t)},e.prototype.AT_LEAST_ONE7=function(t){this.atLeastOneInternal(7,t)},e.prototype.AT_LEAST_ONE8=function(t){this.atLeastOneInternal(8,t)},e.prototype.AT_LEAST_ONE9=function(t){this.atLeastOneInternal(9,t)},e.prototype.AT_LEAST_ONE_SEP=function(t){this.atLeastOneSepFirstInternal(0,t)},e.prototype.AT_LEAST_ONE_SEP1=function(t){this.atLeastOneSepFirstInternal(1,t)},e.prototype.AT_LEAST_ONE_SEP2=function(t){this.atLeastOneSepFirstInternal(2,t)},e.prototype.AT_LEAST_ONE_SEP3=function(t){this.atLeastOneSepFirstInternal(3,t)},e.prototype.AT_LEAST_ONE_SEP4=function(t){this.atLeastOneSepFirstInternal(4,t)},e.prototype.AT_LEAST_ONE_SEP5=function(t){this.atLeastOneSepFirstInternal(5,t)},e.prototype.AT_LEAST_ONE_SEP6=function(t){this.atLeastOneSepFirstInternal(6,t)},e.prototype.AT_LEAST_ONE_SEP7=function(t){this.atLeastOneSepFirstInternal(7,t)},e.prototype.AT_LEAST_ONE_SEP8=function(t){this.atLeastOneSepFirstInternal(8,t)},e.prototype.AT_LEAST_ONE_SEP9=function(t){this.atLeastOneSepFirstInternal(9,t)},e.prototype.RULE=function(t,r,n){if(n===void 0&&(n=Ts.DEFAULT_RULE_CONFIG),(0,nF.default)(this.definedRulesNames,t)){var i=aF.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),a={message:i,type:Ts.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(a)}this.definedRulesNames.push(t);var o=this.defineRule(t,r,n);return this[t]=o,o},e.prototype.OVERRIDE_RULE=function(t,r,n){n===void 0&&(n=Ts.DEFAULT_RULE_CONFIG);var i=(0,oF.validateRuleIsOverridden)(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);var a=this.defineRule(t,r,n);return this[t]=a,a},e.prototype.BACKTRACK=function(t,r){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return t.apply(this,r),!0}catch(i){if((0,iF.isRecognitionException)(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return(0,sF.serializeGrammar)((0,rF.default)(this.gastProductionsCache))},e}();Tr.RecognizerApi=uF});var xg=l(Or=>{"use strict";var Ve=Or&&Or.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Or,"__esModule",{value:!0});Or.RecognizerEngine=void 0;var Rg=Ve(ye()),As=Ve(k()),Os=Ve(De()),Sg=Ve(vn()),cF=Ve(Si()),lF=Ve(Oe()),In=Ve(he()),Ln=Ve(Ce()),bg=Ve(dt()),Ng=Ve(Xe()),me=Qi(),sa=yr(),Ig=vr(),Ar=Tn(),Lg=ue(),fF=ys(),Pg=xt(),Pn=Pt(),pF=function(){function e(){}return e.prototype.initRecognizerEngine=function(t,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Pn.tokenStructuredMatcherNoCategories,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,In.default)(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
90
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
91
|
+
For Further details.`);if((0,As.default)(t)){if((0,Rg.default)(t))throw Error(`A Token Vocabulary cannot be empty.
|
|
92
|
+
Note that the first argument for the parser constructor
|
|
93
|
+
is no longer a Token vector (since v4.0).`);if(typeof t[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
94
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
95
|
+
For Further details.`)}if((0,As.default)(t))this.tokensMap=(0,bg.default)(t,function(s,u){return s[u.name]=u,s},{});else if((0,In.default)(t,"modes")&&(0,Sg.default)((0,Os.default)((0,Ln.default)(t.modes)),Pn.isTokenType)){var n=(0,Os.default)((0,Ln.default)(t.modes)),i=(0,cF.default)(n);this.tokensMap=(0,bg.default)(i,function(s,u){return s[u.name]=u,s},{})}else if((0,lF.default)(t))this.tokensMap=(0,Ng.default)(t);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Pg.EOF;var a=(0,In.default)(t,"modes")?(0,Os.default)((0,Ln.default)(t.modes)):(0,Ln.default)(t),o=(0,Sg.default)(a,function(s){return(0,Rg.default)(s.categoryMatches)});this.tokenMatcher=o?Pn.tokenStructuredMatcherNoCategories:Pn.tokenStructuredMatcher,(0,Pn.augmentTokenTypes)((0,Ln.default)(this.tokensMap))},e.prototype.defineRule=function(t,r,n){if(this.selfAnalysisDone)throw Error("Grammar rule <".concat(t,`> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
96
|
+
`)+"Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var i=(0,In.default)(n,"resyncEnabled")?n.resyncEnabled:Lg.DEFAULT_RULE_CONFIG.resyncEnabled,a=(0,In.default)(n,"recoveryValueFunc")?n.recoveryValueFunc:Lg.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<<me.BITS_FOR_METHOD_TYPE+me.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=t,this.fullRuleNameToShort[t]=o;var s;this.outputCst===!0?s=function(){for(var f=[],d=0;d<arguments.length;d++)f[d]=arguments[d];try{this.ruleInvocationStateUpdate(o,t,this.subruleIdx),r.apply(this,f);var h=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(h),h}catch(m){return this.invokeRuleCatch(m,i,a)}finally{this.ruleFinallyStateUpdate()}}:s=function(){for(var f=[],d=0;d<arguments.length;d++)f[d]=arguments[d];try{return this.ruleInvocationStateUpdate(o,t,this.subruleIdx),r.apply(this,f)}catch(h){return this.invokeRuleCatch(h,i,a)}finally{this.ruleFinallyStateUpdate()}};var u=Object.assign(s,{ruleName:t,originalGrammarAction:r});return u},e.prototype.invokeRuleCatch=function(t,r,n){var i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if((0,sa.isRecognitionException)(t)){var o=t;if(a){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(o.resyncedTokens=this.reSyncTo(s),this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(t);else{if(this.outputCst){var u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,o.partialCstResult=u}throw o}}else{if(i)return this.moveToTerminatedState(),n(t);throw o}}else throw t},e.prototype.optionInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.OPTION_IDX,r);return this.optionInternalLogic(t,r,n)},e.prototype.optionInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof t!="function"){o=t.DEF;var s=t.GATE;if(s!==void 0){var u=a;a=function(){return s.call(i)&&u.call(i)}}}else o=t;if(a.call(this)===!0)return o.call(this)},e.prototype.atLeastOneInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.AT_LEAST_ONE_IDX,t);return this.atLeastOneInternalLogic(t,r,n)},e.prototype.atLeastOneInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;var s=r.GATE;if(s!==void 0){var u=a;a=function(){return s.call(i)&&u.call(i)}}}else o=r;if(a.call(this)===!0)for(var c=this.doSingleRepetition(o);a.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);else throw this.raiseEarlyExitException(t,Ig.PROD_TYPE.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,r],a,me.AT_LEAST_ONE_IDX,t,Ar.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.AT_LEAST_ONE_SEP_IDX,t);this.atLeastOneSepFirstInternalLogic(t,r,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(t,r,n){var i=this,a=r.DEF,o=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){a.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,u,a,Ar.NextTerminalAfterAtLeastOneSepWalker],u,me.AT_LEAST_ONE_SEP_IDX,t,Ar.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(t,Ig.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)},e.prototype.manyInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.MANY_IDX,t);return this.manyInternalLogic(t,r,n)},e.prototype.manyInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;var s=r.GATE;if(s!==void 0){var u=a;a=function(){return s.call(i)&&u.call(i)}}}else o=r;for(var c=!0;a.call(this)===!0&&c===!0;)c=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[t,r],a,me.MANY_IDX,t,Ar.NextTerminalAfterManyWalker,c)},e.prototype.manySepFirstInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.MANY_SEP_IDX,t);this.manySepFirstInternalLogic(t,r,n)},e.prototype.manySepFirstInternalLogic=function(t,r,n){var i=this,a=r.DEF,o=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){a.call(this);for(var u=function(){return i.tokenMatcher(i.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,u,a,Ar.NextTerminalAfterManySepWalker],u,me.MANY_SEP_IDX,t,Ar.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(t,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,r,n,i,a],n,me.AT_LEAST_ONE_SEP_IDX,t,a)},e.prototype.doSingleRepetition=function(t){var r=this.getLexerPosition();t.call(this);var n=this.getLexerPosition();return n>r},e.prototype.orInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(me.OR_IDX,r),i=(0,As.default)(t)?t:t.DEF,a=this.getLaFuncFromCache(n),o=a.call(this,i);if(o!==void 0){var s=i[o];return s.ALT.call(this)}this.raiseNoAltException(r,t.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var t=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new sa.NotAllInputParsedException(r,t))}},e.prototype.subruleInternal=function(t,r,n){var i;try{var a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=t.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:t.ruleName),i}catch(o){throw this.subruleInternalError(o,n,t.ruleName)}},e.prototype.subruleInternalError=function(t,r,n){throw(0,sa.isRecognitionException)(t)&&t.partialCstResult!==void 0&&(this.cstPostNonTerminal(t.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete t.partialCstResult),t},e.prototype.consumeInternal=function(t,r,n){var i;try{var a=this.LA(1);this.tokenMatcher(a,t)===!0?(this.consumeToken(),i=a):this.consumeInternalError(t,a,n)}catch(o){i=this.consumeInternalRecovery(t,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:t.name,i),i},e.prototype.consumeInternalError=function(t,r,n){var i,a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new sa.MismatchedTokenException(i,r,a))},e.prototype.consumeInternalRecovery=function(t,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){var i=this.getFollowsForInRuleRecovery(t,r);try{return this.tryInRuleRecovery(t,i)}catch(a){throw a.name===fF.IN_RULE_RECOVERY_EXCEPTION?n:a}}else throw n},e.prototype.saveRecogState=function(){var t=this.errors,r=(0,Ng.default)(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(t,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(r)},e.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},e.prototype.getCurrRuleFullName=function(){var t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]},e.prototype.shortRuleNameToFullName=function(t){return this.shortRuleNameToFull[t]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),Pg.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}();Or.RecognizerEngine=pF});var Mg=l(Rr=>{"use strict";var qg=Rr&&Rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.ErrorHandler=void 0;var Rs=yr(),dF=qg(he()),Cg=qg(Xe()),kg=vr(),hF=ue(),vF=function(){function e(){}return e.prototype.initErrorHandler=function(t){this._errors=[],this.errorMessageProvider=(0,dF.default)(t,"errorMessageProvider")?t.errorMessageProvider:hF.DEFAULT_PARSER_CONFIG.errorMessageProvider},e.prototype.SAVE_ERROR=function(t){if((0,Rs.isRecognitionException)(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,Cg.default)(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return(0,Cg.default)(this._errors)},set:function(t){this._errors=t},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(t,r,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=(0,kg.getLookaheadPathsForOptionalProd)(t,a,r,this.maxLookahead),s=o[0],u=[],c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));var f=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Rs.EarlyExitException(f,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(t,r){for(var n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=(0,kg.getLookaheadPathsForOr)(t,i,this.maxLookahead),o=[],s=1;s<=this.maxLookahead;s++)o.push(this.LA(s));var u=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:o,previous:u,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Rs.NoViableAltException(c,this.LA(1),u))},e}();Rr.ErrorHandler=vF});var Dg=l(Sr=>{"use strict";var Fg=Sr&&Sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.ContentAssist=void 0;var wg=Tn(),mF=Fg(cr()),yF=Fg(Nt()),gF=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(t,r){var n=this.gastProductionsCache[t];if((0,yF.default)(n))throw Error("Rule ->".concat(t,"<- does not exist in this grammar."));return(0,wg.nextPossibleTokensAfter)([n],r,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(t){var r=(0,mF.default)(t.ruleStack),n=this.getGAstProductions(),i=n[r],a=new wg.NextAfterTokenWalker(i,t).startWalking();return a},e}();Sr.ContentAssist=gF});var zg=l(br=>{"use strict";var Nr=br&&br.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.GastRecorder=void 0;var ua=Nr(Wi()),_F=Nr(k()),EF=Nr(_i()),TF=Nr($()),Gg=Nr(Gt()),Cn=Nr(he()),He=W(),AF=yn(),Wg=Pt(),Vg=xt(),OF=ue(),RF=Qi(),la={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(la);var Ug=!0,jg=Math.pow(2,RF.BITS_FOR_OCCURRENCE_IDX)-1,Hg=(0,Vg.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:AF.Lexer.NA});(0,Wg.augmentTokenTypes)([Hg]);var Kg=(0,Vg.createTokenInstance)(Hg,`This IToken indicates the Parser is in Recording Phase
|
|
97
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Kg);var SF={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
98
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},bF=function(){function e(){}return e.prototype.initGastRecorder=function(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var t=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var r=function(i){var a=i>0?i:"";t["CONSUME".concat(a)]=function(o,s){return this.consumeInternalRecord(o,i,s)},t["SUBRULE".concat(a)]=function(o,s){return this.subruleInternalRecord(o,i,s)},t["OPTION".concat(a)]=function(o){return this.optionInternalRecord(o,i)},t["OR".concat(a)]=function(o){return this.orInternalRecord(o,i)},t["MANY".concat(a)]=function(o){this.manyInternalRecord(i,o)},t["MANY_SEP".concat(a)]=function(o){this.manySepFirstInternalRecord(i,o)},t["AT_LEAST_ONE".concat(a)]=function(o){this.atLeastOneInternalRecord(i,o)},t["AT_LEAST_ONE_SEP".concat(a)]=function(o){this.atLeastOneSepFirstInternalRecord(i,o)}},n=0;n<10;n++)r(n);t.consume=function(i,a,o){return this.consumeInternalRecord(a,i,o)},t.subrule=function(i,a,o){return this.subruleInternalRecord(a,i,o)},t.option=function(i,a){return this.optionInternalRecord(a,i)},t.or=function(i,a){return this.orInternalRecord(a,i)},t.many=function(i,a){this.manyInternalRecord(i,a)},t.atLeastOne=function(i,a){this.atLeastOneInternalRecord(i,a)},t.ACTION=t.ACTION_RECORD,t.BACKTRACK=t.BACKTRACK_RECORD,t.LA=t.LA_RECORD})},e.prototype.disableRecording=function(){var t=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var r=t,n=0;n<10;n++){var i=n>0?n:"";delete r["CONSUME".concat(i)],delete r["SUBRULE".concat(i)],delete r["OPTION".concat(i)],delete r["OR".concat(i)],delete r["MANY".concat(i)],delete r["MANY_SEP".concat(i)],delete r["AT_LEAST_ONE".concat(i)],delete r["AT_LEAST_ONE_SEP".concat(i)]}delete r.consume,delete r.subrule,delete r.option,delete r.or,delete r.many,delete r.atLeastOne,delete r.ACTION,delete r.BACKTRACK,delete r.LA})},e.prototype.ACTION_RECORD=function(t){},e.prototype.BACKTRACK_RECORD=function(t,r){return function(){return!0}},e.prototype.LA_RECORD=function(t){return OF.END_OF_FILE},e.prototype.topLevelRuleRecord=function(t,r){try{var n=new He.Rule({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(i){if(i.KNOWN_RECORDER_ERROR!==!0)try{i.message=i.message+`
|
|
99
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
100
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw i}throw i}},e.prototype.optionInternalRecord=function(t,r){return xn.call(this,He.Option,t,r)},e.prototype.atLeastOneInternalRecord=function(t,r){xn.call(this,He.RepetitionMandatory,r,t)},e.prototype.atLeastOneSepFirstInternalRecord=function(t,r){xn.call(this,He.RepetitionMandatoryWithSeparator,r,t,Ug)},e.prototype.manyInternalRecord=function(t,r){xn.call(this,He.Repetition,r,t)},e.prototype.manySepFirstInternalRecord=function(t,r){xn.call(this,He.RepetitionWithSeparator,r,t,Ug)},e.prototype.orInternalRecord=function(t,r){return NF.call(this,t,r)},e.prototype.subruleInternalRecord=function(t,r,n){if(ca(r),!t||(0,Cn.default)(t,"ruleName")===!1){var i=new Error("<SUBRULE".concat(Bg(r),"> argument is invalid")+" expecting a Parser method reference but got: <".concat(JSON.stringify(t),">")+`
|
|
101
|
+
inside top level rule: <`.concat(this.recordingProdStack[0].name,">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var a=(0,ua.default)(this.recordingProdStack),o=t.ruleName,s=new He.NonTerminal({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return a.definition.push(s),this.outputCst?SF:la},e.prototype.consumeInternalRecord=function(t,r,n){if(ca(r),!(0,Wg.hasShortKeyProperty)(t)){var i=new Error("<CONSUME".concat(Bg(r),"> argument is invalid")+" expecting a TokenType reference but got: <".concat(JSON.stringify(t),">")+`
|
|
102
|
+
inside top level rule: <`.concat(this.recordingProdStack[0].name,">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var a=(0,ua.default)(this.recordingProdStack),o=new He.Terminal({idx:r,terminalType:t,label:n?.LABEL});return a.definition.push(o),Kg},e}();br.GastRecorder=bF;function xn(e,t,r,n){n===void 0&&(n=!1),ca(r);var i=(0,ua.default)(this.recordingProdStack),a=(0,Gg.default)(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),(0,Cn.default)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),la}function NF(e,t){var r=this;ca(t);var n=(0,ua.default)(this.recordingProdStack),i=(0,_F.default)(e)===!1,a=i===!1?e:e.DEF,o=new He.Alternation({definition:[],idx:t,ignoreAmbiguities:i&&e.IGNORE_AMBIGUITIES===!0});(0,Cn.default)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);var s=(0,EF.default)(a,function(u){return(0,Gg.default)(u.GATE)});return o.hasPredicates=s,n.definition.push(o),(0,TF.default)(a,function(u){var c=new He.Alternative({definition:[]});o.definition.push(c),(0,Cn.default)(u,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:(0,Cn.default)(u,"GATE")&&(c.ignoreAmbiguities=!0),r.recordingProdStack.push(c),u.ALT.call(r),r.recordingProdStack.pop()}),la}function Bg(e){return e===0?"":"".concat(e)}function ca(e){if(e<0||e>jg){var t=new Error("Invalid DSL Method idx value: <".concat(e,`>
|
|
103
|
+
`)+"Idx value must be a none negative value smaller than ".concat(jg+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}});var Yg=l(Ir=>{"use strict";var IF=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.PerformanceTracer=void 0;var LF=IF(he()),PF=ar(),xF=ue(),CF=function(){function e(){}return e.prototype.initPerformanceTracer=function(t){if((0,LF.default)(t,"traceInitPerf")){var r=t.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=xF.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(t,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log("".concat(n,"--> <").concat(t,">"));var i=(0,PF.timer)(r),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s("".concat(n,"<-- <").concat(t,"> time: ").concat(a,"ms")),this.traceInitIndent--,o}else return r()},e}();Ir.PerformanceTracer=CF});var Xg=l(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.applyMixins=void 0;function kF(e,t){t.forEach(function(r){var n=r.prototype;Object.getOwnPropertyNames(n).forEach(function(i){if(i!=="constructor"){var a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(e.prototype,i,a):e.prototype[i]=r.prototype[i]}})})}fa.applyMixins=kF});var ue=l(w=>{"use strict";var Qg=w&&w.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lr=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(w,"__esModule",{value:!0});w.EmbeddedActionsParser=w.CstParser=w.Parser=w.EMPTY_ALT=w.ParserDefinitionErrorType=w.DEFAULT_RULE_CONFIG=w.DEFAULT_PARSER_CONFIG=w.END_OF_FILE=void 0;var Ss=Lr(ye()),qF=Lr(re()),MF=Lr($()),Tt=Lr(Ce()),$g=Lr(he()),e_=Lr(Xe()),wF=ar(),FF=Cv(),Zg=xt(),t_=hr(),Jg=Ky(),DF=ys(),UF=og(),jF=_g(),BF=Tg(),GF=Og(),WF=xg(),VF=Mg(),HF=Dg(),KF=zg(),zF=Yg(),YF=Xg(),XF=Rn();w.END_OF_FILE=(0,Zg.createTokenInstance)(Zg.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(w.END_OF_FILE);w.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:t_.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});w.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var $F;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})($F=w.ParserDefinitionErrorType||(w.ParserDefinitionErrorType={}));function ZF(e){return e===void 0&&(e=void 0),function(){return e}}w.EMPTY_ALT=ZF;var pa=function(){function e(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),(0,$g.default)(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
104
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
105
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
106
|
+
For further details.`);this.skipValidations=(0,$g.default)(r,"skipValidations")?r.skipValidations:w.DEFAULT_PARSER_CONFIG.skipValidations}return e.performSelfAnalysis=function(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",function(){(0,wF.toFastProperties)(t)}),t.TRACE_INIT("Grammar Recording",function(){try{t.enableRecording(),(0,MF.default)(t.definedRulesNames,function(a){var o=t[a],s=o.originalGrammarAction,u;t.TRACE_INIT("".concat(a," Rule"),function(){u=t.topLevelRuleRecord(a,s)}),t.gastProductionsCache[a]=u})}finally{t.disableRecording()}});var i=[];if(t.TRACE_INIT("Grammar Resolving",function(){i=(0,Jg.resolveGrammar)({rules:(0,Tt.default)(t.gastProductionsCache)}),t.definitionErrors=t.definitionErrors.concat(i)}),t.TRACE_INIT("Grammar Validations",function(){if((0,Ss.default)(i)&&t.skipValidations===!1){var a=(0,Jg.validateGrammar)({rules:(0,Tt.default)(t.gastProductionsCache),tokenTypes:(0,Tt.default)(t.tokensMap),errMsgProvider:t_.defaultGrammarValidatorErrorProvider,grammarName:n}),o=(0,XF.validateLookahead)({lookaheadStrategy:t.lookaheadStrategy,rules:(0,Tt.default)(t.gastProductionsCache),tokenTypes:(0,Tt.default)(t.tokensMap),grammarName:n});t.definitionErrors=t.definitionErrors.concat(a,o)}}),(0,Ss.default)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",function(){var a=(0,FF.computeAllProdsFollows)((0,Tt.default)(t.gastProductionsCache));t.resyncFollows=a}),t.TRACE_INIT("ComputeLookaheadFunctions",function(){var a,o;(o=(a=t.lookaheadStrategy).initialize)===null||o===void 0||o.call(a,{rules:(0,Tt.default)(t.gastProductionsCache)}),t.preComputeLookaheadFunctions((0,Tt.default)(t.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Ss.default)(t.definitionErrors))throw r=(0,qF.default)(t.definitionErrors,function(a){return a.message}),new Error(`Parser Definition Errors detected:
|
|
107
|
+
`.concat(r.join(`
|
|
108
|
+
-------------------------------
|
|
109
|
+
`)))})},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();w.Parser=pa;(0,YF.applyMixins)(pa,[DF.Recoverable,UF.LooksAhead,jF.TreeBuilder,BF.LexerAdapter,WF.RecognizerEngine,GF.RecognizerApi,VF.ErrorHandler,HF.ContentAssist,KF.GastRecorder,zF.PerformanceTracer]);var JF=function(e){Qg(t,e);function t(r,n){n===void 0&&(n=w.DEFAULT_PARSER_CONFIG);var i=(0,e_.default)(n);return i.outputCst=!0,e.call(this,r,i)||this}return t}(pa);w.CstParser=JF;var QF=function(e){Qg(t,e);function t(r,n){n===void 0&&(n=w.DEFAULT_PARSER_CONFIG);var i=(0,e_.default)(n);return i.outputCst=!1,e.call(this,r,i)||this}return t}(pa);w.EmbeddedActionsParser=QF});var n_=l(At=>{"use strict";var eD=At&&At.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pr=At&&At.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(At,"__esModule",{value:!0});At.buildModel=void 0;var r_=W(),kn=Pr(re()),tD=Pr(De()),rD=Pr(Ce()),nD=Pr(_i()),iD=Pr(ts()),aD=Pr(dn());function oD(e){var t=new sD,r=(0,rD.default)(e);return(0,kn.default)(r,function(n){return t.visitRule(n)})}At.buildModel=oD;var sD=function(e){eD(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.visitRule=function(r){var n=this.visitEach(r.definition),i=(0,iD.default)(n,function(o){return o.propertyName}),a=(0,kn.default)(i,function(o,s){var u=!(0,nD.default)(o,function(f){return!f.canBeNull}),c=o[0].type;return o.length>1&&(c=(0,kn.default)(o,function(f){return f.type})),{name:s,type:c,optional:u}});return{name:r.name,properties:a}},t.prototype.visitAlternative=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitOption=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitRepetition=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitRepetitionMandatory=function(r){return this.visitEach(r.definition)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){return this.visitEach(r.definition).concat({propertyName:r.separator.name,canBeNull:!0,type:da(r.separator)})},t.prototype.visitRepetitionWithSeparator=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0}).concat({propertyName:r.separator.name,canBeNull:!0,type:da(r.separator)})},t.prototype.visitAlternation=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitTerminal=function(r){return[{propertyName:r.label||r.terminalType.name,canBeNull:!1,type:da(r)}]},t.prototype.visitNonTerminal=function(r){return[{propertyName:r.label||r.nonTerminalName,canBeNull:!1,type:da(r)}]},t.prototype.visitEachAndOverrideWith=function(r,n){return(0,kn.default)(this.visitEach(r),function(i){return(0,aD.default)({},i,n)})},t.prototype.visitEach=function(r){var n=this;return(0,tD.default)((0,kn.default)(r,function(i){return n.visit(i)}))},t}(r_.GAstVisitor);function da(e){return e instanceof r_.NonTerminal?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}});var a_=l((AH,i_)=>{"use strict";var uD=di();function cD(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:uD(e,t,r)}i_.exports=cD});var bs=l((OH,o_)=>{"use strict";var lD="\\ud800-\\udfff",fD="\\u0300-\\u036f",pD="\\ufe20-\\ufe2f",dD="\\u20d0-\\u20ff",hD=fD+pD+dD,vD="\\ufe0e\\ufe0f",mD="\\u200d",yD=RegExp("["+mD+lD+hD+vD+"]");function gD(e){return yD.test(e)}o_.exports=gD});var u_=l((RH,s_)=>{"use strict";function _D(e){return e.split("")}s_.exports=_D});var m_=l((SH,v_)=>{"use strict";var c_="\\ud800-\\udfff",ED="\\u0300-\\u036f",TD="\\ufe20-\\ufe2f",AD="\\u20d0-\\u20ff",OD=ED+TD+AD,RD="\\ufe0e\\ufe0f",SD="["+c_+"]",Ns="["+OD+"]",Is="\\ud83c[\\udffb-\\udfff]",bD="(?:"+Ns+"|"+Is+")",l_="[^"+c_+"]",f_="(?:\\ud83c[\\udde6-\\uddff]){2}",p_="[\\ud800-\\udbff][\\udc00-\\udfff]",ND="\\u200d",d_=bD+"?",h_="["+RD+"]?",ID="(?:"+ND+"(?:"+[l_,f_,p_].join("|")+")"+h_+d_+")*",LD=h_+d_+ID,PD="(?:"+[l_+Ns+"?",Ns,f_,p_,SD].join("|")+")",xD=RegExp(Is+"(?="+Is+")|"+PD+LD,"g");function CD(e){return e.match(xD)||[]}v_.exports=CD});var g_=l((bH,y_)=>{"use strict";var kD=u_(),qD=bs(),MD=m_();function wD(e){return qD(e)?MD(e):kD(e)}y_.exports=wD});var E_=l((NH,__)=>{"use strict";var FD=a_(),DD=bs(),UD=g_(),jD=fo();function BD(e){return function(t){t=jD(t);var r=DD(t)?UD(t):void 0,n=r?r[0]:t.charAt(0),i=r?FD(r,1).join(""):t.slice(1);return n[e]()+i}}__.exports=BD});var A_=l((IH,T_)=>{"use strict";var GD=E_(),WD=GD("toUpperCase");T_.exports=WD});var b_=l(xr=>{"use strict";var Cr=xr&&xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xr,"__esModule",{value:!0});xr.genDts=void 0;var VD=Cr(De()),HD=Cr(k()),ha=Cr(re()),KD=Cr(dt()),zD=Cr(Si()),R_=Cr(A_());function YD(e,t){var r=[];return r=r.concat('import type { CstNode, ICstVisitor, IToken } from "chevrotain";'),r=r.concat((0,VD.default)((0,ha.default)(e,function(n){return XD(n)}))),t.includeVisitorInterface&&(r=r.concat(QD(t.visitorInterfaceName,e))),r.join(`
|
|
110
|
+
|
|
111
|
+
`)+`
|
|
112
|
+
`}xr.genDts=YD;function XD(e){var t=$D(e),r=ZD(e);return[t,r]}function $D(e){var t=S_(e.name),r=Ls(e.name);return"export interface ".concat(t,` extends CstNode {
|
|
113
|
+
name: "`).concat(e.name,`";
|
|
114
|
+
children: `).concat(r,`;
|
|
115
|
+
}`)}function ZD(e){var t=Ls(e.name);return"export type ".concat(t,` = {
|
|
116
|
+
`).concat((0,ha.default)(e.properties,function(r){return JD(r)}).join(`
|
|
117
|
+
`),`
|
|
118
|
+
};`)}function JD(e){var t=tU(e.type);return"".concat(e.name).concat(e.optional?"?":"",": ").concat(t,"[];")}function QD(e,t){return"export interface ".concat(e,`<IN, OUT> extends ICstVisitor<IN, OUT> {
|
|
119
|
+
`).concat((0,ha.default)(t,function(r){return eU(r)}).join(`
|
|
120
|
+
`),`
|
|
121
|
+
}`)}function eU(e){var t=Ls(e.name);return"".concat(e.name,"(children: ").concat(t,", param?: IN): OUT;")}function tU(e){if((0,HD.default)(e)){var t=(0,zD.default)((0,ha.default)(e,function(n){return O_(n)})),r=(0,KD.default)(t,function(n,i){return n+" | "+i});return"("+r+")"}else return O_(e)}function O_(e){return e.kind==="token"?"IToken":S_(e.name)}function S_(e){return(0,R_.default)(e)+"CstNode"}function Ls(e){return(0,R_.default)(e)+"CstChildren"}});var N_=l(kr=>{"use strict";var va=kr&&kr.__assign||function(){return va=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},va.apply(this,arguments)};Object.defineProperty(kr,"__esModule",{value:!0});kr.generateCstDts=void 0;var rU=n_(),nU=b_(),iU={includeVisitorInterface:!0,visitorInterfaceName:"ICstNodeVisitor"};function aU(e,t){var r=va(va({},iU),t),n=(0,rU.buildModel)(e);return(0,nU.genDts)(n,r)}kr.generateCstDts=aU});var L_=l(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.createSyntaxDiagramsCode=void 0;var I_=Ua();function oU(e,t){var r=t===void 0?{}:t,n=r.resourceBase,i=n===void 0?"https://unpkg.com/chevrotain@".concat(I_.VERSION,"/diagrams/"):n,a=r.css,o=a===void 0?"https://unpkg.com/chevrotain@".concat(I_.VERSION,"/diagrams/diagrams.css"):a,s=`
|
|
122
|
+
<!-- This is a generated file -->
|
|
123
|
+
<!DOCTYPE html>
|
|
124
|
+
<meta charset="utf-8">
|
|
125
|
+
<style>
|
|
126
|
+
body {
|
|
127
|
+
background-color: hsl(30, 20%, 95%)
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
130
|
+
|
|
131
|
+
`,u=`
|
|
132
|
+
<link rel='stylesheet' href='`.concat(o,`'>
|
|
133
|
+
`),c=`
|
|
134
|
+
<script src='`.concat(i,`vendor/railroad-diagrams.js'></script>
|
|
135
|
+
<script src='`).concat(i,`src/diagrams_builder.js'></script>
|
|
136
|
+
<script src='`).concat(i,`src/diagrams_behavior.js'></script>
|
|
137
|
+
<script src='`).concat(i,`src/main.js'></script>
|
|
138
|
+
`),f=`
|
|
139
|
+
<div id="diagrams" align="center"></div>
|
|
140
|
+
`,d=`
|
|
141
|
+
<script>
|
|
142
|
+
window.serializedGrammar = `.concat(JSON.stringify(e,null," "),`;
|
|
143
|
+
</script>
|
|
144
|
+
`),h=`
|
|
145
|
+
<script>
|
|
146
|
+
var diagramsDiv = document.getElementById("diagrams");
|
|
147
|
+
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|
148
|
+
</script>
|
|
149
|
+
`;return s+u+c+f+d+h}ma.createSyntaxDiagramsCode=oU});var x_=l(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.Parser=E.createSyntaxDiagramsCode=E.clearCache=E.generateCstDts=E.GAstVisitor=E.serializeProduction=E.serializeGrammar=E.Terminal=E.Rule=E.RepetitionWithSeparator=E.RepetitionMandatoryWithSeparator=E.RepetitionMandatory=E.Repetition=E.Option=E.NonTerminal=E.Alternative=E.Alternation=E.defaultLexerErrorProvider=E.NoViableAltException=E.NotAllInputParsedException=E.MismatchedTokenException=E.isRecognitionException=E.EarlyExitException=E.defaultParserErrorProvider=E.LLkLookaheadStrategy=E.getLookaheadPaths=E.tokenName=E.tokenMatcher=E.tokenLabel=E.EOF=E.createTokenInstance=E.createToken=E.LexerDefinitionErrorType=E.Lexer=E.EMPTY_ALT=E.ParserDefinitionErrorType=E.EmbeddedActionsParser=E.CstParser=E.VERSION=void 0;var sU=Ua();Object.defineProperty(E,"VERSION",{enumerable:!0,get:function(){return sU.VERSION}});var ya=ue();Object.defineProperty(E,"CstParser",{enumerable:!0,get:function(){return ya.CstParser}});Object.defineProperty(E,"EmbeddedActionsParser",{enumerable:!0,get:function(){return ya.EmbeddedActionsParser}});Object.defineProperty(E,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return ya.ParserDefinitionErrorType}});Object.defineProperty(E,"EMPTY_ALT",{enumerable:!0,get:function(){return ya.EMPTY_ALT}});var P_=yn();Object.defineProperty(E,"Lexer",{enumerable:!0,get:function(){return P_.Lexer}});Object.defineProperty(E,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return P_.LexerDefinitionErrorType}});var qr=xt();Object.defineProperty(E,"createToken",{enumerable:!0,get:function(){return qr.createToken}});Object.defineProperty(E,"createTokenInstance",{enumerable:!0,get:function(){return qr.createTokenInstance}});Object.defineProperty(E,"EOF",{enumerable:!0,get:function(){return qr.EOF}});Object.defineProperty(E,"tokenLabel",{enumerable:!0,get:function(){return qr.tokenLabel}});Object.defineProperty(E,"tokenMatcher",{enumerable:!0,get:function(){return qr.tokenMatcher}});Object.defineProperty(E,"tokenName",{enumerable:!0,get:function(){return qr.tokenName}});var uU=vr();Object.defineProperty(E,"getLookaheadPaths",{enumerable:!0,get:function(){return uU.getLookaheadPaths}});var cU=_s();Object.defineProperty(E,"LLkLookaheadStrategy",{enumerable:!0,get:function(){return cU.LLkLookaheadStrategy}});var lU=hr();Object.defineProperty(E,"defaultParserErrorProvider",{enumerable:!0,get:function(){return lU.defaultParserErrorProvider}});var qn=yr();Object.defineProperty(E,"EarlyExitException",{enumerable:!0,get:function(){return qn.EarlyExitException}});Object.defineProperty(E,"isRecognitionException",{enumerable:!0,get:function(){return qn.isRecognitionException}});Object.defineProperty(E,"MismatchedTokenException",{enumerable:!0,get:function(){return qn.MismatchedTokenException}});Object.defineProperty(E,"NotAllInputParsedException",{enumerable:!0,get:function(){return qn.NotAllInputParsedException}});Object.defineProperty(E,"NoViableAltException",{enumerable:!0,get:function(){return qn.NoViableAltException}});var fU=Ko();Object.defineProperty(E,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return fU.defaultLexerErrorProvider}});var Ke=W();Object.defineProperty(E,"Alternation",{enumerable:!0,get:function(){return Ke.Alternation}});Object.defineProperty(E,"Alternative",{enumerable:!0,get:function(){return Ke.Alternative}});Object.defineProperty(E,"NonTerminal",{enumerable:!0,get:function(){return Ke.NonTerminal}});Object.defineProperty(E,"Option",{enumerable:!0,get:function(){return Ke.Option}});Object.defineProperty(E,"Repetition",{enumerable:!0,get:function(){return Ke.Repetition}});Object.defineProperty(E,"RepetitionMandatory",{enumerable:!0,get:function(){return Ke.RepetitionMandatory}});Object.defineProperty(E,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return Ke.RepetitionMandatoryWithSeparator}});Object.defineProperty(E,"RepetitionWithSeparator",{enumerable:!0,get:function(){return Ke.RepetitionWithSeparator}});Object.defineProperty(E,"Rule",{enumerable:!0,get:function(){return Ke.Rule}});Object.defineProperty(E,"Terminal",{enumerable:!0,get:function(){return Ke.Terminal}});var Ps=W();Object.defineProperty(E,"serializeGrammar",{enumerable:!0,get:function(){return Ps.serializeGrammar}});Object.defineProperty(E,"serializeProduction",{enumerable:!0,get:function(){return Ps.serializeProduction}});Object.defineProperty(E,"GAstVisitor",{enumerable:!0,get:function(){return Ps.GAstVisitor}});var pU=N_();Object.defineProperty(E,"generateCstDts",{enumerable:!0,get:function(){return pU.generateCstDts}});function dU(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
150
|
+
It performs no action other than printing this message.
|
|
151
|
+
Please avoid using it as it will be completely removed in the future`)}E.clearCache=dU;var hU=L_();Object.defineProperty(E,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return hU.createSyntaxDiagramsCode}});var vU=function(){function e(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|
152
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return e}();E.Parser=vU});var U_=l(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.lilconfigSync=st.lilconfig=st.defaultLoaders=void 0;var ze=Ot("path"),wn=Ot("fs"),mU=Ot("os"),k_=wn.promises.readFile;function yU(e){return["package.json",`.${e}rc.json`,`.${e}rc.js`,`.${e}rc.cjs`,`.config/${e}rc`,`.config/${e}rc.json`,`.config/${e}rc.js`,`.config/${e}rc.cjs`,`${e}.config.js`,`${e}.config.cjs`]}function M_(e,t){return e.split(ze.sep).reduceRight((r,n,i,a)=>{let o=a.slice(0,i+1).join(ze.sep);return r.passedStopDir||r.searchPlaces.push(o||ze.sep),o===t&&(r.passedStopDir=!0),r},{searchPlaces:[],passedStopDir:!1}).searchPlaces}st.defaultLoaders=Object.freeze({".js":Ot,".json":Ot,".cjs":Ot,noExt(e,t){return JSON.parse(t)}});function q_(e){return e==="noExt"?"files without extensions":`extension "${e}"`}function w_(e,t={}){let r={stopDir:mU.homedir(),searchPlaces:yU(e),ignoreEmptySearchPlaces:!0,transform:n=>n,packageProp:[e],...t,loaders:{...st.defaultLoaders,...t.loaders}};return r.searchPlaces.forEach(n=>{let i=ze.extname(n)||"noExt",a=r.loaders[i];if(!a)throw new Error(`No loader specified for ${q_(i)}, so searchPlaces item "${n}" is invalid`);if(typeof a!="function")throw new Error(`loader for ${q_(i)} is not a function (type provided: "${typeof a}"), so searchPlaces item "${n}" is invalid`)}),r}function ga(e,t){return typeof e=="string"&&e in t?t[e]:(Array.isArray(e)?e:e.split(".")).reduce((r,n)=>r===void 0?r:r[n],t)||null}function F_(e,t){return t.reduce((r,n)=>(e.forEach(i=>r.push({searchPlace:i,filepath:ze.join(n,i),loaderKey:ze.extname(i)||"noExt"})),r),[])}function D_(e){if(!e)throw new Error("load must pass a non-empty string")}function _a(e,t){if(!e)throw new Error(`No loader specified for extension "${t}"`);if(typeof e!="function")throw new Error("loader is not a function")}function gU(e,t){let{ignoreEmptySearchPlaces:r,loaders:n,packageProp:i,searchPlaces:a,stopDir:o,transform:s}=w_(e,t);return{async search(u=process.cwd()){let c=M_(u,o),f={config:null,filepath:""},d=F_(a,c);for(let{searchPlace:h,filepath:m,loaderKey:p}of d){try{await wn.promises.access(m)}catch{continue}let v=String(await k_(m)),y=n[p];if(h==="package.json"){let A=await y(m,v),_=ga(i,A);if(_!=null){f.config=_,f.filepath=m;break}continue}let g=v.trim()==="";if(!(g&&r)){g?(f.isEmpty=!0,f.config=void 0):(_a(y,p),f.config=await y(m,v)),f.filepath=m;break}}return f.filepath===""&&f.config===null?s(null):s(f)},async load(u){D_(u);let c=ze.resolve(process.cwd(),u),{base:f,ext:d}=ze.parse(c),h=d||"noExt",m=n[h];_a(m,h);let p=String(await k_(c));if(f==="package.json"){let g=await m(c,p);return s({config:ga(i,g),filepath:c})}let v={config:null,filepath:c},y=p.trim()==="";return y&&r?s({config:void 0,filepath:c,isEmpty:!0}):(v.config=y?void 0:await m(c,p),s(y?{...v,isEmpty:y,config:void 0}:v))}}}st.lilconfig=gU;function _U(e,t){let{ignoreEmptySearchPlaces:r,loaders:n,packageProp:i,searchPlaces:a,stopDir:o,transform:s}=w_(e,t);return{search(u=process.cwd()){let c=M_(u,o),f={config:null,filepath:""},d=F_(a,c);for(let{searchPlace:h,filepath:m,loaderKey:p}of d){try{wn.accessSync(m)}catch{continue}let v=n[p],y=String(wn.readFileSync(m));if(h==="package.json"){let A=v(m,y),_=ga(i,A);if(_!=null){f.config=_,f.filepath=m;break}continue}let g=y.trim()==="";if(!(g&&r)){g?(f.isEmpty=!0,f.config=void 0):(_a(v,p),f.config=v(m,y)),f.filepath=m;break}}return f.filepath===""&&f.config===null?s(null):s(f)},load(u){D_(u);let c=ze.resolve(process.cwd(),u),{base:f,ext:d}=ze.parse(c),h=d||"noExt",m=n[h];_a(m,h);let p=String(wn.readFileSync(c));if(f==="package.json"){let g=m(c,p);return s({config:ga(i,g),filepath:c})}let v={config:null,filepath:c},y=p.trim()==="";return y&&r?s({filepath:c,config:void 0,isEmpty:!0}):(v.config=y?void 0:m(c,p),s(y?{...v,isEmpty:y,config:void 0}:v))}}}st.lilconfigSync=_U});var au=(e,t,r)=>{let n=e.req.raw.headers.get("Cookie");if(typeof t=="string"){if(!n)return;let a=t;return r==="secure"?a="__Secure-"+t:r==="host"&&(a="__Host-"+t),Da(n,a)[a]}return n?Da(n):{}};var ou=(e,t)=>new Response(e,{headers:{"Content-Type":t}}).formData();var SE=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,bE=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/,NE=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,Rt=(e,t)=>async(r,n)=>{let i={},a=r.req.header("Content-Type");switch(e){case"json":if(!a||!SE.test(a))break;try{i=await r.req.json()}catch{let s="Malformed JSON in request body";throw new Fa(400,{message:s})}break;case"form":{if(!a||!(bE.test(a)||NE.test(a)))break;let s;if(r.req.bodyCache.formData)s=await r.req.bodyCache.formData;else try{let c=await r.req.arrayBuffer();s=await ou(c,a),r.req.bodyCache.formData=s}catch(c){let f="Malformed FormData request.";throw f+=c instanceof Error?` ${c.message}`:` ${String(c)}`,new Fa(400,{message:f})}let u={};s.forEach((c,f)=>{f.endsWith("[]")?(u[f]??=[]).push(c):Array.isArray(u[f])?u[f].push(c):f in u?u[f]=[u[f],c]:u[f]=c}),i=u;break}case"query":i=Object.fromEntries(Object.entries(r.req.queries()).map(([s,u])=>u.length===1?[s,u[0]]:[s,u]));break;case"param":i=r.req.param();break;case"header":i=r.req.header();break;case"cookie":i=au(r);break}let o=await t(i,r);if(o instanceof Response)return o;r.req.addValidatedData(e,o),await n()};var IE=Vn({tags:Hn([Hr(Qs(Vr()),Js(1)),eu("all")])});async function su(e){let{output:t,success:r}=Kr(IE,await e.req.json(),{abortEarly:!0});return r?t:e.text("Invalid input",400)}import{Buffer as mE}from"buffer";var O=Zs(x_(),1);var kH=O.default.Alternation,qH=O.default.Alternative,C_=O.default.CstParser,MH=O.default.EMPTY_ALT,wH=O.default.EOF,FH=O.default.EarlyExitException,DH=O.default.EmbeddedActionsParser,UH=O.default.GAstVisitor,jH=O.default.LLkLookaheadStrategy,Mn=O.default.Lexer,BH=O.default.LexerDefinitionErrorType,GH=O.default.MismatchedTokenException,WH=O.default.NoViableAltException,VH=O.default.NonTerminal,HH=O.default.NotAllInputParsedException,KH=O.default.Option,zH=O.default.Parser,YH=O.default.ParserDefinitionErrorType,XH=O.default.Repetition,$H=O.default.RepetitionMandatory,ZH=O.default.RepetitionMandatoryWithSeparator,JH=O.default.RepetitionWithSeparator,QH=O.default.Rule,eK=O.default.Terminal,tK=O.default.VERSION,rK=O.default.clearCache,nK=O.default.createSyntaxDiagramsCode,x=O.default.createToken,iK=O.default.createTokenInstance,aK=O.default.defaultLexerErrorProvider,oK=O.default.defaultParserErrorProvider,sK=O.default.generateCstDts,uK=O.default.getLookaheadPaths,cK=O.default.isRecognitionException,lK=O.default.serializeGrammar,fK=O.default.serializeProduction,pK=O.default.tokenLabel,dK=O.default.tokenMatcher,hK=O.default.tokenName;var V_=Zs(U_());import{EOL as ce}from"os";function H_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ks(e,t)}function ks(e,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ks(e,t)}function j_(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var K=x({name:"Identifier",pattern:/[a-zA-Z][\w-]*/}),K_=x({name:"Datasource",pattern:/datasource/,push_mode:"block"}),z_=x({name:"Generator",pattern:/generator/,push_mode:"block"}),Y_=x({name:"Model",pattern:/model/,push_mode:"block"}),X_=x({name:"View",pattern:/view/,push_mode:"block"}),$_=x({name:"Enum",pattern:/enum/,push_mode:"block"}),Z_=x({name:"Type",pattern:/type/,push_mode:"block"}),J_=x({name:"True",pattern:/true/,longer_alt:K}),Q_=x({name:"False",pattern:/false/,longer_alt:K}),eE=x({name:"Null",pattern:/null/,longer_alt:K}),Fr=x({name:"Comment",pattern:Mn.NA}),EU=x({name:"DocComment",pattern:/\/\/\/[ \t]*(.*)/,categories:[Fr]}),TU=x({name:"LineComment",pattern:/\/\/[ \t]*(.*)/,categories:[Fr]}),Ds=x({name:"Attribute",pattern:Mn.NA}),tE=x({name:"BlockAttribute",pattern:/@@/,label:"'@@'",categories:[Ds]}),rE=x({name:"FieldAttribute",pattern:/@/,label:"'@'",categories:[Ds]}),Ea=x({name:"Dot",pattern:/\./,label:"'.'"}),nE=x({name:"QuestionMark",pattern:/\?/,label:"'?'"}),iE=x({name:"LCurly",pattern:/{/,label:"'{'"}),aE=x({name:"RCurly",pattern:/}/,label:"'}'",pop_mode:!0}),Ta=x({name:"LRound",pattern:/\(/,label:"'('"}),Aa=x({name:"RRound",pattern:/\)/,label:"')'"}),qs=x({name:"LSquare",pattern:/\[/,label:"'['"}),Ms=x({name:"RSquare",pattern:/\]/,label:"']'"}),Fn=x({name:"Comma",pattern:/,/,label:"','"}),oE=x({name:"Colon",pattern:/:/,label:"':'"}),ws=x({name:"Equals",pattern:/=/,label:"'='"}),sE=x({name:"StringLiteral",pattern:/"(:?[^\\"\n\r]|\\(:?[bfnrtv"\\/]|u[0-9a-fA-F]{4}))*"/}),uE=x({name:"NumberLiteral",pattern:/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/}),AU=x({name:"WhiteSpace",pattern:/\s+/,group:Mn.SKIPPED}),wr=x({name:"LineBreak",pattern:/\n|\r\n/,line_breaks:!0,label:"LineBreak"}),B_=[Fr,EU,TU,wr,AU],cE={modes:{global:[].concat(B_,[K_,z_,Y_,X_,$_,Z_]),block:[].concat(B_,[Ds,tE,rE,Ea,nE,iE,aE,qs,Ms,Ta,Aa,Fn,oE,ws,J_,Q_,eE,sE,uE,K])},defaultMode:"global"},OU=new Mn(cE),RU=["model","view","type"];function Fs(e,t){return e!=null&&"type"in e&&t.includes(e.type)}function Mr(e){return Fs(e,RU)}var SU=["field","enumerator"];function G_(e){return e!=null&&"type"in e&&SU.includes(e.type)}function bU(e){return"image"in e[0]}function NU(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=r.reduce(function(a,o){if(!o)return a;var s=a.endColumn,u=s===void 0?-1/0:s,c=a.endLine,f=c===void 0?-1/0:c,d=a.endOffset,h=d===void 0?-1/0:d,m=a.startColumn,p=m===void 0?1/0:m,v=a.startLine,y=v===void 0?1/0:v,g=a.startOffset,A=g===void 0?1/0:g;return o.startLine!=null&&o.startLine<y&&(a.startLine=o.startLine),o.startColumn!=null&&o.startColumn<p&&(a.startColumn=o.startColumn),o.startOffset!=null&&o.startOffset<A&&(a.startOffset=o.startOffset),o.endLine!=null&&o.endLine>f&&(a.endLine=o.endLine),o.endColumn!=null&&o.endColumn>u&&(a.endColumn=o.endColumn),o.endOffset!=null&&o.endOffset>h&&(a.endOffset=o.endOffset),a},{});return Object.assign(e,{location:i})}var IU={parser:{nodeLocationTracking:"none"}},xs;function LU(){if(xs!=null)return xs;var e=(0,V_.lilconfigSync)("prisma-ast").search();return xs=Object.assign(IU,e?.config)}var PU=function(e){H_(t,e);function t(r){var n;return n=e.call(this,cE,r)||this,n.config=void 0,n.break=n.RULE("break",function(){n.CONSUME1(wr),n.CONSUME2(wr)}),n.keyedArg=n.RULE("keyedArg",function(){n.CONSUME(K,{LABEL:"keyName"}),n.CONSUME(oE),n.SUBRULE(n.value)}),n.array=n.RULE("array",function(){n.CONSUME(qs),n.MANY_SEP({SEP:Fn,DEF:function(){n.SUBRULE(n.value)}}),n.CONSUME(Ms)}),n.func=n.RULE("func",function(){n.CONSUME(K,{LABEL:"funcName"}),n.CONSUME(Ta),n.MANY_SEP({SEP:Fn,DEF:function(){n.OR([{ALT:function(){return n.SUBRULE(n.keyedArg)}},{ALT:function(){return n.SUBRULE(n.value)}}])}}),n.CONSUME(Aa)}),n.value=n.RULE("value",function(){n.OR([{ALT:function(){return n.CONSUME(sE,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(uE,{LABEL:"value"})}},{ALT:function(){return n.SUBRULE(n.array,{LABEL:"value"})}},{ALT:function(){return n.SUBRULE(n.func,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(J_,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(Q_,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(eE,{LABEL:"value"})}},{ALT:function(){return n.CONSUME(K,{LABEL:"value"})}}])}),n.property=n.RULE("property",function(){n.CONSUME(K,{LABEL:"propertyName"}),n.CONSUME(ws),n.SUBRULE(n.value,{LABEL:"propertyValue"})}),n.assignment=n.RULE("assignment",function(){n.CONSUME(K,{LABEL:"assignmentName"}),n.CONSUME(ws),n.SUBRULE(n.value,{LABEL:"assignmentValue"})}),n.field=n.RULE("field",function(){n.CONSUME(K,{LABEL:"fieldName"}),n.SUBRULE(n.value,{LABEL:"fieldType"}),n.OPTION1(function(){n.OR([{ALT:function(){n.CONSUME(qs,{LABEL:"array"}),n.CONSUME(Ms,{LABEL:"array"})}},{ALT:function(){return n.CONSUME(nE,{LABEL:"optional"})}}])}),n.MANY(function(){n.SUBRULE(n.fieldAttribute,{LABEL:"attributeList"})}),n.OPTION2(function(){n.CONSUME(Fr,{LABEL:"comment"})})}),n.block=n.RULE("block",function(i){i===void 0&&(i={});var a=i,o=a.componentType,s=o==="enum",u=o==="model"||o==="view"||o==="type";n.CONSUME(iE),n.CONSUME1(wr),n.MANY(function(){n.OR([{ALT:function(){return n.SUBRULE(n.comment,{LABEL:"list"})}},{GATE:function(){return u},ALT:function(){return n.SUBRULE(n.property,{LABEL:"list"})}},{ALT:function(){return n.SUBRULE(n.blockAttribute,{LABEL:"list"})}},{GATE:function(){return u},ALT:function(){return n.SUBRULE(n.field,{LABEL:"list"})}},{GATE:function(){return s},ALT:function(){return n.SUBRULE(n.enum,{LABEL:"list"})}},{GATE:function(){return!u},ALT:function(){return n.SUBRULE(n.assignment,{LABEL:"list"})}},{ALT:function(){return n.SUBRULE(n.break,{LABEL:"list"})}},{ALT:function(){return n.CONSUME2(wr)}}])}),n.CONSUME(aE)}),n.enum=n.RULE("enum",function(){n.CONSUME(K,{LABEL:"enumName"}),n.MANY(function(){n.SUBRULE(n.fieldAttribute,{LABEL:"attributeList"})}),n.OPTION(function(){n.CONSUME(Fr,{LABEL:"comment"})})}),n.fieldAttribute=n.RULE("fieldAttribute",function(){n.CONSUME(rE,{LABEL:"fieldAttribute"}),n.OR([{ALT:function(){n.CONSUME1(K,{LABEL:"groupName"}),n.CONSUME(Ea),n.CONSUME2(K,{LABEL:"attributeName"})}},{ALT:function(){return n.CONSUME(K,{LABEL:"attributeName"})}}]),n.OPTION(function(){n.CONSUME(Ta),n.MANY_SEP({SEP:Fn,DEF:function(){n.SUBRULE(n.attributeArg)}}),n.CONSUME(Aa)})}),n.blockAttribute=n.RULE("blockAttribute",function(){n.CONSUME(tE,{LABEL:"blockAttribute"}),n.OR([{ALT:function(){n.CONSUME1(K,{LABEL:"groupName"}),n.CONSUME(Ea),n.CONSUME2(K,{LABEL:"attributeName"})}},{ALT:function(){return n.CONSUME(K,{LABEL:"attributeName"})}}]),n.OPTION(function(){n.CONSUME(Ta),n.MANY_SEP({SEP:Fn,DEF:function(){n.SUBRULE(n.attributeArg)}}),n.CONSUME(Aa)})}),n.attributeArg=n.RULE("attributeArg",function(){n.OR([{ALT:function(){return n.SUBRULE(n.keyedArg,{LABEL:"value"})}},{ALT:function(){return n.SUBRULE(n.value,{LABEL:"value"})}}])}),n.component=n.RULE("component",function(){var i=n.OR1([{ALT:function(){return n.CONSUME(K_,{LABEL:"type"})}},{ALT:function(){return n.CONSUME(z_,{LABEL:"type"})}},{ALT:function(){return n.CONSUME(Y_,{LABEL:"type"})}},{ALT:function(){return n.CONSUME(X_,{LABEL:"type"})}},{ALT:function(){return n.CONSUME($_,{LABEL:"type"})}},{ALT:function(){return n.CONSUME(Z_,{LABEL:"type"})}}]);n.OR2([{ALT:function(){n.CONSUME1(K,{LABEL:"groupName"}),n.CONSUME(Ea),n.CONSUME2(K,{LABEL:"componentName"})}},{ALT:function(){return n.CONSUME(K,{LABEL:"componentName"})}}]),n.SUBRULE(n.block,{ARGS:[{componentType:i.image}]})}),n.comment=n.RULE("comment",function(){n.CONSUME(Fr,{LABEL:"text"})}),n.schema=n.RULE("schema",function(){n.MANY(function(){n.OR([{ALT:function(){return n.SUBRULE(n.comment,{LABEL:"list"})}},{ALT:function(){return n.SUBRULE(n.component,{LABEL:"list"})}},{ALT:function(){return n.SUBRULE(n.break,{LABEL:"list"})}},{ALT:function(){return n.CONSUME(wr)}}])})}),n.performSelfAnalysis(),n.config=r,n}return t}(C_),lE=new PU(LU().parser),xU=function(t){var r=t.getBaseCstVisitorConstructorWithDefaults();return function(n){H_(i,n);function i(){var o;return o=n.call(this)||this,o.validateVisitor(),o}var a=i.prototype;return a.schema=function(s){var u,c=this,f=((u=s.list)==null?void 0:u.map(function(d){return c.visit([d])}))||[];return{type:"schema",list:f}},a.component=function(s){var u=s.type,c=u[0],f=s.componentName,d=f[0],h=this.visit(s.block),m=function(){switch(c.image){case"datasource":return{type:"datasource",name:d.image,assignments:h};case"generator":return{type:"generator",name:d.image,assignments:h};case"model":return{type:"model",name:d.image,properties:h};case"view":return{type:"view",name:d.image,properties:h};case"enum":return{type:"enum",name:d.image,enumerators:h};case"type":return{type:"type",name:d.image,properties:h};default:throw new Error("Unexpected block type: "+c)}}();return this.maybeAppendLocationData(m,c,d)},a.break=function(){return{type:"break"}},a.comment=function(s){var u=s.text,c=u[0],f={type:"comment",text:c.image};return this.maybeAppendLocationData(f,c)},a.block=function(s){var u,c=this;return(u=s.list)==null?void 0:u.map(function(f){return c.visit([f])})},a.assignment=function(s){var u=this.visit(s.assignmentValue),c=s.assignmentName,f=c[0],d={type:"assignment",key:f.image,value:u};return this.maybeAppendLocationData(d,f)},a.field=function(s){var u,c=this,f,d,h,m=this.visit(s.fieldType),p=s.fieldName,v=p[0],y=(u=s.attributeList)==null?void 0:u.map(function(_){return c.visit([_])}),g=(f=s.comment)==null||(f=f[0])==null?void 0:f.image,A={type:"field",name:v.image,fieldType:m,array:s.array!=null,optional:s.optional!=null,attributes:y,comment:g};return this.maybeAppendLocationData(A,v,(d=s.optional)==null?void 0:d[0],(h=s.array)==null?void 0:h[0])},a.fieldAttribute=function(s){var u,c=this,f=s.attributeName,d=f[0],h=s.groupName||[{}],m=h[0],p=(u=s.attributeArg)==null?void 0:u.map(function(y){return c.visit(y)}),v={type:"attribute",name:d.image,kind:"field",group:m.image,args:p};return this.maybeAppendLocationData.apply(this,[v,d].concat(s.fieldAttribute,[m]))},a.blockAttribute=function(s){var u,c=this,f=s.attributeName,d=f[0],h=s.groupName||[{}],m=h[0],p=(u=s.attributeArg)==null?void 0:u.map(function(y){return c.visit(y)}),v={type:"attribute",name:d.image,kind:"object",group:m.image,args:p};return this.maybeAppendLocationData.apply(this,[v,d].concat(s.blockAttribute,[m]))},a.attributeArg=function(s){var u=this.visit(s.value);return{type:"attributeArgument",value:u}},a.func=function(s){var u,c=this,f,d=s.funcName,h=d[0],m=(u=s.value)==null?void 0:u.map(function(g){return c.visit([g])}),p=(f=s.keyedArg)==null?void 0:f.map(function(g){return c.visit([g])}),v=(m||p)&&[].concat(m??[],p??[]),y={type:"function",name:h.image,params:v};return this.maybeAppendLocationData(y,h)},a.array=function(s){var u,c=this,f=(u=s.value)==null?void 0:u.map(function(d){return c.visit([d])});return{type:"array",args:f}},a.keyedArg=function(s){var u=s.keyName,c=u[0],f=this.visit(s.value),d={type:"keyValue",key:c.image,value:f};return this.maybeAppendLocationData(d,c)},a.value=function(s){if(bU(s.value)){var u=s.value,c=u[0].image;return c}return this.visit(s.value)},a.enum=function(s){var u,c=this,f,d=s.enumName,h=d[0],m=(u=s.attributeList)==null?void 0:u.map(function(y){return c.visit([y])}),p=(f=s.comment)==null||(f=f[0])==null?void 0:f.image,v={type:"enumerator",name:h.image,attributes:m,comment:p};return this.maybeAppendLocationData(v,h)},a.maybeAppendLocationData=function(s){if(t.config.nodeLocationTracking==="none")return s;for(var u=arguments.length,c=new Array(u>1?u-1:0),f=1;f<u;f++)c[f-1]=arguments[f];return NU.apply(void 0,[s].concat(c))},i}(r)},CU=xU(lE),kU=new CU;function qU(e,t){var r,n,i=OU.tokenize(e),a=(r=t?.parser)!=null?r:lE;a.input=i.tokens;var o=a.schema();if(a.errors.length>0)throw a.errors[0];var s=(n=t?.visitor)!=null?n:kU;return s.visit(o)}var W_=["break","comment"],Cs=["generator","datasource","model","view","enum","break","comment"],MU=function(t,r,n){return n===void 0&&(n=Cs),function(i,a){var o=W_.indexOf(i.type)!==-1,s=W_.indexOf(a.type)!==-1;if(o!==s)return t.list.indexOf(i)-t.list.indexOf(a);n!==Cs&&(n=n.concat(Cs));var u=n.indexOf(i.type)-n.indexOf(a.type);return u!==0?u:"name"in i&&"name"in a?i.name.localeCompare(a.name,r):0}};function wU(e,t){t===void 0&&(t={});var r=t,n=r.sort,i=n===void 0?!1:n,a=r.locales,o=a===void 0?void 0:a,s=r.sortOrder,u=s===void 0?void 0:s,c=e.list;if(i){c=e.list=c.filter(function(d){return d.type!=="break"});var f=MU(e,o,u);c.sort(f)}return c.map(FU).filter(Boolean).join(ce).replace(/(\r?\n\s*){3,}/g,ce+ce)+ce}function FU(e){switch(e.type){case"comment":return Ra(e);case"datasource":return DU(e);case"enum":return UU(e);case"generator":return BU(e);case"model":case"view":case"type":return GU(e);case"break":return Sa();default:throw new Error("Unrecognized block type")}}function Ra(e){return e.text}function Sa(){return ce}function DU(e){var t=dE(e.assignments);return`
|
|
153
|
+
datasource `+e.name+` {
|
|
154
|
+
`+t+`
|
|
155
|
+
}`}function UU(e){var t=e.enumerators,r=t.filter(Boolean).map(jU).join(ce+" ").replace(/(\r?\n\s*){3,}/g,ce+ce+" ");return`
|
|
156
|
+
enum `+e.name+` {
|
|
157
|
+
`+r+`
|
|
158
|
+
}`}function jU(e){switch(e.type){case"enumerator":{var t=e.attributes?e.attributes.map(Oa):[];return[e.name].concat(t,[e.comment]).filter(Boolean).join(" ")}case"attribute":return Oa(e);case"comment":return Ra(e);case"break":return Sa();default:throw new Error("Unexpected enumerator type")}}function BU(e){var t=dE(e.assignments);return`
|
|
159
|
+
generator `+e.name+` {
|
|
160
|
+
`+t+`
|
|
161
|
+
}`}function GU(e){var t,r=[].concat(e.properties),n=!1;r.sort(function(s,u){return s.type==="attribute"&&s.kind==="object"&&(u.type!=="attribute"||u.type==="attribute"&&u.kind!=="object")?(n=!0,1):u.type==="attribute"&&u.kind==="object"&&(s.type!=="attribute"||s.type==="attribute"&&s.kind!=="object")?(n=!0,-1):0});var i=r.findIndex(function(s){return s.type==="attribute"&&s.kind==="object"}),a=!["break","comment"].includes((t=r[i-1])==null?void 0:t.type);n&&a&&r.splice(i,0,{type:"break"});var o=zU(r);return`
|
|
162
|
+
`+e.type+" "+e.name+` {
|
|
163
|
+
`+o+`
|
|
164
|
+
}`}function WU(e,t){switch(t===void 0&&(t=0),e.type){case"comment":return Ra(e);case"break":return Sa();case"assignment":return e.key.padEnd(t)+" = "+Dn(e.value);default:throw new Error("Unexpected assignment type")}}function VU(e,t,r){switch(t===void 0&&(t=0),r===void 0&&(r=0),e.type){case"attribute":return Oa(e);case"field":return KU(e,t,r);case"comment":return Ra(e);case"break":return Sa();default:throw new Error("Unrecognized property type")}}function Oa(e){var t=e.args&&e.args.length>0?"("+e.args.map(HU).filter(Boolean).join(", ")+")":"",r=[e.name];return e.group&&r.unshift(e.group),(e.kind==="field"?"@":"@@")+r.join(".")+t}function HU(e){return Dn(e.value)}function KU(e,t,r){t===void 0&&(t=0),r===void 0&&(r=0);var n=e.name.padEnd(t),i=fE(e).padEnd(r),a=e.attributes?e.attributes.map(Oa):[],o=e.comment;return[n,i].concat(a).filter(Boolean).join(" ").trim()+(o?" "+o:"")}function fE(e){var t=e.array?"[]":e.optional?"?":"";if(typeof e.fieldType=="object")switch(e.fieldType.type){case"function":return""+pE(e.fieldType)+t;default:throw new Error("Unexpected field type")}return""+e.fieldType+t}function pE(e){var t=e.params?e.params.map(Dn):"";return e.name+"("+t+")"}function Dn(e){switch(typeof e){case"object":{if("type"in e)switch(e.type){case"keyValue":return e.key+": "+Dn(e.value);case"function":return pE(e);case"array":return"["+(e.args!=null?e.args.map(Dn).join(", "):"")+"]";default:throw new Error("Unexpected value type")}throw new Error("Unexpected object value")}default:return String(e)}}function dE(e){var t=0,r=e.reduce(function(i,a,o,s){return a.type==="break"||(o>0&&s[o-1].type==="break"&&(i[++t]=[]),i[t].push(a)),i},[[]]),n=r.map(function(i){return i.reduce(function(a,o){return Math.max(a,o.type==="assignment"?o.key.length:0)},0)});return e.map(function(i,a,o){return a>0&&i.type!=="break"&&o[a-1].type==="break"&&n.shift(),WU(i,n[0])}).filter(Boolean).join(ce+" ").replace(/(\r?\n\s*){3,}/g,ce+ce+" ")}function zU(e){var t=0,r=e.reduce(function(a,o,s,u){return o.type==="break"||(s>0&&u[s-1].type==="break"&&(a[++t]=[]),a[t].push(o)),a},[[]]),n=r.map(function(a){return a.reduce(function(o,s){return Math.max(o,s.type==="field"?s.name.length:0)},0)}),i=r.map(function(a){return a.reduce(function(o,s){return Math.max(o,s.type==="field"?fE(s).length:0)},0)});return e.map(function(a,o,s){return o>0&&a.type!=="break"&&s[o-1].type==="break"&&(n.shift(),i.shift()),VU(a,n[0],i[0])}).filter(Boolean).join(ce+" ").replace(/(\r?\n\s*){3,}/g,ce+ce+" ")}var YU=function(t,r,n){n===void 0&&(n={});var i=t.filter(hE(r,n)),a=i[0],o=i[1];if(!a)return null;if(o)throw new Error("Found multiple blocks with [type="+r+"]");return a},XU=function(t,r,n){return n===void 0&&(n={}),t.filter(hE(r,n))},hE=function(t,r){var n=r===void 0?{}:r,i=n.name;return function(a){if(i!=null){var o=t==="assignment"?"key":"name";if(!(o in a))return!1;var s=typeof i=="string"?a[o]===i:i.test(a[o]);if(!s)return!1}return a.type===t}},$U=["within"],ZU=["within"],JU=function(){function e(r){r===void 0&&(r=""),this.schema=void 0,this._subject=void 0,this._parent=void 0,this.schema=qU(r)}var t=e.prototype;return t.print=function(n){return n===void 0&&(n={}),wU(this.schema,n)},t.getSchema=function(){return this.schema},t.generator=function(n,i){i===void 0&&(i="prisma-client-js");var a=this.schema.list.reduce(function(o,s){return s.type==="generator"&&s.name===n?s:o},{type:"generator",name:n,assignments:[{type:"assignment",key:"provider",value:'"'+i+'"'}]});return this.schema.list.includes(a)||this.schema.list.push(a),this._subject=a,this},t.drop=function(n){var i=this.schema.list.findIndex(function(a){return"name"in a&&a.name===n});return i!==-1&&this.schema.list.splice(i,1),this},t.datasource=function(n,i){var a={type:"datasource",name:"db",assignments:[{type:"assignment",key:"url",value:typeof i=="string"?'"'+i+'"':{type:"function",name:"env",params:['"'+i.env+'"']}},{type:"assignment",key:"provider",value:n}]},o=this.schema.list.findIndex(function(s){return s.type==="datasource"});return this.schema.list.splice(o,o!==-1?1:0,a),this._subject=a,this},t.model=function(n){var i=this.schema.list.reduce(function(a,o){return o.type==="model"&&o.name===n?o:a},{type:"model",name:n,properties:[]});return this.schema.list.includes(i)||this.schema.list.push(i),this._subject=i,this},t.view=function(n){var i=this.schema.list.reduce(function(a,o){return o.type==="view"&&o.name===n?o:a},{type:"view",name:n,properties:[]});return this.schema.list.includes(i)||this.schema.list.push(i),this._subject=i,this},t.type=function(n){var i=this.schema.list.reduce(function(a,o){return o.type==="type"&&o.name===n?o:a},{type:"type",name:n,properties:[]});return this.schema.list.includes(i)||this.schema.list.push(i),this._subject=i,this},t.enum=function(n,i){i===void 0&&(i=[]);var a=this.schema.list.reduce(function(o,s){return s.type==="enum"&&s.name===n?s:o},{type:"enum",name:n,enumerators:i.map(function(o){return{type:"enumerator",name:o}})});return this.schema.list.includes(a)||this.schema.list.push(a),this._subject=a,this},t.enumerator=function(n){var i=this.getSubject();if(!i||!("type"in i)||i.type!=="enum")throw new Error("Subject must be a prisma enum!");var a={type:"enumerator",name:n};return i.enumerators.push(a),this._parent=this._subject,this._subject=a,this},t.getSubject=function(){return this._subject},t.getParent=function(){return this._parent},t.blockAttribute=function(n,i){var a=this.getSubject();if(a.type!=="enum"&&!Mr(a)){var o=this.getParent();if(!Fs(o,["model","view","type","enum"]))throw new Error("Subject must be a prisma model, view, or type!");a=this._subject=o}var s=function(){return i?typeof i=="string"?[{type:"attributeArgument",value:'"'+i+'"'}]:Array.isArray(i)?[{type:"attributeArgument",value:{type:"array",args:i}}]:Object.entries(i).map(function(c){var f=c[0],d=c[1];return{type:"attributeArgument",value:{type:"keyValue",key:f,value:d}}}):[]}(),u={type:"attribute",kind:"object",name:n,args:s};return a.type==="enum"?a.enumerators.push(u):a.properties.push(u),this},t.attribute=function(n,i){var a=this.getParent(),o=this.getSubject();if(!Fs(a,["model","view","type","enum"]))throw new Error("Parent must be a prisma model or view!");if(!G_(o))throw new Error("Subject must be a prisma field or enumerator!");o.attributes||(o.attributes=[]);var s=o.attributes.reduce(function(c,f){return f.type==="attribute"&&(f.group?f.group+".":"")+f.name===n?f:c},{type:"attribute",kind:"field",name:n});if(Array.isArray(i)){var u=function c(f){var d,h;return typeof f=="string"?f:{type:"function",name:f.name,params:(d=(h=f.function)==null?void 0:h.map(c))!=null?d:[]}};i.length>0&&(s.args=i.map(function(c){return{type:"attributeArgument",value:u(c)}}))}else typeof i=="object"&&(s.args=Object.entries(i).map(function(c){var f=c[0],d=c[1];return{type:"attributeArgument",value:{type:"keyValue",key:f,value:{type:"array",args:d}}}}));return o.attributes.includes(s)||o.attributes.push(s),this},t.removeAttribute=function(n){var i=this.getParent(),a=this.getSubject();if(!Mr(i))throw new Error("Parent must be a prisma model or view!");if(!G_(a))throw new Error("Subject must be a prisma field!");return a.attributes||(a.attributes=[]),a.attributes=a.attributes.filter(function(o){return!(o.type==="attribute"&&o.name===n)}),this},t.assignment=function(n,i){var a=this.getSubject();if(!a||!("type"in a)||!["generator","datasource"].includes(a.type))throw new Error("Subject must be a prisma generator or datasource!");function o(u,c){return c(u),u}var s=a.assignments.reduce(function(u,c){return c.type==="assignment"&&c.key===n?o(c,function(f){f.value='"'+i+'"'}):u},{type:"assignment",key:n,value:'"'+i+'"'});return a.assignments.includes(s)||a.assignments.push(s),this},t.findByType=function(n,i){var a=i.within,o=a===void 0?this.schema.list:a,s=j_(i,$U);return YU(o,n,s)},t.findAllByType=function(n,i){var a=i.within,o=a===void 0?this.schema.list:a,s=j_(i,ZU);return XU(o,n,s)},t.blockInsert=function(n){var i=this.getSubject(),a=["datasource","enum","generator","model","view","type"];if(!i||!("type"in i)||!a.includes(i.type)){var o=this.getParent();if(!o||!("type"in o)||!a.includes(o.type))throw new Error("Subject must be a prisma block!");i=this._subject=o}switch(i.type){case"datasource":{i.assignments.push(n);break}case"enum":{i.enumerators.push(n);break}case"generator":{i.assignments.push(n);break}case"model":{i.properties.push(n);break}}return this},t.break=function(){var n={type:"break"};return this.blockInsert(n)},t.comment=function(n,i){i===void 0&&(i=!1);var a={type:"comment",text:"//"+(i?"/":"")+" "+n};return this.blockInsert(a)},t.schemaComment=function(n,i){i===void 0&&(i=!1);var a={type:"comment",text:"//"+(i?"/":"")+" "+n};return this.schema.list.push(a),this},t.field=function(n,i){i===void 0&&(i="String");var a=this.getSubject();if(!Mr(a)){var o=this.getParent();if(!Mr(o))throw new Error("Subject must be a prisma model or view or composite type!");a=this._subject=o}var s=a.properties.reduce(function(u,c){return c.type==="field"&&c.name===n?c:u},{type:"field",name:n,fieldType:i});return a.properties.includes(s)||a.properties.push(s),this._parent=a,this._subject=s,this},t.removeField=function(n){var i=this.getSubject();if(!Mr(i)){var a=this.getParent();if(!Mr(a))throw new Error("Subject must be a prisma model or view or composite type!");i=this._subject=a}return i.properties=i.properties.filter(function(o){return!(o.type==="field"&&o.name===n)}),this},t.then=function(n){return n(this._subject),this},e}();function QU(e){return new JU(e)}function vE(e,t,r){r===void 0&&(r={});var n=QU(e);return t(n),n.print(r)}var ba=new Map;async function Us(e){let r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(o=>o.toString(16).padStart(2,"0")).join("")}function yE(e){let t=e.req.param("schemaHash"),r=ba.get(t);return r==null?e.json({EngineNotStarted:{reason:"SchemaMissing"}},404):{schemaHash:t,schemas:r}}async function gE(e,t,r){let n=mE.from(e,"base64").toString("utf8"),i=vE(n,o=>{o.datasource('"postgresql"',t.toString())});r&&console.log("[Accelerate] schema with override:",i);let a=await Us(i);return{base64Override:mE.from(i,"utf8").toString("base64"),overrideHash:a}}function Na(e){let{req:t}=e;return{traceparent:t.header("traceparent"),"X-capture-telemetry":t.header("X-capture-telemetry")}}var ej=Vn({isolation_level:ru(Vr()),max_wait:Hr(Wn(),Ma(),wa(0)),timeout:Hr(Wn(),Ma(),wa(0))});async function _E(e){let{issues:t,output:r,success:n}=Kr(ej,await e.req.json(),{abortEarly:!0});return n?r:e.json({EngineNotStarted:{reason:"InvalidRequest",issues:t}},400)}var tj=tu({id:Hn([Vr(),Wn()])});function EE(e,t){let{output:r,success:n}=Kr(tj,e);return n?r:t.json({EngineMalfunction:{}},500)}var js=new iu;js.post("/invalidate",Rt("header",jt),async e=>{let t=await su(e);return t instanceof Response?t:e.body(null)});var rj="/:clientVersion/:schemaHash",Un=js.basePath(rj);js.route("/",Un);var nj=["/graphql","/itx/:transactionId/graphql"];Un.on("POST",[...nj],Rt("header",jt),async e=>{let{req:t}=e;try{let r=await Bs(e);if(r instanceof Response)return r;let n=await t.text(),i=t.param("transactionId"),a=await r.request(n,{...Na(e),"X-transaction-id":i});return e.text(a)}catch(r){return Kn(r,e)}});Un.basePath("/itx/:transactionId").on("POST",["/commit","/rollback"],Rt("header",jt),async e=>{let{req:t}=e;try{let r=await Bs(e);if(r instanceof Response)return r;let i=`${t.routePath.split("/").filter(Boolean).at(-1)}Transaction`,a=t.param("transactionId"),o=await r[i](a,Na(e));return e.json(o)}catch(r){return Kn(r,e)}});Un.put("/schema",Rt("header",jt),async e=>{let{req:t}=e,r=await t.text();if(!r)return e.text("Missing schema",400);let n=t.param("schemaHash"),i=ba.get(n);if(i==null){if(n!==await Us(r))return e.text("Schema hash mismatch",400);let a=await gE(r,e.get("db").prismaORMConnectionString,e.get("debug"));return ba.set(n,{base64Original:r,...a}),e.text(n)}return r!==i.base64Original?e.text("Schema mismatch",400):e.text(n)});Un.post("/transaction/start",Rt("header",jt),async e=>{let{req:t}=e,r=await _E(e);if(r instanceof Response)return r;try{let n=await Bs(e);if(n instanceof Response)return n;let i=await n.startTransaction(r,Na(e)),a=EE(i,e);if(a instanceof Response)return a;let{id:o}=a,s=t.param("clientVersion"),u=e.get("port"),c=e.get("protocol"),f=t.param("schemaHash");return e.json({...i,"data-proxy":{endpoint:`${c}://localhost:${u}/${s}/${f}/itx/${o}`}})}catch(n){return Kn(n,e)}});async function Bs(e){let{req:t}=e,r=yE(e);if(r instanceof Response)return r;let{base64Override:n,overrideHash:i}=r.schemas;return await nu.get({base64Schema:n,clientVersion:process.env.PRISMA_DEV_FORCE_CLIENT_VERSION||t.param("clientVersion"),debug:e.get("debug"),platform:e.get("platform"),schemaHash:i})}export{js as accelerateRoute};
|