@krate/runtime 0.4.0-rc.3 → 0.4.0-rc.5

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.
@@ -0,0 +1,583 @@
1
+ /**
2
+ * Dev-only error overlay + toolbar.
3
+ *
4
+ * Bundled separately as `krate-dev.js` and injected only by `krate dev`; it is
5
+ * never part of the production runtime. It renders structured compiler
6
+ * diagnostics (file:line:col + source + caret + hint) and client runtime errors,
7
+ * forwards runtime errors back to the dev server, and offers open-in-editor.
8
+ */
9
+ function devConfig() {
10
+ const raw = window.__KRATE_DEV__;
11
+ const runtime = window.__KRATE_CFG__;
12
+ return {
13
+ sse: raw?.sse ?? '/__krate/hotreload',
14
+ errors: raw?.errors ?? '/__krate/client-error',
15
+ open: raw?.open ?? '/__krate/open',
16
+ overlay: raw?.overlay ?? true,
17
+ toolbar: raw?.toolbar ?? true,
18
+ basePath: raw?.basePath ?? runtime?.basePath ?? '',
19
+ };
20
+ }
21
+ function esc(s) {
22
+ return String(s)
23
+ .replace(/&/g, '&')
24
+ .replace(/</g, '&lt;')
25
+ .replace(/>/g, '&gt;')
26
+ .replace(/"/g, '&quot;')
27
+ .replace(/'/g, '&#39;');
28
+ }
29
+ function norm(p) {
30
+ return p.replace(/\/+$/, '') || '/';
31
+ }
32
+ /** Strips the configured base path so match patterns (unprefixed) line up. */
33
+ function stripBase(pathname, basePath) {
34
+ if (basePath && (pathname === basePath || pathname.startsWith(basePath + '/'))) {
35
+ const rest = pathname.slice(basePath.length);
36
+ return rest === '' ? '/' : rest;
37
+ }
38
+ return pathname;
39
+ }
40
+ const B64_VLQ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
41
+ /** Decodes a Base64 VLQ mapping segment into a delta array. */
42
+ export function decodeVLQ(str) {
43
+ const out = [];
44
+ let shift = 0;
45
+ let value = 0;
46
+ for (let i = 0; i < str.length; i++) {
47
+ const digit = B64_VLQ.indexOf(str[i]);
48
+ if (digit === -1)
49
+ continue;
50
+ const cont = (digit & 32) !== 0;
51
+ value += (digit & 31) << shift;
52
+ if (cont) {
53
+ shift += 5;
54
+ continue;
55
+ }
56
+ const neg = (value & 1) === 1;
57
+ value >>= 1;
58
+ out.push(neg ? -value : value);
59
+ value = 0;
60
+ shift = 0;
61
+ }
62
+ return out;
63
+ }
64
+ /** Decodes a v3 `mappings` string into per-generated-line segments. */
65
+ export function decodeMappings(mappings) {
66
+ const lines = [];
67
+ let src = 0;
68
+ let srcLine = 0;
69
+ let srcCol = 0;
70
+ for (const line of mappings.split(';')) {
71
+ const segs = [];
72
+ let genCol = 0;
73
+ if (line) {
74
+ for (const part of line.split(',')) {
75
+ if (!part)
76
+ continue;
77
+ const nums = decodeVLQ(part);
78
+ genCol += nums[0] || 0;
79
+ if (nums.length >= 4) {
80
+ src += nums[1];
81
+ srcLine += nums[2];
82
+ srcCol += nums[3];
83
+ segs.push({ genCol, src, srcLine, srcCol });
84
+ }
85
+ }
86
+ }
87
+ lines.push(segs);
88
+ }
89
+ return lines;
90
+ }
91
+ const mapCache = new Map();
92
+ async function loadSourceMap(url) {
93
+ const cached = mapCache.get(url);
94
+ if (cached)
95
+ return cached;
96
+ const p = (async () => {
97
+ try {
98
+ if (/^[a-z]+:\/\//i.test(url) && !url.startsWith(location.origin))
99
+ return null;
100
+ const res = await fetch(url + '.map');
101
+ if (!res.ok)
102
+ return null;
103
+ const json = await res.json();
104
+ if (!json || typeof json.mappings !== 'string')
105
+ return null;
106
+ return { sources: json.sources || [], lines: decodeMappings(json.mappings) };
107
+ }
108
+ catch {
109
+ return null;
110
+ }
111
+ })();
112
+ mapCache.set(url, p);
113
+ return p;
114
+ }
115
+ /** Parses a V8/Firefox stack line into its script location, if present. */
116
+ export function parseStackFrame(line) {
117
+ const patterns = [
118
+ /^(.*?)((?:https?:)?\/\/[^\s)]+|\/[^\s):]+):(\d+):(\d+)(.*)$/,
119
+ ];
120
+ for (const re of patterns) {
121
+ const m = re.exec(line);
122
+ if (!m)
123
+ continue;
124
+ return { prefix: m[1], url: m[2], line: Number(m[3]), col: Number(m[4]), suffix: m[5] };
125
+ }
126
+ return null;
127
+ }
128
+ function remapLocation(map, line, col) {
129
+ const segs = map.lines[line - 1];
130
+ if (!segs || segs.length === 0)
131
+ return null;
132
+ let best = null;
133
+ for (const s of segs) {
134
+ if (s.genCol <= col - 1)
135
+ best = s;
136
+ else
137
+ break;
138
+ }
139
+ if (!best)
140
+ best = segs[0];
141
+ const source = map.sources[best.src] || '';
142
+ return { source, line: best.srcLine + 1, col: best.srcCol + 1 };
143
+ }
144
+ /** Rewrites each mappable frame of a stack trace to its original location. */
145
+ export async function symbolicateStack(stack) {
146
+ if (!stack || stack.indexOf('.js') === -1)
147
+ return stack;
148
+ const lines = stack.split('\n');
149
+ const out = await Promise.all(lines.map(async (line) => {
150
+ const frame = parseStackFrame(line);
151
+ if (!frame)
152
+ return line;
153
+ const map = await loadSourceMap(frame.url);
154
+ if (!map)
155
+ return line;
156
+ const loc = remapLocation(map, frame.line, frame.col);
157
+ if (!loc)
158
+ return line;
159
+ return frame.prefix + loc.source + ':' + loc.line + ':' + loc.col + frame.suffix;
160
+ }));
161
+ return out.join('\n');
162
+ }
163
+ /**
164
+ * Route matcher: a segment starting with `[` matches anything; `[...x]` matches
165
+ * the rest. Exported (pure) for testing.
166
+ */
167
+ export function routeMatches(pattern, pathname, basePath = '') {
168
+ const a = norm(stripBase(pathname, basePath)).split('/');
169
+ const b = norm(pattern).split('/');
170
+ for (let i = 0; i < b.length; i++) {
171
+ const s = b[i];
172
+ if (s.charAt(0) === '[') {
173
+ if (s.indexOf('[...') === 0)
174
+ return true;
175
+ continue;
176
+ }
177
+ if (s !== a[i])
178
+ return false;
179
+ }
180
+ return a.length === b.length;
181
+ }
182
+ const ICON_RELOAD = '<svg class="ic" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" ' +
183
+ 'stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
184
+ '<path d="M21 12a9 9 0 1 1-2.64-6.36"/><path d="M21 3v6h-6"/></svg>';
185
+ const ICON_ALERT = '<svg class="ic" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" ' +
186
+ 'stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
187
+ '<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>' +
188
+ '<path d="M12 9v4"/><path d="M12 17h.01"/></svg>';
189
+ const STYLE = `
190
+ :host { all: initial; }
191
+ * { box-sizing: border-box; }
192
+
193
+ /* palette */
194
+ :host {
195
+ --red: #f87171;
196
+ --green: #34d399;
197
+ --bg: #111114;
198
+ --bg-2: #17171c;
199
+ --line: #2a2a31;
200
+ --fg: #e5e7eb;
201
+ --muted: #9ca3af;
202
+ }
203
+
204
+ /* toolbar */
205
+ .toolbar {
206
+ position: fixed; left: 50%; bottom: 0; z-index: 2147483001;
207
+ transform: translate(-50%, 54%);
208
+ transition: transform .28s cubic-bezier(.22,.61,.36,1),
209
+ border-top-color .35s ease;
210
+ display: flex; align-items: stretch; gap: 2px;
211
+ background: var(--bg);
212
+ border: 1px solid var(--line);
213
+ border-top: 3px solid var(--green);
214
+ border-radius: 16px 16px 0 0;
215
+ padding: 7px 8px 9px;
216
+ box-shadow: 0 -10px 30px rgba(0,0,0,.45);
217
+ font: 12px/1.3 ui-sans-serif, system-ui, -apple-system, sans-serif;
218
+ color: var(--fg);
219
+ }
220
+ .toolbar:hover, .toolbar:focus-within { transform: translate(-50%, 0); }
221
+ .toolbar.bad { border-top-color: var(--red); }
222
+
223
+ .tb-btn {
224
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
225
+ gap: 3px; min-width: 56px; padding: 5px 10px;
226
+ background: transparent; border: 1px solid transparent; border-radius: 11px;
227
+ color: var(--muted); cursor: pointer; font: inherit;
228
+ transition: color .15s ease, background .15s ease;
229
+ }
230
+ .tb-btn:hover { color: var(--fg); background: rgba(255,255,255,.06); }
231
+ .tb-btn .ic { display: block; width: 18px; height: 18px; }
232
+ .tb-btn .tb-label { font-size: 10px; letter-spacing: .02em; }
233
+ .toolbar.bad .tb-btn.errors { color: var(--red); }
234
+
235
+ .tb-center {
236
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
237
+ gap: 1px; min-width: 130px; padding: 2px 16px;
238
+ }
239
+ .tb-center .brand { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #f3f4f6; }
240
+ .tb-center .route {
241
+ font-size: 10px; color: var(--muted);
242
+ max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
243
+ }
244
+
245
+ /* overlay */
246
+ .overlay {
247
+ position: fixed; inset: 0; z-index: 2147483000;
248
+ background: rgba(9, 9, 11, 0.72); backdrop-filter: blur(6px);
249
+ display: flex; align-items: flex-start; justify-content: center;
250
+ padding: 4vh 16px; overflow: auto;
251
+ font: 13px/1.5 "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
252
+ color: var(--fg);
253
+ }
254
+ .overlay[hidden] { display: none; }
255
+ .card {
256
+ width: min(920px, 100%); background: var(--bg);
257
+ border: 1px solid var(--line);
258
+ border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,0.5); overflow: hidden;
259
+ }
260
+ .card-head {
261
+ display: flex; align-items: center; gap: 10px; padding: 14px 18px;
262
+ border-bottom: 1px solid var(--line); background: var(--bg-2);
263
+ }
264
+ .title { font-weight: 600; font-size: 14px; color: var(--red); }
265
+ .count { color: var(--muted); font-size: 12px; }
266
+ .spacer { flex: 1; }
267
+ .btn {
268
+ border: 1px solid var(--line); background: transparent; color: var(--muted);
269
+ border-radius: 9px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12px;
270
+ transition: color .15s ease, background .15s ease, border-color .15s ease;
271
+ }
272
+ .btn:hover { color: var(--fg); background: rgba(255,255,255,.06); border-color: #44444f; }
273
+ .list { padding: 6px 0; }
274
+ .diag { padding: 14px 18px; border-bottom: 1px solid #1f1f26; }
275
+ .diag:last-child { border-bottom: none; }
276
+ .actions { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
277
+ .loc {
278
+ display: inline-flex; align-items: center; gap: 6px; color: #60a5fa;
279
+ background: transparent; border: none; padding: 0; cursor: pointer;
280
+ font: inherit; font-size: 12px;
281
+ }
282
+ .loc:hover { text-decoration: underline; }
283
+ .msg { color: #f3f4f6; white-space: pre-wrap; word-break: break-word; }
284
+ .frame {
285
+ margin-top: 10px; background: #0b0b0e; border: 1px solid #26262e;
286
+ border-radius: 7px; padding: 8px 10px; overflow-x: auto; white-space: pre;
287
+ }
288
+ .frame .src { color: #cbd5e1; }
289
+ .frame .caret { color: var(--red); }
290
+ .hint { margin-top: 8px; color: #a3e635; }
291
+ .stack {
292
+ margin-top: 10px; color: var(--muted); white-space: pre-wrap; word-break: break-word;
293
+ max-height: 320px; overflow: auto;
294
+ }
295
+ `;
296
+ class KrateDev {
297
+ constructor() {
298
+ this.cfg = devConfig();
299
+ this.buildDiags = [];
300
+ this.runtimeErrors = [];
301
+ this.seen = new Set();
302
+ }
303
+ init() {
304
+ const host = document.createElement('div');
305
+ host.id = 'krate-dev-root';
306
+ (document.body || document.documentElement).appendChild(host);
307
+ this.shadow = host.attachShadow({ mode: 'open' });
308
+ const style = document.createElement('style');
309
+ style.textContent = STYLE;
310
+ this.shadow.appendChild(style);
311
+ this.overlay = document.createElement('div');
312
+ this.overlay.className = 'overlay';
313
+ this.overlay.hidden = true;
314
+ this.overlay.innerHTML =
315
+ '<div class="card"><div class="card-head">' +
316
+ '<span class="title"></span><span class="count"></span>' +
317
+ '<span class="spacer"></span>' +
318
+ '<button class="btn close" type="button">Dismiss (Esc)</button></div>' +
319
+ '<div class="list"></div></div>';
320
+ this.shadow.appendChild(this.overlay);
321
+ this.title = this.overlay.querySelector('.title');
322
+ this.list = this.overlay.querySelector('.list');
323
+ if (this.cfg.toolbar) {
324
+ this.toolbar = document.createElement('div');
325
+ this.toolbar.className = 'toolbar';
326
+ this.toolbar.innerHTML =
327
+ '<button class="tb-btn errors" type="button" title="Show errors">' +
328
+ ICON_ALERT +
329
+ '<span class="tb-label">Errors</span></button>' +
330
+ '<div class="tb-center"><span class="brand">krate</span>' +
331
+ '<span class="route"></span></div>' +
332
+ '<button class="tb-btn reload" type="button" title="Reload">' +
333
+ ICON_RELOAD +
334
+ '<span class="tb-label">Reload</span></button>';
335
+ this.shadow.appendChild(this.toolbar);
336
+ this.routeEl = this.toolbar.querySelector('.route');
337
+ this.routeEl.textContent = location.pathname;
338
+ this.watchLocation();
339
+ }
340
+ this.shadow.addEventListener('click', (e) => this.onClick(e));
341
+ document.addEventListener('keydown', (e) => {
342
+ if (e.key === 'Escape')
343
+ this.hide();
344
+ });
345
+ this.connectSSE();
346
+ this.captureRuntimeErrors();
347
+ }
348
+ onClick(e) {
349
+ const t = e.target.closest('.btn, .loc, .tb-btn');
350
+ if (!t)
351
+ return;
352
+ // Toolbar buttons are inside a `:focus-within` container that keeps the
353
+ // half-hidden toolbar raised; blur after acting so a click (with no errors
354
+ // to show) lets it slide back down. Keyboard focus still raises it.
355
+ if (t.classList.contains('tb-btn'))
356
+ t.blur();
357
+ if (t.classList.contains('close')) {
358
+ this.hide();
359
+ return;
360
+ }
361
+ if (t.classList.contains('errors') || t.classList.contains('toggle')) {
362
+ if (this.overlay.hidden)
363
+ this.show();
364
+ else
365
+ this.hide();
366
+ return;
367
+ }
368
+ if (t.classList.contains('reload')) {
369
+ location.reload();
370
+ return;
371
+ }
372
+ if (t.classList.contains('loc') || t.classList.contains('open')) {
373
+ this.openInEditor(t.getAttribute('data-file') || '', t.getAttribute('data-line') || '');
374
+ }
375
+ }
376
+ openInEditor(file, line) {
377
+ if (!file)
378
+ return;
379
+ const url = this.cfg.open + '?file=' + encodeURIComponent(file) + '&line=' + encodeURIComponent(line);
380
+ fetch(url).catch(() => { });
381
+ }
382
+ /** Keep the toolbar route label in sync with SPA (history) navigation. */
383
+ watchLocation() {
384
+ const update = () => {
385
+ if (this.routeEl)
386
+ this.routeEl.textContent = location.pathname;
387
+ };
388
+ window.addEventListener('popstate', update);
389
+ const h = history;
390
+ const push = h.pushState.bind(history);
391
+ h.pushState = function (...args) {
392
+ const r = push(...args);
393
+ update();
394
+ return r;
395
+ };
396
+ const replace = h.replaceState.bind(history);
397
+ h.replaceState = function (...args) {
398
+ const r = replace(...args);
399
+ update();
400
+ return r;
401
+ };
402
+ // Safety net for routers that swap content without touching history.
403
+ setInterval(update, 500);
404
+ }
405
+ connectSSE() {
406
+ let sse;
407
+ try {
408
+ sse = new EventSource(this.cfg.sse);
409
+ }
410
+ catch {
411
+ return;
412
+ }
413
+ sse.addEventListener('reload', (e) => {
414
+ try {
415
+ const d = JSON.parse(e.data);
416
+ if (d.pages &&
417
+ Array.isArray(d.pages) &&
418
+ !d.pages.some((p) => routeMatches(p, location.pathname, this.cfg.basePath))) {
419
+ return;
420
+ }
421
+ }
422
+ catch {
423
+ /* full reload */
424
+ }
425
+ location.reload();
426
+ });
427
+ sse.addEventListener('build-error', (e) => {
428
+ try {
429
+ const d = JSON.parse(e.data);
430
+ this.buildDiags = Array.isArray(d.diagnostics) ? d.diagnostics : [];
431
+ }
432
+ catch {
433
+ this.buildDiags = [];
434
+ }
435
+ this.setStatus(this.buildDiags.length === 0);
436
+ this.render();
437
+ });
438
+ sse.addEventListener('client-error', (e) => {
439
+ try {
440
+ const d = JSON.parse(e.data);
441
+ if (!d.clientError)
442
+ return;
443
+ const err = d.clientError;
444
+ this.addRuntime('Runtime Error', err.message, err.stack);
445
+ }
446
+ catch {
447
+ /* ignore */
448
+ }
449
+ });
450
+ }
451
+ captureRuntimeErrors() {
452
+ window.addEventListener('error', (e) => {
453
+ const stack = e.error?.stack || '';
454
+ const message = e.message || 'Unknown error';
455
+ this.report({
456
+ message,
457
+ stack,
458
+ url: e.filename,
459
+ line: e.lineno,
460
+ col: e.colno,
461
+ kind: 'error',
462
+ });
463
+ this.addRuntime('Runtime Error', message, stack);
464
+ });
465
+ window.addEventListener('unhandledrejection', (e) => {
466
+ const reason = e.reason;
467
+ const message = reason instanceof Error ? reason.message : String(reason);
468
+ const stack = reason instanceof Error ? reason.stack : '';
469
+ this.report({ message, stack, url: location.href, kind: 'unhandledrejection' });
470
+ this.addRuntime('Unhandled Promise Rejection', message, stack);
471
+ });
472
+ }
473
+ report(payload) {
474
+ const key = payload.message + '|' + (payload.stack || '');
475
+ if (this.seen.has(key))
476
+ return;
477
+ this.seen.add(key);
478
+ try {
479
+ const body = JSON.stringify(payload);
480
+ if (navigator.sendBeacon) {
481
+ navigator.sendBeacon(this.cfg.errors, new Blob([body], { type: 'application/json' }));
482
+ }
483
+ else {
484
+ fetch(this.cfg.errors, { method: 'POST', body, headers: { 'Content-Type': 'application/json' }, keepalive: true });
485
+ }
486
+ }
487
+ catch {
488
+ /* reporting is best-effort */
489
+ }
490
+ }
491
+ addRuntime(title, message, stack) {
492
+ const entry = { title, message, stack };
493
+ this.runtimeErrors.push(entry);
494
+ this.setStatus(false);
495
+ this.render();
496
+ // Render immediately with the raw stack, then upgrade in place if a source
497
+ // map lets us point at the original location.
498
+ if (stack) {
499
+ void symbolicateStack(stack).then((mapped) => {
500
+ if (mapped && mapped !== stack) {
501
+ entry.stack = mapped;
502
+ this.render();
503
+ }
504
+ });
505
+ }
506
+ }
507
+ setStatus(ok) {
508
+ if (!this.toolbar)
509
+ return;
510
+ this.toolbar.classList.toggle('bad', !ok);
511
+ }
512
+ frameHTML(d) {
513
+ if (!d.source)
514
+ return '';
515
+ const col = Math.max(1, d.col || 1);
516
+ const caret = ' '.repeat(col - 1) + '^';
517
+ return '<div class="frame"><span class="src">' + esc(d.source) + '</span>\n<span class="caret">' + esc(caret) + '</span></div>';
518
+ }
519
+ diagHTML(d) {
520
+ let actions = '';
521
+ if (d.file) {
522
+ const loc = d.file + (d.line ? ':' + d.line + (d.col ? ':' + d.col : '') : '');
523
+ actions =
524
+ '<div class="actions">' +
525
+ '<button class="loc" data-file="' + esc(d.file) + '" data-line="' + esc(d.line || '') + '">' + esc(loc) + '</button>' +
526
+ '<button class="btn open" data-file="' + esc(d.file) + '" data-line="' + esc(d.line || '') + '">Open in editor</button>' +
527
+ '</div>';
528
+ }
529
+ const hint = d.hint ? '<div class="hint">hint: ' + esc(d.hint) + '</div>' : '';
530
+ return '<div class="diag">' + actions + '<div class="msg">' + esc(d.message) + '</div>' + this.frameHTML(d) + hint + '</div>';
531
+ }
532
+ runtimeHTML(r) {
533
+ const stack = r.stack ? '<div class="stack">' + esc(r.stack) + '</div>' : '';
534
+ return '<div class="diag"><div class="msg">' + esc(r.message) + '</div>' + stack + '</div>';
535
+ }
536
+ render() {
537
+ const total = this.buildDiags.length + this.runtimeErrors.length;
538
+ if (total === 0) {
539
+ this.hide();
540
+ return;
541
+ }
542
+ this.title.textContent = this.buildDiags.length > 0 ? 'Compilation failed' : 'Runtime error';
543
+ let html = '';
544
+ for (const d of this.buildDiags)
545
+ html += this.diagHTML(d);
546
+ for (const r of this.runtimeErrors)
547
+ html += this.runtimeHTML(r);
548
+ this.list.innerHTML = html;
549
+ this.overlay.querySelector('.count').textContent = total > 1 ? String(total) : '';
550
+ if (this.cfg.overlay)
551
+ this.overlay.hidden = false;
552
+ }
553
+ show() {
554
+ if (this.buildDiags.length + this.runtimeErrors.length > 0)
555
+ this.overlay.hidden = false;
556
+ }
557
+ hide() {
558
+ this.overlay.hidden = true;
559
+ }
560
+ }
561
+ /** Initialise the dev overlay. Safe to call more than once. */
562
+ export function initDevOverlay() {
563
+ if (typeof window === 'undefined' || typeof document === 'undefined')
564
+ return;
565
+ if (window.__krate_dev_overlay)
566
+ return;
567
+ window.__krate_dev_overlay = true;
568
+ try {
569
+ new KrateDev().init();
570
+ }
571
+ catch (err) {
572
+ // Never let the dev tooling break the app.
573
+ console.error('[krate] dev overlay failed to initialise', err);
574
+ }
575
+ }
576
+ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
577
+ if (document.readyState === 'loading') {
578
+ document.addEventListener('DOMContentLoaded', initDevOverlay, { once: true });
579
+ }
580
+ else {
581
+ initDevOverlay();
582
+ }
583
+ }
@@ -0,0 +1 @@
1
+ export {};