@drjoshcsimmons/scl 0.1.0 → 0.1.1
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/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +31 -0
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox/index.d.ts +3 -0
- package/dist/components/ui/combobox/index.d.ts.map +1 -0
- package/dist/components/ui/command/command.d.ts +85 -0
- package/dist/components/ui/command/command.d.ts.map +1 -0
- package/dist/components/ui/command/index.d.ts +2 -0
- package/dist/components/ui/command/index.d.ts.map +1 -0
- package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/index.d.ts +1 -1
- package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
- package/dist/components/ui/form/form.d.ts +24 -0
- package/dist/components/ui/form/form.d.ts.map +1 -0
- package/dist/components/ui/form/index.d.ts +2 -0
- package/dist/components/ui/form/index.d.ts.map +1 -0
- package/dist/components/ui/progress/progress.d.ts +0 -6
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +166 -143
- package/dist/index10.js +30 -30
- package/dist/index100.js +9 -30
- package/dist/index101.js +50 -15
- package/dist/index102.js +212 -128
- package/dist/index103.js +4 -50
- package/dist/index104.js +30 -9
- package/dist/index105.js +6 -4
- package/dist/index106.js +19 -179
- package/dist/index107.js +9 -650
- package/dist/index108.js +38 -107
- package/dist/index109.js +17 -90
- package/dist/index11.js +13 -13
- package/dist/index110.js +11 -66
- package/dist/index111.js +201 -154
- package/dist/index112.js +20 -395
- package/dist/index113.js +395 -1675
- package/dist/index114.js +2 -278
- package/dist/index115.js +49 -128
- package/dist/index116.js +65 -32
- package/dist/index117.js +2 -1611
- package/dist/index118.js +2 -298
- package/dist/index119.js +22 -632
- package/dist/index12.js +1 -1
- package/dist/index120.js +29 -144
- package/dist/index121.js +5 -21
- package/dist/index122.js +5 -9
- package/dist/index123.js +3 -38
- package/dist/index124.js +24 -18
- package/dist/index125.js +113 -6
- package/dist/index126.js +15 -11
- package/dist/index127.js +513 -194
- package/dist/index128.js +128 -22
- package/dist/index129.js +114 -380
- package/dist/index13.js +132 -93
- package/dist/index130.js +59 -1300
- package/dist/index131.js +63 -612
- package/dist/index132.js +9 -2
- package/dist/index133.js +13 -52
- package/dist/index134.js +64 -63
- package/dist/index135.js +3 -24
- package/dist/index136.js +23 -29
- package/dist/index137.js +23 -5
- package/dist/index138.js +13 -2
- package/dist/index139.js +28 -2
- package/dist/index14.js +106 -220
- package/dist/index140.js +5 -5
- package/dist/index15.js +79 -125
- package/dist/index16.js +280 -17
- package/dist/index17.js +139 -12
- package/dist/index18.js +92 -22
- package/dist/index19.js +18 -55
- package/dist/index2.js +2 -2
- package/dist/index20.js +14 -26
- package/dist/index21.js +19 -33
- package/dist/index22.js +38 -121
- package/dist/index23.js +29 -22
- package/dist/index24.js +31 -64
- package/dist/index25.js +121 -15
- package/dist/index26.js +19 -29
- package/dist/index27.js +68 -77
- package/dist/index28.js +20 -25
- package/dist/index29.js +32 -88
- package/dist/index3.js +11 -9
- package/dist/index30.js +138 -38
- package/dist/index31.js +20 -227
- package/dist/index32.js +88 -18
- package/dist/index33.js +37 -28
- package/dist/index34.js +86 -22
- package/dist/index35.js +17 -102
- package/dist/index36.js +34 -65
- package/dist/index37.js +23 -49
- package/dist/index38.js +38 -99
- package/dist/index39.js +65 -10
- package/dist/index4.js +6 -6
- package/dist/index40.js +49 -15
- package/dist/index41.js +93 -2256
- package/dist/index42.js +10 -32
- package/dist/index43.js +15 -18
- package/dist/index44.js +2251 -225
- package/dist/index45.js +33 -11
- package/dist/index46.js +116 -64
- package/dist/index47.js +207 -219
- package/dist/index48.js +5 -3
- package/dist/index49.js +54 -330
- package/dist/index5.js +23 -23
- package/dist/index50.js +244 -55
- package/dist/index51.js +9 -241
- package/dist/index52.js +60 -847
- package/dist/index53.js +236 -9
- package/dist/index54.js +11 -118
- package/dist/index55.js +300 -215
- package/dist/index56.js +4 -3
- package/dist/index57.js +225 -11
- package/dist/index58.js +11 -236
- package/dist/index59.js +27 -256
- package/dist/index6.js +12 -12
- package/dist/index60.js +260 -12
- package/dist/index61.js +12 -22
- package/dist/index62.js +94 -506
- package/dist/index63.js +12 -6155
- package/dist/index64.js +20 -2631
- package/dist/index65.js +16 -296
- package/dist/index66.js +232 -663
- package/dist/index67.js +125 -825
- package/dist/index68.js +159 -23
- package/dist/index69.js +241 -315
- package/dist/index7.js +22 -22
- package/dist/index70.js +72 -4889
- package/dist/index71.js +503 -802
- package/dist/index72.js +412 -1235
- package/dist/index73.js +323 -521
- package/dist/index74.js +839 -104
- package/dist/index75.js +9 -161
- package/dist/index76.js +67 -30
- package/dist/index77.js +22 -430
- package/dist/index78.js +6 -129
- package/dist/index79.js +48 -75
- package/dist/index8.js +17 -18
- package/dist/index80.js +42 -64
- package/dist/index81.js +50 -44
- package/dist/index82.js +32 -25
- package/dist/index83.js +10 -6
- package/dist/index84.js +7 -51
- package/dist/index85.js +5 -33
- package/dist/index86.js +24 -10
- package/dist/index87.js +68 -7
- package/dist/index88.js +55 -30
- package/dist/index89.js +10 -54
- package/dist/index9.js +23 -31
- package/dist/index90.js +4 -11
- package/dist/index91.js +30 -4
- package/dist/index92.js +1 -1
- package/dist/index93.js +180 -5
- package/dist/index94.js +14 -24
- package/dist/index95.js +643 -62
- package/dist/index96.js +5 -5
- package/dist/index97.js +128 -212
- package/dist/index98.js +2 -2
- package/dist/index99.js +13 -52
- package/dist/tokens/colors.d.ts +26 -86
- package/dist/tokens/colors.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +12 -84
- package/dist/tokens/index.d.ts.map +1 -1
- package/package.json +26 -22
- package/dist/index141.js +0 -5
- package/dist/index142.js +0 -26
- package/dist/index143.js +0 -115
- package/dist/index144.js +0 -18
- package/dist/index145.js +0 -527
- package/dist/index146.js +0 -130
- package/dist/index147.js +0 -136
- package/dist/index148.js +0 -67
- package/dist/index149.js +0 -71
- package/dist/index150.js +0 -11
- package/dist/index151.js +0 -16
- package/dist/index152.js +0 -68
- package/dist/index153.js +0 -6
- package/dist/index154.js +0 -25
- package/dist/index155.js +0 -25
- package/dist/index156.js +0 -15
- package/dist/index157.js +0 -30
- package/dist/index158.js +0 -7
package/dist/index113.js
CHANGED
|
@@ -1,1682 +1,402 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { offset as st, shift as rt, flip as ct, size as lt, hide as ft, limitShift as ut, computePosition as ht, arrow as at } from "./index127.js";
|
|
2
|
+
import { createCoords as y, round as D, max as E, min as N, rectToClientRect as J, floor as A } from "./index128.js";
|
|
3
|
+
import { isElement as v, getDocumentElement as R, getOverflowAncestors as $, getComputedStyle as b, isHTMLElement as C, getWindow as L, isTopLayer as V, getParentNode as S, isLastTraversableNode as z, isTableElement as dt, isContainingBlock as Q, getContainingBlock as gt, getNodeName as _, isOverflowElement as q, getNodeScroll as H, getFrameElement as U, isWebKit as Y } from "./index129.js";
|
|
4
|
+
function Z(t) {
|
|
5
|
+
const e = b(t);
|
|
6
|
+
let o = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
7
|
+
const n = C(t), r = n ? t.offsetWidth : o, s = n ? t.offsetHeight : i, c = D(o) !== r || D(i) !== s;
|
|
8
|
+
return c && (o = r, i = s), {
|
|
9
|
+
width: o,
|
|
10
|
+
height: i,
|
|
11
|
+
$: c
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function X(t) {
|
|
15
|
+
return v(t) ? t : t.contextElement;
|
|
16
|
+
}
|
|
17
|
+
function F(t) {
|
|
18
|
+
const e = X(t);
|
|
19
|
+
if (!C(e))
|
|
20
|
+
return y(1);
|
|
21
|
+
const o = e.getBoundingClientRect(), {
|
|
22
|
+
width: i,
|
|
23
|
+
height: n,
|
|
24
|
+
$: r
|
|
25
|
+
} = Z(e);
|
|
26
|
+
let s = (r ? D(o.width) : o.width) / i, c = (r ? D(o.height) : o.height) / n;
|
|
27
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
28
|
+
x: s,
|
|
29
|
+
y: c
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const pt = /* @__PURE__ */ y(0);
|
|
33
|
+
function tt(t) {
|
|
34
|
+
const e = L(t);
|
|
35
|
+
return !Y() || !e.visualViewport ? pt : {
|
|
36
|
+
x: e.visualViewport.offsetLeft,
|
|
37
|
+
y: e.visualViewport.offsetTop
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function mt(t, e, o) {
|
|
41
|
+
return e === void 0 && (e = !1), !o || e && o !== L(t) ? !1 : e;
|
|
42
|
+
}
|
|
43
|
+
function T(t, e, o, i) {
|
|
44
|
+
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
45
|
+
const n = t.getBoundingClientRect(), r = X(t);
|
|
46
|
+
let s = y(1);
|
|
47
|
+
e && (i ? v(i) && (s = F(i)) : s = F(t));
|
|
48
|
+
const c = mt(r, o, i) ? tt(r) : y(0);
|
|
49
|
+
let f = (n.left + c.x) / s.x, l = (n.top + c.y) / s.y, u = n.width / s.x, h = n.height / s.y;
|
|
50
|
+
if (r) {
|
|
51
|
+
const d = L(r), a = i && v(i) ? L(i) : i;
|
|
52
|
+
let m = d, p = U(m);
|
|
53
|
+
for (; p && i && a !== m; ) {
|
|
54
|
+
const w = F(p), g = p.getBoundingClientRect(), x = b(p), O = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, W = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
|
|
55
|
+
f *= w.x, l *= w.y, u *= w.x, h *= w.y, f += O, l += W, m = L(p), p = U(m);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return J({
|
|
59
|
+
width: u,
|
|
60
|
+
height: h,
|
|
61
|
+
x: f,
|
|
62
|
+
y: l
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function I(t, e) {
|
|
66
|
+
const o = H(t).scrollLeft;
|
|
67
|
+
return e ? e.left + o : T(R(t)).left + o;
|
|
68
|
+
}
|
|
69
|
+
function et(t, e) {
|
|
70
|
+
const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - I(t, o), n = o.top + e.scrollTop;
|
|
71
|
+
return {
|
|
72
|
+
x: i,
|
|
73
|
+
y: n
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function wt(t) {
|
|
77
|
+
let {
|
|
78
|
+
elements: e,
|
|
79
|
+
rect: o,
|
|
80
|
+
offsetParent: i,
|
|
81
|
+
strategy: n
|
|
82
|
+
} = t;
|
|
83
|
+
const r = n === "fixed", s = R(i), c = e ? V(e.floating) : !1;
|
|
84
|
+
if (i === s || c && r)
|
|
85
|
+
return o;
|
|
86
|
+
let f = {
|
|
87
|
+
scrollLeft: 0,
|
|
88
|
+
scrollTop: 0
|
|
89
|
+
}, l = y(1);
|
|
90
|
+
const u = y(0), h = C(i);
|
|
91
|
+
if ((h || !h && !r) && ((_(i) !== "body" || q(s)) && (f = H(i)), C(i))) {
|
|
92
|
+
const a = T(i);
|
|
93
|
+
l = F(i), u.x = a.x + i.clientLeft, u.y = a.y + i.clientTop;
|
|
94
|
+
}
|
|
95
|
+
const d = s && !h && !r ? et(s, f) : y(0);
|
|
96
|
+
return {
|
|
97
|
+
width: o.width * l.x,
|
|
98
|
+
height: o.height * l.y,
|
|
99
|
+
x: o.x * l.x - f.scrollLeft * l.x + u.x + d.x,
|
|
100
|
+
y: o.y * l.y - f.scrollTop * l.y + u.y + d.y
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function yt(t) {
|
|
104
|
+
return Array.from(t.getClientRects());
|
|
105
|
+
}
|
|
106
|
+
function xt(t) {
|
|
107
|
+
const e = R(t), o = H(t), i = t.ownerDocument.body, n = E(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), r = E(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
108
|
+
let s = -o.scrollLeft + I(t);
|
|
109
|
+
const c = -o.scrollTop;
|
|
110
|
+
return b(i).direction === "rtl" && (s += E(e.clientWidth, i.clientWidth) - n), {
|
|
111
|
+
width: n,
|
|
112
|
+
height: r,
|
|
113
|
+
x: s,
|
|
114
|
+
y: c
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const K = 25;
|
|
118
|
+
function vt(t, e) {
|
|
119
|
+
const o = L(t), i = R(t), n = o.visualViewport;
|
|
120
|
+
let r = i.clientWidth, s = i.clientHeight, c = 0, f = 0;
|
|
121
|
+
if (n) {
|
|
122
|
+
r = n.width, s = n.height;
|
|
123
|
+
const u = Y();
|
|
124
|
+
(!u || u && e === "fixed") && (c = n.offsetLeft, f = n.offsetTop);
|
|
125
|
+
}
|
|
126
|
+
const l = I(i);
|
|
127
|
+
if (l <= 0) {
|
|
128
|
+
const u = i.ownerDocument, h = u.body, d = getComputedStyle(h), a = u.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(i.clientWidth - h.clientWidth - a);
|
|
129
|
+
m <= K && (r -= m);
|
|
130
|
+
} else l <= K && (r += l);
|
|
131
|
+
return {
|
|
132
|
+
width: r,
|
|
133
|
+
height: s,
|
|
134
|
+
x: c,
|
|
135
|
+
y: f
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const bt = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
139
|
+
function Rt(t, e) {
|
|
140
|
+
const o = T(t, !0, e === "fixed"), i = o.top + t.clientTop, n = o.left + t.clientLeft, r = C(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, f = n * r.x, l = i * r.y;
|
|
141
|
+
return {
|
|
142
|
+
width: s,
|
|
143
|
+
height: c,
|
|
144
|
+
x: f,
|
|
145
|
+
y: l
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function j(t, e, o) {
|
|
149
|
+
let i;
|
|
150
|
+
if (e === "viewport")
|
|
151
|
+
i = vt(t, o);
|
|
152
|
+
else if (e === "document")
|
|
153
|
+
i = xt(R(t));
|
|
154
|
+
else if (v(e))
|
|
155
|
+
i = Rt(e, o);
|
|
156
|
+
else {
|
|
157
|
+
const n = tt(t);
|
|
158
|
+
i = {
|
|
159
|
+
x: e.x - n.x,
|
|
160
|
+
y: e.y - n.y,
|
|
161
|
+
width: e.width,
|
|
162
|
+
height: e.height
|
|
32
163
|
};
|
|
33
164
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return (this.flags & 8) > 0;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
Returns true when this node's name or one of its
|
|
114
|
-
[groups](#common.NodeProp^group) matches the given string.
|
|
115
|
-
*/
|
|
116
|
-
is(e) {
|
|
117
|
-
if (typeof e == "string") {
|
|
118
|
-
if (this.name == e)
|
|
119
|
-
return !0;
|
|
120
|
-
let t = this.prop(k.group);
|
|
121
|
-
return t ? t.indexOf(e) > -1 : !1;
|
|
122
|
-
}
|
|
123
|
-
return this.id == e;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
Create a function from node types to arbitrary values by
|
|
127
|
-
specifying an object whose property names are node or
|
|
128
|
-
[group](#common.NodeProp^group) names. Often useful with
|
|
129
|
-
[`NodeProp.add`](#common.NodeProp.add). You can put multiple
|
|
130
|
-
names, separated by spaces, in a single property name to map
|
|
131
|
-
multiple node names to a single value.
|
|
132
|
-
*/
|
|
133
|
-
static match(e) {
|
|
134
|
-
let t = /* @__PURE__ */ Object.create(null);
|
|
135
|
-
for (let r in e)
|
|
136
|
-
for (let n of r.split(" "))
|
|
137
|
-
t[n] = e[r];
|
|
138
|
-
return (r) => {
|
|
139
|
-
for (let n = r.prop(k.group), i = -1; i < (n ? n.length : 0); i++) {
|
|
140
|
-
let s = t[i < 0 ? r.name : n[i]];
|
|
141
|
-
if (s)
|
|
142
|
-
return s;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
j.none = new j(
|
|
148
|
-
"",
|
|
149
|
-
/* @__PURE__ */ Object.create(null),
|
|
150
|
-
0,
|
|
151
|
-
8
|
|
152
|
-
/* NodeFlag.Anonymous */
|
|
153
|
-
);
|
|
154
|
-
class xe {
|
|
155
|
-
/**
|
|
156
|
-
Create a set with the given types. The `id` property of each
|
|
157
|
-
type should correspond to its position within the array.
|
|
158
|
-
*/
|
|
159
|
-
constructor(e) {
|
|
160
|
-
this.types = e;
|
|
161
|
-
for (let t = 0; t < e.length; t++)
|
|
162
|
-
if (e[t].id != t)
|
|
163
|
-
throw new RangeError("Node type ids should correspond to array positions when creating a node set");
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
Create a copy of this set with some node properties added. The
|
|
167
|
-
arguments to this method can be created with
|
|
168
|
-
[`NodeProp.add`](#common.NodeProp.add).
|
|
169
|
-
*/
|
|
170
|
-
extend(...e) {
|
|
171
|
-
let t = [];
|
|
172
|
-
for (let r of this.types) {
|
|
173
|
-
let n = null;
|
|
174
|
-
for (let i of e) {
|
|
175
|
-
let s = i(r);
|
|
176
|
-
if (s) {
|
|
177
|
-
n || (n = Object.assign({}, r.props));
|
|
178
|
-
let f = s[1], o = s[0];
|
|
179
|
-
o.combine && o.id in n && (f = o.combine(n[o.id], f)), n[o.id] = f;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
t.push(n ? new j(r.name, n, r.id, r.flags) : r);
|
|
183
|
-
}
|
|
184
|
-
return new xe(t);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const Z = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap();
|
|
188
|
-
var S;
|
|
189
|
-
(function(l) {
|
|
190
|
-
l[l.ExcludeBuffers = 1] = "ExcludeBuffers", l[l.IncludeAnonymous = 2] = "IncludeAnonymous", l[l.IgnoreMounts = 4] = "IgnoreMounts", l[l.IgnoreOverlays = 8] = "IgnoreOverlays";
|
|
191
|
-
})(S || (S = {}));
|
|
192
|
-
class z {
|
|
193
|
-
/**
|
|
194
|
-
Construct a new tree. See also [`Tree.build`](#common.Tree^build).
|
|
195
|
-
*/
|
|
196
|
-
constructor(e, t, r, n, i) {
|
|
197
|
-
if (this.type = e, this.children = t, this.positions = r, this.length = n, this.props = null, i && i.length) {
|
|
198
|
-
this.props = /* @__PURE__ */ Object.create(null);
|
|
199
|
-
for (let [s, f] of i)
|
|
200
|
-
this.props[typeof s == "number" ? s : s.id] = f;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
@internal
|
|
205
|
-
*/
|
|
206
|
-
toString() {
|
|
207
|
-
let e = q.get(this);
|
|
208
|
-
if (e && !e.overlay)
|
|
209
|
-
return e.tree.toString();
|
|
210
|
-
let t = "";
|
|
211
|
-
for (let r of this.children) {
|
|
212
|
-
let n = r.toString();
|
|
213
|
-
n && (t && (t += ","), t += n);
|
|
214
|
-
}
|
|
215
|
-
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (t.length ? "(" + t + ")" : "") : t;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
Get a [tree cursor](#common.TreeCursor) positioned at the top of
|
|
219
|
-
the tree. Mode can be used to [control](#common.IterMode) which
|
|
220
|
-
nodes the cursor visits.
|
|
221
|
-
*/
|
|
222
|
-
cursor(e = 0) {
|
|
223
|
-
return new te(this.topNode, e);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
Get a [tree cursor](#common.TreeCursor) pointing into this tree
|
|
227
|
-
at the given position and side (see
|
|
228
|
-
[`moveTo`](#common.TreeCursor.moveTo).
|
|
229
|
-
*/
|
|
230
|
-
cursorAt(e, t = 0, r = 0) {
|
|
231
|
-
let n = Z.get(this) || this.topNode, i = new te(n);
|
|
232
|
-
return i.moveTo(e, t), Z.set(this, i._tree), i;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
Get a [syntax node](#common.SyntaxNode) object for the top of the
|
|
236
|
-
tree.
|
|
237
|
-
*/
|
|
238
|
-
get topNode() {
|
|
239
|
-
return new B(this, 0, 0, null);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
Get the [syntax node](#common.SyntaxNode) at the given position.
|
|
243
|
-
If `side` is -1, this will move into nodes that end at the
|
|
244
|
-
position. If 1, it'll move into nodes that start at the
|
|
245
|
-
position. With 0, it'll only enter nodes that cover the position
|
|
246
|
-
from both sides.
|
|
247
|
-
|
|
248
|
-
Note that this will not enter
|
|
249
|
-
[overlays](#common.MountedTree.overlay), and you often want
|
|
250
|
-
[`resolveInner`](#common.Tree.resolveInner) instead.
|
|
251
|
-
*/
|
|
252
|
-
resolve(e, t = 0) {
|
|
253
|
-
let r = K(Z.get(this) || this.topNode, e, t, !1);
|
|
254
|
-
return Z.set(this, r), r;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
Like [`resolve`](#common.Tree.resolve), but will enter
|
|
258
|
-
[overlaid](#common.MountedTree.overlay) nodes, producing a syntax node
|
|
259
|
-
pointing into the innermost overlaid tree at the given position
|
|
260
|
-
(with parent links going through all parent structure, including
|
|
261
|
-
the host trees).
|
|
262
|
-
*/
|
|
263
|
-
resolveInner(e, t = 0) {
|
|
264
|
-
let r = K(he.get(this) || this.topNode, e, t, !0);
|
|
265
|
-
return he.set(this, r), r;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
In some situations, it can be useful to iterate through all
|
|
269
|
-
nodes around a position, including those in overlays that don't
|
|
270
|
-
directly cover the position. This method gives you an iterator
|
|
271
|
-
that will produce all nodes, from small to big, around the given
|
|
272
|
-
position.
|
|
273
|
-
*/
|
|
274
|
-
resolveStack(e, t = 0) {
|
|
275
|
-
return _e(this, e, t);
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
Iterate over the tree and its children, calling `enter` for any
|
|
279
|
-
node that touches the `from`/`to` region (if given) before
|
|
280
|
-
running over such a node's children, and `leave` (if given) when
|
|
281
|
-
leaving the node. When `enter` returns `false`, that node will
|
|
282
|
-
not have its children iterated over (or `leave` called).
|
|
283
|
-
*/
|
|
284
|
-
iterate(e) {
|
|
285
|
-
let { enter: t, leave: r, from: n = 0, to: i = this.length } = e, s = e.mode || 0, f = (s & S.IncludeAnonymous) > 0;
|
|
286
|
-
for (let o = this.cursor(s | S.IncludeAnonymous); ; ) {
|
|
287
|
-
let u = !1;
|
|
288
|
-
if (o.from <= i && o.to >= n && (!f && o.type.isAnonymous || t(o) !== !1)) {
|
|
289
|
-
if (o.firstChild())
|
|
290
|
-
continue;
|
|
291
|
-
u = !0;
|
|
292
|
-
}
|
|
293
|
-
for (; u && r && (f || !o.type.isAnonymous) && r(o), !o.nextSibling(); ) {
|
|
294
|
-
if (!o.parent())
|
|
295
|
-
return;
|
|
296
|
-
u = !0;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
Get the value of the given [node prop](#common.NodeProp) for this
|
|
302
|
-
node. Works with both per-node and per-type props.
|
|
303
|
-
*/
|
|
304
|
-
prop(e) {
|
|
305
|
-
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
Returns the node's [per-node props](#common.NodeProp.perNode) in a
|
|
309
|
-
format that can be passed to the [`Tree`](#common.Tree)
|
|
310
|
-
constructor.
|
|
311
|
-
*/
|
|
312
|
-
get propValues() {
|
|
313
|
-
let e = [];
|
|
314
|
-
if (this.props)
|
|
315
|
-
for (let t in this.props)
|
|
316
|
-
e.push([+t, this.props[t]]);
|
|
317
|
-
return e;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
Balance the direct children of this tree, producing a copy of
|
|
321
|
-
which may have children grouped into subtrees with type
|
|
322
|
-
[`NodeType.none`](#common.NodeType^none).
|
|
323
|
-
*/
|
|
324
|
-
balance(e = {}) {
|
|
325
|
-
return this.children.length <= 8 ? this : le(j.none, this.children, this.positions, 0, this.children.length, 0, this.length, (t, r, n) => new z(this.type, t, r, n, this.propValues), e.makeTree || ((t, r, n) => new z(j.none, t, r, n)));
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
Build a tree from a postfix-ordered buffer of node information,
|
|
329
|
-
or a cursor over such a buffer.
|
|
330
|
-
*/
|
|
331
|
-
static build(e) {
|
|
332
|
-
return Ie(e);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
z.empty = new z(j.none, [], [], 0);
|
|
336
|
-
class ie {
|
|
337
|
-
constructor(e, t) {
|
|
338
|
-
this.buffer = e, this.index = t;
|
|
339
|
-
}
|
|
340
|
-
get id() {
|
|
341
|
-
return this.buffer[this.index - 4];
|
|
342
|
-
}
|
|
343
|
-
get start() {
|
|
344
|
-
return this.buffer[this.index - 3];
|
|
345
|
-
}
|
|
346
|
-
get end() {
|
|
347
|
-
return this.buffer[this.index - 2];
|
|
348
|
-
}
|
|
349
|
-
get size() {
|
|
350
|
-
return this.buffer[this.index - 1];
|
|
351
|
-
}
|
|
352
|
-
get pos() {
|
|
353
|
-
return this.index;
|
|
354
|
-
}
|
|
355
|
-
next() {
|
|
356
|
-
this.index -= 4;
|
|
357
|
-
}
|
|
358
|
-
fork() {
|
|
359
|
-
return new ie(this.buffer, this.index);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
class H {
|
|
363
|
-
/**
|
|
364
|
-
Create a tree buffer.
|
|
365
|
-
*/
|
|
366
|
-
constructor(e, t, r) {
|
|
367
|
-
this.buffer = e, this.length = t, this.set = r;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
@internal
|
|
371
|
-
*/
|
|
372
|
-
get type() {
|
|
373
|
-
return j.none;
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
@internal
|
|
377
|
-
*/
|
|
378
|
-
toString() {
|
|
379
|
-
let e = [];
|
|
380
|
-
for (let t = 0; t < this.buffer.length; )
|
|
381
|
-
e.push(this.childString(t)), t = this.buffer[t + 3];
|
|
382
|
-
return e.join(",");
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
@internal
|
|
386
|
-
*/
|
|
387
|
-
childString(e) {
|
|
388
|
-
let t = this.buffer[e], r = this.buffer[e + 3], n = this.set.types[t], i = n.name;
|
|
389
|
-
if (/\W/.test(i) && !n.isError && (i = JSON.stringify(i)), e += 4, r == e)
|
|
390
|
-
return i;
|
|
391
|
-
let s = [];
|
|
392
|
-
for (; e < r; )
|
|
393
|
-
s.push(this.childString(e)), e = this.buffer[e + 3];
|
|
394
|
-
return i + "(" + s.join(",") + ")";
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
@internal
|
|
398
|
-
*/
|
|
399
|
-
findChild(e, t, r, n, i) {
|
|
400
|
-
let { buffer: s } = this, f = -1;
|
|
401
|
-
for (let o = e; o != t && !(be(i, n, s[o + 1], s[o + 2]) && (f = o, r > 0)); o = s[o + 3])
|
|
402
|
-
;
|
|
403
|
-
return f;
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
@internal
|
|
407
|
-
*/
|
|
408
|
-
slice(e, t, r) {
|
|
409
|
-
let n = this.buffer, i = new Uint16Array(t - e), s = 0;
|
|
410
|
-
for (let f = e, o = 0; f < t; ) {
|
|
411
|
-
i[o++] = n[f++], i[o++] = n[f++] - r;
|
|
412
|
-
let u = i[o++] = n[f++] - r;
|
|
413
|
-
i[o++] = n[f++] - e, s = Math.max(s, u);
|
|
414
|
-
}
|
|
415
|
-
return new H(i, s, this.set);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function be(l, e, t, r) {
|
|
419
|
-
switch (l) {
|
|
420
|
-
case -2:
|
|
421
|
-
return t < e;
|
|
422
|
-
case -1:
|
|
423
|
-
return r >= e && t < e;
|
|
424
|
-
case 0:
|
|
425
|
-
return t < e && r > e;
|
|
426
|
-
case 1:
|
|
427
|
-
return t <= e && r > e;
|
|
428
|
-
case 2:
|
|
429
|
-
return r > e;
|
|
430
|
-
case 4:
|
|
431
|
-
return !0;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
function K(l, e, t, r) {
|
|
435
|
-
for (var n; l.from == l.to || (t < 1 ? l.from >= e : l.from > e) || (t > -1 ? l.to <= e : l.to < e); ) {
|
|
436
|
-
let s = !r && l instanceof B && l.index < 0 ? null : l.parent;
|
|
437
|
-
if (!s)
|
|
438
|
-
return l;
|
|
439
|
-
l = s;
|
|
440
|
-
}
|
|
441
|
-
let i = r ? 0 : S.IgnoreOverlays;
|
|
442
|
-
if (r)
|
|
443
|
-
for (let s = l, f = s.parent; f; s = f, f = s.parent)
|
|
444
|
-
s instanceof B && s.index < 0 && ((n = f.enter(e, t, i)) === null || n === void 0 ? void 0 : n.from) != s.from && (l = f);
|
|
445
|
-
for (; ; ) {
|
|
446
|
-
let s = l.enter(e, t, i);
|
|
447
|
-
if (!s)
|
|
448
|
-
return l;
|
|
449
|
-
l = s;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
class we {
|
|
453
|
-
cursor(e = 0) {
|
|
454
|
-
return new te(this, e);
|
|
455
|
-
}
|
|
456
|
-
getChild(e, t = null, r = null) {
|
|
457
|
-
let n = ue(this, e, t, r);
|
|
458
|
-
return n.length ? n[0] : null;
|
|
459
|
-
}
|
|
460
|
-
getChildren(e, t = null, r = null) {
|
|
461
|
-
return ue(this, e, t, r);
|
|
462
|
-
}
|
|
463
|
-
resolve(e, t = 0) {
|
|
464
|
-
return K(this, e, t, !1);
|
|
465
|
-
}
|
|
466
|
-
resolveInner(e, t = 0) {
|
|
467
|
-
return K(this, e, t, !0);
|
|
468
|
-
}
|
|
469
|
-
matchContext(e) {
|
|
470
|
-
return re(this.parent, e);
|
|
471
|
-
}
|
|
472
|
-
enterUnfinishedNodesBefore(e) {
|
|
473
|
-
let t = this.childBefore(e), r = this;
|
|
474
|
-
for (; t; ) {
|
|
475
|
-
let n = t.lastChild;
|
|
476
|
-
if (!n || n.to != t.to)
|
|
477
|
-
break;
|
|
478
|
-
n.type.isError && n.from == n.to ? (r = t, t = n.prevSibling) : t = n;
|
|
479
|
-
}
|
|
480
|
-
return r;
|
|
481
|
-
}
|
|
482
|
-
get node() {
|
|
483
|
-
return this;
|
|
484
|
-
}
|
|
485
|
-
get next() {
|
|
486
|
-
return this.parent;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
class B extends we {
|
|
490
|
-
constructor(e, t, r, n) {
|
|
491
|
-
super(), this._tree = e, this.from = t, this.index = r, this._parent = n;
|
|
492
|
-
}
|
|
493
|
-
get type() {
|
|
494
|
-
return this._tree.type;
|
|
495
|
-
}
|
|
496
|
-
get name() {
|
|
497
|
-
return this._tree.type.name;
|
|
498
|
-
}
|
|
499
|
-
get to() {
|
|
500
|
-
return this.from + this._tree.length;
|
|
501
|
-
}
|
|
502
|
-
nextChild(e, t, r, n, i = 0) {
|
|
503
|
-
for (let s = this; ; ) {
|
|
504
|
-
for (let { children: f, positions: o } = s._tree, u = t > 0 ? f.length : -1; e != u; e += t) {
|
|
505
|
-
let h = f[e], c = o[e] + s.from;
|
|
506
|
-
if (be(n, r, c, c + h.length)) {
|
|
507
|
-
if (h instanceof H) {
|
|
508
|
-
if (i & S.ExcludeBuffers)
|
|
509
|
-
continue;
|
|
510
|
-
let d = h.findChild(0, h.buffer.length, t, r - c, n);
|
|
511
|
-
if (d > -1)
|
|
512
|
-
return new D(new Ae(s, h, e, c), null, d);
|
|
513
|
-
} else if (i & S.IncludeAnonymous || !h.type.isAnonymous || se(h)) {
|
|
514
|
-
let d;
|
|
515
|
-
if (!(i & S.IgnoreMounts) && (d = q.get(h)) && !d.overlay)
|
|
516
|
-
return new B(d.tree, c, e, s);
|
|
517
|
-
let y = new B(h, c, e, s);
|
|
518
|
-
return i & S.IncludeAnonymous || !y.type.isAnonymous ? y : y.nextChild(t < 0 ? h.children.length - 1 : 0, t, r, n);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
if (i & S.IncludeAnonymous || !s.type.isAnonymous || (s.index >= 0 ? e = s.index + t : e = t < 0 ? -1 : s._parent._tree.children.length, s = s._parent, !s))
|
|
523
|
-
return null;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
get firstChild() {
|
|
527
|
-
return this.nextChild(
|
|
528
|
-
0,
|
|
529
|
-
1,
|
|
530
|
-
0,
|
|
531
|
-
4
|
|
532
|
-
/* Side.DontCare */
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
get lastChild() {
|
|
536
|
-
return this.nextChild(
|
|
537
|
-
this._tree.children.length - 1,
|
|
538
|
-
-1,
|
|
539
|
-
0,
|
|
540
|
-
4
|
|
541
|
-
/* Side.DontCare */
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
childAfter(e) {
|
|
545
|
-
return this.nextChild(
|
|
546
|
-
0,
|
|
547
|
-
1,
|
|
548
|
-
e,
|
|
549
|
-
2
|
|
550
|
-
/* Side.After */
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
childBefore(e) {
|
|
554
|
-
return this.nextChild(
|
|
555
|
-
this._tree.children.length - 1,
|
|
556
|
-
-1,
|
|
557
|
-
e,
|
|
558
|
-
-2
|
|
559
|
-
/* Side.Before */
|
|
560
|
-
);
|
|
561
|
-
}
|
|
562
|
-
prop(e) {
|
|
563
|
-
return this._tree.prop(e);
|
|
564
|
-
}
|
|
565
|
-
enter(e, t, r = 0) {
|
|
566
|
-
let n;
|
|
567
|
-
if (!(r & S.IgnoreOverlays) && (n = q.get(this._tree)) && n.overlay) {
|
|
568
|
-
let i = e - this.from;
|
|
569
|
-
for (let { from: s, to: f } of n.overlay)
|
|
570
|
-
if ((t > 0 ? s <= i : s < i) && (t < 0 ? f >= i : f > i))
|
|
571
|
-
return new B(n.tree, n.overlay[0].from + this.from, -1, this);
|
|
572
|
-
}
|
|
573
|
-
return this.nextChild(0, 1, e, t, r);
|
|
574
|
-
}
|
|
575
|
-
nextSignificantParent() {
|
|
576
|
-
let e = this;
|
|
577
|
-
for (; e.type.isAnonymous && e._parent; )
|
|
578
|
-
e = e._parent;
|
|
579
|
-
return e;
|
|
580
|
-
}
|
|
581
|
-
get parent() {
|
|
582
|
-
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
583
|
-
}
|
|
584
|
-
get nextSibling() {
|
|
585
|
-
return this._parent && this.index >= 0 ? this._parent.nextChild(
|
|
586
|
-
this.index + 1,
|
|
587
|
-
1,
|
|
588
|
-
0,
|
|
589
|
-
4
|
|
590
|
-
/* Side.DontCare */
|
|
591
|
-
) : null;
|
|
592
|
-
}
|
|
593
|
-
get prevSibling() {
|
|
594
|
-
return this._parent && this.index >= 0 ? this._parent.nextChild(
|
|
595
|
-
this.index - 1,
|
|
596
|
-
-1,
|
|
597
|
-
0,
|
|
598
|
-
4
|
|
599
|
-
/* Side.DontCare */
|
|
600
|
-
) : null;
|
|
601
|
-
}
|
|
602
|
-
get tree() {
|
|
603
|
-
return this._tree;
|
|
604
|
-
}
|
|
605
|
-
toTree() {
|
|
606
|
-
return this._tree;
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
@internal
|
|
610
|
-
*/
|
|
611
|
-
toString() {
|
|
612
|
-
return this._tree.toString();
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
function ue(l, e, t, r) {
|
|
616
|
-
let n = l.cursor(), i = [];
|
|
617
|
-
if (!n.firstChild())
|
|
618
|
-
return i;
|
|
619
|
-
if (t != null) {
|
|
620
|
-
for (let s = !1; !s; )
|
|
621
|
-
if (s = n.type.is(t), !n.nextSibling())
|
|
622
|
-
return i;
|
|
623
|
-
}
|
|
624
|
-
for (; ; ) {
|
|
625
|
-
if (r != null && n.type.is(r))
|
|
626
|
-
return i;
|
|
627
|
-
if (n.type.is(e) && i.push(n.node), !n.nextSibling())
|
|
628
|
-
return r == null ? i : [];
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
function re(l, e, t = e.length - 1) {
|
|
632
|
-
for (let r = l; t >= 0; r = r.parent) {
|
|
633
|
-
if (!r)
|
|
634
|
-
return !1;
|
|
635
|
-
if (!r.type.isAnonymous) {
|
|
636
|
-
if (e[t] && e[t] != r.name)
|
|
637
|
-
return !1;
|
|
638
|
-
t--;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
return !0;
|
|
642
|
-
}
|
|
643
|
-
class Ae {
|
|
644
|
-
constructor(e, t, r, n) {
|
|
645
|
-
this.parent = e, this.buffer = t, this.index = r, this.start = n;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
class D extends we {
|
|
649
|
-
get name() {
|
|
650
|
-
return this.type.name;
|
|
651
|
-
}
|
|
652
|
-
get from() {
|
|
653
|
-
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
654
|
-
}
|
|
655
|
-
get to() {
|
|
656
|
-
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
657
|
-
}
|
|
658
|
-
constructor(e, t, r) {
|
|
659
|
-
super(), this.context = e, this._parent = t, this.index = r, this.type = e.buffer.set.types[e.buffer.buffer[r]];
|
|
660
|
-
}
|
|
661
|
-
child(e, t, r) {
|
|
662
|
-
let { buffer: n } = this.context, i = n.findChild(this.index + 4, n.buffer[this.index + 3], e, t - this.context.start, r);
|
|
663
|
-
return i < 0 ? null : new D(this.context, this, i);
|
|
664
|
-
}
|
|
665
|
-
get firstChild() {
|
|
666
|
-
return this.child(
|
|
667
|
-
1,
|
|
668
|
-
0,
|
|
669
|
-
4
|
|
670
|
-
/* Side.DontCare */
|
|
671
|
-
);
|
|
672
|
-
}
|
|
673
|
-
get lastChild() {
|
|
674
|
-
return this.child(
|
|
675
|
-
-1,
|
|
676
|
-
0,
|
|
677
|
-
4
|
|
678
|
-
/* Side.DontCare */
|
|
679
|
-
);
|
|
680
|
-
}
|
|
681
|
-
childAfter(e) {
|
|
682
|
-
return this.child(
|
|
683
|
-
1,
|
|
684
|
-
e,
|
|
685
|
-
2
|
|
686
|
-
/* Side.After */
|
|
687
|
-
);
|
|
688
|
-
}
|
|
689
|
-
childBefore(e) {
|
|
690
|
-
return this.child(
|
|
691
|
-
-1,
|
|
692
|
-
e,
|
|
693
|
-
-2
|
|
694
|
-
/* Side.Before */
|
|
695
|
-
);
|
|
696
|
-
}
|
|
697
|
-
prop(e) {
|
|
698
|
-
return this.type.prop(e);
|
|
699
|
-
}
|
|
700
|
-
enter(e, t, r = 0) {
|
|
701
|
-
if (r & S.ExcludeBuffers)
|
|
702
|
-
return null;
|
|
703
|
-
let { buffer: n } = this.context, i = n.findChild(this.index + 4, n.buffer[this.index + 3], t > 0 ? 1 : -1, e - this.context.start, t);
|
|
704
|
-
return i < 0 ? null : new D(this.context, this, i);
|
|
705
|
-
}
|
|
706
|
-
get parent() {
|
|
707
|
-
return this._parent || this.context.parent.nextSignificantParent();
|
|
708
|
-
}
|
|
709
|
-
externalSibling(e) {
|
|
710
|
-
return this._parent ? null : this.context.parent.nextChild(
|
|
711
|
-
this.context.index + e,
|
|
712
|
-
e,
|
|
713
|
-
0,
|
|
714
|
-
4
|
|
715
|
-
/* Side.DontCare */
|
|
716
|
-
);
|
|
717
|
-
}
|
|
718
|
-
get nextSibling() {
|
|
719
|
-
let { buffer: e } = this.context, t = e.buffer[this.index + 3];
|
|
720
|
-
return t < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new D(this.context, this._parent, t) : this.externalSibling(1);
|
|
721
|
-
}
|
|
722
|
-
get prevSibling() {
|
|
723
|
-
let { buffer: e } = this.context, t = this._parent ? this._parent.index + 4 : 0;
|
|
724
|
-
return this.index == t ? this.externalSibling(-1) : new D(this.context, this._parent, e.findChild(
|
|
725
|
-
t,
|
|
726
|
-
this.index,
|
|
727
|
-
-1,
|
|
728
|
-
0,
|
|
729
|
-
4
|
|
730
|
-
/* Side.DontCare */
|
|
731
|
-
));
|
|
732
|
-
}
|
|
733
|
-
get tree() {
|
|
165
|
+
return J(i);
|
|
166
|
+
}
|
|
167
|
+
function it(t, e) {
|
|
168
|
+
const o = S(t);
|
|
169
|
+
return o === e || !v(o) || z(o) ? !1 : b(o).position === "fixed" || it(o, e);
|
|
170
|
+
}
|
|
171
|
+
function Ct(t, e) {
|
|
172
|
+
const o = e.get(t);
|
|
173
|
+
if (o)
|
|
174
|
+
return o;
|
|
175
|
+
let i = $(t, [], !1).filter((c) => v(c) && _(c) !== "body"), n = null;
|
|
176
|
+
const r = b(t).position === "fixed";
|
|
177
|
+
let s = r ? S(t) : t;
|
|
178
|
+
for (; v(s) && !z(s); ) {
|
|
179
|
+
const c = b(s), f = Q(s);
|
|
180
|
+
!f && c.position === "fixed" && (n = null), (r ? !f && !n : !f && c.position === "static" && !!n && bt.has(n.position) || q(s) && !f && it(t, s)) ? i = i.filter((u) => u !== s) : n = c, s = S(s);
|
|
181
|
+
}
|
|
182
|
+
return e.set(t, i), i;
|
|
183
|
+
}
|
|
184
|
+
function Ot(t) {
|
|
185
|
+
let {
|
|
186
|
+
element: e,
|
|
187
|
+
boundary: o,
|
|
188
|
+
rootBoundary: i,
|
|
189
|
+
strategy: n
|
|
190
|
+
} = t;
|
|
191
|
+
const s = [...o === "clippingAncestors" ? V(e) ? [] : Ct(e, this._c) : [].concat(o), i], c = s[0], f = s.reduce((l, u) => {
|
|
192
|
+
const h = j(e, u, n);
|
|
193
|
+
return l.top = E(h.top, l.top), l.right = N(h.right, l.right), l.bottom = N(h.bottom, l.bottom), l.left = E(h.left, l.left), l;
|
|
194
|
+
}, j(e, c, n));
|
|
195
|
+
return {
|
|
196
|
+
width: f.right - f.left,
|
|
197
|
+
height: f.bottom - f.top,
|
|
198
|
+
x: f.left,
|
|
199
|
+
y: f.top
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function Lt(t) {
|
|
203
|
+
const {
|
|
204
|
+
width: e,
|
|
205
|
+
height: o
|
|
206
|
+
} = Z(t);
|
|
207
|
+
return {
|
|
208
|
+
width: e,
|
|
209
|
+
height: o
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function Tt(t, e, o) {
|
|
213
|
+
const i = C(e), n = R(e), r = o === "fixed", s = T(t, !0, r, e);
|
|
214
|
+
let c = {
|
|
215
|
+
scrollLeft: 0,
|
|
216
|
+
scrollTop: 0
|
|
217
|
+
};
|
|
218
|
+
const f = y(0);
|
|
219
|
+
function l() {
|
|
220
|
+
f.x = I(n);
|
|
221
|
+
}
|
|
222
|
+
if (i || !i && !r)
|
|
223
|
+
if ((_(e) !== "body" || q(n)) && (c = H(e)), i) {
|
|
224
|
+
const a = T(e, !0, r, e);
|
|
225
|
+
f.x = a.x + e.clientLeft, f.y = a.y + e.clientTop;
|
|
226
|
+
} else n && l();
|
|
227
|
+
r && !i && n && l();
|
|
228
|
+
const u = n && !i && !r ? et(n, c) : y(0), h = s.left + c.scrollLeft - f.x - u.x, d = s.top + c.scrollTop - f.y - u.y;
|
|
229
|
+
return {
|
|
230
|
+
x: h,
|
|
231
|
+
y: d,
|
|
232
|
+
width: s.width,
|
|
233
|
+
height: s.height
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function M(t) {
|
|
237
|
+
return b(t).position === "static";
|
|
238
|
+
}
|
|
239
|
+
function G(t, e) {
|
|
240
|
+
if (!C(t) || b(t).position === "fixed")
|
|
734
241
|
return null;
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
return
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
function
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
yieldBuf(e, t) {
|
|
809
|
-
this.index = e;
|
|
810
|
-
let { start: r, buffer: n } = this.buffer;
|
|
811
|
-
return this.type = t || n.set.types[n.buffer[e]], this.from = r + n.buffer[e + 1], this.to = r + n.buffer[e + 2], !0;
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
@internal
|
|
815
|
-
*/
|
|
816
|
-
yield(e) {
|
|
817
|
-
return e ? e instanceof B ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
818
|
-
}
|
|
819
|
-
/**
|
|
820
|
-
@internal
|
|
821
|
-
*/
|
|
822
|
-
toString() {
|
|
823
|
-
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
824
|
-
}
|
|
825
|
-
/**
|
|
826
|
-
@internal
|
|
827
|
-
*/
|
|
828
|
-
enterChild(e, t, r) {
|
|
829
|
-
if (!this.buffer)
|
|
830
|
-
return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, t, r, this.mode));
|
|
831
|
-
let { buffer: n } = this.buffer, i = n.findChild(this.index + 4, n.buffer[this.index + 3], e, t - this.buffer.start, r);
|
|
832
|
-
return i < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(i));
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
Move the cursor to this node's first child. When this returns
|
|
836
|
-
false, the node has no child, and the cursor has not been moved.
|
|
837
|
-
*/
|
|
838
|
-
firstChild() {
|
|
839
|
-
return this.enterChild(
|
|
840
|
-
1,
|
|
841
|
-
0,
|
|
842
|
-
4
|
|
843
|
-
/* Side.DontCare */
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
Move the cursor to this node's last child.
|
|
848
|
-
*/
|
|
849
|
-
lastChild() {
|
|
850
|
-
return this.enterChild(
|
|
851
|
-
-1,
|
|
852
|
-
0,
|
|
853
|
-
4
|
|
854
|
-
/* Side.DontCare */
|
|
855
|
-
);
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
Move the cursor to the first child that ends after `pos`.
|
|
859
|
-
*/
|
|
860
|
-
childAfter(e) {
|
|
861
|
-
return this.enterChild(
|
|
862
|
-
1,
|
|
863
|
-
e,
|
|
864
|
-
2
|
|
865
|
-
/* Side.After */
|
|
866
|
-
);
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
Move to the last child that starts before `pos`.
|
|
870
|
-
*/
|
|
871
|
-
childBefore(e) {
|
|
872
|
-
return this.enterChild(
|
|
873
|
-
-1,
|
|
874
|
-
e,
|
|
875
|
-
-2
|
|
876
|
-
/* Side.Before */
|
|
877
|
-
);
|
|
878
|
-
}
|
|
879
|
-
/**
|
|
880
|
-
Move the cursor to the child around `pos`. If side is -1 the
|
|
881
|
-
child may end at that position, when 1 it may start there. This
|
|
882
|
-
will also enter [overlaid](#common.MountedTree.overlay)
|
|
883
|
-
[mounted](#common.NodeProp^mounted) trees unless `overlays` is
|
|
884
|
-
set to false.
|
|
885
|
-
*/
|
|
886
|
-
enter(e, t, r = this.mode) {
|
|
887
|
-
return this.buffer ? r & S.ExcludeBuffers ? !1 : this.enterChild(1, e, t) : this.yield(this._tree.enter(e, t, r));
|
|
888
|
-
}
|
|
889
|
-
/**
|
|
890
|
-
Move to the node's parent node, if this isn't the top node.
|
|
891
|
-
*/
|
|
892
|
-
parent() {
|
|
893
|
-
if (!this.buffer)
|
|
894
|
-
return this.yieldNode(this.mode & S.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
895
|
-
if (this.stack.length)
|
|
896
|
-
return this.yieldBuf(this.stack.pop());
|
|
897
|
-
let e = this.mode & S.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
898
|
-
return this.buffer = null, this.yieldNode(e);
|
|
899
|
-
}
|
|
900
|
-
/**
|
|
901
|
-
@internal
|
|
902
|
-
*/
|
|
903
|
-
sibling(e) {
|
|
904
|
-
if (!this.buffer)
|
|
905
|
-
return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
|
|
906
|
-
let { buffer: t } = this.buffer, r = this.stack.length - 1;
|
|
907
|
-
if (e < 0) {
|
|
908
|
-
let n = r < 0 ? 0 : this.stack[r] + 4;
|
|
909
|
-
if (this.index != n)
|
|
910
|
-
return this.yieldBuf(t.findChild(
|
|
911
|
-
n,
|
|
912
|
-
this.index,
|
|
913
|
-
-1,
|
|
914
|
-
0,
|
|
915
|
-
4
|
|
916
|
-
/* Side.DontCare */
|
|
917
|
-
));
|
|
918
|
-
} else {
|
|
919
|
-
let n = t.buffer[this.index + 3];
|
|
920
|
-
if (n < (r < 0 ? t.buffer.length : t.buffer[this.stack[r] + 3]))
|
|
921
|
-
return this.yieldBuf(n);
|
|
922
|
-
}
|
|
923
|
-
return r < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
|
|
924
|
-
}
|
|
925
|
-
/**
|
|
926
|
-
Move to this node's next sibling, if any.
|
|
927
|
-
*/
|
|
928
|
-
nextSibling() {
|
|
929
|
-
return this.sibling(1);
|
|
930
|
-
}
|
|
931
|
-
/**
|
|
932
|
-
Move to this node's previous sibling, if any.
|
|
933
|
-
*/
|
|
934
|
-
prevSibling() {
|
|
935
|
-
return this.sibling(-1);
|
|
936
|
-
}
|
|
937
|
-
atLastNode(e) {
|
|
938
|
-
let t, r, { buffer: n } = this;
|
|
939
|
-
if (n) {
|
|
940
|
-
if (e > 0) {
|
|
941
|
-
if (this.index < n.buffer.buffer.length)
|
|
942
|
-
return !1;
|
|
943
|
-
} else
|
|
944
|
-
for (let i = 0; i < this.index; i++)
|
|
945
|
-
if (n.buffer.buffer[i + 3] < this.index)
|
|
946
|
-
return !1;
|
|
947
|
-
({ index: t, parent: r } = n);
|
|
948
|
-
} else
|
|
949
|
-
({ index: t, _parent: r } = this._tree);
|
|
950
|
-
for (; r; { index: t, _parent: r } = r)
|
|
951
|
-
if (t > -1)
|
|
952
|
-
for (let i = t + e, s = e < 0 ? -1 : r._tree.children.length; i != s; i += e) {
|
|
953
|
-
let f = r._tree.children[i];
|
|
954
|
-
if (this.mode & S.IncludeAnonymous || f instanceof H || !f.type.isAnonymous || se(f))
|
|
955
|
-
return !1;
|
|
956
|
-
}
|
|
957
|
-
return !0;
|
|
958
|
-
}
|
|
959
|
-
move(e, t) {
|
|
960
|
-
if (t && this.enterChild(
|
|
961
|
-
e,
|
|
962
|
-
0,
|
|
963
|
-
4
|
|
964
|
-
/* Side.DontCare */
|
|
965
|
-
))
|
|
966
|
-
return !0;
|
|
967
|
-
for (; ; ) {
|
|
968
|
-
if (this.sibling(e))
|
|
969
|
-
return !0;
|
|
970
|
-
if (this.atLastNode(e) || !this.parent())
|
|
971
|
-
return !1;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
Move to the next node in a
|
|
976
|
-
[pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)
|
|
977
|
-
traversal, going from a node to its first child or, if the
|
|
978
|
-
current node is empty or `enter` is false, its next sibling or
|
|
979
|
-
the next sibling of the first parent node that has one.
|
|
980
|
-
*/
|
|
981
|
-
next(e = !0) {
|
|
982
|
-
return this.move(1, e);
|
|
983
|
-
}
|
|
984
|
-
/**
|
|
985
|
-
Move to the next node in a last-to-first pre-order traversal. A
|
|
986
|
-
node is followed by its last child or, if it has none, its
|
|
987
|
-
previous sibling or the previous sibling of the first parent
|
|
988
|
-
node that has one.
|
|
989
|
-
*/
|
|
990
|
-
prev(e = !0) {
|
|
991
|
-
return this.move(-1, e);
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
Move the cursor to the innermost node that covers `pos`. If
|
|
995
|
-
`side` is -1, it will enter nodes that end at `pos`. If it is 1,
|
|
996
|
-
it will enter nodes that start at `pos`.
|
|
997
|
-
*/
|
|
998
|
-
moveTo(e, t = 0) {
|
|
999
|
-
for (; (this.from == this.to || (t < 1 ? this.from >= e : this.from > e) || (t > -1 ? this.to <= e : this.to < e)) && this.parent(); )
|
|
1000
|
-
;
|
|
1001
|
-
for (; this.enterChild(1, e, t); )
|
|
1002
|
-
;
|
|
1003
|
-
return this;
|
|
1004
|
-
}
|
|
1005
|
-
/**
|
|
1006
|
-
Get a [syntax node](#common.SyntaxNode) at the cursor's current
|
|
1007
|
-
position.
|
|
1008
|
-
*/
|
|
1009
|
-
get node() {
|
|
1010
|
-
if (!this.buffer)
|
|
1011
|
-
return this._tree;
|
|
1012
|
-
let e = this.bufferNode, t = null, r = 0;
|
|
1013
|
-
if (e && e.context == this.buffer)
|
|
1014
|
-
e: for (let n = this.index, i = this.stack.length; i >= 0; ) {
|
|
1015
|
-
for (let s = e; s; s = s._parent)
|
|
1016
|
-
if (s.index == n) {
|
|
1017
|
-
if (n == this.index)
|
|
1018
|
-
return s;
|
|
1019
|
-
t = s, r = i + 1;
|
|
1020
|
-
break e;
|
|
1021
|
-
}
|
|
1022
|
-
n = this.stack[--i];
|
|
1023
|
-
}
|
|
1024
|
-
for (let n = r; n < this.stack.length; n++)
|
|
1025
|
-
t = new D(this.buffer, t, this.stack[n]);
|
|
1026
|
-
return this.bufferNode = new D(this.buffer, t, this.index);
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
Get the [tree](#common.Tree) that represents the current node, if
|
|
1030
|
-
any. Will return null when the node is in a [tree
|
|
1031
|
-
buffer](#common.TreeBuffer).
|
|
1032
|
-
*/
|
|
1033
|
-
get tree() {
|
|
1034
|
-
return this.buffer ? null : this._tree._tree;
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
Iterate over the current node and all its descendants, calling
|
|
1038
|
-
`enter` when entering a node and `leave`, if given, when leaving
|
|
1039
|
-
one. When `enter` returns `false`, any children of that node are
|
|
1040
|
-
skipped, and `leave` isn't called for it.
|
|
1041
|
-
*/
|
|
1042
|
-
iterate(e, t) {
|
|
1043
|
-
for (let r = 0; ; ) {
|
|
1044
|
-
let n = !1;
|
|
1045
|
-
if (this.type.isAnonymous || e(this) !== !1) {
|
|
1046
|
-
if (this.firstChild()) {
|
|
1047
|
-
r++;
|
|
1048
|
-
continue;
|
|
1049
|
-
}
|
|
1050
|
-
this.type.isAnonymous || (n = !0);
|
|
1051
|
-
}
|
|
1052
|
-
for (; ; ) {
|
|
1053
|
-
if (n && t && t(this), n = this.type.isAnonymous, !r)
|
|
1054
|
-
return;
|
|
1055
|
-
if (this.nextSibling())
|
|
1056
|
-
break;
|
|
1057
|
-
this.parent(), r--, n = !0;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
Test whether the current node matches a given context—a sequence
|
|
1063
|
-
of direct parent node names. Empty strings in the context array
|
|
1064
|
-
are treated as wildcards.
|
|
1065
|
-
*/
|
|
1066
|
-
matchContext(e) {
|
|
1067
|
-
if (!this.buffer)
|
|
1068
|
-
return re(this.node.parent, e);
|
|
1069
|
-
let { buffer: t } = this.buffer, { types: r } = t.set;
|
|
1070
|
-
for (let n = e.length - 1, i = this.stack.length - 1; n >= 0; i--) {
|
|
1071
|
-
if (i < 0)
|
|
1072
|
-
return re(this._tree, e, n);
|
|
1073
|
-
let s = r[t.buffer[this.stack[i]]];
|
|
1074
|
-
if (!s.isAnonymous) {
|
|
1075
|
-
if (e[n] && e[n] != s.name)
|
|
1076
|
-
return !1;
|
|
1077
|
-
n--;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
return !0;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
function se(l) {
|
|
1084
|
-
return l.children.some((e) => e instanceof H || !e.type.isAnonymous || se(e));
|
|
1085
|
-
}
|
|
1086
|
-
function Ie(l) {
|
|
1087
|
-
var e;
|
|
1088
|
-
let { buffer: t, nodeSet: r, maxBufferLength: n = 1024, reused: i = [], minRepeatType: s = r.types.length } = l, f = Array.isArray(t) ? new ie(t, t.length) : t, o = r.types, u = 0, h = 0;
|
|
1089
|
-
function c(m, w, a, C, x, A) {
|
|
1090
|
-
let { id: g, start: p, end: b, size: v } = f, N = h, U = u;
|
|
1091
|
-
if (v < 0)
|
|
1092
|
-
if (f.next(), v == -1) {
|
|
1093
|
-
let W = i[g];
|
|
1094
|
-
a.push(W), C.push(p - m);
|
|
1095
|
-
return;
|
|
1096
|
-
} else if (v == -3) {
|
|
1097
|
-
u = g;
|
|
1098
|
-
return;
|
|
1099
|
-
} else if (v == -4) {
|
|
1100
|
-
h = g;
|
|
1101
|
-
return;
|
|
1102
|
-
} else
|
|
1103
|
-
throw new RangeError(`Unrecognized record size: ${v}`);
|
|
1104
|
-
let $ = o[g], X, J, fe = p - m;
|
|
1105
|
-
if (b - p <= n && (J = O(f.pos - w, x))) {
|
|
1106
|
-
let W = new Uint16Array(J.size - J.skip), M = f.pos - J.size, R = W.length;
|
|
1107
|
-
for (; f.pos > M; )
|
|
1108
|
-
R = F(J.start, W, R);
|
|
1109
|
-
X = new H(W, b - J.start, r), fe = J.start - m;
|
|
1110
|
-
} else {
|
|
1111
|
-
let W = f.pos - v;
|
|
1112
|
-
f.next();
|
|
1113
|
-
let M = [], R = [], V = g >= s ? g : -1, G = 0, Y = b;
|
|
1114
|
-
for (; f.pos > W; )
|
|
1115
|
-
V >= 0 && f.id == V && f.size >= 0 ? (f.end <= Y - n && (_(M, R, p, G, f.end, Y, V, N, U), G = M.length, Y = f.end), f.next()) : A > 2500 ? d(p, W, M, R) : c(p, W, M, R, V, A + 1);
|
|
1116
|
-
if (V >= 0 && G > 0 && G < M.length && _(M, R, p, G, p, Y, V, N, U), M.reverse(), R.reverse(), V > -1 && G > 0) {
|
|
1117
|
-
let oe = y($, U);
|
|
1118
|
-
X = le($, M, R, 0, M.length, 0, b - p, oe, oe);
|
|
1119
|
-
} else
|
|
1120
|
-
X = P($, M, R, b - p, N - b, U);
|
|
1121
|
-
}
|
|
1122
|
-
a.push(X), C.push(fe);
|
|
1123
|
-
}
|
|
1124
|
-
function d(m, w, a, C) {
|
|
1125
|
-
let x = [], A = 0, g = -1;
|
|
1126
|
-
for (; f.pos > w; ) {
|
|
1127
|
-
let { id: p, start: b, end: v, size: N } = f;
|
|
1128
|
-
if (N > 4)
|
|
1129
|
-
f.next();
|
|
1130
|
-
else {
|
|
1131
|
-
if (g > -1 && b < g)
|
|
1132
|
-
break;
|
|
1133
|
-
g < 0 && (g = v - n), x.push(p, b, v), A++, f.next();
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
if (A) {
|
|
1137
|
-
let p = new Uint16Array(A * 4), b = x[x.length - 2];
|
|
1138
|
-
for (let v = x.length - 3, N = 0; v >= 0; v -= 3)
|
|
1139
|
-
p[N++] = x[v], p[N++] = x[v + 1] - b, p[N++] = x[v + 2] - b, p[N++] = N;
|
|
1140
|
-
a.push(new H(p, x[2] - b, r)), C.push(b - m);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
function y(m, w) {
|
|
1144
|
-
return (a, C, x) => {
|
|
1145
|
-
let A = 0, g = a.length - 1, p, b;
|
|
1146
|
-
if (g >= 0 && (p = a[g]) instanceof z) {
|
|
1147
|
-
if (!g && p.type == m && p.length == x)
|
|
1148
|
-
return p;
|
|
1149
|
-
(b = p.prop(k.lookAhead)) && (A = C[g] + p.length + b);
|
|
1150
|
-
}
|
|
1151
|
-
return P(m, a, C, x, A, w);
|
|
242
|
+
if (e)
|
|
243
|
+
return e(t);
|
|
244
|
+
let o = t.offsetParent;
|
|
245
|
+
return R(t) === o && (o = o.ownerDocument.body), o;
|
|
246
|
+
}
|
|
247
|
+
function ot(t, e) {
|
|
248
|
+
const o = L(t);
|
|
249
|
+
if (V(t))
|
|
250
|
+
return o;
|
|
251
|
+
if (!C(t)) {
|
|
252
|
+
let n = S(t);
|
|
253
|
+
for (; n && !z(n); ) {
|
|
254
|
+
if (v(n) && !M(n))
|
|
255
|
+
return n;
|
|
256
|
+
n = S(n);
|
|
257
|
+
}
|
|
258
|
+
return o;
|
|
259
|
+
}
|
|
260
|
+
let i = G(t, e);
|
|
261
|
+
for (; i && dt(i) && M(i); )
|
|
262
|
+
i = G(i, e);
|
|
263
|
+
return i && z(i) && M(i) && !Q(i) ? o : i || gt(t) || o;
|
|
264
|
+
}
|
|
265
|
+
const Et = async function(t) {
|
|
266
|
+
const e = this.getOffsetParent || ot, o = this.getDimensions, i = await o(t.floating);
|
|
267
|
+
return {
|
|
268
|
+
reference: Tt(t.reference, await e(t.floating), t.strategy),
|
|
269
|
+
floating: {
|
|
270
|
+
x: 0,
|
|
271
|
+
y: 0,
|
|
272
|
+
width: i.width,
|
|
273
|
+
height: i.height
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
function Ft(t) {
|
|
278
|
+
return b(t).direction === "rtl";
|
|
279
|
+
}
|
|
280
|
+
const St = {
|
|
281
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: wt,
|
|
282
|
+
getDocumentElement: R,
|
|
283
|
+
getClippingRect: Ot,
|
|
284
|
+
getOffsetParent: ot,
|
|
285
|
+
getElementRects: Et,
|
|
286
|
+
getClientRects: yt,
|
|
287
|
+
getDimensions: Lt,
|
|
288
|
+
getScale: F,
|
|
289
|
+
isElement: v,
|
|
290
|
+
isRTL: Ft
|
|
291
|
+
};
|
|
292
|
+
function nt(t, e) {
|
|
293
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
294
|
+
}
|
|
295
|
+
function Wt(t, e) {
|
|
296
|
+
let o = null, i;
|
|
297
|
+
const n = R(t);
|
|
298
|
+
function r() {
|
|
299
|
+
var c;
|
|
300
|
+
clearTimeout(i), (c = o) == null || c.disconnect(), o = null;
|
|
301
|
+
}
|
|
302
|
+
function s(c, f) {
|
|
303
|
+
c === void 0 && (c = !1), f === void 0 && (f = 1), r();
|
|
304
|
+
const l = t.getBoundingClientRect(), {
|
|
305
|
+
left: u,
|
|
306
|
+
top: h,
|
|
307
|
+
width: d,
|
|
308
|
+
height: a
|
|
309
|
+
} = l;
|
|
310
|
+
if (c || e(), !d || !a)
|
|
311
|
+
return;
|
|
312
|
+
const m = A(h), p = A(n.clientWidth - (u + d)), w = A(n.clientHeight - (h + a)), g = A(u), O = {
|
|
313
|
+
rootMargin: -m + "px " + -p + "px " + -w + "px " + -g + "px",
|
|
314
|
+
threshold: E(0, N(1, f)) || 1
|
|
1152
315
|
};
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
let p = [k.contextHash, A];
|
|
1163
|
-
g = g ? [p].concat(g) : [p];
|
|
1164
|
-
}
|
|
1165
|
-
if (x > 25) {
|
|
1166
|
-
let p = [k.lookAhead, x];
|
|
1167
|
-
g = g ? [p].concat(g) : [p];
|
|
1168
|
-
}
|
|
1169
|
-
return new z(m, w, a, C, g);
|
|
1170
|
-
}
|
|
1171
|
-
function O(m, w) {
|
|
1172
|
-
let a = f.fork(), C = 0, x = 0, A = 0, g = a.end - n, p = { size: 0, start: 0, skip: 0 };
|
|
1173
|
-
e: for (let b = a.pos - m; a.pos > b; ) {
|
|
1174
|
-
let v = a.size;
|
|
1175
|
-
if (a.id == w && v >= 0) {
|
|
1176
|
-
p.size = C, p.start = x, p.skip = A, A += 4, C += 4, a.next();
|
|
1177
|
-
continue;
|
|
1178
|
-
}
|
|
1179
|
-
let N = a.pos - v;
|
|
1180
|
-
if (v < 0 || N < b || a.start < g)
|
|
1181
|
-
break;
|
|
1182
|
-
let U = a.id >= s ? 4 : 0, $ = a.start;
|
|
1183
|
-
for (a.next(); a.pos > N; ) {
|
|
1184
|
-
if (a.size < 0)
|
|
1185
|
-
if (a.size == -3 || a.size == -4)
|
|
1186
|
-
U += 4;
|
|
1187
|
-
else
|
|
1188
|
-
break e;
|
|
1189
|
-
else a.id >= s && (U += 4);
|
|
1190
|
-
a.next();
|
|
1191
|
-
}
|
|
1192
|
-
x = $, C += v, A += U;
|
|
1193
|
-
}
|
|
1194
|
-
return (w < 0 || C == m) && (p.size = C, p.start = x, p.skip = A), p.size > 4 ? p : void 0;
|
|
1195
|
-
}
|
|
1196
|
-
function F(m, w, a) {
|
|
1197
|
-
let { id: C, start: x, end: A, size: g } = f;
|
|
1198
|
-
if (f.next(), g >= 0 && C < s) {
|
|
1199
|
-
let p = a;
|
|
1200
|
-
if (g > 4) {
|
|
1201
|
-
let b = f.pos - (g - 4);
|
|
1202
|
-
for (; f.pos > b; )
|
|
1203
|
-
a = F(m, w, a);
|
|
1204
|
-
}
|
|
1205
|
-
w[--a] = p, w[--a] = A - m, w[--a] = x - m, w[--a] = C;
|
|
1206
|
-
} else g == -3 ? u = C : g == -4 && (h = C);
|
|
1207
|
-
return a;
|
|
1208
|
-
}
|
|
1209
|
-
let E = [], I = [];
|
|
1210
|
-
for (; f.pos > 0; )
|
|
1211
|
-
c(l.start || 0, l.bufferStart || 0, E, I, -1, 0);
|
|
1212
|
-
let L = (e = l.length) !== null && e !== void 0 ? e : E.length ? I[0] + E[0].length : 0;
|
|
1213
|
-
return new z(o[l.topID], E.reverse(), I.reverse(), L);
|
|
1214
|
-
}
|
|
1215
|
-
const ae = /* @__PURE__ */ new WeakMap();
|
|
1216
|
-
function ee(l, e) {
|
|
1217
|
-
if (!l.isAnonymous || e instanceof H || e.type != l)
|
|
1218
|
-
return 1;
|
|
1219
|
-
let t = ae.get(e);
|
|
1220
|
-
if (t == null) {
|
|
1221
|
-
t = 1;
|
|
1222
|
-
for (let r of e.children) {
|
|
1223
|
-
if (r.type != l || !(r instanceof z)) {
|
|
1224
|
-
t = 1;
|
|
1225
|
-
break;
|
|
1226
|
-
}
|
|
1227
|
-
t += ee(l, r);
|
|
1228
|
-
}
|
|
1229
|
-
ae.set(e, t);
|
|
1230
|
-
}
|
|
1231
|
-
return t;
|
|
1232
|
-
}
|
|
1233
|
-
function le(l, e, t, r, n, i, s, f, o) {
|
|
1234
|
-
let u = 0;
|
|
1235
|
-
for (let _ = r; _ < n; _++)
|
|
1236
|
-
u += ee(l, e[_]);
|
|
1237
|
-
let h = Math.ceil(
|
|
1238
|
-
u * 1.5 / 8
|
|
1239
|
-
/* Balance.BranchFactor */
|
|
1240
|
-
), c = [], d = [];
|
|
1241
|
-
function y(_, P, O, F, E) {
|
|
1242
|
-
for (let I = O; I < F; ) {
|
|
1243
|
-
let L = I, m = P[I], w = ee(l, _[I]);
|
|
1244
|
-
for (I++; I < F; I++) {
|
|
1245
|
-
let a = ee(l, _[I]);
|
|
1246
|
-
if (w + a >= h)
|
|
1247
|
-
break;
|
|
1248
|
-
w += a;
|
|
1249
|
-
}
|
|
1250
|
-
if (I == L + 1) {
|
|
1251
|
-
if (w > h) {
|
|
1252
|
-
let a = _[L];
|
|
1253
|
-
y(a.children, a.positions, 0, a.children.length, P[L] + E);
|
|
1254
|
-
continue;
|
|
1255
|
-
}
|
|
1256
|
-
c.push(_[L]);
|
|
1257
|
-
} else {
|
|
1258
|
-
let a = P[I - 1] + _[I - 1].length - m;
|
|
1259
|
-
c.push(le(l, _, P, L, I, m, a, null, o));
|
|
316
|
+
let W = !0;
|
|
317
|
+
function k(P) {
|
|
318
|
+
const B = P[0].intersectionRatio;
|
|
319
|
+
if (B !== f) {
|
|
320
|
+
if (!W)
|
|
321
|
+
return s();
|
|
322
|
+
B ? s(!1, B) : i = setTimeout(() => {
|
|
323
|
+
s(!1, 1e-7);
|
|
324
|
+
}, 1e3);
|
|
1260
325
|
}
|
|
1261
|
-
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
full-document parse, or the start of a change.
|
|
1326
|
-
*/
|
|
1327
|
-
get openEnd() {
|
|
1328
|
-
return (this.open & 2) > 0;
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
Create a set of fragments from a freshly parsed tree, or update
|
|
1332
|
-
an existing set of fragments by replacing the ones that overlap
|
|
1333
|
-
with a tree with content from the new tree. When `partial` is
|
|
1334
|
-
true, the parse is treated as incomplete, and the resulting
|
|
1335
|
-
fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
|
|
1336
|
-
true.
|
|
1337
|
-
*/
|
|
1338
|
-
static addTree(e, t = [], r = !1) {
|
|
1339
|
-
let n = [new Q(0, e.length, e, 0, !1, r)];
|
|
1340
|
-
for (let i of t)
|
|
1341
|
-
i.to > e.length && n.push(i);
|
|
1342
|
-
return n;
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
Apply a set of edits to an array of fragments, removing or
|
|
1346
|
-
splitting fragments as necessary to remove edited ranges, and
|
|
1347
|
-
adjusting offsets for fragments that moved.
|
|
1348
|
-
*/
|
|
1349
|
-
static applyChanges(e, t, r = 128) {
|
|
1350
|
-
if (!t.length)
|
|
1351
|
-
return e;
|
|
1352
|
-
let n = [], i = 1, s = e.length ? e[0] : null;
|
|
1353
|
-
for (let f = 0, o = 0, u = 0; ; f++) {
|
|
1354
|
-
let h = f < t.length ? t[f] : null, c = h ? h.fromA : 1e9;
|
|
1355
|
-
if (c - o >= r)
|
|
1356
|
-
for (; s && s.from < c; ) {
|
|
1357
|
-
let d = s;
|
|
1358
|
-
if (o >= d.from || c <= d.to || u) {
|
|
1359
|
-
let y = Math.max(d.from, o) - u, _ = Math.min(d.to, c) - u;
|
|
1360
|
-
d = y >= _ ? null : new Q(y, _, d.tree, d.offset + u, f > 0, !!h);
|
|
1361
|
-
}
|
|
1362
|
-
if (d && n.push(d), s.to > c)
|
|
1363
|
-
break;
|
|
1364
|
-
s = i < e.length ? e[i++] : null;
|
|
1365
|
-
}
|
|
1366
|
-
if (!h)
|
|
1367
|
-
break;
|
|
1368
|
-
o = h.toA, u = h.toA - h.toB;
|
|
1369
|
-
}
|
|
1370
|
-
return n;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
class je {
|
|
1374
|
-
/**
|
|
1375
|
-
Start a parse, returning a [partial parse](#common.PartialParse)
|
|
1376
|
-
object. [`fragments`](#common.TreeFragment) can be passed in to
|
|
1377
|
-
make the parse incremental.
|
|
1378
|
-
|
|
1379
|
-
By default, the entire input is parsed. You can pass `ranges`,
|
|
1380
|
-
which should be a sorted array of non-empty, non-overlapping
|
|
1381
|
-
ranges, to parse only those ranges. The tree returned in that
|
|
1382
|
-
case will start at `ranges[0].from`.
|
|
1383
|
-
*/
|
|
1384
|
-
startParse(e, t, r) {
|
|
1385
|
-
return typeof e == "string" && (e = new Ne(e)), r = r ? r.length ? r.map((n) => new T(n.from, n.to)) : [new T(0, 0)] : [new T(0, e.length)], this.createParse(e, t || [], r);
|
|
1386
|
-
}
|
|
1387
|
-
/**
|
|
1388
|
-
Run a full parse, returning the resulting tree.
|
|
1389
|
-
*/
|
|
1390
|
-
parse(e, t, r) {
|
|
1391
|
-
let n = this.startParse(e, t, r);
|
|
1392
|
-
for (; ; ) {
|
|
1393
|
-
let i = n.advance();
|
|
1394
|
-
if (i)
|
|
1395
|
-
return i;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
class Ne {
|
|
1400
|
-
constructor(e) {
|
|
1401
|
-
this.string = e;
|
|
1402
|
-
}
|
|
1403
|
-
get length() {
|
|
1404
|
-
return this.string.length;
|
|
1405
|
-
}
|
|
1406
|
-
chunk(e) {
|
|
1407
|
-
return this.string.slice(e);
|
|
1408
|
-
}
|
|
1409
|
-
get lineChunks() {
|
|
1410
|
-
return !1;
|
|
1411
|
-
}
|
|
1412
|
-
read(e, t) {
|
|
1413
|
-
return this.string.slice(e, t);
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
function Re(l) {
|
|
1417
|
-
return (e, t, r, n) => new Be(e, l, t, r, n);
|
|
1418
|
-
}
|
|
1419
|
-
class pe {
|
|
1420
|
-
constructor(e, t, r, n, i) {
|
|
1421
|
-
this.parser = e, this.parse = t, this.overlay = r, this.target = n, this.from = i;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
function de(l) {
|
|
1425
|
-
if (!l.length || l.some((e) => e.from >= e.to))
|
|
1426
|
-
throw new RangeError("Invalid inner parse ranges given: " + JSON.stringify(l));
|
|
1427
|
-
}
|
|
1428
|
-
class Pe {
|
|
1429
|
-
constructor(e, t, r, n, i, s, f) {
|
|
1430
|
-
this.parser = e, this.predicate = t, this.mounts = r, this.index = n, this.start = i, this.target = s, this.prev = f, this.depth = 0, this.ranges = [];
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
const ne = new k({ perNode: !0 });
|
|
1434
|
-
class Be {
|
|
1435
|
-
constructor(e, t, r, n, i) {
|
|
1436
|
-
this.nest = t, this.input = r, this.fragments = n, this.ranges = i, this.inner = [], this.innerDone = 0, this.baseTree = null, this.stoppedAt = null, this.baseParse = e;
|
|
1437
|
-
}
|
|
1438
|
-
advance() {
|
|
1439
|
-
if (this.baseParse) {
|
|
1440
|
-
let r = this.baseParse.advance();
|
|
1441
|
-
if (!r)
|
|
1442
|
-
return null;
|
|
1443
|
-
if (this.baseParse = null, this.baseTree = r, this.startInner(), this.stoppedAt != null)
|
|
1444
|
-
for (let n of this.inner)
|
|
1445
|
-
n.parse.stopAt(this.stoppedAt);
|
|
1446
|
-
}
|
|
1447
|
-
if (this.innerDone == this.inner.length) {
|
|
1448
|
-
let r = this.baseTree;
|
|
1449
|
-
return this.stoppedAt != null && (r = new z(r.type, r.children, r.positions, r.length, r.propValues.concat([[ne, this.stoppedAt]]))), r;
|
|
1450
|
-
}
|
|
1451
|
-
let e = this.inner[this.innerDone], t = e.parse.advance();
|
|
1452
|
-
if (t) {
|
|
1453
|
-
this.innerDone++;
|
|
1454
|
-
let r = Object.assign(/* @__PURE__ */ Object.create(null), e.target.props);
|
|
1455
|
-
r[k.mounted.id] = new q(t, e.overlay, e.parser), e.target.props = r;
|
|
1456
|
-
}
|
|
1457
|
-
return null;
|
|
1458
|
-
}
|
|
1459
|
-
get parsedPos() {
|
|
1460
|
-
if (this.baseParse)
|
|
1461
|
-
return 0;
|
|
1462
|
-
let e = this.input.length;
|
|
1463
|
-
for (let t = this.innerDone; t < this.inner.length; t++)
|
|
1464
|
-
this.inner[t].from < e && (e = Math.min(e, this.inner[t].parse.parsedPos));
|
|
1465
|
-
return e;
|
|
1466
|
-
}
|
|
1467
|
-
stopAt(e) {
|
|
1468
|
-
if (this.stoppedAt = e, this.baseParse)
|
|
1469
|
-
this.baseParse.stopAt(e);
|
|
1470
|
-
else
|
|
1471
|
-
for (let t = this.innerDone; t < this.inner.length; t++)
|
|
1472
|
-
this.inner[t].parse.stopAt(e);
|
|
1473
|
-
}
|
|
1474
|
-
startInner() {
|
|
1475
|
-
let e = new Me(this.fragments), t = null, r = null, n = new te(new B(this.baseTree, this.ranges[0].from, 0, null), S.IncludeAnonymous | S.IgnoreMounts);
|
|
1476
|
-
e: for (let i, s; ; ) {
|
|
1477
|
-
let f = !0, o;
|
|
1478
|
-
if (this.stoppedAt != null && n.from >= this.stoppedAt)
|
|
1479
|
-
f = !1;
|
|
1480
|
-
else if (e.hasNode(n)) {
|
|
1481
|
-
if (t) {
|
|
1482
|
-
let u = t.mounts.find((h) => h.frag.from <= n.from && h.frag.to >= n.to && h.mount.overlay);
|
|
1483
|
-
if (u)
|
|
1484
|
-
for (let h of u.mount.overlay) {
|
|
1485
|
-
let c = h.from + u.pos, d = h.to + u.pos;
|
|
1486
|
-
c >= n.from && d <= n.to && !t.ranges.some((y) => y.from < d && y.to > c) && t.ranges.push({ from: c, to: d });
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
f = !1;
|
|
1490
|
-
} else if (r && (s = ze(r.ranges, n.from, n.to)))
|
|
1491
|
-
f = s != 2;
|
|
1492
|
-
else if (!n.type.isAnonymous && (i = this.nest(n, this.input)) && (n.from < n.to || !i.overlay)) {
|
|
1493
|
-
n.tree || (Ee(n), t && t.depth++, r && r.depth++);
|
|
1494
|
-
let u = e.findMounts(n.from, i.parser);
|
|
1495
|
-
if (typeof i.overlay == "function")
|
|
1496
|
-
t = new Pe(i.parser, i.overlay, u, this.inner.length, n.from, n.tree, t);
|
|
1497
|
-
else {
|
|
1498
|
-
let h = me(this.ranges, i.overlay || (n.from < n.to ? [new T(n.from, n.to)] : []));
|
|
1499
|
-
h.length && de(h), (h.length || !i.overlay) && this.inner.push(new pe(i.parser, h.length ? i.parser.startParse(this.input, ye(u, h), h) : i.parser.startParse(""), i.overlay ? i.overlay.map((c) => new T(c.from - n.from, c.to - n.from)) : null, n.tree, h.length ? h[0].from : n.from)), i.overlay ? h.length && (r = { ranges: h, depth: 0, prev: r }) : f = !1;
|
|
1500
|
-
}
|
|
1501
|
-
} else if (t && (o = t.predicate(n)) && (o === !0 && (o = new T(n.from, n.to)), o.from < o.to)) {
|
|
1502
|
-
let u = t.ranges.length - 1;
|
|
1503
|
-
u >= 0 && t.ranges[u].to == o.from ? t.ranges[u] = { from: t.ranges[u].from, to: o.to } : t.ranges.push(o);
|
|
1504
|
-
}
|
|
1505
|
-
if (f && n.firstChild())
|
|
1506
|
-
t && t.depth++, r && r.depth++;
|
|
1507
|
-
else
|
|
1508
|
-
for (; !n.nextSibling(); ) {
|
|
1509
|
-
if (!n.parent())
|
|
1510
|
-
break e;
|
|
1511
|
-
if (t && !--t.depth) {
|
|
1512
|
-
let u = me(this.ranges, t.ranges);
|
|
1513
|
-
u.length && (de(u), this.inner.splice(t.index, 0, new pe(t.parser, t.parser.startParse(this.input, ye(t.mounts, u), u), t.ranges.map((h) => new T(h.from - t.start, h.to - t.start)), t.target, u[0].from))), t = t.prev;
|
|
1514
|
-
}
|
|
1515
|
-
r && !--r.depth && (r = r.prev);
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
function ze(l, e, t) {
|
|
1521
|
-
for (let r of l) {
|
|
1522
|
-
if (r.from >= t)
|
|
1523
|
-
break;
|
|
1524
|
-
if (r.to > e)
|
|
1525
|
-
return r.from <= e && r.to >= t ? 2 : 1;
|
|
1526
|
-
}
|
|
1527
|
-
return 0;
|
|
1528
|
-
}
|
|
1529
|
-
function ce(l, e, t, r, n, i) {
|
|
1530
|
-
if (e < t) {
|
|
1531
|
-
let s = l.buffer[e + 1];
|
|
1532
|
-
r.push(l.slice(e, t, s)), n.push(s - i);
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
function Ee(l) {
|
|
1536
|
-
let { node: e } = l, t = [], r = e.context.buffer;
|
|
1537
|
-
do
|
|
1538
|
-
t.push(l.index), l.parent();
|
|
1539
|
-
while (!l.tree);
|
|
1540
|
-
let n = l.tree, i = n.children.indexOf(r), s = n.children[i], f = s.buffer, o = [i];
|
|
1541
|
-
function u(h, c, d, y, _, P) {
|
|
1542
|
-
let O = t[P], F = [], E = [];
|
|
1543
|
-
ce(s, h, O, F, E, y);
|
|
1544
|
-
let I = f[O + 1], L = f[O + 2];
|
|
1545
|
-
o.push(F.length);
|
|
1546
|
-
let m = P ? u(O + 4, f[O + 3], s.set.types[f[O]], I, L - I, P - 1) : e.toTree();
|
|
1547
|
-
return F.push(m), E.push(I - y), ce(s, f[O + 3], c, F, E, y), new z(d, F, E, _);
|
|
1548
|
-
}
|
|
1549
|
-
n.children[i] = u(0, f.length, j.none, 0, s.length, t.length - 1);
|
|
1550
|
-
for (let h of o) {
|
|
1551
|
-
let c = l.tree.children[h], d = l.tree.positions[h];
|
|
1552
|
-
l.yield(new B(c, d + l.from, h, l._tree));
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
class ge {
|
|
1556
|
-
constructor(e, t) {
|
|
1557
|
-
this.offset = t, this.done = !1, this.cursor = e.cursor(S.IncludeAnonymous | S.IgnoreMounts);
|
|
1558
|
-
}
|
|
1559
|
-
// Move to the first node (in pre-order) that starts at or after `pos`.
|
|
1560
|
-
moveTo(e) {
|
|
1561
|
-
let { cursor: t } = this, r = e - this.offset;
|
|
1562
|
-
for (; !this.done && t.from < r; )
|
|
1563
|
-
t.to >= e && t.enter(r, 1, S.IgnoreOverlays | S.ExcludeBuffers) || t.next(!1) || (this.done = !0);
|
|
1564
|
-
}
|
|
1565
|
-
hasNode(e) {
|
|
1566
|
-
if (this.moveTo(e.from), !this.done && this.cursor.from + this.offset == e.from && this.cursor.tree)
|
|
1567
|
-
for (let t = this.cursor.tree; ; ) {
|
|
1568
|
-
if (t == e.tree)
|
|
1569
|
-
return !0;
|
|
1570
|
-
if (t.children.length && t.positions[0] == 0 && t.children[0] instanceof z)
|
|
1571
|
-
t = t.children[0];
|
|
1572
|
-
else
|
|
1573
|
-
break;
|
|
1574
|
-
}
|
|
1575
|
-
return !1;
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
class Me {
|
|
1579
|
-
constructor(e) {
|
|
1580
|
-
var t;
|
|
1581
|
-
if (this.fragments = e, this.curTo = 0, this.fragI = 0, e.length) {
|
|
1582
|
-
let r = this.curFrag = e[0];
|
|
1583
|
-
this.curTo = (t = r.tree.prop(ne)) !== null && t !== void 0 ? t : r.to, this.inner = new ge(r.tree, -r.offset);
|
|
1584
|
-
} else
|
|
1585
|
-
this.curFrag = this.inner = null;
|
|
1586
|
-
}
|
|
1587
|
-
hasNode(e) {
|
|
1588
|
-
for (; this.curFrag && e.from >= this.curTo; )
|
|
1589
|
-
this.nextFrag();
|
|
1590
|
-
return this.curFrag && this.curFrag.from <= e.from && this.curTo >= e.to && this.inner.hasNode(e);
|
|
1591
|
-
}
|
|
1592
|
-
nextFrag() {
|
|
1593
|
-
var e;
|
|
1594
|
-
if (this.fragI++, this.fragI == this.fragments.length)
|
|
1595
|
-
this.curFrag = this.inner = null;
|
|
1596
|
-
else {
|
|
1597
|
-
let t = this.curFrag = this.fragments[this.fragI];
|
|
1598
|
-
this.curTo = (e = t.tree.prop(ne)) !== null && e !== void 0 ? e : t.to, this.inner = new ge(t.tree, -t.offset);
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
findMounts(e, t) {
|
|
1602
|
-
var r;
|
|
1603
|
-
let n = [];
|
|
1604
|
-
if (this.inner) {
|
|
1605
|
-
this.inner.cursor.moveTo(e, 1);
|
|
1606
|
-
for (let i = this.inner.cursor.node; i; i = i.parent) {
|
|
1607
|
-
let s = (r = i.tree) === null || r === void 0 ? void 0 : r.prop(k.mounted);
|
|
1608
|
-
if (s && s.parser == t)
|
|
1609
|
-
for (let f = this.fragI; f < this.fragments.length; f++) {
|
|
1610
|
-
let o = this.fragments[f];
|
|
1611
|
-
if (o.from >= i.to)
|
|
1612
|
-
break;
|
|
1613
|
-
o.tree == this.curFrag.tree && n.push({
|
|
1614
|
-
frag: o,
|
|
1615
|
-
pos: i.from - o.offset,
|
|
1616
|
-
mount: s
|
|
1617
|
-
});
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
return n;
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
function me(l, e) {
|
|
1625
|
-
let t = null, r = e;
|
|
1626
|
-
for (let n = 1, i = 0; n < l.length; n++) {
|
|
1627
|
-
let s = l[n - 1].to, f = l[n].from;
|
|
1628
|
-
for (; i < r.length; i++) {
|
|
1629
|
-
let o = r[i];
|
|
1630
|
-
if (o.from >= f)
|
|
1631
|
-
break;
|
|
1632
|
-
o.to <= s || (t || (r = t = e.slice()), o.from < s ? (t[i] = new T(o.from, s), o.to > f && t.splice(i + 1, 0, new T(f, o.to))) : o.to > f ? t[i--] = new T(f, o.to) : t.splice(i--, 1));
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
return r;
|
|
1636
|
-
}
|
|
1637
|
-
function Te(l, e, t, r) {
|
|
1638
|
-
let n = 0, i = 0, s = !1, f = !1, o = -1e9, u = [];
|
|
1639
|
-
for (; ; ) {
|
|
1640
|
-
let h = n == l.length ? 1e9 : s ? l[n].to : l[n].from, c = i == e.length ? 1e9 : f ? e[i].to : e[i].from;
|
|
1641
|
-
if (s != f) {
|
|
1642
|
-
let d = Math.max(o, t), y = Math.min(h, c, r);
|
|
1643
|
-
d < y && u.push(new T(d, y));
|
|
1644
|
-
}
|
|
1645
|
-
if (o = Math.min(h, c), o == 1e9)
|
|
1646
|
-
break;
|
|
1647
|
-
h == o && (s ? (s = !1, n++) : s = !0), c == o && (f ? (f = !1, i++) : f = !0);
|
|
1648
|
-
}
|
|
1649
|
-
return u;
|
|
1650
|
-
}
|
|
1651
|
-
function ye(l, e) {
|
|
1652
|
-
let t = [];
|
|
1653
|
-
for (let { pos: r, mount: n, frag: i } of l) {
|
|
1654
|
-
let s = r + (n.overlay ? n.overlay[0].from : 0), f = s + n.tree.length, o = Math.max(i.from, s), u = Math.min(i.to, f);
|
|
1655
|
-
if (n.overlay) {
|
|
1656
|
-
let h = n.overlay.map((d) => new T(d.from + r, d.to + r)), c = Te(e, h, o, u);
|
|
1657
|
-
for (let d = 0, y = o; ; d++) {
|
|
1658
|
-
let _ = d == c.length, P = _ ? u : c[d].from;
|
|
1659
|
-
if (P > y && t.push(new Q(y, P, n.tree, -s, i.from >= y || i.openStart, i.to <= P || i.openEnd)), _)
|
|
1660
|
-
break;
|
|
1661
|
-
y = c[d].to;
|
|
1662
|
-
}
|
|
1663
|
-
} else
|
|
1664
|
-
t.push(new Q(o, u, n.tree, -s, i.from >= s || i.openStart, i.to <= f || i.openEnd));
|
|
1665
|
-
}
|
|
1666
|
-
return t;
|
|
1667
|
-
}
|
|
326
|
+
B === 1 && !nt(l, t.getBoundingClientRect()) && s(), W = !1;
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
o = new IntersectionObserver(k, {
|
|
330
|
+
...O,
|
|
331
|
+
// Handle <iframe>s
|
|
332
|
+
root: n.ownerDocument
|
|
333
|
+
});
|
|
334
|
+
} catch {
|
|
335
|
+
o = new IntersectionObserver(k, O);
|
|
336
|
+
}
|
|
337
|
+
o.observe(t);
|
|
338
|
+
}
|
|
339
|
+
return s(!0), r;
|
|
340
|
+
}
|
|
341
|
+
function zt(t, e, o, i) {
|
|
342
|
+
i === void 0 && (i = {});
|
|
343
|
+
const {
|
|
344
|
+
ancestorScroll: n = !0,
|
|
345
|
+
ancestorResize: r = !0,
|
|
346
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
347
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
348
|
+
animationFrame: f = !1
|
|
349
|
+
} = i, l = X(t), u = n || r ? [...l ? $(l) : [], ...$(e)] : [];
|
|
350
|
+
u.forEach((g) => {
|
|
351
|
+
n && g.addEventListener("scroll", o, {
|
|
352
|
+
passive: !0
|
|
353
|
+
}), r && g.addEventListener("resize", o);
|
|
354
|
+
});
|
|
355
|
+
const h = l && c ? Wt(l, o) : null;
|
|
356
|
+
let d = -1, a = null;
|
|
357
|
+
s && (a = new ResizeObserver((g) => {
|
|
358
|
+
let [x] = g;
|
|
359
|
+
x && x.target === l && a && (a.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
360
|
+
var O;
|
|
361
|
+
(O = a) == null || O.observe(e);
|
|
362
|
+
})), o();
|
|
363
|
+
}), l && !f && a.observe(l), a.observe(e));
|
|
364
|
+
let m, p = f ? T(t) : null;
|
|
365
|
+
f && w();
|
|
366
|
+
function w() {
|
|
367
|
+
const g = T(t);
|
|
368
|
+
p && !nt(p, g) && o(), p = g, m = requestAnimationFrame(w);
|
|
369
|
+
}
|
|
370
|
+
return o(), () => {
|
|
371
|
+
var g;
|
|
372
|
+
u.forEach((x) => {
|
|
373
|
+
n && x.removeEventListener("scroll", o), r && x.removeEventListener("resize", o);
|
|
374
|
+
}), h == null || h(), (g = a) == null || g.disconnect(), a = null, f && cancelAnimationFrame(m);
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const Ht = st, It = rt, Mt = ct, Nt = lt, $t = ft, Vt = at, _t = ut, qt = (t, e, o) => {
|
|
378
|
+
const i = /* @__PURE__ */ new Map(), n = {
|
|
379
|
+
platform: St,
|
|
380
|
+
...o
|
|
381
|
+
}, r = {
|
|
382
|
+
...n.platform,
|
|
383
|
+
_c: i
|
|
384
|
+
};
|
|
385
|
+
return ht(t, e, {
|
|
386
|
+
...n,
|
|
387
|
+
platform: r
|
|
388
|
+
});
|
|
389
|
+
};
|
|
1668
390
|
export {
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
Q as TreeFragment,
|
|
1681
|
-
Re as parseMixed
|
|
391
|
+
Vt as arrow,
|
|
392
|
+
zt as autoUpdate,
|
|
393
|
+
qt as computePosition,
|
|
394
|
+
Mt as flip,
|
|
395
|
+
$ as getOverflowAncestors,
|
|
396
|
+
$t as hide,
|
|
397
|
+
_t as limitShift,
|
|
398
|
+
Ht as offset,
|
|
399
|
+
St as platform,
|
|
400
|
+
It as shift,
|
|
401
|
+
Nt as size
|
|
1682
402
|
};
|