-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathtoolgood.algorithm.js
More file actions
2 lines (2 loc) · 266 KB
/
toolgood.algorithm.js
File metadata and controls
2 lines (2 loc) · 266 KB
1
2
/*! For license information please see toolgood.algorithm.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["ToolGood.Algorithm"]=e():t["ToolGood.Algorithm"]=e()}(this,()=>(()=>{var t={9(t,e,r){var s;t.exports=(s=r(21),function(t){var e=s,r=e.t,n=r.WordArray,i=r.Hasher,u=e.i,l=[],h=[];!function(){function e(e){for(var r=t.sqrt(e),s=2;s<=r;s++)if(!(e%s))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var s=2,n=0;n<64;)e(s)&&(n<8&&(l[n]=r(t.pow(s,.5))),h[n]=r(t.pow(s,1/3)),n++),s++}();var a=[],o=u.SHA256=i.extend({u:function(){this.l=new n.init(l.slice(0))},h:function(t,e){for(var r=this.l.o,s=r[0],n=r[1],i=r[2],u=r[3],l=r[4],o=r[5],c=r[6],f=r[7],d=0;d<64;d++){if(d<16)a[d]=0|t[e+d];else{var w=a[d-15],g=(w<<25|w>>>7)^(w<<14|w>>>18)^w>>>3,p=a[d-2],m=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;a[d]=g+a[d-7]+m+a[d-16]}var v=s&n^s&i^n&i,N=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),x=f+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&o^~l&c)+h[d]+a[d];f=c,c=o,o=l,l=u+x|0,u=i,i=n,n=s,s=x+(N+v)|0}r[0]=r[0]+s|0,r[1]=r[1]+n|0,r[2]=r[2]+i|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0,r[5]=r[5]+o|0,r[6]=r[6]+c|0,r[7]=r[7]+f|0},p:function(){var e=this.m,r=e.o,s=8*this.v,n=8*e.N;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(s/4294967296),r[15+(n+64>>>9<<4)]=s,e.N=4*r.length,this.S(),this.l},clone:function(){var t=i.clone.call(this);return t.l=this.l.clone(),t}});e.SHA256=i.I(o),e.HmacSHA256=i.A(o)}(Math),s.SHA256)},21(t,e,r){var s;t.exports=(s=s||function(t){var e;if("undefined"!=typeof window&&window.crypto&&(e=window.crypto),"undefined"!=typeof self&&self.crypto&&(e=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(e=globalThis.crypto),!e&&"undefined"!=typeof window&&window.msCrypto&&(e=window.msCrypto),!e&&void 0!==r.g&&r.g.crypto&&(e=r.g.crypto),!e)try{e=r(477)}catch(t){}var s=function(){if(e){if("function"==typeof e.getRandomValues)try{return e.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof e.D)try{return e.D(4).C()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},u=i.t={},l=u.Base={extend:function(t){var e=n(this);return t&&e.R(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},R:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},h=u.WordArray=l.extend({init:function(t,e){t=this.o=t||[],this.N=null!=e?e:4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.o,r=t.o,s=this.N,n=t.N;if(this.O(),s%4)for(var i=0;i<n;i++){var u=r[i>>>2]>>>24-i%4*8&255;e[s+i>>>2]|=u<<24-(s+i)%4*8}else for(var l=0;l<n;l+=4)e[s+l>>>2]=r[l>>>2];return this.N+=n,this},O:function(){var e=this.o,r=this.N;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=l.clone.call(this);return t.o=this.o.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(s());return new h.init(e,t)}}),a=i.F={},o=a.Hex={stringify:function(t){for(var e=t.o,r=t.N,s=[],n=0;n<r;n++){var i=e[n>>>2]>>>24-n%4*8&255;s.push((i>>>4).toString(16)),s.push((15&i).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,r=[],s=0;s<e;s+=2)r[s>>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new h.init(r,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.o,r=t.N,s=[],n=0;n<r;n++){var i=e[n>>>2]>>>24-n%4*8&255;s.push(String.fromCharCode(i))}return s.join("")},parse:function(t){for(var e=t.length,r=[],s=0;s<e;s++)r[s>>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new h.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},d=u.BufferedBlockAlgorithm=l.extend({reset:function(){this.m=new h.init,this.v=0},k:function(t){"string"==typeof t&&(t=f.parse(t)),this.m.concat(t),this.v+=t.N},S:function(e){var r,s=this.m,n=s.o,i=s.N,u=this.blockSize,l=i/(4*u),a=(l=e?t.ceil(l):t.max((0|l)-this._,0))*u,o=t.min(4*a,i);if(a){for(var c=0;c<a;c+=u)this.h(n,c);r=n.splice(0,a),s.N-=o}return new h.init(r,o)},clone:function(){var t=l.clone.call(this);return t.m=this.m.clone(),t},_:0}),w=(u.Hasher=d.extend({P:l.extend(),init:function(t){this.P=this.P.extend(t),this.reset()},reset:function(){d.reset.call(this),this.u()},update:function(t){return this.k(t),this.S(),this},V:function(t){return t&&this.k(t),this.p()},blockSize:16,I:function(t){return function(e,r){return new t.init(r).V(e)}},A:function(t){return function(e,r){return new w.HMAC.init(t,r).V(e)}}}),i.i={});return i}(Math),s)},25(t,e,r){var s,n,i;t.exports=(n=(s=r(21)).t.Base,i=s.F.Utf8,void(s.i.HMAC=n.extend({init:function(t,e){t=this.B=new t.init,"string"==typeof e&&(e=i.parse(e));var r=t.blockSize,s=4*r;e.N>s&&(e=t.V(e)),e.O();for(var n=this.U=e.clone(),u=this.H=e.clone(),l=n.o,h=u.o,a=0;a<r;a++)l[a]^=1549556828,h[a]^=909522486;n.N=u.N=s,this.reset()},reset:function(){var t=this.B;t.reset(),t.update(this.H)},update:function(t){return this.B.update(t),this},V:function(t){var e=this.B,r=e.V(t);return e.reset(),e.V(this.U.clone().concat(r))}})))},44(t,e,r){var s;t.exports=(s=r(21),r(636),r(25),s.HmacMD5)},240(t,e,r){var s,n,i,u,l,h;t.exports=(i=(n=s=r(21)).t,u=i.Base,l=i.WordArray,(h=n.q={}).Word=u.extend({init:function(t,e){this.high=t,this.low=e}}),h.WordArray=u.extend({init:function(t,e){t=this.o=t||[],this.N=null!=e?e:8*t.length},J:function(){for(var t=this.o,e=t.length,r=[],s=0;s<e;s++){var n=t[s];r.push(n.high),r.push(n.low)}return l.create(r,this.N)},clone:function(){for(var t=u.clone.call(this),e=t.o=this.o.slice(0),r=e.length,s=0;s<r;s++)e[s]=e[s].clone();return t}}),s)},327(t,e,r){var s;t.exports=(s=r(21),r(471),r(25),s.HmacSHA1)},380(t,e,r){var s;t.exports=(s=r(21),r(240),function(){var t=s,e=t.t.Hasher,r=t.q,n=r.Word,i=r.WordArray,u=t.i;function l(){return n.create.apply(n,arguments)}var h=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],a=[];!function(){for(var t=0;t<80;t++)a[t]=l()}();var o=u.SHA512=e.extend({u:function(){this.l=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},h:function(t,e){for(var r=this.l.o,s=r[0],n=r[1],i=r[2],u=r[3],l=r[4],o=r[5],c=r[6],f=r[7],d=s.high,w=s.low,g=n.high,p=n.low,m=i.high,v=i.low,N=u.high,x=u.low,T=l.high,E=l.low,S=o.high,M=o.low,I=c.high,A=c.low,y=f.high,D=f.low,b=d,C=w,R=g,O=p,F=m,k=v,L=N,_=x,P=T,V=E,B=S,U=M,H=I,G=A,q=y,J=D,X=0;X<80;X++){var $,W,j=a[X];if(X<16)W=j.high=0|t[e+2*X],$=j.low=0|t[e+2*X+1];else{var K=a[X-15],z=K.high,Y=K.low,Q=(z>>>1|Y<<31)^(z>>>8|Y<<24)^z>>>7,Z=(Y>>>1|z<<31)^(Y>>>8|z<<24)^(Y>>>7|z<<25),tt=a[X-2],et=tt.high,rt=tt.low,st=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),it=a[X-7],ut=it.high,lt=it.low,ht=a[X-16],at=ht.high,ot=ht.low;W=(W=(W=Q+ut+(($=Z+lt)>>>0<Z>>>0?1:0))+st+(($+=nt)>>>0<nt>>>0?1:0))+at+(($+=ot)>>>0<ot>>>0?1:0),j.high=W,j.low=$}var ct,ft=P&B^~P&H,dt=V&U^~V&G,wt=b&R^b&F^R&F,gt=C&O^C&k^O&k,pt=(b>>>28|C<<4)^(b<<30|C>>>2)^(b<<25|C>>>7),mt=(C>>>28|b<<4)^(C<<30|b>>>2)^(C<<25|b>>>7),vt=(P>>>14|V<<18)^(P>>>18|V<<14)^(P<<23|V>>>9),Nt=(V>>>14|P<<18)^(V>>>18|P<<14)^(V<<23|P>>>9),xt=h[X],Tt=xt.high,Et=xt.low,St=q+vt+((ct=J+Nt)>>>0<J>>>0?1:0),Mt=mt+gt;q=H,J=G,H=B,G=U,B=P,U=V,P=L+(St=(St=(St=St+ft+((ct+=dt)>>>0<dt>>>0?1:0))+Tt+((ct+=Et)>>>0<Et>>>0?1:0))+W+((ct+=$)>>>0<$>>>0?1:0))+((V=_+ct|0)>>>0<_>>>0?1:0)|0,L=F,_=k,F=R,k=O,R=b,O=C,b=St+(pt+wt+(Mt>>>0<mt>>>0?1:0))+((C=ct+Mt|0)>>>0<ct>>>0?1:0)|0}w=s.low=w+C,s.high=d+b+(w>>>0<C>>>0?1:0),p=n.low=p+O,n.high=g+R+(p>>>0<O>>>0?1:0),v=i.low=v+k,i.high=m+F+(v>>>0<k>>>0?1:0),x=u.low=x+_,u.high=N+L+(x>>>0<_>>>0?1:0),E=l.low=E+V,l.high=T+P+(E>>>0<V>>>0?1:0),M=o.low=M+U,o.high=S+B+(M>>>0<U>>>0?1:0),A=c.low=A+G,c.high=I+H+(A>>>0<G>>>0?1:0),D=f.low=D+J,f.high=y+q+(D>>>0<J>>>0?1:0)},p:function(){var t=this.m,e=t.o,r=8*this.v,s=8*t.N;return e[s>>>5]|=128<<24-s%32,e[30+(s+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(s+128>>>10<<5)]=r,t.N=4*e.length,this.S(),this.l.J()},clone:function(){var t=e.clone.call(this);return t.l=this.l.clone(),t},blockSize:32});t.SHA512=e.I(o),t.HmacSHA512=e.A(o)}(),s.SHA512)},468(t,e,r){var s;t.exports=(s=r(21),r(240),r(380),r(25),s.HmacSHA512)},471(t,e,r){var s,n,i,u,l,h,a,o;t.exports=(n=(s=o=r(21)).t,i=n.WordArray,u=n.Hasher,l=s.i,h=[],a=l.SHA1=u.extend({u:function(){this.l=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},h:function(t,e){for(var r=this.l.o,s=r[0],n=r[1],i=r[2],u=r[3],l=r[4],a=0;a<80;a++){if(a<16)h[a]=0|t[e+a];else{var o=h[a-3]^h[a-8]^h[a-14]^h[a-16];h[a]=o<<1|o>>>31}var c=(s<<5|s>>>27)+l+h[a];c+=a<20?1518500249+(n&i|~n&u):a<40?1859775393+(n^i^u):a<60?(n&i|n&u|i&u)-1894007588:(n^i^u)-899497514,l=u,u=i,i=n<<30|n>>>2,n=s,s=c}r[0]=r[0]+s|0,r[1]=r[1]+n|0,r[2]=r[2]+i|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0},p:function(){var t=this.m,e=t.o,r=8*this.v,s=8*t.N;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(s+64>>>9<<4)]=r,t.N=4*e.length,this.S(),this.l},clone:function(){var t=u.clone.call(this);return t.l=this.l.clone(),t}}),s.SHA1=u.I(a),s.HmacSHA1=u.A(a),o.SHA1)},477(){},636(t,e,r){var s;t.exports=(s=r(21),function(t){var e=s,r=e.t,n=r.WordArray,i=r.Hasher,u=e.i,l=[];!function(){for(var e=0;e<64;e++)l[e]=4294967296*t.abs(t.sin(e+1))|0}();var h=u.MD5=i.extend({u:function(){this.l=new n.init([1732584193,4023233417,2562383102,271733878])},h:function(t,e){for(var r=0;r<16;r++){var s=e+r,n=t[s];t[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var i=this.l.o,u=t[e+0],h=t[e+1],d=t[e+2],w=t[e+3],g=t[e+4],p=t[e+5],m=t[e+6],v=t[e+7],N=t[e+8],x=t[e+9],T=t[e+10],E=t[e+11],S=t[e+12],M=t[e+13],I=t[e+14],A=t[e+15],y=i[0],D=i[1],b=i[2],C=i[3];y=a(y,D,b,C,u,7,l[0]),C=a(C,y,D,b,h,12,l[1]),b=a(b,C,y,D,d,17,l[2]),D=a(D,b,C,y,w,22,l[3]),y=a(y,D,b,C,g,7,l[4]),C=a(C,y,D,b,p,12,l[5]),b=a(b,C,y,D,m,17,l[6]),D=a(D,b,C,y,v,22,l[7]),y=a(y,D,b,C,N,7,l[8]),C=a(C,y,D,b,x,12,l[9]),b=a(b,C,y,D,T,17,l[10]),D=a(D,b,C,y,E,22,l[11]),y=a(y,D,b,C,S,7,l[12]),C=a(C,y,D,b,M,12,l[13]),b=a(b,C,y,D,I,17,l[14]),y=o(y,D=a(D,b,C,y,A,22,l[15]),b,C,h,5,l[16]),C=o(C,y,D,b,m,9,l[17]),b=o(b,C,y,D,E,14,l[18]),D=o(D,b,C,y,u,20,l[19]),y=o(y,D,b,C,p,5,l[20]),C=o(C,y,D,b,T,9,l[21]),b=o(b,C,y,D,A,14,l[22]),D=o(D,b,C,y,g,20,l[23]),y=o(y,D,b,C,x,5,l[24]),C=o(C,y,D,b,I,9,l[25]),b=o(b,C,y,D,w,14,l[26]),D=o(D,b,C,y,N,20,l[27]),y=o(y,D,b,C,M,5,l[28]),C=o(C,y,D,b,d,9,l[29]),b=o(b,C,y,D,v,14,l[30]),y=c(y,D=o(D,b,C,y,S,20,l[31]),b,C,p,4,l[32]),C=c(C,y,D,b,N,11,l[33]),b=c(b,C,y,D,E,16,l[34]),D=c(D,b,C,y,I,23,l[35]),y=c(y,D,b,C,h,4,l[36]),C=c(C,y,D,b,g,11,l[37]),b=c(b,C,y,D,v,16,l[38]),D=c(D,b,C,y,T,23,l[39]),y=c(y,D,b,C,M,4,l[40]),C=c(C,y,D,b,u,11,l[41]),b=c(b,C,y,D,w,16,l[42]),D=c(D,b,C,y,m,23,l[43]),y=c(y,D,b,C,x,4,l[44]),C=c(C,y,D,b,S,11,l[45]),b=c(b,C,y,D,A,16,l[46]),y=f(y,D=c(D,b,C,y,d,23,l[47]),b,C,u,6,l[48]),C=f(C,y,D,b,v,10,l[49]),b=f(b,C,y,D,I,15,l[50]),D=f(D,b,C,y,p,21,l[51]),y=f(y,D,b,C,S,6,l[52]),C=f(C,y,D,b,w,10,l[53]),b=f(b,C,y,D,T,15,l[54]),D=f(D,b,C,y,h,21,l[55]),y=f(y,D,b,C,N,6,l[56]),C=f(C,y,D,b,A,10,l[57]),b=f(b,C,y,D,m,15,l[58]),D=f(D,b,C,y,M,21,l[59]),y=f(y,D,b,C,g,6,l[60]),C=f(C,y,D,b,E,10,l[61]),b=f(b,C,y,D,d,15,l[62]),D=f(D,b,C,y,x,21,l[63]),i[0]=i[0]+y|0,i[1]=i[1]+D|0,i[2]=i[2]+b|0,i[3]=i[3]+C|0},p:function(){var e=this.m,r=e.o,s=8*this.v,n=8*e.N;r[n>>>5]|=128<<24-n%32;var i=t.floor(s/4294967296),u=s;r[15+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(n+64>>>9<<4)]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),e.N=4*(r.length+1),this.S();for(var l=this.l,h=l.o,a=0;a<4;a++){var o=h[a];h[a]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return l},clone:function(){var t=i.clone.call(this);return t.l=this.l.clone(),t}});function a(t,e,r,s,n,i,u){var l=t+(e&r|~e&s)+n+u;return(l<<i|l>>>32-i)+e}function o(t,e,r,s,n,i,u){var l=t+(e&s|r&~s)+n+u;return(l<<i|l>>>32-i)+e}function c(t,e,r,s,n,i,u){var l=t+(e^r^s)+n+u;return(l<<i|l>>>32-i)+e}function f(t,e,r,s,n,i,u){var l=t+(r^(e|~s))+n+u;return(l<<i|l>>>32-i)+e}e.MD5=i.I(h),e.HmacMD5=i.A(h)}(Math),s.MD5)},793(t,e,r){var s;t.exports=(s=r(21),r(9),r(25),s.HmacSHA256)}},e={};function r(s){var n=e[s];if(void 0!==n)return n.exports;var i=e[s]={exports:{}};return t[s].call(i.exports,i,i.exports,r),i.exports}r.d=(t,e)=>{for(var s in e)r.X(e,s)&&!r.X(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.X=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"$",{value:!0})};var s={};return(()=>{"use strict";r.d(s,{default:()=>ch});var t={};r.r(t),r.d(t,{AreaUnitType:()=>e,CalculateTreeType:()=>n,ConditionTreeType:()=>i,DistanceUnitType:()=>u,MassUnitType:()=>l,OperandType:()=>h,VolumeUnitType:()=>a});const e={MM2:11,CM2:12,DM2:13,M2:14,KM2:15},n={String:0,Add:1,Sub:2,Mul:3,Div:4,Mod:5,Connect:6,Error:7},i={String:0,And:1,Or:2,Error:3},u={MM:1,CM:2,DM:3,M:4,KM:5},l={G:31,KG:32,T:33},h={NULL:0,ERROR:1,DATE:2,ARRARY:3,NUMBER:4,BOOLEAN:5,TEXT:6,JSON:7,ARRARYJSON:8},a={MM3:21,CM3:22,DM3:23,M3:24,KM3:25};class o{constructor(){this.W=null,this.j=!1,this.K=0,this.Y=null,this.Z=null,this.type=0}get Count(){return 2===this.type?this.W.length:1===this.type?Object.keys(this.Y).length:0}get IsArray(){return 2===this.type}get IsBoolean(){return 5===this.type}get IsDouble(){return 4===this.type}get IsObject(){return 1===this.type}get IsString(){return 3===this.type}get IsNull(){return 6===this.type}get BooleanValue(){return this.j}get NumberValue(){return this.K}get StringValue(){return this.Z}tt(){return this.et().values()}*[Symbol.iterator](){if(2===this.type)for(let t of this.W)yield t}rt(){return 1===this.type||(this.type=1,this.Y={}),this.Y}et(){return 2===this.type||(this.type=2,this.W=[]),this.W}st(t){this.type=5,this.j=t}nt(t){this.type=4,this.K=t}it(t){this.type=3,this.Z=t}ut(){this.type=6}add(t){this.et().push(t)}set(t,e){this.rt()[t]=e}lt(t){if(this.type!==t){switch(t){case 0:break;case 1:this.Y={};break;case 2:this.W=[];break;case 3:this.Z="";break;case 4:this.K=0;break;case 5:this.j=!1}this.type=t}}toString(){let t=[];return this.ht(t),t.join("")}ht(t){if(this.IsNull)t.push("null");else if(this.IsBoolean)t.push(this.j?"true":"false");else if(this.IsArray){t.push("[");for(let e=0;e<this.W.length;e++)e>0&&t.push(","),this.W[e].ht(t);t.push("]")}else if(this.IsObject){t.push("{");let e=!0;for(let r in this.Y)e||t.push(","),e=!1,t.push('"'),t.push(r.replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\0/g,"\\0").replace(/\v/g,"\\v").replace(/\a/g,"\\a").replace(/\b/g,"\\b").replace(/\f/g,"\\f")),t.push('":'),this.Y[r].ht(t);t.push("}")}else this.IsString?(t.push('"'),t.push(this.Z.replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\0/g,"\\0").replace(/\v/g,"\\v").replace(/\a/g,"\\a").replace(/\b/g,"\\b").replace(/\f/g,"\\f")),t.push('"')):this.IsDouble&&t.push(this.K.toString())}}class c{constructor(){this.ot=!1,this.ct=0,this.L=null,this.ft=0}}class f extends Error{constructor(t){super(t),this.name="JsonException"}static dt(t,e){let r=new f(`Invalid token '${t}' in input string`);return e&&(r.wt=e),r}static gt(t){let e=`Invalid character '${String.fromCharCode(t)}' in input string`;return new f(e)}}let d=65537,w=65538,g=65539,p=65540,m=65541,v=65542,N=65543,x=65544,T=65545,E=65546,S=65547,M=65548,I=65549,A=65550,y=65551,D=65552,b=65553,C=65554;class R{constructor(t){this.vt=!0,this.Nt=!0,this.xt=!1,this.Tt=new c,this.Et=0,this.St=0,this.Mt=t,this.state=1,this.It=[],this.At="",this.token=0,this.yt=0,this.Tt.L=this}get EndOfInput(){return this.xt}get Token(){return this.token}get StringValue(){return this.At}static Dt(t){switch(t){case"a":case"A":return 10;case"b":case"B":return 11;case"c":case"C":return 12;case"d":case"D":return 13;case"e":case"E":return 14;case"f":case"F":return 15;default:return t.charCodeAt(0)-48}}static bt(t){switch(t){case'"':case"'":case"\\":case"/":return String.fromCharCode(t.charCodeAt(0));case"n":return"\n";case"t":return"\t";case"r":return"\r";case"b":return"\b";case"f":return"\f";default:return"?"}}Ct(){return-1!==(this.St=this.Rt())||(this.xt=!0,!1)}Rt(){if(0!==this.Et){let t=this.Et;return this.Et=0,t}return this.Mt.read()}Ot(){let t;for(this.Tt.ot=!1;;){if(t=R.Ft[this.state-1],!t(this.Tt))throw f.gt(this.St);if(this.xt)return!1;if(this.Tt.ot)return this.At=this.It.join(""),this.It.length=0,this.token=R.kt[this.state-1],this.token===v&&(this.token=this.St),this.state=this.Tt.ct,!0;this.state=this.Tt.ct}}Lt(){this.Et=this.St}}R._t=function(t){for(;t.L.Ct();)if(!(32===t.L.St||t.L.St>=9&&t.L.St<=13)){if(t.L.St>=49&&t.L.St<=57)return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=3,!0;switch(t.L.St){case 34:return t.ct=19,t.ot=!0,!0;case 44:case 58:case 91:case 93:case 123:case 125:return t.ct=1,t.ot=!0,!0;case 45:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=2,!0;case 48:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=4,!0;case 102:return t.ct=12,!0;case 110:return t.ct=16,!0;case 116:return t.ct=9,!0;case 39:return!!t.L.Nt&&(t.L.St=34,t.ct=23,t.ot=!0,!0);case 47:return!!t.L.vt&&(t.ct=25,!0);default:return!1}}return!0},R.Pt=function(t){return t.L.Ct(),t.L.St>=49&&t.L.St<=57?(t.L.It.push(String.fromCharCode(t.L.St)),t.ct=3,!0):48===t.L.St&&(t.L.It.push(String.fromCharCode(t.L.St)),t.ct=4,!0)},R.Vt=function(t){for(;t.L.Ct();)if(t.L.St>=48&&t.L.St<=57)t.L.It.push(String.fromCharCode(t.L.St));else{if(32===t.L.St||t.L.St>=9&&t.L.St<=13)return t.ot=!0,t.ct=1,!0;switch(t.L.St){case 44:case 93:case 125:return t.L.Lt(),t.ot=!0,t.ct=1,!0;case 46:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=5,!0;case 101:case 69:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=7,!0;default:return!1}}return!0},R.Bt=function(t){if(t.L.Ct(),32===t.L.St||t.L.St>=9&&t.L.St<=13)return t.ot=!0,t.ct=1,!0;switch(t.L.St){case 44:case 93:case 125:return t.L.Lt(),t.ot=!0,t.ct=1,!0;case 46:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=5,!0;case 101:case 69:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=7,!0;default:return!1}},R.Ut=function(t){return t.L.Ct(),t.L.St>=48&&t.L.St<=57&&(t.L.It.push(String.fromCharCode(t.L.St)),t.ct=6,!0)},R.Ht=function(t){for(;t.L.Ct();)if(t.L.St>=48&&t.L.St<=57)t.L.It.push(String.fromCharCode(t.L.St));else{if(32===t.L.St||t.L.St>=9&&t.L.St<=13)return t.ot=!0,t.ct=1,!0;switch(t.L.St){case 44:case 93:case 125:return t.L.Lt(),t.ot=!0,t.ct=1,!0;case 101:case 69:return t.L.It.push(String.fromCharCode(t.L.St)),t.ct=7,!0;default:return!1}}return!0},R.Gt=function(t){return t.L.Ct(),(t.L.St>=48&&t.L.St<=57||43===t.L.St||45===t.L.St)&&(t.L.It.push(String.fromCharCode(t.L.St)),t.ct=8,!0)},R.qt=function(t){for(;t.L.Ct();)if(t.L.St>=48&&t.L.St<=57)t.L.It.push(String.fromCharCode(t.L.St));else{if(32===t.L.St||t.L.St>=9&&t.L.St<=13)return t.ot=!0,t.ct=1,!0;switch(t.L.St){case 44:case 93:case 125:return t.L.Lt(),t.ot=!0,t.ct=1,!0;default:return!1}}return!0},R.Jt=function(t){return t.L.Ct(),114===t.L.St&&(t.ct=10,!0)},R.Xt=function(t){return t.L.Ct(),117===t.L.St&&(t.ct=11,!0)},R.$t=function(t){return t.L.Ct(),101===t.L.St&&(t.ot=!0,t.ct=1,!0)},R.Wt=function(t){return t.L.Ct(),97===t.L.St&&(t.ct=13,!0)},R.jt=function(t){return t.L.Ct(),108===t.L.St&&(t.ct=14,!0)},R.Kt=function(t){return t.L.Ct(),115===t.L.St&&(t.ct=15,!0)},R.zt=function(t){return t.L.Ct(),101===t.L.St&&(t.ot=!0,t.ct=1,!0)},R.Yt=function(t){return t.L.Ct(),117===t.L.St&&(t.ct=17,!0)},R.Qt=function(t){return t.L.Ct(),108===t.L.St&&(t.ct=18,!0)},R.Zt=function(t){return t.L.Ct(),108===t.L.St&&(t.ot=!0,t.ct=1,!0)},R.te=function(t){for(;t.L.Ct();)switch(t.L.St){case 34:return t.L.Lt(),t.ot=!0,t.ct=20,!0;case 92:return t.ft=19,t.ct=21,!0;default:t.L.It.push(String.fromCharCode(t.L.St));continue}return!0},R.ee=function(t){return t.L.Ct(),34===t.L.St&&(t.ot=!0,t.ct=1,!0)},R.re=function(t){if(t.L.Ct(),117===t.L.St)return t.ct=22,!0;switch(t.L.St){case 34:case 39:case 47:case 92:case 98:case 102:case 110:case 114:case 116:return t.L.It.push(R.bt(String.fromCharCode(t.L.St))),t.ct=t.ft,!0;default:return!1}},R.se=function(t){let e=0,r=4096;for(t.L.yt=0;t.L.Ct();){let s=String.fromCharCode(t.L.St);if(!(s>="0"&&s<="9"||s>="A"&&s<="F"||s>="a"&&s<="f"))return!1;if(t.L.yt+=R.Dt(s)*r,e++,r/=16,4===e)return t.L.It.push(String.fromCharCode(t.L.yt)),t.ct=t.ft,!0}return!0},R.ne=function(t){for(;t.L.Ct();)switch(t.L.St){case 39:return t.L.Lt(),t.ot=!0,t.ct=24,!0;case 92:return t.ft=23,t.ct=21,!0;default:t.L.It.push(String.fromCharCode(t.L.St));continue}return!0},R.ie=function(t){return t.L.Ct(),39===t.L.St&&(t.L.St=34,t.ot=!0,t.ct=1,!0)},R.ue=function(t){return t.L.Ct(),42===t.L.St?(t.ct=27,!0):47===t.L.St&&(t.ct=26,!0)},R.le=function(t){for(;t.L.Ct();)if(10===t.L.St)return t.ct=1,!0;return!0},R.he=function(t){for(;t.L.Ct();)if(42===t.L.St)return t.ct=28,!0;return!0},R.ae=function(t){for(;t.L.Ct();)if(42!==t.L.St)return 47===t.L.St?(t.ct=1,!0):(t.ct=27,!0);return!0},R.Ft=[R._t,R.Pt,R.Vt,R.Bt,R.Ut,R.Ht,R.Gt,R.qt,R.Jt,R.Xt,R.$t,R.Wt,R.jt,R.Kt,R.zt,R.Yt,R.Qt,R.Zt,R.te,R.ee,R.re,R.se,R.ne,R.ie,R.ue,R.le,R.he,R.ae],R.kt=[v,0,d,d,0,d,0,d,0,0,w,0,0,0,g,0,0,p,m,v,0,0,m,v,0,0,0,0];class O{constructor(t){this.text=t,this.position=0,this.length=t.length}read(){return this.position>=this.length?-1:this.text.charCodeAt(this.position++)}}class F{constructor(t){let e=new O(t);this.oe=!1,this.ce=!1,this.fe=!1,this.de=[],this.de.push(b),this.de.push(N),this.we=new R(e),this.xt=!1,this.ge=!1,this.token=0,this.pe=null}get Token(){return this.token}get Value(){return this.pe}me(t){if(t.includes(".")||t.includes("e")||t.includes("E")){let e=parseFloat(t);if(!isNaN(e))return void(this.pe=e)}else{let e=parseInt(t,10);if(!isNaN(e))return void(this.pe=e)}this.pe=0}ve(){91===this.Ne?(this.token=4,this.ce=!0):93===this.Ne?(this.token=5,this.ce=!0):123===this.Ne?(this.token=1,this.ce=!0):125===this.Ne?(this.token=3,this.ce=!0):34===this.Ne?this.oe?(this.oe=!1,this.ce=!0):(0===this.token&&(this.token=7),this.oe=!0):this.Ne===m?this.pe=this.we.StringValue:this.Ne===g?(this.token=8,this.pe=!1,this.ce=!0):this.Ne===p?(this.token=9,this.ce=!0):this.Ne===d?(this.me(this.we.StringValue),this.token=6,this.ce=!0):this.Ne===E?this.token=2:this.Ne===w&&(this.token=8,this.pe=!0,this.ce=!0)}xe(){if(this.xt)return!1;let t=this.we.Ot();return this.we.EndOfInput?(this.close(),!1):(this.Te=this.we.Token,t)}close(){this.xt||(this.xt=!0,this.ge=!0)}read(){if(this.xt)return!1;if(this.ge&&(this.ge=!1,this.de.length=0,this.de.push(b),this.de.push(N)),this.oe=!1,this.ce=!1,this.token=0,this.pe=null,!this.fe&&(this.fe=!0,!this.xe()))return!1;let t;for(;;){if(this.ce)return this.de[this.de.length-1]===b&&(this.ge=!0),!0;if(this.Ne=this.de.pop(),this.ve(),this.Ne!==this.Te){try{t=F.Ee[this.Ne][this.Te]}catch(t){throw f.dt(this.Te,t)}if(t[0]!==C)for(let e=t.length-1;e>=0;e--)this.de.push(t[e])}else if(!this.xe()){if(this.de[this.de.length-1]!==b)throw new f("Input doesn't evaluate to proper JSON text");return!!this.ce}}}}F.Ee={[M]:{91:[91,65549]},[I]:{34:[A,y,93],91:[A,y,93],93:[93],123:[A,y,93],[d]:[A,y,93],[w]:[A,y,93],[g]:[A,y,93],[p]:[A,y,93]},[x]:{123:[123,65545]},[T]:{34:[E,S,125],125:[0]},[E]:{34:[D,58,A]},[S]:{44:[44,E,S],125:[C]},[D]:{34:[34,m,34]},[N]:{91:[M],123:[x]},[A]:{34:[D],91:[M],123:[x],[d]:[d],[w]:[w],[g]:[g],[p]:[p]},[y]:{44:[44,A,y],93:[C]}};class k{static readValue(t){if(t.read(),5===t.Token)return null;let e=new o;if(7===t.Token)return e.it(t.Value),e;if(6===t.Token)return e.nt(t.Value),e;if(8===t.Token)return e.st(t.Value),e;if(9===t.Token)return e.ut(),e;if(4===t.Token)for(e.lt(2);;){let r=k.readValue(t);if(null===r&&5===t.Token)break;e.add(r)}else if(1===t.Token)for(e.lt(1);t.read(),3!==t.Token;){let r=t.Value;e.set(r,k.readValue(t))}return e}static Se(t){let e=new F(t);return k.readValue(e)}}var L={StartDateUtc:new Date(Date.UTC(1970,0,1,0,0,0,0)),Me:function(t,e){t.IsArray&&(t=t.ArrayValue);for(var r=0;r<t.length;r++){var s=t[r];if(s.IsNumber)e.push(s.NumberValue);else if(s.IsArray){if(!(i=this.Me(s.ArrayValue,e)))return!1}else if(s.IsJson){var n=s.ToArray(null);if(n.IsError)return!1;if(!(i=this.Me(n.ArrayValue,e)))return!1}else{if(s.IsNull)continue;var i;if((i=s.ToNumber(null)).IsError)return!1;e.push(i.NumberValue)}}return!0},Ie:function(t,e){return t.IsNumber&&e.IsNumber?t.NumberValue-e.NumberValue:t.IsText&&e.IsText?t.TextValue.localeCompare(e.TextValue):t.IsBool&&e.IsBool?t.BoolValue===e.BoolValue?0:t.BoolValue?1:-1:t.IsDate&&e.IsDate?t.DateValue-e.DateValue:0},Ae:function(t,e){for(;0!==e;){var r=e;e=t%e,t=r}return t},ye:function(t){t.sort(function(t,e){return t-e});for(var e=this.Ae(Math.floor(t[1]),Math.floor(t[0])),r=2;r<t.length;r++)e=this.Ae(Math.floor(t[r]),e);return e},De:function(t){t.sort(function(t,e){return t-e}),t=t.filter(function(t){return t>1});for(var e=Math.floor(t[0]),r=1;r<t.length;r++){var s=Math.floor(t[r]);e=e/(s>e?this.Ae(s,e):this.Ae(e,s))*s}return e},be:function(t){var e=t[0];if(">"===e||">"===e){if(t.length>1&&("="===t[1]||"="===t[1])){var r=parseFloat(t.substring(2).trim());if(!isNaN(r))return{operator:">=",value:r}}else if(r=parseFloat(t.substring(1).trim()),!isNaN(r))return{operator:">",value:r}}else if("<"===e||"<"===e){if(t.length>1&&("="===t[1]||"="===t[1])){if(r=parseFloat(t.substring(2).trim()),!isNaN(r))return{operator:"<=",value:r}}else if(r=parseFloat(t.substring(1).trim()),!isNaN(r))return{operator:"<",value:r}}else if("="===e&&t.length>1&&"="===t[1]){if(r=parseFloat(t.substring(2).trim()),!isNaN(r))return{operator:"=",value:r}}else if(("="===e||"="===e||" "===e)&&t.length>1){if(r=parseFloat(t.substring(1).trim()),!isNaN(r))return{operator:"=",value:r}}else if("!"===e&&t.length>1&&("="===t[1]||"="===t[1])){if(r=parseFloat(t.substring(2).trim()),!isNaN(r))return{operator:"!=",value:r}}else if(r=parseFloat(t.trim()),!isNaN(r))return{operator:"=",value:r};return null},TryParseBoolean:function(t){return"true"===t.toLowerCase()||"yes"===t.toLowerCase()||"false"!==t.toLowerCase()&&"no"!==t.toLowerCase()&&("1"===t||"是"===t||"有"===t||"0"!==t&&"否"!==t&&"不是"!==t&&"无"!==t&&"没有"!==t&&null)},Ce:function(t,e,r){let s=0;for(let n=0;n<t.length;n++){let i=t[n];2===arguments.length?i===e&&s++:this.Ie(i,r,e)&&s++}return s},Ie:function(t,e,r){return"<"===r?t<e:"<="===r?t<=e:">"===r?t>e:">="===r?t>=e:"="===r?t===e:t!==e},Re:function(t,e,r,s){let n=0;for(let i=0;i<t.length;i++)if(3===arguments.length){let s=e,u=r;t[i]===s&&(n+=u[i])}else{let u=e,l=r,h=s;this.Ie(t[i],l,u)&&(n+=h[i])}return n}};class _{constructor(t,e,r,s,n,i){if(t instanceof Date)this.Year=t.getFullYear(),this.Month=t.getMonth()+1,this.Day=t.getDate(),this.Hour=t.getHours(),this.Minute=t.getMinutes(),this.Second=t.getSeconds();else if("number"==typeof t&&void 0===e){let e=t,r=Math.floor(e);if(r>365){let t=new Date(1900,0,1),e=new Date(t);e.setDate(e.getDate()+r-2),this.Year=e.getFullYear(),this.Month=e.getMonth()+1,this.Day=e.getDate()}else this.Year=null,this.Month=null,this.Day=r;let s=e-r;this.Hour=Math.floor(24*s),this.Minute=Math.floor(60*(24*s-this.Hour)),this.Second=Math.round(60*(60*(24*s-this.Hour)-this.Minute)),60===this.Second&&(this.Second=0,this.Minute++,60===this.Minute&&(this.Minute=0,this.Hour++))}else if("object"==typeof t&&null!==t&&"Oe"in t){let e=t;this.Year=null,this.Month=null,this.Day=e.Oe||0,this.Hour=e.Fe||0,this.Minute=e.ke||0,this.Second=e.Le||0}else this.Year=t,this.Month=e,this.Day=r,this.Hour=s||0,this.Minute=n||0,this.Second=i||0}toString(t){if(t)return this.toString();if(null!=this.Year&&this.Year>0)return`${this.Year}-${this.Month.toString().padStart(2,"0")}-${this.Day.toString().padStart(2,"0")} ${this.Hour.toString().padStart(2,"0")}:${this.Minute.toString().padStart(2,"0")}:${this.Second.toString().padStart(2,"0")}`;{let t="";return null!=this.Day&&this.Day>0&&(t+=`${this.Day} `),t+=`${this.Hour.toString().padStart(2,"0")}:${this.Minute.toString().padStart(2,"0")}:${this.Second.toString().padStart(2,"0")}`,t}}ToDateTime(t){return null!=this.Year&&this.Year>0?0===t?new Date(Date.UTC(this.Year,this.Month-1,this.Day,this.Hour,this.Minute,this.Second)):new Date(this.Year,this.Month-1,this.Day,this.Hour,this.Minute,this.Second):new Date(1970,0,1+(this.Day||0),this.Hour,this.Minute,this.Second)}ToTimeSpan(){return{Oe:this.Day||0,Fe:this.Hour,ke:this.Minute,Le:this.Second}}AddYears(t){let e=(this.Year||0)+t;return new _(e,this.Month,this.Day,this.Hour,this.Minute,this.Second)}AddMonths(t){let e=(this.Month||0)+t;if(e>=1&&e<=12)return new _(this.Year,e,this.Day,this.Hour,this.Minute,this.Second);let r=this.ToDateTime();return r.setMonth(r.getMonth()+t),new _(r)}AddDays(t){if(null!=this.Year&&this.Year>1900){let e=(this.Day||0)+t;if(e>=1&&e<=28)return new _(this.Year,this.Month,e,this.Hour,this.Minute,this.Second);let r=this.ToDateTime();return r.setDate(r.getDate()+t),new _(r)}return new _(null,null,(this.Day||0)+t,this.Hour,this.Minute,this.Second)}AddHours(t){let e=this.Hour+t;if(e>=0&&e<24)return new _(this.Year,this.Month,this.Day,e,this.Minute,this.Second);if(null!=this.Year&&this.Year>1900){let e=this.ToDateTime();return e.setHours(e.getHours()+t),new _(e)}let r=this.Hour+t,s=Math.floor(r/24),n=r%24;return n<0&&(n+=24,s--),new _(null,null,(this.Day||0)+s,n,this.Minute,this.Second)}AddMinutes(t){let e=this.Minute+t;if(e>=0&&e<=59)return new _(this.Year,this.Month,this.Day,this.Hour,e,this.Second);if(null!=this.Year&&this.Year>1900){let e=this.ToDateTime();return e.setMinutes(e.getMinutes()+t),new _(e)}let r=this.Minute+t,s=Math.floor(r/60),n=r%60;return n<0&&(n+=60,s--),this.AddHours(s).AddMinutes(n)}AddSeconds(t){let e=this.Second+t;if(e>=0&&e<=59)return new _(this.Year,this.Month,this.Day,this.Hour,this.Minute,e);if(null!=this.Year&&this.Year>1900){let e=this.ToDateTime();return e.setSeconds(e.getSeconds()+t),new _(e)}let r=this.Second+t,s=Math.floor(r/60),n=r%60;return n<0&&(n+=60,s--),this.AddMinutes(s).AddSeconds(n)}ToLong(){let t=0;return null!=this.Year&&(t+=1e10*this.Year),null!=this.Month&&(t+=1e8*this.Month),null!=this.Day&&(t+=1e6*this.Day),t+=1e4*this.Hour,t+=100*this.Minute,t+=this.Second,t}static Parse(t){let e=t.trim(),r=e.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return r?new _(parseInt(r[1]),parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5]),parseInt(r[6])):(r=e.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2})$/),r?new _(parseInt(r[1]),parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5]),0):(r=e.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/),r?new _(parseInt(r[1]),parseInt(r[2]),parseInt(r[3]),0,0,0):(r=e.match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/),r?new _(null,null,null,parseInt(r[1]),parseInt(r[2]),parseInt(r[3])):(r=e.match(/^(\d{1,2}):(\d{1,2})$/),r?new _(null,null,null,parseInt(r[1]),parseInt(r[2]),0):null))))}}"undefined"!=typeof window&&(window.MyDate=_);class P{static Version;static True;static False;static One;static Zero;get IsNull(){return!1}get IsNumber(){return!1}get IsText(){return!1}get IsBoolean(){return!1}get IsArray(){return!1}get IsDate(){return!1}get IsJson(){return!1}get IsArrayJson(){return!1}get IsError(){return!1}get ErrorMsg(){return null}get Type(){throw new Error("FIXME")}get NumberValue(){throw new Error("FIXME")}get DoubleValue(){throw new Error("FIXME")}get IntValue(){throw new Error("FIXME")}get LongValue(){throw new Error("FIXME")}get TextValue(){throw new Error("FIXME")}get BooleanValue(){throw new Error("FIXME")}get ArrayValue(){throw new Error("FIXME")}get JsonValue(){throw new Error("FIXME")}get DateValue(){throw new Error("FIXME")}static Create(t){if(t instanceof P)return t;if("boolean"==typeof t)return t?P.True:P.False;if("number"==typeof t)return new V(t);if("string"==typeof t)return null===t?P.CreateNull():new U(t);if(t instanceof _)return new H(t);if(t instanceof o)return new G(t);if(Array.isArray(t)){let e=[];for(let r=0;r<t.length;r++){let s=P.Create(t[r]);e.push(s)}return new q(e)}return P.CreateNull()}static CreateJson(t){if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{let e=k.Se(t);return P.Create(e)}catch(t){}return P.Error("Convert to json error!")}static Error(t,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),new J(t)}static CreateNull(){return new X}ToNumber(t=null,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),P.Error(t??"Convert to number error!")}ToBoolean(t=null,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),P.Error(t??"Convert to bool error!")}ToText(t=null,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),P.Error(t??"Convert to string error!")}ToMyDate(t=null,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),P.Error(t??"Convert to date error!")}ToArray(t=null,...e){return e.length>0&&(t=t.replace(/\{\d+\}/g,(t,r)=>{let s=parseInt(t.substring(1,t.length-1));return void 0!==e[s]?e[s]:t})),P.Error(t??"Convert to array error!")}ToJson(t=null){return P.Error(t??"Convert to json error!")}}class V extends P{constructor(t){super(),this._e=t}get IsNumber(){return!0}get Type(){return h.NUMBER}get IntValue(){return Math.floor(this._e)}get NumberValue(){return this._e}get LongValue(){return Math.floor(this._e)}get DoubleValue(){return this._e}ToNumber(t){return this}ToNumber(t,...e){return this}ToBoolean(t){return 0===this._e?P.False:1===this._e?P.True:super.ToBoolean(t)}ToBoolean(t,...e){return 0===this._e?P.False:1===this._e?P.True:super.ToBoolean(t,...e)}ToText(t){return P.Create(this.DoubleValue.toString())}ToText(t,...e){return P.Create(this.DoubleValue.toString())}toString(){return this.DoubleValue.toString()}}class B extends P{constructor(t){super(),this._e=t}get IsBoolean(){return!0}get Type(){return h.BOOLEAN}get BooleanValue(){return this._e}ToNumber(t){return this._e?P.One:P.Zero}ToNumber(t,...e){return this._e?P.One:P.Zero}ToBoolean(t){return this}ToBoolean(t,...e){return this}ToText(t){return P.Create(this._e?"TRUE":"FALSE")}ToText(t,...e){return P.Create(this._e?"TRUE":"FALSE")}toString(){return this._e?"true":"false"}}class U extends P{constructor(t){super(),this._e=t}get IsText(){return!0}get Type(){return h.TEXT}get TextValue(){return this._e}ToNumber(t){if(-1===this.TextValue.indexOf(".")){let t=parseInt(this.TextValue);if(!isNaN(t))return P.Create(t)}let e=parseFloat(this.TextValue);return isNaN(e)?null==t?P.Error("Convert to number error!"):P.Error(t):P.Create(e)}ToNumber(t,...e){if(-1===this.TextValue.indexOf(".")){let t=parseInt(this.TextValue);if(!isNaN(t))return P.Create(t)}let r=parseFloat(this.TextValue);return isNaN(r)?null==t?P.Error("Convert to number error!"):P.Error(t):P.Create(r)}ToText(t){return this}ToText(t,...e){return this}ToBoolean(t){let e=L.TryParseBoolean(this.TextValue);return null!==e?e?P.True:P.False:null==t?P.Error("Convert to bool error!"):P.Error(t)}ToBoolean(t,...e){let r=L.TryParseBoolean(this.TextValue);return null!==r?r?P.True:P.False:null==t?P.Error("Convert to bool error!"):P.Error(t)}ToMyDate(t){try{let t=new Date(this.TextValue.replaceAll("/","-"));if(!isNaN(t.getTime()))return P.Create(new _(t))}catch(t){}return null==t?P.Error("Convert to date error!"):P.Error(t)}ToMyDate(t,...e){try{let t=new Date(this.TextValue.replaceAll("/","-"));if(!isNaN(t.getTime()))return P.Create(new _(t))}catch(t){}return null==t?P.Error("Convert to date error!"):P.Error(t)}ToArray(t){return P.Error(t??"Convert to array error!")}ToJson(t=null){let e=this.TextValue.trim();if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{let t=k.Se(e);return P.Create(t)}catch(t){}return P.Error(t??"Convert to json error!")}toString(){let t='"';for(let e of this._e)switch(e){case'"':t+='\\"';break;case"\n":t+="\\n";break;case"\r":t+="\\r";break;case"\t":t+="\\t";break;case"\0":t+="\\0";break;case"\v":t+="\\v";break;case"a":t+="\\a";break;case"\b":t+="\\b";break;case"\f":t+="\\f";break;default:t+=e}return t+='"',t}}class H extends P{constructor(t){super(),this._e=t}get IsDate(){return!0}get Type(){return h.DATE}get DateValue(){return this._e}ToNumber(t){return P.Create(this._e.valueOf())}ToNumber(t,...e){return P.Create(this._e.valueOf())}ToBoolean(t){return 0!==this._e.valueOf()?P.True:P.False}ToBoolean(t,...e){return 0!==this._e.valueOf()?P.True:P.False}ToText(t){return P.Create(this._e.toString())}ToText(t,...e){return P.Create(this._e.toString())}ToMyDate(t){return this}ToMyDate(t,...e){return this}toString(){return'"'+this._e.toString()+'"'}}class G extends P{constructor(t){super(),this._e=t}get IsJson(){return!0}get Type(){return h.JSON}get JsonValue(){return this._e}get IsArrayJson(){return!1}ToText(t=null){return P.Create(this._e.toString())}ToText(t,...e){return P.Create(this._e.toString())}ToArray(t){if(this.JsonValue.IsArray){let t=[];for(let e of this.JsonValue)e.IsString?t.push(P.Create(e.StringValue)):e.IsBoolean?t.push(P.Create(e.BooleanValue)):e.IsDouble?t.push(P.Create(e.NumberValue)):e.IsNull?t.push(P.CreateNull()):t.push(P.Create(e));return P.Create(t)}return P.Error(t??"Convert to array error!")}ToArray(t,...e){if(this.JsonValue.IsArray){let t=[];for(let e of this.JsonValue)e.IsString?t.push(P.Create(e.StringValue)):e.IsBoolean?t.push(P.Create(e.BooleanValue)):e.IsDouble?t.push(P.Create(e.NumberValue)):e.IsNull?t.push(P.CreateNull()):t.push(P.Create(e));return P.Create(t)}return P.Error(t)}ToJson(t=null){return this}TryGetValue(t){if(this.JsonValue.IsObject){let e=this.JsonValue.Y[t];if(e)return e.IsString?P.Create(e.StringValue):e.IsBoolean?P.Create(e.BooleanValue):e.IsDouble?P.Create(e.NumberValue):e.IsNull?P.CreateNull():P.Create(e)}return null}toString(){return this._e.toString()}}class q extends P{constructor(t){super(),this._e=t}get IsArray(){return!0}get Type(){return h.ARRARY}get ArrayValue(){return this._e}ToText(t=null){return P.Create(this.toString())}ToText(t,...e){return P.Create(this.toString())}ToArray(t){return this}ToArray(t,...e){return this}ToJson(t=null){let e=this.toString();try{let t=k.Se(e);return P.Create(t)}catch(t){}return P.Error(t??"Convert to json error!")}toString(){return"["+this.ArrayValue.map(t=>t.toString()).join(",")+"]"}}class J extends P{get Type(){return h.ERROR}get IsError(){return!0}constructor(t){super(),this.Pe=t}get ErrorMsg(){return this.Pe}ToNumber(t){return this}ToNumber(t,...e){return this}ToBoolean(t){return this}ToBoolean(t,...e){return this}ToText(t){return this}ToText(t,...e){return this}ToArray(t){return this}ToArray(t,...e){return this}ToMyDate(t){return this}ToMyDate(t,...e){return this}}class X extends P{get IsNull(){return!0}get IsNotNull(){return!1}get Type(){return h.NULL}toString(){return"null"}}class $ extends P{constructor(){super(),this.TextList=[]}get IsArrayJson(){return!0}get Type(){return h.ARRARYJSON}get ArrayValue(){return this.TextList.map(t=>t.Value)}ToText(t=null){return P.Create(this.toString())}ToText(t,...e){return P.Create(this.toString())}ToArray(t){return P.Create(this.ArrayValue)}ToArray(t,...e){return P.Create(this.ArrayValue)}ToJson(t=null){let e=this.toString();try{let t=k.Se(e);return P.Create(t)}catch(t){}return P.Error(t??"Convert to json error!")}AddValue(t){this.TextList.push(t)}TryGetValue(t){for(let e of this.TextList)if(e.key===t.toString())return e.value;return null}ContainsKey(t){for(let e of this.TextList)if(t.TextValue===e.value)return!0;return!1}ContainsValue(t){for(let e of this.TextList){let r=e.Value;if(t.Type===r.Type&&t.IsText&&t.TextValue===r.TextValue)return!0}return!1}toString(){return"{"+this.TextList.map(t=>'"'+t.Key+'":'+t.Value.toString()).join(",")+"}"}}class W extends P{constructor(t){super(),this._e=t}get IsArrayJson(){return!0}get Type(){return h.ARRARYJSON}get Value(){return this._e}}P.Version=new U("ToolGood.Algorithm 6.2"),P.True=new B(!0),P.False=new B(!1),P.One=P.Create(1),P.Zero=P.Create(0),"undefined"!=typeof window&&(window.Operand=P,window.OperandDouble=V,window.OperandBoolean=B,window.OperandString=U,window.OperandMyDate=H,window.OperandJson=G,window.OperandArray=q,window.OperandError=J,window.OperandNull=X,window.KeyValue=class{constructor(t,e){this.Key=t,this.Value=e}},window.OperandKeyValueList=$,window.OperandKeyValue=W);class j{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.Ve=null,this.line=null,this.Be=null,this.Ue=null}He(){return this.source[0]}Ge(){return this.source[1]}get text(){return this.Ue}set text(t){this.Ue=t}}j.qe=0,j.EPSILON=-2,j.Je=1,j.EOF=-1,j.Xe=0,j.$e=1;class K{We(t,e,r,s,n,i){}je(t,e,r,s,n,i,u){}Ke(t,e,r,s,n,i){}ze(t,e,r,s,n,i){}}class z extends K{constructor(){super()}We(t,e,r,s,n,i){}}z.INSTANCE=new z;class Y extends K{constructor(t){if(super(),null===t)throw"delegates";return this.Ye=t,this}We(t,e,r,s,n,i){this.Ye.map(u=>u.We(t,e,r,s,n,i))}je(t,e,r,s,n,i,u){this.Ye.map(l=>l.je(t,e,r,s,n,i,u))}Ke(t,e,r,s,n,i){this.Ye.map(u=>u.Ke(t,e,r,s,n,i))}ze(t,e,r,s,n,i){this.Ye.map(u=>u.ze(t,e,r,s,n,i))}}class Q{constructor(){this.Qe=[z.INSTANCE],this.Ze=null,this.tr=-1}er(t){}rr(t){this.Qe.push(t)}sr(){this.Qe=[]}nr(){return Object.getPrototypeOf(this).constructor.ir||[]}ur(){return Object.getPrototypeOf(this).constructor.lr||[]}hr(){if(!this.ar){let t=this.nr(),e=this.ur(),r=t.length>e.length?t.length:e.length;this.ar=[];for(let s=0;s<r;s++)this.ar[s]=t[s]||e[s]||"<INVALID"}return this.ar}cr(){let t=this.hr();if(null===t)throw"The current recognizer does not provide a list of token names.";let e=this.dr[t];return void 0===e&&(e=t.reduce(function(t,e,r){t[e]=r}),e.EOF=j.EOF,this.dr[t]=e),e}wr(){let t=this.gr;if(null===t)throw"The current recognizer does not provide a list of rule names.";let e=this.pr[t];return void 0===e&&(e=t.reduce(function(t,e,r){t[e]=r}),this.pr[t]=e),e}mr(t){let e=this.cr()[t];return void 0!==e?e:j.qe}vr(t){return"line "+t.Nr().line+":"+t.Nr().Be}Tr(t){if(null===t)return"<no token>";let e=t.text;return null===e&&(e=t.type===j.EOF?"<EOF>":"<"+t.type+">"),e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+e+"'"}Er(){return this.Sr()}Sr(){return new Y(this.Qe)}Mr(t,e,r){return!0}Ir(t,e){return!0}get Ar(){return this.Ze.Ar}get state(){return this.tr}set state(t){this.tr=t}}Q.dr={},Q.pr={};class Z extends j{constructor(t,e,r,s,n){super(),this.source=void 0!==t?t:Z.yr,this.type=void 0!==e?e:null,this.channel=void 0!==r?r:j.Xe,this.start=void 0!==s?s:-1,this.stop=void 0!==n?n:-1,this.Ve=-1,null!==this.source[0]?(this.line=t[0].line,this.Be=t[0].Be):this.Be=-1}clone(){let t=new Z(this.source,this.type,this.channel,this.start,this.stop);return t.Ve=this.Ve,t.line=this.line,t.Be=this.Be,t.text=this.text,t}Dr(t){let e=new Z(this.source,t,this.channel,this.start,this.stop);return e.Ve=this.Ve,e.line=this.line,e.Be=this.Be,t===j.EOF&&(e.text=""),e}toString(){let t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.Ve+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.Be+"]"}get text(){if(null!==this.Ue)return this.Ue;let t=this.Ge();if(null===t)return null;let e=t.size;return this.start<e&&this.stop<e?t.br(this.start,this.stop):"<EOF>"}set text(t){this.Ue=t}}Z.yr=[null,null];class tt{}class et extends tt{constructor(t){super(),this.Cr=void 0!==t&&t}create(t,e,r,s,n,i,u,l){let h=new Z(t,e,s,n,i);return h.line=u,h.Be=l,null!==r?h.text=r:this.Cr&&null!==t[1]&&(h.text=t[1].br(n,i)),h}Rr(t,e){let r=new Z(null,t);return r.text=e,r}}et.DEFAULT=new et;class rt extends Error{constructor(t){super(t.message),Error.captureStackTrace&&Error.captureStackTrace(this,rt),this.message=t.message,this.Fr=t.Fr,this.input=t.input,this.kr=t.kr,this.Lr=null,this._r=-1,null!==this.Fr&&(this._r=this.Fr.state)}Pr(){return null!==this.Fr?this.Fr.Ar.Pr(this._r,this.kr):null}toString(){return this.message}}class st{constructor(t,e){this.start=t,this.stop=e}clone(){return new st(this.start,this.stop)}contains(t){return t>=this.start&&t<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}st.Vr=new st(-1,-2);class nt extends rt{constructor(t,e,r,s){super({message:"",Fr:t,input:e,kr:null}),this.Br=r,this.Ur=s}toString(){let t="";return this.Br>=0&&this.Br<this.input.size&&(t=this.input.br(new st(this.Br,this.Br))),"LexerNoViableAltException"+t}}class it extends Q{constructor(t){super(),this.Hr=t,this.Gr=et.DEFAULT,this.qr=[this,t],this.Ze=null,this.Jr=null,this.Xr=-1,this.$r=-1,this.Wr=-1,this.jr=!1,this.Kr=j.Xe,this.zr=j.qe,this.Yr=[],this.Qr=it.Zr,this.Ue=null}reset(){null!==this.Hr&&this.Hr.seek(0),this.Jr=null,this.zr=j.qe,this.Kr=j.Xe,this.Xr=-1,this.Wr=-1,this.$r=-1,this.Ue=null,this.jr=!1,this.Qr=it.Zr,this.Yr=[],this.Ze.reset()}Ot(){if(null===this.Hr)throw"nextToken requires a non-null input stream.";let t=this.Hr.mark();try{for(;;){if(this.jr)return this.ts(),this.Jr;this.Jr=null,this.Kr=j.Xe,this.Xr=this.Hr.index,this.Wr=this.Ze.Be,this.$r=this.Ze.line,this.Ue=null;let t=!1;for(;;){this.zr=j.qe;let e=it.SKIP;try{e=this.Ze.match(this.Hr,this.Qr)}catch(t){if(!(t instanceof rt))throw t;this.es(t),this.rs(t)}if(this.Hr.LA(1)===j.EOF&&(this.jr=!0),this.zr===j.qe&&(this.zr=e),this.zr===it.SKIP){t=!0;break}if(this.zr!==it.MORE)break}if(!t)return null===this.Jr&&this.emit(),this.Jr}}finally{this.Hr.release(t)}}ss(){this.zr=it.SKIP}ns(){this.zr=it.MORE}mode(t){this.us(t)}us(t){this.Qr=t}ls(){return this.Qr}hs(){return this.Yr}cs(t){this.Ze.debug,this.Yr.push(this.Qr),this.us(t)}fs(){if(0===this.Yr.length)throw"Empty Stack";return this.Ze.debug,this.us(this.Yr.pop()),this.Qr}ds(t){this.Jr=t}emit(){let t=this.Gr.create(this.qr,this.zr,this.Ue,this.Kr,this.Xr,this.ws()-1,this.$r,this.Wr);return this.ds(t),t}ts(){let t=this.Be,e=this.line,r=this.Gr.create(this.qr,j.EOF,null,j.Xe,this.Hr.index,this.Hr.index-1,e,t);return this.ds(r),r}ws(){return this.Hr.index}gs(){let t=[],e=this.Ot();for(;e.type!==j.EOF;)t.push(e),e=this.Ot();return t}es(t){let e=this.Xr,r=this.Hr.index,s=this.Hr.br(e,r),n="token recognition error at: '"+this.ps(s)+"'";this.Sr().We(this,null,this.$r,this.Wr,n,t)}ps(t){let e=[];for(let r=0;r<t.length;r++)e.push(t[r]);return e.join("")}vs(t){return t.charCodeAt(0)===j.EOF?"<EOF>":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t}Ns(t){return"'"+this.vs(t)+"'"}rs(t){this.Hr.LA(1)!==j.EOF&&(t instanceof nt?this.Ze.xs(this.Hr):this.Hr.xs())}get Ts(){return this.Hr}set Ts(t){this.Hr=null,this.qr=[this,this.Hr],this.reset(),this.Hr=t,this.qr=[this,this.Hr]}get Es(){return this.Hr.Es}get type(){return this.zr}set type(t){this.zr=t}get line(){return this.Ze.line}set line(t){this.Ze.line=t}get Be(){return this.Ze.Be}set Be(t){this.Ze.Be=t}get text(){return null!==this.Ue?this.Ue:this.Ze.br(this.Hr)}set text(t){this.Ue=t}}it.Zr=0,it.MORE=-2,it.SKIP=-3,it.Ss=j.Xe,it.HIDDEN=j.$e,it.Ms=0,it.Is=1114111;class ut{}class lt extends ut{constructor(t){super(),this.As=t,this.ys=[],this.index=-1,this.Ds=!1}mark(){return 0}release(t){}reset(){this.seek(0)}seek(t){this.bs(),this.index=this.Cs(t)}get size(){return this.ys.length}get(t){return this.bs(),this.ys[t]}xs(){let t=!1;if(t=this.index>=0&&(this.Ds?this.index<this.ys.length-1:this.index<this.ys.length),!t&&this.LA(1)===j.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.Cs(this.index+1))}sync(t){let e=t-this.ys.length+1;return!(e>0)||this.fetch(e)>=e}fetch(t){if(this.Ds)return 0;for(let e=0;e<t;e++){let t=this.As.Ot();if(t.Ve=this.ys.length,this.ys.push(t),t.type===j.EOF)return this.Ds=!0,e+1}return t}Rs(t,e,r){if(void 0===r&&(r=null),t<0||e<0)return null;this.bs();let s=[];e>=this.ys.length&&(e=this.ys.length-1);for(let n=t;n<e;n++){let t=this.ys[n];if(t.type===j.EOF)break;(null===r||r.contains(t.type))&&s.push(t)}return s}LA(t){return this.LT(t).type}LB(t){return this.index-t<0?null:this.ys[this.index-t]}LT(t){if(this.bs(),0===t)return null;if(t<0)return this.LB(-t);let e=this.index+t-1;return this.sync(e),e>=this.ys.length?this.ys[this.ys.length-1]:this.ys[e]}Cs(t){return t}bs(){-1===this.index&&this.Os()}Os(){this.sync(0),this.index=this.Cs(0)}Fs(t){this.As=t,this.ys=[],this.index=-1,this.Ds=!1}ks(t,e){if(this.sync(t),t>=this.ys.length)return-1;let r=this.ys[t];for(;r.channel!==e;){if(r.type===j.EOF)return-1;t+=1,this.sync(t),r=this.ys[t]}return t}Ls(t,e){for(;t>=0&&this.ys[t].channel!==e;)t-=1;return t}_s(t,e){if(void 0===e&&(e=-1),this.bs(),t<0||t>=this.ys.length)throw t+" not in 0.."+this.ys.length-1;let r=this.ks(t+1,it.Ss),s=t+1,n=-1===r?this.ys.length-1:r;return this.Ps(s,n,e)}Vs(t,e){if(void 0===e&&(e=-1),this.bs(),t<0||t>=this.ys.length)throw t+" not in 0.."+this.ys.length-1;let r=this.Ls(t-1,it.Ss);if(r===t-1)return null;let s=r+1,n=t-1;return this.Ps(s,n,e)}Ps(t,e,r){let s=[];for(let n=t;n<e+1;n++){let t=this.ys[n];-1===r?t.channel!==it.Ss&&s.push(t):t.channel===r&&s.push(t)}return 0===s.length?null:s}Bs(){return this.As.Bs()}br(t){this.bs(),this.fill(),t||(t=new st(0,this.ys.length-1));let e=t.start;e instanceof j&&(e=e.Ve);let r=t.stop;if(r instanceof j&&(r=r.Ve),null===e||null===r||e<0||r<0)return"";r>=this.ys.length&&(r=this.ys.length-1);let s="";for(let t=e;t<r+1;t++){let e=this.ys[t];if(e.type===j.EOF)break;s+=e.text}return s}fill(){for(this.bs();1e3===this.fetch(1e3););}}Object.defineProperty(lt,"size",{get:function(){return this.ys.length}});class ht extends lt{constructor(t,e){super(t),this.channel=void 0===e?j.Xe:e}Cs(t){return this.ks(t,this.channel)}LB(t){if(0===t||this.index-t<0)return null;let e=this.index,r=1;for(;r<=t;)e=this.Ls(e-1,this.channel),r+=1;return e<0?null:this.ys[e]}LT(t){if(this.bs(),0===t)return null;if(t<0)return this.LB(-t);let e=this.index,r=1;for(;r<t;)this.sync(e+1)&&(e=this.ks(e+1,this.channel)),r+=1;return this.ys[e]}Us(){let t=0;this.fill();for(let e=0;e<this.ys.length;e++){let r=this.ys[e];if(r.channel===this.channel&&(t+=1),r.type===j.EOF)break}return t}}function at(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!(t[r]===e[r]||t[r].equals&&t[r].equals(e[r])))return!1;return!0}let ot=Math.round(Math.random()*Math.pow(2,32));function ct(t){if(!t)return 0;let e,r,s=typeof t,n="string"===s?t:!("object"!==s||!t.toString)&&t.toString();if(!n)return 0;let i=3&n.length,u=n.length-i,l=ot,h=3432918353,a=461845907,o=0;for(;o<u;)r=255&n.charCodeAt(o)|(255&n.charCodeAt(++o))<<8|(255&n.charCodeAt(++o))<<16|(255&n.charCodeAt(++o))<<24,++o,r=(65535&r)*h+(((r>>>16)*h&65535)<<16)&4294967295,r=r<<15|r>>>17,r=(65535&r)*a+(((r>>>16)*a&65535)<<16)&4294967295,l^=r,l=l<<13|l>>>19,e=5*(65535&l)+((5*(l>>>16)&65535)<<16)&4294967295,l=27492+(65535&e)+(((e>>>16)+58964&65535)<<16);switch(r=0,i){case 3:r^=(255&n.charCodeAt(o+2))<<16;case 2:r^=(255&n.charCodeAt(o+1))<<8;case 1:r^=255&n.charCodeAt(o),r=(65535&r)*h+(((r>>>16)*h&65535)<<16)&4294967295,r=r<<15|r>>>17,r=(65535&r)*a+(((r>>>16)*a&65535)<<16)&4294967295,l^=r}return l^=n.length,l^=l>>>16,l=2246822507*(65535&l)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(65535&l)+((3266489909*(l>>>16)&65535)<<16)&4294967295,l^=l>>>16,l>>>0}class ft{constructor(){this.count=0,this.hash=0}update(){for(let t=0;t<arguments.length;t++){let e=arguments[t];if(null!=e)if(Array.isArray(e))this.update.apply(this,e);else{let t=0;switch(typeof e){case"undefined":case"function":continue;case"number":case"boolean":t=e;break;case"string":t=ct(e);break;default:e.Hs&&e.Hs(this);continue}t*=3432918353,t=t<<15|t>>>17,t*=461845907,this.count=this.count+1;let r=this.hash^t;r=r<<13|r>>>19,r=5*r+3864292196,this.hash=r}}}finish(){let t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16,t}static Gs(){let t=new ft;return t.update.apply(t,arguments),t.finish()}}function dt(t){return t?"string"==typeof t?ct(t):t.qs():-1}function wt(t,e){return t&&t.equals?t.equals(e):t===e}function gt(t){return null===t?"null":t}function pt(t){return Array.isArray(t)?"["+t.map(gt).join(", ")+"]":"null"}class mt{constructor(t,e){this.Js=new Array(16),this.threshold=Math.floor(12),this.Xs=0,this.$s=t||dt,this.Ws=e||wt}get(t){if(null==t)return t;let e=this.js(t);if(!e)return null;for(let r of e)if(this.Ws(r,t))return r;return null}add(t){return this.Ks(t)===t}Ks(t){this.zs();let e=this.Ys(t),r=this.Js[e];if(!r)return r=[t],this.Js[e]=r,this.Xs++,t;for(let e of r)if(this.Ws(e,t))return e;return r.push(t),this.Xs++,t}has(t){return null!=this.get(t)}values(){return this.Js.filter(t=>null!=t).flat(1)}toString(){return pt(this.values())}get length(){return this.Xs}Ys(t){return this.$s(t)&this.Js.length-1}js(t){return this.Js[this.Ys(t)]}zs(){if(this.Xs<=this.threshold)return;let t=this.Js,e=2*this.Js.length;this.Js=new Array(e),this.threshold=Math.floor(.75*e);for(let e of t)if(e)for(let t of e){let e=this.Ys(t),r=this.Js[e];r||(r=[],this.Js[e]=r),r.push(t)}}}class vt{qs(){let t=new ft;return this.Hs(t),t.finish()}evaluate(t,e){}Qs(t,e){return this}static Zs(t,e){if(null===t||t===vt.NONE)return e;if(null===e||e===vt.NONE)return t;let r=new Nt(t,e);return 1===r.tn.length?r.tn[0]:r}static en(t,e){if(null===t)return e;if(null===e)return t;if(t===vt.NONE||e===vt.NONE)return vt.NONE;let r=new xt(t,e);return 1===r.tn.length?r.tn[0]:r}}class Nt extends vt{constructor(t,e){super();let r=new mt;t instanceof Nt?t.tn.map(function(t){r.add(t)}):r.add(t),e instanceof Nt?e.tn.map(function(t){r.add(t)}):r.add(e);let s=Tt(r);if(s.length>0){let t=null;s.map(function(e){(null===t||e.rn<t.rn)&&(t=e)}),r.add(t)}this.tn=Array.from(r.values())}equals(t){return this===t||t instanceof Nt&&at(this.tn,t.tn)}Hs(t){t.update(this.tn,"AND")}evaluate(t,e){for(let r=0;r<this.tn.length;r++)if(!this.tn[r].evaluate(t,e))return!1;return!0}Qs(t,e){let r=!1,s=[];for(let n=0;n<this.tn.length;n++){let i=this.tn[n],u=i.Qs(t,e);if(r|=u!==i,null===u)return null;u!==vt.NONE&&s.push(u)}if(!r)return this;if(0===s.length)return vt.NONE;let n=null;return s.map(function(t){n=null===n?t:vt.Zs(n,t)}),n}toString(){let t=this.tn.map(t=>t.toString());return(t.length>3?t.slice(3):t).join("&&")}}class xt extends vt{constructor(t,e){super();let r=new mt;t instanceof xt?t.tn.map(function(t){r.add(t)}):r.add(t),e instanceof xt?e.tn.map(function(t){r.add(t)}):r.add(e);let s=Tt(r);if(s.length>0){let t=s.sort(function(t,e){return t.sn(e)}),e=t[t.length-1];r.add(e)}this.tn=Array.from(r.values())}equals(t){return this===t||t instanceof xt&&at(this.tn,t.tn)}Hs(t){t.update(this.tn,"OR")}evaluate(t,e){for(let r=0;r<this.tn.length;r++)if(this.tn[r].evaluate(t,e))return!0;return!1}Qs(t,e){let r=!1,s=[];for(let n=0;n<this.tn.length;n++){let i=this.tn[n],u=i.Qs(t,e);if(r|=u!==i,u===vt.NONE)return vt.NONE;null!==u&&s.push(u)}return r?(0===s.length||s.map(function(t){return t}),null):this}toString(){let t=this.tn.map(t=>t.toString());return(t.length>3?t.slice(3):t).join("||")}}function Tt(t){let e=[];return t.values().map(function(t){t instanceof vt.PrecedencePredicate&&e.push(t)}),e}function Et(t,e){if(null===t){let t={state:null,alt:null,context:null,nn:null};return e&&(t.un=0),t}{let r={};return r.state=t.state||null,r.alt=void 0===t.alt?null:t.alt,r.context=t.context||null,r.nn=t.nn||null,e&&(r.un=t.un||0,r.ln=t.ln||!1),r}}class St{constructor(t,e){this.hn(t,e),t=Et(t),e=Et(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.nn=null!==t.nn?t.nn:null!==e.nn?e.nn:vt.NONE,this.un=e.un,this.ln=e.ln}hn(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)}qs(){let t=new ft;return this.Hs(t),t.finish()}Hs(t){t.update(this.state.an,this.alt,this.context,this.nn)}equals(t){return this===t||t instanceof St&&this.state.an===t.state.an&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.nn.equals(t.nn)&&this.ln===t.ln}cn(){let t=new ft;return t.update(this.state.an,this.alt,this.nn),t.finish()}fn(t){return this===t||t instanceof St&&this.state.an===t.state.an&&this.alt===t.alt&&this.nn.equals(t.nn)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.nn!==vt.NONE?","+this.nn.toString():"")+(this.un>0?",up="+this.un:"")+")"}}class Mt{constructor(){this.dn=null,this.readOnly=!1}first(t){return null===this.dn||0===this.dn.length?j.qe:this.dn[0].start}wn(t){this.gn(new st(t,t+1))}addRange(t,e){this.gn(new st(t,e+1))}gn(t){if(null===this.dn)this.dn=[],this.dn.push(t.clone());else{for(let e=0;e<this.dn.length;e++){let r=this.dn[e];if(t.stop<r.start)return void this.dn.splice(e,0,t);if(t.stop===r.start)return void(this.dn[e]=new st(t.start,r.stop));if(t.start<=r.stop)return this.dn[e]=new st(Math.min(r.start,t.start),Math.max(r.stop,t.stop)),void this.reduce(e)}this.dn.push(t.clone())}}pn(t){return null!==t.dn&&t.dn.forEach(t=>this.gn(t),this),this}reduce(t){if(t<this.dn.length-1){let e=this.dn[t],r=this.dn[t+1];e.stop>=r.stop?(this.dn.splice(t+1,1),this.reduce(t)):e.stop>=r.start&&(this.dn[t]=new st(e.start,r.stop),this.dn.splice(t+1,1))}}mn(t,e){let r=new Mt;return r.gn(new st(t,e+1)),null!==this.dn&&this.dn.forEach(t=>r.removeRange(t)),r}contains(t){if(null===this.dn)return!1;for(let e=0;e<this.dn.length;e++)if(this.dn[e].contains(t))return!0;return!1}removeRange(t){if(t.start===t.stop-1)this.vn(t.start);else if(null!==this.dn){let e=0;for(let r=0;r<this.dn.length;r++){let r=this.dn[e];if(t.stop<=r.start)return;if(t.start>r.start&&t.stop<r.stop){this.dn[e]=new st(r.start,t.start);let s=new st(t.stop,r.stop);return void this.dn.splice(e,0,s)}t.start<=r.start&&t.stop>=r.stop?(this.dn.splice(e,1),e-=1):t.start<r.stop?this.dn[e]=new st(r.start,t.start):t.stop<r.stop&&(this.dn[e]=new st(t.stop,r.stop)),e+=1}}}vn(t){if(null!==this.dn)for(let e=0;e<this.dn.length;e++){let r=this.dn[e];if(t<r.start)return;if(t===r.start&&t===r.stop-1)return void this.dn.splice(e,1);if(t===r.start)return void(this.dn[e]=new st(r.start+1,r.stop));if(t===r.stop-1)return void(this.dn[e]=new st(r.start,r.stop-1));if(t<r.stop-1){let s=new st(r.start,t);return r.start=t+1,void this.dn.splice(e,0,s)}}}toString(t,e,r){return t=t||null,e=e||null,r=r||!1,null===this.dn?"{}":null!==t||null!==e?this.Nn(t,e):r?this.xn():this.Tn()}xn(){let t=[];for(let e=0;e<this.dn.length;e++){let r=this.dn[e];r.stop===r.start+1?r.start===j.EOF?t.push("<EOF>"):t.push("'"+String.fromCharCode(r.start)+"'"):t.push("'"+String.fromCharCode(r.start)+"'..'"+String.fromCharCode(r.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]}Tn(){let t=[];for(let e=0;e<this.dn.length;e++){let r=this.dn[e];r.stop===r.start+1?r.start===j.EOF?t.push("<EOF>"):t.push(r.start.toString()):t.push(r.start.toString()+".."+(r.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]}Nn(t,e){let r=[];for(let s=0;s<this.dn.length;s++){let n=this.dn[s];for(let s=n.start;s<n.stop;s++)r.push(this.En(t,e,s))}return r.length>1?"{"+r.join(", ")+"}":r[0]}En(t,e,r){return r===j.EOF?"<EOF>":r===j.EPSILON?"<EPSILON>":t[r]||e[r]}get length(){return this.dn.map(t=>t.length).reduce((t,e)=>t+e)}}class It{constructor(){this.Ar=null,this.an=It.Sn,this.Mn=null,this.In=0,this.An=!1,this.yn=[],this.Dn=null}toString(){return this.an}equals(t){return t instanceof It&&this.an===t.an}bn(){return!1}Cn(t,e){void 0===e&&(e=-1),0===this.yn.length?this.An=t.Rn:this.An!==t.Rn&&(this.An=!1),-1===e?this.yn.push(t):this.yn.splice(e,1,t)}}It.qe=0,It.BASIC=1,It.On=2,It.Fn=3,It.kn=4,It.Ln=5,It._n=6,It.Pn=7,It.Vn=8,It.Bn=9,It.Un=10,It.Hn=11,It.Gn=12,It.qn=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],It.Sn=-1;class At extends It{constructor(){return super(),this.Mn=It.Pn,this}}class yt{constructor(t){if(null==t)throw"target cannot be null.";this.target=t,this.Rn=!1,this.label=null}}yt.EPSILON=1,yt.RANGE=2,yt.RULE=3,yt.PREDICATE=4,yt.ATOM=5,yt.ACTION=6,yt.SET=7,yt.Jn=8,yt.WILDCARD=9,yt.PRECEDENCE=10,yt.qn=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],yt.Xn={EpsilonTransition:yt.EPSILON,RangeTransition:yt.RANGE,RuleTransition:yt.RULE,PredicateTransition:yt.PREDICATE,AtomTransition:yt.ATOM,ActionTransition:yt.ACTION,$n:yt.SET,NotSetTransition:yt.Jn,WildcardTransition:yt.WILDCARD,PrecedencePredicateTransition:yt.PRECEDENCE};class Dt extends yt{constructor(t,e,r,s){super(t),this.In=e,this.rn=r,this.Wn=s,this.jn=yt.RULE,this.Rn=!0}matches(t,e,r){return!1}}class bt extends yt{constructor(t,e){super(t),this.jn=yt.SET,null!=e?this.label=e:(this.label=new Mt,this.label.wn(j.qe))}matches(t,e,r){return this.label.contains(t)}toString(){return this.label.toString()}}class Ct extends bt{constructor(t,e){super(t,e),this.jn=yt.Jn}matches(t,e,r){return t>=e&&t<=r&&!super.matches(t,e,r)}toString(){return"~"+super.toString()}}class Rt extends yt{constructor(t){super(t),this.jn=yt.WILDCARD}matches(t,e,r){return t>=e&&t<=r}toString(){return"."}}class Ot extends yt{constructor(t){super(t)}}class Ft{}class kt extends Ft{}class Lt extends kt{}class _t extends Lt{get Kn(){throw new Error("missing interface implementation")}}class Pt extends Lt{}class Vt extends Pt{}let Bt={zn:function(t,e,r){e=e||null,null!==(r=r||null)&&(e=r.gr);let s=Bt.Yn(t,e);s=function(t){return t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(s);let n=t.Qn();if(0===n)return s;let i="("+s+" ";n>0&&(s=Bt.zn(t.Zn(0),e),i=i.concat(s));for(let r=1;r<n;r++)s=Bt.zn(t.Zn(r),e),i=i.concat(" "+s);return i=i.concat(")"),i},Yn:function(t,e,r){if(e=e||null,null!==(r=r||null)&&(e=r.gr),null!==e){if(t instanceof _t){let r=t.Kn.ti();return 0!=r?e[t.In]+":"+r:e[t.In]}if(t instanceof Vt)return t.toString();if(t instanceof Pt&&null!==t.ei)return t.ei.text}let s=t.ri();return s instanceof j?s.text:t.ri().toString()},si:function(t){let e=[];for(let r=0;r<t.Qn();r++)e.push(t.Zn(r));return e},ni:function(t){let e=[];for(t=t.getParent();null!==t;)e=[t].concat(e),t=t.getParent();return e},ii:function(t,e){return Bt.ui(t,e,!0)},li:function(t,e){return Bt.ui(t,e,!1)},ui:function(t,e,r){let s=[];return Bt.hi(t,e,r,s),s},hi:function(t,e,r,s){r&&t instanceof Pt?t.ei.type===e&&s.push(t):!r&&t instanceof _t&&t.In===e&&s.push(t);for(let n=0;n<t.Qn();n++)Bt.hi(t.Zn(n),e,r,s)},ai:function(t){let e=[t];for(let r=0;r<t.Qn();r++)e=e.concat(Bt.ai(t.Zn(r)));return e}};const Ut=Bt;class Ht extends _t{constructor(t,e){super(),this.oi=t||null,this.ci=e||-1}fi(){let t=0,e=this;for(;null!==e;)e=e.oi,t+=1;return t}di(){return-1===this.ci}wi(){return st.Vr}get Kn(){return this}ri(){return this}br(){return 0===this.Qn()?"":this.children.map(function(t){return t.br()}).join("")}ti(){return 0}gi(t){}Zn(t){return null}Qn(){return 0}accept(t){return t.pi(this)}zn(t,e){return Ut.zn(this,t,e)}toString(t,e){t=t||null,e=e||null;let r=this,s="[";for(;null!==r&&r!==e;){if(null===t)r.di()||(s+=r.ci);else{let e=r.In;s+=e>=0&&e<t.length?t[e]:""+e}null===r.oi||null===t&&r.oi.di()||(s+=" "),r=r.oi}return s+="]",s}}class Gt{constructor(t){this.mi=t}di(){return this===Gt.EMPTY}Ni(){return this.xi(this.length-1)===Gt.Ti}qs(){return this.mi}Hs(t){t.update(this.mi)}}Gt.EMPTY=null,Gt.Ti=2147483647,Gt.Ei=1,Gt.id=Gt.Ei,Gt.Si=!1;class qt extends Gt{constructor(t,e){let r=new ft;return r.update(t,e),super(r.finish()),this.Mi=t,this.Ii=e,this}di(){return this.Ii[0]===Gt.Ti}getParent(t){return this.Mi[t]}xi(t){return this.Ii[t]}equals(t){return this===t||t instanceof qt&&this.qs()===t.qs()&&at(this.Ii,t.Ii)&&at(this.Mi,t.Mi)}toString(){if(this.di())return"[]";{let t="[";for(let e=0;e<this.Ii.length;e++)e>0&&(t+=", "),this.Ii[e]!==Gt.Ti?(t+=this.Ii[e],null!==this.Mi[e]?t=t+" "+this.Mi[e]:t+="null"):t+="$";return t+"]"}}get length(){return this.Ii.length}}class Jt extends Gt{constructor(t,e){let r=0,s=new ft;null!==t?s.update(t,e):s.update(1),r=s.finish(),super(r),this.oi=t,this.Ai=e}getParent(t){return this.oi}xi(t){return this.Ai}equals(t){return this===t||t instanceof Jt&&this.qs()===t.qs()&&this.Ai===t.Ai&&(null==this.oi?null==t.oi:this.oi.equals(t.oi))}toString(){let t=null===this.oi?"":this.oi.toString();return 0===t.length?this.Ai===Gt.Ti?"$":""+this.Ai:this.Ai+" "+t}get length(){return 1}static create(t,e){return e===Gt.Ti&&null===t?Gt.EMPTY:new Jt(t,e)}}class Xt extends Jt{constructor(){super(null,Gt.Ti)}di(){return!0}getParent(t){return null}xi(t){return this.Ai}equals(t){return this===t}toString(){return"$"}}Gt.EMPTY=new Xt;class $t{constructor(t,e){this.Js=new Array(16),this.threshold=Math.floor(12),this.Xs=0,this.$s=t||dt,this.Ws=e||wt}set(t,e){this.zs();let r=this.Ys(t),s=this.Js[r];if(!s)return s=[[t,e]],this.Js[r]=s,this.Xs++,e;let n=s.find(e=>this.Ws(e[0],t),this);if(n){let t=n[1];return n[1]=e,t}return s.push([t,e]),this.Xs++,e}yi(t){let e=this.js(t);return!!e&&!!e.find(e=>this.Ws(e[0],t),this)}get(t){let e=this.js(t);if(!e)return null;let r=e.find(e=>this.Ws(e[0],t),this);return r?r[1]:null}entries(){return this.Js.filter(t=>null!=t).flat(1)}Di(){return this.entries().map(t=>t[0])}getValues(){return this.entries().map(t=>t[1])}toString(){return"["+this.entries().map(t=>"{"+t[0]+":"+t[1]+"}").join(", ")+"]"}get length(){return this.Xs}Ys(t){return this.$s(t)&this.Js.length-1}js(t){return this.Js[this.Ys(t)]}zs(){if(this.Xs<=this.threshold)return;let t=this.Js,e=2*this.Js.length;this.Js=new Array(e),this.threshold=Math.floor(.75*e);for(let e of t)if(e)for(let t of e){let e=this.Ys(t[0]),r=this.Js[e];r||(r=[],this.Js[e]=r),r.push(t)}}}function Wt(t,e){if(null==e&&(e=Ht.EMPTY),null===e.oi||e===Ht.EMPTY)return Gt.EMPTY;let r=Wt(t,e.oi),s=t.states[e.ci].yn[0];return Jt.create(r,s.Wn.an)}function jt(t,e,r){if(t.di())return t;let s=r.get(t)||null;if(null!==s)return s;if(s=e.get(t),null!==s)return r.set(t,s),s;let n=!1,i=[];for(let s=0;s<i.length;s++){let u=jt(t.getParent(s),e,r);if(n||u!==t.getParent(s)){if(!n){i=[];for(let e=0;e<t.length;e++)i[e]=t.getParent(e);n=!0}i[s]=u}}if(!n)return e.add(t),r.set(t,t),t;let u=null;return u=0===i.length?Gt.EMPTY:1===i.length?Jt.create(i[0],t.xi(0)):new qt(i,t.Ii),e.add(u),r.set(u,u),r.set(t,u),u}function Kt(t,e,r,s){if(t===e)return t;if(t instanceof Jt&&e instanceof Jt)return function(t,e,r,s){if(null!==s){let r=s.get(t,e);if(null!==r)return r;if(r=s.get(e,t),null!==r)return r}let n=function(t,e,r){if(r){if(t===Gt.EMPTY)return Gt.EMPTY;if(e===Gt.EMPTY)return Gt.EMPTY}else{if(t===Gt.EMPTY&&e===Gt.EMPTY)return Gt.EMPTY;if(t===Gt.EMPTY){let t=[e.Ai,Gt.Ti],r=[e.oi,null];return new qt(r,t)}if(e===Gt.EMPTY){let e=[t.Ai,Gt.Ti],r=[t.oi,null];return new qt(r,e)}}return null}(t,e,r);if(null!==n)return null!==s&&s.set(t,e,n),n;if(t.Ai===e.Ai){let n=Kt(t.oi,e.oi,r,s);if(n===t.oi)return t;if(n===e.oi)return e;let i=Jt.create(n,t.Ai);return null!==s&&s.set(t,e,i),i}{let r=null;if((t===e||null!==t.oi&&t.oi===e.oi)&&(r=t.oi),null!==r){let n=[t.Ai,e.Ai];t.Ai>e.Ai&&(n[0]=e.Ai,n[1]=t.Ai);let i=new qt([r,r],n);return null!==s&&s.set(t,e,i),i}let n=[t.Ai,e.Ai],i=[t.oi,e.oi];t.Ai>e.Ai&&(n[0]=e.Ai,n[1]=t.Ai,i=[e.oi,t.oi]);let u=new qt(i,n);return null!==s&&s.set(t,e,u),u}}(t,e,r,s);if(r){if(t instanceof Xt)return t;if(e instanceof Xt)return e}return t instanceof Jt&&(t=new qt([t.getParent()],[t.Ai])),e instanceof Jt&&(e=new qt([e.getParent()],[e.Ai])),function(t,e,r,s){if(null!==s){let r=s.get(t,e);if(null!==r)return Gt.Si,r;if(r=s.get(e,t),null!==r)return Gt.Si,r}let n=0,i=0,u=0,l=new Array(t.Ii.length+e.Ii.length).fill(0),h=new Array(t.Ii.length+e.Ii.length).fill(null);for(;n<t.Ii.length&&i<e.Ii.length;){let a=t.Mi[n],o=e.Mi[i];if(t.Ii[n]===e.Ii[i]){let e=t.Ii[n];e===Gt.Ti&&null===a&&null===o||null!==a&&null!==o&&a===o?(h[u]=a,l[u]=e):(h[u]=Kt(a,o,r,s),l[u]=e),n+=1,i+=1}else t.Ii[n]<e.Ii[i]?(h[u]=a,l[u]=t.Ii[n],n+=1):(h[u]=o,l[u]=e.Ii[i],i+=1);u+=1}if(n<t.Ii.length)for(let e=n;e<t.Ii.length;e++)h[u]=t.Mi[e],l[u]=t.Ii[e],u+=1;else for(let t=i;t<e.Ii.length;t++)h[u]=e.Mi[t],l[u]=e.Ii[t],u+=1;if(u<h.length){if(1===u){let r=Jt.create(h[0],l[0]);return null!==s&&s.set(t,e,r),r}h=h.slice(0,u),l=l.slice(0,u)}let a=new qt(h,l);return a.equals(t)?(null!==s&&s.set(t,e,t),Gt.Si,t):a.equals(e)?(null!==s&&s.set(t,e,e),Gt.Si,e):(function(t){let e=new $t;for(let r=0;r<t.length;r++){let s=t[r];e.yi(s)||e.set(s,s)}for(let r=0;r<t.length;r++)t[r]=e.get(t[r])}(h),null!==s&&s.set(t,e,a),Gt.Si,a)}(t,e,r,s)}class zt{constructor(){this.data=new Uint32Array(1)}set(t){zt.bi(t),this.Ci(t),this.data[t>>>5]|=1<<t%32}get(t){zt.bi(t);let e=t>>>5;return!(e>=this.data.length||!(this.data[e]&1<<t%32))}clear(t){zt.bi(t);let e=t>>>5;e<this.data.length&&(this.data[e]&=~(1<<t))}or(t){let e=Math.min(this.data.length,t.data.length);for(let r=0;r<e;++r)this.data[r]|=t.data[r];if(this.data.length<t.data.length){this.Ci((t.data.length<<5)-1);let r=t.data.length;for(let s=e;s<r;++s)this.data[s]=t.data[s]}}values(){let t=new Array(this.length),e=0,r=this.data.length;for(let s=0;s<r;++s){let r=this.data[s];for(;0!==r;){let n=r&-r;t[e++]=(s<<5)+zt.Ri(n-1),r^=n}}return t}minValue(){for(let t=0;t<this.data.length;++t){let e=this.data[t];if(0!==e){let r=0;for(;!(1&e);)r++,e>>=1;return r+32*t}}return 0}qs(){return ft.Gs(this.values())}equals(t){return t instanceof zt&&at(this.data,t.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.data.map(t=>zt.Ri(t)).reduce((t,e)=>t+e,0)}Ci(t){let e=t+32>>>5;if(e<=this.data.length)return;let r=new Uint32Array(e);r.set(this.data),r.fill(0,this.data.length),this.data=r}static bi(t){if(t<0)throw new RangeError("index cannot be negative")}static Ri(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,0+(t+=t>>16)&63}}class Yt{constructor(t){this.Ar=t}Oi(t){if(null===t)return null;let e=t.yn.length,r=[];for(let s=0;s<e;s++){r[s]=new Mt;let e=new mt,n=!1;this.Fi(t.transition(s).target,null,Gt.EMPTY,r[s],e,new zt,n,!1),(0===r[s].length||r[s].contains(Yt.ki))&&(r[s]=null)}return r}LOOK(t,e,r){let s=new Mt,n=null!==(r=r||null)?Wt(t.Ar,r):null;return this.Fi(t,e,n,s,new mt,new zt,!0,!0),s}Fi(t,e,r,s,n,i,u,l){let h=new St({state:t,alt:0,context:r},null);if(!n.has(h)){if(n.add(h),t===e){if(null===r)return void s.wn(j.EPSILON);if(r.di()&&l)return void s.wn(j.EOF)}if(t instanceof At){if(null===r)return void s.wn(j.EPSILON);if(r.di()&&l)return void s.wn(j.EOF);if(r!==Gt.EMPTY){let h=i.get(t.In);try{i.clear(t.In);for(let t=0;t<r.length;t++){let h=this.Ar.states[r.xi(t)];this.Fi(h,e,r.getParent(t),s,n,i,u,l)}}finally{h&&i.set(t.In)}return}}for(let h=0;h<t.yn.length;h++){let a=t.yn[h];if(a.constructor===Dt){if(i.get(a.target.In))continue;let t=Jt.create(r,a.Wn.an);try{i.set(a.target.In),this.Fi(a.target,e,t,s,n,i,u,l)}finally{i.clear(a.target.In)}}else if(a instanceof Ot)u?this.Fi(a.target,e,r,s,n,i,u,l):s.wn(Yt.ki);else if(a.Rn)this.Fi(a.target,e,r,s,n,i,u,l);else if(a.constructor===Rt)s.addRange(j.Je,this.Ar.Li);else{let t=a.label;null!==t&&(a instanceof Ct&&(t=t.mn(j.Je,this.Ar.Li)),s.pn(t))}}}}}Yt.ki=j.qe;class Qt{constructor(t,e){this._i=t,this.Li=e,this.states=[],this.Pi=[],this.Vi=[],this.Bi=null,this.Ui={},this.Hi=null,this.Gi=null,this.qi=[]}Ji(t,e){return new Yt(this).LOOK(t,null,e)}Xi(t){return null!==t.Dn||(t.Dn=this.Ji(t,null),t.Dn.readOnly=!0),t.Dn}$i(t,e){return void 0===e?this.Xi(t):this.Ji(t,e)}Wi(t){null!==t&&(t.Ar=this,t.an=this.states.length),this.states.push(t)}ji(t){this.states[t.an]=null}Ki(t){return this.Pi.push(t),t.zi=this.Pi.length-1,t.zi}Yi(t){return 0===this.Pi.length?null:this.Pi[t]}Pr(t,e){if(t<0||t>=this.states.length)throw"Invalid state number.";let r=this.states[t],s=this.$i(r);if(!s.contains(j.EPSILON))return s;let n=new Mt;for(n.pn(s),n.vn(j.EPSILON);null!==e&&e.ci>=0&&s.contains(j.EPSILON);){let t=this.states[e.ci].yn[0];s=this.$i(t.Wn),n.pn(s),n.vn(j.EPSILON),e=e.oi}return s.contains(j.EPSILON)&&n.wn(j.EOF),n}}Qt.Qi=0;class Zt extends It{constructor(){super(),this.Mn=It.BASIC}}class te extends It{constructor(){return super(),this.zi=-1,this.Zi=!1,this}}class ee extends te{constructor(){return super(),this.tu=null,this}}class re extends It{constructor(){return super(),this.Mn=It.Vn,this.eu=null,this}}class se extends It{constructor(){return super(),this.Mn=It.Gn,this.ru=null,this}}class ne extends It{constructor(){return super(),this.Mn=It.On,this.su=null,this.nu=!1,this}}class ie extends te{constructor(){return super(),this.Mn=It._n,this}}class ue extends te{constructor(){return super(),this.Mn=It.Hn,this}}class le extends It{constructor(){return super(),this.Mn=It.Bn,this}}class he extends te{constructor(){return super(),this.Mn=It.Un,this.ru=null,this.iu=null,this}}class ae extends ee{constructor(){return super(),this.Mn=It.kn,this.ru=null,this}}class oe extends ee{constructor(){return super(),this.Mn=It.Ln,this}}class ce extends ee{constructor(){return super(),this.Mn=It.Fn,this}}class fe extends yt{constructor(t,e){super(t),this.uu=e,this.label=this.lu(),this.jn=yt.ATOM}lu(){let t=new Mt;return t.wn(this.uu),t}matches(t,e,r){return this.uu===t}toString(){return this.uu}}class de extends yt{constructor(t,e,r){super(t),this.jn=yt.RANGE,this.start=e,this.stop=r,this.label=this.lu()}lu(){let t=new Mt;return t.addRange(this.start,this.stop),t}matches(t,e,r){return t>=this.start&&t<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class we extends yt{constructor(t,e,r,s){super(t),this.jn=yt.ACTION,this.In=e,this.hu=void 0===r?-1:r,this.au=void 0!==s&&s,this.Rn=!0}matches(t,e,r){return!1}toString(){return"action_"+this.In+":"+this.hu}}class ge extends yt{constructor(t,e){super(t),this.jn=yt.EPSILON,this.Rn=!0,this.ou=e}matches(t,e,r){return!1}toString(){return"epsilon"}}class pe extends vt{constructor(t,e,r){super(),this.In=void 0===t?-1:t,this.cu=void 0===e?-1:e,this.au=void 0!==r&&r}evaluate(t,e){let r=this.au?e:null;return t.Mr(r,this.In,this.cu)}Hs(t){t.update(this.In,this.cu,this.au)}equals(t){return this===t||t instanceof pe&&this.In===t.In&&this.cu===t.cu&&this.au===t.au}toString(){return"{"+this.In+":"+this.cu+"}?"}}vt.NONE=new pe;class me extends Ot{constructor(t,e,r,s){super(t),this.jn=yt.PREDICATE,this.In=e,this.cu=r,this.au=s,this.Rn=!0}matches(t,e,r){return!1}fu(){return new pe(this.In,this.cu,this.au)}toString(){return"pred_"+this.In+":"+this.cu}}class ve extends vt{constructor(t){super(),this.rn=void 0===t?0:t}evaluate(t,e){return t.Ir(e,this.rn)}Qs(t,e){return t.Ir(e,this.rn)?vt.NONE:null}sn(t){return this.rn-t.rn}Hs(t){t.update(this.rn)}equals(t){return this===t||t instanceof ve&&this.rn===t.rn}toString(){return"{"+this.rn+">=prec}?"}}vt.PrecedencePredicate=ve;class Ne extends Ot{constructor(t,e){super(t),this.jn=yt.PRECEDENCE,this.rn=e,this.Rn=!0}matches(t,e,r){return!1}fu(){return new ve(this.rn)}toString(){return this.rn+" >= _p"}}class xe{constructor(t){void 0===t&&(t=null),this.readOnly=!1,this.du=null===t||t.du,this.wu=null!==t&&t.wu}}xe.gu=new xe,xe.gu.readOnly=!0;class Te{constructor(t){this.pu=t,this.mu=!1}qs(){let t=new ft;return this.Hs(t),t.finish()}Hs(t){t.update(this.pu)}equals(t){return this===t}}class Ee extends Te{constructor(){super(6)}vu(t){t.ss()}toString(){return"skip"}}Ee.INSTANCE=new Ee;class Se extends Te{constructor(t){super(0),this.channel=t}vu(t){t.Kr=this.channel}Hs(t){t.update(this.pu,this.channel)}equals(t){return this===t||t instanceof Se&&this.channel===t.channel}toString(){return"channel("+this.channel+")"}}class Me extends Te{constructor(t,e){super(1),this.In=t,this.hu=e,this.mu=!0}vu(t){t.action(null,this.In,this.hu)}Hs(t){t.update(this.pu,this.In,this.hu)}equals(t){return this===t||t instanceof Me&&this.In===t.In&&this.hu===t.hu}}class Ie extends Te{constructor(){super(3)}vu(t){t.ns()}toString(){return"more"}}Ie.INSTANCE=new Ie;class Ae extends Te{constructor(t){super(7),this.type=t}vu(t){t.type=this.type}Hs(t){t.update(this.pu,this.type)}equals(t){return this===t||t instanceof Ae&&this.type===t.type}toString(){return"type("+this.type+")"}}class ye extends Te{constructor(t){super(5),this.mode=t}vu(t){t.cs(this.mode)}Hs(t){t.update(this.pu,this.mode)}equals(t){return this===t||t instanceof ye&&this.mode===t.mode}toString(){return"pushMode("+this.mode+")"}}class De extends Te{constructor(){super(4)}vu(t){t.fs()}toString(){return"popMode"}}De.INSTANCE=new De;class be extends Te{constructor(t){super(2),this.mode=t}vu(t){t.us(this.mode)}Hs(t){t.update(this.pu,this.mode)}equals(t){return this===t||t instanceof be&&this.mode===t.mode}toString(){return"mode("+this.mode+")"}}function Ce(t,e){let r=[];return r[t-1]=e,r.map(function(t){return e})}class Re{constructor(t){null==t&&(t=xe.gu),this.Nu=t,this.xu=null,this.Tu=null}Eu(t){let e=this.reset(t);this.er(e),e&&this.Su();let r=this.Mu();this.Iu(r,e),this.Au(r,e),this.yu(r);let s=[];return this.Du(r,s,this.bu.bind(this)),e&&this.Du(r,s,this.Cu.bind(this)),this.Ru(r,s),this.Ou(r),this.Fu(r,e),this.ku(r),this.du(r),this.Nu.wu&&1===r._i&&(this.wu(r),this.du(r)),r}reset(t){if(3===(t.charCodeAt?t.charCodeAt(0):t[0])){let e=function(t){let e=t.charCodeAt(0);return e>1?e-2:e+65534},r=t.split("").map(e);return r[0]=t.charCodeAt(0),this.data=r,this.Lu=0,!0}return this.data=t,this.Lu=0,!1}Su(){let t=0;for(;t++<8;)this.bu()}er(t){let e=this.bu();if(!t&&4!==e)throw"Could not deserialize ATN with version "+e+" (expected 4)."}Mu(){let t=this.bu(),e=this.bu();return new Qt(t,e)}Iu(t,e){let r,s,n,i=[],u=[],l=this.bu();for(let r=0;r<l;r++){let r=this.bu();if(r===It.qe){t.Wi(null);continue}let s=this.bu();e&&65535===s&&(s=-1);let n=this._u(r,s);if(r===It.Gn){let t=this.bu();i.push([n,t])}else if(n instanceof ee){let t=this.bu();u.push([n,t])}t.Wi(n)}for(r=0;r<i.length;r++)s=i[r],s[0].ru=t.states[s[1]];for(r=0;r<u.length;r++)s=u[r],s[0].tu=t.states[s[1]];let h=this.bu();for(r=0;r<h;r++)n=this.bu(),t.states[n].Zi=!0;let a=this.bu();for(r=0;r<a;r++)n=this.bu(),t.states[n].nu=!0}Au(t,e){let r,s=this.bu();for(0===t._i&&(t.Hi=Ce(s,0)),t.Vi=Ce(s,0),r=0;r<s;r++){let s=this.bu();if(t.Vi[r]=t.states[s],0===t._i){let s=this.bu();e&&65535===s&&(s=j.EOF),t.Hi[r]=s}}for(t.Bi=Ce(s,0),r=0;r<t.states.length;r++){let e=t.states[r];e instanceof At&&(t.Bi[e.In]=e,t.Vi[e.In].su=e)}}yu(t){let e=this.bu();for(let r=0;r<e;r++){let e=this.bu();t.qi.push(t.states[e])}}Du(t,e,r){let s=this.bu();for(let t=0;t<s;t++){let t=new Mt;e.push(t);let s=this.bu();0!==this.bu()&&t.wn(-1);for(let e=0;e<s;e++){let e=r(),s=r();t.addRange(e,s)}}}Ru(t,e){let r,s,n,i,u,l=this.bu();for(r=0;r<l;r++){let r=this.bu(),s=this.bu(),n=this.bu(),u=this.bu(),l=this.bu(),h=this.bu();i=this.Pu(t,n,r,s,u,l,h,e),t.states[r].Cn(i)}for(r=0;r<t.states.length;r++)for(n=t.states[r],s=0;s<n.yn.length;s++){let e=n.yn[s];if(!(e instanceof Dt))continue;let r=-1;t.Vi[e.target.In].nu&&0===e.rn&&(r=e.target.In),i=new ge(e.Wn,r),t.Bi[e.target.In].Cn(i)}for(r=0;r<t.states.length;r++){if(n=t.states[r],n instanceof ee){if(null===n.tu)throw"IllegalState";if(null!==n.tu.eu)throw"IllegalState";n.tu.eu=n}if(n instanceof ue)for(s=0;s<n.yn.length;s++)u=n.yn[s].target,u instanceof ae&&(u.ru=n);else if(n instanceof le)for(s=0;s<n.yn.length;s++)u=n.yn[s].target,u instanceof he&&(u.ru=n)}}Ou(t){let e=this.bu();for(let r=0;r<e;r++){let e=this.bu(),s=t.states[e];t.Pi.push(s),s.zi=r}}Fu(t,e){if(0===t._i){let r=this.bu();t.Gi=Ce(r,null);for(let s=0;s<r;s++){let r=this.bu(),n=this.bu();e&&65535===n&&(n=-1);let i=this.bu();e&&65535===i&&(i=-1),t.Gi[s]=this.Vu(r,n,i)}}}wu(t){let e,r=t.Vi.length;for(e=0;e<r;e++)t.Hi[e]=t.Li+e+1;for(e=0;e<r;e++)this.Bu(t,e)}Bu(t,e){let r,s,n=new ce;n.In=e,t.Wi(n);let i=new re;i.In=e,t.Wi(i),n.tu=i,t.Ki(n),i.eu=n;let u=null,l=null;if(t.Vi[e].nu){for(l=null,r=0;r<t.states.length;r++)if(s=t.states[r],this.Uu(s,e)){l=s,u=s.ru.yn[0];break}if(null===u)throw"Couldn't identify final state of the precedence rule prefix section."}else l=t.Bi[e];for(r=0;r<t.states.length;r++){s=t.states[r];for(let t=0;t<s.yn.length;t++){let e=s.yn[t];e!==u&&e.target===l&&(e.target=i)}}let h=t.Vi[e],a=h.yn.length;for(;a>0;)n.Cn(h.yn[a-1]),h.yn=h.yn.slice(-1);t.Vi[e].Cn(new ge(n)),i.Cn(new ge(l));let o=new Zt;t.Wi(o),o.Cn(new fe(i,t.Hi[e])),n.Cn(new ge(o))}Uu(t,e){if(t.In!==e)return null;if(!(t instanceof he))return null;let r=t.yn[t.yn.length-1].target;return r instanceof se&&r.An&&r.yn[0].target instanceof At?t:null}ku(t){for(let e=0;e<t.states.length;e++){let r=t.states[e];if(r instanceof he&&t.Vi[r.In].nu){let t=r.yn[r.yn.length-1].target;t instanceof se&&t.An&&t.yn[0].target instanceof At&&(r.iu=!0)}}}du(t){if(this.Nu.du)for(let e=0;e<t.states.length;e++){let r=t.states[e];if(null!==r)if(this.Hu(r.An||r.yn.length<=1),r instanceof ae)this.Hu(null!==r.ru);else if(r instanceof he)if(this.Hu(null!==r.ru),this.Hu(2===r.yn.length),r.yn[0].target instanceof oe)this.Hu(r.yn[1].target instanceof se),this.Hu(!r.Zi);else{if(!(r.yn[0].target instanceof se))throw"IllegalState";this.Hu(r.yn[1].target instanceof oe),this.Hu(r.Zi)}else r instanceof le?(this.Hu(1===r.yn.length),this.Hu(r.yn[0].target instanceof he)):r instanceof se?this.Hu(null!==r.ru):r instanceof ne?this.Hu(null!==r.su):r instanceof ee?this.Hu(null!==r.tu):r instanceof re?this.Hu(null!==r.eu):r instanceof te?this.Hu(r.yn.length<=1||r.zi>=0):this.Hu(r.yn.length<=1||r instanceof At)}}Hu(t,e){if(!t)throw null==e&&(e="IllegalState"),e}bu(){return this.data[this.Lu++]}Cu(){return this.bu()|this.bu()<<16}Pu(t,e,r,s,n,i,u,l){let h=t.states[s];switch(e){case yt.EPSILON:return new ge(h);case yt.RANGE:return new de(h,0!==u?j.EOF:n,i);case yt.RULE:return new Dt(t.states[n],i,u,h);case yt.PREDICATE:return new me(h,n,i,0!==u);case yt.PRECEDENCE:return new Ne(h,n);case yt.ATOM:return new fe(h,0!==u?j.EOF:n);case yt.ACTION:return new we(h,n,i,0!==u);case yt.SET:return new bt(h,l[n]);case yt.Jn:return new Ct(h,l[n]);case yt.WILDCARD:return new Rt(h);default:throw"The specified transition type: "+e+" is not valid."}}_u(t,e){if(null===this.xu){let t=[];t[It.qe]=null,t[It.BASIC]=()=>new Zt,t[It.On]=()=>new ne,t[It.Fn]=()=>new ce,t[It.kn]=()=>new ae,t[It.Ln]=()=>new oe,t[It._n]=()=>new ie,t[It.Pn]=()=>new At,t[It.Vn]=()=>new re,t[It.Bn]=()=>new le,t[It.Un]=()=>new he,t[It.Hn]=()=>new ue,t[It.Gn]=()=>new se,this.xu=t}if(t>this.xu.length||null===this.xu[t])throw"The specified state type "+t+" is not valid.";{let r=this.xu[t]();if(null!==r)return r.In=e,r}}Vu(t,e,r){if(null===this.Tu){let t=[];t[0]=(t,e)=>new Se(t),t[1]=(t,e)=>new Me(t,e),t[2]=(t,e)=>new be(t),t[3]=(t,e)=>Ie.INSTANCE,t[4]=(t,e)=>De.INSTANCE,t[5]=(t,e)=>new ye(t),t[6]=(t,e)=>Ee.INSTANCE,t[7]=(t,e)=>new Ae(t),this.Tu=t}if(t>this.Tu.length||null===this.Tu[t])throw"The specified lexer action type "+t+" is not valid.";return this.Tu[t](e,r)}}function Oe(t){return t.cn()}function Fe(t,e){return t===e||null!==t&&null!==e&&t.fn(e)}class ke{constructor(t){this.Gu=new mt(Oe,Fe),this.qu=void 0===t||t,this.readOnly=!1,this.Ju=[],this.Xu=0,this.$u=null,this.Wu=!1,this.ju=!1,this.mi=-1}add(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.nn!==vt.NONE&&(this.Wu=!0),t.un>0&&(this.ju=!0);let r=this.Gu.Ks(t);if(r===t)return this.mi=-1,this.Ju.push(t),!0;let s=!this.qu,n=Kt(r.context,t.context,s,e);return r.un=Math.max(r.un,t.un),t.ln&&(r.ln=!0),r.context=n,!0}Ku(){let t=new mt;for(let e=0;e<this.Ju.length;e++)t.add(this.Ju[e].state);return t}zu(){let t=[];for(let e=0;e<this.Ju.length;e++){let r=this.Ju[e].nn;r!==vt.NONE&&t.push(r.nn)}return t}Yu(t){if(this.readOnly)throw"This set is readonly";if(0!==this.Gu.length)for(let e=0;e<this.Ju.length;e++){let r=this.Ju[e];r.context=t.Qu(r.context)}}addAll(t){for(let e=0;e<t.length;e++)this.add(t[e]);return!1}equals(t){return this===t||t instanceof ke&&at(this.Ju,t.Ju)&&this.qu===t.qu&&this.Xu===t.Xu&&this.$u===t.$u&&this.Wu===t.Wu&&this.ju===t.ju}qs(){let t=new ft;return t.update(this.Ju),t.finish()}Hs(t){this.readOnly?(-1===this.mi&&(this.mi=this.qs()),t.update(this.mi)):t.update(this.qs())}di(){return 0===this.Ju.length}contains(t){if(null===this.Gu)throw"This method is not implemented for readonly sets.";return this.Gu.contains(t)}Zu(t){if(null===this.Gu)throw"This method is not implemented for readonly sets.";return this.Gu.Zu(t)}clear(){if(this.readOnly)throw"This set is readonly";this.Ju=[],this.mi=-1,this.Gu=new mt}tl(t){this.readOnly=t,t&&(this.Gu=null)}toString(){return pt(this.Ju)+(this.Wu?",hasSemanticContext="+this.Wu:"")+(this.Xu!==Qt.Qi?",uniqueAlt="+this.Xu:"")+(null!==this.$u?",conflictingAlts="+this.$u:"")+(this.ju?",dipsIntoOuterContext":"")}get items(){return this.Ju}get length(){return this.Ju.length}}class Le{constructor(t,e){return null===t&&(t=-1),null===e&&(e=new ke),this.an=t,this.Ju=e,this.el=null,this.rl=!1,this.sl=0,this.nl=null,this.il=!1,this.ul=null,this}ll(){let t=new mt;if(null!==this.Ju)for(let e=0;e<this.Ju.length;e++){let r=this.Ju[e];t.add(r.alt)}return 0===t.length?null:t}equals(t){return this===t||t instanceof Le&&this.Ju.equals(t.Ju)}toString(){let t=this.an+":"+this.Ju;return this.rl&&(t+="=>",null!==this.ul?t+=this.ul:t+=this.sl),t}qs(){let t=new ft;return t.update(this.Ju),t.finish()}}class _e{constructor(t,e){return this.Ar=t,this.hl=e,this}Qu(t){if(null===this.hl)return t;let e=new $t;return jt(t,this.hl,e)}}_e.ERROR=new Le(2147483647,new ke);class Pe extends ke{constructor(){super(),this.Gu=new mt}}class Ve extends St{constructor(t,e){super(t,e);let r=t.nl||null;return this.nl=r||(null!==e?e.nl:null),this.al=null!==e&&this.ol(e,this.state),this}Hs(t){t.update(this.state.an,this.alt,this.context,this.nn,this.al,this.nl)}equals(t){return this===t||t instanceof Ve&&this.al===t.al&&(this.nl?this.nl.equals(t.nl):!t.nl)&&super.equals(t)}ol(t,e){return t.al||e instanceof te&&e.Zi}}class Be extends Te{constructor(t,e){super(e.pu),this.offset=t,this.action=e,this.mu=!0}vu(t){this.action.vu(t)}Hs(t){t.update(this.pu,this.offset,this.action)}equals(t){return this===t||t instanceof Be&&this.offset===t.offset&&this.action===t.action}}class Ue{constructor(t){return this.Gi=null===t?[]:t,this.mi=ft.Gs(t),this}cl(t){let e=null;for(let r=0;r<this.Gi.length;r++)!this.Gi[r].mu||this.Gi[r]instanceof Be||(null===e&&(e=this.Gi.concat([])),e[r]=new Be(t,this.Gi[r]));return null===e?this:new Ue(e)}vu(t,e,r){let s=!1,n=e.index;try{for(let i=0;i<this.Gi.length;i++){let u=this.Gi[i];if(u instanceof Be){let t=u.offset;e.seek(r+t),u=u.action,s=r+t!==n}else u.mu&&(e.seek(n),s=!1);u.vu(t)}}finally{s&&e.seek(n)}}qs(){return this.mi}Hs(t){t.update(this.mi)}equals(t){if(this===t)return!0;if(t instanceof Ue){if(this.mi!=t.mi)return!1;if(this.Gi.length!=t.Gi.length)return!1;{let e=this.Gi.length;for(let r=0;r<e;++r)if(!this.Gi[r].equals(t.Gi[r]))return!1;return!0}}return!1}static append(t,e){if(null===t)return new Ue([e]);let r=t.Gi.concat([e]);return new Ue(r)}}function He(t){t.index=-1,t.line=0,t.Be=-1,t.fl=null}class Ge{constructor(){He(this)}reset(){He(this)}}class qe extends _e{constructor(t,e,r,s){super(e,s),this.dl=r,this.wl=t,this.Br=-1,this.line=1,this.Be=0,this.mode=it.Zr,this.gl=new Ge}pl(t){this.Be=t.Be,this.line=t.line,this.mode=t.mode,this.Br=t.Br}match(t,e){this.mode=e;let r=t.mark();try{this.Br=t.index,this.gl.reset();let r=this.dl[e];return null===r.ml?this.vl(t):this.Nl(t,r.ml)}finally{t.release(r)}}reset(){this.gl.reset(),this.Br=-1,this.line=1,this.Be=0,this.mode=it.Zr}vl(t){let e=this.Ar.qi[this.mode];qe.debug,this.mode;let r=this.xl(t,e),s=r.Wu;r.Wu=!1;let n=this.Tl(r);s||(this.dl[this.mode].ml=n);let i=this.Nl(t,n);return qe.debug,i}Nl(t,e){qe.debug,e.rl&&this.El(this.gl,t,e);let r=t.LA(1),s=e;for(;;){qe.debug;let e=this.Sl(s,r);if(null===e&&(e=this.Ml(t,s,r)),e===_e.ERROR)break;if(r!==j.EOF&&this.xs(t),e.rl&&(this.El(this.gl,t,e),r===j.EOF))break;r=t.LA(1),s=e}return this.Il(this.gl,t,s.Ju,r)}Sl(t,e){if(null===t.el||e<qe.Al||e>qe.yl)return null;let r=t.el[e-qe.Al];return void 0===r&&(r=null),qe.debug,r}Ml(t,e,r){let s=new Pe;return this.Dl(t,e.Ju,s,r),0===s.items.length?(s.Wu||this.bl(e,r,_e.ERROR),_e.ERROR):this.bl(e,r,null,s)}Il(t,e,r,s){if(null!==this.gl.fl){let r=t.fl.nl;return this.accept(e,r,this.Br,t.index,t.line,t.Be),t.fl.sl}if(s===j.EOF&&e.index===this.Br)return j.EOF;throw new nt(this.wl,e,this.Br,r)}Dl(t,e,r,s){let n=Qt.Qi;for(let i=0;i<e.items.length;i++){let u=e.items[i],l=u.alt===n;if(!l||!u.al){qe.debug;for(let e=0;e<u.state.yn.length;e++){let i=u.state.yn[e],h=this.Cl(i,s);if(null!==h){let e=u.nl;null!==e&&(e=e.cl(t.index-this.Br));let i=s===j.EOF,a=new Ve({state:h,nl:e},u);this.Rl(t,a,r,l,!0,i)&&(n=u.alt)}}}}}accept(t,e,r,s,n,i){qe.debug,t.seek(s),this.line=n,this.Be=i,null!==e&&null!==this.wl&&e.vu(this.wl,t,r)}Cl(t,e){return t.matches(e,0,it.Is)?t.target:null}xl(t,e){let r=Gt.EMPTY,s=new Pe;for(let n=0;n<e.yn.length;n++){let i=e.yn[n].target,u=new Ve({state:i,alt:n+1,context:r},null);this.Rl(t,u,s,!1,!1,!1)}return s}Rl(t,e,r,s,n,i){let u=null;if(qe.debug,e.state instanceof At){if(qe.debug&&this.wl,null===e.context||e.context.Ni()){if(null===e.context||e.context.di())return r.add(e),!0;r.add(new Ve({state:e.state,context:Gt.EMPTY},e)),s=!0}if(null!==e.context&&!e.context.di())for(let l=0;l<e.context.length;l++)if(e.context.xi(l)!==Gt.Ti){let h=e.context.getParent(l),a=this.Ar.states[e.context.xi(l)];u=new Ve({state:a,context:h},e),s=this.Rl(t,u,r,s,n,i)}return s}e.state.An||s&&e.al||r.add(e);for(let l=0;l<e.state.yn.length;l++){let h=e.state.yn[l];u=this.Ol(t,e,h,r,n,i),null!==u&&(s=this.Rl(t,u,r,s,n,i))}return s}Ol(t,e,r,s,n,i){let u=null;if(r.jn===yt.RULE){let t=Jt.create(e.context,r.Wn.an);u=new Ve({state:r.target,context:t},e)}else{if(r.jn===yt.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(r.jn===yt.PREDICATE)qe.debug,s.Wu=!0,this.Fl(t,r.In,r.cu,n)&&(u=new Ve({state:r.target},e));else if(r.jn===yt.ACTION)if(null===e.context||e.context.Ni()){let t=Ue.append(e.nl,this.Ar.Gi[r.hu]);u=new Ve({state:r.target,nl:t},e)}else u=new Ve({state:r.target},e);else r.jn===yt.EPSILON?u=new Ve({state:r.target},e):r.jn!==yt.ATOM&&r.jn!==yt.RANGE&&r.jn!==yt.SET||i&&r.matches(j.EOF,0,it.Is)&&(u=new Ve({state:r.target},e))}return u}Fl(t,e,r,s){if(null===this.wl)return!0;if(!s)return this.wl.Mr(null,e,r);let n=this.Be,i=this.line,u=t.index,l=t.mark();try{return this.xs(t),this.wl.Mr(null,e,r)}finally{this.Be=n,this.line=i,t.seek(u),t.release(l)}}El(t,e,r){t.index=e.index,t.line=this.line,t.Be=this.Be,t.fl=r}bl(t,e,r,s){if(void 0===r&&(r=null),void 0===s&&(s=null),null===r&&null!==s){let t=s.Wu;if(s.Wu=!1,r=this.Tl(s),t)return r}return e<qe.Al||e>qe.yl||(qe.debug,null===t.el&&(t.el=[]),t.el[e-qe.Al]=r),r}Tl(t){let e=new Le(null,t),r=null;for(let e=0;e<t.items.length;e++){let s=t.items[e];if(s.state instanceof At){r=s;break}}null!==r&&(e.rl=!0,e.nl=r.nl,e.sl=this.Ar.Hi[r.state.In]);let s=this.dl[this.mode],n=s.states.get(e);if(null!==n)return n;let i=e;return i.an=s.states.length,t.tl(!0),i.Ju=t,s.states.add(i),i}kl(t){return this.dl[t]}br(t){return t.br(this.Br,t.index-1)}xs(t){t.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.Be=0):this.Be+=1,t.xs()}Ll(t){return-1===t?"EOF":"'"+String.fromCharCode(t)+"'"}}qe.debug=!1,qe._l=!1,qe.Al=0,qe.yl=127;class Je{constructor(t,e){this.alt=e,this.Pl=t}toString(){return"("+this.Pl+", "+this.alt+")"}}class Xe{constructor(){this.data={}}get(t){return this.data["k-"+t]||null}set(t,e){this.data["k-"+t]=e}values(){return Object.keys(this.data).filter(t=>t.startsWith("k-")).map(t=>this.data[t],this)}}let $e={SLL:0,LL:1,Vl:2,Bl:function(t,e){if($e.Ul(e))return!0;if(t===$e.SLL&&e.Wu){let t=new ke;for(let r=0;r<e.items.length;r++){let s=e.items[r];s=new St({nn:vt.NONE},s),t.add(s)}e=t}let r=$e.Hl(e);return $e.Gl(r)&&!$e.ql(e)},Jl:function(t){for(let e=0;e<t.items.length;e++)if(t.items[e].state instanceof At)return!0;return!1},Ul:function(t){for(let e=0;e<t.items.length;e++)if(!(t.items[e].state instanceof At))return!1;return!0},Xl:function(t){return $e.$l(t)},Wl:function(t){return!$e.jl(t)},jl:function(t){for(let e=0;e<t.length;e++)if(1===t[e].length)return!0;return!1},Gl:function(t){for(let e=0;e<t.length;e++)if(t[e].length>1)return!0;return!1},Kl:function(t){let e=null;for(let r=0;r<t.length;r++){let s=t[r];if(null===e)e=s;else if(s!==e)return!1}return!0},zl:function(t){let e=$e.Yl(t);return 1===e.length?e.minValue():Qt.Qi},Yl:function(t){let e=new zt;return t.map(function(t){e.or(t)}),e},Hl:function(t){let e=new $t;return e.$s=function(t){ft.Gs(t.state.an,t.context)},e.Ws=function(t,e){return t.state.an===e.state.an&&t.context.equals(e.context)},t.items.map(function(t){let r=e.get(t);null===r&&(r=new zt,e.set(t,r)),r.set(t.alt)}),e.getValues()},Ql:function(t){let e=new Xe;return t.items.map(function(t){let r=e.get(t.state);null===r&&(r=new zt,e.set(t.state,r)),r.set(t.alt)}),e},ql:function(t){let e=$e.Ql(t).values();for(let t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},$l:function(t){let e=null;for(let r=0;r<t.length;r++){let s=t[r].minValue();if(null===e)e=s;else if(e!==s)return Qt.Qi}return e}};const We=$e;class je extends rt{constructor(t,e,r,s,n,i){i=i||t.Zl,s=s||t.th(),r=r||t.th(),e=e||t.Ge(),super({message:"",Fr:t,input:e,kr:i}),this.Ur=n,this.eh=r,this.Lr=s}}class Ke{constructor(t){this.rh=t||$t,this.sh=new this.rh}get(t,e){let r=this.sh.get(t)||null;return null===r?null:r.get(e)||null}set(t,e,r){let s=this.sh.get(t)||null;null===s&&(s=new this.rh,this.sh.set(t,s)),s.set(e,r)}}const ze={ATN:Qt,ATNDeserializer:Re,LexerATNSimulator:qe,ParserATNSimulator:class extends _e{constructor(t,e,r,s){super(e,s),this.nh=t,this.dl=r,this.ih=We.LL,this.Hr=null,this.uh=0,this.hh=null,this.ah=null,this.oh=null,this.debug=!1,this.fh=!1,this.dh=!1,this.Si=!1,this._l=!1,this.wh=!1}reset(){}gh(t,e,r){this.debug||this.Si,this.Hr=t,this.uh=t.index,this.hh=r;let s=this.dl[e];this.ah=s;let n=t.mark(),i=t.index;try{let e;if(e=s.ph?s.mh(this.nh.Nh()):s.ml,null===e){null===r&&(r=Ht.EMPTY),this.debug;let t=!1,n=this.xl(s.xh,Ht.EMPTY,t);s.ph?(s.ml.Ju=n,n=this.Th(n),e=this.Tl(s,new Le(null,n)),s.Eh(this.nh.Nh(),e)):(e=this.Tl(s,new Le(null,n)),s.ml=e)}let n=this.Nl(s,e,t,i,r);return this.debug,n}finally{this.ah=null,this.oh=null,t.seek(i),t.release(n)}}Nl(t,e,r,s,n){let i;this.debug||this.Si;let u=e;this.debug;let l=r.LA(1);for(;;){let e=this.Sl(u,l);if(null===e&&(e=this.Ml(t,u,l)),e===_e.ERROR){let t=this.Sh(r,n,u.Ju,s);if(r.seek(s),i=this.Mh(u.Ju,n),i!==Qt.Qi)return i;throw t}if(e.il&&this.ih!==We.SLL){let u=null;if(null!==e.ul){this.debug;let t=r.index;if(t!==s&&r.seek(s),u=this.Ih(e.ul,n,!0),1===u.length)return this.debug,u.minValue();t!==s&&r.seek(t)}this._l;let l=!0,h=this.xl(t.xh,n,l);return this.Ke(t,u,e.Ju,s,r.index),i=this.Ah(t,e,h,r,s,n),i}if(e.rl){if(null===e.ul)return e.sl;let i=r.index;r.seek(s);let u=this.Ih(e.ul,n,!0);if(0===u.length)throw this.Sh(r,n,e.Ju,s);return 1===u.length||this.je(t,e,s,i,!1,u,e.Ju),u.minValue()}u=e,l!==j.EOF&&(r.xs(),l=r.LA(1))}}Sl(t,e){let r=t.el;return null===r?null:r[e+1]||null}Ml(t,e,r){let s=this.yh(e.Ju,r,!1);if(null===s)return this.bl(t,e,r,_e.ERROR),_e.ERROR;let n=new Le(null,s),i=this.zl(s);return this.debug&&We.Hl(s),i!==Qt.Qi?(n.rl=!0,n.Ju.Xu=i,n.sl=i):We.Bl(this.ih,s)&&(n.Ju.$u=this.Dh(s),n.il=!0,n.rl=!0,n.sl=n.Ju.$u.minValue()),n.rl&&n.Ju.Wu&&(this.bh(n,this.Ar.Yi(t.zi)),null!==n.ul&&(n.sl=Qt.Qi)),n=this.bl(t,e,r,n),n}bh(t,e){let r=e.yn.length,s=this.Ch(t.Ju),n=this.Rh(s,t.Ju,r);null!==n?(t.ul=this.Oh(s,n),t.sl=Qt.Qi):t.sl=s.minValue()}Ah(t,e,r,s,n,i){this.debug||this.Si;let u,l=!1,h=r;s.seek(n);let a=s.LA(1),o=-1;for(;;){if(u=this.yh(h,a,!0),null===u){let t=this.Sh(s,i,h,n);s.seek(n);let e=this.Mh(h,i);if(e!==Qt.Qi)return e;throw t}let t=We.Hl(u);if(this.debug,u.Xu=this.zl(u),u.Xu!==Qt.Qi){o=u.Xu;break}if(this.ih!==We.Vl){if(o=We.Xl(t),o!==Qt.Qi)break}else if(We.Wl(t)&&We.Kl(t)){l=!0,o=We.$l(t);break}h=u,a!==j.EOF&&(s.xs(),a=s.LA(1))}return u.Xu!==Qt.Qi?(this.ze(t,o,u,n,s.index),o):(this.je(t,e,n,s.index,l,null,u),o)}yh(t,e,r){this.debug,null===this.oh&&(this.oh=new Ke);let s=new ke(r),n=null;for(let i=0;i<t.items.length;i++){let u=t.items[i];if(this.debug,u.state instanceof At)(r||e===j.EOF)&&(null===n&&(n=[]),n.push(u),this.dh);else for(let t=0;t<u.state.yn.length;t++){let r=u.state.yn[t],n=this.Cl(r,e);if(null!==n){let t=new St({state:n},u);s.add(t,this.oh),this.dh}}}let i=null;if(null===n&&e!==j.EOF&&(1===s.items.length||this.zl(s)!==Qt.Qi)&&(i=s),null===i){i=new ke(r);let t=new mt,n=e===j.EOF;for(let e=0;e<s.items.length;e++)this.Rl(s.items[e],i,t,!1,r,n)}if(e===j.EOF&&(i=this.Fh(i,i===s)),!(null===n||r&&We.Jl(i)))for(let t=0;t<n.length;t++)i.add(n[t],this.oh);return this.Si,0===i.items.length?null:i}Fh(t,e){if(We.Ul(t))return t;let r=new ke(t.qu);for(let s=0;s<t.items.length;s++){let n=t.items[s];if(n.state instanceof At)r.add(n,this.oh);else if(e&&n.state.An&&this.Ar.$i(n.state).contains(j.EPSILON)){let t=this.Ar.Bi[n.state.In];r.add(new St({state:t},n),this.oh)}}return r}xl(t,e,r){let s=Wt(this.Ar,e),n=new ke(r);this.Si;for(let e=0;e<t.yn.length;e++){let i=t.yn[e].target,u=new St({state:i,alt:e+1,context:s},null),l=new mt;this.Rl(u,n,l,!0,r,!1)}return n}Th(t){let e,r=[],s=new ke(t.qu);for(let n=0;n<t.items.length;n++){if(e=t.items[n],1!==e.alt)continue;let i=e.nn.Qs(this.nh,this.hh);null!==i&&(r[e.state.an]=e.context,i!==e.nn?s.add(new St({nn:i},e),this.oh):s.add(e,this.oh))}for(let n=0;n<t.items.length;n++)if(e=t.items[n],1!==e.alt){if(!e.ln){let t=r[e.state.an]||null;if(null!==t&&t.equals(e.context))continue}s.add(e,this.oh)}return s}Cl(t,e){return t.matches(e,0,this.Ar.Li)?t.target:null}Rh(t,e,r){let s=[];for(let r=0;r<e.items.length;r++){let n=e.items[r];t.get(n.alt)&&(s[n.alt]=vt.en(s[n.alt]||null,n.nn))}let n=0;for(let t=1;t<r+1;t++){let e=s[t]||null;null===e?s[t]=vt.NONE:e!==vt.NONE&&(n+=1)}return 0===n&&(s=null),this.debug,s}Oh(t,e){let r=[],s=!1;for(let n=1;n<e.length;n++){let i=e[n];null!==t&&t.get(n)&&r.push(new Je(i,n)),i!==vt.NONE&&(s=!0)}return s?r:null}Mh(t,e){let r=this.kh(t,e),s=r[0],n=r[1],i=this.Lh(s);return i!==Qt.Qi||n.items.length>0&&(i=this.Lh(n),i!==Qt.Qi)?i:Qt.Qi}Lh(t){let e=[];for(let r=0;r<t.items.length;r++){let s=t.items[r];(s.un>0||s.state instanceof At&&s.context.Ni())&&e.indexOf(s.alt)<0&&e.push(s.alt)}return 0===e.length?Qt.Qi:Math.min.apply(null,e)}kh(t,e){let r=new ke(t.qu),s=new ke(t.qu);for(let n=0;n<t.items.length;n++){let i=t.items[n];i.nn!==vt.NONE?i.nn.evaluate(this.nh,e)?r.add(i):s.add(i):r.add(i)}return[r,s]}Ih(t,e,r){let s=new zt;for(let n=0;n<t.length;n++){let i=t[n];if(i.Pl===vt.NONE){if(s.set(i.alt),!r)break;continue}let u=i.Pl.evaluate(this.nh,e);if(this.debug||this._l,u&&(this.debug||this._l,s.set(i.alt),!r))break}return s}Rl(t,e,r,s,n,i){this._h(t,e,r,s,n,0,i)}_h(t,e,r,s,n,i,u){if(this.Si||this.fh,t.state instanceof At){if(!t.context.di()){for(let l=0;l<t.context.length;l++){if(t.context.xi(l)===Gt.Ti){if(n){e.add(new St({state:t.state,context:Gt.EMPTY},t),this.oh);continue}this.debug,this.Ph(t,e,r,s,n,i,u);continue}let h=this.Ar.states[t.context.xi(l)],a=t.context.getParent(l),o={state:h,alt:t.alt,context:a,nn:t.nn},c=new St(o,null);c.un=t.un,this._h(c,e,r,s,n,i-1,u)}return}if(n)return void e.add(t,this.oh);this.debug}this.Ph(t,e,r,s,n,i,u)}Ph(t,e,r,s,n,i,u){let l=t.state;l.An||e.add(t,this.oh);for(let h=0;h<l.yn.length;h++){if(0===h&&this.Vh(t))continue;let a=l.yn[h],o=s&&!(a instanceof we),c=this.Ol(t,a,o,0===i,n,u);if(null!==c){let s=i;if(t.state instanceof At){if(null!==this.ah&&this.ah.ph&&a.ou===this.ah.xh.In&&(c.ln=!0),c.un+=1,r.Ks(c)!==c)continue;e.ju=!0,s-=1,this.debug}else{if(!a.Rn&&r.Ks(c)!==c)continue;a instanceof Dt&&s>=0&&(s+=1)}this._h(c,e,r,o,n,s,u)}}}Vh(t){let e=t.state;if(e.Mn!==It.Un)return!1;if(e.Mn!==It.Un||!e.iu||t.context.di()||t.context.Ni())return!1;let r=t.context.length;for(let s=0;s<r;s++)if(this.Ar.states[t.context.xi(s)].In!==e.In)return!1;let s=e.yn[0].target.tu.an,n=this.Ar.states[s];for(let s=0;s<r;s++){let r=t.context.xi(s),i=this.Ar.states[r];if(1!==i.yn.length||!i.yn[0].Rn)return!1;let u=i.yn[0].target;if(!(i.Mn===It.Vn&&u===e||i===n||u===n||u.Mn===It.Vn&&1===u.yn.length&&u.yn[0].Rn&&u.yn[0].target===e))return!1}return!0}Bh(t){return null!==this.nh&&t>=0?this.nh.gr[t]:"<rule "+t+">"}Ol(t,e,r,s,n,i){switch(e.jn){case yt.RULE:return this.Uh(t,e);case yt.PRECEDENCE:return this.Hh(t,e,r,s,n);case yt.PREDICATE:return this.Gh(t,e,r,s,n);case yt.ACTION:return this.qh(t,e);case yt.EPSILON:return new St({state:e.target},t);case yt.ATOM:case yt.RANGE:case yt.SET:return i&&e.matches(j.EOF,0,1)?new St({state:e.target},t):null;default:return null}}qh(t,e){return this.debug&&(-1===e.hu||e.hu),new St({state:e.target},t)}Hh(t,e,r,s,n){this.debug&&this.nh;let i=null;if(r&&s)if(n){let r=this.Hr.index;this.Hr.seek(this.uh);let s=e.fu().evaluate(this.nh,this.hh);this.Hr.seek(r),s&&(i=new St({state:e.target},t))}else{let r=vt.Zs(t.nn,e.fu());i=new St({state:e.target,nn:r},t)}else i=new St({state:e.target},t);return this.debug,i}Gh(t,e,r,s,n){this.debug&&this.nh;let i=null;if(r&&(e.au&&s||!e.au))if(n){let r=this.Hr.index;this.Hr.seek(this.uh);let s=e.fu().evaluate(this.nh,this.hh);this.Hr.seek(r),s&&(i=new St({state:e.target},t))}else{let r=vt.Zs(t.nn,e.fu());i=new St({state:e.target,nn:r},t)}else i=new St({state:e.target},t);return this.debug,i}Uh(t,e){this.debug;let r=e.Wn,s=Jt.create(t.context,r.an);return new St({state:e.target,context:s},t)}Dh(t){let e=We.Hl(t);return We.Yl(e)}Ch(t){let e=null;return t.Xu!==Qt.Qi?(e=new zt,e.set(t.Xu)):e=t.$u,e}Ll(t){return t===j.EOF?"EOF":null===this.nh||null===this.nh.ir||t>=this.nh.ir.length&&t>=this.nh.lr.length?""+t:(this.nh.ir[t]||this.nh.lr[t])+"<"+t+">"}Jh(t){return this.Ll(t.LA(1))}Xh(t){let e=t.$h();for(let t=0;t<e.length;t++){let r=e[t],s="no edges";if(r.state.yn.length>0){let t=r.state.yn[0];t instanceof fe?s="Atom "+this.Ll(t.label):t instanceof bt&&(s=(t instanceof Ct?"~":"")+"Set "+t.set)}}}Sh(t,e,r,s){return new je(this.nh,t,t.get(s),t.LT(1),r,e)}zl(t){let e=Qt.Qi;for(let r=0;r<t.items.length;r++){let s=t.items[r];if(e===Qt.Qi)e=s.alt;else if(s.alt!==e)return Qt.Qi}return e}bl(t,e,r,s){return this.debug,null===s?null:(s=this.Tl(t,s),null===e||r<-1||r>this.Ar.Li||(null===e.el&&(e.el=[]),e.el[r+1]=s,this.debug&&(null===this.nh||this.nh.ir,null===this.nh||this.nh.lr)),s)}Tl(t,e){if(e===_e.ERROR)return e;let r=t.states.get(e);return null!==r?(this.Si,r):(e.an=t.states.length,e.Ju.readOnly||(e.Ju.Yu(this),e.Ju.tl(!0)),this.Si,t.states.add(e),this.debug,e)}Ke(t,e,r,s,n){(this.debug||this.wh)&&new st(s,n+1),null!==this.nh&&this.nh.Sr().Ke(this.nh,t,s,n,e,r)}ze(t,e,r,s,n){(this.debug||this.wh)&&new st(s,n+1),null!==this.nh&&this.nh.Sr().ze(this.nh,t,s,n,e,r)}je(t,e,r,s,n,i,u){(this.debug||this.wh)&&new st(r,s+1),null!==this.nh&&this.nh.Sr().je(this.nh,t,r,s,n,i,u)}},PredictionContextCache:class{constructor(){this.cache=new $t}add(t){if(t===Gt.EMPTY)return Gt.EMPTY;let e=this.cache.get(t)||null;return null!==e?e:(this.cache.set(t,t),t)}get(t){return this.cache.get(t)||null}get length(){return this.cache.length}}};class Ye{constructor(t,e,r){this.Wh=t,this.ir=e||[],this.lr=r||[]}toString(){if(null===this.Wh.ml)return null;let t="",e=this.Wh.jh();for(let r=0;r<e.length;r++){let s=e[r];if(null!==s.el){let e=s.el.length;for(let r=0;r<e;r++){let e=s.el[r]||null;null!==e&&2147483647!==e.an&&(t=t.concat(this.Kh(s)),t=t.concat("-"),t=t.concat(this.zh(r)),t=t.concat("->"),t=t.concat(this.Kh(e)),t=t.concat("\n"))}}}return 0===t.length?null:t}zh(t){return 0===t?"EOF":null!==this.ir||null!==this.lr?this.ir[t-1]||this.lr[t-1]:String.fromCharCode(t-1)}Kh(t){let e=(t.rl?":":"")+"s"+t.an+(t.il?"^":"");return t.rl?null!==t.ul?e+"=>"+pt(t.ul):e+"=>"+t.sl.toString():e}}class Qe extends Ye{constructor(t){super(t,null)}zh(t){return"'"+String.fromCharCode(t)+"'"}}const Ze={DFA:class{constructor(t,e){if(void 0===e&&(e=0),this.xh=t,this.zi=e,this.Yh=new mt,this.ml=null,this.ph=!1,t instanceof he&&t.iu){this.ph=!0;let t=new Le(null,new ke);t.el=[],t.rl=!1,t.il=!1,this.ml=t}}mh(t){if(!this.ph)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.ml.el.length?null:this.ml.el[t]||null}Eh(t,e){if(!this.ph)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.ml.el[t]=e)}Qh(t){if(this.ph!==t){if(this.Yh=new mt,t){let t=new Le(null,new ke);t.el=[],t.rl=!1,t.il=!1,this.ml=t}else this.ml=null;this.ph=t}}jh(){return this.Yh.values().sort(function(t,e){return t.an-e.an})}toString(t,e){return t=t||null,e=e||null,null===this.ml?"":new Ye(this,t,e).toString()}Zh(){return null===this.ml?"":new Qe(this).toString()}get states(){return this.Yh}}},tr={ParseTreeVisitor:class{ta(t){return Array.isArray(t)?t.map(function(t){return t.accept(this)},this):t.accept(this)}pi(t){return t.children?this.ta(t.children):null}ea(t){}ra(t){}}},er={RecognitionException:rt};class rr extends rt{constructor(t,e,r){super({message:sr(e,r||null),Fr:t,input:t.Ge(),kr:t.Zl});let s=t.Ze.Ar.states[t.state].yn[0];s instanceof me?(this.In=s.In,this.sa=s.cu):(this.In=0,this.sa=0),this.na=e,this.Lr=t.th()}}function sr(t,e){return null!==e?e:"failed predicate: {"+t+"}?"}class nr extends rt{constructor(t){super({message:"",Fr:t,input:t.Ge(),kr:t.Zl}),this.Lr=t.th()}}class ir{reset(t){}ia(t){}rs(t,e){}sync(t){}ua(t){}reportError(t){}}class ur extends ir{constructor(){super(),this.la=!1,this.ha=-1,this.aa=null,this.oa=null,this.ca=0}reset(t){this.fa(t)}da(t){this.la=!0}ua(t){return this.la}fa(t){this.la=!1,this.aa=null,this.ha=-1}wa(t){this.fa(t)}reportError(t,e){this.ua(t)||(this.da(t),e instanceof je?this.ga(t,e):e instanceof nr?this.pa(t,e):e instanceof rr?this.ma(t,e):t.va(e.Nr(),e.getMessage(),e))}rs(t,e){this.ha===t.Ge().index&&null!==this.aa&&this.aa.indexOf(t.state)>=0&&t.xs(),this.ha=t.Hr.index,null===this.aa&&(this.aa=[]),this.aa.push(t.state);let r=this.Na(t);this.xa(t,r)}sync(t){if(this.ua(t))return;let e=t.Ze.Ar.states[t.state],r=t.Ta().LA(1),s=t.Ar.$i(e);if(s.contains(r))return this.oa=null,void(this.ca=It.Sn);if(s.contains(j.EPSILON))null===this.oa&&(this.oa=t.Zl,this.Ea=t.tr);else switch(e.Mn){case It.Fn:case It.Ln:case It.kn:case It.Un:if(null!==this.Sa(t))return;throw new nr(t);case It.Hn:case It.Bn:{this.Ma(t);let e=new Mt;e.pn(t.Pr());let r=e.pn(this.Na(t));this.xa(t,r)}}}ga(t,e){let r,s=t.Ta();r=null!==s?e.eh.type===j.EOF?"<EOF>":s.br(new st(e.eh.Ve,e.Lr.Ve)):"<unknown input>";let n="no viable alternative at input "+this.Ia(r);t.va(n,e.Lr,e)}pa(t,e){let r="mismatched input "+this.Tr(e.Lr)+" expecting "+e.Pr().toString(t.ir,t.lr);t.va(r,e.Lr,e)}ma(t,e){let r="rule "+t.gr[t.Zl.In]+" "+e.message;t.va(r,e.Lr,e)}Ma(t){if(this.ua(t))return;this.da(t);let e=t.th(),r="extraneous input "+this.Tr(e)+" expecting "+this.Pr(t).toString(t.ir,t.lr);t.va(r,e,null)}Aa(t){if(this.ua(t))return;this.da(t);let e=t.th(),r="missing "+this.Pr(t).toString(t.ir,t.lr)+" at "+this.Tr(e);t.va(r,e,null)}ia(t){let e=this.Sa(t);if(null!==e)return t.xs(),e;if(this.ya(t))return this.Da(t);throw new nr(t)}ya(t){let e=t.Ta().LA(1),r=t.Ze.Ar,s=r.states[t.state].yn[0].target;return!!r.$i(s,t.Zl).contains(e)&&(this.Aa(t),!0)}Sa(t){let e=t.Ta().LA(2);if(this.Pr(t).contains(e)){this.Ma(t),t.xs();let e=t.th();return this.wa(t),e}return null}Da(t){let e,r=t.th(),s=this.Pr(t).first();e=s===j.EOF?"<missing EOF>":"<missing "+t.ir[s]+">";let n=r,i=t.Ta().LT(-1);return n.type===j.EOF&&null!==i&&(n=i),t.ba().create(n.source,s,e,j.Xe,-1,-1,n.line,n.Be)}Pr(t){return t.Pr()}Tr(t){if(null===t)return"<no token>";let e=t.text;return null===e&&(e=t.type===j.EOF?"<EOF>":"<"+t.type+">"),this.Ia(e)}Ia(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}Na(t){let e=t.Ze.Ar,r=t.Zl,s=new Mt;for(;null!==r&&r.ci>=0;){let t=e.states[r.ci].yn[0],n=e.$i(t.Wn);s.pn(n),r=r.oi}return s.vn(j.EPSILON),s}xa(t,e){let r=t.Ta().LA(1);for(;r!==j.EOF&&!e.contains(r);)t.xs(),r=t.Ta().LA(1)}}class lr{ea(t){}ra(t){}Ca(t){}Ra(t){}}class hr extends lr{constructor(t){super(),this.nh=t}Ca(t){}ea(t){}Ra(t){}}class ar extends Q{constructor(t){super(),this.Hr=null,this.Oa=new ur,this.Fa=[],this.Fa.push(0),this.Zl=null,this.ka=!0,this.La=null,this._a=null,this.Pa=0,this.Va(t)}reset(){null!==this.Hr&&this.Hr.seek(0),this.Oa.reset(this),this.Zl=null,this.Pa=0,this.Ba(!1),this.Fa=[],this.Fa.push(0),null!==this.Ze&&this.Ze.reset()}match(t){let e=this.th();return e.type===t?(this.Oa.wa(this),this.xs()):(e=this.Oa.ia(this),this.ka&&-1===e.Ve&&this.Zl.Ua(e)),e}Ha(){let t=this.th();return t.type>0?(this.Oa.wa(this),this.xs()):(t=this.Oa.ia(this),this.ka&&-1===t.Ve&&this.Zl.Ua(t)),t}Ga(){return this._a||[]}qa(t){if(null===t)throw"listener";null===this._a&&(this._a=[]),this._a.push(t)}Ja(t){if(null!==this._a){let e=this._a.indexOf(t);e>=0&&this._a.splice(e,1),0===this._a.length&&(this._a=null)}}Xa(){this._a=null}$a(){if(null!==this._a){let t=this.Zl;this._a.forEach(function(e){e.Ca(t),t.Wa(e)})}}ja(){if(null!==this._a){let t=this.Zl;this._a.slice(0).reverse().forEach(function(e){t.Ka(e),e.Ra(t)})}}ba(){return this.Hr.As.Gr}za(t){this.Hr.As.Gr=t}Ya(){let t=this.Qa();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";let e=this.Za[t];if(null===e){let r=new xe;r.wu=!0,e=new Re(r).Eu(t),this.Za[t]=e}return e}Ge(){return this.Ta()}Va(t){this.eo(t)}Ta(){return this.Hr}eo(t){this.Hr=null,this.reset(),this.Hr=t}get ro(){return this.Pa}th(){return this.Hr.LT(1)}va(t,e,r){r=r||null,null===(e=e||null)&&(e=this.th()),this.Pa+=1;let s=e.line,n=e.Be;this.Sr().We(this,e,s,n,t,r)}xs(){let t=this.th();t.type!==j.EOF&&this.Ge().xs();let e=null!==this._a&&this._a.length>0;if(this.ka||e){let r;r=this.Oa.ua(this)?this.Zl.Ua(t):this.Zl.so(t),r.ci=this.state,e&&this._a.forEach(function(t){r instanceof Vt||void 0!==r.no&&r.no()?t.ra(r):r instanceof Pt&&t.ea(r)})}return t}io(){null!==this.Zl.oi&&this.Zl.oi.uo(this.Zl)}Wa(t,e,r){this.state=e,this.Zl=t,this.Zl.start=this.Hr.LT(1),this.ka&&this.io(),this.$a()}Ka(){this.Zl.stop=this.Hr.LT(-1),this.ja(),this.state=this.Zl.ci,this.Zl=this.Zl.oi}lo(t,e){t.gi(e),this.ka&&this.Zl!==t&&null!==this.Zl.oi&&(this.Zl.oi.ho(),this.Zl.oi.uo(t)),this.Zl=t}Nh(){return 0===this.Fa.length?-1:this.Fa[this.Fa.length-1]}ao(t,e,r,s){this.state=e,this.Fa.push(s),this.Zl=t,this.Zl.start=this.Hr.LT(1),this.$a()}oo(t,e,r){let s=this.Zl;s.oi=t,s.ci=e,s.stop=this.Hr.LT(-1),this.Zl=t,this.Zl.start=s.start,this.ka&&this.Zl.uo(s),this.$a()}co(t){this.Fa.pop(),this.Zl.stop=this.Hr.LT(-1);let e=this.Zl,r=this.Ga();if(null!==r&&r.length>0)for(;this.Zl!==t;)this.ja(),this.Zl=this.Zl.oi;else this.Zl=t;e.oi=t,this.ka&&null!==t&&t.uo(e)}fo(t){let e=this.Zl;for(;null!==e;){if(e.In===t)return e;e=e.oi}return null}Ir(t,e){return e>=this.Fa[this.Fa.length-1]}do(t){return!1}wo(t){let e=this.Ze.Ar,r=this.Zl,s=e.states[this.state],n=e.$i(s);if(n.contains(t))return!0;if(!n.contains(j.EPSILON))return!1;for(;null!==r&&r.ci>=0&&n.contains(j.EPSILON);){let s=e.states[r.ci].yn[0];if(n=e.$i(s.Wn),n.contains(t))return!0;r=r.oi}return!(!n.contains(j.EPSILON)||t!==j.EOF)}Pr(){return this.Ze.Ar.Pr(this.state,this.Zl)}po(){let t=this.Ze.Ar,e=t.states[this.state];return t.$i(e)}mo(t){let e=this.wr()[t];return null!==e?e:-1}vo(t){null===(t=t||null)&&(t=this.Zl);let e=[];for(;null!==t;){let r=t.In;r<0?e.push("n/a"):e.push(this.gr[r]),t=t.oi}return e}No(){return this.Ze.dl.toString()}xo(){let t=!1;for(let e=0;e<this.Ze.dl.length;e++){let r=this.Ze.dl[e];r.states.length>0&&(this.Eo.To("Decision "+r.zi+":"),this.Eo.print(r.toString(this.ir,this.lr)),t=!0)}}Bs(){return this.Hr.Bs()}Ba(t){t?(null!==this.La&&this.Ja(this.La),this.La=new hr(this),this.qa(this.La)):(this.Ja(this.La),this.La=null)}}ar.Za={};class or extends Pt{constructor(t){super(),this.oi=null,this.ei=t}Zn(t){return null}So(){return this.ei}getParent(){return this.oi}ri(){return this.ei}wi(){if(null===this.ei)return st.Vr;let t=this.ei.Ve;return new st(t,t)}Qn(){return 0}accept(t){return t.ea(this)}br(){return this.ei.text}toString(){return this.ei.type===j.EOF?"<EOF>":this.ei.text}}class cr extends or{constructor(t){super(t)}no(){return!0}accept(t){return t.ra(this)}}class fr extends Ht{constructor(t,e){super(t,e),this.children=null,this.start=null,this.stop=null,this.exception=null}Mo(t){this.oi=t.oi,this.ci=t.ci,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map(function(t){t instanceof cr&&(this.children.push(t),t.oi=this)},this))}Wa(t){}Ka(t){}uo(t){return null===this.children&&(this.children=[]),this.children.push(t),t}ho(){null!==this.children&&this.children.pop()}so(t){let e=new or(t);return this.uo(e),e.oi=this,e}Ua(t){let e=new cr(t);return this.uo(e),e.oi=this,e}Zn(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(let r=0;r<this.children.length;r++){let s=this.children[r];if(s instanceof e){if(0===t)return s;t-=1}}return null}Io(t,e){if(null===this.children||e<0||e>=this.children.length)return null;for(let r=0;r<this.children.length;r++){let s=this.children[r];if(s instanceof Pt&&s.ei.type===t){if(0===e)return s;e-=1}}return null}Rs(t){if(null===this.children)return[];{let e=[];for(let r=0;r<this.children.length;r++){let s=this.children[r];s instanceof Pt&&s.ei.type===t&&e.push(s)}return e}}Ao(t,e){return this.Zn(e,t)}yo(t){if(null===this.children)return[];{let e=[];for(let r=0;r<this.children.length;r++){let s=this.children[r];s instanceof t&&e.push(s)}return e}}Qn(){return null===this.children?0:this.children.length}wi(){return null===this.start||null===this.stop?st.Vr:new st(this.start.Ve,this.stop.Ve)}}Ht.EMPTY=new fr;const dr={Ar:ze,Wh:Ze,Do:tr,error:er,Lexer:it,Parser:ar,ParserRuleContext:fr,Token:j},wr=(new dr.Ar.ATNDeserializer).Eu([4,0,38,607,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,14,1,15,1,15,1,16,1,16,1,16,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,29,4,29,152,8,29,11,29,12,29,153,3,29,156,8,29,1,29,1,29,5,29,160,8,29,10,29,12,29,163,9,29,1,29,1,29,4,29,167,8,29,11,29,12,29,168,3,29,171,8,29,1,29,1,29,1,29,4,29,176,8,29,11,29,12,29,177,3,29,180,8,29,1,29,1,29,5,29,184,8,29,10,29,12,29,187,9,29,1,29,1,29,4,29,191,8,29,11,29,12,29,192,3,29,195,8,29,3,29,197,8,29,1,29,1,29,3,29,201,8,29,1,29,1,29,3,29,205,8,29,3,29,207,8,29,1,30,1,30,1,30,1,30,5,30,213,8,30,10,30,12,30,216,9,30,1,30,1,30,1,30,1,30,1,30,5,30,223,8,30,10,30,12,30,226,9,30,1,30,1,30,1,30,1,30,1,30,5,30,233,8,30,10,30,12,30,236,9,30,1,30,3,30,239,8,30,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,3,32,289,8,32,1,33,1,33,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,563,8,34,1,34,1,34,5,34,567,8,34,10,34,12,34,570,9,34,3,34,572,8,34,1,35,1,35,1,36,4,36,577,8,36,11,36,12,36,578,1,36,1,36,1,37,1,37,1,37,1,37,5,37,587,8,37,10,37,12,37,590,9,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,5,38,601,8,38,10,38,12,38,604,9,38,1,38,1,38,1,588,0,39,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,0,73,36,75,37,77,38,1,0,11,1,0,48,57,1,0,49,57,2,0,43,43,45,45,1,0,39,39,1,0,34,34,1,0,96,96,2,0,65,90,95,95,3,0,48,57,65,90,95,95,10,0,192,214,216,246,248,8191,11264,12287,12352,12687,13056,13183,13312,16383,19968,55295,63744,64255,65280,65520,3,0,9,10,12,13,32,32,2,0,10,10,13,13,680,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,1,79,1,0,0,0,3,81,1,0,0,0,5,83,1,0,0,0,7,85,1,0,0,0,9,87,1,0,0,0,11,89,1,0,0,0,13,91,1,0,0,0,15,93,1,0,0,0,17,95,1,0,0,0,19,97,1,0,0,0,21,99,1,0,0,0,23,101,1,0,0,0,25,103,1,0,0,0,27,105,1,0,0,0,29,107,1,0,0,0,31,110,1,0,0,0,33,112,1,0,0,0,35,115,1,0,0,0,37,117,1,0,0,0,39,120,1,0,0,0,41,124,1,0,0,0,43,128,1,0,0,0,45,131,1,0,0,0,47,134,1,0,0,0,49,137,1,0,0,0,51,140,1,0,0,0,53,142,1,0,0,0,55,144,1,0,0,0,57,146,1,0,0,0,59,206,1,0,0,0,61,238,1,0,0,0,63,240,1,0,0,0,65,288,1,0,0,0,67,290,1,0,0,0,69,571,1,0,0,0,71,573,1,0,0,0,73,576,1,0,0,0,75,582,1,0,0,0,77,596,1,0,0,0,79,80,5,46,0,0,80,2,1,0,0,0,81,82,5,40,0,0,82,4,1,0,0,0,83,84,5,44,0,0,84,6,1,0,0,0,85,86,5,41,0,0,86,8,1,0,0,0,87,88,5,91,0,0,88,10,1,0,0,0,89,90,5,93,0,0,90,12,1,0,0,0,91,92,5,33,0,0,92,14,1,0,0,0,93,94,5,37,0,0,94,16,1,0,0,0,95,96,5,42,0,0,96,18,1,0,0,0,97,98,5,47,0,0,98,20,1,0,0,0,99,100,5,43,0,0,100,22,1,0,0,0,101,102,5,45,0,0,102,24,1,0,0,0,103,104,5,38,0,0,104,26,1,0,0,0,105,106,5,62,0,0,106,28,1,0,0,0,107,108,5,62,0,0,108,109,5,61,0,0,109,30,1,0,0,0,110,111,5,60,0,0,111,32,1,0,0,0,112,113,5,60,0,0,113,114,5,61,0,0,114,34,1,0,0,0,115,116,5,61,0,0,116,36,1,0,0,0,117,118,5,61,0,0,118,119,5,61,0,0,119,38,1,0,0,0,120,121,5,61,0,0,121,122,5,61,0,0,122,123,5,61,0,0,123,40,1,0,0,0,124,125,5,33,0,0,125,126,5,61,0,0,126,127,5,61,0,0,127,42,1,0,0,0,128,129,5,33,0,0,129,130,5,61,0,0,130,44,1,0,0,0,131,132,5,60,0,0,132,133,5,62,0,0,133,46,1,0,0,0,134,135,5,38,0,0,135,136,5,38,0,0,136,48,1,0,0,0,137,138,5,124,0,0,138,139,5,124,0,0,139,50,1,0,0,0,140,141,5,63,0,0,141,52,1,0,0,0,142,143,5,58,0,0,143,54,1,0,0,0,144,145,5,123,0,0,145,56,1,0,0,0,146,147,5,125,0,0,147,58,1,0,0,0,148,155,5,48,0,0,149,151,5,46,0,0,150,152,7,0,0,0,151,150,1,0,0,0,152,153,1,0,0,0,153,151,1,0,0,0,153,154,1,0,0,0,154,156,1,0,0,0,155,149,1,0,0,0,155,156,1,0,0,0,156,207,1,0,0,0,157,161,7,1,0,0,158,160,7,0,0,0,159,158,1,0,0,0,160,163,1,0,0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,170,1,0,0,0,163,161,1,0,0,0,164,166,5,46,0,0,165,167,7,0,0,0,166,165,1,0,0,0,167,168,1,0,0,0,168,166,1,0,0,0,168,169,1,0,0,0,169,171,1,0,0,0,170,164,1,0,0,0,170,171,1,0,0,0,171,207,1,0,0,0,172,179,5,48,0,0,173,175,5,46,0,0,174,176,7,0,0,0,175,174,1,0,0,0,176,177,1,0,0,0,177,175,1,0,0,0,177,178,1,0,0,0,178,180,1,0,0,0,179,173,1,0,0,0,179,180,1,0,0,0,180,197,1,0,0,0,181,185,7,1,0,0,182,184,7,0,0,0,183,182,1,0,0,0,184,187,1,0,0,0,185,183,1,0,0,0,185,186,1,0,0,0,186,194,1,0,0,0,187,185,1,0,0,0,188,190,5,46,0,0,189,191,7,0,0,0,190,189,1,0,0,0,191,192,1,0,0,0,192,190,1,0,0,0,192,193,1,0,0,0,193,195,1,0,0,0,194,188,1,0,0,0,194,195,1,0,0,0,195,197,1,0,0,0,196,172,1,0,0,0,196,181,1,0,0,0,197,198,1,0,0,0,198,200,5,69,0,0,199,201,7,2,0,0,200,199,1,0,0,0,200,201,1,0,0,0,201,202,1,0,0,0,202,204,7,0,0,0,203,205,7,0,0,0,204,203,1,0,0,0,204,205,1,0,0,0,205,207,1,0,0,0,206,148,1,0,0,0,206,157,1,0,0,0,206,196,1,0,0,0,207,60,1,0,0,0,208,214,5,39,0,0,209,213,8,3,0,0,210,211,5,92,0,0,211,213,5,39,0,0,212,209,1,0,0,0,212,210,1,0,0,0,213,216,1,0,0,0,214,212,1,0,0,0,214,215,1,0,0,0,215,217,1,0,0,0,216,214,1,0,0,0,217,239,5,39,0,0,218,224,5,34,0,0,219,223,8,4,0,0,220,221,5,92,0,0,221,223,5,34,0,0,222,219,1,0,0,0,222,220,1,0,0,0,223,226,1,0,0,0,224,222,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,224,1,0,0,0,227,239,5,34,0,0,228,234,5,96,0,0,229,233,8,5,0,0,230,231,5,92,0,0,231,233,5,96,0,0,232,229,1,0,0,0,232,230,1,0,0,0,233,236,1,0,0,0,234,232,1,0,0,0,234,235,1,0,0,0,235,237,1,0,0,0,236,234,1,0,0,0,237,239,5,96,0,0,238,208,1,0,0,0,238,218,1,0,0,0,238,228,1,0,0,0,239,62,1,0,0,0,240,241,5,78,0,0,241,242,5,85,0,0,242,243,5,76,0,0,243,244,5,76,0,0,244,64,1,0,0,0,245,289,5,77,0,0,246,247,5,75,0,0,247,289,5,77,0,0,248,249,5,68,0,0,249,289,5,77,0,0,250,251,5,67,0,0,251,289,5,77,0,0,252,253,5,77,0,0,253,289,5,77,0,0,254,255,5,77,0,0,255,289,5,50,0,0,256,257,5,75,0,0,257,258,5,77,0,0,258,289,5,50,0,0,259,260,5,68,0,0,260,261,5,77,0,0,261,289,5,50,0,0,262,263,5,67,0,0,263,264,5,77,0,0,264,289,5,50,0,0,265,266,5,77,0,0,266,267,5,77,0,0,267,289,5,50,0,0,268,269,5,77,0,0,269,289,5,51,0,0,270,271,5,75,0,0,271,272,5,77,0,0,272,289,5,51,0,0,273,274,5,68,0,0,274,275,5,77,0,0,275,289,5,51,0,0,276,277,5,67,0,0,277,278,5,77,0,0,278,289,5,51,0,0,279,280,5,77,0,0,280,281,5,77,0,0,281,289,5,51,0,0,282,289,5,76,0,0,283,284,5,77,0,0,284,289,5,76,0,0,285,289,5,71,0,0,286,287,5,75,0,0,287,289,5,71,0,0,288,245,1,0,0,0,288,246,1,0,0,0,288,248,1,0,0,0,288,250,1,0,0,0,288,252,1,0,0,0,288,254,1,0,0,0,288,256,1,0,0,0,288,259,1,0,0,0,288,262,1,0,0,0,288,265,1,0,0,0,288,268,1,0,0,0,288,270,1,0,0,0,288,273,1,0,0,0,288,276,1,0,0,0,288,279,1,0,0,0,288,282,1,0,0,0,288,283,1,0,0,0,288,285,1,0,0,0,288,286,1,0,0,0,289,66,1,0,0,0,290,291,5,84,0,0,291,68,1,0,0,0,292,293,5,80,0,0,293,294,5,69,0,0,294,295,5,82,0,0,295,296,5,67,0,0,296,297,5,69,0,0,297,298,5,78,0,0,298,299,5,84,0,0,299,300,5,73,0,0,300,301,5,76,0,0,301,302,5,69,0,0,302,303,5,46,0,0,303,304,5,73,0,0,304,305,5,78,0,0,305,572,5,67,0,0,306,307,5,80,0,0,307,308,5,69,0,0,308,309,5,82,0,0,309,310,5,67,0,0,310,311,5,69,0,0,311,312,5,78,0,0,312,313,5,84,0,0,313,314,5,82,0,0,314,315,5,65,0,0,315,316,5,78,0,0,316,317,5,75,0,0,317,318,5,46,0,0,318,319,5,73,0,0,319,320,5,78,0,0,320,572,5,67,0,0,321,322,5,83,0,0,322,323,5,84,0,0,323,324,5,68,0,0,324,325,5,69,0,0,325,326,5,86,0,0,326,327,5,46,0,0,327,572,5,83,0,0,328,329,5,83,0,0,329,330,5,84,0,0,330,331,5,68,0,0,331,332,5,69,0,0,332,333,5,86,0,0,333,334,5,46,0,0,334,572,5,80,0,0,335,336,5,67,0,0,336,337,5,79,0,0,337,338,5,86,0,0,338,339,5,65,0,0,339,340,5,82,0,0,340,341,5,73,0,0,341,342,5,65,0,0,342,343,5,78,0,0,343,344,5,67,0,0,344,345,5,69,0,0,345,346,5,46,0,0,346,572,5,80,0,0,347,348,5,67,0,0,348,349,5,79,0,0,349,350,5,86,0,0,350,351,5,65,0,0,351,352,5,82,0,0,352,353,5,73,0,0,353,354,5,65,0,0,354,355,5,78,0,0,355,356,5,67,0,0,356,357,5,69,0,0,357,358,5,46,0,0,358,572,5,83,0,0,359,360,5,86,0,0,360,361,5,65,0,0,361,362,5,82,0,0,362,363,5,46,0,0,363,572,5,83,0,0,364,365,5,86,0,0,365,366,5,65,0,0,366,367,5,82,0,0,367,368,5,46,0,0,368,572,5,80,0,0,369,370,5,78,0,0,370,371,5,79,0,0,371,372,5,82,0,0,372,373,5,77,0,0,373,374,5,46,0,0,374,375,5,68,0,0,375,376,5,73,0,0,376,377,5,83,0,0,377,572,5,84,0,0,378,379,5,78,0,0,379,380,5,79,0,0,380,381,5,82,0,0,381,382,5,77,0,0,382,383,5,46,0,0,383,384,5,73,0,0,384,385,5,78,0,0,385,572,5,86,0,0,386,387,5,78,0,0,387,388,5,79,0,0,388,389,5,82,0,0,389,390,5,77,0,0,390,391,5,46,0,0,391,392,5,83,0,0,392,393,5,46,0,0,393,394,5,68,0,0,394,395,5,73,0,0,395,396,5,83,0,0,396,572,5,84,0,0,397,398,5,78,0,0,398,399,5,79,0,0,399,400,5,82,0,0,400,401,5,77,0,0,401,402,5,46,0,0,402,403,5,83,0,0,403,404,5,46,0,0,404,405,5,73,0,0,405,406,5,78,0,0,406,572,5,86,0,0,407,408,5,66,0,0,408,409,5,69,0,0,409,410,5,84,0,0,410,411,5,65,0,0,411,412,5,46,0,0,412,413,5,68,0,0,413,414,5,73,0,0,414,415,5,83,0,0,415,572,5,84,0,0,416,417,5,66,0,0,417,418,5,69,0,0,418,419,5,84,0,0,419,420,5,65,0,0,420,421,5,46,0,0,421,422,5,73,0,0,422,423,5,78,0,0,423,572,5,86,0,0,424,425,5,66,0,0,425,426,5,73,0,0,426,427,5,78,0,0,427,428,5,79,0,0,428,429,5,77,0,0,429,430,5,46,0,0,430,431,5,68,0,0,431,432,5,73,0,0,432,433,5,83,0,0,433,572,5,84,0,0,434,435,5,69,0,0,435,436,5,88,0,0,436,437,5,80,0,0,437,438,5,79,0,0,438,439,5,78,0,0,439,440,5,46,0,0,440,441,5,68,0,0,441,442,5,73,0,0,442,443,5,83,0,0,443,572,5,84,0,0,444,445,5,70,0,0,445,446,5,46,0,0,446,447,5,68,0,0,447,448,5,73,0,0,448,449,5,83,0,0,449,572,5,84,0,0,450,451,5,70,0,0,451,452,5,46,0,0,452,453,5,73,0,0,453,454,5,78,0,0,454,572,5,86,0,0,455,456,5,71,0,0,456,457,5,65,0,0,457,458,5,77,0,0,458,459,5,77,0,0,459,460,5,65,0,0,460,461,5,46,0,0,461,462,5,68,0,0,462,463,5,73,0,0,463,464,5,83,0,0,464,572,5,84,0,0,465,466,5,71,0,0,466,467,5,65,0,0,467,468,5,77,0,0,468,469,5,77,0,0,469,470,5,65,0,0,470,471,5,46,0,0,471,472,5,73,0,0,472,473,5,78,0,0,473,572,5,86,0,0,474,475,5,71,0,0,475,476,5,65,0,0,476,477,5,77,0,0,477,478,5,77,0,0,478,479,5,65,0,0,479,480,5,76,0,0,480,481,5,78,0,0,481,482,5,46,0,0,482,483,5,80,0,0,483,484,5,82,0,0,484,485,5,69,0,0,485,486,5,67,0,0,486,487,5,73,0,0,487,488,5,83,0,0,488,572,5,69,0,0,489,490,5,72,0,0,490,491,5,89,0,0,491,492,5,80,0,0,492,493,5,71,0,0,493,494,5,69,0,0,494,495,5,79,0,0,495,496,5,77,0,0,496,497,5,46,0,0,497,498,5,68,0,0,498,499,5,73,0,0,499,500,5,83,0,0,500,572,5,84,0,0,501,502,5,76,0,0,502,503,5,79,0,0,503,504,5,71,0,0,504,505,5,78,0,0,505,506,5,79,0,0,506,507,5,82,0,0,507,508,5,77,0,0,508,509,5,46,0,0,509,510,5,73,0,0,510,511,5,78,0,0,511,572,5,86,0,0,512,513,5,76,0,0,513,514,5,79,0,0,514,515,5,71,0,0,515,516,5,78,0,0,516,517,5,79,0,0,517,518,5,82,0,0,518,519,5,77,0,0,519,520,5,46,0,0,520,521,5,68,0,0,521,522,5,73,0,0,522,523,5,83,0,0,523,572,5,84,0,0,524,525,5,78,0,0,525,526,5,69,0,0,526,527,5,71,0,0,527,528,5,66,0,0,528,529,5,73,0,0,529,530,5,78,0,0,530,531,5,79,0,0,531,532,5,77,0,0,532,533,5,46,0,0,533,534,5,68,0,0,534,535,5,73,0,0,535,536,5,83,0,0,536,572,5,84,0,0,537,538,5,80,0,0,538,539,5,79,0,0,539,540,5,73,0,0,540,541,5,83,0,0,541,542,5,83,0,0,542,543,5,79,0,0,543,544,5,78,0,0,544,545,5,46,0,0,545,546,5,68,0,0,546,547,5,73,0,0,547,548,5,83,0,0,548,572,5,84,0,0,549,550,5,84,0,0,550,551,5,46,0,0,551,552,5,68,0,0,552,553,5,73,0,0,553,554,5,83,0,0,554,572,5,84,0,0,555,556,5,84,0,0,556,557,5,46,0,0,557,558,5,73,0,0,558,559,5,78,0,0,559,572,5,86,0,0,560,563,7,6,0,0,561,563,3,71,35,0,562,560,1,0,0,0,562,561,1,0,0,0,563,568,1,0,0,0,564,567,7,7,0,0,565,567,3,71,35,0,566,564,1,0,0,0,566,565,1,0,0,0,567,570,1,0,0,0,568,566,1,0,0,0,568,569,1,0,0,0,569,572,1,0,0,0,570,568,1,0,0,0,571,292,1,0,0,0,571,306,1,0,0,0,571,321,1,0,0,0,571,328,1,0,0,0,571,335,1,0,0,0,571,347,1,0,0,0,571,359,1,0,0,0,571,364,1,0,0,0,571,369,1,0,0,0,571,378,1,0,0,0,571,386,1,0,0,0,571,397,1,0,0,0,571,407,1,0,0,0,571,416,1,0,0,0,571,424,1,0,0,0,571,434,1,0,0,0,571,444,1,0,0,0,571,450,1,0,0,0,571,455,1,0,0,0,571,465,1,0,0,0,571,474,1,0,0,0,571,489,1,0,0,0,571,501,1,0,0,0,571,512,1,0,0,0,571,524,1,0,0,0,571,537,1,0,0,0,571,549,1,0,0,0,571,555,1,0,0,0,571,562,1,0,0,0,572,70,1,0,0,0,573,574,7,8,0,0,574,72,1,0,0,0,575,577,7,9,0,0,576,575,1,0,0,0,577,578,1,0,0,0,578,576,1,0,0,0,578,579,1,0,0,0,579,580,1,0,0,0,580,581,6,36,0,0,581,74,1,0,0,0,582,583,5,47,0,0,583,584,5,42,0,0,584,588,1,0,0,0,585,587,9,0,0,0,586,585,1,0,0,0,587,590,1,0,0,0,588,589,1,0,0,0,588,586,1,0,0,0,589,591,1,0,0,0,590,588,1,0,0,0,591,592,5,42,0,0,592,593,5,47,0,0,593,594,1,0,0,0,594,595,6,37,0,0,595,76,1,0,0,0,596,597,5,47,0,0,597,598,5,47,0,0,598,602,1,0,0,0,599,601,8,10,0,0,600,599,1,0,0,0,601,604,1,0,0,0,602,600,1,0,0,0,602,603,1,0,0,0,603,605,1,0,0,0,604,602,1,0,0,0,605,606,6,38,0,0,606,78,1,0,0,0,30,0,153,155,161,168,170,177,179,185,192,194,196,200,204,206,212,214,222,224,232,234,238,288,562,566,568,571,578,588,602,1,6,0,0]),gr=wr.Pi.map((t,e)=>new dr.Wh.DFA(t,e));class pr extends dr.Lexer{static bo="";static Co=[];static Ro=[];static ir=[];static lr=[];static gr=[];constructor(t){super(t),this.Ze=new dr.Ar.LexerATNSimulator(this,wr,gr,new dr.Ar.PredictionContextCache)}}const mr=(new dr.Ar.ATNDeserializer).Eu([4,1,38,142,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,24,8,1,10,1,12,1,27,9,1,3,1,29,8,1,1,1,1,1,1,1,1,1,1,1,5,1,36,8,1,10,1,12,1,39,9,1,1,1,5,1,42,8,1,10,1,12,1,45,9,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,53,8,1,10,1,12,1,56,9,1,1,1,5,1,59,8,1,10,1,12,1,62,9,1,1,1,1,1,1,1,1,1,1,1,3,1,69,8,1,1,1,1,1,3,1,73,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,106,8,1,10,1,12,1,109,9,1,3,1,111,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,128,8,1,10,1,12,1,131,9,1,1,2,3,2,134,8,2,1,2,1,2,1,3,1,3,1,3,1,3,1,3,0,1,2,4,0,2,4,6,0,7,1,0,33,35,1,0,33,34,1,0,8,10,1,0,11,13,1,0,14,17,1,0,18,23,1,0,30,35,167,0,8,1,0,0,0,2,72,1,0,0,0,4,133,1,0,0,0,6,137,1,0,0,0,8,9,3,2,1,0,9,10,5,0,0,1,10,1,1,0,0,0,11,12,6,1,-1,0,12,13,5,2,0,0,13,14,3,2,1,0,14,15,5,4,0,0,15,73,1,0,0,0,16,17,5,7,0,0,17,73,3,2,1,16,18,19,7,0,0,0,19,28,5,2,0,0,20,25,3,2,1,0,21,22,5,3,0,0,22,24,3,2,1,0,23,21,1,0,0,0,24,27,1,0,0,0,25,23,1,0,0,0,25,26,1,0,0,0,26,29,1,0,0,0,27,25,1,0,0,0,28,20,1,0,0,0,28,29,1,0,0,0,29,30,1,0,0,0,30,73,5,4,0,0,31,32,5,28,0,0,32,37,3,6,3,0,33,34,5,3,0,0,34,36,3,6,3,0,35,33,1,0,0,0,36,39,1,0,0,0,37,35,1,0,0,0,37,38,1,0,0,0,38,43,1,0,0,0,39,37,1,0,0,0,40,42,5,3,0,0,41,40,1,0,0,0,42,45,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,46,1,0,0,0,45,43,1,0,0,0,46,47,5,29,0,0,47,73,1,0,0,0,48,49,5,5,0,0,49,54,3,2,1,0,50,51,5,3,0,0,51,53,3,2,1,0,52,50,1,0,0,0,53,56,1,0,0,0,54,52,1,0,0,0,54,55,1,0,0,0,55,60,1,0,0,0,56,54,1,0,0,0,57,59,5,3,0,0,58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61,1,0,0,0,61,63,1,0,0,0,62,60,1,0,0,0,63,64,5,6,0,0,64,73,1,0,0,0,65,73,5,35,0,0,66,68,3,4,2,0,67,69,7,1,0,0,68,67,1,0,0,0,68,69,1,0,0,0,69,73,1,0,0,0,70,73,5,31,0,0,71,73,5,32,0,0,72,11,1,0,0,0,72,16,1,0,0,0,72,18,1,0,0,0,72,31,1,0,0,0,72,48,1,0,0,0,72,65,1,0,0,0,72,66,1,0,0,0,72,70,1,0,0,0,72,71,1,0,0,0,73,129,1,0,0,0,74,75,10,14,0,0,75,76,7,2,0,0,76,128,3,2,1,15,77,78,10,13,0,0,78,79,7,3,0,0,79,128,3,2,1,14,80,81,10,12,0,0,81,82,7,4,0,0,82,128,3,2,1,13,83,84,10,11,0,0,84,85,7,5,0,0,85,128,3,2,1,12,86,87,10,10,0,0,87,88,5,24,0,0,88,128,3,2,1,11,89,90,10,9,0,0,90,91,5,25,0,0,91,128,3,2,1,10,92,93,10,8,0,0,93,94,5,26,0,0,94,95,3,2,1,0,95,96,5,27,0,0,96,97,3,2,1,9,97,128,1,0,0,0,98,99,10,21,0,0,99,100,5,1,0,0,100,101,7,0,0,0,101,110,5,2,0,0,102,107,3,2,1,0,103,104,5,3,0,0,104,106,3,2,1,0,105,103,1,0,0,0,106,109,1,0,0,0,107,105,1,0,0,0,107,108,1,0,0,0,108,111,1,0,0,0,109,107,1,0,0,0,110,102,1,0,0,0,110,111,1,0,0,0,111,112,1,0,0,0,112,128,5,4,0,0,113,114,10,20,0,0,114,115,5,5,0,0,115,116,5,35,0,0,116,128,5,6,0,0,117,118,10,19,0,0,118,119,5,5,0,0,119,120,3,2,1,0,120,121,5,6,0,0,121,128,1,0,0,0,122,123,10,18,0,0,123,124,5,1,0,0,124,128,7,0,0,0,125,126,10,15,0,0,126,128,5,8,0,0,127,74,1,0,0,0,127,77,1,0,0,0,127,80,1,0,0,0,127,83,1,0,0,0,127,86,1,0,0,0,127,89,1,0,0,0,127,92,1,0,0,0,127,98,1,0,0,0,127,113,1,0,0,0,127,117,1,0,0,0,127,122,1,0,0,0,127,125,1,0,0,0,128,131,1,0,0,0,129,127,1,0,0,0,129,130,1,0,0,0,130,3,1,0,0,0,131,129,1,0,0,0,132,134,5,12,0,0,133,132,1,0,0,0,133,134,1,0,0,0,134,135,1,0,0,0,135,136,5,30,0,0,136,5,1,0,0,0,137,138,7,6,0,0,138,139,5,27,0,0,139,140,3,2,1,0,140,7,1,0,0,0,13,25,28,37,43,54,60,68,72,107,110,127,129,133]),vr=mr.Pi.map((t,e)=>new dr.Wh.DFA(t,e)),Nr=new dr.Ar.PredictionContextCache;class xr extends dr.Parser{static bo="";static ir=[];static lr=[];static gr=[];constructor(t){super(t),this.Ze=new dr.Ar.ParserATNSimulator(this,mr,vr,Nr),this.gr=xr.gr,this.ir=xr.ir,this.lr=xr.lr}Mr(t,e,r){return!0}Oo(){let t=new Tr(this,this.Zl,this.state);this.Wa(t,0,0);try{this.lo(t,1),this.state=8,this.Fo(0),this.match(-1)}catch(e){if(!(e instanceof dr.error.RecognitionException))throw e;t.exception=e,this.Oa.reportError(this,e),this.Oa.rs(this,e)}finally{this.Ka()}return t}Fo(t){void 0===t&&(t=0);const e=this.Zl,r=this.state;let s=new Er(this,this.Zl,r);this.ao(s,2,1,t);var n=0;try{switch(this.lo(s,1),this.Oa.sync(this),this.Ze.gh(this.Hr,7,this.Zl)){case 1:s=new Lr(this,s),this.Zl=s,this.match(2),this.state=13,this.Fo(0),this.match(4);break;case 2:s=new kr(this,s),this.Zl=s,this.match(7),this.state=17,this.Fo(16);break;case 3:if(s=new yr(this,s),this.Zl=s,s.f=this.Hr.LT(1),(n=this.Hr.LA(1))-33&-32||!(1<<n-33&7)?s.f=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.match(2),this.Oa.sync(this),!(-32&(n=this.Hr.LA(1)))&&1<<n&3489665188||!(n-32&-32)&&1<<n-32&15)for(this.state=20,this.Fo(0),this.Oa.sync(this),n=this.Hr.LA(1);3===n;)this.match(3),this.state=22,this.Fo(0),this.Oa.sync(this),n=this.Hr.LA(1);this.match(4);break;case 4:s=new Cr(this,s),this.Zl=s,this.match(28),this.state=32,this.ko(),this.Oa.sync(this);for(var i=this.Ze.gh(this.Hr,2,this.Zl);2!=i&&i!=dr.Ar.ATN.Qi;)1===i&&(this.match(3),this.state=34,this.ko()),this.Oa.sync(this),i=this.Ze.gh(this.Hr,2,this.Zl);for(this.Oa.sync(this),n=this.Hr.LA(1);3===n;)this.match(3),this.Oa.sync(this),n=this.Hr.LA(1);this.match(29);break;case 5:for(s=new Or(this,s),this.Zl=s,this.match(5),this.state=49,this.Fo(0),this.Oa.sync(this),i=this.Ze.gh(this.Hr,4,this.Zl);2!=i&&i!=dr.Ar.ATN.Qi;)1===i&&(this.match(3),this.state=51,this.Fo(0)),this.Oa.sync(this),i=this.Ze.gh(this.Hr,4,this.Zl);for(this.Oa.sync(this),n=this.Hr.LA(1);3===n;)this.match(3),this.Oa.sync(this),n=this.Hr.LA(1);this.match(6);break;case 6:s=new _r(this,s),this.Zl=s,this.match(35);break;case 7:s=new Pr(this,s),this.Zl=s,this.state=66,this.Lo(),this.Oa.sync(this),1===this.Ze.gh(this.Hr,6,this.Zl)&&(s.unit=this.Hr.LT(1),33!==(n=this.Hr.LA(1))&&34!==n?s.unit=this.Oa.ia(this):(this.Oa.wa(this),this.xs()));break;case 8:s=new Dr(this,s),this.Zl=s,this.match(31);break;case 9:s=new Vr(this,s),this.Zl=s,this.match(32)}for(this.Zl.stop=this.Hr.LT(-1),this.Oa.sync(this),i=this.Ze.gh(this.Hr,11,this.Zl);2!=i&&i!=dr.Ar.ATN.Qi;){if(1===i)switch(null!==this._a&&this.ja(),this.Oa.sync(this),this.Ze.gh(this.Hr,10,this.Zl)){case 1:s=new Fr(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.Hr.LT(1),-32&(n=this.Hr.LA(1))||!(1<<n&1792)?s._o=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.state=76,this.Fo(15);break;case 2:s=new br(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.Hr.LT(1),-32&(n=this.Hr.LA(1))||!(1<<n&14336)?s._o=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.state=79,this.Fo(14);break;case 3:s=new Mr(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.Hr.LT(1),-32&(n=this.Hr.LA(1))||!(1<<n&245760)?s._o=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.state=82,this.Fo(13);break;case 4:s=new Mr(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.Hr.LT(1),-32&(n=this.Hr.LA(1))||!(1<<n&16515072)?s._o=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.state=85,this.Fo(12);break;case 5:s=new Ir(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.match(24),this.state=88,this.Fo(11);break;case 6:s=new Ir(this,new Er(this,e,r)),this.oo(s,2,1),s._o=this.match(25),this.state=91,this.Fo(10);break;case 7:s=new Sr(this,new Er(this,e,r)),this.oo(s,2,1),this.match(26),this.state=94,this.Fo(0),this.match(27),this.state=96,this.Fo(9);break;case 8:if(s=new yr(this,new Er(this,e,r)),this.oo(s,2,1),this.match(1),s.f=this.Hr.LT(1),(n=this.Hr.LA(1))-33&-32||!(1<<n-33&7)?s.f=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.match(2),this.Oa.sync(this),!(-32&(n=this.Hr.LA(1)))&&1<<n&3489665188||!(n-32&-32)&&1<<n-32&15)for(this.state=102,this.Fo(0),this.Oa.sync(this),n=this.Hr.LA(1);3===n;)this.match(3),this.state=104,this.Fo(0),this.Oa.sync(this),n=this.Hr.LA(1);this.match(4);break;case 9:s=new Rr(this,new Er(this,e,r)),this.oo(s,2,1),this.match(5),this.match(35),this.match(6);break;case 10:s=new Rr(this,new Er(this,e,r)),this.oo(s,2,1),this.match(5),this.state=119,this.Fo(0),this.match(6);break;case 11:s=new Rr(this,new Er(this,e,r)),this.oo(s,2,1),this.match(1),s.Po=this.Hr.LT(1),(n=this.Hr.LA(1))-33&-32||!(1<<n-33&7)?s.Po=this.Oa.ia(this):(this.Oa.wa(this),this.xs());break;case 12:s=new Ar(this,new Er(this,e,r)),this.oo(s,2,1),this.match(8)}this.Oa.sync(this),i=this.Ze.gh(this.Hr,11,this.Zl)}}catch(t){if(!(t instanceof dr.error.RecognitionException))throw t;s.exception=t,this.Oa.reportError(this,t),this.Oa.rs(this,t)}finally{this.co(e)}return s}Lo(){let t=new Br(this,this.Zl,this.state);this.Wa(t,4,2);try{this.lo(t,1),this.Oa.sync(this),12===this.Hr.LA(1)&&this.match(12),this.match(30)}catch(e){if(!(e instanceof dr.error.RecognitionException))throw e;t.exception=e,this.Oa.reportError(this,e),this.Oa.rs(this,e)}finally{this.Ka()}return t}ko(){let t=new Ur(this,this.Zl,this.state);this.Wa(t,6,3);var e=0;try{this.lo(t,1),t.key=this.Hr.LT(1),(e=this.Hr.LA(1))-30&-32||!(1<<e-30&63)?t.key=this.Oa.ia(this):(this.Oa.wa(this),this.xs()),this.match(27),this.state=139,this.Fo(0)}catch(e){if(!(e instanceof dr.error.RecognitionException))throw e;t.exception=e,this.Oa.reportError(this,e),this.Oa.rs(this,e)}finally{this.Ka()}return t}}class Tr extends dr.ParserRuleContext{constructor(t,e,r){super(e,r),this.nh=t,this.In=0}Fo(){return this.Ao(Er,0)}accept(t){return t.Vo(this)}}class Er extends dr.ParserRuleContext{constructor(t,e,r){super(e,r),this.nh=t,this.In=1}Mo(t){super.Mo(t)}}class Sr extends Er{constructor(t,e){super(t),super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.Bo(this)}}class Mr extends Er{constructor(t,e){super(t),this._o=null,super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.Uo(this)}}class Ir extends Er{constructor(t,e){super(t),this._o=null,super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.Ho(this)}}class Ar extends Er{constructor(t,e){super(t),super.Mo(e)}Fo(){return this.Ao(Er,0)}accept(t){return t.Go(this)}}class yr extends Er{constructor(t,e){super(t),this.f=null,super.Mo(e)}PARAMETER(){return this.Io(35,0)}Fo=function(t){return this.yo(Er)};accept(t){return t.qo(this)}}class Dr extends Er{constructor(t,e){super(t),super.Mo(e)}accept(t){return t.Jo(this)}}class br extends Er{constructor(t,e){super(t),this._o=null,super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.Xo(this)}}class Cr extends Er{constructor(t,e){super(t),super.Mo(e)}ko=function(t){return this.yo(Ur)};accept(t){return t.$o(this)}}class Rr extends Er{constructor(t,e){super(t),this.Po=null,super.Mo(e)}Fo=function(t){return this.yo(Er)};PARAMETER(){return this.Io(35,0)}accept(t){return t.Wo(this)}}class Or extends Er{constructor(t,e){super(t),super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.jo(this)}}class Fr extends Er{constructor(t,e){super(t),this._o=null,super.Mo(e)}Fo=function(t){return this.yo(Er)};accept(t){return t.Ko(this)}}class kr extends Er{constructor(t,e){super(t),super.Mo(e)}Fo(){return this.Ao(Er,0)}accept(t){return t.zo(this)}}class Lr extends Er{constructor(t,e){super(t),super.Mo(e)}Fo(){return this.Ao(Er,0)}accept(t){return t.Yo(this)}}class _r extends Er{constructor(t,e){super(t),super.Mo(e)}PARAMETER(){return this.Io(35,0)}accept(t){return t.Qo(this)}}class Pr extends Er{constructor(t,e){super(t),this.unit=null,super.Mo(e)}Lo(){return this.Ao(Br,0)}accept(t){return t.Zo(this)}}class Vr extends Er{constructor(t,e){super(t),super.Mo(e)}accept(t){return t.tc(this)}}class Br extends dr.ParserRuleContext{constructor(t,e,r){super(e,r),this.nh=t,this.In=2}accept(t){return t.ec(this)}}class Ur extends dr.ParserRuleContext{constructor(t,e,r){super(e,r),this.nh=t,this.In=3,this.key=null}Fo(){return this.Ao(Er,0)}PARAMETER(){return this.Io(35,0)}accept(t){return t.rc(this)}}class Hr extends K{constructor(){super(),this.IsError=!1,this.ErrorMsg=null}We(t,e,r,s,n,i){this.IsError=!0,this.ErrorMsg=n}}class Gr extends dr.Do.ParseTreeVisitor{Vo(t){return this.pi(t)}Bo(t){return this.pi(t)}Uo(t){return this.pi(t)}Ho(t){return this.pi(t)}Go(t){return this.pi(t)}qo(t){return this.pi(t)}Jo(t){return this.pi(t)}Xo(t){return this.pi(t)}$o(t){return this.pi(t)}Wo(t){return this.pi(t)}jo(t){return this.pi(t)}Ko(t){return this.pi(t)}zo(t){return this.pi(t)}Yo(t){return this.pi(t)}Qo(t){return this.pi(t)}Zo(t){return this.pi(t)}tc(t){return this.pi(t)}ec(t){return this.pi(t)}rc(t){return this.pi(t)}}class qr{get Name(){throw new Error("FIXME")}evaluate(t,e=null){throw new Error("FIXME")}sc(){const t=[];return this.sc(t,!1),t.join("")}sc(t,e){throw new Error("FIXME")}nc(t,e){return t.ToText("Function '{0}' parameter {1} is error!",this.Name,e)}uc(t,e){return t.ToBoolean("Function '{0}' parameter {1} is error!",this.Name,e)}lc(t,e){return t.ToNumber("Function '{0}' parameter {1} is error!",this.Name,e)}hc(t,e){return t.ToArray("Function '{0}' parameter {1} is error!",this.Name,e)}ac(t,e){return t.ToMyDate("Function '{0}' parameter {1} is error!",this.Name,e)}oc(t){return P.Error("Function '{0}' parameter {1} is error!",this.Name,t)}cc(){return P.Error("Function '{0}' parameter is error!",this.Name)}fc(){return P.Error("Function '{0}' compare is error.",this.Name)}dc(){return P.Error("Function '{0}' Div 0 error!",this.Name)}}class Jr extends qr{constructor(t){super(),Array.isArray(t)?this.a=t[0]:this.a=t}sc(t,e){this.wc(t,this.Name)}wc(t,e){t.push(e),t.push("("),this.a.sc(t,!1),t.push(")")}gc(t,e){let r=this.a.evaluate(t,e);return r.IsText?r:this.nc(r,1)}mc(t,e){let r=this.a.evaluate(t,e);return r.IsNumber?r:this.lc(r,1)}vc(t,e){let r=this.a.evaluate(t,e);return r.IsDate?r:this.ac(r,1)}Nc(t,e){let r=this.a.evaluate(t,e);return r.IsBoolean?r:this.uc(r,1)}xc(t,e){let r=this.a.evaluate(t,e);return r.IsArray?r:this.hc(r,1)}evaluate(t,e=null){throw new Error("FIXME")}}class Xr extends Jr{constructor(t,e){Array.isArray(t)?(super(t[0]),this.b=null,t.length>=2&&(this.b=t[1])):(super(t),this.b=e)}wc(t,e){t.push(e),t.push("("),this.a.sc(t,!1),null!=this.b&&(t.push(", "),this.b.sc(t,!1)),t.push(")")}Tc(t,e){let r=this.b.evaluate(t,e);return r.IsText?r:this.nc(r,2)}Ec(t,e){let r=this.b.evaluate(t,e);return r.IsNumber?r:this.lc(r,2)}Sc(t,e){let r=this.b.evaluate(t,e);return r.IsDate?r:this.ac(r,2)}Mc(t,e){let r=this.b.evaluate(t,e);return r.IsBoolean?r:this.uc(r,2)}Ic(t,e){let r=this.b.evaluate(t,e);return r.IsArray?r:this.hc(r,2)}evaluate(t,e=null){throw new Error("FIXME")}}class $r extends Xr{get Name(){return"*"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError||1===r.NumberValue?s:1===s.NumberValue?r:P.Create(r.NumberValue*s.NumberValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!0),t.append(" * "),this.b.sc(t,!0),e&&t.append(")")}}class Wr extends Xr{get Name(){return"/"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:0===s.NumberValue?this.dc():1===s.NumberValue?r:P.Create(r.NumberValue/s.NumberValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!0),t.append(" / "),this.b.sc(t,!0),e&&t.append(")")}}class jr extends Xr{get Name(){return"%"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:0===s.NumberValue?this.dc():P.Create(r.NumberValue%s.NumberValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!0),t.append(" % "),this.b.sc(t,!0),e&&t.append(")")}}class Kr extends Xr{get Name(){return"+"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:P.Create(r.NumberValue+s.NumberValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!1),t.append(" + "),this.b.sc(t,!1),e&&t.append(")")}}class zr extends Xr{get Name(){return"-"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:0===s.NumberValue?r:P.Create(r.NumberValue-s.NumberValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!1),t.append(" - "),this.b.sc(t,!1),e&&t.append(")")}}class Yr extends Xr{get Name(){return"&"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);return s.IsError?s:P.Create(r.TextValue+s.TextValue)}sc(t,e){e&&t.append("("),this.a.sc(t,!1),t.append(" & "),this.b.sc(t,!1),e&&t.append(")")}}class Qr extends Xr{constructor(t){super(t)}get Name(){return"=="}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue===s.NumberValue):r.IsText?P.Create(r.TextValue===s.TextValue):r.IsBoolean?P.Create(r.BooleanValue===s.BooleanValue):r.IsDate?P.Create(r.DateValue.ToLong()===s.DateValue.ToLong()):r.IsNull?P.True:this.fc():r.IsNull||s.IsNull?P.False:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue===s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" == "),this.b.sc(t,!1),e&&t.push(")")}}class Zr extends Xr{constructor(t){super(t)}get Name(){return"<"}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue<s.NumberValue):r.IsText?r.TextValue.localeCompare(s.TextValue,void 0,{Ac:!0,yc:"base"})<0?P.True:P.False:r.IsDate?P.Create(r.DateValue.ToLong()<s.DateValue.ToLong()):r.IsBoolean?(r=r.ToNumber(),s=s.ToNumber(),P.Create(r.NumberValue<s.NumberValue)):r.IsNull?P.True:this.fc():r.IsNull||s.IsNull?P.False:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue<s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" < "),this.b.sc(t,!1),e&&t.push(")")}}class ts extends Xr{constructor(t){super(t)}get Name(){return"<="}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue<=s.NumberValue):r.IsText?r.TextValue.localeCompare(s.TextValue,void 0,{Ac:!0,yc:"base"})<=0?P.True:P.False:r.IsDate?P.Create(r.DateValue.ToLong()<=s.DateValue.ToLong()):r.IsBoolean?(r=r.ToNumber(),s=s.ToNumber(),P.Create(r.NumberValue<=s.NumberValue)):r.IsNull?P.True:this.fc():r.IsNull||s.IsNull?P.False:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue<=s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" <= "),this.b.sc(t,!1),e&&t.push(")")}}class es extends Xr{constructor(t){super(t)}get Name(){return">"}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue>s.NumberValue):r.IsText?r.TextValue.localeCompare(s.TextValue,void 0,{Ac:!0,yc:"base"})>0?P.True:P.False:r.IsDate?P.Create(r.DateValue.ToLong()>s.DateValue.ToLong()):r.IsBoolean?(r=r.ToNumber(),s=s.ToNumber(),P.Create(r.NumberValue>s.NumberValue)):r.IsNull?P.True:this.fc():r.IsNull||s.IsNull?P.False:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue>s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" > "),this.b.sc(t,!1),e&&t.push(")")}}class rs extends Xr{constructor(t){super(t)}get Name(){return">="}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue>=s.NumberValue):r.IsText?r.TextValue.localeCompare(s.TextValue,void 0,{Ac:!0,yc:"base"})>=0?P.True:P.False:r.IsDate?P.Create(r.DateValue.ToLong()>=s.DateValue.ToLong()):r.IsBoolean?(r=r.ToNumber(),s=s.ToNumber(),P.Create(r.NumberValue>=s.NumberValue)):r.IsNull?P.True:this.fc():r.IsNull||s.IsNull?P.False:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue>=s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" >= "),this.b.sc(t,!1),e&&t.push(")")}}class ss extends Xr{constructor(t){super(t)}get Name(){return"!="}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);return s.IsError?s:r.Type===s.Type?r.IsNumber?P.Create(r.NumberValue!==s.NumberValue):r.IsText?P.Create(r.TextValue!==s.TextValue):r.IsBoolean?P.Create(r.BooleanValue!==s.BooleanValue):r.IsDate?P.Create(r.DateValue.ToLong()!==s.DateValue.ToLong()):r.IsNull?P.False:this.fc():r.IsNull||s.IsNull?P.True:r.IsDate||s.IsDate||r.IsJson||s.IsJson||r.IsArray||s.IsArray||r.IsArrayJson||s.IsArrayJson?this.fc():(r=this.lc(r,1),r.IsError?r:(s=this.lc(s,2),s.IsError?s:P.Create(r.NumberValue!==s.NumberValue)))}sc(t,e){e&&t.push("("),this.a.sc(t,!1),t.push(" != "),this.b.sc(t,!1),e&&t.push(")")}}class ns extends Xr{get Name(){return"And"}constructor(t){super(t)}evaluate(t,e){let r=this.Nc(t,e);if(r.IsError)return r;if(!1===r.BooleanValue){let r=this.Mc(t,e);return r.IsError?r:P.False}return this.Mc(t,e)}sc(t,e){e&&t.append("("),this.a.sc(t,!1),t.append(" && "),this.b.sc(t,!1),e&&t.append(")")}}class is extends Xr{get Name(){return"Or"}constructor(t){super(t)}evaluate(t,e){let r=this.Nc(t,e);if(r.IsError)return r;if(r.BooleanValue){let r=this.Mc(t,e);return r.IsError?r:P.True}return this.Mc(t,e)}sc(t,e){e&&t.append("("),this.a.sc(t,!1),t.append(" || "),this.b.sc(t,!1),e&&t.append(")")}}class us extends qr{constructor(t){super(),this.z=t}sc(t,e){this.wc(t,this.Name)}wc(t,e){t.push(e),t.push("(");for(let e=0;e<this.z.length;e++)e>0&&t.push(", "),this.z[e].sc(t,!1);t.push(")")}br(t,e,r){let s=this.z[r].evaluate(t,e);return s.IsText?s:this.nc(s,r)}Dc(t,e,r){let s=this.z[r].evaluate(t,e);return s.IsNumber?s:this.lc(s,r)}getDate(t,e,r){let s=this.z[r].evaluate(t,e);return s.IsDate?s:this.ac(s,r)}bc(t,e,r){let s=this.z[r].evaluate(t,e);return s.IsBoolean?s:this.uc(s,r)}Cc(t,e,r){let s=this.z[r].evaluate(t,e);return s.IsArray?s:this.hc(s,r)}evaluate(t,e=null){throw new Error("FIXME")}}class ls extends Jr{get Name(){return"Not"}constructor(t){super(t)}evaluate(t,e){let r=this.Nc(t,e);return r.IsError?r:r.BooleanValue?P.False:P.True}}class hs extends qr{get Name(){return"Value"}constructor(t,e){super(),this._e=t,this.Rc=e}evaluate(t,e){return this._e}sc(t,e){if(null==this.Rc||""===this.Rc)if(this._e.IsText){t.append('"');let e=this._e.TextValue;e=e.replace(/\\/g,"\\\\"),e=e.replace(/\r/g,"\\r"),e=e.replace(/\n/g,"\\n"),e=e.replace(/\t/g,"\\t"),e=e.replace(/\0/g,"\\0"),e=e.replace(/\v/g,"\\v"),e=e.replace(/\a/g,"\\a"),e=e.replace(/\b/g,"\\b"),e=e.replace(/\f/g,"\\f"),e=e.replace(/"/g,'\\"'),t.append(e),t.append('"')}else this._e.IsDate?(t.append('"'),t.append(this._e.DateValue.toString()),t.append('"')):this._e.IsBoolean?t.append(this._e.BooleanValue?"true":"false"):t.append(this._e.toString());else t.append(this.Rc)}}class as extends Jr{get Name(){return"Value"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsNumber)return r;if(r.Oc)return r.BooleanValue?P.Fc:P.kc;if(r=r.ToText(this.cc,"Value"),r.IsError)return r;let s=r.TextValue,n=parseFloat(s);return isNaN(n)?P.Error(this.cc,"Value"):P.Create(n)}}class os extends Jr{get Name(){return"Abs"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.abs(r.NumberValue))}}class cs extends Xr{get Name(){return"Quotient"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:0==s.NumberValue?this.dc():P.Create(Math.trunc(r.NumberValue/s.NumberValue))}}class fs extends Jr{get Name(){return"Sign"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.sign(r.NumberValue))}}class ds extends Jr{get Name(){return"Sqrt"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:r.NumberValue<0?this.oc(1):P.Create(Math.sqrt(r.NumberValue))}}class ws extends Jr{get Name(){return"Trunc"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.trunc(r.NumberValue))}}class gs extends us{get Name(){return"Gcd"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s=0;s<this.z.length;s++){let n=this.Dc(t,e,s);if(n.IsError)return n;r.push(n)}let s=[];for(let t of r){if(!t.IsNumber)return this.cc();s.push(t.NumberValue)}return P.Create(this.Lc(s))}Lc(t){return t.reduce((t,e)=>((t,e)=>{for(t=Math.abs(t),e=Math.abs(e);0!==e;){let r=e;e=t%e,t=r}return t})(t,e),t[0])}}class ps extends us{get Name(){return"Lcm"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s=0;s<this.z.length;s++){let n=this.Dc(t,e,s);if(n.IsError)return n;r.push(n)}let s=[];for(let t of r){if(!t.IsNumber)return this.cc();s.push(t.NumberValue)}return P.Create(this._c(s))}_c(t){return t.reduce((t,e)=>{return r=t,s=e,Math.abs(r*s)/((t,e)=>{for(t=Math.abs(t),e=Math.abs(e);0!==e;){let r=e;e=t%e,t=r}return t})(r,s);var r,s},t[0])}}class ms extends Xr{get Name(){return"Combin"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.IntValue,i=s.IntValue;if(n<0||i<0||n<i)return this.oc(1);let u=1,l=1;for(let t=0;t<i;t++)u*=n-t,l*=t+1;return P.Create(u/l)}}class vs extends Xr{get Name(){return"Permut"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.NumberValue,i=s.NumberValue;if(n<0||i<0)return this.oc(1);if(n<i)return this.oc(2);if(0==i)return P.Create(1);let u=1;for(let t=0;t<i;t++)u*=n-t;return P.Create(u)}}class Ns extends Jr{get Name(){return"Percentage"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(r.NumberValue/100)}}class xs extends Jr{get Name(){return"Degrees"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue/Math.PI*180;return P.Create(s)}}class Ts extends Jr{get Name(){return"Radians"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue/180*Math.PI;return P.Create(s)}}class Es extends Jr{get Name(){return"Cos"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.cos(r.DoubleValue))}}class Ss extends Jr{get Name(){return"Cosh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.cosh(r.DoubleValue))}}class Ms extends Jr{get Name(){return"Sin"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.sin(r.DoubleValue))}}class Is extends Jr{get Name(){return"Sinh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.sinh(r.DoubleValue))}}class As extends Jr{get Name(){return"Tan"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.tan(r.DoubleValue))}}class ys extends Jr{get Name(){return"Tanh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.tanh(r.DoubleValue))}}class Ds extends Jr{get Name(){return"Acos"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return s<-1||s>1?this.cc():P.Create(Math.acos(s))}}class bs extends Jr{get Name(){return"Acosh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return s<1?this.cc():P.Create(Math.acosh(s))}}class Cs extends Jr{get Name(){return"Asin"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return s<-1||s>1?this.cc():P.Create(Math.asin(s))}}class Rs extends Jr{get Name(){return"Asinh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.asinh(r.DoubleValue))}}class Os extends Jr{get Name(){return"Atan"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.atan(r.DoubleValue))}}class Fs extends Jr{get Name(){return"Atanh"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return s>=1||s<=-1?this.cc():P.Create(Math.atanh(s))}}class ks extends Xr{get Name(){return"Atan2"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:P.Create(Math.atan2(r.NumberValue,s.NumberValue))}}class Ls extends Xr{constructor(t){super(t),this.c=null,t.length>=3&&(this.c=t[2])}wc(t,e){t.push(e),t.push("("),this.a.sc(t,!1),null!=this.b&&(t.push(", "),this.b.sc(t,!1),null!=this.c&&(t.push(", "),this.c.sc(t,!1))),t.push(")")}Pc(t,e){let r=this.c.evaluate(t,e);return r.IsText?r:this.nc(r,3)}Vc(t,e){let r=this.c.evaluate(t,e);return r.IsNumber?r:this.lc(r,3)}Bc(t,e){let r=this.c.evaluate(t,e);return r.IsDate?r:this.ac(r,3)}Uc(t,e){let r=this.c.evaluate(t,e);return r.IsBoolean?r:this.uc(r,3)}Hc(t,e){let r=this.c.evaluate(t,e);return r.IsArray?r:this.hc(r,3)}evaluate(t,e=null){throw new Error("FIXME")}}class _s extends Ls{get Name(){return"Fixed"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=2;if(null!==this.b&&void 0!==this.b){let r=this.Ec(t,e);if(r.IsError)return r;s=r.IntValue}let n=Math.round(r.NumberValue*Math.pow(10,s))/Math.pow(10,s),i=!1;if(null!==this.c&&void 0!==this.c){let r=this.Uc(t,e);if(r.IsError)return r;i=r.BooleanValue}if(!1===i){let t=n.toFixed(s).split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),P.Create(t.join("."))}return P.Create(n.toString())}}class Ps extends Xr{get Name(){return"Bin2Oct"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[01]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,2).toString(8);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Vs extends Jr{get Name(){return"Bin2Dec"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[01]+$/.test(r.TextValue))return this.cc();let s=parseInt(r.TextValue,2);return P.Create(s)}}class Bs extends Xr{get Name(){return"Bin2Hex"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[01]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,2).toString(16).toUpperCase();if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Us extends Xr{get Name(){return"Oct2Bin"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-7]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,8).toString(2);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Hs extends Jr{get Name(){return"Oct2Dec"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-7]+$/.test(r.TextValue))return this.cc();let s=parseInt(r.TextValue,8);return P.Create(s)}}class Gs extends Xr{get Name(){return"Oct2Hex"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-7]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,8).toString(16).toUpperCase();if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class qs extends Xr{get Name(){return"Dec2Bin"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.IntValue.toString(2);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Js extends Xr{get Name(){return"Dec2Oct"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.IntValue.toString(8);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Xs extends Xr{get Name(){return"Dec2Hex"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.IntValue.toString(16).toUpperCase();if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class $s extends Xr{get Name(){return"Hex2Bin"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-9A-Fa-f]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,16).toString(2);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class Ws extends Xr{get Name(){return"Hex2Oct"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-9A-Fa-f]+$/.test(r.TextValue))return this.oc(1);let s=parseInt(r.TextValue,16).toString(8);if(null!=this.b){let r=this.Ec(t,e);return r.IsError?r:s.length>r.IntValue?P.Create(s.padStart(r.IntValue,"0")):this.oc(2)}return P.Create(s)}}class js extends Jr{get Name(){return"Hex2Dec"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!/^[0-9A-Fa-f]+$/.test(r.TextValue))return this.cc();let s=parseInt(r.TextValue,16);return P.Create(s)}}class Ks extends Xr{get Name(){return"Round"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;if(null===this.b)return P.Create(Math.round(r.NumberValue));let s=this.Ec(t,e);if(s.IsError)return s;let n=s.IntValue,i=Math.pow(10,n);return P.Create(Math.round(r.NumberValue*i)/i)}}class zs extends Xr{get Name(){return"RoundDown"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;if(0==r.NumberValue)return r;let n=Math.pow(10,s.IntValue),i=r.NumberValue,u=i>=0?Math.floor(i*n)/n:Math.ceil(i*n)/n;return P.Create(u)}}class Ys extends Xr{get Name(){return"RoundUp"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;if(0==r.NumberValue)return r;let n=Math.pow(10,s.IntValue),i=r.NumberValue,u=Math.ceil(Math.abs(i)*n)/n;return i>0?P.Create(u):P.Create(-u)}}class Qs extends Xr{get Name(){return"Ceiling"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;if(null===this.b||void 0===this.b)return P.Create(Math.ceil(r.NumberValue));let s=this.Ec(t,e);if(s.IsError)return s;let n=s.NumberValue;if(0==n)return P.Zero;if(n<0)return this.oc(2);let i=r.NumberValue,u=Math.ceil(i/n)*n;return P.Create(u)}}class Zs extends Xr{get Name(){return"Floor"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;if(null===this.b||void 0===this.b)return P.Create(Math.floor(r.NumberValue));let s=this.Ec(t,e);if(s.IsError)return s;let n=s.NumberValue;if(0==n)return P.Zero;let i=r.NumberValue,u=Math.floor(i/n)*n;return P.Create(u)}}class tn extends Jr{get Name(){return"Even"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.NumberValue;return 0==s?P.Zero:s>0?P.Create(2*Math.ceil(s/2)):P.Create(2*Math.floor(s/2))}}class en extends Jr{get Name(){return"Odd"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.NumberValue;return 0==s?P.Create(1):s>0?P.Create(2*Math.ceil(s/2)-1):P.Create(2*Math.floor(s/2)+1)}}class rn extends Xr{get Name(){return"Mround"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=s.NumberValue;if(n<=0)return this.oc(2);let i=r.NumberValue,u=Math.round(i/n)*n;return P.Create(u)}}class sn extends qr{get Name(){return"Rand"}constructor(){super()}evaluate(t,e){return P.Create(Math.random())}}class nn extends Xr{get Name(){return"RandBetween"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);return s.IsError?s:P.Create(Math.random()*(s.NumberValue-r.NumberValue)+r.NumberValue)}}class un extends Xr{get Name(){return"Covariances"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;let n=[],i=[],u=L.Me(r,n),l=L.Me(s,i);if(0==u)return this.oc(1);if(0==l)return this.oc(2);if(n.length!=i.length)return P.Error("Function '{0}' parameter's count error!","CovarIanceS");if(1==n.length)return P.Error("Function '{0}' parameter's count error!","CovarIanceS");let h=n.reduce((t,e)=>t+e,0)/n.length,a=i.reduce((t,e)=>t+e,0)/i.length,o=0;for(let t=0;t<n.length;t++)o+=(n[t]-h)*(i[t]-a);let c=o/(n.length-1);return P.Create(c)}}class ln extends Xr{get Name(){return"Covar"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;let n=[],i=[],u=L.Me(r,n),l=L.Me(s,i);if(0==u)return this.oc(1);if(0==l)return this.oc(2);if(n.length!=i.length)return P.Error("Function '{0}' parameter's count error!","Covar");if(0==n.length)return P.Error("Function '{0}' parameter's count error!","Covar");let h=n.reduce((t,e)=>t+e,0)/n.length,a=i.reduce((t,e)=>t+e,0)/i.length,o=0;for(let t=0;t<n.length;t++)o+=(n[t]-h)*(i[t]-a);let c=o/n.length;return P.Create(c)}}class hn extends Jr{get Name(){return"Fact"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.IntValue;if(s<0)return this.cc();let n=1;for(let t=1;t<=s;t++)n*=t;return P.Create(n)}}class an extends Jr{get Name(){return"FactDouble"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.IntValue;if(s<0)return this.cc();let n=1;for(let t=s;t>0;t-=2)n*=t;return P.Create(n)}}class on extends Xr{get Name(){return"Power"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.NumberValue,i=s.NumberValue;return P.Create(Math.pow(n,i))}}class cn extends Jr{get Name(){return"Exp"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.exp(r.NumberValue))}}class fn extends Jr{get Name(){return"Ln"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.NumberValue;return s<=0?this.oc(1):P.Create(Math.log(s))}}class dn extends Xr{get Name(){return"Log"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;if(null===this.b||void 0===this.b)return P.Create(Math.log10(r.NumberValue));let s=this.Ec(t,e);return s.IsError?s:P.Create(Math.log(r.NumberValue)/Math.log(s.NumberValue))}}class wn extends Jr{get Name(){return"Log10"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.log10(r.NumberValue))}}class gn extends us{get Name(){return"Multinomial"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];for(let t of r){if(t.IsNotNumber)return this.cc();s.push(t.NumberValue)}let n=0,i=1;for(let t=0;t<s.length;t++){let e=Math.floor(s[t]);i*=this.Gc(e),n+=e}let u=this.Gc(n)/i;return P.Create(u)}Gc(t){if(t<=1)return 1;let e=1;for(let r=2;r<=t;r++)e*=r;return e}}class pn extends us{get Name(){return"Product"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s=0;s<this.z.length;s++){let n=this.Dc(t,e,s);if(n.IsError)return n;r.push(n)}let s=[];for(let t of r){if(!t.IsNumber)return this.cc();s.push(t.NumberValue)}let n=1;for(let t=0;t<s.length;t++)n*=s[t];return P.Create(n)}}class mn extends Jr{get Name(){return"SqrtPi"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(Math.sqrt(r.NumberValue*Math.PI))}}class vn extends us{get Name(){return"SumSq"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s=0;s<this.z.length;s++){let n=this.z[s].evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();let n=0;for(let t=0;t<s.length;t++){let e=s[t];n+=e*e}return P.Create(n)}}class Nn extends Jr{get Name(){return"ASC"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(this.qc(r.TextValue))}qc(t){let e=!1;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(12288===s||s>65280&&s<65375){e=!0;break}}if(!e)return t;let r=[];for(let e=0;e<t.length;e++){let s=t.charCodeAt(e);12288===s?r.push(String.fromCharCode(32)):s>65280&&s<65375?r.push(String.fromCharCode(s-65248)):r.push(t[e])}return r.join("")}}class xn extends Jr{get Name(){return"JIS"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(this.Jc(r.TextValue))}Jc(t){let e=!1;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(32===s||s<127){e=!0;break}}if(!e)return t;let r=[];for(let e=0;e<t.length;e++){let s=t.charCodeAt(e);32===s?r.push(String.fromCharCode(12288)):s<127?r.push(String.fromCharCode(s+65248)):r.push(t[e])}return r.join("")}}class Tn extends Jr{get Name(){return"Char"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=String.fromCharCode(r.IntValue);return P.Create(s)}}class En extends Jr{get Name(){return"Clean"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue,n=!1;for(let t=0;t<s.length;t++){let e=s[t];if("\f"===e||"\n"===e||"\r"===e||"\t"===e||"\v"===e){n=!0;break}}if(!n)return r;let i="";for(let t=0;t<s.length;t++){let e=s[t];"\f"!==e&&"\n"!==e&&"\r"!==e&&"\t"!==e&&"\v"!==e&&(i+=e)}return P.Create(i)}}class Sn extends Jr{get Name(){return"CODE"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(!r.TextValue)return P.Error(this.cc,"CODE");let s=r.TextValue[0];return P.Create(s.charCodeAt(0))}}class Mn extends us{get Name(){return"Concatenate"}constructor(t){super(t)}evaluate(t,e){if(0===this.z.length)return P.Create("");if(1===this.z.length){let r=this.z[0].evaluate(t,e);return r.ToText(this.cc,"Concatenate",1),r.IsError,r}let r="";for(let s=0;s<this.z.length;s++){let n=this.z[s].evaluate(t,e);if(n.ToText(this.cc,"Concatenate",s+1),n.IsError)return n;r+=n.TextValue}return P.Create(r)}}class In extends Xr{get Name(){return"EXACT"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);return s.IsError?s:P.Create(r.TextValue===s.TextValue)}}class An extends Ls{get Name(){return"Find"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;if(null===this.c||void 0===this.c){let e=s.TextValue.indexOf(r.TextValue)+t.ExcelIndex;return P.Create(e)}let n=this.Vc(t,e);if(n.IsError)return n;let i=s.TextValue.indexOf(r.TextValue,n.IntValue)+n.IntValue+t.ExcelIndex;return P.Create(i)}}class yn extends Xr{get Name(){return"Left"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(0===r.TextValue.length)return P.Create("");if(null===this.b)return P.Create(r.TextValue.substring(0,1));let s=this.Ec(t,e);if(s.IsError)return s;let n=Math.min(s.IntValue,r.TextValue.length);return P.Create(r.TextValue.substring(0,n))}}class Dn extends Jr{get Name(){return"Len"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(r.TextValue.length)}}class bn extends Jr{get Name(){return"Lower"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(r.TextValue.toLowerCase())}}class Cn extends Ls{get Name(){return"Mid"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=s.IntValue-t.ExcelIndex,u=n.IntValue;return P.Create(r.TextValue.substring(i,i+u))}}class Rn extends Jr{get Name(){return"Proper"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue;if(0===s.length)return P.Create(s);let n=!1,i=!0;for(let t=0;t<s.length;t++){let e=s[t];if(" "===e||"\r"===e||"\n"===e||"\t"===e||"."===e)i=!0;else if(i){if(e===e.toLowerCase()&&e!==e.toUpperCase()){n=!0;break}i=!1}}if(!n)return r;let u=s.split("");i=!0;for(let t=0;t<u.length;t++){let e=u[t];" "===e||"\r"===e||"\n"===e||"\t"===e||"."===e?i=!0:i&&(u[t]=e.toUpperCase(),i=!1)}return P.Create(u.join(""))}}class On extends Ls{constructor(t){super(t),this.d=null,t.length>=4&&(this.d=t[3])}wc(t,e){t.push(e),t.push("("),this.a.sc(t,!1),null!=this.b&&(t.push(", "),this.b.sc(t,!1),null!=this.c&&(t.push(", "),this.c.sc(t,!1),null!=this.d&&(t.push(", "),this.d.sc(t,!1)))),t.push(")")}Xc(t,e){let r=this.d.evaluate(t,e);return r.IsText?r:this.nc(r,4)}$c(t,e){let r=this.d.evaluate(t,e);return r.IsNumber?r:this.lc(r,4)}Wc(t,e){let r=this.d.evaluate(t,e);return r.IsDate?r:this.ac(r,4)}jc(t,e){let r=this.d.evaluate(t,e);return r.IsBoolean?r:this.uc(r,4)}Kc(t,e){let r=this.d.evaluate(t,e);return r.IsArray?r:this.hc(r,4)}evaluate(t,e=null){throw new Error("FIXME")}}class Fn extends On{get Name(){return"Replace"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue;if(null===this.d||void 0===this.d){let r=this.b.evaluate(t,e).ToText("Function '{0}' parameter {1} is error!",this.Name,2);if(r.IsError)return r;let n=this.c.evaluate(t,e).ToText("Function '{0}' parameter {1} is error!",this.Name,3);if(n.IsError)return n;let i=r.TextValue,u=n.TextValue;return P.Create(s.replace(new RegExp(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),u))}let n=this.Ec(t,e);if(n.IsError)return n;let i=this.Vc(t,e);if(i.IsError)return i;let u=this.Xc(t,e);if(u.IsError)return u;let l=n.IntValue-t.ExcelIndex,h=i.IntValue,a=u.TextValue,o="";for(let t=0;t<s.length;t++)t<l?o+=s[t]:t===l?o+=a:t>=l+h&&(o+=s[t]);return P.Create(o)}}class kn extends Xr{get Name(){return"Rept"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.TextValue,i=s.IntValue;if(i<0)return P.Error(this.cc,"Rept",2);if(0===i)return P.Create("");let u="";for(let t=0;t<i;t++)u+=n;return P.Create(u)}}class Ln extends Xr{get Name(){return"Right"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(0===r.TextValue.length)return P.Create("");if(null===this.b)return P.Create(r.TextValue.substring(r.TextValue.length-1,r.TextValue.length));let s=this.Ec(t,e);if(s.IsError)return s;let n=Math.min(s.IntValue,r.TextValue.length),i=r.TextValue.length-n;return P.Create(r.TextValue.substring(i,i+n))}}class _n extends Jr{get Name(){return"RMB"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create(this.zc(r.NumberValue))}zc(t){if(0===t)return"零元";let e=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=["","拾","佰","仟"],s=["","万","亿","兆"],n=["角","分"],i="",u=Math.floor(t),l=Math.round(100*(t-u));if(u<0&&(i="负",u=-u),0===u)i+="零";else{let t=0;for(;u>0;){let n=u%1e4;if(n>0){let u="",l=n,h=0;for(;l>0;){let t=l%10;t>0?u=e[t]+r[h]+u:u&&!u.startsWith("零")&&(u="零"+u),l=Math.floor(l/10),h++}i=u+s[t]+i}u=Math.floor(u/1e4),t++}}if(i+="元",0===l)i+="整";else{let t=Math.floor(l/10),r=l%10;t>0?i+=e[t]+n[0]:r>0&&(i+="零"),r>0&&(i+=e[r]+n[1])}return i}}class Pn extends Ls{get Name(){return"Search"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;if(null===this.c||void 0===this.c){let e=s.TextValue.toLowerCase().indexOf(r.TextValue.toLowerCase())+t.ExcelIndex;return P.Create(e)}let n=this.Vc(t,e);if(n.IsError)return n;let i=n.IntValue-t.ExcelIndex,u=s.TextValue.toLowerCase().indexOf(r.TextValue.toLowerCase(),i)+t.ExcelIndex;return P.Create(u)}}class Vn extends On{get Name(){return"Substitute"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=this.Pc(t,e);if(n.IsError)return n;if(null===this.d||void 0===this.d)return P.Create(r.TextValue.replace(new RegExp(s.TextValue.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),n.TextValue));let i=this.$c(t,e);if(i.IsError)return i;let u=r.TextValue,l=s.TextValue,h=n.TextValue,a=i.IntValue,o=0,c="";for(let t=0;t<u.length;t++){let e=!0;for(let r=0;r<l.length;r++){if(t+r>=u.length){e=!1;break}if(u[t+r]!==l[r]){e=!1;break}}e&&o++,e&&o===a?(c+=h,t+=l.length-1):c+=u[t]}return P.Create(c)}}class Bn extends Jr{get Name(){return"T"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return r.IsText?r:P.Create("")}}class Un extends Xr{get Name(){return"Text"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;if(r.IsText)return r;if(r.IsBoolean)return P.Create(r.BooleanValue?"TRUE":"FALSE");if(r.IsNumber){let t=s.TextValue,e=r.NumberValue;if(t.includes("0")){let r=t.indexOf(".");if(-1!==r){let s=t.substring(r+1).length;return P.Create(e.toFixed(s))}return P.Create(Math.round(e).toString())}return P.Create(e.toString())}if(r.IsDate)return P.Create(r.DateValue.toString());let n=r.ToText(this.cc,"Text",1);return n.IsError?n:P.Create(n.TextValue.toString())}}class Hn extends Jr{get Name(){return"Trim"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(r.TextValue.trim())}}class Gn extends Jr{get Name(){return"Upper"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Create(r.TextValue.toUpperCase())}}class qn extends us{get Name(){return"DateValue"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}if(r[0].IsDate)return r[0];let s=0;if(2==r.length){let t=r[1].ToNumber(StringCache.Function_parameter_error,"DateValue",2);if(t.IsError)return t;s=t.IntValue}if(0==s){if(r[0].IsText){let t=new Date(r[0].TextValue);if(!isNaN(t.getTime()))return P.Create(new _(t))}let e=r[0].ToNumber(StringCache.Function_parameter_error,"DateValue",1);if(e.IntValue<=2958465)return e.ToMyDate();if(e.IntValue<=253402232399){let r=new Date(Date.UTC(1970,0,1,0,0,0)+1e3*e.IntValue);return t.UseLocalTime?P.Create(new _(new Date(r.getTime()+6e4*r.getTimezoneOffset()))):P.Create(new _(r))}let s=new Date(Date.UTC(1970,0,1,0,0,0)+e.IntValue);return t.UseLocalTime?P.Create(new _(new Date(s.getTime()+6e4*s.getTimezoneOffset()))):P.Create(new _(s))}if(1==s){let t=r[0].ToText(StringCache.Function_parameter_error,"DateValue",1);if(t.IsError)return t;let e=new Date(t.TextValue);if(!isNaN(e.getTime()))return P.Create(new _(e))}else{if(2==s)return r[0].ToNumber(StringCache.Function_parameter_error,"DateValue").ToMyDate();if(3==s){let e=r[0].ToNumber(StringCache.Function_parameter_error,"DateValue",1),s=new Date(Date.UTC(1970,0,1,0,0,0)+e.IntValue);return t.UseLocalTime?P.Create(new _(new Date(s.getTime()+6e4*s.getTimezoneOffset()))):P.Create(new _(s))}if(4==s){let e=r[0].ToNumber(StringCache.Function_parameter_error,"DateValue",1),s=new Date(Date.UTC(1970,0,1,0,0,0)+1e3*e.IntValue);return t.UseLocalTime?P.Create(new _(new Date(s.getTime()+6e4*s.getTimezoneOffset()))):P.Create(new _(s))}}return this.cc()}}class Jn extends Xr{get Name(){return"Timestamp"}constructor(t){super(t)}evaluate(t,e){let r=0;if(null!=this.b){let s=this.Ec(t,e);if(s.IsError)return s;r=s.IntValue}let s=this.vc(t,e);if(s.IsError)return s;let n=s.DateValue.ToDateTime().valueOf();return t.UseLocalTime&&(n+=new Date(1970,0,1,0,0,0,0).valueOf()),0===r?P.Create(n):P.Create(n/1e3)}}class Xn extends Jr{get Name(){return"TimeValue"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;try{let t=r.TextValue.split(":");if(t.length>=2){let e=parseInt(t[0],10),r=parseInt(t[1],10),s=0;t.length>=3&&(s=parseInt(t[2],10));let n=new _(0,0,0,e,r,s);return P.Create(n)}}catch(t){}return this.cc()}}class $n extends us{get Name(){return"Date"}constructor(t){super(t)}evaluate(t,e){let r=this.Dc(t,e,0);if(r.IsError)return r;let s=this.Dc(t,e,1);if(s.IsError)return s;let n,i=this.Dc(t,e,2);if(i.IsError)return i;if(3==this.z.length)n=new _(r.IntValue,s.IntValue,i.IntValue,0,0,0);else if(4==this.z.length){let u=this.Dc(t,e,3);if(u.IsError)return u;n=new _(r.IntValue,s.IntValue,i.IntValue,u.IntValue,0,0)}else if(5==this.z.length){let u=this.Dc(t,e,3);if(u.IsError)return u;let l=this.Dc(t,e,4);if(l.IsError)return l;n=new _(r.IntValue,s.IntValue,i.IntValue,u.IntValue,l.IntValue,0)}else{let u=this.Dc(t,e,3);if(u.IsError)return u;let l=this.Dc(t,e,4);if(l.IsError)return l;let h=this.Dc(t,e,5);if(h.IsError)return h;n=new _(r.IntValue,s.IntValue,i.IntValue,u.IntValue,l.IntValue,h.IntValue)}return P.Create(n)}}class Wn extends Ls{get Name(){return"Time"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s,n=this.Ec(t,e);if(n.IsError)return n;if(null!==this.c){let i=this.Vc(t,e);if(i.IsError)return i;s=new _(0,0,0,r.IntValue,n.IntValue,i.IntValue)}else s=new _(0,0,0,r.IntValue,n.IntValue,0);return P.Create(s)}}class jn extends qr{get Name(){return"Now"}evaluate(t,e){return t.UseLocalTime?P.Create(new _(new Date)):P.Create(new _(new Date(Date.UTC((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate(),(new Date).getHours(),(new Date).getMinutes(),(new Date).getSeconds()))))}sc(t,e){t.push("Now()")}}class Kn extends qr{get Name(){return"Today"}evaluate(t,e){let r;return r=t.UseLocalTime?new Date:new Date(Date.UTC((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate())),P.Create(new _(r.getFullYear(),r.getMonth()+1,r.getDate(),0,0,0))}sc(t,e){t.push("Today()")}}class zn extends Jr{get Name(){return"Year"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:null==r.DateValue.Year?this.cc():P.Create(r.DateValue.Year)}}class Yn extends Jr{get Name(){return"Month"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:null==r.DateValue.Month?this.cc():P.Create(r.DateValue.Month)}}class Qn extends Jr{get Name(){return"Day"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:null==r.DateValue.Day?this.cc():P.Create(r.DateValue.Day)}}class Zn extends Jr{get Name(){return"Hour"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:P.Create(r.DateValue.Hour)}}class ti extends Jr{get Name(){return"Minute"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:P.Create(r.DateValue.Minute)}}class ei extends Jr{get Name(){return"Second"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);return r.IsError?r:P.Create(r.DateValue.Second)}}class ri extends Xr{get Name(){return"Weekday"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=1;if(null!=this.b){let r=this.Ec(t,e);if(r.IsError)return r;s=r.IntValue}let n=r.DateValue.ToDateTime().getDay();return 1==s?P.Create(n+1):2==s?0==n?P.Create(7):P.Create(n):0==n?P.Create(6):P.Create(n-1)}}class si extends Ls{get Name(){return"DateDif"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Sc(t,e);if(s.IsError)return s;let n=this.Pc(t,e);if(n.IsError)return n;let i=r.DateValue,u=s.DateValue,l=i.ToDateTime(),h=u.ToDateTime(),a=n.TextValue.toLowerCase();if("y"===a){let t=!1;return(l.getMonth()<h.getMonth()||l.getMonth()===h.getMonth()&&l.getDate()<=h.getDate())&&(t=!0),t?P.Create(h.getFullYear()-l.getFullYear()):P.Create(h.getFullYear()-l.getFullYear()-1)}if("m"===a){let t=!1;return l.getDate()<=h.getDate()&&(t=!0),t?P.Create(12*h.getFullYear()+h.getMonth()+1-(12*l.getFullYear()+l.getMonth()+1)):P.Create(12*h.getFullYear()+h.getMonth()+1-(12*l.getFullYear()+l.getMonth()+1)-1)}if("d"===a){let t=Math.abs(h.getTime()-l.getTime()),e=Math.ceil(t/864e5);return P.Create(e)}if("yd"===a){let t=t=>{let e=new Date(t.getFullYear(),0,1);return Math.ceil((t.getTime()-e.getTime())/864e5)+1},e=t(h)-t(l);return h.getFullYear()>l.getFullYear()&&e<0&&(e=t(new Date(l.getFullYear(),11,31))+e),P.Create(e)}if("md"===a){let t=h.getDate()-l.getDate();if(t<0){let e;e=11===l.getMonth()?new Date(l.getFullYear()+1,0,0).getDate():new Date(l.getFullYear(),l.getMonth()+1,0).getDate(),t+=e}return P.Create(t)}if("ym"===a){let t=h.getMonth()+1-(l.getMonth()+1);return h.getDate()<l.getDate()&&t--,t<0&&(t+=12),P.Create(t)}return this.oc(3)}}class ni extends Ls{get Name(){return"Days360"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Sc(t,e);if(s.IsError)return s;let n=r.DateValue,i=s.DateValue,u=n.ToDateTime(),l=i.ToDateTime(),h=!1;if(null!==this.c){let r=this.Uc(t,e);if(r.IsError)return r;h=r.BooleanValue}let a=360*l.getFullYear()+30*l.getMonth()-360*u.getFullYear()-30*u.getMonth();return h?(31==l.getDate()&&(a+=30),31==u.getDate()&&(a-=30)):(11==u.getMonth()?u.getDate()==new Date(u.getFullYear()+1,0,0).getDate()?a-=30:a-=u.getDate():u.getDate()==new Date(u.getFullYear(),u.getMonth()+1,0).getDate()?a-=30:a-=u.getDate(),11==l.getMonth()?l.getDate()==new Date(l.getFullYear()+1,0,0).getDate()?u.getDate()<30?a+=31:a+=30:a+=l.getDate():l.getDate()==new Date(l.getFullYear(),l.getMonth()+1,0).getDate()?u.getDate()<30?a+=31:a+=30:a+=l.getDate()),P.Create(a)}}class ii extends Xr{get Name(){return"EDate"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.DateValue.ToDateTime(),i=new Date(n.getFullYear(),n.getMonth(),1);i.setMonth(i.getMonth()+s.IntValue);let u=new Date(i.getFullYear(),i.getMonth()+1,0).getDate(),l=Math.min(n.getDate(),u);return i.setDate(l),P.Create(new _(i))}}class ui extends Xr{get Name(){return"EOMonth"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setMonth(n.getMonth()+s.IntValue+1),n.setDate(0),P.Create(new _(n))}}class li extends us{get Name(){return"NetworkDays"}constructor(t){super(t)}evaluate(t,e){let r=this.getDate(t,e,0);if(r.IsError)return r;let s=this.getDate(t,e,1);if(s.IsError)return s;let n=r.DateValue.ToDateTime(),i=s.DateValue.ToDateTime(),u=new Date(n.getTime()),l=new Date(i.getTime()),h=new Set;for(let r=2;r<this.z.length;r++){let s=this.getDate(t,e,r);if(s.IsError)return s;let n=s.DateValue.ToDateTime().toISOString().split("T")[0];h.add(n)}let a=0;for(;u<=l;){let t=u.getDay();if(0!==t&&6!==t){let t=u.toISOString().split("T")[0];h.has(t)||a++}u.setDate(u.getDate()+1)}return P.Create(a)}}class hi extends us{get Name(){return"Workday"}constructor(t){super(t)}evaluate(t,e){let r=this.getDate(t,e,0);if(r.IsError)return r;let s=this.Dc(t,e,1);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime()),i=s.IntValue,u=new Set;for(let r=2;r<this.z.length;r++){let s=this.getDate(t,e,r);if(s.IsError)return s;let n=s.DateValue.ToDateTime().toISOString().split("T")[0];u.add(n)}for(;i>0;){n.setDate(n.getDate()+1);let t=n.getDay();if(6===t)continue;if(0===t)continue;let e=n.toISOString().split("T")[0];u.has(e)||i--}return P.Create(new _(n))}}class ai extends Xr{get Name(){return"Weeknum"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=r.DateValue.ToDateTime(),n=new Date(s.getFullYear(),0,1),i=n.getDay(),u=Math.ceil((s-n)/864e5)+1+i;if(null!=this.b){let r=this.Ec(t,e);if(r.IsError)return r;2==r.IntValue&&u--}let l=Math.ceil(u/7);return P.Create(l)}}class oi extends Xr{get Name(){return"AddMonths"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setMonth(n.getMonth()+s.IntValue),P.Create(new _(n))}}class ci extends Xr{get Name(){return"AddYears"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setFullYear(n.getFullYear()+s.IntValue),P.Create(new _(n))}}class fi extends Xr{get Name(){return"AddSeconds"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setSeconds(n.getSeconds()+s.IntValue),P.Create(new _(n))}}class di extends Xr{get Name(){return"AddMinutes"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setMinutes(n.getMinutes()+s.IntValue),P.Create(new _(n))}}class wi extends Xr{get Name(){return"AddDays"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setDate(n.getDate()+s.NumberValue),P.Create(new _(n))}}class gi extends Xr{get Name(){return"AddHours"}constructor(t){super(t)}evaluate(t,e){let r=this.vc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=new Date(r.DateValue.ToDateTime().getTime());return n.setHours(n.getHours()+s.IntValue),P.Create(new _(n))}}class pi extends us{get Name(){return"Max"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)?this.cc():P.Create(Math.max(...s))}}class mi extends us{get Name(){return"Median"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)||0==s.length?this.cc():(s.sort((t,e)=>t-e),P.Create(s[Math.floor(s.length/2)]))}}class vi extends us{get Name(){return"Min"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)?this.cc():P.Create(Math.min(...s))}}let Ni=1.4142135623730951,xi=.6207822376352452,Ti=1.8603827342052657;class Ei{static Yc(t,e){if(!e||0===e.length)return 0;let r=e[e.length-1];for(let s=e.length-2;s>=0;--s)r*=t,r+=e[s];return r}static Qc(t){let e,r=0,s=t();do{e=t();let n=e-r,i=s+n;r=i-s,r-=n,s=i}while(Math.abs(s)<Math.abs(65536*e));return s}}let Si={Zc:Math.pow(2,-53),tf:2*Math.pow(2,-53),ef:10*Math.pow(2,-53),rf:function(t){let e=new ArrayBuffer(8),r=new Float64Array(e),s=new BigInt64Array(e);return r[0]=t,s[0]},sf:function(t){let e=new ArrayBuffer(8),r=new BigInt64Array(e),s=new Float64Array(e);return r[0]=t,s[0]},nf:function(t,e=1){if(isNaN(t)||!isFinite(t)||0===e)return t;let r=this.rf(t);return r<0?r-=BigInt(e):r+=BigInt(e),r===BigInt(-0x8000000000000000)?0:this.sf(r)},if:function(t){if(isNaN(t)||!isFinite(t))return NaN;let e=this.rf(t);return 0n===e?(e++,this.sf(e)-t):e<0n?(e--,this.sf(e)-t):(e--,t-this.sf(e))},uf:function(t){return 2*this.if(t)},lf:function(t,e,r,s){return isFinite(t)&&isFinite(e)?!isNaN(t)&&!isNaN(e)&&(Math.abs(t)<this.Zc||Math.abs(e)<this.Zc?Math.abs(r)<s:0===t&&Math.abs(e)<s||0===e&&Math.abs(t)<s||Math.abs(r)<s*Math.max(Math.abs(t),Math.abs(e))):t===e},hf:function(t,e){return this.lf(t,e,t-e,this.ef)},af:function(t,e){return this.cf(t,e,t-e,this.ef)},cf:function(t,e,r,s){return isFinite(t)&&isFinite(e)?!isNaN(t)&&!isNaN(e)&&Math.abs(r)<s:t===e}},Mi=10.900511,Ii=[24857408913875355e-21,1.0514237858172197,-3.4568709722201625,4.512277094668948,-2.9828522532357664,1.056397115771267,-.19542877319164587,.01709705434044412,-.0005719261174043057,4633994733599057e-21,0];class Ai{static ff(t){if(t<.5){let e=Ii[0];for(let r=1;r<=10;r++)e+=Ii[r]/(r-t);return 1.1447298858494002-Math.log(Math.sin(Math.PI*t))-Math.log(e)-xi-(.5-t)*Math.log((.5-t+Mi)/Math.E)}{let e=Ii[0];for(let r=1;r<=10;r++)e+=Ii[r]/(t+r-1);return Math.log(e)+xi+(t-.5)*Math.log((t-.5+Mi)/Math.E)}}static df(t,e,r){let s=0===r||1===r?0:Math.exp(Ai.ff(t+e)-Ai.ff(t)-Ai.ff(e)+t*Math.log(r)+e*Math.log(1-r)),n=r>=(t+1)/(t+e+2),i=Si.Zc,u=1e-300,l=r,h=t,a=e;if(n){l=1-r;let t=h;h=a,a=t}let o=h+a,c=h+1,f=h-1,d=1,w=1-o*l/c;Math.abs(w)<u&&(w=u),w=1/w;let g=w;for(let t=1,e=2;t<=140;t++,e+=2){let r=t*(a-t)*l/((f+e)*(h+e));w=1+r*w,Math.abs(w)<u&&(w=u),d=1+r/d,Math.abs(d)<u&&(d=u),w=1/w,g*=w*d;let p=-(h+t)*(o+t)*l/((h+e)*(c+e));w=1+p*w,Math.abs(w)<u&&(w=u),d=1+p/d,Math.abs(d)<u&&(d=u),w=1/w;let m=w*d;if(g*=m,Math.abs(m-1)<=i)return n?1-s*g/h:s*g/h}return n?1-s*g/h:s*g/h}}class yi{static wf(t,e){let r=2220446049250313e-31;if(Si.af(t,0))return Si.af(e,0),1;if(Si.af(e,0))return 0;let s=t*Math.log(e)-e-Ai.ff(t);if(s<-709.782712893384)return t<e?1:0;if(e<=1||e<=t){let r=t,n=1,i=1;do{r+=1,n=n*e/r,i+=n}while(n/i>1e-15);return Math.exp(s)*i/t}let n,i=0,u=1-t,l=e+u+1,h=1,a=e,o=e+1,c=l*e,f=o/c;do{i++,u+=1,l+=2;let t=u*i,e=o*l-h*t,s=c*l-a*t;if(0!==s){let t=e/s;n=Math.abs((f-t)/t),f=t}else n=1;h=o,o=e,a=c,c=s,Math.abs(e)>4503599627370496&&(h*=r,o*=r,a*=r,c*=r)}while(n>1e-15);return 1-Math.exp(s)*f}static gf(t,e){let r=4503599627370496,s=5*1e-15;if(isNaN(t)||isNaN(e))return NaN;if(Si.af(e,0))return 0;if(Si.af(e,1))return 1/0;let n=1-e,i=r,u=0,l=1,h=0,a=1/(9*t),o=1-a-1.3859292911256331*Di.pf(2*n-1)*Math.sqrt(a),c=t*o*o*o,f=Ai.ff(t);for(let e=0;e<10;e++){if(c<u||c>i){a=.0625;break}if(o=1-yi.wf(t,c),o<h||o>l){a=.0625;break}if(o<n?(i=c,h=o):(u=c,l=o),a=(t-1)*Math.log(c)-c-f,a<-709.782712893384){a=.0625;break}if(a=-Math.exp(a),a=(o-n)/a,Math.abs(a/c)<1e-15)return c;a>c/4&&n<.05&&(a=c/10),c-=a}if(i===r)for(c<=0&&(c=1);i===r;){if(c*=1+a,o=1-yi.wf(t,c),o<n){i=c,h=o;break}a+=a}let d=0;a=.5;for(let e=0;e<400;e++){if(c=u+a*(i-u),o=1-yi.wf(t,c),f=(i-u)/(u+i),Math.abs(f)<s)return c;if(f=(o-n)/n,Math.abs(f)<s)return c;if(c<=0)return 0;o>=n?(u=c,l=o,d<0?(d=0,a=.5):a=d>1?.5*a+.5:(n-h)/(l-h),d+=1):(i=c,h=o,d>0?(d=0,a=.5):d<-1?a*=.5:a=(n-h)/(l-h),d-=1)}return c}static gamma(t){let e=[24857408913875355e-21,1.0514237858172197,-3.4568709722201625,4.512277094668948,-2.9828522532357664,1.056397115771267,-.19542877319164587,.01709705434044412,-.0005719261174043057,4633994733599057e-21,0],r=10.900511;if(t<.5){let s=e[0];for(let r=1;r<=10;r++)s+=e[r]/(r-t);return Math.PI/(Math.sin(Math.PI*t)*s*Ti*Math.pow((.5-t+r)/Math.E,.5-t))}{let s=e[0];for(let r=1;r<=10;r++)s+=e[r]/(t+r-1);return s*Ti*Math.pow((t-.5+r)/Math.E,t-.5)}}}class Di{static mf=[.0033791670955125737,-.0007369565304816795,-.3747323373929196,.08174424487335873,-.04210893199365486,.007016570951209575,-.004950912559824351,.0008716465990379225];static vf=[1,-.21808821808792464,.4125429727254421,-.08418911478731067,.06553388564002416,-.012001960445494177,.00408165558926174,-.0006159007215577697];static Nf=[-.03617903907182625,.2922518834448827,.2814470417976045,.12561020886276694,.027413502826893053,.0025083967216806575];static xf=[1,1.8545005897903486,1.4357580303783142,.5828276587530365,.12481047693294975,.011372417654635328];static Tf=[-.03978768926111369,.1531652124678783,.19126029560093624,.10276327061989304,.029637090615738836,.004609348678027549,.0003076078203486802];static Ef=[1,1.955200729876277,1.6476231719938486,.7682386070221262,.20979318593650978,.031956931689991336,.0021336316089578537];static Sf=[-.030083856055794972,.05385788298444545,.07262115416519142,.036762846988804936,.009646290155725275,.0013345348007529107,7780875997825043e-20];static Mf=[1,1.7596709814716753,1.3288357143796112,.5525285965087576,.13379305694133287,.017950964517628076,.0010471244001993736,-1.0664038182035734e-8];static If=[-.011790757013722784,.01426213209053881,.020223443590296084,.009306682999904321,.00213357802422066,.00025022987386460105,12053491221958819e-21];static Af=[1,1.5037622520362048,.9653977862044629,.3392652304767967,.06897406495415698,.007710602624917683,.0003714211015310693];static yf=[-.005469547955387293,.004041902787317071,.005496336955316117,.002126164726039454,.0003949840144950839,3655654770644424e-20,13548589710993232e-22];static Df=[1,1.2101969777363077,.6209146682211439,.17303843066114277,.027655081377343203,.0024062597442430973,8918118172513365e-20,-4655288362833827e-27];static bf=[-.0027072253590577837,.00131875634250294,.0011992593326100233,.00027849619811344664,26782298821833186e-21,9.230436723150282e-7];static Cf=[1,.8146328085431416,.26890166585629954,.044987721610304114,.0038175966332024847,.00013157189788859692,4048153596757641e-27];static Rf=[-.001099467206917422,.00040642544275042267,.0002744994894169007,4652937706466594e-20,32095542539576746e-22,7.782860181450209e-8];static Of=[1,.5881737106118461,.13936333128940975,.016632934041708368,.0010002392131023491,24254837521587224e-21];static Ff=[-.0005690799360109496,.00016949854037376225,5184723545811009e-20,38281931223192885e-22,8.249899312818944e-8];static kf=[1,.33963725005113937,.04347264787031066,.002485493352246371,5356333053371529e-20,-11749094440545958e-29];static Lf=[-.00024131359948399134,5742249752025015e-20,11599896292738377e-21,5.817621344025938e-7,8.539715550856736e-9];static _f=[1,.23304413829968784,.02041869405464403,.0007971856475643983,11701928167017232e-21];static Pf=[-.00014667469927776036,16266655211228053e-21,26911624850916523e-22,9.79584479468092e-8,1.0199464762572346e-9];static Vf=[1,.16590781294484722,.010336171619150588,.0002865930263738684,29840157084090034e-22];static Bf=[-5839057976297718e-20,4125103251054962e-21,4.3179092242025094e-7,9.933651555900132e-9,6534805100201047e-26];static Uf=[1,.10507708607203992,.004142784286754756,7263387546445238e-20,4.778184710473988e-7];static Hf=[-19645779760922958e-21,1572438876668007e-21,5.439025111927009e-8,3.174724923691177e-10];static Gf=[1,.05280398924095763,.0009268760691517533,5410117232266303e-21,5350938458036424e-31];static qf=[-7892247039787227e-21,6.22088451660987e-7,1.457284456768824e-8,6037155055427153e-26];static Jf=[1,.03753288463562937,.0004679195359746253,19384703927584565e-22];static Xf=[-.0005087819496582806,-.008368748197417368,.03348066254097446,-.012692614766297404,-.03656379714117627,.02198786811111689,.008226878746769157,-.005387729650712429];static $f=[1,-.9700050433032906,-1.5657455823417585,1.5622155839842302,.662328840472003,-.7122890234154284,-.05273963823400997,.07952836873415717,-.0023339375937419,.0008862163904564247];static Wf=[-.20243350835593876,.10526468069939171,8.3705032834312,17.644729840837403,-18.851064805871424,-44.6382324441787,17.445385985570866,21.12946554483405,-3.6719225470772936];static jf=[1,6.242641248542475,3.971343795334387,-28.66081804998,-20.14326346804852,48.560921310873994,10.826866735546016,-22.643693341313973,1.7211476576120028];static Kf=[-.1311027816799519,-.16379404719331705,.11703015634199525,.38707973897260434,.3377855389120359,.14286953440815717,.029015791000532906,.0021455899538880526,-6.794655751811263e-7,2.8522533178221704e-8,-6.81149956853777e-10];static zf=[1,3.4662540724256723,5.381683457070069,4.778465929458438,2.5930192162362027,.848854343457902,.15226433829533179,.011059242293464892];static Yf=[-.0350353787183178,-.0022242652921344794,.018557330651423107,.009508047013259196,.0018712349281955923,.00015754461742496055,460469890584318e-20,-2.304047769118826e-10,26633922742578204e-28];static Qf=[1,1.3653349817554064,.7620591645536234,.22009110576413124,.03415891436709477,.00263861676657016,7646752923027944e-20];static Zf=[-.016743100507663373,-.0011295143874558028,.001056288621524929,.00020938631748758808,14962478375834237e-21,4.4969678992770644e-7,4.625961635228786e-9,-2811287356288318e-29,9905570997331033e-32];static td=[1,.5914293448864175,.1381518657490833,.016074608709367652,.0009640118070051656,27533547476472603e-21,2.82243172016108e-7];static ed=[-.002497821279189813,-779190719229054e-20,.0002547230374130275,16239777734251093e-22,3.963410113048012e-8,4.116328311909442e-10,14559628671867504e-28,-11676501239718427e-34];static rd=[1,.2071231122144225,.01694108381209759,.0006905382656226846,14500735981823264e-21,1.4443775662814415e-7,5.097612765997785e-10];static sd=[-.0005390429110190785,-2.8398759004727723e-7,8.994651148922914e-7,2.2934585926592085e-8,2.2556144486350015e-10,9478466275030226e-28,13588013010892486e-31,-34889039339994887e-38];static nd=[1,.08457462340018994,.002820929847262647,4682929219408942e-20,3.999688121938621e-7,1.6180929088790448e-9,2315586083102596e-27];static ud(t){return 0===t?0:isFinite(t)?Di.ld(t,!1):t>0?1:-1}static hd(t){return 0===t?1:isFinite(t)?Di.ld(t,!0):t>0?0:2}static ld(t,e){if(t<0)return e?t<-.5?2-Di.ld(-t,!0):1+Di.ld(-t,!1):-Di.ld(-t,!1);let r;if(t<.5)r=t<1e-10?1.125*t+.0033791670955125737*t:1.125*t+t*Ei.Yc(t,Di.mf)/Ei.Yc(t,Di.vf);else if(t<110||t<110&&e){let s,n;e=!e,t<.75?(s=Ei.Yc(t-.5,Di.Nf)/Ei.Yc(t-.5,Di.xf),n=.3440242112):t<1.25?(s=Ei.Yc(t-.75,Di.Tf)/Ei.Yc(t-.75,Di.Ef),n=.419990927):t<2.25?(s=Ei.Yc(t-1.25,Di.Sf)/Ei.Yc(t-1.25,Di.Mf),n=.4898625016):t<3.5?(s=Ei.Yc(t-2.25,Di.If)/Ei.Yc(t-2.25,Di.Af),n=.5317370892):t<5.25?(s=Ei.Yc(t-3.5,Di.yf)/Ei.Yc(t-3.5,Di.Df),n=.5489973426):t<8?(s=Ei.Yc(t-5.25,Di.bf)/Ei.Yc(t-5.25,Di.Cf),n=.5571740866):t<11.5?(s=Ei.Yc(t-8,Di.Rf)/Ei.Yc(t-8,Di.Of),n=.5609807968):t<17?(s=Ei.Yc(t-11.5,Di.Ff)/Ei.Yc(t-11.5,Di.kf),n=.5626493692):t<24?(s=Ei.Yc(t-17,Di.Lf)/Ei.Yc(t-17,Di._f),n=.5634598136):t<38?(s=Ei.Yc(t-24,Di.Pf)/Ei.Yc(t-24,Di.Vf),n=.5638477802):t<60?(s=Ei.Yc(t-38,Di.Bf)/Ei.Yc(t-38,Di.Uf),n=.5640528202):t<85?(s=Ei.Yc(t-60,Di.Hf)/Ei.Yc(t-60,Di.Gf),n=.5641309023):(s=Ei.Yc(t-85,Di.qf)/Ei.Yc(t-85,Di.Jf),n=.5641584396);let i=Math.exp(-t*t)/t;r=i*n+i*s}else r=0,e=!e;return e&&(r=1-r),r}static pf(t){if(0===t)return 0;if(t>=1)return 1/0;if(t<=-1)return-1/0;let e,r,s;return t<0?(e=-t,r=1-e,s=-1):(e=t,r=1-t,s=1),Di.ad(e,r,s)}static od(t){if(t<=0)return 1/0;if(t>=2)return-1/0;let e,r,s;return t>1?(r=2-t,e=1-r,s=-1):(e=1-t,r=t,s=1),Di.ad(e,r,s)}static ad(t,e,r){let s;if(t<=.5){let e=t*(t+10);s=.08913147449493408*e+e*(Ei.Yc(t,Di.Xf)/Ei.Yc(t,Di.$f))}else if(e>=.25){let t=2.249481201171875,r=e-.25;s=Math.sqrt(-2*Math.log(e))/(t+Ei.Yc(r,Di.Wf)/Ei.Yc(r,Di.jf))}else{let t=Math.sqrt(-Math.log(e));if(t<3){let e=t-1.125;s=.807220458984375*t+Ei.Yc(e,Di.Kf)/Ei.Yc(e,Di.zf)*t}else if(t<6){let e=t-3;s=.9399557113647461*t+Ei.Yc(e,Di.Yf)/Ei.Yc(e,Di.Qf)*t}else if(t<18){let e=t-6;s=.9836282730102539*t+Ei.Yc(e,Di.Zf)/Ei.Yc(e,Di.td)*t}else if(t<44){let e=t-18;s=.9971456527709961*t+Ei.Yc(e,Di.ed)/Ei.Yc(e,Di.rd)*t}else{let e=t-44;s=.9994134902954102*t+Ei.Yc(e,Di.sd)/Ei.Yc(e,Di.nd)*t}}return r*s}static fd(t,e){if(e<0||e>t)return 0;if(0===e||e===t)return 1;e=Math.min(e,t-e);let r=1;for(let s=1;s<=e;s++)r=r*(t-e+s)/s;return r}static dd(t,e){if(e<0||e>t)return-1/0;if(0===e||e===t)return 0;e=Math.min(e,t-e);let r=0;for(let s=1;s<=e;s++)r+=Math.log(t-e+s)-Math.log(s);return r}static wd(t){if(t<0)return NaN;if(0===t||1===t)return 1;let e=1;for(let r=2;r<=t;r++)e*=r;return e}static gd(t){if(t<0)return NaN;if(0===t||1===t)return 0;let e=0;for(let r=2;r<=t;r++)e+=Math.log(r);return e}static pd(t){return Math.abs(t)<1e-6?t+t*t/2+t*t*t/6:Math.exp(t)-1}static ff(t){return Ai.ff(t)}static df(t,e,r){return Ai.df(t,e,r)}static gamma(t){return yi.gamma(t)}static wf(t,e){return yi.wf(t,e)}static gf(t,e){return yi.gf(t,e)}}class bi{static md(t,e,r){return.5*Di.hd((t-r)/(e*Ni))}static vd(t,e,r){return t-e*Ni*Di.od(2*r)}static Nd(t,e,r){let s=(r-t)/e;return Math.exp(-.5*s*s)/(2.5066282746310007*e)}}class Ci{static md(t,e,r,s){if(!isFinite(r))return bi.md(t,e,s);let n=(s-t)/e,i=r/(r+n*n),u=.5*Di.df(r/2,.5,i);return s<=t?u:1-u}static vd(t,e,r,s){if(!isFinite(r))return bi.vd(t,e,s);if(.5===s)return t;let n,i,u=-100,l=100;for(;Math.sign(Ci.xd(t,e,r,s,u))===Math.sign(Ci.xd(t,e,r,s,l));)u*=2,l*=2;for(let h=0;h<100;h++){if(n=(u+l)/2,i=Ci.xd(t,e,r,s,n),Math.abs(i)<1e-12)return n;if(Math.sign(i)===Math.sign(Ci.xd(t,e,r,s,u))?u=n:l=n,Math.abs(l-u)<1e-12)return n}return n}static xd(t,e,r,s,n){let i=(n-t)/e,u=r/(r+i*i),l=.5*Di.df(r/2,.5,u);return n<=t?l-s:1-l-s}}class Ri{static md(t,e,r){return Di.df(t/2,e/2,t*r/(t*r+e))}static vd(t,e,r){let s,n=0,i=1e3;for(let u=0;u<100;u++){s=(n+i)/2;let u=Di.df(t/2,e/2,t*s/(t*s+e))-r;if(Math.abs(u)<1e-15)return s;u<0?n=s:i=s}return s}}class Oi{static md(t,e,r){return r<0?0:r>=1?1:isFinite(t)||isFinite(e)?isFinite(t)?isFinite(e)?0===t&&0===e?r>=0&&r<1?.5:1:0===t?1:0===e?r>=1?1:0:1===t&&1===e?r:Di.df(t,e,r):r>=0?1:0:r<1?0:1:r<.5?0:1}static vd(t,e,r){let s,n=0,i=1;for(let u=0;u<100;u++){s=(n+i)/2;let u=Di.df(t,e,s)-r;if(Math.abs(u)<1e-15)return s;u<0?n=s:i=s}return s}}class Fi{static md(t,e,r){return isFinite(e)?0===t&&0===e?0:Di.wf(t,r*e):r>=t?1:0}static Nd(t,e,r){return isFinite(e)?0===t&&0===e?0:1===t?e*Math.exp(-e*r):t>160?Math.exp(Fi.Td(t,e,r)):Math.pow(e,t)*Math.pow(r,t-1)*Math.exp(-e*r)/Di.gamma(t):r===t?1/0:0}static Td(t,e,r){return isFinite(e)?0===t&&0===e?-1/0:1===t?Math.log(e)-e*r:t*Math.log(e)+(t-1)*Math.log(r)-e*r-Di.ff(t):r===t?1/0:-1/0}static vd(t,e,r){return Di.gf(t,r)/e}}class ki{static Nd(t,e){return e<0?0:t*Math.exp(-t*e)}static md(t,e){return e<0?0:1-Math.exp(-t*e)}}class Li{static Ed(t,e,r,s){return t<0||e<0||r<0||e>t||r>t?0:Di.fd(e,s)*Di.fd(t-e,r-s)/Di.fd(t,r)}}class _i{static Ed(t,e,r){return Math.exp(_i.Sd(t,e,r))}static Sd(t,e,r){return Di.ff(t+r)-Di.ff(t)-Di.ff(r+1)+t*Math.log(e)+r*Math.log(1-e)}}class Pi{static md(t,e,r){return r<0?0:.5*(1+Di.ud((Math.log(r)-t)/(e*Ni)))}static vd(t,e,r){return r<=0?0:r>=1?1/0:Math.exp(t-e*Ni*Di.od(2*r))}}class Vi{static Ed(t,e,r){return r<0||r>e?0:0===t?0===r?1:0:1===t?r===e?1:0:Math.exp(Di.dd(e,r)+r*Math.log(t)+(e-r)*Math.log(1-t))}static md(t,e,r){if(r<0)return 0;if(r>e)return 1;let s=Math.floor(r);return Di.df(e-s,s+1,1-t)}}class Bi{static Ed(t,e){return Math.exp(-t+e*Math.log(t)-Di.gd(e))}static md(t,e){return 1-Di.wf(e+1,t)}}class Ui{static Nd(t,e,r){return r>=0?0===r&&1===t?t/e:t*Math.pow(r/e,t-1)*Math.exp(-Math.pow(r,t)*Math.pow(e,-t))/e:0}static md(t,e,r){return r<0?0:-Di.pd(-Math.pow(r,t)*Math.pow(e,-t))}}var Hi={Md:function(t){if(0==t.length)return Number.NaN;for(var e=Number.POSITIVE_INFINITY,r=0;r<t.length;r++)!Number.isNaN(t[r])&&t[r]<e&&(e=t[r]);return e===Number.POSITIVE_INFINITY?Number.NaN:e},Id:function(t){if(0==t.length)return Number.NaN;for(var e=Number.NEGATIVE_INFINITY,r=0;r<t.length;r++)!Number.isNaN(t[r])&&t[r]>e&&(e=t[r]);return e===Number.NEGATIVE_INFINITY?Number.NaN:e},Ad:function(t,e,r){if(e<0||e>1||0==t.length)return Number.NaN;if(0==e||1==t.length)return this.Md(t);if(1==e)return this.Id(t);switch(r){case 1:var s=t.length*e+.5;return this.yd(t,Math.ceil(s-.5)-1);case 2:return s=t.length*e+.5,.5*(this.yd(t,Math.ceil(s-.5)-1)+this.yd(t,Math.floor(s+.5)-1));case 3:return s=t.length*e,this.yd(t,Math.round(s)-1);case 4:s=t.length*e;var n=Math.floor(s);return(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);case 5:return s=t.length*e+.5,n=Math.floor(s),(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);case 6:return s=(t.length+1)*e,n=Math.floor(s),(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);case 7:return s=(t.length-1)*e+1,n=Math.floor(s),(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);case 8:return s=(t.length+1/3)*e+1/3,n=Math.floor(s),(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);case 9:var i;return s=(t.length+.25)*e+.375,n=Math.floor(s),(i=this.yd(t,n-1))+(s-n)*(this.yd(t,n)-i);default:throw new Error("Not supported")}},yd:function(t,e){if(e<=0)return this.Md(t);if(e>=t.length-1)return this.Id(t);for(var r=t,s=0,n=r.length-1;;){if(n<=s+1){if(n==s+1&&r[n]<r[s]){var i=r[s];r[s]=r[n],r[n]=i}return r[e]}var u=s+n>>1,l=r[u];r[u]=r[s+1],r[s+1]=l,r[s]>r[n]&&(i=r[s],r[s]=r[n],r[n]=i),r[s+1]>r[n]&&(i=r[s+1],r[s+1]=r[n],r[n]=i),r[s]>r[s+1]&&(i=r[s],r[s]=r[s+1],r[s+1]=i);for(var h=s+1,a=n,o=r[h];;){do{h++}while(r[h]<o);do{a--}while(r[a]>o);if(a<h)break;i=r[h],r[h]=r[a],r[a]=i}r[s+1]=r[a],r[a]=o,a>=e&&(n=a-1),a<=e&&(s=h)}}},Gi={Dd:function(t,e){if(e<t[0])return 0;if(e>=t[t.length-1])return 1;var r=this.bd(t,e);if(r>=0){for(var s=r;s>0&&t[s-1]==t[s];)s--;for(;r<t.length-1&&t[r+1]==t[r];)r++;return s/(t.length-1)}var n=(s=(r=~r)-1)/(t.length-1),i=r/(t.length-1);return((t[r]-e)*n+(e-t[s])*i)/(t[r]-t[s])},bd:function(t,e){for(var r=0,s=t.length-1;r<=s;){var n=Math.floor((r+s)/2);if(t[n]===e)return n;t[n]<e?r=n+1:s=n-1}return~r}},qi=function(t,e,r){var s=t.slice();return Hi.Ad(s,e,r)};class Ji extends Xr{get Name(){return"Quartile"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=[];if(0==L.Me(r.ArrayValue,n))return this.oc(1);let i=s.IntValue;return i<0||i>4?this.oc(2):P.Create(function(t,e){switch(e){case 0:return Hi.Md(t);case 1:return qi(t,.25,7);case 2:return qi(t,.5,7);case 3:return qi(t,.75,7);case 4:return Hi.Id(t);default:throw new Error("quant must be between 0 and 4")}}(n,i))}}class Xi extends us{get Name(){return"Mode"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();let n={};for(let t of s)void 0!==n[t]?n[t]+=1:n[t]=1;let i=Object.entries(n).sort((t,e)=>e[1]-t[1]);return P.Create(parseFloat(i[0][0]))}}class $i extends Xr{get Name(){return"Large"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r=this.hc(r,1),r.IsError)return r;let s=this.b.evaluate(t,e);if(s=this.lc(s,2),s.IsError)return s;let n=[];if(0==L.Me(r,n))return this.oc(1);n.sort((t,e)=>e-t);let i=s.IntValue;return i<1-t.ExcelIndex||i>n.length-t.ExcelIndex?this.oc(2):P.Create(n[i-t.ExcelIndex])}}class Wi extends Xr{get Name(){return"Small"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r=this.hc(r,1),r.IsError)return r;let s=this.b.evaluate(t,e);if(s=this.lc(s,2),s.IsError)return s;let n=[];if(0==L.Me(r,n))return this.oc(1);n.sort((t,e)=>t-e);let i=s.IntValue;return i<1-t.ExcelIndex||i>n.length-t.ExcelIndex?this.oc(2):P.Create(n[i-t.ExcelIndex])}}class ji extends Xr{get Name(){return"Percentile"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=[];if(0==L.Me(r.ArrayValue,n))return this.oc(1);let i=s.DoubleValue;return P.Create(function(t,e){return qi(t,e,7)}(n.map(t=>t),i))}}class Ki extends Ls{get Name(){return"PercentRank"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=[];if(0==L.Me(r.ArrayValue,n))return this.cc();let i=s.DoubleValue,u=function(t,e){var r=t.slice();return r.sort(function(t,e){return t-e}),Gi.Dd(r,e)}(n.map(t=>t),i),l=3;if(null!=this.c){let r=this.Vc(t,e);if(r.IsError)return r;l=r.IntValue}return P.Create(Math.round(u*Math.pow(10,l))/Math.pow(10,l))}}class zi extends us{get Name(){return"Average"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)?this.cc():0==s.length?P.Zero:P.Create(s.reduce((t,e)=>t+e,0)/s.length)}}class Yi extends Ls{get Name(){return"AverageIf"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;let n,i,u,l=[];if(0==L.Me(r,l))return this.oc(1);if(null!=this.c){let r=this.Hc(t,e);if(r.IsError)return r;if(n=[],0==L.Me(r,n))return this.oc(3)}else n=l;if(s.IsNumber)u=L.Ce(l,s.NumberValue),i=u*s.NumberValue;else{if(!s.IsText)return this.oc(2);{let t=s.TextValue.trim(),e=parseFloat(t);if(isNaN(e)){let e=t,r=L.be(e);if(null==r)return this.oc(2);u=L.Ce(l,r.operator,r.value),i=L.Re(l,r.operator,r.value,n)}else u=L.Ce(l,e),i=L.Re(l,e,n)}}return 0==u?this.dc():P.Create(i/u)}}class Qi extends us{get Name(){return"GeoMean"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return this.cc();let n=1;for(let t of s){if(t<=0)return this.cc();n*=t}let i=Math.pow(n,1/s.length);return P.Create(i)}}class Zi extends us{get Name(){return"HarMean"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}if(1===r.length)return r[0];let s=[];if(0==L.Me(r,s))return this.cc();let n=0;for(let t of s){if(0===t)return this.cc();n+=1/t}return 0===n?this.cc():P.Create(s.length/n)}}class tu extends us{get Name(){return"Count"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)?this.cc():P.Create(s.length)}}class eu extends Xr{get Name(){return"CountIf"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;let n,i=[];if(0==L.Me(r,i))return this.oc(1);if(s.IsNumber)n=L.Ce(i,s.NumberValue);else{let t=s.TextValue.trim(),e=parseFloat(t);if(isNaN(e)){let e=t,r=L.be(e);if(null==r)return this.oc(2);n=L.Ce(i,r.operator,r.value)}else n=L.Ce(i,e)}return P.Create(n)}}class ru extends us{get Name(){return"Sum"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];return 0==L.Me(r,s)?this.cc():P.Create(s.reduce((t,e)=>t+e,0))}}class su extends Ls{get Name(){return"SumIf"}constructor(t){super(t)}evaluate(t,e){let r=this.xc(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;let n,i,u=[];if(0==L.Me(r,u))return this.oc(1);if(null!=this.c){let r=this.Hc(t,e);if(r.IsError)return r;if(n=[],0==L.Me(r,n))return this.oc(3)}else n=u;if(s.IsNumber)i=L.Ce(u,s.NumberValue)*s.NumberValue;else{if(!s.IsText)return this.oc(2);{let t=s.TextValue.trim(),e=parseFloat(t);if(isNaN(e)){let e=t,r=L.be(e);if(null==r)return this.oc(2);i=L.Re(u,r.operator,r.value,n)}else i=L.Re(u,e,n)}}return P.Create(i)}}class nu extends us{get Name(){return"AveDev"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return P.Zero;let n=s.reduce((t,e)=>t+e,0)/s.length,i=0;for(let t of s)i+=Math.abs(t-n);return P.Create(i/s.length)}}class iu extends us{get Name(){return"StDev"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return this.cc();let n=s.reduce((t,e)=>t+e,0)/s.length,i=0;for(let t=0;t<s.length;t++)i+=(s[t]-n)*(s[t]-n);return P.Create(Math.sqrt(i/(s.length-1)))}}class uu extends us{get Name(){return"StDevP"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return this.cc();let n=s.reduce((t,e)=>t+e,0)/s.length,i=0;for(let t=0;t<s.length;t++)i+=(s[t]-n)*(s[t]-n);return P.Create(Math.sqrt(i/s.length))}}class lu extends us{get Name(){return"DevSq"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return this.cc();let n=s.reduce((t,e)=>t+e,0)/s.length,i=0;for(let t=0;t<s.length;t++){let e=s[t]-n;i+=e*e}return P.Create(i)}}class hu extends us{get Name(){return"Var"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}if(1==r.length)return P.Error("Function '{0}' parameter only one error!","Var");let s=[];if(0==L.Me(r,s))return this.cc();if(s.length<=1)return this.cc();let n=0,i=0;for(let t=0;t<s.length;t++)n+=s[t]*s[t],i+=s[t];return P.Create((s.length*n-i*i)/s.length/(s.length-1))}}class au extends us{get Name(){return"VarP"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}if(1==r.length)return P.Error("Function '{0}' parameter only one error!","VarP");let s=[];if(0==L.Me(r,s))return this.cc();if(0==s.length)return this.cc();if(1==s.length)return P.Zero;let n=0,i=s.reduce((t,e)=>t+e,0)/s.length;for(let t=0;t<s.length;t++)n+=(i-s[t])*(i-s[t]);return P.Create(n/s.length)}}class ou extends On{get Name(){return"NormDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=this.jc(t,e);if(i.IsError)return i;let u=r.DoubleValue,l=s.DoubleValue,h=n.DoubleValue,a=i.BooleanValue;return P.Create((o=u,c=l,f=h,a?bi.md(c,f,o):bi.Nd(c,f,o)));var o,c,f}}class cu extends Ls{get Name(){return"NormInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.DoubleValue,l=n.DoubleValue;return P.Create((h=i,a=u,o=l,bi.vd(a,o,h)));var h,a,o}}class fu extends Jr{get Name(){return"NormSDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return P.Create((n=s,bi.md(0,1,n)));var n}}class du extends Jr{get Name(){return"NormSInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;return P.Create((n=s,bi.vd(0,1,n)));var n}}class wu extends Ls{get Name(){return"BetaDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.DoubleValue,l=n.DoubleValue;return u<0||l<0?this.cc():P.Create(function(t,e,r){return Oi.md(e,r,t)}(i,u,l))}}class gu extends Ls{get Name(){return"BetaInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.DoubleValue,l=n.DoubleValue;return u<0||l<0||i<0||i>1?this.cc():P.Create(function(t,e,r){return Oi.vd(e,r,t)}(i,u,l))}}class pu extends On{get Name(){return"BinomDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=this.jc(t,e);if(i.IsError)return i;let u=s.IntValue,l=n.DoubleValue;return l>=0&&l<=1&&u>=0?P.Create((h=r.IntValue,a=u,o=l,!1===i.BooleanValue?Vi.Ed(o,a,h):Vi.md(o,a,h))):this.cc();var h,a,o}}class mu extends Ls{get Name(){return"ExpOnDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Uc(t,e);if(n.IsError)return n;let i=r.DoubleValue;return i<0?this.cc():P.Create((u=i,l=s.DoubleValue,n.BooleanValue?ki.md(l,u):ki.Nd(l,u)));var u,l}}class vu extends Ls{get Name(){return"FDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.IntValue,l=n.IntValue;return u<=0||l<=0?this.cc():P.Create(function(t,e,r){return 1-Ri.md(e,r,t)}(i,u,l))}}class Nu extends Ls{get Name(){return"FInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.IntValue,l=n.IntValue;return u<=0||l<=0||i<0||i>1?this.cc():P.Create(function(t,e,r){return Ri.vd(e,r,1-t)}(i,u,l))}}class xu extends Jr{get Name(){return"Fisher"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue;if(s>=1||s<=-1)return this.cc();let n=.5*Math.log((1+s)/(1-s));return P.Create(n)}}class Tu extends Jr{get Name(){return"FisherInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=r.DoubleValue,n=(Math.exp(2*s)-1)/(Math.exp(2*s)+1);return P.Create(n)}}class Eu extends On{get Name(){return"GammaDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=this.jc(t,e);if(i.IsError)return i;let u=r.DoubleValue,l=s.DoubleValue,h=n.DoubleValue,a=i.BooleanValue;return l<0||h<0?this.cc():P.Create(function(t,e,r,s){return s?Fi.md(e,1/r,t):Fi.Nd(e,1/r,t)}(u,l,h,a))}}class Su extends Ls{get Name(){return"GammaInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.DoubleValue,l=n.DoubleValue;return u<0||l<0||i<0||i>1?this.cc():P.Create(function(t,e,r){return Fi.vd(e,1/r,t)}(i,u,l))}}class Mu extends Jr{get Name(){return"GammaLn"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);return r.IsError?r:P.Create((s=r.DoubleValue,Di.ff(s)));var s}}class Iu extends On{get Name(){return"HypgeomDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=this.$c(t,e);if(i.IsError)return i;let u=r.IntValue,l=s.IntValue,h=n.IntValue,a=i.IntValue;return a>=0&&h>=0&&l>=0&&h<=a&&l<=a?P.Create(function(t,e,r,s){return Li.Ed(s,r,e,t)}(u,l,h,a)):this.cc()}}class Au extends Ls{get Name(){return"LogInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=n.DoubleValue;return i<0?this.cc():P.Create((u=r.DoubleValue,l=s.DoubleValue,h=i,Pi.vd(l,h,u)));var u,l,h}}class yu extends Ls{get Name(){return"LogNormDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=n.DoubleValue;return i<0?this.cc():P.Create((u=r.DoubleValue,l=s.DoubleValue,h=i,Pi.md(l,h,u)));var u,l,h}}class Du extends Ls{get Name(){return"NegBinomDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.IntValue,u=s.DoubleValue,l=n.DoubleValue;return u>=0&&l>=0&&l<=1?P.Create(function(t,e,r){return _i.Ed(e,r,t)}(i,u,l)):this.cc()}}class bu extends Ls{get Name(){return"Poisson"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Uc(t,e);if(n.IsError)return n;let i=r.IntValue,u=s.DoubleValue,l=n.BooleanValue;return u>0?P.Create(function(t,e,r){return!1===r?Bi.Ed(e,t):Bi.md(e,t)}(i,u,l)):this.cc()}}class Cu extends Ls{get Name(){return"TDist"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=r.DoubleValue,u=s.IntValue,l=n.IntValue;return u<=0||l<1||l>2?this.cc():P.Create(function(t,e,r){switch(r){case 1:return 1-Ci.md(0,1,e,t);case 2:return 1-Ci.md(0,1,e,t)+Ci.md(0,1,e,-t);default:throw new Error("tails must be 1 or 2")}}(i,u,l))}}class Ru extends Xr{get Name(){return"TInv"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.DoubleValue,i=s.IntValue;return i<=0||n<0||n>1?this.cc():P.Create(function(t,e){return-Ci.vd(0,1,e,t/2)}(n,i))}}class Ou extends On{get Name(){return"Weibull"}constructor(t){super(t)}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=this.Vc(t,e);if(n.IsError)return n;let i=this.jc(t,e);if(i.IsError)return i;let u=r.DoubleValue,l=s.DoubleValue,h=n.DoubleValue,a=i.BooleanValue;return l<=0||h<=0?this.cc():P.Create(function(t,e,r,s){return!1===s?Ui.Nd(e,r,t):Ui.md(e,r,t)}(u,l,h,a))}}class Fu extends Jr{get Name(){return"UrlEncode"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue,n=encodeURIComponent(s).replace(/%20/g,"+").toLowerCase();return P.Create(n)}}class ku extends Jr{get Name(){return"UrlDecode"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue,n=decodeURIComponent(s).replace(/\+/g," ");return P.Create(n)}}class Lu extends Jr{get Name(){return"HtmlEncode"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue,n=Lu.HtmlEncode(s);return P.Create(n)}static HtmlEncode(t){return null==t?"":t.toString().replace(/[&<>'"]/g,function(t){switch(t){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return t}})}}class _u extends Jr{get Name(){return"HtmlDecode"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=r.TextValue,n=_u.HtmlDecode(s);return P.Create(n)}static HtmlDecode(t){return null==t?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&#([0-9]+);/g,function(t,e){return String.fromCharCode(e)})}}class Pu extends Jr{get Name(){return"Base64ToText"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Buffer.from(r.TextValue,"base64").toString("utf-8");return P.Create(t)}catch(t){return this.cc()}}}class Vu extends Jr{get Name(){return"Base64UrlToText"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;try{let t=r.TextValue.replace(/-/g,"+").replace(/_/g,"/"),e=t.length%4;e>0&&(t+="=".repeat(4-e));let s=Buffer.from(t,"base64").toString("utf-8");return P.Create(s)}catch(t){return this.cc()}}}class Bu extends Jr{get Name(){return"TextToBase64"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Buffer.from(r.TextValue,"utf-8").toString("base64");return P.Create(t)}catch(t){return this.cc()}}}class Uu extends Jr{get Name(){return"TextToBase64Url"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Buffer.from(r.TextValue,"utf-8").toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return P.Create(t)}catch(t){return this.cc()}}}class Hu extends Xr{constructor(t){super(t)}get Name(){return"Regex"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=new RegExp(s.TextValue).exec(r.TextValue);return t?P.Create(t[0]):this.cc()}catch(t){return this.cc()}}}class Gu extends Ls{constructor(t){super(t)}get Name(){return"RegexReplace"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=this.Pc(t,e);if(n.IsError)return n;try{let t=new RegExp(s.TextValue,"g"),e=r.TextValue.replace(t,n.TextValue);return P.Create(e)}catch(t){return this.cc()}}}class qu extends Xr{constructor(t){super(t)}get Name(){return"IsRegex"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=new RegExp(s.TextValue).test(r.TextValue);return P.Create(t)}catch(t){return P.Create(!1)}}}class Ju extends qr{constructor(){super()}get Name(){return"Guid"}evaluate(t,e){return P.Create(this.Cd())}Cd(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}sc(t,e){t.push("GUID()")}}var Xu=r(636);class $u extends Jr{get Name(){return"MD5"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Xu(r.TextValue).toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var Wu=r(471);class ju extends Jr{get Name(){return"SHA1"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Wu(r.TextValue).toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var Ku=r(9);class zu extends Jr{get Name(){return"SHA256"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Ku(r.TextValue).toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var Yu=r(380);class Qu extends Jr{get Name(){return"SHA512"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;try{let t=Yu(r.TextValue).toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var Zu=r(44);class tl extends Xr{get Name(){return"HmacMD5"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=Zu(r.TextValue,s.TextValue||"").toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var el=r(327);class rl extends Xr{get Name(){return"HmacSHA1"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=el(r.TextValue,s.TextValue||"").toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var sl=r(793);class nl extends Xr{get Name(){return"HmacSHA256"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=sl(r.TextValue,s.TextValue||"").toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}var il=r(468);class ul extends Xr{get Name(){return"HmacSHA512"}constructor(t){super(t)}evaluate(t,e=null){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;try{let t=il(r.TextValue,s.TextValue||"").toString().toUpperCase();return P.Create(t)}catch(t){return this.cc()}}}class ll extends Ls{get Name(){return"StartsWith"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=r.TextValue,i=s.TextValue;if(null==this.c)return P.Create(n.startsWith(i));let u=this.Uc(t,e);return u.IsError?u:u.BooleanValue?P.Create(n.toLowerCase().startsWith(i.toLowerCase())):P.Create(n.startsWith(i))}}class hl extends Ls{constructor(t){super(t)}get Name(){return"EndsWith"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=r.TextValue;if(!this.c)return P.Create(n.endsWith(s.TextValue));let i=this.Uc(t,e);return i.IsError?i:i.BooleanValue?P.Create(n.toLowerCase().endsWith(s.TextValue.toLowerCase())):P.Create(n.endsWith(s.TextValue))}}class al extends On{constructor(t){super(t)}get Name(){return"IndexOf"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=r.TextValue;if(null==this.c){let e=n.indexOf(s.TextValue);return P.Create(e+t.ExcelIndex)}let i=this.Vc(t,e);if(i.IsError)return i;if(null==this.d){let e=i.IntValue,r=n.indexOf(s.TextValue,e);return P.Create(r+t.ExcelIndex)}let u=this.$c(t,e);if(u.IsError)return u;let l=i.IntValue,h=l+u.IntValue,a=n.substring(l,h).indexOf(s.TextValue);return-1===a?P.Create(-1+t.ExcelIndex):P.Create(a+l+t.ExcelIndex)}}class ol extends On{constructor(t){super(t)}get Name(){return"LastIndexOf"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=r.TextValue;if(null==this.c){let e=n.lastIndexOf(s.TextValue);return P.Create(e+t.ExcelIndex)}let i=this.Vc(t,e);if(i.IsError)return i;if(null==this.d){let e=n.substring(0,i.IntValue).lastIndexOf(s.TextValue);return P.Create(e+t.ExcelIndex)}let u=this.$c(t,e);if(u.IsError)return u;let l=i.IntValue,h=l+u.IntValue,a=n.substring(l,h).lastIndexOf(s.TextValue);return-1===a?P.Create(-1+t.ExcelIndex):P.Create(a+l+t.ExcelIndex)}}class cl extends Xr{get Name(){return"Split"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=r.TextValue,i=s.TextValue,u=n.split(i);return P.Create(u)}}class fl extends Ls{get Name(){return"Substring"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Ec(t,e);if(s.IsError)return s;let n=r.TextValue,i=s.IntValue-t.ExcelIndex;if(null===this.c)return P.Create(n.substring(i));let u=this.Vc(t,e);if(u.IsError)return u;let l=i+u.IntValue;return P.Create(n.substring(i,l))}}class dl extends Xr{get Name(){return"TrimStart"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(null==this.b)return P.Create(r.TextValue.trimStart());let s=this.Tc(t,e);if(s.IsError)return s;let n=s.TextValue.split(""),i=r.TextValue,u=0;for(;u<i.length&&n.includes(i[u]);)u++;return P.Create(i.substring(u))}}class wl extends Xr{get Name(){return"TrimEnd"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(null==this.b)return P.Create(r.TextValue.trimEnd());let s=this.Tc(t,e);if(s.IsError)return s;let n=s.TextValue.split(""),i=r.TextValue,u=i.length-1;for(;u>=0&&n.includes(i[u]);)u--;return P.Create(i.substring(0,u+1))}}class gl extends Ls{constructor(t){super(t)}get Name(){return"RemoveStart"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=!1;if(this.c){let r=this.Uc(t,e);if(r.IsError)return r;n=r.BooleanValue}let i=r.TextValue,u=s.TextValue,l=!1;return l=n?i.toLowerCase().startsWith(u.toLowerCase()):i.startsWith(u),l?P.Create(i.substring(u.length)):r}}class pl extends Ls{constructor(t){super(t)}get Name(){return"RemoveEnd"}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;let n=!1;if(this.c){let r=this.Uc(t,e);if(r.IsError)return r;n=r.BooleanValue}let i=r.TextValue,u=s.TextValue,l=!1;return l=n?i.toLowerCase().endsWith(u.toLowerCase()):i.endsWith(u),l?P.Create(i.substring(0,i.length-u.length)):r}}class ml extends us{constructor(t){super(t)}get Name(){return"Join"}Me(t,e){if(t.IsError)return!1;if(t.IsArray){for(let r=0;r<t.ArrayValue.length;r++)if(!this.Me(t.ArrayValue[r],e))return!1}else if(t.IsJson){if(t.ToArray(null).IsError)return!1;for(let r=0;r<t.ArrayValue.length;r++)if(!this.Me(t.ArrayValue[r],e))return!1}else if(t.IsNull);else{var r=t.ToText(null);if(r.IsError)return!1;e.push(r.TextValue)}return!0}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);if(n.IsError)return n;r.push(n)}let s=r[0];if(s.IsJson){let t=s.ToArray(null);t.IsError||(s=t)}if(s.IsArray){let t=[];if(!this.Me(s,t))return this.oc(1);let e=this.nc(r[1],2);return e.IsError?e:P.Create(t.join(e.TextValue))}{if(s=this.nc(s,1),s.IsError)return s;let t=[];for(let e=1;e<r.length;e++)if(!this.Me(r[e],t))return this.oc(e+1);return P.Create(t.join(s.TextValue))}}}class vl extends Xr{constructor(t){super(t)}get Name(){return"LookCeiling"}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ic(t,e);if(s.IsError)return s;let n=[];if(L.Me(s.ArrayValue,n),0===n.length)return this.oc(2);n.sort((t,e)=>e-t);let i=r.NumberValue,u=n[0];if(u===i)return r;for(let t=1;t<n.length;t++){let e=n[t];if(!(e>i)){if(e===i)return r;break}u=e}return P.Create(u)}}class Nl extends Xr{constructor(t){super(t)}get Name(){return"LookFloor"}evaluate(t,e){let r=this.mc(t,e);if(r.IsError)return r;let s=this.Ic(t,e);if(s.IsError)return s;let n=[];if(L.Me(s.ArrayValue,n),0===n.length)return this.oc(2);n.sort((t,e)=>t-e);let i=r.NumberValue,u=n[0];if(u===i)return r;for(let t=1;t<n.length;t++){let e=n[t];if(!(e<i)){if(e===i)return r;break}u=e}return P.Create(u)}}class xl extends Xr{constructor(t){super(t)}get Name(){return"Has"}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;if(r.IsArrayJson)return P.Create(r.yi(s));if(r.IsJson){let t=r.JsonValue;if(Array.isArray(t))for(let e=0;e<t.length;e++){let r=t[e];if("string"==typeof r){if(r===s.TextValue)return P.True}else if("number"==typeof r){if(r.toString()===s.TextValue)return P.True}else if("boolean"==typeof r&&r.toString().toLowerCase()===s.TextValue.toLowerCase())return P.True}else if(void 0!==t[s.TextValue])return P.True;return P.False}if(r.IsArray){let t=r.ArrayValue;for(let e of t){let t=e.ToText();if(!t.IsError&&t.TextValue===s.TextValue)return P.True}return P.False}return this.oc(1)}}class Tl extends Xr{constructor(t){super(t)}get Name(){return"HasValue"}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.Tc(t,e);if(s.IsError)return s;if(r.IsArrayJson)return P.Create(r.Rd(s));if(r.IsJson){let t=r.JsonValue;if(Array.isArray(t))for(let e=0;e<t.length;e++){let r=t[e];if("string"==typeof r){if(r===s.TextValue)return P.True}else if("number"==typeof r){if(r.toString()===s.TextValue)return P.True}else if("boolean"==typeof r&&r.toString().toLowerCase()===s.TextValue.toLowerCase())return P.True}else for(let e in t){let r=t[e];if("string"==typeof r){if(r===s.TextValue)return P.True}else if("number"==typeof r){if(r.toString()===s.TextValue)return P.True}else if("boolean"==typeof r&&r.toString().toLowerCase()===s.TextValue.toLowerCase())return P.True}return P.False}if(r.IsArray){let t=r.ArrayValue;for(let e of t){let t=e.ToText();if(!t.IsError&&t.TextValue===s.TextValue)return P.True}return P.False}return this.oc(1)}}class El extends Ls{get Name(){return"If"}constructor(t){super(t)}evaluate(t,e){let r=this.Nc(t,e);return r.IsError?r:r.BooleanValue?this.b.evaluate(t,e):null===this.c?P.False:this.c.evaluate(t,e)}}class Sl extends Ls{get Name(){return"IfError"}constructor(t){super(t)}evaluate(t,e){return this.a.evaluate(t,e).IsError?this.b.evaluate(t,e):this.c.evaluate(t,e)}}class Ml extends Xr{get Name(){return"IsError"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return null!=this.b?r.IsError?this.b.evaluate(t,e):r:r.IsError?P.True:P.False}}class Il extends Xr{get Name(){return"IsNull"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return null!=this.b?r.IsNull||r.IsText&&null==r.TextValue?this.b.evaluate(t,e):r:r.IsNull||r.IsText&&null==r.TextValue?P.True:P.False}}class Al extends Xr{get Name(){return"IsNullorError"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return null!==this.b?r.IsNull||r.IsError||r.IsText&&null===r.TextValue?this.b.evaluate(t,e):r:r.IsNull||r.IsError||r.IsText&&null===r.TextValue?P.True:P.False}}class yl extends Jr{get Name(){return"IsEven"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return r.IsNumber&&r.IntValue%2==0?P.True:P.False}}class Dl extends Jr{get Name(){return"IsLogical"}constructor(t){super(t)}evaluate(t,e){return this.a.evaluate(t,e).IsBoolean?P.True:P.False}}class bl extends Jr{get Name(){return"IsOdd"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);return r.IsNumber&&r.IntValue%2==1?P.True:P.False}}class Cl extends Jr{get Name(){return"IsNonText"}constructor(t){super(t)}evaluate(t,e){return this.a.evaluate(t,e).IsText?P.False:P.True}}class Rl extends Jr{get Name(){return"IsNullOrEmpty"}constructor(t){super(t)}evaluate(t,e){let r,s=this.a.evaluate(t,e);if(s.IsNull)return P.True;if(s.IsNotText){if(r=s.ToText(StringCache.Function_parameter_error,"IsNullOrEmpty",1),r.IsError)return r}else r=s;return null===r.TextValue||""===r.TextValue?P.True:P.False}}class Ol extends Jr{get Name(){return"IsNullOrWhiteSpace"}constructor(t){super(t)}evaluate(t,e){let r,s=this.a.evaluate(t,e);if(s.IsNull)return P.True;if(s.IsNotText){if(r=s.ToText(StringCache.Function_parameter_error,"IsNullOrWhiteSpace",1),r.IsError)return r}else r=s;return null===r.TextValue||""===r.TextValue.trim()?P.True:P.False}}class Fl extends Jr{get Name(){return"IsNumber"}constructor(t){super(t)}evaluate(t,e){return this.a.evaluate(t,e).IsNumber?P.True:P.False}}class kl extends Jr{get Name(){return"IsText"}constructor(t){super(t)}evaluate(t,e){return this.a.evaluate(t,e).IsText?P.True:P.False}}class Ll extends us{get Name(){return"Array"}constructor(t){super(t)}evaluate(t,e){let r=[];for(let s=0;s<this.z.length;s++){let n=this.z[s].evaluate(t,e);if(n.IsError)return n;r.push(n)}return P.Create(r)}}class _l extends Jr{get Name(){return"Json"}constructor(t){super(t)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;if(r.IsJson)return r;if(r.IsArrayJson&&(r=r.ToText()),r.IsNotText)return this.cc();let s=r.TextValue;if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{let t=k.Se(s);return P.Create(t)}catch(t){}return this.cc()}}class Pl extends us{get Name(){return"ArrayJson"}constructor(t){super(t)}evaluate(t,e){let r=new $;for(let s of this.z){let n=s.evaluate(t,e);r.AddValue(n._e)}return r}sc(t,e){t.append("{");for(let e=0;e<this.z.length;e++)e>0&&t.append(", "),this.z[e].sc(t,!1);t.append("}")}}class Vl extends Jr{get Name(){return"ArrayJsonItem"}constructor(t,e){super(e),this.key=t}evaluate(t,e){let r={key:this.key,value:this.a.evaluate(t,e)};return new W(r)}sc(t,e){t.append(this.key),t.append(":"),this.a.sc(t,!1)}}class Bl extends Xr{get Name(){return"GetJsonValue"}constructor(t,e){super(t,e)}evaluate(t,e){let r=this.a.evaluate(t,e);if(r.IsError)return r;let s=this.b.evaluate(t,e);if(s.IsError)return s;if(r.IsArray){if(s=s.ToNumber("Function '{0}' ARRARY index is error!","GetJsonValue"),s.IsError)return s;let e=s.IntValue-t.ExcelIndex;return e<r.ArrayValue.length?r.ArrayValue[e]:P.Error("Function '{0}' ARRARY index {1} greater than maximum length!","GetJsonValue",e)}if(r.IsArrayJson){if(s.IsNumber){let t=r.TryGetValue(s.NumberValue.toString());return null!==t?t:P.Error("Function '{0}' Parameter name '{1}' is missing!","GetJsonValue",s.TextValue)}if(s.IsText){let t=r.TryGetValue(s.TextValue);return null!==t?t:P.Error("Function '{0}' Parameter name '{1}' is missing!","GetJsonValue",s.TextValue)}return P.Error("Function '{0}' Parameter name is missing!","GetJsonValue")}if(r.IsJson){let e=r.JsonValue;if(e.IsArray){if(s=s.ToNumber("Function '{0}' JSON parameter index is error!","GetJsonValue"),s.IsError)return s;let r=s.IntValue-t.ExcelIndex;if(r<e.W.length){let t=e.W[r];return t.IsString?P.Create(t.StringValue):t.IsBoolean?P.Create(t.BooleanValue):t.IsDouble?P.Create(t.NumberValue):t.IsObject||t.IsArray?P.Create(t):t.IsNull?P.CreateNull():P.Create(t)}return P.Error("Function '{0}' JSON index {1} greater than maximum length!","GetJsonValue",r)}if(e.IsObject){if(s=s.ToText("Function '{0}' JSON parameter name is error!","GetJsonValue"),s.IsError)return s;let t=e.Y[s.TextValue];if(t)return t.IsString?P.Create(t.StringValue):t.IsBoolean?P.Create(t.BooleanValue):t.IsDouble?P.Create(t.NumberValue):t.IsObject||t.IsArray?P.Create(t):t.IsNull?P.CreateNull():P.Create(t)}}return P.Error("Function '{0}' Operator is error!","GetJsonValue")}sc(t,e){this.a.sc(t,!1),t.append("["),this.b.sc(t,!1),t.append("]")}}class Ul{static Od=null;static Fd(){return this.Od||(this.Od={KM:5,M:4,DM:3,CM:2,MM:1,KM2:15,M2:14,DM2:13,CM2:12,MM2:11,M3:24,DM3:23,CM3:22,MM3:21,KM3:25,L:23,ML:22,T:33,KG:32,G:31}),this.Od}static kd(t,r,s,n,i,h){if(1===r)switch(s){case u.MM:return t;case u.CM:return.1*t;case u.DM:return.01*t;case u.M:return.001*t;case u.KM:return 1e-6*t;default:throw new Error("Number unit is error!")}else if(2===r)switch(s){case u.MM:return 10*t;case u.CM:return t;case u.DM:return.1*t;case u.M:return.01*t;case u.KM:return 1e-5*t;default:throw new Error("Number unit is error!")}else if(3===r)switch(s){case u.MM:return 100*t;case u.CM:return 10*t;case u.DM:return t;case u.M:return.1*t;case u.KM:return 1e-4*t;default:throw new Error("Number unit is error!")}else if(4===r)switch(s){case u.MM:return 1e3*t;case u.CM:return 100*t;case u.DM:return 10*t;case u.M:return t;case u.KM:return.001*t;default:throw new Error("Number unit is error!")}else if(5===r)switch(s){case u.MM:return 1e6*t;case u.CM:return 1e5*t;case u.DM:return 1e4*t;case u.M:return 1e3*t;case u.KM:return t;default:throw new Error("Number unit is error!")}else if(11===r)switch(n){case e.MM2:return t;case e.CM2:return.01*t;case e.DM2:return 1e-4*t;case e.M2:return 1e-6*t;case e.KM2:return 1e-12*t;default:throw new Error("Number unit is error!")}else if(12===r)switch(n){case e.MM2:return 100*t;case e.CM2:return t;case e.DM2:return.01*t;case e.M2:return 1e-4*t;case e.KM2:return 1e-10*t;default:throw new Error("Number unit is error!")}else if(13===r)switch(n){case e.MM2:return 1e4*t;case e.CM2:return 100*t;case e.DM2:return t;case e.M2:return.01*t;case e.KM2:return 1e-8*t;default:throw new Error("Number unit is error!")}else if(14===r)switch(n){case e.MM2:return 1e6*t;case e.CM2:return 1e4*t;case e.DM2:return 100*t;case e.M2:return t;case e.KM2:return 1e-6*t;default:throw new Error("Number unit is error!")}else if(15===r)switch(n){case e.MM2:return 1e12*t;case e.CM2:return 1e10*t;case e.DM2:return 1e8*t;case e.M2:return 1e6*t;case e.KM2:return t;default:throw new Error("Number unit is error!")}else if(21===r)switch(i){case a.MM3:return t;case a.CM3:return.001*t;case a.DM3:return 1e-6*t;case a.M3:return 1e-9*t;case a.KM3:return 1e-18*t;default:throw new Error("Number unit is error!")}else if(22===r)switch(i){case a.MM3:return 1e3*t;case a.CM3:return t;case a.DM3:return.001*t;case a.M3:return 1e-6*t;case a.KM3:return 1e-15*t;default:throw new Error("Number unit is error!")}else if(23===r)switch(i){case a.MM3:return 1e6*t;case a.CM3:return 1e3*t;case a.DM3:return t;case a.M3:return.001*t;case a.KM3:return 1e-12*t;default:throw new Error("Number unit is error!")}else if(24===r)switch(i){case a.MM3:return 1e9*t;case a.CM3:return 1e6*t;case a.DM3:return 1e3*t;case a.M3:return t;case a.KM3:return 1e-9*t;default:throw new Error("Number unit is error!")}else if(25===r)switch(i){case a.MM3:return 1e18*t;case a.CM3:return 1e15*t;case a.DM3:return 1e12*t;case a.M3:return 1e9*t;case a.KM3:return t;default:throw new Error("Number unit is error!")}else if(31===r)switch(h){case l.G:return t;case l.KG:return.001*t;case l.T:return 1e-6*t;default:throw new Error("Number unit is error!")}else if(32===r)switch(h){case l.G:return 1e3*t;case l.KG:return t;case l.T:return.001*t;default:throw new Error("Number unit is error!")}else if(33===r)switch(h){case l.G:return 1e6*t;case l.KG:return 1e3*t;case l.T:return t;default:throw new Error("Number unit is error!")}throw new Error("Number unit is error!")}}class Hl extends qr{get Name(){return"Num"}constructor(t,e){super(),this.d=t,this.unit=e}evaluate(t,e){let r=Ul.Fd(),s=this.unit.toUpperCase(),n=Ul.kd(this.d,r[s],t.DistanceUnit,t.AreaUnit,t.VolumeUnit,t.MassUnit);return P.Create(n)}sc(t,e){t.append(this.d),t.append(this.unit)}}class Gl extends Xr{get Name(){return"Param"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);if(r.IsError)return r;if(null!==e){let s=e(t,r.TextValue);if(null!==s)return s}let s=t.Ld(r.TextValue);return s.IsError&&null!==this.b?this.b.evaluate(t,e):s}}class ql extends qr{get Name(){return"Parameter"}constructor(t,e){super(),"string"==typeof t?this.name=t:this._d=t}evaluate(t,e){let r=this.name;if(null==r){let s=this._d.evaluate(t,e);if(s=s.ToText(),s.IsError)return s;r=s.TextValue}if(e&&null!==e){let s=e(t,r);if(null!==s)return s}return t.Ld(r)}sc(t,e){void 0===this.name||null===this.name?this._d.sc(t,!1):t.append(this.name)}}class Jl extends us{get Name(){return"DiyFunction"}constructor(t,e){super(e),this.Pd=t}evaluate(t,e){let r=[];for(let s of this.z){let n=s.evaluate(t,e);r.push(n)}return t.ExecuteDiyFunction(this.Pd,r)}sc(t,e){this.wc(t,this.Pd)}}class Xl extends Jr{get Name(){return"Error"}constructor(t){super(t)}evaluate(t,e){let r=this.gc(t,e);return r.IsError?r:P.Error(r.TextValue)}}class $l{static Vd(t){if("string"!=typeof t||1!==t.length)return t;let e=t.charCodeAt(0);return e>=65&&e<=90?t:e<=127?t.toUpperCase():e<=65280?"×"==t?"*":"÷"==t?"/":"‘"==t||"’"==t?"'":'"'==t||'"'==t?'"':12288==e?String.fromCharCode(32):"【"==t?"[":"】"==t?"]":"〔"==t?"(":"〕"==t?")":t:(e<65375&&(t=String.fromCharCode(e-65248)),t.toUpperCase())}static Bd(t){for(var e=[],r=0;r<t.length;r++)e.push(this.Vd(t[r]));return e.join("")}static equals(t,e){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!=e[r]&&this.Vd(t[r])!=e[r])return!1;return!0}static Ud(t,e,r){return!!this.equals(t,e)||!!this.equals(t,r)}static Hd(t,e,r,s){return!!this.equals(t,e)||!!this.equals(t,r)||!!this.equals(t,s)}}const Wl={IF:t=>new El(t),IFERROR:t=>new Sl(t),ISNUMBER:t=>new Fl(t),ISTEXT:t=>new kl(t),ISERROR:t=>new Ml(t),ISNONTEXT:t=>new Cl(t),ISLOGICAL:t=>new Dl(t),ISEVEN:t=>new yl(t),ISODD:t=>new bl(t),ISNULL:t=>new Il(t),ISNULLORERROR:t=>new Al(t),AND:t=>new ns(t),OR:t=>new is(t),NOT:t=>new ls(t),DEC2BIN:t=>new qs(t),DEC2HEX:t=>new Xs(t),DEC2OCT:t=>new Js(t),HEX2BIN:t=>new $s(t),HEX2DEC:t=>new js(t),HEX2OCT:t=>new Ws(t),OCT2BIN:t=>new Us(t),OCT2DEC:t=>new Hs(t),OCT2HEX:t=>new Gs(t),BIN2OCT:t=>new Ps(t),BIN2DEC:t=>new Vs(t),BIN2HEX:t=>new Bs(t),ABS:t=>new os(t),QUOTIENT:t=>new cs(t),MOD:t=>new jr(t),SIGN:t=>new fs(t),SQRT:t=>new ds(t),TRUNC:t=>new ws(t),INT:t=>new ws(t),GCD:t=>new gs(t),LCM:t=>new ps(t),COMBIN:t=>new ms(t),PERMUT:t=>new vs(t),DEGREES:t=>new xs(t),RADIANS:t=>new Ts(t),COS:t=>new Es(t),COSH:t=>new Ss(t),SIN:t=>new Ms(t),SINH:t=>new Is(t),TAN:t=>new As(t),TANH:t=>new ys(t),ACOS:t=>new Ds(t),ACOSH:t=>new bs(t),ASIN:t=>new Cs(t),ASINH:t=>new Rs(t),ATAN:t=>new Os(t),ATANH:t=>new Fs(t),ATAN2:t=>new ks(t),ROUND:t=>new Ks(t),ROUNDDOWN:t=>new zs(t),ROUNDUP:t=>new Ys(t),CEILING:t=>new Qs(t),FLOOR:t=>new Zs(t),EVEN:t=>new tn(t),ODD:t=>new en(t),MROUND:t=>new rn(t),RANDBETWEEN:t=>new nn(t),FACT:t=>new hn(t),FACTDOUBLE:t=>new an(t),POWER:t=>new on(t),EXP:t=>new cn(t),LN:t=>new fn(t),LOG:t=>new dn(t),LOG10:t=>new wn(t),MULTINOMIAL:t=>new gn(t),PRODUCT:t=>new pn(t),SQRTPI:t=>new mn(t),SUMSQ:t=>new vn(t),ASC:t=>new Nn(t),JIS:t=>new xn(t),WIDECHAR:t=>new xn(t),CHAR:t=>new Tn(t),CLEAN:t=>new En(t),CODE:t=>new Sn(t),CONCATENATE:t=>new Mn(t),EXACT:t=>new In(t),FIND:t=>new An(t),FIXED:t=>new _s(t),LEFT:t=>new yn(t),LEN:t=>new Dn(t),LOWER:t=>new bn(t),TOLOWER:t=>new bn(t),MID:t=>new Cn(t),PROPER:t=>new Rn(t),REPLACE:t=>new Fn(t),REPT:t=>new kn(t),RIGHT:t=>new Ln(t),RMB:t=>new _n(t),SEARCH:t=>new Pn(t),SUBSTITUTE:t=>new Vn(t),T:t=>new Bn(t),TEXT:t=>new Un(t),TRIM:t=>new Hn(t),UPPER:t=>new Gn(t),TOUPPER:t=>new Gn(t),VALUE:t=>new as(t),DATEVALUE:t=>new qn(t),TIMEVALUE:t=>new Xn(t),DATE:t=>new $n(t),TIME:t=>new Wn(t),YEAR:t=>new zn(t),MONTH:t=>new Yn(t),DAY:t=>new Qn(t),HOUR:t=>new Zn(t),MINUTE:t=>new ti(t),SECOND:t=>new ei(t),WEEKDAY:t=>new ri(t),DATEDIF:t=>new si(t),DAYS360:t=>new ni(t),EDATE:t=>new ii(t),EOMONTH:t=>new ui(t),NETWORKDAYS:t=>new li(t),WORKDAY:t=>new hi(t),WEEKNUM:t=>new ai(t),MAX:t=>new pi(t),MEDIAN:t=>new mi(t),MIN:t=>new vi(t),QUARTILE:t=>new Ji(t),MODE:t=>new Xi(t),LARGE:t=>new $i(t),SMALL:t=>new Wi(t),PERCENTILE:t=>new ji(t),"PERCENTILE.INC":t=>new ji(t),PERCENTRANK:t=>new Ki(t),"PERCENTRANK.INC":t=>new Ki(t),AVERAGE:t=>new zi(t),AVERAGEIF:t=>new Yi(t),GEOMEAN:t=>new Qi(t),HARMEAN:t=>new Zi(t),COUNT:t=>new tu(t),COUNTIF:t=>new eu(t),SUM:t=>new ru(t),SUMIF:t=>new su(t),AVEDEV:t=>new nu(t),STDEV:t=>new iu(t),"STDEV.S":t=>new iu(t),STDEVP:t=>new uu(t),"STDEV.P":t=>new uu(t),COVAR:t=>new ln(t),"COVARIANCE.P":t=>new ln(t),"COVARIANCE.S":t=>new un(t),DEVSQ:t=>new lu(t),VAR:t=>new hu(t),"VAR.S":t=>new hu(t),VARP:t=>new au(t),"VAR.P":t=>new au(t),NORMDIST:t=>new ou(t),"NORM.DIST":t=>new ou(t),NORMINV:t=>new cu(t),"NORM.INV":t=>new cu(t),NORMSDIST:t=>new fu(t),"NORM.S.DIST":t=>new fu(t),NORMSINV:t=>new du(t),"NORM.S.INV":t=>new du(t),BETADIST:t=>new wu(t),"BETA.DIST":t=>new wu(t),BETAINV:t=>new gu(t),"BETA.INV":t=>new gu(t),BINOMDIST:t=>new pu(t),"BINOM.DIST":t=>new pu(t),EXPONDIST:t=>new mu(t),"EXPON.DIST":t=>new mu(t),FDIST:t=>new vu(t),"F.DIST":t=>new vu(t),FINV:t=>new Nu(t),"F.INV":t=>new Nu(t),FISHER:t=>new xu(t),FISHERINV:t=>new Tu(t),GAMMADIST:t=>new Eu(t),"GAMMA.DIST":t=>new Eu(t),GAMMAINV:t=>new Su(t),"GAMMA.INV":t=>new Su(t),GAMMALN:t=>new Mu(t),"GAMMALN.PRECISE":t=>new Mu(t),HYPGEOMDIST:t=>new Iu(t),"HYPGEOM.DIST":t=>new Iu(t),LOGINV:t=>new Au(t),"LOGNORM.INV":t=>new Au(t),LOGNORMDIST:t=>new yu(t),"LOGNORM.DIST":t=>new yu(t),NEGBINOMDIST:t=>new Du(t),"NEGBINOM.DIST":t=>new Du(t),POISSON:t=>new bu(t),"POISSON.DIST":t=>new bu(t),TDIST:t=>new Cu(t),"T.DIST":t=>new Cu(t),TINV:t=>new Ru(t),"T.INV":t=>new Ru(t),WEIBULL:t=>new Ou(t),URLENCODE:t=>new Fu(t),URLDECODE:t=>new ku(t),HTMLENCODE:t=>new Lu(t),HTMLDECODE:t=>new _u(t),BASE64TOTEXT:t=>new Pu(t),BASE64URLTOTEXT:t=>new Vu(t),TEXTTOBASE64:t=>new Bu(t),TEXTTOBASE64URL:t=>new Uu(t),REGEX:t=>new Hu(t),REGEXREPALCE:t=>new Gu(t),ISREGEX:t=>new qu(t),ISMATCH:t=>new qu(t),MD5:t=>new $u(t),SHA1:t=>new ju(t),SHA256:t=>new zu(t),SHA512:t=>new Qu(t),HMACMD5:t=>new tl(t),HMACSHA1:t=>new rl(t),HMACSHA256:t=>new nl(t),HMACSHA512:t=>new ul(t),TRIMSTART:t=>new dl(t),LTRIM:t=>new dl(t),TRIMEND:t=>new wl(t),RTRIM:t=>new wl(t),INDEXOF:t=>new al(t),LASTINDEXOF:t=>new ol(t),SPLIT:t=>new cl(t),JOIN:t=>new ml(t),SUBSTRING:t=>new fl(t),STARTSWITH:t=>new ll(t),ENDSWITH:t=>new hl(t),ISNULLOREMPTY:t=>new Rl(t),ISNULLORWHITESPACE:t=>new Ol(t),REMOVESTART:t=>new gl(t),REMOVEEND:t=>new pl(t),JSON:t=>new _l(t),LOOKCEILING:t=>new vl(t),LOOKFLOOR:t=>new Nl(t),ARRAY:t=>new Ll(t),ADDYEARS:t=>new ci(t),ADDMONTHS:t=>new oi(t),ADDDAYS:t=>new wi(t),ADDHOURS:t=>new gi(t),ADDMINUTES:t=>new di(t),ADDSECONDS:t=>new fi(t),TIMESTAMP:t=>new Jn(t),HAS:t=>new xl(t),HASKEY:t=>new xl(t),CONTAINS:t=>new xl(t),CONTAINSKEY:t=>new xl(t),HASVALUE:t=>new Tl(t),CONTAINSVALUE:t=>new Tl(t),PARAM:t=>new Gl(t),PARAMETER:t=>new Gl(t),GETPARAMETER:t=>new Gl(t),ERROR:t=>new Xl(t)};class jl extends Gr{static Gd(){return Wl}qd(t){let e=t.Fo(),r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=e[t].accept(this);return r}Jd(t){return t.Fo().accept(this)}Vo(t){return this.Jd(t)}Ko(t){let e=this.qd(t),r=t._o.text;return $l.equals(r,"*")?new $r(e):$l.equals(r,"/")?new Wr(e):new jr(e)}Xo(t){let e=this.qd(t),r=t._o.text;return $l.equals(r,"&")?new Yr(e):$l.equals(r,"+")?new Kr(e):new zr(e)}Uo(t){let e=this.qd(t),r=t._o.text;return $l.Hd(r,"=","==","===")?new Qr(e):$l.equals(r,"<")?new Zr(e):$l.equals(r,"<=")?new ts(e):$l.equals(r,">")?new es(e):$l.equals(r,">=")?new rs(e):new ss(e)}Ho(t){let e=this.qd(t),r=t._o.text;return $l.equals(r,"&&")?new ns(e):new is(e)}qo(t){let e=$l.Bd(t.f.text);if("E"===e)return new hs(P.Create(Math.E),"E");if("PI"===e)return new hs(P.Create(Math.PI),"PI");if("TRUE"===e||"YES"===e||"是"===e||"有"===e)return new hs(P.True,e);if("FALSE"===e||"NO"===e||"不是"===e||"否"===e||"没有"===e||"无"===e)return new hs(P.False,e);if("ALGORITHMVERSION"===e||"ENGINEVERSION"===e)return new hs(P.Version,e);if("RAND"===e)return new sn;if("GUID"===e)return new Ju;if("NOW"===e)return new jn;if("TODAY"===e)return new Kn;let r=this.qd(t),s=Wl[e];return s?s(r):new Jl(e,r)}Qo(t){let e=t.PARAMETER(),r=$l.Bd(e.br());return"E"===r?new hs(P.Create(Math.E),"E"):"PI"===r?new hs(P.Create(Math.PI),"PI"):"TRUE"===r||"YES"===r||"是"===r||"有"===r?new hs(P.True,r):"FALSE"===r||"NO"===r||"不是"===r||"否"===r||"没有"===r||"无"===r?new hs(P.False,r):"ALGORITHMVERSION"===r||"ENGINEVERSION"===r?new hs(P.Version,r):new ql(e.br())}Go(t){let e=this.Jd(t);return new Ns(e)}Jo(t){let e=t.br(),r=[],s=1;for(;s<e.length-1;){let t=e[s++];if("\\"===t){let t=e[s++];"n"===t?r.push("\n"):"r"===t?r.push("\r"):"t"===t?r.push("\t"):"0"===t?r.push("\0"):"v"===t?r.push("\v"):"a"===t?r.push("a"):"b"===t?r.push("\b"):"f"===t?r.push("\f"):r.push(e[s++])}else r.push(t)}return new hs(P.Create(r.join("")))}$o(t){let e=t.ko(),r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=e[t].accept(this);return new Pl(r)}Wo(t){let e=this.qd(t);if(null!=t.Po){let r=t.Po.text.trim().replace(/^["'"\s\t\r\n\f]+|["'"\s\t\r\n\f]+$/g,""),s=new hs(P.Create(r),r);return new Bl(e[0],s)}if(null!=t.PARAMETER()){let r=t.PARAMETER(),s=new ql(r.br?r.br():r.text);return new Bl(e[0],s)}return new Bl(e[0],e[1])}jo(t){let e=this.qd(t);return new Ll(e)}zo(t){let e=this.Jd(t);return new ls(e)}Yo(t){return this.Jd(t)}Zo(t){let e=t.Lo().br(),r=parseFloat(e);if(null==t.unit)return new hs(P.Create(r),e);let s=t.unit.text;return new Hl(r,s)}tc(t){return new hs(P.CreateNull(),"NULL")}ec(t){let e=parseFloat(t.br());return new hs(P.Create(e),t.br())}rc(t){let e=null;t.key&&(e=t.key.text.replace(/^["'"\s\t\r\n\f]+|["'"\s\t\r\n\f]+$/g,""));let r=this.Jd(t);return new Vl(e,r)}Bo(t){let e=this.qd(t);return new El(e)}}class Kl{constructor(t,e){if(this.name="<empty>",this.Xd=t,this.$d=e||!1,this.Wd=0,this.data=[],this.$d)for(let t=0;t<this.Xd.length;){let e=this.Xd.codePointAt(t);this.data.push(e),t+=e<=65535?1:2}else{this.data=new Array(this.Xd.length);for(let t=0;t<this.Xd.length;t++)this.data[t]=this.Xd.charCodeAt(t)}this.jd=this.data.length}reset(){this.Wd=0}xs(){if(this.Wd>=this.jd)throw"cannot consume EOF";this.Wd+=1}LA(t){if(0===t)return 0;t<0&&(t+=1);let e=this.Wd+t-1;return e<0||e>=this.jd?j.EOF:this.data[e]}LT(t){return this.LA(t)}mark(){return-1}release(t){}seek(t){t<=this.Wd?this.Wd=t:this.Wd=Math.min(t,this.jd)}br(t,e){if(e>=this.jd&&(e=this.jd-1),t>=this.jd)return"";if(this.$d){let r="";for(let s=t;s<=e;s++)r+=String.fromCodePoint(this.data[s]);return r}return this.Xd.slice(t,e+1)}toString(){return this.Xd}get index(){return this.Wd}get size(){return this.jd}}class zl extends Kl{constructor(t,e){super(t,e)}LA(t){if(0===t)return 0;t<0&&(t+=1);let e=this.Wd+t-1;if(e<0||e>=this.jd)return j.EOF;let r=this.data[e];return $l.Vd(String.fromCharCode(r)).charCodeAt(0)}}class Yl{constructor(){this.ExcelIndex=1,this.UseLocalTime=!0,this.DistanceUnit=u.M,this.AreaUnit=e.M2,this.VolumeUnit=a.M3,this.MassUnit=l.KG,this.LastError=null}set UseExcelIndex(t){this.ExcelIndex=t?1:0}Ld(t){return P.Error(`Parameter [${t}] is missing.`)}ExecuteDiyFunction(t,e){return P.Error(`DiyFunction [${t}] is missing.`)}Parse(t){if(this.LastError=null,!t||""===t.trim())throw this.LastError="Parameter exp invalid !",new Error(this.LastError);let e=new Hr,r=new zl(t),s=new pr(r,null,e);s.sr(),s.rr(e);let n=new ht(s),i=new xr(n,null,e);i.sr(),i.rr(e);let u=i.Oo();if(e.IsError)throw this.LastError=e.ErrorMsg,new Error(this.LastError);return(new jl).ta(u)}Evaluate(t){return t.evaluate(this)}TryEvaluate_Int(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsNumber){let t=r.ToNumber("It can't be converted to number!");if(t.IsError)return this.LastError=t.ErrorMsg,e;r=t}return r.IntValue}catch(t){this.LastError=t.message+"\n"+t.stack}return e}TryEvaluate_Double(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsNumber){let t=r.ToNumber("It can't be converted to number!");if(t.IsError)return this.LastError=t.ErrorMsg,e;r=t}return r.NumberValue}catch(t){this.LastError=t.message+"\n"+t.stack}return e}TryEvaluate_String(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsText){let t=r.ToText("It can't be converted to string!");return t.IsError?(this.LastError=t.ErrorMsg,e):t.TextValue}return r.TextValue}catch(t){this.LastError=t.message+"\n"+t.stack}return e}TryEvaluate_Boolean(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsBoolean){let t=r.ToBoolean("It can't be converted to bool!");if(t.IsError)return this.LastError=t.ErrorMsg,e}return r.BooleanValue}catch(t){this.LastError=t.message+"\n"+t.stack}return e}TryEvaluate_DateTime(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsDate){let t=r.ToMyDate("It can't be converted to DateTime!");if(t.IsError)return this.LastError=t.ErrorMsg,e}return this.UseLocalTime?r.DateValue.ToDateTime(1):r.DateValue.ToDateTime(0)}catch(t){this.LastError=t.message+"\n"+t.stack}return e}TryEvaluate_TimeSpan(t,e){try{let r=this.Parse(t).evaluate(this);if(!r.IsDate){let t=r.ToMyDate("It can't be converted to DateTime!");if(t.IsError)return this.LastError=t.ErrorMsg,e}return r.DateValue.ToTimeSpan()}catch(t){this.LastError=t.message+"\n"+t.stack}return e}}class Ql extends Yl{constructor(t=!1){super(),this.IgnoreCase=t,this.UseTempDict=!1,this.Kd={}}Ld(t){let e=this.IgnoreCase?t.toLowerCase():t;if(void 0!==this.Kd[e])return this.Kd[e];let r=super.Ld?super.Ld(t):P.CreateNull();return this.UseTempDict&&(this.Kd[e]=r),r}ClearParameters(){this.Kd={}}AddParameter(t,e){let r=this.IgnoreCase?t.toLowerCase():t;this.Kd[r]=e instanceof P?e:P.Create(e)}AddParameterFromJson(t){if(t.startsWith("{")&&t.endsWith("}")){let e=k.Se(t);if(e.IsObject){let t=e.rt();for(let e in t)if(t.hasOwnProperty(e)){let r=t[e],s=this.IgnoreCase?e.toLowerCase():e;r.IsString?this.Kd[s]=P.Create(r.StringValue):r.IsBoolean?this.Kd[s]=P.Create(r.BooleanValue):r.IsDouble?this.Kd[s]=P.Create(r.NumberValue):r.IsObject||r.IsArray?this.Kd[s]=P.Create(r):r.IsNull&&(this.Kd[s]=P.CreateNull())}return}}throw new Error("Parameter is not json string.")}}"undefined"!=typeof window&&(window.AlgorithmEngineEx=Ql);class Zl extends Gr{constructor(){super(),this.zd={Parameters:[],Functions:[]}}Qo(t){let e=t.PARAMETER();if(e){let r=$l.Bd(e.br());if("E"===r)return this.pi(t);if("PI"===r)return this.pi(t);if("TRUE"===r||"YES"===r||"是"===r||"有"===r)return this.pi(t);if("FALSE"===r||"NO"===r||"不是"===r||"否"===r||"没有"===r||"无"===r)return this.pi(t);if("ALGORITHMVERSION"===r||"ENGINEVERSION"===r)return this.pi(t);let s=e.So();this.zd.Parameters.push({Name:e.br(),Start:s.start,End:s.stop})}return this.pi(t)}Wo(t){let e=t.PARAMETER();if(e){let t=e.So();this.zd.Parameters.push({Name:e.br(),Start:t.start,End:t.stop})}return this.pi(t)}qo(t){let e=t.f;if(!e)return this.pi(t);let r=$l.Bd(e.text);return"E"===r||"PI"===r||"TRUE"===r||"YES"===r||"是"===r||"有"===r||"FALSE"===r||"NO"===r||"不是"===r||"否"===r||"没有"===r||"无"===r||"ALGORITHMVERSION"===r||"ENGINEVERSION"===r||"RAND"===r||"GUID"===r||"NOW"===r||"TODAY"===r||Wl[r]||this.zd.Functions.push({Name:e.text,Start:e.start,End:e.stop}),this.pi(t)}}class th extends Gr{Vo(t){return t.Fo().accept(this)}Ho(t){let e={Yd:[]},r=t._o.text;$l.Ud(r,"&&","and")?e.Type=i.And:e.Type=i.Or;let s=t.Fo();return e.Yd.push(s[0].accept(this)),e.Yd.push(s[1].accept(this)),e.start=t.start?t.start.start:0,e.end=t.stop?t.stop.stop:t.br().length-1,e.Qd=t.br(),e}Yo(t){return t.Fo().accept(this)}pi(t){return{Type:i.String,start:t.start?t.start.start:0,end:t.stop?t.stop.stop:t.br().length-1,Qd:t.br()}}}class eh extends Gr{Vo(t){return t.Fo().accept(this)}Yo(t){return t.Fo().accept(this)}Ko(t){let e={Yd:[]},r=t.Fo(),s=t._o.text;return $l.equals(s,"*")?e.Type=n.Mul:$l.equals(s,"/")?e.Type=n.Div:e.Type=n.Mod,e.Yd.push(r[0].accept(this)),e.Yd.push(r[1].accept(this)),e.start=t.start?t.start.start:0,e.end=t.stop?t.stop.stop:t.br().length-1,e.Qd=t.br(),e}Xo(t){let e={Yd:[]},r=t.Fo(),s=t._o.text;return $l.equals(s,"+")?e.Type=n.Add:$l.equals(s,"-")?e.Type=n.Sub:e.Type=n.Connect,e.Yd.push(r[0].accept(this)),e.Yd.push(r[1].accept(this)),e.start=t.start?t.start.start:0,e.end=t.stop?t.stop.stop:t.br().length-1,e.Qd=t.br(),e}pi(t){return{Type:n.String,start:t.start?t.start.start:0,end:t.stop?t.stop.stop:t.br().length-1,Qd:t.br()}}}class rh extends Error{constructor(t){super(`The Unit '${t}' is not supported by this converter`),this.name="UnitNotSupportedException"}}class sh{constructor(...t){this.Zd=[...t]}contains(t){if(t instanceof sh){for(let e of t.Zd)if(this.contains(e))return!0;return!1}return"string"==typeof t&&this.Zd.some(e=>e.toLowerCase()===t.toLowerCase())}toString(){return this.Zd.join(", ")}}sh.tw=function(t){return new sh(t)};class nh{constructor(){this.ew={}}set(t,e){this.ew[t.toString()]={rw:t,sw:e}}get keys(){return Object.values(this.ew).map(t=>t.rw)}get values(){return Object.values(this.ew).map(t=>t.sw)}get entries(){return Object.values(this.ew)}nw(t){for(let e of Object.values(this.ew))if(e.rw.contains(t))return e.rw;return null}iw(t){for(let e of Object.values(this.ew))if(e.rw.contains(t))return e.sw;throw new rh(t.toString())}}class ih{instantiate(t,e,r){this.units=t,this.uw=e,this.lw=r}hw(t){return t/this.units.iw(this.uw)*this.units.iw(this.lw)}}class uh extends ih{constructor(t,e){super(),this.instantiate(uh.units,t,e)}static aw(t,e){return null!=uh.units.nw(t)&&null!=uh.units.nw(e)}}uh.units=new nh,uh.units.set(new sh("m","metre","米"),1),uh.units.set(new sh("km","kilometre","千米"),.001),uh.units.set(new sh("dm","decimetre","分米"),10),uh.units.set(new sh("cm","centimetre","厘米"),100),uh.units.set(new sh("mm","millimetre","毫米"),1e3),uh.units.set(new sh("ft","foot","feet","英尺"),1250/381),uh.units.set(new sh("yd","yard","码"),1250/1143),uh.units.set(new sh("mile","英里"),125/201168),uh.units.set(new sh("in","inch","英寸"),5e3/127),uh.units.set(new sh("au"),1/1496e8);class lh extends ih{constructor(t,e){super(),this.instantiate(lh.units,t,e)}static aw(t,e){return null!=lh.units.nw(t)&&null!=lh.units.nw(e)}}lh.units=new nh,lh.units.set(new sh("kg","kilogram","千克"),1),lh.units.set(new sh("gram","g","克"),1e3),lh.units.set(new sh("ton","t","吨"),.001),lh.units.set(new sh("lb","lbs","pound","pounds","英镑"),2.2046226218487757),lh.units.set(new sh("st","stone","石"),5e7/317514659),lh.units.set(new sh("oz","ounce","盎司"),35.27396194958041),lh.units.set(new sh("quintal","英担"),.01),lh.units.set(new sh("short ton","net ton","us ton","短吨","美吨"),.00110231),lh.units.set(new sh("long ton","weight ton","gross ton","imperial ton","长吨","英吨"),984207e-9);class hh extends ih{constructor(t,e){super(),this.instantiate(hh.units,t,e)}static aw(t,e){return null!=hh.units.nw(t)&&null!=hh.units.nw(e)}}hh.units=new nh,hh.units.set(new sh("m²","m2","square metre","square meter","centiare","平方米","平方公尺"),1),hh.units.set(new sh("km²","km2","square kilometre","square kilometer","平方千米"),1e-6),hh.units.set(new sh("dm²","dm2","square decimetre","square decimeter","平方分米"),100),hh.units.set(new sh("cm²","cm2","square centimetre","square centimeter","平方厘米"),1e4),hh.units.set(new sh("mm²","mm2","square millimetre","square millimeter","平方毫米"),1e6),hh.units.set(new sh("ft²","ft2","square foot","square feet","sq ft","平方英尺"),1/.3048/.3048),hh.units.set(new sh("yd²","yd2","sq yd","square yard","平方码"),1/.9144/.9144),hh.units.set(new sh("a","are"),.01),hh.units.set(new sh("ha","hectare","公顷"),1e-4),hh.units.set(new sh("in²","in2","sq in","square inch","平方英寸"),1/64516e-8),hh.units.set(new sh("mi²","mi2","sq mi","square mile","平方英里"),1/2589988.110336),hh.units.set(new sh("亩"),1/666.667);class ah extends ih{constructor(t,e){super(),this.instantiate(ah.units,t,e)}static aw(t,e){return null!=ah.units.nw(t)&&null!=ah.units.nw(e)}}ah.units=new nh,ah.units.set(new sh("l","L","lt","ltr","liter","litre","dm³","dm3","cubic decimetre","cubic decimeter","升","立方分米"),1),ah.units.set(new sh("m³","m3","cubic metre","cubic meter","立方米"),.001),ah.units.set(new sh("km³","km3","cubic kilometre","cubic kilometer","立方千米"),1e-9*.001),ah.units.set(new sh("cm³","cm3","cubic centimetre","cubic centimeter","立方厘米","毫升"),1e3),ah.units.set(new sh("mm³","mm3","cubic millimetre","cubic millimeter","立方毫米"),1e6),ah.units.set(new sh("ft³","ft3","cubic foot","cubic feet","cu ft","立方英尺"),.0353147),ah.units.set(new sh("in³","in3","cu in","cubic inch","立方英寸"),61.0237),ah.units.set(new sh("imperial pint","imperial pt","imperial p"),1.75975),ah.units.set(new sh("imperial gallon","imperial gal"),.219969),ah.units.set(new sh("imperial quart","imperial qt"),.879877),ah.units.set(new sh("US pint","US pt","US p"),2.11337643513819),ah.units.set(new sh("US gallon","US gal"),.264172),ah.units.set(new sh("US quart","US qt"),2.11338);class oh{static ow=null;static IsParameter(t){if(!t||""===t.trim())return!1;try{let e=this.cw(t);if(e.Functions&&e.Functions.length>0)return!1;if(e.Parameters&&1===e.Parameters.length)return e.Parameters[0].Name===t}catch(t){}return!1}static cw(t){if(!t||""===t.trim())throw new Error("Parameter exp invalid !");let e=new Hr,r=new zl(t),s=new pr(r,null,e);s.sr(),s.rr(e);let n=new ht(s),i=new xr(n,null,e);i.sr(),i.rr(e);let u=i.Oo();if(e.IsError)throw new Error(e.ErrorMsg);let l=new Zl;return l.ta(u),l.zd}static UnitConversion(t,e,r,s=null){if(!e||!r)return t;if(this.ow||(this.ow=/[\s \(\)()\[\]<>]/g),(e=e.replace(this.ow,""))===r)return t;if(uh.aw(e,r))return new uh(e,r).hw(t);if(lh.aw(e,r))return new lh(e,r).hw(t);if(hh.aw(e,r))return new hh(e,r).hw(t);if(ah.aw(e,r))return new ah(e,r).hw(t);if(!s)throw new Error(`The input item has different units and cannot be converted from [${e}] to [${r}]`);throw new Error(`The input item [${s}] has different units and cannot be converted from [${e}] to [${r}]`)}static ParseFormula(t,e){if(!t||""===t.trim())throw new Error("Parameter exp invalid !");let r=new Hr,s=new zl(t),n=new pr(s,null,r);n.sr(),n.rr(r);let i=new ht(n),u=new xr(i,null,r);if(u.sr(),u.rr(r),e){u.rr(e);let t=u.Oo();return(new jl).ta(t)}let l=u.Oo();if(r.IsError)throw new Error(r.ErrorMsg);return(new jl).ta(l)}static CheckFormula(t){if(!t||""===t.trim())return!1;let e=new Hr,r=new zl(t),s=new pr(r,null,e);s.sr(),s.rr(e);let n=new ht(s),i=new xr(n,null,e);return i.sr(),i.rr(e),i.Oo(),!e.IsError}static ParseCondition(t){let e={Type:null,ErrorMessage:null};if(!t||""===t.trim())return e.Type=i.Error,e.ErrorMessage="condition is null",e;try{let r=new Hr,s=new zl(t),n=new pr(s,null,r);n.sr(),n.rr(r);let u=new ht(n),l=new xr(u,null,r);l.sr(),l.rr(r);let h=l.Oo();return r.IsError?(e.Type=i.Error,e.ErrorMessage=r.ErrorMsg,e):(new th).ta(h)}catch(t){e.Type=i.Error,e.ErrorMessage=t.message}return e}static Condition_And(t,e){return new ns(t,e)}static Condition_Or(t,e){return new is(t,e)}static ParseCalculate(t){let e={Type:null,ErrorMessage:null};if(!t||""===t.trim())return e.Type=n.Error,e.ErrorMessage="exp is null",e;try{let r=new Hr,s=new zl(t),i=new pr(s,null,r);i.sr(),i.rr(r);let u=new ht(i),l=new xr(u,null,r);l.sr(),l.rr(r);let h=l.Oo();return r.IsError?(e.Type=n.Error,e.ErrorMessage=r.ErrorMsg,e):(new eh).ta(h)}catch(t){e.Type=n.Error,e.ErrorMessage=t.message}return e}static Calculate_Add(t,e){return new Kr(t,e)}static Calculate_Subtract(t,e){return new zr(t,e)}static Calculate_Multiply(t,e){return new $r(t,e)}static Calculate_Divide(t,e){return new Wr(t,e)}static Calculate_Mod(t,e){return new jr(t,e)}static Calculate_Connect(t,e){return new Yr(t,e)}}"undefined"!=typeof window&&(window.AlgorithmEngineHelper=oh);const ch={AlgorithmEngine:Yl,AlgorithmEngineEx:Ql,AlgorithmEngineHelper:oh,Operand:P,Enums:t};"undefined"!=typeof window&&(window.ToolGood=window.ToolGood||{},window.ToolGood.Algorithm={AlgorithmEngine:Yl,AlgorithmEngineEx:Ql,AlgorithmEngineHelper:oh,Operand:P,Enums:t})})(),s.default})());