@afterpack/protection-map 0.1.0-rc.20260925T1347
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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +55 -0
- package/codec.mjs +292 -0
- package/index.d.ts +53 -0
- package/index.mjs +1 -0
- package/package.json +63 -0
- package/render-core.mjs +83 -0
- package/render.mjs +66 -0
- package/template.html +4302 -0
package/template.html
ADDED
|
@@ -0,0 +1,4302 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="robots" content="noindex, nofollow" />
|
|
7
|
+
<title>AfterPack · Protection Map</title>
|
|
8
|
+
<style>
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
color-scheme: light dark;
|
|
12
|
+
|
|
13
|
+
--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
14
|
+
--font-ui: Inter, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
15
|
+
|
|
16
|
+
--ground: #ffffff;
|
|
17
|
+
--surface-1: #ffffff;
|
|
18
|
+
--surface-2: #f8f8f8;
|
|
19
|
+
--surface-3: #ececec;
|
|
20
|
+
--surface-hover: #e8e8e8;
|
|
21
|
+
--scrollbar: #c9c9c9;
|
|
22
|
+
--border: #e5e5e5;
|
|
23
|
+
--border-strong: #cecece;
|
|
24
|
+
--text-primary: #262626;
|
|
25
|
+
--text-secondary: #616161;
|
|
26
|
+
--text-muted: #767676;
|
|
27
|
+
|
|
28
|
+
--brand: #a06a12;
|
|
29
|
+
--brand-hover: #b57317;
|
|
30
|
+
--brand-ink: #ffffff;
|
|
31
|
+
--focus-ring: #a06a12;
|
|
32
|
+
|
|
33
|
+
--wash: #f3f3f3;
|
|
34
|
+
|
|
35
|
+
--heat-0: #fff3c2;
|
|
36
|
+
--heat-1: #ffde85;
|
|
37
|
+
--heat-2: #ffc247;
|
|
38
|
+
--heat-3: #fa940f;
|
|
39
|
+
--heat-4: #e6650f;
|
|
40
|
+
--heat-5: #d1381a;
|
|
41
|
+
--heat-6: #b62020;
|
|
42
|
+
|
|
43
|
+
--cost-0: #f8e3d5;
|
|
44
|
+
--cost-1: #eec9ae;
|
|
45
|
+
--cost-2: #dda780;
|
|
46
|
+
--cost-3: #c48350;
|
|
47
|
+
--cost-4: #a45f24;
|
|
48
|
+
--cost-5: #7f4406;
|
|
49
|
+
--cost-6: #5a2d00;
|
|
50
|
+
|
|
51
|
+
--band-safety: #d4d4d4;
|
|
52
|
+
--band-reflection: #bdbdbd;
|
|
53
|
+
--band-skip: #969696;
|
|
54
|
+
|
|
55
|
+
--status-leak: #dc2626;
|
|
56
|
+
--status-leak-soft: #fee2e2;
|
|
57
|
+
--status-property: #b45309;
|
|
58
|
+
--status-property-soft: #fef3c7;
|
|
59
|
+
--status-weak: #a16207;
|
|
60
|
+
--status-weak-soft: #fef9c3;
|
|
61
|
+
|
|
62
|
+
--class-preserved: #525252;
|
|
63
|
+
--class-preserved-soft: #e5e5e5;
|
|
64
|
+
--class-preserved-wash: rgba(82, 82, 82, 0.09);
|
|
65
|
+
--class-renamed: #0d7d88;
|
|
66
|
+
--class-renamed-soft: #d6eef0;
|
|
67
|
+
--class-flattened: #1d6fa5;
|
|
68
|
+
--class-flattened-soft: #dbeafe;
|
|
69
|
+
--class-destroyed: #7141b8;
|
|
70
|
+
--class-destroyed-soft: #efe3fb;
|
|
71
|
+
--class-destroyed-edge: #b57317;
|
|
72
|
+
|
|
73
|
+
--tok-hover-bg: rgba(181, 115, 23, 0.36);
|
|
74
|
+
--tok-hover-ring: rgba(160, 106, 18, 0.85);
|
|
75
|
+
--resizer-hover: rgba(160, 106, 18, 0.55);
|
|
76
|
+
|
|
77
|
+
--logo-plate: #141414;
|
|
78
|
+
--syn-comment: #008000;
|
|
79
|
+
--syn-key: #0000ff;
|
|
80
|
+
--syn-str: #a31515;
|
|
81
|
+
--syn-num: #046043;
|
|
82
|
+
|
|
83
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
84
|
+
--radius: 8px;
|
|
85
|
+
--radius-card: 12px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (prefers-color-scheme: dark) {
|
|
89
|
+
:root {
|
|
90
|
+
--ground: #1f1f1f;
|
|
91
|
+
--surface-1: #202020;
|
|
92
|
+
--surface-2: #181818;
|
|
93
|
+
--surface-3: #2b2b2b;
|
|
94
|
+
--surface-hover: #2a2d2e;
|
|
95
|
+
--scrollbar: #4f4f4f;
|
|
96
|
+
--border: #2b2b2b;
|
|
97
|
+
--border-strong: #3c3c3c;
|
|
98
|
+
--text-primary: #cccccc;
|
|
99
|
+
--text-secondary: #9d9d9d;
|
|
100
|
+
--text-muted: #8c8c8c;
|
|
101
|
+
|
|
102
|
+
--brand: #eaae3d;
|
|
103
|
+
--brand-hover: #fcea85;
|
|
104
|
+
--brand-ink: #0a0a0a;
|
|
105
|
+
--focus-ring: #eaae3d;
|
|
106
|
+
|
|
107
|
+
--wash: #252526;
|
|
108
|
+
|
|
109
|
+
--heat-0: #543912; --heat-1: #714514; --heat-2: #8e4e15; --heat-3: #b15416;
|
|
110
|
+
--heat-4: #d14b1a; --heat-5: #df3c2a; --heat-6: #df4949;
|
|
111
|
+
|
|
112
|
+
--cost-0: #2a1c11; --cost-1: #482b14; --cost-2: #6d411c; --cost-3: #955823;
|
|
113
|
+
--cost-4: #bf6f29; --cost-5: #e78b3c; --cost-6: #fca765;
|
|
114
|
+
|
|
115
|
+
--band-safety: #2a2a2a; --band-reflection: #333333; --band-skip: #474747;
|
|
116
|
+
|
|
117
|
+
--status-leak: #f87171; --status-leak-soft: rgba(248, 113, 113, 0.16);
|
|
118
|
+
--status-property: #fbbf24; --status-property-soft: rgba(251, 191, 36, 0.16);
|
|
119
|
+
--status-weak: #d0bb5a; --status-weak-soft: rgba(208, 187, 90, 0.15);
|
|
120
|
+
|
|
121
|
+
--class-preserved: #b3b3b3; --class-preserved-soft: rgba(179, 179, 179, 0.20);
|
|
122
|
+
--class-preserved-wash: rgba(179, 179, 179, 0.06);
|
|
123
|
+
--class-renamed: #5ed0d0; --class-renamed-soft: rgba(94, 208, 208, 0.20);
|
|
124
|
+
--class-flattened: #6db8ea; --class-flattened-soft: rgba(109, 184, 234, 0.20);
|
|
125
|
+
--class-destroyed: #c9a3ff; --class-destroyed-soft: rgba(201, 163, 255, 0.20); --class-destroyed-edge: #eaae3d;
|
|
126
|
+
|
|
127
|
+
--tok-hover-bg: rgba(234, 174, 61, 0.26);
|
|
128
|
+
--tok-hover-ring: rgba(234, 174, 61, 0.95);
|
|
129
|
+
--resizer-hover: rgba(234, 174, 61, 0.65);
|
|
130
|
+
|
|
131
|
+
--logo-plate: rgba(255, 255, 255, 0.04);
|
|
132
|
+
--syn-comment: #6a9955;
|
|
133
|
+
--syn-key: #8fc8ff;
|
|
134
|
+
--syn-str: #e8b598;
|
|
135
|
+
--syn-num: #c3dbb4;
|
|
136
|
+
|
|
137
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.55);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:root[data-theme="light"] {
|
|
142
|
+
--ground: #ffffff; --surface-1: #ffffff; --surface-2: #f8f8f8; --surface-3: #ececec;
|
|
143
|
+
--surface-hover: #e8e8e8; --scrollbar: #c9c9c9; --border: #e5e5e5; --border-strong: #cecece;
|
|
144
|
+
--text-primary: #262626; --text-secondary: #616161; --text-muted: #767676;
|
|
145
|
+
--brand: #a06a12; --brand-hover: #b57317; --brand-ink: #ffffff; --focus-ring: #a06a12; --wash: #f3f3f3;
|
|
146
|
+
--heat-0: #fff3c2; --heat-1: #ffde85; --heat-2: #ffc247; --heat-3: #fa940f;
|
|
147
|
+
--heat-4: #e6650f; --heat-5: #d1381a; --heat-6: #b62020;
|
|
148
|
+
--cost-0: #f8e3d5; --cost-1: #eec9ae; --cost-2: #dda780; --cost-3: #c48350;
|
|
149
|
+
--cost-4: #a45f24; --cost-5: #7f4406; --cost-6: #5a2d00;
|
|
150
|
+
--band-safety: #d4d4d4; --band-reflection: #bdbdbd; --band-skip: #969696;
|
|
151
|
+
--status-leak: #dc2626; --status-leak-soft: #fee2e2;
|
|
152
|
+
--status-property: #b45309; --status-property-soft: #fef3c7;
|
|
153
|
+
--status-weak: #a16207; --status-weak-soft: #fef9c3;
|
|
154
|
+
--class-preserved: #525252; --class-preserved-soft: #e5e5e5; --class-preserved-wash: rgba(82, 82, 82, 0.09);
|
|
155
|
+
--class-renamed: #0d7d88; --class-renamed-soft: #d6eef0;
|
|
156
|
+
--class-flattened: #1d6fa5; --class-flattened-soft: #dbeafe;
|
|
157
|
+
--class-destroyed: #7141b8; --class-destroyed-soft: #efe3fb; --class-destroyed-edge: #b57317;
|
|
158
|
+
--tok-hover-bg: rgba(181, 115, 23, 0.36); --tok-hover-ring: rgba(160, 106, 18, 0.85);
|
|
159
|
+
--resizer-hover: rgba(160, 106, 18, 0.55);
|
|
160
|
+
--logo-plate: #141414; --syn-comment: #008000; --syn-key: #0000ff; --syn-str: #a31515; --syn-num: #046043;
|
|
161
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:root[data-theme="dark"] {
|
|
165
|
+
--ground: #1f1f1f; --surface-1: #202020; --surface-2: #181818; --surface-3: #2b2b2b;
|
|
166
|
+
--surface-hover: #2a2d2e; --scrollbar: #4f4f4f; --border: #2b2b2b; --border-strong: #3c3c3c;
|
|
167
|
+
--text-primary: #cccccc; --text-secondary: #9d9d9d; --text-muted: #8c8c8c;
|
|
168
|
+
--brand: #eaae3d; --brand-hover: #fcea85; --brand-ink: #0a0a0a; --focus-ring: #eaae3d; --wash: #252526;
|
|
169
|
+
--heat-0: #543912; --heat-1: #714514; --heat-2: #8e4e15; --heat-3: #b15416;
|
|
170
|
+
--heat-4: #d14b1a; --heat-5: #df3c2a; --heat-6: #df4949;
|
|
171
|
+
--cost-0: #2a1c11; --cost-1: #482b14; --cost-2: #6d411c; --cost-3: #955823;
|
|
172
|
+
--cost-4: #bf6f29; --cost-5: #e78b3c; --cost-6: #fca765;
|
|
173
|
+
--band-safety: #2a2a2a; --band-reflection: #333333; --band-skip: #474747;
|
|
174
|
+
--status-leak: #f87171; --status-leak-soft: rgba(248, 113, 113, 0.16);
|
|
175
|
+
--status-property: #fbbf24; --status-property-soft: rgba(251, 191, 36, 0.16);
|
|
176
|
+
--status-weak: #d0bb5a; --status-weak-soft: rgba(208, 187, 90, 0.15);
|
|
177
|
+
--class-preserved: #b3b3b3; --class-preserved-soft: rgba(179, 179, 179, 0.20); --class-preserved-wash: rgba(179, 179, 179, 0.06);
|
|
178
|
+
--class-renamed: #5ed0d0; --class-renamed-soft: rgba(94, 208, 208, 0.20);
|
|
179
|
+
--class-flattened: #6db8ea; --class-flattened-soft: rgba(109, 184, 234, 0.20);
|
|
180
|
+
--class-destroyed: #c9a3ff; --class-destroyed-soft: rgba(201, 163, 255, 0.20); --class-destroyed-edge: #eaae3d;
|
|
181
|
+
--tok-hover-bg: rgba(234, 174, 61, 0.26); --tok-hover-ring: rgba(234, 174, 61, 0.95);
|
|
182
|
+
--resizer-hover: rgba(234, 174, 61, 0.65);
|
|
183
|
+
--logo-plate: rgba(255, 255, 255, 0.04); --syn-comment: #6a9955; --syn-key: #8fc8ff; --syn-str: #e8b598; --syn-num: #c3dbb4;
|
|
184
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.55);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
* { box-sizing: border-box; }
|
|
188
|
+
html, body { height: 100%; }
|
|
189
|
+
html { overflow-x: hidden; }
|
|
190
|
+
body {
|
|
191
|
+
margin: 0;
|
|
192
|
+
overflow-x: hidden;
|
|
193
|
+
background: var(--ground);
|
|
194
|
+
color: var(--text-primary);
|
|
195
|
+
font-family: var(--font-ui);
|
|
196
|
+
font-size: 14px;
|
|
197
|
+
line-height: 1.5;
|
|
198
|
+
-webkit-font-smoothing: antialiased;
|
|
199
|
+
}
|
|
200
|
+
h1, h2, h3, h4 { margin: 0; font-family: var(--font-mono); font-weight: 600; }
|
|
201
|
+
button { font: inherit; color: inherit; }
|
|
202
|
+
p { margin: 0 0 0.6em; }
|
|
203
|
+
p:last-child { margin-bottom: 0; }
|
|
204
|
+
ul { margin: 0; padding: 0; list-style: none; }
|
|
205
|
+
a { color: var(--brand); }
|
|
206
|
+
a:hover { color: var(--brand-hover); }
|
|
207
|
+
|
|
208
|
+
@media (prefers-reduced-motion: reduce) {
|
|
209
|
+
*, *::before, *::after {
|
|
210
|
+
animation-duration: 0.001ms !important;
|
|
211
|
+
animation-iteration-count: 1 !important;
|
|
212
|
+
transition-duration: 0.001ms !important;
|
|
213
|
+
scroll-behavior: auto !important;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:focus-visible {
|
|
218
|
+
outline: 2px solid var(--focus-ring);
|
|
219
|
+
outline-offset: 2px;
|
|
220
|
+
border-radius: 3px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.eyebrow {
|
|
224
|
+
font-family: var(--font-mono);
|
|
225
|
+
font-size: 10.5px;
|
|
226
|
+
font-weight: 700;
|
|
227
|
+
letter-spacing: 0.08em;
|
|
228
|
+
text-transform: uppercase;
|
|
229
|
+
color: var(--text-muted);
|
|
230
|
+
}
|
|
231
|
+
.mono { font-family: var(--font-mono); }
|
|
232
|
+
|
|
233
|
+
.app-shell {
|
|
234
|
+
--rail-left-w: 262px;
|
|
235
|
+
--rail-right-w: 340px;
|
|
236
|
+
display: grid;
|
|
237
|
+
grid-template-columns: var(--rail-left-w) minmax(0, 1fr) var(--rail-right-w);
|
|
238
|
+
grid-template-rows: auto 1fr;
|
|
239
|
+
grid-template-areas:
|
|
240
|
+
"top top top"
|
|
241
|
+
"left center right";
|
|
242
|
+
height: 100vh;
|
|
243
|
+
width: 100%;
|
|
244
|
+
}
|
|
245
|
+
.app-shell.rail-collapsed {
|
|
246
|
+
grid-template-columns: minmax(0, 1fr) var(--rail-right-w);
|
|
247
|
+
grid-template-areas:
|
|
248
|
+
"top top"
|
|
249
|
+
"center right";
|
|
250
|
+
}
|
|
251
|
+
.app-shell.rail-collapsed .rail-left { display: none; }
|
|
252
|
+
.app-shell.inspector-collapsed {
|
|
253
|
+
grid-template-columns: var(--rail-left-w) minmax(0, 1fr);
|
|
254
|
+
grid-template-areas:
|
|
255
|
+
"top top"
|
|
256
|
+
"left center";
|
|
257
|
+
}
|
|
258
|
+
.app-shell.inspector-collapsed .rail-right { display: none; }
|
|
259
|
+
.app-shell.rail-collapsed.inspector-collapsed {
|
|
260
|
+
grid-template-columns: minmax(0, 1fr);
|
|
261
|
+
grid-template-areas:
|
|
262
|
+
"top"
|
|
263
|
+
"center";
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.pane-resizer {
|
|
267
|
+
position: relative;
|
|
268
|
+
z-index: 6;
|
|
269
|
+
width: 9px;
|
|
270
|
+
align-self: stretch;
|
|
271
|
+
cursor: col-resize;
|
|
272
|
+
touch-action: none;
|
|
273
|
+
background: transparent;
|
|
274
|
+
border: none;
|
|
275
|
+
padding: 0;
|
|
276
|
+
}
|
|
277
|
+
.pane-resizer#resize-left { grid-area: left; justify-self: end; margin-right: -4px; }
|
|
278
|
+
.pane-resizer#resize-right { grid-area: right; justify-self: start; margin-left: -4px; }
|
|
279
|
+
.pane-resizer::before {
|
|
280
|
+
content: "";
|
|
281
|
+
position: absolute;
|
|
282
|
+
top: 0;
|
|
283
|
+
bottom: 0;
|
|
284
|
+
left: 3px;
|
|
285
|
+
width: 3px;
|
|
286
|
+
border-radius: 2px;
|
|
287
|
+
background: transparent;
|
|
288
|
+
transition: background-color 0.15s ease;
|
|
289
|
+
}
|
|
290
|
+
.pane-resizer:hover::before,
|
|
291
|
+
.pane-resizer.is-dragging::before { background: var(--resizer-hover); }
|
|
292
|
+
.pane-resizer:focus-visible {
|
|
293
|
+
outline: 2px solid var(--focus-ring);
|
|
294
|
+
outline-offset: -1px;
|
|
295
|
+
border-radius: 4px;
|
|
296
|
+
}
|
|
297
|
+
.pane-resizer:focus-visible::before { background: var(--brand); }
|
|
298
|
+
.app-shell.rail-collapsed .pane-resizer#resize-left,
|
|
299
|
+
.app-shell.inspector-collapsed .pane-resizer#resize-right { display: none; }
|
|
300
|
+
body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
|
|
301
|
+
body.is-resizing .pane-resizer::before { transition: none; }
|
|
302
|
+
@media (prefers-reduced-motion: reduce) { .pane-resizer::before { transition: none; } }
|
|
303
|
+
|
|
304
|
+
@media (max-width: 980px) {
|
|
305
|
+
.pane-resizer { display: none; }
|
|
306
|
+
.app-shell,
|
|
307
|
+
.app-shell.rail-collapsed,
|
|
308
|
+
.app-shell.inspector-collapsed,
|
|
309
|
+
.app-shell.rail-collapsed.inspector-collapsed {
|
|
310
|
+
grid-template-columns: 1fr;
|
|
311
|
+
grid-template-rows: auto auto auto auto;
|
|
312
|
+
grid-template-areas:
|
|
313
|
+
"top"
|
|
314
|
+
"left"
|
|
315
|
+
"center"
|
|
316
|
+
"right";
|
|
317
|
+
height: auto;
|
|
318
|
+
min-height: 100vh;
|
|
319
|
+
}
|
|
320
|
+
.rail-left, .rail-right { max-height: 46vh; }
|
|
321
|
+
.pane-center { min-height: 60vh; max-height: 60vh; }
|
|
322
|
+
}
|
|
323
|
+
@media (max-width: 480px) {
|
|
324
|
+
.topbar { padding: 8px 10px; }
|
|
325
|
+
.rail-left, .rail-right { padding: 10px 8px 18px; }
|
|
326
|
+
.code-toolbar { padding: 6px 10px; }
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.topbar {
|
|
330
|
+
grid-area: top;
|
|
331
|
+
display: flex;
|
|
332
|
+
flex-wrap: wrap;
|
|
333
|
+
align-items: center;
|
|
334
|
+
gap: 10px;
|
|
335
|
+
row-gap: 8px;
|
|
336
|
+
padding: 10px 16px;
|
|
337
|
+
background: var(--surface-1);
|
|
338
|
+
backdrop-filter: blur(14px);
|
|
339
|
+
-webkit-backdrop-filter: blur(14px);
|
|
340
|
+
border-bottom: 1px solid var(--border);
|
|
341
|
+
min-width: 0;
|
|
342
|
+
}
|
|
343
|
+
.topbar h1 {
|
|
344
|
+
font-size: 14px;
|
|
345
|
+
letter-spacing: 0.01em;
|
|
346
|
+
white-space: nowrap;
|
|
347
|
+
overflow: hidden;
|
|
348
|
+
text-overflow: ellipsis;
|
|
349
|
+
}
|
|
350
|
+
.topbar h1 .dot { color: var(--brand); }
|
|
351
|
+
.tag-size {
|
|
352
|
+
font-family: var(--font-mono);
|
|
353
|
+
font-size: 10px;
|
|
354
|
+
font-weight: 700;
|
|
355
|
+
letter-spacing: 0.06em;
|
|
356
|
+
text-transform: uppercase;
|
|
357
|
+
color: var(--text-secondary);
|
|
358
|
+
background: var(--surface-3);
|
|
359
|
+
border: 1px solid var(--border-strong);
|
|
360
|
+
border-radius: 4px;
|
|
361
|
+
padding: 2px 7px;
|
|
362
|
+
white-space: nowrap;
|
|
363
|
+
flex-shrink: 0;
|
|
364
|
+
cursor: help;
|
|
365
|
+
transition: color 0.3s ease, border-color 0.3s ease;
|
|
366
|
+
}
|
|
367
|
+
.tag-size:hover, .tag-size:focus-visible { color: var(--brand); border-color: var(--brand); }
|
|
368
|
+
.topbar .spacer { flex: 1 1 auto; min-width: 8px; }
|
|
369
|
+
|
|
370
|
+
.brand-logo {
|
|
371
|
+
display: inline-flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
flex-shrink: 0;
|
|
374
|
+
margin-left: 6px;
|
|
375
|
+
padding: 4px 10px;
|
|
376
|
+
border-radius: 999px;
|
|
377
|
+
background: var(--logo-plate);
|
|
378
|
+
box-shadow: inset 0 0 0 1px var(--border);
|
|
379
|
+
text-decoration: none;
|
|
380
|
+
color: inherit;
|
|
381
|
+
transition: box-shadow 0.3s ease, background-color 0.3s ease;
|
|
382
|
+
}
|
|
383
|
+
.brand-logo:hover, .brand-logo:focus-visible { box-shadow: inset 0 0 0 1px var(--brand); }
|
|
384
|
+
.brand-logo svg { height: 22px; width: auto; display: block; }
|
|
385
|
+
|
|
386
|
+
.segmented {
|
|
387
|
+
display: inline-flex;
|
|
388
|
+
border: 1px solid var(--border-strong);
|
|
389
|
+
border-radius: var(--radius);
|
|
390
|
+
overflow: hidden;
|
|
391
|
+
flex-shrink: 0;
|
|
392
|
+
}
|
|
393
|
+
.segmented button {
|
|
394
|
+
font-family: var(--font-mono);
|
|
395
|
+
font-size: 11.5px;
|
|
396
|
+
font-weight: 700;
|
|
397
|
+
letter-spacing: 0.04em;
|
|
398
|
+
text-transform: uppercase;
|
|
399
|
+
border: none;
|
|
400
|
+
background: var(--surface-2);
|
|
401
|
+
color: var(--text-secondary);
|
|
402
|
+
padding: 7px 12px;
|
|
403
|
+
cursor: pointer;
|
|
404
|
+
transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
|
|
405
|
+
}
|
|
406
|
+
.segmented button + button { border-left: 1px solid var(--border-strong); }
|
|
407
|
+
.segmented-tight { display: flex; width: 100%; max-width: 100%; }
|
|
408
|
+
.segmented-tight button {
|
|
409
|
+
padding: 6px 4px;
|
|
410
|
+
font-size: 10px;
|
|
411
|
+
letter-spacing: 0.01em;
|
|
412
|
+
flex: 1 1 auto;
|
|
413
|
+
min-width: 0;
|
|
414
|
+
white-space: nowrap;
|
|
415
|
+
}
|
|
416
|
+
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 20px rgba(234, 174, 61, 0.4); }
|
|
417
|
+
.segmented button:hover:not([aria-pressed="true"]) { background: var(--surface-hover); }
|
|
418
|
+
|
|
419
|
+
.theme-toggle {
|
|
420
|
+
font-family: var(--font-mono);
|
|
421
|
+
font-size: 11.5px;
|
|
422
|
+
font-weight: 700;
|
|
423
|
+
border: 1px solid var(--border-strong);
|
|
424
|
+
border-radius: var(--radius);
|
|
425
|
+
background: var(--surface-2);
|
|
426
|
+
color: var(--text-secondary);
|
|
427
|
+
padding: 7px 10px;
|
|
428
|
+
cursor: pointer;
|
|
429
|
+
white-space: nowrap;
|
|
430
|
+
flex-shrink: 0;
|
|
431
|
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
|
432
|
+
}
|
|
433
|
+
.theme-toggle:hover { background: var(--surface-hover); }
|
|
434
|
+
|
|
435
|
+
.top-btn {
|
|
436
|
+
display: inline-flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
gap: 6px;
|
|
439
|
+
font-family: var(--font-mono);
|
|
440
|
+
font-size: 11.5px;
|
|
441
|
+
font-weight: 700;
|
|
442
|
+
border: 1px solid var(--border-strong);
|
|
443
|
+
border-radius: var(--radius);
|
|
444
|
+
background: var(--surface-2);
|
|
445
|
+
color: var(--text-secondary);
|
|
446
|
+
padding: 7px 10px;
|
|
447
|
+
cursor: pointer;
|
|
448
|
+
white-space: nowrap;
|
|
449
|
+
flex-shrink: 0;
|
|
450
|
+
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
451
|
+
}
|
|
452
|
+
.top-btn:hover { background: var(--surface-hover); }
|
|
453
|
+
.top-btn[aria-expanded="true"], .top-btn[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); }
|
|
454
|
+
.top-btn .top-btn-glyph { font-size: 13px; line-height: 1; }
|
|
455
|
+
.top-btn-icon { padding: 6px 8px; }
|
|
456
|
+
.top-btn-icon svg { display: block; }
|
|
457
|
+
|
|
458
|
+
.top-btn-pair { display: inline-flex; flex-shrink: 0; }
|
|
459
|
+
.top-btn-pair .top-btn { border-radius: 0; }
|
|
460
|
+
.top-btn-pair .top-btn:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
|
|
461
|
+
.top-btn-pair .top-btn:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
|
|
462
|
+
.top-btn-pair .top-btn + .top-btn { border-left-width: 0; }
|
|
463
|
+
.top-btn-pair .top-btn[aria-pressed="true"] + .top-btn { border-left: 1px solid var(--border-strong); }
|
|
464
|
+
|
|
465
|
+
.tree-search {
|
|
466
|
+
width: 100%;
|
|
467
|
+
font-family: var(--font-mono);
|
|
468
|
+
font-size: 12px;
|
|
469
|
+
color: var(--text-primary);
|
|
470
|
+
background: var(--surface-1);
|
|
471
|
+
border: 1px solid var(--border-strong);
|
|
472
|
+
border-radius: var(--radius);
|
|
473
|
+
padding: 6px 9px;
|
|
474
|
+
margin: 6px 0;
|
|
475
|
+
}
|
|
476
|
+
.tree-search::placeholder { color: var(--text-muted); }
|
|
477
|
+
.tree-empty { font-size: 11.5px; color: var(--text-muted); font-style: italic; padding: 6px 2px; }
|
|
478
|
+
.tree-note {
|
|
479
|
+
font-size: 10.5px;
|
|
480
|
+
line-height: 1.45;
|
|
481
|
+
color: var(--text-muted);
|
|
482
|
+
background: var(--surface-3);
|
|
483
|
+
border-radius: 6px;
|
|
484
|
+
padding: 5px 7px;
|
|
485
|
+
margin: 0 0 6px;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.rail-left, .rail-right { overflow-y: auto; min-width: 0; }
|
|
489
|
+
.rail-left {
|
|
490
|
+
grid-area: left;
|
|
491
|
+
background: var(--surface-2);
|
|
492
|
+
border-right: 1px solid var(--border);
|
|
493
|
+
padding: 14px 12px 24px;
|
|
494
|
+
}
|
|
495
|
+
.rail-right {
|
|
496
|
+
grid-area: right;
|
|
497
|
+
background: var(--surface-2);
|
|
498
|
+
border-left: 1px solid var(--border);
|
|
499
|
+
padding: 0;
|
|
500
|
+
display: flex;
|
|
501
|
+
flex-direction: column;
|
|
502
|
+
overflow-y: hidden;
|
|
503
|
+
}
|
|
504
|
+
.rail-right-pin {
|
|
505
|
+
flex: 0 0 auto;
|
|
506
|
+
max-height: 58%;
|
|
507
|
+
overflow-y: auto;
|
|
508
|
+
padding: 14px 12px 10px;
|
|
509
|
+
border-bottom: 1px solid var(--border);
|
|
510
|
+
}
|
|
511
|
+
.rail-right-scroll {
|
|
512
|
+
flex: 1 1 auto;
|
|
513
|
+
min-height: 0;
|
|
514
|
+
overflow-y: auto;
|
|
515
|
+
padding: 12px 12px 24px;
|
|
516
|
+
}
|
|
517
|
+
.rail-right-pin .rail-section { margin-bottom: 0; }
|
|
518
|
+
@media (max-width: 980px) {
|
|
519
|
+
.rail-right { display: block; overflow-y: auto; padding: 0; }
|
|
520
|
+
.rail-right-pin { max-height: none; overflow-y: visible; padding: 12px 10px; }
|
|
521
|
+
.rail-right-scroll { overflow-y: visible; padding: 12px 10px 18px; }
|
|
522
|
+
}
|
|
523
|
+
.rail-section { margin-bottom: 18px; }
|
|
524
|
+
.rail-section:last-child { margin-bottom: 0; }
|
|
525
|
+
.rail-section > .eyebrow { display: block; margin-bottom: 8px; }
|
|
526
|
+
.rail-right-pin .rail-section + .rail-section { margin-top: 14px; }
|
|
527
|
+
|
|
528
|
+
.tree-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
|
|
529
|
+
.tree-head > .eyebrow { flex: 1 1 auto; min-width: 0; }
|
|
530
|
+
.workspace-line {
|
|
531
|
+
font-family: var(--font-mono);
|
|
532
|
+
font-size: 10.5px;
|
|
533
|
+
color: var(--text-muted);
|
|
534
|
+
flex: 0 0 auto;
|
|
535
|
+
}
|
|
536
|
+
.workspace-line:empty { display: none; }
|
|
537
|
+
|
|
538
|
+
.tree {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex-direction: column;
|
|
541
|
+
margin: 0 -8px;
|
|
542
|
+
--tree-row-h: 28px;
|
|
543
|
+
--tree-pin-off: -14px;
|
|
544
|
+
}
|
|
545
|
+
.tree-node, .tree-branch { display: flex; flex-direction: column; }
|
|
546
|
+
.tree-row {
|
|
547
|
+
display: flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
gap: 6px;
|
|
550
|
+
width: 100%;
|
|
551
|
+
height: var(--tree-row-h);
|
|
552
|
+
flex: 0 0 auto;
|
|
553
|
+
background: transparent;
|
|
554
|
+
border: none;
|
|
555
|
+
text-align: left;
|
|
556
|
+
cursor: pointer;
|
|
557
|
+
padding-right: 8px;
|
|
558
|
+
border-radius: 6px;
|
|
559
|
+
font-family: var(--font-mono);
|
|
560
|
+
font-size: 12px;
|
|
561
|
+
color: var(--text-primary);
|
|
562
|
+
transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
|
563
|
+
}
|
|
564
|
+
.tree-row-folder { position: sticky; background: var(--surface-2); }
|
|
565
|
+
.tree-row:hover { background: var(--surface-hover); }
|
|
566
|
+
.tree-row-file.is-active { background: var(--surface-1); box-shadow: 0 0 0 1px var(--brand) inset; font-weight: 700; }
|
|
567
|
+
.tree-row.is-ignored { color: var(--text-muted); opacity: 0.62; }
|
|
568
|
+
.tree-row.is-ignored:hover, .tree-row.is-ignored.is-active, .tree-row.is-ignored:focus-visible { opacity: 1; }
|
|
569
|
+
.tree-file-meter.is-ignored { opacity: 0.45; }
|
|
570
|
+
.tree-twisty {
|
|
571
|
+
flex: 0 0 auto;
|
|
572
|
+
width: 1em;
|
|
573
|
+
display: inline-block;
|
|
574
|
+
text-align: center;
|
|
575
|
+
color: var(--text-muted);
|
|
576
|
+
transition: transform 0.12s ease;
|
|
577
|
+
}
|
|
578
|
+
.tree-row-folder[aria-expanded="false"] .tree-twisty { transform: rotate(-90deg); }
|
|
579
|
+
.tree-icon { flex: 0 0 auto; }
|
|
580
|
+
.tree-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
581
|
+
.tree-count { flex: 0 0 auto; font-size: 10px; color: var(--text-muted); }
|
|
582
|
+
.tree-mark {
|
|
583
|
+
flex: 0 0 auto;
|
|
584
|
+
font-family: var(--font-mono);
|
|
585
|
+
font-size: 9.5px;
|
|
586
|
+
font-weight: 700;
|
|
587
|
+
color: var(--brand);
|
|
588
|
+
border: 1px solid var(--brand);
|
|
589
|
+
border-radius: 4px;
|
|
590
|
+
padding: 0 4px;
|
|
591
|
+
line-height: 1.5;
|
|
592
|
+
}
|
|
593
|
+
.tree-row-folder .tree-mark { opacity: 0.75; }
|
|
594
|
+
.tree-file-meter { padding-bottom: 6px; padding-right: 10px; }
|
|
595
|
+
.badge-weak {
|
|
596
|
+
flex-shrink: 0;
|
|
597
|
+
font-family: var(--font-mono);
|
|
598
|
+
font-size: 10px;
|
|
599
|
+
font-weight: 700;
|
|
600
|
+
color: var(--brand-ink);
|
|
601
|
+
background: var(--status-property);
|
|
602
|
+
border-radius: 999px;
|
|
603
|
+
padding: 1px 6px;
|
|
604
|
+
line-height: 1.4;
|
|
605
|
+
}
|
|
606
|
+
.badge-weak.has-leak { background: var(--status-leak); }
|
|
607
|
+
.tree-row-folder .badge-weak { opacity: 0.78; }
|
|
608
|
+
|
|
609
|
+
.meter { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
|
|
610
|
+
.meter > i { display: block; height: 100%; border-radius: 3px 0 0 3px; }
|
|
611
|
+
.meter-lg { height: 7px; border-radius: 4px; }
|
|
612
|
+
|
|
613
|
+
.class-dist-bar { display: flex; height: 10px; border-radius: 4px; overflow: hidden; background: var(--surface-3); margin-bottom: 8px; }
|
|
614
|
+
.class-dist-bar i { display: block; height: 100%; }
|
|
615
|
+
.class-dist-bar i[data-class="preserved"] { background: var(--class-preserved); }
|
|
616
|
+
.class-dist-bar i[data-class="renamed-encoded"] { background: var(--class-renamed); }
|
|
617
|
+
.class-dist-bar i[data-class="flattened-fused"] { background: var(--class-flattened); }
|
|
618
|
+
.class-dist-bar i[data-class="destroyed-fused"] { background: var(--class-destroyed); }
|
|
619
|
+
.class-dist-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
|
|
620
|
+
.class-dist-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
|
|
621
|
+
.class-dist-count { margin-left: auto; font-family: var(--font-mono); font-weight: 700; color: var(--text-secondary); }
|
|
622
|
+
.class-reached-line { font-size: 11px; color: var(--text-secondary); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
623
|
+
.class-dist-footnote { font-size: 10px; color: var(--text-muted); margin-top: 6px; font-style: italic; }
|
|
624
|
+
|
|
625
|
+
.class-legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 11px; }
|
|
626
|
+
.class-legend-flag {
|
|
627
|
+
flex: 0 0 auto;
|
|
628
|
+
font-family: var(--font-mono);
|
|
629
|
+
font-size: 9px;
|
|
630
|
+
text-transform: uppercase;
|
|
631
|
+
letter-spacing: 0.05em;
|
|
632
|
+
color: var(--text-muted);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.class-chip {
|
|
636
|
+
display: inline-flex;
|
|
637
|
+
align-items: center;
|
|
638
|
+
gap: 5px;
|
|
639
|
+
font-family: var(--font-mono);
|
|
640
|
+
font-size: 10.5px;
|
|
641
|
+
font-weight: 700;
|
|
642
|
+
padding: 3px 8px;
|
|
643
|
+
border-radius: 999px;
|
|
644
|
+
border: 1px solid transparent;
|
|
645
|
+
flex-shrink: 0;
|
|
646
|
+
white-space: nowrap;
|
|
647
|
+
}
|
|
648
|
+
.class-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
|
|
649
|
+
.class-chip[data-class="preserved"] { color: var(--class-preserved); background: var(--class-preserved-soft); }
|
|
650
|
+
.class-chip[data-class="preserved"] .dot { background: var(--class-preserved); }
|
|
651
|
+
.class-chip[data-class="renamed-encoded"] { color: var(--class-renamed); background: var(--class-renamed-soft); }
|
|
652
|
+
.class-chip[data-class="renamed-encoded"] .dot { background: var(--class-renamed); }
|
|
653
|
+
.class-chip[data-class="flattened-fused"] { color: var(--class-flattened); background: var(--class-flattened-soft); }
|
|
654
|
+
.class-chip[data-class="flattened-fused"] .dot { background: var(--class-flattened); }
|
|
655
|
+
.class-chip[data-class="destroyed-fused"] { color: var(--class-destroyed); background: var(--class-destroyed-soft); border-color: var(--class-destroyed-edge); }
|
|
656
|
+
.class-chip[data-class="destroyed-fused"] .dot { background: var(--class-destroyed); }
|
|
657
|
+
.class-chip.is-ghost { opacity: 0.6; background: transparent; border-style: dashed; border-color: currentColor; }
|
|
658
|
+
|
|
659
|
+
.tier-pill {
|
|
660
|
+
font-family: var(--font-mono);
|
|
661
|
+
font-size: 9.5px;
|
|
662
|
+
font-weight: 700;
|
|
663
|
+
text-transform: uppercase;
|
|
664
|
+
letter-spacing: 0.04em;
|
|
665
|
+
border-radius: 4px;
|
|
666
|
+
padding: 2px 6px;
|
|
667
|
+
border: 1px solid;
|
|
668
|
+
flex-shrink: 0;
|
|
669
|
+
}
|
|
670
|
+
.tier-pill.tier-free { color: var(--text-secondary); border-color: var(--border-strong); background: var(--surface-2); }
|
|
671
|
+
.tier-pill.tier-pro { color: var(--class-destroyed); border-color: var(--class-destroyed); background: var(--class-destroyed-soft); }
|
|
672
|
+
|
|
673
|
+
.legend-bar { height: 10px; border-radius: 3px; border: 1px solid var(--border); }
|
|
674
|
+
.legend-labels { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10.5px; font-family: var(--font-mono); color: var(--text-muted); }
|
|
675
|
+
|
|
676
|
+
.engine-info {
|
|
677
|
+
font-family: var(--font-mono);
|
|
678
|
+
font-size: 10.5px;
|
|
679
|
+
color: var(--text-muted);
|
|
680
|
+
display: grid;
|
|
681
|
+
grid-template-columns: auto 1fr;
|
|
682
|
+
gap: 3px 8px;
|
|
683
|
+
}
|
|
684
|
+
.engine-info dt { text-align: left; }
|
|
685
|
+
.engine-info dd { margin: 0; text-align: right; color: var(--text-secondary); overflow-wrap: anywhere; }
|
|
686
|
+
|
|
687
|
+
.pane-center { grid-area: center; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ground); }
|
|
688
|
+
|
|
689
|
+
.file-summary {
|
|
690
|
+
flex: 0 0 auto;
|
|
691
|
+
position: sticky;
|
|
692
|
+
top: 0;
|
|
693
|
+
z-index: 3;
|
|
694
|
+
display: flex;
|
|
695
|
+
flex-direction: column;
|
|
696
|
+
align-items: stretch;
|
|
697
|
+
padding: 0;
|
|
698
|
+
background: var(--surface-1);
|
|
699
|
+
border-bottom: 1px solid var(--border);
|
|
700
|
+
backdrop-filter: blur(14px);
|
|
701
|
+
-webkit-backdrop-filter: blur(14px);
|
|
702
|
+
}
|
|
703
|
+
.file-head-row { display: flex; align-items: center; gap: 8px; padding: 9px 14px 5px; min-width: 0; }
|
|
704
|
+
.file-head-spacer { flex: 1 1 auto; min-width: 10px; }
|
|
705
|
+
.file-summary-path { display: flex; align-items: baseline; gap: 1px; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; }
|
|
706
|
+
.file-summary-path .fs-dir {
|
|
707
|
+
color: var(--text-muted);
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
text-overflow: ellipsis;
|
|
710
|
+
white-space: nowrap;
|
|
711
|
+
direction: rtl;
|
|
712
|
+
unicode-bidi: plaintext;
|
|
713
|
+
min-width: 0;
|
|
714
|
+
}
|
|
715
|
+
.file-summary-path .fs-name { color: var(--text-primary); font-weight: 700; flex-shrink: 0; }
|
|
716
|
+
#source-origin-note { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; cursor: help; }
|
|
717
|
+
.icon-btn {
|
|
718
|
+
flex: 0 0 auto;
|
|
719
|
+
display: inline-flex;
|
|
720
|
+
align-items: center;
|
|
721
|
+
justify-content: center;
|
|
722
|
+
min-width: 22px;
|
|
723
|
+
height: 20px;
|
|
724
|
+
padding: 0 5px;
|
|
725
|
+
font-family: var(--font-mono);
|
|
726
|
+
font-size: 11px;
|
|
727
|
+
font-weight: 700;
|
|
728
|
+
border: 1px solid var(--border-strong);
|
|
729
|
+
border-radius: 5px;
|
|
730
|
+
background: var(--surface-2);
|
|
731
|
+
color: var(--text-secondary);
|
|
732
|
+
cursor: pointer;
|
|
733
|
+
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
734
|
+
}
|
|
735
|
+
.icon-btn:hover { background: var(--surface-hover); color: var(--brand); border-color: var(--brand); }
|
|
736
|
+
.code-toolbar {
|
|
737
|
+
display: flex;
|
|
738
|
+
align-items: center;
|
|
739
|
+
gap: 12px;
|
|
740
|
+
padding: 0 14px 8px;
|
|
741
|
+
font-family: var(--font-mono);
|
|
742
|
+
font-size: 11px;
|
|
743
|
+
color: var(--text-muted);
|
|
744
|
+
min-width: 0;
|
|
745
|
+
}
|
|
746
|
+
.code-toolbar .toolbar-spacer { flex: 1 1 auto; min-width: 8px; }
|
|
747
|
+
.toggle-inline { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
|
|
748
|
+
.toggle-inline input[type="checkbox"] { accent-color: var(--brand); width: 13px; height: 13px; margin: 0; }
|
|
749
|
+
.toggle-inline:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
|
|
750
|
+
#highlight-class-status {
|
|
751
|
+
flex: 0 0 auto;
|
|
752
|
+
display: inline-block;
|
|
753
|
+
min-width: 12ch;
|
|
754
|
+
color: var(--brand);
|
|
755
|
+
white-space: nowrap;
|
|
756
|
+
overflow: hidden;
|
|
757
|
+
text-overflow: ellipsis;
|
|
758
|
+
visibility: hidden;
|
|
759
|
+
}
|
|
760
|
+
#highlight-class-status.is-on { visibility: visible; }
|
|
761
|
+
|
|
762
|
+
.code-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 0 40px; }
|
|
763
|
+
.code-line { display: flex; min-width: max-content; white-space: pre; }
|
|
764
|
+
.ln {
|
|
765
|
+
position: sticky;
|
|
766
|
+
left: 0;
|
|
767
|
+
flex: 0 0 auto;
|
|
768
|
+
box-sizing: content-box;
|
|
769
|
+
padding: 0 12px 0 14px;
|
|
770
|
+
text-align: right;
|
|
771
|
+
color: var(--text-muted);
|
|
772
|
+
background: var(--ground);
|
|
773
|
+
border-right: 1px solid var(--border);
|
|
774
|
+
font-family: var(--font-mono);
|
|
775
|
+
font-size: 12.5px;
|
|
776
|
+
user-select: none;
|
|
777
|
+
}
|
|
778
|
+
.lc { flex: 1 1 auto; font-family: var(--font-mono); font-size: 12.5px; padding-left: 14px; padding-right: 40px; }
|
|
779
|
+
.tok { cursor: default; border-radius: 2px; transition: filter 0.1s ease, box-shadow 0.1s ease; }
|
|
780
|
+
.tok.tok-hot, .tok.tok-unlit { cursor: pointer; }
|
|
781
|
+
.tok.tok-hot:hover,
|
|
782
|
+
.tok.tok-hot:focus-visible,
|
|
783
|
+
.tok.tok-unlit:hover,
|
|
784
|
+
.tok.tok-unlit:focus-visible {
|
|
785
|
+
background-image: linear-gradient(var(--tok-hover-bg), var(--tok-hover-bg));
|
|
786
|
+
box-shadow: 0 0 0 1px var(--tok-hover-ring);
|
|
787
|
+
filter: brightness(1.06);
|
|
788
|
+
}
|
|
789
|
+
.tok.tok-peer {
|
|
790
|
+
background-image: linear-gradient(var(--tok-hover-bg), var(--tok-hover-bg));
|
|
791
|
+
filter: brightness(1.06);
|
|
792
|
+
}
|
|
793
|
+
.tok.is-selected { outline: 2px solid var(--brand); outline-offset: 1px; }
|
|
794
|
+
.tok.spot-leak { text-decoration: underline; text-decoration-color: var(--status-leak); text-decoration-thickness: 2px; text-underline-offset: 2px; }
|
|
795
|
+
.tok.spot-propertyName { text-decoration: underline; text-decoration-color: var(--status-property); text-decoration-thickness: 2px; text-underline-offset: 2px; }
|
|
796
|
+
.tok.spot-weak { text-decoration: underline dashed; text-decoration-color: var(--status-weak); text-decoration-thickness: 2px; text-underline-offset: 2px; }
|
|
797
|
+
.tok.tok-preserved {
|
|
798
|
+
background-color: var(--class-preserved-wash);
|
|
799
|
+
color: var(--text-secondary);
|
|
800
|
+
}
|
|
801
|
+
.pin {
|
|
802
|
+
display: inline-block;
|
|
803
|
+
width: 11px;
|
|
804
|
+
height: 11px;
|
|
805
|
+
margin-right: 2px;
|
|
806
|
+
vertical-align: -1px;
|
|
807
|
+
flex: 0 0 auto;
|
|
808
|
+
}
|
|
809
|
+
.lc .tok.spot-leak > .pin { color: var(--status-leak); }
|
|
810
|
+
.lc .tok.spot-propertyName > .pin { color: var(--status-property); }
|
|
811
|
+
.lc .tok.spot-weak > .pin { color: var(--status-weak); }
|
|
812
|
+
.pin svg { display: block; width: 100%; height: 100%; }
|
|
813
|
+
|
|
814
|
+
.lc i { font-style: normal; }
|
|
815
|
+
.lc i.sy-c, .lc .tok.sy-c { color: var(--syn-comment); font-style: italic; }
|
|
816
|
+
.lc .tok-hot i.sy-c { color: inherit; }
|
|
817
|
+
.lc .tok-ink-yield i { color: inherit; }
|
|
818
|
+
.lc i.sy-k, .lc .tok.sy-k { color: var(--syn-key); }
|
|
819
|
+
.lc i.sy-s, .lc .tok.sy-s { color: var(--syn-str); }
|
|
820
|
+
.lc i.sy-n, .lc .tok.sy-n { color: var(--syn-num); }
|
|
821
|
+
|
|
822
|
+
.dir-kw {
|
|
823
|
+
background-image: linear-gradient(100deg,
|
|
824
|
+
var(--brand) 0%, var(--brand-hover) 30%, var(--brand-hover) 50%,
|
|
825
|
+
var(--brand-hover) 70%, var(--brand) 100%);
|
|
826
|
+
background-size: 300% 100%;
|
|
827
|
+
-webkit-background-clip: text;
|
|
828
|
+
background-clip: text;
|
|
829
|
+
color: transparent;
|
|
830
|
+
animation: dir-sweep 9s linear infinite;
|
|
831
|
+
font-weight: 700;
|
|
832
|
+
}
|
|
833
|
+
.dir-arg { color: var(--brand); font-weight: 600; }
|
|
834
|
+
@keyframes dir-sweep { from { background-position: 0% 0; } to { background-position: 300% 0; } }
|
|
835
|
+
|
|
836
|
+
.code-line.has-directive .ln { color: var(--brand); }
|
|
837
|
+
.code-line.has-directive .ln::after {
|
|
838
|
+
content: "";
|
|
839
|
+
position: absolute;
|
|
840
|
+
left: 0;
|
|
841
|
+
top: 50%;
|
|
842
|
+
transform: translateY(-50%);
|
|
843
|
+
width: 3px;
|
|
844
|
+
height: 1.15em;
|
|
845
|
+
border-radius: 0 2px 2px 0;
|
|
846
|
+
background: linear-gradient(180deg, var(--brand-hover), var(--brand));
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
@media (prefers-reduced-motion: reduce) {
|
|
850
|
+
.dir-kw { animation: none; background-position: 50% 0; }
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.unlit { background: transparent; }
|
|
854
|
+
.lc .tok.tok-unlit { background: var(--wash); }
|
|
855
|
+
.lc .tok.tok-unlit.sy-c { background: transparent; }
|
|
856
|
+
.lc i.sy-c { background: var(--ground); }
|
|
857
|
+
|
|
858
|
+
.directive-legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11px; }
|
|
859
|
+
.directive-legend-row .swatch { flex: 0 0 auto; font-family: var(--font-mono); font-size: 10px; }
|
|
860
|
+
.directive-legend-row code { font-family: var(--font-mono); color: var(--text-secondary); }
|
|
861
|
+
|
|
862
|
+
.code-body[data-highlight-class] .tok[data-class]:not([data-class="preserved"]):not([data-class="renamed-encoded"]):not([data-class="flattened-fused"]):not([data-class="destroyed-fused"]) { opacity: 1; }
|
|
863
|
+
.code-body[data-highlight-class="preserved"] .tok[data-class]:not([data-class="preserved"]),
|
|
864
|
+
.code-body[data-highlight-class="renamed-encoded"] .tok[data-class]:not([data-class="renamed-encoded"]),
|
|
865
|
+
.code-body[data-highlight-class="flattened-fused"] .tok[data-class]:not([data-class="flattened-fused"]),
|
|
866
|
+
.code-body[data-highlight-class="destroyed-fused"] .tok[data-class]:not([data-class="destroyed-fused"]) {
|
|
867
|
+
opacity: 0.28;
|
|
868
|
+
}
|
|
869
|
+
.code-body[data-highlight-class="preserved"] .tok[data-class="preserved"] { box-shadow: 0 0 0 1px var(--class-preserved) inset; }
|
|
870
|
+
.code-body[data-highlight-class="renamed-encoded"] .tok[data-class="renamed-encoded"] { box-shadow: 0 0 0 1px var(--class-renamed) inset; }
|
|
871
|
+
.code-body[data-highlight-class="flattened-fused"] .tok[data-class="flattened-fused"] { box-shadow: 0 0 0 1px var(--class-flattened) inset; }
|
|
872
|
+
.code-body[data-highlight-class="destroyed-fused"] .tok[data-class="destroyed-fused"] { box-shadow: 0 0 0 1px var(--class-destroyed) inset; }
|
|
873
|
+
|
|
874
|
+
.tooltip {
|
|
875
|
+
position: fixed;
|
|
876
|
+
z-index: 60;
|
|
877
|
+
max-width: 300px;
|
|
878
|
+
font-family: var(--font-ui);
|
|
879
|
+
font-size: 11.5px;
|
|
880
|
+
line-height: 1.45;
|
|
881
|
+
color: var(--text-primary);
|
|
882
|
+
background: var(--surface-2);
|
|
883
|
+
border: 1px solid var(--border-strong);
|
|
884
|
+
border-radius: var(--radius);
|
|
885
|
+
box-shadow: var(--shadow);
|
|
886
|
+
padding: 8px 10px;
|
|
887
|
+
pointer-events: none;
|
|
888
|
+
opacity: 0;
|
|
889
|
+
transition: opacity 0.12s ease;
|
|
890
|
+
}
|
|
891
|
+
.tooltip[data-show] { opacity: 1; }
|
|
892
|
+
.info-dot {
|
|
893
|
+
display: inline-flex;
|
|
894
|
+
align-items: center;
|
|
895
|
+
justify-content: center;
|
|
896
|
+
width: 15px;
|
|
897
|
+
height: 15px;
|
|
898
|
+
border-radius: 50%;
|
|
899
|
+
border: 1px solid var(--border-strong);
|
|
900
|
+
background: var(--surface-2);
|
|
901
|
+
color: var(--text-muted);
|
|
902
|
+
font-family: var(--font-mono);
|
|
903
|
+
font-size: 10px;
|
|
904
|
+
font-weight: 700;
|
|
905
|
+
cursor: help;
|
|
906
|
+
flex-shrink: 0;
|
|
907
|
+
vertical-align: middle;
|
|
908
|
+
}
|
|
909
|
+
.info-dot:hover, .info-dot:focus-visible { color: var(--brand); border-color: var(--brand); }
|
|
910
|
+
|
|
911
|
+
.popover {
|
|
912
|
+
position: fixed;
|
|
913
|
+
top: 54px;
|
|
914
|
+
right: 14px;
|
|
915
|
+
z-index: 50;
|
|
916
|
+
width: 320px;
|
|
917
|
+
max-width: calc(100vw - 28px);
|
|
918
|
+
max-height: calc(100vh - 70px);
|
|
919
|
+
overflow-y: auto;
|
|
920
|
+
background: var(--surface-1);
|
|
921
|
+
border: 1px solid var(--border-strong);
|
|
922
|
+
border-radius: var(--radius-card);
|
|
923
|
+
box-shadow: var(--shadow);
|
|
924
|
+
backdrop-filter: blur(14px);
|
|
925
|
+
-webkit-backdrop-filter: blur(14px);
|
|
926
|
+
padding: 14px 14px 16px;
|
|
927
|
+
}
|
|
928
|
+
.popover[hidden] { display: none; }
|
|
929
|
+
.popover-section { margin-bottom: 16px; }
|
|
930
|
+
.popover-section:last-child { margin-bottom: 0; }
|
|
931
|
+
.popover-section > .eyebrow { display: block; margin-bottom: 8px; }
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
.weakspot { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); margin-bottom: 6px; overflow: hidden; transition: border-color 0.3s ease; }
|
|
935
|
+
.weakspot:last-child { margin-bottom: 0; }
|
|
936
|
+
.weakspot[open] { border-color: var(--border-strong); }
|
|
937
|
+
.weakspot-summary { display: flex; align-items: center; gap: 7px; padding: 6px 9px; cursor: pointer; list-style: none; }
|
|
938
|
+
.weakspot-summary::-webkit-details-marker { display: none; }
|
|
939
|
+
.weakspot-summary:hover { background: var(--surface-hover); }
|
|
940
|
+
.weakspot-sev { flex: 0 0 auto; padding: 1px 5px; font-size: 10px; }
|
|
941
|
+
.weakspot-sample { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-primary); overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
942
|
+
.weakspot-tail { flex: 0 0 auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); white-space: nowrap; }
|
|
943
|
+
.weakspot-body { padding: 8px 10px 10px; border-top: 1px dashed var(--border); }
|
|
944
|
+
.weakspot-reason { font-size: 11px; color: var(--text-secondary); margin: 0 0 6px; }
|
|
945
|
+
.weakspot-kv { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin: 0 0 8px; overflow-wrap: anywhere; }
|
|
946
|
+
.empty-note { font-size: 11.5px; color: var(--text-muted); font-style: italic; }
|
|
947
|
+
.empty-note-ok { font-size: 11.5px; color: var(--text-muted); font-style: normal; margin: 0; }
|
|
948
|
+
.empty-note-ok .ok-check { color: var(--brand); font-weight: 700; margin-right: 4px; }
|
|
949
|
+
|
|
950
|
+
.rail-section-headrow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
|
|
951
|
+
.rail-collapsible.is-collapsed > .rail-section-headrow { margin-bottom: 0; }
|
|
952
|
+
.rail-section-head {
|
|
953
|
+
display: flex; align-items: baseline; gap: 8px;
|
|
954
|
+
flex: 1 1 auto; min-width: 0;
|
|
955
|
+
background: none; border: 0; padding: 0; margin: 0;
|
|
956
|
+
font: inherit; color: inherit; text-align: left; cursor: pointer;
|
|
957
|
+
}
|
|
958
|
+
.rail-section-head::before {
|
|
959
|
+
content: "\25B8";
|
|
960
|
+
flex: 0 0 auto;
|
|
961
|
+
color: var(--text-muted);
|
|
962
|
+
font-size: 10px;
|
|
963
|
+
line-height: 1;
|
|
964
|
+
transition: transform 0.12s ease;
|
|
965
|
+
}
|
|
966
|
+
.rail-section-head[aria-expanded="true"]::before { transform: rotate(90deg); }
|
|
967
|
+
.rail-section-head > .eyebrow { flex: 0 0 auto; margin-bottom: 0; }
|
|
968
|
+
.rail-section-count {
|
|
969
|
+
flex: 1 1 auto;
|
|
970
|
+
min-width: 0;
|
|
971
|
+
font-family: var(--font-mono);
|
|
972
|
+
font-size: 10.5px;
|
|
973
|
+
color: var(--text-muted);
|
|
974
|
+
white-space: nowrap;
|
|
975
|
+
overflow: hidden;
|
|
976
|
+
text-overflow: ellipsis;
|
|
977
|
+
}
|
|
978
|
+
.rail-section-count:empty { display: none; }
|
|
979
|
+
.rail-collapsible.is-collapsed > :not(.rail-section-headrow) { display: none; }
|
|
980
|
+
|
|
981
|
+
.weakspots-section.is-empty { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
|
|
982
|
+
.weakspots-section.is-empty > .rail-section-headrow { margin-bottom: 0; }
|
|
983
|
+
.weakspots-section.is-empty #weakspots-list { margin-top: 0 !important; flex: 1 1 auto; min-width: 0; }
|
|
984
|
+
.weakspots-section.is-empty.is-collapsed > #weakspots-list { display: block; }
|
|
985
|
+
.rail-right.weakspots-hidden #weakspots-section,
|
|
986
|
+
.rail-right.weakspots-hidden .rail-right-scroll { display: none; }
|
|
987
|
+
.rail-right.weakspots-quiet .rail-right-pin { max-height: none; flex: 1 1 auto; min-height: 0; }
|
|
988
|
+
.rail-right.weakspots-quiet .rail-right-scroll { flex: 0 0 auto; overflow-y: visible; padding-bottom: 12px; }
|
|
989
|
+
.rail-right.inspector-section-collapsed .rail-right-pin { flex: 0 0 auto; max-height: none; }
|
|
990
|
+
@media (max-width: 980px) {
|
|
991
|
+
.rail-right.weakspots-quiet .rail-right-pin { flex: 0 0 auto; }
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
.mini-btn { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; border: 1px solid var(--border-strong); color: var(--text-secondary); background: var(--surface-2); border-radius: 5px; padding: 4px 8px; cursor: pointer; transition: background-color 0.3s ease, border-color 0.3s ease; }
|
|
996
|
+
.mini-btn:hover { background: var(--surface-hover); }
|
|
997
|
+
|
|
998
|
+
details > summary { cursor: pointer; list-style: none; }
|
|
999
|
+
details > summary::-webkit-details-marker { display: none; }
|
|
1000
|
+
.details-summary { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
|
|
1001
|
+
.details-summary::before { content: "\25B8"; color: var(--text-muted); font-size: 10px; display: inline-block; transition: transform 0.12s ease; }
|
|
1002
|
+
details[open] > .details-summary::before { transform: rotate(90deg); }
|
|
1003
|
+
.chain-extra { margin-top: 2px; }
|
|
1004
|
+
.chain-extra > summary { font-size: 10.5px; color: var(--brand); font-style: italic; padding: 3px 0 3px 22px; }
|
|
1005
|
+
.chain-extra > summary::before { content: "\FF0B "; font-style: normal; }
|
|
1006
|
+
.chain-extra[open] > summary::before { content: "\FF0D "; }
|
|
1007
|
+
|
|
1008
|
+
.pill {
|
|
1009
|
+
display: inline-flex;
|
|
1010
|
+
align-items: center;
|
|
1011
|
+
gap: 4px;
|
|
1012
|
+
font-family: var(--font-mono);
|
|
1013
|
+
font-size: 10px;
|
|
1014
|
+
font-weight: 700;
|
|
1015
|
+
letter-spacing: 0.04em;
|
|
1016
|
+
text-transform: uppercase;
|
|
1017
|
+
border-radius: 999px;
|
|
1018
|
+
padding: 2px 7px;
|
|
1019
|
+
flex-shrink: 0;
|
|
1020
|
+
}
|
|
1021
|
+
.pill-leak { background: var(--status-leak-soft); color: var(--status-leak); }
|
|
1022
|
+
.pill-propertyName { background: var(--status-property-soft); color: var(--status-property); }
|
|
1023
|
+
.pill-weak { background: var(--status-weak-soft); color: var(--status-weak); }
|
|
1024
|
+
|
|
1025
|
+
.inspector-section {
|
|
1026
|
+
background: var(--surface-1);
|
|
1027
|
+
border: 1px solid var(--border);
|
|
1028
|
+
border-radius: var(--radius-card);
|
|
1029
|
+
padding: 10px 12px;
|
|
1030
|
+
margin-bottom: 12px;
|
|
1031
|
+
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
|
1032
|
+
}
|
|
1033
|
+
.inspector-section:last-child { margin-bottom: 0; }
|
|
1034
|
+
.inspector-section h3 { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
|
|
1035
|
+
.inspector-empty { font-size: 12px; color: var(--text-muted); }
|
|
1036
|
+
|
|
1037
|
+
.insp { display: flex; flex-direction: column; gap: 8px; }
|
|
1038
|
+
.insp-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 9px 11px; }
|
|
1039
|
+
.insp-ident { display: flex; align-items: center; gap: 6px; height: 22px; min-width: 0; }
|
|
1040
|
+
.insp-ident .class-chip, .insp-ident .tier-pill { min-width: 0; overflow: hidden; }
|
|
1041
|
+
.insp-ident .class-chip { flex: 0 1 auto; }
|
|
1042
|
+
.insp-flags { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
|
|
1043
|
+
.insp-flag {
|
|
1044
|
+
display: inline-flex;
|
|
1045
|
+
align-items: center;
|
|
1046
|
+
justify-content: center;
|
|
1047
|
+
min-width: 17px;
|
|
1048
|
+
height: 17px;
|
|
1049
|
+
padding: 0 4px;
|
|
1050
|
+
border: 1px solid;
|
|
1051
|
+
border-radius: 4px;
|
|
1052
|
+
font-family: var(--font-mono);
|
|
1053
|
+
font-size: 9.5px;
|
|
1054
|
+
font-weight: 700;
|
|
1055
|
+
line-height: 1;
|
|
1056
|
+
cursor: help;
|
|
1057
|
+
}
|
|
1058
|
+
.insp-flag[data-kind="warn"] { color: var(--status-property); border-color: var(--status-property); background: var(--status-property-soft); }
|
|
1059
|
+
.insp-flag[data-kind="leak"] { color: var(--status-leak); border-color: var(--status-leak); background: var(--status-leak-soft); }
|
|
1060
|
+
.insp-flag[data-kind="dir"] { color: var(--brand); border-color: var(--brand); }
|
|
1061
|
+
.insp-flag[data-kind="info"] { color: var(--text-muted); border-color: var(--border-strong); }
|
|
1062
|
+
.insp-score { flex: 0 0 auto; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); }
|
|
1063
|
+
.insp-score small { font-size: 10px; font-weight: 700; color: var(--text-muted); }
|
|
1064
|
+
.insp-meter { margin: 7px 0 7px; }
|
|
1065
|
+
.insp-meter.is-blank { visibility: hidden; }
|
|
1066
|
+
.insp-where { height: 16px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1067
|
+
.insp-facts { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
|
|
1068
|
+
.insp-fact { display: flex; align-items: center; gap: 10px; height: 19px; }
|
|
1069
|
+
.insp-fact > .k { flex: 0 0 auto; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
|
|
1070
|
+
.insp-fact[data-tip] > .k { border-bottom: 1px dotted var(--border-strong); cursor: help; }
|
|
1071
|
+
.insp-fact > .v { flex: 1 1 auto; min-width: 0; text-align: right; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1072
|
+
.insp-fact > .v.is-dim { color: var(--text-muted); font-weight: 400; }
|
|
1073
|
+
.insp-fact > .v.is-warn { color: var(--status-leak); }
|
|
1074
|
+
.insp-fact .class-chip { font-size: 9.5px; padding: 1px 6px; vertical-align: middle; }
|
|
1075
|
+
.insp-fact.is-pad { visibility: hidden; }
|
|
1076
|
+
.insp-actions { display: flex; align-items: center; gap: 6px; height: 27px; overflow: hidden; margin-top: 8px; }
|
|
1077
|
+
.insp-chain { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 7px 11px; }
|
|
1078
|
+
.insp-chain > summary { height: 18px; }
|
|
1079
|
+
.insp-chain[open] > .details-summary { margin-bottom: 8px; }
|
|
1080
|
+
.insp-chain .chain-step:last-of-type .chain-body { padding-bottom: 0; }
|
|
1081
|
+
.insp-note { font-size: 11px; color: var(--text-secondary); }
|
|
1082
|
+
.insp-title { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
|
|
1083
|
+
.insp-hint { font-size: 11px; color: var(--text-muted); font-style: italic; }
|
|
1084
|
+
.insp-chain .inspector-section { background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0; }
|
|
1085
|
+
.insp-chain .inspector-section > h3 { display: none; }
|
|
1086
|
+
|
|
1087
|
+
.file-band { display: flex; flex-direction: column; gap: 2px; }
|
|
1088
|
+
.fb-row { display: flex; align-items: center; gap: 10px; height: 19px; }
|
|
1089
|
+
.fb-row > .k { flex: 0 0 auto; font-size: 11.5px; color: var(--text-secondary); border-bottom: 1px dotted var(--border-strong); cursor: help; }
|
|
1090
|
+
.fb-row > .v { flex: 1 1 auto; min-width: 0; text-align: right; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1091
|
+
.fb-row > .v.is-warn { color: var(--status-leak); }
|
|
1092
|
+
.fb-row .class-chip { font-size: 9.5px; padding: 1px 6px; }
|
|
1093
|
+
.file-band-section { margin-bottom: 12px; }
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
.chain { display: flex; flex-direction: column; }
|
|
1097
|
+
.chain-step { display: flex; gap: 10px; }
|
|
1098
|
+
.chain-rail { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; width: 12px; }
|
|
1099
|
+
.chain-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: var(--brand); box-shadow: 0 0 0 3px var(--surface-1); flex: 0 0 auto; }
|
|
1100
|
+
.chain-line { flex: 1 1 auto; width: 2px; background: var(--border-strong); min-height: 8px; }
|
|
1101
|
+
.chain-step:last-of-type .chain-line { display: none; }
|
|
1102
|
+
.chain-body { flex: 1 1 auto; min-width: 0; padding-bottom: 10px; }
|
|
1103
|
+
.chain-step:last-of-type .chain-body { padding-bottom: 0; }
|
|
1104
|
+
.chain-head { display: flex; align-items: baseline; gap: 6px; }
|
|
1105
|
+
.chain-transform { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
|
|
1106
|
+
.chain-count { color: var(--brand); font-weight: 700; font-family: var(--font-mono); font-size: 11px; }
|
|
1107
|
+
.chain-delta { margin-left: auto; color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
|
|
1108
|
+
.chain-caption { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.02em; margin-top: 1px; }
|
|
1109
|
+
.chain-more { margin-top: 6px; font-size: 10.5px; color: var(--text-muted); font-style: italic; padding-left: 22px; }
|
|
1110
|
+
.chip {
|
|
1111
|
+
font-family: var(--font-mono);
|
|
1112
|
+
font-size: 9.5px;
|
|
1113
|
+
font-weight: 700;
|
|
1114
|
+
text-transform: uppercase;
|
|
1115
|
+
letter-spacing: 0.03em;
|
|
1116
|
+
background: var(--surface-3);
|
|
1117
|
+
color: var(--text-secondary);
|
|
1118
|
+
border-radius: 4px;
|
|
1119
|
+
padding: 1px 5px;
|
|
1120
|
+
flex: 0 0 auto;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
.copy-btn-pro { border-color: var(--brand); color: var(--brand); }
|
|
1125
|
+
.copy-btn-pro:hover { background: var(--surface-2); }
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
@media (max-width: 980px) { .app-shell { overflow: visible; } }
|
|
1129
|
+
|
|
1130
|
+
::selection { background: rgba(234, 174, 61, 0.3); color: #0a0a0a; }
|
|
1131
|
+
|
|
1132
|
+
.rail-left, .rail-right, .code-body { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
|
|
1133
|
+
::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
1134
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
1135
|
+
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 9999px; }
|
|
1136
|
+
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
|
|
1137
|
+
</style>
|
|
1138
|
+
</head>
|
|
1139
|
+
<body>
|
|
1140
|
+
<div class="app-shell" id="app">
|
|
1141
|
+
|
|
1142
|
+
<header class="topbar">
|
|
1143
|
+
<div class="top-btn-pair" role="group" aria-label="Show or hide the side panels">
|
|
1144
|
+
<button type="button" class="top-btn top-btn-icon" id="rail-toggle" aria-pressed="false" aria-controls="file-tree" title="Hide the file tree" aria-label="Hide the file tree">
|
|
1145
|
+
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false">
|
|
1146
|
+
<rect x="1.6" y="2.6" width="12.8" height="10.8" rx="2" stroke="currentColor" stroke-width="1.3"/>
|
|
1147
|
+
<path d="M5.9 2.6v10.8" stroke="currentColor" stroke-width="1.3"/>
|
|
1148
|
+
<path d="M2.25 3.25h3.65v9.5H2.25z" fill="currentColor" opacity="0.34"/>
|
|
1149
|
+
</svg>
|
|
1150
|
+
</button>
|
|
1151
|
+
<button type="button" class="top-btn top-btn-icon" id="inspector-toggle" aria-pressed="false" aria-controls="inspector" title="Hide the inspector panel" aria-label="Hide the inspector panel">
|
|
1152
|
+
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false">
|
|
1153
|
+
<rect x="1.6" y="2.6" width="12.8" height="10.8" rx="2" stroke="currentColor" stroke-width="1.3"/>
|
|
1154
|
+
<path d="M10.1 2.6v10.8" stroke="currentColor" stroke-width="1.3"/>
|
|
1155
|
+
<path d="M10.1 3.25h3.65v9.5H10.1z" fill="currentColor" opacity="0.34"/>
|
|
1156
|
+
</svg>
|
|
1157
|
+
</button>
|
|
1158
|
+
</div>
|
|
1159
|
+
<h1>Protection Map</h1>
|
|
1160
|
+
<span class="tag-size" id="map-size" tabindex="0" role="note" data-tip="Measuring…">— </span>
|
|
1161
|
+
<div class="spacer"></div>
|
|
1162
|
+
<button type="button" class="top-btn" id="legend-toggle" aria-expanded="false" aria-controls="build-popover"><span class="top-btn-glyph" aria-hidden="true">ⓘ</span> Legend & build</button>
|
|
1163
|
+
<button type="button" class="theme-toggle" id="theme-toggle" aria-label="Toggle color theme">🌙 Dark</button>
|
|
1164
|
+
<a class="brand-logo" id="brand-logo" target="_blank" rel="noopener noreferrer" aria-label="AfterPack — open afterpack.dev in a new tab">
|
|
1165
|
+
<svg width="152" height="34" viewBox="0 0 152 34" fill="none" aria-hidden="true" focusable="false">
|
|
1166
|
+
<path d="M16 9C19.0485 9 22 11.6656 22 15C22 18.3344 19.0485 21 16 21H15.0215L12 27H8L12.9824 16.9912L12.9873 16.9805H16.2236C17.1084 16.8441 18 15.9356 18 15C18 13.9852 16.9515 13 16 13H15L13 9H16Z" fill="url(#paint0_linear_30_314)"/>
|
|
1167
|
+
<path d="M16 9.25C18.9181 9.25 21.75 11.8113 21.75 15C21.75 18.1887 18.9181 20.75 16 20.75H15.0215C14.9508 20.75 14.8845 20.7797 14.8379 20.8301L14.7979 20.8877L11.8457 26.75H8.40332L13.1426 17.2305H16.2236C16.2364 17.2305 16.2491 17.2295 16.2617 17.2275C16.77 17.1492 17.2628 16.8542 17.627 16.46C17.9913 16.0654 18.25 15.5461 18.25 15C18.25 14.4082 17.9464 13.847 17.5312 13.4404C17.1168 13.0348 16.5575 12.75 16 12.75H15.1543L13.4043 9.25H16Z" stroke="black" stroke-opacity="0.1" stroke-width="0.5" stroke-linejoin="round"/>
|
|
1168
|
+
<path d="M11 9L13 13L6 27H2L11 9Z" fill="url(#paint1_linear_30_314)"/>
|
|
1169
|
+
<path d="M22 27H18L16 23C16 23.003 15.9986 22.9972 16 23H16.5009C17.5772 22.9998 18.6408 22.6657 19.5673 22.0889L22 27Z" fill="url(#paint2_linear_30_314)"/>
|
|
1170
|
+
<path d="M21.5977 26.75H18.1543L16.4043 23.25H16.501C17.5376 23.2498 18.5559 22.9502 19.4609 22.4375L21.5977 26.75ZM12.7207 13L5.8457 26.75H2.4043L11 9.55859L12.7207 13Z" stroke="black" stroke-opacity="0.1" stroke-width="0.5" stroke-linejoin="round"/>
|
|
1171
|
+
<mask id="path-5-inside-1_30_314" fill="white">
|
|
1172
|
+
<path d="M115.183 13.0723C117.014 13.0723 118.418 13.471 119.395 14.2686C120.371 15.0661 120.859 16.2789 120.859 17.9062V27H118.259L117.539 25.1445H117.441C116.752 26.0057 115.921 26.7252 114.841 27.0244C113.539 27.385 111.969 27.3716 110.739 26.7803C110.105 26.4711 109.604 25.9989 109.238 25.3643C108.872 24.7214 108.688 23.9076 108.688 22.9229C108.688 21.4743 109.198 20.4082 110.215 19.7246C112.195 18.378 114.865 18.5749 117.16 18.5039C117.16 17.7501 117.215 16.8806 116.599 16.3311C115.216 15.0992 112.607 16.1842 111.191 16.8193L109.958 14.3047C111.553 13.4622 113.385 13.0723 115.183 13.0723ZM127.072 13.8408C129.417 12.6874 132.5 12.8809 134.824 14.0244L133.726 16.9053C132.318 16.3385 130.349 15.5619 128.952 16.5635C128.521 16.8646 128.2 17.3204 127.988 17.9307C127.405 19.6134 127.326 22.6638 129.001 23.8018C130.592 24.8524 132.969 23.9831 134.396 23.0449V26.2314C133.139 27.0219 131.71 27.2441 130.246 27.2441C128.895 27.2441 127.744 26.9999 126.792 26.5117C125.84 26.0153 125.116 25.2502 124.619 24.2168C123.512 21.9107 123.505 18.4382 124.717 16.1729C125.286 15.1149 126.071 14.3372 127.072 13.8408ZM99.8877 9.15332C102.191 9.15339 103.871 9.64981 104.929 10.6426C107.1 12.6637 107.05 16.7479 105.002 18.8584C104.473 19.4117 103.765 19.8513 102.878 20.1768C101.306 20.7391 99.6136 20.6523 97.9707 20.6523V27H94.1865V9.15332H99.8877ZM141.294 8.00586C141.294 11.8614 141.465 15.735 141.099 19.5781C142.037 19.5761 146.14 13.8435 146.592 13.3525H150.791L145.371 19.2734L151.12 27H146.823L142.893 21.4707L141.294 22.752V27H137.57V8.00586H141.294ZM117.16 20.6768C115.91 20.7191 114.217 20.5182 113.205 21.373C112.487 21.991 112.122 23.5181 113.01 24.168C113.969 24.8461 115.495 24.5373 116.33 23.8145C117.269 23.0134 117.16 21.7908 117.16 20.6768ZM97.9707 17.5518C99.0025 17.5518 100.072 17.6264 101.06 17.2715C101.58 17.0844 101.983 16.7911 102.268 16.3926C102.953 15.4326 102.872 13.6902 101.963 12.9014C101.475 12.4701 100.718 12.254 99.6924 12.2539H97.9707V17.5518Z"/>
|
|
1173
|
+
</mask>
|
|
1174
|
+
<path d="M115.183 13.0723C117.014 13.0723 118.418 13.471 119.395 14.2686C120.371 15.0661 120.859 16.2789 120.859 17.9062V27H118.259L117.539 25.1445H117.441C116.752 26.0057 115.921 26.7252 114.841 27.0244C113.539 27.385 111.969 27.3716 110.739 26.7803C110.105 26.4711 109.604 25.9989 109.238 25.3643C108.872 24.7214 108.688 23.9076 108.688 22.9229C108.688 21.4743 109.198 20.4082 110.215 19.7246C112.195 18.378 114.865 18.5749 117.16 18.5039C117.16 17.7501 117.215 16.8806 116.599 16.3311C115.216 15.0992 112.607 16.1842 111.191 16.8193L109.958 14.3047C111.553 13.4622 113.385 13.0723 115.183 13.0723ZM127.072 13.8408C129.417 12.6874 132.5 12.8809 134.824 14.0244L133.726 16.9053C132.318 16.3385 130.349 15.5619 128.952 16.5635C128.521 16.8646 128.2 17.3204 127.988 17.9307C127.405 19.6134 127.326 22.6638 129.001 23.8018C130.592 24.8524 132.969 23.9831 134.396 23.0449V26.2314C133.139 27.0219 131.71 27.2441 130.246 27.2441C128.895 27.2441 127.744 26.9999 126.792 26.5117C125.84 26.0153 125.116 25.2502 124.619 24.2168C123.512 21.9107 123.505 18.4382 124.717 16.1729C125.286 15.1149 126.071 14.3372 127.072 13.8408ZM99.8877 9.15332C102.191 9.15339 103.871 9.64981 104.929 10.6426C107.1 12.6637 107.05 16.7479 105.002 18.8584C104.473 19.4117 103.765 19.8513 102.878 20.1768C101.306 20.7391 99.6136 20.6523 97.9707 20.6523V27H94.1865V9.15332H99.8877ZM141.294 8.00586C141.294 11.8614 141.465 15.735 141.099 19.5781C142.037 19.5761 146.14 13.8435 146.592 13.3525H150.791L145.371 19.2734L151.12 27H146.823L142.893 21.4707L141.294 22.752V27H137.57V8.00586H141.294ZM117.16 20.6768C115.91 20.7191 114.217 20.5182 113.205 21.373C112.487 21.991 112.122 23.5181 113.01 24.168C113.969 24.8461 115.495 24.5373 116.33 23.8145C117.269 23.0134 117.16 21.7908 117.16 20.6768ZM97.9707 17.5518C99.0025 17.5518 100.072 17.6264 101.06 17.2715C101.58 17.0844 101.983 16.7911 102.268 16.3926C102.953 15.4326 102.872 13.6902 101.963 12.9014C101.475 12.4701 100.718 12.254 99.6924 12.2539H97.9707V17.5518Z" fill="url(#paint3_linear_30_314)"/>
|
|
1175
|
+
<path d="M119.395 14.2686L119.711 13.8813L119.711 13.8813L119.395 14.2686ZM120.859 27V27.5C121.136 27.5 121.359 27.2761 121.359 27H120.859ZM118.259 27L117.793 27.1808C117.867 27.3732 118.052 27.5 118.259 27.5V27ZM117.539 25.1445L118.005 24.9637C117.931 24.7713 117.745 24.6445 117.539 24.6445V25.1445ZM117.441 25.1445V24.6445C117.29 24.6445 117.146 24.7136 117.051 24.8322L117.441 25.1445ZM114.841 27.0244L114.974 27.5063V27.5063L114.841 27.0244ZM110.739 26.7803L110.52 27.2298L110.523 27.2309L110.739 26.7803ZM109.238 25.3643L108.804 25.6117L108.805 25.6141L109.238 25.3643ZM108.688 22.9229H108.188V22.9229H108.688ZM110.215 19.7246L110.494 20.1396L110.496 20.1381L110.215 19.7246ZM117.16 18.5039L117.176 19.0037C117.446 18.9953 117.66 18.774 117.66 18.5039H117.16ZM116.599 16.3311L116.931 15.9578V15.9578L116.599 16.3311ZM111.191 16.8193L110.742 17.0395C110.861 17.2815 111.15 17.3858 111.396 17.2755L111.191 16.8193ZM109.958 14.3047L109.725 13.8626C109.485 13.9888 109.39 14.2822 109.509 14.5249L109.958 14.3047ZM127.072 13.8408L126.852 13.3922L126.85 13.3929L127.072 13.8408ZM134.824 14.0244L135.291 14.2026C135.383 13.9614 135.277 13.6898 135.045 13.5758L134.824 14.0244ZM133.726 16.9053L133.539 17.3691C133.663 17.4192 133.803 17.4172 133.926 17.3635C134.049 17.3098 134.145 17.2088 134.193 17.0834L133.726 16.9053ZM128.952 16.5635L129.238 16.9735L129.243 16.9698L128.952 16.5635ZM127.988 17.9307L127.516 17.7669L127.516 17.7669L127.988 17.9307ZM129.001 23.8018L128.72 24.2154L128.725 24.219L129.001 23.8018ZM134.396 23.0449H134.896C134.896 22.8611 134.796 22.6921 134.634 22.6049C134.472 22.5176 134.276 22.5261 134.122 22.6271L134.396 23.0449ZM134.396 26.2314L134.663 26.6548C134.808 26.5633 134.896 26.4034 134.896 26.2314H134.396ZM126.792 26.5117L126.561 26.9551L126.564 26.9566L126.792 26.5117ZM124.619 24.2168L124.168 24.4333L124.168 24.4333L124.619 24.2168ZM124.717 16.1729L124.277 15.9358L124.276 15.937L124.717 16.1729ZM99.8877 9.15332L99.8877 8.65332H99.8877V9.15332ZM104.929 10.6426L104.587 11.0072L104.588 11.0086L104.929 10.6426ZM105.002 18.8584L104.643 18.5102L104.641 18.5129L105.002 18.8584ZM102.878 20.1768L103.046 20.6476L103.05 20.6461L102.878 20.1768ZM97.9707 20.6523V20.1523C97.6946 20.1523 97.4707 20.3762 97.4707 20.6523H97.9707ZM97.9707 27V27.5C98.2468 27.5 98.4707 27.2761 98.4707 27H97.9707ZM94.1865 27H93.6865C93.6865 27.2761 93.9104 27.5 94.1865 27.5V27ZM94.1865 9.15332V8.65332C93.9104 8.65332 93.6865 8.87718 93.6865 9.15332H94.1865ZM141.294 8.00586H141.794C141.794 7.72972 141.57 7.50586 141.294 7.50586V8.00586ZM141.099 19.5781L140.601 19.5307C140.588 19.6711 140.634 19.8106 140.729 19.9149C140.824 20.0191 140.959 20.0784 141.1 20.0781L141.099 19.5781ZM146.592 13.3525V12.8525C146.452 12.8525 146.319 12.9111 146.224 13.0139L146.592 13.3525ZM150.791 13.3525L151.16 13.6901C151.294 13.5439 151.328 13.3325 151.249 13.151C151.169 12.9696 150.989 12.8525 150.791 12.8525V13.3525ZM145.371 19.2734L145.002 18.9358C144.84 19.1127 144.827 19.3796 144.97 19.5719L145.371 19.2734ZM151.12 27V27.5C151.309 27.5 151.482 27.3934 151.567 27.2245C151.652 27.0555 151.634 26.8532 151.521 26.7015L151.12 27ZM146.823 27L146.416 27.2897C146.51 27.4216 146.661 27.5 146.823 27.5V27ZM142.893 21.4707L143.3 21.181C143.22 21.0688 143.098 20.9945 142.962 20.9755C142.825 20.9565 142.687 20.9945 142.58 21.0805L142.893 21.4707ZM141.294 22.752L140.981 22.3618C140.863 22.4567 140.794 22.6002 140.794 22.752H141.294ZM141.294 27V27.5C141.57 27.5 141.794 27.2761 141.794 27H141.294ZM137.57 27H137.07C137.07 27.2761 137.294 27.5 137.57 27.5V27ZM137.57 8.00586V7.50586C137.294 7.50586 137.07 7.72972 137.07 8.00586H137.57ZM117.16 20.6768H117.66C117.66 20.5412 117.605 20.4115 117.508 20.3173C117.41 20.2231 117.279 20.1725 117.143 20.177L117.16 20.6768ZM113.205 21.373L112.882 20.9911L112.879 20.994L113.205 21.373ZM113.01 24.168L112.714 24.5715L112.721 24.5762L113.01 24.168ZM116.33 23.8145L116.006 23.434L116.003 23.4364L116.33 23.8145ZM97.9707 17.5518H97.4707C97.4707 17.8279 97.6946 18.0518 97.9707 18.0518V17.5518ZM101.06 17.2715L101.229 17.742L101.229 17.742L101.06 17.2715ZM102.268 16.3926L102.674 16.6833L102.674 16.6832L102.268 16.3926ZM101.963 12.9014L101.632 13.2761L101.635 13.2791L101.963 12.9014ZM99.6924 12.2539L99.6924 11.7539H99.6924V12.2539ZM97.9707 12.2539V11.7539C97.6946 11.7539 97.4707 11.9778 97.4707 12.2539H97.9707ZM115.183 13.0723V13.5723C116.949 13.5723 118.224 13.9579 119.078 14.6558L119.395 14.2686L119.711 13.8813C118.612 12.9842 117.078 12.5723 115.183 12.5723V13.0723ZM119.395 14.2686L119.078 14.6558C119.906 15.3321 120.359 16.382 120.359 17.9062H120.859H121.359C121.359 16.1759 120.835 14.8001 119.711 13.8813L119.395 14.2686ZM120.859 17.9062H120.359V27H120.859H121.359V17.9062H120.859ZM120.859 27V26.5H118.259V27V27.5H120.859V27ZM118.259 27L118.725 26.8192L118.005 24.9637L117.539 25.1445L117.073 25.3254L117.793 27.1808L118.259 27ZM117.539 25.1445V24.6445H117.441V25.1445V25.6445H117.539V25.1445ZM117.441 25.1445L117.051 24.8322C116.396 25.6504 115.647 26.2823 114.707 26.5425L114.841 27.0244L114.974 27.5063C116.196 27.168 117.109 26.361 117.832 25.4569L117.441 25.1445ZM114.841 27.0244L114.707 26.5425C113.49 26.8796 112.05 26.8559 110.956 26.3297L110.739 26.7803L110.523 27.2309C111.887 27.8874 113.587 27.8904 114.974 27.5063L114.841 27.0244ZM110.739 26.7803L110.958 26.3308C110.417 26.0671 109.99 25.6663 109.671 25.1144L109.238 25.3643L108.805 25.6141C109.219 26.3316 109.792 26.8751 110.52 27.2298L110.739 26.7803ZM109.238 25.3643L109.673 25.1168C109.361 24.5701 109.188 23.8483 109.188 22.9229H108.688H108.188C108.188 23.9668 108.383 24.8727 108.804 25.6117L109.238 25.3643ZM108.688 22.9229H109.188C109.188 21.606 109.641 20.7125 110.494 20.1396L110.215 19.7246L109.936 19.3096C108.754 20.1039 108.188 21.3425 108.188 22.9229H108.688ZM110.215 19.7246L110.496 20.1381C111.39 19.5302 112.46 19.2569 113.623 19.1331C114.8 19.0077 115.989 19.0404 117.176 19.0037L117.16 18.5039L117.145 18.0041C116.037 18.0384 114.743 18.0082 113.517 18.1387C112.275 18.2709 111.02 18.5724 109.934 19.3111L110.215 19.7246ZM117.16 18.5039H117.66C117.66 18.1538 117.676 17.6913 117.604 17.2588C117.529 16.8097 117.353 16.3335 116.931 15.9578L116.599 16.3311L116.266 16.7043C116.461 16.8782 116.566 17.1115 116.617 17.423C116.672 17.751 116.66 18.1002 116.66 18.5039H117.16ZM116.599 16.3311L116.931 15.9578C116.059 15.1804 114.856 15.1794 113.811 15.3844C112.748 15.5931 111.695 16.0451 110.987 16.3632L111.191 16.8193L111.396 17.2755C112.103 16.9584 113.063 16.5503 114.004 16.3657C114.964 16.1774 115.756 16.2498 116.266 16.7043L116.599 16.3311ZM111.191 16.8193L111.64 16.5992L110.407 14.0845L109.958 14.3047L109.509 14.5249L110.742 17.0395L111.191 16.8193ZM109.958 14.3047L110.191 14.7468C111.705 13.9476 113.455 13.5723 115.183 13.5723V13.0723V12.5723C113.316 12.5723 111.402 12.9768 109.725 13.8626L109.958 14.3047ZM127.072 13.8408L127.293 14.2895C129.476 13.2155 132.395 13.3863 134.603 14.473L134.824 14.0244L135.045 13.5758C132.606 12.3756 129.358 12.1593 126.852 13.3922L127.072 13.8408ZM134.824 14.0244L134.357 13.8463L133.258 16.7271L133.726 16.9053L134.193 17.0834L135.291 14.2026L134.824 14.0244ZM133.726 16.9053L133.912 16.4415C133.216 16.1608 132.322 15.8031 131.417 15.653C130.508 15.5022 129.511 15.5476 128.661 16.1571L128.952 16.5635L129.243 16.9698C129.79 16.5778 130.476 16.5107 131.253 16.6395C132.034 16.7689 132.828 17.0829 133.539 17.3691L133.726 16.9053ZM128.952 16.5635L128.666 16.1535C128.13 16.5278 127.754 17.0803 127.516 17.7669L127.988 17.9307L128.461 18.0944C128.646 17.5605 128.912 17.2014 129.238 16.9734L128.952 16.5635ZM127.988 17.9307L127.516 17.7669C127.201 18.6763 127.026 19.9332 127.15 21.1225C127.273 22.299 127.704 23.5252 128.72 24.2154L129.001 23.8018L129.282 23.3881C128.623 22.9403 128.255 22.0724 128.145 21.0185C128.036 19.9774 128.193 18.8677 128.461 18.0944L127.988 17.9307ZM129.001 23.8018L128.725 24.219C129.675 24.8463 130.821 24.8764 131.862 24.6586C132.908 24.4398 133.917 23.9584 134.671 23.4628L134.396 23.0449L134.122 22.6271C133.448 23.0696 132.555 23.492 131.658 23.6798C130.755 23.8685 129.918 23.8079 129.277 23.3845L129.001 23.8018ZM134.396 23.0449H133.896V26.2314H134.396H134.896V23.0449H134.396ZM134.396 26.2314L134.13 25.8081C132.985 26.5278 131.664 26.7441 130.246 26.7441V27.2441V27.7441C131.756 27.7441 133.292 27.5159 134.663 26.6548L134.396 26.2314ZM130.246 27.2441V26.7441C128.954 26.7441 127.886 26.5105 127.02 26.0668L126.792 26.5117L126.564 26.9566C127.603 27.4892 128.836 27.7441 130.246 27.7441V27.2441ZM126.792 26.5117L127.023 26.0684C126.174 25.6254 125.523 24.9434 125.07 24.0003L124.619 24.2168L124.168 24.4333C124.708 25.557 125.506 26.4053 126.561 26.9551L126.792 26.5117ZM124.619 24.2168L125.07 24.0003C124.555 22.929 124.287 21.5626 124.298 20.1835C124.309 18.8038 124.599 17.4535 125.158 16.4087L124.717 16.1729L124.276 15.937C123.623 17.1576 123.31 18.6762 123.298 20.1756C123.286 21.6757 123.575 23.1986 124.168 24.4333L124.619 24.2168ZM124.717 16.1729L125.157 16.4099C125.682 15.4357 126.394 14.7355 127.294 14.2888L127.072 13.8408L126.85 13.3929C125.749 13.9389 124.891 14.7941 124.277 15.9358L124.717 16.1729ZM99.8877 9.15332L99.8877 9.65332C102.135 9.65339 103.663 10.1403 104.587 11.0072L104.929 10.6426L105.271 10.278C104.079 9.15931 102.246 8.65339 99.8877 8.65332L99.8877 9.15332ZM104.929 10.6426L104.588 11.0086C105.55 11.9036 106.045 13.2845 106.048 14.7179C106.051 16.1516 105.56 17.5659 104.643 18.5102L105.002 18.8584L105.361 19.2066C106.493 18.0404 107.051 16.3574 107.048 14.716C107.045 13.0745 106.479 11.4027 105.269 10.2766L104.929 10.6426ZM105.002 18.8584L104.641 18.5129C104.175 18.9996 103.537 19.4022 102.706 19.7074L102.878 20.1768L103.05 20.6461C103.992 20.3004 104.771 19.8238 105.363 19.2039L105.002 18.8584ZM102.878 20.1768L102.71 19.706C101.24 20.2317 99.6573 20.1523 97.9707 20.1523V20.6523V21.1523C99.5699 21.1523 101.372 21.2466 103.046 20.6475L102.878 20.1768ZM97.9707 20.6523H97.4707V27H97.9707H98.4707V20.6523H97.9707ZM97.9707 27V26.5H94.1865V27V27.5H97.9707V27ZM94.1865 27H94.6865V9.15332H94.1865H93.6865V27H94.1865ZM94.1865 9.15332V9.65332H99.8877V9.15332V8.65332H94.1865V9.15332ZM141.294 8.00586H140.794C140.794 11.891 140.964 15.7191 140.601 19.5307L141.099 19.5781L141.596 19.6255C141.965 15.7509 141.794 11.8318 141.794 8.00586H141.294ZM141.099 19.5781L141.1 20.0781C141.274 20.0778 141.429 20.0147 141.539 19.9575C141.658 19.896 141.777 19.8143 141.893 19.7247C142.123 19.5453 142.381 19.2996 142.65 19.0199C143.189 18.4581 143.815 17.7121 144.417 16.9616C145.021 16.2091 145.609 15.4422 146.072 14.8355C146.549 14.2102 146.867 13.7915 146.96 13.6912L146.592 13.3525L146.224 13.0139C146.09 13.1591 145.726 13.641 145.277 14.2288C144.815 14.835 144.233 15.5935 143.638 16.3357C143.04 17.0801 142.436 17.7983 141.928 18.3273C141.673 18.5929 141.453 18.7993 141.278 18.9356C141.191 19.004 141.125 19.0461 141.08 19.0691C141.028 19.0962 141.04 19.0782 141.098 19.0781L141.099 19.5781ZM146.592 13.3525V13.8525H150.791V13.3525V12.8525H146.592V13.3525ZM150.791 13.3525L150.422 13.0149L145.002 18.9358L145.371 19.2734L145.74 19.611L151.16 13.6901L150.791 13.3525ZM145.371 19.2734L144.97 19.5719L150.719 27.2985L151.12 27L151.521 26.7015L145.772 18.975L145.371 19.2734ZM151.12 27V26.5H146.823V27V27.5H151.12V27ZM146.823 27L147.231 26.7103L143.3 21.181L142.893 21.4707L142.485 21.7604L146.416 27.2897L146.823 27ZM142.893 21.4707L142.58 21.0805L140.981 22.3618L141.294 22.752L141.607 23.1421L143.205 21.8609L142.893 21.4707ZM141.294 22.752H140.794V27H141.294H141.794V22.752H141.294ZM141.294 27V26.5H137.57V27V27.5H141.294V27ZM137.57 27H138.07V8.00586H137.57H137.07V27H137.57ZM137.57 8.00586V8.50586H141.294V8.00586V7.50586H137.57V8.00586ZM117.16 20.6768L117.143 20.177C116.842 20.1873 116.518 20.1827 116.156 20.1832C115.803 20.1837 115.425 20.1892 115.05 20.2221C114.309 20.2871 113.507 20.4635 112.882 20.9911L113.205 21.373L113.528 21.755C113.915 21.4277 114.465 21.2772 115.137 21.2183C115.468 21.1893 115.81 21.1837 116.158 21.1832C116.497 21.1828 116.854 21.1874 117.177 21.1765L117.16 20.6768ZM113.205 21.373L112.879 20.994C112.412 21.3954 112.092 22.0514 112.009 22.6943C111.925 23.3406 112.071 24.1007 112.715 24.5715L113.01 24.168L113.305 23.7645C113.06 23.5854 112.945 23.257 113.001 22.8228C113.058 22.3852 113.279 21.9686 113.531 21.7521L113.205 21.373ZM113.01 24.168L112.721 24.5762C113.333 25.0088 114.092 25.1065 114.784 25.012C115.476 24.9174 116.159 24.6235 116.657 24.1925L116.33 23.8145L116.003 23.4364C115.666 23.7282 115.168 23.9502 114.649 24.0212C114.128 24.0923 113.646 24.0053 113.298 23.7598L113.01 24.168ZM116.33 23.8145L116.655 24.1949C117.24 23.6954 117.488 23.0668 117.591 22.4445C117.69 21.8465 117.66 21.1989 117.66 20.6768H117.16H116.66C116.66 21.2686 116.685 21.7894 116.604 22.2814C116.527 22.7491 116.359 23.1324 116.006 23.434L116.33 23.8145ZM97.9707 17.5518V18.0518C98.9477 18.0518 100.136 18.1346 101.229 17.742L101.06 17.2715L100.89 16.8009C100.008 17.1182 99.0573 17.0518 97.9707 17.0518V17.5518ZM101.06 17.2715L101.229 17.742C101.832 17.525 102.323 17.1748 102.674 16.6833L102.268 16.3926L101.861 16.1019C101.642 16.4074 101.328 16.6437 100.89 16.801L101.06 17.2715ZM102.268 16.3926L102.674 16.6832C103.1 16.0876 103.267 15.2888 103.212 14.5461C103.157 13.8045 102.874 13.03 102.291 12.5237L101.963 12.9014L101.635 13.2791C101.961 13.5615 102.173 14.0527 102.215 14.6195C102.256 15.1852 102.121 15.7376 101.861 16.102L102.268 16.3926ZM101.963 12.9014L102.294 12.5266C101.675 11.9795 100.773 11.754 99.6924 11.7539L99.6924 12.2539L99.6923 12.7539C100.662 12.754 101.275 12.9607 101.632 13.2761L101.963 12.9014ZM99.6924 12.2539V11.7539H97.9707V12.2539V12.7539H99.6924V12.2539ZM97.9707 12.2539H97.4707V17.5518H97.9707H98.4707V12.2539H97.9707Z" fill="black" fill-opacity="0.1" mask="url(#path-5-inside-1_30_314)"/>
|
|
1176
|
+
<mask id="path-7-inside-2_30_314" fill="white">
|
|
1177
|
+
<path d="M73.3984 13.0959C74.6596 13.096 75.7459 13.3402 76.6572 13.8284C77.5687 14.3085 78.2731 15.0084 78.7695 15.928C79.6317 17.5252 79.5137 19.3496 79.5137 21.1037H70.7129C70.7536 22.1535 71.0664 22.98 71.6523 23.5823C73.4117 25.3414 76.804 24.3073 78.7451 23.3987V26.2795C76.2612 27.5065 72.819 27.6843 70.3096 26.4875C69.2598 25.983 68.4342 25.2134 67.832 24.1799C66.5533 21.9554 66.5946 18.5623 67.7461 16.2942C68.2913 15.2282 69.0482 14.4305 70.0166 13.9016C70.985 13.3645 72.1127 13.0959 73.3984 13.0959ZM61.0322 13.3528H64.8535V16.1477H61.0322V22.7278C61.0323 23.2485 61.1788 23.6393 61.4717 23.8996C61.7728 24.1519 62.168 24.2776 62.6562 24.2776C63.4782 24.2775 64.2428 24.0925 65 23.8508V26.6213C63.3504 27.362 61.068 27.5268 59.3848 26.8537C58.7419 26.5852 58.2327 26.1249 57.8584 25.4739C57.4923 24.8147 57.3096 23.8994 57.3096 22.7278V16.1477H55.5273V14.5735L57.5781 13.3284L58.6523 10.4475H61.0322V13.3528ZM45.249 27.0002H41.1719L39.8779 22.7522H33.3711L32.0771 27.0002H28L34.2988 9.08031H38.9258L45.249 27.0002ZM48.3984 9.64183C49.8398 7.28872 53.8102 7.56344 56.0645 8.44554L55.1123 11.1799C54.2171 10.8986 52.5767 10.4089 51.8896 11.302C51.4437 11.8863 51.5352 12.6617 51.5352 13.3528H54.7578V16.1477H51.5352V27.0002H47.8125V16.1477H45.7617V14.3537L47.8125 13.3528C47.8125 12.1072 47.7267 10.7474 48.3984 9.64183ZM90.1582 13.0959C90.5718 13.0959 91.0107 13.1209 91.416 13.2063L91.1348 16.6975C89.9758 16.3112 88.3612 16.6323 87.4238 17.3567C86.7156 17.8879 86.2647 18.754 86.2646 20.0539V27.0002H82.541V13.3528H85.3613L85.9102 15.6477H86.0938C86.9355 14.1937 88.436 13.0959 90.1582 13.0959ZM36.6309 11.8508C35.9954 14.4563 35.1134 17.0197 34.3232 19.5784H38.9746C38.1772 17.0207 37.2667 14.4578 36.6309 11.8508ZM73.4229 15.7453C72.6988 15.7453 72.0963 15.977 71.6162 16.4407C71.1442 16.9045 70.8711 17.6334 70.7979 18.6262H76.0225C76.0062 17.5234 75.6308 16.6296 74.8633 16.1233C74.489 15.8711 74.0086 15.7454 73.4229 15.7453Z"/>
|
|
1178
|
+
</mask>
|
|
1179
|
+
<path d="M73.3984 13.0959C74.6596 13.096 75.7459 13.3402 76.6572 13.8284C77.5687 14.3085 78.2731 15.0084 78.7695 15.928C79.6317 17.5252 79.5137 19.3496 79.5137 21.1037H70.7129C70.7536 22.1535 71.0664 22.98 71.6523 23.5823C73.4117 25.3414 76.804 24.3073 78.7451 23.3987V26.2795C76.2612 27.5065 72.819 27.6843 70.3096 26.4875C69.2598 25.983 68.4342 25.2134 67.832 24.1799C66.5533 21.9554 66.5946 18.5623 67.7461 16.2942C68.2913 15.2282 69.0482 14.4305 70.0166 13.9016C70.985 13.3645 72.1127 13.0959 73.3984 13.0959ZM61.0322 13.3528H64.8535V16.1477H61.0322V22.7278C61.0323 23.2485 61.1788 23.6393 61.4717 23.8996C61.7728 24.1519 62.168 24.2776 62.6562 24.2776C63.4782 24.2775 64.2428 24.0925 65 23.8508V26.6213C63.3504 27.362 61.068 27.5268 59.3848 26.8537C58.7419 26.5852 58.2327 26.1249 57.8584 25.4739C57.4923 24.8147 57.3096 23.8994 57.3096 22.7278V16.1477H55.5273V14.5735L57.5781 13.3284L58.6523 10.4475H61.0322V13.3528ZM45.249 27.0002H41.1719L39.8779 22.7522H33.3711L32.0771 27.0002H28L34.2988 9.08031H38.9258L45.249 27.0002ZM48.3984 9.64183C49.8398 7.28872 53.8102 7.56344 56.0645 8.44554L55.1123 11.1799C54.2171 10.8986 52.5767 10.4089 51.8896 11.302C51.4437 11.8863 51.5352 12.6617 51.5352 13.3528H54.7578V16.1477H51.5352V27.0002H47.8125V16.1477H45.7617V14.3537L47.8125 13.3528C47.8125 12.1072 47.7267 10.7474 48.3984 9.64183ZM90.1582 13.0959C90.5718 13.0959 91.0107 13.1209 91.416 13.2063L91.1348 16.6975C89.9758 16.3112 88.3612 16.6323 87.4238 17.3567C86.7156 17.8879 86.2647 18.754 86.2646 20.0539V27.0002H82.541V13.3528H85.3613L85.9102 15.6477H86.0938C86.9355 14.1937 88.436 13.0959 90.1582 13.0959ZM36.6309 11.8508C35.9954 14.4563 35.1134 17.0197 34.3232 19.5784H38.9746C38.1772 17.0207 37.2667 14.4578 36.6309 11.8508ZM73.4229 15.7453C72.6988 15.7453 72.0963 15.977 71.6162 16.4407C71.1442 16.9045 70.8711 17.6334 70.7979 18.6262H76.0225C76.0062 17.5234 75.6308 16.6296 74.8633 16.1233C74.489 15.8711 74.0086 15.7454 73.4229 15.7453Z" fill="url(#paint4_linear_30_314)"/>
|
|
1180
|
+
<path d="M73.3984 13.0959L73.3985 12.5959H73.3984V13.0959ZM76.6572 13.8284L76.4211 14.2691L76.4242 14.2707L76.6572 13.8284ZM78.7695 15.928L79.2095 15.6904L79.2095 15.6904L78.7695 15.928ZM79.5137 21.1037V21.6037C79.7898 21.6037 80.0137 21.3799 80.0137 21.1037L79.5137 21.1037ZM70.7129 21.1037V20.6037C70.5769 20.6037 70.4468 20.6591 70.3526 20.7571C70.2583 20.8551 70.208 20.9872 70.2133 21.1231L70.7129 21.1037ZM71.6523 23.5823L71.2939 23.931L71.2988 23.9358L71.6523 23.5823ZM78.7451 23.3987H79.2451C79.2451 23.2277 79.1577 23.0685 79.0135 22.9768C78.8692 22.885 78.688 22.8733 78.5331 22.9458L78.7451 23.3987ZM78.7451 26.2795L78.9666 26.7278C79.1371 26.6436 79.2451 26.4698 79.2451 26.2795H78.7451ZM70.3096 26.4875L70.093 26.9382L70.0943 26.9388L70.3096 26.4875ZM67.832 24.1799L67.3985 24.4291L67.4 24.4316L67.832 24.1799ZM67.7461 16.2942L67.3009 16.0665L67.3003 16.0678L67.7461 16.2942ZM70.0166 13.9016L70.2563 14.3404L70.2591 14.3389L70.0166 13.9016ZM61.0322 13.3528H60.5322C60.5322 13.6289 60.7561 13.8528 61.0322 13.8528V13.3528ZM64.8535 13.3528H65.3535C65.3535 13.0766 65.1297 12.8528 64.8535 12.8528V13.3528ZM64.8535 16.1477V16.6477C65.1297 16.6477 65.3535 16.4238 65.3535 16.1477H64.8535ZM61.0322 16.1477V15.6477C60.7561 15.6477 60.5322 15.8715 60.5322 16.1477H61.0322ZM61.0322 22.7278H60.5322V22.7278L61.0322 22.7278ZM61.4717 23.8996L61.1395 24.2733C61.1432 24.2766 61.1469 24.2798 61.1506 24.2829L61.4717 23.8996ZM62.6562 24.2776V24.7776H62.6563L62.6562 24.2776ZM65 23.8508H65.5C65.5 23.6912 65.4238 23.5412 65.2949 23.4471C65.1661 23.3529 65 23.326 64.848 23.3745L65 23.8508ZM65 26.6213L65.2048 27.0775C65.3844 26.9968 65.5 26.8182 65.5 26.6213H65ZM59.3848 26.8537L59.192 27.3152L59.1991 27.318L59.3848 26.8537ZM57.8584 25.4739L57.4213 25.7167L57.4249 25.7231L57.8584 25.4739ZM57.3096 22.7278H56.8096V22.7278L57.3096 22.7278ZM57.3096 16.1477H57.8096C57.8096 15.8715 57.5857 15.6477 57.3096 15.6477V16.1477ZM55.5273 16.1477H55.0273C55.0273 16.4238 55.2512 16.6477 55.5273 16.6477V16.1477ZM55.5273 14.5735L55.2679 14.1461C55.1185 14.2367 55.0273 14.3988 55.0273 14.5735H55.5273ZM57.5781 13.3284L57.8376 13.7557C57.9337 13.6974 58.0073 13.6084 58.0466 13.503L57.5781 13.3284ZM58.6523 10.4475V9.94749C58.4436 9.94749 58.2568 10.0772 58.1839 10.2728L58.6523 10.4475ZM61.0322 10.4475H61.5322C61.5322 10.1714 61.3084 9.94749 61.0322 9.94749V10.4475ZM45.249 27.0002V27.5002C45.4113 27.5002 45.5635 27.4215 45.6572 27.289C45.7509 27.1566 45.7745 26.9869 45.7205 26.8339L45.249 27.0002ZM41.1719 27.0002L40.6936 27.1459C40.7577 27.3564 40.9518 27.5002 41.1719 27.5002V27.0002ZM39.8779 22.7522L40.3562 22.6065C40.2921 22.396 40.098 22.2522 39.8779 22.2522V22.7522ZM33.3711 22.7522V22.2522C33.1511 22.2522 32.9569 22.396 32.8928 22.6065L33.3711 22.7522ZM32.0771 27.0002V27.5002C32.2972 27.5002 32.4913 27.3564 32.5555 27.1459L32.0771 27.0002ZM28 27.0002L27.5283 26.8344C27.4745 26.9874 27.4983 27.157 27.592 27.2893C27.6858 27.4216 27.8378 27.5002 28 27.5002V27.0002ZM34.2988 9.08031V8.58031C34.0866 8.58031 33.8975 8.71428 33.8271 8.9145L34.2988 9.08031ZM38.9258 9.08031L39.3973 8.91393C39.3267 8.71401 39.1378 8.58031 38.9258 8.58031V9.08031ZM48.3984 9.64183L47.9721 9.38067L47.9711 9.3822L48.3984 9.64183ZM56.0645 8.44554L56.5366 8.60997C56.625 8.35614 56.4969 8.07786 56.2467 7.97992L56.0645 8.44554ZM55.1123 11.1799L54.9624 11.6569C55.2202 11.7379 55.4956 11.5995 55.5845 11.3443L55.1123 11.1799ZM51.8896 11.302L51.4934 10.9971L51.4922 10.9987L51.8896 11.302ZM51.5352 13.3528H51.0352C51.0352 13.6289 51.259 13.8528 51.5352 13.8528V13.3528ZM54.7578 13.3528H55.2578C55.2578 13.0766 55.034 12.8528 54.7578 12.8528V13.3528ZM54.7578 16.1477V16.6477C55.034 16.6477 55.2578 16.4238 55.2578 16.1477H54.7578ZM51.5352 16.1477V15.6477C51.259 15.6477 51.0352 15.8715 51.0352 16.1477H51.5352ZM51.5352 27.0002V27.5002C51.8113 27.5002 52.0352 27.2764 52.0352 27.0002H51.5352ZM47.8125 27.0002H47.3125C47.3125 27.2764 47.5364 27.5002 47.8125 27.5002V27.0002ZM47.8125 16.1477H48.3125C48.3125 15.8715 48.0886 15.6477 47.8125 15.6477V16.1477ZM45.7617 16.1477H45.2617C45.2617 16.4238 45.4856 16.6477 45.7617 16.6477V16.1477ZM45.7617 14.3537L45.5424 13.9044C45.3707 13.9882 45.2617 14.1626 45.2617 14.3537H45.7617ZM47.8125 13.3528L48.0318 13.8021C48.2036 13.7183 48.3125 13.5439 48.3125 13.3528H47.8125ZM91.416 13.2063L91.9144 13.2464C91.9346 12.9956 91.7653 12.7688 91.519 12.717L91.416 13.2063ZM91.1348 16.6975L90.9767 17.1718C91.1224 17.2204 91.2824 17.1993 91.4106 17.1145C91.5387 17.0298 91.6208 16.8908 91.6332 16.7376L91.1348 16.6975ZM87.4238 17.3567L87.7239 17.7567L87.7296 17.7523L87.4238 17.3567ZM86.2646 20.0539L85.7646 20.0539V20.0539H86.2646ZM86.2646 27.0002V27.5002C86.5408 27.5002 86.7646 27.2764 86.7646 27.0002H86.2646ZM82.541 27.0002H82.041C82.041 27.2764 82.2649 27.5002 82.541 27.5002V27.0002ZM82.541 13.3528V12.8528C82.2649 12.8528 82.041 13.0766 82.041 13.3528H82.541ZM85.3613 13.3528L85.8476 13.2365C85.7938 13.0115 85.5927 12.8528 85.3613 12.8528V13.3528ZM85.9102 15.6477L85.4239 15.764C85.4777 15.989 85.6788 16.1477 85.9102 16.1477V15.6477ZM86.0938 15.6477V16.1477C86.2722 16.1477 86.4371 16.0526 86.5265 15.8982L86.0938 15.6477ZM36.6309 11.8508L37.1166 11.7323C37.062 11.5084 36.8614 11.3508 36.6309 11.3508C36.4004 11.3508 36.1997 11.5084 36.1451 11.7323L36.6309 11.8508ZM34.3232 19.5784L33.8455 19.4308C33.7987 19.5825 33.8266 19.7474 33.9209 19.8752C34.0152 20.003 34.1645 20.0784 34.3232 20.0784V19.5784ZM38.9746 19.5784V20.0784C39.1336 20.0784 39.2831 20.0027 39.3774 19.8747C39.4716 19.7466 39.4993 19.5813 39.4519 19.4295L38.9746 19.5784ZM73.4229 15.7453L73.4229 15.2453H73.4229V15.7453ZM71.6162 16.4407L71.2689 16.081L71.2657 16.084L71.6162 16.4407ZM70.7979 18.6262L70.2992 18.5894C70.289 18.728 70.3369 18.8647 70.4315 18.9665C70.5261 19.0683 70.6589 19.1262 70.7979 19.1262V18.6262ZM76.0225 18.6262V19.1262C76.1563 19.1262 76.2846 19.0725 76.3786 18.9771C76.4726 18.8818 76.5244 18.7527 76.5224 18.6189L76.0225 18.6262ZM74.8633 16.1233L74.5838 16.5379L74.5879 16.5406L74.8633 16.1233ZM73.3984 13.0959L73.3984 13.5959C74.5951 13.596 75.5967 13.8275 76.4211 14.2691L76.6572 13.8284L76.8933 13.3876C75.8951 12.8529 74.7241 12.596 73.3985 12.5959L73.3984 13.0959ZM76.6572 13.8284L76.4242 14.2707C77.2466 14.704 77.8796 15.332 78.3295 16.1655L78.7695 15.928L79.2095 15.6904C78.6666 14.6848 77.8907 13.913 76.8903 13.386L76.6572 13.8284ZM78.7695 15.928L78.3295 16.1655C79.117 17.6243 79.0137 19.2902 79.0137 21.1037L79.5137 21.1037L80.0137 21.1037C80.0137 19.4091 80.1465 17.4261 79.2095 15.6904L78.7695 15.928ZM79.5137 21.1037V20.6037H70.7129V21.1037V21.6037H79.5137V21.1037ZM70.7129 21.1037L70.2133 21.1231C70.2575 22.264 70.6017 23.2194 71.294 23.9309L71.6523 23.5823L72.0107 23.2336C71.5311 22.7407 71.2497 22.0431 71.2125 21.0844L70.7129 21.1037ZM71.6523 23.5823L71.2988 23.9358C72.3375 24.9744 73.8159 25.1469 75.1883 24.9875C76.5717 24.8269 77.9593 24.3186 78.9571 23.8515L78.7451 23.3987L78.5331 22.9458C77.5898 23.3874 76.3107 23.8505 75.0729 23.9942C73.824 24.1393 72.7266 23.9493 72.0059 23.2287L71.6523 23.5823ZM78.7451 23.3987H78.2451V26.2795H78.7451H79.2451V23.3987H78.7451ZM78.7451 26.2795L78.5237 25.8312C76.1598 26.9989 72.8792 27.1591 70.5248 26.0362L70.3096 26.4875L70.0943 26.9388C72.7587 28.2095 76.3627 28.014 78.9666 26.7278L78.7451 26.2795ZM70.3096 26.4875L70.5262 26.0369C69.5692 25.5769 68.8175 24.878 68.264 23.9282L67.832 24.1799L67.4 24.4316C68.051 25.5488 68.9504 26.389 70.093 26.9382L70.3096 26.4875ZM67.832 24.1799L68.2655 23.9307C67.6792 22.9107 67.3831 21.5964 67.3777 20.2514C67.3724 18.9072 67.6578 17.5726 68.1919 16.5205L67.7461 16.2942L67.3003 16.0678C66.6829 17.2839 66.3719 18.7799 66.3777 20.2554C66.3836 21.7301 66.7062 23.2246 67.3985 24.4291L67.832 24.1799ZM67.7461 16.2942L68.1912 16.5219C68.6948 15.5373 69.3836 14.8171 70.2563 14.3404L70.0166 13.9016L69.7769 13.4628C68.7129 14.044 67.8878 14.9191 67.3009 16.0665L67.7461 16.2942ZM70.0166 13.9016L70.2591 14.3389C71.1421 13.8491 72.1837 13.5959 73.3984 13.5959V13.0959V12.5959C72.0416 12.5959 70.8279 12.8799 69.7741 13.4643L70.0166 13.9016ZM61.0322 13.3528V13.8528H64.8535V13.3528V12.8528H61.0322V13.3528ZM64.8535 13.3528H64.3535V16.1477H64.8535H65.3535V13.3528H64.8535ZM64.8535 16.1477V15.6477H61.0322V16.1477V16.6477H64.8535V16.1477ZM61.0322 16.1477H60.5322V22.7278H61.0322H61.5322V16.1477H61.0322ZM61.0322 22.7278L60.5322 22.7278C60.5323 23.3418 60.7077 23.8895 61.1395 24.2733L61.4717 23.8996L61.8039 23.5259C61.6498 23.389 61.5323 23.1552 61.5322 22.7277L61.0322 22.7278ZM61.4717 23.8996L61.1506 24.2829C61.5623 24.6278 62.0806 24.7776 62.6562 24.7776V24.2776V23.7776C62.2555 23.7776 61.9833 23.6759 61.7928 23.5163L61.4717 23.8996ZM62.6562 24.2776L62.6563 24.7776C63.5532 24.7775 64.3746 24.5753 65.152 24.3271L65 23.8508L64.848 23.3745C64.1111 23.6097 63.4031 23.7775 62.6562 23.7776L62.6562 24.2776ZM65 23.8508H64.5V26.6213H65H65.5V23.8508H65ZM65 26.6213L64.7952 26.1652C63.2491 26.8593 61.1086 27.0046 59.5704 26.3895L59.3848 26.8537L59.1991 27.318C61.0273 28.049 63.4517 27.8646 65.2048 27.0775L65 26.6213ZM59.3848 26.8537L59.5775 26.3924C59.0441 26.1696 58.616 25.7883 58.2919 25.2246L57.8584 25.4739L57.4249 25.7231C57.8495 26.4615 58.4397 27.0008 59.192 27.3151L59.3848 26.8537ZM57.8584 25.4739L58.2955 25.2311C57.9874 24.6764 57.8096 23.8574 57.8096 22.7278L57.3096 22.7278L56.8096 22.7278C56.8096 23.9414 56.9972 24.9531 57.4213 25.7167L57.8584 25.4739ZM57.3096 22.7278H57.8096V16.1477H57.3096H56.8096V22.7278H57.3096ZM57.3096 16.1477V15.6477H55.5273V16.1477V16.6477H57.3096V16.1477ZM55.5273 16.1477H56.0273V14.5735H55.5273H55.0273V16.1477H55.5273ZM55.5273 14.5735L55.7868 15.0009L57.8376 13.7557L57.5781 13.3284L57.3186 12.901L55.2679 14.1461L55.5273 14.5735ZM57.5781 13.3284L58.0466 13.503L59.1208 10.6222L58.6523 10.4475L58.1839 10.2728L57.1096 13.1537L57.5781 13.3284ZM58.6523 10.4475V10.9475H61.0322V10.4475V9.94749H58.6523V10.4475ZM61.0322 10.4475H60.5322V13.3528H61.0322H61.5322V10.4475H61.0322ZM45.249 27.0002V26.5002H41.1719V27.0002V27.5002H45.249V27.0002ZM41.1719 27.0002L41.6502 26.8545L40.3562 22.6065L39.8779 22.7522L39.3996 22.8979L40.6936 27.1459L41.1719 27.0002ZM39.8779 22.7522V22.2522H33.3711V22.7522V23.2522H39.8779V22.7522ZM33.3711 22.7522L32.8928 22.6065L31.5988 26.8545L32.0771 27.0002L32.5555 27.1459L33.8494 22.8979L33.3711 22.7522ZM32.0771 27.0002V26.5002H28V27.0002V27.5002H32.0771V27.0002ZM28 27.0002L28.4717 27.166L34.7705 9.24611L34.2988 9.08031L33.8271 8.9145L27.5283 26.8344L28 27.0002ZM34.2988 9.08031V9.58031H38.9258V9.08031V8.58031H34.2988V9.08031ZM38.9258 9.08031L38.4543 9.24668L44.7775 27.1666L45.249 27.0002L45.7205 26.8339L39.3973 8.91393L38.9258 9.08031ZM48.3984 9.64183L48.8248 9.90299C49.4253 8.92265 50.5851 8.43828 51.9661 8.32892C53.3382 8.22025 54.8187 8.495 55.8823 8.91116L56.0645 8.44554L56.2467 7.97992C55.0559 7.51398 53.4241 7.21032 51.8871 7.33204C50.3589 7.45307 48.8129 8.0079 47.9721 9.38067L48.3984 9.64183ZM56.0645 8.44554L55.5923 8.28112L54.6401 11.0155L55.1123 11.1799L55.5845 11.3443L56.5366 8.60997L56.0645 8.44554ZM55.1123 11.1799L55.2622 10.7029C54.8185 10.5635 54.1333 10.3528 53.4606 10.302C52.8061 10.2525 51.9966 10.343 51.4934 10.9971L51.8896 11.302L52.2859 11.6069C52.4698 11.3679 52.8241 11.2567 53.3853 11.2991C53.9283 11.3402 54.511 11.515 54.9624 11.6569L55.1123 11.1799ZM51.8896 11.302L51.4922 10.9987C51.1909 11.3934 51.0849 11.8372 51.0473 12.241C51.0116 12.6245 51.0352 13.0507 51.0352 13.3528H51.5352H52.0352C52.0352 12.9638 52.013 12.6567 52.043 12.3337C52.0712 12.0309 52.1425 11.7948 52.2871 11.6053L51.8896 11.302ZM51.5352 13.3528V13.8528H54.7578V13.3528V12.8528H51.5352V13.3528ZM54.7578 13.3528H54.2578V16.1477H54.7578H55.2578V13.3528H54.7578ZM54.7578 16.1477V15.6477H51.5352V16.1477V16.6477H54.7578V16.1477ZM51.5352 16.1477H51.0352V27.0002H51.5352H52.0352V16.1477H51.5352ZM51.5352 27.0002V26.5002H47.8125V27.0002V27.5002H51.5352V27.0002ZM47.8125 27.0002H48.3125V16.1477H47.8125H47.3125V27.0002H47.8125ZM47.8125 16.1477V15.6477H45.7617V16.1477V16.6477H47.8125V16.1477ZM45.7617 16.1477H46.2617V14.3537H45.7617H45.2617V16.1477H45.7617ZM45.7617 14.3537L45.981 14.8031L48.0318 13.8021L47.8125 13.3528L47.5932 12.9034L45.5424 13.9044L45.7617 14.3537ZM47.8125 13.3528H48.3125C48.3125 12.707 48.2918 12.0955 48.3512 11.4939C48.4095 10.9019 48.5428 10.3671 48.8257 9.90146L48.3984 9.64183L47.9711 9.3822C47.5823 10.0221 47.4226 10.72 47.356 11.3957C47.2903 12.0618 47.3125 12.7529 47.3125 13.3528H47.8125ZM90.1582 13.0959V13.5959C90.5552 13.5959 90.9555 13.6203 91.313 13.6956L91.416 13.2063L91.519 12.717C91.0658 12.6216 90.5883 12.5959 90.1582 12.5959V13.0959ZM91.416 13.2063L90.9176 13.1661L90.6364 16.6573L91.1348 16.6975L91.6332 16.7376L91.9144 13.2464L91.416 13.2063ZM91.1348 16.6975L91.2929 16.2232C90.6145 15.997 89.8324 15.9851 89.1057 16.1189C88.3787 16.2527 87.6623 16.5405 87.1181 16.961L87.4238 17.3567L87.7296 17.7523C88.1228 17.4485 88.6824 17.2136 89.2867 17.1023C89.8914 16.991 90.4961 17.0117 90.9767 17.1718L91.1348 16.6975ZM87.4238 17.3567L87.1238 16.9567C86.2672 17.5992 85.7647 18.627 85.7646 20.0539L86.2646 20.0539L86.7646 20.054C86.7647 18.881 87.164 18.1766 87.7238 17.7567L87.4238 17.3567ZM86.2646 20.0539H85.7646V27.0002H86.2646H86.7646V20.0539H86.2646ZM86.2646 27.0002V26.5002H82.541V27.0002V27.5002H86.2646V27.0002ZM82.541 27.0002H83.041V13.3528H82.541H82.041V27.0002H82.541ZM82.541 13.3528V13.8528H85.3613V13.3528V12.8528H82.541V13.3528ZM85.3613 13.3528L84.875 13.4691L85.4239 15.764L85.9102 15.6477L86.3964 15.5314L85.8476 13.2365L85.3613 13.3528ZM85.9102 15.6477V16.1477H86.0938V15.6477V15.1477H85.9102V15.6477ZM86.0938 15.6477L86.5265 15.8982C87.3021 14.5585 88.6564 13.5959 90.1582 13.5959V13.0959V12.5959C88.2156 12.5959 86.569 13.829 85.661 15.3972L86.0938 15.6477ZM36.6309 11.8508L36.1451 11.7323C35.5144 14.3183 34.642 16.8517 33.8455 19.4308L34.3232 19.5784L34.801 19.7259C35.5848 17.1878 36.4764 14.5943 37.1166 11.9693L36.6309 11.8508ZM34.3232 19.5784V20.0784H38.9746V19.5784V19.0784H34.3232V19.5784ZM38.9746 19.5784L39.4519 19.4295C38.6466 16.8465 37.7475 14.3191 37.1166 11.7323L36.6309 11.8508L36.1451 11.9693C36.7859 14.5965 37.7078 17.1949 38.4973 19.7272L38.9746 19.5784ZM73.4229 15.7453V15.2453C72.5814 15.2453 71.8506 15.5192 71.2689 16.081L71.6162 16.4407L71.9635 16.8003C72.342 16.4349 72.8161 16.2453 73.4229 16.2453V15.7453ZM71.6162 16.4407L71.2657 16.084C70.6727 16.6669 70.377 17.5345 70.2992 18.5894L70.7979 18.6262L71.2965 18.663C71.3652 17.7322 71.6157 17.1422 71.9667 16.7973L71.6162 16.4407ZM70.7979 18.6262V19.1262H76.0225V18.6262V18.1262H70.7979V18.6262ZM76.0225 18.6262L76.5224 18.6189C76.5047 17.4127 76.089 16.3329 75.1386 15.7059L74.8633 16.1233L74.5879 16.5406C75.1726 16.9263 75.5078 17.6341 75.5225 18.6336L76.0225 18.6262ZM74.8633 16.1233L75.1427 15.7086C74.6642 15.3862 74.0783 15.2454 73.4229 15.2453L73.4229 15.7453L73.4228 16.2453C73.9388 16.2454 74.3138 16.3559 74.5839 16.5379L74.8633 16.1233Z" fill="black" fill-opacity="0.1" mask="url(#path-7-inside-2_30_314)"/>
|
|
1181
|
+
<defs>
|
|
1182
|
+
<linearGradient id="paint0_linear_30_314" x1="15" y1="9" x2="15" y2="27" gradientUnits="userSpaceOnUse">
|
|
1183
|
+
<stop stop-color="#E8EAEE"/>
|
|
1184
|
+
<stop offset="0.5" stop-color="#FEFEFE"/>
|
|
1185
|
+
<stop offset="0.6" stop-color="#97999D"/>
|
|
1186
|
+
<stop offset="0.75" stop-color="#E1E4E6"/>
|
|
1187
|
+
</linearGradient>
|
|
1188
|
+
<linearGradient id="paint1_linear_30_314" x1="12" y1="9" x2="12" y2="27" gradientUnits="userSpaceOnUse">
|
|
1189
|
+
<stop stop-color="#B57317"/>
|
|
1190
|
+
<stop offset="0.5" stop-color="#FCEA85"/>
|
|
1191
|
+
<stop offset="0.6" stop-color="#8F5811"/>
|
|
1192
|
+
<stop offset="0.75" stop-color="#EAAE3D"/>
|
|
1193
|
+
<stop offset="1" stop-color="#9F5C0C"/>
|
|
1194
|
+
</linearGradient>
|
|
1195
|
+
<linearGradient id="paint2_linear_30_314" x1="12" y1="9" x2="12" y2="27" gradientUnits="userSpaceOnUse">
|
|
1196
|
+
<stop stop-color="#B57317"/>
|
|
1197
|
+
<stop offset="0.5" stop-color="#FCEA85"/>
|
|
1198
|
+
<stop offset="0.6" stop-color="#8F5811"/>
|
|
1199
|
+
<stop offset="0.75" stop-color="#EAAE3D"/>
|
|
1200
|
+
<stop offset="1" stop-color="#9F5C0C"/>
|
|
1201
|
+
</linearGradient>
|
|
1202
|
+
<linearGradient id="paint3_linear_30_314" x1="122.653" y1="8.00586" x2="122.653" y2="27.2659" gradientUnits="userSpaceOnUse">
|
|
1203
|
+
<stop stop-color="#E8EAEE"/>
|
|
1204
|
+
<stop offset="0.5" stop-color="#FEFEFE"/>
|
|
1205
|
+
<stop offset="0.6" stop-color="#97999D"/>
|
|
1206
|
+
<stop offset="0.75" stop-color="#E1E4E6"/>
|
|
1207
|
+
</linearGradient>
|
|
1208
|
+
<linearGradient id="paint4_linear_30_314" x1="59.708" y1="7.80492" x2="59.708" y2="27.2984" gradientUnits="userSpaceOnUse">
|
|
1209
|
+
<stop stop-color="#B57317"/>
|
|
1210
|
+
<stop offset="0.5" stop-color="#FCEA85"/>
|
|
1211
|
+
<stop offset="0.6" stop-color="#8F5811"/>
|
|
1212
|
+
<stop offset="0.75" stop-color="#EAAE3D"/>
|
|
1213
|
+
<stop offset="1" stop-color="#9F5C0C"/>
|
|
1214
|
+
</linearGradient>
|
|
1215
|
+
</defs>
|
|
1216
|
+
</svg>
|
|
1217
|
+
</a>
|
|
1218
|
+
</header>
|
|
1219
|
+
|
|
1220
|
+
<aside class="rail-left" id="rail-left" aria-label="Files">
|
|
1221
|
+
<div class="rail-section">
|
|
1222
|
+
<div class="tree-head">
|
|
1223
|
+
<span class="eyebrow" id="files-title">Files</span>
|
|
1224
|
+
<span class="workspace-line" id="workspace-summary"></span>
|
|
1225
|
+
</div>
|
|
1226
|
+
<input type="search" class="tree-search" id="tree-search" placeholder="Filter by path…" aria-label="Filter files by path" autocomplete="off" spellcheck="false" />
|
|
1227
|
+
<div class="segmented segmented-tight" id="file-filter" role="group" aria-label="Filter files by origin" style="margin:6px 0">
|
|
1228
|
+
<button type="button" id="filter-all" data-filter="all" aria-pressed="true">All</button>
|
|
1229
|
+
<button type="button" id="filter-app" data-filter="app" aria-pressed="false">App</button>
|
|
1230
|
+
<button type="button" id="filter-vendor" data-filter="vendor" aria-pressed="false">Vendor</button>
|
|
1231
|
+
<button type="button" id="filter-weak" data-filter="weak" aria-pressed="false" data-tip="Only the files that carry a WEAK SPOT — a readable literal that survived this build (severity “leak”) or a residual property name. Same count the dashboard’s “Weak spots” tile sums, per file. Deep-linkable as #filter=weak.">Weak</button>
|
|
1232
|
+
<button type="button" id="filter-marked" data-filter="marked" aria-pressed="false" data-tip="Only the files where this build RECORDED an @afterpack marker over a span. The map records that a marker was found at those coordinates; whether it changed the outcome is not recorded. Empty on Free, where no marker is recorded. Deep-linkable as #filter=marked.">Marked</button>
|
|
1233
|
+
</div>
|
|
1234
|
+
<p class="tree-note" id="deeplink-note" hidden></p>
|
|
1235
|
+
<div class="tree" id="file-tree" role="group" aria-label="File tree"></div>
|
|
1236
|
+
</div>
|
|
1237
|
+
</aside>
|
|
1238
|
+
<div class="pane-resizer" id="resize-left" role="separator" aria-orientation="vertical" tabindex="0"
|
|
1239
|
+
aria-controls="rail-left" aria-valuemin="180" aria-valuenow="262"
|
|
1240
|
+
aria-label="File tree width — arrow keys resize"
|
|
1241
|
+
title="Drag to resize the file tree (arrow keys also work; hold Shift for a bigger step)"></div>
|
|
1242
|
+
|
|
1243
|
+
<main class="pane-center" aria-label="Original source, painted by protection intensity">
|
|
1244
|
+
<div class="file-summary" id="file-summary">
|
|
1245
|
+
<div class="file-head-row">
|
|
1246
|
+
<div class="file-summary-path" id="file-summary-path"></div>
|
|
1247
|
+
<button type="button" class="icon-btn" id="copy-path" data-copy="" data-copied-label="✓" aria-label="Copy the full file path" data-tip="Copy this file's full path">⧉</button>
|
|
1248
|
+
<span class="file-head-spacer"></span>
|
|
1249
|
+
<span id="source-origin-note" class="mono" tabindex="0">—</span>
|
|
1250
|
+
</div>
|
|
1251
|
+
<div class="code-toolbar" id="code-toolbar">
|
|
1252
|
+
<label class="toggle-inline" id="syntax-label" data-tip="Colour the source by its own grammar (comments, keywords, strings, numbers). Foreground only — every background in this pane belongs to the protection overlay.">
|
|
1253
|
+
<input type="checkbox" id="syntax-toggle" checked />
|
|
1254
|
+
<span id="syntax-toggle-text">Syntax</span>
|
|
1255
|
+
</label>
|
|
1256
|
+
<label class="toggle-inline" id="highlight-class-label" data-tip="Dim every painted token whose region is a DIFFERENT reversal class than the one you have selected, and ring the ones that match. Needs a region selected; engine scaffolding and un-attributed gaps are left alone either way.">
|
|
1257
|
+
<input type="checkbox" id="highlight-class-toggle" disabled />
|
|
1258
|
+
Highlight same class
|
|
1259
|
+
</label>
|
|
1260
|
+
<span id="highlight-class-status" aria-live="polite"></span>
|
|
1261
|
+
<span class="toolbar-spacer"></span>
|
|
1262
|
+
</div>
|
|
1263
|
+
</div>
|
|
1264
|
+
<div class="code-body" id="code-body" tabindex="0" role="group" aria-label="Painted source code"></div>
|
|
1265
|
+
</main>
|
|
1266
|
+
|
|
1267
|
+
<div class="pane-resizer" id="resize-right" role="separator" aria-orientation="vertical" tabindex="0"
|
|
1268
|
+
aria-controls="rail-right" aria-valuemin="180" aria-valuenow="340"
|
|
1269
|
+
aria-label="Inspector width — arrow keys resize"
|
|
1270
|
+
title="Drag to resize the inspector (arrow keys also work; hold Shift for a bigger step)"></div>
|
|
1271
|
+
<aside class="rail-right" id="rail-right" aria-label="Inspector and weak spots">
|
|
1272
|
+
<div class="rail-right-pin">
|
|
1273
|
+
<div class="rail-section file-band-section">
|
|
1274
|
+
<span class="eyebrow">This file</span>
|
|
1275
|
+
<div class="file-band" id="file-summary-metrics"></div>
|
|
1276
|
+
</div>
|
|
1277
|
+
<div class="rail-section rail-collapsible is-collapsed" id="inspector-section">
|
|
1278
|
+
<div class="rail-section-headrow">
|
|
1279
|
+
<button type="button" class="rail-section-head" id="inspector-head" aria-expanded="false" aria-controls="inspector">
|
|
1280
|
+
<span class="eyebrow">Inspector</span>
|
|
1281
|
+
<span class="rail-section-count" id="inspector-count">no selection</span>
|
|
1282
|
+
</button>
|
|
1283
|
+
</div>
|
|
1284
|
+
<div id="inspector"></div>
|
|
1285
|
+
</div>
|
|
1286
|
+
</div>
|
|
1287
|
+
<div class="rail-right-scroll">
|
|
1288
|
+
<div class="rail-section rail-collapsible weakspots-section is-collapsed" id="weakspots-section">
|
|
1289
|
+
<div class="rail-section-headrow">
|
|
1290
|
+
<button type="button" class="rail-section-head" id="weakspots-head" aria-expanded="false" aria-controls="weakspots-list">
|
|
1291
|
+
<span class="eyebrow" id="weakspots-title">Weak spots</span>
|
|
1292
|
+
</button>
|
|
1293
|
+
<span class="info-dot" id="weakspots-info" tabindex="0" role="img" aria-label="About these figures" data-tip="Sizes are the engine's estimate of added output bytes, not a byte-exact count. Decode-ops / call-frames are a per-site static op count — not amortized over loops or repeated calls.">i</span>
|
|
1294
|
+
</div>
|
|
1295
|
+
<div id="weakspots-list" style="margin-top:8px"></div>
|
|
1296
|
+
</div>
|
|
1297
|
+
</div>
|
|
1298
|
+
</aside>
|
|
1299
|
+
|
|
1300
|
+
</div>
|
|
1301
|
+
|
|
1302
|
+
<div class="popover" id="build-popover" role="dialog" aria-label="Legend and build info" hidden>
|
|
1303
|
+
<div class="popover-section">
|
|
1304
|
+
<span class="eyebrow">Class distribution · selected file</span>
|
|
1305
|
+
<div class="class-dist-bar" id="class-dist-bar"></div>
|
|
1306
|
+
<ul class="class-dist-rows" id="class-dist-rows"></ul>
|
|
1307
|
+
<div class="class-reached-line" id="class-reached"></div>
|
|
1308
|
+
<div class="class-dist-footnote" id="class-dist-footnote" hidden></div>
|
|
1309
|
+
</div>
|
|
1310
|
+
<div class="popover-section">
|
|
1311
|
+
<span class="eyebrow">Reversal classes</span>
|
|
1312
|
+
<ul id="class-legend"></ul>
|
|
1313
|
+
</div>
|
|
1314
|
+
<div class="popover-section" id="directive-legend-section" hidden>
|
|
1315
|
+
<span class="eyebrow">Directive markers</span>
|
|
1316
|
+
<div id="directive-legend"></div>
|
|
1317
|
+
</div>
|
|
1318
|
+
<div class="popover-section">
|
|
1319
|
+
<span class="eyebrow" id="legend-title">Scale · Protection (per file)</span>
|
|
1320
|
+
<div class="legend-bar" id="legend-bar"></div>
|
|
1321
|
+
<div class="legend-labels" id="legend-labels"><span>low in file</span><span>high in file</span></div>
|
|
1322
|
+
</div>
|
|
1323
|
+
<div class="popover-section">
|
|
1324
|
+
<span class="eyebrow">Engine</span>
|
|
1325
|
+
<dl class="engine-info" id="engine-info"></dl>
|
|
1326
|
+
</div>
|
|
1327
|
+
</div>
|
|
1328
|
+
|
|
1329
|
+
<div class="tooltip" id="tooltip" role="tooltip" hidden></div>
|
|
1330
|
+
|
|
1331
|
+
<script id="afterpack-data" type="application/octet-stream">__AFTERPACK_DATA__</script>
|
|
1332
|
+
<script id="afterpack-codec">
|
|
1333
|
+
"use strict";
|
|
1334
|
+
function afterpackDecodeDocument(c) {
|
|
1335
|
+
const dict = c.dict || {};
|
|
1336
|
+
const cols = c.columns || {};
|
|
1337
|
+
const regionCols = cols.region || [];
|
|
1338
|
+
const spotCols = cols.spotlight || [];
|
|
1339
|
+
const lineageCols = cols.lineage || [];
|
|
1340
|
+
const legend = c.legend || {};
|
|
1341
|
+
|
|
1342
|
+
const decodeTable = (table, colNames) => {
|
|
1343
|
+
const n = table?.n || 0;
|
|
1344
|
+
const src = table?.cols || {};
|
|
1345
|
+
const rows = new Array(n);
|
|
1346
|
+
for (let i = 0; i < n; i++) rows[i] = {};
|
|
1347
|
+
for (const col of colNames) {
|
|
1348
|
+
const arr = src[col];
|
|
1349
|
+
const d = dict[col];
|
|
1350
|
+
for (let i = 0; i < n; i++) {
|
|
1351
|
+
const v = arr ? arr[i] : undefined;
|
|
1352
|
+
rows[i][col] = d ? d[v] : v;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return { rows, src };
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
const files = (c.files || []).map((fc) => {
|
|
1359
|
+
const rdec = decodeTable(fc.regions, regionCols);
|
|
1360
|
+
const regions = rdec.rows;
|
|
1361
|
+
const rsrc = rdec.src;
|
|
1362
|
+
for (let i = 0; i < regions.length; i++) {
|
|
1363
|
+
const region = regions[i];
|
|
1364
|
+
const decodeOps = region.decodeOps;
|
|
1365
|
+
region.perf = { costClass: region.costClass, decodeOps, callFrames: region.callFrames };
|
|
1366
|
+
delete region.costClass;
|
|
1367
|
+
delete region.decodeOps;
|
|
1368
|
+
delete region.callFrames;
|
|
1369
|
+
region.lineage = rsrc.lineage
|
|
1370
|
+
? (rsrc.lineage[i] || []).map((t) => {
|
|
1371
|
+
const step = {};
|
|
1372
|
+
for (let k = 0; k < lineageCols.length; k++) {
|
|
1373
|
+
const lc = lineageCols[k];
|
|
1374
|
+
step[lc] = dict[lc] ? dict[lc][t[k]] : t[k];
|
|
1375
|
+
}
|
|
1376
|
+
return step;
|
|
1377
|
+
})
|
|
1378
|
+
: [];
|
|
1379
|
+
if (rsrc.lineageCapped && rsrc.lineageCapped[i] != null) {
|
|
1380
|
+
region.lineageCapped = rsrc.lineageCapped[i];
|
|
1381
|
+
}
|
|
1382
|
+
const lg = legend[region.reversalClass] || {};
|
|
1383
|
+
region.why = lg.why == null ? undefined : lg.why;
|
|
1384
|
+
region.tier = lg.tier == null ? null : lg.tier;
|
|
1385
|
+
region.ceiling = lg.ceiling == null ? null : lg.ceiling;
|
|
1386
|
+
region.annotations = decodeOps > 0 ? ["materializationSite"] : [];
|
|
1387
|
+
region.outputSpan = null;
|
|
1388
|
+
}
|
|
1389
|
+
const sdec = decodeTable(fc.spotlights, spotCols);
|
|
1390
|
+
return {
|
|
1391
|
+
file: fc.file,
|
|
1392
|
+
regions,
|
|
1393
|
+
spotlights: sdec.rows,
|
|
1394
|
+
aggregate: fc.aggregate,
|
|
1395
|
+
renamedSpans: fc.renamedSpans || [],
|
|
1396
|
+
extractedSpans: fc.extractedSpans || [],
|
|
1397
|
+
};
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1400
|
+
return {
|
|
1401
|
+
schemaVersion: c.schemaVersion,
|
|
1402
|
+
...(c.spanUnits !== undefined ? { spanUnits: c.spanUnits } : {}),
|
|
1403
|
+
generatedAt: c.generatedAt !== undefined ? c.generatedAt : null,
|
|
1404
|
+
engine: c.engine !== undefined ? c.engine : null,
|
|
1405
|
+
files,
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
async function afterpackInflateBase64Gzip(b64) {
|
|
1410
|
+
var binary = atob(b64);
|
|
1411
|
+
var bytes = new Uint8Array(binary.length);
|
|
1412
|
+
for (var i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
1413
|
+
var stream = new Blob([bytes]).stream().pipeThrough(new DecompressionStream("gzip"));
|
|
1414
|
+
var buf = await new Response(stream).arrayBuffer();
|
|
1415
|
+
return new TextDecoder().decode(buf);
|
|
1416
|
+
}
|
|
1417
|
+
</script>
|
|
1418
|
+
<script>
|
|
1419
|
+
(async function () {
|
|
1420
|
+
"use strict";
|
|
1421
|
+
|
|
1422
|
+
var dataEl = document.getElementById("afterpack-data");
|
|
1423
|
+
var DATA = null;
|
|
1424
|
+
var MAP_BYTES = null;
|
|
1425
|
+
var MAP_ENCODING = "";
|
|
1426
|
+
var codeBodyEl = document.getElementById("code-body");
|
|
1427
|
+
try {
|
|
1428
|
+
var payload = dataEl.textContent.trim();
|
|
1429
|
+
MAP_ENCODING = payload.charAt(0) === "{" ? "raw JSON" : "gzip";
|
|
1430
|
+
MAP_BYTES = payload.charAt(0) === "{"
|
|
1431
|
+
? new TextEncoder().encode(payload).length
|
|
1432
|
+
: Math.floor(payload.replace(/=+$/, "").length * 3 / 4);
|
|
1433
|
+
if (payload.charAt(0) === "{") {
|
|
1434
|
+
DATA = JSON.parse(payload);
|
|
1435
|
+
} else {
|
|
1436
|
+
codeBodyEl.textContent = "Decompressing Protection Map…";
|
|
1437
|
+
var json = await afterpackInflateBase64Gzip(payload);
|
|
1438
|
+
DATA = afterpackDecodeDocument(JSON.parse(json));
|
|
1439
|
+
}
|
|
1440
|
+
} catch (e) {
|
|
1441
|
+
codeBodyEl.textContent = "Failed to load embedded Protection Map data: " + e.message;
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
if (!DATA || !Array.isArray(DATA.files)) DATA = { files: [] };
|
|
1445
|
+
|
|
1446
|
+
function s2lin(c) { return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); }
|
|
1447
|
+
function lin2s(c) { c = Math.max(0, Math.min(1, c)); return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055; }
|
|
1448
|
+
function hex2rgb(hex) {
|
|
1449
|
+
hex = hex.trim().replace(/^#/, "");
|
|
1450
|
+
if (hex.length === 3) hex = hex.split("").map(function (c) { return c + c; }).join("");
|
|
1451
|
+
return [0, 2, 4].map(function (i) { return parseInt(hex.slice(i, i + 2), 16) / 255; });
|
|
1452
|
+
}
|
|
1453
|
+
function rgb2hex(rgb) {
|
|
1454
|
+
function to255(c) { return Math.round(Math.max(0, Math.min(1, c)) * 255).toString(16).padStart(2, "0"); }
|
|
1455
|
+
return "#" + rgb.map(to255).join("");
|
|
1456
|
+
}
|
|
1457
|
+
function oklabFromLin(rgb) {
|
|
1458
|
+
var r = rgb[0], g = rgb[1], b = rgb[2];
|
|
1459
|
+
var l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
1460
|
+
var m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
1461
|
+
var s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
1462
|
+
return [
|
|
1463
|
+
0.2104542553 * l + 0.7936177850 * m - 0.0040720468 * s,
|
|
1464
|
+
1.9779984951 * l - 2.4285922050 * m + 0.4505937099 * s,
|
|
1465
|
+
0.0259040371 * l + 0.7827717662 * m - 0.8086757660 * s
|
|
1466
|
+
];
|
|
1467
|
+
}
|
|
1468
|
+
function linFromOklab(lab) {
|
|
1469
|
+
var L = lab[0], a = lab[1], b = lab[2];
|
|
1470
|
+
var l_ = L + 0.3963377774 * a + 0.2158037573 * b;
|
|
1471
|
+
var m_ = L - 0.1055613458 * a - 0.0638541728 * b;
|
|
1472
|
+
var s_ = L - 0.0894841775 * a - 1.2914855480 * b;
|
|
1473
|
+
var l = l_ * l_ * l_, m = m_ * m_ * m_, s = s_ * s_ * s_;
|
|
1474
|
+
return [
|
|
1475
|
+
+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
|
|
1476
|
+
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
|
|
1477
|
+
-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s
|
|
1478
|
+
];
|
|
1479
|
+
}
|
|
1480
|
+
function hex2oklab(hex) { return oklabFromLin(hex2rgb(hex).map(s2lin)); }
|
|
1481
|
+
function oklab2hex(lab) { return rgb2hex(linFromOklab(lab).map(lin2s)); }
|
|
1482
|
+
function rampColor(stops, t) {
|
|
1483
|
+
t = Math.max(0, Math.min(1, t));
|
|
1484
|
+
var n = stops.length;
|
|
1485
|
+
var pos = t * (n - 1);
|
|
1486
|
+
var i = Math.min(n - 2, Math.floor(pos));
|
|
1487
|
+
var f = pos - i;
|
|
1488
|
+
var a = hex2oklab(stops[i]), b = hex2oklab(stops[i + 1]);
|
|
1489
|
+
var lab = [a[0] + (b[0] - a[0]) * f, a[1] + (b[1] - a[1]) * f, a[2] + (b[2] - a[2]) * f];
|
|
1490
|
+
return oklab2hex(lab);
|
|
1491
|
+
}
|
|
1492
|
+
function hexToRgba(hex, a) {
|
|
1493
|
+
var rgb = hex2rgb(hex).map(function (c) { return Math.round(c * 255); });
|
|
1494
|
+
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a.toFixed(3) + ")";
|
|
1495
|
+
}
|
|
1496
|
+
function readVar(name) { return getComputedStyle(document.documentElement).getPropertyValue(name).trim(); }
|
|
1497
|
+
function currentRamp(prefix) {
|
|
1498
|
+
var out = [];
|
|
1499
|
+
for (var i = 0; i <= 6; i++) out.push(readVar("--" + prefix + "-" + i));
|
|
1500
|
+
return out;
|
|
1501
|
+
}
|
|
1502
|
+
function tokenAlpha(m) { return m <= 0 ? 0 : Math.min(0.5, 0.10 + (m / 100) * 0.42); }
|
|
1503
|
+
var RENAMED_WASH_ALPHA = 0.16;
|
|
1504
|
+
var EXTRACTED_WASH_ALPHA = 0.22;
|
|
1505
|
+
function lineAlpha(m) { return m < 60 ? 0 : Math.min(0.07, ((m - 60) / 40) * 0.07); }
|
|
1506
|
+
function heatSolid(score) { return rampColor(currentRamp("heat"), Math.max(0, Math.min(100, score)) / 100); }
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
var INK_MIN_CONTRAST = 4.2;
|
|
1510
|
+
var INK_COLORS = ["--syn-key", "--syn-str", "--syn-num"];
|
|
1511
|
+
function relLuminance(rgb01) {
|
|
1512
|
+
var c = rgb01.map(function (v) { return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); });
|
|
1513
|
+
return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
|
|
1514
|
+
}
|
|
1515
|
+
function contrastRatio(a01, b01) {
|
|
1516
|
+
var la = relLuminance(a01), lb = relLuminance(b01);
|
|
1517
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
1518
|
+
}
|
|
1519
|
+
function inkYieldScore(heatRamp) {
|
|
1520
|
+
var ground = hex2rgb(readVar("--ground"));
|
|
1521
|
+
var inks = INK_COLORS.map(function (n) { return hex2rgb(readVar(n)); });
|
|
1522
|
+
for (var m = 1; m <= 100; m++) {
|
|
1523
|
+
var c = hex2rgb(rampColor(heatRamp, m / 100));
|
|
1524
|
+
var a = tokenAlpha(m);
|
|
1525
|
+
var comp = [a * c[0] + (1 - a) * ground[0], a * c[1] + (1 - a) * ground[1], a * c[2] + (1 - a) * ground[2]];
|
|
1526
|
+
for (var k = 0; k < inks.length; k++) {
|
|
1527
|
+
if (contrastRatio(inks[k], comp) < INK_MIN_CONTRAST) return m;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return 101;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
function escapeHtml(str) {
|
|
1534
|
+
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1535
|
+
}
|
|
1536
|
+
function escapeAttr(str) {
|
|
1537
|
+
return escapeHtml(str).replace(/"/g, """);
|
|
1538
|
+
}
|
|
1539
|
+
function fmtBytes(n) {
|
|
1540
|
+
if (n == null) return "—";
|
|
1541
|
+
if (n < 1024) return n + " B";
|
|
1542
|
+
if (n < 1024 * 1024) return (n / 1024).toFixed(1) + " KB";
|
|
1543
|
+
return (n / (1024 * 1024)).toFixed(2) + " MB";
|
|
1544
|
+
}
|
|
1545
|
+
function fmtNum(n) { return n == null ? "—" : n.toLocaleString(); }
|
|
1546
|
+
|
|
1547
|
+
var CLASS_ORDER = ["preserved", "renamed-encoded", "flattened-fused", "destroyed-fused"];
|
|
1548
|
+
var CLASS_META = {
|
|
1549
|
+
"preserved": { label: "Preserved", note: "Left readable — either the engine had to keep it literal (import path, directive, property key) or no transform reached it. Not a claim about who wrote it." },
|
|
1550
|
+
"renamed-encoded": { label: "Renamed & encoded", note: "Identifiers renamed, constants rebuilt at use sites. Recoverable with effort. (Free)" },
|
|
1551
|
+
"flattened-fused": { label: "Flattened & fused", note: "Control flow flattened, logic fused into an equivalent-but-different program. (Free ceiling)" },
|
|
1552
|
+
"destroyed-fused": { label: "Destroyed & fused", note: "Boundary-destroying fusion across the bundle — recovering authored structure is computationally infeasible for a static reader. (Pro)" }
|
|
1553
|
+
};
|
|
1554
|
+
var CATEGORY_LABEL = { Data: "data", Structural: "struct", Control: "control" };
|
|
1555
|
+
var WARN_ICON =
|
|
1556
|
+
'<span class="pin" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" ' +
|
|
1557
|
+
'stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">' +
|
|
1558
|
+
'<path d="M8 2.2 15 14H1z"/><path d="M8 6.4v3.4"/><path d="M8 11.8h.01"/></svg></span>';
|
|
1559
|
+
var SEVERITY_ICON = { leak: "🔓", propertyName: "🔑", weak: "〰" };
|
|
1560
|
+
var SEVERITY_LABEL = { leak: "Leak", propertyName: "Property name", weak: "Weak" };
|
|
1561
|
+
var MACHINERY_BLURB = "Whole-file pipeline bookkeeping — materialization plumbing, wrapper IIFEs, cached-string tables, and similar — that doesn't map to any specific span of your source. Excluded from the heat map and from token selection on purpose: every character in the file technically falls inside this bucket, so painting or selecting it would make the whole file look uniformly “protected” and hide the real, per-token signal underneath.";
|
|
1562
|
+
var UNTRANSFORMED_BLURB = "This span is unlit because it is genuinely plain — required syntax the build keeps verbatim (a keyword, punctuation, a property key, or a module specifier), or code your bundler removed before AfterPack ran. Renamed identifiers are shown on their own baseline layer, so an unlit span is almost always one that is truly unchanged or was already gone — not a renamed identifier. Unlit here means plain-or-removed, not “untransformed but still exposed”.";
|
|
1563
|
+
|
|
1564
|
+
var INSP_COPY = {
|
|
1565
|
+
score: "The engine's 0–100 protection score for this span — how hard the ledger says this region is to reverse.",
|
|
1566
|
+
why: "The engine's own one-line account of what it did to this span.",
|
|
1567
|
+
leakCap: "A readable literal survived un-encoded inside this span — the leaked literal itself is UNPROTECTED. The score and class on this card rate the surrounding transformed code, not the leak.",
|
|
1568
|
+
spanMismatch: "This region is a string-materialization site — it encodes exactly one literal — but its recorded span covers no literal at all. Ledger spans are back-mapped from your bundled output through source maps, and a minifier's map resolves a position to the nearest mapping segment, not to the token: the encoded literal in `role === \"owner\"` back-maps onto `role`. The transform is real; the painted extent is wrong. Builds from August 2026 on re-anchor such a region onto the literal itself, and send it to Machinery when the literal is not inside the span at all — so this flag means the map predates that fix.",
|
|
1569
|
+
transforms: "Transform passes the ledger recorded on this span.",
|
|
1570
|
+
chainTop: "The oldest step of this span's transform chain. Open “Transform chain” below for the rest.",
|
|
1571
|
+
chainNone: "This map carries the per-region totals but not the per-step column — the cloud artifact drops it so a several-hundred-file map stays small. It is a size trade-off, not a missing transform.",
|
|
1572
|
+
sizeDelta: "The engine's estimate of the output bytes this span's transforms added. An estimate, not a byte-exact count.",
|
|
1573
|
+
decodeOps: "A per-site STATIC op count for decoding this span at runtime — not amortized over loops or repeated calls.",
|
|
1574
|
+
entropy: "The engine's RAW per-span entropy figure — an unbounded count (0 to the high tens on a real build), not a ratio. It is a different quantity from the file's “avg entropy”, which is a normalised 0–1 hint: do not compare the two.",
|
|
1575
|
+
entropyAvg: "The file's average entropy hint, normalised to 0–1. A different quantity from a region's raw entropy figure — the two are not comparable.",
|
|
1576
|
+
ceiling: "The strongest reversal class a Pro directive could pin this exact span to. An upgrade option, not a gap in this build.",
|
|
1577
|
+
ceilingNone: "No stronger class is offered for this span in this build.",
|
|
1578
|
+
preservedMust: "must stay literal",
|
|
1579
|
+
preservedLowered: "Structure was lowered/desugared, but identifiers and values stay readable — no rename or encoding ran on this span.",
|
|
1580
|
+
preservedNone: "No transform ran on this span — left readable.",
|
|
1581
|
+
preservedState: "Why this span was left readable. “must stay literal” is a structural requirement the engine cannot break; “lowered only” means transforms ran but none of them renamed or encoded anything here.",
|
|
1582
|
+
renamedLayer: "The rename baseline — the bottom tier of the map. A region always wins the fill over it, so this token carries no hardened transform.",
|
|
1583
|
+
renamedStrength: "Renaming hides intent but is low-effort to undo. Real protection is the hardened regions (materialization / control-flow / MBA).",
|
|
1584
|
+
renamedOutput: "This identifier's original name is not in your shipped output. Your bundler minified it and AfterPack re-renamed it under this build's seed.",
|
|
1585
|
+
extractedLayer: "The extraction lane — one tier above the rename baseline, below any hardened region. Property names and free globals are hoisted into a whole-program constant pool and reached through a computed lookup, so the readable name is gone from every access site.",
|
|
1586
|
+
extractedStrength: "Stronger than a rename (the name leaves the call site entirely) but still injective: the pool declaration holds each name literally, so a reader who finds the pool can undo it. Real protection is the hardened regions (materialization / control-flow / MBA).",
|
|
1587
|
+
extractedOutput: "In your output this token is a computed lookup into the constant pool, not a readable name.",
|
|
1588
|
+
extractedKind: "What was extracted: a PROPERTY name (a member access or an object-literal key) or a free/GLOBAL identifier.",
|
|
1589
|
+
gapAbuts: "Ledger spans are back-mapped from your bundled output through source maps, and at that resolution a region edge can land a token short. This token may well be inside that region's transform even though the recorded span stops before it.",
|
|
1590
|
+
gapClear: "No region edge is adjacent to this token, so this is not a clipped span.",
|
|
1591
|
+
gapNone: "No ledger region was recorded anywhere near this token.",
|
|
1592
|
+
coverage: "Share of this file's characters, measured over the same spans the code pane paints. Ledger region, Extracted only, Renamed only and Plain are the four disjoint buckets every character falls into, in that priority order, so they add up to the whole file. A ledger region is recorded only where a transform cleared the entropy funnel, so a large plain share is normal — most of a source file is syntax, and syntax cannot be obfuscated away.",
|
|
1593
|
+
severity: "How the engine classed this weak spot.",
|
|
1594
|
+
sample: "The exact text that survived readable in your output.",
|
|
1595
|
+
mechanism: "The engine's mechanism code for this weak spot, glossed in plain English.",
|
|
1596
|
+
disposition: "What the engine decided to do about this weak spot.",
|
|
1597
|
+
bytes: "The engine's estimate of the added output bytes for this site, not a byte-exact count.",
|
|
1598
|
+
avgScore: "Width-weighted average protection score across the spans of this file that carry a ledger region. It says nothing about how MUCH of the file has one — see “Attributed”.",
|
|
1599
|
+
fileRegions: "Ledger regions recorded in this file, excluding the whole-file scaffolding bucket.",
|
|
1600
|
+
selectHint: "Click (or focus + Enter/Space) any token in the code pane. Clicking whitespace, the gutter, or anywhere off the code returns here.",
|
|
1601
|
+
weakSpots: "Weak spots recorded in THIS file — readable literals this build left in the output. Every one is listed below, with a jump to its exact position. The file-tree header counts them across the whole build.",
|
|
1602
|
+
leaks: "The subset of this file's weak spots whose severity is “leak”: a literal that survived unprotected. The rest are residual property names, which the engine has to keep literal for your object to keep working.",
|
|
1603
|
+
noRegion: "No ledger region covers this span."
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
var HUMANIZE = {
|
|
1607
|
+
"module-specifier": "import path — must stay literal to resolve the module",
|
|
1608
|
+
"non-computed-key": "property key — must stay literal to keep your object working",
|
|
1609
|
+
"directive": "directive (e.g. \"use client\") — must stay literal",
|
|
1610
|
+
"reflection": "read by name at runtime — renaming it would break reflection",
|
|
1611
|
+
"external": "external reference — resolved outside this bundle",
|
|
1612
|
+
"ReachableConst": "a reachable constant the reader can still follow to its value"
|
|
1613
|
+
};
|
|
1614
|
+
function humanize(code) {
|
|
1615
|
+
if (code == null || code === "") return "";
|
|
1616
|
+
return HUMANIZE[code] || String(code);
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
function classChipHtml(cls, ghost, labelOverride) {
|
|
1620
|
+
var meta = CLASS_META[cls] || { label: cls };
|
|
1621
|
+
var label = labelOverride != null ? labelOverride : meta.label;
|
|
1622
|
+
return '<span class="class-chip' + (ghost ? " is-ghost" : "") + '" data-class="' + cls + '"><span class="dot" aria-hidden="true"></span>' + escapeHtml(label) + "</span>";
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
var GRAMMARS = [
|
|
1626
|
+
{
|
|
1627
|
+
id: "js",
|
|
1628
|
+
label: "JS / TS",
|
|
1629
|
+
ext: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
|
|
1630
|
+
typed: ["ts", "tsx", "mts", "cts"],
|
|
1631
|
+
line: "//", block: ["/*", "*/"],
|
|
1632
|
+
quotes: "'\"", template: "`", regex: true,
|
|
1633
|
+
keywords: "abstract any as asserts async await bigint boolean break case catch class const continue debugger declare default delete do else enum export extends false finally for from function if implements import in infer instanceof interface is keyof let never new null number object of override private protected public readonly return satisfies static string super switch symbol this throw true try type typeof undefined unique unknown var void while with yield"
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
id: "json",
|
|
1637
|
+
label: "JSON",
|
|
1638
|
+
ext: ["json", "jsonc", "json5"],
|
|
1639
|
+
line: "//", block: ["/*", "*/"],
|
|
1640
|
+
quotes: "\"", template: "", regex: false,
|
|
1641
|
+
keywords: "true false null"
|
|
1642
|
+
}
|
|
1643
|
+
];
|
|
1644
|
+
var GRAMMAR_BY_EXT = {};
|
|
1645
|
+
GRAMMARS.forEach(function (g) {
|
|
1646
|
+
g.kw = {};
|
|
1647
|
+
g.keywords.split(" ").forEach(function (w) { if (w) g.kw[w] = true; });
|
|
1648
|
+
g.typedExt = {};
|
|
1649
|
+
(g.typed || []).forEach(function (e) { g.typedExt[e] = true; });
|
|
1650
|
+
g.ext.forEach(function (e) { GRAMMAR_BY_EXT[e] = g; });
|
|
1651
|
+
});
|
|
1652
|
+
function extOf(path) {
|
|
1653
|
+
var m = /\.([A-Za-z0-9]+)(?:[?#][^./\\]*)?$/.exec(path || "");
|
|
1654
|
+
return m ? m[1].toLowerCase() : null;
|
|
1655
|
+
}
|
|
1656
|
+
function grammarFor(path) {
|
|
1657
|
+
var e = extOf(path);
|
|
1658
|
+
return e ? GRAMMAR_BY_EXT[e] || null : null;
|
|
1659
|
+
}
|
|
1660
|
+
function isTypedPath(path) {
|
|
1661
|
+
var e = extOf(path), g = e ? GRAMMAR_BY_EXT[e] : null;
|
|
1662
|
+
return !!(g && g.typedExt[e]);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
var SYN_CLASS = { c: "sy-c", k: "sy-k", v: "sy-k", s: "sy-s", n: "sy-n" };
|
|
1666
|
+
var TOKEN_KIND = {
|
|
1667
|
+
w: "whitespace", p: "punctuation / operator", i: "identifier", y: "property name",
|
|
1668
|
+
k: "keyword", s: "string literal", n: "number literal", c: "comment", "?": "source text",
|
|
1669
|
+
v: "value literal"
|
|
1670
|
+
};
|
|
1671
|
+
var VALUE_LITERAL_TEXT = { "null": 1, "true": 1, "false": 1, "undefined": 1 };
|
|
1672
|
+
var NO_REGEX_AFTER = { "this": 1, "true": 1, "false": 1, "null": 1, "undefined": 1, "super": 1 };
|
|
1673
|
+
|
|
1674
|
+
function isSpaceCh(ch) { return ch === " " || ch === "\t" || ch === "\n" || ch === "\r" || ch === "\f" || ch === "\v"; }
|
|
1675
|
+
function isDigitCh(ch) { return ch >= "0" && ch <= "9"; }
|
|
1676
|
+
function isIdStartCh(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || ch === "_" || ch === "$" || ch > "\u007f"; }
|
|
1677
|
+
function isIdPartCh(ch) { return isIdStartCh(ch) || isDigitCh(ch); }
|
|
1678
|
+
|
|
1679
|
+
function lexSource(src, g) {
|
|
1680
|
+
var starts = [], types = [], n = src.length, i = 0;
|
|
1681
|
+
var prevT = "", prevStart = 0, prevEnd = 0;
|
|
1682
|
+
var depth = 0, tplDepth = [];
|
|
1683
|
+
function push(s, t) {
|
|
1684
|
+
starts.push(s); types.push(t);
|
|
1685
|
+
if (t !== "w" && t !== "c") { prevT = t; prevStart = s; prevEnd = i; }
|
|
1686
|
+
}
|
|
1687
|
+
function regexOk() {
|
|
1688
|
+
if (prevT === "") return true;
|
|
1689
|
+
if (prevT === "i" || prevT === "y" || prevT === "n" || prevT === "s") return false;
|
|
1690
|
+
if (prevT === "k") return !NO_REGEX_AFTER[src.slice(prevStart, prevEnd)];
|
|
1691
|
+
var c = src.charAt(prevEnd - 1);
|
|
1692
|
+
return c !== ")" && c !== "]" && c !== "<" && c !== ">" && c !== ".";
|
|
1693
|
+
}
|
|
1694
|
+
function scanTemplate(s) {
|
|
1695
|
+
while (i < n) {
|
|
1696
|
+
var d = src.charAt(i);
|
|
1697
|
+
if (d === "\\") { i += 2; continue; }
|
|
1698
|
+
if (d === g.template) { i++; push(s, "s"); return; }
|
|
1699
|
+
if (d === "$" && src.charAt(i + 1) === "{") {
|
|
1700
|
+
if (i > s) push(s, "s");
|
|
1701
|
+
var ps = i; i += 2; push(ps, "p");
|
|
1702
|
+
tplDepth.push(depth); depth++;
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
i++;
|
|
1706
|
+
}
|
|
1707
|
+
if (i > s) push(s, "s");
|
|
1708
|
+
}
|
|
1709
|
+
while (i < n) {
|
|
1710
|
+
var s = i, c = src.charAt(i), j, d, e;
|
|
1711
|
+
if (isSpaceCh(c)) {
|
|
1712
|
+
while (i < n && isSpaceCh(src.charAt(i))) i++;
|
|
1713
|
+
push(s, "w"); continue;
|
|
1714
|
+
}
|
|
1715
|
+
if ((g.line && src.startsWith(g.line, i)) || (s === 0 && src.startsWith("#!", 0))) {
|
|
1716
|
+
e = src.indexOf("\n", i); i = e < 0 ? n : e; push(s, "c"); continue;
|
|
1717
|
+
}
|
|
1718
|
+
if (g.block && src.startsWith(g.block[0], i)) {
|
|
1719
|
+
e = src.indexOf(g.block[1], i + g.block[0].length);
|
|
1720
|
+
i = e < 0 ? n : e + g.block[1].length; push(s, "c"); continue;
|
|
1721
|
+
}
|
|
1722
|
+
if (g.quotes.indexOf(c) >= 0) {
|
|
1723
|
+
j = i + 1;
|
|
1724
|
+
var closed = false;
|
|
1725
|
+
while (j < n) {
|
|
1726
|
+
d = src.charAt(j);
|
|
1727
|
+
if (d === "\\") { j += 2; continue; }
|
|
1728
|
+
if (d === "\n") break;
|
|
1729
|
+
if (d === c) { j++; closed = true; break; }
|
|
1730
|
+
j++;
|
|
1731
|
+
}
|
|
1732
|
+
if (closed) { i = j; push(s, "s"); } else { i = s + 1; push(s, "p"); }
|
|
1733
|
+
continue;
|
|
1734
|
+
}
|
|
1735
|
+
if (g.template && c === g.template) { i++; scanTemplate(s); continue; }
|
|
1736
|
+
if (c === "{") { i++; depth++; push(s, "p"); continue; }
|
|
1737
|
+
if (c === "}") {
|
|
1738
|
+
i++; if (depth > 0) depth--;
|
|
1739
|
+
push(s, "p");
|
|
1740
|
+
if (tplDepth.length && tplDepth[tplDepth.length - 1] === depth) { tplDepth.pop(); scanTemplate(i); }
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
if (isDigitCh(c) || (c === "." && isDigitCh(src.charAt(i + 1)))) {
|
|
1744
|
+
i++;
|
|
1745
|
+
while (i < n) {
|
|
1746
|
+
d = src.charAt(i);
|
|
1747
|
+
if (isIdPartCh(d) || d === ".") { i++; continue; }
|
|
1748
|
+
e = src.charAt(i - 1);
|
|
1749
|
+
if ((d === "+" || d === "-") && (e === "e" || e === "E") && isDigitCh(src.charAt(i + 1))) { i++; continue; }
|
|
1750
|
+
break;
|
|
1751
|
+
}
|
|
1752
|
+
push(s, "n"); continue;
|
|
1753
|
+
}
|
|
1754
|
+
if (isIdStartCh(c)) {
|
|
1755
|
+
i++;
|
|
1756
|
+
while (i < n && isIdPartCh(src.charAt(i))) i++;
|
|
1757
|
+
var afterDot = prevT === "p" && src.charAt(prevEnd - 1) === ".";
|
|
1758
|
+
push(s, afterDot ? "y" : (g.kw[src.slice(s, i)] ? "k" : "i"));
|
|
1759
|
+
continue;
|
|
1760
|
+
}
|
|
1761
|
+
if (c === "/") {
|
|
1762
|
+
if (g.regex && regexOk()) {
|
|
1763
|
+
j = i + 1;
|
|
1764
|
+
var inClass = false, done = false;
|
|
1765
|
+
while (j < n) {
|
|
1766
|
+
d = src.charAt(j);
|
|
1767
|
+
if (d === "\\") { j += 2; continue; }
|
|
1768
|
+
if (d === "\n") break;
|
|
1769
|
+
if (d === "[") inClass = true;
|
|
1770
|
+
else if (d === "]") inClass = false;
|
|
1771
|
+
else if (d === "/" && !inClass) { j++; done = true; break; }
|
|
1772
|
+
j++;
|
|
1773
|
+
}
|
|
1774
|
+
if (done) {
|
|
1775
|
+
while (j < n && isIdPartCh(src.charAt(j))) j++;
|
|
1776
|
+
i = j; push(s, "s"); continue;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
i++; push(s, "p"); continue;
|
|
1780
|
+
}
|
|
1781
|
+
i++;
|
|
1782
|
+
while (i < n) {
|
|
1783
|
+
d = src.charAt(i);
|
|
1784
|
+
if (isSpaceCh(d) || isIdPartCh(d) || d === "/" || d === "{" || d === "}" ||
|
|
1785
|
+
d === g.template || g.quotes.indexOf(d) >= 0) break;
|
|
1786
|
+
i++;
|
|
1787
|
+
}
|
|
1788
|
+
push(s, "p");
|
|
1789
|
+
}
|
|
1790
|
+
return { starts: starts, types: types.join("") };
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
function lexFile(file) {
|
|
1794
|
+
if (file.syn === undefined) file.syn = file.grammar ? lexSource(file.source, file.grammar) : null;
|
|
1795
|
+
return file.syn;
|
|
1796
|
+
}
|
|
1797
|
+
function tokenIndexAt(syn, pos) {
|
|
1798
|
+
if (!syn) return -1;
|
|
1799
|
+
var lo = 0, hi = syn.starts.length - 1;
|
|
1800
|
+
while (lo < hi) {
|
|
1801
|
+
var mid = (lo + hi + 1) >> 1;
|
|
1802
|
+
if (syn.starts[mid] <= pos) lo = mid; else hi = mid - 1;
|
|
1803
|
+
}
|
|
1804
|
+
return lo;
|
|
1805
|
+
}
|
|
1806
|
+
function tokenEnd(syn, idx, srcLen) { return idx + 1 < syn.starts.length ? syn.starts[idx + 1] : srcLen; }
|
|
1807
|
+
|
|
1808
|
+
var TS_TYPE_CONT = { extends: 1, keyof: 1, typeof: 1, infer: 1, in: 1, is: 1, asserts: 1, readonly: 1, "new": 1, from: 1 };
|
|
1809
|
+
var TS_LINE_CONT = { "|": 1, "&": 1, "?": 1, ":": 1, ".": 1 };
|
|
1810
|
+
var TS_FN_HEAD = { "export": 1, "function": 1, async: 1, declare: 1, "static": 1, "private": 1, "protected": 1, "public": 1, abstract: 1, override: 1 };
|
|
1811
|
+
var TS_HEAD_PREFIX = { "export": 1, declare: 1, "default": 1 };
|
|
1812
|
+
var TS_DECLARE_NEXT = { module: 1, namespace: 1, global: 1 };
|
|
1813
|
+
|
|
1814
|
+
function tsAtoms(src, syn) {
|
|
1815
|
+
var out = [], starts = syn.starts, types = syn.types, n = starts.length, prevEnd = 0;
|
|
1816
|
+
for (var i = 0; i < n; i++) {
|
|
1817
|
+
var t = types.charAt(i);
|
|
1818
|
+
var s = starts[i], e = i + 1 < n ? starts[i + 1] : src.length;
|
|
1819
|
+
if (t === "w" || t === "c") continue;
|
|
1820
|
+
var nl = src.slice(prevEnd, s).indexOf("\n") >= 0;
|
|
1821
|
+
prevEnd = e;
|
|
1822
|
+
if (t === "p") {
|
|
1823
|
+
for (var p = s; p < e; p++) {
|
|
1824
|
+
out.push({ s: p, e: p + 1, t: "p", x: src.charAt(p), nl: nl && p === s });
|
|
1825
|
+
}
|
|
1826
|
+
} else {
|
|
1827
|
+
out.push({ s: s, e: e, t: t, x: t === "i" || t === "y" || t === "k" ? src.slice(s, e) : "", nl: nl });
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
return out;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
function scanTypeRanges(src, syn) {
|
|
1834
|
+
var A = tsAtoms(src, syn), n = A.length, out = [];
|
|
1835
|
+
var stack = [{ kind: "brace", ternary: 0, decl: false, head: null }];
|
|
1836
|
+
var classPending = false;
|
|
1837
|
+
function top() { return stack[stack.length - 1]; }
|
|
1838
|
+
function isName(a) { return !!a && (a.t === "i" || a.t === "k" || a.t === "y"); }
|
|
1839
|
+
function isP(a, ch) { return !!a && a.t === "p" && a.x === ch; }
|
|
1840
|
+
function add(s, e) { if (e > s) out.push([s, e]); }
|
|
1841
|
+
function complete(a) {
|
|
1842
|
+
if (!a) return false;
|
|
1843
|
+
return a.t === "p" ? ")]}>".indexOf(a.x) >= 0 : !TS_TYPE_CONT[a.x];
|
|
1844
|
+
}
|
|
1845
|
+
function continues(a) { return !!a && a.t === "p" && TS_LINE_CONT[a.x] === 1; }
|
|
1846
|
+
function breaksLine(a, prev, k, start) { return k > start && a.nl && complete(prev) && !continues(a); }
|
|
1847
|
+
function consumeType(k) {
|
|
1848
|
+
var depth = 0, prev = null, start = k, fnType = isP(A[k], "(");
|
|
1849
|
+
while (k < n) {
|
|
1850
|
+
var a = A[k];
|
|
1851
|
+
if (depth === 0 && breaksLine(a, prev, k, start)) break;
|
|
1852
|
+
if (a.t === "p") {
|
|
1853
|
+
var c = a.x;
|
|
1854
|
+
if (c === "(" || c === "[" || c === "<" || (c === "{" && (depth > 0 || k === start || !complete(prev)))) {
|
|
1855
|
+
depth++;
|
|
1856
|
+
} else if (c === ")" || c === "]" || c === ">" || c === "}") {
|
|
1857
|
+
if (depth === 0) break;
|
|
1858
|
+
depth--;
|
|
1859
|
+
} else if (depth === 0) {
|
|
1860
|
+
if (c === "," || c === ";" || c === "{") break;
|
|
1861
|
+
if (c === "=") {
|
|
1862
|
+
if (!(fnType && isP(prev, ")") && isP(A[k + 1], ">") && A[k + 1].s === a.e)) break;
|
|
1863
|
+
prev = A[k + 1];
|
|
1864
|
+
k += 2;
|
|
1865
|
+
continue;
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
prev = a;
|
|
1870
|
+
k++;
|
|
1871
|
+
}
|
|
1872
|
+
return k;
|
|
1873
|
+
}
|
|
1874
|
+
function skipBalanced(k, open, close) {
|
|
1875
|
+
var depth = 0;
|
|
1876
|
+
while (k < n) {
|
|
1877
|
+
var a = A[k];
|
|
1878
|
+
if (a.t === "p") {
|
|
1879
|
+
if (a.x === open) depth++;
|
|
1880
|
+
else if (a.x === close) { depth--; if (depth === 0) return k + 1; }
|
|
1881
|
+
}
|
|
1882
|
+
k++;
|
|
1883
|
+
}
|
|
1884
|
+
return -1;
|
|
1885
|
+
}
|
|
1886
|
+
function endOfStatement(k) {
|
|
1887
|
+
var depth = 0, prev = null, start = k;
|
|
1888
|
+
while (k < n) {
|
|
1889
|
+
var a = A[k];
|
|
1890
|
+
if (depth === 0 && breaksLine(a, prev, k, start)) break;
|
|
1891
|
+
if (a.t === "p") {
|
|
1892
|
+
if ("([{<".indexOf(a.x) >= 0) depth++;
|
|
1893
|
+
else if (")]}>".indexOf(a.x) >= 0) { if (depth === 0) break; depth--; }
|
|
1894
|
+
else if (a.x === ";" && depth === 0) return k + 1;
|
|
1895
|
+
}
|
|
1896
|
+
prev = a;
|
|
1897
|
+
k++;
|
|
1898
|
+
}
|
|
1899
|
+
return k;
|
|
1900
|
+
}
|
|
1901
|
+
function headerBrace(k) {
|
|
1902
|
+
var depth = 0;
|
|
1903
|
+
while (k < n) {
|
|
1904
|
+
var a = A[k];
|
|
1905
|
+
if (a.t === "p") {
|
|
1906
|
+
if (a.x === "{" && depth === 0) return k;
|
|
1907
|
+
if ("(<[".indexOf(a.x) >= 0) depth++;
|
|
1908
|
+
else if (")>]".indexOf(a.x) >= 0) { if (depth === 0) return -1; depth--; }
|
|
1909
|
+
else if (a.x === ";" && depth === 0) return -1;
|
|
1910
|
+
else if (a.x === "}" && depth === 0) return -1;
|
|
1911
|
+
}
|
|
1912
|
+
k++;
|
|
1913
|
+
}
|
|
1914
|
+
return -1;
|
|
1915
|
+
}
|
|
1916
|
+
function braceBody(k) { return skipBalanced(k, "{", "}"); }
|
|
1917
|
+
|
|
1918
|
+
var match = new Array(n);
|
|
1919
|
+
var open = [];
|
|
1920
|
+
for (var bi = 0; bi < n; bi++) {
|
|
1921
|
+
if (A[bi].t !== "p") continue;
|
|
1922
|
+
if ("([{".indexOf(A[bi].x) >= 0) open.push(bi);
|
|
1923
|
+
else if (")]}".indexOf(A[bi].x) >= 0 && open.length) {
|
|
1924
|
+
var o = open.pop();
|
|
1925
|
+
match[o] = bi; match[bi] = o;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
function isArrow(i) { return isP(A[i], "=") && isP(A[i + 1], ">") && A[i + 1].s === A[i].e; }
|
|
1929
|
+
function backOverTypeArgs(i) {
|
|
1930
|
+
var d = 0;
|
|
1931
|
+
while (i >= 0) {
|
|
1932
|
+
var a = A[i];
|
|
1933
|
+
if (a.t === "p") {
|
|
1934
|
+
if (a.x === ">") d++;
|
|
1935
|
+
else if (a.x === "<") { d--; if (d === 0) return i; }
|
|
1936
|
+
else if ("(){}[];".indexOf(a.x) >= 0) return -1;
|
|
1937
|
+
}
|
|
1938
|
+
i--;
|
|
1939
|
+
}
|
|
1940
|
+
return -1;
|
|
1941
|
+
}
|
|
1942
|
+
function isParamList(k, encl) {
|
|
1943
|
+
var m = match[k];
|
|
1944
|
+
if (m == null) return false;
|
|
1945
|
+
var nx = A[m + 1];
|
|
1946
|
+
if (isArrow(m + 1)) return true;
|
|
1947
|
+
if (isP(nx, ":") && isArrow(consumeType(m + 2))) return true;
|
|
1948
|
+
if (isP(A[k - 1], ">")) {
|
|
1949
|
+
var lt = backOverTypeArgs(k - 1);
|
|
1950
|
+
if (lt <= 0) return false;
|
|
1951
|
+
k = lt;
|
|
1952
|
+
}
|
|
1953
|
+
var prev = A[k - 1];
|
|
1954
|
+
if (!prev) return false;
|
|
1955
|
+
if (prev.t === "k") return prev.x === "function" || prev.x === "catch";
|
|
1956
|
+
if (!isName(prev)) return false;
|
|
1957
|
+
var pp = A[k - 2];
|
|
1958
|
+
if (pp && pp.t === "k" && (pp.x === "function" || pp.x === "class")) return true;
|
|
1959
|
+
return encl.kind === "classbody" || isP(nx, "{");
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
var head = new Array(n);
|
|
1963
|
+
for (var h = 0; h < n; h++) {
|
|
1964
|
+
head[h] = h === 0 || A[h].nl ||
|
|
1965
|
+
(h > 0 && A[h - 1].t === "k" && TS_HEAD_PREFIX[A[h - 1].x] === 1 && head[h - 1]);
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
var paramParen = {};
|
|
1969
|
+
var k = 0;
|
|
1970
|
+
while (k < n) {
|
|
1971
|
+
var a = A[k], f = top();
|
|
1972
|
+
if (a.nl) { f.decl = false; f.head = null; }
|
|
1973
|
+
if (head[k] && a.t === "k" && f.head === null) f.head = a.x;
|
|
1974
|
+
|
|
1975
|
+
if (a.t === "p") {
|
|
1976
|
+
var c = a.x, j, body;
|
|
1977
|
+
if (c === "(" || c === "[") {
|
|
1978
|
+
var params = c === "(" && isParamList(k, f);
|
|
1979
|
+
if (params) paramParen[k] = true;
|
|
1980
|
+
stack.push({ kind: params ? "params" : "paren", ternary: 0, decl: false, head: null });
|
|
1981
|
+
k++; continue;
|
|
1982
|
+
}
|
|
1983
|
+
if (c === "{") {
|
|
1984
|
+
stack.push({ kind: classPending ? "classbody" : "brace", ternary: 0, decl: false, head: null });
|
|
1985
|
+
classPending = false;
|
|
1986
|
+
k++; continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (c === ")" || c === "]" || c === "}") { if (stack.length > 1) stack.pop(); k++; continue; }
|
|
1989
|
+
if (c === ";") { f.decl = false; f.head = null; k++; continue; }
|
|
1990
|
+
if (c === "=") { classPending = false; k++; continue; }
|
|
1991
|
+
if (c === "?") {
|
|
1992
|
+
var pv = A[k - 1], nx = A[k + 1];
|
|
1993
|
+
var chained = (isP(pv, "?") && pv.e === a.s) || (nx && nx.s === a.e && (nx.x === "." || nx.x === "?"));
|
|
1994
|
+
var optional = nx && nx.t === "p" && (nx.x === ":" || nx.x === ")" || nx.x === "," || nx.x === "]");
|
|
1995
|
+
if (!chained && !optional) f.ternary++;
|
|
1996
|
+
k++; continue;
|
|
1997
|
+
}
|
|
1998
|
+
if (c === ":") {
|
|
1999
|
+
if (f.ternary > 0) { f.ternary--; k++; continue; }
|
|
2000
|
+
var before = A[k - 1];
|
|
2001
|
+
var okBefore = isName(before) || isP(before, "?") || isP(before, ")") ||
|
|
2002
|
+
isP(before, "]") || isP(before, "}");
|
|
2003
|
+
var retType = isP(before, ")") && match[k - 1] != null && paramParen[match[k - 1]] === true;
|
|
2004
|
+
var okFrame = f.kind === "params" || f.kind === "classbody" || retType ||
|
|
2005
|
+
((f.kind === "brace") && (f.decl === true || TS_FN_HEAD[f.head] === 1));
|
|
2006
|
+
if (okBefore && okFrame) {
|
|
2007
|
+
var te = consumeType(k + 1);
|
|
2008
|
+
if (te > k + 1) { add(a.s, A[te - 1].e); k = te; continue; }
|
|
2009
|
+
}
|
|
2010
|
+
k++; continue;
|
|
2011
|
+
}
|
|
2012
|
+
if (c === "<" && isName(A[k - 1]) && A[k - 1].e === a.s) {
|
|
2013
|
+
var d = 0, ok = true, m = k;
|
|
2014
|
+
while (m < n) {
|
|
2015
|
+
var b = A[m];
|
|
2016
|
+
if (b.nl && m > k) { ok = false; break; }
|
|
2017
|
+
if (b.t === "p") {
|
|
2018
|
+
if (b.x === "<") d++;
|
|
2019
|
+
else if (b.x === ">") { d--; if (d === 0) break; }
|
|
2020
|
+
else if ("[],.|&?".indexOf(b.x) < 0) { ok = false; break; }
|
|
2021
|
+
} else if (b.t === "n") { ok = false; break; }
|
|
2022
|
+
m++;
|
|
2023
|
+
}
|
|
2024
|
+
if (ok && m < n && d === 0) {
|
|
2025
|
+
var after = A[m + 1];
|
|
2026
|
+
if (after && after.s === A[m].e && after.t === "p" && after.x === "(") { add(a.s, A[m].e); k = m + 1; continue; }
|
|
2027
|
+
}
|
|
2028
|
+
k++; continue;
|
|
2029
|
+
}
|
|
2030
|
+
k++; continue;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
if (a.t === "k") {
|
|
2034
|
+
if (a.x === "class") { classPending = true; k++; continue; }
|
|
2035
|
+
if (a.x === "const" || a.x === "let" || a.x === "var") { f.decl = true; k++; continue; }
|
|
2036
|
+
if (head[k] && a.x === "interface" && isName(A[k + 1])) {
|
|
2037
|
+
j = headerBrace(k + 1);
|
|
2038
|
+
body = j >= 0 ? braceBody(j) : -1;
|
|
2039
|
+
if (body > 0) { add(a.s, A[body - 1].e); k = body; continue; }
|
|
2040
|
+
k++; continue;
|
|
2041
|
+
}
|
|
2042
|
+
if (head[k] && a.x === "declare" && A[k + 1] &&
|
|
2043
|
+
(A[k + 1].t === "k" || (A[k + 1].t === "i" && TS_DECLARE_NEXT[A[k + 1].x] === 1))) {
|
|
2044
|
+
j = headerBrace(k + 1);
|
|
2045
|
+
body = j >= 0 ? braceBody(j) : -1;
|
|
2046
|
+
if (body < 0) body = endOfStatement(k + 1);
|
|
2047
|
+
if (body > k) { add(a.s, A[body - 1].e); k = body; continue; }
|
|
2048
|
+
k++; continue;
|
|
2049
|
+
}
|
|
2050
|
+
if (head[k] && a.x === "import" && A[k + 1] && A[k + 1].t === "k" && A[k + 1].x === "type") {
|
|
2051
|
+
j = endOfStatement(k + 2);
|
|
2052
|
+
if (j > k) { add(a.s, A[j - 1].e); k = j; continue; }
|
|
2053
|
+
k++; continue;
|
|
2054
|
+
}
|
|
2055
|
+
if (head[k] && a.x === "type" && A[k + 1]) {
|
|
2056
|
+
if (isP(A[k + 1], "{") || isP(A[k + 1], "*")) {
|
|
2057
|
+
j = endOfStatement(k + 1);
|
|
2058
|
+
if (j > k) { add(a.s, A[j - 1].e); k = j; continue; }
|
|
2059
|
+
k++; continue;
|
|
2060
|
+
}
|
|
2061
|
+
if (A[k + 1].t === "i") {
|
|
2062
|
+
j = k + 2;
|
|
2063
|
+
if (isP(A[j], "<")) j = skipBalanced(j, "<", ">");
|
|
2064
|
+
if (j > 0 && isP(A[j], "=")) {
|
|
2065
|
+
var ae = consumeType(j + 1);
|
|
2066
|
+
if (ae > j + 1) { add(a.s, A[ae - 1].e); k = ae; continue; }
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
k++; continue;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
k++;
|
|
2073
|
+
}
|
|
2074
|
+
return out;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
function typeRangesFor(file) {
|
|
2078
|
+
if (file.__typeRanges === undefined) {
|
|
2079
|
+
var syn = lexFile(file);
|
|
2080
|
+
file.__typeRanges = file.isTyped && syn ? scanTypeRanges(file.source, syn) : null;
|
|
2081
|
+
}
|
|
2082
|
+
return file.__typeRanges;
|
|
2083
|
+
}
|
|
2084
|
+
function inTypeRange(ranges, pos) {
|
|
2085
|
+
if (!ranges) return false;
|
|
2086
|
+
var lo = 0, hi = ranges.length - 1;
|
|
2087
|
+
while (lo <= hi) {
|
|
2088
|
+
var mid = (lo + hi) >> 1;
|
|
2089
|
+
if (pos < ranges[mid][0]) hi = mid - 1;
|
|
2090
|
+
else if (pos >= ranges[mid][1]) lo = mid + 1;
|
|
2091
|
+
else return true;
|
|
2092
|
+
}
|
|
2093
|
+
return false;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
function buildByteStarts(str) {
|
|
2097
|
+
var starts = new Array(str.length + 1);
|
|
2098
|
+
var byteOffset = 0;
|
|
2099
|
+
var i = 0;
|
|
2100
|
+
while (i < str.length) {
|
|
2101
|
+
starts[i] = byteOffset;
|
|
2102
|
+
var codePoint = str.codePointAt(i);
|
|
2103
|
+
var units = codePoint > 0xffff ? 2 : 1;
|
|
2104
|
+
var chunkLen =
|
|
2105
|
+
codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;
|
|
2106
|
+
if (units === 2) starts[i + 1] = byteOffset + chunkLen;
|
|
2107
|
+
byteOffset += chunkLen;
|
|
2108
|
+
i += units;
|
|
2109
|
+
}
|
|
2110
|
+
starts[str.length] = byteOffset;
|
|
2111
|
+
return starts;
|
|
2112
|
+
}
|
|
2113
|
+
function makeSameUnits(len) {
|
|
2114
|
+
return function (offset) { return offset > 0 ? (offset < len ? offset : len) : 0; };
|
|
2115
|
+
}
|
|
2116
|
+
function makeByteToChar(str) {
|
|
2117
|
+
var starts = buildByteStarts(str);
|
|
2118
|
+
var len = str.length;
|
|
2119
|
+
return function (byteOffset) {
|
|
2120
|
+
var lo = 0, hi = starts.length - 1;
|
|
2121
|
+
if (byteOffset <= 0) return 0;
|
|
2122
|
+
if (byteOffset >= starts[hi]) return len;
|
|
2123
|
+
while (lo < hi) {
|
|
2124
|
+
var mid = (lo + hi + 1) >> 1;
|
|
2125
|
+
if (starts[mid] <= byteOffset) lo = mid; else hi = mid - 1;
|
|
2126
|
+
}
|
|
2127
|
+
return lo;
|
|
2128
|
+
};
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
function directiveKindOf(keyword) {
|
|
2132
|
+
return keyword === "skip" || keyword === "hardened" || keyword === "destroy"
|
|
2133
|
+
? keyword
|
|
2134
|
+
: "custom";
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
function clampDirectivesToEndMarkers(source, directives) {
|
|
2138
|
+
if (!directives.length) return;
|
|
2139
|
+
var allowed = { end: true };
|
|
2140
|
+
directives.forEach(function (d) { allowed[d.keyword] = true; });
|
|
2141
|
+
var markers = [], re = /@afterpack[ \t]+([A-Za-z][\w-]*)/g, m;
|
|
2142
|
+
while ((m = re.exec(source)) !== null) {
|
|
2143
|
+
if (allowed[m[1]] === true) markers.push({ start: m.index, end: m.index + m[0].length, keyword: m[1] });
|
|
2144
|
+
}
|
|
2145
|
+
if (!markers.length) return;
|
|
2146
|
+
directives.forEach(function (d) {
|
|
2147
|
+
var anchor = -1, best = Infinity, i, mk;
|
|
2148
|
+
for (i = 0; i < markers.length; i++) {
|
|
2149
|
+
mk = markers[i];
|
|
2150
|
+
if (mk.keyword === "end" || mk.keyword !== d.keyword) continue;
|
|
2151
|
+
var dist = Math.abs(mk.start - d.startChar);
|
|
2152
|
+
if (dist < best) { best = dist; anchor = i; }
|
|
2153
|
+
}
|
|
2154
|
+
if (anchor < 0) return;
|
|
2155
|
+
var depth = 0;
|
|
2156
|
+
for (i = anchor + 1; i < markers.length; i++) {
|
|
2157
|
+
mk = markers[i];
|
|
2158
|
+
if (mk.keyword !== "end") { depth++; continue; }
|
|
2159
|
+
if (depth > 0) { depth--; continue; }
|
|
2160
|
+
var eol = source.indexOf("\n", mk.end);
|
|
2161
|
+
var stop = eol < 0 ? source.length : eol;
|
|
2162
|
+
if (stop < d.endChar && stop > d.startChar) d.endChar = stop;
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
function prepareFile(fdoc, fileIdx) {
|
|
2169
|
+
var source = (fdoc.file && fdoc.file.originalSource) || "";
|
|
2170
|
+
var sourceLen = source.length;
|
|
2171
|
+
var byteToChar = DATA.spanUnits === "utf16" ? makeSameUnits(sourceLen) : makeByteToChar(source);
|
|
2172
|
+
|
|
2173
|
+
var regions = (fdoc.regions || []).map(function (r, idx) {
|
|
2174
|
+
var startChar = byteToChar(r.span[0]);
|
|
2175
|
+
var endChar = Math.max(byteToChar(r.span[1]), startChar);
|
|
2176
|
+
var isMachinery = startChar <= 0 && endChar >= sourceLen &&
|
|
2177
|
+
r.reversalClass === "preserved" && (r.score || 0) <= 0;
|
|
2178
|
+
return { idx: idx, raw: r, startChar: startChar, endChar: endChar, width: endChar - startChar, isMachinery: isMachinery };
|
|
2179
|
+
});
|
|
2180
|
+
var machinery = regions.filter(function (r) { return r.isMachinery; })[0] || null;
|
|
2181
|
+
var realRegions = regions.filter(function (r) { return !r.isMachinery; });
|
|
2182
|
+
|
|
2183
|
+
var heatPositive = [], heatMax = 0;
|
|
2184
|
+
realRegions.forEach(function (r) {
|
|
2185
|
+
var s = r.raw.score || 0;
|
|
2186
|
+
if (s > heatMax) heatMax = s;
|
|
2187
|
+
if (s > 0) heatPositive.push(s);
|
|
2188
|
+
});
|
|
2189
|
+
var heatMinPos = heatPositive.length ? Math.min.apply(null, heatPositive) : 0;
|
|
2190
|
+
regions.forEach(function (r) {
|
|
2191
|
+
var s = r.raw.score || 0;
|
|
2192
|
+
if (s <= 0) { r.heatNorm = 0; return; }
|
|
2193
|
+
var norm = heatMax === heatMinPos ? 100 : ((s - heatMinPos) / (heatMax - heatMinPos)) * 100;
|
|
2194
|
+
r.heatNorm = Math.max(1, norm);
|
|
2195
|
+
});
|
|
2196
|
+
|
|
2197
|
+
var spotlights = (fdoc.spotlights || []).map(function (s, idx) {
|
|
2198
|
+
var span = s.span || [0, 0];
|
|
2199
|
+
var startChar = byteToChar(span[0]);
|
|
2200
|
+
var endChar = Math.max(byteToChar(span[1]), startChar);
|
|
2201
|
+
if (s.sample) {
|
|
2202
|
+
var local = source.slice(startChar, endChar);
|
|
2203
|
+
var mid = local.length / 2;
|
|
2204
|
+
var bestIdx = -1, bestDist = Infinity, from = 0, at;
|
|
2205
|
+
while ((at = local.indexOf(s.sample, from)) >= 0) {
|
|
2206
|
+
var dist = Math.abs(at + s.sample.length / 2 - mid);
|
|
2207
|
+
if (dist < bestDist) { bestDist = dist; bestIdx = at; }
|
|
2208
|
+
from = at + 1;
|
|
2209
|
+
}
|
|
2210
|
+
if (bestIdx >= 0) {
|
|
2211
|
+
startChar = startChar + bestIdx;
|
|
2212
|
+
endChar = startChar + s.sample.length;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
return { idx: idx, raw: s, startChar: startChar, endChar: endChar };
|
|
2216
|
+
});
|
|
2217
|
+
|
|
2218
|
+
var renamedRanges = (fdoc.renamedSpans || []).map(function (pair) {
|
|
2219
|
+
var sc = byteToChar(pair[0]);
|
|
2220
|
+
var ec = Math.max(byteToChar(pair[1]), sc);
|
|
2221
|
+
return { startChar: sc, endChar: ec };
|
|
2222
|
+
}).filter(function (r) { return r.endChar > r.startChar; });
|
|
2223
|
+
|
|
2224
|
+
var extractedFlat = fdoc.extractedSpans || [];
|
|
2225
|
+
var extractedRanges = [];
|
|
2226
|
+
for (var xi = 0; xi + 2 < extractedFlat.length; xi += 3) {
|
|
2227
|
+
var xsc = byteToChar(extractedFlat[xi]);
|
|
2228
|
+
var xec = Math.max(byteToChar(extractedFlat[xi + 1]), xsc);
|
|
2229
|
+
if (xec > xsc) {
|
|
2230
|
+
extractedRanges.push({
|
|
2231
|
+
startChar: xsc, endChar: xec,
|
|
2232
|
+
kind: extractedFlat[xi + 2] === 1 ? "global" : "property"
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
var directives = ((fdoc.aggregate && fdoc.aggregate.directives) || []).map(function (d, idx) {
|
|
2238
|
+
var span = d.span || [0, 0];
|
|
2239
|
+
var sc = byteToChar(span[0]);
|
|
2240
|
+
var ec = Math.max(byteToChar(span[1]), sc);
|
|
2241
|
+
return {
|
|
2242
|
+
idx: idx, keyword: d.keyword, kind: directiveKindOf(d.keyword),
|
|
2243
|
+
target: d.target, floor: d.floor, startChar: sc, endChar: ec
|
|
2244
|
+
};
|
|
2245
|
+
}).filter(function (d) { return d.endChar > d.startChar; });
|
|
2246
|
+
clampDirectivesToEndMarkers(source, directives);
|
|
2247
|
+
|
|
2248
|
+
var boundarySet = {};
|
|
2249
|
+
function addB(p) { boundarySet[p] = true; }
|
|
2250
|
+
addB(0); addB(sourceLen);
|
|
2251
|
+
realRegions.forEach(function (r) { addB(r.startChar); addB(r.endChar); });
|
|
2252
|
+
spotlights.forEach(function (s) { addB(s.startChar); addB(s.endChar); });
|
|
2253
|
+
renamedRanges.forEach(function (r) { addB(r.startChar); addB(r.endChar); });
|
|
2254
|
+
extractedRanges.forEach(function (r) { addB(r.startChar); addB(r.endChar); });
|
|
2255
|
+
directives.forEach(function (d) { addB(d.startChar); addB(d.endChar); });
|
|
2256
|
+
var boundaries = Object.keys(boundarySet).map(Number).sort(function (a, b) { return a - b; });
|
|
2257
|
+
|
|
2258
|
+
function winnerFor(start, end) {
|
|
2259
|
+
var best = null;
|
|
2260
|
+
for (var i = 0; i < realRegions.length; i++) {
|
|
2261
|
+
var r = realRegions[i];
|
|
2262
|
+
if (r.startChar <= start && r.endChar >= end) {
|
|
2263
|
+
if (!best || r.width < best.width || (r.width === best.width && (r.raw.score || 0) > (best.raw.score || 0))) best = r;
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return best;
|
|
2267
|
+
}
|
|
2268
|
+
function spotlightForRange(start, end) {
|
|
2269
|
+
for (var i = 0; i < spotlights.length; i++) {
|
|
2270
|
+
var s = spotlights[i];
|
|
2271
|
+
if (s.startChar <= start && s.endChar >= end) return s;
|
|
2272
|
+
}
|
|
2273
|
+
return null;
|
|
2274
|
+
}
|
|
2275
|
+
function renamedForRange(start, end) {
|
|
2276
|
+
for (var i = 0; i < renamedRanges.length; i++) {
|
|
2277
|
+
var r = renamedRanges[i];
|
|
2278
|
+
if (r.startChar <= start && r.endChar >= end) return i;
|
|
2279
|
+
}
|
|
2280
|
+
return -1;
|
|
2281
|
+
}
|
|
2282
|
+
function extractedForRange(start, end) {
|
|
2283
|
+
for (var i = 0; i < extractedRanges.length; i++) {
|
|
2284
|
+
var r = extractedRanges[i];
|
|
2285
|
+
if (r.startChar <= start && r.endChar >= end) return i;
|
|
2286
|
+
}
|
|
2287
|
+
return -1;
|
|
2288
|
+
}
|
|
2289
|
+
function directiveForRange(start, end) {
|
|
2290
|
+
var best = -1, bestW = Infinity;
|
|
2291
|
+
for (var i = 0; i < directives.length; i++) {
|
|
2292
|
+
var d = directives[i];
|
|
2293
|
+
if (d.startChar <= start && d.endChar >= end) {
|
|
2294
|
+
var w = d.endChar - d.startChar;
|
|
2295
|
+
if (w < bestW) { bestW = w; best = i; }
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
return best;
|
|
2299
|
+
}
|
|
2300
|
+
regions.forEach(function (r) {
|
|
2301
|
+
var di = directiveForRange(r.startChar, Math.min(r.startChar + 1, r.endChar));
|
|
2302
|
+
r.directive = di >= 0 ? directives[di] : null;
|
|
2303
|
+
});
|
|
2304
|
+
|
|
2305
|
+
var runs = [];
|
|
2306
|
+
for (var bi = 0; bi < boundaries.length - 1; bi++) {
|
|
2307
|
+
var segStart = boundaries[bi], segEnd = boundaries[bi + 1];
|
|
2308
|
+
if (segEnd <= segStart) continue;
|
|
2309
|
+
var winner = winnerFor(segStart, segEnd);
|
|
2310
|
+
var spot = spotlightForRange(segStart, segEnd);
|
|
2311
|
+
var extIdx = winner ? -1 : extractedForRange(segStart, segEnd);
|
|
2312
|
+
var renIdx = winner || extIdx >= 0 ? -1 : renamedForRange(segStart, segEnd);
|
|
2313
|
+
var dirIdx = directiveForRange(segStart, segEnd);
|
|
2314
|
+
runs.push({
|
|
2315
|
+
start: segStart, end: segEnd,
|
|
2316
|
+
regionIdx: winner ? winner.idx : null,
|
|
2317
|
+
spotlightIdx: spot ? spot.idx : null,
|
|
2318
|
+
renamedIdx: renIdx >= 0 ? renIdx : null,
|
|
2319
|
+
extractedIdx: extIdx >= 0 ? extIdx : null,
|
|
2320
|
+
directiveIdx: dirIdx >= 0 ? dirIdx : null,
|
|
2321
|
+
isSpotlightStart: !!(spot && spot.startChar === segStart)
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
var mergedRuns = [];
|
|
2325
|
+
runs.forEach(function (run) {
|
|
2326
|
+
var last = mergedRuns[mergedRuns.length - 1];
|
|
2327
|
+
if (last && last.regionIdx === run.regionIdx && last.spotlightIdx === run.spotlightIdx && last.renamedIdx === run.renamedIdx && last.extractedIdx === run.extractedIdx && last.directiveIdx === run.directiveIdx && last.end === run.start) {
|
|
2328
|
+
last.end = run.end;
|
|
2329
|
+
} else {
|
|
2330
|
+
mergedRuns.push(run);
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
|
|
2334
|
+
var sumW = 0, totalW = 0;
|
|
2335
|
+
mergedRuns.forEach(function (run) {
|
|
2336
|
+
if (run.regionIdx == null) return;
|
|
2337
|
+
var len = run.end - run.start;
|
|
2338
|
+
sumW += len * (regions[run.regionIdx].raw.score || 0);
|
|
2339
|
+
totalW += len;
|
|
2340
|
+
});
|
|
2341
|
+
var avgScore = totalW > 0 ? sumW / totalW : 0;
|
|
2342
|
+
|
|
2343
|
+
var displayPath = (fdoc.file && fdoc.file.path) || null;
|
|
2344
|
+
var displayName = displayPath ? displayPath.split(/[\\/]+/).pop() : "(unnamed input " + (fileIdx + 1) + ")";
|
|
2345
|
+
var leakCount = (fdoc.aggregate && fdoc.aggregate.leakCount) || 0;
|
|
2346
|
+
var weakSpotCount = spotlights.length ||
|
|
2347
|
+
((fdoc.aggregate && fdoc.aggregate.weakRegions) || 0);
|
|
2348
|
+
|
|
2349
|
+
var covRegion = 0, covRenamed = 0, covExtracted = 0;
|
|
2350
|
+
mergedRuns.forEach(function (run) {
|
|
2351
|
+
var len = run.end - run.start;
|
|
2352
|
+
if (run.regionIdx != null) covRegion += len;
|
|
2353
|
+
else if (run.extractedIdx != null) covExtracted += len;
|
|
2354
|
+
else if (run.renamedIdx != null) covRenamed += len;
|
|
2355
|
+
});
|
|
2356
|
+
|
|
2357
|
+
return {
|
|
2358
|
+
grammar: grammarFor(displayPath || displayName),
|
|
2359
|
+
isTyped: isTypedPath(displayPath || displayName),
|
|
2360
|
+
coverage: {
|
|
2361
|
+
region: covRegion, renamed: covRenamed, extracted: covExtracted,
|
|
2362
|
+
plain: Math.max(0, sourceLen - covRegion - covRenamed - covExtracted), total: sourceLen
|
|
2363
|
+
},
|
|
2364
|
+
fileIdx: fileIdx, doc: fdoc, source: source, sourceLen: sourceLen,
|
|
2365
|
+
regions: regions, realRegions: realRegions, machinery: machinery,
|
|
2366
|
+
spotlights: spotlights, mergedRuns: mergedRuns,
|
|
2367
|
+
renamedRanges: renamedRanges, extractedRanges: extractedRanges, directives: directives,
|
|
2368
|
+
renamedCount: (fdoc.aggregate && fdoc.aggregate.renamedCount != null) ? fdoc.aggregate.renamedCount : renamedRanges.length,
|
|
2369
|
+
extractedCount: (fdoc.aggregate && fdoc.aggregate.extractedCount != null) ? fdoc.aggregate.extractedCount : extractedRanges.length,
|
|
2370
|
+
avgScore: avgScore, leakCount: leakCount, weakSpotCount: weakSpotCount,
|
|
2371
|
+
displayPath: displayPath, displayName: displayName
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
var FILES = DATA.files.map(prepareFile);
|
|
2376
|
+
|
|
2377
|
+
function treePartsFor(f) {
|
|
2378
|
+
return f.displayPath ? f.displayPath.split(/[\\/]+/).filter(Boolean) : [f.displayName];
|
|
2379
|
+
}
|
|
2380
|
+
function buildTree(files) {
|
|
2381
|
+
var root = { type: "folder", name: "", key: "", depth: 0, children: [] };
|
|
2382
|
+
files.forEach(function (f) {
|
|
2383
|
+
var parts = treePartsFor(f);
|
|
2384
|
+
var node = root;
|
|
2385
|
+
var keyAcc = "";
|
|
2386
|
+
for (var i = 0; i < parts.length - 1; i++) {
|
|
2387
|
+
var part = parts[i];
|
|
2388
|
+
keyAcc = keyAcc ? keyAcc + "/" + part : part;
|
|
2389
|
+
var next = null;
|
|
2390
|
+
for (var j = 0; j < node.children.length; j++) {
|
|
2391
|
+
if (node.children[j].type === "folder" && node.children[j].name === part) { next = node.children[j]; break; }
|
|
2392
|
+
}
|
|
2393
|
+
if (!next) { next = { type: "folder", name: part, key: keyAcc, depth: node.depth + 1, children: [] }; node.children.push(next); }
|
|
2394
|
+
node = next;
|
|
2395
|
+
}
|
|
2396
|
+
node.children.push({ type: "file", name: parts[parts.length - 1], depth: node.depth + 1, fileIdx: f.fileIdx });
|
|
2397
|
+
});
|
|
2398
|
+
(function sortNode(node) {
|
|
2399
|
+
node.children.sort(function (a, b) {
|
|
2400
|
+
if (a.type !== b.type) return a.type === "folder" ? -1 : 1;
|
|
2401
|
+
return a.name.localeCompare(b.name);
|
|
2402
|
+
});
|
|
2403
|
+
node.children.forEach(function (c) { if (c.type === "folder") sortNode(c); });
|
|
2404
|
+
})(root);
|
|
2405
|
+
return root;
|
|
2406
|
+
}
|
|
2407
|
+
function collectFolderKeys(node, out) {
|
|
2408
|
+
node.children.forEach(function (c) {
|
|
2409
|
+
if (c.type === "folder") { out.push(c.key); collectFolderKeys(c, out); }
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
var FILTER_ALIAS = {
|
|
2414
|
+
all: "all", app: "app", src: "app", source: "app",
|
|
2415
|
+
vendor: "vendor", node_modules: "vendor",
|
|
2416
|
+
weak: "weak", weakspots: "weak", "weak-spots": "weak", leak: "weak", leaks: "weak",
|
|
2417
|
+
marked: "marked", directive: "marked", directives: "marked"
|
|
2418
|
+
};
|
|
2419
|
+
var RAIL_ALIAS = {
|
|
2420
|
+
collapsed: true, hidden: true, closed: true, off: true,
|
|
2421
|
+
open: false, shown: false, expanded: false, on: false
|
|
2422
|
+
};
|
|
2423
|
+
var WEAKSPOTS_ALIAS = {
|
|
2424
|
+
collapsed: "collapsed", closed: "collapsed", off: "collapsed",
|
|
2425
|
+
hidden: "hidden", none: "hidden",
|
|
2426
|
+
open: "open", expanded: "open", shown: "open", on: "open"
|
|
2427
|
+
};
|
|
2428
|
+
function readHashParams() {
|
|
2429
|
+
var raw = "";
|
|
2430
|
+
try { raw = (window.location && window.location.hash) || ""; } catch (e) { raw = ""; }
|
|
2431
|
+
var out = { file: null, filter: null, unknownFilter: null, rail: null, theme: null, weakspots: null };
|
|
2432
|
+
raw.replace(/^#/, "").split("&").forEach(function (pair) {
|
|
2433
|
+
var eq = pair.indexOf("=");
|
|
2434
|
+
if (eq <= 0) return;
|
|
2435
|
+
var k = pair.slice(0, eq).toLowerCase(), v = pair.slice(eq + 1);
|
|
2436
|
+
try { v = decodeURIComponent(v.replace(/\+/g, " ")); } catch (e) {}
|
|
2437
|
+
if (k === "file" || k === "path") out.file = v;
|
|
2438
|
+
else if (k === "filter" || k === "tab") {
|
|
2439
|
+
var canon = FILTER_ALIAS[v.toLowerCase()];
|
|
2440
|
+
if (canon) out.filter = canon; else out.unknownFilter = v;
|
|
2441
|
+
} else if (k === "rail") {
|
|
2442
|
+
var want = RAIL_ALIAS[v.toLowerCase()];
|
|
2443
|
+
if (typeof want === "boolean") out.rail = want;
|
|
2444
|
+
} else if (k === "theme") {
|
|
2445
|
+
var mode = v.toLowerCase();
|
|
2446
|
+
if (mode === "light" || mode === "dark") out.theme = mode;
|
|
2447
|
+
} else if (k === "weakspots" || k === "weak-spots") {
|
|
2448
|
+
var ws = WEAKSPOTS_ALIAS[v.toLowerCase()];
|
|
2449
|
+
if (ws) out.weakspots = ws;
|
|
2450
|
+
}
|
|
2451
|
+
});
|
|
2452
|
+
return out;
|
|
2453
|
+
}
|
|
2454
|
+
function normPath(p) { return String(p == null ? "" : p).replace(/\\/g, "/").replace(/^\.?\/+/, ""); }
|
|
2455
|
+
function findFileIdxByPath(want) {
|
|
2456
|
+
if (!want) return -1;
|
|
2457
|
+
var w = normPath(want), wl = w.toLowerCase();
|
|
2458
|
+
if (!wl) return -1;
|
|
2459
|
+
var exact = -1, ci = -1, tail = -1, tailN = 0, base = -1, baseN = 0;
|
|
2460
|
+
FILES.forEach(function (f) {
|
|
2461
|
+
var pth = normPath(f.displayPath || f.displayName), pl = pth.toLowerCase();
|
|
2462
|
+
if (exact < 0 && pth === w) exact = f.fileIdx;
|
|
2463
|
+
if (ci < 0 && pl === wl) ci = f.fileIdx;
|
|
2464
|
+
if (pl.length > wl.length && pl.slice(-wl.length) === wl && pl.charAt(pl.length - wl.length - 1) === "/") {
|
|
2465
|
+
tailN++; if (tail < 0) tail = f.fileIdx;
|
|
2466
|
+
}
|
|
2467
|
+
if (pl.split("/").pop() === wl) { baseN++; if (base < 0) base = f.fileIdx; }
|
|
2468
|
+
});
|
|
2469
|
+
if (exact >= 0) return exact;
|
|
2470
|
+
if (ci >= 0) return ci;
|
|
2471
|
+
if (tailN === 1) return tail;
|
|
2472
|
+
if (baseN === 1) return base;
|
|
2473
|
+
return -1;
|
|
2474
|
+
}
|
|
2475
|
+
function setDeeplinkNote(text) {
|
|
2476
|
+
var el = document.getElementById("deeplink-note");
|
|
2477
|
+
if (!el) return;
|
|
2478
|
+
el.textContent = text || "";
|
|
2479
|
+
el.hidden = !text;
|
|
2480
|
+
}
|
|
2481
|
+
function syncHash() {
|
|
2482
|
+
if (typeof history === "undefined" || !history.replaceState) return;
|
|
2483
|
+
var f = state.activeFileIdx >= 0 ? FILES[state.activeFileIdx] : null;
|
|
2484
|
+
var parts = [];
|
|
2485
|
+
if (f) parts.push("file=" + encodeURIComponent(f.displayPath || f.displayName).replace(/%2F/gi, "/"));
|
|
2486
|
+
if (activeFileFilter !== "all") parts.push("filter=" + activeFileFilter);
|
|
2487
|
+
var url = "#" + parts.join("&");
|
|
2488
|
+
if (!parts.length) {
|
|
2489
|
+
var loc = window.location || {};
|
|
2490
|
+
url = (loc.pathname || "") + (loc.search || "");
|
|
2491
|
+
if (!url) return;
|
|
2492
|
+
}
|
|
2493
|
+
try { history.replaceState(null, "", url); } catch (e) {}
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
var HASH0 = readHashParams();
|
|
2497
|
+
var activeFileFilter = "all";
|
|
2498
|
+
var FILE_FILTERS = ["all", "app", "vendor", "weak", "marked"];
|
|
2499
|
+
function isVendorFile(f) { return !!(f && f.doc && f.doc.file && f.doc.file.vendor); }
|
|
2500
|
+
function isMarkedFile(f) { return !!(f && f.directives && f.directives.length); }
|
|
2501
|
+
function isWeakFile(f) { return !!(f && f.weakSpotCount > 0); }
|
|
2502
|
+
function markedKeywords(f) {
|
|
2503
|
+
var seen = {}, out = [];
|
|
2504
|
+
(f.directives || []).forEach(function (d) { if (!seen[d.keyword]) { seen[d.keyword] = 1; out.push(d.keyword); } });
|
|
2505
|
+
return out;
|
|
2506
|
+
}
|
|
2507
|
+
function matchesQuery(f) {
|
|
2508
|
+
var q = (state && state.treeQuery) || "";
|
|
2509
|
+
if (!q) return true;
|
|
2510
|
+
return (f.displayPath || f.displayName || "").toLowerCase().indexOf(q) >= 0;
|
|
2511
|
+
}
|
|
2512
|
+
function filteredFiles() {
|
|
2513
|
+
var base = activeFileFilter === "app" ? FILES.filter(function (f) { return !isVendorFile(f); })
|
|
2514
|
+
: activeFileFilter === "vendor" ? FILES.filter(isVendorFile)
|
|
2515
|
+
: activeFileFilter === "marked" ? FILES.filter(isMarkedFile)
|
|
2516
|
+
: activeFileFilter === "weak" ? FILES.filter(isWeakFile)
|
|
2517
|
+
: FILES;
|
|
2518
|
+
return base.filter(matchesQuery);
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
var deeplinkNote = "";
|
|
2522
|
+
var linkedFileIdx = -1;
|
|
2523
|
+
if (HASH0.unknownFilter) {
|
|
2524
|
+
deeplinkNote = "This link asked for an unknown filter (“" + HASH0.unknownFilter + "”) — showing all files.";
|
|
2525
|
+
} else if (HASH0.filter && HASH0.filter !== "all") {
|
|
2526
|
+
activeFileFilter = HASH0.filter;
|
|
2527
|
+
if (!filteredFiles().length) {
|
|
2528
|
+
deeplinkNote = "No file in this build matches the “" + HASH0.filter + "” filter — showing all files.";
|
|
2529
|
+
activeFileFilter = "all";
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
if (HASH0.file) {
|
|
2533
|
+
linkedFileIdx = findFileIdxByPath(HASH0.file);
|
|
2534
|
+
if (linkedFileIdx < 0) {
|
|
2535
|
+
deeplinkNote = (deeplinkNote ? deeplinkNote + " " : "") +
|
|
2536
|
+
"“" + HASH0.file + "” is not in this Protection Map — showing the first file instead.";
|
|
2537
|
+
} else if (!filteredFiles().some(function (f) { return f.fileIdx === linkedFileIdx; })) {
|
|
2538
|
+
activeFileFilter = "all";
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
var TREE = buildTree(filteredFiles());
|
|
2543
|
+
var allFolderKeys = [];
|
|
2544
|
+
collectFolderKeys(TREE, allFolderKeys);
|
|
2545
|
+
|
|
2546
|
+
function ancestorExpansion(fileIdx) {
|
|
2547
|
+
var out = {};
|
|
2548
|
+
var f = fileIdx >= 0 ? FILES[fileIdx] : null;
|
|
2549
|
+
if (!f) return out;
|
|
2550
|
+
var parts = treePartsFor(f), acc = "";
|
|
2551
|
+
for (var i = 0; i < parts.length - 1; i++) {
|
|
2552
|
+
acc = acc ? acc + "/" + parts[i] : parts[i];
|
|
2553
|
+
out[acc] = true;
|
|
2554
|
+
}
|
|
2555
|
+
return out;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
var initialFileIdx = (function () {
|
|
2559
|
+
if (linkedFileIdx >= 0) return linkedFileIdx;
|
|
2560
|
+
var visible = filteredFiles();
|
|
2561
|
+
return visible.length ? visible[0].fileIdx : (FILES.length ? 0 : -1);
|
|
2562
|
+
})();
|
|
2563
|
+
var state = {
|
|
2564
|
+
activeFileIdx: initialFileIdx,
|
|
2565
|
+
selection: null,
|
|
2566
|
+
highlightClassOn: false,
|
|
2567
|
+
syntaxOn: true,
|
|
2568
|
+
railCollapsed: false,
|
|
2569
|
+
railManual: false,
|
|
2570
|
+
inspectorCollapsed: false,
|
|
2571
|
+
treeQuery: "",
|
|
2572
|
+
expandedFolders: ancestorExpansion(initialFileIdx)
|
|
2573
|
+
};
|
|
2574
|
+
function activeFile() { return state.activeFileIdx >= 0 ? FILES[state.activeFileIdx] : null; }
|
|
2575
|
+
function revealActiveFile() {
|
|
2576
|
+
var open = ancestorExpansion(state.activeFileIdx);
|
|
2577
|
+
for (var k in open) {
|
|
2578
|
+
if (Object.prototype.hasOwnProperty.call(open, k)) state.expandedFolders[k] = true;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
var FACET_EXPANDS_ALL = { weak: 1, marked: 1 };
|
|
2582
|
+
function facetExpandsAll() { return !!(state.treeQuery || FACET_EXPANDS_ALL[activeFileFilter]); }
|
|
2583
|
+
function reapplyExpansion() {
|
|
2584
|
+
if (facetExpandsAll()) allFolderKeys.forEach(function (k) { state.expandedFolders[k] = true; });
|
|
2585
|
+
revealActiveFile();
|
|
2586
|
+
}
|
|
2587
|
+
function regionByIdx(file, idx) { return idx == null ? null : file.regions[idx]; }
|
|
2588
|
+
function sourceOriginOf(file) { return (file.doc.file && file.doc.file.sourceOrigin) || "engineInput"; }
|
|
2589
|
+
|
|
2590
|
+
var codeBody = document.getElementById("code-body");
|
|
2591
|
+
|
|
2592
|
+
function metricForRegion(region) {
|
|
2593
|
+
return region ? (region.heatNorm || 0) : 0;
|
|
2594
|
+
}
|
|
2595
|
+
function isPreservedRegion(region) {
|
|
2596
|
+
return !!(region && (region.raw.preservedReason || region.raw.reversalClass === "preserved"));
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
function paintCode(file) {
|
|
2600
|
+
var heatRamp = currentRamp("heat");
|
|
2601
|
+
var renamedHex = readVar("--class-renamed");
|
|
2602
|
+
var inkYield = inkYieldScore(heatRamp);
|
|
2603
|
+
var src = file.source;
|
|
2604
|
+
|
|
2605
|
+
var syn = lexFile(file);
|
|
2606
|
+
var typeRanges = typeRangesFor(file);
|
|
2607
|
+
var colored = state.syntaxOn;
|
|
2608
|
+
var synStarts = syn ? syn.starts : null;
|
|
2609
|
+
var synTypes = syn ? syn.types : null;
|
|
2610
|
+
var synN = syn ? synStarts.length : 0;
|
|
2611
|
+
var cursor = 0;
|
|
2612
|
+
function tokAt(pos) {
|
|
2613
|
+
while (cursor + 1 < synN && synStarts[cursor + 1] <= pos) cursor++;
|
|
2614
|
+
while (cursor > 0 && synStarts[cursor] > pos) cursor--;
|
|
2615
|
+
return cursor;
|
|
2616
|
+
}
|
|
2617
|
+
function tokStop(ti, limit) {
|
|
2618
|
+
var e = ti + 1 < synN ? synStarts[ti + 1] : src.length;
|
|
2619
|
+
return e < limit ? e : limit;
|
|
2620
|
+
}
|
|
2621
|
+
function markersFor(f) {
|
|
2622
|
+
if (f.__markers) return f.__markers;
|
|
2623
|
+
var allowed = {};
|
|
2624
|
+
var any = false;
|
|
2625
|
+
for (var k = 0; k < (f.directives || []).length; k++) {
|
|
2626
|
+
allowed[f.directives[k].keyword] = true;
|
|
2627
|
+
any = true;
|
|
2628
|
+
}
|
|
2629
|
+
if (!any) { f.__markers = []; return f.__markers; }
|
|
2630
|
+
allowed.end = true;
|
|
2631
|
+
var out = [];
|
|
2632
|
+
var re = /@afterpack[ \t]+([A-Za-z][\w-]*)/g;
|
|
2633
|
+
var m;
|
|
2634
|
+
while ((m = re.exec(f.source)) !== null) {
|
|
2635
|
+
if (allowed[m[1]] !== true) continue;
|
|
2636
|
+
var kwStart = m.index;
|
|
2637
|
+
var kwEnd = kwStart + "@afterpack".length;
|
|
2638
|
+
out.push({ kwStart: kwStart, kwEnd: kwEnd, argEnd: kwStart + m[0].length });
|
|
2639
|
+
}
|
|
2640
|
+
f.__markers = out;
|
|
2641
|
+
return out;
|
|
2642
|
+
}
|
|
2643
|
+
function commentInner(a, b) {
|
|
2644
|
+
var ms = markersFor(file);
|
|
2645
|
+
var hit = [];
|
|
2646
|
+
for (var i = 0; i < ms.length; i++) {
|
|
2647
|
+
if (ms[i].kwStart < b && ms[i].argEnd > a) hit.push(ms[i]);
|
|
2648
|
+
}
|
|
2649
|
+
if (!hit.length) return escapeHtml(src.slice(a, b));
|
|
2650
|
+
var out = "", cur = a;
|
|
2651
|
+
for (var j = 0; j < hit.length; j++) {
|
|
2652
|
+
var m2 = hit[j];
|
|
2653
|
+
if (m2.kwStart > cur) out += escapeHtml(src.slice(cur, m2.kwStart));
|
|
2654
|
+
var kwFrom = Math.max(m2.kwStart, cur);
|
|
2655
|
+
var kwTo = Math.min(m2.kwEnd, b);
|
|
2656
|
+
if (kwTo > kwFrom) {
|
|
2657
|
+
out += '<span class="dir-kw">' + escapeHtml(src.slice(kwFrom, kwTo)) + "</span>";
|
|
2658
|
+
}
|
|
2659
|
+
var argFrom = Math.max(m2.kwEnd, cur);
|
|
2660
|
+
var argTo = Math.min(m2.argEnd, b);
|
|
2661
|
+
if (argTo > argFrom) {
|
|
2662
|
+
out += '<span class="dir-arg">' + escapeHtml(src.slice(argFrom, argTo)) + "</span>";
|
|
2663
|
+
}
|
|
2664
|
+
cur = Math.max(cur, Math.max(kwTo, argTo));
|
|
2665
|
+
}
|
|
2666
|
+
if (cur < b) out += escapeHtml(src.slice(cur, b));
|
|
2667
|
+
return out;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
function synInner(a, b) {
|
|
2671
|
+
if (!syn) return escapeHtml(src.slice(a, b));
|
|
2672
|
+
if (!colored) return commentInner(a, b);
|
|
2673
|
+
var out = "", ti = tokAt(a);
|
|
2674
|
+
while (a < b) {
|
|
2675
|
+
var stop = tokStop(ti, b);
|
|
2676
|
+
if (stop <= a) { out += escapeHtml(src.slice(a, b)); break; }
|
|
2677
|
+
var ty = synTypes.charAt(ti);
|
|
2678
|
+
var cls = SYN_CLASS[ty];
|
|
2679
|
+
var piece = ty === "c" ? commentInner(a, stop) : escapeHtml(src.slice(a, stop));
|
|
2680
|
+
out += cls ? "<i class=" + cls + ">" + piece + "</i>" : piece;
|
|
2681
|
+
a = stop; ti++;
|
|
2682
|
+
}
|
|
2683
|
+
return out;
|
|
2684
|
+
}
|
|
2685
|
+
function unlitInner(a, b, directive) {
|
|
2686
|
+
if (!syn) {
|
|
2687
|
+
return '<span class="unlit"><span class="tok tok-unlit" tabindex="-1" data-unlit="' + a + '" data-ue="' + b +
|
|
2688
|
+
'" data-ut="?" title="Not attributed — click to see why">' + escapeHtml(src.slice(a, b)) + "</span></span>";
|
|
2689
|
+
}
|
|
2690
|
+
var out = "", ti = tokAt(a);
|
|
2691
|
+
while (a < b) {
|
|
2692
|
+
var stop = tokStop(ti, b);
|
|
2693
|
+
if (stop <= a) { out += escapeHtml(src.slice(a, b)); break; }
|
|
2694
|
+
var t = synTypes.charAt(ti);
|
|
2695
|
+
var piece = escapeHtml(src.slice(a, stop));
|
|
2696
|
+
if (t === "k" && VALUE_LITERAL_TEXT[src.slice(a, stop)] === 1) t = "v";
|
|
2697
|
+
if (t === "c") {
|
|
2698
|
+
out += colored
|
|
2699
|
+
? '<i class="sy-c">' + commentInner(a, stop) + "</i>"
|
|
2700
|
+
: commentInner(a, stop);
|
|
2701
|
+
} else if (t === "w" || t === "p" || inTypeRange(typeRanges, a)) {
|
|
2702
|
+
var syCls = colored ? SYN_CLASS[t] : null;
|
|
2703
|
+
out += syCls ? '<i class="' + syCls + '">' + piece + "</i>" : piece;
|
|
2704
|
+
} else {
|
|
2705
|
+
var cls = colored ? SYN_CLASS[t] : null;
|
|
2706
|
+
var dirAttr = directive ? ' data-directive="' + directive.kind + '"' : "";
|
|
2707
|
+
var dirTitle = directive
|
|
2708
|
+
? escapeAttr(" — Directive: /* @afterpack " + directive.keyword + " */")
|
|
2709
|
+
: "";
|
|
2710
|
+
out += '<span class="tok tok-unlit' + (cls ? " " + cls : "") + '" tabindex="-1" data-unlit="' + a +
|
|
2711
|
+
'" data-ut="' + t + '"' + dirAttr + ' title="Not attributed — ' + TOKEN_KIND[t] + dirTitle + '">' + piece + "</span>";
|
|
2712
|
+
}
|
|
2713
|
+
a = stop; ti++;
|
|
2714
|
+
}
|
|
2715
|
+
return '<span class="unlit">' + out + "</span>";
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
var lineChunks = [[]];
|
|
2719
|
+
var lineWSum = [0];
|
|
2720
|
+
var lineWLen = [0];
|
|
2721
|
+
var lineDir = [false];
|
|
2722
|
+
|
|
2723
|
+
file.mergedRuns.forEach(function (run) {
|
|
2724
|
+
var text = src.slice(run.start, run.end);
|
|
2725
|
+
var region = regionByIdx(file, run.regionIdx);
|
|
2726
|
+
var preserved = isPreservedRegion(region);
|
|
2727
|
+
var metric = region && !preserved ? metricForRegion(region) : 0;
|
|
2728
|
+
var renamedOnly = !region && run.renamedIdx != null;
|
|
2729
|
+
var extractedOnly = !region && run.extractedIdx != null;
|
|
2730
|
+
var extracted = extractedOnly ? file.extractedRanges[run.extractedIdx] : null;
|
|
2731
|
+
var bg = "transparent", dataClass = "", extraCls = "";
|
|
2732
|
+
if (region) {
|
|
2733
|
+
if (preserved) {
|
|
2734
|
+
dataClass = "preserved";
|
|
2735
|
+
extraCls = " tok-preserved";
|
|
2736
|
+
} else {
|
|
2737
|
+
bg = hexToRgba(rampColor(heatRamp, metric / 100), tokenAlpha(metric));
|
|
2738
|
+
dataClass = region.raw.reversalClass || "";
|
|
2739
|
+
if (metric >= inkYield) extraCls += " tok-ink-yield";
|
|
2740
|
+
}
|
|
2741
|
+
} else if (extractedOnly) {
|
|
2742
|
+
bg = hexToRgba(renamedHex, EXTRACTED_WASH_ALPHA);
|
|
2743
|
+
extraCls = " tok-extracted";
|
|
2744
|
+
dataClass = "renamed-encoded";
|
|
2745
|
+
} else if (renamedOnly) {
|
|
2746
|
+
bg = hexToRgba(renamedHex, RENAMED_WASH_ALPHA);
|
|
2747
|
+
extraCls = " tok-renamed";
|
|
2748
|
+
}
|
|
2749
|
+
var spotlight = run.spotlightIdx != null ? file.spotlights[run.spotlightIdx] : null;
|
|
2750
|
+
var attributed = !!region || !!spotlight || extractedOnly || renamedOnly;
|
|
2751
|
+
var directive = run.directiveIdx != null ? file.directives[run.directiveIdx] : null;
|
|
2752
|
+
var perToken = !attributed;
|
|
2753
|
+
var cls = "tok" + extraCls + (attributed ? " tok-hot" : " tok-unlit unlit") + (spotlight ? " spot-" + spotlight.raw.severity : "");
|
|
2754
|
+
|
|
2755
|
+
var titleParts = [];
|
|
2756
|
+
titleParts.push(region
|
|
2757
|
+
? (preserved
|
|
2758
|
+
? (region.raw.preservedReason ? "Preserved — must stay literal · " + humanize(region.raw.preservedReason) : "Preserved — readable, not obscured")
|
|
2759
|
+
: (CLASS_META[region.raw.reversalClass] ? CLASS_META[region.raw.reversalClass].label : region.raw.reversalClass) + " · score " + region.raw.score)
|
|
2760
|
+
: extractedOnly
|
|
2761
|
+
? (extracted && extracted.kind === "global"
|
|
2762
|
+
? "Global reference extracted into the constant pool — the name is gone from this access site"
|
|
2763
|
+
: "Property name extracted into the constant pool — the name is gone from this access site")
|
|
2764
|
+
: renamedOnly
|
|
2765
|
+
? "Renamed identifier — original name not in your output (baseline, low-value protection)"
|
|
2766
|
+
: "Not attributed — click to see what this token is and what the map can (and cannot) say about it");
|
|
2767
|
+
if (spotlight) titleParts.push((SEVERITY_LABEL[spotlight.raw.severity] || spotlight.raw.severity) + ": " + (spotlight.raw.reason || ""));
|
|
2768
|
+
if (directive) titleParts.push("Directive: /* @afterpack " + directive.keyword + " */");
|
|
2769
|
+
|
|
2770
|
+
var bgCss = bg === "transparent" ? "" : bg;
|
|
2771
|
+
|
|
2772
|
+
var attrs = 'class="' + cls + '"' + (attributed ? ' tabindex="0" role="button"' : ' tabindex="-1"') +
|
|
2773
|
+
(bgCss ? ' style="background:' + bgCss + '"' : "") +
|
|
2774
|
+
' data-region-idx="' + (run.regionIdx == null ? "" : run.regionIdx) + '"' +
|
|
2775
|
+
' data-spotlight-idx="' + (run.spotlightIdx == null ? "" : run.spotlightIdx) + '"' +
|
|
2776
|
+
(run.renamedIdx == null ? "" : ' data-renamed-idx="' + run.renamedIdx + '"') +
|
|
2777
|
+
(run.extractedIdx == null ? "" : ' data-extracted-idx="' + run.extractedIdx + '"') +
|
|
2778
|
+
(attributed ? "" : ' data-unlit="' + run.start + '" data-ue="' + run.end + '" data-ut="?"') +
|
|
2779
|
+
(directive ? ' data-directive="' + directive.kind + '"' : "") +
|
|
2780
|
+
(dataClass ? ' data-class="' + dataClass + '"' : "") +
|
|
2781
|
+
' title="' + escapeAttr(titleParts.join(" — ")) + '"';
|
|
2782
|
+
|
|
2783
|
+
var pin = run.isSpotlightStart ? WARN_ICON : "";
|
|
2784
|
+
var segments = text.split("\n");
|
|
2785
|
+
var off = run.start;
|
|
2786
|
+
segments.forEach(function (seg, si) {
|
|
2787
|
+
if (seg.length) {
|
|
2788
|
+
var a = off, b = off + seg.length;
|
|
2789
|
+
lineChunks[lineChunks.length - 1].push(
|
|
2790
|
+
perToken
|
|
2791
|
+
? unlitInner(a, b, directive)
|
|
2792
|
+
: "<span " + attrs + ">" + pin + synInner(a, b) + "</span>"
|
|
2793
|
+
);
|
|
2794
|
+
if (directive) lineDir[lineDir.length - 1] = true;
|
|
2795
|
+
pin = "";
|
|
2796
|
+
lineWLen[lineWLen.length - 1] += seg.length;
|
|
2797
|
+
lineWSum[lineWSum.length - 1] += seg.length * metric;
|
|
2798
|
+
}
|
|
2799
|
+
if (si < segments.length - 1) { lineChunks.push([]); lineWSum.push(0); lineWLen.push(0); lineDir.push(false); }
|
|
2800
|
+
off += seg.length + 1;
|
|
2801
|
+
});
|
|
2802
|
+
});
|
|
2803
|
+
|
|
2804
|
+
var totalLines = file.source.split("\n").length;
|
|
2805
|
+
var gutterWidth = String(totalLines).length + 1;
|
|
2806
|
+
|
|
2807
|
+
var html = lineChunks.map(function (spans, i) {
|
|
2808
|
+
var lineNo = i + 1;
|
|
2809
|
+
var avgMetric = lineWLen[i] > 0 ? lineWSum[i] / lineWLen[i] : 0;
|
|
2810
|
+
var lineBg = avgMetric > 0 ? hexToRgba(rampColor(heatRamp, avgMetric / 100), lineAlpha(avgMetric)) : "transparent";
|
|
2811
|
+
return '<div class="code-line' + (lineDir[i] ? " has-directive" : "") + '" data-line="' + lineNo + '">' +
|
|
2812
|
+
'<span class="ln" style="width:' + gutterWidth + 'ch">' + lineNo + "</span>" +
|
|
2813
|
+
'<span class="lc" style="background:' + lineBg + '">' + (spans.join("") || " ") + "</span>" +
|
|
2814
|
+
"</div>";
|
|
2815
|
+
}).join("");
|
|
2816
|
+
codeBody.innerHTML = html;
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
var treeEl = document.getElementById("file-tree");
|
|
2820
|
+
|
|
2821
|
+
function countFilesUnder(node) {
|
|
2822
|
+
var n = 0;
|
|
2823
|
+
node.children.forEach(function (c) { n += c.type === "file" ? 1 : countFilesUnder(c); });
|
|
2824
|
+
return n;
|
|
2825
|
+
}
|
|
2826
|
+
function isIgnoredPath(p) { return !!p && /(^|[\\/])node_modules([\\/]|$)/.test(p); }
|
|
2827
|
+
function isIgnoredFileIdx(idx) {
|
|
2828
|
+
var f = FILES[idx];
|
|
2829
|
+
return !!f && (isVendorFile(f) || isIgnoredPath(f.displayPath || f.displayName || ""));
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
function countMarkedUnder(node) {
|
|
2833
|
+
var n = 0;
|
|
2834
|
+
node.children.forEach(function (c) {
|
|
2835
|
+
n += c.type === "file" ? (isMarkedFile(FILES[c.fileIdx]) ? 1 : 0) : countMarkedUnder(c);
|
|
2836
|
+
});
|
|
2837
|
+
return n;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
function countWeakUnder(node) {
|
|
2841
|
+
var acc = { weak: 0, leaks: 0 };
|
|
2842
|
+
node.children.forEach(function (c) {
|
|
2843
|
+
if (c.type === "file") {
|
|
2844
|
+
var f = FILES[c.fileIdx];
|
|
2845
|
+
acc.weak += f.weakSpotCount; acc.leaks += f.leakCount;
|
|
2846
|
+
} else {
|
|
2847
|
+
var sub = countWeakUnder(c);
|
|
2848
|
+
acc.weak += sub.weak; acc.leaks += sub.leaks;
|
|
2849
|
+
}
|
|
2850
|
+
});
|
|
2851
|
+
return acc;
|
|
2852
|
+
}
|
|
2853
|
+
function weakBadgeHtml(weak, leaks, scope) {
|
|
2854
|
+
if (!weak) return "";
|
|
2855
|
+
var residual = weak - leaks;
|
|
2856
|
+
var tip = weak + " weak spot" + (weak === 1 ? "" : "s") + " " + scope + ": " +
|
|
2857
|
+
(leaks > 0 ? leaks + " leaked literal" + (leaks === 1 ? "" : "s") : "no leaked literal") +
|
|
2858
|
+
(residual > 0 ? ", " + residual + " residual property name" + (residual === 1 ? "" : "s") : "") +
|
|
2859
|
+
". A weak spot is a readable literal this build left in the output; the right rail lists every one in the open file.";
|
|
2860
|
+
return '<span class="badge-weak' + (leaks > 0 ? " has-leak" : "") + '" data-tip="' +
|
|
2861
|
+
escapeAttr(tip) + '">' + (leaks > 0 ? "\u26a0 " : "") + weak + "</span>";
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
function renderTreeChildren(node, html) {
|
|
2865
|
+
node.children.forEach(function (child) {
|
|
2866
|
+
var indent = (child.depth - 1) * 13;
|
|
2867
|
+
if (child.type === "folder") {
|
|
2868
|
+
var expanded = !!state.expandedFolders[child.key];
|
|
2869
|
+
var folderIgnored = isIgnoredPath(child.key) || child.name === "node_modules";
|
|
2870
|
+
var marked = countMarkedUnder(child);
|
|
2871
|
+
var weakUnder = countWeakUnder(child);
|
|
2872
|
+
html.push(
|
|
2873
|
+
'<div class="tree-node">' +
|
|
2874
|
+
'<button type="button" class="tree-row tree-row-folder' + (folderIgnored ? " is-ignored" : "") + '" data-kind="folder" data-key="' + escapeAttr(child.key) +
|
|
2875
|
+
'" style="padding-left:' + indent + "px;top:calc(var(--tree-row-h) * " + (child.depth - 1) + " + var(--tree-pin-off));z-index:" + Math.max(1, 24 - child.depth) +
|
|
2876
|
+
'" aria-expanded="' + (expanded ? "true" : "false") + '">' +
|
|
2877
|
+
'<span class="tree-twisty" aria-hidden="true">▸</span>' +
|
|
2878
|
+
'<span class="tree-icon" aria-hidden="true">' + (expanded ? "📂" : "📁") + "</span>" +
|
|
2879
|
+
'<span class="tree-name">' + escapeHtml(child.name) + "</span>" +
|
|
2880
|
+
(marked > 0 ? '<span class="tree-mark" data-tip="' + escapeAttr(marked + " file" + (marked === 1 ? "" : "s") +
|
|
2881
|
+
" under this folder carry an @afterpack marker recorded over a span in this build.") + '">@' + marked + "</span>" : "") +
|
|
2882
|
+
weakBadgeHtml(weakUnder.weak, weakUnder.leaks, "under this folder") +
|
|
2883
|
+
'<span class="tree-count">' + countFilesUnder(child) + "</span>" +
|
|
2884
|
+
"</button>"
|
|
2885
|
+
);
|
|
2886
|
+
if (expanded) {
|
|
2887
|
+
html.push('<div class="tree-branch">');
|
|
2888
|
+
renderTreeChildren(child, html);
|
|
2889
|
+
html.push("</div>");
|
|
2890
|
+
}
|
|
2891
|
+
html.push("</div>");
|
|
2892
|
+
} else {
|
|
2893
|
+
var file = FILES[child.fileIdx];
|
|
2894
|
+
var active = state.activeFileIdx === child.fileIdx;
|
|
2895
|
+
var fileIgnored = isIgnoredFileIdx(child.fileIdx);
|
|
2896
|
+
var kws = markedKeywords(file);
|
|
2897
|
+
html.push(
|
|
2898
|
+
'<button type="button" class="tree-row tree-row-file' + (active ? " is-active" : "") + (fileIgnored ? " is-ignored" : "") + '" data-kind="file" data-file-idx="' + child.fileIdx +
|
|
2899
|
+
'" style="padding-left:' + indent + 'px" aria-current="' + (active ? "true" : "false") + '">' +
|
|
2900
|
+
'<span class="tree-twisty" aria-hidden="true"></span>' +
|
|
2901
|
+
'<span class="tree-icon" aria-hidden="true">📄</span>' +
|
|
2902
|
+
'<span class="tree-name" title="' + escapeAttr(file.displayPath || file.displayName) + '">' + escapeHtml(file.displayName) + "</span>" +
|
|
2903
|
+
(kws.length ? '<span class="tree-mark" data-tip="' + escapeAttr(file.directives.length + " @afterpack marker" +
|
|
2904
|
+
(file.directives.length === 1 ? "" : "s") + " recorded in this file (" + kws.join(", ") +
|
|
2905
|
+
"). The build records where markers were found; whether they changed the outcome is not recorded.") + '">@</span>' : "") +
|
|
2906
|
+
weakBadgeHtml(file.weakSpotCount, file.leakCount, "in this file") +
|
|
2907
|
+
"</button>" +
|
|
2908
|
+
'<div class="tree-file-meter' + (fileIgnored ? " is-ignored" : "") + '" style="padding-left:' + (indent + 18) + 'px"' +
|
|
2909
|
+
' data-tip="' + escapeAttr("Average protection score " + file.avgScore.toFixed(0) + "/100 across the spans that carry a ledger region — which is " +
|
|
2910
|
+
(file.coverage.total > 0 ? Math.round((file.coverage.region / file.coverage.total) * 100) : 0) +
|
|
2911
|
+
"% of this file. It is not a share of the file that is protected.") + '">' +
|
|
2912
|
+
'<div class="meter"><i style="width:' + file.avgScore.toFixed(0) + '%;background:' + heatSolid(file.avgScore) + '"></i></div>' +
|
|
2913
|
+
"</div>"
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2916
|
+
});
|
|
2917
|
+
}
|
|
2918
|
+
function renderTree() {
|
|
2919
|
+
var html = [];
|
|
2920
|
+
renderTreeChildren(TREE, html);
|
|
2921
|
+
treeEl.innerHTML = html.length ? html.join("") : '<p class="tree-empty">No files match.</p>';
|
|
2922
|
+
}
|
|
2923
|
+
function scrollTreeToActive() {
|
|
2924
|
+
if (!treeEl || !treeEl.querySelector) return;
|
|
2925
|
+
var row = treeEl.querySelector('.tree-row-file[data-file-idx="' + state.activeFileIdx + '"]');
|
|
2926
|
+
if (row && row.scrollIntoView) row.scrollIntoView({ block: "nearest" });
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2929
|
+
function blankPanels() {
|
|
2930
|
+
renderTree();
|
|
2931
|
+
document.getElementById("code-body").textContent = "No files match this filter.";
|
|
2932
|
+
document.getElementById("file-summary-path").innerHTML = "";
|
|
2933
|
+
document.getElementById("file-summary-metrics").innerHTML = "";
|
|
2934
|
+
document.getElementById("engine-info").innerHTML = "";
|
|
2935
|
+
document.getElementById("weakspots-title").textContent = "Weak spots (0)";
|
|
2936
|
+
document.getElementById("weakspots-list").innerHTML = "";
|
|
2937
|
+
setWeakSpotsEmpty(true);
|
|
2938
|
+
document.getElementById("inspector").innerHTML = "";
|
|
2939
|
+
var inspCount = document.getElementById("inspector-count");
|
|
2940
|
+
if (inspCount) inspCount.textContent = "no selection";
|
|
2941
|
+
document.getElementById("class-dist-bar").innerHTML = "";
|
|
2942
|
+
document.getElementById("class-dist-rows").innerHTML = "";
|
|
2943
|
+
document.getElementById("class-reached").innerHTML = "";
|
|
2944
|
+
var footnote = document.getElementById("class-dist-footnote");
|
|
2945
|
+
if (footnote) footnote.hidden = true;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
function syncFilterButtons() {
|
|
2949
|
+
FILE_FILTERS.forEach(function (k) {
|
|
2950
|
+
var b = document.getElementById("filter-" + k);
|
|
2951
|
+
if (b) b.setAttribute("aria-pressed", String(k === activeFileFilter));
|
|
2952
|
+
});
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
function setFileFilter(filter) {
|
|
2956
|
+
if (filter === activeFileFilter) return;
|
|
2957
|
+
var wasExpanded = facetExpandsAll();
|
|
2958
|
+
activeFileFilter = filter;
|
|
2959
|
+
syncFilterButtons();
|
|
2960
|
+
if (wasExpanded && !facetExpandsAll()) state.expandedFolders = ancestorExpansion(state.activeFileIdx);
|
|
2961
|
+
var visible = filteredFiles();
|
|
2962
|
+
TREE = buildTree(visible);
|
|
2963
|
+
allFolderKeys = [];
|
|
2964
|
+
collectFolderKeys(TREE, allFolderKeys);
|
|
2965
|
+
var stillVisible = visible.some(function (f) { return f.fileIdx === state.activeFileIdx; });
|
|
2966
|
+
if (stillVisible) {
|
|
2967
|
+
reapplyExpansion();
|
|
2968
|
+
renderTree();
|
|
2969
|
+
scrollTreeToActive();
|
|
2970
|
+
syncHash();
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
state.selection = null;
|
|
2974
|
+
state.activeFileIdx = visible.length ? visible[0].fileIdx : -1;
|
|
2975
|
+
reapplyExpansion();
|
|
2976
|
+
if (state.activeFileIdx >= 0) {
|
|
2977
|
+
onActiveFileChanged();
|
|
2978
|
+
} else {
|
|
2979
|
+
blankPanels();
|
|
2980
|
+
syncHash();
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
function applyTreeSearch(raw) {
|
|
2985
|
+
var had = !!state.treeQuery;
|
|
2986
|
+
state.treeQuery = (raw || "").trim().toLowerCase();
|
|
2987
|
+
var visible = filteredFiles();
|
|
2988
|
+
TREE = buildTree(visible);
|
|
2989
|
+
allFolderKeys = [];
|
|
2990
|
+
collectFolderKeys(TREE, allFolderKeys);
|
|
2991
|
+
if (had && !state.treeQuery) state.expandedFolders = ancestorExpansion(state.activeFileIdx);
|
|
2992
|
+
if (state.activeFileIdx < 0 && visible.length) {
|
|
2993
|
+
state.activeFileIdx = visible[0].fileIdx;
|
|
2994
|
+
state.selection = null;
|
|
2995
|
+
onActiveFileChanged();
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
reapplyExpansion();
|
|
2999
|
+
renderTree();
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
function renderWorkspaceSummary() {
|
|
3003
|
+
var titleEl = document.getElementById("files-title");
|
|
3004
|
+
if (titleEl) titleEl.textContent = "Files (" + FILES.length + ")";
|
|
3005
|
+
var el = document.getElementById("workspace-summary");
|
|
3006
|
+
if (!el) return;
|
|
3007
|
+
var weak = 0, leaks = 0, filesWith = 0;
|
|
3008
|
+
FILES.forEach(function (f) {
|
|
3009
|
+
weak += f.weakSpotCount; leaks += f.leakCount;
|
|
3010
|
+
if (f.weakSpotCount > 0) filesWith++;
|
|
3011
|
+
});
|
|
3012
|
+
el.textContent = weak > 0 ? weak + " weak spot" + (weak === 1 ? "" : "s") : "";
|
|
3013
|
+
if (weak > 0) {
|
|
3014
|
+
el.setAttribute("data-tip", weak + " weak spot" + (weak === 1 ? "" : "s") + " across this whole build, in " +
|
|
3015
|
+
filesWith + " file" + (filesWith === 1 ? "" : "s") + " \u2014 " + leaks + " leaked literal" + (leaks === 1 ? "" : "s") +
|
|
3016
|
+
" and " + (weak - leaks) + " residual property name" + (weak - leaks === 1 ? "" : "s") +
|
|
3017
|
+
". This is the number the dashboard's \u201cWeak spots\u201d tile shows; the Weak filter lists exactly these files.");
|
|
3018
|
+
} else {
|
|
3019
|
+
el.removeAttribute("data-tip");
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
function renderFileSummary(file) {
|
|
3024
|
+
var f = file.doc.file || {};
|
|
3025
|
+
var a = file.doc.aggregate || {};
|
|
3026
|
+
var cs = a.classSummary || {};
|
|
3027
|
+
|
|
3028
|
+
var full = file.displayPath || file.displayName || "";
|
|
3029
|
+
var name = file.displayName || full;
|
|
3030
|
+
var dir = full.length > name.length ? full.slice(0, full.length - name.length) : "";
|
|
3031
|
+
document.getElementById("file-summary-path").innerHTML =
|
|
3032
|
+
(dir ? '<span class="fs-dir">' + escapeHtml(dir) + "</span>" : "") +
|
|
3033
|
+
'<span class="fs-name">' + escapeHtml(name) + "</span>";
|
|
3034
|
+
var copyBtn = document.getElementById("copy-path");
|
|
3035
|
+
if (copyBtn) {
|
|
3036
|
+
copyBtn.setAttribute("data-copy", encodeURIComponent(full));
|
|
3037
|
+
copyBtn.setAttribute("data-tip", "Copy the full path: " + full);
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
var maxCls = cs.maxClassReached;
|
|
3041
|
+
var maxClsHtml = maxCls ? classChipHtml(maxCls, false) : "—";
|
|
3042
|
+
|
|
3043
|
+
var est = f.outputSizeEstimated ? " (est.)" : "";
|
|
3044
|
+
var bundledIn = f.bundledInputSize != null ? f.bundledInputSize : f.inputSize;
|
|
3045
|
+
var sizeTip = "Bundled " + fmtBytes(bundledIn) + " → output " + fmtBytes(f.outputSize) + est +
|
|
3046
|
+
(f.outputSizeEstimated
|
|
3047
|
+
? ". Output is this file's share of the chunk's MEASURED size, apportioned by how many of " +
|
|
3048
|
+
"the chunk's bundled bytes came from this source — so the ratio is output ÷ bundled input, " +
|
|
3049
|
+
"comparable to the build's headline ratio. The estimate is the one assumption left: " +
|
|
3050
|
+
"inflation is taken as uniform within a chunk. Machinery the build ships once for the " +
|
|
3051
|
+
"whole bundle — string pool, helpers, bootstrap — is carried as its own separate entry, " +
|
|
3052
|
+
"not folded into any source file."
|
|
3053
|
+
: "");
|
|
3054
|
+
var sizeVal = f.inflationRatio != null ? f.inflationRatio.toFixed(2) + "×" : "—";
|
|
3055
|
+
|
|
3056
|
+
var leaks = file.leakCount;
|
|
3057
|
+
var weak = file.weakSpotCount;
|
|
3058
|
+
var weakTip = weak + " weak spot" + (weak === 1 ? "" : "s") + " in THIS file (" + leaks + " leaked literal" +
|
|
3059
|
+
(leaks === 1 ? "" : "s") + ", " + (weak - leaks) + " residual property name" + (weak - leaks === 1 ? "" : "s") +
|
|
3060
|
+
"), listed in full below. The file-tree header counts them across the whole build, which is why the two numbers differ.";
|
|
3061
|
+
var renamed = file.renamedCount || 0;
|
|
3062
|
+
|
|
3063
|
+
var cov = file.coverage;
|
|
3064
|
+
var covPct = cov.total > 0 ? Math.round((cov.region / cov.total) * 100) : 0;
|
|
3065
|
+
var covShare = function (n) { return cov.total > 0 ? Math.round((n / cov.total) * 100) : 0; };
|
|
3066
|
+
var covTip = "Share of this file's characters carrying a ledger region: " + covPct +
|
|
3067
|
+
"%. Extracted-only: " + covShare(cov.extracted || 0) + "%. Renamed-only: " + covShare(cov.renamed) +
|
|
3068
|
+
"%. The rest is syntax, preserved names, comments, or code your bundler removed — a region is recorded only where a transform cleared the entropy funnel, so a large plain share is normal.";
|
|
3069
|
+
|
|
3070
|
+
var rows = [
|
|
3071
|
+
{ k: "Max class", html: maxClsHtml, tip: "The strongest reversal class any region in this file reached." },
|
|
3072
|
+
{ k: "Attributed", v: covPct + "%", tip: covTip },
|
|
3073
|
+
{ k: "Extracted", v: fmtNum(file.extractedCount || 0), tip: "Property names and free globals hoisted into the constant pool and reached through a computed lookup — the name is gone from every access site. One tier above renaming, still injective (the pool holds each name literally)." },
|
|
3074
|
+
{ k: "Renamed", v: fmtNum(renamed), tip: "Identifiers renamed under this build's seed — the low-value baseline layer. Real protection is the hardened regions (materialization / control-flow / MBA)." },
|
|
3075
|
+
{ k: "Transforms", v: fmtNum(a.totalTransforms), tip: "Total transform passes applied across this file." },
|
|
3076
|
+
{ k: "Weak spots", v: fmtNum(weak) + (leaks > 0 ? " ⚠" : ""), warn: leaks > 0, tip: weakTip },
|
|
3077
|
+
{ k: "Size cost" + est, v: sizeVal, tip: sizeTip }
|
|
3078
|
+
];
|
|
3079
|
+
document.getElementById("file-summary-metrics").innerHTML = rows.map(function (r) {
|
|
3080
|
+
return '<div class="fb-row" data-tip="' + escapeAttr(r.tip) + '">' +
|
|
3081
|
+
'<span class="k">' + escapeHtml(r.k) + "</span>" +
|
|
3082
|
+
'<span class="v' + (r.warn ? " is-warn" : "") + '">' +
|
|
3083
|
+
(r.html != null ? r.html : escapeHtml(String(r.v))) + "</span></div>";
|
|
3084
|
+
}).join("");
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
function renderMapSize() {
|
|
3088
|
+
var el = document.getElementById("map-size");
|
|
3089
|
+
if (!el) return;
|
|
3090
|
+
if (MAP_BYTES == null) { el.textContent = "—"; return; }
|
|
3091
|
+
el.textContent = "Map " + fmtBytes(MAP_BYTES);
|
|
3092
|
+
el.setAttribute("data-tip",
|
|
3093
|
+
"The Protection Map data embedded in this page: " + fmtNum(MAP_BYTES) + " bytes of " + MAP_ENCODING +
|
|
3094
|
+
", covering " + fmtNum(FILES.length) + " file" + (FILES.length === 1 ? "" : "s") +
|
|
3095
|
+
". The viewer itself is not counted. This artifact is a DEV-ONLY build output — it carries your original source, so keep it out of anything you publish.");
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
function renderClassDist(file) {
|
|
3099
|
+
var raw = (file.doc.aggregate && file.doc.aggregate.classSummary) || {};
|
|
3100
|
+
var adjustedPreserved = Math.max(0, (raw.preserved || 0) - (file.machinery ? 1 : 0));
|
|
3101
|
+
var counts = {
|
|
3102
|
+
"preserved": adjustedPreserved,
|
|
3103
|
+
"renamed-encoded": raw["renamed-encoded"] || 0,
|
|
3104
|
+
"flattened-fused": raw["flattened-fused"] || 0,
|
|
3105
|
+
"destroyed-fused": raw["destroyed-fused"] || 0
|
|
3106
|
+
};
|
|
3107
|
+
var total = counts["preserved"] + counts["renamed-encoded"] + counts["flattened-fused"] + counts["destroyed-fused"];
|
|
3108
|
+
|
|
3109
|
+
document.getElementById("class-dist-bar").innerHTML = CLASS_ORDER.map(function (cls) {
|
|
3110
|
+
var n = counts[cls];
|
|
3111
|
+
if (!n) return "";
|
|
3112
|
+
var pct = total > 0 ? (n / total * 100) : 0;
|
|
3113
|
+
return '<i data-class="' + cls + '" style="width:' + pct.toFixed(2) + '%" title="' + escapeAttr(CLASS_META[cls].label + ": " + n) + '"></i>';
|
|
3114
|
+
}).join("");
|
|
3115
|
+
|
|
3116
|
+
document.getElementById("class-dist-rows").innerHTML = CLASS_ORDER.map(function (cls) {
|
|
3117
|
+
return '<li class="class-dist-row">' + classChipHtml(cls, counts[cls] === 0) + '<span class="class-dist-count">' + counts[cls] + "</span></li>";
|
|
3118
|
+
}).join("");
|
|
3119
|
+
|
|
3120
|
+
var maxCls = raw.maxClassReached;
|
|
3121
|
+
document.getElementById("class-reached").innerHTML = maxCls ? "Reached this build: " + classChipHtml(maxCls, false) : "";
|
|
3122
|
+
|
|
3123
|
+
var footnote = document.getElementById("class-dist-footnote");
|
|
3124
|
+
if (file.machinery && (raw.preserved || 0) > 0 && adjustedPreserved === 0) {
|
|
3125
|
+
footnote.hidden = false;
|
|
3126
|
+
footnote.textContent = "No user code was left preserved in this build — the \"" + (raw.preserved) + " preserved\" the engine reports is entirely the whole-file scaffolding bucket, excluded from this count.";
|
|
3127
|
+
} else {
|
|
3128
|
+
footnote.hidden = true;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
function renderClassLegendStatic() {
|
|
3133
|
+
var totals = { "preserved": 0, "renamed-encoded": 0, "flattened-fused": 0, "destroyed-fused": 0 };
|
|
3134
|
+
FILES.forEach(function (f) {
|
|
3135
|
+
var cs = (f.doc.aggregate && f.doc.aggregate.classSummary) || {};
|
|
3136
|
+
CLASS_ORDER.forEach(function (cls) { totals[cls] += cs[cls] || 0; });
|
|
3137
|
+
});
|
|
3138
|
+
document.getElementById("class-legend").innerHTML = CLASS_ORDER.map(function (cls) {
|
|
3139
|
+
var reached = totals[cls] > 0;
|
|
3140
|
+
return '<li class="class-legend-row" tabindex="0" data-tip="' + escapeAttr(CLASS_META[cls].note) + '">' +
|
|
3141
|
+
classChipHtml(cls, !reached) +
|
|
3142
|
+
'<span class="class-legend-flag">' + (reached ? "reached" : "ceiling") + "</span>" +
|
|
3143
|
+
"</li>";
|
|
3144
|
+
}).join("");
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
var DIRECTIVE_LEGEND_META = {
|
|
3148
|
+
skip: "skip — asks for the span to stay readable",
|
|
3149
|
+
hardened: "hardened — asks for the flattened-fused class",
|
|
3150
|
+
destroy: "destroy — asks for the strongest, destroyed-fused class",
|
|
3151
|
+
custom: "custom target/floor/deny — an explicit per-region override written on the marker"
|
|
3152
|
+
};
|
|
3153
|
+
var DIRECTIVE_LEGEND_ORDER = ["skip", "hardened", "destroy", "custom"];
|
|
3154
|
+
function renderDirectiveLegend() {
|
|
3155
|
+
var present = {};
|
|
3156
|
+
FILES.forEach(function (f) {
|
|
3157
|
+
(f.directives || []).forEach(function (d) { present[d.kind] = true; });
|
|
3158
|
+
});
|
|
3159
|
+
var kinds = DIRECTIVE_LEGEND_ORDER.filter(function (k) { return present[k]; });
|
|
3160
|
+
var section = document.getElementById("directive-legend-section");
|
|
3161
|
+
if (!kinds.length) { section.hidden = true; return; }
|
|
3162
|
+
section.hidden = false;
|
|
3163
|
+
document.getElementById("directive-legend").innerHTML = kinds.map(function (k) {
|
|
3164
|
+
return '<div class="directive-legend-row"><span class="swatch dir-kw" data-directive="' + k +
|
|
3165
|
+
'">@afterpack</span>' +
|
|
3166
|
+
"<code>" + escapeHtml(DIRECTIVE_LEGEND_META[k]) + "</code></div>";
|
|
3167
|
+
}).join("");
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
function renderLegend() {
|
|
3171
|
+
var bar = document.getElementById("legend-bar");
|
|
3172
|
+
var labels = document.getElementById("legend-labels");
|
|
3173
|
+
var ramp = currentRamp("heat");
|
|
3174
|
+
var stops = ramp.map(function (c, i) { return c + " " + ((i / (ramp.length - 1)) * 100).toFixed(1) + "%"; });
|
|
3175
|
+
bar.style.background = "linear-gradient(to right, " + stops.join(", ") + ")";
|
|
3176
|
+
labels.innerHTML = "<span>low in file</span><span>high in file</span>";
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
function renderEngineInfo(file) {
|
|
3180
|
+
var e = DATA.engine || file.doc.engine || {};
|
|
3181
|
+
var schema = DATA.schemaVersion != null ? DATA.schemaVersion : file.doc.schemaVersion;
|
|
3182
|
+
var origin = sourceOriginOf(file);
|
|
3183
|
+
var rows = [
|
|
3184
|
+
["backend", e.backend], ["preset", e.preset], ["seed", e.seed],
|
|
3185
|
+
["materialize", e.materialize === true ? "on" : e.materialize === false ? "off" : "—"],
|
|
3186
|
+
["complexity", e.complexity], ["engine version", e.version],
|
|
3187
|
+
["source origin", origin],
|
|
3188
|
+
["schema", schema != null ? "v" + schema : "—"]
|
|
3189
|
+
];
|
|
3190
|
+
document.getElementById("engine-info").innerHTML = rows.map(function (r) {
|
|
3191
|
+
return "<dt>" + escapeHtml(r[0]) + "</dt><dd>" + escapeHtml(r[1] == null ? "—" : String(r[1])) + "</dd>";
|
|
3192
|
+
}).join("");
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
function setWeakSpotsEmpty(empty) {
|
|
3196
|
+
var section = document.getElementById("weakspots-section");
|
|
3197
|
+
if (section) section.classList.toggle("is-empty", empty);
|
|
3198
|
+
syncRailFill();
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
function syncRailFill() {
|
|
3202
|
+
var rail = document.getElementById("rail-right");
|
|
3203
|
+
if (!rail) return;
|
|
3204
|
+
var ws = document.getElementById("weakspots-section");
|
|
3205
|
+
var insp = document.getElementById("inspector-section");
|
|
3206
|
+
var wsQuiet = !ws || rail.classList.contains("weakspots-hidden") ||
|
|
3207
|
+
ws.classList.contains("is-empty") || ws.classList.contains("is-collapsed");
|
|
3208
|
+
rail.classList.toggle("weakspots-quiet", wsQuiet);
|
|
3209
|
+
rail.classList.toggle("inspector-section-collapsed", !!(insp && insp.classList.contains("is-collapsed")));
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
function renderWeakSpots(file) {
|
|
3213
|
+
var titleEl = document.getElementById("weakspots-title");
|
|
3214
|
+
var infoEl = document.getElementById("weakspots-info");
|
|
3215
|
+
var list = document.getElementById("weakspots-list");
|
|
3216
|
+
if (!titleEl || !list) return;
|
|
3217
|
+
if (!file.spotlights.length) {
|
|
3218
|
+
titleEl.textContent = "Weak spots (0)";
|
|
3219
|
+
if (infoEl) infoEl.style.display = "none";
|
|
3220
|
+
list.style.marginTop = "0";
|
|
3221
|
+
var elsewhere = 0;
|
|
3222
|
+
FILES.forEach(function (f) { if (f.fileIdx !== file.fileIdx) elsewhere += f.weakSpotCount; });
|
|
3223
|
+
list.innerHTML = '<p class="empty-note-ok"><span class="ok-check">✓</span>None recorded in this file.' +
|
|
3224
|
+
(elsewhere > 0 ? " " + elsewhere + " elsewhere in this build — use the <strong>Weak</strong> file filter." : "") +
|
|
3225
|
+
"</p>";
|
|
3226
|
+
setWeakSpotsEmpty(true);
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3229
|
+
setWeakSpotsEmpty(false);
|
|
3230
|
+
titleEl.textContent = "Weak spots (" + file.spotlights.length + ")";
|
|
3231
|
+
if (infoEl) infoEl.style.display = "";
|
|
3232
|
+
list.style.marginTop = "8px";
|
|
3233
|
+
list.innerHTML = file.spotlights.map(function (s) {
|
|
3234
|
+
var sev = s.raw.severity;
|
|
3235
|
+
var icon = SEVERITY_ICON[sev] || "⚠";
|
|
3236
|
+
var mech = s.raw.mechanism || "";
|
|
3237
|
+
var mechHuman = mech ? humanize(mech) : "";
|
|
3238
|
+
var tail = s.raw.bytes != null ? s.raw.bytes + " B" : "";
|
|
3239
|
+
return '<details class="weakspot" data-spot-idx="' + s.idx + '">' +
|
|
3240
|
+
'<summary class="weakspot-summary">' +
|
|
3241
|
+
'<span class="weakspot-sev pill pill-' + sev + '" title="' + escapeAttr(SEVERITY_LABEL[sev] || sev) + '">' + icon + "</span>" +
|
|
3242
|
+
'<span class="weakspot-sample">' + escapeHtml(s.raw.sample || "") + "</span>" +
|
|
3243
|
+
(tail ? '<span class="weakspot-tail">' + escapeHtml(tail) + "</span>" : "") +
|
|
3244
|
+
"</summary>" +
|
|
3245
|
+
'<div class="weakspot-body">' +
|
|
3246
|
+
'<p class="weakspot-reason">' + escapeHtml(s.raw.reason || "") + "</p>" +
|
|
3247
|
+
(mech ? '<p class="weakspot-reason">' + escapeHtml(mechHuman) + "</p>" : "") +
|
|
3248
|
+
'<p class="weakspot-kv">disposition: <strong>' + escapeHtml(s.raw.disposition || "—") + "</strong>" +
|
|
3249
|
+
(mech ? ' · mechanism: <strong data-tip="' + escapeAttr(mech) + '">' + escapeHtml(mech) + "</strong>" : "") +
|
|
3250
|
+
(s.raw.bytes != null ? " · " + s.raw.bytes + " bytes" : "") + "</p>" +
|
|
3251
|
+
'<div class="cta"><button type="button" class="mini-btn" data-jump-spotlight="' + s.idx + '">Jump to code & inspect</button></div>' +
|
|
3252
|
+
"</div>" +
|
|
3253
|
+
"</details>";
|
|
3254
|
+
}).join("");
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
function collapseLineage(lineage) {
|
|
3258
|
+
var groups = [];
|
|
3259
|
+
lineage.forEach(function (step) {
|
|
3260
|
+
var last = groups[groups.length - 1];
|
|
3261
|
+
if (last && last.transform === step.transform) {
|
|
3262
|
+
last.count++;
|
|
3263
|
+
last.entropyGain += step.entropyGain || 0;
|
|
3264
|
+
last.sizeDeltaEst += step.sizeDeltaEst || 0;
|
|
3265
|
+
} else {
|
|
3266
|
+
groups.push({ transform: step.transform, category: step.category, phase: step.phase, count: 1, entropyGain: step.entropyGain || 0, sizeDeltaEst: step.sizeDeltaEst || 0 });
|
|
3267
|
+
}
|
|
3268
|
+
});
|
|
3269
|
+
return groups;
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
var CHAIN_VISIBLE_CAP = 5;
|
|
3273
|
+
function chainStepHtml(g) {
|
|
3274
|
+
var cat = CATEGORY_LABEL[g.category] || (g.category || "").toLowerCase();
|
|
3275
|
+
var caption = [cat, g.phase].filter(Boolean).join(" · ");
|
|
3276
|
+
var delta = [];
|
|
3277
|
+
if (g.sizeDeltaEst) delta.push((g.sizeDeltaEst >= 0 ? "+" : "") + g.sizeDeltaEst + "B");
|
|
3278
|
+
return '<div class="chain-step">' +
|
|
3279
|
+
'<div class="chain-rail"><span class="chain-dot"></span><span class="chain-line"></span></div>' +
|
|
3280
|
+
'<div class="chain-body">' +
|
|
3281
|
+
'<div class="chain-head">' +
|
|
3282
|
+
'<span class="chain-transform">' + escapeHtml(g.transform || "?") + "</span>" +
|
|
3283
|
+
(g.count > 1 ? '<span class="chain-count">×' + g.count + "</span>" : "") +
|
|
3284
|
+
(delta.length ? '<span class="chain-delta">' + escapeHtml(delta.join(" ")) + "</span>" : "") +
|
|
3285
|
+
"</div>" +
|
|
3286
|
+
(caption ? '<div class="chain-caption">' + escapeHtml(caption) + "</div>" : "") +
|
|
3287
|
+
"</div>" +
|
|
3288
|
+
"</div>";
|
|
3289
|
+
}
|
|
3290
|
+
function renderChainStepper(region) {
|
|
3291
|
+
var lineage = region.raw.lineage || [];
|
|
3292
|
+
if (!lineage.length) {
|
|
3293
|
+
var n = region.raw.transformCount || 0;
|
|
3294
|
+
return '<div class="inspector-section"><h3>Transform chain</h3>' +
|
|
3295
|
+
'<p class="inspector-empty">' + (n > 0
|
|
3296
|
+
? escapeHtml("This map stores per-region TOTALS only, not the individual steps — the ledger counts " +
|
|
3297
|
+
n + " transform" + (n === 1 ? "" : "s") + " on this span, all of them real. Maps stored before " +
|
|
3298
|
+
"August 2026 were captured without the step column to keep the artifact small; re-run your " +
|
|
3299
|
+
"build to get the full chain.")
|
|
3300
|
+
: "No transform ran on this span.") +
|
|
3301
|
+
"</p></div>";
|
|
3302
|
+
}
|
|
3303
|
+
var groups = collapseLineage(lineage);
|
|
3304
|
+
var visible = groups.slice(0, CHAIN_VISIBLE_CAP).map(chainStepHtml).join("");
|
|
3305
|
+
var extra = groups.slice(CHAIN_VISIBLE_CAP);
|
|
3306
|
+
var extraHtml = extra.length
|
|
3307
|
+
? '<details class="chain-extra"><summary>show ' + extra.length + " more step" + (extra.length === 1 ? "" : "s") + "</summary>" +
|
|
3308
|
+
extra.map(chainStepHtml).join("") + "</details>"
|
|
3309
|
+
: "";
|
|
3310
|
+
var note = region.raw.lineageCapped
|
|
3311
|
+
? '<div class="chain-more">' + escapeHtml("ledger recorded " + region.raw.lineageCapped + " raw steps total; " + lineage.length + " embedded in this map") + "</div>"
|
|
3312
|
+
: "";
|
|
3313
|
+
return '<div class="inspector-section"><h3>Transform chain <span class="chip">' + groups.length + " step" + (groups.length === 1 ? "" : "s") +
|
|
3314
|
+
(region.raw.lineageCapped ? "+" : "") + '</span></h3><div class="chain">' + visible + "</div>" + extraHtml + note + "</div>";
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
var INSP_FACTS = 6;
|
|
3318
|
+
function inspFlag(kind, glyph, tip) {
|
|
3319
|
+
return '<span class="insp-flag" data-kind="' + kind + '" tabindex="0" role="note" data-tip="' +
|
|
3320
|
+
escapeAttr(tip) + '">' + escapeHtml(glyph) + "</span>";
|
|
3321
|
+
}
|
|
3322
|
+
function inspFact(f) {
|
|
3323
|
+
if (!f) return '<div class="insp-fact is-pad" aria-hidden="true"><span class="k">-</span><span class="v">-</span></div>';
|
|
3324
|
+
var val = f.html != null ? f.html : escapeHtml(f.v == null || f.v === "" ? "—" : String(f.v));
|
|
3325
|
+
return '<div class="insp-fact"' + (f.tip ? ' data-tip="' + escapeAttr(f.tip) + '"' : "") + ">" +
|
|
3326
|
+
'<span class="k">' + escapeHtml(f.k) + "</span>" +
|
|
3327
|
+
'<span class="v' + (f.dim ? " is-dim" : "") + (f.warn ? " is-warn" : "") + '"' +
|
|
3328
|
+
(f.full ? ' title="' + escapeAttr(f.full) + '"' : "") + ">" + val + "</span></div>";
|
|
3329
|
+
}
|
|
3330
|
+
function inspCard(o) {
|
|
3331
|
+
var facts = (o.facts || []).slice(0, INSP_FACTS);
|
|
3332
|
+
while (facts.length < INSP_FACTS) facts.push(null);
|
|
3333
|
+
var hasScore = o.score != null && !isNaN(o.score);
|
|
3334
|
+
var s = hasScore ? Math.max(0, Math.min(100, Math.round(o.score))) : 0;
|
|
3335
|
+
return '<div class="insp-card">' +
|
|
3336
|
+
'<div class="insp-ident">' + (o.chip || "") + (o.tier || "") +
|
|
3337
|
+
'<span class="insp-flags">' + (o.flags || []).join("") + "</span>" +
|
|
3338
|
+
'<span class="insp-score"' + (o.scoreTip ? ' data-tip="' + escapeAttr(o.scoreTip) + '"' : "") + ">" +
|
|
3339
|
+
(hasScore ? s + "<small>/100</small>" : "<small>—</small>") + "</span>" +
|
|
3340
|
+
"</div>" +
|
|
3341
|
+
'<div class="meter meter-lg insp-meter' + (hasScore ? "" : " is-blank") + '">' +
|
|
3342
|
+
'<i style="width:' + s + "%;background:" + heatSolid(s) + '"></i></div>' +
|
|
3343
|
+
'<div class="insp-where">' + escapeHtml(o.where || "") + "</div>" +
|
|
3344
|
+
'<div class="insp-facts">' + facts.map(inspFact).join("") + "</div>" +
|
|
3345
|
+
'<div class="insp-actions">' + (o.actions || "") + "</div>" +
|
|
3346
|
+
"</div>";
|
|
3347
|
+
}
|
|
3348
|
+
function inspChain(region) {
|
|
3349
|
+
if (!region) {
|
|
3350
|
+
return '<details class="insp-chain"><summary class="details-summary" data-tip="' +
|
|
3351
|
+
escapeAttr(INSP_COPY.noRegion) + '">Transform chain <span class="chip">no region</span></summary>' +
|
|
3352
|
+
'<p class="insp-note">' + escapeHtml(INSP_COPY.noRegion) + "</p></details>";
|
|
3353
|
+
}
|
|
3354
|
+
var groups = collapseLineage(region.raw.lineage || []);
|
|
3355
|
+
var n = region.raw.transformCount || 0;
|
|
3356
|
+
var label = groups.length
|
|
3357
|
+
? groups.length + " step" + (groups.length === 1 ? "" : "s") + (region.raw.lineageCapped ? "+" : "")
|
|
3358
|
+
: n > 0 ? "totals only" : "none";
|
|
3359
|
+
return '<details class="insp-chain"><summary class="details-summary">Transform chain <span class="chip">' +
|
|
3360
|
+
escapeHtml(label) + "</span></summary>" + renderChainStepper(region) + "</details>";
|
|
3361
|
+
}
|
|
3362
|
+
function chainTopStep(region) {
|
|
3363
|
+
var g = collapseLineage((region && region.raw.lineage) || [])[0];
|
|
3364
|
+
return g ? (g.transform || "?") + (g.count > 1 ? " ×" + g.count : "") : null;
|
|
3365
|
+
}
|
|
3366
|
+
function directiveTip(d) {
|
|
3367
|
+
var posture = [];
|
|
3368
|
+
if (d.target != null) posture.push("target " + d.target);
|
|
3369
|
+
if (d.floor != null) posture.push("floor " + (d.floor ? "on" : "off"));
|
|
3370
|
+
return "An @afterpack " + d.keyword + " marker recorded over this span" +
|
|
3371
|
+
(posture.length ? " — " + posture.join(" · ") : "") +
|
|
3372
|
+
". The build records the marker and its coordinates; whether it changed this span's target class is not recorded.";
|
|
3373
|
+
}
|
|
3374
|
+
function sizeDeltaText(n) { return n == null ? null : (n >= 0 ? "+" : "") + fmtNum(n) + " B"; }
|
|
3375
|
+
function machineryTip(file) {
|
|
3376
|
+
var m = file.machinery ? file.machinery.raw : null;
|
|
3377
|
+
if (!m) return MACHINERY_BLURB;
|
|
3378
|
+
var num = function (v) { return v == null ? "—" : String(v); };
|
|
3379
|
+
return "Whole-file bucket (not per-token) — entropyRaw " + num(m.entropyRaw) +
|
|
3380
|
+
", transformCount " + num(m.transformCount) + ", sizeDeltaEst " + num(m.sizeDeltaEst) +
|
|
3381
|
+
" (est.). " + MACHINERY_BLURB;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
|
|
3385
|
+
function tokenAt(file, pos) {
|
|
3386
|
+
var syn = lexFile(file);
|
|
3387
|
+
if (!syn) return { start: pos, end: Math.min(pos + 1, file.sourceLen), type: "?", text: file.source.charAt(pos) };
|
|
3388
|
+
var ti = tokenIndexAt(syn, pos);
|
|
3389
|
+
var start = syn.starts[ti], end = tokenEnd(syn, ti, file.sourceLen);
|
|
3390
|
+
return { start: start, end: end, type: syn.types.charAt(ti), text: file.source.slice(start, end) };
|
|
3391
|
+
}
|
|
3392
|
+
function neighbourRegions(file, pos) {
|
|
3393
|
+
var before = null, after = null;
|
|
3394
|
+
file.realRegions.forEach(function (r) {
|
|
3395
|
+
if (r.endChar <= pos) { if (!before || r.endChar > before.endChar) before = r; }
|
|
3396
|
+
else if (r.startChar >= pos) { if (!after || r.startChar < after.startChar) after = r; }
|
|
3397
|
+
});
|
|
3398
|
+
return { before: before, after: after };
|
|
3399
|
+
}
|
|
3400
|
+
function regionCoversLiteral(file, region) {
|
|
3401
|
+
var syn = lexFile(file);
|
|
3402
|
+
if (!syn) return true;
|
|
3403
|
+
var ti = tokenIndexAt(syn, region.startChar);
|
|
3404
|
+
while (ti < syn.starts.length && syn.starts[ti] < region.endChar) {
|
|
3405
|
+
var t = syn.types.charAt(ti);
|
|
3406
|
+
if (t === "s" || t === "n") return true;
|
|
3407
|
+
ti++;
|
|
3408
|
+
}
|
|
3409
|
+
return false;
|
|
3410
|
+
}
|
|
3411
|
+
function isMaterializationRegion(region) {
|
|
3412
|
+
return !!region && (region.raw.annotations || []).indexOf("materializationSite") >= 0;
|
|
3413
|
+
}
|
|
3414
|
+
function pct(part, total) { return total > 0 ? Math.round((part / total) * 100) + "%" : "—"; }
|
|
3415
|
+
|
|
3416
|
+
var UNLIT_VERDICT = {
|
|
3417
|
+
w: "Whitespace. Nothing here for any transform to act on.",
|
|
3418
|
+
p: "An operator or punctuation — required syntax. It has to survive verbatim for the program to parse, so no transform can touch it.",
|
|
3419
|
+
k: "A syntactic keyword — `if`, `return`, `function`, `const`. Required syntax: it has to survive verbatim for the program to parse, so no transform can touch it. (`null`, `true`, `false` and `undefined` are lexically keywords too, but they are VALUES, and this viewer reports them separately — they are not untouchable.)",
|
|
3420
|
+
v: "A value literal, not syntax. `null` / `true` / `false` / `undefined` are ordinary expressions, so unlike `if` or `return` an obfuscator may legitimately replace them — and AfterPack does: `true`/`false` are lowered to `!0`/`!1` and then fused into opaque arithmetic, while `null` and `undefined` are replaced by a reference to a shared sink, so the keyword itself never reaches your output. Unlit here means THIS MAP carries no region for the span, not that the token shipped verbatim. Maps captured before value-literal lowering was ledgered show every one of them unlit.",
|
|
3421
|
+
y: "A property key. AfterPack never RENAMES one — that would break every dynamic access, JSON round-trip and external contract that reaches it by name — but it does not leave it alone either: property extraction rewrites `state.items.map(…)` to `a[l](…)` and hoists `\"map\"` into the string pool, where string encoding treats it like any other literal. So a property key CAN carry a region, and usually does once encoding is on. Unlit means no region landed on THIS key: either the key was not extracted, or its span did not survive back-mapping. Keys that reach your output still readable are listed separately as `Property name` spotlights.",
|
|
3422
|
+
i: "An identifier with no rename recorded on it. Either your bundler resolved or removed it before AfterPack ran (an import binding, a type, dead code), or it is a name AfterPack must not touch — a global, an export your consumers call, a reserved word.",
|
|
3423
|
+
s: "A string literal with no ledger region on it.",
|
|
3424
|
+
n: "A number literal with no ledger region on it.",
|
|
3425
|
+
c: "A comment. Comments never reach your shipped output — your bundler strips them long before AfterPack sees the code — so there is nothing here to protect and nothing to leak.",
|
|
3426
|
+
"?": "This viewer has no grammar for this file type, so it cannot say what this token is. It carries no ledger region and no rename."
|
|
3427
|
+
};
|
|
3428
|
+
var LITERAL_FUNNEL_NOTE = "The map records a region only where a transform cleared the entropy funnel. A literal can also be gone before the engine ever sees it — a TypeScript type-position string is erased at compile time, and a constant your bundler folded away leaves nothing to encode.";
|
|
3429
|
+
|
|
3430
|
+
function cardRegion(file, region, opts) {
|
|
3431
|
+
var r = region.raw;
|
|
3432
|
+
var perf = r.perf || {};
|
|
3433
|
+
var flags = [];
|
|
3434
|
+
if (r.why) flags.push(inspFlag("info", "?", r.why));
|
|
3435
|
+
if (opts && opts.leakInside) flags.push(inspFlag("leak", "!", INSP_COPY.leakCap));
|
|
3436
|
+
if (isMaterializationRegion(region) && !regionCoversLiteral(file, region)) {
|
|
3437
|
+
flags.push(inspFlag("warn", "▲", INSP_COPY.spanMismatch));
|
|
3438
|
+
}
|
|
3439
|
+
if (region.directive) flags.push(inspFlag("dir", "@", directiveTip(region.directive)));
|
|
3440
|
+
var top = chainTopStep(region);
|
|
3441
|
+
return inspCard({
|
|
3442
|
+
chip: classChipHtml(r.reversalClass, false),
|
|
3443
|
+
tier: r.tier ? '<span class="tier-pill tier-' + escapeAttr(r.tier) + '">' + escapeHtml(r.tier) + "</span>" : "",
|
|
3444
|
+
flags: flags,
|
|
3445
|
+
score: r.score,
|
|
3446
|
+
scoreTip: INSP_COPY.score,
|
|
3447
|
+
where: (r.nodeKind || "?") + " · chars " + region.startChar + "–" + region.endChar,
|
|
3448
|
+
facts: [
|
|
3449
|
+
{ k: "Transforms", v: r.transformCount, tip: INSP_COPY.transforms },
|
|
3450
|
+
{ k: "Chain", v: top || (r.transformCount ? "totals only" : "none"), dim: !top, full: top || "",
|
|
3451
|
+
tip: top ? INSP_COPY.chainTop : INSP_COPY.chainNone },
|
|
3452
|
+
{ k: "Size Δ", v: sizeDeltaText(r.sizeDeltaEst), tip: INSP_COPY.sizeDelta },
|
|
3453
|
+
{ k: "Decode ops", v: perf.decodeOps, tip: INSP_COPY.decodeOps },
|
|
3454
|
+
{ k: "Entropy (raw)", v: r.entropyRaw, tip: INSP_COPY.entropy },
|
|
3455
|
+
r.ceiling
|
|
3456
|
+
? { k: "Ceiling", html: classChipHtml(r.ceiling.class, true), tip: INSP_COPY.ceiling }
|
|
3457
|
+
: { k: "Ceiling", v: "—", dim: true, tip: INSP_COPY.ceilingNone }
|
|
3458
|
+
],
|
|
3459
|
+
actions: r.ceiling
|
|
3460
|
+
? '<button type="button" class="mini-btn copy-btn-pro" data-copy="' + encodeURIComponent(r.ceiling.directive) +
|
|
3461
|
+
'" data-tip="' + escapeAttr(r.ceiling.directive + " — " + INSP_COPY.ceiling) + '">Copy Pro directive</button>'
|
|
3462
|
+
: ""
|
|
3463
|
+
}) + inspChain(region);
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
function cardPreserved(file, region) {
|
|
3467
|
+
var r = region.raw;
|
|
3468
|
+
var hasReason = !!r.preservedReason;
|
|
3469
|
+
var steps = (r.lineage || []).length;
|
|
3470
|
+
var count = r.transformCount || 0;
|
|
3471
|
+
var lowered = !hasReason && (steps > 0 || count > 0);
|
|
3472
|
+
var reason = hasReason ? humanize(r.preservedReason) : lowered ? INSP_COPY.preservedLowered : INSP_COPY.preservedNone;
|
|
3473
|
+
var flags = [inspFlag("info", "?", reason)];
|
|
3474
|
+
if (region.directive) flags.push(inspFlag("dir", "@", directiveTip(region.directive)));
|
|
3475
|
+
var top = chainTopStep(region);
|
|
3476
|
+
return inspCard({
|
|
3477
|
+
chip: classChipHtml("preserved", false),
|
|
3478
|
+
flags: flags,
|
|
3479
|
+
score: null,
|
|
3480
|
+
where: (r.nodeKind || "?") + " · chars " + region.startChar + "–" + region.endChar,
|
|
3481
|
+
facts: [
|
|
3482
|
+
{ k: "State", v: hasReason ? "must stay literal" : lowered ? "lowered only" : "no transform ran",
|
|
3483
|
+
tip: INSP_COPY.preservedState },
|
|
3484
|
+
{ k: "Reason", v: hasReason ? humanize(r.preservedReason) : "—", dim: !hasReason,
|
|
3485
|
+
full: hasReason ? humanize(r.preservedReason) : "", tip: hasReason ? reason : INSP_COPY.preservedState },
|
|
3486
|
+
{ k: "Reason code", v: r.preservedReason || "—", dim: !hasReason },
|
|
3487
|
+
{ k: "Transforms", v: count, tip: INSP_COPY.transforms },
|
|
3488
|
+
{ k: "Chain", v: top || (count ? "totals only" : "none"), dim: !top,
|
|
3489
|
+
tip: top ? INSP_COPY.chainTop : INSP_COPY.chainNone },
|
|
3490
|
+
region.directive
|
|
3491
|
+
? { k: "Directive", v: "@afterpack " + region.directive.keyword, tip: directiveTip(region.directive) }
|
|
3492
|
+
: { k: "Directive", v: "—", dim: true }
|
|
3493
|
+
],
|
|
3494
|
+
actions: ""
|
|
3495
|
+
}) + inspChain(region);
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
function cardRenamed(file, idx) {
|
|
3499
|
+
var r = file.renamedRanges[idx];
|
|
3500
|
+
return inspCard({
|
|
3501
|
+
chip: classChipHtml("renamed-encoded", false, "Renamed"),
|
|
3502
|
+
flags: [inspFlag("info", "?", INSP_COPY.renamedOutput)],
|
|
3503
|
+
score: null,
|
|
3504
|
+
where: "identifier" + (r ? " · chars " + r.startChar + "–" + r.endChar : ""),
|
|
3505
|
+
facts: [
|
|
3506
|
+
{ k: "Layer", v: "rename baseline", tip: INSP_COPY.renamedLayer },
|
|
3507
|
+
{ k: "In your output", v: "name replaced", tip: INSP_COPY.renamedOutput },
|
|
3508
|
+
{ k: "Strength", v: "low", dim: true, tip: INSP_COPY.renamedStrength },
|
|
3509
|
+
{ k: "Hardened region", v: "none on this span", dim: true, tip: INSP_COPY.renamedLayer },
|
|
3510
|
+
{ k: "Renamed span", v: (idx + 1) + " of " + fmtNum(file.renamedRanges.length),
|
|
3511
|
+
tip: "This span's position in the file's list of renamed identifier occurrences — not the 5th use of this particular name." },
|
|
3512
|
+
{ k: "Renamed share", v: pct(file.coverage.renamed, file.coverage.total), tip: INSP_COPY.coverage }
|
|
3513
|
+
],
|
|
3514
|
+
actions: ""
|
|
3515
|
+
}) + inspChain(null);
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
function cardExtracted(file, idx) {
|
|
3519
|
+
var r = file.extractedRanges[idx];
|
|
3520
|
+
var isGlobal = !!r && r.kind === "global";
|
|
3521
|
+
return inspCard({
|
|
3522
|
+
chip: classChipHtml("renamed-encoded", false, "Extracted"),
|
|
3523
|
+
flags: [inspFlag("info", "?", INSP_COPY.extractedOutput)],
|
|
3524
|
+
score: null,
|
|
3525
|
+
where: (isGlobal ? "global reference" : "property name") +
|
|
3526
|
+
(r ? " · chars " + r.startChar + "–" + r.endChar : ""),
|
|
3527
|
+
facts: [
|
|
3528
|
+
{ k: "Layer", v: "constant-pool extraction", tip: INSP_COPY.extractedLayer },
|
|
3529
|
+
{ k: "Extracted", v: isGlobal ? "global identifier" : "property name", tip: INSP_COPY.extractedKind },
|
|
3530
|
+
{ k: "In your output", v: "computed pool lookup", tip: INSP_COPY.extractedOutput },
|
|
3531
|
+
{ k: "Strength", v: "low–moderate", dim: true, tip: INSP_COPY.extractedStrength },
|
|
3532
|
+
{ k: "Hardened region", v: "none on this span", dim: true, tip: INSP_COPY.extractedLayer },
|
|
3533
|
+
{ k: "Extracted span", v: (idx + 1) + " of " + fmtNum(file.extractedRanges.length),
|
|
3534
|
+
tip: "This span's position in the file's list of extracted tokens — not the Nth use of this particular name." },
|
|
3535
|
+
{ k: "Extracted share", v: pct(file.coverage.extracted, file.coverage.total), tip: INSP_COPY.coverage }
|
|
3536
|
+
],
|
|
3537
|
+
actions: ""
|
|
3538
|
+
}) + inspChain(null);
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
function cardUnlit(file, u) {
|
|
3542
|
+
var tok = tokenAt(file, u.pos);
|
|
3543
|
+
if (tok.type === "?" && u.end != null) tok = { start: u.pos, end: u.end, type: "?", text: file.source.slice(u.pos, u.end) };
|
|
3544
|
+
var type = tok.type === "?" && u.type && u.type !== "?" ? u.type : tok.type;
|
|
3545
|
+
if (type === "k" && VALUE_LITERAL_TEXT[tok.text] === 1) type = "v";
|
|
3546
|
+
var kind = TOKEN_KIND[type] || "source text";
|
|
3547
|
+
var nb = neighbourRegions(file, tok.start);
|
|
3548
|
+
var cov = file.coverage;
|
|
3549
|
+
var before = nb.before;
|
|
3550
|
+
var gapText = before ? file.source.slice(before.endChar, tok.start) : null;
|
|
3551
|
+
var abuts = !!before && gapText.length <= 2 && !/\S/.test(gapText);
|
|
3552
|
+
var mislaid = abuts && isMaterializationRegion(before) && !regionCoversLiteral(file, before);
|
|
3553
|
+
var verdict = UNLIT_VERDICT[type] || UNLIT_VERDICT["?"];
|
|
3554
|
+
|
|
3555
|
+
var flags = [inspFlag("info", "?", verdict)];
|
|
3556
|
+
if (type === "s" || type === "n") flags.push(inspFlag("info", "ƒ", LITERAL_FUNNEL_NOTE));
|
|
3557
|
+
if (abuts) {
|
|
3558
|
+
flags.push(inspFlag("warn", "▲", "A recorded region ends " +
|
|
3559
|
+
(gapText.length === 0 ? "immediately" : gapText.length + " character" + (gapText.length === 1 ? "" : "s")) +
|
|
3560
|
+
" before this token, with nothing but whitespace in between. " + INSP_COPY.gapAbuts +
|
|
3561
|
+
(mislaid ? " " + INSP_COPY.spanMismatch : "")));
|
|
3562
|
+
}
|
|
3563
|
+
var di = -1;
|
|
3564
|
+
file.directives.forEach(function (d, i) {
|
|
3565
|
+
if (d.startChar <= tok.start && d.endChar >= tok.end &&
|
|
3566
|
+
(di < 0 || (d.endChar - d.startChar) < (file.directives[di].endChar - file.directives[di].startChar))) di = i;
|
|
3567
|
+
});
|
|
3568
|
+
if (di >= 0) flags.push(inspFlag("dir", "@", directiveTip(file.directives[di])));
|
|
3569
|
+
if (file.machinery) flags.push(inspFlag("info", "◫", machineryTip(file)));
|
|
3570
|
+
|
|
3571
|
+
var nearest = abuts
|
|
3572
|
+
? (gapText.length === 0 ? "abuts a region" : gapText.length + " chars after a region")
|
|
3573
|
+
: (before || nb.after)
|
|
3574
|
+
? [before ? (tok.start - before.endChar) + " chars after" : null,
|
|
3575
|
+
nb.after ? (nb.after.startChar - tok.end) + " chars before" : null].filter(Boolean).join(" · ")
|
|
3576
|
+
: "none in this file";
|
|
3577
|
+
return inspCard({
|
|
3578
|
+
chip: classChipHtml("preserved", true, "Not attributed"),
|
|
3579
|
+
flags: flags,
|
|
3580
|
+
score: null,
|
|
3581
|
+
where: kind + " · chars " + tok.start + "–" + tok.end,
|
|
3582
|
+
facts: [
|
|
3583
|
+
{ k: "Token", v: kind, tip: verdict },
|
|
3584
|
+
{ k: "Nearest region", v: nearest, warn: abuts,
|
|
3585
|
+
tip: abuts ? INSP_COPY.gapAbuts : (before || nb.after) ? INSP_COPY.gapClear : INSP_COPY.gapNone },
|
|
3586
|
+
{ k: "Ledger region", v: pct(cov.region, cov.total), tip: INSP_COPY.coverage },
|
|
3587
|
+
{ k: "Extracted only", v: pct(cov.extracted || 0, cov.total), tip: INSP_COPY.coverage },
|
|
3588
|
+
{ k: "Renamed only", v: pct(cov.renamed, cov.total), tip: INSP_COPY.coverage },
|
|
3589
|
+
{ k: "Plain", v: pct(cov.plain, cov.total), tip: INSP_COPY.coverage }
|
|
3590
|
+
],
|
|
3591
|
+
actions: abuts
|
|
3592
|
+
? '<button type="button" class="mini-btn" data-select-region="' + before.idx + '">Inspect that region</button>'
|
|
3593
|
+
: ""
|
|
3594
|
+
}) + inspChain(null);
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3597
|
+
function cardSpotlight(file, spotlight, region) {
|
|
3598
|
+
var s = spotlight.raw;
|
|
3599
|
+
var sev = s.severity;
|
|
3600
|
+
var leakLabel = sev === "leak" ? "Unprotected — leaked"
|
|
3601
|
+
: sev === "propertyName" ? "Unprotected — key name" : null;
|
|
3602
|
+
var flags = [];
|
|
3603
|
+
if (s.reason) flags.push(inspFlag("info", "?", s.reason));
|
|
3604
|
+
flags.push(inspFlag("leak", "!", INSP_COPY.leakCap));
|
|
3605
|
+
if (region && region.directive) flags.push(inspFlag("dir", "@", directiveTip(region.directive)));
|
|
3606
|
+
var mech = s.mechanism || "";
|
|
3607
|
+
return inspCard({
|
|
3608
|
+
chip: classChipHtml(s.reversalClass || "preserved", false, leakLabel),
|
|
3609
|
+
tier: '<span class="pill pill-' + escapeAttr(sev) + '">' + escapeHtml(SEVERITY_LABEL[sev] || sev) + "</span>",
|
|
3610
|
+
flags: flags,
|
|
3611
|
+
score: region ? region.raw.score : null,
|
|
3612
|
+
scoreTip: INSP_COPY.leakCap,
|
|
3613
|
+
where: (SEVERITY_ICON[sev] || "⚠") + " " + (SEVERITY_LABEL[sev] || sev) +
|
|
3614
|
+
" · chars " + spotlight.startChar + "–" + spotlight.endChar,
|
|
3615
|
+
facts: [
|
|
3616
|
+
{ k: "Sample", v: s.sample, full: s.sample, tip: INSP_COPY.sample },
|
|
3617
|
+
{ k: "Mechanism", v: mech ? humanize(mech) : "—", full: mech, dim: !mech, tip: INSP_COPY.mechanism },
|
|
3618
|
+
{ k: "Disposition", v: s.disposition, tip: INSP_COPY.disposition },
|
|
3619
|
+
{ k: "Added bytes", v: s.bytes == null ? "—" : s.bytes + " B", dim: s.bytes == null, tip: INSP_COPY.bytes },
|
|
3620
|
+
{ k: "Region class", html: region ? classChipHtml(region.raw.reversalClass, false) : null, v: "none",
|
|
3621
|
+
dim: !region, tip: region ? INSP_COPY.leakCap : INSP_COPY.noRegion },
|
|
3622
|
+
{ k: "Region score", v: region ? region.raw.score + "/100" : "—", dim: !region, tip: INSP_COPY.leakCap }
|
|
3623
|
+
],
|
|
3624
|
+
actions: s.proHint
|
|
3625
|
+
? '<button type="button" class="mini-btn copy-btn-pro" data-copy="' + encodeURIComponent(s.proHint) +
|
|
3626
|
+
'" data-tip="' + escapeAttr(s.proHint) + '">Force-protect in Pro</button>'
|
|
3627
|
+
: ""
|
|
3628
|
+
}) + inspChain(region);
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
function cardFile(file) {
|
|
3632
|
+
var a = file.doc.aggregate || {};
|
|
3633
|
+
var leaks = file.leakCount;
|
|
3634
|
+
var maxCls = (a.classSummary || {}).maxClassReached;
|
|
3635
|
+
var flags = [inspFlag("info", "?", INSP_COPY.selectHint)];
|
|
3636
|
+
if (file.machinery) flags.push(inspFlag("info", "◫", machineryTip(file)));
|
|
3637
|
+
return inspCard({
|
|
3638
|
+
chip: maxCls ? classChipHtml(maxCls, false) : '<span class="insp-title">File aggregate</span>',
|
|
3639
|
+
flags: flags,
|
|
3640
|
+
score: Math.round(file.avgScore),
|
|
3641
|
+
scoreTip: INSP_COPY.avgScore,
|
|
3642
|
+
where: "no selection · whole file",
|
|
3643
|
+
facts: [
|
|
3644
|
+
{ k: "Regions", v: fmtNum(file.realRegions.length), tip: INSP_COPY.fileRegions },
|
|
3645
|
+
{ k: "Transforms", v: fmtNum(a.totalTransforms), tip: INSP_COPY.transforms },
|
|
3646
|
+
{ k: "Weak spots", v: fmtNum(file.weakSpotCount), tip: INSP_COPY.weakSpots },
|
|
3647
|
+
{ k: "of which leaks", v: fmtNum(leaks), warn: leaks > 0, tip: INSP_COPY.leaks },
|
|
3648
|
+
{ k: "Size Δ total", v: sizeDeltaText(a.sizeDeltaEstTotal), tip: INSP_COPY.sizeDelta },
|
|
3649
|
+
{ k: "Avg entropy", v: a.avgEntropy, tip: INSP_COPY.entropyAvg }
|
|
3650
|
+
],
|
|
3651
|
+
actions: '<span class="insp-hint">Select any token to inspect it.</span>'
|
|
3652
|
+
}) + inspChain(null);
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
function inspectorSummary(file, sel) {
|
|
3656
|
+
if (!sel) return "no selection";
|
|
3657
|
+
if (sel.spotlightIdx != null) {
|
|
3658
|
+
var sp = file.spotlights[sel.spotlightIdx];
|
|
3659
|
+
var sample = sp && sp.raw.sample ? String(sp.raw.sample) : "";
|
|
3660
|
+
if (sample.length > 24) sample = sample.slice(0, 23) + "…";
|
|
3661
|
+
return sample ? "weak spot · " + sample : "weak spot";
|
|
3662
|
+
}
|
|
3663
|
+
if (sel.unlit) return "unattributed token";
|
|
3664
|
+
if (sel.renamedIdx != null) return "renamed identifier";
|
|
3665
|
+
if (sel.extractedIdx != null) return "extracted name";
|
|
3666
|
+
if (sel.regionIdx != null) {
|
|
3667
|
+
var region = regionByIdx(file, sel.regionIdx);
|
|
3668
|
+
if (!region) return "region";
|
|
3669
|
+
var cls = region.raw.reversalClass;
|
|
3670
|
+
return (CLASS_META[cls] && CLASS_META[cls].label) || cls || "region";
|
|
3671
|
+
}
|
|
3672
|
+
return "";
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
function renderInspector() {
|
|
3676
|
+
var el = document.getElementById("inspector");
|
|
3677
|
+
var countEl = document.getElementById("inspector-count");
|
|
3678
|
+
var file = activeFile();
|
|
3679
|
+
var sel = state.selection;
|
|
3680
|
+
if (countEl) countEl.textContent = file ? inspectorSummary(file, sel) : "";
|
|
3681
|
+
if (!file) { el.innerHTML = ""; return; }
|
|
3682
|
+
if (!sel) {
|
|
3683
|
+
el.innerHTML = '<p class="inspector-empty">Select any token in the code pane to inspect it.</p>';
|
|
3684
|
+
return;
|
|
3685
|
+
}
|
|
3686
|
+
var region = sel.regionIdx != null ? regionByIdx(file, sel.regionIdx) : null;
|
|
3687
|
+
var spotlight = sel.spotlightIdx != null ? file.spotlights[sel.spotlightIdx] : null;
|
|
3688
|
+
var html = spotlight ? cardSpotlight(file, spotlight, region)
|
|
3689
|
+
: region && isPreservedRegion(region) ? cardPreserved(file, region)
|
|
3690
|
+
: region ? cardRegion(file, region, null)
|
|
3691
|
+
: sel.unlit ? cardUnlit(file, sel.unlit)
|
|
3692
|
+
: sel.extractedIdx != null ? cardExtracted(file, sel.extractedIdx)
|
|
3693
|
+
: sel.renamedIdx != null ? cardRenamed(file, sel.renamedIdx)
|
|
3694
|
+
: cardFile(file);
|
|
3695
|
+
el.innerHTML = '<div class="insp">' + html + "</div>";
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
function highlightSelectionRing() {
|
|
3699
|
+
codeBody.querySelectorAll(".tok.is-selected").forEach(function (t) { t.classList.remove("is-selected"); });
|
|
3700
|
+
var sel = state.selection;
|
|
3701
|
+
if (!sel) return;
|
|
3702
|
+
if (sel.regionIdx != null) {
|
|
3703
|
+
codeBody.querySelectorAll('.tok[data-region-idx="' + sel.regionIdx + '"]').forEach(function (t) { t.classList.add("is-selected"); });
|
|
3704
|
+
} else if (sel.spotlightIdx != null) {
|
|
3705
|
+
codeBody.querySelectorAll('.tok[data-spotlight-idx="' + sel.spotlightIdx + '"]').forEach(function (t) { t.classList.add("is-selected"); });
|
|
3706
|
+
} else if (sel.extractedIdx != null) {
|
|
3707
|
+
codeBody.querySelectorAll('.tok[data-extracted-idx="' + sel.extractedIdx + '"]').forEach(function (t) { t.classList.add("is-selected"); });
|
|
3708
|
+
} else if (sel.renamedIdx != null) {
|
|
3709
|
+
codeBody.querySelectorAll('.tok[data-renamed-idx="' + sel.renamedIdx + '"]').forEach(function (t) { t.classList.add("is-selected"); });
|
|
3710
|
+
} else if (sel.unlit) {
|
|
3711
|
+
codeBody.querySelectorAll('.tok[data-unlit="' + sel.unlit.pos + '"]').forEach(function (t) { t.classList.add("is-selected"); });
|
|
3712
|
+
}
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
var highlightToggle = document.getElementById("highlight-class-toggle");
|
|
3716
|
+
var highlightStatus = document.getElementById("highlight-class-status");
|
|
3717
|
+
var syntaxToggle = document.getElementById("syntax-toggle");
|
|
3718
|
+
var syntaxToggleText = document.getElementById("syntax-toggle-text");
|
|
3719
|
+
function updateSyntaxToggle(file) {
|
|
3720
|
+
if (!syntaxToggle) return;
|
|
3721
|
+
var g = file && file.grammar;
|
|
3722
|
+
syntaxToggle.disabled = !g;
|
|
3723
|
+
syntaxToggle.checked = !!g && state.syntaxOn;
|
|
3724
|
+
if (syntaxToggleText) syntaxToggleText.textContent = g ? "Syntax · " + g.label : "Syntax · n/a";
|
|
3725
|
+
}
|
|
3726
|
+
function currentSelectedRegion() {
|
|
3727
|
+
var file = activeFile();
|
|
3728
|
+
if (!file || !state.selection || state.selection.regionIdx == null) return null;
|
|
3729
|
+
return regionByIdx(file, state.selection.regionIdx);
|
|
3730
|
+
}
|
|
3731
|
+
function applyHighlightClass() {
|
|
3732
|
+
var region = currentSelectedRegion();
|
|
3733
|
+
var cls = region ? region.raw.reversalClass : null;
|
|
3734
|
+
highlightToggle.disabled = !cls;
|
|
3735
|
+
var active = state.highlightClassOn && !!cls;
|
|
3736
|
+
if (active) {
|
|
3737
|
+
codeBody.setAttribute("data-highlight-class", cls);
|
|
3738
|
+
var file = activeFile();
|
|
3739
|
+
var count = file ? file.realRegions.filter(function (r) { return r.raw.reversalClass === cls; }).length : 0;
|
|
3740
|
+
var label = CLASS_META[cls] ? CLASS_META[cls].label : cls;
|
|
3741
|
+
highlightStatus.textContent = "· " + count + " region" + (count === 1 ? "" : "s");
|
|
3742
|
+
highlightStatus.setAttribute("data-tip", "Highlighting " + label + " — " + count + " region" +
|
|
3743
|
+
(count === 1 ? "" : "s") + " in this file share the selected token's reversal class.");
|
|
3744
|
+
highlightStatus.classList.add("is-on");
|
|
3745
|
+
} else {
|
|
3746
|
+
codeBody.removeAttribute("data-highlight-class");
|
|
3747
|
+
highlightStatus.classList.remove("is-on");
|
|
3748
|
+
highlightStatus.removeAttribute("data-tip");
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
function selectFromRun(regionIdx, spotlightIdx, renamedIdx, extractedIdx) {
|
|
3753
|
+
state.selection = {
|
|
3754
|
+
regionIdx: regionIdx == null || isNaN(regionIdx) ? null : regionIdx,
|
|
3755
|
+
spotlightIdx: spotlightIdx == null || isNaN(spotlightIdx) ? null : spotlightIdx,
|
|
3756
|
+
renamedIdx: renamedIdx == null || isNaN(renamedIdx) ? null : renamedIdx,
|
|
3757
|
+
extractedIdx: extractedIdx == null || isNaN(extractedIdx) ? null : extractedIdx,
|
|
3758
|
+
unlit: null
|
|
3759
|
+
};
|
|
3760
|
+
revealInspectorSection();
|
|
3761
|
+
highlightSelectionRing();
|
|
3762
|
+
applyHighlightClass();
|
|
3763
|
+
renderInspector();
|
|
3764
|
+
}
|
|
3765
|
+
function selectUnlit(pos, type, end) {
|
|
3766
|
+
state.selection = { regionIdx: null, spotlightIdx: null, renamedIdx: null, extractedIdx: null, unlit: { pos: pos, type: type, end: end } };
|
|
3767
|
+
revealInspectorSection();
|
|
3768
|
+
highlightSelectionRing();
|
|
3769
|
+
applyHighlightClass();
|
|
3770
|
+
renderInspector();
|
|
3771
|
+
}
|
|
3772
|
+
function clearSelection() {
|
|
3773
|
+
if (!state.selection) return;
|
|
3774
|
+
state.selection = null;
|
|
3775
|
+
highlightSelectionRing();
|
|
3776
|
+
applyHighlightClass();
|
|
3777
|
+
renderInspector();
|
|
3778
|
+
}
|
|
3779
|
+
function isAttributedTok(el) { return !!el && el.classList.contains("tok-hot"); }
|
|
3780
|
+
function isPickableTok(el) { return !!el && (el.classList.contains("tok-hot") || el.classList.contains("tok-unlit")); }
|
|
3781
|
+
function handleTokActivate(tokEl) {
|
|
3782
|
+
if (!isAttributedTok(tokEl)) {
|
|
3783
|
+
selectUnlit(Number(tokEl.dataset.unlit || 0), tokEl.dataset.ut || "?", tokEl.dataset.ue ? Number(tokEl.dataset.ue) : null);
|
|
3784
|
+
return;
|
|
3785
|
+
}
|
|
3786
|
+
var r = tokEl.dataset.regionIdx === "" ? null : Number(tokEl.dataset.regionIdx);
|
|
3787
|
+
var s = tokEl.dataset.spotlightIdx === "" ? null : Number(tokEl.dataset.spotlightIdx);
|
|
3788
|
+
var rn = tokEl.dataset.renamedIdx == null || tokEl.dataset.renamedIdx === "" ? null : Number(tokEl.dataset.renamedIdx);
|
|
3789
|
+
var ex = tokEl.dataset.extractedIdx == null || tokEl.dataset.extractedIdx === "" ? null : Number(tokEl.dataset.extractedIdx);
|
|
3790
|
+
selectFromRun(r, s, rn, ex);
|
|
3791
|
+
}
|
|
3792
|
+
function jumpToSpotlight(idx) {
|
|
3793
|
+
var file = activeFile();
|
|
3794
|
+
var target = codeBody.querySelector('.tok[data-spotlight-idx="' + idx + '"]');
|
|
3795
|
+
var run = file ? file.mergedRuns.filter(function (r) { return r.spotlightIdx === idx; })[0] : null;
|
|
3796
|
+
if (target) {
|
|
3797
|
+
target.scrollIntoView({ block: "center", inline: "center", behavior: "smooth" });
|
|
3798
|
+
target.focus({ preventScroll: true });
|
|
3799
|
+
}
|
|
3800
|
+
selectFromRun(run ? run.regionIdx : null, idx);
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
function copyText(text, btn) {
|
|
3804
|
+
function ok() {
|
|
3805
|
+
var prev = btn.textContent;
|
|
3806
|
+
btn.textContent = btn.getAttribute("data-copied-label") || "Copied";
|
|
3807
|
+
setTimeout(function () { btn.textContent = prev; }, 1400);
|
|
3808
|
+
}
|
|
3809
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
3810
|
+
navigator.clipboard.writeText(text).then(ok, function () { fallbackCopy(text); ok(); });
|
|
3811
|
+
} else {
|
|
3812
|
+
fallbackCopy(text);
|
|
3813
|
+
ok();
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
function fallbackCopy(text) {
|
|
3817
|
+
var ta = document.createElement("textarea");
|
|
3818
|
+
ta.value = text;
|
|
3819
|
+
ta.style.position = "fixed";
|
|
3820
|
+
ta.style.opacity = "0";
|
|
3821
|
+
document.body.appendChild(ta);
|
|
3822
|
+
ta.select();
|
|
3823
|
+
try { document.execCommand("copy"); } catch (e) {}
|
|
3824
|
+
document.body.removeChild(ta);
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
function updateSourceOriginNote(file) {
|
|
3828
|
+
var noteEl = document.getElementById("source-origin-note");
|
|
3829
|
+
var origin = sourceOriginOf(file);
|
|
3830
|
+
noteEl.textContent = origin === "machinery" ? "engine note (not your source)"
|
|
3831
|
+
: origin === "engineInput" ? "source: engine-input"
|
|
3832
|
+
: "source: original (via source map)";
|
|
3833
|
+
noteEl.setAttribute("data-tip", origin === "machinery"
|
|
3834
|
+
? "Not one of your files. This is the engine's accounting bucket for spans that map to no original source; the text in the pane is a fixed note the engine wrote, and the regions listed against it are measured in BUNDLE positions, so nothing here is painted over your code."
|
|
3835
|
+
: origin === "engineInput"
|
|
3836
|
+
? "Colored over engine-input source — if this input was bundled, provide a source map to see pre-bundle original source."
|
|
3837
|
+
: "Colored over original source (recovered via input source map).");
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
function onActiveFileChanged() {
|
|
3841
|
+
var file = activeFile();
|
|
3842
|
+
if (!file) return;
|
|
3843
|
+
updateSourceOriginNote(file);
|
|
3844
|
+
updateSyntaxToggle(file);
|
|
3845
|
+
revealActiveFile();
|
|
3846
|
+
renderTree();
|
|
3847
|
+
scrollTreeToActive();
|
|
3848
|
+
syncHash();
|
|
3849
|
+
renderFileSummary(file);
|
|
3850
|
+
renderClassDist(file);
|
|
3851
|
+
renderEngineInfo(file);
|
|
3852
|
+
paintCode(file);
|
|
3853
|
+
renderWeakSpots(file);
|
|
3854
|
+
highlightSelectionRing();
|
|
3855
|
+
applyHighlightClass();
|
|
3856
|
+
renderInspector();
|
|
3857
|
+
}
|
|
3858
|
+
|
|
3859
|
+
var appShell = document.getElementById("app");
|
|
3860
|
+
var railToggleBtn = document.getElementById("rail-toggle");
|
|
3861
|
+
function setRailCollapsed(collapsed, remember) {
|
|
3862
|
+
state.railCollapsed = collapsed;
|
|
3863
|
+
if (remember) setPref("railCollapsed", collapsed);
|
|
3864
|
+
appShell.classList.toggle("rail-collapsed", collapsed);
|
|
3865
|
+
railToggleBtn.setAttribute("aria-pressed", String(collapsed));
|
|
3866
|
+
railToggleBtn.setAttribute("title", collapsed ? "Show the file tree" : "Hide the file tree");
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
var inspectorToggleBtn = document.getElementById("inspector-toggle");
|
|
3870
|
+
function setInspectorCollapsed(collapsed, remember) {
|
|
3871
|
+
state.inspectorCollapsed = collapsed;
|
|
3872
|
+
if (remember) setPref("inspectorCollapsed", collapsed);
|
|
3873
|
+
appShell.classList.toggle("inspector-collapsed", collapsed);
|
|
3874
|
+
if (!inspectorToggleBtn) return;
|
|
3875
|
+
inspectorToggleBtn.setAttribute("aria-pressed", String(collapsed));
|
|
3876
|
+
var label = collapsed ? "Show the inspector panel" : "Hide the inspector panel";
|
|
3877
|
+
inspectorToggleBtn.setAttribute("title", label);
|
|
3878
|
+
inspectorToggleBtn.setAttribute("aria-label", label);
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
function isSectionCollapsed(sectionId) {
|
|
3882
|
+
var sec = document.getElementById(sectionId);
|
|
3883
|
+
return !!(sec && sec.classList.contains("is-collapsed"));
|
|
3884
|
+
}
|
|
3885
|
+
function setSectionCollapsed(sectionId, headId, collapsed, remember, prefKey) {
|
|
3886
|
+
var sec = document.getElementById(sectionId);
|
|
3887
|
+
var head = document.getElementById(headId);
|
|
3888
|
+
if (sec) sec.classList.toggle("is-collapsed", collapsed);
|
|
3889
|
+
if (head) head.setAttribute("aria-expanded", String(!collapsed));
|
|
3890
|
+
if (remember && prefKey) setPref(prefKey, collapsed);
|
|
3891
|
+
syncRailFill();
|
|
3892
|
+
}
|
|
3893
|
+
function toggleInspectorSection() {
|
|
3894
|
+
setSectionCollapsed("inspector-section", "inspector-head",
|
|
3895
|
+
!isSectionCollapsed("inspector-section"), true, "inspectorSectionCollapsed");
|
|
3896
|
+
}
|
|
3897
|
+
function toggleWeakSpotsSection() {
|
|
3898
|
+
setSectionCollapsed("weakspots-section", "weakspots-head",
|
|
3899
|
+
!isSectionCollapsed("weakspots-section"), true, "weakspotsCollapsed");
|
|
3900
|
+
}
|
|
3901
|
+
function revealInspectorSection() {
|
|
3902
|
+
if (isSectionCollapsed("inspector-section")) {
|
|
3903
|
+
setSectionCollapsed("inspector-section", "inspector-head", false, false);
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
var PREFS_KEY = "afterpack-protmap-prefs";
|
|
3908
|
+
var THEME_KEY = "afterpack-protmap-theme";
|
|
3909
|
+
var prefs = {};
|
|
3910
|
+
function loadPrefs() {
|
|
3911
|
+
try {
|
|
3912
|
+
var raw = localStorage.getItem(PREFS_KEY);
|
|
3913
|
+
prefs = raw ? JSON.parse(raw) : {};
|
|
3914
|
+
} catch (e) { prefs = {}; }
|
|
3915
|
+
if (!prefs || typeof prefs !== "object") prefs = {};
|
|
3916
|
+
if (prefs.theme !== "light" && prefs.theme !== "dark") {
|
|
3917
|
+
try {
|
|
3918
|
+
var legacy = localStorage.getItem(THEME_KEY);
|
|
3919
|
+
if (legacy === "light" || legacy === "dark") prefs.theme = legacy;
|
|
3920
|
+
} catch (e) {}
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
function setPref(k, v) {
|
|
3924
|
+
prefs[k] = v;
|
|
3925
|
+
try { localStorage.setItem(PREFS_KEY, JSON.stringify(prefs)); } catch (e) {}
|
|
3926
|
+
}
|
|
3927
|
+
loadPrefs();
|
|
3928
|
+
|
|
3929
|
+
var MIN_RAIL = 180;
|
|
3930
|
+
var MIN_CODE = 320;
|
|
3931
|
+
var RESIZER_EL = {};
|
|
3932
|
+
function resizerEl(which) {
|
|
3933
|
+
if (!(which in RESIZER_EL)) RESIZER_EL[which] = document.getElementById(which === "left" ? "resize-left" : "resize-right");
|
|
3934
|
+
return RESIZER_EL[which];
|
|
3935
|
+
}
|
|
3936
|
+
function railWidth(which) {
|
|
3937
|
+
var v = parseFloat(getComputedStyle(appShell).getPropertyValue(which === "left" ? "--rail-left-w" : "--rail-right-w"));
|
|
3938
|
+
return isNaN(v) ? (which === "left" ? 262 : 340) : v;
|
|
3939
|
+
}
|
|
3940
|
+
function railMax(which) {
|
|
3941
|
+
var otherShown = which === "left" ? !state.inspectorCollapsed : !state.railCollapsed;
|
|
3942
|
+
var other = otherShown ? railWidth(which === "left" ? "right" : "left") : 0;
|
|
3943
|
+
var shellW = appShell.getBoundingClientRect().width || window.innerWidth;
|
|
3944
|
+
return Math.max(MIN_RAIL, Math.min(shellW * 0.42, shellW - other - MIN_CODE));
|
|
3945
|
+
}
|
|
3946
|
+
function syncRailAria(which, w) {
|
|
3947
|
+
var handle = resizerEl(which);
|
|
3948
|
+
if (!handle) return;
|
|
3949
|
+
handle.setAttribute("aria-valuenow", String(Math.round(w == null ? railWidth(which) : w)));
|
|
3950
|
+
handle.setAttribute("aria-valuemax", String(Math.round(railMax(which))));
|
|
3951
|
+
}
|
|
3952
|
+
function restoreRailWidths() {
|
|
3953
|
+
if (typeof prefs.railLeftW === "number") setRailWidth("left", prefs.railLeftW, false);
|
|
3954
|
+
else syncRailAria("left", null);
|
|
3955
|
+
if (typeof prefs.railRightW === "number") setRailWidth("right", prefs.railRightW, false);
|
|
3956
|
+
else syncRailAria("right", null);
|
|
3957
|
+
}
|
|
3958
|
+
function setRailWidth(which, px, persist) {
|
|
3959
|
+
var w = Math.round(Math.max(MIN_RAIL, Math.min(px, railMax(which))));
|
|
3960
|
+
appShell.style.setProperty(which === "left" ? "--rail-left-w" : "--rail-right-w", w + "px");
|
|
3961
|
+
syncRailAria(which, w);
|
|
3962
|
+
if (persist !== false) setPref(which === "left" ? "railLeftW" : "railRightW", w);
|
|
3963
|
+
return w;
|
|
3964
|
+
}
|
|
3965
|
+
function wireResizer(el, which) {
|
|
3966
|
+
if (!el) return;
|
|
3967
|
+
var dragging = false;
|
|
3968
|
+
var dragWidth = null;
|
|
3969
|
+
function widthFromPointer(clientX) {
|
|
3970
|
+
var r = appShell.getBoundingClientRect();
|
|
3971
|
+
return which === "left" ? clientX - r.left : r.right - clientX;
|
|
3972
|
+
}
|
|
3973
|
+
el.addEventListener("pointerdown", function (e) {
|
|
3974
|
+
if (e.button != null && e.button !== 0) return;
|
|
3975
|
+
dragging = true;
|
|
3976
|
+
el.classList.add("is-dragging");
|
|
3977
|
+
document.body.classList.add("is-resizing");
|
|
3978
|
+
try { el.setPointerCapture(e.pointerId); } catch (err) { }
|
|
3979
|
+
e.preventDefault();
|
|
3980
|
+
});
|
|
3981
|
+
el.addEventListener("pointermove", function (e) {
|
|
3982
|
+
if (!dragging) return;
|
|
3983
|
+
dragWidth = setRailWidth(which, widthFromPointer(e.clientX), false);
|
|
3984
|
+
e.preventDefault();
|
|
3985
|
+
});
|
|
3986
|
+
function endDrag(e) {
|
|
3987
|
+
if (!dragging) return;
|
|
3988
|
+
dragging = false;
|
|
3989
|
+
el.classList.remove("is-dragging");
|
|
3990
|
+
document.body.classList.remove("is-resizing");
|
|
3991
|
+
try { if (e && e.pointerId != null) el.releasePointerCapture(e.pointerId); } catch (err) { }
|
|
3992
|
+
if (dragWidth != null) setPref(which === "left" ? "railLeftW" : "railRightW", dragWidth);
|
|
3993
|
+
dragWidth = null;
|
|
3994
|
+
}
|
|
3995
|
+
el.addEventListener("pointerup", endDrag);
|
|
3996
|
+
el.addEventListener("pointercancel", endDrag);
|
|
3997
|
+
el.addEventListener("lostpointercapture", endDrag);
|
|
3998
|
+
el.addEventListener("keydown", function (e) {
|
|
3999
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
4000
|
+
var step = (e.shiftKey ? 48 : 16) * (e.key === "ArrowLeft" ? -1 : 1) * (which === "left" ? 1 : -1);
|
|
4001
|
+
setRailWidth(which, railWidth(which) + step);
|
|
4002
|
+
e.preventDefault();
|
|
4003
|
+
});
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
var popoverEl = document.getElementById("build-popover");
|
|
4007
|
+
var legendBtn = document.getElementById("legend-toggle");
|
|
4008
|
+
function setPopover(open) {
|
|
4009
|
+
popoverEl.hidden = !open;
|
|
4010
|
+
legendBtn.setAttribute("aria-expanded", String(open));
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
var tooltipEl = document.getElementById("tooltip");
|
|
4014
|
+
var tipTarget = null;
|
|
4015
|
+
function positionTip(el) {
|
|
4016
|
+
var r = el.getBoundingClientRect();
|
|
4017
|
+
var tr = tooltipEl.getBoundingClientRect();
|
|
4018
|
+
var top = r.top - tr.height - 8;
|
|
4019
|
+
if (top < 8) top = r.bottom + 8;
|
|
4020
|
+
var left = r.left + r.width / 2 - tr.width / 2;
|
|
4021
|
+
left = Math.max(8, Math.min(left, window.innerWidth - tr.width - 8));
|
|
4022
|
+
tooltipEl.style.top = top + "px";
|
|
4023
|
+
tooltipEl.style.left = left + "px";
|
|
4024
|
+
}
|
|
4025
|
+
function showTip(el) {
|
|
4026
|
+
var tip = el.getAttribute("data-tip");
|
|
4027
|
+
if (!tip) return;
|
|
4028
|
+
tipTarget = el;
|
|
4029
|
+
tooltipEl.textContent = tip;
|
|
4030
|
+
tooltipEl.hidden = false;
|
|
4031
|
+
positionTip(el);
|
|
4032
|
+
tooltipEl.setAttribute("data-show", "");
|
|
4033
|
+
}
|
|
4034
|
+
function hideTip() {
|
|
4035
|
+
tipTarget = null;
|
|
4036
|
+
tooltipEl.removeAttribute("data-show");
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
var THEME_LABEL = { light: "☀ Light", dark: "🌙 Dark" };
|
|
4040
|
+
var themeBtn = document.getElementById("theme-toggle");
|
|
4041
|
+
function systemTheme() {
|
|
4042
|
+
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4043
|
+
}
|
|
4044
|
+
function repaintForTheme() {
|
|
4045
|
+
var file = activeFile();
|
|
4046
|
+
renderDirectiveLegend();
|
|
4047
|
+
if (file) { paintCode(file); renderTree(); renderLegend(); highlightSelectionRing(); }
|
|
4048
|
+
}
|
|
4049
|
+
function labelTheme(mode) {
|
|
4050
|
+
themeBtn.dataset.theme = mode;
|
|
4051
|
+
themeBtn.textContent = THEME_LABEL[mode] || THEME_LABEL.dark;
|
|
4052
|
+
themeBtn.setAttribute("aria-label", "Color theme: " + mode + ". Activate to switch to " + (mode === "dark" ? "light" : "dark") + ".");
|
|
4053
|
+
}
|
|
4054
|
+
function applyTheme(mode, quiet, forced) {
|
|
4055
|
+
if (mode !== "light" && mode !== "dark") mode = systemTheme();
|
|
4056
|
+
document.documentElement.setAttribute("data-theme", mode);
|
|
4057
|
+
labelTheme(mode);
|
|
4058
|
+
if (forced) { if (!quiet) repaintForTheme(); return; }
|
|
4059
|
+
setPref("theme", mode);
|
|
4060
|
+
try { localStorage.setItem(THEME_KEY, mode); } catch (e) {}
|
|
4061
|
+
if (!quiet) repaintForTheme();
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
function wireEvents() {
|
|
4065
|
+
railToggleBtn.addEventListener("click", function () {
|
|
4066
|
+
state.railManual = true;
|
|
4067
|
+
setRailCollapsed(!state.railCollapsed, true);
|
|
4068
|
+
});
|
|
4069
|
+
if (inspectorToggleBtn) {
|
|
4070
|
+
inspectorToggleBtn.addEventListener("click", function () { setInspectorCollapsed(!state.inspectorCollapsed, true); });
|
|
4071
|
+
}
|
|
4072
|
+
var inspectorHead = document.getElementById("inspector-head");
|
|
4073
|
+
if (inspectorHead) inspectorHead.addEventListener("click", toggleInspectorSection);
|
|
4074
|
+
var weakspotsHead = document.getElementById("weakspots-head");
|
|
4075
|
+
if (weakspotsHead) weakspotsHead.addEventListener("click", toggleWeakSpotsSection);
|
|
4076
|
+
wireResizer(document.getElementById("resize-left"), "left");
|
|
4077
|
+
wireResizer(document.getElementById("resize-right"), "right");
|
|
4078
|
+
legendBtn.addEventListener("click", function () { setPopover(popoverEl.hidden); });
|
|
4079
|
+
document.addEventListener("click", function (e) {
|
|
4080
|
+
if (popoverEl.hidden) return;
|
|
4081
|
+
if (!popoverEl.contains(e.target) && !legendBtn.contains(e.target)) setPopover(false);
|
|
4082
|
+
});
|
|
4083
|
+
document.addEventListener("keydown", function (e) {
|
|
4084
|
+
if (e.key === "Escape") { setPopover(false); hideTip(); }
|
|
4085
|
+
});
|
|
4086
|
+
var searchEl = document.getElementById("tree-search");
|
|
4087
|
+
if (searchEl) searchEl.addEventListener("input", function () { applyTreeSearch(searchEl.value); });
|
|
4088
|
+
|
|
4089
|
+
document.addEventListener("mouseover", function (e) {
|
|
4090
|
+
var el = e.target.closest ? e.target.closest("[data-tip]") : null;
|
|
4091
|
+
if (el && el !== tipTarget) showTip(el);
|
|
4092
|
+
});
|
|
4093
|
+
document.addEventListener("mouseout", function (e) {
|
|
4094
|
+
var el = e.target.closest ? e.target.closest("[data-tip]") : null;
|
|
4095
|
+
if (el && el === tipTarget && !el.contains(e.relatedTarget)) hideTip();
|
|
4096
|
+
});
|
|
4097
|
+
document.addEventListener("focusin", function (e) {
|
|
4098
|
+
var el = e.target.closest ? e.target.closest("[data-tip]") : null;
|
|
4099
|
+
if (el) showTip(el);
|
|
4100
|
+
});
|
|
4101
|
+
document.addEventListener("focusout", function () { hideTip(); });
|
|
4102
|
+
|
|
4103
|
+
themeBtn.addEventListener("click", function () {
|
|
4104
|
+
applyTheme((themeBtn.dataset.theme || systemTheme()) === "dark" ? "light" : "dark");
|
|
4105
|
+
});
|
|
4106
|
+
var darkQuery = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
4107
|
+
if (darkQuery) {
|
|
4108
|
+
var onSystemThemeChange = function () {
|
|
4109
|
+
if (document.documentElement.hasAttribute("data-theme")) return;
|
|
4110
|
+
labelTheme(systemTheme());
|
|
4111
|
+
repaintForTheme();
|
|
4112
|
+
};
|
|
4113
|
+
if (darkQuery.addEventListener) darkQuery.addEventListener("change", onSystemThemeChange);
|
|
4114
|
+
else if (darkQuery.addListener) darkQuery.addListener(onSystemThemeChange);
|
|
4115
|
+
}
|
|
4116
|
+
codeBody.addEventListener("click", function (e) {
|
|
4117
|
+
var t = e.target.closest(".tok");
|
|
4118
|
+
if (isPickableTok(t)) handleTokActivate(t);
|
|
4119
|
+
else clearSelection();
|
|
4120
|
+
});
|
|
4121
|
+
codeBody.addEventListener("keydown", function (e) {
|
|
4122
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
4123
|
+
var t = e.target.closest(".tok");
|
|
4124
|
+
if (!isPickableTok(t)) return;
|
|
4125
|
+
e.preventDefault();
|
|
4126
|
+
handleTokActivate(t);
|
|
4127
|
+
});
|
|
4128
|
+
var peerRegion = null;
|
|
4129
|
+
function setPeers(idx) {
|
|
4130
|
+
if (peerRegion === idx) return;
|
|
4131
|
+
codeBody.querySelectorAll(".tok.tok-peer").forEach(function (t) { t.classList.remove("tok-peer"); });
|
|
4132
|
+
peerRegion = idx;
|
|
4133
|
+
if (idx == null) return;
|
|
4134
|
+
codeBody.querySelectorAll('.tok[data-region-idx="' + idx + '"]').forEach(function (t) { t.classList.add("tok-peer"); });
|
|
4135
|
+
}
|
|
4136
|
+
codeBody.addEventListener("mouseover", function (e) {
|
|
4137
|
+
var t = e.target.closest ? e.target.closest(".tok-hot") : null;
|
|
4138
|
+
var idx = t && t.dataset.regionIdx !== "" ? t.dataset.regionIdx : null;
|
|
4139
|
+
setPeers(idx);
|
|
4140
|
+
});
|
|
4141
|
+
codeBody.addEventListener("mouseleave", function () { setPeers(null); });
|
|
4142
|
+
document.addEventListener("click", function (e) {
|
|
4143
|
+
if (!state.selection) return;
|
|
4144
|
+
var t = e.target;
|
|
4145
|
+
if (!t || !t.closest) return;
|
|
4146
|
+
if (t.closest(".tok") || t.closest(".rail-left, .rail-right, .topbar, .popover, .tooltip, .pane-resizer, .file-summary, .code-toolbar")) return;
|
|
4147
|
+
clearSelection();
|
|
4148
|
+
});
|
|
4149
|
+
var headEl = document.getElementById("file-summary");
|
|
4150
|
+
if (headEl) {
|
|
4151
|
+
headEl.addEventListener("click", function (e) {
|
|
4152
|
+
var btn = e.target.closest ? e.target.closest("[data-copy]") : null;
|
|
4153
|
+
if (btn && btn.dataset.copy) copyText(decodeURIComponent(btn.dataset.copy), btn);
|
|
4154
|
+
});
|
|
4155
|
+
}
|
|
4156
|
+
document.getElementById("weakspots-list").addEventListener("click", function (e) {
|
|
4157
|
+
var btn = e.target.closest("[data-jump-spotlight]");
|
|
4158
|
+
if (btn) jumpToSpotlight(Number(btn.dataset.jumpSpotlight));
|
|
4159
|
+
});
|
|
4160
|
+
document.getElementById("inspector").addEventListener("click", function (e) {
|
|
4161
|
+
var btn = e.target.closest("[data-copy]");
|
|
4162
|
+
if (btn) { copyText(decodeURIComponent(btn.dataset.copy), btn); return; }
|
|
4163
|
+
var jump = e.target.closest("[data-select-region]");
|
|
4164
|
+
if (jump) {
|
|
4165
|
+
var idx = Number(jump.dataset.selectRegion);
|
|
4166
|
+
selectFromRun(idx, null, null);
|
|
4167
|
+
var target = codeBody.querySelector('.tok[data-region-idx="' + idx + '"]');
|
|
4168
|
+
if (target) target.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth" });
|
|
4169
|
+
}
|
|
4170
|
+
});
|
|
4171
|
+
if (syntaxToggle) {
|
|
4172
|
+
syntaxToggle.addEventListener("change", function () {
|
|
4173
|
+
state.syntaxOn = syntaxToggle.checked;
|
|
4174
|
+
setPref("syntaxOn", state.syntaxOn);
|
|
4175
|
+
var f = activeFile();
|
|
4176
|
+
if (f) { paintCode(f); highlightSelectionRing(); }
|
|
4177
|
+
});
|
|
4178
|
+
}
|
|
4179
|
+
treeEl.addEventListener("click", function (e) {
|
|
4180
|
+
var row = e.target.closest(".tree-row");
|
|
4181
|
+
if (!row) return;
|
|
4182
|
+
if (row.dataset.kind === "folder") {
|
|
4183
|
+
var key = row.dataset.key;
|
|
4184
|
+
state.expandedFolders[key] = !state.expandedFolders[key];
|
|
4185
|
+
renderTree();
|
|
4186
|
+
} else {
|
|
4187
|
+
var fi = Number(row.dataset.fileIdx);
|
|
4188
|
+
if (fi === state.activeFileIdx) return;
|
|
4189
|
+
state.activeFileIdx = fi;
|
|
4190
|
+
state.selection = null;
|
|
4191
|
+
onActiveFileChanged();
|
|
4192
|
+
}
|
|
4193
|
+
});
|
|
4194
|
+
highlightToggle.addEventListener("change", function () {
|
|
4195
|
+
state.highlightClassOn = highlightToggle.checked;
|
|
4196
|
+
applyHighlightClass();
|
|
4197
|
+
});
|
|
4198
|
+
var filterEl = document.getElementById("file-filter");
|
|
4199
|
+
if (filterEl) {
|
|
4200
|
+
filterEl.addEventListener("click", function (e) {
|
|
4201
|
+
var b = e.target.closest("button[data-filter]");
|
|
4202
|
+
if (b) setFileFilter(b.dataset.filter);
|
|
4203
|
+
});
|
|
4204
|
+
}
|
|
4205
|
+
if (window.addEventListener) {
|
|
4206
|
+
window.addEventListener("hashchange", function () { applyDeepLink(readHashParams()); });
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4210
|
+
function applyDeepLink(h) {
|
|
4211
|
+
var note = "";
|
|
4212
|
+
if (typeof h.rail === "boolean") setRailCollapsed(h.rail);
|
|
4213
|
+
if (h.theme) applyTheme(h.theme, false, true);
|
|
4214
|
+
if (h.unknownFilter) {
|
|
4215
|
+
note = "This link asked for an unknown filter (\u201c" + h.unknownFilter + "\u201d).";
|
|
4216
|
+
} else if (h.filter) {
|
|
4217
|
+
var before = activeFileFilter;
|
|
4218
|
+
activeFileFilter = h.filter;
|
|
4219
|
+
var ok = h.filter === "all" || filteredFiles().length > 0;
|
|
4220
|
+
activeFileFilter = before;
|
|
4221
|
+
if (ok) setFileFilter(h.filter);
|
|
4222
|
+
else note = "No file in this build matches the \u201c" + h.filter + "\u201d filter.";
|
|
4223
|
+
}
|
|
4224
|
+
if (h.file) {
|
|
4225
|
+
var idx = findFileIdxByPath(h.file);
|
|
4226
|
+
if (idx < 0) {
|
|
4227
|
+
note = (note ? note + " " : "") + "\u201c" + h.file + "\u201d is not in this Protection Map.";
|
|
4228
|
+
} else if (idx !== state.activeFileIdx) {
|
|
4229
|
+
if (!filteredFiles().some(function (f) { return f.fileIdx === idx; })) setFileFilter("all");
|
|
4230
|
+
state.activeFileIdx = idx;
|
|
4231
|
+
state.selection = null;
|
|
4232
|
+
onActiveFileChanged();
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
setDeeplinkNote(note);
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4238
|
+
function init() {
|
|
4239
|
+
if (HASH0.theme) applyTheme(HASH0.theme, true, true);
|
|
4240
|
+
else if (prefs.theme === "light" || prefs.theme === "dark") applyTheme(prefs.theme, true);
|
|
4241
|
+
else labelTheme(systemTheme());
|
|
4242
|
+
|
|
4243
|
+
if (typeof prefs.syntaxOn === "boolean") state.syntaxOn = prefs.syntaxOn;
|
|
4244
|
+
|
|
4245
|
+
var brandLink = document.getElementById("brand-logo");
|
|
4246
|
+
if (brandLink) brandLink.setAttribute("href", ["https", "//www.afterpack.dev"].join(":"));
|
|
4247
|
+
|
|
4248
|
+
renderClassLegendStatic();
|
|
4249
|
+
renderDirectiveLegend();
|
|
4250
|
+
renderWorkspaceSummary();
|
|
4251
|
+
renderMapSize();
|
|
4252
|
+
var markedBtn = document.getElementById("filter-marked");
|
|
4253
|
+
if (markedBtn && !FILES.some(isMarkedFile)) markedBtn.remove();
|
|
4254
|
+
var weakBtn = document.getElementById("filter-weak");
|
|
4255
|
+
if (weakBtn && !FILES.some(isWeakFile)) weakBtn.remove();
|
|
4256
|
+
syncFilterButtons();
|
|
4257
|
+
setDeeplinkNote(deeplinkNote);
|
|
4258
|
+
wireEvents();
|
|
4259
|
+
|
|
4260
|
+
setRailCollapsed(
|
|
4261
|
+
typeof HASH0.rail === "boolean" ? HASH0.rail
|
|
4262
|
+
: typeof prefs.railCollapsed === "boolean" ? prefs.railCollapsed
|
|
4263
|
+
: FILES.length <= 1
|
|
4264
|
+
);
|
|
4265
|
+
if (prefs.inspectorCollapsed === true) setInspectorCollapsed(true);
|
|
4266
|
+
|
|
4267
|
+
if (HASH0.weakspots === "hidden") {
|
|
4268
|
+
var railRight = document.getElementById("rail-right");
|
|
4269
|
+
if (railRight) railRight.classList.add("weakspots-hidden");
|
|
4270
|
+
}
|
|
4271
|
+
setSectionCollapsed("inspector-section", "inspector-head", prefs.inspectorSectionCollapsed !== false);
|
|
4272
|
+
setSectionCollapsed("weakspots-section", "weakspots-head",
|
|
4273
|
+
HASH0.weakspots ? HASH0.weakspots !== "open" : prefs.weakspotsCollapsed !== false);
|
|
4274
|
+
restoreRailWidths();
|
|
4275
|
+
|
|
4276
|
+
var file = activeFile();
|
|
4277
|
+
if (!file) {
|
|
4278
|
+
document.getElementById("code-body").textContent = "No files in this Protection Map document.";
|
|
4279
|
+
return;
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
updateSourceOriginNote(file);
|
|
4283
|
+
updateSyntaxToggle(file);
|
|
4284
|
+
reapplyExpansion();
|
|
4285
|
+
renderTree();
|
|
4286
|
+
renderFileSummary(file);
|
|
4287
|
+
renderClassDist(file);
|
|
4288
|
+
renderLegend();
|
|
4289
|
+
renderEngineInfo(file);
|
|
4290
|
+
paintCode(file);
|
|
4291
|
+
renderWeakSpots(file);
|
|
4292
|
+
applyHighlightClass();
|
|
4293
|
+
renderInspector();
|
|
4294
|
+
scrollTreeToActive();
|
|
4295
|
+
syncHash();
|
|
4296
|
+
}
|
|
4297
|
+
|
|
4298
|
+
init();
|
|
4299
|
+
})();
|
|
4300
|
+
</script>
|
|
4301
|
+
</body>
|
|
4302
|
+
</html>
|