subscript 10.4.1 → 10.4.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.
package/eval/var.js CHANGED
@@ -63,7 +63,4 @@ const varOp = (...decls) => {
63
63
  };
64
64
  operator('let', varOp);
65
65
  operator('const', varOp);
66
- // var just declares the variable (assignment handled by = operator)
67
- operator('var', name => (typeof name === 'string'
68
- ? ctx => { ctx[name] = undefined; }
69
- : () => {}));
66
+ operator('var', varOp);
package/feature/asi.js CHANGED
@@ -65,8 +65,11 @@ parse.step = (a, p, cc, expr) => {
65
65
  return baseStep(a, p, cc, expr) ?? (a && nl ? asi(a, p, expr) ?? null : null);
66
66
  };
67
67
 
68
+ // Runaway-recursion guard: asi recurses once per consecutive statement in a
69
+ // block, so depth ~ statement count. Cap well below the JS call-stack limit
70
+ // (which blows ~5–10k statements) but high enough for realistic generated code.
68
71
  let asiDepth = 0;
69
- const MAX_ASI_DEPTH = 100;
72
+ const MAX_ASI_DEPTH = 2000;
70
73
 
71
74
  const asi = parse.asi = (a, p, expr, b, items) => {
72
75
  if (p >= lvl || asiDepth >= MAX_ASI_DEPTH) return;
package/feature/module.js CHANGED
@@ -28,8 +28,11 @@ keyword('import', STATEMENT, () => (
28
28
  word('.meta') ? (skip(5), ['import.meta']) : ['import', expr(SEQ)]
29
29
  ));
30
30
 
31
- // export: prefix for declarations or re-exports (use STATEMENT to capture const/let/function)
32
- keyword('export', STATEMENT, () => (space(), ['export', expr(STATEMENT)]));
33
-
34
- // default: prefix for export default (NOT switch default: which has colon)
35
- keyword('default', SEQ + 1, () => space() !== 58 && (space(), ['default', expr(SEQ)]));
31
+ // export: prefix for declarations or re-exports (use STATEMENT to capture const/let/function).
32
+ // `export default X` is recognized inline; outside `export`, `default` stays an identifier.
33
+ keyword('export', STATEMENT, () => (
34
+ space(),
35
+ word('default')
36
+ ? (skip(7), ['export', ['default', expr(SEQ)]])
37
+ : ['export', expr(STATEMENT)]
38
+ ));
package/feature/string.js CHANGED
@@ -1,27 +1,58 @@
1
1
  /**
2
- * Strings with escape sequences
3
- *
4
- * Configurable via parse.string: { '"': true } or { '"': true, "'": true }
2
+ * String literals with ES escape sequences.
3
+ * Configurable via parse.string: { '"': true, "'": true }
5
4
  */
6
5
  import { parse, lookup, next, err, skip, idx, cur } from '../parse.js';
7
6
 
8
- const BSLASH = 92, DQUOTE = 34, SQUOTE = 39;
9
- const esc = { n: '\n', r: '\r', t: '\t', b: '\b', f: '\f', v: '\v' };
7
+ const BSLASH = 92, DQUOTE = 34, SQUOTE = 39, U = 117, X = 120, LBRACE = 123, RBRACE = 125, LF = 10, CR = 13;
8
+ const esc = { n: '\n', r: '\r', t: '\t', b: '\b', f: '\f', v: '\v', '0': '\0' };
10
9
 
11
- // Parse string with given quote char code
12
- const parseString = q => (a, _, s = '') => {
13
- if (a || !parse.string?.[String.fromCharCode(q)]) return;
10
+ // Hex digit code value (−1 if not hex)
11
+ const hex = c =>
12
+ c >= 48 && c <= 57 ? c - 48 :
13
+ c >= 65 && c <= 70 ? c - 55 :
14
+ c >= 97 && c <= 102 ? c - 87 : -1;
15
+
16
+ // `s` is the closed-over accumulator shared with the escape handler.
17
+ const parseString = q => (a, _, s = '', qc = String.fromCharCode(q)) => {
18
+ if (a || !parse.string?.[qc]) return;
14
19
  skip();
15
- next(c => c - q && (c === BSLASH ? (s += esc[cur[idx + 1]] || cur[idx + 1], 2) : (s += cur[idx], 1)));
16
- cur[idx] === String.fromCharCode(q) ? skip() : err('Bad string');
20
+
21
+ // Decode escape at idx (a BSLASH); append to s, return source chars consumed.
22
+ // Malformed escapes fall back to literal next char.
23
+ const escape = () => {
24
+ const n = cur.charCodeAt(idx + 1);
25
+ if (n === LF) return 2;
26
+ if (n === CR) return cur.charCodeAt(idx + 2) === LF ? 3 : 2;
27
+ // \xHH or \uHHHH
28
+ if (n === X || (n === U && cur.charCodeAt(idx + 2) !== LBRACE)) {
29
+ const w = n === X ? 2 : 4;
30
+ let cp = 0, h;
31
+ for (let k = 0; k < w; k++) {
32
+ if ((h = hex(cur.charCodeAt(idx + 2 + k))) < 0) return s += cur[idx + 1], 2;
33
+ cp = cp * 16 + h;
34
+ }
35
+ return s += String.fromCharCode(cp), 2 + w;
36
+ }
37
+ // \u{H...H}
38
+ if (n === U) {
39
+ let cp = 0, k = idx + 3, h;
40
+ while ((h = hex(cur.charCodeAt(k))) >= 0) cp = cp * 16 + h, k++;
41
+ if (k > idx + 3 && cp <= 0x10ffff && cur.charCodeAt(k) === RBRACE)
42
+ return s += String.fromCodePoint(cp), k - idx + 1;
43
+ return s += cur[idx + 1], 2;
44
+ }
45
+ return s += esc[cur[idx + 1]] || cur[idx + 1], 2;
46
+ };
47
+
48
+ // c - q is 0 at close, NaN at EOF — both falsy, terminating the loop.
49
+ next(c => c - q && (c !== BSLASH ? (s += cur[idx], 1) : escape()));
50
+ cur[idx] === qc ? skip() : err('Bad string');
17
51
  return [, s];
18
52
  };
19
53
 
20
- // Register both quote chars (enabled via parse.string config)
21
54
  lookup[DQUOTE] = parseString(DQUOTE);
22
55
  lookup[SQUOTE] = parseString(SQUOTE);
23
-
24
- // Default: double quotes only
25
56
  parse.string = { '"': true };
26
57
 
27
58
  export { esc };
package/feature/var.js CHANGED
@@ -1,41 +1,34 @@
1
1
  /**
2
2
  * Variable declarations: let, const, var - parse half
3
3
  *
4
- * AST:
4
+ * AST (uniform for let/const/var):
5
5
  * let x = 1 → ['let', ['=', 'x', 1]]
6
6
  * let x = 1, y = 2 → ['let', ['=', 'x', 1], ['=', 'y', 2]]
7
7
  * const {a} = x → ['const', ['=', ['{}', 'a'], 'x']]
8
8
  * for (let x in o) → ['for', ['in', ['let', 'x'], 'o'], body]
9
- * var x → ['var', 'x'] (acts as assignment target)
9
+ * for (let in o) → ['for', ['in', 'let', 'o'], body] (let as identifier)
10
+ * ({let}) → ['()', ['{}', 'let']] (let as identifier)
11
+ * var x → ['var', 'x']
10
12
  */
11
- import { expr, space, keyword, seek, word, idx } from '../parse.js';
13
+ import { expr, keyword, seek, idx } from '../parse.js';
12
14
 
13
- const STATEMENT = 5, SEQ = 10, ASSIGN = 20;
15
+ const STATEMENT = 5, SEQ = 10;
14
16
 
15
- // let/const: expr(SEQ-1) consumes assignment, stops before comma
16
- // For for-in/of, return ['in/of', ['let', x], iterable] not ['let', ['in', x, it]]
17
- // For comma, return ['let', decl1, decl2, ...] not ['let', [',', ...]]
18
- const decl = keyword => {
19
- // let as identifier in for-in: for (let in obj)
20
- if (keyword === 'let') {
21
- const from = idx;
22
- space();
23
- if (word('in')) { seek(from); return; }
24
- seek(from);
25
- }
26
- let node = expr(SEQ - 1);
27
- // for (let x in obj) - restructure so for-loop sees in/of at top
28
- if (node?.[0] === 'in' || node?.[0] === 'of')
29
- return [node[0], [keyword, node[1]], node[2]];
30
- // let x = 1, y = 2 - flatten comma into nary let
31
- if (node?.[0] === ',')
32
- return [keyword, ...node.slice(1)];
33
- return [keyword, node];
17
+ // expr(SEQ-1) consumes `=` and the comma chain, so we get the whole declarator
18
+ // list. If nothing parses, the keyword falls back to identifier
19
+ // (`{let}`, `(let)`, bare `let`, etc.). For `for (let in/of obj)`, expr reads
20
+ // `in`/`of` as a bare identifier — backtrack so the binary op picks `let` up.
21
+ const decl = kw => {
22
+ const from = idx;
23
+ const node = expr(SEQ - 1);
24
+ if (node == null) return kw;
25
+ if (kw === 'let' && (node === 'in' || node === 'of')) return seek(from), kw;
26
+ if (node[0] === 'in' || node[0] === 'of')
27
+ return [node[0], [kw, node[1]], node[2]];
28
+ if (node[0] === ',') return [kw, ...node.slice(1)];
29
+ return [kw, node];
34
30
  };
35
31
 
36
32
  keyword('let', STATEMENT + 1, () => decl('let'));
37
33
  keyword('const', STATEMENT + 1, () => decl('const'));
38
-
39
- // var: just declares identifier, assignment happens separately
40
- // var x = 5 → ['=', ['var', 'x'], 5]
41
- keyword('var', STATEMENT, () => (space(), ['var', expr(ASSIGN)]));
34
+ keyword('var', STATEMENT + 1, () => decl('var'));
package/jessie.min.js CHANGED
@@ -1,9 +1,9 @@
1
- var u,c,l=r=>(u=0,c=r,l.enter?.(),r=a(),c[u]?R():r||""),R=(r="Unexpected token",t=u,e=c.slice(0,t).split(`
2
- `),o=e.pop(),n=c.slice(Math.max(0,t-40),t),p="\u032D",m=(c[t]||" ")+p,f=c.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
1
+ var u,c,m=r=>(u=0,c=r,m.enter?.(),r=A(),c[u]?N():r||""),N=(r="Unexpected token",t=u,e=c.slice(0,t).split(`
2
+ `),o=e.pop(),n=c.slice(Math.max(0,t-40),t),s="\u032D",l=(c[t]||" ")+s,f=c.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
3
  ${c[t-41]!==`
4
- `,""+n}${m}${f}`)},vr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),N=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},h=(r=1)=>c[u+=r],O=r=>u=r,a=(r=0,t)=>{let e,o,n;for(t&&l.enter?.(r,t);(e=d())&&e!==t&&(n=fr(o,r,e,a));)o=n;return t&&(e==t?(u++,l.exit?.(r,t)):R("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},fr=(r,t,e,o,n)=>(n=T[e])&&n(r,t)||(r?null:N(l.id)||null),d=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},Z=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},je=l.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,I=(r,t=r.length)=>c.substr(u,t)===r&&!l.id(c.charCodeAt(u+t)),v=()=>(h(),a(0,41)),T=[],$={},k=(r,t=32,e,o=r.charCodeAt(0),n=r.length,p=T[o],m=r.toUpperCase()!==r,f,A)=>(t=$[r]=!p&&$[r]||t,T[o]=(g,S,E,C=u)=>(f=E,(E?r==E:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!m||!l.id(c.charCodeAt(u+n)))&&(f=E=r))&&S<t&&(u+=n,(A=e(g))?vr(A,C):(u=C,f=0,!m&&!p&&!g&&R()),A)||p?.(g,S,f))),y=(r,t,e=!1)=>k(r,t,o=>o&&(n=>n&&[r,o,n])(a(t-(e?.5:0)))),P=(r,t,e)=>k(r,t,o=>e?o&&[r,o]:!o&&(o=a(t-.5))&&[r,o]),Q=(r,t)=>k(r,200,e=>!e&&[,t]),lr=(r,t,e)=>k(r,t,(o,n)=>(n=a(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),W=(r,t)=>k(r[0],t,e=>!e&&[r,a(0,r.charCodeAt(1))||null]),mr=(r,t)=>k(r[0],t,e=>e&&[r,e,a(0,r.charCodeAt(1))||null]),w=(r,t,e,o=r.charCodeAt(0),n=r.length,p=T[o],m)=>T[o]=(f,A,g,S=u)=>!f&&(g?r==g:(n<2||c.substr(u,n)==r)&&(g=r))&&A<t&&!l.id(c.charCodeAt(u+n))&&(!l.prop||l.prop(u+n))&&(O(u+n),(m=e())?vr(m,S):O(S),m)||p?.(f,A,g);Object.defineProperty(l,"space",{configurable:!0,enumerable:!0,get:()=>d,set:r=>d=r});Object.defineProperty(l,"step",{configurable:!0,enumerable:!0,get:()=>fr,set:r=>fr=r});var ur={},s=(r,t,e=ur[r])=>ur[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):ur[r[0]]?.(...r.slice(1))??R(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var x=46,z=48,b=57,at=69,ht=101,At=43,yt=45,q=95,Br=110,gt=97,wt=102,Ct=65,Et=70,Mr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),cr=r=>{let t=Mr(N(e=>e===x&&c.charCodeAt(u+1)!==x||e>=z&&e<=b||e===q||((e===at||e===ht)&&((e=c.charCodeAt(u+1))>=z&&e<=b||e===At||e===yt)?2:0)));return c.charCodeAt(u)===Br?(h(),[,BigInt(t)]):(r=+t)!=r?R():[,r]},St={2:r=>r===48||r===49||r===q,8:r=>r>=48&&r<=55||r===q,16:r=>r>=z&&r<=b||r>=gt&&r<=wt||r>=Ct&&r<=Et||r===q};l.number=null;T[x]=r=>!r&&c.charCodeAt(u+1)!==x&&cr();for(let r=z;r<=b;r++)T[r]=t=>t?void 0:cr();T[z]=r=>{if(r)return;let t=l.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&c[u+1]?.toLowerCase()===e[1]){h(2);let n=Mr(N(St[o]));return c.charCodeAt(u)===Br?(h(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return cr()};var kt=92,Lr=34,Ur=39,It={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Dr=r=>(t,e,o="")=>{if(!(t||!l.string?.[String.fromCharCode(r)]))return h(),N(n=>n-r&&(n===kt?(o+=It[c[u+1]]||c[u+1],2):(o+=c[u],1))),c[u]===String.fromCharCode(r)?h():R("Bad string"),[,o]};T[Lr]=Dr(Lr);T[Ur]=Dr(Ur);l.string={'"':!0};var Tt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>y(r,Tt,!0));var Nt=30,Rt=40,_t=140;P("!",_t);y("||",Nt);y("&&",Rt);var Ot=50,Pt=60,vt=70,Fr=100,Bt=140;y("|",Ot);y("&",vt);y("^",Pt);y(">>",Fr);y("<<",Fr);P("~",Bt);var rr=90;y("<",rr);y(">",rr);y("<=",rr);y(">=",rr);var Gr=80;y("==",Gr);y("!=",Gr);var Xr=110,dr=120,Kr=140;y("+",Xr);y("-",Xr);y("*",dr);y("/",dr);y("%",dr);P("+",Kr);P("-",Kr);var tr=150;k("++",tr,r=>r?["++",r,null]:["++",a(tr-1)]);k("--",tr,r=>r?["--",r,null]:["--",a(tr-1)]);var Mt=5,Lt=10;lr(",",Lt);lr(";",Mt,!0);var Ut=170;W("()",Ut);var ar=170;mr("[]",ar);y(".",ar);mr("()",ar);var Dt=32,Ft=l.space;l.comment??={"//":`
6
- `,"/*":"*/"};var hr;l.space=()=>{hr||(hr=Object.entries(l.comment).map(([n,p])=>[n,p,n.charCodeAt(0)]));for(var r;r=Ft();){for(var t=0,e;e=hr[t++];)if(r===e[2]&&c.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
- `)for(;c.charCodeAt(o)>=Dt;)o++;else{for(;c[o]&&c.substr(o,e[1].length)!==e[1];)o++;c[o]&&(o+=e[1].length)}O(o),r=0;break}if(r)return r}return r};var Hr=80;y("===",Hr);y("!==",Hr);var Gt=30;y("??",Gt);var Xt=130,Kt=20;y("**",Xt,!0);y("**=",Kt,!0);var jr=90;y("in",jr);y("of",jr);var Ht=20,jt=100;y(">>>",jt);y(">>>=",Ht,!0);var Ar=20;y("||=",Ar,!0);y("&&=",Ar,!0);y("??=",Ar,!0);Q("true",!0);Q("false",!1);Q("null",null);w("undefined",200,()=>[]);Q("NaN",NaN);Q("Infinity",1/0);var yr=20;k("?",yr,(r,t,e)=>r&&(t=a(yr-1))&&N(o=>o===58)&&(e=a(yr-1),["?",r,t,e]));var Qt=20;y("=>",Qt,!0);var $t=140;P("...",$t);var Qr=170;k("?.",Qr,(r,t)=>{if(!r)return;let e=d();return e===40?(h(),["?.()",r,a(0,41)||null]):e===91?(h(),["?.[]",r,a(0,93)]):(t=a(Qr),t?["?.",r,t]:void 0)});var J=140;P("typeof",J);P("void",J);P("delete",J);w("new",J,()=>I(".target")?(h(7),["new.target"]):["new",a(J)]);var Wt=20,$r=200;l.prop=r=>Z(r)!==58;W("[]",$r);W("{}",$r);y(":",Wt-1,!0);var zt=170,er=96,Jt=36,Vt=123,Yt=92,Zt={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Wr=()=>{let r=[];for(let t="",e;(e=c.charCodeAt(u))!==er;)e?e===Yt?(h(),t+=Zt[c[u]]||c[u],h()):e===Jt&&c.charCodeAt(u+1)===Vt?(t&&r.push([,t]),t="",h(2),r.push(a(0,125))):(t+=c[u],h(),e=c.charCodeAt(u),e===er&&t&&r.push([,t])):R("Unterminated template");return h(),r},qt=T[er];T[er]=(r,t)=>r&&t<zt?l.asi&&l.newline?void 0:(h(),["``",r,...Wr()]):r?qt?.(r,t):(h(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(Wr()));l.string["'"]=!0;l.number={"0x":16,"0b":2,"0o":8};var xt=92,bt=117,re=123,te=125,ee=183,oe=l.id,zr=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,ne=(r=u+2,t,e=0,o=0)=>{if(c.charCodeAt(u)!==xt||c.charCodeAt(u+1)!==bt)return 0;if(c.charCodeAt(r)===re){for(;zr(t=c.charCodeAt(++r));)e=e*16+(t<=57?t-48:(t&31)+9);return r>u+3&&e<=1114111&&c.charCodeAt(r)===te?r-u+1:0}for(;o<4&&zr(c.charCodeAt(r+o));)o++;return o===4?6:0};l.id=r=>oe(r)||r===ee||ne();var gr=5,ie=10,se=20,Jr=r=>{if(r==="let"){let e=u;if(d(),I("in")){O(e);return}O(e)}let t=a(ie-1);return t?.[0]==="in"||t?.[0]==="of"?[t[0],[r,t[1]],t[2]]:t?.[0]===","?[r,...t.slice(1)]:[r,t]};w("let",gr+1,()=>Jr("let"));w("const",gr+1,()=>Jr("const"));w("var",gr,()=>(d(),["var",a(se)]));var or=5,pe=59,M=()=>(d()===123||R("Expected {"),h(),a(or-.5,125)||null),D=()=>d()!==123?a(or+.5):(h(),a(or-.5,125)||null),fe=()=>{let r=u;return d()===pe&&h(),d(),I("else")?(h(4),!0):(O(r),!1)};w("if",or+1,()=>{d();let r=["if",v(),D()];return fe()&&r.push(D()),r});var ue=200;w("function",ue,()=>{d();let r=!1;c[u]==="*"&&(r=!0,h(),d());let t=N(l.id);return t&&d(),r?["function*",t,v()||null,M()]:["function",t,v()||null,M()]});var nr=140,wr=20;P("await",nr);w("yield",nr,()=>(d(),c[u]==="*"?(h(),d(),["yield*",a(wr)]):["yield",a(wr)]));w("async",nr,()=>{if(d(),I("function"))return["async",a(nr)];let r=a(wr-.5);return r&&["async",r]});var Cr=200,le=140,me=90;P("static",le);y("instanceof",me);k("#",Cr,r=>{if(r)return;let t=N(l.id);return t?"#"+t:void 0});w("class",Cr,()=>{d();let r=N(l.id)||null;if(r==="extends")r=null,d();else{if(d(),!I("extends"))return["class",r,null,M()];h(7),d()}return["class",r,a(Cr),M()]});var ce=140,Er=47,de=92,ae=r=>r===de?2:r&&r!==Er,he=r=>r===103||r===105||r===109||r===115||r===117||r===121;k("/",ce,r=>{if(r)return;let t=c.charCodeAt(u);if(t===Er||t===42||t===43||t===63||t===61)return;let e=N(ae);c.charCodeAt(u)===Er||R("Unterminated regex"),h();let o=N(he);try{new RegExp(e,o)}catch(n){R("Invalid regex: "+n.message)}return o?["//",e,o]:["//",e]});var H=5,V=125,Y=59;w("while",H+1,()=>(d(),["while",v(),D()]));w("do",H+1,()=>(r=>(d(),h(5),d(),["do",r,v()]))(D()));w("for",H+1,()=>(d(),I("await")?(h(5),d(),["for await",v(),D()]):["for",v(),D()]));w("break",H+1,()=>{l.asi&&(l.newline=!1);let r=u;d();let t=c.charCodeAt(u);if(!t||t===V||t===Y||l.newline)return["break"];let e=N(l.id);if(!e)return["break"];d();let o=c.charCodeAt(u);return!o||o===V||o===Y||l.newline?["break",e]:(O(r),["break"])});w("continue",H+1,()=>{l.asi&&(l.newline=!1);let r=u;d();let t=c.charCodeAt(u);if(!t||t===V||t===Y||l.newline)return["continue"];let e=N(l.id);if(!e)return["continue"];d();let o=c.charCodeAt(u);return!o||o===V||o===Y||l.newline?["continue",e]:(O(r),["continue"])});w("return",H+1,()=>{l.asi&&(l.newline=!1);let r=d();return!r||r===V||r===Y||l.newline?["return"]:["return",a(H)]});var Sr=5;w("try",Sr+1,()=>{let r=["try",M()];return d(),I("catch")&&(h(5),d(),r.push(["catch",Z()===40?v():null,M()])),d(),I("finally")&&(h(7),r.push(["finally",M()])),r});w("throw",Sr+1,()=>{if(l.asi&&(l.newline=!1),d(),l.newline)throw SyntaxError("Unexpected newline after throw");return["throw",a(Sr)]});var Zr=5,Ae=20,Vr=58,ye=59,qr=125,kr=0,xr=(r,t=r.length,e=r.charCodeAt(0),o=T[e])=>T[e]=(n,p,m)=>I(r)&&!n&&kr||o?.(n,p,m);xr("case");xr("default");var Yr=r=>{let t=[];for(;(r=d())!==qr&&!I("case")&&!I("default");){if(r===ye){h();continue}t.push(a(Zr-.5))||R()}return t.length>1?[";",...t]:t[0]||null},ge=()=>{d()===123||R("Expected {"),h(),kr++;let r=[];try{for(;d()!==qr;)if(I("case")){O(u+4),d();let t=a(Ae-.5);d()===Vr&&h(),r.push(["case",t,Yr()])}else I("default")?(O(u+7),d()===Vr&&h(),r.push(["default",Yr()])):R("Expected case or default")}finally{kr--}return h(),r};w("switch",Zr+1,()=>d()===40&&["switch",v(),...ge()]);var br=5;w("debugger",br+1,()=>["debugger"]);w("with",br+1,()=>(d(),["with",v(),D()]));var Ir=5,j=10,rt=42,we=T[rt];T[rt]=(r,t)=>r?we?.(r,t):(h(),"*");k("from",j+1,r=>r?r[0]!=="="&&r[0]!==","&&(d(),["from",r,a(j+1)]):!1);k("as",j+2,r=>r?(d(),["as",r,a(j+2)]):!1);w("import",Ir,()=>I(".meta")?(h(5),["import.meta"]):["import",a(j)]);w("export",Ir,()=>(d(),["export",a(Ir)]));w("default",j+1,()=>d()!==58&&(d(),["default",a(j)]));var Tr=20,Ce=40,tt=41,et=123,ot=125,nt=r=>t=>{if(t)return;d();let e=N(l.id);if(!e||(d(),c.charCodeAt(u)!==Ce))return!1;h();let o=a(0,tt);return d(),c.charCodeAt(u)!==et?!1:(h(),[r,e,o,a(0,ot)])};k("get",Tr-1,nt("get"));k("set",Tr-1,nt("set"));k("(",Tr-1,r=>{if(!r||typeof r!="string")return;let t=a(0,tt)||null;if(d(),c.charCodeAt(u)===et)return h(),[":",r,["=>",["()",t],a(0,ot)||null]]});l.comment["#!"]=`
9
- `;var st=32,_r=10,Ee=59,Se=125,ke=91,Ie=40,Rr=$.asi??$[";"],Te=l._baseSpace??=l.space,Ne=l._baseStep??=l.step,Re=(r,t)=>{for(;(t=c.charCodeAt(r))<=st;){if(t===_r)return!0;r++}return!1},_e=(r=u,t)=>{for(;r-- >0&&(t=c.charCodeAt(r))<=st;)if(t===_r)return!0;return!1};l.space=(r,t)=>{for(;;){for(t=u,r=Te();t<u;)if(c.charCodeAt(t++)===_r){l.newline=!0;break}if(r===Ee&&Re(u+1)){O(u+1),l.newline=l.semi=!0;continue}return r}};l.enter=()=>l.newline=l.semi=!1;l.exit=(r,t)=>{t===Se&&(l.newline=!0)};l.step=(r,t,e,o)=>{if(l.semi&&t>=Rr)return!1;if(r&&(l.semi||(e===ke||e===Ie)&&_e()))return it(r,t,o)??null;let n=l.newline;return Ne(r,t,e,o)??(r&&n?it(r,t,o)??null:null)};var Nr=0,Oe=100,it=l.asi=(r,t,e,o,n)=>{if(t>=Rr||Nr>=Oe)return;l.semi=!1;let p=u;Nr++;try{o=e(Rr-.5)}finally{Nr--}if(!(!o||u===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var ft=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?ft(r[1],t):(()=>{throw Error("Invalid assignment target")})(),pt={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in pt)s(r,(t,e)=>(e=i(e),ft(t,(o,n,p)=>pt[r](o,n,e(p)))));s("!",r=>(r=i(r),t=>!r(t)));s("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));s("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));s("~",r=>(r=i(r),t=>~r(t)));s("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));s("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));s("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));s(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));s("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));s(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));s("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));s(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));s("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));s("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));s("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));s("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));s("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));s("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));s("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));s("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var Or=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?Or(r[1],t):(()=>{throw Error("Invalid increment target")})();s("++",(r,t)=>Or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));s("--",(r,t)=>Or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var ut=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});s(",",ut);s(";",ut);var F=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",ir=r=>{throw Error(r)};s("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&ir("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return F(o)?void 0:r(e)[o]}));s(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],F(t)?()=>{}:e=>r(e)[t]));s("()",(r,t)=>{if(t===void 0)return r==null?ir("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(p=>p==null||e(p));e(t)&&ir("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(p=>p(n))):(t=i(t),n=>[t(n)]):()=>[];return Pr(r,(n,p,m)=>n[p](...o(m)))});var L=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&L(r[1])||r[0]==="{}"),Pr=(r,t,e,o)=>r==null?ir("Empty ()"):r[0]==="()"&&r.length==2?Pr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let p=e(n);return p==null?void 0:t(p,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let p=e(n);return p==null?void 0:t(p,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),G=Pr;s("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));s("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));s("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Pe=r=>{throw Error(r)};s("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));s("**=",(r,t)=>(L(r)||Pe("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]**=t(n))));s("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var ve=r=>{throw Error(r)};s(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));s(">>>=",(r,t)=>(L(r)||ve("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]>>>=t(n))));var Be=r=>r[0]?.[0]===","?r[0].slice(1):r,X=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,p=Be(n);if(o==="{}"){let m=[];for(let f of p){if(Array.isArray(f)&&f[0]==="..."){let C={};for(let _ in t)m.includes(_)||(C[_]=t[_]);e[f[1]]=C;break}let A,g,S;typeof f=="string"?A=g=f:f[0]==="="?(typeof f[1]=="string"?A=g=f[1]:[,A,g]=f[1],S=f[2]):[,A,g]=f,m.push(A);let E=t[A];E===void 0&&S&&(E=i(S)(e)),X(g,E,e)}}else if(o==="[]"){let m=0;for(let f of p){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let A=f,g;Array.isArray(f)&&f[0]==="="&&([,A,g]=f);let S=t[m++];S===void 0&&g&&(S=i(g)(e)),X(A,S,e)}}},lt=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?p=>{p[e]=n(p)}:p=>X(e,n(p),p)}return i(t)}),t=>{for(let e of r)e(t)});s("let",lt);s("const",lt);s("var",r=>typeof r=="string"?t=>{t[r]=void 0}:()=>{});var sr=r=>{throw Error(r)};s("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>X(e,t(o),o)}return L(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]=t(n))});s("||=",(r,t)=>(L(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]||=t(n))));s("&&=",(r,t)=>(L(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]&&=t(n))));s("??=",(r,t)=>(L(r)||sr("Invalid assignment target"),t=i(t),G(r,(e,o,n)=>e[o]??=t(n))));s("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var B=[];s("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=e[e.length-1];Array.isArray(p)&&p[0]==="..."&&(o=e.length-1,n=p[1],e.length--);let m=t?.[0]==="{}";return t=i(m?["{",t[1]]:t),f=>(...A)=>{let g={};e.forEach((E,C)=>g[E]=A[C]),n&&(g[n]=A.slice(o));let S=new Proxy(g,{get:(E,C)=>C in E?E[C]:f?.[C],set:(E,C,_)=>((C in E?E:f)[C]=_,!0),has:(E,C)=>C in E||(f?C in f:!1)});try{let E=t(S);return m?void 0:E}catch(E){if(E===B)return E[0];throw E}}});s("...",r=>(r=i(r),t=>Object.entries(r(t))));s("?.",(r,t)=>(r=i(r),F(t)?()=>{}:e=>r(e)?.[t]));s("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=t(e);return F(o)?void 0:r(e)?.[o]}));s("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(p=>p(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),p=r[2];return F(p)?()=>{}:m=>n(m)?.[p]?.(...e(m))}if(r[0]==="?.[]"){let n=i(r[1]),p=i(r[2]);return m=>{let f=n(m),A=p(m);return F(A)?void 0:f?.[A]?.(...e(m))}}if(r[0]==="."){let n=i(r[1]),p=r[2];return F(p)?()=>{}:m=>n(m)?.[p]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),p=i(r[2]);return m=>{let f=n(m),A=p(m);return F(A)?void 0:f?.[A]?.(...e(m))}}let o=i(r);return n=>o(n)?.(...e(n))});s("typeof",r=>(r=i(r),t=>typeof r(t)));s("void",r=>(r=i(r),t=>(r(t),void 0)));s("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});s("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>p=>n.map(m=>m(p)))(e.slice(1).map(i)):(n=>p=>[n(p)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var pr=Symbol("accessor");s("get",(r,t)=>(t=t?i(t):()=>{},e=>[[pr,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));s("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[pr,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[t]=n,e(p)}}]]));var Me=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);s("{}",(r,t)=>{if(t!==void 0)return;if(!Me(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let m of e.flatMap(f=>f(o)))if(m[0]===pr){let[,f,A]=m;p[f]={...p[f],...A,configurable:!0,enumerable:!0}}else n[m[0]]=m[1];for(let m in p)Object.defineProperty(n,m,p[m]);return n}});s("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));s(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));s("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));s("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let p of t)Array.isArray(p)&&p[0]===void 0?e.push(p[1]):o.push(i(p));let n=Object.assign([...e],{raw:e});return p=>r(p)(n,...o.map(m=>m(p)))});s("function",(r,t,e)=>{e=e?i(e):()=>{};let o=t?t[0]===","?t.slice(1):[t]:[],n=null,p=-1,m=o[o.length-1];return Array.isArray(m)&&m[0]==="..."&&(p=o.length-1,n=m[1],o.length--),f=>{let A=(...g)=>{let S={};o.forEach((C,_)=>S[C]=g[_]),n&&(S[n]=g.slice(p));let E=new Proxy(S,{get:(C,_)=>_ in C?C[_]:f[_],set:(C,_,dt)=>((_ in C?C:f)[_]=dt,!0),has:(C,_)=>_ in C||_ in f});try{return e(E)}catch(C){if(C===B)return C[0];throw C}};return r&&(f[r]=A),A}});s("function*",(r,t,e)=>{throw Error("Generator functions are not supported in evaluation")});s("async",r=>{let t=i(r);return e=>{let o=t(e);return async function(...n){return o(...n)}}});s("await",r=>(r=i(r),async t=>await r(t)));s("yield",r=>(r=r?i(r):null,t=>{throw{__yield__:r?r(t):void 0}}));s("yield*",r=>(r=i(r),t=>{throw{__yield_all__:r(t)}}));var Le=Symbol("static"),Ue=r=>{throw Error(r)};s("instanceof",(r,t)=>(r=i(r),t=i(t),e=>r(e)instanceof t(e)));s("class",(r,t,e)=>(t=t?i(t):null,e=e?i(e):null,o=>{let n=t?t(o):Object,p=function(...m){if(!(this instanceof p))return Ue("Class constructor must be called with new");let f=t?Reflect.construct(n,m,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(f,m),f};if(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n),e){let m=Object.create(o);m.super=n;let f=e(m),A=Array.isArray(f)&&typeof f[0]?.[0]=="string"?f:[];for(let[g,S]of A)g==="constructor"?p.prototype.__constructor__=S:p.prototype[g]=S}return r&&(o[r]=p),p}));s("static",r=>(r=i(r),t=>[[Le,r(t)]]));s("//",(r,t)=>{let e=new RegExp(r,t||"");return()=>e});s("if",(r,t,e)=>(r=i(r),t=i(t),e=e!==void 0?i(e):null,o=>r(o)?t(o):e?.(o)));var U=Symbol("break"),K=Symbol("continue");s("while",(r,t)=>(r=i(r),t=i(t),e=>{let o;for(;r(e);)try{o=t(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}return o}));s("do",(r,t)=>(r=i(r),t=i(t),e=>{let o;do try{o=r(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}while(t(e));return o}));s("for",(r,t)=>{if(Array.isArray(r)&&r[0]===";"){let[,e,o,n]=r;return e=e?i(e):null,o=o?i(o):()=>!0,n=n?i(n):null,t=i(t),p=>{let m;for(e?.(p);o(p);n?.(p))try{m=t(p)}catch(f){if(f===U)break;if(f===K)continue;if(f===B)return f[0];throw f}return m}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[e,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),e==="in")return Fe(o,n,t);if(e==="of")return De(o,n,t)}});var De=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let f of t(n)){o?X(r,f,n):n[r]=f;try{p=e(n)}catch(A){if(A===U)break;if(A===K)continue;if(A===B)return A[0];throw A}}return o||(n[r]=m),p}},Fe=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let f in t(n)){o?X(r,f,n):n[r]=f;try{p=e(n)}catch(A){if(A===U)break;if(A===K)continue;if(A===B)return A[0];throw A}}return o||(n[r]=m),p}};s("break",()=>()=>{throw U});s("continue",()=>()=>{throw K});s("return",r=>(r=r!==void 0?i(r):null,t=>{throw B[0]=r?.(t),B}));s("try",(r,...t)=>{r=r?i(r):null;let e=t.find(f=>f?.[0]==="catch"),o=t.find(f=>f?.[0]==="finally"),n=e?.[1],p=e?.[2]?i(e[2]):null,m=o?.[1]?i(o[1]):null;return f=>{let A;try{A=r?.(f)}catch(g){if(g===U||g===K||g===B)throw g;if(n!=null&&p){let S=n in f,E=f[n];f[n]=g;try{A=p(f)}finally{S?f[n]=E:delete f[n]}}else if(!p)throw g}finally{m?.(f)}return A}});s("throw",r=>(r=i(r),t=>{throw r(t)}));s("switch",(r,...t)=>(r=i(r),t.length?(t=t.map(e=>[e[0]==="case"?i(e[1]):null,(e[0]==="case"?e[2]:e[1])?.[0]===";"?(e[0]==="case"?e[2]:e[1]).slice(1).map(i):(e[0]==="case"?e[2]:e[1])?[i(e[0]==="case"?e[2]:e[1])]:[]]),e=>{let o=r(e),n=!1,p;for(let[f,A]of t)if(n||f===null||f(e)===o)for(n=!0,m=0;m<A.length;m++)try{p=A[m](e)}catch(g){if(g===U)return p;throw g}var m;return p}):e=>r(e)));s("import",()=>()=>{});s("export",()=>()=>{});s("from",(r,t)=>()=>{});s("as",(r,t)=>()=>{});s("default",r=>i(r));var mt=new WeakMap,Ge=(r,...t)=>typeof r=="string"?i(l(r)):mt.get(r)||mt.set(r,Xe(r,t)).get(r),ct=57344,Xe=(r,t)=>{let e=r.reduce((p,m,f)=>p+(f?String.fromCharCode(ct+f-1):"")+m,""),o=l(e),n=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-ct,f;if(m>=0&&m<t.length)return f=t[m],Ke(f)?f:[,f]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Ke=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),He=Ge;export{mr as access,y as binary,i as compile,c as cur,He as default,R as err,a as expr,W as group,je as id,u as idx,w as keyword,Q as literal,vr as loc,T as lookup,lr as nary,N as next,s as operator,ur as operators,v as parens,l as parse,Z as peek,$ as prec,O as seek,h as skip,d as space,fr as step,k as token,P as unary,I as word};
4
+ `,""+n}${l}${f}`)},Lr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),R=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},h=(r=1)=>c[u+=r],P=r=>u=r,A=(r=0,t)=>{let e,o,n;for(t&&m.enter?.(r,t);(e=a())&&e!==t&&(n=fr(o,r,e,A));)o=n;return t&&(e==t?(u++,m.exit?.(r,t)):N("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},fr=(r,t,e,o,n)=>(n=T[e])&&n(r,t)||(r?null:R(m.id)||null),a=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},Y=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},Je=m.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,I=(r,t=r.length)=>c.substr(u,t)===r&&!m.id(c.charCodeAt(u+t)),v=()=>(h(),A(0,41)),T=[],$={},k=(r,t=32,e,o=r.charCodeAt(0),n=r.length,s=T[o],l=r.toUpperCase()!==r,f,d)=>(t=$[r]=!s&&$[r]||t,T[o]=(g,E,S,w=u)=>(f=S,(S?r==S:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!l||!m.id(c.charCodeAt(u+n)))&&(f=S=r))&&E<t&&(u+=n,(d=e(g))?Lr(d,w):(u=w,f=0,!l&&!s&&!g&&N()),d)||s?.(g,E,f))),y=(r,t,e=!1)=>k(r,t,o=>o&&(n=>n&&[r,o,n])(A(t-(e?.5:0)))),O=(r,t,e)=>k(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),j=(r,t)=>k(r,200,e=>!e&&[,t]),lr=(r,t,e)=>k(r,t,(o,n)=>(n=A(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),x=(r,t)=>k(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),mr=(r,t)=>k(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),C=(r,t,e,o=r.charCodeAt(0),n=r.length,s=T[o],l)=>T[o]=(f,d,g,E=u)=>!f&&(g?r==g:(n<2||c.substr(u,n)==r)&&(g=r))&&d<t&&!m.id(c.charCodeAt(u+n))&&(!m.prop||m.prop(u+n))&&(P(u+n),(l=e())?Lr(l,E):P(E),l)||s?.(f,d,g);Object.defineProperty(m,"space",{configurable:!0,enumerable:!0,get:()=>a,set:r=>a=r});Object.defineProperty(m,"step",{configurable:!0,enumerable:!0,get:()=>fr,set:r=>fr=r});var ur={},p=(r,t,e=ur[r])=>ur[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):ur[r[0]]?.(...r.slice(1))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var q=46,W=48,b=57,gt=69,Ct=101,wt=43,Et=45,Z=95,Mr=110,St=97,kt=102,It=65,Tt=70,Ur=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),cr=r=>{let t=Ur(R(e=>e===q&&c.charCodeAt(u+1)!==q||e>=W&&e<=b||e===Z||((e===gt||e===Ct)&&((e=c.charCodeAt(u+1))>=W&&e<=b||e===wt||e===Et)?2:0)));return c.charCodeAt(u)===Mr?(h(),[,BigInt(t)]):(r=+t)!=r?N():[,r]},Rt={2:r=>r===48||r===49||r===Z,8:r=>r>=48&&r<=55||r===Z,16:r=>r>=W&&r<=b||r>=St&&r<=kt||r>=It&&r<=Tt||r===Z};m.number=null;T[q]=r=>!r&&c.charCodeAt(u+1)!==q&&cr();for(let r=W;r<=b;r++)T[r]=t=>t?void 0:cr();T[W]=r=>{if(r)return;let t=m.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&c[u+1]?.toLowerCase()===e[1]){h(2);let n=Ur(R(Rt[o]));return c.charCodeAt(u)===Mr?(h(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return cr()};var Nt=92,Fr=34,Dr=39,Xr=117,Gr=120,_t=123,Ot=125,Kr=10,Pt=13,vt={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},Hr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,jr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!m.string?.[n])return;h();let s=()=>{let l=c.charCodeAt(u+1);if(l===Kr)return 2;if(l===Pt)return c.charCodeAt(u+2)===Kr?3:2;if(l===Gr||l===Xr&&c.charCodeAt(u+2)!==_t){let f=l===Gr?2:4,d=0,g;for(let E=0;E<f;E++){if((g=Hr(c.charCodeAt(u+2+E)))<0)return o+=c[u+1],2;d=d*16+g}return o+=String.fromCharCode(d),2+f}if(l===Xr){let f=0,d=u+3,g;for(;(g=Hr(c.charCodeAt(d)))>=0;)f=f*16+g,d++;return d>u+3&&f<=1114111&&c.charCodeAt(d)===Ot?(o+=String.fromCodePoint(f),d-u+1):(o+=c[u+1],2)}return o+=vt[c[u+1]]||c[u+1],2};return R(l=>l-r&&(l!==Nt?(o+=c[u],1):s())),c[u]===n?h():N("Bad string"),[,o]};T[Fr]=jr(Fr);T[Dr]=jr(Dr);m.string={'"':!0};var Bt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>y(r,Bt,!0));var Lt=30,Mt=40,Ut=140;O("!",Ut);y("||",Lt);y("&&",Mt);var Ft=50,Dt=60,Xt=70,Qr=100,Gt=140;y("|",Ft);y("&",Xt);y("^",Dt);y(">>",Qr);y("<<",Qr);O("~",Gt);var rr=90;y("<",rr);y(">",rr);y("<=",rr);y(">=",rr);var $r=80;y("==",$r);y("!=",$r);var xr=110,dr=120,Wr=140;y("+",xr);y("-",xr);y("*",dr);y("/",dr);y("%",dr);O("+",Wr);O("-",Wr);var tr=150;k("++",tr,r=>r?["++",r,null]:["++",A(tr-1)]);k("--",tr,r=>r?["--",r,null]:["--",A(tr-1)]);var Kt=5,Ht=10;lr(",",Ht);lr(";",Kt,!0);var jt=170;x("()",jt);var ar=170;mr("[]",ar);y(".",ar);mr("()",ar);var Qt=32,$t=m.space;m.comment??={"//":`
6
+ `,"/*":"*/"};var hr;m.space=()=>{hr||(hr=Object.entries(m.comment).map(([n,s])=>[n,s,n.charCodeAt(0)]));for(var r;r=$t();){for(var t=0,e;e=hr[t++];)if(r===e[2]&&c.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
+ `)for(;c.charCodeAt(o)>=Qt;)o++;else{for(;c[o]&&c.substr(o,e[1].length)!==e[1];)o++;c[o]&&(o+=e[1].length)}P(o),r=0;break}if(r)return r}return r};var zr=80;y("===",zr);y("!==",zr);var xt=30;y("??",xt);var Wt=130,zt=20;y("**",Wt,!0);y("**=",zt,!0);var Jr=90;y("in",Jr);y("of",Jr);var Jt=20,Vt=100;y(">>>",Vt);y(">>>=",Jt,!0);var Ar=20;y("||=",Ar,!0);y("&&=",Ar,!0);y("??=",Ar,!0);j("true",!0);j("false",!1);j("null",null);C("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var yr=20;k("?",yr,(r,t,e)=>r&&(t=A(yr-1))&&R(o=>o===58)&&(e=A(yr-1),["?",r,t,e]));var Yt=20;y("=>",Yt,!0);var Zt=140;O("...",Zt);var Vr=170;k("?.",Vr,(r,t)=>{if(!r)return;let e=a();return e===40?(h(),["?.()",r,A(0,41)||null]):e===91?(h(),["?.[]",r,A(0,93)]):(t=A(Vr),t?["?.",r,t]:void 0)});var z=140;O("typeof",z);O("void",z);O("delete",z);C("new",z,()=>I(".target")?(h(7),["new.target"]):["new",A(z)]);var qt=20,Yr=200;m.prop=r=>Y(r)!==58;x("[]",Yr);x("{}",Yr);y(":",qt-1,!0);var bt=170,er=96,re=36,te=123,ee=92,oe={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Zr=()=>{let r=[];for(let t="",e;(e=c.charCodeAt(u))!==er;)e?e===ee?(h(),t+=oe[c[u]]||c[u],h()):e===re&&c.charCodeAt(u+1)===te?(t&&r.push([,t]),t="",h(2),r.push(A(0,125))):(t+=c[u],h(),e=c.charCodeAt(u),e===er&&t&&r.push([,t])):N("Unterminated template");return h(),r},ne=T[er];T[er]=(r,t)=>r&&t<bt?m.asi&&m.newline?void 0:(h(),["``",r,...Zr()]):r?ne?.(r,t):(h(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(Zr()));m.string["'"]=!0;m.number={"0x":16,"0b":2,"0o":8};var ie=92,se=117,pe=123,fe=125,ue=183,le=m.id,qr=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,me=(r=u+2,t,e=0,o=0)=>{if(c.charCodeAt(u)!==ie||c.charCodeAt(u+1)!==se)return 0;if(c.charCodeAt(r)===pe){for(;qr(t=c.charCodeAt(++r));)e=e*16+(t<=57?t-48:(t&31)+9);return r>u+3&&e<=1114111&&c.charCodeAt(r)===fe?r-u+1:0}for(;o<4&&qr(c.charCodeAt(r+o));)o++;return o===4?6:0};m.id=r=>le(r)||r===ue||me();var gr=5,ce=10,Cr=r=>{let t=u,e=A(ce-1);return e==null?r:r==="let"&&(e==="in"||e==="of")?(P(t),r):e[0]==="in"||e[0]==="of"?[e[0],[r,e[1]],e[2]]:e[0]===","?[r,...e.slice(1)]:[r,e]};C("let",gr+1,()=>Cr("let"));C("const",gr+1,()=>Cr("const"));C("var",gr+1,()=>Cr("var"));var or=5,de=59,L=()=>(a()===123||N("Expected {"),h(),A(or-.5,125)||null),F=()=>a()!==123?A(or+.5):(h(),A(or-.5,125)||null),ae=()=>{let r=u;return a()===de&&h(),a(),I("else")?(h(4),!0):(P(r),!1)};C("if",or+1,()=>{a();let r=["if",v(),F()];return ae()&&r.push(F()),r});var he=200;C("function",he,()=>{a();let r=!1;c[u]==="*"&&(r=!0,h(),a());let t=R(m.id);return t&&a(),r?["function*",t,v()||null,L()]:["function",t,v()||null,L()]});var nr=140,wr=20;O("await",nr);C("yield",nr,()=>(a(),c[u]==="*"?(h(),a(),["yield*",A(wr)]):["yield",A(wr)]));C("async",nr,()=>{if(a(),I("function"))return["async",A(nr)];let r=A(wr-.5);return r&&["async",r]});var Er=200,Ae=140,ye=90;O("static",Ae);y("instanceof",ye);k("#",Er,r=>{if(r)return;let t=R(m.id);return t?"#"+t:void 0});C("class",Er,()=>{a();let r=R(m.id)||null;if(r==="extends")r=null,a();else{if(a(),!I("extends"))return["class",r,null,L()];h(7),a()}return["class",r,A(Er),L()]});var ge=140,Sr=47,Ce=92,we=r=>r===Ce?2:r&&r!==Sr,Ee=r=>r===103||r===105||r===109||r===115||r===117||r===121;k("/",ge,r=>{if(r)return;let t=c.charCodeAt(u);if(t===Sr||t===42||t===43||t===63||t===61)return;let e=R(we);c.charCodeAt(u)===Sr||N("Unterminated regex"),h();let o=R(Ee);try{new RegExp(e,o)}catch(n){N("Invalid regex: "+n.message)}return o?["//",e,o]:["//",e]});var H=5,J=125,V=59;C("while",H+1,()=>(a(),["while",v(),F()]));C("do",H+1,()=>(r=>(a(),h(5),a(),["do",r,v()]))(F()));C("for",H+1,()=>(a(),I("await")?(h(5),a(),["for await",v(),F()]):["for",v(),F()]));C("break",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["break"];let e=R(m.id);if(!e)return["break"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["break",e]:(P(r),["break"])});C("continue",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let t=c.charCodeAt(u);if(!t||t===J||t===V||m.newline)return["continue"];let e=R(m.id);if(!e)return["continue"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["continue",e]:(P(r),["continue"])});C("return",H+1,()=>{m.asi&&(m.newline=!1);let r=a();return!r||r===J||r===V||m.newline?["return"]:["return",A(H)]});var kr=5;C("try",kr+1,()=>{let r=["try",L()];return a(),I("catch")&&(h(5),a(),r.push(["catch",Y()===40?v():null,L()])),a(),I("finally")&&(h(7),r.push(["finally",L()])),r});C("throw",kr+1,()=>{if(m.asi&&(m.newline=!1),a(),m.newline)throw SyntaxError("Unexpected newline after throw");return["throw",A(kr)]});var tt=5,Se=20,br=58,ke=59,et=125,Ir=0,ot=(r,t=r.length,e=r.charCodeAt(0),o=T[e])=>T[e]=(n,s,l)=>I(r)&&!n&&Ir||o?.(n,s,l);ot("case");ot("default");var rt=r=>{let t=[];for(;(r=a())!==et&&!I("case")&&!I("default");){if(r===ke){h();continue}t.push(A(tt-.5))||N()}return t.length>1?[";",...t]:t[0]||null},Ie=()=>{a()===123||N("Expected {"),h(),Ir++;let r=[];try{for(;a()!==et;)if(I("case")){P(u+4),a();let t=A(Se-.5);a()===br&&h(),r.push(["case",t,rt()])}else I("default")?(P(u+7),a()===br&&h(),r.push(["default",rt()])):N("Expected case or default")}finally{Ir--}return h(),r};C("switch",tt+1,()=>a()===40&&["switch",v(),...Ie()]);var nt=5;C("debugger",nt+1,()=>["debugger"]);C("with",nt+1,()=>(a(),["with",v(),F()]));var Tr=5,Q=10,it=42,Te=T[it];T[it]=(r,t)=>r?Te?.(r,t):(h(),"*");k("from",Q+1,r=>r?r[0]!=="="&&r[0]!==","&&(a(),["from",r,A(Q+1)]):!1);k("as",Q+2,r=>r?(a(),["as",r,A(Q+2)]):!1);C("import",Tr,()=>I(".meta")?(h(5),["import.meta"]):["import",A(Q)]);C("export",Tr,()=>(a(),I("default")?(h(7),["export",["default",A(Q)]]):["export",A(Tr)]));var Rr=20,Re=40,st=41,pt=123,ft=125,ut=r=>t=>{if(t)return;a();let e=R(m.id);if(!e||(a(),c.charCodeAt(u)!==Re))return!1;h();let o=A(0,st);return a(),c.charCodeAt(u)!==pt?!1:(h(),[r,e,o,A(0,ft)])};k("get",Rr-1,ut("get"));k("set",Rr-1,ut("set"));k("(",Rr-1,r=>{if(!r||typeof r!="string")return;let t=A(0,st)||null;if(a(),c.charCodeAt(u)===pt)return h(),[":",r,["=>",["()",t],A(0,ft)||null]]});m.comment["#!"]=`
9
+ `;var mt=32,Or=10,Ne=59,_e=125,Oe=91,Pe=40,_r=$.asi??$[";"],ve=m._baseSpace??=m.space,Be=m._baseStep??=m.step,Le=(r,t)=>{for(;(t=c.charCodeAt(r))<=mt;){if(t===Or)return!0;r++}return!1},Me=(r=u,t)=>{for(;r-- >0&&(t=c.charCodeAt(r))<=mt;)if(t===Or)return!0;return!1};m.space=(r,t)=>{for(;;){for(t=u,r=ve();t<u;)if(c.charCodeAt(t++)===Or){m.newline=!0;break}if(r===Ne&&Le(u+1)){P(u+1),m.newline=m.semi=!0;continue}return r}};m.enter=()=>m.newline=m.semi=!1;m.exit=(r,t)=>{t===_e&&(m.newline=!0)};m.step=(r,t,e,o)=>{if(m.semi&&t>=_r)return!1;if(r&&(m.semi||(e===Oe||e===Pe)&&Me()))return lt(r,t,o)??null;let n=m.newline;return Be(r,t,e,o)??(r&&n?lt(r,t,o)??null:null)};var Nr=0,Ue=2e3,lt=m.asi=(r,t,e,o,n)=>{if(t>=_r||Nr>=Ue)return;m.semi=!1;let s=u;Nr++;try{o=e(_r-.5)}finally{Nr--}if(!(!o||u===s))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var dt=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?dt(r[1],t):(()=>{throw Error("Invalid assignment target")})(),ct={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in ct)p(r,(t,e)=>(e=i(e),dt(t,(o,n,s)=>ct[r](o,n,e(s)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var Pr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?Pr(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>Pr(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>Pr(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var at=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});p(",",at);p(";",at);var D=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",ir=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&ir("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return D(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],D(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?ir("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(s=>s==null||e(s));e(t)&&ir("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];return vr(r,(n,s,l)=>n[s](...o(l)))});var M=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&M(r[1])||r[0]==="{}"),vr=(r,t,e,o)=>r==null?ir("Empty ()"):r[0]==="()"&&r.length==2?vr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),X=vr;p("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Fe=r=>{throw Error(r)};p("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));p("**=",(r,t)=>(M(r)||Fe("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]**=t(n))));p("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var De=r=>{throw Error(r)};p(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(M(r)||De("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]>>>=t(n))));var Xe=r=>r[0]?.[0]===","?r[0].slice(1):r,G=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,s=Xe(n);if(o==="{}"){let l=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let w={};for(let _ in t)l.includes(_)||(w[_]=t[_]);e[f[1]]=w;break}let d,g,E;typeof f=="string"?d=g=f:f[0]==="="?(typeof f[1]=="string"?d=g=f[1]:[,d,g]=f[1],E=f[2]):[,d,g]=f,l.push(d);let S=t[d];S===void 0&&E&&(S=i(E)(e)),G(g,S,e)}}else if(o==="[]"){let l=0;for(let f of s){if(f===null){l++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(l);break}let d=f,g;Array.isArray(f)&&f[0]==="="&&([,d,g]=f);let E=t[l++];E===void 0&&g&&(E=i(g)(e)),G(d,E,e)}}},Br=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?s=>{s[e]=n(s)}:s=>G(e,n(s),s)}return i(t)}),t=>{for(let e of r)e(t)});p("let",Br);p("const",Br);p("var",Br);var sr=r=>{throw Error(r)};p("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>G(e,t(o),o)}return M(r)||sr("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]=t(n))});p("||=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]||=t(n))));p("&&=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]&&=t(n))));p("??=",(r,t)=>(M(r)||sr("Invalid assignment target"),t=i(t),X(r,(e,o,n)=>e[o]??=t(n))));p("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var B=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,n=s[1],e.length--);let l=t?.[0]==="{}";return t=i(l?["{",t[1]]:t),f=>(...d)=>{let g={};e.forEach((S,w)=>g[S]=d[w]),n&&(g[n]=d.slice(o));let E=new Proxy(g,{get:(S,w)=>w in S?S[w]:f?.[w],set:(S,w,_)=>((w in S?S:f)[w]=_,!0),has:(S,w)=>w in S||(f?w in f:!1)});try{let S=t(E);return l?void 0:S}catch(S){if(S===B)return S[0];throw S}}});p("...",r=>(r=i(r),t=>Object.entries(r(t))));p("?.",(r,t)=>(r=i(r),D(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=t(e);return D(o)?void 0:r(e)?.[o]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="?.[]"){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...e(l))}}if(r[0]==="."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...e(l))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...e(l))}}let o=i(r);return n=>o(n)?.(...e(n))});p("typeof",r=>(r=i(r),t=>typeof r(t)));p("void",r=>(r=i(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>s=>n.map(l=>l(s)))(e.slice(1).map(i)):(n=>s=>[n(s)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var pr=Symbol("accessor");p("get",(r,t)=>(t=t?i(t):()=>{},e=>[[pr,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[pr,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[t]=n,e(s)}}]]));var Ge=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!Ge(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let l of e.flatMap(f=>f(o)))if(l[0]===pr){let[,f,d]=l;s[f]={...s[f],...d,configurable:!0,enumerable:!0}}else n[l[0]]=l[1];for(let l in s)Object.defineProperty(n,l,s[l]);return n}});p("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(i(s));let n=Object.assign([...e],{raw:e});return s=>r(s)(n,...o.map(l=>l(s)))});p("function",(r,t,e)=>{e=e?i(e):()=>{};let o=t?t[0]===","?t.slice(1):[t]:[],n=null,s=-1,l=o[o.length-1];return Array.isArray(l)&&l[0]==="..."&&(s=o.length-1,n=l[1],o.length--),f=>{let d=(...g)=>{let E={};o.forEach((w,_)=>E[w]=g[_]),n&&(E[n]=g.slice(s));let S=new Proxy(E,{get:(w,_)=>_ in w?w[_]:f[_],set:(w,_,yt)=>((_ in w?w:f)[_]=yt,!0),has:(w,_)=>_ in w||_ in f});try{return e(S)}catch(w){if(w===B)return w[0];throw w}};return r&&(f[r]=d),d}});p("function*",(r,t,e)=>{throw Error("Generator functions are not supported in evaluation")});p("async",r=>{let t=i(r);return e=>{let o=t(e);return async function(...n){return o(...n)}}});p("await",r=>(r=i(r),async t=>await r(t)));p("yield",r=>(r=r?i(r):null,t=>{throw{__yield__:r?r(t):void 0}}));p("yield*",r=>(r=i(r),t=>{throw{__yield_all__:r(t)}}));var Ke=Symbol("static"),He=r=>{throw Error(r)};p("instanceof",(r,t)=>(r=i(r),t=i(t),e=>r(e)instanceof t(e)));p("class",(r,t,e)=>(t=t?i(t):null,e=e?i(e):null,o=>{let n=t?t(o):Object,s=function(...l){if(!(this instanceof s))return He("Class constructor must be called with new");let f=t?Reflect.construct(n,l,s):this;return s.prototype.__constructor__&&s.prototype.__constructor__.apply(f,l),f};if(Object.setPrototypeOf(s.prototype,n.prototype),Object.setPrototypeOf(s,n),e){let l=Object.create(o);l.super=n;let f=e(l),d=Array.isArray(f)&&typeof f[0]?.[0]=="string"?f:[];for(let[g,E]of d)g==="constructor"?s.prototype.__constructor__=E:s.prototype[g]=E}return r&&(o[r]=s),s}));p("static",r=>(r=i(r),t=>[[Ke,r(t)]]));p("//",(r,t)=>{let e=new RegExp(r,t||"");return()=>e});p("if",(r,t,e)=>(r=i(r),t=i(t),e=e!==void 0?i(e):null,o=>r(o)?t(o):e?.(o)));var U=Symbol("break"),K=Symbol("continue");p("while",(r,t)=>(r=i(r),t=i(t),e=>{let o;for(;r(e);)try{o=t(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}return o}));p("do",(r,t)=>(r=i(r),t=i(t),e=>{let o;do try{o=r(e)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}while(t(e));return o}));p("for",(r,t)=>{if(Array.isArray(r)&&r[0]===";"){let[,e,o,n]=r;return e=e?i(e):null,o=o?i(o):()=>!0,n=n?i(n):null,t=i(t),s=>{let l;for(e?.(s);o(s);n?.(s))try{l=t(s)}catch(f){if(f===U)break;if(f===K)continue;if(f===B)return f[0];throw f}return l}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[e,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),e==="in")return Qe(o,n,t);if(e==="of")return je(o,n,t)}});var je=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f of t(n)){o?G(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}},Qe=(r,t,e)=>{t=i(t),e=i(e);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f in t(n)){o?G(r,f,n):n[r]=f;try{s=e(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}};p("break",()=>()=>{throw U});p("continue",()=>()=>{throw K});p("return",r=>(r=r!==void 0?i(r):null,t=>{throw B[0]=r?.(t),B}));p("try",(r,...t)=>{r=r?i(r):null;let e=t.find(f=>f?.[0]==="catch"),o=t.find(f=>f?.[0]==="finally"),n=e?.[1],s=e?.[2]?i(e[2]):null,l=o?.[1]?i(o[1]):null;return f=>{let d;try{d=r?.(f)}catch(g){if(g===U||g===K||g===B)throw g;if(n!=null&&s){let E=n in f,S=f[n];f[n]=g;try{d=s(f)}finally{E?f[n]=S:delete f[n]}}else if(!s)throw g}finally{l?.(f)}return d}});p("throw",r=>(r=i(r),t=>{throw r(t)}));p("switch",(r,...t)=>(r=i(r),t.length?(t=t.map(e=>[e[0]==="case"?i(e[1]):null,(e[0]==="case"?e[2]:e[1])?.[0]===";"?(e[0]==="case"?e[2]:e[1]).slice(1).map(i):(e[0]==="case"?e[2]:e[1])?[i(e[0]==="case"?e[2]:e[1])]:[]]),e=>{let o=r(e),n=!1,s;for(let[f,d]of t)if(n||f===null||f(e)===o)for(n=!0,l=0;l<d.length;l++)try{s=d[l](e)}catch(g){if(g===U)return s;throw g}var l;return s}):e=>r(e)));p("import",()=>()=>{});p("export",()=>()=>{});p("from",(r,t)=>()=>{});p("as",(r,t)=>()=>{});p("default",r=>i(r));var ht=new WeakMap,$e=(r,...t)=>typeof r=="string"?i(m(r)):ht.get(r)||ht.set(r,xe(r,t)).get(r),At=57344,xe=(r,t)=>{let e=r.reduce((s,l,f)=>s+(f?String.fromCharCode(At+f-1):"")+l,""),o=m(e),n=s=>{if(typeof s=="string"&&s.length===1){let l=s.charCodeAt(0)-At,f;if(l>=0&&l<t.length)return f=t[l],We(f)?f:[,f]}return Array.isArray(s)?s.map(n):s};return i(n(o))},We=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),ze=$e;export{mr as access,y as binary,i as compile,c as cur,ze as default,N as err,A as expr,x as group,Je as id,u as idx,C as keyword,j as literal,Lr as loc,T as lookup,lr as nary,R as next,p as operator,ur as operators,v as parens,m as parse,Y as peek,$ as prec,P as seek,h as skip,a as space,fr as step,k as token,O as unary,I as word};
package/justin.min.js CHANGED
@@ -1,8 +1,8 @@
1
- var u,c,d=r=>(u=0,c=r,d.enter?.(),r=y(),c[u]?v():r||""),v=(r="Unexpected token",t=u,e=c.slice(0,t).split(`
2
- `),o=e.pop(),i=c.slice(Math.max(0,t-40),t),p="\u032D",f=(c[t]||" ")+p,m=c.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
- ${c[t-41]!==`
4
- `,""+i}${f}${m}`)},sr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),R=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},C=(r=1)=>c[u+=r],F=r=>u=r,y=(r=0,t)=>{let e,o,i;for(t&&d.enter?.(r,t);(e=_())&&e!==t&&(i=J(o,r,e,y));)o=i;return t&&(e==t?(u++,d.exit?.(r,t)):v("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},J=(r,t,e,o,i)=>(i=I[e])&&i(r,t)||(r?null:R(d.id)||null),_=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},pr=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},wt=d.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,mr=(r,t=r.length)=>c.substr(u,t)===r&&!d.id(c.charCodeAt(u+t)),kt=()=>(C(),y(0,41)),I=[],ir={},w=(r,t=32,e,o=r.charCodeAt(0),i=r.length,p=I[o],f=r.toUpperCase()!==r,m,g)=>(t=ir[r]=!p&&ir[r]||t,I[o]=(h,E,A,S=u)=>(m=A,(A?r==A:(i<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(i<3||c.substr(u,i)==r))&&(!f||!d.id(c.charCodeAt(u+i)))&&(m=A=r))&&E<t&&(u+=i,(g=e(h))?sr(g,S):(u=S,m=0,!f&&!p&&!h&&v()),g)||p?.(h,E,m))),l=(r,t,e=!1)=>w(r,t,o=>o&&(i=>i&&[r,o,i])(y(t-(e?.5:0)))),k=(r,t,e)=>w(r,t,o=>e?o&&[r,o]:!o&&(o=y(t-.5))&&[r,o]),L=(r,t)=>w(r,200,e=>!e&&[,t]),Y=(r,t,e)=>w(r,t,(o,i)=>(i=y(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),i?.[0]===r?o.push(...i.slice(1)):o.push(i||null),o)),U=(r,t)=>w(r[0],t,e=>!e&&[r,y(0,r.charCodeAt(1))||null]),Z=(r,t)=>w(r[0],t,e=>e&&[r,e,y(0,r.charCodeAt(1))||null]),X=(r,t,e,o=r.charCodeAt(0),i=r.length,p=I[o],f)=>I[o]=(m,g,h,E=u)=>!m&&(h?r==h:(i<2||c.substr(u,i)==r)&&(h=r))&&g<t&&!d.id(c.charCodeAt(u+i))&&(!d.prop||d.prop(u+i))&&(F(u+i),(f=e())?sr(f,E):F(E),f)||p?.(m,g,h);Object.defineProperty(d,"space",{configurable:!0,enumerable:!0,get:()=>_,set:r=>_=r});Object.defineProperty(d,"step",{configurable:!0,enumerable:!0,get:()=>J,set:r=>J=r});var V={},s=(r,t,e=V[r])=>V[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):V[r[0]]?.(...r.slice(1))??v(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var $=46,M=48,a=57,Lr=69,Tr=101,_r=43,Ur=45,G=95,fr=110,Mr=97,Br=102,Dr=65,Fr=70,ur=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),q=r=>{let t=ur(R(e=>e===$&&c.charCodeAt(u+1)!==$||e>=M&&e<=a||e===G||((e===Lr||e===Tr)&&((e=c.charCodeAt(u+1))>=M&&e<=a||e===_r||e===Ur)?2:0)));return c.charCodeAt(u)===fr?(C(),[,BigInt(t)]):(r=+t)!=r?v():[,r]},Xr={2:r=>r===48||r===49||r===G,8:r=>r>=48&&r<=55||r===G,16:r=>r>=M&&r<=a||r>=Mr&&r<=Br||r>=Dr&&r<=Fr||r===G};d.number=null;I[$]=r=>!r&&c.charCodeAt(u+1)!==$&&q();for(let r=M;r<=a;r++)I[r]=t=>t?void 0:q();I[M]=r=>{if(r)return;let t=d.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&c[u+1]?.toLowerCase()===e[1]){C(2);let i=ur(R(Xr[o]));return c.charCodeAt(u)===fr?(C(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return q()};var Gr=92,lr=34,cr=39,$r={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},dr=r=>(t,e,o="")=>{if(!(t||!d.string?.[String.fromCharCode(r)]))return C(),R(i=>i-r&&(i===Gr?(o+=$r[c[u+1]]||c[u+1],2):(o+=c[u],1))),c[u]===String.fromCharCode(r)?C():v("Bad string"),[,o]};I[lr]=dr(lr);I[cr]=dr(cr);d.string={'"':!0};var ar=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>l(r,ar,!0));var jr=30,Qr=40,Hr=140;k("!",Hr);l("||",jr);l("&&",Qr);var Kr=50,Wr=60,zr=70,gr=100,Jr=140;l("|",Kr);l("&",zr);l("^",Wr);l(">>",gr);l("<<",gr);k("~",Jr);var j=90;l("<",j);l(">",j);l("<=",j);l(">=",j);var Ar=80;l("==",Ar);l("!=",Ar);var hr=110,x=120,yr=140;l("+",hr);l("-",hr);l("*",x);l("/",x);l("%",x);k("+",yr);k("-",yr);var Q=150;w("++",Q,r=>r?["++",r,null]:["++",y(Q-1)]);w("--",Q,r=>r?["--",r,null]:["--",y(Q-1)]);var Vr=5,Yr=10;Y(",",Yr);Y(";",Vr,!0);var Zr=170;U("()",Zr);var b=170;Z("[]",b);l(".",b);Z("()",b);var qr=32,xr=d.space;d.comment??={"//":`
6
- `,"/*":"*/"};var rr;d.space=()=>{rr||(rr=Object.entries(d.comment).map(([i,p])=>[i,p,i.charCodeAt(0)]));for(var r;r=xr();){for(var t=0,e;e=rr[t++];)if(r===e[2]&&c.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
- `)for(;c.charCodeAt(o)>=qr;)o++;else{for(;c[o]&&c.substr(o,e[1].length)!==e[1];)o++;c[o]&&(o+=e[1].length)}F(o),r=0;break}if(r)return r}return r};var Cr=80;l("===",Cr);l("!==",Cr);var br=30;l("??",br);var rt=130,tt=20;l("**",rt,!0);l("**=",tt,!0);var Sr=90;l("in",Sr);l("of",Sr);var et=20,ot=100;l(">>>",ot);l(">>>=",et,!0);var tr=20;l("||=",tr,!0);l("&&=",tr,!0);l("??=",tr,!0);L("true",!0);L("false",!1);L("null",null);X("undefined",200,()=>[]);L("NaN",NaN);L("Infinity",1/0);var er=20;w("?",er,(r,t,e)=>r&&(t=y(er-1))&&R(o=>o===58)&&(e=y(er-1),["?",r,t,e]));var nt=20;l("=>",nt,!0);var it=140;k("...",it);var Er=170;w("?.",Er,(r,t)=>{if(!r)return;let e=_();return e===40?(C(),["?.()",r,y(0,41)||null]):e===91?(C(),["?.[]",r,y(0,93)]):(t=y(Er),t?["?.",r,t]:void 0)});var B=140;k("typeof",B);k("void",B);k("delete",B);X("new",B,()=>mr(".target")?(C(7),["new.target"]):["new",y(B)]);var st=20,Ir=200;d.prop=r=>pr(r)!==58;U("[]",Ir);U("{}",Ir);l(":",st-1,!0);var pt=170,H=96,mt=36,ft=123,ut=92,lt={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},wr=()=>{let r=[];for(let t="",e;(e=c.charCodeAt(u))!==H;)e?e===ut?(C(),t+=lt[c[u]]||c[u],C()):e===mt&&c.charCodeAt(u+1)===ft?(t&&r.push([,t]),t="",C(2),r.push(y(0,125))):(t+=c[u],C(),e=c.charCodeAt(u),e===H&&t&&r.push([,t])):v("Unterminated template");return C(),r},ct=I[H];I[H]=(r,t)=>r&&t<pt?d.asi&&d.newline?void 0:(C(),["``",r,...wr()]):r?ct?.(r,t):(C(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(wr()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var vr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?vr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),kr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in kr)s(r,(t,e)=>(e=n(e),vr(t,(o,i,p)=>kr[r](o,i,e(p)))));s("!",r=>(r=n(r),t=>!r(t)));s("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));s("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));s("~",r=>(r=n(r),t=>~r(t)));s("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));s("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));s("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));s(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));s("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));s(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));s("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));s(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));s("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));s("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));s("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));s("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));s("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));s("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));s("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));s("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var or=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?or(r[1],t):(()=>{throw Error("Invalid increment target")})();s("++",(r,t)=>or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));s("--",(r,t)=>or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Or=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});s(",",Or);s(";",Or);var N=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",K=r=>{throw Error(r)};s("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&K("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return N(o)?void 0:r(e)[o]}));s(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],N(t)?()=>{}:e=>r(e)[t]));s("()",(r,t)=>{if(t===void 0)return r==null?K("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(p=>p==null||e(p));e(t)&&K("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];return nr(r,(i,p,f)=>i[p](...o(f)))});var O=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&O(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?K("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let p=e(i);return p==null?void 0:t(p,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let p=e(i);return p==null?void 0:t(p,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),P=nr;s("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));s("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));s("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var dt=r=>{throw Error(r)};s("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));s("**=",(r,t)=>(O(r)||dt("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]**=t(i))));s("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var gt=r=>{throw Error(r)};s(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));s(">>>=",(r,t)=>(O(r)||gt("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]>>>=t(i))));var At=r=>r[0]?.[0]===","?r[0].slice(1):r,D=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,p=At(i);if(o==="{}"){let f=[];for(let m of p){if(Array.isArray(m)&&m[0]==="..."){let S={};for(let T in t)f.includes(T)||(S[T]=t[T]);e[m[1]]=S;break}let g,h,E;typeof m=="string"?g=h=m:m[0]==="="?(typeof m[1]=="string"?g=h=m[1]:[,g,h]=m[1],E=m[2]):[,g,h]=m,f.push(g);let A=t[g];A===void 0&&E&&(A=n(E)(e)),D(h,A,e)}}else if(o==="[]"){let f=0;for(let m of p){if(m===null){f++;continue}if(Array.isArray(m)&&m[0]==="..."){e[m[1]]=t.slice(f);break}let g=m,h;Array.isArray(m)&&m[0]==="="&&([,g,h]=m);let E=t[f++];E===void 0&&h&&(E=n(h)(e)),D(g,E,e)}}},Nr=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?p=>{p[e]=i(p)}:p=>D(e,i(p),p)}return n(t)}),t=>{for(let e of r)e(t)});s("let",Nr);s("const",Nr);s("var",r=>typeof r=="string"?t=>{t[r]=void 0}:()=>{});var W=r=>{throw Error(r)};s("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>D(e,t(o),o)}return O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]=t(i))});s("||=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]||=t(i))));s("&&=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]&&=t(i))));s("??=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]??=t(i))));s("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var ht=[];s("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,p=e[e.length-1];Array.isArray(p)&&p[0]==="..."&&(o=e.length-1,i=p[1],e.length--);let f=t?.[0]==="{}";return t=n(f?["{",t[1]]:t),m=>(...g)=>{let h={};e.forEach((A,S)=>h[A]=g[S]),i&&(h[i]=g.slice(o));let E=new Proxy(h,{get:(A,S)=>S in A?A[S]:m?.[S],set:(A,S,T)=>((S in A?A:m)[S]=T,!0),has:(A,S)=>S in A||(m?S in m:!1)});try{let A=t(E);return f?void 0:A}catch(A){if(A===ht)return A[0];throw A}}});s("...",r=>(r=n(r),t=>Object.entries(r(t))));s("?.",(r,t)=>(r=n(r),N(t)?()=>{}:e=>r(e)?.[t]));s("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return N(o)?void 0:r(e)?.[o]}));s("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),p=r[2];return N(p)?()=>{}:f=>i(f)?.[p]?.(...e(f))}if(r[0]==="?.[]"){let i=n(r[1]),p=n(r[2]);return f=>{let m=i(f),g=p(f);return N(g)?void 0:m?.[g]?.(...e(f))}}if(r[0]==="."){let i=n(r[1]),p=r[2];return N(p)?()=>{}:f=>i(f)?.[p]?.(...e(f))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),p=n(r[2]);return f=>{let m=i(f),g=p(f);return N(g)?void 0:m?.[g]?.(...e(f))}}let o=n(r);return i=>o(i)?.(...e(i))});s("typeof",r=>(r=n(r),t=>typeof r(t)));s("void",r=>(r=n(r),t=>(r(t),void 0)));s("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});s("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>p=>i.map(f=>f(p)))(e.slice(1).map(n)):(i=>p=>[i(p)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var z=Symbol("accessor");s("get",(r,t)=>(t=t?n(t):()=>{},e=>[[z,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));s("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[z,r,{set:function(i){let p=Object.create(o||{});p.this=this,p[t]=i,e(p)}}]]));var yt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);s("{}",(r,t)=>{if(t!==void 0)return;if(!yt(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},p={};for(let f of e.flatMap(m=>m(o)))if(f[0]===z){let[,m,g]=f;p[m]={...p[m],...g,configurable:!0,enumerable:!0}}else i[f[0]]=f[1];for(let f in p)Object.defineProperty(i,f,p[f]);return i}});s("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));s(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));s("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));s("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let p of t)Array.isArray(p)&&p[0]===void 0?e.push(p[1]):o.push(n(p));let i=Object.assign([...e],{raw:e});return p=>r(p)(i,...o.map(f=>f(p)))});var Pr=new WeakMap,Ct=(r,...t)=>typeof r=="string"?n(d(r)):Pr.get(r)||Pr.set(r,St(r,t)).get(r),Rr=57344,St=(r,t)=>{let e=r.reduce((p,f,m)=>p+(m?String.fromCharCode(Rr+m-1):"")+f,""),o=d(e),i=p=>{if(typeof p=="string"&&p.length===1){let f=p.charCodeAt(0)-Rr,m;if(f>=0&&f<t.length)return m=t[f],Et(m)?m:[,m]}return Array.isArray(p)?p.map(i):p};return n(i(o))},Et=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),It=Ct;export{Z as access,l as binary,n as compile,c as cur,It as default,v as err,y as expr,U as group,wt as id,u as idx,X as keyword,L as literal,sr as loc,I as lookup,Y as nary,R as next,s as operator,V as operators,kt as parens,d as parse,pr as peek,ir as prec,F as seek,C as skip,_ as space,J as step,w as token,k as unary,mr as word};
1
+ var u,l,A=r=>(u=0,l=r,A.enter?.(),r=y(),l[u]?v():r||""),v=(r="Unexpected token",t=u,e=l.slice(0,t).split(`
2
+ `),o=e.pop(),i=l.slice(Math.max(0,t-40),t),p="\u032D",m=(l[t]||" ")+p,f=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
+ ${l[t-41]!==`
4
+ `,""+i}${m}${f}`)},pr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),R=(r,t=u,e)=>{for(;e=r(l.charCodeAt(u));)u+=e;return l.slice(t,u)},C=(r=1)=>l[u+=r],M=r=>u=r,y=(r=0,t)=>{let e,o,i;for(t&&A.enter?.(r,t);(e=U())&&e!==t&&(i=J(o,r,e,y));)o=i;return t&&(e==t?(u++,A.exit?.(r,t)):v("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},J=(r,t,e,o,i)=>(i=w[e])&&i(r,t)||(r?null:R(A.id)||null),U=r=>{for(;(r=l.charCodeAt(u))<=32;)u++;return r},mr=(r=u)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Lt=A.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,fr=(r,t=r.length)=>l.substr(u,t)===r&&!A.id(l.charCodeAt(u+t)),Tt=()=>(C(),y(0,41)),w=[],sr={},I=(r,t=32,e,o=r.charCodeAt(0),i=r.length,p=w[o],m=r.toUpperCase()!==r,f,d)=>(t=sr[r]=!p&&sr[r]||t,w[o]=(g,S,h,E=u)=>(f=h,(h?r==h:(i<2||r.charCodeAt(1)===l.charCodeAt(u+1)&&(i<3||l.substr(u,i)==r))&&(!m||!A.id(l.charCodeAt(u+i)))&&(f=h=r))&&S<t&&(u+=i,(d=e(g))?pr(d,E):(u=E,f=0,!m&&!p&&!g&&v()),d)||p?.(g,S,f))),c=(r,t,e=!1)=>I(r,t,o=>o&&(i=>i&&[r,o,i])(y(t-(e?.5:0)))),k=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=y(t-.5))&&[r,o]),L=(r,t)=>I(r,200,e=>!e&&[,t]),Y=(r,t,e)=>I(r,t,(o,i)=>(i=y(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),i?.[0]===r?o.push(...i.slice(1)):o.push(i||null),o)),_=(r,t)=>I(r[0],t,e=>!e&&[r,y(0,r.charCodeAt(1))||null]),Z=(r,t)=>I(r[0],t,e=>e&&[r,e,y(0,r.charCodeAt(1))||null]),D=(r,t,e,o=r.charCodeAt(0),i=r.length,p=w[o],m)=>w[o]=(f,d,g,S=u)=>!f&&(g?r==g:(i<2||l.substr(u,i)==r)&&(g=r))&&d<t&&!A.id(l.charCodeAt(u+i))&&(!A.prop||A.prop(u+i))&&(M(u+i),(m=e())?pr(m,S):M(S),m)||p?.(f,d,g);Object.defineProperty(A,"space",{configurable:!0,enumerable:!0,get:()=>U,set:r=>U=r});Object.defineProperty(A,"step",{configurable:!0,enumerable:!0,get:()=>J,set:r=>J=r});var V={},s=(r,t,e=V[r])=>V[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):V[r[0]]?.(...r.slice(1))??v(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var G=46,a=48,$=57,ar=69,Br=101,Fr=43,Mr=45,X=95,ur=110,Dr=97,Xr=102,Gr=65,$r=70,lr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),q=r=>{let t=lr(R(e=>e===G&&l.charCodeAt(u+1)!==G||e>=a&&e<=$||e===X||((e===ar||e===Br)&&((e=l.charCodeAt(u+1))>=a&&e<=$||e===Fr||e===Mr)?2:0)));return l.charCodeAt(u)===ur?(C(),[,BigInt(t)]):(r=+t)!=r?v():[,r]},jr={2:r=>r===48||r===49||r===X,8:r=>r>=48&&r<=55||r===X,16:r=>r>=a&&r<=$||r>=Dr&&r<=Xr||r>=Gr&&r<=$r||r===X};A.number=null;w[G]=r=>!r&&l.charCodeAt(u+1)!==G&&q();for(let r=a;r<=$;r++)w[r]=t=>t?void 0:q();w[a]=r=>{if(r)return;let t=A.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&l[u+1]?.toLowerCase()===e[1]){C(2);let i=lr(R(jr[o]));return l.charCodeAt(u)===ur?(C(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return q()};var Qr=92,cr=34,dr=39,Ar=117,gr=120,Hr=123,Kr=125,hr=10,Wr=13,zr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},yr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Cr=r=>(t,e,o="",i=String.fromCharCode(r))=>{if(t||!A.string?.[i])return;C();let p=()=>{let m=l.charCodeAt(u+1);if(m===hr)return 2;if(m===Wr)return l.charCodeAt(u+2)===hr?3:2;if(m===gr||m===Ar&&l.charCodeAt(u+2)!==Hr){let f=m===gr?2:4,d=0,g;for(let S=0;S<f;S++){if((g=yr(l.charCodeAt(u+2+S)))<0)return o+=l[u+1],2;d=d*16+g}return o+=String.fromCharCode(d),2+f}if(m===Ar){let f=0,d=u+3,g;for(;(g=yr(l.charCodeAt(d)))>=0;)f=f*16+g,d++;return d>u+3&&f<=1114111&&l.charCodeAt(d)===Kr?(o+=String.fromCodePoint(f),d-u+1):(o+=l[u+1],2)}return o+=zr[l[u+1]]||l[u+1],2};return R(m=>m-r&&(m!==Qr?(o+=l[u],1):p())),l[u]===i?C():v("Bad string"),[,o]};w[cr]=Cr(cr);w[dr]=Cr(dr);A.string={'"':!0};var Jr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Jr,!0));var Vr=30,Yr=40,Zr=140;k("!",Zr);c("||",Vr);c("&&",Yr);var qr=50,xr=60,br=70,Sr=100,rt=140;c("|",qr);c("&",br);c("^",xr);c(">>",Sr);c("<<",Sr);k("~",rt);var j=90;c("<",j);c(">",j);c("<=",j);c(">=",j);var Er=80;c("==",Er);c("!=",Er);var wr=110,x=120,Ir=140;c("+",wr);c("-",wr);c("*",x);c("/",x);c("%",x);k("+",Ir);k("-",Ir);var Q=150;I("++",Q,r=>r?["++",r,null]:["++",y(Q-1)]);I("--",Q,r=>r?["--",r,null]:["--",y(Q-1)]);var tt=5,et=10;Y(",",et);Y(";",tt,!0);var ot=170;_("()",ot);var b=170;Z("[]",b);c(".",b);Z("()",b);var nt=32,it=A.space;A.comment??={"//":`
6
+ `,"/*":"*/"};var rr;A.space=()=>{rr||(rr=Object.entries(A.comment).map(([i,p])=>[i,p,i.charCodeAt(0)]));for(var r;r=it();){for(var t=0,e;e=rr[t++];)if(r===e[2]&&l.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
+ `)for(;l.charCodeAt(o)>=nt;)o++;else{for(;l[o]&&l.substr(o,e[1].length)!==e[1];)o++;l[o]&&(o+=e[1].length)}M(o),r=0;break}if(r)return r}return r};var kr=80;c("===",kr);c("!==",kr);var st=30;c("??",st);var pt=130,mt=20;c("**",pt,!0);c("**=",mt,!0);var vr=90;c("in",vr);c("of",vr);var ft=20,ut=100;c(">>>",ut);c(">>>=",ft,!0);var tr=20;c("||=",tr,!0);c("&&=",tr,!0);c("??=",tr,!0);L("true",!0);L("false",!1);L("null",null);D("undefined",200,()=>[]);L("NaN",NaN);L("Infinity",1/0);var er=20;I("?",er,(r,t,e)=>r&&(t=y(er-1))&&R(o=>o===58)&&(e=y(er-1),["?",r,t,e]));var lt=20;c("=>",lt,!0);var ct=140;k("...",ct);var Or=170;I("?.",Or,(r,t)=>{if(!r)return;let e=U();return e===40?(C(),["?.()",r,y(0,41)||null]):e===91?(C(),["?.[]",r,y(0,93)]):(t=y(Or),t?["?.",r,t]:void 0)});var B=140;k("typeof",B);k("void",B);k("delete",B);D("new",B,()=>fr(".target")?(C(7),["new.target"]):["new",y(B)]);var dt=20,Nr=200;A.prop=r=>mr(r)!==58;_("[]",Nr);_("{}",Nr);c(":",dt-1,!0);var At=170,H=96,gt=36,ht=123,yt=92,Ct={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Pr=()=>{let r=[];for(let t="",e;(e=l.charCodeAt(u))!==H;)e?e===yt?(C(),t+=Ct[l[u]]||l[u],C()):e===gt&&l.charCodeAt(u+1)===ht?(t&&r.push([,t]),t="",C(2),r.push(y(0,125))):(t+=l[u],C(),e=l.charCodeAt(u),e===H&&t&&r.push([,t])):v("Unterminated template");return C(),r},St=w[H];w[H]=(r,t)=>r&&t<At?A.asi&&A.newline?void 0:(C(),["``",r,...Pr()]):r?St?.(r,t):(C(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(Pr()));A.string["'"]=!0;A.number={"0x":16,"0b":2,"0o":8};var Lr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?Lr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Rr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in Rr)s(r,(t,e)=>(e=n(e),Lr(t,(o,i,p)=>Rr[r](o,i,e(p)))));s("!",r=>(r=n(r),t=>!r(t)));s("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));s("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));s("~",r=>(r=n(r),t=>~r(t)));s("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));s("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));s("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));s(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));s("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));s(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));s("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));s(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));s("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));s("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));s("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));s("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));s("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));s("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));s("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));s("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var or=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?or(r[1],t):(()=>{throw Error("Invalid increment target")})();s("++",(r,t)=>or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));s("--",(r,t)=>or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Tr=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});s(",",Tr);s(";",Tr);var N=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",K=r=>{throw Error(r)};s("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&K("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return N(o)?void 0:r(e)[o]}));s(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],N(t)?()=>{}:e=>r(e)[t]));s("()",(r,t)=>{if(t===void 0)return r==null?K("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(p=>p==null||e(p));e(t)&&K("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];return nr(r,(i,p,m)=>i[p](...o(m)))});var O=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&O(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?K("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let p=e(i);return p==null?void 0:t(p,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let p=e(i);return p==null?void 0:t(p,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),P=nr;s("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));s("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));s("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var Et=r=>{throw Error(r)};s("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));s("**=",(r,t)=>(O(r)||Et("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]**=t(i))));s("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var wt=r=>{throw Error(r)};s(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));s(">>>=",(r,t)=>(O(r)||wt("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]>>>=t(i))));var It=r=>r[0]?.[0]===","?r[0].slice(1):r,F=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,p=It(i);if(o==="{}"){let m=[];for(let f of p){if(Array.isArray(f)&&f[0]==="..."){let E={};for(let T in t)m.includes(T)||(E[T]=t[T]);e[f[1]]=E;break}let d,g,S;typeof f=="string"?d=g=f:f[0]==="="?(typeof f[1]=="string"?d=g=f[1]:[,d,g]=f[1],S=f[2]):[,d,g]=f,m.push(d);let h=t[d];h===void 0&&S&&(h=n(S)(e)),F(g,h,e)}}else if(o==="[]"){let m=0;for(let f of p){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let d=f,g;Array.isArray(f)&&f[0]==="="&&([,d,g]=f);let S=t[m++];S===void 0&&g&&(S=n(g)(e)),F(d,S,e)}}},ir=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?p=>{p[e]=i(p)}:p=>F(e,i(p),p)}return n(t)}),t=>{for(let e of r)e(t)});s("let",ir);s("const",ir);s("var",ir);var W=r=>{throw Error(r)};s("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>F(e,t(o),o)}return O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]=t(i))});s("||=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]||=t(i))));s("&&=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]&&=t(i))));s("??=",(r,t)=>(O(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]??=t(i))));s("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var kt=[];s("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,p=e[e.length-1];Array.isArray(p)&&p[0]==="..."&&(o=e.length-1,i=p[1],e.length--);let m=t?.[0]==="{}";return t=n(m?["{",t[1]]:t),f=>(...d)=>{let g={};e.forEach((h,E)=>g[h]=d[E]),i&&(g[i]=d.slice(o));let S=new Proxy(g,{get:(h,E)=>E in h?h[E]:f?.[E],set:(h,E,T)=>((E in h?h:f)[E]=T,!0),has:(h,E)=>E in h||(f?E in f:!1)});try{let h=t(S);return m?void 0:h}catch(h){if(h===kt)return h[0];throw h}}});s("...",r=>(r=n(r),t=>Object.entries(r(t))));s("?.",(r,t)=>(r=n(r),N(t)?()=>{}:e=>r(e)?.[t]));s("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return N(o)?void 0:r(e)?.[o]}));s("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),p=r[2];return N(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="?.[]"){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),d=p(m);return N(d)?void 0:f?.[d]?.(...e(m))}}if(r[0]==="."){let i=n(r[1]),p=r[2];return N(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),d=p(m);return N(d)?void 0:f?.[d]?.(...e(m))}}let o=n(r);return i=>o(i)?.(...e(i))});s("typeof",r=>(r=n(r),t=>typeof r(t)));s("void",r=>(r=n(r),t=>(r(t),void 0)));s("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});s("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>p=>i.map(m=>m(p)))(e.slice(1).map(n)):(i=>p=>[i(p)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var z=Symbol("accessor");s("get",(r,t)=>(t=t?n(t):()=>{},e=>[[z,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));s("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[z,r,{set:function(i){let p=Object.create(o||{});p.this=this,p[t]=i,e(p)}}]]));var vt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);s("{}",(r,t)=>{if(t!==void 0)return;if(!vt(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},p={};for(let m of e.flatMap(f=>f(o)))if(m[0]===z){let[,f,d]=m;p[f]={...p[f],...d,configurable:!0,enumerable:!0}}else i[m[0]]=m[1];for(let m in p)Object.defineProperty(i,m,p[m]);return i}});s("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));s(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));s("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));s("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let p of t)Array.isArray(p)&&p[0]===void 0?e.push(p[1]):o.push(n(p));let i=Object.assign([...e],{raw:e});return p=>r(p)(i,...o.map(m=>m(p)))});var Ur=new WeakMap,Ot=(r,...t)=>typeof r=="string"?n(A(r)):Ur.get(r)||Ur.set(r,Nt(r,t)).get(r),_r=57344,Nt=(r,t)=>{let e=r.reduce((p,m,f)=>p+(f?String.fromCharCode(_r+f-1):"")+m,""),o=A(e),i=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-_r,f;if(m>=0&&m<t.length)return f=t[m],Pt(f)?f:[,f]}return Array.isArray(p)?p.map(i):p};return n(i(o))},Pt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Rt=Ot;export{Z as access,c as binary,n as compile,l as cur,Rt as default,v as err,y as expr,_ as group,Lt as id,u as idx,D as keyword,L as literal,pr as loc,w as lookup,Y as nary,R as next,s as operator,V as operators,Tt as parens,A as parse,mr as peek,sr as prec,M as seek,C as skip,U as space,J as step,I as token,k as unary,fr as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.4.1",
3
+ "version": "10.4.3",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",
package/subscript.min.js CHANGED
@@ -1,5 +1,5 @@
1
- var s,l,f=r=>(s=0,l=r,f.enter?.(),r=g(),l[s]?y():r||""),y=(r="Unexpected token",t=s,e=l.slice(0,t).split(`
2
- `),n=e.pop(),o=l.slice(Math.max(0,t-40),t),m="\u032D",d=(l[t]||" ")+m,c=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${n.length+1}
3
- ${l[t-41]!==`
4
- `,""+o}${d}${c}`)},J=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),I=(r,t=s,e)=>{for(;e=r(l.charCodeAt(s));)s+=e;return l.slice(t,s)},S=(r=1)=>l[s+=r],W=r=>s=r,g=(r=0,t)=>{let e,n,o;for(t&&f.enter?.(r,t);(e=O())&&e!==t&&(o=N(n,r,e,g));)n=o;return t&&(e==t?(s++,f.exit?.(r,t)):y("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},N=(r,t,e,n,o)=>(o=A[e])&&o(r,t)||(r?null:I(f.id)||null),O=r=>{for(;(r=l.charCodeAt(s))<=32;)s++;return r},Or=(r=s)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},$r=f.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,Fr=(r,t=r.length)=>l.substr(s,t)===r&&!f.id(l.charCodeAt(s+t)),Xr=()=>(S(),g(0,41)),A=[],z={},h=(r,t=32,e,n=r.charCodeAt(0),o=r.length,m=A[n],d=r.toUpperCase()!==r,c,_)=>(t=z[r]=!m&&z[r]||t,A[n]=(C,w,T,G=s)=>(c=T,(T?r==T:(o<2||r.charCodeAt(1)===l.charCodeAt(s+1)&&(o<3||l.substr(s,o)==r))&&(!d||!f.id(l.charCodeAt(s+o)))&&(c=T=r))&&w<t&&(s+=o,(_=e(C))?J(_,G):(s=G,c=0,!d&&!m&&!C&&y()),_)||m?.(C,w,c))),u=(r,t,e=!1)=>h(r,t,n=>n&&(o=>o&&[r,n,o])(g(t-(e?.5:0)))),E=(r,t,e)=>h(r,t,n=>e?n&&[r,n]:!n&&(n=g(t-.5))&&[r,n]),Br=(r,t)=>h(r,200,e=>!e&&[,t]),F=(r,t,e)=>h(r,t,(n,o)=>(o=g(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),o?.[0]===r?n.push(...o.slice(1)):n.push(o||null),n)),K=(r,t)=>h(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),X=(r,t)=>h(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),Qr=(r,t,e,n=r.charCodeAt(0),o=r.length,m=A[n],d)=>A[n]=(c,_,C,w=s)=>!c&&(C?r==C:(o<2||l.substr(s,o)==r)&&(C=r))&&_<t&&!f.id(l.charCodeAt(s+o))&&(!f.prop||f.prop(s+o))&&(W(s+o),(d=e())?J(d,w):W(w),d)||m?.(c,_,C);Object.defineProperty(f,"space",{configurable:!0,enumerable:!0,get:()=>O,set:r=>O=r});Object.defineProperty(f,"step",{configurable:!0,enumerable:!0,get:()=>N,set:r=>N=r});var $={},p=(r,t,e=$[r])=>$[r]=(...n)=>t(...n)||e?.(...n),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):$[r[0]]?.(...r.slice(1))??y(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var R=46,P=48,D=57,lr=69,mr=101,ur=43,fr=45,U=95,V=110,cr=97,dr=102,Ar=65,gr=70,Y=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),B=r=>{let t=Y(I(e=>e===R&&l.charCodeAt(s+1)!==R||e>=P&&e<=D||e===U||((e===lr||e===mr)&&((e=l.charCodeAt(s+1))>=P&&e<=D||e===ur||e===fr)?2:0)));return l.charCodeAt(s)===V?(S(),[,BigInt(t)]):(r=+t)!=r?y():[,r]},hr={2:r=>r===48||r===49||r===U,8:r=>r>=48&&r<=55||r===U,16:r=>r>=P&&r<=D||r>=cr&&r<=dr||r>=Ar&&r<=gr||r===U};f.number=null;A[R]=r=>!r&&l.charCodeAt(s+1)!==R&&B();for(let r=P;r<=D;r++)A[r]=t=>t?void 0:B();A[P]=r=>{if(r)return;let t=f.number;if(t){for(let[e,n]of Object.entries(t))if(e[0]==="0"&&l[s+1]?.toLowerCase()===e[1]){S(2);let o=Y(I(hr[n]));return l.charCodeAt(s)===V?(S(),[,BigInt("0"+e[1]+o)]):[,parseInt(o,n)]}}return B()};var Cr=92,Z=34,q=39,yr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},x=r=>(t,e,n="")=>{if(!(t||!f.string?.[String.fromCharCode(r)]))return S(),I(o=>o-r&&(o===Cr?(n+=yr[l[s+1]]||l[s+1],2):(n+=l[s],1))),l[s]===String.fromCharCode(r)?S():y("Bad string"),[,n]};A[Z]=x(Z);A[q]=x(q);f.string={'"':!0};var Sr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>u(r,Sr,!0));var Er=30,_r=40,Ir=140;E("!",Ir);u("||",Er);u("&&",_r);var wr=50,Pr=60,Tr=70,j=100,Ur=140;u("|",wr);u("&",Tr);u("^",Pr);u(">>",j);u("<<",j);E("~",Ur);var M=90;u("<",M);u(">",M);u("<=",M);u(">=",M);var a=80;u("==",a);u("!=",a);var b=110,Q=120,rr=140;u("+",b);u("-",b);u("*",Q);u("/",Q);u("%",Q);E("+",rr);E("-",rr);var k=150;h("++",k,r=>r?["++",r,null]:["++",g(k-1)]);h("--",k,r=>r?["--",r,null]:["--",g(k-1)]);var Rr=5,Dr=10;F(",",Dr);F(";",Rr,!0);var Mr=170;K("()",Mr);var H=170;X("[]",H);u(".",H);X("()",H);var er=(r,t,e,n)=>typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="()"&&r.length===2?er(r[1],t):(()=>{throw Error("Invalid assignment target")})(),tr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in tr)p(r,(t,e)=>(e=i(e),er(t,(n,o,m)=>tr[r](n,o,e(m)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var v=(r,t,e,n)=>typeof r=="string"?o=>t(o,r):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o))):r[0]==="()"&&r.length===2?v(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>v(r,t===null?(e,n)=>e[n]++:(e,n)=>++e[n]));p("--",(r,t)=>v(r,t===null?(e,n)=>e[n]--:(e,n)=>--e[n]));var or=(...r)=>(r=r.map(i),t=>{let e;for(let n of r)e=n(t);return e});p(",",or);p(";",or);var nr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",L=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),n=>e(n)):(e=i(e),n=>[e(n)])),e=>r.flatMap(n=>n(e))):(t==null&&L("Missing index"),r=i(r),t=i(t),e=>{let n=t(e);return nr(n)?void 0:r(e)[n]}));p(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],nr(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?L("Empty ()"):i(r);let e=o=>o?.[0]===","&&o.slice(1).some(m=>m==null||e(m));e(t)&&L("Empty argument");let n=t?t[0]===","?(t=t.slice(1).map(i),o=>t.map(m=>m(o))):(t=i(t),o=>[t(o)]):()=>[];return ir(r,(o,m,d)=>o[m](...n(d)))});var ir=(r,t,e,n)=>r==null?L("Empty ()"):r[0]==="()"&&r.length==2?ir(r[1],t):typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="?."?(e=i(r[1]),n=r[2],o=>{let m=e(o);return m==null?void 0:t(m,n,o)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="?.[]"?(e=i(r[1]),n=i(r[2]),o=>{let m=e(o);return m==null?void 0:t(m,n(o),o)}):(r=i(r),o=>t([r(o)],0,o));var sr=new WeakMap,kr=(r,...t)=>typeof r=="string"?i(f(r)):sr.get(r)||sr.set(r,Lr(r,t)).get(r),pr=57344,Lr=(r,t)=>{let e=r.reduce((m,d,c)=>m+(c?String.fromCharCode(pr+c-1):"")+d,""),n=f(e),o=m=>{if(typeof m=="string"&&m.length===1){let d=m.charCodeAt(0)-pr,c;if(d>=0&&d<t.length)return c=t[d],Nr(c)?c:[,c]}return Array.isArray(m)?m.map(o):m};return i(o(n))},Nr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Ft=kr;export{X as access,u as binary,i as compile,l as cur,Ft as default,y as err,g as expr,K as group,$r as id,s as idx,Qr as keyword,Br as literal,J as loc,A as lookup,F as nary,I as next,p as operator,$ as operators,Xr as parens,f as parse,Or as peek,z as prec,W as seek,S as skip,O as space,N as step,h as token,E as unary,Fr as word};
1
+ var s,p,A=r=>(s=0,p=r,A.enter?.(),r=g(),p[s]?S():r||""),S=(r="Unexpected token",t=s,e=p.slice(0,t).split(`
2
+ `),o=e.pop(),n=p.slice(Math.max(0,t-40),t),m="\u032D",f=(p[t]||" ")+m,d=p.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
+ ${p[t-41]!==`
4
+ `,""+n}${f}${d}`)},J=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),I=(r,t=s,e)=>{for(;e=r(p.charCodeAt(s));)s+=e;return p.slice(t,s)},w=(r=1)=>p[s+=r],W=r=>s=r,g=(r=0,t)=>{let e,o,n;for(t&&A.enter?.(r,t);(e=N())&&e!==t&&(n=F(o,r,e,g));)o=n;return t&&(e==t?(s++,A.exit?.(r,t)):S("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},F=(r,t,e,o,n)=>(n=C[e])&&n(r,t)||(r?null:I(A.id)||null),N=r=>{for(;(r=p.charCodeAt(s))<=32;)s++;return r},vr=(r=s)=>{for(;p.charCodeAt(r)<=32;)r++;return p.charCodeAt(r)},Gr=A.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,Wr=(r,t=r.length)=>p.substr(s,t)===r&&!A.id(p.charCodeAt(s+t)),zr=()=>(w(),g(0,41)),C=[],z={},E=(r,t=32,e,o=r.charCodeAt(0),n=r.length,m=C[o],f=r.toUpperCase()!==r,d,h)=>(t=z[r]=!m&&z[r]||t,C[o]=(c,y,R,G=s)=>(d=R,(R?r==R:(n<2||r.charCodeAt(1)===p.charCodeAt(s+1)&&(n<3||p.substr(s,n)==r))&&(!f||!A.id(p.charCodeAt(s+n)))&&(d=R=r))&&y<t&&(s+=n,(h=e(c))?J(h,G):(s=G,d=0,!f&&!m&&!c&&S()),h)||m?.(c,y,d))),u=(r,t,e=!1)=>E(r,t,o=>o&&(n=>n&&[r,o,n])(g(t-(e?.5:0)))),_=(r,t,e)=>E(r,t,o=>e?o&&[r,o]:!o&&(o=g(t-.5))&&[r,o]),Jr=(r,t)=>E(r,200,e=>!e&&[,t]),$=(r,t,e)=>E(r,t,(o,n)=>(n=g(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),K=(r,t)=>E(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),B=(r,t)=>E(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),Kr=(r,t,e,o=r.charCodeAt(0),n=r.length,m=C[o],f)=>C[o]=(d,h,c,y=s)=>!d&&(c?r==c:(n<2||p.substr(s,n)==r)&&(c=r))&&h<t&&!A.id(p.charCodeAt(s+n))&&(!A.prop||A.prop(s+n))&&(W(s+n),(f=e())?J(f,y):W(y),f)||m?.(d,h,c);Object.defineProperty(A,"space",{configurable:!0,enumerable:!0,get:()=>N,set:r=>N=r});Object.defineProperty(A,"step",{configurable:!0,enumerable:!0,get:()=>F,set:r=>F=r});var O={},l=(r,t,e=O[r])=>O[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):O[r[0]]?.(...r.slice(1))??S(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var T=46,P=48,k=57,dr=69,Ar=101,hr=43,cr=45,U=95,V=110,Cr=97,gr=102,yr=65,Er=70,Y=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),X=r=>{let t=Y(I(e=>e===T&&p.charCodeAt(s+1)!==T||e>=P&&e<=k||e===U||((e===dr||e===Ar)&&((e=p.charCodeAt(s+1))>=P&&e<=k||e===hr||e===cr)?2:0)));return p.charCodeAt(s)===V?(w(),[,BigInt(t)]):(r=+t)!=r?S():[,r]},Sr={2:r=>r===48||r===49||r===U,8:r=>r>=48&&r<=55||r===U,16:r=>r>=P&&r<=k||r>=Cr&&r<=gr||r>=yr&&r<=Er||r===U};A.number=null;C[T]=r=>!r&&p.charCodeAt(s+1)!==T&&X();for(let r=P;r<=k;r++)C[r]=t=>t?void 0:X();C[P]=r=>{if(r)return;let t=A.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&p[s+1]?.toLowerCase()===e[1]){w(2);let n=Y(I(Sr[o]));return p.charCodeAt(s)===V?(w(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return X()};var wr=92,Z=34,q=39,x=117,j=120,_r=123,Ir=125,a=10,Pr=13,Rr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},b=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,rr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!A.string?.[n])return;w();let m=()=>{let f=p.charCodeAt(s+1);if(f===a)return 2;if(f===Pr)return p.charCodeAt(s+2)===a?3:2;if(f===j||f===x&&p.charCodeAt(s+2)!==_r){let d=f===j?2:4,h=0,c;for(let y=0;y<d;y++){if((c=b(p.charCodeAt(s+2+y)))<0)return o+=p[s+1],2;h=h*16+c}return o+=String.fromCharCode(h),2+d}if(f===x){let d=0,h=s+3,c;for(;(c=b(p.charCodeAt(h)))>=0;)d=d*16+c,h++;return h>s+3&&d<=1114111&&p.charCodeAt(h)===Ir?(o+=String.fromCodePoint(d),h-s+1):(o+=p[s+1],2)}return o+=Rr[p[s+1]]||p[s+1],2};return I(f=>f-r&&(f!==wr?(o+=p[s],1):m())),p[s]===n?w():S("Bad string"),[,o]};C[Z]=rr(Z);C[q]=rr(q);A.string={'"':!0};var Ur=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>u(r,Ur,!0));var Tr=30,kr=40,Lr=140;_("!",Lr);u("||",Tr);u("&&",kr);var Dr=50,Mr=60,Fr=70,tr=100,Nr=140;u("|",Dr);u("&",Fr);u("^",Mr);u(">>",tr);u("<<",tr);_("~",Nr);var L=90;u("<",L);u(">",L);u("<=",L);u(">=",L);var er=80;u("==",er);u("!=",er);var or=110,Q=120,nr=140;u("+",or);u("-",or);u("*",Q);u("/",Q);u("%",Q);_("+",nr);_("-",nr);var D=150;E("++",D,r=>r?["++",r,null]:["++",g(D-1)]);E("--",D,r=>r?["--",r,null]:["--",g(D-1)]);var Or=5,$r=10;$(",",$r);$(";",Or,!0);var Br=170;K("()",Br);var H=170;B("[]",H);u(".",H);B("()",H);var sr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?sr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),ir={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in ir)l(r,(t,e)=>(e=i(e),sr(t,(o,n,m)=>ir[r](o,n,e(m)))));l("!",r=>(r=i(r),t=>!r(t)));l("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));l("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));l("~",r=>(r=i(r),t=>~r(t)));l("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));l("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));l("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));l(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));l("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));l(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));l("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));l(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));l("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));l("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));l("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));l("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));l("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));l("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));l("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));l("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var v=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?v(r[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(r,t)=>v(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));l("--",(r,t)=>v(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var pr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});l(",",pr);l(";",pr);var lr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",M=r=>{throw Error(r)};l("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&M("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return lr(o)?void 0:r(e)[o]}));l(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],lr(t)?()=>{}:e=>r(e)[t]));l("()",(r,t)=>{if(t===void 0)return r==null?M("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(m=>m==null||e(m));e(t)&&M("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(m=>m(n))):(t=i(t),n=>[t(n)]):()=>[];return mr(r,(n,m,f)=>n[m](...o(f)))});var mr=(r,t,e,o)=>r==null?M("Empty ()"):r[0]==="()"&&r.length==2?mr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let m=e(n);return m==null?void 0:t(m,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let m=e(n);return m==null?void 0:t(m,o(n),n)}):(r=i(r),n=>t([r(n)],0,n));var ur=new WeakMap,Xr=(r,...t)=>typeof r=="string"?i(A(r)):ur.get(r)||ur.set(r,Qr(r,t)).get(r),fr=57344,Qr=(r,t)=>{let e=r.reduce((m,f,d)=>m+(d?String.fromCharCode(fr+d-1):"")+f,""),o=A(e),n=m=>{if(typeof m=="string"&&m.length===1){let f=m.charCodeAt(0)-fr,d;if(f>=0&&f<t.length)return d=t[f],Hr(d)?d:[,d]}return Array.isArray(m)?m.map(n):m};return i(n(o))},Hr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Wt=Xr;export{B as access,u as binary,i as compile,p as cur,Wt as default,S as err,g as expr,K as group,Gr as id,s as idx,Kr as keyword,Jr as literal,J as loc,C as lookup,$ as nary,I as next,l as operator,O as operators,zr as parens,A as parse,vr as peek,z as prec,W as seek,w as skip,N as space,F as step,E as token,_ as unary,Wr as word};