@pi-outpost/embed 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CodeEditor-84sk1WGW.cjs +9 -0
- package/dist/{CodeEditor-CxKTvrhG.js → CodeEditor-CNBsvq8Z.js} +1081 -698
- package/dist/{dist-BDenKBYL.cjs → dist-B9TXDASo.cjs} +1 -1
- package/dist/{dist-AeGgfThs.cjs → dist-BF9tfVH8.cjs} +1 -1
- package/dist/{dist-BWEDf1a-.js → dist-BIMxMB--.js} +49 -49
- package/dist/{dist-C6eKaA9j.cjs → dist-BLS46S7g.cjs} +2 -2
- package/dist/{dist-CGZbBQje.js → dist-BWAsFrsx.js} +69 -69
- package/dist/{dist-DaJf_JYz.js → dist-BZ1m84Kh.js} +56 -56
- package/dist/{dist-CYUF5YPj.js → dist-Bg1-NGne.js} +13 -13
- package/dist/{dist-gn9y7Yb8.js → dist-BjQ1Exnz.js} +26 -26
- package/dist/{dist-DEZD35IP.cjs → dist-BlUoR-U1.cjs} +1 -1
- package/dist/{dist-DNg4hNu7.js → dist-BnXHuZGz.js} +93 -93
- package/dist/{dist-Kg2QsUg8.js → dist-C2UMsquH.js} +74 -74
- package/dist/{dist-D_oMTxAl.cjs → dist-CELe3Rxj.cjs} +2 -2
- package/dist/{dist-CmF-TINl.cjs → dist-CEPd6ecF.cjs} +1 -1
- package/dist/{dist-Cz8GulTe.cjs → dist-CGPxOMk5.cjs} +2 -2
- package/dist/{dist-CCIM600Y.cjs → dist-CPxwFKs7.cjs} +3 -3
- package/dist/{dist-CIBKGNWD.js → dist-Ca51SM3i.js} +141 -141
- package/dist/{dist-BWVp6Da-.js → dist-CcTOENSK.js} +21 -21
- package/dist/{dist-M4fo1U45.cjs → dist-CkDnvyBs.cjs} +1 -1
- package/dist/{dist-BTD5L343.js → dist-CpOA8cNn.js} +121 -121
- package/dist/{dist-CQNYwGEy.cjs → dist-CpsCEkIr.cjs} +1 -1
- package/dist/{dist-LM11INLG.js → dist-CwPu13CG.js} +38 -38
- package/dist/{dist-lPCEVnGX.js → dist-DCT8mdeU.js} +47 -47
- package/dist/{dist-rfjaCa2V.cjs → dist-DJYmQsI-.cjs} +1 -1
- package/dist/{dist-DszFZlYh.js → dist-DeLxY4Ia.js} +32 -32
- package/dist/{dist-2ynRxsSC.cjs → dist-Lxxq5IH0.cjs} +1 -1
- package/dist/{dist-hv72z6I6.js → dist-SqwJhRs0.js} +65 -65
- package/dist/{dist-D6LkseRA.cjs → dist-W-WjEDJm.cjs} +1 -1
- package/dist/{dist-CFf_g4kk.cjs → dist-c-DRw6Dh.cjs} +1 -1
- package/dist/{dist-ChWDi62w.js → dist-iZeihidk.js} +296 -296
- package/dist/{dist-BJHB0x8Y.js → dist-qeX2QqDc.js} +1 -1
- package/dist/{dist-Dpu_aN4m.cjs → dist-sM-IE5EO.cjs} +1 -1
- package/dist/{dist-CT7H4C9g.cjs → dist-vBlUeRrZ.cjs} +1 -1
- package/dist/pi-outpost-embed.cjs +29 -28
- package/dist/pi-outpost-embed.js +3039 -2734
- package/package.json +1 -1
- package/dist/CodeEditor-B699PZlx.cjs +0 -6
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { _ as e,
|
|
2
|
-
import { r as u } from "./dist-
|
|
1
|
+
import { _ as e, a as t, bt as n, f as r, h as i, n as a, p as o, u as s, x as c, yt as l } from "./dist-qeX2QqDc.js";
|
|
2
|
+
import { r as u } from "./dist-BWAsFrsx.js";
|
|
3
3
|
//#region ../node_modules/@lezer/java/dist/index.js
|
|
4
|
-
var d =
|
|
5
|
-
null:
|
|
6
|
-
instanceof:
|
|
7
|
-
this:
|
|
8
|
-
"new super assert open to with void":
|
|
9
|
-
"class interface extends implements enum var":
|
|
10
|
-
"module package import":
|
|
11
|
-
"switch while for if else case default do break continue return try catch finally throw":
|
|
12
|
-
"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":
|
|
13
|
-
IntegerLiteral:
|
|
14
|
-
FloatingPointLiteral:
|
|
15
|
-
"StringLiteral TextBlock":
|
|
16
|
-
CharacterLiteral:
|
|
17
|
-
LineComment:
|
|
18
|
-
BlockComment:
|
|
19
|
-
BooleanLiteral:
|
|
20
|
-
PrimitiveType:
|
|
21
|
-
TypeName:
|
|
22
|
-
Identifier:
|
|
23
|
-
"MethodName/Identifier":
|
|
24
|
-
Definition:
|
|
25
|
-
ArithOp:
|
|
26
|
-
LogicOp:
|
|
27
|
-
BitOp:
|
|
28
|
-
CompareOp:
|
|
29
|
-
AssignOp:
|
|
30
|
-
UpdateOp:
|
|
31
|
-
Asterisk:
|
|
32
|
-
Label:
|
|
33
|
-
"( )":
|
|
34
|
-
"[ ]":
|
|
35
|
-
"{ }":
|
|
36
|
-
".":
|
|
37
|
-
", ;":
|
|
4
|
+
var d = l({
|
|
5
|
+
null: n.null,
|
|
6
|
+
instanceof: n.operatorKeyword,
|
|
7
|
+
this: n.self,
|
|
8
|
+
"new super assert open to with void": n.keyword,
|
|
9
|
+
"class interface extends implements enum var": n.definitionKeyword,
|
|
10
|
+
"module package import": n.moduleKeyword,
|
|
11
|
+
"switch while for if else case default do break continue return try catch finally throw": n.controlKeyword,
|
|
12
|
+
"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws": n.modifier,
|
|
13
|
+
IntegerLiteral: n.integer,
|
|
14
|
+
FloatingPointLiteral: n.float,
|
|
15
|
+
"StringLiteral TextBlock": n.string,
|
|
16
|
+
CharacterLiteral: n.character,
|
|
17
|
+
LineComment: n.lineComment,
|
|
18
|
+
BlockComment: n.blockComment,
|
|
19
|
+
BooleanLiteral: n.bool,
|
|
20
|
+
PrimitiveType: n.standard(n.typeName),
|
|
21
|
+
TypeName: n.typeName,
|
|
22
|
+
Identifier: n.variableName,
|
|
23
|
+
"MethodName/Identifier": n.function(n.variableName),
|
|
24
|
+
Definition: n.definition(n.variableName),
|
|
25
|
+
ArithOp: n.arithmeticOperator,
|
|
26
|
+
LogicOp: n.logicOperator,
|
|
27
|
+
BitOp: n.bitwiseOperator,
|
|
28
|
+
CompareOp: n.compareOperator,
|
|
29
|
+
AssignOp: n.definitionOperator,
|
|
30
|
+
UpdateOp: n.updateOperator,
|
|
31
|
+
Asterisk: n.punctuation,
|
|
32
|
+
Label: n.labelName,
|
|
33
|
+
"( )": n.paren,
|
|
34
|
+
"[ ]": n.squareBracket,
|
|
35
|
+
"{ }": n.brace,
|
|
36
|
+
".": n.derefOperator,
|
|
37
|
+
", ;": n.separator
|
|
38
38
|
}), f = {
|
|
39
39
|
__proto__: null,
|
|
40
40
|
void: 34,
|
|
@@ -233,7 +233,7 @@ var d = t({
|
|
|
233
233
|
tokenPrec: 9164
|
|
234
234
|
}), m = /*@__PURE__*/ a.define({
|
|
235
235
|
name: "java",
|
|
236
|
-
parser: /*@__PURE__*/ p.configure({ props: [/*@__PURE__*/
|
|
236
|
+
parser: /*@__PURE__*/ p.configure({ props: [/*@__PURE__*/ c.add({
|
|
237
237
|
IfStatement: /*@__PURE__*/ s({ except: /^\s*({|else\b)/ }),
|
|
238
238
|
TryStatement: /*@__PURE__*/ s({ except: /^\s*({|catch|finally)\b/ }),
|
|
239
239
|
LabeledStatement: o,
|
|
@@ -265,7 +265,7 @@ var d = t({
|
|
|
265
265
|
}
|
|
266
266
|
});
|
|
267
267
|
function h() {
|
|
268
|
-
return new
|
|
268
|
+
return new t(m);
|
|
269
269
|
}
|
|
270
270
|
//#endregion
|
|
271
271
|
export { h as java };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e,
|
|
2
|
-
import { n as c, r as l } from "./dist-
|
|
1
|
+
import { _ as e, a as t, bt as n, h as r, n as i, u as a, x as o, yt as s } from "./dist-qeX2QqDc.js";
|
|
2
|
+
import { n as c, r as l } from "./dist-BWAsFrsx.js";
|
|
3
3
|
//#region ../node_modules/@lezer/rust/dist/index.js
|
|
4
4
|
var u = 1, d = 2, f = 3, p = 4, m = 5, h = 301, g = 98, _ = 101, v = 102, y = 114, b = 69, x = 46, S = 43, C = 45, w = 35, T = 34, E = 124, D = 60, O = 62, k = 61, A = 38;
|
|
5
5
|
function j(e) {
|
|
@@ -58,49 +58,49 @@ var N = new c((e, t) => {
|
|
|
58
58
|
e.next == D && e.peek(1) != k ? e.acceptToken(d, 1) : e.next == O && e.acceptToken(f, 1);
|
|
59
59
|
}), I = new c((e, t) => {
|
|
60
60
|
e.next == A && e.peek(1) == A && t.canShift(h) && e.acceptToken(h, 2);
|
|
61
|
-
}, { contextual: !0 }), L =
|
|
62
|
-
"const macro_rules struct union enum type fn impl trait let static":
|
|
63
|
-
"mod use crate":
|
|
64
|
-
"pub unsafe async mut extern default move":
|
|
65
|
-
"for if else loop while match continue break return await":
|
|
66
|
-
"as in ref":
|
|
67
|
-
"where _ crate super dyn":
|
|
68
|
-
self:
|
|
69
|
-
String:
|
|
70
|
-
Char:
|
|
71
|
-
RawString:
|
|
72
|
-
Boolean:
|
|
73
|
-
Identifier:
|
|
74
|
-
"CallExpression/Identifier":
|
|
75
|
-
BoundIdentifier:
|
|
76
|
-
"FunctionItem/BoundIdentifier":
|
|
77
|
-
LoopLabel:
|
|
78
|
-
FieldIdentifier:
|
|
79
|
-
"CallExpression/FieldExpression/FieldIdentifier":
|
|
80
|
-
Lifetime:
|
|
81
|
-
ScopeIdentifier:
|
|
82
|
-
TypeIdentifier:
|
|
83
|
-
"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":
|
|
84
|
-
"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":
|
|
85
|
-
"\"!\"":
|
|
86
|
-
UpdateOp:
|
|
87
|
-
"LineComment Shebang":
|
|
88
|
-
BlockComment:
|
|
89
|
-
Integer:
|
|
90
|
-
Float:
|
|
91
|
-
ArithOp:
|
|
92
|
-
LogicOp:
|
|
93
|
-
BitOp:
|
|
94
|
-
CompareOp:
|
|
95
|
-
"=":
|
|
96
|
-
".. ... => ->":
|
|
97
|
-
"( )":
|
|
98
|
-
"[ ]":
|
|
99
|
-
"{ }":
|
|
100
|
-
". DerefOp":
|
|
101
|
-
"&":
|
|
102
|
-
", ; ::":
|
|
103
|
-
"Attribute/...":
|
|
61
|
+
}, { contextual: !0 }), L = s({
|
|
62
|
+
"const macro_rules struct union enum type fn impl trait let static": n.definitionKeyword,
|
|
63
|
+
"mod use crate": n.moduleKeyword,
|
|
64
|
+
"pub unsafe async mut extern default move": n.modifier,
|
|
65
|
+
"for if else loop while match continue break return await": n.controlKeyword,
|
|
66
|
+
"as in ref": n.operatorKeyword,
|
|
67
|
+
"where _ crate super dyn": n.keyword,
|
|
68
|
+
self: n.self,
|
|
69
|
+
String: n.string,
|
|
70
|
+
Char: n.character,
|
|
71
|
+
RawString: n.special(n.string),
|
|
72
|
+
Boolean: n.bool,
|
|
73
|
+
Identifier: n.variableName,
|
|
74
|
+
"CallExpression/Identifier": n.function(n.variableName),
|
|
75
|
+
BoundIdentifier: n.definition(n.variableName),
|
|
76
|
+
"FunctionItem/BoundIdentifier": n.function(n.definition(n.variableName)),
|
|
77
|
+
LoopLabel: n.labelName,
|
|
78
|
+
FieldIdentifier: n.propertyName,
|
|
79
|
+
"CallExpression/FieldExpression/FieldIdentifier": n.function(n.propertyName),
|
|
80
|
+
Lifetime: n.special(n.variableName),
|
|
81
|
+
ScopeIdentifier: n.namespace,
|
|
82
|
+
TypeIdentifier: n.typeName,
|
|
83
|
+
"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier": n.macroName,
|
|
84
|
+
"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier": n.macroName,
|
|
85
|
+
"\"!\"": n.macroName,
|
|
86
|
+
UpdateOp: n.updateOperator,
|
|
87
|
+
"LineComment Shebang": n.lineComment,
|
|
88
|
+
BlockComment: n.blockComment,
|
|
89
|
+
Integer: n.integer,
|
|
90
|
+
Float: n.float,
|
|
91
|
+
ArithOp: n.arithmeticOperator,
|
|
92
|
+
LogicOp: n.logicOperator,
|
|
93
|
+
BitOp: n.bitwiseOperator,
|
|
94
|
+
CompareOp: n.compareOperator,
|
|
95
|
+
"=": n.definitionOperator,
|
|
96
|
+
".. ... => ->": n.punctuation,
|
|
97
|
+
"( )": n.paren,
|
|
98
|
+
"[ ]": n.squareBracket,
|
|
99
|
+
"{ }": n.brace,
|
|
100
|
+
". DerefOp": n.derefOperator,
|
|
101
|
+
"&": n.operator,
|
|
102
|
+
", ; ::": n.separator,
|
|
103
|
+
"Attribute/...": n.meta
|
|
104
104
|
}), R = {
|
|
105
105
|
__proto__: null,
|
|
106
106
|
self: 26,
|
|
@@ -322,7 +322,7 @@ var N = new c((e, t) => {
|
|
|
322
322
|
tokenPrec: 18860
|
|
323
323
|
}), B = /*@__PURE__*/ i.define({
|
|
324
324
|
name: "rust",
|
|
325
|
-
parser: /*@__PURE__*/ z.configure({ props: [/*@__PURE__*/
|
|
325
|
+
parser: /*@__PURE__*/ z.configure({ props: [/*@__PURE__*/ o.add({
|
|
326
326
|
IfExpression: /*@__PURE__*/ a({ except: /^\s*({|else\b)/ }),
|
|
327
327
|
"String BlockComment": () => null,
|
|
328
328
|
AttributeItem: (e) => e.continue(),
|
|
@@ -351,7 +351,7 @@ var N = new c((e, t) => {
|
|
|
351
351
|
}
|
|
352
352
|
});
|
|
353
353
|
function V() {
|
|
354
|
-
return new
|
|
354
|
+
return new t(B);
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
export { V as rust };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./dist-DEZD35IP.cjs");var t=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,r,i=0){let a=t.parser.context;return new e(t,[],r,i,i,0,[],0,a?new n(a,a.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new r(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new n(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},n=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},r=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},i=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function a(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var o=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},s=new o,c=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=s,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=s,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},l=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;f(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};l.prototype.contextual=l.prototype.fallback=l.prototype.extend=!1;var u=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?a(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(f(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};u.prototype.contextual=l.prototype.fallback=l.prototype.extend=!1;var d=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function f(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||m(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function p(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function m(e,t,n,r){let i=p(n,r,t);return i<0||p(n,r,e)<i}var h=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG),g=null;function _(t,n,r){let i=t.cursor(e.bt.IncludeAnonymous);for(i.moveTo(n);;)if(!(r<0?i.childBefore(n):i.childAfter(n)))for(;;){if((r<0?i.to<n:i.from>n)&&!i.type.isError)return r<0?Math.max(0,Math.min(i.to-1,n-25)):Math.min(t.length,Math.max(i.from+1,n+25));if(r<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return r<0?0:t.length}}var v=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=r.children[i],o=this.start[n]+r.positions[i];if(o>t)return this.nextStart=o,null;if(a instanceof e.Et){let r=o>this.lastRepeatPos&&a.type.id>=this.minRepeat;if(o==t||r){let n=o+a.length,i;if(o>=this.safeFrom&&n<=this.safeTo&&(!(i=a.prop(e.xt.lookAhead))||n+i<this.fragment.to)){if(r&&(this.lastRepeat=a,this.lastRepeatPos=o),o==t)return a}else if(o==t)return null}this.index[n]++,o+a.length>=Math.max(this.safeFrom,t)&&(this.trees.push(a),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+a.length}}},y=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new o)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,c=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let o=i[r],l=this.tokens[r];if((!n||o.fallback)&&((o.contextual||l.start!=e.pos||l.mask!=a||l.context!=s)&&(this.updateCachedToken(l,o,e),l.mask=a,l.context=s),l.lookAhead>l.end+25&&(c=Math.max(l.lookAhead,c)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!o.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!n&&e.pos==this.stream.end&&(n=new o,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new o,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=E(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(E(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(E(o,s+1),t,n,r))}return r}},b=class{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new c(n,i),this.tokens=new y(e,this.stream),this.topTerm=e.top[1];let{from:a}=i[0];this.stacks=[t.start(this,e.top[0],a)],this.fragments=r.length&&this.stream.end-a>e.bufferLength*4?new v(r,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&D(r);if(e)return h&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw h&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return h&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(t,n,r,i){if(!r)return null;let a=t.curContext&&t.curContext.tracker.strict,o=a?t.curContext.hash:0;for(;r;){let s=this.parser.nodeSet.types[r.type.id]==r.type?this.parser.getGoto(t.state,r.type.id):-1;if(s>-1&&r.length&&(!a||(r.prop(e.xt.contextHash)||0)==o))return t.useNode(r,s,n),r;if(r.children.length==0||r.positions[0]>0)break;let c=r.children[0];if(c instanceof e.Et&&(!i||c.type.id>=this.parser.minRepeatTerm))r=c;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=h?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return h&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),h&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),h&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return x(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=h?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),h&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(h&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)h&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))h&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),h&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),x(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(t){return t.close(),e.Et.build({buffer:i.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(g||=new WeakMap).get(e);return t||g.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function x(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var S=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},C=e=>e,w=class{constructor(e){this.start=e.start,this.shift=e.shift||C,this.reduce=e.reduce||C,this.reuse=e.reuse||C,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},T=class t extends e.Tt{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(` `);this.minRepeatTerm=n.length;for(let e=0;e<t.repeatNodeCount;e++)n.push(``);let r=Object.keys(t.topRules).map(e=>t.topRules[e][1]),i=[];for(let e=0;e<n.length;e++)i.push([]);function o(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(t.nodeProps)for(let n of t.nodeProps){let t=n[0];typeof t==`string`&&(t=e.xt[t]);for(let e=1;e<n.length;){let r=n[e++];if(r>=0)o(r,t,n[e++]);else{let i=n[e+-r];for(let a=-r;a>0;a--)o(n[e++],t,i);e++}}}this.nodeSet=new e.St(n.map((n,a)=>e.Ct.define({name:a>=this.minRepeatTerm?void 0:n,id:a,props:i[a],top:r.indexOf(a)>-1,error:a==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(a)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=e.yt;let s=a(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(O),this.states=a(t.states,Uint32Array),this.data=a(t.stateData),this.goto=a(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(e=>typeof e==`number`?new l(s,e):e),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new b(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=E(n,i+2)];else if(n[i+1]==2)return E(n,i+2);else break}if(a==t||a==0)return E(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=E(this.data,n+2);else break}r=t(E(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=E(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw RangeError(`Invalid top rule name ${e.top}`);n.top=t}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=e.specializers.find(e=>e.from==t.external);if(!i)return t;let a=Object.assign(Object.assign({},t),{external:i.to});return n.specializers[r]=O(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new S(e,n,r)}static deserialize(e){return new t(e)}};function E(e,t){return e[t]|e[t+1]<<16}function D(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function O(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return w}});
|
|
1
|
+
const e=require("./dist-BlUoR-U1.cjs");var t=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,r,i=0){let a=t.parser.context;return new e(t,[],r,i,i,0,[],0,a?new n(a,a.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new r(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new n(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},n=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},r=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},i=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function a(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var o=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},s=new o,c=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=s,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=s,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},l=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;f(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};l.prototype.contextual=l.prototype.fallback=l.prototype.extend=!1;var u=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?a(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(f(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};u.prototype.contextual=l.prototype.fallback=l.prototype.extend=!1;var d=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function f(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||m(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function p(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function m(e,t,n,r){let i=p(n,r,t);return i<0||p(n,r,e)<i}var h=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG),g=null;function _(t,n,r){let i=t.cursor(e.St.IncludeAnonymous);for(i.moveTo(n);;)if(!(r<0?i.childBefore(n):i.childAfter(n)))for(;;){if((r<0?i.to<n:i.from>n)&&!i.type.isError)return r<0?Math.max(0,Math.min(i.to-1,n-25)):Math.min(t.length,Math.max(i.from+1,n+25));if(r<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return r<0?0:t.length}}var v=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=r.children[i],o=this.start[n]+r.positions[i];if(o>t)return this.nextStart=o,null;if(a instanceof e.Ot){let r=o>this.lastRepeatPos&&a.type.id>=this.minRepeat;if(o==t||r){let n=o+a.length,i;if(o>=this.safeFrom&&n<=this.safeTo&&(!(i=a.prop(e.Ct.lookAhead))||n+i<this.fragment.to)){if(r&&(this.lastRepeat=a,this.lastRepeatPos=o),o==t)return a}else if(o==t)return null}this.index[n]++,o+a.length>=Math.max(this.safeFrom,t)&&(this.trees.push(a),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+a.length}}},y=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new o)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,c=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let o=i[r],l=this.tokens[r];if((!n||o.fallback)&&((o.contextual||l.start!=e.pos||l.mask!=a||l.context!=s)&&(this.updateCachedToken(l,o,e),l.mask=a,l.context=s),l.lookAhead>l.end+25&&(c=Math.max(l.lookAhead,c)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!o.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!n&&e.pos==this.stream.end&&(n=new o,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new o,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=E(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(E(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(E(o,s+1),t,n,r))}return r}},b=class{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new c(n,i),this.tokens=new y(e,this.stream),this.topTerm=e.top[1];let{from:a}=i[0];this.stacks=[t.start(this,e.top[0],a)],this.fragments=r.length&&this.stream.end-a>e.bufferLength*4?new v(r,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&D(r);if(e)return h&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw h&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return h&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(t,n,r,i){if(!r)return null;let a=t.curContext&&t.curContext.tracker.strict,o=a?t.curContext.hash:0;for(;r;){let s=this.parser.nodeSet.types[r.type.id]==r.type?this.parser.getGoto(t.state,r.type.id):-1;if(s>-1&&r.length&&(!a||(r.prop(e.Ct.contextHash)||0)==o))return t.useNode(r,s,n),r;if(r.children.length==0||r.positions[0]>0)break;let c=r.children[0];if(c instanceof e.Ot&&(!i||c.type.id>=this.parser.minRepeatTerm))r=c;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=h?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return h&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),h&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),h&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return x(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=h?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),h&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(h&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)h&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))h&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),h&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),x(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(t){return t.close(),e.Ot.build({buffer:i.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(g||=new WeakMap).get(e);return t||g.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function x(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var S=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},C=e=>e,w=class{constructor(e){this.start=e.start,this.shift=e.shift||C,this.reduce=e.reduce||C,this.reuse=e.reuse||C,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},T=class t extends e.Dt{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(` `);this.minRepeatTerm=n.length;for(let e=0;e<t.repeatNodeCount;e++)n.push(``);let r=Object.keys(t.topRules).map(e=>t.topRules[e][1]),i=[];for(let e=0;e<n.length;e++)i.push([]);function o(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(t.nodeProps)for(let n of t.nodeProps){let t=n[0];typeof t==`string`&&(t=e.Ct[t]);for(let e=1;e<n.length;){let r=n[e++];if(r>=0)o(r,t,n[e++]);else{let i=n[e+-r];for(let a=-r;a>0;a--)o(n[e++],t,i);e++}}}this.nodeSet=new e.wt(n.map((n,a)=>e.Tt.define({name:a>=this.minRepeatTerm?void 0:n,id:a,props:i[a],top:r.indexOf(a)>-1,error:a==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(a)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=e.xt;let s=a(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(O),this.states=a(t.states,Uint32Array),this.data=a(t.stateData),this.goto=a(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(e=>typeof e==`number`?new l(s,e):e),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new b(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=E(n,i+2)];else if(n[i+1]==2)return E(n,i+2);else break}if(a==t||a==0)return E(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=E(this.data,n+2);else break}r=t(E(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=E(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw RangeError(`Invalid top rule name ${e.top}`);n.top=t}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=e.specializers.find(e=>e.from==t.external);if(!i)return t;let a=Object.assign(Object.assign({},t),{external:i.to});return n.specializers[r]=O(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new S(e,n,r)}static deserialize(e){return new t(e)}};function E(e,t){return e[t]|e[t+1]<<16}function D(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function O(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return w}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as e,
|
|
2
|
-
import { n as u, r as d, t as f } from "./dist-
|
|
1
|
+
import { M as e, _ as t, a as n, bt as r, et as i, k as a, l as o, n as s, x as c, yt as l } from "./dist-qeX2QqDc.js";
|
|
2
|
+
import { n as u, r as d, t as f } from "./dist-BWAsFrsx.js";
|
|
3
3
|
//#region ../node_modules/@lezer/xml/dist/index.js
|
|
4
4
|
var p = 1, m = 2, h = 3, g = 4, _ = 5, v = 36, y = 37, b = 38, x = 11, S = 13;
|
|
5
5
|
function C(e) {
|
|
@@ -59,19 +59,19 @@ function M(e, t) {
|
|
|
59
59
|
r && n.acceptToken(e);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
var N = M(v, "-->"), P = M(y, "?>"), F = M(b, "]]>"), I =
|
|
63
|
-
Text:
|
|
64
|
-
"StartTag StartCloseTag EndTag SelfCloseEndTag":
|
|
65
|
-
TagName:
|
|
66
|
-
"MismatchedCloseTag/TagName": [
|
|
67
|
-
AttributeName:
|
|
68
|
-
AttributeValue:
|
|
69
|
-
Is:
|
|
70
|
-
"EntityReference CharacterReference":
|
|
71
|
-
Comment:
|
|
72
|
-
ProcessingInst:
|
|
73
|
-
DoctypeDecl:
|
|
74
|
-
Cdata:
|
|
62
|
+
var N = M(v, "-->"), P = M(y, "?>"), F = M(b, "]]>"), I = l({
|
|
63
|
+
Text: r.content,
|
|
64
|
+
"StartTag StartCloseTag EndTag SelfCloseEndTag": r.angleBracket,
|
|
65
|
+
TagName: r.tagName,
|
|
66
|
+
"MismatchedCloseTag/TagName": [r.tagName, r.invalid],
|
|
67
|
+
AttributeName: r.attributeName,
|
|
68
|
+
AttributeValue: r.attributeValue,
|
|
69
|
+
Is: r.definitionOperator,
|
|
70
|
+
"EntityReference CharacterReference": r.character,
|
|
71
|
+
Comment: r.blockComment,
|
|
72
|
+
ProcessingInst: r.processingInstruction,
|
|
73
|
+
DoctypeDecl: r.documentMeta,
|
|
74
|
+
Cdata: r.special(r.string)
|
|
75
75
|
}), L = d.deserialize({
|
|
76
76
|
version: 14,
|
|
77
77
|
states: ",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",
|
|
@@ -306,7 +306,7 @@ function q(e, t) {
|
|
|
306
306
|
var J = /*@__PURE__*/ s.define({
|
|
307
307
|
name: "xml",
|
|
308
308
|
parser: /*@__PURE__*/ L.configure({ props: [
|
|
309
|
-
/*@__PURE__*/
|
|
309
|
+
/*@__PURE__*/ c.add({
|
|
310
310
|
Element(e) {
|
|
311
311
|
let t = /^\s*<\//.test(e.textAfter);
|
|
312
312
|
return e.lineIndent(e.node.from) + (t ? 0 : e.unit);
|
|
@@ -315,7 +315,7 @@ var J = /*@__PURE__*/ s.define({
|
|
|
315
315
|
return e.column(e.node.from) + e.unit;
|
|
316
316
|
}
|
|
317
317
|
}),
|
|
318
|
-
/*@__PURE__*/
|
|
318
|
+
/*@__PURE__*/ t.add({ Element(e) {
|
|
319
319
|
let t = e.firstChild, n = e.lastChild;
|
|
320
320
|
return !t || t.name != "OpenTag" ? null : {
|
|
321
321
|
from: t.to,
|
|
@@ -334,37 +334,37 @@ var J = /*@__PURE__*/ s.define({
|
|
|
334
334
|
});
|
|
335
335
|
function Y(e = {}) {
|
|
336
336
|
let t = [J.data.of({ autocomplete: q(e.elements || [], e.attributes || []) })];
|
|
337
|
-
return e.autoCloseTags !== !1 && t.push(Z), new
|
|
337
|
+
return e.autoCloseTags !== !1 && t.push(Z), new n(J, t);
|
|
338
338
|
}
|
|
339
339
|
function X(e, t, n = e.length) {
|
|
340
340
|
if (!t) return "";
|
|
341
341
|
let r = t.firstChild, i = r && r.getChild("TagName");
|
|
342
342
|
return i ? e.sliceString(i.from, Math.min(i.to, n)) : "";
|
|
343
343
|
}
|
|
344
|
-
var Z = /*@__PURE__*/ e.inputHandler.of((e, n, r,
|
|
345
|
-
if (e.composing || e.state.readOnly ||
|
|
344
|
+
var Z = /*@__PURE__*/ e.inputHandler.of((e, t, n, r, o) => {
|
|
345
|
+
if (e.composing || e.state.readOnly || t != n || r != ">" && r != "/" || !J.isActiveAt(e.state, t, -1)) return !1;
|
|
346
346
|
let s = o(), { state: c } = s, l = c.changeByRange((e) => {
|
|
347
|
-
let { head:
|
|
348
|
-
if (
|
|
349
|
-
let
|
|
350
|
-
if (
|
|
347
|
+
let { head: t } = e, n = c.doc.sliceString(t - 1, t) == r, o = a(c).resolveInner(t, -1), s;
|
|
348
|
+
if (n && r == ">" && o.name == "EndTag") {
|
|
349
|
+
let n = o.parent;
|
|
350
|
+
if (n.parent?.lastChild?.name != "CloseTag" && (s = X(c.doc, n.parent, t))) return {
|
|
351
351
|
range: e,
|
|
352
352
|
changes: {
|
|
353
|
-
from:
|
|
354
|
-
to:
|
|
353
|
+
from: t,
|
|
354
|
+
to: t + +(c.doc.sliceString(t, t + 1) === ">"),
|
|
355
355
|
insert: `</${s}>`
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
-
} else if (
|
|
358
|
+
} else if (n && r == "/" && o.name == "StartCloseTag") {
|
|
359
359
|
let e = o.parent;
|
|
360
|
-
if (o.from ==
|
|
361
|
-
let e =
|
|
360
|
+
if (o.from == t - 2 && e.lastChild?.name != "CloseTag" && (s = X(c.doc, e, t))) {
|
|
361
|
+
let e = t + +(c.doc.sliceString(t, t + 1) === ">"), n = `${s}>`;
|
|
362
362
|
return {
|
|
363
|
-
range:
|
|
363
|
+
range: i.cursor(t + n.length, -1),
|
|
364
364
|
changes: {
|
|
365
|
-
from:
|
|
365
|
+
from: t,
|
|
366
366
|
to: e,
|
|
367
|
-
insert:
|
|
367
|
+
insert: n
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
}
|