@buoy-gg/js-top 7.0.41 → 7.0.43
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/README.md +12 -71
- package/lib/commonjs/index.js +1 -99
- package/lib/commonjs/js-top/components/BusySparkline.js +1 -56
- package/lib/commonjs/js-top/components/JsTopHudOverlay.js +1 -79
- package/lib/commonjs/js-top/components/JsTopModal.js +1 -349
- package/lib/commonjs/js-top/components/TaskDetailView.js +1 -330
- package/lib/commonjs/js-top/components/TaskTable.js +1 -360
- package/lib/commonjs/js-top/engine/JsTopController.js +1 -350
- package/lib/commonjs/js-top/engine/aggregator.js +1 -148
- package/lib/commonjs/js-top/engine/busyProbe.js +1 -101
- package/lib/commonjs/js-top/engine/frameStack.js +1 -133
- package/lib/commonjs/js-top/engine/longtasks.js +1 -141
- package/lib/commonjs/js-top/engine/now.js +1 -38
- package/lib/commonjs/js-top/engine/originRegistry.js +1 -402
- package/lib/commonjs/js-top/engine/patches/bridge.js +1 -60
- package/lib/commonjs/js-top/engine/patches/microtasks.js +1 -27
- package/lib/commonjs/js-top/engine/patches/promises.js +1 -65
- package/lib/commonjs/js-top/engine/patches/timers.js +1 -66
- package/lib/commonjs/js-top/engine/state.js +1 -63
- package/lib/commonjs/js-top/engine/symbolicate.js +1 -95
- package/lib/commonjs/js-top/sync/jsTopSyncAdapter.js +1 -74
- package/lib/commonjs/js-top/types/index.js +1 -46
- package/lib/commonjs/js-top/utils/preferences.js +1 -31
- package/lib/commonjs/preset.js +1 -75
- package/lib/module/index.js +1 -49
- package/lib/module/js-top/components/BusySparkline.js +1 -52
- package/lib/module/js-top/components/JsTopHudOverlay.js +1 -75
- package/lib/module/js-top/components/JsTopModal.js +1 -345
- package/lib/module/js-top/components/TaskDetailView.js +1 -326
- package/lib/module/js-top/components/TaskTable.js +1 -353
- package/lib/module/js-top/engine/JsTopController.js +1 -347
- package/lib/module/js-top/engine/aggregator.js +1 -136
- package/lib/module/js-top/engine/busyProbe.js +1 -94
- package/lib/module/js-top/engine/frameStack.js +1 -126
- package/lib/module/js-top/engine/longtasks.js +1 -133
- package/lib/module/js-top/engine/now.js +1 -33
- package/lib/module/js-top/engine/originRegistry.js +1 -388
- package/lib/module/js-top/engine/patches/bridge.js +1 -56
- package/lib/module/js-top/engine/patches/microtasks.js +1 -23
- package/lib/module/js-top/engine/patches/promises.js +1 -62
- package/lib/module/js-top/engine/patches/timers.js +1 -62
- package/lib/module/js-top/engine/state.js +1 -54
- package/lib/module/js-top/engine/symbolicate.js +1 -91
- package/lib/module/js-top/sync/jsTopSyncAdapter.js +1 -70
- package/lib/module/js-top/types/index.js +1 -42
- package/lib/module/js-top/utils/preferences.js +1 -26
- package/lib/module/preset.js +1 -71
- package/lib/web/index.mjs +2 -3
- package/package.json +3 -6
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/js-top/components/BusySparkline.js.map +0 -1
- package/lib/commonjs/js-top/components/JsTopHudOverlay.js.map +0 -1
- package/lib/commonjs/js-top/components/JsTopModal.js.map +0 -1
- package/lib/commonjs/js-top/components/TaskDetailView.js.map +0 -1
- package/lib/commonjs/js-top/components/TaskTable.js.map +0 -1
- package/lib/commonjs/js-top/engine/JsTopController.js.map +0 -1
- package/lib/commonjs/js-top/engine/aggregator.js.map +0 -1
- package/lib/commonjs/js-top/engine/busyProbe.js.map +0 -1
- package/lib/commonjs/js-top/engine/frameStack.js.map +0 -1
- package/lib/commonjs/js-top/engine/longtasks.js.map +0 -1
- package/lib/commonjs/js-top/engine/now.js.map +0 -1
- package/lib/commonjs/js-top/engine/originRegistry.js.map +0 -1
- package/lib/commonjs/js-top/engine/patches/bridge.js.map +0 -1
- package/lib/commonjs/js-top/engine/patches/microtasks.js.map +0 -1
- package/lib/commonjs/js-top/engine/patches/promises.js.map +0 -1
- package/lib/commonjs/js-top/engine/patches/timers.js.map +0 -1
- package/lib/commonjs/js-top/engine/state.js.map +0 -1
- package/lib/commonjs/js-top/engine/symbolicate.js.map +0 -1
- package/lib/commonjs/js-top/sync/jsTopSyncAdapter.js.map +0 -1
- package/lib/commonjs/js-top/types/index.js.map +0 -1
- package/lib/commonjs/js-top/utils/preferences.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/js-top/components/BusySparkline.js.map +0 -1
- package/lib/module/js-top/components/JsTopHudOverlay.js.map +0 -1
- package/lib/module/js-top/components/JsTopModal.js.map +0 -1
- package/lib/module/js-top/components/TaskDetailView.js.map +0 -1
- package/lib/module/js-top/components/TaskTable.js.map +0 -1
- package/lib/module/js-top/engine/JsTopController.js.map +0 -1
- package/lib/module/js-top/engine/aggregator.js.map +0 -1
- package/lib/module/js-top/engine/busyProbe.js.map +0 -1
- package/lib/module/js-top/engine/frameStack.js.map +0 -1
- package/lib/module/js-top/engine/longtasks.js.map +0 -1
- package/lib/module/js-top/engine/now.js.map +0 -1
- package/lib/module/js-top/engine/originRegistry.js.map +0 -1
- package/lib/module/js-top/engine/patches/bridge.js.map +0 -1
- package/lib/module/js-top/engine/patches/microtasks.js.map +0 -1
- package/lib/module/js-top/engine/patches/promises.js.map +0 -1
- package/lib/module/js-top/engine/patches/timers.js.map +0 -1
- package/lib/module/js-top/engine/state.js.map +0 -1
- package/lib/module/js-top/engine/symbolicate.js.map +0 -1
- package/lib/module/js-top/sync/jsTopSyncAdapter.js.map +0 -1
- package/lib/module/js-top/types/index.js.map +0 -1
- package/lib/module/js-top/utils/preferences.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/js-top/components/BusySparkline.d.ts.map +0 -1
- package/lib/typescript/js-top/components/JsTopHudOverlay.d.ts.map +0 -1
- package/lib/typescript/js-top/components/JsTopModal.d.ts.map +0 -1
- package/lib/typescript/js-top/components/TaskDetailView.d.ts.map +0 -1
- package/lib/typescript/js-top/components/TaskTable.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/JsTopController.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/aggregator.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/busyProbe.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/frameStack.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/longtasks.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/now.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/originRegistry.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/patches/bridge.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/patches/microtasks.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/patches/promises.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/patches/timers.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/state.d.ts.map +0 -1
- package/lib/typescript/js-top/engine/symbolicate.d.ts.map +0 -1
- package/lib/typescript/js-top/sync/jsTopSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/js-top/types/index.d.ts.map +0 -1
- package/lib/typescript/js-top/utils/preferences.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
|
@@ -1,91 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Dev-only origin symbolication via Metro's /symbolicate endpoint (the same
|
|
5
|
-
* one LogBox uses). Hermes stacks give function names + bundle offsets; for
|
|
6
|
-
* anonymous scheduling sites (the typical `useEffect(() => setInterval(…))`)
|
|
7
|
-
* that leaves an unreadable label. Metro maps the offset back to the real
|
|
8
|
-
* source file — so a row can say `setInterval ← ChatScreen.tsx:42`, which is
|
|
9
|
-
* component-level attribution in practice.
|
|
10
|
-
*
|
|
11
|
-
* Fire-and-forget with hard caps: one attempt per origin, few in flight,
|
|
12
|
-
* silent on any failure (release builds, tunnels, Metro gone). The origin's
|
|
13
|
-
* label/file/line are upgraded in place when the answer lands — the table
|
|
14
|
-
* re-renders every tick and picks it up.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const MAX_IN_FLIGHT = 3;
|
|
18
|
-
let inFlight = 0;
|
|
19
|
-
function isDev() {
|
|
20
|
-
return typeof __DEV__ !== "undefined" && __DEV__;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** Last two path segments of a source path — "screens/ChatScreen.tsx". */
|
|
24
|
-
function tailPath(file) {
|
|
25
|
-
const clean = file.split("?")[0] ?? file;
|
|
26
|
-
const parts = clean.split("/").filter(Boolean);
|
|
27
|
-
return parts.slice(-2).join("/");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** True for names like ChatScreen / PokemonScreen — reads as a component. */
|
|
31
|
-
function looksLikeComponent(name) {
|
|
32
|
-
return /^[A-Z][A-Za-z0-9]*$/.test(name);
|
|
33
|
-
}
|
|
34
|
-
export function buoyJsTopSymbolicateOrigin(o, apiLabelText) {
|
|
35
|
-
if (!isDev()) return;
|
|
36
|
-
if (o.symbolicated || !o.frames || o.frames.length === 0) return;
|
|
37
|
-
if (inFlight >= MAX_IN_FLIGHT) return; // retried implicitly? no — one shot
|
|
38
|
-
o.symbolicated = true;
|
|
39
|
-
const top = o.frames[0];
|
|
40
|
-
if (!top || !/^https?:\/\//.test(top.file)) return;
|
|
41
|
-
let endpoint;
|
|
42
|
-
try {
|
|
43
|
-
endpoint = `${new URL(top.file).origin}/symbolicate`;
|
|
44
|
-
} catch {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
inFlight++;
|
|
48
|
-
const body = JSON.stringify({
|
|
49
|
-
stack: o.frames.map(f => ({
|
|
50
|
-
file: f.file,
|
|
51
|
-
lineNumber: f.line,
|
|
52
|
-
column: f.col,
|
|
53
|
-
methodName: ""
|
|
54
|
-
}))
|
|
55
|
-
});
|
|
56
|
-
fetch(endpoint, {
|
|
57
|
-
method: "POST",
|
|
58
|
-
body
|
|
59
|
-
}).then(res => res.ok ? res.json() : null).then(data => {
|
|
60
|
-
let frame = data?.stack?.find(f => f.file && !f.file.includes("node_modules")) ?? data?.stack?.[0];
|
|
61
|
-
// Some Metro configs (serialized source maps) reject full
|
|
62
|
-
// symbolication but still NAME the module in the error — that file
|
|
63
|
-
// path is exactly the scheduling site, so harvest it.
|
|
64
|
-
if (!frame?.file && data?.error) {
|
|
65
|
-
const m = /found: (\/.+)$/.exec(data.error);
|
|
66
|
-
if (m) frame = {
|
|
67
|
-
file: m[1]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (!frame?.file) return;
|
|
71
|
-
const file = tailPath(frame.file);
|
|
72
|
-
const line = frame.lineNumber;
|
|
73
|
-
const method = frame.methodName && frame.methodName !== "<unknown>" ? frame.methodName : undefined;
|
|
74
|
-
o.file = file;
|
|
75
|
-
o.line = line ?? o.line;
|
|
76
|
-
// The existing label is name-anchored — append the source site
|
|
77
|
-
// once, and promote a component-looking method name.
|
|
78
|
-
const site = `${file.split("/").pop()}${line != null ? `:${line}` : ""}`;
|
|
79
|
-
if (method && looksLikeComponent(method) && !o.caller) {
|
|
80
|
-
o.caller = method;
|
|
81
|
-
o.label = `${o.label} ← <${method}> · ${site}`;
|
|
82
|
-
} else {
|
|
83
|
-
o.label = `${o.label} · ${site}`;
|
|
84
|
-
}
|
|
85
|
-
}).catch(() => {
|
|
86
|
-
// Symbolication is best-effort decoration — never surface failures.
|
|
87
|
-
}).finally(() => {
|
|
88
|
-
inFlight--;
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=symbolicate.js.map
|
|
1
|
+
"use strict";const d=3;let o=0;function h(){return typeof __DEV__!=="undefined"&&__DEV__}function p(e){const c=e.split("?")[0]??e;const i=c.split("/").filter(Boolean);return i.slice(-2).join("/")}function b(e){return/^[A-Z][A-Za-z0-9]*$/.test(e)}export function buoyJsTopSymbolicateOrigin(e,c){if(!h())return;if(e.symbolicated||!e.frames||e.frames.length===0)return;if(o>=d)return;e.symbolicated=true;const i=e.frames[0];if(!i||!/^https?:\/\//.test(i.file))return;let f;try{f=`${new URL(i.file).origin}/symbolicate`}catch{return}o++;const m=JSON.stringify({stack:e.frames.map(t=>({file:t.file,lineNumber:t.line,column:t.col,methodName:""}))});fetch(f,{method:"POST",body:m}).then(t=>t.ok?t.json():null).then(t=>{let n=t?.stack?.find(l=>l.file&&!l.file.includes("node_modules"))??t?.stack?.[0];if(!n?.file&&t?.error){const l=/found: (\/.+)$/.exec(t.error);if(l)n={file:l[1]}}if(!n?.file)return;const a=p(n.file);const s=n.lineNumber;const r=n.methodName&&n.methodName!=="<unknown>"?n.methodName:void 0;e.file=a;e.line=s??e.line;const u=`${a.split("/").pop()}${s!=null?`:${s}`:""}`;if(r&&b(r)&&!e.caller){e.caller=r;e.label=`${e.label} \u2190 <${r}> \xB7 ${u}`}else{e.label=`${e.label} \xB7 ${u}`}}).catch(()=>{}).finally(()=>{o--})}
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sync adapter for the JS TOP tool, consumed by @buoy-gg/external-sync's
|
|
5
|
-
* `useExternalSync` (structurally matches its ToolSyncAdapter interface so
|
|
6
|
-
* this package doesn't need a dependency on it — same pattern as
|
|
7
|
-
* perf-monitor's adapter).
|
|
8
|
-
*
|
|
9
|
-
* `subscribe` is only called while a dashboard is watching, and subscribing
|
|
10
|
-
* to JsTopController is exactly what starts the engine — so a desktop
|
|
11
|
-
* watcher auto-starts sampling and closing the desktop tool stops it. The
|
|
12
|
-
* snapshot IS the live channel; there is no heavy persisted state.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { JsTopController } from "../engine/JsTopController";
|
|
16
|
-
export const jsTopSyncAdapter = {
|
|
17
|
-
version: 1,
|
|
18
|
-
getSnapshot: () => ({
|
|
19
|
-
live: JsTopController.getSnapshot(),
|
|
20
|
-
// "enabled" mirrors perf-monitor semantics: is the device sampling for
|
|
21
|
-
// any viewer (its own HUD/modal or a desktop's silent remote sampling).
|
|
22
|
-
enabled: JsTopController.isEnabled() || JsTopController.isRemoteSampling()
|
|
23
|
-
}),
|
|
24
|
-
subscribe: onChange => {
|
|
25
|
-
const unsubSnapshot = JsTopController.subscribe(() => onChange());
|
|
26
|
-
const unsubEnabled = JsTopController.subscribeEnabled(() => onChange());
|
|
27
|
-
return () => {
|
|
28
|
-
unsubSnapshot();
|
|
29
|
-
unsubEnabled();
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
actions: {
|
|
33
|
-
/**
|
|
34
|
-
* Silent sampling for a desktop viewer: streams snapshots without
|
|
35
|
-
* showing the device's own HUD. (Subscribing via `subscribe` already
|
|
36
|
-
* runs the engine while watched; this exists so MCP / scripted callers
|
|
37
|
-
* can force sampling on without a watch.)
|
|
38
|
-
*/
|
|
39
|
-
setEnabled: params => {
|
|
40
|
-
const enabled = params.enabled;
|
|
41
|
-
JsTopController.setRemoteSampling(enabled);
|
|
42
|
-
},
|
|
43
|
-
pause: () => JsTopController.pause(),
|
|
44
|
-
resume: () => JsTopController.resume(),
|
|
45
|
-
clear: () => JsTopController.clear(),
|
|
46
|
-
/** Full detail for one origin (desktop tap-through parity). */
|
|
47
|
-
getOriginDetail: params => JsTopController.getOriginDetail(params.key),
|
|
48
|
-
/**
|
|
49
|
-
* One-shot sample for MCP/automation: ensure the engine is running,
|
|
50
|
-
* observe for `durationMs` (default 3s, capped 30s), return the
|
|
51
|
-
* resulting snapshot. `clearFirst` resets all stats before sampling so
|
|
52
|
-
* the result attributes exactly one interaction/window. Leaves sampling
|
|
53
|
-
* in its prior state.
|
|
54
|
-
*/
|
|
55
|
-
sample: async params => {
|
|
56
|
-
const p = params;
|
|
57
|
-
const durationMs = Math.min(Math.max(p?.durationMs ?? 3000, 250), 30_000);
|
|
58
|
-
const wasSampling = JsTopController.isRemoteSampling() || JsTopController.isEnabled();
|
|
59
|
-
if (!wasSampling) JsTopController.setRemoteSampling(true);
|
|
60
|
-
if (p?.clearFirst) JsTopController.clear();
|
|
61
|
-
try {
|
|
62
|
-
await new Promise(resolve => setTimeout(resolve, durationMs));
|
|
63
|
-
return JsTopController.getSnapshot();
|
|
64
|
-
} finally {
|
|
65
|
-
if (!wasSampling) JsTopController.setRemoteSampling(false);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=jsTopSyncAdapter.js.map
|
|
1
|
+
"use strict";import{JsTopController as e}from"../engine/JsTopController";export const jsTopSyncAdapter={version:1,getSnapshot:()=>({live:e.getSnapshot(),enabled:e.isEnabled()||e.isRemoteSampling()}),subscribe:s=>{const t=e.subscribe(()=>s());const a=e.subscribeEnabled(()=>s());return()=>{t();a()}},actions:{setEnabled:s=>{const t=s.enabled;e.setRemoteSampling(t)},pause:()=>e.pause(),resume:()=>e.resume(),clear:()=>e.clear(),getOriginDetail:s=>e.getOriginDetail(s.key),sample:async s=>{const t=s;const a=Math.min(Math.max(t?.durationMs??3e3,250),3e4);const n=e.isRemoteSampling()||e.isEnabled();if(!n)e.setRemoteSampling(true);if(t?.clearFirst)e.clear();try{await new Promise(i=>setTimeout(i,a));return e.getSnapshot()}finally{if(!n)e.setRemoteSampling(false)}}}};
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* JS TOP — live Task Manager for the React Native JS thread.
|
|
5
|
-
*
|
|
6
|
-
* Attribution model: the engine wraps every JS-thread entry point it can
|
|
7
|
-
* reach (timers, rAF, microtasks, Promise reactions, legacy-bridge call-ins)
|
|
8
|
-
* and books EXCLUSIVE time per "origin" (the place a callback was scheduled
|
|
9
|
-
* from). A high-frequency probe measures true thread occupancy; the gap
|
|
10
|
-
* between measured busy time and attributed time is surfaced honestly as an
|
|
11
|
-
* "unattributed" row rather than hidden.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/** Which entry-point API a task came through. */
|
|
15
|
-
|
|
16
|
-
/** One captured stack frame from an origin's scheduling site (dev-readable). */
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Which coverage tiers are live on this device. UIs gray out / banner what a
|
|
20
|
-
* runtime can't see (e.g. bridge call-ins don't exist on bridgeless).
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** One row of the live table — a task origin ("process" in Task Manager terms). */
|
|
24
|
-
|
|
25
|
-
/** A 50ms+ blocking task reported by the runtime, with our best attribution. */
|
|
26
|
-
|
|
27
|
-
/** The JSON-serializable live snapshot (device UI + external-sync payload). */
|
|
28
|
-
|
|
29
|
-
/** Everything the engine knows about one origin — the tap-through detail. */
|
|
30
|
-
|
|
31
|
-
/** Engine tuning constants — exported for tests. */
|
|
32
|
-
export const BUCKET_MS = 250;
|
|
33
|
-
/** Rolling "recent" window: 20 buckets = 5s. */
|
|
34
|
-
export const WINDOW_BUCKETS = 20;
|
|
35
|
-
/** Global busy history ring: 120 buckets = 30s. */
|
|
36
|
-
export const HISTORY_BUCKETS = 120;
|
|
37
|
-
export const MAX_ORIGINS = 500;
|
|
38
|
-
/** Promotion thresholds: capture a scheduling stack once an origin is hot. */
|
|
39
|
-
export const PROMOTE_MIN_CALLS = 25;
|
|
40
|
-
export const PROMOTE_MIN_TOTAL_MS = 50;
|
|
41
|
-
export const SNAPSHOT_ROWS = 30;
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export const BUCKET_MS=250;export const WINDOW_BUCKETS=20;export const HISTORY_BUCKETS=120;export const MAX_ORIGINS=500;export const PROMOTE_MIN_CALLS=25;export const PROMOTE_MIN_TOTAL_MS=50;export const SNAPSHOT_ROWS=30;
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Persisted JS TOP preferences. Same load-then-save contract as
|
|
5
|
-
* perf-monitor's hudPreferences: rehydrate async, and only persist
|
|
6
|
-
* user-driven changes after the load resolves so defaults never clobber
|
|
7
|
-
* last session's state.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { definePersistedSetting } from "@buoy-gg/shared-ui";
|
|
11
|
-
const KEY = "@react_buoy/js-top/prefs";
|
|
12
|
-
const DEFAULTS = {
|
|
13
|
-
enabled: false
|
|
14
|
-
};
|
|
15
|
-
const prefs = definePersistedSetting(KEY, DEFAULTS, {
|
|
16
|
-
sanitize: merged => ({
|
|
17
|
-
enabled: merged.enabled === true
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
export async function loadJsTopPrefs() {
|
|
21
|
-
return prefs.load();
|
|
22
|
-
}
|
|
23
|
-
export async function saveJsTopPrefs(next) {
|
|
24
|
-
await prefs.save(next);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=preferences.js.map
|
|
1
|
+
"use strict";import{definePersistedSetting as t}from"@buoy-gg/shared-ui";const n="@react_buoy/js-top/prefs";const o={enabled:false};const s=t(n,o,{sanitize:e=>({enabled:e.enabled===true})});export async function loadJsTopPrefs(){return s.load()}export async function saveJsTopPrefs(e){await s.save(e)}
|
package/lib/module/preset.js
CHANGED
|
@@ -1,71 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Pre-configured JS TOP tools for FloatingDevTools.
|
|
5
|
-
*
|
|
6
|
-
* Two presets:
|
|
7
|
-
* - jsTopPreset: toggle-only chip that turns the floating busy% pill on/off.
|
|
8
|
-
* - jsTopModalPreset: opens the Task Manager window (ranked live table).
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { jsTopPreset, jsTopModalPreset } from '@buoy-gg/js-top';
|
|
13
|
-
*
|
|
14
|
-
* <FloatingDevTools apps={[jsTopPreset, jsTopModalPreset]} />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { useEffect, useState } from "react";
|
|
19
|
-
import { Activity } from "@buoy-gg/shared-ui";
|
|
20
|
-
import { JsTopController } from "./js-top/engine/JsTopController";
|
|
21
|
-
import { JsTopModal } from "./js-top/components/JsTopModal";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
export const JS_TOP_ENABLED_COLOR = "#34D399";
|
|
24
|
-
export const JS_TOP_DISABLED_COLOR = "#6B7280";
|
|
25
|
-
function JsTopToggleIcon({
|
|
26
|
-
size
|
|
27
|
-
}) {
|
|
28
|
-
const [enabled, setEnabled] = useState(() => JsTopController.isEnabled());
|
|
29
|
-
useEffect(() => JsTopController.subscribeEnabled(setEnabled), []);
|
|
30
|
-
return /*#__PURE__*/_jsx(Activity, {
|
|
31
|
-
size: size,
|
|
32
|
-
color: enabled ? JS_TOP_ENABLED_COLOR : JS_TOP_DISABLED_COLOR
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function EmptyComponent() {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Toggle-only preset: show/hide the floating busy% pill. */
|
|
40
|
-
export const jsTopPreset = {
|
|
41
|
-
id: "js-top",
|
|
42
|
-
name: "JS TOP",
|
|
43
|
-
description: "Toggle the floating JS-thread busy pill",
|
|
44
|
-
slot: "row",
|
|
45
|
-
icon: JsTopToggleIcon,
|
|
46
|
-
component: EmptyComponent,
|
|
47
|
-
props: {},
|
|
48
|
-
launchMode: "toggle-only",
|
|
49
|
-
onPress: () => {
|
|
50
|
-
JsTopController.setEnabled(!JsTopController.isEnabled());
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/** Modal preset: the live Task Manager window. */
|
|
55
|
-
export const jsTopModalPreset = {
|
|
56
|
-
id: "js-top-modal",
|
|
57
|
-
name: "TASKS",
|
|
58
|
-
description: "Live Task Manager for the JS thread",
|
|
59
|
-
slot: "both",
|
|
60
|
-
icon: ({
|
|
61
|
-
size
|
|
62
|
-
}) => /*#__PURE__*/_jsx(Activity, {
|
|
63
|
-
size: size,
|
|
64
|
-
color: JS_TOP_ENABLED_COLOR
|
|
65
|
-
}),
|
|
66
|
-
component: JsTopModal,
|
|
67
|
-
props: {
|
|
68
|
-
enableSharedModalDimensions: false
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=preset.js.map
|
|
1
|
+
"use strict";import{useEffect as i,useState as l}from"react";import{Activity as t}from"@buoy-gg/shared-ui";import{JsTopController as o}from"./js-top/engine/JsTopController";import{JsTopModal as p}from"./js-top/components/JsTopModal";import{jsx as s}from"react/jsx-runtime";export const JS_TOP_ENABLED_COLOR="#34D399";export const JS_TOP_DISABLED_COLOR="#6B7280";function a({size:e}){const[n,r]=l(()=>o.isEnabled());i(()=>o.subscribeEnabled(r),[]);return s(t,{size:e,color:n?JS_TOP_ENABLED_COLOR:JS_TOP_DISABLED_COLOR})}function c(){return null}export const jsTopPreset={id:"js-top",name:"JS TOP",description:"Toggle the floating JS-thread busy pill",slot:"row",icon:a,component:c,props:{},launchMode:"toggle-only",onPress:()=>{o.setEnabled(!o.isEnabled())}};export const jsTopModalPreset={id:"js-top-modal",name:"TASKS",description:"Live Task Manager for the JS thread",slot:"both",icon:({size:e})=>s(t,{size:e,color:JS_TOP_ENABLED_COLOR}),component:p,props:{enableSharedModalDimensions:false}};
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var nt=Object.defineProperty;var ro=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var io=Object.prototype.hasOwnProperty;var so=(e,t)=>{for(var o in t)nt(e,o,{get:t[o],enumerable:!0})},rt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of no(t))!io.call(e,n)&&n!==o&&nt(e,n,{get:()=>t[n],enumerable:!(r=ro(t,n))||r.enumerable});return e},M=(e,t,o)=>(rt(e,t,"default"),o&&rt(o,t,"default"));var f=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);var b={};so(b,{AccessibilityInfo:()=>wo,ActivityIndicator:()=>go,Alert:()=>To,Animated:()=>Mo,AppRegistry:()=>ko,AppState:()=>Ae,Appearance:()=>vo,BackHandler:()=>Ao,Button:()=>ho,CheckBox:()=>No,Clipboard:()=>Oo,DeviceEventEmitter:()=>nr,Dimensions:()=>Ro,Easing:()=>Co,FlatList:()=>Ho,I18nManager:()=>Eo,Image:()=>$o,ImageBackground:()=>Ko,InteractionManager:()=>Io,Keyboard:()=>Po,KeyboardAvoidingView:()=>jo,LayoutAnimation:()=>zo,Linking:()=>Jo,LogBox:()=>rr,Modal:()=>fo,NativeEventEmitter:()=>Fo,NativeModules:()=>xo,PanResponder:()=>Bo,Picker:()=>Uo,PixelRatio:()=>Wo,Platform:()=>Lo,Pressable:()=>mo,ProgressBar:()=>qo,RefreshControl:()=>Go,SafeAreaView:()=>Yo,ScrollView:()=>ie,SectionList:()=>Qo,Share:()=>_o,StatusBar:()=>Xo,StyleSheet:()=>I,Switch:()=>bo,Text:()=>u,TextInput:()=>co,Touchable:()=>Zo,TouchableHighlight:()=>uo,TouchableNativeFeedback:()=>er,TouchableOpacity:()=>G,TouchableWithoutFeedback:()=>po,UIManager:()=>Vo,Vibration:()=>Do,View:()=>m,VirtualizedList:()=>tr,YellowBox:()=>or,findNodeHandle:()=>yo,unstable_createElement:()=>So,useColorScheme:()=>ir,useLocaleContext:()=>sr,useWindowDimensions:()=>ar});M(b,yn);import*as yn from"react-native-web";import{unstable_createElement as So,NativeModules as xo,AccessibilityInfo as wo,Animated as Mo,Appearance as vo,AppRegistry as ko,AppState as Ae,BackHandler as Ao,Clipboard as Oo,Dimensions as Ro,Easing as Co,I18nManager as Eo,Keyboard as Po,InteractionManager as Io,LayoutAnimation as zo,Linking as Jo,NativeEventEmitter as Fo,PanResponder as Bo,PixelRatio as Wo,Platform as Lo,Share as _o,StyleSheet as I,UIManager as Vo,Vibration as Do,CheckBox as No,FlatList as Ho,Image as $o,ImageBackground as Ko,KeyboardAvoidingView as jo,Picker as Uo,ProgressBar as qo,RefreshControl as Go,SafeAreaView as Yo,SectionList as Qo,StatusBar as Xo,Touchable as Zo,TouchableNativeFeedback as er,VirtualizedList as tr,YellowBox as or,LogBox as rr,DeviceEventEmitter as nr,useColorScheme as ir,useLocaleContext as sr,useWindowDimensions as ar}from"react-native-web";import*as g from"react-native-web";import{createElement as ao,forwardRef as lo}from"react";function F(e){let t=lo((r,n)=>{let{accessibilityState:i,accessibilityValue:s,...a}=r;for(let l of["busy","checked","disabled","expanded","selected"])i?.[l]!==void 0&&a[`aria-${l}`]===void 0&&(a[`aria-${l}`]=i[l]);for(let[l,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[l]!==void 0&&a[`aria-${c}`]===void 0&&(a[`aria-${c}`]=s[l]);return ao(e,{...a,ref:n})}),o=e.State;return o&&Object.assign(t,{State:o}),t.displayName=e.displayName??e.name??"NativeWebView",t}var m=F(g.View),u=F(g.Text),co=F(g.TextInput),G=F(g.TouchableOpacity),uo=F(g.TouchableHighlight),po=F(g.TouchableWithoutFeedback),mo=F(g.Pressable),ie=F(g.ScrollView),fo=F(g.Modal),bo=F(g.Switch),go=F(g.ActivityIndicator),ho=F(g.Button),yo=g.findNodeHandle,To={alert(e,t,o,r){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(i),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let a=o?.length?o:[{text:"OK"}],l=()=>{n.close?.(),n.remove()};for(let c of a){let T=document.createElement("button");T.type="button",T.textContent=c.text??"OK",T.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,T.onclick=()=>{l(),c.onPress?.()},s.appendChild(T)}n.addEventListener("cancel",c=>{c.preventDefault(),r?.cancelable!==!1&&(l(),r?.onDismiss?.())}),n.appendChild(s),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};var be=typeof globalThis<"u"?globalThis:void 0,lr=(()=>{if(typeof be?.nativePerformanceNow=="function"){let e=be.nativePerformanceNow;return()=>e()}if(typeof be?.performance?.now=="function"){let e=be.performance;return()=>e.now()}return()=>Date.now()})(),cr=lr;function B(){return cr()}var d=typeof globalThis<"u"?globalThis:{},it=!1;function L(){return it}function se(e){it=e}var Oe=null;function ae(){return Oe||(Oe={setTimeout:d.setTimeout?.bind(d),setInterval:d.setInterval?.bind(d),clearInterval:d.clearInterval?.bind(d),clearTimeout:d.clearTimeout?.bind(d),setImmediate:d.setImmediate?.bind(d),requestAnimationFrame:d.requestAnimationFrame?.bind(d),queueMicrotask:d.queueMicrotask?.bind(d)}),Oe}function X(){return ae()}var v=Symbol.for("buoy.jsTop.patched"),Re=Symbol.for("buoy.jsTop.wrapped");var Z=new Float64Array(120),le=new Float64Array(120),Ce=new Float64Array(120),ee=new Float64Array(120).fill(-1);function N(e){return Math.floor(e/250)}function ur(e){let t=e%120;return ee[t]!==e&&(ee[t]=e,Z[t]=0,le[t]=0,Ce[t]=0),t}function Ee(e,t,o){if(!(t>e))return;let r=Math.max(e,t-3e4),n=N(r),i=N(t),s=r;for(;n<=i;){let a=(n+1)*250,l=Math.min(t,a),c=l-s;c>0&&o(ur(n),c),s=l,n++}}function st(e,t){Ee(e,t,(o,r)=>{Z[o]=Math.min(250,Z[o]+r)})}function at(e,t,o){let r=t-e;if(!(r>0)||!(o>0))return;let n=Math.min(1,o/r);Ee(e,t,(i,s)=>{le[i]=Math.min(250,le[i]+s*n)})}function lt(e,t){Ee(e,t,(o,r)=>{Ce[o]=Math.min(250,Ce[o]+r)})}function ct(e,t,o){let r=N(t),n=0;for(let i=r-o+1;i<=r;i++){let s=i%120;s>=0&&ee[s]===i&&(n+=e[s])}return n}function Pe(e){return ct(Z,e,20)}function ut(e){return ct(le,e,20)}function pt(e){let t=N(e),o=[];for(let r=t-20+1;r<=t;r++){let n=r%120;n>=0&&ee[n]===r?o.push(Math.max(0,Math.round((Z[n]-le[n])*10)/10)):o.push(0)}return o}function dt(e){let t=N(e),o=[];for(let n=t-120+1;n<=t;n++){let i=n%120;i>=0&&ee[i]===n?o.push(Math.round(Z[i]/250*100)):o.push(0)}let r=0;for(;r<o.length&&o[r]===0;)r++;return o.slice(Math.max(0,Math.min(r,o.length-1)))}function mt(){ee.fill(-1)}var Ie=0;function pr(){return typeof f<"u"&&f}function dr(e){return(e.split("?")[0]??e).split("/").filter(Boolean).slice(-2).join("/")}function mr(e){return/^[A-Z][A-Za-z0-9]*$/.test(e)}function ft(e,t){if(!pr()||e.symbolicated||!e.frames||e.frames.length===0||Ie>=3)return;e.symbolicated=!0;let o=e.frames[0];if(!o||!/^https?:\/\//.test(o.file))return;let r;try{r=`${new URL(o.file).origin}/symbolicate`}catch{return}Ie++;let n=JSON.stringify({stack:e.frames.map(i=>({file:i.file,lineNumber:i.line,column:i.col,methodName:""}))});fetch(r,{method:"POST",body:n}).then(i=>i.ok?i.json():null).then(i=>{let s=i?.stack?.find(W=>W.file&&!W.file.includes("node_modules"))??i?.stack?.[0];if(!s?.file&&i?.error){let W=/found: (\/.+)$/.exec(i.error);W&&(s={file:W[1]})}if(!s?.file)return;let a=dr(s.file),l=s.lineNumber,c=s.methodName&&s.methodName!=="<unknown>"?s.methodName:void 0;e.file=a,e.line=l??e.line;let T=`${a.split("/").pop()}${l!=null?`:${l}`:""}`;c&&mr(c)&&!e.caller?(e.caller=c,e.label=`${e.label} \u2190 <${c}> \xB7 ${T}`):e.label=`${e.label} \xB7 ${T}`}).catch(()=>{}).finally(()=>{Ie--})}var gr=500,hr=20,R=new Map,bt="other",gt=0,ze=0;function Fe(e,t,o){return{key:e,api:t,label:o,calls:0,totalMs:0,maxMs:0,scheduleCount:0,lastSeenAt:0,promoted:!1,lastCaptureAt:0,ring:new Float64Array(20),ringStamps:new Float64Array(20).fill(-1)}}function yt(e,t){let o=N(t),r=0;for(let n=o-20+1;n<=o;n++){let i=n%20;i>=0&&e.ringStamps[i]===n&&(r+=e.ring[i])}return r}function ht(e){let t=null,o=1/0;for(let n of R.values()){if(n.key===bt)continue;let i=yt(n,e)*1e6+n.lastSeenAt;i<o&&(o=i,t=n)}if(!t)return;let r=yr(bt,"other","other (evicted origins)");r.calls+=t.calls,r.totalMs+=t.totalMs,r.maxMs=Math.max(r.maxMs,t.maxMs),r.lastSeenAt=Math.max(r.lastSeenAt,t.lastSeenAt),R.delete(t.key)}function yr(e,t,o){let r=R.get(e);return r||(r=Fe(e,t,o),R.set(e,r)),r}function Tr(e){let t=[],o,r=e.split(`
|
|
3
|
-
`);for(let n of r){let i=/at\s+(.*?)\s+\((?:address at\s+)?(.*?):(\d+):(\d+)\)/.exec(n)??/at\s+()(.*?):(\d+):(\d+)$/.exec(n.trim());if(!i)continue;let s=i[1]??"";if(s.includes("buoyJsTop")||s==="Error"||i[2]?.includes("/js-top/"))continue;t.push({file:i[2]??"",line:Number(i[3]),col:Number(i[4])});let a=/^(react_stack_bottom_frame|runWithFiberInDEV|commitHookEffectList|flushPassive|performWork|renderWithHooks|safelyCall)/.test(s)||/^(then|catch|finally|resolve|reject|fulfilled|rejected|step|tryCallOne|tryCallTwo|tryCatch|invokeCallback|notify)$/.test(s);if(!o&&s&&s!=="anonymous"&&!a&&(o=s),t.length>=3)break}return{caller:o,frames:t}}function Sr(e,t){return t-e.lastCaptureAt<gr||(t-gt>1e3&&(gt=t,ze=0),ze>=hr)?!1:(ze++,e.lastCaptureAt=t,!0)}function Je(e){if(!e)return;let t=(e.split("?")[0]??e).replace(/\/\/&.*$/,""),o=/^[a-z]+:\/\/[^/]+\/(.*)$/.exec(t);return(o?o[1]:t).split("/").slice(-2).join("/")}function Tt(e){return R.has(e)}function ge(e,t,o,r=!0){let n=t,i=typeof n.displayName=="string"&&n.displayName||typeof n.name=="string"&&n.name||"anonymous",s=`${e}|${i}`,a=R.get(s);if(a||(R.size>=500&&ht(o),a=Fe(s,e,i==="anonymous"?ce(e):`${ce(e)} ${i}`),R.set(s,a)),a.scheduleCount++,!a.promoted&&(a.scheduleCount>=25||a.totalMs>=50)&&(a.promoted=!0),(a.promoted||e==="interval")&&r&&Sr(a,o)){let{caller:l,frames:c}=Tr(new Error().stack??""),T=c[0];if(T||l){let W=T?`${Je(T.file)??"?"}:${T.line}`:"?",y=`${s}@${l??"?"}:${W}`,x=R.get(y);if(!x){R.size>=500&&ht(o);let E=i==="anonymous"?ce(e):`${ce(e)} ${i}`;x=Fe(y,e,l?`${E} \u2190 ${l}`:i==="anonymous"?`${E} @ ${Je(T?.file??"")??"?"}`:E),x.caller=l,x.file=T?Je(T.file):void 0,x.line=T?.line,x.frames=c,x.promoted=!0,x.calls=a.calls,x.totalMs=a.totalMs,x.maxMs=a.maxMs,x.scheduleCount=a.scheduleCount,x.lastSeenAt=a.lastSeenAt,x.ring.set(a.ring),x.ringStamps.set(a.ringStamps),a.calls=0,a.totalMs=0,a.maxMs=0,a.ring.fill(0),a.ringStamps.fill(-1),R.set(y,x),ft(x,ce(e))}a.activeRefinedKey=y}}return a.activeRefinedKey??s}function ce(e){switch(e){case"timeout":return"setTimeout";case"interval":return"setInterval";case"immediate":return"setImmediate";case"raf":return"requestAnimationFrame";case"microtask":return"queueMicrotask";case"then":return"Promise.then";case"bridge":return"bridge";default:return e}}function St(e,t,o,r){let n=R.get(e);if(!n)return;n.calls++,n.totalMs+=t,t>n.maxMs&&(n.maxMs=t),n.lastSeenAt=r,!n.promoted&&n.totalMs>=50&&(n.promoted=!0);let i=r-o,s=i>0?Math.min(1,t/i):1,a=Math.max(o,r-5e3),l=N(a),c=N(r),T=a;for(;l<=c;){let W=(l+1)*250,y=Math.min(r,W),x=y-T;if(x>0){let E=l%20;E>=0&&(n.ringStamps[E]!==l&&(n.ringStamps[E]=l,n.ring[E]=0),n.ring[E]+=i>0?x*s:t)}T=y,l++}at(o,r,t)}function xt(e){return R.get(e)?.label??null}function wt(e,t,o){let r=[];for(let s of R.values()){let a=yt(s,e);a<=0&&s.totalMs<1||r.push({key:s.key,label:s.label,api:s.api,file:s.file,line:s.line,windowMs:Math.round(a*10)/10,pctOfBusy:t>0?Math.min(100,Math.round(a/t*1e3)/10):0,totalMs:Math.round(s.totalMs*10)/10,calls:s.calls,avgMs:s.calls>0?Math.round(s.totalMs/s.calls*100)/100:0,maxMs:Math.round(s.maxMs*100)/100,lastSeenAgoMs:s.lastSeenAt>0?Math.max(0,e-s.lastSeenAt):0,freezes:0,worstFreezeMs:0})}r.sort((s,a)=>a.windowMs-s.windowMs||a.totalMs-s.totalMs);let n=[],i=[];for(let s of r)(s.windowMs>=1||s.pctOfBusy>=.5||s.freezes>0?n:i).push(s);return i.length>=2?(n.push({key:"minor",label:`${i.length} minor origins (\u22641ms each)`,api:"other",windowMs:Math.round(i.reduce((s,a)=>s+a.windowMs,0)*10)/10,pctOfBusy:Math.round(i.reduce((s,a)=>s+a.pctOfBusy,0)*10)/10,totalMs:Math.round(i.reduce((s,a)=>s+a.totalMs,0)*10)/10,calls:i.reduce((s,a)=>s+a.calls,0),avgMs:0,maxMs:Math.max(0,...i.map(s=>s.maxMs)),lastSeenAgoMs:Math.min(...i.map(s=>s.lastSeenAgoMs)),freezes:0,worstFreezeMs:0}),n.slice(0,o)):r.slice(0,o)}function Mt(e,t,o){let r=R.get(e);if(!r)return null;let n=N(t),i=[],s=0;for(let a=n-20+1;a<=n;a++){let l=a%20,c=l>=0&&r.ringStamps[l]===a?Math.round(r.ring[l]*10)/10:0;i.push(c),s+=c}return{key:r.key,label:r.label,api:r.api,caller:r.caller,file:r.file,line:r.line,frames:r.frames,promoted:r.promoted,scheduleCount:r.scheduleCount,calls:r.calls,totalMs:Math.round(r.totalMs*10)/10,avgMs:r.calls>0?Math.round(r.totalMs/r.calls*100)/100:0,maxMs:Math.round(r.maxMs*100)/100,windowMs:Math.round(s*10)/10,pctOfBusy:o>0?Math.min(100,Math.round(s/o*1e3)/10):0,lastSeenAgoMs:r.lastSeenAt>0?Math.max(0,t-r.lastSeenAt):0,buckets:i}}function vt(){R.clear()}var xr=32,te=[],wr=20,kt=64,At=new Array(kt).fill(null),Be=0;function Ot(){return At}function Rt(e,t){let o=B(),r=te.length>0?te[te.length-1]:null,n=null;te.length<xr&&(n={originKey:e,start:o,childrenMs:0},te.push(n));try{return t()}finally{try{if(n){te.pop();let i=B(),s=i-o,a=Math.max(0,s-n.childrenMs);r&&(r.childrenMs+=s),St(e,a,o,i),!r&&s>=wr&&(At[Be]={originKey:e,start:o,end:i},Be=(Be+1)%kt)}}catch{}}}function $(e,t){if(typeof e!="function"||e[Re])return e;let o=L()?ge(t,e,B()):null,r=function(...n){return L()?((o===null||!Tt(o))&&(o=ge(t,e,B(),!1)),Rt(o,()=>e.apply(this,n))):e.apply(this,n)};return r[Re]=!0,r}function We(e,t,o){if(!L())return o();let r=ge(e,{name:t},B());return Rt(r,o)}function he(){let e=ae();if(typeof d.setTimeout=="function"&&!d.setTimeout[v]){let t=function(o,r,...n){let i=$(o,"timeout");return e.setTimeout(i,r,...n)};t[v]=!0,d.setTimeout=t}if(typeof d.setInterval=="function"&&!d.setInterval[v]){let t=function(o,r,...n){let i=$(o,"interval");return e.setInterval(i,r,...n)};t[v]=!0,d.setInterval=t}if(typeof d.setImmediate=="function"&&!d.setImmediate[v]&&e.setImmediate){let t=function(o,...r){let n=$(o,"immediate");return e.setImmediate(n,...r)};t[v]=!0,d.setImmediate=t}if(typeof d.requestAnimationFrame=="function"&&!d.requestAnimationFrame[v]&&e.requestAnimationFrame){let t=function(o){let r=$(o,"raf");return e.requestAnimationFrame(r)};t[v]=!0,d.requestAnimationFrame=t}}function ye(){let e=ae();if(typeof d.queueMicrotask=="function"&&!d.queueMicrotask[v]&&e.queueMicrotask){let t=function(o){let r=$(o,"microtask");return e.queueMicrotask(r)};t[v]=!0,d.queueMicrotask=t}}var Le=16,Mr=100,vr=3,kr=8,pe=null,de=0,Te=!1,ue=[],oe=1/0,re=0,_e=Le;function Ar(){let e=B(),t=de>0?e-de:0;if(de=e,Te){Te=!1,oe=1/0,re=e;return}if(t<=0)return;t<Mr&&(t<oe&&(oe=t),re===0&&(re=e),e-re>=1e3&&(ue.push(oe),ue.length>vr&&ue.shift(),_e=Math.max(kr,Math.min(...ue)),oe=1/0,re=e));let o=t-_e;o>1&&st(e-o,e)}function Ve(){if(pe!=null)return;let e=X();de=B(),Te=!1,ue=[],oe=1/0,re=0,_e=Le,pe=e.setInterval(Ar,Le)}function De(){pe!=null&&(X().clearInterval(pe),pe=null),de=0}function Ct(){Te=!0}import{definePersistedSetting as Or}from"@buoy-gg/shared-ui/web";var Rr="@react_buoy/js-top/prefs",Cr={enabled:!1},Et=Or(Rr,Cr,{sanitize:e=>({enabled:e.enabled===!0})});async function Pt(){return Et.load()}async function It(e){await Et.save(e)}var Er=250,Ne=class{constructor(){this.enabled=!1;this.enabledLoaded=!1;this.paused=!1;this.remoteSampling=!1;this.engineRunning=!1;this.tiers={timers:!1,promises:!1,bridge:!1,longtask:!1};this.notifyHandle=null;this.appStateSub=null;this.snapshot=this.buildSnapshot();this.subscribers=new Set;this.enabledSubscribers=new Set;this.tierInstallers=[];this.longtaskProvider=null;this.freezeStatsProvider=null;this.clearHooks=[];Pt().then(t=>{this.enabledLoaded=!0,t.enabled&&!this.enabled&&this.setEnabled(!0)})}subscribe(t){return this.subscribers.add(t),this.syncEngineState(),t(this.snapshot),()=>{this.subscribers.delete(t),this.syncEngineState()}}subscribeEnabled(t){return this.enabledSubscribers.add(t),t(this.enabled),()=>{this.enabledSubscribers.delete(t)}}setEnabled(t){this.enabled!==t&&(this.enabled=t,this.enabledLoaded&&It({enabled:t}),this.enabledSubscribers.forEach(o=>{try{o(t)}catch(r){f&&console.error("[js-top] enabled subscriber threw",r)}}),this.syncEngineState())}isEnabled(){return this.enabled}setRemoteSampling(t){this.remoteSampling!==t&&(this.remoteSampling=t,this.syncEngineState())}isRemoteSampling(){return this.remoteSampling}getStatus(){return this.engineRunning?this.paused?"paused":"running":"disabled"}pause(){this.paused||(this.paused=!0,se(!1),De(),this.emitSnapshot())}resume(){this.paused&&(this.paused=!1,this.engineRunning&&(se(!0),Ve()),this.emitSnapshot())}clear(){vt(),mt();for(let t of this.clearHooks)try{t()}catch{}this.emitSnapshot()}registerClearHook(t){this.clearHooks.push(t)}getSnapshot(){return this.snapshot}getOriginDetail(t){let o=B(),r=Pe(o),i=this.freezeStatsProvider?.(Date.now())?.byOrigin[t];if(t==="unattributed"){let a=pt(o),l=Math.round(a.reduce((c,T)=>c+T,0)*10)/10;return{key:t,label:"unattributed (events / React / native call-ins)",api:"unattributed",promoted:!1,scheduleCount:0,calls:0,totalMs:0,avgMs:0,maxMs:0,windowMs:l,pctOfBusy:r>0?Math.min(100,Math.round(l/r*1e3)/10):0,lastSeenAgoMs:0,buckets:a,freezes:i?.count??0,worstFreezeMs:Math.round(i?.maxMs??0)}}let s=Mt(t,o,r);return s?{...s,freezes:i?.count??0,worstFreezeMs:Math.round(i?.maxMs??0)}:null}registerTierInstaller(t){this.tierInstallers.push(t),this.engineRunning&&Object.assign(this.tiers,this.runInstaller(t))}registerLongtaskProvider(t){this.longtaskProvider=t}registerFreezeStatsProvider(t){this.freezeStatsProvider=t}shouldRun(){return this.subscribers.size>0||this.remoteSampling}syncEngineState(){let t=this.shouldRun();t&&!this.engineRunning?this.startEngine():!t&&this.engineRunning&&this.stopEngine()}runInstaller(t){try{return t()}catch(o){return f&&console.error("[js-top] tier installer threw",o),{}}}startEngine(){this.engineRunning=!0,he(),ye(),this.tiers={timers:!0,promises:!1,bridge:!1,longtask:!1};for(let t of this.tierInstallers)Object.assign(this.tiers,this.runInstaller(t));se(!this.paused),this.paused||Ve();try{this.appStateSub=Ae.addEventListener("change",()=>{Ct()})}catch{this.appStateSub=null}this.notifyHandle=X().setInterval(()=>this.emitSnapshot(),Er),this.emitSnapshot()}stopEngine(){if(this.engineRunning=!1,se(!1),De(),this.notifyHandle!=null&&(X().clearInterval(this.notifyHandle),this.notifyHandle=null),this.appStateSub){try{this.appStateSub.remove()}catch{}this.appStateSub=null}}buildSnapshot(){let t=B(),o=Pe(t),r=ut(t),n=Math.max(0,o-r),i=wt(t,o,30);n>=1&&(i.push({key:"unattributed",label:"unattributed (events / React / native call-ins)",api:"unattributed",windowMs:Math.round(n*10)/10,pctOfBusy:o>0?Math.min(100,Math.round(n/o*1e3)/10):0,totalMs:0,calls:0,avgMs:0,maxMs:0,lastSeenAgoMs:0,freezes:0,worstFreezeMs:0}),i.sort((l,c)=>c.windowMs-l.windowMs||c.totalMs-l.totalMs));let s=this.freezeStatsProvider?.(Date.now())??{count:0,worstMs:0,byOrigin:{}};for(let l of i){let c=s.byOrigin[l.key];c&&(l.freezes=c.count,l.worstFreezeMs=Math.round(c.maxMs))}let a=5e3;return{ts:Date.now(),paused:this.paused,busyPct:Math.min(100,Math.round(o/a*1e3)/10),busyHistory:dt(t),tiers:{...this.tiers},rows:i,totals:{attributedWindowMs:Math.round(r*10)/10,unattributedWindowMs:Math.round(n*10)/10,windowMs:a},freezeSummary:{count:s.count,worstMs:Math.round(s.worstMs)},longtasks:this.longtaskProvider?this.longtaskProvider():[]}}emitSnapshot(){this.snapshot=this.buildSnapshot(),this.subscribers.forEach(t=>{try{t(this.snapshot)}catch(o){f&&console.error("[js-top] snapshot subscriber threw",o)}})}isEngineActive(){return L()}},p=new Ne;function He(e,t){let o=e[t];if(typeof o!="function")return!1;if(o[v])return!0;let r=function(...n){for(let i=0;i<n.length;i++)typeof n[i]=="function"&&(n[i]=$(n[i],"then"));return o.apply(this,n)};return r[v]=!0,Object.defineProperty(r,"name",{value:t,configurable:!0}),e[t]=r,!0}function zt(){let e=d.Promise?.prototype;if(!e)return{promises:!1};let t=He(e,"then");return He(e,"catch"),He(e,"finally"),{promises:t}}function Jt(){let e=d.__fbBatchedBridge;if(!e)return{bridge:!1};let t=!1;if(typeof e.callFunctionReturnFlushedQueue=="function"&&!e.callFunctionReturnFlushedQueue[v]){let r=e.callFunctionReturnFlushedQueue.bind(e),n=function(i,s,a){return L()?We("bridge",`${i}.${s}`,()=>r(i,s,a)):r(i,s,a)};n[v]=!0,e.callFunctionReturnFlushedQueue=n,t=!0}if(typeof e.invokeCallbackAndReturnFlushedQueue=="function"&&!e.invokeCallbackAndReturnFlushedQueue[v]){let r=e.invokeCallbackAndReturnFlushedQueue.bind(e),n=function(i,s){return L()?We("bridge","nativeModuleCallback",()=>r(i,s)):r(i,s)};n[v]=!0,e.invokeCallbackAndReturnFlushedQueue=n,t=!0}let o=e.callFunctionReturnFlushedQueue?.[v]===!0;return{bridge:t||o}}var Pr=40,Ir=6e4,zr="unattributed",Ft=!1,Se=!1,ne=[];function Jr(e,t){let o=e+t,r=null,n=0;for(let i of Ot()){if(!i)continue;let s=Math.min(o,i.end)-Math.max(e,i.start);s>n&&(n=s,r=i.originKey)}return r}function Bt(){if(Ft)return{longtask:Se};Ft=!0;let e=d.PerformanceObserver;if(typeof e!="function")return{longtask:!1};try{new e(o=>{if(L())try{for(let r of o.getEntries()){if(r.entryType!=="longtask")continue;let n=r.startTime,i=r.duration;lt(n,n+i),ne.push({start:n,duration:i,at:Date.now(),originKey:Jr(n,i)}),ne.length>Pr&&ne.shift()}}catch{}}).observe({entryTypes:["longtask"]}),Se=!0}catch{Se=!1}return{longtask:Se}}function Wt(){return ne.map(e=>({start:e.start,duration:e.duration,at:e.at,originLabel:e.originKey?xt(e.originKey):null}))}function Lt(e){let t={},o=0,r=0;for(let n of ne){if(n.at>0&&e-n.at>Ir)continue;o++,n.duration>r&&(r=n.duration);let i=n.originKey??zr,s=t[i];s?(s.count++,n.duration>s.maxMs&&(s.maxMs=n.duration)):t[i]={count:1,maxMs:n.duration}}return{count:o,worstMs:r,byOrigin:t}}function _t(){ne.length=0}var Fr={version:1,getSnapshot:()=>({live:p.getSnapshot(),enabled:p.isEnabled()||p.isRemoteSampling()}),subscribe:e=>{let t=p.subscribe(()=>e()),o=p.subscribeEnabled(()=>e());return()=>{t(),o()}},actions:{setEnabled:e=>{let t=e.enabled;p.setRemoteSampling(t)},pause:()=>p.pause(),resume:()=>p.resume(),clear:()=>p.clear(),getOriginDetail:e=>p.getOriginDetail(e.key),sample:async e=>{let t=e,o=Math.min(Math.max(t?.durationMs??3e3,250),3e4),r=p.isRemoteSampling()||p.isEnabled();r||p.setRemoteSampling(!0),t?.clearFirst&&p.clear();try{return await new Promise(n=>setTimeout(n,o)),p.getSnapshot()}finally{r||p.setRemoteSampling(!1)}}}};import{useCallback as qr,useEffect as Gr,useMemo as Yr,useState as qt}from"react";import{Activity as Qr,JsModal as Xr,macOSColors as V,night as P,ModalHeader as fe,Pause as Zr,Play as en,Trash2 as tn}from"@buoy-gg/shared-ui/web";import{memo as Br}from"react";import{macOSColors as $e}from"@buoy-gg/shared-ui/web";import{jsx as Dt}from"react/jsx-runtime";var Wr=60;function Lr(e){return e>=80?$e.semantic.error:e>=40?$e.semantic.warning:$e.semantic.success}var Nt=Br(function({history:t}){let o=t.slice(-Wr);return Dt(m,{style:Vt.row,pointerEvents:"none",children:o.map((r,n)=>Dt(m,{style:[Vt.bar,{height:Math.max(2,r/100*28),backgroundColor:Lr(r)}]},`b${n}`))})}),Vt=I.create({row:{flexDirection:"row",alignItems:"flex-end",gap:1,height:28,alignSelf:"stretch"},bar:{flex:1,maxWidth:6,borderRadius:1,opacity:.9}});import{memo as _r,useState as Vr}from"react";import{macOSColors as xe,night as A}from"@buoy-gg/shared-ui/web";import{jsx as z,jsxs as j}from"react/jsx-runtime";var Dr=[{key:"windowMs",title:"RECENT"},{key:"calls",title:"CALLS"},{key:"avgMs",title:"AVG"},{key:"maxMs",title:"MAX"},{key:"totalMs",title:"TOTAL"}],Ht={timeout:{text:"TIMEOUT",color:"#38BDF8",prefix:"setTimeout"},interval:{text:"INTERVAL",color:"#22D3EE",prefix:"setInterval"},immediate:{text:"IMMED",color:"#60A5FA",prefix:"setImmediate"},raf:{text:"RAF",color:"#34D399",prefix:"requestAnimationFrame"},microtask:{text:"MICRO",color:"#A78BFA",prefix:"queueMicrotask"},then:{text:"PROMISE",color:"#BF5AF2",prefix:"Promise.then"},bridge:{text:"BRIDGE",color:"#FBBF24",prefix:"bridge"},unattributed:{text:"SYSTEM",color:"#8E8E93"},other:{text:"OTHER",color:"#8E8E93",prefix:"other"}};function we(e){return Ht[e]??Ht.other}function Ke(e){if(e.api==="unattributed")return"events \xB7 React \xB7 native call-ins";if(e.api==="other")return"evicted cold origins";let t=we(e.api).prefix,o=e.label;return t&&o.startsWith(t)&&(o=o.slice(t.length)),o=o.replace(/^[\s←@]+/,"").trim(),o.length>0?o:"anonymous"}function me(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?`${Math.round(e)}`:`${Math.round(e*10)/10}`}function Nr(e){return e.calls<=0?"measured by probe \xB7 not reachable from JS":`${me(e.calls)} calls \xB7 avg ${me(e.avgMs)} \xB7 max ${me(e.maxMs)} \xB7 total ${me(e.totalMs)} ms`}var Hr=_r(function({row:t,rank:o,onPress:r}){let n=we(t.api);return j(r?G:m,{style:C.row,...r?{onPress:()=>r(t),activeOpacity:.6}:{},children:[j(m,{style:C.topLine,children:[z(u,{style:C.rank,children:o}),z(m,{style:[C.badge,{borderColor:n.color,backgroundColor:`${n.color}1A`}],children:z(u,{style:[C.badgeText,{color:n.color}],children:n.text})}),z(u,{style:C.name,numberOfLines:1,children:Ke(t)}),t.freezes>0&&j(u,{style:[C.freezeBadge,t.worstFreezeMs>=100&&C.freezeBadgeSevere],children:["\u26A0 \xD7",t.freezes]}),j(u,{style:[C.windowMs,t.api!=="unattributed"&&t.pctOfBusy>=25&&{color:t.pctOfBusy>=50?xe.semantic.error:xe.semantic.warning}],children:[me(t.windowMs),z(u,{style:C.unit,children:" ms"})]}),j(u,{style:[C.pct,t.api==="unattributed"&&C.pctMuted],children:[Math.round(t.pctOfBusy),"%"]})]}),j(m,{style:C.subLine,children:[z(m,{style:C.barTrack,children:z(m,{style:[C.barFill,{width:`${Math.min(100,t.pctOfBusy)}%`,backgroundColor:n.color}]})}),z(u,{style:C.stats,numberOfLines:1,children:Nr(t)})]})]})},(e,t)=>e.rank===t.rank&&e.onPress===t.onPress&&e.row.key===t.row.key&&e.row.windowMs===t.row.windowMs&&e.row.calls===t.row.calls&&e.row.maxMs===t.row.maxMs&&e.row.totalMs===t.row.totalMs&&e.row.pctOfBusy===t.row.pctOfBusy&&e.row.freezes===t.row.freezes&&e.row.worstFreezeMs===t.row.worstFreezeMs);function $t({rows:e,onSelectRow:t}){let[o,r]=Vr("windowMs"),n=o==="windowMs"?e:[...e].sort((i,s)=>s[o]-i[o]);return j(m,{style:K.root,children:[j(m,{style:K.sortRow,children:[z(u,{style:K.sortLabel,children:"SORT"}),Dr.map(i=>z(G,{onPress:()=>r(i.key),style:[K.sortChip,o===i.key&&K.sortChipOn],children:z(u,{style:[K.sortChipText,o===i.key&&K.sortChipTextOn],children:i.title})},i.key))]}),j(ie,{style:K.body,children:[n.map((i,s)=>z(Hr,{row:i,rank:s+1,onPress:t},i.key)),n.length===0&&z(u,{style:K.empty,children:"No tasks observed yet \u2014 interact with the app."})]})]})}var K=I.create({root:{flex:1,minHeight:0},sortRow:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:6,borderBottomWidth:1,borderBottomColor:A.color.border,backgroundColor:A.color.surface},sortLabel:{color:A.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.5,marginRight:2},sortChip:{borderWidth:1,borderColor:A.color.border,borderRadius:4,paddingHorizontal:7,paddingVertical:3},sortChipOn:{borderColor:A.color.accentBorderStrong,backgroundColor:A.color.accentSoft},sortChipText:{color:A.color.textTertiary,fontSize:9,fontWeight:"600",fontVariant:["tabular-nums"]},sortChipTextOn:{color:A.color.accent},body:{flex:1},empty:{color:A.color.textTertiary,fontSize:12,textAlign:"center",paddingVertical:24}}),C=I.create({row:{paddingHorizontal:10,paddingVertical:8,borderBottomWidth:I.hairlineWidth,borderBottomColor:A.color.border,gap:5},topLine:{flexDirection:"row",alignItems:"center",gap:6},rank:{width:16,color:A.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},badge:{borderWidth:1,borderRadius:3,paddingHorizontal:4,paddingVertical:1},badgeText:{fontSize:8,fontWeight:"700",letterSpacing:.4},name:{flex:1,color:A.color.text,fontSize:13,fontWeight:"500"},freezeBadge:{color:xe.semantic.warning,fontSize:10,fontWeight:"700",fontVariant:["tabular-nums"]},freezeBadgeSevere:{color:xe.semantic.error},windowMs:{color:A.color.text,fontSize:13,fontWeight:"700",fontVariant:["tabular-nums"]},unit:{color:A.color.textTertiary,fontSize:10,fontWeight:"400"},pct:{width:38,textAlign:"right",color:A.color.textSecondary,fontSize:12,fontWeight:"600",fontVariant:["tabular-nums"]},pctMuted:{color:A.color.textTertiary},subLine:{flexDirection:"row",alignItems:"center",gap:8,paddingLeft:22},barTrack:{width:72,height:4,borderRadius:2,backgroundColor:A.color.fillSecondary,overflow:"hidden"},barFill:{height:4,borderRadius:2,opacity:.85},stats:{flex:1,color:A.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]}});import{memo as $r}from"react";import{macOSColors as Me,night as O,useSafeAreaInsets as Kr}from"@buoy-gg/shared-ui/web";import{Fragment as jt,jsx as w,jsxs as J}from"react/jsx-runtime";var Kt={timeout:"Work scheduled with setTimeout. Time shown is the callback's exclusive run time on the JS thread.",interval:"A repeating setInterval. One scheduling site, many runs \u2014 a hot interval is the classic silent JS-FPS killer.",immediate:"Work scheduled with setImmediate \u2014 runs at the end of the current event-loop turn.",raf:"requestAnimationFrame work \u2014 runs once per frame while scheduled. Cost here directly trades against 60fps.",microtask:"queueMicrotask work \u2014 runs after the current task, before the thread yields.",then:"Promise reaction (.then/.catch/.finally). Named by the function that attached the reaction. Note: async/await bodies bypass .then and land in the System row instead.",bridge:"A native\u2192JS call-in over the legacy bridge (events, module callbacks), measured as its un-nested remainder.",unattributed:"Thread time the probe measured but no JS wrapper could claim: touch handlers, React commits, native call-ins, and async/await bodies. High here on New Architecture is normal \u2014 it's where UI work lives.",other:"Origins evicted from the table when the registry hit its cap \u2014 their totals are preserved here."};function jr(e){return Kt[e]??Kt.other}function Y(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?`${Math.round(e)}`:`${Math.round(e*100)/100}`}function Ur(e){if(e<=0)return"\u2014";let t=e/1e3;return t<1?"just now":t<60?`${Math.round(t)}s ago`:`${Math.floor(t/60)}m ago`}function q({label:e,value:t,accent:o}){return J(m,{style:h.stat,children:[w(u,{style:h.statLabel,children:e}),w(u,{style:[h.statValue,o?{color:o}:null],children:t})]})}var Ut=$r(function({detail:t}){let o=we(t.api),r=Kr({minBottom:12}),n=Math.max(1,...t.buckets);return J(ie,{style:h.root,contentContainerStyle:{paddingBottom:r.bottom},children:[J(m,{style:h.identityRow,children:[w(m,{style:[h.badge,{borderColor:o.color,backgroundColor:`${o.color}1A`}],children:w(u,{style:[h.badgeText,{color:o.color}],children:o.text})}),w(u,{style:h.name,numberOfLines:2,children:Ke(t)})]}),w(u,{style:h.explainer,children:jr(t.api)}),w(u,{style:h.sectionTitle,children:"ACTIVITY \xB7 LAST 5S"}),w(m,{style:h.chartRow,children:t.buckets.map((i,s)=>w(m,{style:h.chartBarSlot,children:w(m,{style:[h.chartBar,{height:Math.max(2,i/n*44),backgroundColor:o.color}]})},`bk${s}`))}),J(m,{style:h.chartLegend,children:[J(u,{style:h.chartLegendText,children:[Y(t.windowMs)," ms in window \xB7 ",t.pctOfBusy.toFixed(1),"% of busy time"]}),J(u,{style:h.chartLegendText,children:["peak ",Y(n)," ms/250ms"]})]}),w(u,{style:h.sectionTitle,children:"STATS \xB7 SINCE START"}),J(m,{style:h.statGrid,children:[w(q,{label:"RUNS",value:t.calls>0?Y(t.calls):"\u2014"}),w(q,{label:"SCHEDULED",value:t.scheduleCount>0?Y(t.scheduleCount):"\u2014"}),w(q,{label:"AVG / RUN",value:t.calls>0?`${Y(t.avgMs)} ms`:"\u2014"}),w(q,{label:"MAX / RUN",value:t.maxMs>0?`${Y(t.maxMs)} ms`:"\u2014",accent:t.maxMs>=50?Me.semantic.warning:void 0}),w(q,{label:"TOTAL",value:t.totalMs>0?`${Y(t.totalMs)} ms`:"\u2014"}),w(q,{label:"LAST RUN",value:Ur(t.lastSeenAgoMs)}),w(q,{label:"FREEZES \xB7 60S",value:t.freezes>0?`${t.freezes}`:"0",accent:t.freezes>0?Me.semantic.error:void 0}),w(q,{label:"WORST FREEZE",value:t.worstFreezeMs>0?`${t.worstFreezeMs} ms`:"\u2014",accent:t.worstFreezeMs>=100?Me.semantic.error:t.worstFreezeMs>0?Me.semantic.warning:void 0})]}),(t.caller||(t.frames?.length??0)>0)&&J(jt,{children:[w(u,{style:h.sectionTitle,children:"SCHEDULED FROM"}),J(m,{style:h.siteCard,children:[t.caller&&J(u,{style:h.siteCaller,children:[t.caller,"()"]}),t.file&&J(u,{style:h.siteFile,children:[t.file,t.line!=null?`:${t.line}`:""]}),t.frames?.map((i,s)=>J(u,{style:h.siteFrame,numberOfLines:1,children:[i.file,":",i.line,":",i.col]},`fr${s}`)),w(u,{style:h.siteNote,children:"Frames are bundle offsets (Hermes) \u2014 the caller name above is the readable part. Captured once when this origin got hot."})]})]}),!t.caller&&(t.frames?.length??0)===0&&t.api!=="unattributed"&&t.api!=="other"&&J(jt,{children:[w(u,{style:h.sectionTitle,children:"SCHEDULED FROM"}),w(u,{style:h.sitePending,children:t.promoted?"Stack capture pending \u2014 next schedule from this site will record it.":"Not hot enough yet \u2014 the scheduling stack is captured once an origin passes 25 schedules or 50ms total."})]})]})}),h=I.create({root:{flex:1,backgroundColor:"transparent",paddingHorizontal:12},identityRow:{flexDirection:"row",alignItems:"center",gap:8,paddingTop:12},badge:{borderWidth:1,borderRadius:3,paddingHorizontal:5,paddingVertical:2},badgeText:{fontSize:9,fontWeight:"700",letterSpacing:.4},name:{flex:1,color:O.color.text,fontSize:15,fontWeight:"600"},explainer:{color:O.color.textTertiary,fontSize:11,lineHeight:15,marginTop:6,marginBottom:4},sectionTitle:{color:O.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.5,marginTop:14,marginBottom:6},chartRow:{flexDirection:"row",alignItems:"flex-end",height:48,gap:2,backgroundColor:O.color.surface,borderRadius:6,borderWidth:1,borderColor:O.color.border,paddingHorizontal:6,paddingTop:2},chartBarSlot:{flex:1,alignItems:"center",justifyContent:"flex-end"},chartBar:{width:"70%",borderTopLeftRadius:2,borderTopRightRadius:2,opacity:.9},chartLegend:{flexDirection:"row",justifyContent:"space-between",marginTop:4},chartLegendText:{color:O.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},statGrid:{flexDirection:"row",flexWrap:"wrap",gap:8},stat:{width:"23%",minWidth:76,flexGrow:1,backgroundColor:O.color.surface,borderWidth:1,borderColor:O.color.border,borderRadius:6,paddingHorizontal:8,paddingVertical:6},statLabel:{color:O.color.textTertiary,fontSize:8,fontWeight:"700",letterSpacing:.4,marginBottom:3},statValue:{color:O.color.text,fontSize:13,fontWeight:"600",fontVariant:["tabular-nums"]},siteCard:{backgroundColor:O.color.surface,borderWidth:1,borderColor:O.color.border,borderRadius:6,padding:10,gap:3},siteCaller:{color:O.color.text,fontSize:13,fontWeight:"600"},siteFile:{color:O.color.info,fontSize:11},siteFrame:{color:O.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},siteNote:{color:O.color.textTertiary,fontSize:9,opacity:.8,marginTop:4},sitePending:{color:O.color.textTertiary,fontSize:11}});import{Fragment as rn,jsx as S,jsxs as U}from"react/jsx-runtime";function Gt(e){return e>=80?V.semantic.error:e>=40?V.semantic.warning:V.semantic.success}function je(e){return e>=100?V.semantic.error:V.semantic.warning}function on(e){let t=e.rows.find(o=>o.api!=="unattributed"&&o.api!=="other");return t&&t.pctOfBusy>=25&&e.busyPct>=15?{color:t.pctOfBusy>=50?V.semantic.error:V.semantic.warning,icon:"\u25B2",text:`${t.label} is eating ${Math.round(t.pctOfBusy)}% of thread time \u2014 start there.`}:e.freezeSummary.count>0?{color:je(e.freezeSummary.worstMs),icon:"\u25B2",text:`${e.freezeSummary.count} freeze${e.freezeSummary.count===1?"":"s"} in the last 60s (worst ${e.freezeSummary.worstMs}ms) \u2014 check rows marked \u26A0.`}:e.busyPct>=80?{color:V.semantic.warning,icon:"\u25B2",text:"Thread saturated by UI/React work \u2014 open Highlight Updates to find re-renders."}:{color:V.semantic.success,icon:"\u25CF",text:`Thread healthy at ${Math.round(e.busyPct)}% load \u2014 nothing worth chasing.`}}function Ue({visible:e,onClose:t,onBack:o,onMinimize:r,initialModalState:n,minimizeTargetPosition:i,remoteSnapshot:s,remoteActions:a,embedded:l=!1}){let c=s!==void 0,[T,W]=qt(null);Gr(()=>{if(!(c||!e))return p.subscribe(W)},[c,e]);let y=c?s:T,x=Yr(()=>a??{pause:()=>p.pause(),resume:()=>p.resume(),clear:()=>p.clear()},[a]),E=y?.paused??!1,ve=(y?.rows.length??0)>0,[ke,Xe]=qt(null),oo=qr(Q=>Xe(Q.key),[]),Ze=!c&&ke?p.getOriginDetail(ke):null,et=ke!==null,tt=U(fe,{children:[et?S(fe.Navigation,{onBack:()=>Xe(null)}):o?S(fe.Navigation,{onBack:o}):null,S(fe.Content,{title:"",noMargin:!0,children:U(m,{style:k.titleRow,children:[S(Qr,{size:14,color:"#34D399"}),S(u,{style:k.title,children:"JS Top"}),y&&S(m,{style:[k.busyPill,{borderColor:Gt(y.busyPct)}],children:U(u,{style:[k.busyText,{color:Gt(y.busyPct)}],children:[y.busyPct.toFixed(0),"% BUSY"]})}),y&&y.freezeSummary.count>0&&S(m,{style:[k.busyPill,{borderColor:je(y.freezeSummary.worstMs)}],children:U(u,{style:[k.busyText,{color:je(y.freezeSummary.worstMs)}],children:["\u26A0 ",y.freezeSummary.count," \xB7"," ",y.freezeSummary.worstMs,"ms"]})})]})}),U(fe.Actions,{children:[S(G,{onPress:E?x.resume:x.pause,style:[k.actionBtn,E&&k.actionBtnActive],accessibilityLabel:E?"Resume sampling":"Pause sampling",children:E?S(en,{size:14,color:P.color.accent}):S(Zr,{size:14,color:P.color.textSecondary})}),S(G,{onPress:x.clear,disabled:!ve,style:[k.actionBtn,!ve&&k.actionBtnDisabled],accessibilityLabel:"Clear stats",children:S(tn,{size:14,color:ve?P.color.textTertiary:P.color.textTertiary})})]})]}),ot=S(m,{style:k.body,children:et?Ze?S(Ut,{detail:Ze}):S(u,{style:k.waiting,children:"This origin is no longer tracked (cleared or evicted)."}):y?U(rn,{children:[(()=>{let Q=on(y);return U(m,{style:[k.diagnosis,{borderLeftColor:Q.color}],children:[S(u,{style:[k.diagnosisIcon,{color:Q.color}],children:Q.icon}),S(u,{style:k.diagnosisText,children:Q.text})]})})(),U(m,{style:k.sparklineRow,children:[S(u,{style:k.sparklineCaption,children:"JS THREAD LOAD \xB7 LAST 30s"}),S(Nt,{history:y.busyHistory})]}),!y.tiers.bridge&&S(u,{style:k.tierBanner,children:"\u201CSystem\u201D rows are UI/React/native work pure JS can\u2019t name \u2014 timers, rAF and Promise chains are fully attributed."}),S($t,{rows:y.rows,onSelectRow:c?void 0:oo})]}):S(u,{style:k.waiting,children:c?"Waiting for device\u2026":"Starting engine\u2026"})});return l?U(m,{style:k.embeddedRoot,children:[S(m,{style:k.embeddedHeader,children:tt}),ot]}):S(Xr,{visible:e,onClose:t,onMinimize:r,minimizeTargetPosition:i,initialModalState:n,header:{showToggleButton:!0,customContent:tt},persistenceKey:"buoy-js-top-modal",enablePersistence:!0,initialMode:"bottomSheet",disableScrollWrapper:!0,children:ot})}var k=I.create({titleRow:{flexDirection:"row",alignItems:"center",gap:8},title:{color:P.color.text,fontSize:14,fontWeight:"500"},busyPill:{borderWidth:1,borderRadius:4,paddingHorizontal:6,paddingVertical:2},busyText:{fontSize:10,fontWeight:"700",fontVariant:["tabular-nums"]},actionBtn:{width:32,height:32,borderRadius:8,backgroundColor:P.color.buttonSurface,borderWidth:1,borderColor:P.color.border,alignItems:"center",justifyContent:"center"},actionBtnActive:{backgroundColor:P.color.accentSoft,borderColor:P.color.accentBorderStrong},actionBtnDisabled:{opacity:.55},body:{flex:1,minHeight:0,backgroundColor:"transparent"},diagnosis:{flexDirection:"row",alignItems:"center",gap:8,marginHorizontal:10,marginTop:8,paddingHorizontal:10,paddingVertical:8,backgroundColor:P.color.surface,borderRadius:6,borderLeftWidth:3},diagnosisIcon:{fontSize:11,fontWeight:"700"},diagnosisText:{flex:1,color:P.color.text,fontSize:12,lineHeight:16},sparklineRow:{paddingHorizontal:10,paddingVertical:8,gap:4},sparklineCaption:{color:P.color.textTertiary,fontSize:8,fontWeight:"700",letterSpacing:.5},tierBanner:{color:P.color.textTertiary,fontSize:10,paddingHorizontal:10,paddingBottom:6},waiting:{color:P.color.textTertiary,fontSize:12,textAlign:"center",paddingVertical:32},embeddedRoot:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:V.background.base},embeddedHeader:{borderBottomWidth:1,borderBottomColor:V.border.default}});import{useEffect as Yt,useState as Qt}from"react";import{macOSColors as qe,night as Ge}from"@buoy-gg/shared-ui/web";import{jsx as an,jsxs as Xt}from"react/jsx-runtime";function nn(e){return e>=80?qe.semantic.error:e>=40?qe.semantic.warning:qe.semantic.success}function sn(){let[e,t]=Qt(()=>p.isEnabled()),[o,r]=Qt(null);if(Yt(()=>p.subscribeEnabled(t),[]),Yt(()=>{if(!e){r(null);return}return p.subscribe(r)},[e]),!e||!o)return null;let n=o.rows.find(i=>i.api!=="unattributed");return Xt(m,{style:Ye.pill,pointerEvents:"none",children:[Xt(u,{style:[Ye.busy,{color:nn(o.busyPct)}],children:[o.busyPct.toFixed(0),"%"]}),n&&an(u,{style:Ye.label,numberOfLines:1,children:n.label})]})}var Ye=I.create({pill:{position:"absolute",top:60,left:8,flexDirection:"row",alignItems:"center",gap:6,backgroundColor:Ge.color.buttonSurface,borderWidth:1,borderColor:Ge.color.border,borderRadius:6,paddingHorizontal:8,paddingVertical:4,maxWidth:220},busy:{fontSize:11,fontWeight:"700",fontVariant:["tabular-nums"]},label:{color:Ge.color.textSecondary,fontSize:10,flexShrink:1}});import{useEffect as ln,useState as cn}from"react";import{Activity as Zt}from"@buoy-gg/shared-ui/web";import{jsx as to}from"react/jsx-runtime";var Qe="#34D399",eo="#6B7280";function un({size:e}){let[t,o]=cn(()=>p.isEnabled());return ln(()=>p.subscribeEnabled(o),[]),to(Zt,{size:e,color:t?Qe:eo})}function pn(){return null}var dn={id:"js-top",name:"JS TOP",description:"Toggle the floating JS-thread busy pill",slot:"row",icon:un,component:pn,props:{},launchMode:"toggle-only",onPress:()=>{p.setEnabled(!p.isEnabled())}},mn={id:"js-top-modal",name:"TASKS",description:"Live Task Manager for the JS thread",slot:"both",icon:({size:e})=>to(Zt,{size:e,color:Qe}),component:Ue,props:{enableSharedModalDimensions:!1}};p.registerTierInstaller(zt);p.registerTierInstaller(Jt);p.registerTierInstaller(Bt);p.registerLongtaskProvider(Wt);p.registerFreezeStatsProvider(Lt);p.registerClearHook(_t);try{typeof window<"u"&&(he(),ye())}catch{}export{eo as JS_TOP_DISABLED_COLOR,Qe as JS_TOP_ENABLED_COLOR,p as JsTopController,sn as JsTopHudOverlay,Ue as JsTopModal,mn as jsTopModalPreset,dn as jsTopPreset,Fr as jsTopSyncAdapter};
|
|
1
|
+
"use client";var Ve=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var At=(e,t)=>{for(var r in t)Ve(e,r,{get:t[r],enumerable:true})},Ne=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ct(t))!zt.call(e,o)&&o!==r&&Ve(e,o,{get:()=>t[o],enumerable:!(n=Tt(t,o))||n.enumerable});return e},Bt=(e,t,r)=>(Ne(e,t,"default"),r&&Ne(r,t,"default"));var Y=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);var je={};At(je,{AccessibilityInfo:()=>Ot,ActivityIndicator:()=>zr,Alert:()=>Rr,Animated:()=>It,AppRegistry:()=>$t,AppState:()=>qe,Appearance:()=>Pt,BackHandler:()=>Lt,Button:()=>Ar,CheckBox:()=>Xt,Clipboard:()=>Wt,DeviceEventEmitter:()=>pr,Dimensions:()=>Dt,Easing:()=>Ht,FlatList:()=>er,I18nManager:()=>Vt,Image:()=>tr,ImageBackground:()=>rr,InteractionManager:()=>jt,Keyboard:()=>Nt,KeyboardAvoidingView:()=>nr,LayoutAnimation:()=>qt,Linking:()=>Jt,LogBox:()=>mr,Modal:()=>Tr,NativeEventEmitter:()=>Kt,NativeModules:()=>Ft,PanResponder:()=>Ut,Picker:()=>or,PixelRatio:()=>_t,Platform:()=>Qt,Pressable:()=>kr,ProgressBar:()=>ir,RefreshControl:()=>ar,SafeAreaView:()=>sr,ScrollView:()=>pe,SectionList:()=>lr,Share:()=>Gt,StatusBar:()=>cr,StyleSheet:()=>D,Switch:()=>Cr,Text:()=>c,TextInput:()=>wr,Touchable:()=>ur,TouchableHighlight:()=>Sr,TouchableNativeFeedback:()=>dr,TouchableOpacity:()=>Z,TouchableWithoutFeedback:()=>vr,UIManager:()=>Yt,Vibration:()=>Zt,View:()=>f,VirtualizedList:()=>hr,YellowBox:()=>fr,findNodeHandle:()=>Br,unstable_createElement:()=>Et,useColorScheme:()=>br,useLocaleContext:()=>gr,useWindowDimensions:()=>yr});Bt(je,Rt);import*as Rt from"react-native-web";import{unstable_createElement as Et,NativeModules as Ft,AccessibilityInfo as Ot,Animated as It,Appearance as Pt,AppRegistry as $t,AppState as qe,BackHandler as Lt,Clipboard as Wt,Dimensions as Dt,Easing as Ht,I18nManager as Vt,Keyboard as Nt,InteractionManager as jt,LayoutAnimation as qt,Linking as Jt,NativeEventEmitter as Kt,PanResponder as Ut,PixelRatio as _t,Platform as Qt,Share as Gt,StyleSheet as D,UIManager as Yt,Vibration as Zt,CheckBox as Xt,FlatList as er,Image as tr,ImageBackground as rr,KeyboardAvoidingView as nr,Picker as or,ProgressBar as ir,RefreshControl as ar,SafeAreaView as sr,SectionList as lr,StatusBar as cr,Touchable as ur,TouchableNativeFeedback as dr,VirtualizedList as hr,YellowBox as fr,LogBox as mr,DeviceEventEmitter as pr,useColorScheme as br,useLocaleContext as gr,useWindowDimensions as yr}from"react-native-web";import*as A from"react-native-web";import{createElement as Mr,forwardRef as xr}from"react";function E(e){let t=xr((n,o)=>{let{accessibilityState:i,accessibilityValue:a,...s}=n;for(let l of["busy","checked","disabled","expanded","selected"])i?.[l]!==void 0&&s[`aria-${l}`]===void 0&&(s[`aria-${l}`]=i[l]);for(let[l,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))a?.[l]!==void 0&&s[`aria-${u}`]===void 0&&(s[`aria-${u}`]=a[l]);return Mr(e,{...s,ref:o})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=E(A.View),c=E(A.Text),wr=E(A.TextInput),Z=E(A.TouchableOpacity),Sr=E(A.TouchableHighlight),vr=E(A.TouchableWithoutFeedback),kr=E(A.Pressable),pe=E(A.ScrollView),Tr=E(A.Modal),Cr=E(A.Switch),zr=E(A.ActivityIndicator),Ar=E(A.Button),Br=A.findNodeHandle,Rr={alert(e,t,r,n){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(i),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(u)}let a=document.createElement("div");a.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let s=r?.length?r:[{text:"OK"}],l=()=>{o.close?.(),o.remove()};for(let u of s){let M=document.createElement("button");M.type="button",M.textContent=u.text??"OK",M.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,M.onclick=()=>{l(),u.onPress?.()},a.appendChild(M)}o.addEventListener("cancel",u=>{u.preventDefault(),n?.cancelable!==false&&(l(),n?.onDismiss?.())}),o.appendChild(a),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};var ae=typeof globalThis<"u"?globalThis:void 0,Er=(()=>{if(typeof ae?.nativePerformanceNow=="function"){let e=ae.nativePerformanceNow;return()=>e()}if(typeof ae?.performance?.now=="function"){let e=ae.performance;return()=>e.now()}return()=>Date.now()})(),Fr=Er;function I(){return Fr()}var h=typeof globalThis<"u"?globalThis:{},Je=false;function V(){return Je}function se(e){Je=e}var be=null;function ge(){return be||(be={setTimeout:h.setTimeout?.bind(h),setInterval:h.setInterval?.bind(h),clearInterval:h.clearInterval?.bind(h),clearTimeout:h.clearTimeout?.bind(h),setImmediate:h.setImmediate?.bind(h),requestAnimationFrame:h.requestAnimationFrame?.bind(h),queueMicrotask:h.queueMicrotask?.bind(h)}),be}function le(){return ge()}var S=Symbol.for("buoy.jsTop.patched"),Ke=Symbol.for("buoy.jsTop.wrapped");var q=new Float64Array(120),X=new Float64Array(120),ye=new Float64Array(120),J=new Float64Array(120).fill(-1);function P(e){return Math.floor(e/250)}function Or(e){let t=e%120;return J[t]!==e&&(J[t]=e,q[t]=0,X[t]=0,ye[t]=0),t}function Me(e,t,r){if(!(t>e))return;let n=Math.max(e,t-3e4),o=P(n),i=P(t),a=n;for(;o<=i;){let s=(o+1)*250,l=Math.min(t,s),u=l-a;u>0&&r(Or(o),u),a=l,o++}}function Ir(e,t){Me(e,t,(r,n)=>{q[r]=Math.min(250,q[r]+n)})}function Pr(e,t,r){let n=t-e;if(!(n>0)||!(r>0))return;let o=Math.min(1,r/n);Me(e,t,(i,a)=>{X[i]=Math.min(250,X[i]+a*o)})}function $r(e,t){Me(e,t,(r,n)=>{ye[r]=Math.min(250,ye[r]+n)})}function Ue(e,t,r){let n=P(t),o=0;for(let i=n-r+1;i<=n;i++){let a=i%120;a>=0&&J[a]===i&&(o+=e[a])}return o}function _e(e){return Ue(q,e,20)}function Lr(e){return Ue(X,e,20)}function Wr(e){let t=P(e),r=[];for(let n=t-20+1;n<=t;n++){let o=n%120;o>=0&&J[o]===n?r.push(Math.max(0,Math.round((q[o]-X[o])*10)/10)):r.push(0)}return r}function Dr(e){let t=P(e),r=[];for(let o=t-120+1;o<=t;o++){let i=o%120;i>=0&&J[i]===o?r.push(Math.round(q[i]/250*100)):r.push(0)}let n=0;for(;n<r.length&&r[n]===0;)n++;return r.slice(Math.max(0,Math.min(n,r.length-1)))}function Hr(){J.fill(-1)}var xe=0;function Vr(){return typeof Y<"u"&&Y}function Nr(e){return(e.split("?")[0]??e).split("/").filter(Boolean).slice(-2).join("/")}function jr(e){return/^[A-Z][A-Za-z0-9]*$/.test(e)}function qr(e,t){if(!Vr()||e.symbolicated||!e.frames||e.frames.length===0||xe>=3)return;e.symbolicated=true;let r=e.frames[0];if(!r||!/^https?:\/\//.test(r.file))return;let n;try{n=`${new URL(r.file).origin}/symbolicate`}catch{return}xe++;let o=JSON.stringify({stack:e.frames.map(i=>({file:i.file,lineNumber:i.line,column:i.col,methodName:""}))});fetch(n,{method:"POST",body:o}).then(i=>i.ok?i.json():null).then(i=>{let a=i?.stack?.find(F=>F.file&&!F.file.includes("node_modules"))??i?.stack?.[0];if(!a?.file&&i?.error){let F=/found: (\/.+)$/.exec(i.error);F&&(a={file:F[1]})}if(!a?.file)return;let s=Nr(a.file),l=a.lineNumber,u=a.methodName&&a.methodName!=="<unknown>"?a.methodName:void 0;e.file=s,e.line=l??e.line;let M=`${s.split("/").pop()}${l!=null?`:${l}`:""}`;u&&jr(u)&&!e.caller?(e.caller=u,e.label=`${e.label} \u2190 <${u}> \xB7 ${M}`):e.label=`${e.label} \xB7 ${M}`}).catch(()=>{}).finally(()=>{xe--})}var Jr=500,Kr=20,k=new Map,Qe="other",Ge=0,we=0;function Se(e,t,r){return{key:e,api:t,label:r,calls:0,totalMs:0,maxMs:0,scheduleCount:0,lastSeenAt:0,promoted:false,lastCaptureAt:0,ring:new Float64Array(20),ringStamps:new Float64Array(20).fill(-1)}}function Ye(e,t){let r=P(t),n=0;for(let o=r-20+1;o<=r;o++){let i=o%20;i>=0&&e.ringStamps[i]===o&&(n+=e.ring[i])}return n}function Ze(e){let t=null,r=1/0;for(let o of k.values()){if(o.key===Qe)continue;let i=Ye(o,e)*1e6+o.lastSeenAt;i<r&&(r=i,t=o)}if(!t)return;let n=Ur(Qe,"other","other (evicted origins)");n.calls+=t.calls,n.totalMs+=t.totalMs,n.maxMs=Math.max(n.maxMs,t.maxMs),n.lastSeenAt=Math.max(n.lastSeenAt,t.lastSeenAt),k.delete(t.key)}function Ur(e,t,r){let n=k.get(e);return n||(n=Se(e,t,r),k.set(e,n)),n}function _r(e){let t=[],r,n=e.split(`
|
|
2
|
+
`);for(let o of n){let i=/at\s+(.*?)\s+\((?:address at\s+)?(.*?):(\d+):(\d+)\)/.exec(o)??/at\s+()(.*?):(\d+):(\d+)$/.exec(o.trim());if(!i)continue;let a=i[1]??"";if(a.includes("buoyJsTop")||a==="Error"||i[2]?.includes("/js-top/"))continue;t.push({file:i[2]??"",line:Number(i[3]),col:Number(i[4])});let s=/^(react_stack_bottom_frame|runWithFiberInDEV|commitHookEffectList|flushPassive|performWork|renderWithHooks|safelyCall)/.test(a)||/^(then|catch|finally|resolve|reject|fulfilled|rejected|step|tryCallOne|tryCallTwo|tryCatch|invokeCallback|notify)$/.test(a);if(!r&&a&&a!=="anonymous"&&!s&&(r=a),t.length>=3)break}return{caller:r,frames:t}}function Qr(e,t){return t-e.lastCaptureAt<Jr||(t-Ge>1e3&&(Ge=t,we=0),we>=Kr)?false:(we++,e.lastCaptureAt=t,true)}function ve(e){if(!e)return;let t=(e.split("?")[0]??e).replace(/\/\/&.*$/,""),r=/^[a-z]+:\/\/[^/]+\/(.*)$/.exec(t);return(r?r[1]:t).split("/").slice(-2).join("/")}function Gr(e){return k.has(e)}function ke(e,t,r,n=true){let o=t,i=typeof o.displayName=="string"&&o.displayName||typeof o.name=="string"&&o.name||"anonymous",a=`${e}|${i}`,s=k.get(a);if(s||(k.size>=500&&Ze(r),s=Se(a,e,i==="anonymous"?ee(e):`${ee(e)} ${i}`),k.set(a,s)),s.scheduleCount++,!s.promoted&&(s.scheduleCount>=25||s.totalMs>=50)&&(s.promoted=true),(s.promoted||e==="interval")&&n&&Qr(s,r)){let{caller:l,frames:u}=_r(new Error().stack??""),M=u[0];if(M||l){let F=M?`${ve(M.file)??"?"}:${M.line}`:"?",p=`${a}@${l??"?"}:${F}`,g=k.get(p);if(!g){k.size>=500&&Ze(r);let C=i==="anonymous"?ee(e):`${ee(e)} ${i}`;g=Se(p,e,l?`${C} \u2190 ${l}`:i==="anonymous"?`${C} @ ${ve(M?.file??"")??"?"}`:C),g.caller=l,g.file=M?ve(M.file):void 0,g.line=M?.line,g.frames=u,g.promoted=true,g.calls=s.calls,g.totalMs=s.totalMs,g.maxMs=s.maxMs,g.scheduleCount=s.scheduleCount,g.lastSeenAt=s.lastSeenAt,g.ring.set(s.ring),g.ringStamps.set(s.ringStamps),s.calls=0,s.totalMs=0,s.maxMs=0,s.ring.fill(0),s.ringStamps.fill(-1),k.set(p,g),qr(g,ee(e))}s.activeRefinedKey=p}}return s.activeRefinedKey??a}function ee(e){switch(e){case"timeout":return"setTimeout";case"interval":return"setInterval";case"immediate":return"setImmediate";case"raf":return"requestAnimationFrame";case"microtask":return"queueMicrotask";case"then":return"Promise.then";case"bridge":return"bridge";default:return e}}function Yr(e,t,r,n){let o=k.get(e);if(!o)return;o.calls++,o.totalMs+=t,t>o.maxMs&&(o.maxMs=t),o.lastSeenAt=n,!o.promoted&&o.totalMs>=50&&(o.promoted=true);let i=n-r,a=i>0?Math.min(1,t/i):1,s=Math.max(r,n-5e3),l=P(s),u=P(n),M=s;for(;l<=u;){let F=(l+1)*250,p=Math.min(n,F),g=p-M;if(g>0){let C=l%20;C>=0&&(o.ringStamps[C]!==l&&(o.ringStamps[C]=l,o.ring[C]=0),o.ring[C]+=i>0?g*a:t)}M=p,l++}Pr(r,n,t)}function Zr(e){return k.get(e)?.label??null}function Xr(e,t,r){let n=[];for(let a of k.values()){let s=Ye(a,e);s<=0&&a.totalMs<1||n.push({key:a.key,label:a.label,api:a.api,file:a.file,line:a.line,windowMs:Math.round(s*10)/10,pctOfBusy:t>0?Math.min(100,Math.round(s/t*1e3)/10):0,totalMs:Math.round(a.totalMs*10)/10,calls:a.calls,avgMs:a.calls>0?Math.round(a.totalMs/a.calls*100)/100:0,maxMs:Math.round(a.maxMs*100)/100,lastSeenAgoMs:a.lastSeenAt>0?Math.max(0,e-a.lastSeenAt):0,freezes:0,worstFreezeMs:0})}n.sort((a,s)=>s.windowMs-a.windowMs||s.totalMs-a.totalMs);let o=[],i=[];for(let a of n)(a.windowMs>=1||a.pctOfBusy>=.5||a.freezes>0?o:i).push(a);return i.length>=2?(o.push({key:"minor",label:`${i.length} minor origins (\u22641ms each)`,api:"other",windowMs:Math.round(i.reduce((a,s)=>a+s.windowMs,0)*10)/10,pctOfBusy:Math.round(i.reduce((a,s)=>a+s.pctOfBusy,0)*10)/10,totalMs:Math.round(i.reduce((a,s)=>a+s.totalMs,0)*10)/10,calls:i.reduce((a,s)=>a+s.calls,0),avgMs:0,maxMs:Math.max(0,...i.map(a=>a.maxMs)),lastSeenAgoMs:Math.min(...i.map(a=>a.lastSeenAgoMs)),freezes:0,worstFreezeMs:0}),o.slice(0,r)):n.slice(0,r)}function en(e,t,r){let n=k.get(e);if(!n)return null;let o=P(t),i=[],a=0;for(let s=o-20+1;s<=o;s++){let l=s%20,u=l>=0&&n.ringStamps[l]===s?Math.round(n.ring[l]*10)/10:0;i.push(u),a+=u}return{key:n.key,label:n.label,api:n.api,caller:n.caller,file:n.file,line:n.line,frames:n.frames,promoted:n.promoted,scheduleCount:n.scheduleCount,calls:n.calls,totalMs:Math.round(n.totalMs*10)/10,avgMs:n.calls>0?Math.round(n.totalMs/n.calls*100)/100:0,maxMs:Math.round(n.maxMs*100)/100,windowMs:Math.round(a*10)/10,pctOfBusy:r>0?Math.min(100,Math.round(a/r*1e3)/10):0,lastSeenAgoMs:n.lastSeenAt>0?Math.max(0,t-n.lastSeenAt):0,buckets:i}}function tn(){k.clear()}var rn=32,K=[],nn=20,Xe=64,et=new Array(Xe).fill(null),Te=0;function on(){return et}function tt(e,t){let r=I(),n=K.length>0?K[K.length-1]:null,o=null;K.length<rn&&(o={originKey:e,start:r,childrenMs:0},K.push(o));try{return t()}finally{try{if(o){K.pop();let i=I(),a=i-r,s=Math.max(0,a-o.childrenMs);n&&(n.childrenMs+=a),Yr(e,s,r,i),!n&&a>=nn&&(et[Te]={originKey:e,start:r,end:i},Te=(Te+1)%Xe)}}catch{}}}function U(e,t){if(typeof e!="function"||e[Ke])return e;let r=V()?ke(t,e,I()):null,n=function(...o){return V()?((r===null||!Gr(r))&&(r=ke(t,e,I(),false)),tt(r,()=>e.apply(this,o))):e.apply(this,o)};return n[Ke]=true,n}function rt(e,t,r){if(!V())return r();let n=ke(e,{name:t},I());return tt(n,r)}function nt(){let e=ge();if(typeof h.setTimeout=="function"&&!h.setTimeout[S]){let t=function(r,n,...o){let i=U(r,"timeout");return e.setTimeout(i,n,...o)};t[S]=true,h.setTimeout=t}if(typeof h.setInterval=="function"&&!h.setInterval[S]){let t=function(r,n,...o){let i=U(r,"interval");return e.setInterval(i,n,...o)};t[S]=true,h.setInterval=t}if(typeof h.setImmediate=="function"&&!h.setImmediate[S]&&e.setImmediate){let t=function(r,...n){let o=U(r,"immediate");return e.setImmediate(o,...n)};t[S]=true,h.setImmediate=t}if(typeof h.requestAnimationFrame=="function"&&!h.requestAnimationFrame[S]&&e.requestAnimationFrame){let t=function(r){let n=U(r,"raf");return e.requestAnimationFrame(n)};t[S]=true,h.requestAnimationFrame=t}}function ot(){let e=ge();if(typeof h.queueMicrotask=="function"&&!h.queueMicrotask[S]&&e.queueMicrotask){let t=function(r){let n=U(r,"microtask");return e.queueMicrotask(n)};t[S]=true,h.queueMicrotask=t}}var Ce=16,an=100,sn=3,ln=8,te=null,re=0,ce=false,ne=[],_=1/0,Q=0,ze=Ce;function cn(){let e=I(),t=re>0?e-re:0;if(re=e,ce){ce=false,_=1/0,Q=e;return}if(t<=0)return;t<an&&(t<_&&(_=t),Q===0&&(Q=e),e-Q>=1e3&&(ne.push(_),ne.length>sn&&ne.shift(),ze=Math.max(ln,Math.min(...ne)),_=1/0,Q=e));let r=t-ze;r>1&&Ir(e-r,e)}function it(){if(te!=null)return;let e=le();re=I(),ce=false,ne=[],_=1/0,Q=0,ze=Ce,te=e.setInterval(cn,Ce)}function at(){te!=null&&(le().clearInterval(te),te=null),re=0}function un(){ce=true}import{definePersistedSetting as dn}from"@buoy-gg/shared-ui/web";var hn="@react_buoy/js-top/prefs",fn={enabled:false},st=dn(hn,fn,{sanitize:e=>({enabled:e.enabled===true})});async function mn(){return st.load()}async function pn(e){await st.save(e)}var bn=250,gn=class{constructor(){this.enabled=false;this.enabledLoaded=false;this.paused=false;this.remoteSampling=false;this.engineRunning=false;this.tiers={timers:false,promises:false,bridge:false,longtask:false};this.notifyHandle=null;this.appStateSub=null;this.snapshot=this.buildSnapshot();this.subscribers=new Set;this.enabledSubscribers=new Set;this.tierInstallers=[];this.longtaskProvider=null;this.freezeStatsProvider=null;this.clearHooks=[];mn().then(e=>{this.enabledLoaded=true,e.enabled&&!this.enabled&&this.setEnabled(true)})}subscribe(e){return this.subscribers.add(e),this.syncEngineState(),e(this.snapshot),()=>{this.subscribers.delete(e),this.syncEngineState()}}subscribeEnabled(e){return this.enabledSubscribers.add(e),e(this.enabled),()=>{this.enabledSubscribers.delete(e)}}setEnabled(e){this.enabled!==e&&(this.enabled=e,this.enabledLoaded&&pn({enabled:e}),this.enabledSubscribers.forEach(t=>{try{t(e)}catch(r){Y&&console.error("[js-top] enabled subscriber threw",r)}}),this.syncEngineState())}isEnabled(){return this.enabled}setRemoteSampling(e){this.remoteSampling!==e&&(this.remoteSampling=e,this.syncEngineState())}isRemoteSampling(){return this.remoteSampling}getStatus(){return this.engineRunning?this.paused?"paused":"running":"disabled"}pause(){this.paused||(this.paused=true,se(false),at(),this.emitSnapshot())}resume(){this.paused&&(this.paused=false,this.engineRunning&&(se(true),it()),this.emitSnapshot())}clear(){tn(),Hr();for(let e of this.clearHooks)try{e()}catch{}this.emitSnapshot()}registerClearHook(e){this.clearHooks.push(e)}getSnapshot(){return this.snapshot}getOriginDetail(e){let t=I(),r=_e(t),n=this.freezeStatsProvider?.(Date.now())?.byOrigin[e];if(e==="unattributed"){let i=Wr(t),a=Math.round(i.reduce((s,l)=>s+l,0)*10)/10;return{key:e,label:"unattributed (events / React / native call-ins)",api:"unattributed",promoted:false,scheduleCount:0,calls:0,totalMs:0,avgMs:0,maxMs:0,windowMs:a,pctOfBusy:r>0?Math.min(100,Math.round(a/r*1e3)/10):0,lastSeenAgoMs:0,buckets:i,freezes:n?.count??0,worstFreezeMs:Math.round(n?.maxMs??0)}}let o=en(e,t,r);return o?{...o,freezes:n?.count??0,worstFreezeMs:Math.round(n?.maxMs??0)}:null}registerTierInstaller(e){this.tierInstallers.push(e),this.engineRunning&&Object.assign(this.tiers,this.runInstaller(e))}registerLongtaskProvider(e){this.longtaskProvider=e}registerFreezeStatsProvider(e){this.freezeStatsProvider=e}shouldRun(){return this.subscribers.size>0||this.remoteSampling}syncEngineState(){let e=this.shouldRun();e&&!this.engineRunning?this.startEngine():!e&&this.engineRunning&&this.stopEngine()}runInstaller(e){try{return e()}catch(t){return Y&&console.error("[js-top] tier installer threw",t),{}}}startEngine(){this.engineRunning=true,nt(),ot(),this.tiers={timers:true,promises:false,bridge:false,longtask:false};for(let e of this.tierInstallers)Object.assign(this.tiers,this.runInstaller(e));se(!this.paused),this.paused||it();try{this.appStateSub=qe.addEventListener("change",()=>{un()})}catch{this.appStateSub=null}this.notifyHandle=le().setInterval(()=>this.emitSnapshot(),bn),this.emitSnapshot()}stopEngine(){if(this.engineRunning=false,se(false),at(),this.notifyHandle!=null&&(le().clearInterval(this.notifyHandle),this.notifyHandle=null),this.appStateSub){try{this.appStateSub.remove()}catch{}this.appStateSub=null}}buildSnapshot(){let e=I(),t=_e(e),r=Lr(e),n=Math.max(0,t-r),o=Xr(e,t,30);n>=1&&(o.push({key:"unattributed",label:"unattributed (events / React / native call-ins)",api:"unattributed",windowMs:Math.round(n*10)/10,pctOfBusy:t>0?Math.min(100,Math.round(n/t*1e3)/10):0,totalMs:0,calls:0,avgMs:0,maxMs:0,lastSeenAgoMs:0,freezes:0,worstFreezeMs:0}),o.sort((s,l)=>l.windowMs-s.windowMs||l.totalMs-s.totalMs));let i=this.freezeStatsProvider?.(Date.now())??{count:0,worstMs:0,byOrigin:{}};for(let s of o){let l=i.byOrigin[s.key];l&&(s.freezes=l.count,s.worstFreezeMs=Math.round(l.maxMs))}let a=5e3;return{ts:Date.now(),paused:this.paused,busyPct:Math.min(100,Math.round(t/a*1e3)/10),busyHistory:Dr(e),tiers:{...this.tiers},rows:o,totals:{attributedWindowMs:Math.round(r*10)/10,unattributedWindowMs:Math.round(n*10)/10,windowMs:a},freezeSummary:{count:i.count,worstMs:Math.round(i.worstMs)},longtasks:this.longtaskProvider?this.longtaskProvider():[]}}emitSnapshot(){this.snapshot=this.buildSnapshot(),this.subscribers.forEach(e=>{try{e(this.snapshot)}catch(t){Y&&console.error("[js-top] snapshot subscriber threw",t)}})}isEngineActive(){return V()}},d=new gn;function Ae(e,t){let r=e[t];if(typeof r!="function")return false;if(r[S])return true;let n=function(...o){for(let i=0;i<o.length;i++)typeof o[i]=="function"&&(o[i]=U(o[i],"then"));return r.apply(this,o)};return n[S]=true,Object.defineProperty(n,"name",{value:t,configurable:true}),e[t]=n,true}function yn(){let e=h.Promise?.prototype;if(!e)return{promises:false};let t=Ae(e,"then");return Ae(e,"catch"),Ae(e,"finally"),{promises:t}}function Mn(){let e=h.__fbBatchedBridge;if(!e)return{bridge:false};let t=false;if(typeof e.callFunctionReturnFlushedQueue=="function"&&!e.callFunctionReturnFlushedQueue[S]){let n=e.callFunctionReturnFlushedQueue.bind(e),o=function(i,a,s){return V()?rt("bridge",`${i}.${a}`,()=>n(i,a,s)):n(i,a,s)};o[S]=true,e.callFunctionReturnFlushedQueue=o,t=true}if(typeof e.invokeCallbackAndReturnFlushedQueue=="function"&&!e.invokeCallbackAndReturnFlushedQueue[S]){let n=e.invokeCallbackAndReturnFlushedQueue.bind(e),o=function(i,a){return V()?rt("bridge","nativeModuleCallback",()=>n(i,a)):n(i,a)};o[S]=true,e.invokeCallbackAndReturnFlushedQueue=o,t=true}let r=e.callFunctionReturnFlushedQueue?.[S]===true;return{bridge:t||r}}var xn=40,wn=6e4,Sn="unattributed",lt=false,ue=false,G=[];function vn(e,t){let r=e+t,n=null,o=0;for(let i of on()){if(!i)continue;let a=Math.min(r,i.end)-Math.max(e,i.start);a>o&&(o=a,n=i.originKey)}return n}function kn(){if(lt)return{longtask:ue};lt=true;let e=h.PerformanceObserver;if(typeof e!="function")return{longtask:false};try{new e(t=>{if(V())try{for(let r of t.getEntries()){if(r.entryType!=="longtask")continue;let n=r.startTime,o=r.duration;$r(n,n+o),G.push({start:n,duration:o,at:Date.now(),originKey:vn(n,o)}),G.length>xn&&G.shift()}}catch{}}).observe({entryTypes:["longtask"]}),ue=true}catch{ue=false}return{longtask:ue}}function Tn(){return G.map(e=>({start:e.start,duration:e.duration,at:e.at,originLabel:e.originKey?Zr(e.originKey):null}))}function Cn(e){let t={},r=0,n=0;for(let o of G){if(o.at>0&&e-o.at>wn)continue;r++,o.duration>n&&(n=o.duration);let i=o.originKey??Sn,a=t[i];a?(a.count++,o.duration>a.maxMs&&(a.maxMs=o.duration)):t[i]={count:1,maxMs:o.duration}}return{count:r,worstMs:n,byOrigin:t}}function zn(){G.length=0}var An={version:1,getSnapshot:()=>({live:d.getSnapshot(),enabled:d.isEnabled()||d.isRemoteSampling()}),subscribe:e=>{let t=d.subscribe(()=>e()),r=d.subscribeEnabled(()=>e());return()=>{t(),r()}},actions:{setEnabled:e=>{let t=e.enabled;d.setRemoteSampling(t)},pause:()=>d.pause(),resume:()=>d.resume(),clear:()=>d.clear(),getOriginDetail:e=>d.getOriginDetail(e.key),sample:async e=>{let t=e,r=Math.min(Math.max(t?.durationMs??3e3,250),3e4),n=d.isRemoteSampling()||d.isEnabled();n||d.setRemoteSampling(true),t?.clearFirst&&d.clear();try{return await new Promise(o=>setTimeout(o,r)),d.getSnapshot()}finally{n||d.setRemoteSampling(false)}}}};import{useCallback as Bn,useEffect as Rn,useMemo as En,useState as ct}from"react";import{Activity as Fn,JsModal as On,macOSColors as O,night as z,ModalHeader as oe,Pause as In,Play as Pn,Trash2 as $n}from"@buoy-gg/shared-ui/web";import{memo as Ln}from"react";import{macOSColors as Be}from"@buoy-gg/shared-ui/web";import{jsx as ut}from"react/jsx-runtime";var Wn=60;function Dn(e){return e>=80?Be.semantic.error:e>=40?Be.semantic.warning:Be.semantic.success}var Hn=Ln(function({history:e}){let t=e.slice(-Wn);return ut(f,{style:dt.row,pointerEvents:"none",children:t.map((r,n)=>ut(f,{style:[dt.bar,{height:Math.max(2,r/100*28),backgroundColor:Dn(r)}]},`b${n}`))})}),dt=D.create({row:{flexDirection:"row",alignItems:"flex-end",gap:1,height:28,alignSelf:"stretch"},bar:{flex:1,maxWidth:6,borderRadius:1,opacity:.9}});import{memo as Vn,useState as Nn}from"react";import{macOSColors as de,night as w}from"@buoy-gg/shared-ui/web";import{jsx as B,jsxs as $}from"react/jsx-runtime";var jn=[{key:"windowMs",title:"RECENT"},{key:"calls",title:"CALLS"},{key:"avgMs",title:"AVG"},{key:"maxMs",title:"MAX"},{key:"totalMs",title:"TOTAL"}],ht={timeout:{text:"TIMEOUT",color:"#38BDF8",prefix:"setTimeout"},interval:{text:"INTERVAL",color:"#22D3EE",prefix:"setInterval"},immediate:{text:"IMMED",color:"#60A5FA",prefix:"setImmediate"},raf:{text:"RAF",color:"#34D399",prefix:"requestAnimationFrame"},microtask:{text:"MICRO",color:"#A78BFA",prefix:"queueMicrotask"},then:{text:"PROMISE",color:"#BF5AF2",prefix:"Promise.then"},bridge:{text:"BRIDGE",color:"#FBBF24",prefix:"bridge"},unattributed:{text:"SYSTEM",color:"#8E8E93"},other:{text:"OTHER",color:"#8E8E93",prefix:"other"}};function Re(e){return ht[e]??ht.other}function ft(e){if(e.api==="unattributed")return"events \xB7 React \xB7 native call-ins";if(e.api==="other")return"evicted cold origins";let t=Re(e.api).prefix,r=e.label;return t&&r.startsWith(t)&&(r=r.slice(t.length)),r=r.replace(/^[\s←@]+/,"").trim(),r.length>0?r:"anonymous"}function ie(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?`${Math.round(e)}`:`${Math.round(e*10)/10}`}function qn(e){return e.calls<=0?"measured by probe \xB7 not reachable from JS":`${ie(e.calls)} calls \xB7 avg ${ie(e.avgMs)} \xB7 max ${ie(e.maxMs)} \xB7 total ${ie(e.totalMs)} ms`}var Jn=Vn(function({row:e,rank:t,onPress:r}){let n=Re(e.api);return $(r?Z:f,{style:T.row,...r?{onPress:()=>r(e),activeOpacity:.6}:{},children:[$(f,{style:T.topLine,children:[B(c,{style:T.rank,children:t}),B(f,{style:[T.badge,{borderColor:n.color,backgroundColor:`${n.color}1A`}],children:B(c,{style:[T.badgeText,{color:n.color}],children:n.text})}),B(c,{style:T.name,numberOfLines:1,children:ft(e)}),e.freezes>0&&$(c,{style:[T.freezeBadge,e.worstFreezeMs>=100&&T.freezeBadgeSevere],children:["\u26A0 \xD7",e.freezes]}),$(c,{style:[T.windowMs,e.api!=="unattributed"&&e.pctOfBusy>=25&&{color:e.pctOfBusy>=50?de.semantic.error:de.semantic.warning}],children:[ie(e.windowMs),B(c,{style:T.unit,children:" ms"})]}),$(c,{style:[T.pct,e.api==="unattributed"&&T.pctMuted],children:[Math.round(e.pctOfBusy),"%"]})]}),$(f,{style:T.subLine,children:[B(f,{style:T.barTrack,children:B(f,{style:[T.barFill,{width:`${Math.min(100,e.pctOfBusy)}%`,backgroundColor:n.color}]})}),B(c,{style:T.stats,numberOfLines:1,children:qn(e)})]})]})},(e,t)=>e.rank===t.rank&&e.onPress===t.onPress&&e.row.key===t.row.key&&e.row.windowMs===t.row.windowMs&&e.row.calls===t.row.calls&&e.row.maxMs===t.row.maxMs&&e.row.totalMs===t.row.totalMs&&e.row.pctOfBusy===t.row.pctOfBusy&&e.row.freezes===t.row.freezes&&e.row.worstFreezeMs===t.row.worstFreezeMs);function Kn({rows:e,onSelectRow:t}){let[r,n]=Nn("windowMs"),o=r==="windowMs"?e:[...e].sort((i,a)=>a[r]-i[r]);return $(f,{style:L.root,children:[$(f,{style:L.sortRow,children:[B(c,{style:L.sortLabel,children:"SORT"}),jn.map(i=>B(Z,{onPress:()=>n(i.key),style:[L.sortChip,r===i.key&&L.sortChipOn],children:B(c,{style:[L.sortChipText,r===i.key&&L.sortChipTextOn],children:i.title})},i.key))]}),$(pe,{style:L.body,children:[o.map((i,a)=>B(Jn,{row:i,rank:a+1,onPress:t},i.key)),o.length===0&&B(c,{style:L.empty,children:"No tasks observed yet \u2014 interact with the app."})]})]})}var L=D.create({root:{flex:1,minHeight:0},sortRow:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:6,borderBottomWidth:1,borderBottomColor:w.color.border,backgroundColor:w.color.surface},sortLabel:{color:w.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.5,marginRight:2},sortChip:{borderWidth:1,borderColor:w.color.border,borderRadius:4,paddingHorizontal:7,paddingVertical:3},sortChipOn:{borderColor:w.color.accentBorderStrong,backgroundColor:w.color.accentSoft},sortChipText:{color:w.color.textTertiary,fontSize:9,fontWeight:"600",fontVariant:["tabular-nums"]},sortChipTextOn:{color:w.color.accent},body:{flex:1},empty:{color:w.color.textTertiary,fontSize:12,textAlign:"center",paddingVertical:24}}),T=D.create({row:{paddingHorizontal:10,paddingVertical:8,borderBottomWidth:D.hairlineWidth,borderBottomColor:w.color.border,gap:5},topLine:{flexDirection:"row",alignItems:"center",gap:6},rank:{width:16,color:w.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},badge:{borderWidth:1,borderRadius:3,paddingHorizontal:4,paddingVertical:1},badgeText:{fontSize:8,fontWeight:"700",letterSpacing:.4},name:{flex:1,color:w.color.text,fontSize:13,fontWeight:"500"},freezeBadge:{color:de.semantic.warning,fontSize:10,fontWeight:"700",fontVariant:["tabular-nums"]},freezeBadgeSevere:{color:de.semantic.error},windowMs:{color:w.color.text,fontSize:13,fontWeight:"700",fontVariant:["tabular-nums"]},unit:{color:w.color.textTertiary,fontSize:10,fontWeight:"400"},pct:{width:38,textAlign:"right",color:w.color.textSecondary,fontSize:12,fontWeight:"600",fontVariant:["tabular-nums"]},pctMuted:{color:w.color.textTertiary},subLine:{flexDirection:"row",alignItems:"center",gap:8,paddingLeft:22},barTrack:{width:72,height:4,borderRadius:2,backgroundColor:w.color.fillSecondary,overflow:"hidden"},barFill:{height:4,borderRadius:2,opacity:.85},stats:{flex:1,color:w.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]}});import{memo as Un}from"react";import{macOSColors as he,night as v,useSafeAreaInsets as _n}from"@buoy-gg/shared-ui/web";import{Fragment as mt,jsx as y,jsxs as R}from"react/jsx-runtime";var pt={timeout:"Work scheduled with setTimeout. Time shown is the callback's exclusive run time on the JS thread.",interval:"A repeating setInterval. One scheduling site, many runs \u2014 a hot interval is the classic silent JS-FPS killer.",immediate:"Work scheduled with setImmediate \u2014 runs at the end of the current event-loop turn.",raf:"requestAnimationFrame work \u2014 runs once per frame while scheduled. Cost here directly trades against 60fps.",microtask:"queueMicrotask work \u2014 runs after the current task, before the thread yields.",then:"Promise reaction (.then/.catch/.finally). Named by the function that attached the reaction. Note: async/await bodies bypass .then and land in the System row instead.",bridge:"A native\u2192JS call-in over the legacy bridge (events, module callbacks), measured as its un-nested remainder.",unattributed:"Thread time the probe measured but no JS wrapper could claim: touch handlers, React commits, native call-ins, and async/await bodies. High here on New Architecture is normal \u2014 it's where UI work lives.",other:"Origins evicted from the table when the registry hit its cap \u2014 their totals are preserved here."};function Qn(e){return pt[e]??pt.other}function N(e){return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?`${Math.round(e)}`:`${Math.round(e*100)/100}`}function Gn(e){if(e<=0)return"\u2014";let t=e/1e3;return t<1?"just now":t<60?`${Math.round(t)}s ago`:`${Math.floor(t/60)}m ago`}function H({label:e,value:t,accent:r}){return R(f,{style:m.stat,children:[y(c,{style:m.statLabel,children:e}),y(c,{style:[m.statValue,r?{color:r}:null],children:t})]})}var Yn=Un(function({detail:e}){let t=Re(e.api),r=_n({minBottom:12}),n=Math.max(1,...e.buckets);return R(pe,{style:m.root,contentContainerStyle:{paddingBottom:r.bottom},children:[R(f,{style:m.identityRow,children:[y(f,{style:[m.badge,{borderColor:t.color,backgroundColor:`${t.color}1A`}],children:y(c,{style:[m.badgeText,{color:t.color}],children:t.text})}),y(c,{style:m.name,numberOfLines:2,children:ft(e)})]}),y(c,{style:m.explainer,children:Qn(e.api)}),y(c,{style:m.sectionTitle,children:"ACTIVITY \xB7 LAST 5S"}),y(f,{style:m.chartRow,children:e.buckets.map((o,i)=>y(f,{style:m.chartBarSlot,children:y(f,{style:[m.chartBar,{height:Math.max(2,o/n*44),backgroundColor:t.color}]})},`bk${i}`))}),R(f,{style:m.chartLegend,children:[R(c,{style:m.chartLegendText,children:[N(e.windowMs)," ms in window \xB7 ",e.pctOfBusy.toFixed(1),"% of busy time"]}),R(c,{style:m.chartLegendText,children:["peak ",N(n)," ms/250ms"]})]}),y(c,{style:m.sectionTitle,children:"STATS \xB7 SINCE START"}),R(f,{style:m.statGrid,children:[y(H,{label:"RUNS",value:e.calls>0?N(e.calls):"\u2014"}),y(H,{label:"SCHEDULED",value:e.scheduleCount>0?N(e.scheduleCount):"\u2014"}),y(H,{label:"AVG / RUN",value:e.calls>0?`${N(e.avgMs)} ms`:"\u2014"}),y(H,{label:"MAX / RUN",value:e.maxMs>0?`${N(e.maxMs)} ms`:"\u2014",accent:e.maxMs>=50?he.semantic.warning:void 0}),y(H,{label:"TOTAL",value:e.totalMs>0?`${N(e.totalMs)} ms`:"\u2014"}),y(H,{label:"LAST RUN",value:Gn(e.lastSeenAgoMs)}),y(H,{label:"FREEZES \xB7 60S",value:e.freezes>0?`${e.freezes}`:"0",accent:e.freezes>0?he.semantic.error:void 0}),y(H,{label:"WORST FREEZE",value:e.worstFreezeMs>0?`${e.worstFreezeMs} ms`:"\u2014",accent:e.worstFreezeMs>=100?he.semantic.error:e.worstFreezeMs>0?he.semantic.warning:void 0})]}),(e.caller||(e.frames?.length??0)>0)&&R(mt,{children:[y(c,{style:m.sectionTitle,children:"SCHEDULED FROM"}),R(f,{style:m.siteCard,children:[e.caller&&R(c,{style:m.siteCaller,children:[e.caller,"()"]}),e.file&&R(c,{style:m.siteFile,children:[e.file,e.line!=null?`:${e.line}`:""]}),e.frames?.map((o,i)=>R(c,{style:m.siteFrame,numberOfLines:1,children:[o.file,":",o.line,":",o.col]},`fr${i}`)),y(c,{style:m.siteNote,children:"Frames are bundle offsets (Hermes) \u2014 the caller name above is the readable part. Captured once when this origin got hot."})]})]}),!e.caller&&(e.frames?.length??0)===0&&e.api!=="unattributed"&&e.api!=="other"&&R(mt,{children:[y(c,{style:m.sectionTitle,children:"SCHEDULED FROM"}),y(c,{style:m.sitePending,children:e.promoted?"Stack capture pending \u2014 next schedule from this site will record it.":"Not hot enough yet \u2014 the scheduling stack is captured once an origin passes 25 schedules or 50ms total."})]})]})}),m=D.create({root:{flex:1,backgroundColor:"transparent",paddingHorizontal:12},identityRow:{flexDirection:"row",alignItems:"center",gap:8,paddingTop:12},badge:{borderWidth:1,borderRadius:3,paddingHorizontal:5,paddingVertical:2},badgeText:{fontSize:9,fontWeight:"700",letterSpacing:.4},name:{flex:1,color:v.color.text,fontSize:15,fontWeight:"600"},explainer:{color:v.color.textTertiary,fontSize:11,lineHeight:15,marginTop:6,marginBottom:4},sectionTitle:{color:v.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.5,marginTop:14,marginBottom:6},chartRow:{flexDirection:"row",alignItems:"flex-end",height:48,gap:2,backgroundColor:v.color.surface,borderRadius:6,borderWidth:1,borderColor:v.color.border,paddingHorizontal:6,paddingTop:2},chartBarSlot:{flex:1,alignItems:"center",justifyContent:"flex-end"},chartBar:{width:"70%",borderTopLeftRadius:2,borderTopRightRadius:2,opacity:.9},chartLegend:{flexDirection:"row",justifyContent:"space-between",marginTop:4},chartLegendText:{color:v.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},statGrid:{flexDirection:"row",flexWrap:"wrap",gap:8},stat:{width:"23%",minWidth:76,flexGrow:1,backgroundColor:v.color.surface,borderWidth:1,borderColor:v.color.border,borderRadius:6,paddingHorizontal:8,paddingVertical:6},statLabel:{color:v.color.textTertiary,fontSize:8,fontWeight:"700",letterSpacing:.4,marginBottom:3},statValue:{color:v.color.text,fontSize:13,fontWeight:"600",fontVariant:["tabular-nums"]},siteCard:{backgroundColor:v.color.surface,borderWidth:1,borderColor:v.color.border,borderRadius:6,padding:10,gap:3},siteCaller:{color:v.color.text,fontSize:13,fontWeight:"600"},siteFile:{color:v.color.info,fontSize:11},siteFrame:{color:v.color.textTertiary,fontSize:10,fontVariant:["tabular-nums"]},siteNote:{color:v.color.textTertiary,fontSize:9,opacity:.8,marginTop:4},sitePending:{color:v.color.textTertiary,fontSize:11}});import{Fragment as Zn,jsx as b,jsxs as W}from"react/jsx-runtime";function bt(e){return e>=80?O.semantic.error:e>=40?O.semantic.warning:O.semantic.success}function Ee(e){return e>=100?O.semantic.error:O.semantic.warning}function Xn(e){let t=e.rows.find(r=>r.api!=="unattributed"&&r.api!=="other");return t&&t.pctOfBusy>=25&&e.busyPct>=15?{color:t.pctOfBusy>=50?O.semantic.error:O.semantic.warning,icon:"\u25B2",text:`${t.label} is eating ${Math.round(t.pctOfBusy)}% of thread time \u2014 start there.`}:e.freezeSummary.count>0?{color:Ee(e.freezeSummary.worstMs),icon:"\u25B2",text:`${e.freezeSummary.count} freeze${e.freezeSummary.count===1?"":"s"} in the last 60s (worst ${e.freezeSummary.worstMs}ms) \u2014 check rows marked \u26A0.`}:e.busyPct>=80?{color:O.semantic.warning,icon:"\u25B2",text:"Thread saturated by UI/React work \u2014 open Highlight Updates to find re-renders."}:{color:O.semantic.success,icon:"\u25CF",text:`Thread healthy at ${Math.round(e.busyPct)}% load \u2014 nothing worth chasing.`}}function gt({visible:e,onClose:t,onBack:r,onMinimize:n,initialModalState:o,minimizeTargetPosition:i,remoteSnapshot:a,remoteActions:s,embedded:l=false}){let u=a!==void 0,[M,F]=ct(null);Rn(()=>{if(!(u||!e))return d.subscribe(F)},[u,e]);let p=u?a:M,g=En(()=>s??{pause:()=>d.pause(),resume:()=>d.resume(),clear:()=>d.clear()},[s]),C=p?.paused??false,fe=(p?.rows.length??0)>0,[me,$e]=ct(null),kt=Bn(j=>$e(j.key),[]),Le=!u&&me?d.getOriginDetail(me):null,We=me!==null,De=W(oe,{children:[We?b(oe.Navigation,{onBack:()=>$e(null)}):r?b(oe.Navigation,{onBack:r}):null,b(oe.Content,{title:"",noMargin:true,children:W(f,{style:x.titleRow,children:[b(Fn,{size:14,color:"#34D399"}),b(c,{style:x.title,children:"JS Top"}),p&&b(f,{style:[x.busyPill,{borderColor:bt(p.busyPct)}],children:W(c,{style:[x.busyText,{color:bt(p.busyPct)}],children:[p.busyPct.toFixed(0),"% BUSY"]})}),p&&p.freezeSummary.count>0&&b(f,{style:[x.busyPill,{borderColor:Ee(p.freezeSummary.worstMs)}],children:W(c,{style:[x.busyText,{color:Ee(p.freezeSummary.worstMs)}],children:["\u26A0 ",p.freezeSummary.count," \xB7"," ",p.freezeSummary.worstMs,"ms"]})})]})}),W(oe.Actions,{children:[b(Z,{onPress:C?g.resume:g.pause,style:[x.actionBtn,C&&x.actionBtnActive],accessibilityLabel:C?"Resume sampling":"Pause sampling",children:C?b(Pn,{size:14,color:z.color.accent}):b(In,{size:14,color:z.color.textSecondary})}),b(Z,{onPress:g.clear,disabled:!fe,style:[x.actionBtn,!fe&&x.actionBtnDisabled],accessibilityLabel:"Clear stats",children:b($n,{size:14,color:fe?z.color.textTertiary:z.color.textTertiary})})]})]}),He=b(f,{style:x.body,children:We?Le?b(Yn,{detail:Le}):b(c,{style:x.waiting,children:"This origin is no longer tracked (cleared or evicted)."}):p?W(Zn,{children:[(()=>{let j=Xn(p);return W(f,{style:[x.diagnosis,{borderLeftColor:j.color}],children:[b(c,{style:[x.diagnosisIcon,{color:j.color}],children:j.icon}),b(c,{style:x.diagnosisText,children:j.text})]})})(),W(f,{style:x.sparklineRow,children:[b(c,{style:x.sparklineCaption,children:"JS THREAD LOAD \xB7 LAST 30s"}),b(Hn,{history:p.busyHistory})]}),!p.tiers.bridge&&b(c,{style:x.tierBanner,children:"\u201CSystem\u201D rows are UI/React/native work pure JS can\u2019t name \u2014 timers, rAF and Promise chains are fully attributed."}),b(Kn,{rows:p.rows,onSelectRow:u?void 0:kt})]}):b(c,{style:x.waiting,children:u?"Waiting for device\u2026":"Starting engine\u2026"})});return l?W(f,{style:x.embeddedRoot,children:[b(f,{style:x.embeddedHeader,children:De}),He]}):b(On,{visible:e,onClose:t,onMinimize:n,minimizeTargetPosition:i,initialModalState:o,header:{showToggleButton:true,customContent:De},persistenceKey:"buoy-js-top-modal",enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:He})}var x=D.create({titleRow:{flexDirection:"row",alignItems:"center",gap:8},title:{color:z.color.text,fontSize:14,fontWeight:"500"},busyPill:{borderWidth:1,borderRadius:4,paddingHorizontal:6,paddingVertical:2},busyText:{fontSize:10,fontWeight:"700",fontVariant:["tabular-nums"]},actionBtn:{width:32,height:32,borderRadius:8,backgroundColor:z.color.buttonSurface,borderWidth:1,borderColor:z.color.border,alignItems:"center",justifyContent:"center"},actionBtnActive:{backgroundColor:z.color.accentSoft,borderColor:z.color.accentBorderStrong},actionBtnDisabled:{opacity:.55},body:{flex:1,minHeight:0,backgroundColor:"transparent"},diagnosis:{flexDirection:"row",alignItems:"center",gap:8,marginHorizontal:10,marginTop:8,paddingHorizontal:10,paddingVertical:8,backgroundColor:z.color.surface,borderRadius:6,borderLeftWidth:3},diagnosisIcon:{fontSize:11,fontWeight:"700"},diagnosisText:{flex:1,color:z.color.text,fontSize:12,lineHeight:16},sparklineRow:{paddingHorizontal:10,paddingVertical:8,gap:4},sparklineCaption:{color:z.color.textTertiary,fontSize:8,fontWeight:"700",letterSpacing:.5},tierBanner:{color:z.color.textTertiary,fontSize:10,paddingHorizontal:10,paddingBottom:6},waiting:{color:z.color.textTertiary,fontSize:12,textAlign:"center",paddingVertical:32},embeddedRoot:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:O.background.base},embeddedHeader:{borderBottomWidth:1,borderBottomColor:O.border.default}});import{useEffect as yt,useState as Mt}from"react";import{macOSColors as Fe,night as Oe}from"@buoy-gg/shared-ui/web";import{jsx as eo,jsxs as xt}from"react/jsx-runtime";function to(e){return e>=80?Fe.semantic.error:e>=40?Fe.semantic.warning:Fe.semantic.success}function ro(){let[e,t]=Mt(()=>d.isEnabled()),[r,n]=Mt(null);if(yt(()=>d.subscribeEnabled(t),[]),yt(()=>{if(!e){n(null);return}return d.subscribe(n)},[e]),!e||!r)return null;let o=r.rows.find(i=>i.api!=="unattributed");return xt(f,{style:Ie.pill,pointerEvents:"none",children:[xt(c,{style:[Ie.busy,{color:to(r.busyPct)}],children:[r.busyPct.toFixed(0),"%"]}),o&&eo(c,{style:Ie.label,numberOfLines:1,children:o.label})]})}var Ie=D.create({pill:{position:"absolute",top:60,left:8,flexDirection:"row",alignItems:"center",gap:6,backgroundColor:Oe.color.buttonSurface,borderWidth:1,borderColor:Oe.color.border,borderRadius:6,paddingHorizontal:8,paddingVertical:4,maxWidth:220},busy:{fontSize:11,fontWeight:"700",fontVariant:["tabular-nums"]},label:{color:Oe.color.textSecondary,fontSize:10,flexShrink:1}});import{useEffect as no,useState as oo}from"react";import{Activity as wt}from"@buoy-gg/shared-ui/web";import{jsx as St}from"react/jsx-runtime";var Pe="#34D399",vt="#6B7280";function io({size:e}){let[t,r]=oo(()=>d.isEnabled());return no(()=>d.subscribeEnabled(r),[]),St(wt,{size:e,color:t?Pe:vt})}function ao(){return null}var so={id:"js-top",name:"JS TOP",description:"Toggle the floating JS-thread busy pill",slot:"row",icon:io,component:ao,props:{},launchMode:"toggle-only",onPress:()=>{d.setEnabled(!d.isEnabled())}},lo={id:"js-top-modal",name:"TASKS",description:"Live Task Manager for the JS thread",slot:"both",icon:({size:e})=>St(wt,{size:e,color:Pe}),component:gt,props:{enableSharedModalDimensions:false}};d.registerTierInstaller(yn);d.registerTierInstaller(Mn);d.registerTierInstaller(kn);d.registerLongtaskProvider(Tn);d.registerFreezeStatsProvider(Cn);d.registerClearHook(zn);try{typeof window<"u"&&(nt(),ot())}catch{}export{vt as JS_TOP_DISABLED_COLOR,Pe as JS_TOP_ENABLED_COLOR,d as JsTopController,ro as JsTopHudOverlay,gt as JsTopModal,lo as jsTopModalPreset,so as jsTopPreset,An as jsTopSyncAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/js-top",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.43",
|
|
4
4
|
"description": "Inspect instrumented JavaScript timers, promises and callbacks to investigate work on the React Native JS thread.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -12,13 +12,10 @@
|
|
|
12
12
|
],
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
15
|
+
"@buoy-gg/shared-ui": "^7.0.43"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"react": "*"
|
|
19
|
-
"react-native": ">=0.76.0",
|
|
20
|
-
"react-native-web": "^0.21.0",
|
|
21
|
-
"react-dom": ">=18"
|
|
18
|
+
"react": "*"
|
|
22
19
|
},
|
|
23
20
|
"devDependencies": {
|
|
24
21
|
"@types/react": "^19.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_JsTopController","require","_promises","_bridge","_timers","_microtasks","_longtasks","_jsTopSyncAdapter","_JsTopModal","_JsTopHudOverlay","_preset","JsTopController","registerTierInstaller","installPromisePatches","installBridgePatch","installLongtaskObserver","registerLongtaskProvider","getLongtasks","registerFreezeStatsProvider","getFreezeStats","registerClearHook","clearLongtasks","window","installTimerPatches","installMicrotaskPatches"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AA8BA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcAU,gCAAe,CAACC,qBAAqB,CAACC,+BAAqB,CAAC;AAC5DF,gCAAe,CAACC,qBAAqB,CAACE,0BAAkB,CAAC;AACzDH,gCAAe,CAACC,qBAAqB,CAACG,kCAAuB,CAAC;AAC9DJ,gCAAe,CAACK,wBAAwB,CAACC,uBAAY,CAAC;AACtDN,gCAAe,CAACO,2BAA2B,CAACC,yBAAc,CAAC;AAC3DR,gCAAe,CAACS,iBAAiB,CAACC,yBAAc,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;EACF,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACnC,IAAAC,2BAAmB,EAAC,CAAC;IACrB,IAAAC,mCAAuB,EAAC,CAAC;EACzB;AACF,CAAC,CAAC,MAAM;EACN;AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_sharedUi","_jsxRuntime","MAX_POINTS","barColor","pct","macOSColors","semantic","error","warning","success","BusySparkline","exports","memo","history","points","slice","jsx","View","style","styles","row","pointerEvents","children","map","i","bar","height","Math","max","backgroundColor","StyleSheet","create","flexDirection","alignItems","gap","alignSelf","flex","maxWidth","borderRadius","opacity"],"sourceRoot":"../../../../src","sources":["js-top/components/BusySparkline.tsx"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAiD,IAAAG,WAAA,GAAAH,OAAA;AAPjD;AACA;AACA;AACA;;AAMA,MAAMI,UAAU,GAAG,EAAE;AAErB,SAASC,QAAQA,CAACC,GAAW,EAAU;EACrC,IAAIA,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACC,KAAK;EAChD,IAAIH,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACE,OAAO;EAClD,OAAOH,qBAAW,CAACC,QAAQ,CAACG,OAAO;AACrC;AAEO,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,gBAAG,IAAAE,WAAI,EAAC,SAASF,aAAaA,CAAC;EACvDG;AAGF,CAAC,EAAE;EACD,MAAMC,MAAM,GAAGD,OAAO,CAACE,KAAK,CAAC,CAACb,UAAU,CAAC;EACzC,oBACE,IAAAD,WAAA,CAAAe,GAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,GAAI;IAACC,aAAa,EAAC,MAAM;IAAAC,QAAA,EAC1CR,MAAM,CAACS,GAAG,CAAC,CAACnB,GAAG,EAAEoB,CAAC,kBACjB,IAAAvB,WAAA,CAAAe,GAAA,EAACjB,YAAA,CAAAkB;IACC;IACA;IACA;IAAA;MAEAC,KAAK,EAAE,CACLC,MAAM,CAACM,GAAG,EACV;QACEC,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAGxB,GAAG,GAAG,GAAG,GAAI,EAAE,CAAC;QACrCyB,eAAe,EAAE1B,QAAQ,CAACC,GAAG;MAC/B,CAAC;IACD,GAPG,IAAIoB,CAAC,EAQX,CACF;EAAC,CACE,CAAC;AAEX,CAAC,CAAC;AAEF,MAAML,MAAM,GAAGW,uBAAU,CAACC,MAAM,CAAC;EAC/BX,GAAG,EAAE;IACHY,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,UAAU;IACtBC,GAAG,EAAE,CAAC;IACNR,MAAM,EAAE,EAAE;IACVS,SAAS,EAAE;EACb,CAAC;EACDV,GAAG,EAAE;IACHW,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,CAAC;IACXC,YAAY,EAAE,CAAC;IACfC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_sharedUi","_JsTopController","_jsxRuntime","busyColor","pct","macOSColors","semantic","error","warning","success","JsTopHudOverlay","enabled","setEnabled","useState","JsTopController","isEnabled","snapshot","setSnapshot","useEffect","subscribeEnabled","subscribe","top","rows","find","r","api","jsxs","View","style","styles","pill","pointerEvents","children","Text","busy","color","busyPct","toFixed","jsx","label","numberOfLines","StyleSheet","create","position","left","flexDirection","alignItems","gap","backgroundColor","night","buttonSurface","borderWidth","borderColor","border","borderRadius","paddingHorizontal","paddingVertical","maxWidth","fontSize","fontWeight","fontVariant","textSecondary","flexShrink"],"sourceRoot":"../../../../src","sources":["js-top/components/JsTopHudOverlay.tsx"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAA4D,IAAAI,WAAA,GAAAJ,OAAA;AAX5D;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASK,SAASA,CAACC,GAAW,EAAU;EACtC,IAAIA,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACC,KAAK;EAChD,IAAIH,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACE,OAAO;EAClD,OAAOH,qBAAW,CAACC,QAAQ,CAACG,OAAO;AACrC;AAEO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAMC,gCAAe,CAACC,SAAS,CAAC,CAAC,CAAC;EACzE,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAJ,eAAQ,EAAuB,IAAI,CAAC;EAEpE,IAAAK,gBAAS,EAAC,MAAMJ,gCAAe,CAACK,gBAAgB,CAACP,UAAU,CAAC,EAAE,EAAE,CAAC;EAEjE,IAAAM,gBAAS,EAAC,MAAM;IACd,IAAI,CAACP,OAAO,EAAE;MACZM,WAAW,CAAC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AE,CAAC;IACdC,WAAW,EAAEH,eAAK,CAACd,KAAK,CAACkB,MAAM;IAC/BC,YAAY,EAAE,CAAC;IACfC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE,CAAC;IAClBC,QAAQ,EAAE;EACZ,CAAC;EACDvB,IAAI,EAAE;IACJwB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,WAAW,EAAE,CAAC,cAAc;EAC9B,CAAC;EACDrB,KAAK,EAAE;IACLJ,KAAK,EAAEc,eAAK,CAACd,KAAK,CAAC0B,aAAa;IAChCH,QAAQ,EAAE,EAAE;IACZI,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_sharedUi","_JsTopController","_BusySparkline","_TaskTable","_TaskDetailView","_jsxRuntime","busyColor","pct","macOSColors","semantic","error","warning","success","freezeColor","worstMs","diagnose","s","culprit","rows","find","r","api","pctOfBusy","busyPct","color","icon","text","label","Math","round","freezeSummary","count","JsTopModal","visible","onClose","onBack","onMinimize","initialModalState","minimizeTargetPosition","remoteSnapshot","remoteActions","embedded","isRemote","undefined","localSnapshot","setLocalSnapshot","useState","useEffect","JsTopController","subscribe","snapshot","actions","useMemo","pause","resume","clear","paused","hasData","length","detailKey","setDetailKey","onSelectRow","useCallback","row","key","detail","getOriginDetail","inDetail","headerContent","jsxs","ModalHeader","children","jsx","Navigation","Content","title","noMargin","View","style","styles","titleRow","Activity","size","Text","busyPill","borderColor","busyText","toFixed","Actions","TouchableOpacity","onPress","actionBtn","actionBtnActive","accessibilityLabel","Play","night","accent","Pause","textSecondary","disabled","actionBtnDisabled","Trash2","textTertiary","body","TaskDetailView","waiting","Fragment","d","diagnosis","borderLeftColor","diagnosisIcon","diagnosisText","sparklineRow","sparklineCaption","BusySparkline","history","busyHistory","tiers","bridge","tierBanner","TaskTable","embeddedRoot","embeddedHeader","JsModal","header","showToggleButton","customContent","persistenceKey","enablePersistence","initialMode","disableScrollWrapper","StyleSheet","create","flexDirection","alignItems","gap","fontSize","fontWeight","borderWidth","borderRadius","paddingHorizontal","paddingVertical","fontVariant","width","height","backgroundColor","buttonSurface","border","justifyContent","accentSoft","accentBorderStrong","opacity","flex","minHeight","marginHorizontal","marginTop","surface","borderLeftWidth","lineHeight","letterSpacing","paddingBottom","textAlign","position","top","left","right","bottom","background","base","borderBottomWidth","borderBottomColor","default"],"sourceRoot":"../../../../src","sources":["js-top/components/JsTopModal.tsx"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AAaA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAAkD,IAAAO,WAAA,GAAAP,OAAA;AApClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiDA,SAASQ,SAASA,CAACC,GAAW,EAAU;EACtC,IAAIA,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACC,KAAK;EAChD,IAAIH,GAAG,IAAI,EAAE,EAAE,OAAOC,qBAAW,CAACC,QAAQ,CAACE,OAAO;EAClD,OAAOH,qBAAW,CAACC,QAAQ,CAACG,OAAO;AACrC;;AAEA;AACA,SAASC,WAAWA,CAACC,OAAe,EAAU;EAC5C,OAAOA,OAAO,IAAI,GAAG,GACjBN,qBAAW,CAACC,QAAQ,CAACC,KAAK,GAC1BF,qBAAW,CAACC,QAAQ,CAACE,OAAO;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASI,QAAQA,CAACC,CAAgB,EAIhC;EACA,MAAMC,OAAO,GAAGD,CAAC,CAACE,IAAI,CAACC,IAAI,CACxBC,CAAC,IAAKA,CAAC,CAACC,GAAG,K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