subscript 10.7.2 → 10.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,15 @@ const isMethodKey = a =>
26
26
  typeof a === 'string' ||
27
27
  (Array.isArray(a) && (a[0] === undefined || a[0] === '[]'));
28
28
 
29
+ // The token dispatcher rewinds idx on failure; speculative member parsing
30
+ // must also restore the ASI flags before an expression handler retries.
31
+ const speculate = handler => a => {
32
+ const newline = parse.newline, semi = parse.semi;
33
+ const node = handler(a);
34
+ if (!node) { parse.newline = newline; parse.semi = semi; }
35
+ return node;
36
+ };
37
+
29
38
  // Shared parser for get/set — returns false if not valid accessor pattern (falls through to identifier)
30
39
  // Returns false (not undefined) to signal "fall through without setting reserved"
31
40
  const accessor = (kind) => a => {
@@ -45,8 +54,8 @@ const accessor = (kind) => a => {
45
54
  return [kind, name, params, expr(0, CBRACE)];
46
55
  };
47
56
 
48
- token('get', ASSIGN - 1, accessor('get'));
49
- token('set', ASSIGN - 1, accessor('set'));
57
+ token('get', ASSIGN - 1, speculate(accessor('get')));
58
+ token('set', ASSIGN - 1, speculate(accessor('set')));
50
59
 
51
60
  // Generator method: { *g() {} } / class { *g() {} } / static *g() {}
52
61
  // → [':', key, ['function*', null, params, body]] (≡ g: function* () {})
@@ -62,7 +71,7 @@ const paramish = n => n == null || typeof n === 'string' ||
62
71
  n[0] === '=' ? typeof n[1] === 'string' || paramish(n[1]) :
63
72
  n[0] === '...' || n[0] === '{}' || n[0] === '[]'));
64
73
  const multPrec = prec['*'];
65
- token('*', TOKEN, a => {
74
+ token('*', TOKEN, speculate(a => {
66
75
  // Infix `*` is multiplication — EXCEPT at a member boundary: class bodies
67
76
  // have no separators, so `ctor() {} *g() {}` reaches here with the previous
68
77
  // member as `a` (ASI can't split on `*`: `x \n * y` must stay a product).
@@ -83,14 +92,14 @@ token('*', TOKEN, a => {
83
92
  skip();
84
93
  const node = [':', name, ['function*', null, params, expr(0, CBRACE) || null]];
85
94
  return a ? (a[0] === ';' ? (a.push(node), a) : [';', a, node]) : node;
86
- });
95
+ }));
87
96
  prec['*'] = multPrec;
88
97
 
89
98
  // Method shorthand: { foo() {} } / { async foo() {} } / class { static foo() {} }
90
99
  // → [':', key, ['=>', ['()', params], body]]
91
100
  // Accepts identifier, string-literal node [, "..."], ['async', key] from
92
101
  // async.js, or ['static', key] from unary('static').
93
- token('(', ASSIGN - 1, a => {
102
+ token('(', ASSIGN - 1, speculate(a => {
94
103
  if (!a) return;
95
104
  // ['static', key] from unary('static'): unwrap, re-wrap the resulting method node.
96
105
  // ['async', key] from async.js: unwrap, wrap the method value in async.
@@ -108,4 +117,4 @@ token('(', ASSIGN - 1, a => {
108
117
  if (isAsync) value = ['async', value];
109
118
  const node = [':', a, value];
110
119
  return wrap ? [wrap, node] : node;
111
- });
120
+ }));
package/jessie.min.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var l,m,s=r=>(l=0,m=r,s.enter?.(),r=d(),m[l]?O():r||""),O=(r="Unexpected token",e=l,t=m.slice(0,e).split(`
2
2
  `),o=t.pop(),n=m.slice(Math.max(0,e-40),e),p="\u032D",c=(m[e]||" ")+p,u=m.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
- ${n}${c}${u}`)},De=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),E=(r,e=l,t)=>{for(;t=r(m.charCodeAt(l));)l+=t;return m.slice(e,l)},h=(r=1)=>m[l+=r],T=r=>l=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(l++,s.exit?.(r,e)):O("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},z=(r=l)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Po=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,S=(r,e=r.length)=>m.substr(l,e)===r&&!s.id(m.charCodeAt(l+e)),L=()=>(h(),d(0,41)),N=[],v={},g=(r,e=32,t,o=r.charCodeAt(0))=>$r({op:r,l:r.length,p:v[r]=!N[o]&&v[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),j=(r,e)=>g(r,200,t=>!t&&[,e]),sr=(r,e,t,o)=>g(r,e,(n,p,c=n)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||z()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),J=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),pr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),fr=(r,e)=>(s.space(),e=m.charCodeAt(l),s.id(e)&&(e<48||e>57)?E(s.id):d(r)),Qr=(r,e)=>g(r,e,(t,o)=>t&&(o=fr(e))&&[r,t,o]),w=(r,e,t)=>(v[r]??=e,$r({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Xr=(r,e,t=(o,n,p,c=l,u,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===m.charCodeAt(l+1)&&(a.l<3||m.substr(l,a.l)===a.op))&&(!a.word||!s.id(m.charCodeAt(l+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(l+a.l))){if(l+=a.l,u=a.map(o))return De(u,c);l=c,p=0,a.word||o||e||r[y]||O()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),$r=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Xr([r,...t.ops],t.tail):Xr([r],t);s.space=r=>{for(;(r=m.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:E(s.id)||null);var ir={},f=(r,e,t=ir[r])=>ir[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):ir[r[0]]?.(...r.slice(1))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var lr=46,Q=48,x=57,jr=69,xr=101,Ge=43,Fe=45,Wr=95,He=97,Xe=102,Qe=65,$e=70,zr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),je=r=>r===lr&&(r=m.charCodeAt(l+1))!==lr&&!(s.id(r)&&r>x&&r!==xr&&r!==jr)||r>=Q&&r<=x||r===Wr||((r===jr||r===xr)&&((r=m.charCodeAt(l+1))>=Q&&r<=x||r===Ge||r===Fe)?2:0),ur=r=>(r=+zr(E(je)))!=r?O():[,r],xe=r=>e=>e===Wr||e>=Q&&e<=x&&e-Q<r||r===16&&(e>=He&&e<=Xe||e>=Qe&&e<=$e);s.number=null;N[lr]=r=>!r&&m.charCodeAt(l+1)>=Q&&m.charCodeAt(l+1)<=x&&ur();for(let r=Q;r<=x;r++)N[r]=e=>e?void 0:ur();N[Q]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(l+1)|32)===t.charCodeAt(1)){h(2);let o=zr(E(xe(e=s.number[t])));return[,parseInt(o,e)]}return ur()}};var We=92,Jr=34,Vr=39,Yr=117,Zr=120,ze=123,Je=125,qr=10,Ve=13,Ye={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},br=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,cr=()=>{let r=m.charCodeAt(l+1);if(r===qr)return["",2];if(r===Ve)return["",m.charCodeAt(l+2)===qr?3:2];if(r===Zr||r===Yr&&m.charCodeAt(l+2)!==ze){let e=r===Zr?2:4,t=0,o;for(let n=0;n<e;n++){if((o=br(m.charCodeAt(l+2+n)))<0)return[m[l+1],2];t=t*16+o}return[String.fromCharCode(t),2+e]}if(r===Yr){let e=0,t=l+3,o;for(;(o=br(m.charCodeAt(t)))>=0;)e=e*16+o,t++;return t>l+3&&e<=1114111&&m.charCodeAt(t)===Je?[String.fromCodePoint(e),t-l+1]:[m[l+1],2]}return[Ye[m[l+1]]||m[l+1],2]},re=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let[c,u]=cr();return o+=c,u};return E(c=>c-r&&(c!==We?(o+=m[l],1):p())),m[l]===n?h():O("Bad string"),[,o]};N[Jr]=re(Jr);N[Vr]=re(Vr);s.string={'"':!0};var Ze=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,Ze,!0));var qe=30,be=40,rt=140;_("!",rt);A("||",qe);A("&&",be);var et=50,tt=60,ot=70,ee=100,nt=140;A("|",et);A("&",ot);A("^",tt);A(">>",ee);A("<<",ee);_("~",nt);var Z=90;A("<",Z);A(">",Z);A("<=",Z);A(">=",Z);var te=80;A("==",te);A("!=",te);var oe=110,mr=120,ne=140;A("+",oe);A("-",oe);A("*",mr);A("/",mr);A("%",mr);_("+",ne);_("-",ne);var q=150;g("++",q,r=>r?["++",r,null]:["++",d(q-1)]);g("--",q,r=>r?["--",r,null]:["--",d(q-1)]);var it=5,st=10;sr(",",st);sr(";",it,!0,!0);var pt=170;J("()",pt);var ie=170,ft=160;pr("[]",ie);Qr(".",ie);pr("()",ft);var lt=s.space;s.comment??={"//":`
5
- `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=lt();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(l+1)===t.charCodeAt(1))&&(t.length<3||m.substr(l,t.length)===t)){o=e[t],n=m.indexOf(o,l+t.length),T(n<0?m.length:o===`
6
- `?n:n+o.length),r=0;break}if(r)return r}return r};var se=80;A("===",se);A("!==",se);var ut=30;A("??",ut);var ct=130,mt=20;A("**",ct,!0);A("**=",mt,!0);var pe=90;A("in",pe);A("of",pe);var at=20,dt=100;A(">>>",dt);A(">>>=",at,!0);var ar=20;A("||=",ar,!0);A("&&=",ar,!0);A("??=",ar,!0);j("true",!0);j("false",!1);j("null",null);w("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var dr=20;g("?",dr,(r,e,t)=>r&&(e=d(dr-1))&&E(o=>o===58)&&(t=d(dr-1),["?",r,e,t]));var ht=20;A("=>",ht,!0);var At=20;_("...",At);var fe=170;g("?.",fe,(r,e)=>{if(!r)return;let t=s.space();return t===40?(h(),["?.()",r,d(0,41)||null]):t===91?(h(),["?.[]",r,d(0,93)]):(e=fr(fe),e?["?.",r,e]:void 0)});var hr=140,le=160,yt=le+1;_("typeof",hr);_("void",hr);_("delete",hr);var wt=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",yt,()=>S(".target")?(h(7),["new.target"]):["new",wt(d(le))]);var Ct=20,ue=200;s.prop=r=>z(r)!==58;J("[]",ue);J("{}",ue);A(":",Ct-1,!0);var gt=170,Ar=96,Et=36,St=123,kt=92,ce=()=>{let r=[],e="",t,o;for(;(t=m.charCodeAt(l))!==Ar;)t?t===kt?(o=cr(),e+=o[0],h(o[1])):t===Et&&m.charCodeAt(l+1)===St?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=m[l],h()):O("Unterminated template");return r.push([,e]),h(),r},Tt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Nt=N[Ar];N[Ar]=(r,e)=>r&&e<gt?s.asi&&s.newline?void 0:(h(),["``",r,...ce()]):r?Nt?.(r,e):(h(),Tt(ce()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var Rt=92,It=117,Ot=123,_t=125,Lt=183,Pt=s.id,me=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,vt=(r=l+2,e,t=0,o=0)=>{if(m.charCodeAt(l)!==Rt||m.charCodeAt(l+1)!==It)return 0;if(m.charCodeAt(r)===Ot){for(;me(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&m.charCodeAt(r)===_t?r-l+1:0}for(;o<4&&me(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>Pt(r)||r===Lt||vt();var yr=5,de=10,wr=r=>{let e=l,t=d(de-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(T(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",yr+1,()=>wr("let"));w("const",yr+1,()=>wr("const"));w("var",yr+1,()=>wr("var"));var ae=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";w("using",200,()=>{let r=l;s.space();let e=m.charCodeAt(l);if(s.id(e)&&(e<48||e>57)){let t=l;if(E(s.id),s.space(),m.charCodeAt(l)===61&&m.charCodeAt(l+1)!==61&&m.charCodeAt(l+1)!==62){T(t);let o=d(de-1);if(o[0]===","?o.slice(1).every(ae):ae(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return T(r),"using"});var b=5,Bt=59,U=()=>(s.space()===123||O("Expected {"),h(),d(b-.5,125)||null),G=()=>s.space()!==123?d(b+.5):(h(),d(b-.5,125)||null),Mt=()=>{let r=l;return s.space()===Bt&&h(),s.space(),S("else")?(h(4),s.semi=!1,!0):(T(r),!1)};w("if",b+1,()=>{s.space();let r=["if",L(),G()];return Mt()&&r.push(G()),r});var Ut=200;w("function",Ut,()=>{s.space();let r=!1;m[l]==="*"&&(r=!0,h(),s.space());let e=E(s.id);return e&&s.space(),r?["function*",e,L()||null,U()]:["function",e,L()||null,U()]});var rr=140,Cr=20,Kt=40;_("await",rr);var Dt=10,Gt=13,Ft=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===Dt||e===Gt)return!0;r++}return!1};w("yield",rr,()=>Ft(l)?["yield"]:(s.space(),m[l]==="*"?(h(),s.space(),["yield*",d(Cr)]):["yield",d(Cr)]));w("async",rr,()=>{if(s.space(),S("function"))return["async",d(rr)];let r=l,e=E(s.id);if(e){if(s.space(),m.charCodeAt(l)===Kt)return["async",e];T(r)}let t=d(Cr-.5);return t&&["async",t]});var he=200;var Ht=90,Xt=175,Qt=160,$t=Qt-.5;_("static",Xt);A("instanceof",Ht);g("#",he,r=>{if(r)return;let e=E(s.id);return e?"#"+e:void 0});w("class",he,()=>{s.space();let r=E(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!S("extends"))return["class",r,null,U()];h(7),s.space()}return["class",r,d($t),U()]});var gr=47,jt=92,xt=91,Wt=93;g("/",140,r=>{let e=m.charCodeAt(l);if(r||e===gr||e===42||e===43||e===63)return;let t=!1,o=E(p=>p===jt?2:p===xt?(t=!0,1):p===Wt?(t=!1,1):p&&(t||p!==gr));m.charCodeAt(l)===gr||O("Unterminated regex"),h();let n=E(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var $=5,V=125,Y=59;w("while",$+1,()=>(s.space(),["while",L(),G()]));w("do",$+1,r=>(r=G(),s.space(),h(5),s.space(),["do",r,L()]));var Ae={let:1,const:1,var:1},Er=(r,e=r,t)=>{if(Ae[r?.[0]]&&Array.isArray(r[1]))return(e=Er(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],r.length>2?[",",e[2],...r.slice(2)]:e[2]]:r;for(;Array.isArray(e)&&v[e[0]]<v.in&&!Ae[e[0]];)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",$+1,()=>(s.space(),S("await")?(h(5),s.space(),["for await",Er(L()),G()]):["for",Er(L()),G()]));w("break",$+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===V||e===Y||s.newline)return["break"];let t=E(s.id);if(!t)return["break"];let o=s.space();return!o||o===V||o===Y||s.newline?["break",t]:(T(r),["break"])});w("continue",$+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===V||e===Y||s.newline)return["continue"];let t=E(s.id);if(!t)return["continue"];let o=s.space();return!o||o===V||o===Y||s.newline?["continue",t]:(T(r),["continue"])});w("return",$+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===V||r===Y||s.newline?["return"]:["return",d($)]});var Sr=5;w("try",Sr+1,()=>{let r=["try",U()];return s.space(),S("catch")&&(h(5),s.space(),r.push(["catch",z()===40?L():null,U()])),s.space(),S("finally")&&(h(7),r.push(["finally",U()])),r});w("throw",Sr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(Sr)]});var Ce=5,zt=20,ye=58,Jt=59,kr=125,Tr=0,ge=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>S(r)&&!n&&Tr&&(!s.prop||s.prop(l+e))||o?.(n,p,c);ge("case");ge("default");var we=r=>{let e=[];for(;(r=s.space())!==kr&&!S("case")&&!S("default");){if(r===Jt){h();continue}s.semi=!1,e.push(d(Ce+.5))||O()}return e.length>1?[";",...e]:e[0]||null},Vt=()=>{s.space()===123||O("Expected {"),h(),Tr++;let r=[];try{for(;s.space()!==kr;)if(S("case")){T(l+4),s.space(),s.semi=!1;let e=d(zt-.5);s.space()===ye&&h(),r.push(["case",e,we()])}else S("default")?(T(l+7),s.space()===ye&&h(),r.push(["default",we()])):O("Expected case or default")}finally{Tr--}return h(),s.exit?.(0,kr),r};w("switch",Ce+1,()=>s.space()===40&&["switch",L(),...Vt()]);var Nr=5,Yt=20;w("debugger",Nr+1,()=>["debugger"]);w("with",Nr+1,()=>(s.space(),["with",L(),G()]));var Zt=["if","for","while","do","switch","try"];g(":",Yt-1,r=>typeof r=="string"&&(s.space(),Zt.some(e=>S(e)))&&[":",r,d(Nr)]);var Rr=5,W=10,Ee=42,qt=N[Ee];N[Ee]=(r,e)=>r?qt?.(r,e):(h(),"*");g("from",W+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(W+1)]):!1);g("as",W+2,r=>r?(s.space(),["as",r,d(W+2)]):!1);w("import",Rr,()=>S(".meta")?(h(5),["import.meta"]):["import",d(W)]);w("export",Rr,()=>(s.space(),S("default")?(h(7),["export",["default",d(W)]]):["export",d(Rr)]));var Or=20,Se=200,bt=10,ro=13,eo=34,to=35,oo=39,ke=40,_r=41,no=91,Lr=123,Pr=125,io=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===bt||t===ro)return!0}return!1},so=r=>r===eo||r===oo||r===no||r===to,Te=()=>E(s.id)||(so(m.charCodeAt(l))?d(Se-.5):null),po=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),Ne=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||io(t,l))return!1;let o=Te();if(!o||(s.space(),m.charCodeAt(l)!==ke))return!1;h();let n=d(0,_r);return s.space(),m.charCodeAt(l)!==Lr?!1:(h(),[r,o,n,d(0,Pr)])};g("get",Or-1,Ne("get"));g("set",Or-1,Ne("set"));var Ir=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(Ir):r[0]==="="?typeof r[1]=="string"||Ir(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),fo=v["*"];g("*",Se,r=>{let e=r&&s.newline;if(r&&!e)return;let t=l,o=Te();if(!o)return r?(T(t),void 0):!1;if(s.space(),m.charCodeAt(l)!==ke)return r?(T(t),void 0):!1;h();let n=d(0,_r)||null;if(r&&!Ir(n))return T(t),void 0;if(s.space(),m.charCodeAt(l)!==Lr)return r?(T(t),void 0):!1;h();let p=[":",o,["function*",null,n,d(0,Pr)||null]];return r?r[0]===";"?(r.push(p),r):[";",r,p]:p});v["*"]=fo;g("(",Or-1,r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!po(r))return;let o=d(0,_r)||null;if(s.space(),m.charCodeAt(l)!==Lr)return;h();let n=["=>",["()",o],d(0,Pr)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p});s.comment["#!"]=`
7
- `;var _e=32,Ur=10,lo=59,uo=125,Re=91,Ie=40,er=v.asi??v[";"],co=s._baseSpace??=s.space,mo=s._baseStep??=s.step,vr=r=>Array.isArray(r)||typeof r=="string",ao=(v[";"]??5)+1,Mr=r=>Array.isArray(r)&&(v[r[0]]<=ao||r[0]==="{}"&&Mr(r[1])),ho=(r,e)=>{for(;(e=m.charCodeAt(r))<=_e;){if(e===Ur)return!0;r++}return!1},Ao=(r=l,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=_e;)if(e===Ur)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=co();e<l;)if(m.charCodeAt(e++)===Ur){s.newline=!0;break}if(r===lo&&ho(l+1)){T(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===uo&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=er)return!1;if(r&&!vr(r))return null;if(vr(r)){let p=(t===Re||t===Ie)&&Ao();if(s.semi||t===Re&&(p||Mr(r))||t===Ie&&(Mr(r)||p&&e>=er))return Oe(r,e,o)??null}let n=s.newline;return mo(r,e,t,o)??(vr(r)&&n?Oe(r,e,o)??null:null)};var Br=0,yo=2e3,Oe=s.asi=(r,e,t,o,n)=>{if(e>=er||Br>=yo)return;s.semi=!1;let p=l;Br++;try{o=t(er-.5)}finally{Br--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Pe=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?Pe(r[1],e):(()=>{throw Error("Invalid assignment target")})(),Le={"=":(r,e,t)=>r[e]=t,"+=":(r,e,t)=>r[e]+=t,"-=":(r,e,t)=>r[e]-=t,"*=":(r,e,t)=>r[e]*=t,"/=":(r,e,t)=>r[e]/=t,"%=":(r,e,t)=>r[e]%=t,"|=":(r,e,t)=>r[e]|=t,"&=":(r,e,t)=>r[e]&=t,"^=":(r,e,t)=>r[e]^=t,">>=":(r,e,t)=>r[e]>>=t,"<<=":(r,e,t)=>r[e]<<=t};for(let r in Le)f(r,(e,t)=>(t=i(t),Pe(e,(o,n,p)=>Le[r](o,n,t(p)))));f("!",r=>(r=i(r),e=>!r(e)));f("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));f("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));f("~",r=>(r=i(r),e=>~r(e)));f("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));f("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));f("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));f(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));f("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));f(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));f("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));f(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));f("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));f("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));f("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));f("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));f("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));f("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));f("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));f("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var Kr=(r,e,t,o)=>typeof r=="string"?n=>e(n,r):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n))):r[0]==="()"&&r.length===2?Kr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Kr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Kr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var ve=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",ve);f(";",ve);var Be=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>Be(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),wo=r=>P(M(r));i.id=r=>r===void 0||wo(r)?()=>{}:e=>e?.[r];var tr=r=>{throw Error(r)};f("[]",(r,e)=>e===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(t=>t==null?(()=>{}):t[0]==="..."?(t=i(t[1]),o=>t(o)):(t=i(t),o=>[t(o)])),t=>r.flatMap(o=>o(t))):(e==null&&tr("Missing index"),r=i(r),e=i(e),t=>{let o=M(e(t));return P(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),P(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?tr("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&tr("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=Fr(r);return n<0?()=>{}:Gr(r,n?(p,c,u)=>(c=M(c),P(c)?void 0:p[c](...o(u))):(p,c,u)=>p[c](...o(u)))});var K=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&K(r[1])||r[0]==="{}"),Gr=(r,e,t,o)=>r==null?tr("Empty ()"):r[0]==="()"&&r.length==2?Gr(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),Dr=r=>Be(r)?1:P(r)?-1:0,Fr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Dr(r):e==="()"&&r.length==2?Fr(r[1]):e==="."||e==="?."?Dr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Dr(t[1]):1:0,F=(r,e,t=Fr(r))=>t<0?()=>{}:Gr(r,t?(o,n,p)=>(n=M(n),P(n)?void 0:e(o,n,p)):e);f("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));f("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));f("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var Co=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(K(r)||Co("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var go=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(K(r)||go("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]>>>=e(n))));var Eo=r=>r[0]?.[0]===","?r[0].slice(1):r,H=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=Eo(n);if(o==="{}"){let c=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let C={};for(let I in e)!c.includes(I)&&!P(I)&&(C[I]=e[I]);t[u[1]]=C;break}let a,y,R;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],R=u[2]):[,a,y]=u,c.push(a=M(a));let k=P(a)?void 0:e[a];k===void 0&&R&&(k=i(R)(t)),H(y,k,t)}}else if(o==="[]"){let c=0;for(let u of p){if(u===null){c++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(c);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let R=e[c++];R===void 0&&y&&(R=i(y)(t)),H(a,R,t)}}},Hr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>H(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Hr);f("const",Hr);f("var",Hr);var or=r=>{throw Error(r)};f("=",(r,e)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let t=r[1];return e=i(e),typeof t=="string"?o=>{o[t]=e(o)}:o=>H(t,e(o),o)}return K(r)||or("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(K(r)||or("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(K(r)||or("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(K(r)||or("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var B=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let c=e?.[0]==="{}";return e=i(c?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((k,C)=>y[k]=a[C]),n&&(y[n]=a.slice(o));let R=new Proxy(y,{get:(k,C)=>C in k?k[C]:u?.[C],set:(k,C,I)=>((C in k?k:u)[C]=I,!0),has:(k,C)=>C in k||(u?C in u:!1)});try{let k=e(R);return c?void 0:k}catch(k){if(k===B)return k[0];throw k}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))P(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),P(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return P(n)?void 0:o[n]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=r[0]==="?.",p=i(r[1]),c=M(r[2]);return P(c)?()=>{}:n?u=>p(u)?.[c]?.(...t(u)):u=>p(u)[c]?.(...t(u))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return u=>{let a=p(u);if(n&&a==null)return;let y=M(c(u));return P(y)?void 0:a[y]?.(...t(u))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(c=>c(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var nr=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[nr,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[nr,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var So=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!So(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let c of t.flatMap(u=>u(o)))if(c[0]===nr){let[,u,a]=c;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[c[0]]=c[1];for(let c in p)Object.defineProperty(n,c,p[c]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(c=>c(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,c=o[o.length-1];return Array.isArray(c)&&c[0]==="..."&&(p=o.length-1,n=c[1],o.length--),u=>{let a=(...y)=>{let R={};o.forEach((C,I)=>R[C]=y[I]),n&&(R[n]=y.slice(p));let k=new Proxy(R,{get:(C,I)=>I in C?C[I]:u[I],set:(C,I,Ke)=>((I in C?C:u)[I]=Ke,!0),has:(C,I)=>I in C||I in u});try{return t(k)}catch(C){if(C===B)return C[0];throw C}};return r&&(u[r]=a),a}});f("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});f("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});f("await",r=>(r=i(r),async e=>await r(e)));f("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));f("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var ko=Symbol("static"),To=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?.(o),p=function(...c){if(!(this instanceof p))return To("Class constructor must be called with new");let u=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,c),u};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let u=t(c),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,R]of a)y==="constructor"?p.prototype.__constructor__=R:p.prototype[y]=R}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[ko,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var D=Symbol("break"),X=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===D)break;if(n===X)continue;if(n===B)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===D)break;if(n===X)continue;if(n===B)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let c;for(t?.(p);o(p);n?.(p))try{c=e(p)}catch(u){if(u===D)break;if(u===X)continue;if(u===B)return u[0];throw u}return c}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return Ro(o,n,e);if(t==="of")return No(o,n,e)}});var No=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u of e(n)){o?H(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===D)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}},Ro=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u in e(n)){o?H(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===D)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}};f("break",()=>()=>{throw D});f("continue",()=>()=>{throw X});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(u=>u?.[0]==="catch"),o=e.find(u=>u?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===D||y===X||y===B)throw y;if(n!=null&&p){let R=n in u,k=u[n];u[n]=y;try{a=p(u)}finally{R?u[n]=k:delete u[n]}}else if(!p)throw y}finally{c?.(u)}return a}});f("throw",r=>(r=i(r),e=>{throw r(e)}));f("switch",(r,...e)=>(r=i(r),e.length?(e=e.map(t=>[t[0]==="case"?i(t[1]):null,(t[0]==="case"?t[2]:t[1])?.[0]===";"?(t[0]==="case"?t[2]:t[1]).slice(1).map(i):(t[0]==="case"?t[2]:t[1])?[i(t[0]==="case"?t[2]:t[1])]:[]]),t=>{let o=r(t),n=!1,p;for(let[u,a]of e)if(n||u===null||u(t)===o)for(n=!0,c=0;c<a.length;c++)try{p=a[c](t)}catch(y){if(y===D)return p;throw y}var c;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var Me=new WeakMap,Io=(r,...e)=>typeof r=="string"?i(s(r)):Me.get(r)||Me.set(r,Oo(r,e)).get(r),Ue=57344,Oo=(r,e)=>{let t=r.reduce((p,c,u)=>p+(u?String.fromCharCode(Ue+u-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-Ue,u;if(c>=0&&c<e.length)return u=e[c],_o(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},_o=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Lo=Io;export{pr as access,A as binary,i as compile,m as cur,Lo as default,O as err,d as expr,J as group,Po as id,l as idx,w as keyword,j as literal,De as loc,N as lookup,Qr as member,sr as nary,E as next,f as operator,ir as operators,L as parens,s as parse,z as peek,v as prec,fr as propName,T as seek,h as skip,g as token,_ as unary,S as word};
3
+ ${n}${c}${u}`)},Ge=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),E=(r,e=l,t)=>{for(;t=r(m.charCodeAt(l));)l+=t;return m.slice(e,l)},h=(r=1)=>m[l+=r],T=r=>l=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(l++,s.exit?.(r,e)):O("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},z=(r=l)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},vo=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,S=(r,e=r.length)=>m.substr(l,e)===r&&!s.id(m.charCodeAt(l+e)),L=()=>(h(),d(0,41)),N=[],v={},g=(r,e=32,t,o=r.charCodeAt(0))=>jr({op:r,l:r.length,p:v[r]=!N[o]&&v[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),j=(r,e)=>g(r,200,t=>!t&&[,e]),pr=(r,e,t,o)=>g(r,e,(n,p,c=n)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||z()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),J=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),fr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),lr=(r,e)=>(s.space(),e=m.charCodeAt(l),s.id(e)&&(e<48||e>57)?E(s.id):d(r)),$r=(r,e)=>g(r,e,(t,o)=>t&&(o=lr(e))&&[r,t,o]),w=(r,e,t)=>(v[r]??=e,jr({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Qr=(r,e,t=(o,n,p,c=l,u,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===m.charCodeAt(l+1)&&(a.l<3||m.substr(l,a.l)===a.op))&&(!a.word||!s.id(m.charCodeAt(l+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(l+a.l))){if(l+=a.l,u=a.map(o))return Ge(u,c);l=c,p=0,a.word||o||e||r[y]||O()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),jr=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Qr([r,...t.ops],t.tail):Qr([r],t);s.space=r=>{for(;(r=m.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:E(s.id)||null);var sr={},f=(r,e,t=sr[r])=>sr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):sr[r[0]]?.(...r.slice(1))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var ur=46,Q=48,x=57,xr=69,Wr=101,Fe=43,He=45,zr=95,Xe=97,Qe=102,$e=65,je=70,Jr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),xe=r=>r===ur&&(r=m.charCodeAt(l+1))!==ur&&!(s.id(r)&&r>x&&r!==Wr&&r!==xr)||r>=Q&&r<=x||r===zr||((r===xr||r===Wr)&&((r=m.charCodeAt(l+1))>=Q&&r<=x||r===Fe||r===He)?2:0),cr=r=>(r=+Jr(E(xe)))!=r?O():[,r],We=r=>e=>e===zr||e>=Q&&e<=x&&e-Q<r||r===16&&(e>=Xe&&e<=Qe||e>=$e&&e<=je);s.number=null;N[ur]=r=>!r&&m.charCodeAt(l+1)>=Q&&m.charCodeAt(l+1)<=x&&cr();for(let r=Q;r<=x;r++)N[r]=e=>e?void 0:cr();N[Q]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(l+1)|32)===t.charCodeAt(1)){h(2);let o=Jr(E(We(e=s.number[t])));return[,parseInt(o,e)]}return cr()}};var ze=92,Vr=34,Yr=39,Zr=117,qr=120,Je=123,Ve=125,br=10,Ye=13,Ze={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},re=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,mr=()=>{let r=m.charCodeAt(l+1);if(r===br)return["",2];if(r===Ye)return["",m.charCodeAt(l+2)===br?3:2];if(r===qr||r===Zr&&m.charCodeAt(l+2)!==Je){let e=r===qr?2:4,t=0,o;for(let n=0;n<e;n++){if((o=re(m.charCodeAt(l+2+n)))<0)return[m[l+1],2];t=t*16+o}return[String.fromCharCode(t),2+e]}if(r===Zr){let e=0,t=l+3,o;for(;(o=re(m.charCodeAt(t)))>=0;)e=e*16+o,t++;return t>l+3&&e<=1114111&&m.charCodeAt(t)===Ve?[String.fromCodePoint(e),t-l+1]:[m[l+1],2]}return[Ze[m[l+1]]||m[l+1],2]},ee=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let[c,u]=mr();return o+=c,u};return E(c=>c-r&&(c!==ze?(o+=m[l],1):p())),m[l]===n?h():O("Bad string"),[,o]};N[Vr]=ee(Vr);N[Yr]=ee(Yr);s.string={'"':!0};var qe=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,qe,!0));var be=30,rt=40,et=140;_("!",et);A("||",be);A("&&",rt);var tt=50,ot=60,nt=70,te=100,it=140;A("|",tt);A("&",nt);A("^",ot);A(">>",te);A("<<",te);_("~",it);var Z=90;A("<",Z);A(">",Z);A("<=",Z);A(">=",Z);var oe=80;A("==",oe);A("!=",oe);var ne=110,ar=120,ie=140;A("+",ne);A("-",ne);A("*",ar);A("/",ar);A("%",ar);_("+",ie);_("-",ie);var q=150;g("++",q,r=>r?["++",r,null]:["++",d(q-1)]);g("--",q,r=>r?["--",r,null]:["--",d(q-1)]);var st=5,pt=10;pr(",",pt);pr(";",st,!0,!0);var ft=170;J("()",ft);var se=170,lt=160;fr("[]",se);$r(".",se);fr("()",lt);var ut=s.space;s.comment??={"//":`
5
+ `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=ut();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(l+1)===t.charCodeAt(1))&&(t.length<3||m.substr(l,t.length)===t)){o=e[t],n=m.indexOf(o,l+t.length),T(n<0?m.length:o===`
6
+ `?n:n+o.length),r=0;break}if(r)return r}return r};var pe=80;A("===",pe);A("!==",pe);var ct=30;A("??",ct);var mt=130,at=20;A("**",mt,!0);A("**=",at,!0);var fe=90;A("in",fe);A("of",fe);var dt=20,ht=100;A(">>>",ht);A(">>>=",dt,!0);var dr=20;A("||=",dr,!0);A("&&=",dr,!0);A("??=",dr,!0);j("true",!0);j("false",!1);j("null",null);w("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var hr=20;g("?",hr,(r,e,t)=>r&&(e=d(hr-1))&&E(o=>o===58)&&(t=d(hr-1),["?",r,e,t]));var At=20;A("=>",At,!0);var yt=20;_("...",yt);var le=170;g("?.",le,(r,e)=>{if(!r)return;let t=s.space();return t===40?(h(),["?.()",r,d(0,41)||null]):t===91?(h(),["?.[]",r,d(0,93)]):(e=lr(le),e?["?.",r,e]:void 0)});var Ar=140,ue=160,wt=ue+1;_("typeof",Ar);_("void",Ar);_("delete",Ar);var Ct=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",wt,()=>S(".target")?(h(7),["new.target"]):["new",Ct(d(ue))]);var gt=20,ce=200;s.prop=r=>z(r)!==58;J("[]",ce);J("{}",ce);A(":",gt-1,!0);var Et=170,yr=96,St=36,kt=123,Tt=92,me=()=>{let r=[],e="",t,o;for(;(t=m.charCodeAt(l))!==yr;)t?t===Tt?(o=mr(),e+=o[0],h(o[1])):t===St&&m.charCodeAt(l+1)===kt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=m[l],h()):O("Unterminated template");return r.push([,e]),h(),r},Nt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Rt=N[yr];N[yr]=(r,e)=>r&&e<Et?s.asi&&s.newline?void 0:(h(),["``",r,...me()]):r?Rt?.(r,e):(h(),Nt(me()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var It=92,Ot=117,_t=123,Lt=125,Pt=183,vt=s.id,ae=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Bt=(r=l+2,e,t=0,o=0)=>{if(m.charCodeAt(l)!==It||m.charCodeAt(l+1)!==Ot)return 0;if(m.charCodeAt(r)===_t){for(;ae(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&m.charCodeAt(r)===Lt?r-l+1:0}for(;o<4&&ae(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>vt(r)||r===Pt||Bt();var wr=5,he=10,Cr=r=>{let e=l,t=d(he-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(T(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",wr+1,()=>Cr("let"));w("const",wr+1,()=>Cr("const"));w("var",wr+1,()=>Cr("var"));var de=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";w("using",200,()=>{let r=l;s.space();let e=m.charCodeAt(l);if(s.id(e)&&(e<48||e>57)){let t=l;if(E(s.id),s.space(),m.charCodeAt(l)===61&&m.charCodeAt(l+1)!==61&&m.charCodeAt(l+1)!==62){T(t);let o=d(he-1);if(o[0]===","?o.slice(1).every(de):de(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return T(r),"using"});var b=5,Mt=59,U=()=>(s.space()===123||O("Expected {"),h(),d(b-.5,125)||null),G=()=>s.space()!==123?d(b+.5):(h(),d(b-.5,125)||null),Ut=()=>{let r=l;return s.space()===Mt&&h(),s.space(),S("else")?(h(4),s.semi=!1,!0):(T(r),!1)};w("if",b+1,()=>{s.space();let r=["if",L(),G()];return Ut()&&r.push(G()),r});var Kt=200;w("function",Kt,()=>{s.space();let r=!1;m[l]==="*"&&(r=!0,h(),s.space());let e=E(s.id);return e&&s.space(),r?["function*",e,L()||null,U()]:["function",e,L()||null,U()]});var rr=140,gr=20,Dt=40;_("await",rr);var Gt=10,Ft=13,Ht=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===Gt||e===Ft)return!0;r++}return!1};w("yield",rr,()=>Ht(l)?["yield"]:(s.space(),m[l]==="*"?(h(),s.space(),["yield*",d(gr)]):["yield",d(gr)]));w("async",rr,()=>{if(s.space(),S("function"))return["async",d(rr)];let r=l,e=E(s.id);if(e){if(s.space(),m.charCodeAt(l)===Dt)return["async",e];T(r)}let t=d(gr-.5);return t&&["async",t]});var Ae=200;var Xt=90,Qt=175,$t=160,jt=$t-.5;_("static",Qt);A("instanceof",Xt);g("#",Ae,r=>{if(r)return;let e=E(s.id);return e?"#"+e:void 0});w("class",Ae,()=>{s.space();let r=E(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!S("extends"))return["class",r,null,U()];h(7),s.space()}return["class",r,d(jt),U()]});var Er=47,xt=92,Wt=91,zt=93;g("/",140,r=>{let e=m.charCodeAt(l);if(r||e===Er||e===42||e===43||e===63)return;let t=!1,o=E(p=>p===xt?2:p===Wt?(t=!0,1):p===zt?(t=!1,1):p&&(t||p!==Er));m.charCodeAt(l)===Er||O("Unterminated regex"),h();let n=E(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var $=5,V=125,Y=59;w("while",$+1,()=>(s.space(),["while",L(),G()]));w("do",$+1,r=>(r=G(),s.space(),h(5),s.space(),["do",r,L()]));var ye={let:1,const:1,var:1},Sr=(r,e=r,t)=>{if(ye[r?.[0]]&&Array.isArray(r[1]))return(e=Sr(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],r.length>2?[",",e[2],...r.slice(2)]:e[2]]:r;for(;Array.isArray(e)&&v[e[0]]<v.in&&!ye[e[0]];)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",$+1,()=>(s.space(),S("await")?(h(5),s.space(),["for await",Sr(L()),G()]):["for",Sr(L()),G()]));w("break",$+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===V||e===Y||s.newline)return["break"];let t=E(s.id);if(!t)return["break"];let o=s.space();return!o||o===V||o===Y||s.newline?["break",t]:(T(r),["break"])});w("continue",$+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===V||e===Y||s.newline)return["continue"];let t=E(s.id);if(!t)return["continue"];let o=s.space();return!o||o===V||o===Y||s.newline?["continue",t]:(T(r),["continue"])});w("return",$+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===V||r===Y||s.newline?["return"]:["return",d($)]});var kr=5;w("try",kr+1,()=>{let r=["try",U()];return s.space(),S("catch")&&(h(5),s.space(),r.push(["catch",z()===40?L():null,U()])),s.space(),S("finally")&&(h(7),r.push(["finally",U()])),r});w("throw",kr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(kr)]});var ge=5,Jt=20,we=58,Vt=59,Tr=125,Nr=0,Ee=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>S(r)&&!n&&Nr&&(!s.prop||s.prop(l+e))||o?.(n,p,c);Ee("case");Ee("default");var Ce=r=>{let e=[];for(;(r=s.space())!==Tr&&!S("case")&&!S("default");){if(r===Vt){h();continue}s.semi=!1,e.push(d(ge+.5))||O()}return e.length>1?[";",...e]:e[0]||null},Yt=()=>{s.space()===123||O("Expected {"),h(),Nr++;let r=[];try{for(;s.space()!==Tr;)if(S("case")){T(l+4),s.space(),s.semi=!1;let e=d(Jt-.5);s.space()===we&&h(),r.push(["case",e,Ce()])}else S("default")?(T(l+7),s.space()===we&&h(),r.push(["default",Ce()])):O("Expected case or default")}finally{Nr--}return h(),s.exit?.(0,Tr),r};w("switch",ge+1,()=>s.space()===40&&["switch",L(),...Yt()]);var Rr=5,Zt=20;w("debugger",Rr+1,()=>["debugger"]);w("with",Rr+1,()=>(s.space(),["with",L(),G()]));var qt=["if","for","while","do","switch","try"];g(":",Zt-1,r=>typeof r=="string"&&(s.space(),qt.some(e=>S(e)))&&[":",r,d(Rr)]);var Ir=5,W=10,Se=42,bt=N[Se];N[Se]=(r,e)=>r?bt?.(r,e):(h(),"*");g("from",W+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(W+1)]):!1);g("as",W+2,r=>r?(s.space(),["as",r,d(W+2)]):!1);w("import",Ir,()=>S(".meta")?(h(5),["import.meta"]):["import",d(W)]);w("export",Ir,()=>(s.space(),S("default")?(h(7),["export",["default",d(W)]]):["export",d(Ir)]));var _r=20,ke=200,ro=10,eo=13,to=34,oo=35,no=39,Te=40,Lr=41,io=91,Pr=123,vr=125,so=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===ro||t===eo)return!0}return!1},po=r=>r===to||r===no||r===io||r===oo,Ne=()=>E(s.id)||(po(m.charCodeAt(l))?d(ke-.5):null),fo=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),er=r=>e=>{let t=s.newline,o=s.semi,n=r(e);return n||(s.newline=t,s.semi=o),n},Re=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||so(t,l))return!1;let o=Ne();if(!o||(s.space(),m.charCodeAt(l)!==Te))return!1;h();let n=d(0,Lr);return s.space(),m.charCodeAt(l)!==Pr?!1:(h(),[r,o,n,d(0,vr)])};g("get",_r-1,er(Re("get")));g("set",_r-1,er(Re("set")));var Or=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(Or):r[0]==="="?typeof r[1]=="string"||Or(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),lo=v["*"];g("*",ke,er(r=>{let e=r&&s.newline;if(r&&!e)return;let t=l,o=Ne();if(!o)return r?(T(t),void 0):!1;if(s.space(),m.charCodeAt(l)!==Te)return r?(T(t),void 0):!1;h();let n=d(0,Lr)||null;if(r&&!Or(n))return T(t),void 0;if(s.space(),m.charCodeAt(l)!==Pr)return r?(T(t),void 0):!1;h();let p=[":",o,["function*",null,n,d(0,vr)||null]];return r?r[0]===";"?(r.push(p),r):[";",r,p]:p}));v["*"]=lo;g("(",_r-1,er(r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!fo(r))return;let o=d(0,Lr)||null;if(s.space(),m.charCodeAt(l)!==Pr)return;h();let n=["=>",["()",o],d(0,vr)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p}));s.comment["#!"]=`
7
+ `;var Le=32,Kr=10,uo=59,co=125,Ie=91,Oe=40,tr=v.asi??v[";"],mo=s._baseSpace??=s.space,ao=s._baseStep??=s.step,Br=r=>Array.isArray(r)||typeof r=="string",ho=(v[";"]??5)+1,Ur=r=>Array.isArray(r)&&(v[r[0]]<=ho||r[0]==="{}"&&Ur(r[1])),Ao=(r,e)=>{for(;(e=m.charCodeAt(r))<=Le;){if(e===Kr)return!0;r++}return!1},yo=(r=l,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=Le;)if(e===Kr)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=mo();e<l;)if(m.charCodeAt(e++)===Kr){s.newline=!0;break}if(r===uo&&Ao(l+1)){T(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===co&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=tr)return!1;if(r&&!Br(r))return null;if(Br(r)){let p=(t===Ie||t===Oe)&&yo();if(s.semi||t===Ie&&(p||Ur(r))||t===Oe&&(Ur(r)||p&&e>=tr))return _e(r,e,o)??null}let n=s.newline;return ao(r,e,t,o)??(Br(r)&&n?_e(r,e,o)??null:null)};var Mr=0,wo=2e3,_e=s.asi=(r,e,t,o,n)=>{if(e>=tr||Mr>=wo)return;s.semi=!1;let p=l;Mr++;try{o=t(tr-.5)}finally{Mr--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var ve=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?ve(r[1],e):(()=>{throw Error("Invalid assignment target")})(),Pe={"=":(r,e,t)=>r[e]=t,"+=":(r,e,t)=>r[e]+=t,"-=":(r,e,t)=>r[e]-=t,"*=":(r,e,t)=>r[e]*=t,"/=":(r,e,t)=>r[e]/=t,"%=":(r,e,t)=>r[e]%=t,"|=":(r,e,t)=>r[e]|=t,"&=":(r,e,t)=>r[e]&=t,"^=":(r,e,t)=>r[e]^=t,">>=":(r,e,t)=>r[e]>>=t,"<<=":(r,e,t)=>r[e]<<=t};for(let r in Pe)f(r,(e,t)=>(t=i(t),ve(e,(o,n,p)=>Pe[r](o,n,t(p)))));f("!",r=>(r=i(r),e=>!r(e)));f("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));f("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));f("~",r=>(r=i(r),e=>~r(e)));f("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));f("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));f("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));f(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));f("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));f(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));f("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));f(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));f("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));f("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));f("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));f("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));f("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));f("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));f("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));f("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var Dr=(r,e,t,o)=>typeof r=="string"?n=>e(n,r):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n))):r[0]==="()"&&r.length===2?Dr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Dr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Dr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var Be=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",Be);f(";",Be);var Me=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>Me(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Co=r=>P(M(r));i.id=r=>r===void 0||Co(r)?()=>{}:e=>e?.[r];var or=r=>{throw Error(r)};f("[]",(r,e)=>e===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(t=>t==null?(()=>{}):t[0]==="..."?(t=i(t[1]),o=>t(o)):(t=i(t),o=>[t(o)])),t=>r.flatMap(o=>o(t))):(e==null&&or("Missing index"),r=i(r),e=i(e),t=>{let o=M(e(t));return P(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),P(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?or("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&or("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=Hr(r);return n<0?()=>{}:Fr(r,n?(p,c,u)=>(c=M(c),P(c)?void 0:p[c](...o(u))):(p,c,u)=>p[c](...o(u)))});var K=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&K(r[1])||r[0]==="{}"),Fr=(r,e,t,o)=>r==null?or("Empty ()"):r[0]==="()"&&r.length==2?Fr(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),Gr=r=>Me(r)?1:P(r)?-1:0,Hr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Gr(r):e==="()"&&r.length==2?Hr(r[1]):e==="."||e==="?."?Gr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Gr(t[1]):1:0,F=(r,e,t=Hr(r))=>t<0?()=>{}:Fr(r,t?(o,n,p)=>(n=M(n),P(n)?void 0:e(o,n,p)):e);f("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));f("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));f("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var go=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(K(r)||go("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var Eo=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(K(r)||Eo("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]>>>=e(n))));var So=r=>r[0]?.[0]===","?r[0].slice(1):r,H=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=So(n);if(o==="{}"){let c=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let C={};for(let I in e)!c.includes(I)&&!P(I)&&(C[I]=e[I]);t[u[1]]=C;break}let a,y,R;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],R=u[2]):[,a,y]=u,c.push(a=M(a));let k=P(a)?void 0:e[a];k===void 0&&R&&(k=i(R)(t)),H(y,k,t)}}else if(o==="[]"){let c=0;for(let u of p){if(u===null){c++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(c);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let R=e[c++];R===void 0&&y&&(R=i(y)(t)),H(a,R,t)}}},Xr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>H(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Xr);f("const",Xr);f("var",Xr);var nr=r=>{throw Error(r)};f("=",(r,e)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let t=r[1];return e=i(e),typeof t=="string"?o=>{o[t]=e(o)}:o=>H(t,e(o),o)}return K(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(K(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(K(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(K(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var B=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let c=e?.[0]==="{}";return e=i(c?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((k,C)=>y[k]=a[C]),n&&(y[n]=a.slice(o));let R=new Proxy(y,{get:(k,C)=>C in k?k[C]:u?.[C],set:(k,C,I)=>((C in k?k:u)[C]=I,!0),has:(k,C)=>C in k||(u?C in u:!1)});try{let k=e(R);return c?void 0:k}catch(k){if(k===B)return k[0];throw k}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))P(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),P(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return P(n)?void 0:o[n]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=r[0]==="?.",p=i(r[1]),c=M(r[2]);return P(c)?()=>{}:n?u=>p(u)?.[c]?.(...t(u)):u=>p(u)[c]?.(...t(u))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return u=>{let a=p(u);if(n&&a==null)return;let y=M(c(u));return P(y)?void 0:a[y]?.(...t(u))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(c=>c(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var ir=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[ir,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[ir,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var ko=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!ko(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let c of t.flatMap(u=>u(o)))if(c[0]===ir){let[,u,a]=c;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[c[0]]=c[1];for(let c in p)Object.defineProperty(n,c,p[c]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(c=>c(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,c=o[o.length-1];return Array.isArray(c)&&c[0]==="..."&&(p=o.length-1,n=c[1],o.length--),u=>{let a=(...y)=>{let R={};o.forEach((C,I)=>R[C]=y[I]),n&&(R[n]=y.slice(p));let k=new Proxy(R,{get:(C,I)=>I in C?C[I]:u[I],set:(C,I,De)=>((I in C?C:u)[I]=De,!0),has:(C,I)=>I in C||I in u});try{return t(k)}catch(C){if(C===B)return C[0];throw C}};return r&&(u[r]=a),a}});f("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});f("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});f("await",r=>(r=i(r),async e=>await r(e)));f("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));f("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var To=Symbol("static"),No=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?.(o),p=function(...c){if(!(this instanceof p))return No("Class constructor must be called with new");let u=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,c),u};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let u=t(c),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,R]of a)y==="constructor"?p.prototype.__constructor__=R:p.prototype[y]=R}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[To,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var D=Symbol("break"),X=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===D)break;if(n===X)continue;if(n===B)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===D)break;if(n===X)continue;if(n===B)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let c;for(t?.(p);o(p);n?.(p))try{c=e(p)}catch(u){if(u===D)break;if(u===X)continue;if(u===B)return u[0];throw u}return c}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return Io(o,n,e);if(t==="of")return Ro(o,n,e)}});var Ro=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u of e(n)){o?H(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===D)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}},Io=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u in e(n)){o?H(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===D)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}};f("break",()=>()=>{throw D});f("continue",()=>()=>{throw X});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(u=>u?.[0]==="catch"),o=e.find(u=>u?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===D||y===X||y===B)throw y;if(n!=null&&p){let R=n in u,k=u[n];u[n]=y;try{a=p(u)}finally{R?u[n]=k:delete u[n]}}else if(!p)throw y}finally{c?.(u)}return a}});f("throw",r=>(r=i(r),e=>{throw r(e)}));f("switch",(r,...e)=>(r=i(r),e.length?(e=e.map(t=>[t[0]==="case"?i(t[1]):null,(t[0]==="case"?t[2]:t[1])?.[0]===";"?(t[0]==="case"?t[2]:t[1]).slice(1).map(i):(t[0]==="case"?t[2]:t[1])?[i(t[0]==="case"?t[2]:t[1])]:[]]),t=>{let o=r(t),n=!1,p;for(let[u,a]of e)if(n||u===null||u(t)===o)for(n=!0,c=0;c<a.length;c++)try{p=a[c](t)}catch(y){if(y===D)return p;throw y}var c;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var Ue=new WeakMap,Oo=(r,...e)=>typeof r=="string"?i(s(r)):Ue.get(r)||Ue.set(r,_o(r,e)).get(r),Ke=57344,_o=(r,e)=>{let t=r.reduce((p,c,u)=>p+(u?String.fromCharCode(Ke+u-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-Ke,u;if(c>=0&&c<e.length)return u=e[c],Lo(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Lo=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Po=Oo;export{fr as access,A as binary,i as compile,m as cur,Po as default,O as err,d as expr,J as group,vo as id,l as idx,w as keyword,j as literal,Ge as loc,N as lookup,$r as member,pr as nary,E as next,f as operator,sr as operators,L as parens,s as parse,z as peek,v as prec,lr as propName,T as seek,h as skip,g as token,_ as unary,S as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.7.2",
3
+ "version": "10.7.3",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",