{"version":3,"file":"index.mjs","names":["MONO","SANS","roundedToken","sharedGlobal","CELL","HEAD_CELL","MONO","MONO","SANS","SourceMapConsumer"],"sources":["../../../../nice-devtools-core/build/index.mjs","../../../../nice-ui/src/size.ts","../../../../nice-ui/src/errors.ts","../../../../nice-ui/src/theme/roles.ts","../../../../nice-ui/src/theme/cssVariables.ts","../../../../nice-ui/src/theme/defaultTheme.ts","../../../../nice-ui/src/tokens.ts","../../../../nice-ui/src/components/Tooltip.tsx","../../../../nice-ui/src/components/Chip.tsx","../../../../nice-ui/src/components/PanelChrome.tsx","../../../../nice-ui/src/components/ListDetailSplit.tsx","../../../../nice-ui/src/styles.ts","../../../../nice-ui/src/components/PanelShell.tsx","../../../../nice-ui/src/components/SectionLabel.tsx","../../../../nice-ui/src/list.ts","../../../../nice-ui/src/components/VirtualList.tsx","../../../../nice-ui/src/theme/NiceUiThemeProvider.tsx","../../../../nice-devtools-shared/src/components/FollowLatestToggles.tsx","../../../../nice-devtools-shared/src/format.ts","../../../../nice-devtools-shared/src/json.tsx","../../../../nice-devtools-shared/src/marks.tsx","../../../../nice-devtools-shared/src/prefs.ts","../../../../nice-devtools-shared/src/styles.ts","../../../../nice-devtools-shared/src/traffic/components/LaneBreakdownTable.tsx","../../../../nice-devtools-shared/src/traffic/components/LargestFramesList.tsx","../../../../nice-devtools-shared/src/traffic/components/LinkBreakdownTable.tsx","../../../../nice-devtools-shared/src/traffic/components/RateSparkline.tsx","../../../../nice-devtools-shared/src/traffic/components/TrafficStatTiles.tsx","../../../../nice-devtools-shared/src/traffic/components/TrafficPanel.tsx","../../../src/devtools/browser/components/DetailSection.tsx","../../../src/devtools/core/devtools_colors.ts","../../../src/devtools/browser/components/NiceErrorDisplay.tsx","../../../src/devtools/browser/devtools_storage.ts","../../../../../node_modules/source-map-js/lib/base64.js","../../../../../node_modules/source-map-js/lib/base64-vlq.js","../../../../../node_modules/source-map-js/lib/util.js","../../../../../node_modules/source-map-js/lib/array-set.js","../../../../../node_modules/source-map-js/lib/mapping-list.js","../../../../../node_modules/source-map-js/lib/source-map-generator.js","../../../../../node_modules/source-map-js/lib/binary-search.js","../../../../../node_modules/source-map-js/lib/quick-sort.js","../../../../../node_modules/source-map-js/lib/source-map-consumer.js","../../../../../node_modules/source-map-js/lib/source-node.js","../../../../../node_modules/source-map-js/source-map.js","../../../src/devtools/browser/components/sourceMapResolver.ts","../../../src/devtools/browser/components/StackTraceSection.tsx","../../../src/devtools/browser/components/ActionErrorDisplay.tsx","../../../src/devtools/browser/components/Chip.tsx","../../../src/devtools/browser/components/Icon.tsx","../../../src/devtools/browser/components/DomainChip.tsx","../../../src/devtools/browser/components/HandlerChips.tsx","../../../src/devtools/browser/components/OptionalTooltip.tsx","../../../src/devtools/browser/components/utils.ts","../../../src/devtools/browser/components/RunningTimer.tsx","../../../src/devtools/browser/components/CallStackSection.tsx","../../../src/devtools/browser/components/ChildDispatchChips.tsx","../../../src/devtools/browser/components/MetaSection.tsx","../../../src/devtools/browser/components/OriginChip.tsx","../../../src/devtools/browser/components/RoutingSection.tsx","../../../src/devtools/browser/components/action_detail/ActionDetailPanel.tsx","../../../src/devtools/browser/components/action_list/IoTooltipContent.tsx","../../../src/devtools/browser/components/action_list/ActionInputAndOutputChip.tsx","../../../src/devtools/browser/components/action_list/ActionEntryRow.tsx","../../../src/devtools/browser/components/action_list/ActionList.tsx","../../../src/devtools/browser/NiceActionDevtools.tsx","../../../src/devtools/browser/remoteActionDevtools.ts"],"sourcesContent":["import { a as DEVTOOLS_RELAY_PROXY_PATH, c as DEVTOOLS_WINDOW_ENTRY_PATH, d as devtoolsWindowUrl, f as parseCliDevtoolsStatus, h as relayUrlFromStatus, i as DEVTOOLS_RELAY_DEFAULT_PORT, l as DEVTOOLS_WINDOW_PATH, m as readDevtoolsWindowParams, n as DEVTOOLS_ENSURE_PATH, o as DEVTOOLS_RELAY_ROLE_PARAM, p as parseDevtoolsRelayRole, r as DEVTOOLS_HANDOFF_PATH, s as DEVTOOLS_STATUS_PATH, t as DEVTOOLS_DISCOVERY_BASE, u as defaultLocalRelayUrl } from \"./discoveryProtocol-8NH1IKnS.mjs\";\nimport { REMOTE_SESSION_ENDED_CLOSE_CODE } from \"./remote/remoteSessionUrl.mjs\";\n//#region src/env.ts\nfunction readViteEnv() {\n\ttry {\n\t\treturn import.meta.env;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction readNodeEnv() {\n\ttry {\n\t\treturn process.env.NODE_ENV;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* Whether the devtools should be active.\n*\n* Gates the app-side producers — the devtools bridge and the launcher button that\n* opens the window. (The window page itself is already a dev-only artifact.)\n*\n* Detection order: Vite's `import.meta.env`, then `process.env.NODE_ENV`, then —\n* if neither is resolvable (e.g. unbundled browser ESM) — default to enabled so\n* the devtools never silently vanish. Real production builds always resolve one\n* of the first two and correctly get `false`.\n*\n* `forceEnable` short-circuits to `true` for consumers who want the devtools in\n* production builds as well.\n*/\nfunction isDevtoolsEnabled(forceEnable) {\n\tif (forceEnable === true) return true;\n\tconst viteEnv = readViteEnv();\n\tif (viteEnv != null) {\n\t\tif (typeof viteEnv.DEV === \"boolean\") return viteEnv.DEV;\n\t\tif (typeof viteEnv.MODE === \"string\") return viteEnv.MODE !== \"production\";\n\t}\n\tconst nodeEnv = readNodeEnv();\n\tif (nodeEnv != null) return nodeEnv !== \"production\";\n\treturn true;\n}\n//#endregion\n//#region src/timing/unrefTimer.ts\n/**\n* Detach a pending timer from the event loop so it never, by itself, keeps a Node process (or a\n* test runner) alive — a no-op in browsers and Workers, where a timer handle is a plain `number`\n* with no `unref`.\n*\n* This is a local copy of `@nice-code/util`'s `unrefTimer`: `@nice-code/devtools-core` is\n* deliberately **zero-runtime-dependency** (a server/DO uses it React-free *and* dependency-free),\n* so it cannot import the shared one. Typing the parameter as the union of both cross-environment\n* timer shapes (`NodeJS.Timeout` carries `unref`, a DOM `number` does not) lets every `setTimeout`\n* handle pass without a cast, and the `typeof` narrows to the only arm that has the method.\n*/\nfunction unrefTimer(timer) {\n\tif (typeof timer !== \"number\") timer.unref?.();\n}\n//#endregion\n//#region src/remote/clone.ts\nfunction jsonSafeCopy(value, seen) {\n\tif (value === null) return null;\n\tconst type = typeof value;\n\tif (type === \"function\" || type === \"symbol\" || type === \"bigint\" || type === \"undefined\") return;\n\tif (type !== \"object\") return value;\n\tconst obj = value;\n\tif (seen.has(obj)) return \"[Circular]\";\n\tseen.add(obj);\n\tif (Array.isArray(obj)) return obj.map((item) => jsonSafeCopy(item, seen));\n\tif (obj instanceof Error) return {\n\t\tname: obj.name,\n\t\tmessage: obj.message,\n\t\tstack: obj.stack\n\t};\n\tconst out = {};\n\tfor (const [key, item] of Object.entries(obj)) {\n\t\tconst copied = jsonSafeCopy(item, seen);\n\t\tif (copied !== void 0) out[key] = copied;\n\t}\n\treturn out;\n}\n/**\n* Clone a value into a form guaranteed to survive the transport's structured\n* clone. Tries the fast/faithful `structuredClone` first (keeps Dates, Maps,\n* typed arrays, Errors); on failure falls back to a cycle-safe JSON copy that\n* drops functions and other non-cloneables rather than throwing.\n*/\nfunction toCloneable(value) {\n\ttry {\n\t\treturn structuredClone(value);\n\t} catch {\n\t\treturn jsonSafeCopy(value, /* @__PURE__ */ new WeakSet());\n\t}\n}\n//#endregion\n//#region src/remote/protocol.ts\nconst CHANNEL_PREFIX = \"__nice_devtools__:\";\n/** Bumped on any incompatible envelope change; mismatched peers ignore each other gracefully. */\nconst DEVTOOLS_PROTOCOL_VERSION = 3;\n/** Namespaced BroadcastChannel name for an app key, so two apps on one origin don't cross streams. */\nfunction devtoolsChannelName(key) {\n\treturn `${CHANNEL_PREFIX}${key}`;\n}\n//#endregion\n//#region src/remote/DevtoolsBridge.ts\n/**\n* Build a sample-scope from a `TrafficMetricsCore` — forwards its raw sample\n* stream so a window can replay them into its own core (full window-select\n* fidelity), and backfills a fresh window with the core's accumulated state so\n* its MAX totals match the host's since-connect numbers. `clear` from the window\n* clears the host core too.\n*/\nfunction trafficSampleScope(scope, core) {\n\treturn {\n\t\tscope,\n\t\tobserve: (onSample) => core.observe(onSample),\n\t\tgetBackfill: () => core.exportState(),\n\t\tapplyCommand: (command) => {\n\t\t\tif (command.type === \"clear\") core.clear();\n\t\t}\n\t};\n}\n/** Coalesce snapshot re-pushes to at most one per this interval, per scope. */\nconst SNAPSHOT_THROTTLE_MS = 100;\n/**\n* ## The liveness contract, in one place\n*\n* Three cadences, split across this file and `DevtoolsWindowClient`, decide whether a producer is\n* drawn as live. They are only correct as a *set*, so they are written down together:\n*\n* | | value | owner |\n* | --- | --- | --- |\n* | window re-`hello` | 10s (`HEARTBEAT_MS`) | `DevtoolsWindowClient` |\n* | bridge `ready` while attached | 5s ({@link DEFAULT_HEARTBEAT_MS}) | here |\n* | bridge detach after silence | 45s ({@link DEFAULT_ATTACH_TIMEOUT_MS}) | here |\n* | window dims a client | 15s (`STALE_MS`) | `DevtoolsWindowClient` |\n* | window drops a client | 30s (`DROP_MS`) | `DevtoolsWindowClient` |\n*\n* The two rules that keep it honest:\n*\n* 1. **`ready` cadence < `STALE_MS`.** An attached bridge speaks every 5s, so a window never dims a\n*    producer that is still talking to it. One dropped frame is not a symptom.\n* 2. **`attachTimeoutMs` > window re-`hello` cadence, by several beats.** Detaching is *correct* when\n*    nobody is looking — it is what lets a Durable Object hibernate — but a detached bridge goes\n*    completely silent, and the window then drops it after `DROP_MS` and redraws it as a grey\n*    \"not reporting\" placeholder. So the timeout must absorb ordinary jitter (a GC pause, a paused\n*    debugger, a slow tab) rather than trip on it. Four missed hellos, not two.\n*\n* What it deliberately does **not** try to do is out-wait a *backgrounded* window: a browser throttles\n* a hidden page's timers to ~once a minute and may freeze it outright, so no fixed timeout survives\n* that, and widening this one far enough to try would pin a DO awake for minutes after the last look.\n* Detaching there is the right answer. Recovery is an *event*, not a timeout — `DevtoolsWindowClient`\n* re-`hello`s the moment its page becomes visible again, which re-attaches every bridge in one\n* round-trip. Change one of these numbers and re-read this block.\n*/\n/** Detach after this much silence from every window. Four missed window hellos (10s each), plus slack. */\nconst DEFAULT_ATTACH_TIMEOUT_MS = 45e3;\n/** `ready` cadence while attached. Must stay below the window's `STALE_MS` (15s). */\nconst DEFAULT_HEARTBEAT_MS = 5e3;\nfunction randomId$1() {\n\treturn `c_${Math.random().toString(36).slice(2, 10)}`;\n}\n/**\n* The host side of the standalone-devtools link. Register the app's devtools\n* cores as scopes, `start()`, and the bridge streams them to any attached\n* window, tagged with this client's identity so a multi-client window can tell\n* clients apart and target commands.\n*\n* Efficiency: the bridge does **no** projection work until a window actually\n* attaches (a `hello` arrives), and detaches again after `attachTimeoutMs` of\n* silence — so an idle app with no devtools window open pays nothing (notably it\n* never clones a realm's `viewState`). Same-origin `BroadcastChannel` never\n* delivers a message to its own sender, so the bridge only sees window→host\n* frames.\n*/\nvar DevtoolsBridge = class {\n\t_transport;\n\t_snapshotScopes = /* @__PURE__ */ new Map();\n\t_sampleScopes = /* @__PURE__ */ new Map();\n\t_clientId;\n\t_getLabel;\n\t_env;\n\t_kind;\n\t_coordEnvId;\n\t_streamContents;\n\t_attachTimeoutMs;\n\t_heartbeatMs;\n\t_allowRemoteCommands;\n\t_transportUnsub = null;\n\t_started = false;\n\t_attached = false;\n\t_lastHelloAt = 0;\n\t_attachListeners = /* @__PURE__ */ new Set();\n\t_scopeUnsubs = [];\n\t_pending = /* @__PURE__ */ new Map();\n\t_knownConsumers = /* @__PURE__ */ new Set();\n\t_accent = null;\n\t_accentListeners = /* @__PURE__ */ new Set();\n\t/** The single while-attached timer: each tick either detaches, or sends `ready`. */\n\t_pulseTimer = null;\n\tconstructor(transport, options = {}) {\n\t\tthis._transport = transport;\n\t\tthis._clientId = options.clientId ?? randomId$1();\n\t\tthis._getLabel = options.getLabel ?? (() => this._clientId);\n\t\tthis._env = options.env;\n\t\tthis._kind = options.kind;\n\t\tthis._coordEnvId = options.coordEnvId;\n\t\tthis._streamContents = options.streamContents;\n\t\tthis._attachTimeoutMs = options.attachTimeoutMs ?? DEFAULT_ATTACH_TIMEOUT_MS;\n\t\tthis._heartbeatMs = options.heartbeatMs ?? DEFAULT_HEARTBEAT_MS;\n\t\tthis._allowRemoteCommands = options.allowRemoteCommands ?? false;\n\t}\n\t/** Whether a devtools window is currently listening (a `hello` inside `attachTimeoutMs`). */\n\tget attached() {\n\t\treturn this._attached;\n\t}\n\t/** This host's id — the one a window addresses commands to, and keys its per-client mirrors by. */\n\tget clientId() {\n\t\treturn this._clientId;\n\t}\n\t/**\n\t* This host's current label, exactly as the window shows it in its client switcher and topology.\n\t*\n\t* Read live rather than captured, because it refines: a runtime coordinate's `perId` only exists\n\t* after the handshake. An app that renders its own identity (a \"connected\" chip, say) therefore has\n\t* to re-read this, not remember it.\n\t*/\n\tgetLabel() {\n\t\treturn this._getLabel();\n\t}\n\t/**\n\t* Observe {@link attached}. An app renders its in-page dock only while NOTHING is attached, so the\n\t* same devtools never render twice (dock + window) — the panels drive the same live cores, and a\n\t* hidden dock also stops paying for its own rendering. Fires on every transition; returns an\n\t* unsubscribe.\n\t*/\n\tonAttachedChange(listener) {\n\t\tthis._attachListeners.add(listener);\n\t\treturn () => this._attachListeners.delete(listener);\n\t}\n\t/**\n\t* The accent colour the devtools window has assigned this client — the hue of the lane it is shown\n\t* in when compared side by side with other clients — or `null` when it has none. An app renders it\n\t* on its own \"connected\" chip so a tab's chip matches its lane in the window.\n\t*/\n\tget accent() {\n\t\treturn this._accent;\n\t}\n\t/** Observe {@link accent}. Fires on every change; returns an unsubscribe. */\n\tonAccentChange(listener) {\n\t\tthis._accentListeners.add(listener);\n\t\treturn () => this._accentListeners.delete(listener);\n\t}\n\taddSnapshotScope(scope) {\n\t\tthis._snapshotScopes.set(scope.scope, scope);\n\t\tif (this._attached) this._wireSnapshotScope(scope);\n\t}\n\taddSampleScope(scope) {\n\t\tthis._sampleScopes.set(scope.scope, scope);\n\t\tif (this._attached) this._wireSampleScope(scope);\n\t}\n\tstart() {\n\t\tif (this._started) return;\n\t\tthis._started = true;\n\t\tthis._transportUnsub = this._transport.onMessage((raw, origin) => this._onMessage(raw, origin));\n\t}\n\tstop() {\n\t\tthis._detach();\n\t\tthis._transportUnsub?.();\n\t\tthis._transportUnsub = null;\n\t\tthis._started = false;\n\t\tthis._transport.close();\n\t}\n\t_identity() {\n\t\treturn {\n\t\t\tclientId: this._clientId,\n\t\t\tlabel: this._getLabel(),\n\t\t\t...this._env != null ? { env: this._env } : {},\n\t\t\t...this._kind != null ? { kind: this._kind } : {},\n\t\t\t...this._coordEnvId != null ? { coordEnvId: this._coordEnvId } : {},\n\t\t\t...this._streamContents != null ? { streamContents: this._streamContents } : {},\n\t\t\tallowRemoteCommands: this._allowRemoteCommands\n\t\t};\n\t}\n\t_attach() {\n\t\tif (this._attached) return;\n\t\tthis._attached = true;\n\t\tfor (const scope of this._snapshotScopes.values()) this._wireSnapshotScope(scope);\n\t\tfor (const scope of this._sampleScopes.values()) this._wireSampleScope(scope);\n\t\tthis._pulseTimer = setInterval(() => this._pulse(), this._heartbeatMs);\n\t\tunrefTimer(this._pulseTimer);\n\t\tthis._emitAttached();\n\t}\n\t/**\n\t* One tick while attached: reap first, then beat. Detaching reclaims the projection cost and (on a\n\t* Durable Object) the ability to hibernate — so a window that has stopped saying `hello` stops\n\t* being paid for, without ever having to close its socket.\n\t*/\n\t_pulse() {\n\t\tif (Date.now() - this._lastHelloAt > this._attachTimeoutMs) {\n\t\t\tthis._detach();\n\t\t\treturn;\n\t\t}\n\t\tthis._sendReady();\n\t}\n\t_detach() {\n\t\tif (!this._attached) return;\n\t\tthis._attached = false;\n\t\tfor (const unsub of this._scopeUnsubs) unsub();\n\t\tthis._scopeUnsubs.length = 0;\n\t\tfor (const timer of this._pending.values()) clearTimeout(timer);\n\t\tthis._pending.clear();\n\t\tthis._knownConsumers.clear();\n\t\tif (this._pulseTimer != null) clearInterval(this._pulseTimer);\n\t\tthis._pulseTimer = null;\n\t\tthis._emitAttached();\n\t}\n\t_emitAttached() {\n\t\tfor (const listener of this._attachListeners) listener(this._attached);\n\t}\n\t_wireSnapshotScope(scope) {\n\t\tthis._scopeUnsubs.push(scope.subscribe(() => this._scheduleSnapshot(scope.scope)));\n\t}\n\t_wireSampleScope(scope) {\n\t\tthis._scopeUnsubs.push(scope.observe((sample) => this._transport.post({\n\t\t\tt: \"sample\",\n\t\t\tv: 3,\n\t\t\tfrom: this._identity(),\n\t\t\tscope: scope.scope,\n\t\t\tsample\n\t\t})));\n\t}\n\t_scheduleSnapshot(scopeName) {\n\t\tif (this._pending.has(scopeName)) return;\n\t\tconst timer = setTimeout(() => {\n\t\t\tthis._pending.delete(scopeName);\n\t\t\tthis._postSnapshot(scopeName);\n\t\t}, SNAPSHOT_THROTTLE_MS);\n\t\tunrefTimer(timer);\n\t\tthis._pending.set(scopeName, timer);\n\t}\n\t_postSnapshot(scopeName) {\n\t\tconst scope = this._snapshotScopes.get(scopeName);\n\t\tif (scope == null) return;\n\t\tthis._transport.post({\n\t\t\tt: \"snapshot\",\n\t\t\tv: 3,\n\t\t\tfrom: this._identity(),\n\t\t\tscope: scopeName,\n\t\t\tsnapshot: toCloneable(scope.getSnapshot())\n\t\t});\n\t}\n\t_sendReady() {\n\t\tthis._transport.post({\n\t\t\tt: \"ready\",\n\t\t\tv: 3,\n\t\t\tfrom: this._identity(),\n\t\t\tscopes: [...this._snapshotScopes.keys(), ...this._sampleScopes.keys()]\n\t\t});\n\t}\n\t/**\n\t* Tell the sending window its command was refused. Posted on the shared transport like every other\n\t* host message — it fans out to all carriers, and the addressed window picks it up by `to`. That\n\t* costs one small frame to windows that did not ask, and buys not needing a reply path back down a\n\t* specific carrier, which the fanout does not offer.\n\t*/\n\t_sendCommandRejected(consumerId, scope, reason) {\n\t\tthis._transport.post({\n\t\t\tt: \"command_rejected\",\n\t\t\tv: 3,\n\t\t\tfrom: this._identity(),\n\t\t\tto: consumerId,\n\t\t\tscope,\n\t\t\treason\n\t\t});\n\t}\n\t_onMessage(message, origin) {\n\t\tif (message == null || typeof message !== \"object\") return;\n\t\tif (message.v !== 3) return;\n\t\tif (message.t === \"hello\") {\n\t\t\tthis._lastHelloAt = Date.now();\n\t\t\tthis._attach();\n\t\t\tthis._sendReady();\n\t\t\tif (!this._knownConsumers.has(message.consumerId)) {\n\t\t\t\tthis._knownConsumers.add(message.consumerId);\n\t\t\t\tfor (const scopeName of this._snapshotScopes.keys()) this._postSnapshot(scopeName);\n\t\t\t\tfor (const scope of this._sampleScopes.values()) {\n\t\t\t\t\tif (scope.getBackfill == null) continue;\n\t\t\t\t\tthis._transport.post({\n\t\t\t\t\t\tt: \"backfill\",\n\t\t\t\t\t\tv: 3,\n\t\t\t\t\t\tfrom: this._identity(),\n\t\t\t\t\t\tscope: scope.scope,\n\t\t\t\t\t\tstate: toCloneable(scope.getBackfill())\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (message.t === \"command\") {\n\t\t\tif (message.to !== this._clientId) return;\n\t\t\tif (origin === \"remote\" && !this._allowRemoteCommands) {\n\t\t\t\tthis._sendCommandRejected(message.consumerId, message.scope, \"remote_commands_disabled\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._snapshotScopes.get(message.scope)?.applyCommand?.(message.command);\n\t\t\tthis._sampleScopes.get(message.scope)?.applyCommand?.(message.command);\n\t\t} else if (message.t === \"accent\") {\n\t\t\tif (message.to !== this._clientId) return;\n\t\t\tif (this._accent === message.color) return;\n\t\t\tthis._accent = message.color;\n\t\t\tfor (const listener of this._accentListeners) listener(this._accent);\n\t\t}\n\t}\n};\n//#endregion\n//#region src/host/clientHost.ts\n/**\n* Build the frontend devtools host (devtools-revamp Wave D) — promotes the wiring\n* every app used to hand-roll around `DevtoolsBridge` into one reusable seam.\n*\n* ```ts\n* createClientDevtoolsHost({ transport, getLabel })\n*   .contribute(actionBridgeScope(actionDevtools))\n*   .contribute(realmBridgeScope(realmDevtools).snapshot)\n*   .contributeSample(trafficSampleScope(\"traffic\", trafficDevtools))\n*   .start();\n* ```\n*/\nfunction createClientDevtoolsHost(options) {\n\tconst bridge = new DevtoolsBridge(options.transport, {\n\t\t...options.clientId != null ? { clientId: options.clientId } : {},\n\t\t...options.getLabel != null ? { getLabel: options.getLabel } : {},\n\t\tenv: options.env ?? \"development\",\n\t\tkind: options.kind ?? \"frontend\",\n\t\t...options.attachTimeoutMs != null ? { attachTimeoutMs: options.attachTimeoutMs } : {},\n\t\t...options.allowRemoteCommands != null ? { allowRemoteCommands: options.allowRemoteCommands } : {},\n\t\t...options.streamContents != null ? { streamContents: options.streamContents } : {}\n\t});\n\tconst host = {\n\t\tclientId: bridge.clientId,\n\t\tgetLabel: () => bridge.getLabel(),\n\t\tcontribute(scope) {\n\t\t\tbridge.addSnapshotScope(scope);\n\t\t\treturn host;\n\t\t},\n\t\tcontributeSample(scope) {\n\t\t\tbridge.addSampleScope(scope);\n\t\t\treturn host;\n\t\t},\n\t\tstart() {\n\t\t\tbridge.start();\n\t\t\treturn host;\n\t\t},\n\t\tstop() {\n\t\t\tbridge.stop();\n\t\t},\n\t\tisAttached: () => bridge.attached,\n\t\tonAttachedChange: (listener) => bridge.onAttachedChange(listener),\n\t\tgetAccent: () => bridge.accent,\n\t\tonAccentChange: (listener) => bridge.onAccentChange(listener)\n\t};\n\treturn host;\n}\n//#endregion\n//#region src/host/coordinateIdentity.ts\n/** Read the coordinate now, whether it was handed over directly or behind a getter. */\nfunction resolveCoordinate(source) {\n\treturn (typeof source === \"function\" ? source() : source).coordinate;\n}\n/** First `length` characters, or an em-dash when the id is absent. Labels must stay scannable. */\nfunction elide(id, length) {\n\treturn id != null ? id.slice(0, length) : \"—\";\n}\n/**\n* A **frontend's** client id: the coordinate's `insId`, which `ActionRuntime` mints fresh per boot.\n*\n* Two tabs of one app are two devtools clients — you want to clear one tab's action log without\n* touching the other's — and `insId` is precisely the id that distinguishes them. Falls back to the\n* topology id for an app with no runtime.\n*/\nfunction frontendClientId(coordinate, fallback) {\n\treturn coordinate?.insId ?? fallback;\n}\n/**\n* A **backend's** client id: `envId`, plus `::perId` when the coordinate carries one.\n*\n* Deliberately *not* `insId`, and deliberately not random. A backend restarts constantly in\n* development, and an id that changed per boot would mint a new entry in the devtools window on\n* every restart, leaving the old one to grey out and linger. Keying by identity instead means a\n* bounced dev server **replaces** its own entry.\n*\n* This is the same distinction `RuntimeCoordinate` itself draws: `insId` is per-process-boot,\n* `perId` is the persistent identity. Frontends key by instance; backends key by identity.\n*/\nfunction backendClientId(coordinate, fallback) {\n\tif (coordinate == null) return fallback;\n\treturn coordinate.perId != null ? `${coordinate.envId}::${coordinate.perId}` : coordinate.envId;\n}\n/**\n* A **Durable Object's** client id: `do_` + its persistent id.\n*\n* A DO's runtime is conventionally built with `coordinate.withPersistentId(ctx.id.toString())`, so\n* `perId` already *is* the DO's identity; `ctxId` is the fallback for a DO that didn't. Stable\n* across hibernation wakes either way — a random per-construction id would mint a \"new\" backend in\n* the window on every wake.\n*/\nfunction durableObjectClientId(coordinate, ctxId) {\n\treturn `do_${coordinate?.perId ?? ctxId}`;\n}\n/**\n* A frontend's label: `envId · perId·insId`, elided.\n*\n* Shown in the window's client switcher and topology band — and, by `useDevtoolsClientIdentity`, in\n* the app's own connected chip. The two must match exactly: with three tabs open, that match is the\n* only thing telling you which row is the tab you are looking at.\n*/\nfunction frontendLabel(coordinate) {\n\treturn `${coordinate.envId} · ${elide(coordinate.perId, 6)}·${elide(coordinate.insId, 5)}`;\n}\n/**\n* A backend's label: `envId`, plus an elided `perId` when it has one.\n*\n* No `insId`: a backend's boot instance is noise in a switcher (and for a Durable Object it does not\n* exist). What distinguishes two backends is which service they are, and which DO instance.\n*/\nfunction backendLabel(coordinate) {\n\treturn coordinate.perId != null ? `${coordinate.envId} · ${elide(coordinate.perId, 8)}` : coordinate.envId;\n}\n//#endregion\n//#region src/host/serverScope.types.ts\n/** The scope-name prefix every server-contributed scope shares (`server:realm:<id>`, `server:action:<domain>`). */\nconst SERVER_SCOPE_PREFIX = \"server:\";\n//#endregion\n//#region src/host/RemoteServerDevtoolsCore.ts\nconst EMPTY = {\n\trealms: [],\n\tactions: []\n};\nfunction isServerScopeSnapshot(value) {\n\treturn value != null && typeof value === \"object\" && \"kind\" in value;\n}\n/**\n* Window-side mirror of a backend client's `server:*` scopes (devtools-revamp Wave\n* D, Step 3). A backend's server scopes are dynamic — `server:realm:<id>`,\n* `server:action:<domain>`, one per engine/domain it runs, and they can appear over\n* the client's lifetime — so this discovers them from the client's advertised scope\n* list and subscribes to any it hasn't yet, grouping the snapshots by kind for the\n* panel. Framework-agnostic; the React panel (`NiceServerDevtools`) renders it.\n*/\nvar RemoteServerDevtoolsCore = class {\n\t_byScope = /* @__PURE__ */ new Map();\n\t_subscribedScopes = /* @__PURE__ */ new Set();\n\t_snapshot = EMPTY;\n\t_listeners = /* @__PURE__ */ new Set();\n\tconstructor(client, clientId) {\n\t\tclient.onClients((clients) => {\n\t\t\tconst me = clients.find((entry) => entry.clientId === clientId);\n\t\t\tif (me == null) return;\n\t\t\tfor (const scope of me.scopes) {\n\t\t\t\tif (!scope.startsWith(\"server:\")) continue;\n\t\t\t\tif (this._subscribedScopes.has(scope)) continue;\n\t\t\t\tthis._subscribedScopes.add(scope);\n\t\t\t\tclient.onSnapshot(clientId, scope, (raw) => this._ingest(scope, raw));\n\t\t\t}\n\t\t});\n\t}\n\tgetSnapshot() {\n\t\treturn this._snapshot;\n\t}\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\tlistener(this._snapshot);\n\t\treturn () => {\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\t_ingest(scope, raw) {\n\t\tif (!isServerScopeSnapshot(raw)) return;\n\t\tthis._byScope.set(scope, raw);\n\t\tthis._recompute();\n\t}\n\t_recompute() {\n\t\tconst realms = [];\n\t\tconst actions = [];\n\t\tfor (const snap of this._byScope.values()) if (snap.kind === \"realm\") realms.push(snap);\n\t\telse if (snap.kind === \"action\") actions.push(snap);\n\t\trealms.sort((a, b) => a.label.localeCompare(b.label));\n\t\tactions.sort((a, b) => a.domain.localeCompare(b.domain));\n\t\tthis._snapshot = {\n\t\t\trealms,\n\t\t\tactions\n\t\t};\n\t\tfor (const listener of [...this._listeners]) listener(this._snapshot);\n\t}\n};\n//#endregion\n//#region src/remote/fanoutTransport.ts\nconst DEDUP_LIMIT = 4096;\n/**\n* Combine several {@link IDevtoolsTransport}s into one: every post goes out on all\n* of them, and inbound messages are merged — **de-duplicated** so a message that\n* arrives over more than one carrier is delivered once.\n*\n* The point is spanning both a same-origin `BroadcastChannel` (zero-dependency,\n* same-profile) and a WebSocket relay (cross-partition) at once: a same-profile\n* peer is reachable over both, so without dedup its every message would arrive\n* twice. Each post is tagged with a unique id inside a small envelope; a receiver\n* delivers a given id only the first time it sees it (and drops the echo of its\n* own posts). The envelope is transparent to the underlying carriers, which just\n* ferry opaque messages.\n*\n* ## Origin, and what dedup does to it\n*\n* Each delivery carries the {@link TDevtoolsOrigin} of the carrier it arrived on — this is the\n* component that used to erase that, and the erasure is what let a relay-joined window mutate a\n* producer's state as freely as a local one.\n*\n* Dedup means a message delivered on *both* a local and a remote carrier is tagged with whichever\n* arrived **first**. That is safe in the direction that matters: a message can only race like that\n* if its sender genuinely reaches us both ways, and reaching us locally (same-origin\n* `BroadcastChannel`) already implies running in this origin. So the worst case is a local peer\n* occasionally being *tagged* remote and refused — visible and recoverable. The reverse (a\n* remote-only peer tagged local) would need it to also post the same envelope id on our local\n* carrier, which means it is already inside the origin and has no need of this.\n*/\nfunction createFanoutTransport(initialTransports) {\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst seenOrder = [];\n\tlet counter = 0;\n\tconst transports = [...initialTransports];\n\tconst unsubByTransport = /* @__PURE__ */ new Map();\n\tconst remember = (id) => {\n\t\tif (seen.has(id)) return false;\n\t\tseen.add(id);\n\t\tseenOrder.push(id);\n\t\tif (seenOrder.length > DEDUP_LIMIT) {\n\t\t\tconst evicted = seenOrder.shift();\n\t\t\tif (evicted != null) seen.delete(evicted);\n\t\t}\n\t\treturn true;\n\t};\n\tconst newId = () => `${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2, 8)}`;\n\tconst subscribe = (transport) => {\n\t\tconst carrierOrigin = transport.origin ?? \"local\";\n\t\tconst unsub = transport.onMessage((raw) => {\n\t\t\tif (raw == null || typeof raw !== \"object\") return;\n\t\t\tif (!(\"__fanout\" in raw) || !(\"id\" in raw) || !(\"m\" in raw)) return;\n\t\t\tif (raw.__fanout !== 1) return;\n\t\t\tconst id = raw.id;\n\t\t\tif (typeof id !== \"string\" || !remember(id)) return;\n\t\t\tconst payload = raw.m;\n\t\t\tfor (const listener of [...listeners]) listener(payload, carrierOrigin);\n\t\t});\n\t\tunsubByTransport.set(transport, unsub);\n\t};\n\tfor (const transport of transports) subscribe(transport);\n\treturn {\n\t\tget origin() {\n\t\t\treturn transports.some((t) => t.origin === \"remote\") ? \"remote\" : \"local\";\n\t\t},\n\t\tpost(message) {\n\t\t\tconst id = newId();\n\t\t\tremember(id);\n\t\t\tconst envelope = {\n\t\t\t\t__fanout: 1,\n\t\t\t\tid,\n\t\t\t\tm: message\n\t\t\t};\n\t\t\tfor (const transport of transports) transport.post(envelope);\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\taddTransport(transport) {\n\t\t\ttransports.push(transport);\n\t\t\tsubscribe(transport);\n\t\t\treturn () => {\n\t\t\t\tconst index = transports.indexOf(transport);\n\t\t\t\tif (index >= 0) transports.splice(index, 1);\n\t\t\t\tunsubByTransport.get(transport)?.();\n\t\t\t\tunsubByTransport.delete(transport);\n\t\t\t\ttransport.close();\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tfor (const unsub of unsubByTransport.values()) unsub();\n\t\t\tunsubByTransport.clear();\n\t\t\tlisteners.clear();\n\t\t\tfor (const transport of transports) transport.close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/remote/backendTarget.ts\nconst LOCAL_HOSTS = new Set([\n\t\"localhost\",\n\t\"127.0.0.1\",\n\t\"0.0.0.0\",\n\t\"::1\",\n\t\"[::1]\"\n]);\n/** Whether `hostname` names this machine (loopback) — a plain `ws://` dial to it is fine. */\nfunction isLocalHost(hostname) {\n\tconst host = hostname.toLowerCase();\n\treturn LOCAL_HOSTS.has(host) || host.endsWith(\".localhost\");\n}\n/**\n* Validate and normalize a backend dial URL. Accepts `ws`/`wss` (and coerces `http`→`ws`,\n* `https`→`wss` for a pasted browser URL). **Refuses a plain `ws://` to a non-local host** — an\n* off-machine devtools link must be `wss://` (TLS), because the devtools protocol rides it plain\n* (token-gated, not encrypted at the protocol layer). Returns whether the target is remote so the\n* caller can badge it.\n*/\nfunction normalizeBackendDialUrl(raw) {\n\tconst trimmed = raw.trim();\n\tif (trimmed === \"\") return {\n\t\tok: false,\n\t\treason: \"enter a backend WebSocket URL\"\n\t};\n\tlet url;\n\ttry {\n\t\turl = new URL(trimmed);\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"not a valid URL\"\n\t\t};\n\t}\n\tif (url.protocol === \"http:\") url.protocol = \"ws:\";\n\telse if (url.protocol === \"https:\") url.protocol = \"wss:\";\n\tif (url.protocol !== \"ws:\" && url.protocol !== \"wss:\") return {\n\t\tok: false,\n\t\treason: \"URL must be ws:// or wss://\"\n\t};\n\tconst isRemote = !isLocalHost(url.hostname);\n\tif (isRemote && url.protocol === \"ws:\") return {\n\t\tok: false,\n\t\treason: \"a remote backend must use wss:// — a plain ws:// devtools link off this machine is refused\"\n\t};\n\treturn {\n\t\tok: true,\n\t\turl: url.toString(),\n\t\tisRemote\n\t};\n}\n//#endregion\n//#region src/remote/webSocketTransport.ts\n/**\n* An {@link IDevtoolsTransport} over a WebSocket, for reaching a devtools **relay**\n* that bridges the browser storage partitions `BroadcastChannel` cannot — a\n* private window, another browser profile, another browser, even another device on\n* the LAN. Buffers posts until the socket opens and auto-reconnects with backoff,\n* so a not-yet-started (or restarted) relay just means messages queue briefly\n* rather than error. Frames are JSON. No-op where WebSocket is unavailable (SSR).\n*\n* Pair with {@link createFanoutTransport} so same-origin windows keep working over\n* BroadcastChannel while cross-partition clients ride the relay.\n*/\nfunction createWebSocketTransport(url, options = {}) {\n\tconst origin = options.origin ?? \"local\";\n\tif (typeof WebSocket === \"undefined\") return {\n\t\tpost: () => {},\n\t\tonMessage: () => () => {},\n\t\tclose: () => {},\n\t\torigin\n\t};\n\tconst reconnectMinMs = options.reconnectMinMs ?? 500;\n\tconst reconnectMaxMs = options.reconnectMaxMs ?? 8e3;\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst queue = [];\n\tlet socket = null;\n\tlet closed = false;\n\tlet backoff = reconnectMinMs;\n\tlet reconnectTimer = null;\n\tconst report = (status) => {\n\t\toptions.onStatus?.(status.status);\n\t\toptions.onDetailedStatus?.(status);\n\t};\n\tconst scheduleReconnect = () => {\n\t\tif (closed || reconnectTimer != null) return;\n\t\treconnectTimer = setTimeout(() => {\n\t\t\treconnectTimer = null;\n\t\t\tbackoff = Math.min(backoff * 2, reconnectMaxMs);\n\t\t\tconnect();\n\t\t}, backoff);\n\t};\n\tconst connect = () => {\n\t\tif (closed) return;\n\t\tlet ws;\n\t\ttry {\n\t\t\tws = new WebSocket(url);\n\t\t} catch {\n\t\t\tscheduleReconnect();\n\t\t\treturn;\n\t\t}\n\t\tsocket = ws;\n\t\tlet down = false;\n\t\tlet opened = false;\n\t\tconst markDown = (detail) => {\n\t\t\tif (down) return;\n\t\t\tdown = true;\n\t\t\tws.onopen = null;\n\t\t\tws.onmessage = null;\n\t\t\tws.onclose = null;\n\t\t\tws.onerror = null;\n\t\t\tif (socket === ws) socket = null;\n\t\t\treport({\n\t\t\t\tstatus: \"closed\",\n\t\t\t\twasOpen: opened,\n\t\t\t\t...detail?.code != null ? { code: detail.code } : {},\n\t\t\t\t...detail?.reason != null && detail.reason !== \"\" ? { reason: detail.reason } : {}\n\t\t\t});\n\t\t\tscheduleReconnect();\n\t\t};\n\t\tws.onopen = () => {\n\t\t\topened = true;\n\t\t\tbackoff = reconnectMinMs;\n\t\t\treport({ status: \"open\" });\n\t\t\tconst pending = queue.splice(0, queue.length);\n\t\t\tfor (const frame of pending) ws.send(frame);\n\t\t};\n\t\tws.onmessage = (event) => {\n\t\t\tif (typeof event.data !== \"string\") return;\n\t\t\tlet data;\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse(event.data);\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const listener of [...listeners]) listener(data, origin);\n\t\t};\n\t\tws.onclose = (event) => markDown({\n\t\t\tcode: event?.code,\n\t\t\treason: event?.reason\n\t\t});\n\t\tws.onerror = () => {\n\t\t\tif (ws.readyState === WebSocket.OPEN) {\n\t\t\t\ttry {\n\t\t\t\t\tws.close();\n\t\t\t\t} catch {}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmarkDown();\n\t\t};\n\t};\n\tconnect();\n\treturn {\n\t\torigin,\n\t\tpost(message) {\n\t\t\tconst frame = JSON.stringify(message);\n\t\t\tif (socket != null && socket.readyState === WebSocket.OPEN) {\n\t\t\t\tsocket.send(frame);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tqueue.push(frame);\n\t\t\tif (queue.length > 1e3) queue.shift();\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tclosed = true;\n\t\t\tif (reconnectTimer != null) clearTimeout(reconnectTimer);\n\t\t\treconnectTimer = null;\n\t\t\tlisteners.clear();\n\t\t\ttry {\n\t\t\t\tsocket?.close();\n\t\t\t} catch {}\n\t\t\tsocket = null;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/remote/remoteSession.ts\n/**\n* Build the WebSocket URL to join a relay session room: `<relay>/session/<id>?token&role&env`.\n* Coerces an `http(s)`/`ws(s)` base and enforces `wss://` for a non-local relay (a plain `ws://`\n* session link off-machine is refused — the token rides it, TLS protects it). Throws on a refusal so\n* a misconfigured producer fails loudly rather than dialing in the clear.\n*/\nfunction remoteSessionJoinUrl(session) {\n\tconst base = normalizeBackendDialUrl(session.relayUrl);\n\tif (!base.ok) throw new Error(`invalid devtools relay URL: ${base.reason}`);\n\tconst url = new URL(base.url);\n\turl.pathname = `${url.pathname.replace(/\\/$/, \"\")}/session/${encodeURIComponent(session.sessionId)}`;\n\turl.searchParams.set(\"token\", session.sessionToken);\n\turl.searchParams.set(\"role\", session.role ?? \"producer\");\n\turl.searchParams.set(\"env\", session.env);\n\treturn url.toString();\n}\n/**\n* The carrier a producer adds to its devtools fanout to reach a relay session — or `null` when the\n* session must not be dialed (declared `env: \"production\"`). `null` composes cleanly: the caller\n* filters it out of the fanout, so production silently carries no relay carrier even if this module\n* somehow shipped.\n*\n* It declares `origin: \"remote\"`, which is what makes a producer refuse commands arriving over it\n* ({@link DevtoolsBridge}'s `allowRemoteCommands`). This is the only carrier in the codebase that\n* leaves the machine, so it is the only one that says so — and the tag rides the *carrier*, so no\n* frame arriving on it can present itself as anything else.\n*/\nfunction createRemoteSessionCarrier(session, options) {\n\tif (session.env === \"production\") return null;\n\treturn createWebSocketTransport(remoteSessionJoinUrl(session), {\n\t\t...options,\n\t\torigin: \"remote\"\n\t});\n}\n//#endregion\n//#region src/host/serverHost.ts\nfunction randomId() {\n\treturn `s_${Math.random().toString(36).slice(2, 10)}`;\n}\n/**\n* Build the single server-side devtools host (devtools-revamp Wave D). Framework-\n* agnostic — no React, no browser assumptions — so a plain Bun/Node acceptor or\n* `wrangler dev` can run it. Contribute module scopes, pick sinks, `start()`.\n*\n* ```ts\n* import { createServerDevtoolsHost } from \"@nice-code/devtools-core\";\n* import { realmEngineScope } from \"@nice-code/realm/devtools/server\";\n*\n* // No relay URL: a backend looks for the local relay on its well-known port, and keeps looking\n* // until someone opens devtools and one appears.\n* const host = createServerDevtoolsHost({ name: \"demo\", sinks: [\"console\", \"relay\"], topologyId: \"my-app\" });\n* host.contribute(realmEngineScope(engine, \"demo_board\")).start();\n* ```\n*\n* **Not for a Durable Object.** Both sinks are wrong there: `console` holds an interval timer, and\n* `relay` holds an outbound socket — either one pins the DO awake, so it would bill you for the\n* privilege of measuring its own idle cost. A DO is observed the other way round, by the window\n* dialing *into* it: see `createWireDevtoolsHost` / `createNiceDurableObjectDevtools`.\n*/\nfunction createServerDevtoolsHost(options) {\n\tconst defaultEnabled = typeof process !== \"undefined\" ? process.env.NODE_ENV !== \"production\" : true;\n\tconst enabled = options.enabled ?? defaultEnabled;\n\tconst sinks = options.sinks ?? [\"console\"];\n\tconst summaryEveryMs = options.summaryEveryMs ?? 3e4;\n\tconst logger = options.logger ?? ((line) => console.log(line));\n\tconst format = options.format ?? \"pretty\";\n\tconst name = options.name;\n\tif (!enabled) {\n\t\tconst noop = {\n\t\t\tcontribute: () => noop,\n\t\t\tcontributeSample: () => noop,\n\t\t\tstart: () => noop,\n\t\t\tstop: () => {}\n\t\t};\n\t\treturn noop;\n\t}\n\tconst scopes = [];\n\tconst sampleScopes = [];\n\tconst wantRelay = sinks.includes(\"relay\");\n\tconst wantConsole = sinks.includes(\"console\") && summaryEveryMs > 0;\n\tlet bridge = null;\n\tif (wantRelay) {\n\t\tlet transport;\n\t\tlet env = options.env ?? \"development\";\n\t\tif (options.transport != null) transport = options.transport;\n\t\telse if (options.session != null) {\n\t\t\tenv = options.env ?? options.session.env;\n\t\t\ttransport = createRemoteSessionCarrier({\n\t\t\t\t...options.session,\n\t\t\t\tenv,\n\t\t\t\trole: \"producer\"\n\t\t\t});\n\t\t} else transport = relayTransport(relayUrlFor(options));\n\t\tif (transport != null) bridge = new DevtoolsBridge(transport, {\n\t\t\tclientId: options.clientId ?? randomId(),\n\t\t\tgetLabel: () => name,\n\t\t\tenv,\n\t\t\tkind: \"backend\",\n\t\t\t...options.coordEnvId != null ? { coordEnvId: options.coordEnvId } : {},\n\t\t\t...options.allowRemoteCommands != null ? { allowRemoteCommands: options.allowRemoteCommands } : {}\n\t\t});\n\t}\n\tlet consoleTimer = null;\n\tlet started = false;\n\tfunction flushConsole() {\n\t\tfor (const scope of scopes) {\n\t\t\tif (scope.logSince == null) continue;\n\t\t\tfor (const record of scope.logSince()) logRecord(logger, format, name, record);\n\t\t}\n\t}\n\tconst host = {\n\t\tcontribute(scope) {\n\t\t\tscopes.push(scope);\n\t\t\tif (bridge != null && started) bridge.addSnapshotScope(scope);\n\t\t\treturn host;\n\t\t},\n\t\tcontributeSample(scope) {\n\t\t\tsampleScopes.push(scope);\n\t\t\tif (bridge != null && started) bridge.addSampleScope(scope);\n\t\t\treturn host;\n\t\t},\n\t\tstart() {\n\t\t\tif (started) return host;\n\t\t\tstarted = true;\n\t\t\tif (bridge != null) {\n\t\t\t\tfor (const scope of scopes) bridge.addSnapshotScope(scope);\n\t\t\t\tfor (const scope of sampleScopes) bridge.addSampleScope(scope);\n\t\t\t\tbridge.start();\n\t\t\t}\n\t\t\tif (wantConsole) {\n\t\t\t\tconsoleTimer = setInterval(flushConsole, summaryEveryMs);\n\t\t\t\tunrefTimer(consoleTimer);\n\t\t\t}\n\t\t\treturn host;\n\t\t},\n\t\tstop() {\n\t\t\tstarted = false;\n\t\t\tif (consoleTimer != null) clearInterval(consoleTimer);\n\t\t\tconsoleTimer = null;\n\t\t\tbridge?.stop();\n\t\t\tbridge = null;\n\t\t}\n\t};\n\treturn host;\n}\n/**\n* The relay URL this host should dial: what it was told, or the local relay on its well-known port.\n*\n* The default is what lets a backend join the devtools window with no configuration at all — the\n* same promise the Vite plugin makes to frontends. It is safe because the `\"relay\"` sink is opt-in\n* and the whole host is dev-gated: nothing here dials anything in a production build.\n*\n* The room (`?key=`) is appended from `topologyId` unless the caller already put one in the URL, so\n* an existing `${relayUrl}?key=${key}` call site keeps working untouched.\n*/\nfunction relayUrlFor(options) {\n\treturn relayUrlForTopology(options.topologyId, options);\n}\n/**\n* One topology's relay URL. Split out of {@link relayUrlFor} because a backend may belong to several\n* topologies at once (a service shared by a web app and an admin console) — the caller builds one\n* carrier per id and fans out over them, so it needs the URL per id rather than per options object.\n*/\nfunction relayUrlForTopology(topologyId, relay) {\n\tconst base = relay.relayUrl != null && relay.relayUrl !== \"\" ? relay.relayUrl : defaultLocalRelayUrl(relay.relayPort);\n\tif (topologyId == null || topologyId === \"\") return base;\n\tif (base.includes(\"key=\")) return base;\n\treturn `${base}${base.includes(\"?\") ? \"&\" : \"?\"}key=${encodeURIComponent(topologyId)}&role=producer`;\n}\nfunction relayTransport(relayUrl) {\n\treturn createFanoutTransport([createWebSocketTransport(relayUrl)]);\n}\nfunction logRecord(logger, format, host, record) {\n\tif (format === \"json\") {\n\t\tlogger(JSON.stringify({\n\t\t\ttime: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\thost,\n\t\t\tevent: record.event,\n\t\t\t...record.label != null ? { label: record.label } : {},\n\t\t\t...record.fields ?? {}\n\t\t}));\n\t\treturn;\n\t}\n\tif (record.message != null) {\n\t\tlogger(record.message);\n\t\treturn;\n\t}\n\tconst label = record.label != null ? ` ${record.label}` : \"\";\n\tconst fields = record.fields != null && Object.keys(record.fields).length > 0 ? `  ${Object.entries(record.fields).map(([k, v]) => `${k}=${typeof v === \"string\" ? v : JSON.stringify(v)}`).join(\" \")}` : \"\";\n\tlogger(`[${host}] ${record.event}${label}${fields}`);\n}\n//#endregion\n//#region src/host/TopologyCore.ts\nconst SERVER_REALM_PREFIX = \"server:realm:\";\n/** Synthetic node ids for backends nobody reports — namespaced so they can't collide with a clientId. */\nconst UNMONITORED_PREFIX = \"unmonitored:\";\n/**\n* Derives the devtools **topology** (devtools-revamp Wave D, Step 4) from what the\n* window already hears: a node per known client (kind/label/liveness straight off the\n* Phase-3 identity), and an edge per realm a frontend is connected to.\n*\n* Edges join a frontend realm's **peer** (the `envId` of the backend its connection dials) to the\n* backend advertising that `coordEnvId`. Falling back to a `realmId` join — the original rule —\n* mis-attributes traffic whenever two backends serve one realm id (a durable board on a Durable\n* Object beside an ephemeral one on a plain server: the DO's traffic was drawn on the plain\n* server's wire). A peer no monitored backend claims becomes an {@link ITopologyNode.unmonitored}\n* placeholder, so a backend that publishes nothing is *visibly* present rather than silently\n* collapsed onto its neighbour.\n*\n* Framework-agnostic; `TopologyView` renders it, and clicking a node drives the window's client\n* selection.\n*/\n/** The `envId` inside a coordinate `stringId` (`envId[web_app]perId[..]:insId[..]`). */\nconst ENV_ID_PATTERN = /^envId\\[([^\\]]*)\\]/;\n/**\n* A wire sample's `linkId` is the *peer's* coordinate `stringId`; the topology joins on `envId`.\n* A `linkId` that isn't a coordinate (a reserved bucket like `(handshaking)`) yields `undefined`\n* and folds into the client's aggregate, which is the honest place for un-attributed bytes.\n*/\nfunction topologyPeerEnvId(linkId) {\n\tif (linkId == null) return void 0;\n\treturn ENV_ID_PATTERN.exec(linkId)?.[1];\n}\n/** The aggregate bucket key — a client's traffic that names no peer. */\nconst FLOW_AGGREGATE = \"\";\nvar TopologyCore = class {\n\t_clients = [];\n\t/** Frontend realm connections, per client, read from its `realm` scope snapshot. */\n\t_realmsByClient = /* @__PURE__ */ new Map();\n\t/**\n\t* Cumulative wire totals per client, then per peer `envId` — plus an aggregate under\n\t* {@link FLOW_AGGREGATE}. Per-peer is what lets each WIRE animate its own bytes: a client holding\n\t* two backends would otherwise pulse its combined rate on both of them.\n\t*/\n\t_flowTotalsByClient = /* @__PURE__ */ new Map();\n\t/** Per-client teardown for the scope subscriptions above (dropped clients must not leak). */\n\t_unsubsByClient = /* @__PURE__ */ new Map();\n\t/**\n\t* Every backend `coordEnvId` this window has EVER heard from. Deliberately never pruned: it is the\n\t* only thing that distinguishes a backend which went quiet from one that never reported at all,\n\t* and a dropped client takes its `coordEnvId` with it. Bounded by the number of distinct backends.\n\t*/\n\t_everReportedEnvIds = /* @__PURE__ */ new Set();\n\t_snapshot = {\n\t\tnodes: [],\n\t\tedges: []\n\t};\n\t_listeners = /* @__PURE__ */ new Set();\n\tconstructor(client) {\n\t\tclient.onClients((clients) => {\n\t\t\tthis._clients = clients;\n\t\t\tconst live = new Set(clients.map((info) => info.clientId));\n\t\t\tfor (const info of clients) {\n\t\t\t\tif (this._unsubsByClient.has(info.clientId)) continue;\n\t\t\t\tconst clientId = info.clientId;\n\t\t\t\tthis._unsubsByClient.set(clientId, [client.onSnapshot(clientId, \"realm\", (raw) => {\n\t\t\t\t\tthis._realmsByClient.set(clientId, extractClientRealms(raw));\n\t\t\t\t\tthis._recompute();\n\t\t\t\t}), client.onSample(clientId, \"traffic\", (sample) => {\n\t\t\t\t\tlet byPeer = this._flowTotalsByClient.get(clientId);\n\t\t\t\t\tif (byPeer == null) {\n\t\t\t\t\t\tbyPeer = /* @__PURE__ */ new Map();\n\t\t\t\t\t\tthis._flowTotalsByClient.set(clientId, byPeer);\n\t\t\t\t\t}\n\t\t\t\t\tconst peerEnvId = topologyPeerEnvId(sample.linkId);\n\t\t\t\t\taddFlow(byPeer, FLOW_AGGREGATE, sample.dir, sample.bytes);\n\t\t\t\t\tif (peerEnvId != null) addFlow(byPeer, peerEnvId, sample.dir, sample.bytes);\n\t\t\t\t})]);\n\t\t\t}\n\t\t\tfor (const [clientId, unsubs] of [...this._unsubsByClient]) {\n\t\t\t\tif (live.has(clientId)) continue;\n\t\t\t\tfor (const unsub of unsubs) unsub();\n\t\t\t\tthis._unsubsByClient.delete(clientId);\n\t\t\t\tthis._realmsByClient.delete(clientId);\n\t\t\t\tthis._flowTotalsByClient.delete(clientId);\n\t\t\t}\n\t\t\tthis._recompute();\n\t\t});\n\t}\n\tgetSnapshot() {\n\t\treturn this._snapshot;\n\t}\n\t/**\n\t* A client's cumulative wire totals (a copy). Diff two reads over time for live rates — sample\n\t* arrival never fires {@link subscribe} listeners, so a polling consumer pays one map lookup per\n\t* tick instead of a re-render per frame.\n\t*\n\t* Pass `peerEnvId` (an edge's {@link ITopologyEdge.peer}) for the bytes on **that wire alone**.\n\t* When the client never stamped a peer — an older tap, or a bare-mux loopback — no per-peer\n\t* bucket exists and this falls back to the aggregate: the same number on every one of its wires,\n\t* which is what the band showed before per-link attribution existed.\n\t*\n\t* Direction is always **from the client's point of view**: `out` = toward the backend. That is\n\t* also the backend's ingress, so an edge needs no second measurement from the far end — the same\n\t* frames, counted once, at the end that knows which wire they were on.\n\t*/\n\tgetFlowTotals(clientId, peerEnvId) {\n\t\tconst byPeer = this._flowTotalsByClient.get(clientId);\n\t\tif (byPeer == null) return void 0;\n\t\tif (peerEnvId == null) {\n\t\t\tconst aggregate = byPeer.get(FLOW_AGGREGATE);\n\t\t\treturn aggregate == null ? void 0 : { ...aggregate };\n\t\t}\n\t\tconst exact = byPeer.get(peerEnvId);\n\t\tif (exact != null) return { ...exact };\n\t\tif (byPeer.size > 1) return void 0;\n\t\tconst aggregate = byPeer.get(FLOW_AGGREGATE);\n\t\treturn aggregate == null ? void 0 : { ...aggregate };\n\t}\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\tlistener(this._snapshot);\n\t\treturn () => {\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\t_recompute() {\n\t\tconst nodes = this._clients.map((info) => {\n\t\t\tconst kind = info.kind === \"backend\" ? \"backend\" : info.kind === \"frontend\" ? \"frontend\" : \"unknown\";\n\t\t\tconst realmIds = kind === \"backend\" ? info.scopes.filter((scope) => scope.startsWith(SERVER_REALM_PREFIX)).map((scope) => scope.slice(13)) : unique((this._realmsByClient.get(info.clientId) ?? []).map((realm) => realm.realmId));\n\t\t\treturn {\n\t\t\t\tclientId: info.clientId,\n\t\t\t\tlabel: info.label ?? info.clientId,\n\t\t\t\tkind,\n\t\t\t\tstale: info.stale,\n\t\t\t\trealmIds,\n\t\t\t\t...info.env != null ? { env: info.env } : {}\n\t\t\t};\n\t\t});\n\t\tconst backends = this._clients.filter((info) => info.kind === \"backend\");\n\t\t/** `coordEnvId` → the backend client that serves it. The precise join. */\n\t\tconst backendByEnvId = /* @__PURE__ */ new Map();\n\t\tfor (const backend of backends) {\n\t\t\tif (backend.coordEnvId == null) continue;\n\t\t\tbackendByEnvId.set(backend.coordEnvId, backend);\n\t\t\tthis._everReportedEnvIds.add(backend.coordEnvId);\n\t\t}\n\t\tconst edges = [];\n\t\tconst seenEdges = /* @__PURE__ */ new Set();\n\t\t/** Peers no monitored backend claims — one placeholder node each. */\n\t\tconst unmonitored = /* @__PURE__ */ new Map();\n\t\tconst addEdge = (from, to, realmId, peer) => {\n\t\t\tconst key = `${from}\u0000${to}\u0000${realmId}`;\n\t\t\tif (seenEdges.has(key)) return;\n\t\t\tseenEdges.add(key);\n\t\t\tedges.push({\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\trealmId,\n\t\t\t\t...peer != null ? { peer } : {}\n\t\t\t});\n\t\t};\n\t\tfor (const info of this._clients) {\n\t\t\tif (info.kind === \"backend\") continue;\n\t\t\tfor (const realm of this._realmsByClient.get(info.clientId) ?? []) {\n\t\t\t\tif (realm.peer != null) {\n\t\t\t\t\tconst backend = backendByEnvId.get(realm.peer);\n\t\t\t\t\tif (backend != null) addEdge(info.clientId, backend.clientId, realm.realmId, realm.peer);\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst nodeId = `${UNMONITORED_PREFIX}${realm.peer}`;\n\t\t\t\t\t\tlet realmIds = unmonitored.get(realm.peer);\n\t\t\t\t\t\tif (realmIds == null) {\n\t\t\t\t\t\t\trealmIds = /* @__PURE__ */ new Set();\n\t\t\t\t\t\t\tunmonitored.set(realm.peer, realmIds);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trealmIds.add(realm.realmId);\n\t\t\t\t\t\taddEdge(info.clientId, nodeId, realm.realmId, realm.peer);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfor (const backend of backends) if (backend.scopes.some((scope) => scope === `${SERVER_REALM_PREFIX}${realm.realmId}`)) addEdge(info.clientId, backend.clientId, realm.realmId);\n\t\t\t}\n\t\t}\n\t\tfor (const [envId, realmIds] of unmonitored) nodes.push({\n\t\t\tclientId: `${UNMONITORED_PREFIX}${envId}`,\n\t\t\tlabel: envId,\n\t\t\tkind: \"backend\",\n\t\t\tstale: false,\n\t\t\trealmIds: [...realmIds],\n\t\t\tunmonitored: true,\n\t\t\twasReporting: this._everReportedEnvIds.has(envId)\n\t\t});\n\t\tthis._snapshot = {\n\t\t\tnodes,\n\t\t\tedges\n\t\t};\n\t\tfor (const listener of [...this._listeners]) listener(this._snapshot);\n\t}\n};\nfunction unique(values) {\n\treturn [...new Set(values)];\n}\nfunction addFlow(byPeer, key, dir, bytes) {\n\tlet totals = byPeer.get(key);\n\tif (totals == null) {\n\t\ttotals = {\n\t\t\tinBytes: 0,\n\t\t\tinCount: 0,\n\t\t\toutBytes: 0,\n\t\t\toutCount: 0\n\t\t};\n\t\tbyPeer.set(key, totals);\n\t}\n\tif (dir === \"in\") {\n\t\ttotals.inBytes += bytes;\n\t\ttotals.inCount += 1;\n\t} else {\n\t\ttotals.outBytes += bytes;\n\t\ttotals.outCount += 1;\n\t}\n}\n/**\n* Pull each realm connection out of a `realm` scope snapshot, defensively. Reads each entry's\n* `realmId` (the realm *definition* id, e.g. `\"demo_board\"`, present once the engine reports\n* `handleReady`) — NOT the display-label `id` (e.g. `\"basic board\"`) — and its `peer` (the dialed\n* backend's coordinate `envId`), which is what the edge actually joins on.\n*/\nfunction extractClientRealms(raw) {\n\tif (raw == null || typeof raw !== \"object\" || !(\"realms\" in raw)) return [];\n\tconst realms = raw.realms;\n\tif (!Array.isArray(realms)) return [];\n\tconst out = [];\n\tfor (const realm of realms) if (realm != null && typeof realm === \"object\" && \"realmId\" in realm && typeof realm.realmId === \"string\") {\n\t\tconst peer = \"peer\" in realm && typeof realm.peer === \"string\" && realm.peer !== \"\" ? realm.peer : void 0;\n\t\tout.push({\n\t\t\trealmId: realm.realmId,\n\t\t\t...peer != null ? { peer } : {}\n\t\t});\n\t}\n\treturn out;\n}\n//#endregion\n//#region src/remote/acceptorTransport.ts\n/**\n* The **accept-in** devtools transport: the mirror of `createWebSocketTransport`, for a host that\n* cannot dial out. A devtools window opens a socket *into* the host; the host adopts it here and the\n* ordinary {@link DevtoolsBridge} rides it unchanged.\n*\n* This is the shape a Cloudflare Durable Object needs. A dial-out sink would hold an outbound socket\n* open, which pins the DO awake and bills for it — measuring a hibernation-driven cost model by\n* destroying it. An inbound hibernatable socket costs nothing while nobody is watching.\n*\n* Frames are JSON, matching every other devtools transport. Broadcasts fan to every attached socket\n* (two windows may observe one host); a socket whose `send` throws is dropped rather than allowed to\n* fail the broadcast for its siblings.\n*\n* ## Why this carrier is `\"local\"`\n*\n* It reports `origin: \"local\"`, so a window that dialed in here keeps full command rights — even\n* against a deployed DO over `wss://`. That is deliberate, and it is not the case the read-only gate\n* was built for:\n*\n* - **Admission is a deploy secret, not a shared link.** Reaching this transport at all means\n*   holding the DO's devtools token, which lives in deploy config. The relay-session token the gate\n*   guards is the opposite kind of thing: minted to be pasted to someone, and outliving the\n*   conversation it was pasted into.\n* - **There is no provenance to erase.** The gate exists because a *fanout* mixes local and session\n*   carriers into one indistinguishable stream. A host on this transport has exactly one carrier and\n*   one kind of peer.\n*\n* If a deployment ever wants dialed-in windows read-only too, the honest move is an origin option\n* here rather than a second gate elsewhere — the plumbing already carries it.\n*/\nfunction createAcceptorTransport() {\n\tconst sockets = /* @__PURE__ */ new Set();\n\tconst listeners = /* @__PURE__ */ new Set();\n\tlet closed = false;\n\treturn {\n\t\torigin: \"local\",\n\t\tget socketCount() {\n\t\t\treturn sockets.size;\n\t\t},\n\t\tattach(socket) {\n\t\t\tif (closed) return;\n\t\t\tsockets.add(socket);\n\t\t},\n\t\tdetach(socket) {\n\t\t\tsockets.delete(socket);\n\t\t},\n\t\treceive(socket, data) {\n\t\t\tif (closed) return;\n\t\t\tsockets.add(socket);\n\t\t\tlet message = data;\n\t\t\tif (typeof data === \"string\") try {\n\t\t\t\tmessage = JSON.parse(data);\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const listener of [...listeners]) listener(message, \"local\");\n\t\t},\n\t\tpost(message) {\n\t\t\tif (closed || sockets.size === 0) return;\n\t\t\tconst frame = JSON.stringify(message);\n\t\t\tfor (const socket of [...sockets]) try {\n\t\t\t\tsocket.send(frame);\n\t\t\t} catch {\n\t\t\t\tsockets.delete(socket);\n\t\t\t}\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tclosed = true;\n\t\t\tlisteners.clear();\n\t\t\tsockets.clear();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/remote/wireDevtoolsTransport.ts\n/**\n* The devtools **wire carrier** (Phase 2.5): devtools as the third protocol on the wire mux,\n* beside action (the lane) and realm (`0x01`). This module is the pair of adapters that lets the\n* unchanged {@link DevtoolsBridge} / `DevtoolsWindowClient` ride a `@nice-code/wire` connection:\n*\n* - {@link createWireDevtoolsTransport} — the **window** side: an {@link IDevtoolsTransport} over a\n*   wire client's mux, replacing the bespoke `createWebSocketTransport` dial (and its parallel\n*   reconnect ladder) for backends the window dials directly.\n* - {@link createWireDevtoolsAcceptorProtocol} — the **host** side: a wire acceptor protocol that\n*   glues admitted connections onto the ordinary {@link createAcceptorTransport}, replacing\n*   `durableObjectDevtools`' parallel acceptor (own route, own `WebSocketPair`, tag-based\n*   hibernation re-adoption, socket bookkeeping).\n*\n* ## The link is PLAIN, and the token is the gate — deliberately\n*\n* Today's posture exactly: a plain socket, a shared-secret token (constant-time compare),\n* sizes-only payloads. Riding wire as a **plain** connection keeps that posture and buys the\n* structural wins: no handshake ⇒ no dictionary-version gate (one window dials ANY wire acceptor,\n* whatever channel it serves), no TOFU pins from throwaway window identities, and hibernation\n* triviality (a plain connection has no session and no binding — after a DO wake the next frame\n* just flows; there is nothing to rehydrate, no tag, no socket set: **routing is by prefix byte**).\n*\n* The wire acceptor's A.6 security gate composes: this protocol opts into `allowPlain` and owns\n* its own **admission** — the first frame on a connection must be `{t:\"auth\", token}`; until it\n* matches, nothing is served. A host whose operator configured a strict `securityLevel` (no\n* `none`) refuses plain dials wholesale — fail-closed above this layer. In production the\n* protocol is simply never registered, so devtools frames land in the unknown-prefix drop.\n*\n* Everything here is typed **structurally** against wire (the mux port, the acceptor protocol\n* shape), so `@nice-code/devtools-core` keeps its zero runtime dependencies.\n*/\n/** The devtools protocol's reserved wire prefix byte. Realm holds `0x01`; range is `0x01`–`0x0F`. */\nconst DEVTOOLS_WIRE_PREFIX = 2;\n/** The devtools protocol id — advertised as `proto:devtools` where a handshake exists (secure links). */\nconst DEVTOOLS_WIRE_PROTOCOL_ID = \"devtools\";\nconst AUTH_DENIED_FRAME = JSON.stringify({ t: \"auth_denied\" });\n/**\n* The host's re-admission challenge: sent (once per connection) when a non-auth frame arrives on\n* an un-admitted connection. The one case that needs it is a **host eviction that keeps the socket\n* alive** (a Durable Object wake): the link never dropped, so the client's attach-time auth never\n* re-fires — while the woken host's admission state is fresh. The challenge closes that loop: the\n* client re-auths and re-announces (its `onLinkUp` fires again → the window re-`hello`s), and the\n* bridge re-attaches within one round-trip of the window's next frame. (Today's parallel stack\n* solved the same wake with eager tag-based socket re-adoption — this is its lazy, stateless twin.)\n*/\nconst AUTH_REQUIRED_FRAME = JSON.stringify({ t: \"auth_required\" });\n/**\n* Constant-time token comparison: XOR every char and accumulate, so the loop's duration never\n* depends on *where* two tokens first differ. Length is compared up front — any comparison leaks\n* it, and it is not the secret.\n*/\nfunction devtoolsTokensMatch(a, b) {\n\tif (a.length !== b.length || a.length === 0) return false;\n\tlet diff = 0;\n\tfor (let i = 0; i < a.length; i++) diff |= a.charCodeAt(i) ^ b.charCodeAt(i);\n\treturn diff === 0;\n}\nconst textEncoder = new TextEncoder();\nconst textDecoder = new TextDecoder();\n/**\n* The attachment key under which the acceptor records that a connection passed the token gate. It\n* is a **server-side** marker (written via a hibernatable socket's `serializeAttachment`, which a\n* client can never set), and it is the whole of the hibernation fix: a Durable Object is evicted on\n* idle even while a devtools socket is open, wiping the in-memory admission map — so on the next\n* wake a surviving socket's first frame would otherwise draw an `auth_required` challenge, and under\n* aggressive eviction the challenge/re-auth handshake can split across two wakes and loop forever\n* (the client \"pops up once then never sticks\"). Persisting admission lets the woken acceptor\n* **re-adopt** the socket silently — the surviving link already proved the token.\n*/\nconst DEVTOOLS_ADMITTED_ATTACHMENT_KEY = \"__nice_devtools_admitted\";\n/** Whether this connection was token-admitted before a hibernation wake (a server-written marker). */\nfunction wasAdmittedBeforeWake(connection) {\n\tconst conn = connection;\n\tif (typeof conn?.deserializeAttachment !== \"function\") return false;\n\ttry {\n\t\tconst attachment = conn.deserializeAttachment();\n\t\treturn typeof attachment === \"object\" && attachment != null && attachment[DEVTOOLS_ADMITTED_ATTACHMENT_KEY] === true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Record token admission on the connection's attachment, **merge-through** so any field the wire\n* host co-stored on the socket (its binding, say) is preserved. A no-op on a host whose connection\n* has no attachment API — that host does not hibernate, so it does not need the marker.\n*/\nfunction persistAdmission(connection) {\n\tconst conn = connection;\n\tif (typeof conn?.serializeAttachment !== \"function\" || typeof conn?.deserializeAttachment !== \"function\") return;\n\ttry {\n\t\tconst existing = conn.deserializeAttachment();\n\t\tconst base = typeof existing === \"object\" && existing != null ? existing : {};\n\t\tconn.serializeAttachment({\n\t\t\t...base,\n\t\t\t[DEVTOOLS_ADMITTED_ATTACHMENT_KEY]: true\n\t\t});\n\t} catch {}\n}\n/**\n* An {@link IDevtoolsTransport} over a wire connection's mux — the window side of the devtools\n* wire carrier. Posts are JSON-framed onto the `devtools` protocol (queued, bounded, while the\n* link is down — the wire client owns reconnection); inbound protocol frames fan to listeners.\n* Drop-in beside the BroadcastChannel/relay carriers in the window's fanout.\n*/\nfunction createWireDevtoolsTransport(options) {\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst queue = [];\n\tlet port;\n\tlet attached = false;\n\tlet deniedWarned = false;\n\tconst sendAuth = (to) => {\n\t\tif (options.token == null || options.token === \"\") return;\n\t\tconst auth = {\n\t\t\tt: \"auth\",\n\t\t\ttoken: options.token\n\t\t};\n\t\tto.send(textEncoder.encode(JSON.stringify(auth)));\n\t};\n\tconst flush = () => {\n\t\tif (port == null || !attached) return;\n\t\tconst pending = queue.splice(0, queue.length);\n\t\tfor (const frame of pending) port.send(textEncoder.encode(frame));\n\t};\n\tport = options.mux.registerProtocol({\n\t\tid: DEVTOOLS_WIRE_PROTOCOL_ID,\n\t\tprefixByte: 2,\n\t\tonFrame: (payload, livePort) => {\n\t\t\tlet message;\n\t\t\ttry {\n\t\t\t\tmessage = JSON.parse(textDecoder.decode(payload));\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (message != null && typeof message === \"object\" && \"t\" in message) {\n\t\t\t\tif (message.t === \"auth_denied\") {\n\t\t\t\t\tif (!deniedWarned) {\n\t\t\t\t\t\tdeniedWarned = true;\n\t\t\t\t\t\tconsole.warn(\"[nice-devtools] the backend refused this window's devtools token — check the token the window dials with against the backend's DEVTOOLS_TOKEN.\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (message.t === \"auth_required\") {\n\t\t\t\t\tsendAuth(livePort);\n\t\t\t\t\toptions.onLinkUp?.();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const listener of [...listeners]) listener(message, \"local\");\n\t\t},\n\t\tonAttach: (livePort) => {\n\t\t\tattached = true;\n\t\t\tsendAuth(livePort);\n\t\t\tflush();\n\t\t\toptions.onLinkUp?.();\n\t\t},\n\t\tonDetach: () => {\n\t\t\tattached = false;\n\t\t}\n\t});\n\treturn {\n\t\torigin: \"local\",\n\t\tpost(message) {\n\t\t\tconst frame = JSON.stringify(message);\n\t\t\tif (attached && port?.isOpen()) {\n\t\t\t\tport.send(textEncoder.encode(frame));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tqueue.push(frame);\n\t\t\tif (queue.length > 1e3) queue.shift();\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tlisteners.clear();\n\t\t\tqueue.length = 0;\n\t\t\toptions.close?.();\n\t\t}\n\t};\n}\n/**\n* The host side of the devtools wire carrier: a wire **acceptor protocol** (structurally\n* `IWireAcceptorProtocol<TConn>`, `allowPlain: true`) that admits a connection on a constant-time\n* token match and then glues it onto the ordinary acceptor transport. Register it on any wire\n* host — `serveWireDurableObject(ctx, { protocols: [it] })`, action's `serveDurableObject`, or a\n* Node `serveChannel` — and the same `DevtoolsBridge` observes over it unchanged.\n*\n* Per-connection lifecycle, without a socket set: adoption is **lazy** (on the auth frame — a\n* plain connection fires no acceptor `onAttach`), the per-connection sender is retained from that\n* frame, and `onDetach` (which the acceptor fans un-gated on every drop) releases it.\n*\n* ## Surviving a hibernation wake\n*\n* A Durable Object is evicted on idle **even while the devtools socket stays open**, wiping this\n* in-memory `state` map. On admission the host writes a server-only marker onto the connection's\n* attachment (`serializeAttachment` — a client cannot set it); a woken acceptor's first frame from a\n* marked-but-unmapped socket **re-adopts it silently** rather than challenging. This replaces the\n* earlier lazy `auth_required` handshake, which could split across two wakes (client sends `auth`\n* then `hello` as separate frames; the DO hibernates between them; the `hello` lands on a fresh\n* empty map → challenge again → loop) and left the client unable to re-attach. A host with no\n* attachment API (a Node `serveChannel`, which never hibernates) writes no marker and keeps the\n* lazy `auth_required` path. A genuinely fresh dial re-auths normally on link attach.\n*/\nfunction createWireDevtoolsAcceptorProtocol(options) {\n\tconst state = /* @__PURE__ */ new Map();\n\treturn {\n\t\tid: DEVTOOLS_WIRE_PROTOCOL_ID,\n\t\tprefixByte: 2,\n\t\tallowPlain: true,\n\t\tonFrame(connection, payload, send) {\n\t\t\tlet text;\n\t\t\ttry {\n\t\t\t\ttext = textDecoder.decode(payload);\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst makeSender = () => ({ send: (data) => send(textEncoder.encode(data)) });\n\t\t\tconst current = state.get(connection);\n\t\t\tif (current != null && current !== \"challenged\") {\n\t\t\t\toptions.transport.receive(current, text);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (current !== \"challenged\" && wasAdmittedBeforeWake(connection)) {\n\t\t\t\tconst sender = makeSender();\n\t\t\t\tstate.set(connection, sender);\n\t\t\t\toptions.transport.attach(sender);\n\t\t\t\toptions.transport.receive(sender, text);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet message;\n\t\t\ttry {\n\t\t\t\tmessage = JSON.parse(text);\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (message == null || typeof message !== \"object\" || !(\"t\" in message) || message.t !== \"auth\" || !(\"token\" in message) || typeof message.token !== \"string\") {\n\t\t\t\tif (current !== \"challenged\") {\n\t\t\t\t\tstate.set(connection, \"challenged\");\n\t\t\t\t\tsend(textEncoder.encode(AUTH_REQUIRED_FRAME));\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!devtoolsTokensMatch(message.token, options.token)) {\n\t\t\t\tsend(textEncoder.encode(AUTH_DENIED_FRAME));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst sender = makeSender();\n\t\t\tstate.set(connection, sender);\n\t\t\tpersistAdmission(connection);\n\t\t\toptions.transport.attach(sender);\n\t\t},\n\t\tonDetach(connection) {\n\t\t\tconst current = state.get(connection);\n\t\t\tif (current == null) return;\n\t\t\tstate.delete(connection);\n\t\t\tif (current !== \"challenged\") options.transport.detach(current);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/traffic/traffic.types.ts\n/**\n* Frames tapped before a connection binds an identity (the handshake itself) carry no `linkId` —\n* they are real bytes on a real socket, so they get a reserved bucket rather than being dropped.\n* Without it, per-link totals would silently fail to reconcile with the all-lane totals.\n*/\nconst TRAFFIC_LINK_HANDSHAKING = \"(handshaking)\";\n/** Overflow bucket past `maxLinks` — a public server must not grow one counter per lifetime socket. */\nconst TRAFFIC_LINK_OTHER = \"(other links)\";\nconst TRAFFIC_WINDOW_MS_ONE_MINUTE = 6e4;\nconst TRAFFIC_WINDOW_MS_FIVE_MINUTES = 3e5;\nconst TRAFFIC_WINDOW_MS_FIFTEEN_MINUTES = 9e5;\n/** All-time — everything since the client connected (or last clear). Not ring-bounded. */\nconst MAX_TRAFFIC_WINDOW_MS = Number.POSITIVE_INFINITY;\nconst DEFAULT_TRAFFIC_WINDOW_MS = TRAFFIC_WINDOW_MS_FIVE_MINUTES;\n/** The finite rolling windows (1m / 5m / 15m). MAX is reported separately from lifetime totals. */\nconst STANDARD_TRAFFIC_WINDOWS_MS = [\n\tTRAFFIC_WINDOW_MS_ONE_MINUTE,\n\tTRAFFIC_WINDOW_MS_FIVE_MINUTES,\n\tTRAFFIC_WINDOW_MS_FIFTEEN_MINUTES\n];\n/** The window options the panel offers, MAX last (and default). */\nconst TRAFFIC_WINDOW_OPTIONS_MS = [...STANDARD_TRAFFIC_WINDOWS_MS, MAX_TRAFFIC_WINDOW_MS];\n//#endregion\n//#region src/traffic/TrafficMetricsCore.ts\n/** How many points the charting series downsamples to (keeps the SVG cheap at 15m/30m spans). */\nconst SERIES_TARGET_POINTS = 120;\nfunction newDirCounters() {\n\treturn {\n\t\tinCount: 0,\n\t\tinBytes: 0,\n\t\toutCount: 0,\n\t\toutBytes: 0\n\t};\n}\nfunction newLaneCounters() {\n\treturn {\n\t\t...newDirCounters(),\n\t\tkinds: /* @__PURE__ */ new Map()\n\t};\n}\nfunction newLinkCounters() {\n\treturn {\n\t\t...newDirCounters(),\n\t\tlanes: /* @__PURE__ */ new Map()\n\t};\n}\nfunction isReservedLinkId(linkId) {\n\treturn linkId === \"(handshaking)\" || linkId === \"(other links)\";\n}\nfunction countDistinctLinks(links) {\n\tlet count = 0;\n\tfor (const linkId of links.keys()) if (!isReservedLinkId(linkId)) count += 1;\n\treturn count;\n}\nfunction laneToTransfer(lane) {\n\treturn {\n\t\tin: {\n\t\t\tcount: lane.inCount,\n\t\t\tbytes: lane.inBytes\n\t\t},\n\t\tout: {\n\t\t\tcount: lane.outCount,\n\t\t\tbytes: lane.outBytes\n\t\t},\n\t\tkinds: [...lane.kinds.entries()].map(([kind, counters]) => ({\n\t\t\tkind,\n\t\t\tin: {\n\t\t\t\tcount: counters.inCount,\n\t\t\t\tbytes: counters.inBytes\n\t\t\t},\n\t\t\tout: {\n\t\t\t\tcount: counters.outCount,\n\t\t\t\tbytes: counters.outBytes\n\t\t\t}\n\t\t}))\n\t};\n}\nfunction linksToTransfer(links) {\n\treturn [...links.entries()].map(([linkId, link]) => ({\n\t\tlinkId,\n\t\tin: {\n\t\t\tcount: link.inCount,\n\t\t\tbytes: link.inBytes\n\t\t},\n\t\tout: {\n\t\t\tcount: link.outCount,\n\t\t\tbytes: link.outBytes\n\t\t},\n\t\tlanes: [...link.lanes.entries()].map(([lane, counters]) => ({\n\t\t\tlane,\n\t\t\tin: {\n\t\t\t\tcount: counters.inCount,\n\t\t\t\tbytes: counters.inBytes\n\t\t\t},\n\t\t\tout: {\n\t\t\t\tcount: counters.outCount,\n\t\t\t\tbytes: counters.outBytes\n\t\t\t}\n\t\t}))\n\t}));\n}\nfunction toLaneCounters(entry) {\n\tconst lane = newLaneCounters();\n\tlane.inCount = entry.in.count;\n\tlane.inBytes = entry.in.bytes;\n\tlane.outCount = entry.out.count;\n\tlane.outBytes = entry.out.bytes;\n\tfor (const kind of entry.kinds) lane.kinds.set(kind.kind, {\n\t\tinCount: kind.in.count,\n\t\tinBytes: kind.in.bytes,\n\t\toutCount: kind.out.count,\n\t\toutBytes: kind.out.bytes\n\t});\n\treturn lane;\n}\nfunction toLinkCounters(entry) {\n\tconst link = newLinkCounters();\n\tlink.inCount = entry.in.count;\n\tlink.inBytes = entry.in.bytes;\n\tlink.outCount = entry.out.count;\n\tlink.outBytes = entry.out.bytes;\n\tfor (const lane of entry.lanes) link.lanes.set(lane.lane, {\n\t\tinCount: lane.in.count,\n\t\tinBytes: lane.in.bytes,\n\t\toutCount: lane.out.count,\n\t\toutBytes: lane.out.bytes\n\t});\n\treturn link;\n}\nfunction addToDir(counters, dir, bytes) {\n\tif (dir === \"in\") {\n\t\tcounters.inCount += 1;\n\t\tcounters.inBytes += bytes;\n\t} else {\n\t\tcounters.outCount += 1;\n\t\tcounters.outBytes += bytes;\n\t}\n}\nfunction addToLane(lane, dir, bytes, kind) {\n\taddToDir(lane, dir, bytes);\n\tif (kind != null) {\n\t\tlet kindCounters = lane.kinds.get(kind);\n\t\tif (kindCounters == null) {\n\t\t\tkindCounters = newDirCounters();\n\t\t\tlane.kinds.set(kind, kindCounters);\n\t\t}\n\t\taddToDir(kindCounters, dir, bytes);\n\t}\n}\nfunction addToLink(link, dir, bytes, lane) {\n\taddToDir(link, dir, bytes);\n\tlet laneCounters = link.lanes.get(lane);\n\tif (laneCounters == null) {\n\t\tlaneCounters = newDirCounters();\n\t\tlink.lanes.set(lane, laneCounters);\n\t}\n\taddToDir(laneCounters, dir, bytes);\n}\nfunction mergeLinkInto(target, source) {\n\ttarget.inCount += source.inCount;\n\ttarget.inBytes += source.inBytes;\n\ttarget.outCount += source.outCount;\n\ttarget.outBytes += source.outBytes;\n\tfor (const [lane, counters] of source.lanes) {\n\t\tlet existing = target.lanes.get(lane);\n\t\tif (existing == null) {\n\t\t\texisting = newDirCounters();\n\t\t\ttarget.lanes.set(lane, existing);\n\t\t}\n\t\texisting.inCount += counters.inCount;\n\t\texisting.inBytes += counters.inBytes;\n\t\texisting.outCount += counters.outCount;\n\t\texisting.outBytes += counters.outBytes;\n\t}\n}\n/**\n* A link's stats over `windowMs`, optionally restricted to `laneFilter` — the lane filter must\n* apply here too, or a filtered snapshot's links would not sum to its filtered totals.\n*/\nfunction linkToStats(linkId, link, windowMs, laneFilter) {\n\tlet inCount = 0;\n\tlet inBytes = 0;\n\tlet outCount = 0;\n\tlet outBytes = 0;\n\tconst lanes = [];\n\tfor (const [lane, counters] of link.lanes) {\n\t\tif (laneFilter != null && !laneFilter.has(lane)) continue;\n\t\tinCount += counters.inCount;\n\t\tinBytes += counters.inBytes;\n\t\toutCount += counters.outCount;\n\t\toutBytes += counters.outBytes;\n\t\tlanes.push({\n\t\t\tlane,\n\t\t\tin: {\n\t\t\t\tcount: counters.inCount,\n\t\t\t\tbytes: counters.inBytes\n\t\t\t},\n\t\t\tout: {\n\t\t\t\tcount: counters.outCount,\n\t\t\t\tbytes: counters.outBytes\n\t\t\t}\n\t\t});\n\t}\n\tlanes.sort((a, b) => b.in.bytes + b.out.bytes - (a.in.bytes + a.out.bytes));\n\treturn {\n\t\tlinkId,\n\t\tin: rateStats(inCount, inBytes, windowMs),\n\t\tout: rateStats(outCount, outBytes, windowMs),\n\t\tlanes\n\t};\n}\nfunction mergeLaneInto(target, source) {\n\ttarget.inCount += source.inCount;\n\ttarget.inBytes += source.inBytes;\n\ttarget.outCount += source.outCount;\n\ttarget.outBytes += source.outBytes;\n\tfor (const [kind, counters] of source.kinds) {\n\t\tlet existing = target.kinds.get(kind);\n\t\tif (existing == null) {\n\t\t\texisting = newDirCounters();\n\t\t\ttarget.kinds.set(kind, existing);\n\t\t}\n\t\texisting.inCount += counters.inCount;\n\t\texisting.inBytes += counters.inBytes;\n\t\texisting.outCount += counters.outCount;\n\t\texisting.outBytes += counters.outBytes;\n\t}\n}\nfunction rateStats(count, bytes, windowMs) {\n\tconst seconds = windowMs / 1e3;\n\treturn {\n\t\tcount,\n\t\tbytes,\n\t\tmsgsPerSec: seconds > 0 ? count / seconds : 0,\n\t\tbytesPerSec: seconds > 0 ? bytes / seconds : 0\n\t};\n}\nfunction laneToStats(name, lane, windowMs) {\n\tconst kinds = [...lane.kinds.entries()].map(([kind, counters]) => ({\n\t\tkind,\n\t\tin: {\n\t\t\tcount: counters.inCount,\n\t\t\tbytes: counters.inBytes\n\t\t},\n\t\tout: {\n\t\t\tcount: counters.outCount,\n\t\t\tbytes: counters.outBytes\n\t\t}\n\t})).sort((a, b) => b.in.bytes + b.out.bytes - (a.in.bytes + a.out.bytes));\n\treturn {\n\t\tlane: name,\n\t\tin: rateStats(lane.inCount, lane.inBytes, windowMs),\n\t\tout: rateStats(lane.outCount, lane.outBytes, windowMs),\n\t\tkinds\n\t};\n}\n/**\n* Framework-agnostic collector for wire/protocol traffic. Feed it\n* {@link ITrafficSample}s and it maintains a ring of 1-second buckets (for the\n* finite rolling windows + the charting series) AND unbounded lifetime\n* accumulators per lane×dir×kind (for the MAX / all-time view). The finite \"per\n* X\" stats are ring sums; MAX stats come from the lifetime accumulators so\n* \"since the client connected\" totals are exact no matter how long ago that was.\n*\n* The hot path ({@link record}) is a few map lookups and integer adds. Nothing\n* retains payload contents.\n*/\nvar TrafficMetricsCore = class {\n\t_ring;\n\t_ringSeconds;\n\t_topN;\n\t_notifyThrottleMs;\n\t_maxLinks;\n\t_topFrames = [];\n\t_lifetimeIn = {\n\t\tcount: 0,\n\t\tbytes: 0\n\t};\n\t_lifetimeOut = {\n\t\tcount: 0,\n\t\tbytes: 0\n\t};\n\t_lifetimeLanes = /* @__PURE__ */ new Map();\n\t_lifetimeLinks = /* @__PURE__ */ new Map();\n\t_sinceMs = Date.now();\n\t/** True when `sinceMs` marks a host wake/reset rather than a genuine first-observation. */\n\t_resumedFromReset = false;\n\t_listeners = /* @__PURE__ */ new Set();\n\t_sampleListeners = /* @__PURE__ */ new Set();\n\t_notifyTimer = null;\n\tconstructor(options = {}) {\n\t\tthis._ringSeconds = Math.max(1, options.ringSeconds ?? 1800);\n\t\tthis._topN = Math.max(0, options.topFrames ?? 20);\n\t\tthis._notifyThrottleMs = options.notifyThrottleMs ?? 250;\n\t\tthis._maxLinks = Math.max(1, options.maxLinks ?? 200);\n\t\tthis._ring = new Array(this._ringSeconds);\n\t}\n\t/**\n\t* The bucket a sample's `linkId` counts into. An unbound frame (the handshake, tapped before the\n\t* peer identity exists) gets the reserved handshaking bucket; a new id past `maxLinks` folds into\n\t* the overflow bucket. Decided once per sample off the *lifetime* map, so the ring and the\n\t* lifetime accumulators can never disagree about which bucket a frame landed in.\n\t*/\n\t_resolveLinkId(linkId) {\n\t\tif (linkId == null || linkId === \"\") return TRAFFIC_LINK_HANDSHAKING;\n\t\tif (this._lifetimeLinks.has(linkId)) return linkId;\n\t\tif (this._distinctLinks < this._maxLinks) return linkId;\n\t\treturn TRAFFIC_LINK_OTHER;\n\t}\n\t/** Real (non-reserved) link ids tracked so far — the quantity `maxLinks` bounds. */\n\t_distinctLinks = 0;\n\t/**\n\t* Adapter for the wire-level tap seams (`connectChannel({ wireTap })` et al.):\n\t* structurally accepts a nice-wire `IWireTapEvent` and stamps the time. Bound,\n\t* so it can be passed around detached (`{ wireTap: core.wireTap }`).\n\t*/\n\twireTap = (event) => {\n\t\tthis.record({\n\t\t\tatMs: Date.now(),\n\t\t\t...event\n\t\t});\n\t};\n\trecord(sample) {\n\t\tconst sec = Math.floor(sample.atMs / 1e3);\n\t\tconst slot = (sec % this._ringSeconds + this._ringSeconds) % this._ringSeconds;\n\t\tlet bucket = this._ring[slot];\n\t\tif (bucket == null) {\n\t\t\tbucket = {\n\t\t\t\tsec,\n\t\t\t\tlanes: /* @__PURE__ */ new Map(),\n\t\t\t\tlinks: /* @__PURE__ */ new Map()\n\t\t\t};\n\t\t\tthis._ring[slot] = bucket;\n\t\t} else if (bucket.sec !== sec) if (bucket.sec > sec) {} else {\n\t\t\tbucket.sec = sec;\n\t\t\tbucket.lanes = /* @__PURE__ */ new Map();\n\t\t\tbucket.links = /* @__PURE__ */ new Map();\n\t\t}\n\t\tlet lane = bucket.lanes.get(sample.lane);\n\t\tif (lane == null) {\n\t\t\tlane = newLaneCounters();\n\t\t\tbucket.lanes.set(sample.lane, lane);\n\t\t}\n\t\taddToLane(lane, sample.dir, sample.bytes, sample.kind);\n\t\tconst linkId = this._resolveLinkId(sample.linkId);\n\t\tlet bucketLink = bucket.links.get(linkId);\n\t\tif (bucketLink == null) {\n\t\t\tbucketLink = newLinkCounters();\n\t\t\tbucket.links.set(linkId, bucketLink);\n\t\t}\n\t\taddToLink(bucketLink, sample.dir, sample.bytes, sample.lane);\n\t\tconst lifetime = sample.dir === \"in\" ? this._lifetimeIn : this._lifetimeOut;\n\t\tlifetime.count += 1;\n\t\tlifetime.bytes += sample.bytes;\n\t\tlet lifetimeLane = this._lifetimeLanes.get(sample.lane);\n\t\tif (lifetimeLane == null) {\n\t\t\tlifetimeLane = newLaneCounters();\n\t\t\tthis._lifetimeLanes.set(sample.lane, lifetimeLane);\n\t\t}\n\t\taddToLane(lifetimeLane, sample.dir, sample.bytes, sample.kind);\n\t\tlet lifetimeLink = this._lifetimeLinks.get(linkId);\n\t\tif (lifetimeLink == null) {\n\t\t\tlifetimeLink = newLinkCounters();\n\t\t\tthis._lifetimeLinks.set(linkId, lifetimeLink);\n\t\t\tif (!isReservedLinkId(linkId)) this._distinctLinks += 1;\n\t\t}\n\t\taddToLink(lifetimeLink, sample.dir, sample.bytes, sample.lane);\n\t\tthis._maybeRecordTopFrame(sample);\n\t\tif (this._sampleListeners.size > 0) for (const listener of this._sampleListeners) listener(sample);\n\t\tthis._scheduleNotify();\n\t}\n\t/**\n\t* Observe the raw {@link ITrafficSample} stream (every `record`, unthrottled).\n\t* The devtools bridge forwards samples to a standalone window that feeds them\n\t* into its own core, preserving full window-select interactivity remotely.\n\t*/\n\tobserve(listener) {\n\t\tthis._sampleListeners.add(listener);\n\t\treturn () => {\n\t\t\tthis._sampleListeners.delete(listener);\n\t\t};\n\t}\n\tgetSnapshot(query = {}) {\n\t\tconst windowMs = query.windowMs ?? MAX_TRAFFIC_WINDOW_MS;\n\t\tconst isMax = !Number.isFinite(windowMs);\n\t\tconst laneFilter = query.lanes != null ? new Set(query.lanes) : null;\n\t\tconst nowSec = Math.floor(Date.now() / 1e3);\n\t\tconst elapsedMs = Math.max(1, Date.now() - this._sinceMs);\n\t\tconst selWindowSec = isMax ? 0 : Math.max(1, Math.round(windowMs / 1e3));\n\t\tconst seriesSpanSec = Math.min(this._ringSeconds, isMax ? this._ringSeconds : Math.max(1, Math.round(windowMs / 1e3)));\n\t\tconst groupSec = Math.max(1, Math.ceil(seriesSpanSec / SERIES_TARGET_POINTS));\n\t\tconst windowTotals = STANDARD_TRAFFIC_WINDOWS_MS.map(() => newDirCounters());\n\t\tconst finiteLaneAcc = /* @__PURE__ */ new Map();\n\t\tconst finiteLinkAcc = /* @__PURE__ */ new Map();\n\t\tconst seriesGroups = /* @__PURE__ */ new Map();\n\t\tfor (const bucket of this._ring) {\n\t\t\tif (bucket == null) continue;\n\t\t\tconst age = nowSec - bucket.sec;\n\t\t\tif (age < 0 || age >= this._ringSeconds) continue;\n\t\t\tif (!isMax && age < selWindowSec) for (const [linkId, link] of bucket.links) {\n\t\t\t\tlet acc = finiteLinkAcc.get(linkId);\n\t\t\t\tif (acc == null) {\n\t\t\t\t\tacc = newLinkCounters();\n\t\t\t\t\tfiniteLinkAcc.set(linkId, acc);\n\t\t\t\t}\n\t\t\t\tmergeLinkInto(acc, link);\n\t\t\t}\n\t\t\tlet inCount = 0;\n\t\t\tlet inBytes = 0;\n\t\t\tlet outCount = 0;\n\t\t\tlet outBytes = 0;\n\t\t\tfor (const [laneName, lane] of bucket.lanes) {\n\t\t\t\tif (laneFilter != null && !laneFilter.has(laneName)) continue;\n\t\t\t\tinCount += lane.inCount;\n\t\t\t\tinBytes += lane.inBytes;\n\t\t\t\toutCount += lane.outCount;\n\t\t\t\toutBytes += lane.outBytes;\n\t\t\t\tif (!isMax && age < selWindowSec) {\n\t\t\t\t\tlet acc = finiteLaneAcc.get(laneName);\n\t\t\t\t\tif (acc == null) {\n\t\t\t\t\t\tacc = newLaneCounters();\n\t\t\t\t\t\tfiniteLaneAcc.set(laneName, acc);\n\t\t\t\t\t}\n\t\t\t\t\tmergeLaneInto(acc, lane);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let w = 0; w < STANDARD_TRAFFIC_WINDOWS_MS.length; w++) if (age < STANDARD_TRAFFIC_WINDOWS_MS[w] / 1e3) {\n\t\t\t\tconst totals = windowTotals[w];\n\t\t\t\ttotals.inCount += inCount;\n\t\t\t\ttotals.inBytes += inBytes;\n\t\t\t\ttotals.outCount += outCount;\n\t\t\t\ttotals.outBytes += outBytes;\n\t\t\t}\n\t\t\tif (age < seriesSpanSec && (inCount > 0 || outCount > 0)) {\n\t\t\t\tconst groupIndex = Math.floor(age / groupSec);\n\t\t\t\tlet point = seriesGroups.get(groupIndex);\n\t\t\t\tif (point == null) {\n\t\t\t\t\tpoint = {\n\t\t\t\t\t\tatMs: (nowSec - groupIndex * groupSec) * 1e3,\n\t\t\t\t\t\tinCount: 0,\n\t\t\t\t\t\tinBytes: 0,\n\t\t\t\t\t\toutCount: 0,\n\t\t\t\t\t\toutBytes: 0\n\t\t\t\t\t};\n\t\t\t\t\tseriesGroups.set(groupIndex, point);\n\t\t\t\t}\n\t\t\t\tpoint.inCount += inCount;\n\t\t\t\tpoint.inBytes += inBytes;\n\t\t\t\tpoint.outCount += outCount;\n\t\t\t\tpoint.outBytes += outBytes;\n\t\t\t}\n\t\t}\n\t\tlet ltInCount = 0;\n\t\tlet ltInBytes = 0;\n\t\tlet ltOutCount = 0;\n\t\tlet ltOutBytes = 0;\n\t\tfor (const [laneName, lane] of this._lifetimeLanes) {\n\t\t\tif (laneFilter != null && !laneFilter.has(laneName)) continue;\n\t\t\tltInCount += lane.inCount;\n\t\t\tltInBytes += lane.inBytes;\n\t\t\tltOutCount += lane.outCount;\n\t\t\tltOutBytes += lane.outBytes;\n\t\t}\n\t\tconst lifetimeIn = {\n\t\t\tcount: ltInCount,\n\t\t\tbytes: ltInBytes\n\t\t};\n\t\tconst lifetimeOut = {\n\t\t\tcount: ltOutCount,\n\t\t\tbytes: ltOutBytes\n\t\t};\n\t\tconst windows = STANDARD_TRAFFIC_WINDOWS_MS.map((ms, i) => ({\n\t\t\twindowMs: ms,\n\t\t\tin: rateStats(windowTotals[i].inCount, windowTotals[i].inBytes, ms),\n\t\t\tout: rateStats(windowTotals[i].outCount, windowTotals[i].outBytes, ms)\n\t\t}));\n\t\twindows.push({\n\t\t\twindowMs: MAX_TRAFFIC_WINDOW_MS,\n\t\t\tin: rateStats(lifetimeIn.count, lifetimeIn.bytes, elapsedMs),\n\t\t\tout: rateStats(lifetimeOut.count, lifetimeOut.bytes, elapsedMs)\n\t\t});\n\t\tconst lanes = isMax ? [...this._lifetimeLanes.entries()].filter(([laneName]) => laneFilter == null || laneFilter.has(laneName)).map(([laneName, lane]) => laneToStats(laneName, lane, elapsedMs)).sort((a, b) => b.in.bytes + b.out.bytes - (a.in.bytes + a.out.bytes)) : [...finiteLaneAcc.entries()].map(([laneName, lane]) => laneToStats(laneName, lane, windowMs)).sort((a, b) => b.in.bytes + b.out.bytes - (a.in.bytes + a.out.bytes));\n\t\tconst linkSource = isMax ? this._lifetimeLinks : finiteLinkAcc;\n\t\tconst linkWindowMs = isMax ? elapsedMs : windowMs;\n\t\tconst links = [...linkSource.entries()].map(([linkId, link]) => linkToStats(linkId, link, linkWindowMs, laneFilter)).filter((link) => link.in.count > 0 || link.out.count > 0).sort((a, b) => b.out.bytes + b.in.bytes - (a.out.bytes + a.in.bytes));\n\t\tconst groupCount = Math.max(1, Math.ceil(seriesSpanSec / groupSec));\n\t\tconst series = [];\n\t\tfor (let groupIndex = groupCount - 1; groupIndex >= 0; groupIndex--) series.push(seriesGroups.get(groupIndex) ?? {\n\t\t\tatMs: (nowSec - groupIndex * groupSec) * 1e3,\n\t\t\tinCount: 0,\n\t\t\tinBytes: 0,\n\t\t\toutCount: 0,\n\t\t\toutBytes: 0\n\t\t});\n\t\tconst topFrames = laneFilter != null ? this._topFrames.filter((frame) => laneFilter.has(frame.lane)) : [...this._topFrames];\n\t\treturn {\n\t\t\twindowMs,\n\t\t\twindows,\n\t\t\tlanes,\n\t\t\tlinks,\n\t\t\tseries,\n\t\t\tseriesBucketMs: groupSec * 1e3,\n\t\t\ttopFrames,\n\t\t\tlifetime: {\n\t\t\t\tin: lifetimeIn,\n\t\t\t\tout: lifetimeOut,\n\t\t\t\tsinceMs: this._sinceMs,\n\t\t\t\tresetFromWake: this._resumedFromReset\n\t\t\t}\n\t\t};\n\t}\n\t/** Serialize accumulated state for a window backfill (see {@link ITrafficStateTransfer}). */\n\texportState() {\n\t\tconst buckets = [];\n\t\tfor (const bucket of this._ring) {\n\t\t\tif (bucket == null) continue;\n\t\t\tbuckets.push({\n\t\t\t\tsec: bucket.sec,\n\t\t\t\tlanes: [...bucket.lanes.entries()].map(([lane, counters]) => ({\n\t\t\t\t\tlane,\n\t\t\t\t\t...laneToTransfer(counters)\n\t\t\t\t})),\n\t\t\t\tlinks: linksToTransfer(bucket.links)\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tsinceMs: this._sinceMs,\n\t\t\tlifetimeIn: { ...this._lifetimeIn },\n\t\t\tlifetimeOut: { ...this._lifetimeOut },\n\t\t\tlanes: [...this._lifetimeLanes.entries()].map(([lane, counters]) => ({\n\t\t\t\tlane,\n\t\t\t\t...laneToTransfer(counters)\n\t\t\t})),\n\t\t\tlinks: linksToTransfer(this._lifetimeLinks),\n\t\t\tbuckets,\n\t\t\ttopFrames: [...this._topFrames]\n\t\t};\n\t}\n\t/**\n\t* A compact lifetime rollup — totals only, no 1-second ring, no top frames. What a hibernating\n\t* host persists so its MAX numbers survive an eviction (see `persistCounters`). Restore with\n\t* {@link importLifetimeRollup}.\n\t*/\n\texportLifetimeRollup() {\n\t\treturn {\n\t\t\tsinceMs: this._sinceMs,\n\t\t\tlifetimeIn: { ...this._lifetimeIn },\n\t\t\tlifetimeOut: { ...this._lifetimeOut },\n\t\t\tlanes: [...this._lifetimeLanes.entries()].map(([lane, counters]) => ({\n\t\t\t\tlane,\n\t\t\t\t...laneToTransfer(counters)\n\t\t\t})),\n\t\t\tlinks: linksToTransfer(this._lifetimeLinks)\n\t\t};\n\t}\n\t/**\n\t* Seed the lifetime accumulators from a {@link exportLifetimeRollup} (a woken host restoring its\n\t* persisted totals). The ring stays empty — the rolling windows and the graph legitimately restart\n\t* at the wake, only the all-time totals continue. Must be called before any `record`.\n\t*/\n\timportLifetimeRollup(rollup) {\n\t\tthis._sinceMs = rollup.sinceMs;\n\t\tthis._lifetimeIn = { ...rollup.lifetimeIn };\n\t\tthis._lifetimeOut = { ...rollup.lifetimeOut };\n\t\tthis._lifetimeLanes = new Map(rollup.lanes.map((entry) => [entry.lane, toLaneCounters(entry)]));\n\t\tthis._lifetimeLinks = new Map(rollup.links.map((entry) => [entry.linkId, toLinkCounters(entry)]));\n\t\tthis._distinctLinks = countDistinctLinks(this._lifetimeLinks);\n\t\tthis._fireNotify();\n\t}\n\t/**\n\t* Declare that `sinceMs` marks a reset (an in-memory host restarted, a Durable Object woke from\n\t* hibernation and lost its counters) rather than a genuine first observation. The MAX view labels\n\t* itself accordingly instead of implying a lifetime total it does not have.\n\t*/\n\tmarkResetFromWake() {\n\t\tthis._resumedFromReset = true;\n\t\tthis._fireNotify();\n\t}\n\t/** Seed this core from a {@link exportState} transfer (a freshly-opened window). Replaces state. */\n\timportState(state) {\n\t\tthis._sinceMs = state.sinceMs;\n\t\tthis._lifetimeIn = { ...state.lifetimeIn };\n\t\tthis._lifetimeOut = { ...state.lifetimeOut };\n\t\tthis._lifetimeLanes = new Map(state.lanes.map((entry) => [entry.lane, toLaneCounters(entry)]));\n\t\tthis._lifetimeLinks = new Map((state.links ?? []).map((entry) => [entry.linkId, toLinkCounters(entry)]));\n\t\tthis._distinctLinks = countDistinctLinks(this._lifetimeLinks);\n\t\tthis._ring = new Array(this._ringSeconds);\n\t\tfor (const bucket of state.buckets) {\n\t\t\tconst slot = (bucket.sec % this._ringSeconds + this._ringSeconds) % this._ringSeconds;\n\t\t\tthis._ring[slot] = {\n\t\t\t\tsec: bucket.sec,\n\t\t\t\tlanes: new Map(bucket.lanes.map((entry) => [entry.lane, toLaneCounters(entry)])),\n\t\t\t\tlinks: new Map((bucket.links ?? []).map((entry) => [entry.linkId, toLinkCounters(entry)]))\n\t\t\t};\n\t\t}\n\t\tthis._topFrames = [...state.topFrames];\n\t\tthis._fireNotify();\n\t}\n\t/**\n\t* Change notification, throttled to at most one call per `notifyThrottleMs`.\n\t* Listeners receive no payload — call {@link getSnapshot} with the query your\n\t* view needs (and refresh on a timer too: rolling windows decay with time).\n\t*/\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\tclear() {\n\t\tthis._ring = new Array(this._ringSeconds);\n\t\tthis._topFrames = [];\n\t\tthis._lifetimeIn = {\n\t\t\tcount: 0,\n\t\t\tbytes: 0\n\t\t};\n\t\tthis._lifetimeOut = {\n\t\t\tcount: 0,\n\t\t\tbytes: 0\n\t\t};\n\t\tthis._lifetimeLanes = /* @__PURE__ */ new Map();\n\t\tthis._lifetimeLinks = /* @__PURE__ */ new Map();\n\t\tthis._distinctLinks = 0;\n\t\tthis._sinceMs = Date.now();\n\t\tthis._resumedFromReset = false;\n\t\tthis._fireNotify();\n\t}\n\t_maybeRecordTopFrame(sample) {\n\t\tif (this._topN === 0) return;\n\t\tif (this._topFrames.length >= this._topN && sample.bytes <= this._topFrames[this._topFrames.length - 1].bytes) return;\n\t\tconst frame = {\n\t\t\tatMs: sample.atMs,\n\t\t\tdir: sample.dir,\n\t\t\tbytes: sample.bytes,\n\t\t\tlane: sample.lane,\n\t\t\t...sample.kind != null ? { kind: sample.kind } : {},\n\t\t\t...sample.linkId != null ? { linkId: sample.linkId } : {}\n\t\t};\n\t\tlet index = this._topFrames.length;\n\t\twhile (index > 0 && this._topFrames[index - 1].bytes < frame.bytes) index--;\n\t\tthis._topFrames.splice(index, 0, frame);\n\t\tif (this._topFrames.length > this._topN) this._topFrames.length = this._topN;\n\t}\n\t_scheduleNotify() {\n\t\tif (this._notifyTimer != null || this._listeners.size === 0) return;\n\t\tthis._notifyTimer = setTimeout(() => this._fireNotify(), this._notifyThrottleMs);\n\t\tunrefTimer(this._notifyTimer);\n\t}\n\t_fireNotify() {\n\t\tif (this._notifyTimer != null) {\n\t\t\tclearTimeout(this._notifyTimer);\n\t\t\tthis._notifyTimer = null;\n\t\t}\n\t\tfor (const listener of [...this._listeners]) listener();\n\t}\n};\n//#endregion\n//#region src/host/wireDevtoolsHost.ts\n/**\n* A disabled instance: inert, allocation-light, and unreachable — it exposes no protocol, so there\n* is nothing to authenticate against. Exported because `createNiceDurableObjectDevtools` treats an\n* **absent token** as \"devtools off\" rather than a construction error. Still fail-closed: an unset\n* token can only ever close the door.\n*/\nfunction inertWireDevtoolsHost() {\n\tconst noop = {\n\t\tenabled: false,\n\t\twireTap: () => {},\n\t\ttraffic: new TrafficMetricsCore(),\n\t\tcontribute: () => noop,\n\t\tcontributeSample: () => noop\n\t};\n\treturn noop;\n}\nfunction createWireDevtoolsHost(options) {\n\tif (options.env == null || options.env === \"\") throw new Error(\"createWireDevtoolsHost: `env` is required. workerd has no NODE_ENV to infer it from, and a devtools endpoint must never default to enabled. Pass e.g. env: \\\"development\\\".\");\n\tif (options.env === \"production\") return inertWireDevtoolsHost();\n\tif (options.token == null || options.token === \"\") throw new Error(\"createWireDevtoolsHost: `token` is required outside production — the devtools protocol is otherwise open to anyone who can reach this host.\");\n\tconst traffic = new TrafficMetricsCore(options.maxLinks != null ? { maxLinks: options.maxLinks } : {});\n\tconst persist = options.persistCounters;\n\tconst persistKey = persist?.key ?? \"__nice_devtools_traffic\";\n\tif (persist?.blockConcurrencyWhile != null) persist.blockConcurrencyWhile(async () => {\n\t\tconst stored = await persist.storage.get(persistKey);\n\t\tif (stored != null) traffic.importLifetimeRollup(stored);\n\t});\n\telse traffic.markResetFromWake();\n\tconst flushCounters = () => {\n\t\tif (persist == null) return;\n\t\tpersist.storage.put(persistKey, traffic.exportLifetimeRollup()).catch(() => {});\n\t};\n\tconst transport = createAcceptorTransport();\n\tconst protocol = createWireDevtoolsAcceptorProtocol({\n\t\ttoken: options.token,\n\t\ttransport: {\n\t\t\t...transport,\n\t\t\tget socketCount() {\n\t\t\t\treturn transport.socketCount;\n\t\t\t},\n\t\t\tdetach: (socket) => {\n\t\t\t\ttransport.detach(socket);\n\t\t\t\tif (transport.socketCount === 0) flushCounters();\n\t\t\t}\n\t\t}\n\t});\n\tconst bridge = new DevtoolsBridge(createFanoutTransport([transport]), {\n\t\tclientId: options.clientId,\n\t\tgetLabel: () => options.name,\n\t\tenv: options.env,\n\t\tkind: \"backend\",\n\t\t...options.coordEnvId != null ? { coordEnvId: options.coordEnvId } : {}\n\t});\n\tbridge.addSampleScope(trafficSampleScope(\"traffic\", traffic));\n\tbridge.onAttachedChange((attached) => {\n\t\tif (!attached) flushCounters();\n\t});\n\tbridge.start();\n\tconst host = {\n\t\tenabled: true,\n\t\ttraffic,\n\t\twireTap: (event) => {\n\t\t\tif (event.lane === \"devtools\") return;\n\t\t\ttraffic.wireTap(event);\n\t\t},\n\t\tprotocol,\n\t\tcontribute(scope) {\n\t\t\tbridge.addSnapshotScope(scope);\n\t\t\treturn host;\n\t\t},\n\t\tcontributeSample(scope) {\n\t\t\tbridge.addSampleScope(scope);\n\t\t\treturn host;\n\t\t}\n\t};\n\treturn host;\n}\n//#endregion\n//#region src/remote/DevtoolsWindowClient.ts\n/**\n* ms without any message before a client is marked stale, then dropped.\n*\n* These are two of the five numbers in the liveness contract — read the block above\n* `DEFAULT_ATTACH_TIMEOUT_MS` in `DevtoolsBridge.ts` before changing either. In short: an attached\n* bridge speaks every 5s, well inside {@link STALE_MS}, so a producer that is still talking is never\n* dimmed; a producer that has gone quiet for {@link DROP_MS} is forgotten, and a *backend* that is\n* forgotten does not vanish — `TopologyCore` redraws it as a grey \"not reporting\" placeholder,\n* because the frontends still name it as their realm `peer`.\n*/\nconst STALE_MS = 15e3;\nconst DROP_MS = 3e4;\n/** Heartbeat `hello` cadence (also keeps hosts attached + projecting). */\nconst HEARTBEAT_MS = 1e4;\nfunction scopeKey(clientId, scope) {\n\treturn `${clientId}\u0000${scope}`;\n}\n/**\n* The window side of the standalone-devtools link. Owns the transport, announces\n* itself (`hello` + heartbeat), and tracks every HOST it hears from as a client\n* (Phase 3) — so one window observes many clients (tabs, multiplayer peers).\n* Snapshots and samples fan out to per-`(client, scope)` handlers (the mirror\n* cores register here); commands are addressed back to one client.\n*/\nvar DevtoolsWindowClient = class {\n\t_transport;\n\t_consumerId = `w_${Math.random().toString(36).slice(2, 10)}`;\n\t_snapshotHandlers = /* @__PURE__ */ new Map();\n\t_sampleHandlers = /* @__PURE__ */ new Map();\n\t/** Per-scope handlers that fire for EVERY client (merged traffic / event log). */\n\t_anySampleHandlers = /* @__PURE__ */ new Map();\n\t_backfillHandlers = /* @__PURE__ */ new Map();\n\t_latest = /* @__PURE__ */ new Map();\n\t_backfill = /* @__PURE__ */ new Map();\n\t_clients = /* @__PURE__ */ new Map();\n\t_clientsListeners = /* @__PURE__ */ new Set();\n\t_commandRejectedListeners = /* @__PURE__ */ new Set();\n\t_cleanup = null;\n\t_heartbeatTimer = null;\n\t_staleTimer = null;\n\tconstructor(transport) {\n\t\tthis._transport = transport;\n\t}\n\t/** Every client this window has heard from, newest-labelled-first is not guaranteed — sort in the UI. */\n\tgetClients() {\n\t\treturn [...this._clients.values()];\n\t}\n\tstart() {\n\t\tif (this._cleanup != null) return;\n\t\tthis._cleanup = this._transport.onMessage((raw, origin) => this._onMessage(raw, origin));\n\t\tthis.hello();\n\t\tthis._heartbeatTimer = setInterval(() => this.hello(), HEARTBEAT_MS);\n\t\tthis._staleTimer = setInterval(() => this._sweepStale(), STALE_MS / 3);\n\t\tif (typeof window !== \"undefined\") {\n\t\t\twindow.addEventListener(\"focus\", this._onFocus);\n\t\t\twindow.addEventListener(\"pageshow\", this._onFocus);\n\t\t}\n\t\tif (typeof document !== \"undefined\") document.addEventListener(\"visibilitychange\", this._onVisibilityChange);\n\t}\n\tstop() {\n\t\tthis._cleanup?.();\n\t\tthis._cleanup = null;\n\t\tif (this._heartbeatTimer != null) clearInterval(this._heartbeatTimer);\n\t\tif (this._staleTimer != null) clearInterval(this._staleTimer);\n\t\tthis._heartbeatTimer = null;\n\t\tthis._staleTimer = null;\n\t\tif (typeof window !== \"undefined\") {\n\t\t\twindow.removeEventListener(\"focus\", this._onFocus);\n\t\t\twindow.removeEventListener(\"pageshow\", this._onFocus);\n\t\t}\n\t\tif (typeof document !== \"undefined\") document.removeEventListener(\"visibilitychange\", this._onVisibilityChange);\n\t\tthis._transport.close();\n\t}\n\t/** Announce presence — hosts (re)attach + replay, and it doubles as our heartbeat. */\n\thello() {\n\t\tthis._transport.post({\n\t\t\tt: \"hello\",\n\t\t\tv: 3,\n\t\t\tconsumerId: this._consumerId\n\t\t});\n\t}\n\tonClients(listener) {\n\t\tthis._clientsListeners.add(listener);\n\t\tlistener(this.getClients());\n\t\treturn () => {\n\t\t\tthis._clientsListeners.delete(listener);\n\t\t};\n\t}\n\tonSnapshot(clientId, scope, handler) {\n\t\tconst key = scopeKey(clientId, scope);\n\t\tlet set = this._snapshotHandlers.get(key);\n\t\tif (set == null) {\n\t\t\tset = /* @__PURE__ */ new Set();\n\t\t\tthis._snapshotHandlers.set(key, set);\n\t\t}\n\t\tset.add(handler);\n\t\tconst latest = this._latest.get(key);\n\t\tif (latest !== void 0) handler(latest);\n\t\treturn () => set?.delete(handler);\n\t}\n\tonSample(clientId, scope, handler) {\n\t\tconst key = scopeKey(clientId, scope);\n\t\tlet set = this._sampleHandlers.get(key);\n\t\tif (set == null) {\n\t\t\tset = /* @__PURE__ */ new Set();\n\t\t\tthis._sampleHandlers.set(key, set);\n\t\t}\n\t\tset.add(handler);\n\t\treturn () => set?.delete(handler);\n\t}\n\t/** Seed a mirror core from a client's backfill (replays the last one if it already arrived). */\n\tonBackfill(clientId, scope, handler) {\n\t\tconst key = scopeKey(clientId, scope);\n\t\tlet set = this._backfillHandlers.get(key);\n\t\tif (set == null) {\n\t\t\tset = /* @__PURE__ */ new Set();\n\t\t\tthis._backfillHandlers.set(key, set);\n\t\t}\n\t\tset.add(handler);\n\t\tconst latest = this._backfill.get(key);\n\t\tif (latest !== void 0) handler(latest);\n\t\treturn () => set?.delete(handler);\n\t}\n\t/** Observe a sample-scope across ALL clients (for a merged \"all clients\" traffic core). */\n\tonAnySample(scope, handler) {\n\t\tlet set = this._anySampleHandlers.get(scope);\n\t\tif (set == null) {\n\t\t\tset = /* @__PURE__ */ new Set();\n\t\t\tthis._anySampleHandlers.set(scope, set);\n\t\t}\n\t\tset.add(handler);\n\t\treturn () => set?.delete(handler);\n\t}\n\tsendCommand(clientId, scope, command) {\n\t\tthis._transport.post({\n\t\t\tt: \"command\",\n\t\t\tv: 3,\n\t\t\tto: clientId,\n\t\t\tscope,\n\t\t\tcommand,\n\t\t\tconsumerId: this._consumerId\n\t\t});\n\t}\n\t/**\n\t* Observe commands this window sent that a producer **refused** — today, a producer that is\n\t* read-only to remote windows (`allowRemoteCommands: false`, the default). Fires only for this\n\t* window's own commands.\n\t*\n\t* Worth wiring even where the UI already disables the controls: the disabled state is inferred\n\t* from what a producer *says* it allows, while this is what it actually *did*. If those two ever\n\t* disagree, the operator should hear it from the producer rather than trust the greyed-out button.\n\t*/\n\tonCommandRejected(listener) {\n\t\tthis._commandRejectedListeners.add(listener);\n\t\treturn () => {\n\t\t\tthis._commandRejectedListeners.delete(listener);\n\t\t};\n\t}\n\t/**\n\t* Tell ONE client the accent colour the window has assigned it — the hue of the lane it is shown\n\t* in — or `null` to clear it. Fire-and-forget: a host that starts later re-learns its accent the\n\t* next time the window reconciles (on a client-list or selection change), and a host that ignores\n\t* the message loses only the cosmetic chip tint.\n\t*/\n\tsetAccent(clientId, color) {\n\t\tthis._transport.post({\n\t\t\tt: \"accent\",\n\t\t\tv: 3,\n\t\t\tto: clientId,\n\t\t\tcolor\n\t\t});\n\t}\n\t_onFocus = () => {\n\t\tthis.hello();\n\t};\n\t/** Only the visible edge matters — going hidden needs no announcement, and posts nothing. */\n\t_onVisibilityChange = () => {\n\t\tif (document.visibilityState === \"visible\") this.hello();\n\t};\n\t_onMessage(message, origin) {\n\t\tif (message == null || typeof message !== \"object\") return;\n\t\tif (message.v !== 3) return;\n\t\tconst identity = message.from;\n\t\tif (identity == null) return;\n\t\tthis._touchClient(identity, origin, message.t === \"ready\" ? message.scopes : void 0);\n\t\tif (message.t === \"snapshot\") {\n\t\t\tconst key = scopeKey(identity.clientId, message.scope);\n\t\t\tthis._latest.set(key, message.snapshot);\n\t\t\tconst handlers = this._snapshotHandlers.get(key);\n\t\t\tif (handlers != null) for (const handler of [...handlers]) handler(message.snapshot);\n\t\t} else if (message.t === \"sample\") {\n\t\t\tconst handlers = this._sampleHandlers.get(scopeKey(identity.clientId, message.scope));\n\t\t\tif (handlers != null) for (const handler of [...handlers]) handler(message.sample);\n\t\t\tconst any = this._anySampleHandlers.get(message.scope);\n\t\t\tif (any != null) for (const handler of [...any]) handler(message.sample);\n\t\t} else if (message.t === \"backfill\") {\n\t\t\tconst key = scopeKey(identity.clientId, message.scope);\n\t\t\tthis._backfill.set(key, message.state);\n\t\t\tconst handlers = this._backfillHandlers.get(key);\n\t\t\tif (handlers != null) for (const handler of [...handlers]) handler(message.state);\n\t\t} else if (message.t === \"command_rejected\") {\n\t\t\tif (message.to !== this._consumerId) return;\n\t\t\tconst rejection = {\n\t\t\t\tclientId: identity.clientId,\n\t\t\t\tlabel: identity.label,\n\t\t\t\tscope: message.scope,\n\t\t\t\treason: message.reason\n\t\t\t};\n\t\t\tfor (const listener of [...this._commandRejectedListeners]) listener(rejection);\n\t\t}\n\t}\n\t_touchClient(identity, origin, scopes) {\n\t\tconst existing = this._clients.get(identity.clientId);\n\t\tconst readOnly = origin === \"remote\" && identity.allowRemoteCommands !== true;\n\t\tconst next = {\n\t\t\t...identity,\n\t\t\tscopes: scopes ?? existing?.scopes ?? [],\n\t\t\tlastSeen: Date.now(),\n\t\t\tstale: false,\n\t\t\torigin,\n\t\t\treadOnly\n\t\t};\n\t\tconst changed = existing == null || existing.label !== next.label || existing.stale || existing.scopes.length !== next.scopes.length || existing.readOnly !== next.readOnly;\n\t\tthis._clients.set(identity.clientId, next);\n\t\tif (changed) this._notifyClients();\n\t}\n\t_sweepStale() {\n\t\tconst now = Date.now();\n\t\tlet changed = false;\n\t\tfor (const [clientId, info] of [...this._clients]) {\n\t\t\tconst age = now - info.lastSeen;\n\t\t\tif (age > DROP_MS) {\n\t\t\t\tthis._clients.delete(clientId);\n\t\t\t\tchanged = true;\n\t\t\t} else if (age > STALE_MS && !info.stale) {\n\t\t\t\tthis._clients.set(clientId, {\n\t\t\t\t\t...info,\n\t\t\t\t\tstale: true\n\t\t\t\t});\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif (changed) this._notifyClients();\n\t}\n\t_notifyClients() {\n\t\tconst clients = this.getClients();\n\t\tfor (const listener of [...this._clientsListeners]) listener(clients);\n\t}\n};\n/**\n* A `TrafficMetricsCore` on the window side fed one client's forwarded samples\n* for `scope` (full window-select fidelity, unlike a single windowed snapshot).\n*/\nfunction createRemoteTrafficCore(client, clientId, scope) {\n\tconst core = new TrafficMetricsCore();\n\tclient.onBackfill(clientId, scope, (state) => core.importState(state));\n\tclient.onSample(clientId, scope, (sample) => core.record(sample));\n\treturn core;\n}\n/** A `TrafficMetricsCore` fed EVERY client's samples for `scope` — the \"all clients\" merged view. */\nfunction createMergedTrafficCore(client, scope) {\n\tconst core = new TrafficMetricsCore();\n\tclient.onAnySample(scope, (sample) => core.record(sample));\n\treturn core;\n}\n//#endregion\n//#region src/remote/relayDiscovery.ts\nconst DEFAULT_POLL_MS = 1e4;\n/** Don't re-ask the dev server to start a relay more than this often, however often the link flaps. */\nconst HEAL_COOLDOWN_MS = 5e3;\nfunction parseStatus(body) {\n\tif (body == null || typeof body !== \"object\") return null;\n\tif (!(\"running\" in body) || !(\"port\" in body) || !(\"conflict\" in body)) return null;\n\tconst { running, port, conflict } = body;\n\tif (typeof running !== \"boolean\" || typeof port !== \"number\" || typeof conflict !== \"boolean\") return null;\n\tconst path = \"path\" in body && typeof body.path === \"string\" ? body.path : void 0;\n\treturn {\n\t\trunning,\n\t\tport,\n\t\tconflict,\n\t\t...path != null ? { path } : {}\n\t};\n}\nasync function fetchSameOrigin(path, method) {\n\tconst response = await fetch(path, { method });\n\tif (!response.ok) return { status: response.status };\n\ttry {\n\t\treturn {\n\t\t\tstatus: response.status,\n\t\t\tbody: await response.json()\n\t\t};\n\t} catch {\n\t\treturn { status: response.status };\n\t}\n}\n/**\n* Finds the local devtools relay, so an app never has to be told where it is.\n*\n* The dev server (`@nice-code/devtools-vite`) answers two same-origin routes; this asks them and,\n* when a relay is running, hands its URL to the carrier that should dial it. Three properties make\n* it safe to leave on by default:\n*\n* - **A dev server without the plugin answers 404**, and discovery disables itself for the session.\n*   An app that never installs the plugin behaves exactly as it did before discovery existed.\n* - **Nothing dials until a relay is known to exist.** A browser logs a console error for every\n*   failed WebSocket connection, so speculatively dialing a maybe-relay is not free — it is a wall\n*   of red for the majority of sessions that never open devtools.\n* - **It re-heals.** The relay lives inside whichever dev server started it. When that process exits,\n*   surviving clients ask *their own* dev server to stand a new one up, and the carrier's ordinary\n*   reconnect backoff rejoins it. No page reload.\n*/\nfunction createRelayDiscovery(options) {\n\tconst pollMs = options.pollMs ?? DEFAULT_POLL_MS;\n\tconst request = options.request ?? fetchSameOrigin;\n\tconst logger = options.logger ?? console;\n\tconst hostname = options.hostname ?? (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n\tlet state = \"idle\";\n\tlet pollTimer = null;\n\tlet lastHealAt = 0;\n\t/** Set once the relay has been seen up, so a drop is distinguishable from \"never connected\". */\n\tlet everUp = false;\n\tconst clearPoll = () => {\n\t\tif (pollTimer != null) clearTimeout(pollTimer);\n\t\tpollTimer = null;\n\t};\n\tconst schedulePoll = () => {\n\t\tif (state !== \"polling\" || pollTimer != null) return;\n\t\tpollTimer = setTimeout(() => {\n\t\t\tpollTimer = null;\n\t\t\task(\"GET\");\n\t\t}, pollMs);\n\t\tunrefTimer(pollTimer);\n\t};\n\t/**\n\t* The URL the carrier should dial. A same-origin proxy path from the dev server wins over the\n\t* direct `ws://<hostname>:<port>` build: the page's own origin is reachable however the page was\n\t* opened (localhost, LAN IP, a phone), and it inherits `wss:` under an HTTPS dev server — both\n\t* places the direct dial breaks. Outside a browser (no `location`) the direct build remains.\n\t*/\n\tconst relayUrlFor = (status) => {\n\t\tif (status.path != null && typeof location !== \"undefined\") return `${location.protocol === \"https:\" ? \"wss\" : \"ws\"}://${location.host}${status.path}`;\n\t\treturn relayUrlFromStatus(status, hostname);\n\t};\n\tconst settle = (status) => {\n\t\tif (status.conflict) {\n\t\t\tstate = \"conflict\";\n\t\t\tclearPoll();\n\t\t\tlogger.warn(`[nice-devtools] port ${status.port} is not a devtools relay — cross-browser devtools are unavailable. See the dev server's log.`);\n\t\t\treturn;\n\t\t}\n\t\tif (status.running) {\n\t\t\tconst wasUp = everUp;\n\t\t\teverUp = true;\n\t\t\tstate = \"up\";\n\t\t\tclearPoll();\n\t\t\tif (!wasUp) options.onRelayUp(relayUrlFor(status));\n\t\t\treturn;\n\t\t}\n\t\tstate = \"polling\";\n\t\tschedulePoll();\n\t};\n\tconst currentState = () => state;\n\tconst topologyQuery = options.statusTopologyId != null && options.statusTopologyId !== \"\" ? `?topology=${encodeURIComponent(options.statusTopologyId)}` : \"\";\n\tconst ask = async (method) => {\n\t\tif (state === \"disabled\" || state === \"conflict\") return;\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await request(method === \"GET\" ? `${DEVTOOLS_STATUS_PATH}${topologyQuery}` : `${DEVTOOLS_ENSURE_PATH}${topologyQuery}`, method);\n\t\t} catch {\n\t\t\tif (currentState() === \"disabled\") return;\n\t\t\tstate = \"polling\";\n\t\t\tschedulePoll();\n\t\t\treturn;\n\t\t}\n\t\tif (currentState() === \"disabled\") return;\n\t\tif (response.status === 404) {\n\t\t\tstate = \"disabled\";\n\t\t\tclearPoll();\n\t\t\treturn;\n\t\t}\n\t\tif (response.body != null) options.onStatusBody?.(response.body);\n\t\tconst status = parseStatus(response.body);\n\t\tif (status == null) {\n\t\t\tif (response.status >= 200 && response.status < 300) {\n\t\t\t\tstate = \"disabled\";\n\t\t\t\tclearPoll();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstate = \"polling\";\n\t\t\tschedulePoll();\n\t\t\treturn;\n\t\t}\n\t\tsettle(status);\n\t};\n\treturn {\n\t\tstart() {\n\t\t\tif (state !== \"idle\") return;\n\t\t\tstate = \"polling\";\n\t\t\task(\"GET\");\n\t\t},\n\t\tensure() {\n\t\t\tif (state === \"disabled\" || state === \"conflict\" || state === \"up\") return;\n\t\t\task(\"POST\");\n\t\t},\n\t\trecheck() {\n\t\t\tif (state === \"disabled\" || state === \"conflict\" || state === \"up\") return;\n\t\t\task(\"GET\");\n\t\t},\n\t\tonCarrierDrop() {\n\t\t\tif (!everUp || state === \"disabled\" || state === \"conflict\") return;\n\t\t\tconst now = Date.now();\n\t\t\tif (now - lastHealAt < HEAL_COOLDOWN_MS) return;\n\t\t\tlastHealAt = now;\n\t\t\tstate = \"polling\";\n\t\t\task(\"POST\");\n\t\t},\n\t\tstop() {\n\t\t\tstate = \"disabled\";\n\t\t\tclearPoll();\n\t\t},\n\t\tget state() {\n\t\t\treturn state;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/remote/discoveredRelayTransport.ts\n/** The topology this carrier joins. Throws rather than silently using `default`. */\nfunction resolveTopologyId(options) {\n\tconst topologyId = options.topologyId;\n\tif (topologyId == null || topologyId === \"\") throw new Error(\"createDiscoveredRelayTransport: `topologyId` is required — it names the relay room this client joins. Without it the client would land in the shared `default` room, where it would see (and be seen by) every other app on this machine.\");\n\treturn topologyId;\n}\n/**\n* A relay carrier that doesn't know where the relay is — or whether there is one — until it asks.\n*\n* It behaves as an ordinary {@link IDevtoolsTransport} from the first moment: posts are buffered,\n* listeners registered. Behind it, {@link createRelayDiscovery} asks the dev server whether a relay\n* exists; only when one does is a real WebSocket transport built and attached, at which point the\n* buffer flushes and the listeners are re-registered on it.\n*\n* The deferral is the whole point. The relay's URL contains a port the client cannot guess, and —\n* more importantly — a browser prints a console error for every failed WebSocket connection, so a\n* carrier that dialed hopefully would fill the console of every dev session that never opens\n* devtools. Discovery makes \"no relay\" completely silent.\n*/\nfunction createDiscoveredRelayTransport(options) {\n\tconst topologyId = resolveTopologyId(options);\n\tconst listeners = /* @__PURE__ */ new Set();\n\t/** Posts made before a relay was found. Bounded: an app that never opens devtools posts nothing. */\n\tconst queue = [];\n\tlet inner = null;\n\tlet innerUnsub = null;\n\tlet closed = false;\n\tconst discovery = createRelayDiscovery({\n\t\t...options,\n\t\tstatusTopologyId: topologyId,\n\t\tonRelayUp: (relayUrl) => {\n\t\t\tif (closed || inner != null) return;\n\t\t\tconst roleQuery = options.role != null ? `&${DEVTOOLS_RELAY_ROLE_PARAM}=${options.role}` : \"\";\n\t\t\tconst transport = createWebSocketTransport(`${relayUrl}?key=${encodeURIComponent(topologyId)}${roleQuery}`, { onStatus: (status) => {\n\t\t\t\tif (status === \"closed\") discovery.onCarrierDrop();\n\t\t\t} });\n\t\t\tinner = transport;\n\t\t\tinnerUnsub = transport.onMessage((message, origin) => {\n\t\t\t\tfor (const listener of [...listeners]) listener(message, origin);\n\t\t\t});\n\t\t\tfor (const message of queue.splice(0, queue.length)) transport.post(message);\n\t\t}\n\t});\n\tdiscovery.start();\n\treturn {\n\t\tpost(message) {\n\t\t\tif (closed) return;\n\t\t\tif (inner != null) {\n\t\t\t\tinner.post(message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tqueue.push(message);\n\t\t\tif (queue.length > 1e3) queue.shift();\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tclosed = true;\n\t\t\tdiscovery.stop();\n\t\t\tinnerUnsub?.();\n\t\t\tinnerUnsub = null;\n\t\t\tinner?.close();\n\t\t\tinner = null;\n\t\t\tlisteners.clear();\n\t\t\tqueue.length = 0;\n\t\t},\n\t\tensureRelay() {\n\t\t\tif (!closed) discovery.ensure();\n\t\t},\n\t\trecheckRelay() {\n\t\t\tif (!closed) discovery.recheck();\n\t\t},\n\t\tdiscovery\n\t};\n}\n//#endregion\n//#region src/remote/EventLogCore.ts\nconst GROUP_WINDOW_MS = 1500;\nconst SEEN_ACTION_CAP = 2e3;\nconst ACTION_TONE = {\n\tsuccess: \"success\",\n\t\"action-error\": \"error\",\n\tfailed: \"error\",\n\taborted: \"warning\"\n};\nconst ACTION_GLYPH = {\n\tsuccess: \"✓\",\n\t\"action-error\": \"✗\",\n\tfailed: \"✗\",\n\taborted: \"⊘\"\n};\n/**\n* Window-side synthesis of a terse, grouped \"what caused traffic\" feed (Phase 6),\n* derived entirely from the mirrors the window already holds — no new protocol.\n* Fed one client's action entries, realm snapshots and traffic samples; emits\n* clickable events that navigate into the causing tool. Per client (the sidebar\n* scopes to the selected one). First feed of each source seeds silently (records\n* what's already there) so opening the window doesn't dump stale history.\n*/\nvar EventLogCore = class {\n\t_entries = [];\n\t_listeners = /* @__PURE__ */ new Set();\n\t_maxEvents;\n\t_counter = 0;\n\t_seenAction = /* @__PURE__ */ new Set();\n\t_actionSeeded = false;\n\t_lastRealmEventCuid = /* @__PURE__ */ new Map();\n\t_realmSeeded = false;\n\tconstructor(options = {}) {\n\t\tthis._maxEvents = options.maxEvents ?? 200;\n\t}\n\tfeedActionEntries(entries) {\n\t\tif (!this._actionSeeded) {\n\t\t\tfor (const entry of entries) this._seenAction.add(`${entry.cuid}:${entry.status}`);\n\t\t\tthis._actionSeeded = true;\n\t\t\treturn;\n\t\t}\n\t\tconst fresh = [];\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.status === \"running\") continue;\n\t\t\tconst key = `${entry.cuid}:${entry.status}`;\n\t\t\tif (this._seenAction.has(key)) continue;\n\t\t\tthis._seenAction.add(key);\n\t\t\tfresh.push(entry);\n\t\t}\n\t\tif (this._seenAction.size > SEEN_ACTION_CAP) this._seenAction.clear();\n\t\tfresh.sort((a, b) => (a.endTime ?? a.startTime) - (b.endTime ?? b.startTime));\n\t\tfor (const entry of fresh) {\n\t\t\tconst glyph = ACTION_GLYPH[entry.status] ?? \"\";\n\t\t\tconst ms = entry.endTime != null ? ` ${Math.max(0, Math.round(entry.endTime - entry.startTime))}ms` : \"\";\n\t\t\tthis._add({\n\t\t\t\ttool: \"action\",\n\t\t\t\tatMs: entry.endTime ?? entry.startTime,\n\t\t\t\tlabel: `${entry.actionId} ${glyph}${ms}`,\n\t\t\t\ttone: ACTION_TONE[entry.status] ?? \"info\",\n\t\t\t\ttarget: { cuid: entry.cuid }\n\t\t\t});\n\t\t}\n\t}\n\tfeedRealmSnapshot(snapshot) {\n\t\tif (!this._realmSeeded) {\n\t\t\tfor (const realm of snapshot.realms) if (realm.events[0] != null) this._lastRealmEventCuid.set(realm.id, realm.events[0].cuid);\n\t\t\tthis._realmSeeded = true;\n\t\t\treturn;\n\t\t}\n\t\tfor (const realm of snapshot.realms) {\n\t\t\tconst last = this._lastRealmEventCuid.get(realm.id);\n\t\t\tconst fresh = [];\n\t\t\tfor (const event of realm.events) {\n\t\t\t\tif (event.cuid === last) break;\n\t\t\t\tfresh.push(event);\n\t\t\t}\n\t\t\tif (realm.events[0] != null) this._lastRealmEventCuid.set(realm.id, realm.events[0].cuid);\n\t\t\tfor (const event of fresh.reverse()) this._add({\n\t\t\t\ttool: \"realm\",\n\t\t\t\tatMs: event.atMs,\n\t\t\t\tlabel: `${realm.label} · ${event.label}`,\n\t\t\t\ttone: event.tone,\n\t\t\t\ttarget: {\n\t\t\t\t\tcuid: event.cuid,\n\t\t\t\t\trealmId: realm.id\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tfeedSample(sample) {\n\t\tif (sample.lane === \"keepalive\") this._add({\n\t\t\ttool: \"link\",\n\t\t\tatMs: sample.atMs,\n\t\t\tlabel: \"keepalive\",\n\t\t\ttone: \"info\",\n\t\t\tgroupKey: \"keepalive\"\n\t\t});\n\t\telse if (sample.lane === \"handshake\") this._add({\n\t\t\ttool: \"link\",\n\t\t\tatMs: sample.atMs,\n\t\t\tlabel: \"handshake\",\n\t\t\ttone: \"info\",\n\t\t\tgroupKey: \"handshake\"\n\t\t});\n\t}\n\tgetEntries() {\n\t\treturn this._entries;\n\t}\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\tlistener(this._entries);\n\t\treturn () => {\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\tclear() {\n\t\tthis._entries = [];\n\t\tthis._notify();\n\t}\n\t_add(input) {\n\t\tconst head = this._entries[0];\n\t\tif (head != null && input.groupKey != null && head.groupKey === input.groupKey && input.atMs - head.atMs < GROUP_WINDOW_MS) {\n\t\t\thead.count += 1;\n\t\t\thead.atMs = input.atMs;\n\t\t\tthis._entries = [{ ...head }, ...this._entries.slice(1)];\n\t\t\tthis._notify();\n\t\t\treturn;\n\t\t}\n\t\tconst entry = {\n\t\t\tcuid: `evt_${++this._counter}`,\n\t\t\tcount: 1,\n\t\t\t...input\n\t\t};\n\t\tthis._entries = [entry, ...this._entries];\n\t\tif (this._entries.length > this._maxEvents) this._entries.length = this._maxEvents;\n\t\tthis._notify();\n\t}\n\t_notify() {\n\t\tfor (const listener of [...this._listeners]) listener(this._entries);\n\t}\n};\n//#endregion\n//#region src/remote/summarizeShape.ts\n/**\n* Reduce any cloneable value to its shape: objects keep their keys and nesting (structure), arrays\n* report their length, strings report their length, and every other primitive becomes its type name.\n* `null`/`undefined` pass through as themselves — a structural fact (\"this field is empty\"), not a\n* secret. A window's panel still renders a tree; it just reads `number` / `string(12)` / `{\"[…]\": 3}`\n* where a value would be, so no leaf value ever leaves the producer.\n*/\nfunction summarizeShape(value) {\n\tif (value === null) return null;\n\tif (value === void 0) return void 0;\n\tif (Array.isArray(value)) return { \"[…]\": value.length };\n\tconst type = typeof value;\n\tif (type === \"object\") {\n\t\tconst out = {};\n\t\tfor (const [key, child] of Object.entries(value)) out[key] = summarizeShape(child);\n\t\treturn out;\n\t}\n\tif (type === \"string\") return `string(${value.length})`;\n\treturn type;\n}\n//#endregion\n//#region src/remote/transport.ts\n/**\n* A same-origin `BroadcastChannel` transport. Because BroadcastChannel is\n* strictly same-origin, a page on another origin cannot read this stream — the\n* whole local pop-out path carries no cross-origin exposure. Returns a no-op\n* transport where BroadcastChannel is unavailable (SSR / very old runtimes).\n*/\nfunction createBroadcastChannelTransport(key) {\n\tif (typeof BroadcastChannel === \"undefined\") return {\n\t\tpost: () => {},\n\t\tonMessage: () => () => {},\n\t\tclose: () => {},\n\t\torigin: \"local\"\n\t};\n\tconst channel = new BroadcastChannel(devtoolsChannelName(key));\n\tconst listeners = /* @__PURE__ */ new Set();\n\tchannel.onmessage = (event) => {\n\t\tfor (const listener of [...listeners]) listener(event.data, \"local\");\n\t};\n\treturn {\n\t\torigin: \"local\",\n\t\tpost(message) {\n\t\t\tchannel.postMessage(message);\n\t\t},\n\t\tonMessage(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tlisteners.clear();\n\t\t\tchannel.onmessage = null;\n\t\t\tchannel.close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/remote/windowPresence.ts\nfunction presenceChannelName(key) {\n\treturn `${devtoolsChannelName(key)}:window-presence`;\n}\n/**\n* App side. Ask whether a devtools window is already open for this app key, and\n* if so nudge it to the foreground. Resolves `true` when a responder answers (the\n* caller must NOT open another), or `false` after `timeoutMs` of silence (none\n* open → open one).\n*\n* Keep `timeoutMs` short: on the `false` path the caller opens a window with\n* `window.open`, which needs the click's still-live transient activation — a long\n* wait would burn it and trip the popup blocker. A BroadcastChannel round-trip is\n* sub-millisecond, so the default leaves a wide margin.\n*/\nfunction focusExistingDevtoolsWindow(key, timeoutMs = 200) {\n\tif (typeof BroadcastChannel === \"undefined\") return Promise.resolve(false);\n\treturn new Promise((resolve) => {\n\t\tconst channel = new BroadcastChannel(presenceChannelName(key));\n\t\tconst nonce = Math.floor(Math.random() * 2 ** 31);\n\t\tlet settled = false;\n\t\tconst finish = (found) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tclearTimeout(timer);\n\t\t\tchannel.onmessage = null;\n\t\t\tchannel.close();\n\t\t\tresolve(found);\n\t\t};\n\t\tchannel.onmessage = (event) => {\n\t\t\tconst data = event.data;\n\t\t\tif (data != null && typeof data === \"object\" && data.t === \"here\" && data.nonce === nonce) finish(true);\n\t\t};\n\t\tconst timer = setTimeout(() => finish(false), timeoutMs);\n\t\tchannel.postMessage({\n\t\t\tt: \"ping\",\n\t\t\tnonce\n\t\t});\n\t});\n}\n/**\n* Low-level responder: on each focus ping, call `onPing`. If it returns `true`\n* (a window exists and was — best-effort — brought forward) the ping is answered,\n* so the asking tab skips `window.open`; returning `false` stays silent so another\n* responder can answer instead. Returns cleanup.\n*/\nfunction onDevtoolsFocusPing(key, onPing) {\n\tif (typeof BroadcastChannel === \"undefined\") return () => {};\n\tconst channel = new BroadcastChannel(presenceChannelName(key));\n\tchannel.onmessage = (event) => {\n\t\tconst data = event.data;\n\t\tif (data == null || typeof data !== \"object\" || data.t !== \"ping\") return;\n\t\tif (onPing()) channel.postMessage({\n\t\t\tt: \"here\",\n\t\t\tnonce: data.nonce\n\t\t});\n\t};\n\treturn () => {\n\t\tchannel.onmessage = null;\n\t\tchannel.close();\n\t};\n}\n/**\n* Devtools-window side. Announce that this window can serve `key` and self-focus\n* (best-effort) on a ping, so an app's launcher finds it and skips `window.open`.\n* This is the fallback foregrounder for when the tab that opened the window has\n* since closed; while that opener tab is alive, {@link serveDevtoolsOpenerFocus}\n* does the *reliable* raising. Call once when the window mounts; returns cleanup.\n*/\nfunction serveDevtoolsWindowPresence(key) {\n\tif (typeof window === \"undefined\") return () => {};\n\treturn onDevtoolsFocusPing(key, () => {\n\t\ttry {\n\t\t\twindow.focus();\n\t\t} catch {}\n\t\treturn true;\n\t});\n}\n/**\n* Newest-window-wins presence for a workspace window (PLAN-devtools-cli §3.6.3): announce a\n* takeover for `key`, then listen so a LATER window can take over from this one.\n*\n* This deliberately inverts the ping/close-self dedupe. A window buried behind other windows cannot\n* raise itself (browsers ignore un-activated `focus()`), so \"new window detects a sibling and\n* closes itself\" left the user staring at a flash-closed popup with the real window still buried —\n* dedupe that reads as breakage. The freshly opened window is the one browser-focus rules\n* *guarantee* is in front (it came from a click), so it survives and every earlier sibling closes\n* itself via `onDisplaced` — same one-window invariant, and the surviving window is always the one\n* the user is looking at. `BroadcastChannel` never echoes to its poster, so the announcing window\n* cannot displace itself.\n*\n* Scope `key` by workspace id, never bare topology: two workspaces on one dashboard must not\n* displace each other. Call once when the window page boots; returns cleanup.\n*/\nfunction claimDevtoolsWindowPresence(key, onDisplaced) {\n\tif (typeof BroadcastChannel === \"undefined\") return () => {};\n\tconst channel = new BroadcastChannel(presenceChannelName(key));\n\tchannel.onmessage = (event) => {\n\t\tconst data = event.data;\n\t\tif (data != null && typeof data === \"object\" && data.t === \"takeover\") onDisplaced();\n\t};\n\tchannel.postMessage({ t: \"takeover\" });\n\treturn () => {\n\t\tchannel.onmessage = null;\n\t\tchannel.close();\n\t};\n}\n/**\n* Opener side (app tab). Answer other tabs' focus pings by raising the devtools\n* window THIS tab opened, via its live handle (`getWindow`). A tab may focus a\n* popup it opened, so this reliably foregrounds the window even for a *different*\n* tab — the one that can't self-raise it. Stays silent (no ack) when this tab\n* holds no live handle, letting the window-side responder answer instead. Call\n* once (e.g. where the app starts its devtools bridge); returns cleanup.\n*/\nfunction serveDevtoolsOpenerFocus(key, getWindow) {\n\treturn onDevtoolsFocusPing(key, () => {\n\t\tconst win = getWindow();\n\t\tif (win == null || win.closed) return false;\n\t\ttry {\n\t\t\twin.focus();\n\t\t} catch {}\n\t\treturn true;\n\t});\n}\n//#endregion\n//#region src/traffic/combineTrafficSnapshots.ts\nconst COMBINED_TOP_FRAMES = 12;\nfunction addDir(a, b) {\n\treturn {\n\t\tcount: a.count + b.count,\n\t\tbytes: a.bytes + b.bytes\n\t};\n}\n/** Rates are additive across independent streams: combined throughput = sum of throughputs. */\nfunction addRate(a, b) {\n\treturn {\n\t\tcount: a.count + b.count,\n\t\tbytes: a.bytes + b.bytes,\n\t\tmsgsPerSec: a.msgsPerSec + b.msgsPerSec,\n\t\tbytesPerSec: a.bytesPerSec + b.bytesPerSec\n\t};\n}\nfunction egressBytes(link) {\n\treturn link.out.bytes + link.in.bytes;\n}\nfunction laneBytes(lane) {\n\treturn lane.out.bytes + lane.in.bytes;\n}\nfunction mergeKinds(into, from) {\n\tconst byKind = /* @__PURE__ */ new Map();\n\tfor (const kind of into) byKind.set(kind.kind, {\n\t\tkind: kind.kind,\n\t\tin: { ...kind.in },\n\t\tout: { ...kind.out }\n\t});\n\tfor (const kind of from) {\n\t\tconst cur = byKind.get(kind.kind);\n\t\tif (cur == null) byKind.set(kind.kind, {\n\t\t\tkind: kind.kind,\n\t\t\tin: { ...kind.in },\n\t\t\tout: { ...kind.out }\n\t\t});\n\t\telse {\n\t\t\tcur.in = addDir(cur.in, kind.in);\n\t\t\tcur.out = addDir(cur.out, kind.out);\n\t\t}\n\t}\n\treturn [...byKind.values()];\n}\n/**\n* Sum several clients' traffic snapshots into one — what the meta sidebar shows in\n* lanes mode (\"traffic · N clients\"). Window totals, lane breakdowns and the rate\n* series add straight up (rates included — independent streams' throughputs sum).\n* Per-**client** link rows are prefixed with the source label so two clients that\n* dial the same server don't collapse into one row; the reserved `(handshaking)` /\n* `(other links)` buckets merge across clients so the per-link totals still\n* reconcile with the headline totals. Largest frames merge and re-sort, each\n* tagged with its client.\n*/\nfunction combineTrafficSnapshots(inputs) {\n\tif (inputs.length === 0) return emptySnapshot();\n\tif (inputs.length === 1) return inputs[0].snapshot;\n\tconst first = inputs[0].snapshot;\n\tconst windows = first.windows.map((base) => {\n\t\tlet inR = { ...base.in };\n\t\tlet outR = { ...base.out };\n\t\tfor (let i = 1; i < inputs.length; i++) {\n\t\t\tconst match = inputs[i].snapshot.windows.find((w) => w.windowMs === base.windowMs);\n\t\t\tif (match != null) {\n\t\t\t\tinR = addRate(inR, match.in);\n\t\t\t\toutR = addRate(outR, match.out);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\twindowMs: base.windowMs,\n\t\t\tin: inR,\n\t\t\tout: outR\n\t\t};\n\t});\n\tconst laneMap = /* @__PURE__ */ new Map();\n\tfor (const { snapshot } of inputs) for (const lane of snapshot.lanes) {\n\t\tconst cur = laneMap.get(lane.lane);\n\t\tif (cur == null) laneMap.set(lane.lane, {\n\t\t\tlane: lane.lane,\n\t\t\tin: { ...lane.in },\n\t\t\tout: { ...lane.out },\n\t\t\tkinds: lane.kinds.map((k) => ({\n\t\t\t\tkind: k.kind,\n\t\t\t\tin: { ...k.in },\n\t\t\t\tout: { ...k.out }\n\t\t\t}))\n\t\t});\n\t\telse {\n\t\t\tcur.in = addRate(cur.in, lane.in);\n\t\t\tcur.out = addRate(cur.out, lane.out);\n\t\t\tcur.kinds = mergeKinds(cur.kinds, lane.kinds);\n\t\t}\n\t}\n\tconst lanes = [...laneMap.values()].sort((a, b) => laneBytes(b) - laneBytes(a));\n\tconst reserved = /* @__PURE__ */ new Map();\n\tconst realLinks = [];\n\tfor (const { label, snapshot } of inputs) for (const link of snapshot.links) if (link.linkId === \"(handshaking)\" || link.linkId === \"(other links)\") {\n\t\tconst cur = reserved.get(link.linkId);\n\t\tif (cur == null) reserved.set(link.linkId, {\n\t\t\tlinkId: link.linkId,\n\t\t\tin: { ...link.in },\n\t\t\tout: { ...link.out },\n\t\t\tlanes: link.lanes.map((l) => ({\n\t\t\t\tlane: l.lane,\n\t\t\t\tin: { ...l.in },\n\t\t\t\tout: { ...l.out }\n\t\t\t}))\n\t\t});\n\t\telse {\n\t\t\tcur.in = addRate(cur.in, link.in);\n\t\t\tcur.out = addRate(cur.out, link.out);\n\t\t}\n\t} else realLinks.push({\n\t\tlinkId: `${label} · ${link.linkId}`,\n\t\tin: { ...link.in },\n\t\tout: { ...link.out },\n\t\tlanes: link.lanes.map((l) => ({\n\t\t\tlane: l.lane,\n\t\t\tin: { ...l.in },\n\t\t\tout: { ...l.out }\n\t\t}))\n\t});\n\tconst links = [...realLinks, ...reserved.values()].sort((a, b) => egressBytes(b) - egressBytes(a));\n\tconst bucketMap = /* @__PURE__ */ new Map();\n\tfor (const { snapshot } of inputs) for (const point of snapshot.series) {\n\t\tconst cur = bucketMap.get(point.atMs);\n\t\tif (cur == null) bucketMap.set(point.atMs, { ...point });\n\t\telse {\n\t\t\tcur.inCount += point.inCount;\n\t\t\tcur.inBytes += point.inBytes;\n\t\t\tcur.outCount += point.outCount;\n\t\t\tcur.outBytes += point.outBytes;\n\t\t}\n\t}\n\tconst series = [...bucketMap.values()].sort((a, b) => a.atMs - b.atMs);\n\tconst topFrames = inputs.flatMap(({ label, snapshot }) => snapshot.topFrames.map((frame) => ({\n\t\t...frame,\n\t\tlane: `${label} · ${frame.lane}`\n\t}))).sort((a, b) => b.bytes - a.bytes).slice(0, COMBINED_TOP_FRAMES);\n\tlet lifetimeIn = {\n\t\tcount: 0,\n\t\tbytes: 0\n\t};\n\tlet lifetimeOut = {\n\t\tcount: 0,\n\t\tbytes: 0\n\t};\n\tlet sinceMs = Number.POSITIVE_INFINITY;\n\tlet resetFromWake = false;\n\tfor (const { snapshot } of inputs) {\n\t\tlifetimeIn = addDir(lifetimeIn, snapshot.lifetime.in);\n\t\tlifetimeOut = addDir(lifetimeOut, snapshot.lifetime.out);\n\t\tsinceMs = Math.min(sinceMs, snapshot.lifetime.sinceMs);\n\t\tresetFromWake = resetFromWake || snapshot.lifetime.resetFromWake === true;\n\t}\n\treturn {\n\t\twindowMs: first.windowMs,\n\t\twindows,\n\t\tlanes,\n\t\tlinks,\n\t\tseries,\n\t\tseriesBucketMs: first.seriesBucketMs,\n\t\ttopFrames,\n\t\tlifetime: {\n\t\t\tin: lifetimeIn,\n\t\t\tout: lifetimeOut,\n\t\t\tsinceMs: Number.isFinite(sinceMs) ? sinceMs : Date.now(),\n\t\t\t...resetFromWake ? { resetFromWake: true } : {}\n\t\t}\n\t};\n}\nfunction emptySnapshot() {\n\treturn {\n\t\twindowMs: Number.POSITIVE_INFINITY,\n\t\twindows: [],\n\t\tlanes: [],\n\t\tlinks: [],\n\t\tseries: [],\n\t\tseriesBucketMs: 1e3,\n\t\ttopFrames: [],\n\t\tlifetime: {\n\t\t\tin: {\n\t\t\t\tcount: 0,\n\t\t\t\tbytes: 0\n\t\t\t},\n\t\t\tout: {\n\t\t\t\tcount: 0,\n\t\t\t\tbytes: 0\n\t\t\t},\n\t\t\tsinceMs: Date.now()\n\t\t}\n\t};\n}\n/**\n* Present several traffic cores as ONE snapshot source: every `getSnapshot` combines\n* a fresh snapshot from each, and `subscribe` fans a single listener across all of\n* them. Pass the result straight to the traffic panel — it can't tell the difference.\n*/\nfunction createCombinedTrafficSource(sources) {\n\treturn {\n\t\tgetSnapshot(query) {\n\t\t\treturn combineTrafficSnapshots(sources.map((source) => ({\n\t\t\t\tlabel: source.label,\n\t\t\t\tsnapshot: source.core.getSnapshot(query)\n\t\t\t})));\n\t\t},\n\t\tsubscribe(listener) {\n\t\t\tconst unsubscribes = sources.map((source) => source.core.subscribe(listener));\n\t\t\treturn () => {\n\t\t\t\tfor (const unsubscribe of unsubscribes) unsubscribe();\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\n//#region src/traffic/frameByteSize.ts\nlet encoder;\n/**\n* The transmitted size of one frame: `byteLength` for binary frames, UTF-8\n* length for strings (what a WebSocket text frame actually carries — `length`\n* under-counts any non-ASCII). Unknown shapes measure 0 rather than throwing.\n*/\nfunction frameByteSize(frame) {\n\tif (typeof frame === \"string\") {\n\t\tif (encoder == null) encoder = new TextEncoder();\n\t\treturn encoder.encode(frame).byteLength;\n\t}\n\tif (frame instanceof Uint8Array) return frame.byteLength;\n\tif (frame instanceof ArrayBuffer) return frame.byteLength;\n\tif (typeof SharedArrayBuffer !== \"undefined\" && frame instanceof SharedArrayBuffer) return frame.byteLength;\n\tif (ArrayBuffer.isView(frame)) return frame.byteLength;\n\treturn 0;\n}\n//#endregion\nexport { DEFAULT_TRAFFIC_WINDOW_MS, DEVTOOLS_DISCOVERY_BASE, DEVTOOLS_ENSURE_PATH, DEVTOOLS_HANDOFF_PATH, DEVTOOLS_PROTOCOL_VERSION, DEVTOOLS_RELAY_DEFAULT_PORT, DEVTOOLS_RELAY_PROXY_PATH, DEVTOOLS_RELAY_ROLE_PARAM, DEVTOOLS_STATUS_PATH, DEVTOOLS_WINDOW_ENTRY_PATH, DEVTOOLS_WINDOW_PATH, DEVTOOLS_WIRE_PREFIX, DEVTOOLS_WIRE_PROTOCOL_ID, DevtoolsBridge, DevtoolsWindowClient, EventLogCore, MAX_TRAFFIC_WINDOW_MS, REMOTE_SESSION_ENDED_CLOSE_CODE, RemoteServerDevtoolsCore, SERVER_SCOPE_PREFIX, STANDARD_TRAFFIC_WINDOWS_MS, TRAFFIC_LINK_HANDSHAKING, TRAFFIC_LINK_OTHER, TRAFFIC_WINDOW_MS_FIFTEEN_MINUTES, TRAFFIC_WINDOW_MS_FIVE_MINUTES, TRAFFIC_WINDOW_MS_ONE_MINUTE, TRAFFIC_WINDOW_OPTIONS_MS, TopologyCore, TrafficMetricsCore, backendClientId, backendLabel, claimDevtoolsWindowPresence, combineTrafficSnapshots, createAcceptorTransport, createBroadcastChannelTransport, createClientDevtoolsHost, createCombinedTrafficSource, createDiscoveredRelayTransport, createFanoutTransport, createMergedTrafficCore, createRelayDiscovery, createRemoteSessionCarrier, createRemoteTrafficCore, createServerDevtoolsHost, createWebSocketTransport, createWireDevtoolsAcceptorProtocol, createWireDevtoolsHost, createWireDevtoolsTransport, defaultLocalRelayUrl, devtoolsChannelName, devtoolsTokensMatch, devtoolsWindowUrl, durableObjectClientId, focusExistingDevtoolsWindow, frameByteSize, frontendClientId, frontendLabel, inertWireDevtoolsHost, isDevtoolsEnabled, isLocalHost, normalizeBackendDialUrl, onDevtoolsFocusPing, parseCliDevtoolsStatus, parseDevtoolsRelayRole, readDevtoolsWindowParams, relayUrlFor, relayUrlForTopology, relayUrlFromStatus, remoteSessionJoinUrl, resolveCoordinate, serveDevtoolsOpenerFocus, serveDevtoolsWindowPresence, summarizeShape, toCloneable, topologyPeerEnvId, trafficSampleScope };\n\n//# sourceMappingURL=index.mjs.map","/** Relative sizing step for primitives that scale (Chip, and 1.3's buttons). */\nexport enum ESize {\n  sm = \"sm\",\n  md = \"md\",\n  lg = \"lg\",\n}\n\n/** The multiplier a size step applies to a primitive's intrinsic dimensions. */\nexport function getSizeValue(size: ESize): number {\n  switch (size) {\n    case ESize.sm:\n      return 0.75;\n    case ESize.md:\n      return 1;\n    case ESize.lg:\n      return 1.2;\n    default:\n      return 1;\n  }\n}\n","// 1.6 — the `err_ui` domain.\n//\n// Declared the way this repo declares one (`err_nice.createChildDomain`, per\n// `common-errors/src/validation`), so a nice-ui failure is castable, serialisable and matchable\n// alongside every other domain rather than being a bare `Error` a caller has to string-match.\n//\n// ⚠ Studio's codes are `err_ui_studio` and are declared in 2.1. These are the LIBRARY's failures —\n// the ones a consumer can hit by handing nice-ui a theme or a style reference it cannot accept.\n//\n// No `defaultHttpStatusCode`: none of these cross an HTTP boundary. A UI library that assigns\n// status codes to its own render-time failures is guessing about a transport it never sees.\n\nimport { err, err_nice } from \"@nice-code/error\";\n\nexport enum EErrId_Ui {\n  /** A theme value carried CSS-terminating characters and would have escaped its declaration. */\n  unsafe_css_value = \"unsafe_css_value\",\n  /** `withAlpha` received something that is not a 6-digit hex colour. */\n  alpha_derivation_unsupported = \"alpha_derivation_unsupported\",\n  /** A style-reference document could not be read at all. */\n  style_reference_unreadable = \"style_reference_unreadable\",\n  /** A compiled theme failed the contrast table with no covering ledger entry. */\n  contrast_failed = \"contrast_failed\",\n}\n\nexport interface IErrContext_UnsafeCssValue {\n  property: string;\n  value: string;\n}\n\nexport interface IErrContext_AlphaDerivation {\n  value: string;\n}\n\nexport interface IErrContext_StyleReferenceUnreadable {\n  reason: string;\n  line?: number;\n  column?: number;\n}\n\nexport interface IErrContext_ContrastFailed {\n  /** `role on surface` pairs that failed, worst first. */\n  pairs: string[];\n  scheme: string;\n}\n\nexport const err_ui = err_nice.createChildDomain({\n  domain: \"err_ui\",\n  schema: {\n    [EErrId_Ui.unsafe_css_value]: err<IErrContext_UnsafeCssValue>({\n      message: ({ property, value }) =>\n        `nice-ui refused to emit ${property}: the value contains CSS-terminating characters ` +\n        `(${JSON.stringify(value)}). A theme compiled from an untrusted document cannot be ` +\n        \"allowed to close a declaration and open its own.\",\n    }),\n    [EErrId_Ui.alpha_derivation_unsupported]: err<IErrContext_AlphaDerivation>({\n      message: ({ value }) =>\n        `nice-ui cannot derive alpha from ${JSON.stringify(value)}: a 6-digit hex colour is ` +\n        \"required. Appending alpha to an rgb()/rgba() value produces a string that is not a \" +\n        \"colour at all, and the style silently drops.\",\n    }),\n    [EErrId_Ui.style_reference_unreadable]: err<IErrContext_StyleReferenceUnreadable>({\n      message: ({ reason, line, column }) =>\n        `nice-ui could not read the style reference: ${reason}` +\n        (line != null ? ` (line ${line}${column != null ? `, column ${column}` : \"\"})` : \"\"),\n    }),\n    [EErrId_Ui.contrast_failed]: err<IErrContext_ContrastFailed>({\n      message: ({ pairs, scheme }) =>\n        `nice-ui: ${pairs.length} contrast pair(s) fail in the ${scheme} scheme with no ledger ` +\n        `entry: ${pairs.slice(0, 5).join(\", \")}${pairs.length > 5 ? \", …\" : \"\"}.`,\n    }),\n  },\n});\n","// 1.0 — the canonical role vocabulary.\n//\n// This exists because 1.1 and 1.4 would otherwise need two disjoint vocabularies with no mapping\n// between them. The seed palette speaks `DEVTOOL_*` (35 exported constants in\n// `nice-devtools-shared/src/colors.ts`); the shipped style-reference prototype speaks Material 3\n// (47 colour roles in `design_examples/compact_devtools_screen/DESIGN.md`). Neither is the\n// vocabulary — this is, and `./m3.ts` is the bridge from the second one.\n//\n// Naming rule: a role says what it is FOR, never what it looks like. `surfaceRaised`, not\n// `surfaceGrey700`. A theme that renames a colour must not have to rename a role.\n\n/** Every colour role, as a const tuple — the single source of truth for the key set. */\nexport const NICE_UI_COLOR_ROLES = [\n  // ─── Text hierarchy — four levels, no intermediate aliases ───\n  \"textEmphasis\",\n  \"textSecondary\",\n  \"textMuted\",\n  \"textFaint\",\n\n  // ─── Semantic status — every status colour must resolve to one of these five ───\n  \"semanticError\",\n  \"semanticSuccess\",\n  \"semanticSystem\",\n  \"semanticWarning\",\n  \"semanticMetadata\",\n\n  // ─── Accent pairs. Present so an M3 document has somewhere to land, and so 1.3's contrast\n  //     table can check on-X against X rather than guessing which text sits on an accent. ───\n  \"primary\",\n  \"onPrimary\",\n  \"errorSurface\",\n  \"onErrorSurface\",\n\n  // ─── Surfaces, darkest first. `surfaceVoid` is deliberately below every panel background so a\n  //     gutter painted with it reads as a channel between floating cards, not a shared seam. ───\n  \"surfaceVoid\",\n  \"surfaceBase\",\n  \"surfaceSelected\",\n  \"surfaceDetail\",\n  \"surfaceDetailHeader\",\n  \"surfaceSection\",\n  \"surfaceSectionAlt\",\n\n  // ─── Borders ───\n  \"borderPanel\",\n  \"borderDivider\",\n\n  // ─── Overlays and elevation. Scheme-varying: a dark-tuned rgba backdrop is wrong on light. ───\n  \"dialogBackdrop\",\n  \"tooltipBackground\",\n  \"tooltipTitleBackground\",\n  \"tooltipTitleBorder\",\n  \"tooltipBorder\",\n\n  // ─── JSON syntax highlighting ───\n  \"jsonKey\",\n  \"jsonString\",\n  \"jsonNumber\",\n  \"jsonKeyword\",\n  \"jsonPunctuation\",\n\n  // ─── Chrome the injected <style> block owns, which inline styles cannot express. 1.5 tokenises\n  //     the two raw hexes currently sitting in `nice-devtools-shared/src/styles.ts:20-21`. ───\n  \"scrollbarThumb\",\n  \"scrollbarThumbHover\",\n  \"focusRing\",\n] as const;\n\nexport type TNiceUiColorRole = (typeof NICE_UI_COLOR_ROLES)[number];\n\n/**\n * The colours of one scheme. No optional members: a role cannot be added to `dark` and forgotten in\n * `light`, because that is exactly how a light mode ships broken (1.1).\n */\nexport type TNiceUiSchemeColors = Record<TNiceUiColorRole, string>;\n\n/**\n * Array-valued theme data. `laneAccents` is a mutually-distinct hue per selected client, assigned by\n * position — plain data plus a helper, not a set of numbered roles, because the count is a property\n * of the theme rather than of the vocabulary.\n */\nexport interface INiceUiSchemeArrays {\n  laneAccents: readonly string[];\n}\n\nexport type TNiceUiScheme = TNiceUiSchemeColors & INiceUiSchemeArrays;\n\n/** The accent for the Nth item, wrapping when there are more items than hues. */\nexport function laneAccent(accents: readonly string[], index: number): string {\n  if (accents.length === 0) {\n    throw new Error(\"laneAccent: the theme declares no lane accents\");\n  }\n  const count = accents.length;\n  const at = ((index % count) + count) % count;\n  // `accents` is non-empty and `at` is within bounds, so this is defined.\n  return accents[at] as string;\n}\n\nconst ROLE_LOOKUP: ReadonlySet<string> = new Set(NICE_UI_COLOR_ROLES);\n\nexport function isNiceUiColorRole(value: string): value is TNiceUiColorRole {\n  return ROLE_LOOKUP.has(value);\n}\n","// 1.2 — the theme transport (D8).\n//\n// The theme travels as DOM CSS custom properties, not React context. Premise 7 is why: this package\n// is private and source-only, so every published dependant bundles its own evaluated copy and each\n// bundle gets a distinct React Context identity. \"One provider themes all nice-code UI\" therefore\n// cannot be built on context. Custom properties inherit through the DOM regardless of how many\n// copies of React or of this package are on the page.\n//\n// The payoff beyond cross-bundle identity: once the style element is injected, `system` mode's CSS\n// variables repaint from the media query with no attribute mutation. A mounted provider still\n// subscribes and re-renders its bundle-local context value when the resolved scheme changes.\n//\n// ⚠ Both schemes emit the SAME variable names. A component reads `--nice-ui-text-emphasis` and never\n// learns which scheme is active — which is what makes a scheme switch a pure paint.\n\nimport { EErrId_Ui, err_ui } from \"../errors\";\nimport type { TNiceUiColorRole } from \"./roles\";\nimport { NICE_UI_COLOR_ROLES } from \"./roles\";\nimport type { INiceUiTheme, TNiceUiSchemeName } from \"./theme\";\n\nexport const NICE_UI_SCHEME_ATTRIBUTE = \"data-nice-ui-scheme\";\nexport const NICE_UI_SCHEME_SOURCE_ATTRIBUTE = \"data-nice-ui-scheme-source\";\n\nconst PREFIX = \"--nice-ui\";\n\n/** `textEmphasis` → `--nice-ui-text-emphasis`. Semantic by construction: roles are named by use. */\nexport function colorVariableName(role: TNiceUiColorRole): string {\n  return `${PREFIX}-${role.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;\n}\n\nexport function laneAccentVariableName(index: number): string {\n  return `${PREFIX}-lane-accent-${index}`;\n}\n\n/**\n * Reject anything that could terminate a declaration and start a new one.\n *\n * This is not defensive programming for its own sake. From 1.4 a theme can be compiled from a\n * `DESIGN.md` a *model* proposed, and from 5.2 from one distilled out of an image — Appendix B's\n * threat (4) is untrusted model output reaching somewhere it executes. A value carrying `;` or `}`\n * escapes its declaration and can add arbitrary rules; a `<` can close the surrounding `<style>`.\n * The check belongs here, at the one place values become CSS text, rather than at each caller.\n */\nconst FORBIDDEN_IN_VALUE = /[;{}<>\\\\]|\\/\\*|\\*\\//;\n\nfunction declaration(property: string, value: string): string {\n  if (FORBIDDEN_IN_VALUE.test(value)) {\n    throw err_ui.fromId(EErrId_Ui.unsafe_css_value, { property, value });\n  }\n  return `${property}: ${value};`;\n}\n\nfunction schemeDeclarations(theme: INiceUiTheme, scheme: TNiceUiSchemeName): string[] {\n  const colors = theme.schemes[scheme];\n  const out: string[] = [];\n  for (const role of NICE_UI_COLOR_ROLES) {\n    out.push(declaration(colorVariableName(role), colors[role]));\n  }\n  colors.laneAccents.forEach((accent, index) => {\n    out.push(declaration(laneAccentVariableName(index), accent));\n  });\n  out.push(declaration(`${PREFIX}-lane-accent-count`, String(colors.laneAccents.length)));\n  // Makes UA scrollbars, form controls and the canvas follow the scheme. Without it a light page\n  // still paints a dark native scrollbar, which is the first thing anyone notices.\n  out.push(declaration(\"color-scheme\", scheme));\n  return out;\n}\n\n/**\n * A numeric px value becomes CSS text HERE and nowhere else (D19, 1.2a): the theme model carries\n * bare numbers so the same data serves a future RN transport, and this being the single\n * stringification point is what shrinks the sanitizer's untrusted surface — a compiled theme's\n * dimensions must already be numbers by the time they arrive.\n */\nfunction px(property: string, value: number): string {\n  if (!Number.isFinite(value)) {\n    throw err_ui.fromId(EErrId_Ui.unsafe_css_value, { property, value: String(value) });\n  }\n  return `${property}: ${value}px;`;\n}\n\n/**\n * Join a single primary family + fallbacks into the CSS font-family list, quoting any name that\n * needs it. The model splits them (RN takes exactly one family name); the DOM list is derived.\n */\nfunction fontFamilyList(primary: string, fallbacks: readonly string[]): string {\n  return [primary, ...fallbacks]\n    .map((name) => (/^[a-zA-Z][a-zA-Z0-9-]*$/.test(name) ? name : `'${name.replace(/'/g, \"\")}'`))\n    .join(\", \");\n}\n\n/** Typography, rounded, spacing and elevation geometry — emitted once, identical in every scheme. */\nfunction invariantDeclarations(theme: INiceUiTheme): string[] {\n  const out: string[] = [];\n  for (const [role, style] of Object.entries(theme.typography)) {\n    const base = `${PREFIX}-font-${role.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`)}`;\n    out.push(\n      declaration(`${base}-family`, fontFamilyList(style.fontFamily, style.fontFamilyFallbacks)),\n    );\n    out.push(px(`${base}-size`, style.fontSize));\n    out.push(declaration(`${base}-weight`, style.fontWeight));\n    out.push(px(`${base}-line-height`, style.lineHeight));\n    if (style.letterSpacing != null) {\n      out.push(px(`${base}-letter-spacing`, style.letterSpacing));\n    }\n  }\n  for (const [key, value] of Object.entries(theme.rounded)) {\n    out.push(px(`${PREFIX}-rounded-${key}`, value));\n  }\n  for (const [key, value] of Object.entries(theme.spacing)) {\n    out.push(px(`${PREFIX}-space-${key}`, value));\n  }\n  for (const [level, geometry] of Object.entries(theme.elevation)) {\n    out.push(px(`${PREFIX}-elevation-${level}-offset-y`, geometry.offsetY));\n    out.push(px(`${PREFIX}-elevation-${level}-blur`, geometry.blur));\n    out.push(px(`${PREFIX}-elevation-${level}-spread`, geometry.spread));\n  }\n  return out;\n}\n\nfunction rule(selector: string, declarations: string[]): string {\n  return `${selector} {\\n  ${declarations.join(\"\\n  \")}\\n}`;\n}\n\n/**\n * The complete stylesheet for a theme, in three selector families.\n *\n * `system` emits the LIGHT values plainly and the DARK values inside\n * `@media (prefers-color-scheme: dark)`. That ordering matters: the media block must come after the\n * plain one so it wins on equal specificity, and it is what lets the OS repaint the token values\n * without a DOM attribute mutation.\n *\n * `scopeSelector` defaults to the attribute alone (any element carrying it, including `<html>`), so\n * a consumer can scope the whole theme to one subtree by passing e.g. `#devtools-panel`.\n */\nexport function buildThemeCss(theme: INiceUiTheme, scopeSelector = \"\"): string {\n  const at = (scheme: string): string =>\n    `${scopeSelector}[${NICE_UI_SCHEME_ATTRIBUTE}=\"${scheme}\"]`;\n  const invariant = invariantDeclarations(theme);\n\n  return [\n    rule(`${at(\"light\")}, ${at(\"dark\")}, ${at(\"system\")}`, invariant),\n    rule(at(\"light\"), schemeDeclarations(theme, \"light\")),\n    rule(at(\"dark\"), schemeDeclarations(theme, \"dark\")),\n    // `color-scheme: light dark` tells the UA both are supported, so its own controls follow the\n    // media query alongside our variables.\n    rule(at(\"system\"), [\n      ...schemeDeclarations(theme, \"light\").filter((d) => !d.startsWith(\"color-scheme\")),\n      declaration(\"color-scheme\", \"light dark\"),\n    ]),\n    `@media (prefers-color-scheme: dark) {\\n${rule(\n      at(\"system\"),\n      schemeDeclarations(theme, \"dark\").filter((d) => !d.startsWith(\"color-scheme\")),\n    )\n      .split(\"\\n\")\n      .map((line) => `  ${line}`)\n      .join(\"\\n\")}\\n}`,\n  ].join(\"\\n\\n\");\n}\n","// 1.1 — the default theme's two schemes. 1.2a — numeric dimensions, split font stacks, the light\n// palette re-authored to pass its tiers, and the onPrimary correction.\n//\n// `dark` reproduces the devtools palette exactly, so 6.1 can re-point `nice-devtools-shared` at this\n// package with no visible change. `test/fixtures/devtoolsPalette.frozen.ts` holds an independent\n// copy of those values and a test compares against it — deliberately duplicated, because after 6.1\n// a test importing both packages would compare a source against itself.\n//\n// `light` is AUTHORED. Programmatic inversion is banned outright, including as a fallback: it fails\n// the contrast table, and it turns a semantic error red into a cyan that means \"success\" to every\n// user who has ever seen a traffic light.\n\nimport type { TNiceUiScheme } from \"./roles\";\nimport type { INiceUiTheme } from \"./theme\";\n\nconst MONO = \"ui-monospace\";\nconst MONO_FALLBACKS = [\"Cascadia Code\", \"Source Code Pro\", \"monospace\"] as const;\nconst SANS = \"ui-sans-serif\";\nconst SANS_FALLBACKS = [\"system-ui\", \"sans-serif\"] as const;\n\nconst dark: TNiceUiScheme = {\n  textEmphasis: \"#f1f5f9\",\n  textSecondary: \"#cbd5e1\",\n  // 6.1a: was the seed's #64748b (3.05 worst, on surfaceSelected) — real body text in the 4.5\n  // tier. #8b9bb4 passes every surface (worst 5.14) and keeps the hierarchy step below\n  // textSecondary #cbd5e1.\n  textMuted: \"#8b9bb4\",\n  textFaint: \"#334155\",\n\n  semanticError: \"#FF5C5C\",\n  semanticSuccess: \"#A3E635\",\n  semanticSystem: \"#38BDF8\",\n  semanticWarning: \"#FB923C\",\n  semanticMetadata: \"#A1A1AA\",\n\n  primary: \"#38BDF8\",\n  // 1.2a correction: the earlier comment here claimed nothing paints text on a filled primary\n  // surface — false. PanelChrome.tsx:196 (SegmentedControl's active segment) paints #0f172a on\n  // #38BDF8, so THIS is the seed's real on-primary and 1.5's tokenization of that line is\n  // value-exact. (8.33:1 on primary; the fixture does not pin this role, which is exactly why the\n  // value had to be reconciled here rather than discovered as a 6.4 pixel diff.)\n  onPrimary: \"#0f172a\",\n  errorSurface: \"#1e0a0a\",\n  onErrorSurface: \"#FF5C5C\",\n\n  surfaceVoid: \"#05070d\",\n  surfaceBase: \"#0f172a\",\n  surfaceSelected: \"#1d2942\",\n  surfaceDetail: \"#0d1729\",\n  surfaceDetailHeader: \"#131f35\",\n  surfaceSection: \"#1e293b\",\n  surfaceSectionAlt: \"#0d131f\",\n\n  borderPanel: \"#1e293b\",\n  // 6.1a: was the seed's #1d3352 (1.14 worst). In the 3:1 control tier — SplitHandle is\n  // transparent at rest, so this edge is its only resting affordance. Worst 3.05 on\n  // surfaceSelected; the hairline stays a hairline, so the thinner margin is deliberate.\n  borderDivider: \"#64748b\",\n\n  dialogBackdrop: \"rgba(2, 6, 12, 0.65)\",\n  tooltipBackground: \"#0c1526\",\n  tooltipTitleBackground: \"#101b2e\",\n  tooltipTitleBorder: \"#211f5f\",\n  tooltipBorder: \"#312e81\",\n\n  jsonKey: \"#a5b4fc\",\n  jsonString: \"#fbbf24\",\n  jsonNumber: \"#34d399\",\n  jsonKeyword: \"#a78bfa\",\n  jsonPunctuation: \"#475569\",\n\n  // 6.1a: thumb was #334155 (1.40 worst), hover #475569 (1.91) — controls in the 3:1 tier,\n  // hover state included (WCAG 1.4.11 covers states). NOT #64748b for the thumb: light already\n  // owns that value for the same role and the parity test forbids verbatim reuse. Worst 3.37 /\n  // 5.66, and hover stays a clearly lighter step.\n  scrollbarThumb: \"#6b7b93\",\n  scrollbarThumbHover: \"#94a3b8\",\n  focusRing: \"#38BDF8\",\n\n  laneAccents: [\"#a78bfa\", \"#fbbf24\", \"#2dd4bf\", \"#f472b6\", \"#fb7185\", \"#818cf8\"],\n};\n\n// 6.1a landed: the four roles the 1.3 ledger froze for the 6.1 migration (textMuted,\n// borderDivider, scrollbarThumb, scrollbarThumbHover) are remediated above and the contrast\n// waiver ledger is EMPTY — the pair table now gates every dark role at its real tier, no waivers.\n// textFaint and jsonPunctuation stay decorative by CLASSIFICATION (argued in contrast.ts), which\n// is a statement about what they are for, not a lowered bar awaiting a fix.\n\nconst light: TNiceUiScheme = {\n  // Text darkens rather than inverting: slate-900 → slate-600 keeps the hierarchy's *rhythm*\n  // while every step stays a real reading colour on a white surface.\n  textEmphasis: \"#0f172a\",\n  textSecondary: \"#334155\",\n  textMuted: \"#4b5563\",\n  // 1.2a (REVIEW R3): was #94a3b8, which failed even the 3.0 decorative tier on every surface\n  // (2.08–2.56). slate-500 passes everywhere (3.86–4.76) while staying a visible step lighter than\n  // textMuted #4b5563 — #475569 would collapse the hierarchy step faint exists to provide.\n  textFaint: \"#64748b\",\n\n  // Status hues are re-picked, not darkened: the dark set is tuned for luminance against near-black\n  // and washes out on white. Each keeps its hue family so the meaning survives the scheme change.\n  // ⚠ 1.3 correction: success/warning were #4d7c0f/#b45309, which cleared 4.5 on surfaceSection\n  // (4.56/4.58) but FAILED on the three darker light surfaces — worst 4.05 on surfaceVoid. The\n  // 1.2a audit only paired them against surfaceSection; 1.3's full table pairs every text role\n  // against every surface, which is what caught it. Now 5.74/5.93 worst-case.\n  semanticError: \"#b91c1c\",\n  semanticSuccess: \"#3f6212\",\n  semanticSystem: \"#0369a1\",\n  semanticWarning: \"#9a3412\",\n  semanticMetadata: \"#52525b\",\n\n  primary: \"#0369a1\",\n  onPrimary: \"#ffffff\",\n  errorSurface: \"#fef2f2\",\n  onErrorSurface: \"#991b1b\",\n\n  // The depth ORDER inverts (the recessed surface is now the darker one) but the ordering itself is\n  // preserved, so a component that layers surfaceSection over surfaceBase still reads as raised.\n  surfaceVoid: \"#e2e8f0\",\n  surfaceBase: \"#ffffff\",\n  surfaceSelected: \"#dbeafe\",\n  surfaceDetail: \"#f8fafc\",\n  surfaceDetailHeader: \"#f1f5f9\",\n  surfaceSection: \"#f1f5f9\",\n  surfaceSectionAlt: \"#e9eef5\",\n\n  // borderPanel stays a light hairline: 1.3's border policy classifies it a decorative seam\n  // (panels are separated by surfaceVoid gutters, not this line), so it is excluded from the 3:1\n  // tier by name in both schemes.\n  borderPanel: \"#cbd5e1\",\n  // 1.2a (REVIEW R3): was #94a3b8 (2.08–2.56). borderDivider IS in the 3:1 tier — its top edge is\n  // SplitHandle's main resting affordance — and slate-600 passes everywhere (6.15–7.58).\n  borderDivider: \"#475569\",\n\n  // A light wash, not the dark one at lower alpha: the seed's rgba(2,6,12,0.65) over a white page\n  // reads as a black sheet rather than a scrim.\n  dialogBackdrop: \"rgba(15, 23, 42, 0.35)\",\n  // ⚠ 1.3 correction — a real defect in the light scheme authored at 1.2a. These were #1e293b /\n  // #0f172a: an INVERTED (dark) tooltip on a light page. That is a perfectly good design, but the\n  // vocabulary has no `onTooltip*` text role, so the theme's own text roles landed on it at\n  // 1.22:1 (textEmphasis) and 1.41:1 (textSecondary) — unreadable. Two ways out: add on-tooltip\n  // roles (a vocabulary change mid-Phase-1, churning 1.1's frozen key set, fixture and parity\n  // tests) or keep the tooltip a light surface so the SAME text roles work in both schemes.\n  // The second is chosen: role-based theming exists precisely so a component need not know which\n  // scheme it is in. An inverted tooltip can return later as a deliberate vocabulary addition\n  // (6.1a is the natural moment) rather than as an accident nobody paired.\n  tooltipBackground: \"#ffffff\",\n  tooltipTitleBackground: \"#f1f5f9\",\n  tooltipTitleBorder: \"#e2e8f0\",\n  tooltipBorder: \"#94a3b8\",\n\n  // Syntax colours are re-picked for a light ground; the dark set fails on white.\n  jsonKey: \"#4338ca\",\n  // ⚠ 1.3: was #047857, 4.45 on surfaceVoid and 4.49 on surfaceSelected — under 4.5 by a hair on\n  // exactly the two surfaces the 1.2a audit did not pair JSON colours against. emerald-800: 6.23.\n  jsonNumber: \"#065f46\",\n  // 1.2a (REVIEW R3): was #a16207, 4.22 on surfaceSectionAlt — the exact surface JSON renders on.\n  // yellow-800 gives 6.85 base / 5.88 alt. laneAccents[1] keeps #a16207: it only needs 3.0 (4.92).\n  jsonString: \"#854d0e\",\n  jsonKeyword: \"#6d28d9\",\n  // 1.2a (REVIEW R3, corrected during the fold-in): was #64748b, 4.08 on surfaceSectionAlt. The\n  // review proposed #475569, but that is dark's FROZEN jsonPunctuation verbatim and would fail the\n  // no-verbatim-reuse parity test — slate-700 passes everywhere (8.88 alt / 10.66 base) instead.\n  jsonPunctuation: \"#334155\",\n\n  // 1.2a (REVIEW R3/C11): thumb was #cbd5e1 (1.48 on white) — a scrollbar thumb is a control, so\n  // the 3:1 tier applies. Hover was #94a3b8; #475569 (the review's pick) is dark's frozen\n  // scrollbarThumbHover verbatim, so slate-700 serves as the darker hover step instead.\n  scrollbarThumb: \"#64748b\",\n  scrollbarThumbHover: \"#334155\",\n  focusRing: \"#0369a1\",\n\n  // Darkened to stay distinguishable on white while holding the same six hue families, so a lane's\n  // identity survives a scheme switch.\n  laneAccents: [\"#6d28d9\", \"#a16207\", \"#0f766e\", \"#be185d\", \"#be123c\", \"#4338ca\"],\n};\n\nexport const NICE_UI_DEFAULT_THEME: INiceUiTheme = {\n  name: \"nice-code\",\n  schemes: { light, dark },\n  defaultScheme: \"dark\",\n  typography: {\n    headline: {\n      fontFamily: MONO,\n      fontFamilyFallbacks: MONO_FALLBACKS,\n      fontSize: 14,\n      fontWeight: \"600\",\n      lineHeight: 20,\n    },\n    body: {\n      fontFamily: SANS,\n      fontFamilyFallbacks: SANS_FALLBACKS,\n      fontSize: 13,\n      fontWeight: \"400\",\n      lineHeight: 18,\n    },\n    bodySmall: {\n      fontFamily: SANS,\n      fontFamilyFallbacks: SANS_FALLBACKS,\n      fontSize: 11,\n      fontWeight: \"400\",\n      lineHeight: 16,\n    },\n    code: {\n      fontFamily: MONO,\n      fontFamilyFallbacks: MONO_FALLBACKS,\n      fontSize: 12,\n      fontWeight: \"500\",\n      lineHeight: 16,\n    },\n    label: {\n      fontFamily: MONO,\n      fontFamilyFallbacks: MONO_FALLBACKS,\n      fontSize: 10,\n      fontWeight: \"700\",\n      lineHeight: 12,\n      // 0.05em resolved against this style's own 10px fontSize (1.2a — letterSpacing is a number).\n      letterSpacing: 0.5,\n    },\n    // Everything that frames the product speaks mono. Body copy alone is sans — the window shell has\n    // always spoken mono, and a dashboard whose controls spoke sans against it read as two products.\n    chrome: {\n      fontFamily: MONO,\n      fontFamilyFallbacks: MONO_FALLBACKS,\n      fontSize: 12,\n      fontWeight: \"500\",\n      lineHeight: 16,\n    },\n  },\n  // rem → px at a 16px root (1.2a): 0.125/0.25/0.375/0.5/0.75rem. Radii no longer scale with the\n  // user's root font size on web — the recorded cost of one number serving both platforms.\n  rounded: { sm: 2, base: 4, md: 6, lg: 8, xl: 12, full: 9999 },\n  spacing: { xxs: 2, xs: 4, sm: 8, md: 12, lg: 16 },\n  elevation: {\n    raised: { offsetY: 1, blur: 2, spread: 0 },\n    overlay: { offsetY: 4, blur: 12, spread: -2 },\n  },\n};\n","// 1.3 — how a component reads the theme.\n//\n// Components never import a colour value. They emit `var(--nice-ui-<role>)` and let the DOM resolve\n// it, which is the entire payoff of D8: a scheme switch is a repaint, not a re-render, and a\n// component works identically under a provider it has never heard of (a different bundled consumer,\n// or none at all).\n//\n// The seed package did the opposite — `import { DEVTOOL_LIST_BASE_BACKGROUND } from \"../colors\"` —\n// which is why its panels can only ever be one scheme. Replacing those imports with these helpers\n// IS the lift; a \"lifted\" component still importing a literal has not been lifted.\n\nimport { EErrId_Ui, err_ui } from \"./errors\";\nimport { colorVariableName, laneAccentVariableName } from \"./theme/cssVariables\";\nimport { NICE_UI_DEFAULT_THEME } from \"./theme/defaultTheme\";\nimport type { TNiceUiColorRole } from \"./theme/roles\";\nimport type { INiceUiRounded, INiceUiSpacing, INiceUiTypography } from \"./theme/theme\";\n\n/** `token(\"textEmphasis\")` → `var(--nice-ui-text-emphasis)`. */\nexport function token(role: TNiceUiColorRole): string {\n  return `var(${colorVariableName(role)})`;\n}\n\n/** The Nth lane accent, wrapping is the caller's job (see `laneAccent` for the resolved form). */\nexport function laneAccentToken(index: number): string {\n  return `var(${laneAccentVariableName(index)})`;\n}\n\n// The scheme model types `laneAccents` as `readonly string[]`, so the count is a value of the\n// MOUNTED theme, not of this module. This defaults to the default theme's count — right for every\n// surface that mounts `NICE_UI_DEFAULT_THEME`; pass the mounted theme's own `laneAccents.length`\n// when it differs, or the last accents reference variables never emitted. Wrap-by-index composes\n// with the existing helper: `laneAccent(laneAccentTokens(), index)`.\nconst DEFAULT_LANE_ACCENT_COUNT = NICE_UI_DEFAULT_THEME.schemes.dark.laneAccents.length;\n\n/** Every lane accent as a var() reference, in order — for tables that need the whole cycle. */\nexport function laneAccentTokens(count: number = DEFAULT_LANE_ACCENT_COUNT): readonly string[] {\n  return Array.from({ length: count }, (_, index) => laneAccentToken(index));\n}\n\nexport function space(key: keyof INiceUiSpacing): string {\n  return `var(--nice-ui-space-${key})`;\n}\n\nexport function rounded(key: keyof INiceUiRounded): string {\n  return `var(--nice-ui-rounded-${key})`;\n}\n\nconst FONT_ROLE_VAR: Readonly<Record<keyof INiceUiTypography, string>> = {\n  headline: \"headline\",\n  body: \"body\",\n  bodySmall: \"body-small\",\n  code: \"code\",\n  label: \"label\",\n  chrome: \"chrome\",\n};\n\n/**\n * Just the family list of a type role — `var(--nice-ui-font-code-family)`. For the many sites\n * that set `fontFamily` alone on an element already sized by its context; use `typeStyle` when\n * the element should take the whole role.\n */\nexport function fontFamilyToken(role: keyof INiceUiTypography): string {\n  return `var(--nice-ui-font-${FONT_ROLE_VAR[role]}-family)`;\n}\n\n/**\n * The whole type role as inline-style properties. Returned as an object rather than a shorthand\n * because `font:` shorthand resets properties a caller may have set deliberately.\n */\nexport function typeStyle(role: keyof INiceUiTypography): {\n  fontFamily: string;\n  fontSize: string;\n  fontWeight: string;\n  lineHeight: string;\n  letterSpacing?: string;\n} {\n  const base = `--nice-ui-font-${FONT_ROLE_VAR[role]}`;\n  return {\n    fontFamily: `var(${base}-family)`,\n    fontSize: `var(${base}-size)`,\n    fontWeight: `var(${base}-weight)`,\n    lineHeight: `var(${base}-line-height)`,\n    // Absent on most roles; `var(x, initial)` keeps that harmless rather than emitting an invalid\n    // declaration when the role has no letter-spacing variable.\n    letterSpacing: `var(${base}-letter-spacing, normal)`,\n  };\n}\n\n// ─── derived alpha ───────────────────────────────────────────────────────────────────────────────\n\nconst SIX_DIGIT_HEX = /^#[0-9a-fA-F]{6}$/;\n\n/**\n * A role colour at partial opacity, as 8-digit hex.\n *\n * ⚠ This replaces string concatenation, which the seed used at `VirtualList.tsx:162`\n * (`${DEVTOOL_COLOR_SEMANTIC_WARNING}55`). That pattern has two defects the guard cannot see:\n * 1.5's colour regex matches quoted literals and `rgb()` calls, so a template suffix is invisible\n * to it; and if a *compiled* theme supplies the role as `rgba(…)` — which 1.2's sanitizer\n * deliberately permits, because `dialogBackdrop` needs it — then `rgba(…)55` is not a colour at\n * all and the style silently drops.\n *\n * Use this only where a RESOLVED value is in hand. Inside a component reading `var(--…)`, use\n * `tokenAlpha` instead: you cannot append alpha to a custom-property reference.\n */\nexport function withAlpha(hex: string, alpha: number): string {\n  if (!SIX_DIGIT_HEX.test(hex)) {\n    throw err_ui.fromId(EErrId_Ui.alpha_derivation_unsupported, { value: hex });\n  }\n  if (!(alpha >= 0 && alpha <= 1)) {\n    throw new RangeError(`nice-ui withAlpha: alpha must be within 0..1, received ${alpha}`);\n  }\n  const byte = Math.round(alpha * 255)\n    .toString(16)\n    .padStart(2, \"0\");\n  return `${hex}${byte}`;\n}\n\n/**\n * The CSS-variable equivalent of `withAlpha`, for the path components actually take.\n *\n * `color-mix()` is what makes this possible at all: a custom property holds a colour, not text you\n * can suffix, so the alpha has to be applied by CSS rather than by string building. It also keeps\n * the value scheme-following — the mix re-resolves when the variable changes, which a baked\n * 8-digit hex would not.\n */\nexport function tokenAlpha(role: TNiceUiColorRole, alpha: number): string {\n  if (!(alpha >= 0 && alpha <= 1)) {\n    throw new RangeError(`nice-ui tokenAlpha: alpha must be within 0..1, received ${alpha}`);\n  }\n  const percent = Math.round(alpha * 100);\n  return `color-mix(in srgb, ${token(role)} ${percent}%, transparent)`;\n}\n","// Lifted from `nice-devtools-shared/src/components/Tooltip.tsx`, with the accessibility work 1.3\n// requires — which is most of the change.\n//\n// The seed exported only a positioned surface taking a `DOMRect`; every caller wired its own\n// pointer handlers, so the tooltip was mouse-only, had no ARIA relationship to what it described,\n// and could not be dismissed from the keyboard. Three consequences, all of them real failures:\n// a keyboard user could never see it, a screen reader never announced it, and WCAG 1.4.13\n// (content on hover or focus must be dismissible) was unmet.\n//\n// `NiceUiTooltip` is therefore a single-trigger enhancer: it shows on pointer hover AND focus,\n// dismisses on Escape without moving trigger focus, and puts `aria-describedby` on the actual\n// trigger. The positioned surface is still exported for callers that own their own anchor rect.\n\nimport {\n  Children,\n  cloneElement,\n  type FocusEventHandler,\n  type PointerEventHandler,\n  type ReactElement,\n  type ReactNode,\n  type Ref,\n  useCallback,\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { rounded, space, token, typeStyle } from \"../tokens\";\n\nexport interface INiceUiTooltipConfig {\n  content: ReactNode;\n  title?: ReactNode;\n  /** `center` centres over the anchor (default); `edge` aligns the nearer horizontal edge. */\n  align?: \"center\" | \"edge\";\n  maxWidth?: number;\n}\n\nexport interface INiceUiTooltipSurfaceProps {\n  anchor: DOMRect;\n  config: INiceUiTooltipConfig;\n  /** Wired to the trigger's `aria-describedby`. */\n  id?: string;\n  /** The trigger's document. Its body owns the portal and its view owns viewport geometry. */\n  ownerDocument?: Document;\n  onPointerEnter?: PointerEventHandler<HTMLDivElement>;\n  onPointerLeave?: PointerEventHandler<HTMLDivElement>;\n  onFocusCapture?: FocusEventHandler<HTMLDivElement>;\n  onBlurCapture?: FocusEventHandler<HTMLDivElement>;\n}\n\n/** The positioned bubble. Rendered in a portal so an overflow-hidden ancestor cannot clip it. */\nexport function NiceUiTooltipSurface({\n  anchor,\n  config,\n  id,\n  ownerDocument,\n  onPointerEnter,\n  onPointerLeave,\n  onFocusCapture,\n  onBlurCapture,\n}: INiceUiTooltipSurfaceProps): React.JSX.Element {\n  const doc = ownerDocument ?? (typeof document === \"undefined\" ? undefined : document);\n  const view = doc?.defaultView ?? (typeof window === \"undefined\" ? undefined : window);\n  if (doc == null || view == null) return <></>;\n\n  const maxWidth = config.maxWidth ?? 400;\n  const showAbove = anchor.top >= view.innerHeight - anchor.bottom;\n  const gap = 6;\n  const screenMargin = 16;\n  const top = showAbove ? Math.round(anchor.top - gap) : Math.round(anchor.bottom + gap);\n  const maxHeight = showAbove\n    ? Math.round(anchor.top - gap - screenMargin)\n    : Math.round(view.innerHeight - anchor.bottom - gap - screenMargin);\n\n  let left: number | undefined;\n  let right: number | undefined;\n  let transform: string | undefined;\n\n  if (config.align !== \"edge\") {\n    const halfMax = maxWidth / 2;\n    const centre = Math.round(anchor.left + anchor.width / 2);\n    left = Math.max(\n      halfMax + screenMargin,\n      Math.min(centre, view.innerWidth - halfMax - screenMargin),\n    );\n    transform = showAbove ? \"translateX(-50%) translateY(-100%)\" : \"translateX(-50%)\";\n  } else {\n    const midX = anchor.left + anchor.width / 2;\n    if (midX <= view.innerWidth / 2) left = Math.max(screenMargin, anchor.left);\n    else right = Math.max(screenMargin, view.innerWidth - anchor.right);\n    transform = showAbove ? \"translateY(-100%)\" : undefined;\n  }\n\n  return createPortal(\n    <div\n      id={id}\n      // `tooltip` rather than `status`: this describes its trigger, it is not a live region.\n      role=\"tooltip\"\n      onPointerEnter={onPointerEnter}\n      onPointerLeave={onPointerLeave}\n      onFocusCapture={onFocusCapture}\n      onBlurCapture={onBlurCapture}\n      style={{\n        position: \"fixed\",\n        top,\n        left,\n        right,\n        transform,\n        maxWidth,\n        maxHeight,\n        overflow: \"auto\",\n        zIndex: 2147483000,\n        background: token(\"tooltipBackground\"),\n        border: `1px solid ${token(\"tooltipBorder\")}`,\n        borderRadius: rounded(\"md\"),\n        color: token(\"textSecondary\"),\n        pointerEvents: \"auto\",\n        ...typeStyle(\"bodySmall\"),\n      }}\n    >\n      {config.title != null && (\n        <div\n          style={{\n            background: token(\"tooltipTitleBackground\"),\n            borderBottom: `1px solid ${token(\"tooltipTitleBorder\")}`,\n            padding: `${space(\"xxs\")} ${space(\"sm\")}`,\n            color: token(\"textEmphasis\"),\n            ...typeStyle(\"label\"),\n          }}\n        >\n          {config.title}\n        </div>\n      )}\n      <div style={{ padding: `${space(\"xs\")} ${space(\"sm\")}` }}>{config.content}</div>\n    </div>,\n    doc.body,\n  );\n}\n\nexport interface INiceUiTooltipTriggerProps {\n  \"aria-describedby\"?: string;\n  onPointerEnter?: PointerEventHandler<HTMLElement>;\n  onPointerLeave?: PointerEventHandler<HTMLElement>;\n  onFocus?: FocusEventHandler<HTMLElement>;\n  onBlur?: FocusEventHandler<HTMLElement>;\n  ref?: Ref<HTMLElement>;\n}\n\nexport interface INiceUiTooltipProps {\n  config: INiceUiTooltipConfig;\n  /** Exactly one element that accepts DOM event props and forwards its ref to the trigger node. */\n  children: ReactElement<INiceUiTooltipTriggerProps>;\n}\n\nfunction mergeDescription(\n  existing: string | undefined,\n  tooltipId: string | undefined,\n): string | undefined {\n  const ids = [existing, tooltipId]\n    .flatMap((value) => value?.split(/\\s+/) ?? [])\n    .filter((value, index, all) => value !== \"\" && all.indexOf(value) === index);\n  return ids.length === 0 ? undefined : ids.join(\" \");\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null): void {\n  if (typeof ref === \"function\") {\n    ref(value);\n  } else if (ref != null) {\n    ref.current = value;\n  }\n}\n\nfunction mergedHandler<Event>(\n  consumer: ((event: Event) => void) | undefined,\n  tooltip: (event: Event) => void,\n): (event: Event) => void {\n  return (event) => {\n    consumer?.(event);\n    tooltip(event);\n  };\n}\n\n/**\n * Enhances one trigger. The trigger and bubble jointly own pointer/focus presence, Escape dismisses\n * without moving trigger focus, and `aria-describedby` lives on the element users actually focus.\n */\nexport function NiceUiTooltip({ config, children }: INiceUiTooltipProps): React.JSX.Element {\n  const id = useId();\n  const trigger = Children.only(children);\n  const triggerRef = useRef<HTMLElement>(null);\n  const [anchor, setAnchor] = useState<DOMRect | null>(null);\n  const triggerPointer = useRef(false);\n  const surfacePointer = useRef(false);\n  const triggerFocus = useRef(false);\n  const surfaceFocus = useRef(false);\n  const hideTimer = useRef<{ view: Window; id: number } | null>(null);\n\n  const clearScheduledHide = useCallback(() => {\n    if (hideTimer.current == null) return;\n    hideTimer.current.view.clearTimeout(hideTimer.current.id);\n    hideTimer.current = null;\n  }, []);\n\n  const show = useCallback(() => {\n    clearScheduledHide();\n    const rect = triggerRef.current?.getBoundingClientRect();\n    if (rect != null) setAnchor(rect);\n  }, [clearScheduledHide]);\n\n  const scheduleHide = useCallback(() => {\n    clearScheduledHide();\n    const view =\n      triggerRef.current?.ownerDocument.defaultView ??\n      (typeof window === \"undefined\" ? undefined : window);\n    if (view == null) return;\n    const id = view.setTimeout(() => {\n      hideTimer.current = null;\n      if (\n        triggerPointer.current ||\n        surfacePointer.current ||\n        triggerFocus.current ||\n        surfaceFocus.current\n      ) {\n        return;\n      }\n      setAnchor(null);\n    }, 0);\n    hideTimer.current = { view, id };\n  }, [clearScheduledHide]);\n\n  useEffect(() => clearScheduledHide, [clearScheduledHide]);\n\n  useEffect(() => {\n    if (anchor == null) return;\n    const doc = triggerRef.current?.ownerDocument;\n    if (doc == null) return;\n    const onKeyDown = (event: KeyboardEvent): void => {\n      if (event.key !== \"Escape\") return;\n      // Do not stop propagation: a dialog above may also want Escape, and swallowing it here would\n      // trap the user in exactly the situation the key exists to escape.\n      setAnchor(null);\n    };\n    doc.addEventListener(\"keydown\", onKeyDown);\n    return () => doc.removeEventListener(\"keydown\", onKeyDown);\n  }, [anchor]);\n\n  const childProps = trigger.props;\n  const childRef = childProps.ref;\n  const ref = useMemo(\n    () =>\n      (element: HTMLElement | null): void => {\n        triggerRef.current = element;\n        assignRef(childRef, element);\n      },\n    [childRef],\n  );\n  const open = anchor != null;\n  const enhanced = cloneElement(trigger, {\n    ref,\n    \"aria-describedby\": mergeDescription(childProps[\"aria-describedby\"], open ? id : undefined),\n    onPointerEnter: mergedHandler(childProps.onPointerEnter, () => {\n      triggerPointer.current = true;\n      show();\n    }),\n    onPointerLeave: mergedHandler(childProps.onPointerLeave, () => {\n      triggerPointer.current = false;\n      scheduleHide();\n    }),\n    onFocus: mergedHandler(childProps.onFocus, () => {\n      triggerFocus.current = true;\n      show();\n    }),\n    onBlur: mergedHandler(childProps.onBlur, (event) => {\n      if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n      triggerFocus.current = false;\n      scheduleHide();\n    }),\n  });\n\n  return (\n    <>\n      {enhanced}\n      {anchor != null && (\n        <NiceUiTooltipSurface\n          anchor={anchor}\n          config={config}\n          id={id}\n          ownerDocument={triggerRef.current?.ownerDocument}\n          onPointerEnter={() => {\n            surfacePointer.current = true;\n            clearScheduledHide();\n          }}\n          onPointerLeave={() => {\n            surfacePointer.current = false;\n            scheduleHide();\n          }}\n          onFocusCapture={() => {\n            surfaceFocus.current = true;\n            clearScheduledHide();\n          }}\n          onBlurCapture={(event) => {\n            if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n            surfaceFocus.current = false;\n            scheduleHide();\n          }}\n        />\n      )}\n    </>\n  );\n}\n","// Lifted from `nice-devtools-shared/src/components/Chip.tsx`.\n//\n// The tooltip wiring is gone: the seed hand-rolled `onMouseEnter`/`onMouseLeave` and rendered the\n// bubble itself, which is exactly how the tooltip ended up mouse-only everywhere it was used.\n// A chip with a tooltip now delegates to `NiceUiTooltip`, so it inherits focus support, the ARIA\n// relationship and Escape-to-dismiss for free — and there is one tooltip behaviour in the package\n// rather than one per caller.\n\nimport type { ReactNode } from \"react\";\nimport { ESize } from \"../size\";\nimport { rounded as roundedToken, space, token, typeStyle } from \"../tokens\";\nimport { type INiceUiTooltipConfig, NiceUiTooltip } from \"./Tooltip\";\n\nconst CHIP_PADDING: Record<ESize, string> = {\n  [ESize.sm]: `1px ${space(\"xxs\")}`,\n  [ESize.md]: `1px ${space(\"xs\")}`,\n  [ESize.lg]: `${space(\"xxs\")} ${space(\"xs\")}`,\n};\n\n/** The paint for one chip role: strong text/border, plus an optional subtle variant. */\nexport interface INiceUiChipColorEntry {\n  /** Pass `token(...)` references — never literals; 1.5's drift guard depends on it. */\n  color: string;\n  borderColor: string;\n  subtle?: { color?: string; borderColor?: string };\n}\n\nexport interface INiceUiChipProps {\n  /**\n   * Resolved colours for this chip. Consumers keep their own semantic → role tables (what a chip\n   * *means* is consumer-specific) and pass the entry here.\n   */\n  colorEntry: INiceUiChipColorEntry;\n  subtle?: boolean;\n  size?: ESize;\n  pill?: boolean;\n  tooltip?: INiceUiTooltipConfig;\n  children: ReactNode;\n}\n\nexport function NiceUiChip({\n  colorEntry,\n  subtle = false,\n  size = ESize.md,\n  pill = false,\n  tooltip,\n  children,\n}: INiceUiChipProps): React.JSX.Element {\n  const color = subtle ? (colorEntry.subtle?.color ?? colorEntry.color) : colorEntry.color;\n  const borderColor = subtle\n    ? (colorEntry.subtle?.borderColor ?? \"transparent\")\n    : colorEntry.borderColor;\n\n  const chip = (\n    <span\n      tabIndex={tooltip == null ? undefined : 0}\n      style={{\n        display: \"flex\",\n        alignItems: \"center\",\n        color,\n        background: token(\"surfaceBase\"),\n        border: `1px solid ${borderColor}`,\n        padding: CHIP_PADDING[size],\n        borderRadius: pill ? roundedToken(\"full\") : roundedToken(\"sm\"),\n        flexShrink: 0,\n        whiteSpace: \"nowrap\",\n        ...typeStyle(\"label\"),\n      }}\n    >\n      {children}\n    </span>\n  );\n\n  if (tooltip == null) return chip;\n  return <NiceUiTooltip config={tooltip}>{chip}</NiceUiTooltip>;\n}\n","// Lifted from `nice-devtools-shared/src/components/PanelChrome.tsx`.\n//\n// ⚠ Generic chrome, not devtools-specific: `PanelShell` imports `NiceUiPanelHeader` and\n// `ListDetailSplit` imports `NiceUiSplitHandle`, so excluding this module would break two lifted\n// components on day one.\n//\n// Accessibility work in this lift, all of it load-bearing:\n//   * `SplitHandle` becomes a real ARIA separator, operable from the keyboard. It was a bare `div`\n//     with a mousedown handler — invisible to assistive tech and impossible to move without a\n//     pointer, which is a plain WCAG 2.1.1 failure on the primary layout control.\n//   * `SegmentedControl` becomes a radiogroup with roving focus, so arrow keys move between options\n//     the way every other segmented control does, and the active option is *announced* as selected\n//     rather than merely painted.\n//   * The header's icon-only pause/clear buttons get accessible names.\n\nimport {\n  type CSSProperties,\n  type KeyboardEvent as ReactKeyboardEvent,\n  type MouseEvent as ReactMouseEvent,\n  type ReactNode,\n  useRef,\n  useState,\n} from \"react\";\nimport { rounded, space, token, typeStyle } from \"../tokens\";\n\nfunction chromeButtonStyle(color: string): CSSProperties {\n  return {\n    background: \"none\",\n    border: \"none\",\n    color,\n    cursor: \"pointer\",\n    padding: 0,\n    whiteSpace: \"nowrap\",\n    ...typeStyle(\"label\"),\n  };\n}\n\nexport interface INiceUiPanelHeaderProps {\n  title: string;\n  onClear?: () => void;\n  paused?: boolean;\n  onTogglePause?: () => void;\n  children?: ReactNode;\n}\n\n/** The panel's top chrome: title on the left, caller controls and actions on the right. */\nexport function NiceUiPanelHeader({\n  title,\n  onClear,\n  paused,\n  onTogglePause,\n  children,\n}: INiceUiPanelHeaderProps): React.JSX.Element {\n  const hasActionsRow = onTogglePause != null || onClear != null;\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"space-between\",\n        padding: `${space(\"xs\")} ${space(\"md\")}`,\n        gap: space(\"sm\"),\n        background: token(\"surfaceSection\"),\n        borderBottom: `1px solid ${token(\"borderPanel\")}`,\n        flexShrink: 0,\n      }}\n    >\n      <span\n        style={{\n          ...typeStyle(\"label\"),\n          color: token(\"semanticSystem\"),\n          fontWeight: \"bold\",\n          whiteSpace: \"nowrap\",\n        }}\n      >\n        {title}\n      </span>\n      <div style={{ display: \"flex\", gap: space(\"sm\"), alignItems: \"center\" }}>\n        <div style={{ display: \"flex\", flexDirection: \"column\", alignItems: \"stretch\" }}>\n          {children}\n          {hasActionsRow && (\n            <div\n              style={{\n                display: \"flex\",\n                gap: space(\"sm\"),\n                alignItems: \"center\",\n                justifyContent: \"space-between\",\n                padding: space(\"xxs\"),\n              }}\n            >\n              {onTogglePause != null && (\n                <button\n                  type=\"button\"\n                  onClick={onTogglePause}\n                  // A name, not just a title: `title` is invisible to keyboard users and\n                  // inconsistently announced. `aria-pressed` makes the toggle state readable.\n                  aria-label={paused ? \"Resume recording\" : \"Pause recording\"}\n                  aria-pressed={paused === true}\n                  style={chromeButtonStyle(\n                    paused === true ? token(\"semanticSystem\") : token(\"textMuted\"),\n                  )}\n                >\n                  {/* Inline SVG, never the ⏸/▶ characters. U+23F8 has no glyph in many font\n                      stacks (WSL2 renders tofu; ubuntu happens to find one), which made the same\n                      UI rasterize differently per host — the one visual-baseline input no\n                      fingerprint field can pin. currentColor keeps it on the button's token. */}\n                  <svg\n                    aria-hidden=\"true\"\n                    width={9}\n                    height={9}\n                    viewBox=\"0 0 9 9\"\n                    style={{ marginRight: 4, verticalAlign: \"-1px\" }}\n                  >\n                    {paused === true ? (\n                      <path d=\"M1 0 L9 4.5 L1 9 Z\" fill=\"currentColor\" />\n                    ) : (\n                      <>\n                        <rect x=\"1\" y=\"0\" width=\"2.6\" height=\"9\" fill=\"currentColor\" />\n                        <rect x=\"5.4\" y=\"0\" width=\"2.6\" height=\"9\" fill=\"currentColor\" />\n                      </>\n                    )}\n                  </svg>\n                  {paused === true ? \"resume\" : \"pause\"}\n                </button>\n              )}\n              {onClear != null && (\n                <button\n                  type=\"button\"\n                  onClick={onClear}\n                  aria-label=\"Clear\"\n                  style={chromeButtonStyle(token(\"textMuted\"))}\n                >\n                  clear\n                </button>\n              )}\n            </div>\n          )}\n        </div>\n      </div>\n    </div>\n  );\n}\n\nconst SPLIT_RATIO_MIN = 0.15;\nconst SPLIT_RATIO_MAX = 0.85;\n/** One arrow press. Coarse enough to be useful, fine enough to land on a target. */\nconst KEYBOARD_STEP = 0.02;\n\nexport interface INiceUiSplitHandleProps {\n  /** `true` when the split axis is horizontal (a row layout dragging left/right). */\n  horizontal: boolean;\n  /** The fraction of the container the DETAIL pane occupies. */\n  ratio: number;\n  onRatioChange: (ratio: number) => void;\n  /** Names the separator for assistive tech. */\n  label?: string;\n}\n\nconst clampRatio = (ratio: number): number =>\n  Math.max(SPLIT_RATIO_MIN, Math.min(SPLIT_RATIO_MAX, ratio));\n\n/**\n * Draggable divider between list and detail.\n *\n * ⚠ It reports `ratio` now, where the seed only emitted changes. A `separator` must expose\n * `aria-valuenow`, and a control that cannot say where it currently is cannot be operated by\n * anything but a mouse — which is why the seed's version was pointer-only.\n */\nexport function NiceUiSplitHandle({\n  horizontal,\n  ratio,\n  onRatioChange,\n  label = \"Resize panels\",\n}: INiceUiSplitHandleProps): React.JSX.Element {\n  const [hovered, setHovered] = useState(false);\n  const ref = useRef<HTMLDivElement>(null);\n\n  const onMouseDown = (event: ReactMouseEvent<HTMLDivElement>): void => {\n    event.preventDefault();\n    const container = event.currentTarget.parentElement;\n    if (container == null) return;\n    const onMove = (move: MouseEvent): void => {\n      const rect = container.getBoundingClientRect();\n      // Detail sits after the handle, so its size measures from the far edge back to the cursor.\n      const next = horizontal\n        ? (rect.right - move.clientX) / rect.width\n        : (rect.bottom - move.clientY) / rect.height;\n      onRatioChange(clampRatio(next));\n    };\n    const onUp = (): void => {\n      window.removeEventListener(\"mousemove\", onMove);\n      window.removeEventListener(\"mouseup\", onUp);\n    };\n    window.addEventListener(\"mousemove\", onMove);\n    window.addEventListener(\"mouseup\", onUp);\n  };\n\n  const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n    // Grow-detail keys are the ones pointing *at* the list, because dragging that way enlarges\n    // the detail pane — matching what the pointer does rather than what the arrow glyph suggests.\n    const grow = horizontal ? \"ArrowLeft\" : \"ArrowUp\";\n    const shrink = horizontal ? \"ArrowRight\" : \"ArrowDown\";\n    let next: number | null = null;\n    if (event.key === grow) next = ratio + KEYBOARD_STEP;\n    else if (event.key === shrink) next = ratio - KEYBOARD_STEP;\n    else if (event.key === \"Home\") next = SPLIT_RATIO_MIN;\n    else if (event.key === \"End\") next = SPLIT_RATIO_MAX;\n    if (next == null) return;\n    event.preventDefault();\n    onRatioChange(clampRatio(next));\n  };\n\n  return (\n    // <hr> cannot be focused or carry aria-valuenow, and a resizable split IS a focusable widget —\n    // WAI-ARIA defines exactly this case. The suggested element would delete the keyboard\n    // operability this lift exists to add.\n    // biome-ignore lint/a11y/useSemanticElements: a focusable separator cannot be an <hr>\n    <div\n      ref={ref}\n      role=\"separator\"\n      tabIndex={0}\n      aria-label={label}\n      aria-orientation={horizontal ? \"vertical\" : \"horizontal\"}\n      aria-valuenow={Math.round(ratio * 100)}\n      aria-valuemin={Math.round(SPLIT_RATIO_MIN * 100)}\n      aria-valuemax={Math.round(SPLIT_RATIO_MAX * 100)}\n      onMouseDown={onMouseDown}\n      onKeyDown={onKeyDown}\n      onMouseEnter={() => setHovered(true)}\n      onMouseLeave={() => setHovered(false)}\n      data-nice-ui-motion=\"surface\"\n      style={{\n        flex: \"0 0 5px\",\n        alignSelf: \"stretch\",\n        cursor: horizontal ? \"ew-resize\" : \"ns-resize\",\n        background: hovered ? token(\"semanticSystem\") : \"transparent\",\n        opacity: hovered ? 0.6 : 1,\n        zIndex: 5,\n      }}\n    />\n  );\n}\n\nexport interface INiceUiSegmentedControlProps<T extends string> {\n  options: readonly { value: T; label: string }[];\n  value: T;\n  onChange: (value: T) => void;\n  /** Names the group for assistive tech. */\n  label?: string;\n}\n\n/**\n * A compact segmented toggle, as a radiogroup with roving focus.\n *\n * The seed rendered plain buttons: the active one was painted but never announced as selected, and\n * every option sat in the tab order, so tabbing through a three-way switch took three stops instead\n * of one. Roving `tabIndex` plus arrow keys is the conventional pattern and fixes both.\n */\nexport function NiceUiSegmentedControl<T extends string>({\n  options,\n  value,\n  onChange,\n  label = \"View\",\n}: INiceUiSegmentedControlProps<T>): React.JSX.Element {\n  const refs = useRef<(HTMLButtonElement | null)[]>([]);\n\n  const onKeyDown = (event: ReactKeyboardEvent<HTMLButtonElement>, index: number): void => {\n    const delta = event.key === \"ArrowRight\" ? 1 : event.key === \"ArrowLeft\" ? -1 : 0;\n    if (delta === 0) return;\n    event.preventDefault();\n    const next = (index + delta + options.length) % options.length;\n    const option = options[next];\n    if (option == null) return;\n    onChange(option.value);\n    refs.current[next]?.focus();\n  };\n\n  return (\n    <div\n      role=\"radiogroup\"\n      aria-label={label}\n      style={{\n        display: \"flex\",\n        border: `1px solid ${token(\"textFaint\")}`,\n        borderRadius: rounded(\"md\"),\n        overflow: \"hidden\",\n      }}\n    >\n      {options.map((option, index) => {\n        const active = option.value === value;\n        return (\n          // biome-ignore lint/a11y/useSemanticElements: the ARIA radio-group pattern uses role\n          <button\n            key={option.value}\n            ref={(element) => {\n              refs.current[index] = element;\n            }}\n            type=\"button\"\n            // A real <input type=\"radio\"> would have to be visually hidden and re-labelled to\n            // look like a segment — trading working semantics for markup that only looks better.\n            role=\"radio\"\n            aria-checked={active}\n            // Roving: only the selected option is a tab stop.\n            tabIndex={active ? 0 : -1}\n            onClick={() => onChange(option.value)}\n            onKeyDown={(event) => onKeyDown(event, index)}\n            data-nice-ui-motion=\"surface\"\n            style={{\n              ...typeStyle(\"label\"),\n              background: active ? token(\"primary\") : \"transparent\",\n              // `onPrimary` — the role 1.2a corrected to #0f172a precisely because THIS is the\n              // place the seed painted text on a filled primary surface.\n              color: active ? token(\"onPrimary\") : token(\"textMuted\"),\n              border: \"none\",\n              cursor: \"pointer\",\n              fontWeight: active ? 700 : 500,\n              padding: `${space(\"xxs\")} ${space(\"sm\")}`,\n            }}\n          >\n            {option.label}\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n","// Lifted from `nice-devtools-shared/src/components/ListDetailSplit.tsx`.\n//\n// The list ⇄ detail layout: panes stack as a column with a draggable split whose ratio the caller\n// persists. `detail = null` renders the list full-size with no handle.\n\nimport type { ReactNode } from \"react\";\nimport { token, tokenAlpha } from \"../tokens\";\nimport { NiceUiSplitHandle } from \"./PanelChrome\";\n\nexport interface INiceUiListDetailSplitProps {\n  /** Fraction of the container the DETAIL pane occupies. */\n  detailRatio: number;\n  onDetailRatioChange: (ratio: number) => void;\n  list: ReactNode;\n  detail: ReactNode | null;\n}\n\nexport function NiceUiListDetailSplit({\n  detailRatio,\n  onDetailRatioChange,\n  list,\n  detail,\n}: INiceUiListDetailSplitProps): React.JSX.Element {\n  return (\n    <div\n      style={{\n        flex: 1,\n        display: \"flex\",\n        flexDirection: \"column\",\n        overflow: \"hidden\",\n        minHeight: 0,\n      }}\n    >\n      <div\n        style={{\n          flexGrow: detail != null ? 1 - detailRatio : 1,\n          flexShrink: 1,\n          flexBasis: 0,\n          minWidth: 0,\n          minHeight: 0,\n          display: \"flex\",\n          flexDirection: \"column\",\n          overflow: \"hidden\",\n        }}\n      >\n        {list}\n      </div>\n      {detail != null && (\n        <>\n          {/* `ratio` is passed now: a separator must expose aria-valuenow, and a control that\n              cannot report where it is cannot be operated from the keyboard. */}\n          <NiceUiSplitHandle\n            horizontal={false}\n            ratio={detailRatio}\n            onRatioChange={onDetailRatioChange}\n            label=\"Resize detail pane\"\n          />\n          <div\n            style={{\n              flexGrow: detailRatio,\n              flexShrink: 1,\n              flexBasis: 0,\n              minWidth: 0,\n              minHeight: 0,\n              display: \"flex\",\n              flexDirection: \"column\",\n              overflow: \"hidden\",\n              // This edge is the separator's main resting affordance — the handle itself is\n              // transparent until hover — which is why `borderDivider` sits in the 3:1 control\n              // tier rather than being classified decorative like `borderPanel`.\n              borderTop: `1px solid ${token(\"borderDivider\")}`,\n              // Was a raw rgba(0,0,0,0.8) literal in the seed; derived from a role now, so it\n              // follows the scheme and 1.5's drift guard can see it.\n              boxShadow: `inset 0 18px 36px -14px ${tokenAlpha(\"surfaceVoid\", 0.8)}`,\n            }}\n          >\n            {detail}\n          </div>\n        </>\n      )}\n    </div>\n  );\n}\n","// 1.3 — the injected `<style>` block: what inline styles cannot express.\n//\n// Inline styles cannot reach pseudo-elements (`::-webkit-scrollbar`, `::backdrop`), pseudo-classes\n// (`:hover`, `:focus-visible`) or media queries — so a small stylesheet is unavoidable. Everything\n// else stays inline and token-driven.\n//\n// ⚠ ONE injector, deliberately. The upsert pipeline below is the single place a `<style>` is\n// created, so the CSP nonce cannot be forgotten by a future caller. The seed package had two independent\n// injectors (`ensurePanelStyles` and Dialog's own backdrop block) and neither carried a nonce; under\n// 3.1's `style-src-elem 'self' 'nonce-…'` an un-nonced block is dropped **silently** — visible only\n// through `getComputedStyle`, never in the DOM. That is precisely the failure a review caught in the\n// plan (R7), and a shared injector is why it cannot recur.\n\nimport { token } from \"./tokens\";\n\n// A CSP host cannot know which nested component will need a pseudo-class or pseudo-element sheet,\n// and threading a per-document nonce through every authored scene prop makes those components\n// unusable in isolated renderers. Hosts may publish the current document nonce here instead. The\n// value is not a secret (an executing script can already read nonce-bearing style elements); it is\n// a DOM transport shared by separately bundled Nice UI copies without adding a React singleton.\nconst NICE_UI_STYLE_NONCE_ATTRIBUTE = \"data-nice-ui-style-nonce\";\nconst sharedGlobal = globalThis as typeof globalThis & Record<symbol, unknown>;\n\ninterface IStyleNonceOwner {\n  readonly token: object;\n  readonly nonce: string;\n}\n\ninterface IStyleNonceOwnership {\n  readonly priorPresent: boolean;\n  readonly priorValue: string | null;\n  readonly owners: IStyleNonceOwner[];\n}\n\nconst STYLE_NONCE_OWNERS = Symbol.for(\"@nice-code/ui/style-nonce-owners\");\nconst styleNonceOwners =\n  (sharedGlobal[STYLE_NONCE_OWNERS] as WeakMap<Document, IStyleNonceOwnership> | undefined) ??\n  new WeakMap<Document, IStyleNonceOwnership>();\nsharedGlobal[STYLE_NONCE_OWNERS] = styleNonceOwners;\n\n/**\n * Publish a provider/host nonce for nested injectors, including separately bundled Nice UI copies.\n * Ownership is stacked so overlapping providers restore the prior host transport exactly.\n */\nexport function mountStyleNonceTransport(nonce?: string, doc?: Document): () => void {\n  const target = doc ?? (typeof document === \"undefined\" ? undefined : document);\n  const root = target?.documentElement;\n  if (target == null || root == null || nonce == null || nonce === \"\") return () => {};\n  let ownership = styleNonceOwners.get(target);\n  if (ownership == null) {\n    ownership = {\n      priorPresent: root.hasAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE),\n      priorValue: root.getAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE),\n      owners: [],\n    };\n    styleNonceOwners.set(target, ownership);\n  }\n  const owner = { token: {}, nonce };\n  ownership.owners.push(owner);\n  root.setAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE, nonce);\n  return () => {\n    const current = styleNonceOwners.get(target);\n    if (current == null) return;\n    const index = current.owners.findIndex((candidate) => candidate.token === owner.token);\n    if (index < 0) return;\n    current.owners.splice(index, 1);\n    const active = current.owners.at(-1);\n    if (active != null) {\n      root.setAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE, active.nonce);\n      return;\n    }\n    if (current.priorPresent) {\n      root.setAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE, current.priorValue ?? \"\");\n    } else {\n      root.removeAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE);\n    }\n    styleNonceOwners.delete(target);\n  };\n}\n\nexport interface INiceUiStyleInjection {\n  /** Stable id — injection is idempotent per id. */\n  id: string;\n  css: string;\n  /** Explicit override for the host document nonce. Applied as attribute AND property. */\n  nonce?: string | undefined;\n  document?: Document | undefined;\n  /** Exact ownership metadata used by higher-level style slots. */\n  attributes?: Readonly<Record<string, string>> | undefined;\n}\n\ninterface IStyleOwnership {\n  element: HTMLStyleElement;\n  readonly owners: Set<object>;\n  persistent: boolean;\n}\n\nconst STYLE_OWNERS = Symbol.for(\"@nice-code/ui/style-owners\");\nconst styleOwners =\n  (sharedGlobal[STYLE_OWNERS] as WeakMap<Document, Map<string, IStyleOwnership>> | undefined) ??\n  new WeakMap<Document, Map<string, IStyleOwnership>>();\nsharedGlobal[STYLE_OWNERS] = styleOwners;\n\nfunction styleMap(doc: Document): Map<string, IStyleOwnership> {\n  let styles = styleOwners.get(doc);\n  if (styles == null) {\n    styles = new Map();\n    styleOwners.set(doc, styles);\n  }\n  return styles;\n}\n\nfunction hostStyleNonce(doc: Document): string | undefined {\n  const value = doc.documentElement?.getAttribute(NICE_UI_STYLE_NONCE_ATTRIBUTE);\n  return value == null || value === \"\" ? undefined : value;\n}\n\nfunction upsertStyleElement(\n  { id, css, nonce, document: doc, attributes = {} }: INiceUiStyleInjection,\n  persistent: boolean,\n): { element: HTMLStyleElement; ownership: IStyleOwnership; document: Document } | null {\n  const target = doc ?? (typeof document === \"undefined\" ? undefined : document);\n  if (target == null) return null;\n  const styles = styleMap(target);\n  let ownership = styles.get(id);\n  const registered = ownership?.element;\n  const existing =\n    registered != null && target.getElementById(id) === registered\n      ? registered\n      : target.getElementById(id);\n  if (existing != null && existing.tagName !== \"STYLE\") {\n    throw new Error(`nice-ui: style id ${JSON.stringify(id)} is owned by a non-style element`);\n  }\n  const adopted = ownership == null && existing != null;\n  const existingStyle = existing as HTMLStyleElement | null;\n  const effectiveNonce =\n    nonce ??\n    hostStyleNonce(target) ??\n    existingStyle?.nonce ??\n    existingStyle?.getAttribute(\"nonce\") ??\n    undefined;\n  const attributesMatch = Object.entries(attributes).every(\n    ([name, value]) => existingStyle?.getAttribute(name) === value,\n  );\n  const nonceMatches = effectiveNonce == null || existingStyle?.nonce === effectiveNonce;\n\n  let element = existingStyle;\n  if (element == null || element.textContent !== css || !attributesMatch || !nonceMatches) {\n    element = target.createElement(\"style\");\n    element.id = id;\n    for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value);\n    if (effectiveNonce != null) {\n      // Both: the attribute for the CSP check, the property because some browsers clear the\n      // attribute after parsing and downstream code reads `.nonce`.\n      element.setAttribute(\"nonce\", effectiveNonce);\n      element.nonce = effectiveNonce;\n    }\n    element.textContent = css;\n    if (existingStyle == null) target.head?.appendChild(element);\n    else existingStyle.replaceWith(element);\n  }\n\n  if (ownership == null) {\n    ownership = { element, owners: new Set(), persistent: persistent || adopted };\n    styles.set(id, ownership);\n  } else {\n    ownership.element = element;\n    if (persistent) ownership.persistent = true;\n  }\n  return { element, ownership, document: target };\n}\n\n/**\n * The only place this package creates a `<style>`. Repeated ids are content-aware: changed CSS,\n * nonce, or ownership metadata atomically replaces the old node instead of returning stale text.\n */\nexport function injectStyleElement(injection: INiceUiStyleInjection): HTMLStyleElement | null {\n  return upsertStyleElement(injection, true)?.element ?? null;\n}\n\n/** Component-owned style lifetime with cross-instance ref-counted cleanup. */\nexport function mountStyleElement(injection: INiceUiStyleInjection): () => void {\n  const mounted = upsertStyleElement(injection, false);\n  if (mounted == null) return () => {};\n  const owner = {};\n  mounted.ownership.owners.add(owner);\n  return () => {\n    const target = mounted.document;\n    const styles = styleOwners.get(target);\n    const ownership = styles?.get(injection.id);\n    if (ownership == null) return;\n    ownership.owners.delete(owner);\n    if (ownership.owners.size > 0 || ownership.persistent) return;\n    ownership.element.remove();\n    styles?.delete(injection.id);\n  };\n}\n\n/*\n * Kept as a named helper because tests and imperative bootstraps call it directly. Component paths\n * use `mountStyleElement` through the mount helpers below.\n */\nfunction panelStyleInjection(\n  panelDomId: string,\n  options: { extraCss?: string; nonce?: string; document?: Document } = {},\n): INiceUiStyleInjection {\n  const scope = `#${panelDomId}`;\n  return {\n    id: `${panelDomId}-styles`,\n    nonce: options.nonce,\n    document: options.document,\n    css: `\n    ${scope} ::-webkit-scrollbar { width: 4px; height: 4px; }\n    ${scope} ::-webkit-scrollbar-track { background: transparent; }\n    ${scope} ::-webkit-scrollbar-thumb { background: ${token(\"scrollbarThumb\")}; border-radius: 2px; }\n    ${scope} ::-webkit-scrollbar-thumb:hover { background: ${token(\"scrollbarThumbHover\")}; }\n    ${scope} ::-webkit-scrollbar-corner { background: transparent; }\n    ${scope} input,\n    ${scope} button,\n    ${scope} select,\n    ${scope} textarea { all: revert; font-family: inherit; }\n    ${scope} :focus-visible {\n      outline: 2px solid ${token(\"focusRing\")};\n      outline-offset: 1px;\n    }\n    ${motionCss(scope)}\n    ${options.extraCss ?? \"\"}\n  `,\n  };\n}\n\nfunction dialogStyleInjection(\n  options: { nonce?: string; document?: Document } = {},\n): INiceUiStyleInjection {\n  return {\n    id: \"nice-ui-dialog-styles\",\n    nonce: options.nonce,\n    document: options.document,\n    css: `\n    dialog[data-nice-ui-dialog]::backdrop { background: ${token(\"dialogBackdrop\")}; }\n    dialog[data-nice-ui-dialog] { border: none; padding: 0; background: transparent; }\n  `,\n  };\n}\n\n/**\n * Transitions live here and nowhere else (the motion policy).\n *\n * Inline styles never animate — not a style preference, a testability requirement: a transition in\n * an inline style cannot be switched off by `prefers-reduced-motion`, so it would defeat both the\n * OS setting and 2.3's `reducedMotion` capture pin, making every screenshot a race. Wrapping the\n * rules in `no-preference` means both are honoured with no re-render and no component branch.\n */\nfunction motionCss(scope: string): string {\n  return `\n    @media (prefers-reduced-motion: no-preference) {\n      ${scope} [data-nice-ui-motion=\"fade\"] { transition: opacity 120ms ease-out; }\n      ${scope} [data-nice-ui-motion=\"surface\"] { transition: background-color 120ms ease-out, border-color 120ms ease-out; }\n    }`;\n}\n\n/**\n * The per-panel block: themed scrollbars, the host-style shield, and a visible focus ring.\n *\n * The `all: revert` shield protects native form controls from a host app's bare `input {}` /\n * `button {}` rules; the panel's own inline styles still win, so its look is unchanged in any host.\n */\nexport function ensurePanelStyles(\n  panelDomId: string,\n  options: { extraCss?: string; nonce?: string; document?: Document } = {},\n): void {\n  injectStyleElement(panelStyleInjection(panelDomId, options));\n}\n\nexport function mountPanelStyles(\n  panelDomId: string,\n  options: { extraCss?: string; nonce?: string; document?: Document } = {},\n): () => void {\n  return mountStyleElement(panelStyleInjection(panelDomId, options));\n}\n\n/**\n * The dialog backdrop. `::backdrop` is reachable only from a stylesheet, which is why this exists\n * at all — and why it must carry the nonce like every other block.\n */\nexport function ensureDialogStyles(options: { nonce?: string; document?: Document } = {}): void {\n  injectStyleElement(dialogStyleInjection(options));\n}\n\nexport function mountDialogStyles(\n  options: { nonce?: string; document?: Document } = {},\n): () => void {\n  return mountStyleElement(dialogStyleInjection(options));\n}\n","// Lifted from `nice-devtools-shared/src/components/PanelShell.tsx`.\n//\n// The frame a panel surface shares: injected styles plus a header, filling whatever container it is\n// given. It owns no position, size or z-index state — the host places it.\n\nimport { type ReactNode, useInsertionEffect } from \"react\";\nimport { mountPanelStyles } from \"../styles\";\nimport { token, typeStyle } from \"../tokens\";\nimport { NiceUiPanelHeader } from \"./PanelChrome\";\n\nexport interface INiceUiPanelShellProps {\n  /** DOM id of the panel root — also keys the injected style block. */\n  panelDomId: string;\n  /** Consumer-specific CSS appended to the shared block (keyframes etc.). */\n  extraCss?: string;\n  /** Explicit style nonce override. CSP hosts may instead publish the document nonce transport. */\n  nonce?: string;\n  title: string;\n  onClear?: () => void;\n  paused?: boolean;\n  onTogglePause?: () => void;\n  headerChildren?: ReactNode;\n  children: ReactNode;\n}\n\nexport function NiceUiPanelShell({\n  panelDomId,\n  extraCss,\n  nonce,\n  title,\n  onClear,\n  paused,\n  onTogglePause,\n  headerChildren,\n  children,\n}: INiceUiPanelShellProps): React.JSX.Element {\n  // Insertion effects run only for a committed client tree, before layout effects. That gives the\n  // first paint its pseudo-element/focus CSS without mutating the DOM during render or under SSR.\n  useInsertionEffect(\n    () => mountPanelStyles(panelDomId, { extraCss, nonce }),\n    [panelDomId, extraCss, nonce],\n  );\n\n  return (\n    <div\n      id={panelDomId}\n      style={{\n        flex: 1,\n        minHeight: 0,\n        display: \"flex\",\n        flexDirection: \"column\",\n        background: token(\"surfaceBase\"),\n        color: token(\"textSecondary\"),\n        overflow: \"hidden\",\n        ...typeStyle(\"chrome\"),\n      }}\n    >\n      <NiceUiPanelHeader\n        title={title}\n        onClear={onClear}\n        paused={paused}\n        onTogglePause={onTogglePause}\n      >\n        {headerChildren}\n      </NiceUiPanelHeader>\n      {children}\n    </div>\n  );\n}\n","// Lifted from `nice-devtools-shared/src/components/SectionLabel.tsx`.\n//\n// ⚠ It is now a real heading. The seed rendered a `<div>`, which looks like a heading and is\n// invisible to the document outline — a screen-reader user cannot jump between sections that do not\n// exist as headings. `level` lets a caller place it correctly in the surrounding hierarchy rather\n// than hardcoding one and hoping.\n\nimport { space, token, typeStyle } from \"../tokens\";\n\nexport interface INiceUiSectionLabelProps {\n  label: string;\n  /** Heading level in the surrounding document outline. */\n  level?: 2 | 3 | 4 | 5 | 6;\n  /** Overrides the accent colour. Pass a `token(...)` reference, never a literal. */\n  color?: string;\n}\n\nexport function NiceUiSectionLabel({\n  label,\n  level = 3,\n  color = token(\"semanticSystem\"),\n}: INiceUiSectionLabelProps): React.JSX.Element {\n  const Heading = `h${level}` as const;\n  return (\n    <Heading\n      style={{\n        color,\n        marginBottom: space(\"xxs\"),\n        marginTop: 0,\n        textTransform: \"uppercase\",\n        textAlign: \"left\",\n        ...typeStyle(\"label\"),\n      }}\n    >\n      {label}\n    </Heading>\n  );\n}\n","import type { Virtualizer } from \"@tanstack/react-virtual\";\nimport { type RefObject, useCallback, useLayoutEffect, useRef } from \"react\";\n\n/**\n * Pin a virtualized list's viewport to a stable anchor row across list\n * mutations. Both devtools timelines are newest-first, so new entries (and\n * merges) prepend at the top; without this they shove whatever the user is\n * looking at downward. The anchor is the selected row when one is visible,\n * otherwise the first visible row, so \"the thing I selected / am reading\" stays\n * put at the same screen position. Returns an `onScroll` handler that must be\n * wired to the scroll container.\n *\n * `hoveringRef` is optional. When provided, the hook keeps the viewport still\n * even across selection changes while the cursor is over the list — the caller\n * is expected to suppress its own scroll-into-view in that case and let this\n * hold the view rock-still (nice-action's pause-on-hover behaviour). When\n * omitted, a selection change yields to the caller's scroll-into-view effect.\n */\nexport function useListScrollAnchor({\n  containerRef,\n  virtualizer,\n  itemKeys,\n  selectedKey,\n  hoveringRef,\n}: {\n  containerRef: RefObject<HTMLDivElement | null>;\n  virtualizer: Virtualizer<HTMLDivElement, Element>;\n  itemKeys: string[];\n  selectedKey: string | null;\n  hoveringRef?: RefObject<boolean>;\n}): () => void {\n  const anchorRef = useRef<{ key: string; delta: number } | null>(null);\n  const selectedKeyRef = useRef(selectedKey);\n  selectedKeyRef.current = selectedKey;\n\n  // Record where the anchor row sits relative to the viewport top. Called on every scroll (incl.\n  // programmatic ones), so it always reflects the last position the user actually saw.\n  const captureAnchor = useCallback(() => {\n    const el = containerRef.current;\n    if (el == null) return;\n    const items = virtualizer.getVirtualItems();\n    if (items.length === 0) {\n      anchorRef.current = null;\n      return;\n    }\n    const scrollTop = el.scrollTop;\n    const sel = selectedKeyRef.current;\n    const chosen =\n      (sel != null ? items.find((vi) => String(vi.key) === sel) : undefined) ??\n      items.find((vi) => vi.end > scrollTop) ??\n      items[0];\n    anchorRef.current = { key: String(chosen.key), delta: chosen.start - scrollTop };\n  }, [containerRef, virtualizer]);\n\n  const prevSelectedRef = useRef(selectedKey);\n  useLayoutEffect(() => {\n    const selectionChanged = prevSelectedRef.current !== selectedKey;\n    prevSelectedRef.current = selectedKey;\n    // A selection change is normally handled by the caller's scroll-into-view effect — don't fight it.\n    // We only re-pin when the list data shifted underneath a stable selection. The exception is while\n    // hovering: the caller suppresses its scroll-into-view, so we own keeping the view still and must\n    // re-pin through selection changes (e.g. \"stay on latest\" re-selecting each new entry) too.\n    if (selectionChanged && !(hoveringRef?.current ?? false)) return;\n    const anchor = anchorRef.current;\n    if (anchor == null) return;\n    const index = itemKeys.indexOf(anchor.key);\n    if (index < 0) return;\n    const offset = virtualizer.getOffsetForIndex(index, \"start\")?.[0];\n    if (offset == null) return;\n    const target = Math.max(0, offset - anchor.delta);\n    const current = virtualizer.scrollOffset ?? 0;\n    if (Math.abs(target - current) > 1) virtualizer.scrollToOffset(target);\n  }, [itemKeys, selectedKey, virtualizer, hoveringRef]);\n\n  return captureAnchor;\n}\n","// Lifted from `nice-devtools-shared/src/components/VirtualList.tsx`.\n//\n// Owns how the list *behaves* — windowed rendering, viewport anchoring across prepends,\n// scroll-the-selection-into-view, and hold-still-while-reading with an \"N new\" catch-up hint —\n// while each consumer supplies `renderItem`. The list is newest-first: new rows prepend.\n//\n// Two changes in this lift, both required by 1.3:\n//\n//   * ⚠ **A keyboard path to the hold.** The seed paused following on HOVER only. A keyboard user\n//     cannot hover, so the one affordance that stops the view yanking away mid-read was\n//     pointer-exclusive — WCAG 2.1.1. Focus now holds the view exactly as hover does (the list is\n//     a focusable region), and the pending-count hint is a polite live region, so a screen-reader\n//     user learns that rows arrived instead of silently missing them.\n//   * The `${WARNING}55` border becomes `tokenAlpha`. That concatenation was invisible to 1.5's\n//     colour guard and produced a non-colour if the role ever resolved to `rgb()`/`rgba()`.\n\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { type CSSProperties, type ReactNode, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useListScrollAnchor } from \"../list\";\nimport { rounded, space, token, tokenAlpha, typeStyle } from \"../tokens\";\n\nexport interface INiceUiVirtualListProps<T> {\n  items: T[];\n  /** Stable identity for a row — must not change as later items merge/prepend. */\n  getItemKey: (item: T, index: number) => string;\n  renderItem: (item: T, index: number) => ReactNode;\n  /** Key of the currently-selected row, for anchoring + scroll-into-view. */\n  selectedKey: string | null;\n  /** Estimated row height (px) for the virtualizer. */\n  estimateSize: number;\n  overscan?: number;\n  rowStyle?: CSSProperties;\n  empty?: ReactNode;\n  footer?: ReactNode;\n  style?: CSSProperties;\n  /** Accessible name for the scrollable region. */\n  label?: string;\n}\n\nexport function NiceUiVirtualList<T>({\n  items,\n  getItemKey,\n  renderItem,\n  selectedKey,\n  estimateSize,\n  overscan = 8,\n  rowStyle,\n  empty,\n  footer,\n  style,\n  label = \"Timeline\",\n}: INiceUiVirtualListProps<T>): React.JSX.Element {\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  // Pointer and focus are independent hold owners. Collapsing both events into setHeld(true/false)\n  // lets the first modality's leave release the second, and lets the second enter reset the pending\n  // baseline. Refs make each transition atomic before effects observe it.\n  const [held, setHeld] = useState(false);\n  const heldRef = useRef(false);\n  const pointerInsideRef = useRef(false);\n  const focusInsideRef = useRef(false);\n\n  // Activity that arrived while held, surfaced as an \"N new\" hint so the user knows fresh rows are\n  // above (newest-first) without the view jumping to reveal them.\n  const baselineCountRef = useRef(0);\n  const pendingCount = held ? Math.max(0, items.length - baselineCountRef.current) : 0;\n  const hasPending = held && pendingCount > 0;\n\n  const setModality = (modality: \"pointer\" | \"focus\", inside: boolean): void => {\n    const wasHeld = pointerInsideRef.current || focusInsideRef.current;\n    if (modality === \"pointer\") pointerInsideRef.current = inside;\n    else focusInsideRef.current = inside;\n    const nextHeld = pointerInsideRef.current || focusInsideRef.current;\n    if (!wasHeld && nextHeld) baselineCountRef.current = items.length;\n    heldRef.current = nextHeld;\n    if (nextHeld !== wasHeld) setHeld(nextHeld);\n  };\n\n  const getItemKeyRef = useRef(getItemKey);\n  getItemKeyRef.current = getItemKey;\n  const itemKeys = useMemo(() => items.map((item, i) => getItemKeyRef.current(item, i)), [items]);\n\n  const virtualizer = useVirtualizer({\n    count: items.length,\n    getScrollElement: () => containerRef.current,\n    estimateSize: () => estimateSize,\n    overscan,\n    getItemKey: (index) => itemKeys[index] as string,\n  });\n\n  const onScroll = useListScrollAnchor({\n    containerRef,\n    virtualizer,\n    itemKeys,\n    selectedKey,\n    hoveringRef: heldRef,\n  });\n\n  // Scroll the selected row into view on selection change. With \"follow latest\" this is also what\n  // pins the viewport to the top: each new entry reselects index 0. The anchor hook yields here.\n  const prevSelectedRef = useRef(selectedKey);\n  useEffect(() => {\n    if (selectedKey === prevSelectedRef.current) return;\n    prevSelectedRef.current = selectedKey;\n    if (selectedKey == null) return;\n    if (heldRef.current) return;\n    const index = itemKeys.indexOf(selectedKey);\n    if (index >= 0) virtualizer.scrollToIndex(index, { align: \"auto\" });\n  }, [selectedKey, itemKeys, virtualizer]);\n\n  if (items.length === 0) return <>{empty}</>;\n\n  return (\n    // A named <section> (implicit role=\"region\") rather than a div+role: this IS a major\n    // scrollable area of the panel, so a landmark is honest, and it needs no role suppression.\n    <section\n      ref={containerRef}\n      style={style}\n      onScroll={onScroll}\n      aria-label={label}\n      // A scrollable container must be reachable by keyboard (WCAG 2.1.1) — browsers do not focus\n      // overflow containers reliably — and focus is also what gives the keyboard the same\n      // hold-the-view affordance the pointer already had via hover.\n      // biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be focusable\n      tabIndex={0}\n      onPointerEnter={() => setModality(\"pointer\", true)}\n      onPointerLeave={() => setModality(\"pointer\", false)}\n      onFocus={() => setModality(\"focus\", true)}\n      onBlur={(event) => {\n        // React focus events bubble. Moving between the region and one of its descendants, or\n        // between two descendants, is still one continuous focus hold.\n        if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n        setModality(\"focus\", false);\n      }}\n    >\n      {hasPending && <PendingIndicator count={pendingCount} />}\n      <div style={{ position: \"relative\", width: \"100%\", height: virtualizer.getTotalSize() }}>\n        {virtualizer.getVirtualItems().map((vItem) => (\n          <div\n            key={vItem.key}\n            data-index={vItem.index}\n            ref={virtualizer.measureElement}\n            style={{\n              position: \"absolute\",\n              top: 0,\n              left: 0,\n              width: \"100%\",\n              transform: `translateY(${vItem.start}px)`,\n              ...rowStyle,\n            }}\n          >\n            {renderItem(items[vItem.index] as T, vItem.index)}\n          </div>\n        ))}\n      </div>\n      {footer}\n    </section>\n  );\n}\n\n/**\n * A sticky, zero-height overlay floating over the rows without taking layout space.\n *\n * `role=\"status\"` (polite) is the keyboard/screen-reader half of the hold: a sighted user sees the\n * badge, everyone else is told once that rows arrived. Not `alert` — this is informational, and\n * interrupting someone mid-read is the opposite of what holding the view is for.\n */\nfunction PendingIndicator({ count }: { count: number }): React.JSX.Element {\n  return (\n    <div style={{ position: \"sticky\", top: 0, height: 0, zIndex: 5, pointerEvents: \"none\" }}>\n      <div\n        role=\"status\"\n        aria-live=\"polite\"\n        style={{\n          position: \"absolute\",\n          top: space(\"xs\"),\n          right: space(\"sm\"),\n          display: \"flex\",\n          alignItems: \"center\",\n          gap: space(\"xxs\"),\n          padding: `${space(\"xxs\")} ${space(\"xs\")}`,\n          borderRadius: rounded(\"full\"),\n          color: token(\"semanticWarning\"),\n          background: token(\"tooltipBackground\"),\n          border: `1px solid ${tokenAlpha(\"semanticWarning\", 0.33)}`,\n          boxShadow: `0 2px 8px ${tokenAlpha(\"surfaceVoid\", 0.5)}`,\n          whiteSpace: \"nowrap\",\n          ...typeStyle(\"label\"),\n        }}\n      >\n        {/* Drawn, not typed: \"↑\" is a per-host font lottery (the glyph-coverage guard's class). */}\n        <svg aria-hidden=\"true\" width={8} height={8} viewBox=\"0 0 8 8\">\n          <path d=\"M4 0 L8 5 L5.4 5 L5.4 8 L2.6 8 L2.6 5 L0 5 Z\" fill=\"currentColor\" />\n        </svg>\n        {count} new\n      </div>\n    </div>\n  );\n}\n","// 1.2 — the React surface over the transport.\n//\n// ⚠ Read this before depending on the hook. The CONTEXT here is a bundle-local convenience, nothing\n// more. Because this package is private and source-only, every published dependant bundles its own\n// copy and gets its own Context identity — so a provider rendered in one consumer is invisible to a\n// component from another. **No correctness claim may depend on this context crossing two bundled\n// consumers.** What actually themes the page is the DOM: the injected stylesheet plus the\n// `data-nice-ui-scheme` attribute, which inherit through the tree no matter how many React or\n// nice-ui copies exist. The hook tells a component what it is *already* painted as.\n\nimport type { ReactNode } from \"react\";\nimport {\n  createContext,\n  useContext,\n  useEffect,\n  useInsertionEffect,\n  useMemo,\n  useRef,\n  useState,\n} from \"react\";\nimport {\n  type INiceUiStyleInjection,\n  injectStyleElement,\n  mountStyleElement,\n  mountStyleNonceTransport,\n} from \"../styles\";\nimport {\n  buildThemeCss,\n  NICE_UI_SCHEME_ATTRIBUTE,\n  NICE_UI_SCHEME_SOURCE_ATTRIBUTE,\n} from \"./cssVariables\";\nimport type { INiceUiResolvedScheme, TNiceUiSchemePreference } from \"./resolveScheme\";\nimport { prefersDarkFromMedia, resolveScheme } from \"./resolveScheme\";\nimport type { INiceUiTheme } from \"./theme\";\n\nexport interface INiceUiThemeContextValue extends INiceUiResolvedScheme {\n  theme: INiceUiTheme;\n}\n\nconst NiceUiThemeContext = createContext<INiceUiThemeContextValue | null>(null);\n\nconst THEME_STYLE_MARKER = \"data-nice-ui-theme-style\";\nconst THEME_STYLE_NAME = \"data-nice-ui-theme-name\";\nconst THEME_STYLE_SCOPE = \"data-nice-ui-theme-scope\";\n\nfunction themeStyleId(themeName: string, scopeSelector: string): string {\n  // Preserve the original unscoped id: built-consumer and browser diagnostics use it as the public\n  // transport marker. Scoped ids encode the complete tuple so concatenated names/selectors cannot\n  // collide (`[\"a\", \"bc\"]` versus `[\"ab\", \"c\"]`).\n  return scopeSelector === \"\"\n    ? `nice-ui-theme-${themeName}`\n    : `nice-ui-theme-scoped-${encodeURIComponent(JSON.stringify([themeName, scopeSelector]))}`;\n}\n\nfunction ownedThemeStyle(\n  doc: Document,\n  themeName: string,\n  scopeSelector: string,\n  id: string,\n): HTMLStyleElement | null {\n  for (const candidate of doc.head?.querySelectorAll<HTMLStyleElement>(\n    `style[${THEME_STYLE_MARKER}]`,\n  ) ?? []) {\n    if (\n      candidate.getAttribute(THEME_STYLE_NAME) === themeName &&\n      candidate.getAttribute(THEME_STYLE_SCOPE) === scopeSelector\n    ) {\n      return candidate;\n    }\n  }\n\n  // Adopt the pre-6.9f unscoped transport if it is already present during a hot upgrade.\n  const legacy = doc.getElementById(id);\n  return legacy?.tagName === \"STYLE\" ? (legacy as HTMLStyleElement) : null;\n}\n\n/**\n * Ensure one current stylesheet per exact (theme name, scope) tuple and document.\n *\n * Reusing a theme name with changed content replaces the owned node in one DOM operation. This is\n * the normal Studio iteration path, so name-only idempotence would leave stale tokens painted.\n *\n * `nonce` is the explicit path wherever a CSP names one. A host such as ui-studio may instead\n * publish the per-document Nice UI nonce transport; the single injector consumes it when this\n * option is absent. The preview serves `style-src-elem 'self' 'nonce-…'` and never\n * `'unsafe-inline'`, so a style missing both paths is blocked and reported (3.1, Appendix E).\n */\nexport function ensureThemeStyles(\n  theme: INiceUiTheme,\n  options: { scopeSelector?: string; nonce?: string; document?: Document } = {},\n): void {\n  const injection = themeStyleInjection(theme, options);\n  if (injection != null) injectStyleElement(injection);\n}\n\nfunction themeStyleInjection(\n  theme: INiceUiTheme,\n  options: { scopeSelector?: string; nonce?: string; document?: Document },\n): INiceUiStyleInjection | null {\n  const doc = options.document ?? (typeof document === \"undefined\" ? undefined : document);\n  if (doc == null) return null;\n\n  const scopeSelector = options.scopeSelector ?? \"\";\n  const id = themeStyleId(theme.name, scopeSelector);\n  const css = buildThemeCss(theme, scopeSelector);\n  const existing = ownedThemeStyle(doc, theme.name, scopeSelector, id);\n  // Adopt a marked pre-6.9k node into the canonical id before the single injector owns updates.\n  if (existing != null && existing.id !== id && doc.getElementById(id) == null) existing.id = id;\n  return {\n    id,\n    css,\n    nonce: options.nonce,\n    document: doc,\n    attributes: {\n      [THEME_STYLE_MARKER]: \"\",\n      [THEME_STYLE_NAME]: theme.name,\n      [THEME_STYLE_SCOPE]: scopeSelector,\n    },\n  };\n}\n\nexport function mountThemeStyles(\n  theme: INiceUiTheme,\n  options: { scopeSelector?: string; nonce?: string; document?: Document } = {},\n): () => void {\n  const injection = themeStyleInjection(theme, options);\n  return injection == null ? () => {} : mountStyleElement(injection);\n}\n\nexport interface INiceUiThemeProviderProps {\n  theme: INiceUiTheme;\n  /**\n   * Explicit choice — highest priority. In `\"system\"`, CSS repaints from its media query without a\n   * DOM mutation; the context subscription still re-renders when the resolved scheme changes.\n   */\n  scheme?: TNiceUiSchemePreference;\n  /** The consumer's persisted choice. The library never touches storage itself. */\n  persistedScheme?: TNiceUiSchemePreference;\n  /** Where to put the attribute and the styles. Defaults to `<html>`. */\n  target?: HTMLElement | null;\n  /** Prefix every theme selector, allowing independent revisions on separate target subtrees. */\n  scopeSelector?: string;\n  nonce?: string;\n  children?: ReactNode;\n}\n\ninterface IAttributeSnapshot {\n  readonly present: boolean;\n  readonly value: string | null;\n}\n\ninterface IThemeAttributeOwner {\n  readonly token: object;\n  readonly applied: string;\n  readonly source: string;\n}\n\ninterface IThemeAttributeOwnership {\n  readonly priorScheme: IAttributeSnapshot;\n  readonly priorSource: IAttributeSnapshot;\n  readonly owners: IThemeAttributeOwner[];\n}\n\nconst THEME_ATTRIBUTE_OWNERS = Symbol.for(\"@nice-code/ui/theme-attribute-owners\");\nconst sharedGlobal = globalThis as typeof globalThis & Record<symbol, unknown>;\nconst themeAttributeOwners =\n  (sharedGlobal[THEME_ATTRIBUTE_OWNERS] as\n    | WeakMap<HTMLElement, IThemeAttributeOwnership>\n    | undefined) ?? new WeakMap<HTMLElement, IThemeAttributeOwnership>();\nsharedGlobal[THEME_ATTRIBUTE_OWNERS] = themeAttributeOwners;\n\nfunction snapshotAttribute(element: HTMLElement, name: string): IAttributeSnapshot {\n  return { present: element.hasAttribute(name), value: element.getAttribute(name) };\n}\n\nfunction restoreAttribute(element: HTMLElement, name: string, snapshot: IAttributeSnapshot): void {\n  if (snapshot.present) {\n    element.setAttribute(name, snapshot.value ?? \"\");\n  } else {\n    element.removeAttribute(name);\n  }\n}\n\nfunction writeOwnedAttributes(element: HTMLElement, owner: IThemeAttributeOwner): void {\n  element.setAttribute(NICE_UI_SCHEME_ATTRIBUTE, owner.applied);\n  element.setAttribute(NICE_UI_SCHEME_SOURCE_ATTRIBUTE, owner.source);\n}\n\nfunction claimThemeAttributes(element: HTMLElement, owner: IThemeAttributeOwner): void {\n  let ownership = themeAttributeOwners.get(element);\n  if (ownership == null) {\n    ownership = {\n      priorScheme: snapshotAttribute(element, NICE_UI_SCHEME_ATTRIBUTE),\n      priorSource: snapshotAttribute(element, NICE_UI_SCHEME_SOURCE_ATTRIBUTE),\n      owners: [],\n    };\n    themeAttributeOwners.set(element, ownership);\n  }\n  const previous = ownership.owners.findIndex((candidate) => candidate.token === owner.token);\n  if (previous >= 0) ownership.owners.splice(previous, 1);\n  ownership.owners.push(owner);\n  writeOwnedAttributes(element, owner);\n}\n\nfunction releaseThemeAttributes(element: HTMLElement, token: object): void {\n  const ownership = themeAttributeOwners.get(element);\n  if (ownership == null) return;\n  const index = ownership.owners.findIndex((candidate) => candidate.token === token);\n  if (index < 0) return;\n  ownership.owners.splice(index, 1);\n\n  const active = ownership.owners.at(-1);\n  if (active != null) {\n    writeOwnedAttributes(element, active);\n    return;\n  }\n  restoreAttribute(element, NICE_UI_SCHEME_ATTRIBUTE, ownership.priorScheme);\n  restoreAttribute(element, NICE_UI_SCHEME_SOURCE_ATTRIBUTE, ownership.priorSource);\n  themeAttributeOwners.delete(element);\n}\n\nexport function mountNiceUiThemeDom(\n  theme: INiceUiTheme,\n  options: {\n    target?: HTMLElement | null;\n    document?: Document;\n    scopeSelector?: string;\n    nonce?: string;\n    applied: TNiceUiSchemePreference;\n    source: INiceUiResolvedScheme[\"source\"];\n  },\n): () => void {\n  const doc = options.document ?? options.target?.ownerDocument;\n  const element =\n    options.target ??\n    doc?.documentElement ??\n    (typeof document === \"undefined\" ? null : document.documentElement);\n  if (element == null) return () => {};\n  const releaseNonce = mountStyleNonceTransport(options.nonce, element.ownerDocument);\n  const releaseStyles = mountThemeStyles(theme, {\n    nonce: options.nonce,\n    scopeSelector: options.scopeSelector,\n    document: element.ownerDocument,\n  });\n  const token = {};\n  claimThemeAttributes(element, { token, applied: options.applied, source: options.source });\n  return () => {\n    releaseStyles();\n    releaseNonce();\n    releaseThemeAttributes(element, token);\n  };\n}\n\nexport function NiceUiThemeProvider({\n  theme,\n  scheme,\n  persistedScheme,\n  target,\n  scopeSelector,\n  nonce,\n  children,\n}: INiceUiThemeProviderProps): React.JSX.Element {\n  // Read the media preference once on mount rather than during render, so SSR and the first client\n  // render agree and React does not warn about a hydration mismatch.\n  const [prefersDark, setPrefersDark] = useState<boolean | undefined>(undefined);\n  const attributeOwner = useRef<object>({});\n\n  useEffect(() => {\n    setPrefersDark(prefersDarkFromMedia());\n    if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return;\n    const query = window.matchMedia(\"(prefers-color-scheme: dark)\");\n    const onChange = (event: MediaQueryListEvent): void => setPrefersDark(event.matches);\n    query.addEventListener(\"change\", onChange);\n    return () => query.removeEventListener(\"change\", onChange);\n  }, []);\n\n  const resolved = useMemo(\n    () => resolveScheme(theme, { prop: scheme, persisted: persistedScheme, prefersDark }),\n    [theme, scheme, persistedScheme, prefersDark],\n  );\n\n  useInsertionEffect(() => {\n    const element = target ?? (typeof document === \"undefined\" ? null : document.documentElement);\n    if (element == null) return;\n    const releaseNonce = mountStyleNonceTransport(nonce, element.ownerDocument);\n    const releaseStyles = mountThemeStyles(theme, {\n      nonce,\n      scopeSelector,\n      document: element.ownerDocument,\n    });\n    return () => {\n      releaseStyles();\n      releaseNonce();\n    };\n  }, [theme, nonce, scopeSelector, target]);\n\n  useEffect(() => {\n    const element = target ?? (typeof document === \"undefined\" ? null : document.documentElement);\n    if (element == null) return;\n    // `applied`, not `scheme`: when the preference is \"system\" the attribute must stay \"system\" so\n    // the media block keeps driving it. Writing the resolved value would pin the page.\n    claimThemeAttributes(element, {\n      token: attributeOwner.current,\n      applied: resolved.applied,\n      source: resolved.source,\n    });\n    return () => releaseThemeAttributes(element, attributeOwner.current);\n  }, [target, resolved.applied, resolved.source]);\n\n  const value = useMemo<INiceUiThemeContextValue>(\n    () => ({ ...resolved, theme }),\n    [resolved, theme],\n  );\n\n  return <NiceUiThemeContext.Provider value={value}>{children}</NiceUiThemeContext.Provider>;\n}\n\n/**\n * The resolved scheme for the nearest provider **in this bundle**. Returns `null` when there is\n * none — which, per the note at the top of this file, is a normal situation for a component from a\n * different bundled consumer, not an error. Components must not need this to render correctly; the\n * CSS variables already have them covered.\n */\nexport function useNiceUiTheme(): INiceUiThemeContextValue | null {\n  return useContext(NiceUiThemeContext);\n}\n","import { fontFamilyToken, token } from \"@nice-code/ui\";\nimport type { ReactNode } from \"react\";\n\n/**\n * The \"Follow latest\" toggle pair shown above a devtools timeline list, with its\n * indented \"clicking latest re-follows\" sub-option. `noun` is the thing the\n * timeline tracks (\"action\" in nice-action, \"change\" in nice-state) and is woven\n * into the explanatory tooltips so both suites read naturally from one component.\n */\nexport function FollowLatestToggles({\n  noun,\n  stayOnLatest,\n  onStayOnLatestChange,\n  followLatestOnSelect,\n  onFollowLatestOnSelectChange,\n}: {\n  noun: string;\n  stayOnLatest: boolean;\n  onStayOnLatestChange: (next: boolean) => void;\n  followLatestOnSelect: boolean;\n  onFollowLatestOnSelectChange: (next: boolean) => void;\n}) {\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        flexDirection: \"column\",\n        flexShrink: 0,\n        paddingBottom: \"3px\",\n        background: token(\"surfaceSection\"),\n        borderBottom: `1px solid ${token(\"surfaceBase\")}`,\n      }}\n    >\n      <ToggleLabel\n        title={`Auto-select the most recent ${noun} so the detail pane keeps showing the latest as new ${noun}s land`}\n        checked={stayOnLatest}\n        onChange={onStayOnLatestChange}\n      >\n        Follow latest\n      </ToggleLabel>\n      {/* Sub-option of \"Follow latest\": indented under it because it only tunes\n          how following resumes when the latest entry is clicked. */}\n      <div\n        style={{ display: \"flex\", alignItems: \"center\", paddingLeft: \"12px\", marginTop: \"-4px\" }}\n      >\n        <span\n          aria-hidden\n          style={{\n            color: token(\"textMuted\"),\n            fontFamily: fontFamilyToken(\"body\"),\n            fontSize: \"10px\",\n            lineHeight: 1,\n          }}\n        >\n          └\n        </span>\n        <ToggleLabel\n          title={`When you click the latest ${noun}, turn 'Follow latest' back on so the view resumes tracking new ${noun}s. Turn this off to pin exactly to the ${noun} you click instead.`}\n          checked={followLatestOnSelect}\n          onChange={onFollowLatestOnSelectChange}\n        >\n          clicking latest re-follows\n        </ToggleLabel>\n      </div>\n    </div>\n  );\n}\n\nfunction ToggleLabel({\n  checked,\n  onChange,\n  title,\n  children,\n}: {\n  checked: boolean;\n  onChange: (next: boolean) => void;\n  title: string;\n  children: ReactNode;\n}) {\n  return (\n    <label\n      title={title}\n      style={{\n        display: \"flex\",\n        alignItems: \"center\",\n        gap: \"6px\",\n        padding: \"5px 10px\",\n        cursor: \"pointer\",\n        userSelect: \"none\",\n        color: checked ? token(\"textSecondary\") : token(\"textMuted\"),\n        fontSize: \"10px\",\n        fontFamily: fontFamilyToken(\"body\"),\n      }}\n    >\n      <input\n        type=\"checkbox\"\n        checked={checked}\n        onChange={(e) => onChange(e.target.checked)}\n        style={{ accentColor: token(\"semanticSystem\"), cursor: \"pointer\", margin: 0 }}\n      />\n      {children}\n    </label>\n  );\n}\n","// Small, dependency-free formatting helpers shared by both devtools suites.\n\n/** Pretty-print any value to JSON, degrading gracefully for cyclic / non-JSON values. */\nexport function safeStringify(value: unknown, indent = 2): string {\n  if (value === undefined) return \"undefined\";\n  if (value === null) return \"null\";\n  try {\n    return JSON.stringify(value, null, indent);\n  } catch {\n    return String(value);\n  }\n}\n\n/** Wall-clock time of day, e.g. `14:03:09`. */\nexport function formatTimestamp(ms: number): string {\n  return new Date(ms).toLocaleTimeString([], {\n    hour: \"2-digit\",\n    minute: \"2-digit\",\n    second: \"2-digit\",\n    hour12: false,\n  });\n}\n\n/** Compact relative age: `850ms`, `3.2s`, `4m`. */\nexport function formatRelativeAge(ms: number): string {\n  if (ms < 1000) return `${ms}ms`;\n  if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;\n  return `${Math.floor(ms / 60_000)}m`;\n}\n\n/** Compact byte size: `0 B`, `418 B`, `1.4 KB`, `2.0 MB`. */\nexport function formatBytes(bytes: number): string {\n  if (bytes < 1024) return `${Math.round(bytes)} B`;\n  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n  if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n  return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n}\n\n/** Compact count: `0`, `950`, `1.2k`, `3.4M`. */\nexport function formatCount(count: number): string {\n  if (count < 1000) return `${Math.round(count)}`;\n  if (count < 1_000_000) return `${(count / 1000).toFixed(1)}k`;\n  return `${(count / 1_000_000).toFixed(1)}M`;\n}\n\n/** A per-second rate with its unit, e.g. `1.4 KB/s`, `12/s`. */\nexport function formatRate(perSec: number, unit: \"bytes\" | \"msgs\"): string {\n  if (unit === \"bytes\") return `${formatBytes(perSec)}/s`;\n  if (perSec >= 100) return `${Math.round(perSec)}/s`;\n  return `${perSec >= 10 ? perSec.toFixed(0) : perSec.toFixed(1)}/s`;\n}\n\n/** Compact window label: `1s`, `10s`, `1m`, `15m`. */\nexport function formatWindow(windowMs: number): string {\n  if (!Number.isFinite(windowMs)) return \"MAX\";\n  const seconds = windowMs / 1000;\n  if (seconds < 60) return `${seconds}s`;\n  return `${seconds / 60}m`;\n}\n\n/**\n * Middle-truncate a long identifier so both ends stay readable: a runtime coordinate's `stringId`\n * carries the env at the front and the instance at the back, and a uuid-shaped persistent id in the\n * middle — the two informative parts are exactly the ones a plain `…` tail-truncation would eat.\n * Always pair with a `title` carrying the full id.\n */\nexport function formatMiddleTruncated(value: string, max = 28): string {\n  if (value.length <= max) return value;\n  const keep = max - 1;\n  const head = Math.ceil(keep / 2);\n  const tail = Math.floor(keep / 2);\n  return `${value.slice(0, head)}…${value.slice(value.length - tail)}`;\n}\n","import { fontFamilyToken, token } from \"@nice-code/ui\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { safeStringify } from \"./format\";\n\n// Regex-based JSON tokenizer — strings (and the `:` that may follow a key),\n// numbers, keywords and structural punctuation each get their own colour.\nconst JSON_TOKEN_RE =\n  /(\"(?:\\\\.|[^\"\\\\])*\")(\\s*:)?|(-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(\\btrue\\b|\\bfalse\\b|\\bnull\\b|\\bundefined\\b)|([{}[\\],])/g;\n\n/** Tokenize a JSON string into coloured <span> nodes for inline rendering. */\nexport function renderColoredJson(text: string): ReactNode[] {\n  const nodes: ReactNode[] = [];\n  let last = 0;\n  let i = 0;\n  JSON_TOKEN_RE.lastIndex = 0;\n  for (let m = JSON_TOKEN_RE.exec(text); m !== null; m = JSON_TOKEN_RE.exec(text)) {\n    if (m.index > last) nodes.push(text.slice(last, m.index));\n    const [, str, colon, num, kw, punct] = m;\n    if (str != null) {\n      if (colon != null) {\n        nodes.push(\n          <span key={i++} style={{ color: token(\"jsonKey\") }}>\n            {str}\n          </span>,\n        );\n        nodes.push(\n          <span key={i++} style={{ color: token(\"jsonPunctuation\") }}>\n            {colon}\n          </span>,\n        );\n      } else {\n        nodes.push(\n          <span key={i++} style={{ color: token(\"jsonString\") }}>\n            {str}\n          </span>,\n        );\n      }\n    } else if (num != null) {\n      nodes.push(\n        <span key={i++} style={{ color: token(\"jsonNumber\") }}>\n          {num}\n        </span>,\n      );\n    } else if (kw != null) {\n      nodes.push(\n        <span key={i++} style={{ color: token(\"jsonKeyword\") }}>\n          {kw}\n        </span>,\n      );\n    } else if (punct != null) {\n      nodes.push(\n        <span key={i++} style={{ color: token(\"jsonPunctuation\") }}>\n          {punct}\n        </span>,\n      );\n    }\n    last = JSON_TOKEN_RE.lastIndex;\n  }\n  if (last < text.length) nodes.push(text.slice(last));\n  return nodes;\n}\n\n/** A pre-formatted, syntax-highlighted JSON block. */\nexport function JsonView({\n  value,\n  indent = 2,\n  style,\n}: {\n  value: unknown;\n  indent?: number;\n  style?: CSSProperties;\n}) {\n  const text = safeStringify(value, indent);\n  return (\n    <pre\n      style={{\n        margin: 0,\n        padding: \"8px 10px\",\n        borderRadius: \"4px\",\n        fontSize: \"11px\",\n        lineHeight: 1.5,\n        fontFamily: fontFamilyToken(\"code\"),\n        background: token(\"surfaceSectionAlt\"),\n        overflowX: \"auto\",\n        whiteSpace: \"pre-wrap\",\n        wordBreak: \"break-word\",\n        ...style,\n      }}\n    >\n      {renderColoredJson(text)}\n    </pre>\n  );\n}\n","// 6.1's glyph sweep: every symbol-block character these devtools used to TYPE is now DRAWN.\n//\n// A typed \"▸\" or \"🌐\" is a per-host font lottery — U+23F8 rendered tofu on WSL2 and a glyph on\n// ubuntu, which is how the first cross-host visual probe failed (see nice-ui's glyph-coverage\n// guard). Marks on `currentColor`, sized in em, inherit exactly what the surrounding text would\n// have given the glyph: same colour, same scale, no font involved.\n//\n// One module rather than per-site inline SVGs because the same mark recurs across panels (six\n// expander carets, five in/out triangles) and a caret that drifts per site is its own bug class.\n// Contexts that can only hold a STRING — `<option>` labels, `title` attributes, terminal log\n// prefixes — cannot use these; they use universally-covered punctuation instead (`•`, `·`) and\n// `scripts/check-rendered-glyphs.ts` polices the difference.\n\nimport type { CSSProperties, ReactNode } from \"react\";\n\ninterface IMarkProps {\n  /** Merged onto the svg — margins and one-off alignment nudges only; never colour. */\n  style?: CSSProperties;\n}\n\nfunction svgProps(size: string, style: CSSProperties | undefined) {\n  return {\n    \"aria-hidden\": true as const,\n    viewBox: \"0 0 10 10\",\n    style: { width: size, height: size, verticalAlign: \"-0.05em\", flexShrink: 0, ...style },\n  };\n}\n\n/** ▸ / ▾ — the expander caret. */\nexport function CaretMark({ expanded, style }: IMarkProps & { expanded: boolean }): ReactNode {\n  return (\n    <svg {...svgProps(\"0.62em\", style)}>\n      {expanded ? (\n        <path d=\"M1.5 3 H8.5 L5 8.5 Z\" fill=\"currentColor\" />\n      ) : (\n        <path d=\"M3 1.5 V8.5 L8.5 5 Z\" fill=\"currentColor\" />\n      )}\n    </svg>\n  );\n}\n\n/** ▲ / ▼ — traffic direction. */\nexport function TriangleMark({ dir, style }: IMarkProps & { dir: \"up\" | \"down\" }): ReactNode {\n  return (\n    <svg {...svgProps(\"0.62em\", style)}>\n      {dir === \"up\" ? (\n        <path d=\"M5 1.5 L9 8.5 H1 Z\" fill=\"currentColor\" />\n      ) : (\n        <path d=\"M1 1.5 H9 L5 8.5 Z\" fill=\"currentColor\" />\n      )}\n    </svg>\n  );\n}\n\n/** ● / ○ / ◉ — status dots. */\nexport function DotMark({\n  variant,\n  style,\n}: IMarkProps & { variant: \"solid\" | \"ring\" | \"target\" }): ReactNode {\n  return (\n    <svg {...svgProps(\"0.62em\", style)}>\n      {variant !== \"ring\" && (\n        <circle cx=\"5\" cy=\"5\" r={variant === \"target\" ? 2 : 3.6} fill=\"currentColor\" />\n      )}\n      {variant !== \"solid\" && (\n        <circle cx=\"5\" cy=\"5\" r=\"3.9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" />\n      )}\n    </svg>\n  );\n}\n\n/** → ← ↑ ↳ ⇢ ↗ — the arrows prose used to type. */\nexport function ArrowMark({\n  kind,\n  style,\n}: IMarkProps & {\n  kind: \"right\" | \"left\" | \"up\" | \"branch\" | \"dashedRight\" | \"external\";\n}): ReactNode {\n  const props = svgProps(\"0.7em\", style);\n  switch (kind) {\n    case \"right\":\n      return (\n        <svg {...props}>\n          <path\n            d=\"M1 5 H8 M5.4 2 L8.6 5 L5.4 8\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.3\"\n          />\n        </svg>\n      );\n    case \"left\":\n      return (\n        <svg {...props}>\n          <path\n            d=\"M9 5 H2 M4.6 2 L1.4 5 L4.6 8\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.3\"\n          />\n        </svg>\n      );\n    case \"up\":\n      return (\n        <svg {...props}>\n          <path\n            d=\"M5 9 V2 M2 5.6 L5 1.4 L8 5.6\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.3\"\n          />\n        </svg>\n      );\n    case \"branch\":\n      // ↳ — enters from the top, turns toward the target.\n      return (\n        <svg {...props}>\n          <path\n            d=\"M2 1 V6.5 H8 M5.6 3.8 L8.6 6.5 L5.6 9.2\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.3\"\n          />\n        </svg>\n      );\n    case \"dashedRight\":\n      return (\n        <svg {...props}>\n          <path\n            d=\"M1 5 H7.6\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.3\"\n            strokeDasharray=\"1.7 1.4\"\n          />\n          <path d=\"M5.4 2 L8.6 5 L5.4 8\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n        </svg>\n      );\n    case \"external\":\n      // ↗ — out of the corner of its box.\n      return (\n        <svg {...props}>\n          <path d=\"M2 8 L8 2 M3.6 2 H8 V6.4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n        </svg>\n      );\n  }\n}\n\n/** ⬢ — the domain chip's hex. */\nexport function HexMark({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.7em\", style)}>\n      <path d=\"M5 0.8 L8.8 3 V7 L5 9.2 L1.2 7 V3 Z\" fill=\"currentColor\" />\n    </svg>\n  );\n}\n\n// ─── Tool identity icons (the emoji they replace: ⚡ 🧩 🌐 🖥 🔗) ────────────────────────────────\n// Line icons, not filled: at 10–14px a filled silhouette reads as a blob; strokes stay legible.\n\nexport function BoltIcon({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.85em\", style)}>\n      <path d=\"M5.8 0.8 L2 5.6 H4.6 L4.2 9.2 L8 4.4 H5.4 Z\" fill=\"currentColor\" />\n    </svg>\n  );\n}\n\nexport function PuzzleIcon({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.85em\", style)}>\n      <path\n        d=\"M1.5 3.5 H3.4 A1.1 1.1 0 1 1 5.6 3.5 H7.5 V5.4 A1.1 1.1 0 1 0 7.5 7.6 V9.5 H1.5 Z\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.1\"\n      />\n    </svg>\n  );\n}\n\nexport function GlobeIcon({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.85em\", style)}>\n      <circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.1\" />\n      <ellipse cx=\"5\" cy=\"5\" rx=\"1.8\" ry=\"4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"0.9\" />\n      <path d=\"M1 5 H9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"0.9\" />\n    </svg>\n  );\n}\n\nexport function MonitorIcon({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.85em\", style)}>\n      <rect\n        x=\"1\"\n        y=\"1.5\"\n        width=\"8\"\n        height=\"5.5\"\n        rx=\"0.8\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.1\"\n      />\n      <path d=\"M3.5 9 H6.5 M5 7 V9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.1\" />\n    </svg>\n  );\n}\n\nexport function LinkIcon({ style }: IMarkProps): ReactNode {\n  return (\n    <svg {...svgProps(\"0.85em\", style)}>\n      <path\n        d=\"M4.2 5.8 L5.8 4.2 M3 7 L2.2 7.8 A1.55 1.55 0 0 0 4.4 10 L5.9 8.5 A1.55 1.55 0 0 0 3.7 6.3 M7 3 L7.8 2.2 A1.55 1.55 0 0 0 5.6 0 L4.1 1.5 A1.55 1.55 0 0 0 6.3 3.7\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.1\"\n        transform=\"translate(0,-0.4) scale(0.96)\"\n      />\n    </svg>\n  );\n}\n","import { useEffect, useState } from \"react\";\n\n/**\n * The prefs every devtools panel persists. Suites extend this with their own\n * fields (e.g. nice-state's diff-view toggles) — the whole object round-trips\n * through one localStorage key via {@link useDevtoolsPrefs}.\n */\nexport interface IDevtoolsBasePrefs {\n  /** Fraction of the panel the detail pane occupies. */\n  detailRatio: number;\n  stayOnLatest: boolean;\n  followLatestOnSelect: boolean;\n}\n\nexport const DEVTOOLS_DETAIL_RATIO_DEFAULT = 0.5;\n\n/**\n * Read a panel's persisted prefs, merged over `fallback`. Safe against a missing\n * `localStorage` (SSR) and corrupt JSON. Keys the panel no longer knows about —\n * e.g. the dock position/size a previous version wrote — ride along unread and\n * are harmless.\n */\nexport function readDevtoolsPrefs<TPrefs extends IDevtoolsBasePrefs>(\n  key: string,\n  fallback: TPrefs,\n): TPrefs {\n  try {\n    if (typeof localStorage === \"undefined\") return fallback;\n    const stored = localStorage.getItem(key);\n    return stored != null ? { ...fallback, ...JSON.parse(stored) } : fallback;\n  } catch {\n    return fallback;\n  }\n}\n\nexport function writeDevtoolsPrefs<TPrefs extends IDevtoolsBasePrefs>(\n  key: string,\n  prefs: TPrefs,\n): void {\n  try {\n    localStorage.setItem(key, JSON.stringify(prefs));\n  } catch {\n    return;\n  }\n}\n\n/**\n * localStorage-backed panel prefs: read once on mount, partial-merge updates,\n * debounced persist — a split drag fires on every mouse move, so writing on\n * each one would thrash localStorage.\n *\n * `fallback` also carries the caller's dynamic defaults; it is only read on\n * first render.\n */\nexport function useDevtoolsPrefs<TPrefs extends IDevtoolsBasePrefs>(\n  key: string,\n  fallback: TPrefs,\n): [TPrefs, (update: Partial<TPrefs>) => void] {\n  const [prefs, setPrefsRaw] = useState<TPrefs>(() => readDevtoolsPrefs(key, fallback));\n\n  useEffect(() => {\n    const timer = setTimeout(() => writeDevtoolsPrefs(key, prefs), 250);\n    return () => clearTimeout(timer);\n  }, [key, prefs]);\n\n  const setPrefs = (update: Partial<TPrefs>) => {\n    setPrefsRaw((prev) => ({ ...prev, ...update }));\n  };\n\n  return [prefs, setPrefs];\n}\n","import {\n  ensureThemeStyles,\n  mountNiceUiThemeDom,\n  NICE_UI_DEFAULT_THEME,\n  NICE_UI_SCHEME_ATTRIBUTE,\n  NICE_UI_SCHEME_SOURCE_ATTRIBUTE,\n} from \"@nice-code/ui\";\nimport { useInsertionEffect } from \"react\";\n\n/**\n * Mount the nice-ui theme in a devtools-owned document (6.1): the variable stylesheet plus the\n * scheme attribute every `var(--nice-ui-…)` reference in `colors.ts` resolves through. Dark is\n * pinned for now — the devtools have always been dark-only; a scheme toggle is a later decision,\n * and D8 means flipping it needs no re-render when it comes.\n *\n * Call once per document that renders devtools UI. Idempotent (ensureThemeStyles keys by theme\n * name); no-op outside the DOM.\n */\nexport function ensureDevtoolsTheme(doc?: Document): void {\n  const target = doc ?? (typeof document === \"undefined\" ? undefined : document);\n  if (target == null) return;\n  ensureThemeStyles(NICE_UI_DEFAULT_THEME, { document: target });\n  target.documentElement.setAttribute(NICE_UI_SCHEME_ATTRIBUTE, \"dark\");\n  target.documentElement.setAttribute(NICE_UI_SCHEME_SOURCE_ATTRIBUTE, \"prop\");\n}\n\n/**\n * React-owned theme bootstrap. It runs only for committed trees, before layout, and restores the\n * exact prior root attributes after the final independently bundled panel unmounts.\n */\nexport function useDevtoolsTheme(doc?: Document): void {\n  useInsertionEffect(\n    () =>\n      mountNiceUiThemeDom(NICE_UI_DEFAULT_THEME, {\n        document: doc,\n        applied: \"dark\",\n        source: \"prop\",\n      }),\n    [doc],\n  );\n}\n","import type { ITrafficLaneStats } from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, token } from \"@nice-code/ui\";\nimport { Fragment, useState } from \"react\";\nimport { formatBytes, formatCount } from \"../../format\";\nimport { CaretMark } from \"../../marks\";\n\nconst CELL: React.CSSProperties = {\n  padding: \"3px 8px\",\n  fontSize: \"11px\",\n  textAlign: \"right\",\n  whiteSpace: \"nowrap\",\n};\n\nconst HEAD_CELL: React.CSSProperties = {\n  ...CELL,\n  fontFamily: fontFamilyToken(\"body\"),\n  fontSize: \"9px\",\n  textTransform: \"uppercase\",\n  letterSpacing: \"0.05em\",\n  color: token(\"textMuted\"),\n};\n\n/**\n * Per-lane counts + bytes over the snapshot's window; a lane with per-kind\n * attribution (e.g. realm frame kinds) expands on click.\n */\nexport function LaneBreakdownTable({ lanes }: { lanes: ITrafficLaneStats[] }) {\n  const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n  if (lanes.length === 0) {\n    return (\n      <div\n        style={{\n          padding: \"10px\",\n          fontSize: \"11px\",\n          color: token(\"textMuted\"),\n          fontStyle: \"italic\",\n        }}\n      >\n        No traffic in this window.\n      </div>\n    );\n  }\n\n  const toggle = (lane: string) => {\n    setExpanded((prev) => {\n      const next = new Set(prev);\n      if (next.has(lane)) next.delete(lane);\n      else next.add(lane);\n      return next;\n    });\n  };\n\n  return (\n    <table style={{ width: \"100%\", borderCollapse: \"collapse\" }}>\n      <thead>\n        <tr style={{ borderBottom: `1px solid ${token(\"surfaceSection\")}` }}>\n          <th style={{ ...HEAD_CELL, textAlign: \"left\" }}>lane</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSystem\") }}>in</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSystem\") }}>in bytes</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSuccess\") }}>out</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSuccess\") }}>out bytes</th>\n        </tr>\n      </thead>\n      <tbody>\n        {lanes.map((lane) => {\n          const expandable = lane.kinds.length > 0;\n          const isExpanded = expanded.has(lane.lane);\n          return (\n            <Fragment key={lane.lane}>\n              <tr\n                onClick={expandable ? () => toggle(lane.lane) : undefined}\n                style={{\n                  cursor: expandable ? \"pointer\" : undefined,\n                  borderBottom: `1px solid ${token(\"surfaceSection\")}`,\n                }}\n              >\n                <td style={{ ...CELL, textAlign: \"left\", color: token(\"textEmphasis\") }}>\n                  {expandable && (\n                    <span style={{ color: token(\"textFaint\"), marginRight: \"4px\" }}>\n                      <CaretMark expanded={isExpanded} />\n                    </span>\n                  )}\n                  {lane.lane}\n                </td>\n                <td style={CELL}>{formatCount(lane.in.count)}</td>\n                <td style={CELL}>{formatBytes(lane.in.bytes)}</td>\n                <td style={CELL}>{formatCount(lane.out.count)}</td>\n                <td style={CELL}>{formatBytes(lane.out.bytes)}</td>\n              </tr>\n              {isExpanded &&\n                lane.kinds.map((kind) => (\n                  <tr key={`${lane.lane}:${kind.kind}`}>\n                    <td\n                      style={{\n                        ...CELL,\n                        textAlign: \"left\",\n                        paddingLeft: \"24px\",\n                        color: token(\"textMuted\"),\n                      }}\n                    >\n                      {kind.kind}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatCount(kind.in.count)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatBytes(kind.in.bytes)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatCount(kind.out.count)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatBytes(kind.out.bytes)}\n                    </td>\n                  </tr>\n                ))}\n            </Fragment>\n          );\n        })}\n      </tbody>\n    </table>\n  );\n}\n","import type { ITrafficTopFrame } from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, token } from \"@nice-code/ui\";\nimport { useState } from \"react\";\nimport { formatBytes, formatRelativeAge } from \"../../format\";\nimport { TriangleMark } from \"../../marks\";\n\n/**\n * The largest frames on record — size + attribution only (no contents). Kept\n * minimal by default (just the top {@link collapsedCount}); the rest are one\n * click away so the section doesn't dominate the traffic view.\n */\nexport function LargestFramesList({\n  frames,\n  now,\n  collapsedCount = 3,\n}: {\n  frames: ITrafficTopFrame[];\n  now: number;\n  collapsedCount?: number;\n}) {\n  const [expanded, setExpanded] = useState(false);\n\n  if (frames.length === 0) {\n    return (\n      <div\n        style={{\n          padding: \"10px\",\n          fontSize: \"11px\",\n          color: token(\"textMuted\"),\n          fontStyle: \"italic\",\n        }}\n      >\n        No frames recorded yet.\n      </div>\n    );\n  }\n\n  const canCollapse = frames.length > collapsedCount;\n  const shown = expanded || !canCollapse ? frames : frames.slice(0, collapsedCount);\n  const hiddenCount = frames.length - shown.length;\n\n  return (\n    <div style={{ display: \"flex\", flexDirection: \"column\" }}>\n      {shown.map((frame) => (\n        <div\n          key={`${frame.atMs}:${frame.dir}:${frame.bytes}:${frame.lane}:${frame.kind ?? \"\"}`}\n          style={{\n            display: \"flex\",\n            alignItems: \"baseline\",\n            gap: \"8px\",\n            padding: \"3px 8px\",\n            fontSize: \"11px\",\n            borderBottom: `1px solid ${token(\"surfaceSection\")}`,\n          }}\n        >\n          <span\n            style={{\n              color: frame.dir === \"in\" ? token(\"semanticSystem\") : token(\"semanticSuccess\"),\n              width: \"24px\",\n              flexShrink: 0,\n            }}\n          >\n            <TriangleMark dir={frame.dir === \"in\" ? \"down\" : \"up\"} style={{ marginRight: \"3px\" }} />\n            {frame.dir === \"in\" ? \"in\" : \"out\"}\n          </span>\n          <span\n            style={{\n              color: token(\"textEmphasis\"),\n              width: \"64px\",\n              textAlign: \"right\",\n              flexShrink: 0,\n            }}\n          >\n            {formatBytes(frame.bytes)}\n          </span>\n          <span\n            style={{\n              color: token(\"textMuted\"),\n              flex: 1,\n              minWidth: 0,\n              overflow: \"hidden\",\n              textOverflow: \"ellipsis\",\n            }}\n          >\n            {frame.lane}\n            {frame.kind != null ? ` · ${frame.kind}` : \"\"}\n          </span>\n          <span style={{ color: token(\"textMuted\"), flexShrink: 0 }}>\n            {formatRelativeAge(Math.max(0, now - frame.atMs))} ago\n          </span>\n        </div>\n      ))}\n      {canCollapse && (\n        <button\n          type=\"button\"\n          onClick={() => setExpanded((prev) => !prev)}\n          style={{\n            appearance: \"none\",\n            background: \"transparent\",\n            border: \"none\",\n            cursor: \"pointer\",\n            textAlign: \"left\",\n            padding: \"4px 8px\",\n            fontSize: \"10px\",\n            fontFamily: fontFamilyToken(\"body\"),\n            color: token(\"textMuted\"),\n          }}\n        >\n          <TriangleMark dir={expanded ? \"up\" : \"down\"} style={{ marginRight: \"3px\" }} />\n          {expanded ? \"show less\" : `show ${hiddenCount} more`}\n        </button>\n      )}\n    </div>\n  );\n}\n","import {\n  type ITrafficLinkStats,\n  TRAFFIC_LINK_HANDSHAKING,\n  TRAFFIC_LINK_OTHER,\n} from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, token } from \"@nice-code/ui\";\nimport { Fragment, useState } from \"react\";\nimport { formatBytes, formatCount, formatMiddleTruncated } from \"../../format\";\nimport { CaretMark } from \"../../marks\";\n\nconst CELL: React.CSSProperties = {\n  padding: \"3px 8px\",\n  fontSize: \"11px\",\n  textAlign: \"right\",\n  whiteSpace: \"nowrap\",\n};\n\nconst HEAD_CELL: React.CSSProperties = {\n  ...CELL,\n  fontFamily: fontFamilyToken(\"body\"),\n  fontSize: \"9px\",\n  textTransform: \"uppercase\",\n  letterSpacing: \"0.05em\",\n  color: token(\"textMuted\"),\n};\n\n/** The reserved buckets are book-keeping, not clients — say so rather than showing a cryptic id. */\nconst RESERVED_HINT: Record<string, string> = {\n  [TRAFFIC_LINK_HANDSHAKING]:\n    \"Frames tapped before the peer identity was bound — the handshake itself. Counted here so per-client bytes always sum to the totals above.\",\n  [TRAFFIC_LINK_OTHER]:\n    \"Links beyond this core's `maxLinks` cap, folded together so a busy server can't grow one counter per socket it ever saw.\",\n};\n\n/**\n * Per-**client** counts + bytes over the snapshot's window — the cost lens: on a backend one row per\n * connected client, on a frontend one row per backend it dials. Rows expand to their per-lane split.\n *\n * Sorted by egress bytes first (out + in): egress is the per-message billing unit on the platforms\n * this library targets, so \"who costs most\" reads top-down. Every byte the core saw lands in exactly\n * one row, including the two reserved book-keeping buckets — so the column totals here always equal\n * the panel's headline totals.\n */\nexport function LinkBreakdownTable({ links }: { links: ITrafficLinkStats[] }) {\n  const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n  if (links.length === 0) {\n    return (\n      <div\n        style={{\n          padding: \"10px\",\n          fontSize: \"11px\",\n          color: token(\"textMuted\"),\n          fontStyle: \"italic\",\n        }}\n      >\n        No per-client attribution in this window.\n      </div>\n    );\n  }\n\n  const toggle = (linkId: string) => {\n    setExpanded((prev) => {\n      const next = new Set(prev);\n      if (next.has(linkId)) next.delete(linkId);\n      else next.add(linkId);\n      return next;\n    });\n  };\n\n  const totals = links.reduce(\n    (acc, link) => ({\n      inCount: acc.inCount + link.in.count,\n      inBytes: acc.inBytes + link.in.bytes,\n      outCount: acc.outCount + link.out.count,\n      outBytes: acc.outBytes + link.out.bytes,\n    }),\n    { inCount: 0, inBytes: 0, outCount: 0, outBytes: 0 },\n  );\n\n  return (\n    <table style={{ width: \"100%\", borderCollapse: \"collapse\" }}>\n      <thead>\n        <tr style={{ borderBottom: `1px solid ${token(\"surfaceSection\")}` }}>\n          <th style={{ ...HEAD_CELL, textAlign: \"left\" }}>client</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSystem\") }}>in</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSystem\") }}>in bytes</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSuccess\") }}>out</th>\n          <th style={{ ...HEAD_CELL, color: token(\"semanticSuccess\") }}>out bytes</th>\n        </tr>\n      </thead>\n      <tbody>\n        {links.map((link) => {\n          const expandable = link.lanes.length > 0;\n          const isExpanded = expanded.has(link.linkId);\n          const reservedHint = RESERVED_HINT[link.linkId];\n          return (\n            <Fragment key={link.linkId}>\n              <tr\n                onClick={expandable ? () => toggle(link.linkId) : undefined}\n                style={{\n                  cursor: expandable ? \"pointer\" : undefined,\n                  borderBottom: `1px solid ${token(\"surfaceSection\")}`,\n                }}\n              >\n                <td\n                  title={reservedHint ?? link.linkId}\n                  style={{\n                    ...CELL,\n                    textAlign: \"left\",\n                    color: reservedHint != null ? token(\"textMuted\") : token(\"textEmphasis\"),\n                    fontStyle: reservedHint != null ? \"italic\" : undefined,\n                  }}\n                >\n                  {expandable && (\n                    <span style={{ color: token(\"textFaint\"), marginRight: \"4px\" }}>\n                      <CaretMark expanded={isExpanded} />\n                    </span>\n                  )}\n                  {formatMiddleTruncated(link.linkId)}\n                </td>\n                <td style={CELL}>{formatCount(link.in.count)}</td>\n                <td style={CELL}>{formatBytes(link.in.bytes)}</td>\n                <td style={CELL}>{formatCount(link.out.count)}</td>\n                <td style={CELL}>{formatBytes(link.out.bytes)}</td>\n              </tr>\n              {isExpanded &&\n                link.lanes.map((lane) => (\n                  <tr key={`${link.linkId}:${lane.lane}`}>\n                    <td\n                      style={{\n                        ...CELL,\n                        textAlign: \"left\",\n                        paddingLeft: \"24px\",\n                        color: token(\"textMuted\"),\n                      }}\n                    >\n                      {lane.lane}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatCount(lane.in.count)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatBytes(lane.in.bytes)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatCount(lane.out.count)}\n                    </td>\n                    <td style={{ ...CELL, color: token(\"textMuted\") }}>\n                      {formatBytes(lane.out.bytes)}\n                    </td>\n                  </tr>\n                ))}\n            </Fragment>\n          );\n        })}\n        {links.length > 1 && (\n          <tr style={{ borderTop: `1px solid ${token(\"surfaceSection\")}` }}>\n            <td\n              style={{\n                ...CELL,\n                textAlign: \"left\",\n                fontFamily: fontFamilyToken(\"body\"),\n                fontSize: \"9px\",\n                textTransform: \"uppercase\",\n                letterSpacing: \"0.05em\",\n                color: token(\"textMuted\"),\n              }}\n            >\n              total\n            </td>\n            <td style={{ ...CELL, color: token(\"textEmphasis\") }}>{formatCount(totals.inCount)}</td>\n            <td style={{ ...CELL, color: token(\"textEmphasis\") }}>{formatBytes(totals.inBytes)}</td>\n            <td style={{ ...CELL, color: token(\"textEmphasis\") }}>\n              {formatCount(totals.outCount)}\n            </td>\n            <td style={{ ...CELL, color: token(\"textEmphasis\") }}>\n              {formatBytes(totals.outBytes)}\n            </td>\n          </tr>\n        )}\n      </tbody>\n    </table>\n  );\n}\n","import type { ITrafficSeriesPoint } from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, token } from \"@nice-code/ui\";\nimport { useMemo } from \"react\";\nimport { formatBytes } from \"../../format\";\nimport { TriangleMark } from \"../../marks\";\n\nconst IN_COLOR = token(\"semanticSystem\");\nconst OUT_COLOR = token(\"semanticSuccess\");\n\nfunction buildPath(values: number[], width: number, height: number, max: number): string {\n  if (values.length === 0 || max <= 0) return \"\";\n  const stepX = width / Math.max(1, values.length - 1);\n  const parts: string[] = [];\n  for (let i = 0; i < values.length; i++) {\n    const x = i * stepX;\n    // Leave a 1px margin so a maxed-out point doesn't clip.\n    const y = height - (values[i] / max) * (height - 2) - 1;\n    parts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(1)},${y.toFixed(1)}`);\n  }\n  return parts.join(\" \");\n}\n\n/**\n * Dependency-free SVG sparkline of the 1s bytes series, incoming and outgoing\n * as two lines on a shared scale (the scale legend shows the peak).\n */\nexport function RateSparkline({\n  series,\n  height = 48,\n}: {\n  series: ITrafficSeriesPoint[];\n  height?: number;\n}) {\n  const width = 300; // viewBox units — the svg itself stretches to its container\n\n  const { inPath, outPath, peak } = useMemo(() => {\n    const inValues = series.map((p) => p.inBytes);\n    const outValues = series.map((p) => p.outBytes);\n    const max = Math.max(1, ...inValues, ...outValues);\n    return {\n      inPath: buildPath(inValues, width, height, max),\n      outPath: buildPath(outValues, width, height, max),\n      peak: max,\n    };\n  }, [series, height]);\n\n  return (\n    <div\n      style={{\n        position: \"relative\",\n        background: token(\"surfaceSectionAlt\"),\n        borderRadius: \"4px\",\n        overflow: \"hidden\",\n      }}\n    >\n      <svg\n        viewBox={`0 0 ${width} ${height}`}\n        preserveAspectRatio=\"none\"\n        style={{ display: \"block\", width: \"100%\", height: `${height}px` }}\n        role=\"img\"\n        aria-label=\"traffic per second\"\n      >\n        <path\n          d={outPath}\n          fill=\"none\"\n          style={{ stroke: OUT_COLOR }}\n          strokeWidth={1.2}\n          vectorEffect=\"non-scaling-stroke\"\n        />\n        <path\n          d={inPath}\n          fill=\"none\"\n          style={{ stroke: IN_COLOR }}\n          strokeWidth={1.2}\n          vectorEffect=\"non-scaling-stroke\"\n        />\n      </svg>\n      <div\n        style={{\n          position: \"absolute\",\n          top: \"3px\",\n          right: \"6px\",\n          display: \"flex\",\n          gap: \"8px\",\n          fontSize: \"9px\",\n          fontFamily: fontFamilyToken(\"body\"),\n          color: token(\"textMuted\"),\n          pointerEvents: \"none\",\n        }}\n      >\n        <span style={{ color: IN_COLOR }}>\n          <TriangleMark dir=\"down\" style={{ marginRight: \"2px\" }} />\n          in\n        </span>\n        <span style={{ color: OUT_COLOR }}>\n          <TriangleMark dir=\"up\" style={{ marginRight: \"2px\" }} />\n          out\n        </span>\n        <span>peak {formatBytes(peak)}/s</span>\n      </div>\n    </div>\n  );\n}\n","import type { ITrafficRateStats, ITrafficWindowTotals } from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, token } from \"@nice-code/ui\";\nimport { formatBytes, formatCount, formatRate } from \"../../format\";\n\nfunction Tile({ label, color, stats }: { label: string; color: string; stats: ITrafficRateStats }) {\n  return (\n    <div\n      style={{\n        flex: 1,\n        minWidth: \"120px\",\n        background: token(\"surfaceSection\"),\n        borderRadius: \"5px\",\n        padding: \"7px 10px\",\n        display: \"flex\",\n        flexDirection: \"column\",\n        gap: \"2px\",\n      }}\n    >\n      <div\n        style={{\n          fontSize: \"9px\",\n          fontFamily: fontFamilyToken(\"body\"),\n          textTransform: \"uppercase\",\n          letterSpacing: \"0.06em\",\n          color,\n        }}\n      >\n        {label}\n      </div>\n      <div style={{ display: \"flex\", alignItems: \"baseline\", gap: \"8px\" }}>\n        <span style={{ fontSize: \"15px\", fontWeight: 700, color: token(\"textEmphasis\") }}>\n          {formatBytes(stats.bytes)}\n        </span>\n        <span style={{ fontSize: \"10px\", color: token(\"textMuted\") }}>\n          {formatCount(stats.count)} msg{stats.count === 1 ? \"\" : \"s\"}\n        </span>\n      </div>\n      <div style={{ fontSize: \"10px\", color: token(\"textMuted\") }}>\n        {formatRate(stats.bytesPerSec, \"bytes\")} · {formatRate(stats.msgsPerSec, \"msgs\")}\n      </div>\n    </div>\n  );\n}\n\n/** The in/out headline tiles for one selected window. */\nexport function TrafficStatTiles({ totals }: { totals: ITrafficWindowTotals }) {\n  return (\n    <div style={{ display: \"flex\", gap: \"6px\" }}>\n      <Tile label=\"incoming\" color={token(\"semanticSystem\")} stats={totals.in} />\n      <Tile label=\"outgoing\" color={token(\"semanticSuccess\")} stats={totals.out} />\n    </div>\n  );\n}\n","import {\n  type ITrafficSnapshotSource,\n  TRAFFIC_LINK_HANDSHAKING,\n  TRAFFIC_WINDOW_MS_FIVE_MINUTES,\n  TRAFFIC_WINDOW_OPTIONS_MS,\n} from \"@nice-code/devtools-core\";\nimport { fontFamilyToken, NiceUiSectionLabel, NiceUiSegmentedControl, token } from \"@nice-code/ui\";\nimport { useEffect, useReducer, useState } from \"react\";\nimport { formatBytes, formatTimestamp, formatWindow } from \"../../format\";\nimport { TriangleMark } from \"../../marks\";\nimport { LaneBreakdownTable } from \"./LaneBreakdownTable\";\nimport { LargestFramesList } from \"./LargestFramesList\";\nimport { LinkBreakdownTable } from \"./LinkBreakdownTable\";\nimport { RateSparkline } from \"./RateSparkline\";\nimport { TrafficStatTiles } from \"./TrafficStatTiles\";\n\n/**\n * The composed traffic tab body: window selector (1m / 5m / 15m / MAX, MAX =\n * everything since the client connected), in/out stat tiles, the sparkline,\n * per-lane breakdown and the largest-frames list — driven by one\n * {@link TrafficMetricsCore}. On MAX the *stats* are all-time (unbounded), while\n * the graph is a bounded lens on the ring's reach (~30 min). Refreshes on the\n * core's change ticks and once a second (rolling windows decay with time).\n */\nexport function TrafficPanel({\n  core,\n  lanes,\n  defaultWindowMs = TRAFFIC_WINDOW_MS_FIVE_MINUTES,\n}: {\n  core: ITrafficSnapshotSource;\n  /** Restrict the whole view to these lanes (e.g. one realm's label). */\n  lanes?: string[];\n  defaultWindowMs?: number;\n}) {\n  const [windowMs, setWindowMs] = useState(defaultWindowMs);\n  const [, bump] = useReducer((n: number) => n + 1, 0);\n\n  useEffect(() => {\n    const unsubscribe = core.subscribe(bump);\n    const timer = setInterval(bump, 1000);\n    return () => {\n      unsubscribe();\n      clearInterval(timer);\n    };\n  }, [core]);\n\n  const snapshot = core.getSnapshot({ windowMs, lanes });\n  const selected = snapshot.windows.find((w) => w.windowMs === windowMs) ?? snapshot.windows[0];\n  const isMax = !Number.isFinite(windowMs);\n  const graphSpanMs = snapshot.series.length * snapshot.seriesBucketMs;\n  const now = Date.now();\n\n  // Per-client attribution only says something when at least one real (non-reserved) link exists —\n  // a client that never stamps a `linkId` would otherwise render a one-row table saying\n  // \"(handshaking): everything\", which is noise, not information.\n  const hasLinkAttribution = snapshot.links.some(\n    (link) => link.linkId !== TRAFFIC_LINK_HANDSHAKING,\n  );\n\n  return (\n    <div\n      style={{\n        flex: 1,\n        minHeight: 0,\n        overflowY: \"auto\",\n        display: \"flex\",\n        flexDirection: \"column\",\n        gap: \"10px\",\n        padding: \"10px\",\n      }}\n    >\n      <div\n        style={{\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"space-between\",\n          gap: \"8px\",\n        }}\n      >\n        <NiceUiSegmentedControl<string>\n          options={TRAFFIC_WINDOW_OPTIONS_MS.map((ms) => ({\n            value: String(ms),\n            label: formatWindow(ms),\n          }))}\n          value={String(windowMs)}\n          onChange={(value) => setWindowMs(Number(value))}\n        />\n        {!isMax && (\n          <span\n            style={{\n              fontSize: \"10px\",\n              fontFamily: fontFamilyToken(\"body\"),\n              color: token(\"textMuted\"),\n            }}\n          >\n            all-time: <TriangleMark dir=\"down\" /> {formatBytes(snapshot.lifetime.in.bytes)} ·{\" \"}\n            <TriangleMark dir=\"up\" /> {formatBytes(snapshot.lifetime.out.bytes)}\n          </span>\n        )}\n      </div>\n\n      {/* Lens label (plan 2.3): this panel measures the WIRE — post-encryption carrier bytes across\n          every lane. A realm engine's own card reports decoded payload bytes on the realm lane\n          alone, so the two legitimately disagree; saying which is which stops that reading as a bug. */}\n      <span\n        title=\"True bytes on the carrier: measured post-encryption on the way out and pre-decryption on the way in — what a platform's per-message billing and egress metering actually see. A realm engine's card reports the DECODED payload it handed the mux, so it reads smaller by the crypto envelope.\"\n        style={{\n          fontSize: \"9.5px\",\n          fontFamily: fontFamilyToken(\"body\"),\n          textTransform: \"uppercase\",\n          letterSpacing: \"0.05em\",\n          color: token(\"textMuted\"),\n          cursor: \"help\",\n          alignSelf: \"flex-start\",\n        }}\n      >\n        wire · post-encryption bytes\n      </span>\n\n      {isMax && snapshot.lifetime.resetFromWake === true && (\n        <span\n          title=\"This host lost its in-memory counters (a process restart, or a Durable Object waking from hibernation). All-time totals count from the reset, not from first contact.\"\n          style={{\n            fontSize: \"10px\",\n            fontFamily: fontFamilyToken(\"body\"),\n            color: token(\"semanticWarning\"),\n            cursor: \"help\",\n          }}\n        >\n          ⟳ counters reset at {formatTimestamp(snapshot.lifetime.sinceMs)} (host woke)\n        </span>\n      )}\n\n      {selected != null && <TrafficStatTiles totals={selected} />}\n\n      <div>\n        <NiceUiSectionLabel\n          label={\n            isMax\n              ? `graph · last ${formatWindow(graphSpanMs)}`\n              : `graph · ${formatWindow(windowMs)}`\n          }\n        />\n        <RateSparkline series={snapshot.series} />\n      </div>\n\n      <div>\n        <NiceUiSectionLabel\n          label={`lanes · ${isMax ? \"all-time\" : `last ${formatWindow(snapshot.windowMs)}`}`}\n        />\n        <LaneBreakdownTable lanes={snapshot.lanes} />\n      </div>\n\n      {hasLinkAttribution && (\n        <div>\n          <NiceUiSectionLabel\n            label={`clients · ${isMax ? \"all-time\" : `last ${formatWindow(snapshot.windowMs)}`}`}\n          />\n          <LinkBreakdownTable links={snapshot.links} />\n        </div>\n      )}\n\n      <div>\n        <NiceUiSectionLabel label=\"largest frames\" />\n        <LargestFramesList frames={snapshot.topFrames} now={now} />\n      </div>\n    </div>\n  );\n}\n","import { NiceUiSectionLabel, token } from \"@nice-code/ui\";\nimport { CaretMark, renderColoredJson, safeStringify } from \"nice-devtools-shared\";\nimport { useState } from \"react\";\n\nconst COMPACT_CHAR_LIMIT = 120;\nconst MONO = \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\";\n\nfunction tryParseJson(s: string): unknown {\n  try {\n    return JSON.parse(s);\n  } catch {\n    return null;\n  }\n}\n\nexport function DetailSection({\n  label,\n  value,\n  color = token(\"semanticSystem\"),\n}: {\n  label: string;\n  value: unknown;\n  color?: string;\n}) {\n  // If the value is a raw string that is valid JSON, parse and render it as\n  // structured data with syntax highlighting instead of as a plain string.\n  const parsedFromString = typeof value === \"string\" ? tryParseJson(value) : null;\n  const isPlainString = typeof value === \"string\" && parsedFromString === null;\n  const effectiveValue = parsedFromString !== null ? parsedFromString : value;\n\n  const [expanded, setExpanded] = useState(false);\n  const fullJson = isPlainString ? (value as string) : safeStringify(effectiveValue, 2);\n  const compactJson = isPlainString ? (value as string) : safeStringify(effectiveValue, 0);\n\n  const canExpand = fullJson !== compactJson || compactJson.length > COMPACT_CHAR_LIMIT;\n  const compactDisplay =\n    compactJson.length > COMPACT_CHAR_LIMIT\n      ? `${compactJson.slice(0, COMPACT_CHAR_LIMIT)}…`\n      : compactJson;\n\n  const baseStyle = isPlainString\n    ? { background: token(\"surfaceSectionAlt\"), color: token(\"textMuted\") }\n    : { background: token(\"surfaceSection\"), color: token(\"textSecondary\") };\n\n  return (\n    <div>\n      <div\n        style={{\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"space-between\",\n          marginBottom: \"3px\",\n        }}\n      >\n        <NiceUiSectionLabel label={label} color={color} />\n        {canExpand && (\n          <span style={{ color: token(\"textFaint\"), fontSize: \"11px\" }}>\n            <CaretMark expanded={expanded} />\n          </span>\n        )}\n      </div>\n      {expanded ? (\n        <div\n          onClick={canExpand ? () => setExpanded(false) : undefined}\n          style={{\n            margin: 0,\n            padding: \"6px 8px\",\n            borderRadius: \"4px\",\n            fontSize: \"11px\",\n            fontFamily: MONO,\n            overflowX: \"auto\",\n            textAlign: \"left\",\n            whiteSpace: \"pre-wrap\",\n            wordBreak: \"break-all\",\n            cursor: canExpand ? \"pointer\" : \"default\",\n            fontStyle: isPlainString ? \"italic\" : \"normal\",\n            ...baseStyle,\n          }}\n        >\n          {isPlainString ? fullJson : renderColoredJson(fullJson)}\n        </div>\n      ) : (\n        <div\n          onClick={canExpand ? () => setExpanded(true) : undefined}\n          style={{\n            padding: \"5px 8px\",\n            borderRadius: \"4px\",\n            fontSize: \"11px\",\n            fontFamily: MONO,\n            whiteSpace: \"nowrap\",\n            overflow: \"hidden\",\n            textOverflow: \"ellipsis\",\n            cursor: canExpand ? \"pointer\" : \"default\",\n            fontStyle: isPlainString ? \"italic\" : \"normal\",\n            ...baseStyle,\n          }}\n        >\n          {compactDisplay}\n        </div>\n      )}\n    </div>\n  );\n}\n","// nice-action-SPECIFIC colours only. The shared palette lives in `@nice-code/ui` — components\n// read it with `token()`/`tokenAlpha()` directly (6.1 retired the re-export layer that used to\n// sit here). Everything below is vocabulary this devtool alone uses.\n\nimport type { INiceUiChipColorEntry } from \"@nice-code/ui\";\nimport { token, tokenAlpha } from \"@nice-code/ui\";\n\n// ─── Handler chip colours (role-specific, not status) ─────────────────────────\nexport const DEVTOOL_COLOR_HANDLER_LOCAL_TEXT = \"#34bb89\";\nexport const DEVTOOL_COLOR_HANDLER_LOCAL_BORDER = \"#144427\";\nexport const DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT = \"#cfa12a\";\nexport const DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER = \"#723917\";\n\n// ─── nice-action-specific surfaces ────────────────────────────────────────────\nexport const DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND = \"#1d2942\";\nexport const DEVTOOL_LIST_GROUP_DIVIDER = \"#101109\";\nexport const DEVTOOL_STACK_TRACE_BACKGROUND = \"#040a13\";\nexport const DEVTOOL_ERROR_BADGE_BACKGROUND = \"#2d0f0f\";\n\n// ─── Call stack ───────────────────────────────────────────────────────────────\nexport const DEVTOOL_COLOR_CALL_STACK_DIVIDER = \"#0a1120\";\n\n// ─── Stack trace frame colours (user vs internal) ─────────────────────────────\nexport const DEVTOOL_STACK_FRAME_USER_NUMBER = \"#64748b\";\nexport const DEVTOOL_STACK_FRAME_USER_FUNCTION = \"#e2e8f0\";\nexport const DEVTOOL_STACK_FRAME_USER_FOLDER = \"#596b83\";\nexport const DEVTOOL_STACK_FRAME_USER_FILE = \"#8a9ebb\";\nexport const DEVTOOL_STACK_FRAME_USER_LINE = \"#4a7fa8\";\nexport const DEVTOOL_STACK_FRAME_INTERNAL_NUMBER = \"#2d3f53\";\nexport const DEVTOOL_STACK_FRAME_INTERNAL_FUNCTION = \"#50698b\";\nexport const DEVTOOL_STACK_FRAME_INTERNAL_FOLDER = \"#2d3f53\";\nexport const DEVTOOL_STACK_FRAME_INTERNAL_FILE = \"#425979\";\nexport const DEVTOOL_STACK_FRAME_INTERNAL_LINE = \"#2d4a63\";\n\n// ─── Chip / Icon semantic colour table ───────────────────────────────────────\n// Chip and Icon components resolve colours exclusively through this table.\n// ESemanticThing names what a UI element *is*; SEMANTIC_COLORS maps it to paint.\n// The age_latest chip reuses the base status entries (failed/action_error/aborted/\n// running_action) — no separate variants needed.\n\nexport enum ESemanticThing {\n  // Status / outcome\n  running_action = \"running_action\",\n  success = \"success\",\n  action_error = \"action_error\",\n  failed = \"failed\",\n  aborted = \"aborted\",\n  error = \"error\", // error chip in list / tooltip\n  // Role / classification\n  domain = \"domain\",\n  handler_local = \"handler_local\",\n  handler_external = \"handler_external\",\n  origin = \"origin\", // runtime an action was received from (inbound / pushed actions)\n  // List decorators\n  age = \"age\", // non-latest relative-age chip\n  io_input = \"io_input\",\n  io_output = \"io_output\",\n  // Fallback\n  default = \"default\",\n}\n\nexport const SEMANTIC_COLORS: Record<ESemanticThing, INiceUiChipColorEntry> = {\n  running_action: {\n    color: token(\"semanticSystem\"),\n    borderColor: tokenAlpha(\"semanticSystem\", 0.33),\n  },\n  success: {\n    color: token(\"semanticSuccess\"),\n    borderColor: tokenAlpha(\"semanticSuccess\", 0.33),\n  },\n  action_error: {\n    color: token(\"semanticWarning\"),\n    borderColor: tokenAlpha(\"semanticWarning\", 0.33),\n  },\n  failed: {\n    color: token(\"semanticError\"),\n    borderColor: tokenAlpha(\"semanticError\", 0.33),\n  },\n  aborted: {\n    color: token(\"semanticMetadata\"),\n    borderColor: token(\"textFaint\"),\n  },\n  error: {\n    color: token(\"semanticError\"),\n    borderColor: token(\"semanticError\"),\n    subtle: { color: \"#FF5C5C9f\", borderColor: \"transparent\" },\n  },\n  domain: {\n    color: token(\"semanticSystem\"),\n    borderColor: tokenAlpha(\"semanticSystem\", 0.33),\n    subtle: { color: \"#4b5563\", borderColor: \"transparent\" },\n  },\n  handler_local: {\n    color: DEVTOOL_COLOR_HANDLER_LOCAL_TEXT,\n    borderColor: DEVTOOL_COLOR_HANDLER_LOCAL_BORDER,\n    subtle: { color: \"#4b5563\", borderColor: \"transparent\" },\n  },\n  handler_external: {\n    color: DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT,\n    borderColor: DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER,\n    subtle: { color: \"#cfa12a9f\", borderColor: \"transparent\" },\n  },\n  origin: {\n    color: token(\"semanticSystem\"),\n    borderColor: tokenAlpha(\"semanticSystem\", 0.33),\n    subtle: { color: tokenAlpha(\"semanticSystem\", 0.62), borderColor: \"transparent\" },\n  },\n  age: {\n    color: token(\"semanticMetadata\"),\n    borderColor: token(\"surfaceSection\"),\n    subtle: { color: \"#4b5563\", borderColor: \"transparent\" },\n  },\n  io_input: {\n    color: \"#fbbf24\",\n    subtle: { color: \"#fbbe249f\", borderColor: \"transparent\" },\n    borderColor: \"#78350f\",\n  },\n  io_output: {\n    color: \"#a78bfa\",\n    subtle: { color: \"#a78bfa9f\", borderColor: \"transparent\" },\n    borderColor: \"#4c1d95\",\n  },\n  default: {\n    color: token(\"textMuted\"),\n    borderColor: token(\"textFaint\"),\n  },\n};\n","import { NiceUiSectionLabel, token } from \"@nice-code/ui\";\nimport { DEVTOOL_ERROR_BADGE_BACKGROUND } from \"../../core/devtools_colors\";\n\nconst MONO = \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\";\nconst SANS = \"ui-sans-serif, system-ui, -apple-system, sans-serif\";\n\nexport type TNiceErrorJson = {\n  name: \"NiceError\";\n  message: string;\n  ids: string[];\n  httpStatusCode: number;\n  def: { domain: string; allDomains: string[] };\n  /** `true` for the generic wrapper around a foreign throw (an error never accounted for). */\n  isUnhandled?: boolean;\n};\n\nexport function isNiceErrorJson(value: unknown): value is TNiceErrorJson {\n  if (typeof value !== \"object\" || value == null) return false;\n  const v = value as Record<string, unknown>;\n  return v[\"name\"] === \"NiceError\" && Array.isArray(v[\"ids\"]) && typeof v[\"message\"] === \"string\";\n}\n\nexport function NiceErrorBody({ error }: { error: TNiceErrorJson }) {\n  return (\n    <div\n      style={{\n        background: token(\"errorSurface\"),\n        border: `1px solid ${token(\"semanticError\")}`,\n        borderRadius: \"4px\",\n        overflow: \"hidden\",\n      }}\n    >\n      {/* Main exception message — largest, boldest */}\n      <div\n        style={{\n          padding: \"12px 14px\",\n          color: token(\"semanticError\"),\n          fontSize: \"1em\",\n          fontWeight: \"700\",\n          lineHeight: \"1.45\",\n          wordBreak: \"break-word\",\n          fontFamily: SANS,\n          textAlign: \"left\",\n          borderBottom: `1px solid ${DEVTOOL_ERROR_BADGE_BACKGROUND}`,\n        }}\n      >\n        {error.message}\n      </div>\n      {/* Error code, domain, HTTP status — smaller, subdued */}\n      <div\n        style={{\n          padding: \"6px 14px 8px\",\n          display: \"flex\",\n          flexWrap: \"wrap\",\n          gap: \"10px\",\n          alignItems: \"center\",\n          background: DEVTOOL_ERROR_BADGE_BACKGROUND,\n        }}\n      >\n        {error.ids.map((id) => (\n          <span\n            key={id}\n            style={{\n              color: token(\"semanticError\"),\n              fontFamily: MONO,\n              fontSize: \"11px\",\n              fontWeight: \"600\",\n            }}\n          >\n            {id}\n          </span>\n        ))}\n        <span style={{ color: token(\"textMuted\"), fontSize: \"10px\", fontFamily: SANS }}>\n          domain:{\" \"}\n          <span style={{ color: token(\"textMuted\"), fontFamily: MONO }}>{error.def.domain}</span>\n        </span>\n        <span style={{ color: token(\"textMuted\"), fontSize: \"10px\", fontFamily: SANS }}>\n          http:{\" \"}\n          <span style={{ color: token(\"textMuted\"), fontFamily: MONO }}>\n            {error.httpStatusCode}\n          </span>\n        </span>\n        {error.isUnhandled === true && (\n          <span\n            style={{\n              color: token(\"semanticError\"),\n              fontFamily: MONO,\n              fontSize: \"10px\",\n              fontWeight: \"700\",\n              border: `1px solid ${token(\"semanticError\")}`,\n              borderRadius: \"3px\",\n              padding: \"1px 5px\",\n            }}\n            title=\"A foreign throw we never accounted for (not a defined NiceError).\"\n          >\n            unhandled\n          </span>\n        )}\n      </div>\n    </div>\n  );\n}\n\nexport function NiceErrorDisplay({\n  error,\n  label,\n  color,\n}: {\n  error: TNiceErrorJson;\n  label: string;\n  color: string;\n}) {\n  return (\n    <div>\n      <NiceUiSectionLabel label={label} color={color} />\n      <NiceErrorBody error={error} />\n    </div>\n  );\n}\n","import { createTypedMemoryStorage_json, createTypedWebLocalStorage } from \"@nice-code/util\";\nimport type { TRuntimeCoordinateEnvId } from \"@nice-code/wire\";\n\ninterface TBrowserDevtoolsTypedStorage {\n  runtimeToProjectFilePath: Record<TRuntimeCoordinateEnvId, string>;\n}\n\n/**\n * The devtools' browser storage, safe to import where there is no web storage. A real browser\n * runtime persists under the `nice-action-devtools::` prefix in localStorage; anywhere that\n * storage is unavailable or denied (a bare vitest/node import, private mode...) the same typed\n * surface falls back to an in-memory adapter — exactly the \"storage can be denied\" resilience\n * the rest of the codebase treats as the default, not the exception. Nothing in devtools treats\n * these files across a restart as authoritative, so a disposable map is an honest stand-in.\n */\nexport const devtools_storage = createTypedBrowserOrMemoryStorage<TBrowserDevtoolsTypedStorage>({});\n\nexport function createTypedBrowserOrMemoryStorage<T extends Record<string, any>>(_options?: {\n  keyPrefix?: string;\n}): ReturnType<typeof createTypedWebLocalStorage<T>> {\n  const keyPrefix = _options?.keyPrefix ?? \"nice-action-devtools::\";\n  if (typeof window !== \"undefined\" && window.localStorage != null) {\n    return createTypedWebLocalStorage<T>({\n      localStorage: window.localStorage,\n      keyPrefix,\n    });\n  }\n  return createTypedMemoryStorage_json<T>();\n}\n\ndevtools_storage.updateJsonWithDef(\"runtimeToProjectFilePath\", {}, (prev) => prev);\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n  if (0 <= number && number < intToCharMap.length) {\n    return intToCharMap[number];\n  }\n  throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n  var bigA = 65;     // 'A'\n  var bigZ = 90;     // 'Z'\n\n  var littleA = 97;  // 'a'\n  var littleZ = 122; // 'z'\n\n  var zero = 48;     // '0'\n  var nine = 57;     // '9'\n\n  var plus = 43;     // '+'\n  var slash = 47;    // '/'\n\n  var littleOffset = 26;\n  var numberOffset = 52;\n\n  // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n  if (bigA <= charCode && charCode <= bigZ) {\n    return (charCode - bigA);\n  }\n\n  // 26 - 51: abcdefghijklmnopqrstuvwxyz\n  if (littleA <= charCode && charCode <= littleZ) {\n    return (charCode - littleA + littleOffset);\n  }\n\n  // 52 - 61: 0123456789\n  if (zero <= charCode && charCode <= nine) {\n    return (charCode - zero + numberOffset);\n  }\n\n  // 62: +\n  if (charCode == plus) {\n    return 62;\n  }\n\n  // 63: /\n  if (charCode == slash) {\n    return 63;\n  }\n\n  // Invalid base64 digit.\n  return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above\n *    copyright notice, this list of conditions and the following\n *    disclaimer in the documentation and/or other materials provided\n *    with the distribution.\n *  * Neither the name of Google Inc. nor the names of its\n *    contributors may be used to endorse or promote products derived\n *    from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n//   Continuation\n//   |    Sign\n//   |    |\n//   V    V\n//   101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit.  For example, as decimals:\n *   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n *   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n  return aValue < 0\n    ? ((-aValue) << 1) + 1\n    : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit.  For example, as decimals:\n *   2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n *   4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n  var isNegative = (aValue & 1) === 1;\n  var shifted = aValue >> 1;\n  return isNegative\n    ? -shifted\n    : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n  var encoded = \"\";\n  var digit;\n\n  var vlq = toVLQSigned(aValue);\n\n  do {\n    digit = vlq & VLQ_BASE_MASK;\n    vlq >>>= VLQ_BASE_SHIFT;\n    if (vlq > 0) {\n      // There are still more digits in this value, so we must make sure the\n      // continuation bit is marked.\n      digit |= VLQ_CONTINUATION_BIT;\n    }\n    encoded += base64.encode(digit);\n  } while (vlq > 0);\n\n  return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n  var strLen = aStr.length;\n  var result = 0;\n  var shift = 0;\n  var continuation, digit;\n\n  do {\n    if (aIndex >= strLen) {\n      throw new Error(\"Expected more digits in base 64 VLQ value.\");\n    }\n\n    digit = base64.decode(aStr.charCodeAt(aIndex++));\n    if (digit === -1) {\n      throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n    }\n\n    continuation = !!(digit & VLQ_CONTINUATION_BIT);\n    digit &= VLQ_BASE_MASK;\n    result = result + (digit << shift);\n    shift += VLQ_BASE_SHIFT;\n  } while (continuation);\n\n  aOutParam.value = fromVLQSigned(result);\n  aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n  if (aName in aArgs) {\n    return aArgs[aName];\n  } else if (arguments.length === 3) {\n    return aDefaultValue;\n  } else {\n    throw new Error('\"' + aName + '\" is a required argument.');\n  }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n  var match = aUrl.match(urlRegexp);\n  if (!match) {\n    return null;\n  }\n  return {\n    scheme: match[1],\n    auth: match[2],\n    host: match[3],\n    port: match[4],\n    path: match[5]\n  };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n  var url = '';\n  if (aParsedUrl.scheme) {\n    url += aParsedUrl.scheme + ':';\n  }\n  url += '//';\n  if (aParsedUrl.auth) {\n    url += aParsedUrl.auth + '@';\n  }\n  if (aParsedUrl.host) {\n    url += aParsedUrl.host;\n  }\n  if (aParsedUrl.port) {\n    url += \":\" + aParsedUrl.port\n  }\n  if (aParsedUrl.path) {\n    url += aParsedUrl.path;\n  }\n  return url;\n}\nexports.urlGenerate = urlGenerate;\n\nvar MAX_CACHED_INPUTS = 32;\n\n/**\n * Takes some function `f(input) -> result` and returns a memoized version of\n * `f`.\n *\n * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The\n * memoization is a dumb-simple, linear least-recently-used cache.\n */\nfunction lruMemoize(f) {\n  var cache = [];\n\n  return function(input) {\n    for (var i = 0; i < cache.length; i++) {\n      if (cache[i].input === input) {\n        var temp = cache[0];\n        cache[0] = cache[i];\n        cache[i] = temp;\n        return cache[0].result;\n      }\n    }\n\n    var result = f(input);\n\n    cache.unshift({\n      input,\n      result,\n    });\n\n    if (cache.length > MAX_CACHED_INPUTS) {\n      cache.pop();\n    }\n\n    return result;\n  };\n}\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nvar normalize = lruMemoize(function normalize(aPath) {\n  var path = aPath;\n  var url = urlParse(aPath);\n  if (url) {\n    if (!url.path) {\n      return aPath;\n    }\n    path = url.path;\n  }\n  var isAbsolute = exports.isAbsolute(path);\n  // Split the path into parts between `/` characters. This is much faster than\n  // using `.split(/\\/+/g)`.\n  var parts = [];\n  var start = 0;\n  var i = 0;\n  while (true) {\n    start = i;\n    i = path.indexOf(\"/\", start);\n    if (i === -1) {\n      parts.push(path.slice(start));\n      break;\n    } else {\n      parts.push(path.slice(start, i));\n      while (i < path.length && path[i] === \"/\") {\n        i++;\n      }\n    }\n  }\n\n  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n    part = parts[i];\n    if (part === '.') {\n      parts.splice(i, 1);\n    } else if (part === '..') {\n      up++;\n    } else if (up > 0) {\n      if (part === '') {\n        // The first part is blank if the path is absolute. Trying to go\n        // above the root is a no-op. Therefore we can remove all '..' parts\n        // directly after the root.\n        parts.splice(i + 1, up);\n        up = 0;\n      } else {\n        parts.splice(i, 2);\n        up--;\n      }\n    }\n  }\n  path = parts.join('/');\n\n  if (path === '') {\n    path = isAbsolute ? '/' : '.';\n  }\n\n  if (url) {\n    url.path = path;\n    return urlGenerate(url);\n  }\n  return path;\n});\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n *   scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n *   first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n *   is updated with the result and aRoot is returned. Otherwise the result\n *   is returned.\n *   - If aPath is absolute, the result is aPath.\n *   - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n  if (aRoot === \"\") {\n    aRoot = \".\";\n  }\n  if (aPath === \"\") {\n    aPath = \".\";\n  }\n  var aPathUrl = urlParse(aPath);\n  var aRootUrl = urlParse(aRoot);\n  if (aRootUrl) {\n    aRoot = aRootUrl.path || '/';\n  }\n\n  // `join(foo, '//www.example.org')`\n  if (aPathUrl && !aPathUrl.scheme) {\n    if (aRootUrl) {\n      aPathUrl.scheme = aRootUrl.scheme;\n    }\n    return urlGenerate(aPathUrl);\n  }\n\n  if (aPathUrl || aPath.match(dataUrlRegexp)) {\n    return aPath;\n  }\n\n  // `join('http://', 'www.example.com')`\n  if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n    aRootUrl.host = aPath;\n    return urlGenerate(aRootUrl);\n  }\n\n  var joined = aPath.charAt(0) === '/'\n    ? aPath\n    : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n  if (aRootUrl) {\n    aRootUrl.path = joined;\n    return urlGenerate(aRootUrl);\n  }\n  return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n  return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n  if (aRoot === \"\") {\n    aRoot = \".\";\n  }\n\n  aRoot = aRoot.replace(/\\/$/, '');\n\n  // It is possible for the path to be above the root. In this case, simply\n  // checking whether the root is a prefix of the path won't work. Instead, we\n  // need to remove components from the root one by one, until either we find\n  // a prefix that fits, or we run out of components to remove.\n  var level = 0;\n  while (aPath.indexOf(aRoot + '/') !== 0) {\n    var index = aRoot.lastIndexOf(\"/\");\n    if (index < 0) {\n      return aPath;\n    }\n\n    // If the only part of the root that is left is the scheme (i.e. http://,\n    // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n    // have exhausted all components, so the path is not relative to the root.\n    aRoot = aRoot.slice(0, index);\n    if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n      return aPath;\n    }\n\n    ++level;\n  }\n\n  // Make sure we add a \"../\" for each component we removed from the root.\n  return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n  var obj = Object.create(null);\n  return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n  return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n  if (isProtoString(aStr)) {\n    return '$' + aStr;\n  }\n\n  return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n  if (isProtoString(aStr)) {\n    return aStr.slice(1);\n  }\n\n  return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n  if (!s) {\n    return false;\n  }\n\n  var length = s.length;\n\n  if (length < 9 /* \"__proto__\".length */) {\n    return false;\n  }\n\n  if (s.charCodeAt(length - 1) !== 95  /* '_' */ ||\n      s.charCodeAt(length - 2) !== 95  /* '_' */ ||\n      s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n      s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n      s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n      s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n      s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n      s.charCodeAt(length - 8) !== 95  /* '_' */ ||\n      s.charCodeAt(length - 9) !== 95  /* '_' */) {\n    return false;\n  }\n\n  for (var i = length - 10; i >= 0; i--) {\n    if (s.charCodeAt(i) !== 36 /* '$' */) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n  var cmp = strcmp(mappingA.source, mappingB.source);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalLine - mappingB.originalLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalColumn - mappingB.originalColumn;\n  if (cmp !== 0 || onlyCompareOriginal) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedLine - mappingB.generatedLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\nfunction compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {\n  var cmp\n\n  cmp = mappingA.originalLine - mappingB.originalLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalColumn - mappingB.originalColumn;\n  if (cmp !== 0 || onlyCompareOriginal) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedLine - mappingB.generatedLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n  var cmp = mappingA.generatedLine - mappingB.generatedLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n  if (cmp !== 0 || onlyCompareGenerated) {\n    return cmp;\n  }\n\n  cmp = strcmp(mappingA.source, mappingB.source);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalLine - mappingB.originalLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalColumn - mappingB.originalColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {\n  var cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n  if (cmp !== 0 || onlyCompareGenerated) {\n    return cmp;\n  }\n\n  cmp = strcmp(mappingA.source, mappingB.source);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalLine - mappingB.originalLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalColumn - mappingB.originalColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;\n\nfunction strcmp(aStr1, aStr2) {\n  if (aStr1 === aStr2) {\n    return 0;\n  }\n\n  if (aStr1 === null) {\n    return 1; // aStr2 !== null\n  }\n\n  if (aStr2 === null) {\n    return -1; // aStr1 !== null\n  }\n\n  if (aStr1 > aStr2) {\n    return 1;\n  }\n\n  return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n  var cmp = mappingA.generatedLine - mappingB.generatedLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = strcmp(mappingA.source, mappingB.source);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalLine - mappingB.originalLine;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = mappingA.originalColumn - mappingB.originalColumn;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n  return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n  sourceURL = sourceURL || '';\n\n  if (sourceRoot) {\n    // This follows what Chrome does.\n    if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n      sourceRoot += '/';\n    }\n    // The spec says:\n    //   Line 4: An optional source root, useful for relocating source\n    //   files on a server or removing repeated values in the\n    //   “sources” entry.  This value is prepended to the individual\n    //   entries in the “source” field.\n    sourceURL = sourceRoot + sourceURL;\n  }\n\n  // Historically, SourceMapConsumer did not take the sourceMapURL as\n  // a parameter.  This mode is still somewhat supported, which is why\n  // this code block is conditional.  However, it's preferable to pass\n  // the source map URL to SourceMapConsumer, so that this function\n  // can implement the source URL resolution algorithm as outlined in\n  // the spec.  This block is basically the equivalent of:\n  //    new URL(sourceURL, sourceMapURL).toString()\n  // ... except it avoids using URL, which wasn't available in the\n  // older releases of node still supported by this library.\n  //\n  // The spec says:\n  //   If the sources are not absolute URLs after prepending of the\n  //   “sourceRoot”, the sources are resolved relative to the\n  //   SourceMap (like resolving script src in a html document).\n  if (sourceMapURL) {\n    var parsed = urlParse(sourceMapURL);\n    if (!parsed) {\n      throw new Error(\"sourceMapURL could not be parsed\");\n    }\n    if (parsed.path) {\n      // Strip the last path component, but keep the \"/\".\n      var index = parsed.path.lastIndexOf('/');\n      if (index >= 0) {\n        parsed.path = parsed.path.substring(0, index + 1);\n      }\n    }\n    sourceURL = join(urlGenerate(parsed), sourceURL);\n  }\n\n  return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n  this._array = [];\n  this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n  var set = new ArraySet();\n  for (var i = 0, len = aArray.length; i < len; i++) {\n    set.add(aArray[i], aAllowDuplicates);\n  }\n  return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n  return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n  var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n  var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n  var idx = this._array.length;\n  if (!isDuplicate || aAllowDuplicates) {\n    this._array.push(aStr);\n  }\n  if (!isDuplicate) {\n    if (hasNativeMap) {\n      this._set.set(aStr, idx);\n    } else {\n      this._set[sStr] = idx;\n    }\n  }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n  if (hasNativeMap) {\n    return this._set.has(aStr);\n  } else {\n    var sStr = util.toSetString(aStr);\n    return has.call(this._set, sStr);\n  }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n  if (hasNativeMap) {\n    var idx = this._set.get(aStr);\n    if (idx >= 0) {\n        return idx;\n    }\n  } else {\n    var sStr = util.toSetString(aStr);\n    if (has.call(this._set, sStr)) {\n      return this._set[sStr];\n    }\n  }\n\n  throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n  if (aIdx >= 0 && aIdx < this._array.length) {\n    return this._array[aIdx];\n  }\n  throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n  return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n  // Optimized for most common case\n  var lineA = mappingA.generatedLine;\n  var lineB = mappingB.generatedLine;\n  var columnA = mappingA.generatedColumn;\n  var columnB = mappingB.generatedColumn;\n  return lineB > lineA || lineB == lineA && columnB >= columnA ||\n         util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n  this._array = [];\n  this._sorted = true;\n  // Serves as infimum\n  this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n  function MappingList_forEach(aCallback, aThisArg) {\n    this._array.forEach(aCallback, aThisArg);\n  };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n  if (generatedPositionAfter(this._last, aMapping)) {\n    this._last = aMapping;\n    this._array.push(aMapping);\n  } else {\n    this._sorted = false;\n    this._array.push(aMapping);\n  }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n  if (!this._sorted) {\n    this._array.sort(util.compareByGeneratedPositionsInflated);\n    this._sorted = true;\n  }\n  return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n *   - file: The filename of the generated source.\n *   - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n  if (!aArgs) {\n    aArgs = {};\n  }\n  this._file = util.getArg(aArgs, 'file', null);\n  this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n  this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n  this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);\n  this._sources = new ArraySet();\n  this._names = new ArraySet();\n  this._mappings = new MappingList();\n  this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n  function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {\n    var sourceRoot = aSourceMapConsumer.sourceRoot;\n    var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {\n      file: aSourceMapConsumer.file,\n      sourceRoot: sourceRoot\n    }));\n    aSourceMapConsumer.eachMapping(function (mapping) {\n      var newMapping = {\n        generated: {\n          line: mapping.generatedLine,\n          column: mapping.generatedColumn\n        }\n      };\n\n      if (mapping.source != null) {\n        newMapping.source = mapping.source;\n        if (sourceRoot != null) {\n          newMapping.source = util.relative(sourceRoot, newMapping.source);\n        }\n\n        newMapping.original = {\n          line: mapping.originalLine,\n          column: mapping.originalColumn\n        };\n\n        if (mapping.name != null) {\n          newMapping.name = mapping.name;\n        }\n      }\n\n      generator.addMapping(newMapping);\n    });\n    aSourceMapConsumer.sources.forEach(function (sourceFile) {\n      var sourceRelative = sourceFile;\n      if (sourceRoot !== null) {\n        sourceRelative = util.relative(sourceRoot, sourceFile);\n      }\n\n      if (!generator._sources.has(sourceRelative)) {\n        generator._sources.add(sourceRelative);\n      }\n\n      var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n      if (content != null) {\n        generator.setSourceContent(sourceFile, content);\n      }\n    });\n    return generator;\n  };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n *   - generated: An object with the generated line and column positions.\n *   - original: An object with the original line and column positions.\n *   - source: The original source file (relative to the sourceRoot).\n *   - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n  function SourceMapGenerator_addMapping(aArgs) {\n    var generated = util.getArg(aArgs, 'generated');\n    var original = util.getArg(aArgs, 'original', null);\n    var source = util.getArg(aArgs, 'source', null);\n    var name = util.getArg(aArgs, 'name', null);\n\n    if (!this._skipValidation) {\n      if (this._validateMapping(generated, original, source, name) === false) {\n        return;\n      }\n    }\n\n    if (source != null) {\n      source = String(source);\n      if (!this._sources.has(source)) {\n        this._sources.add(source);\n      }\n    }\n\n    if (name != null) {\n      name = String(name);\n      if (!this._names.has(name)) {\n        this._names.add(name);\n      }\n    }\n\n    this._mappings.add({\n      generatedLine: generated.line,\n      generatedColumn: generated.column,\n      originalLine: original != null && original.line,\n      originalColumn: original != null && original.column,\n      source: source,\n      name: name\n    });\n  };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n  function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n    var source = aSourceFile;\n    if (this._sourceRoot != null) {\n      source = util.relative(this._sourceRoot, source);\n    }\n\n    if (aSourceContent != null) {\n      // Add the source content to the _sourcesContents map.\n      // Create a new _sourcesContents map if the property is null.\n      if (!this._sourcesContents) {\n        this._sourcesContents = Object.create(null);\n      }\n      this._sourcesContents[util.toSetString(source)] = aSourceContent;\n    } else if (this._sourcesContents) {\n      // Remove the source file from the _sourcesContents map.\n      // If the _sourcesContents map is empty, set the property to null.\n      delete this._sourcesContents[util.toSetString(source)];\n      if (Object.keys(this._sourcesContents).length === 0) {\n        this._sourcesContents = null;\n      }\n    }\n  };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n *        If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n *        to be applied. If relative, it is relative to the SourceMapConsumer.\n *        This parameter is needed when the two source maps aren't in the same\n *        directory, and the source map to be applied contains relative source\n *        paths. If so, those relative source paths need to be rewritten\n *        relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n  function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n    var sourceFile = aSourceFile;\n    // If aSourceFile is omitted, we will use the file property of the SourceMap\n    if (aSourceFile == null) {\n      if (aSourceMapConsumer.file == null) {\n        throw new Error(\n          'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n          'or the source map\\'s \"file\" property. Both were omitted.'\n        );\n      }\n      sourceFile = aSourceMapConsumer.file;\n    }\n    var sourceRoot = this._sourceRoot;\n    // Make \"sourceFile\" relative if an absolute Url is passed.\n    if (sourceRoot != null) {\n      sourceFile = util.relative(sourceRoot, sourceFile);\n    }\n    // Applying the SourceMap can add and remove items from the sources and\n    // the names array.\n    var newSources = new ArraySet();\n    var newNames = new ArraySet();\n\n    // Find mappings for the \"sourceFile\"\n    this._mappings.unsortedForEach(function (mapping) {\n      if (mapping.source === sourceFile && mapping.originalLine != null) {\n        // Check if it can be mapped by the source map, then update the mapping.\n        var original = aSourceMapConsumer.originalPositionFor({\n          line: mapping.originalLine,\n          column: mapping.originalColumn\n        });\n        if (original.source != null) {\n          // Copy mapping\n          mapping.source = original.source;\n          if (aSourceMapPath != null) {\n            mapping.source = util.join(aSourceMapPath, mapping.source)\n          }\n          if (sourceRoot != null) {\n            mapping.source = util.relative(sourceRoot, mapping.source);\n          }\n          mapping.originalLine = original.line;\n          mapping.originalColumn = original.column;\n          if (original.name != null) {\n            mapping.name = original.name;\n          }\n        }\n      }\n\n      var source = mapping.source;\n      if (source != null && !newSources.has(source)) {\n        newSources.add(source);\n      }\n\n      var name = mapping.name;\n      if (name != null && !newNames.has(name)) {\n        newNames.add(name);\n      }\n\n    }, this);\n    this._sources = newSources;\n    this._names = newNames;\n\n    // Copy sourcesContents of applied map.\n    aSourceMapConsumer.sources.forEach(function (sourceFile) {\n      var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n      if (content != null) {\n        if (aSourceMapPath != null) {\n          sourceFile = util.join(aSourceMapPath, sourceFile);\n        }\n        if (sourceRoot != null) {\n          sourceFile = util.relative(sourceRoot, sourceFile);\n        }\n        this.setSourceContent(sourceFile, content);\n      }\n    }, this);\n  };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n *   1. Just the generated position.\n *   2. The Generated position, original position, and original source.\n *   3. Generated and original position, original source, as well as a name\n *      token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n  function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n                                              aName) {\n    // When aOriginal is truthy but has empty values for .line and .column,\n    // it is most likely a programmer error. In this case we throw a very\n    // specific error message to try to guide them the right way.\n    // For example: https://github.com/Polymer/polymer-bundler/pull/519\n    if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n      var message = 'original.line and original.column are not numbers -- you probably meant to omit ' +\n      'the original mapping entirely and only map the generated position. If so, pass ' +\n      'null for the original mapping instead of an object with empty or null values.'\n\n      if (this._ignoreInvalidMapping) {\n        if (typeof console !== 'undefined' && console.warn) {\n          console.warn(message);\n        }\n        return false;\n      } else {\n        throw new Error(message);\n      }\n    }\n\n    if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n        && aGenerated.line > 0 && aGenerated.column >= 0\n        && !aOriginal && !aSource && !aName) {\n      // Case 1.\n      return;\n    }\n    else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n             && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n             && aGenerated.line > 0 && aGenerated.column >= 0\n             && aOriginal.line > 0 && aOriginal.column >= 0\n             && aSource) {\n      // Cases 2 and 3.\n      return;\n    }\n    else {\n      var message = 'Invalid mapping: ' + JSON.stringify({\n        generated: aGenerated,\n        source: aSource,\n        original: aOriginal,\n        name: aName\n      });\n\n      if (this._ignoreInvalidMapping) {\n        if (typeof console !== 'undefined' && console.warn) {\n          console.warn(message);\n        }\n        return false;\n      } else {\n        throw new Error(message)\n      }\n    }\n  };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n  function SourceMapGenerator_serializeMappings() {\n    var previousGeneratedColumn = 0;\n    var previousGeneratedLine = 1;\n    var previousOriginalColumn = 0;\n    var previousOriginalLine = 0;\n    var previousName = 0;\n    var previousSource = 0;\n    var result = '';\n    var next;\n    var mapping;\n    var nameIdx;\n    var sourceIdx;\n\n    var mappings = this._mappings.toArray();\n    for (var i = 0, len = mappings.length; i < len; i++) {\n      mapping = mappings[i];\n      next = ''\n\n      if (mapping.generatedLine !== previousGeneratedLine) {\n        previousGeneratedColumn = 0;\n        while (mapping.generatedLine !== previousGeneratedLine) {\n          next += ';';\n          previousGeneratedLine++;\n        }\n      }\n      else {\n        if (i > 0) {\n          if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n            continue;\n          }\n          next += ',';\n        }\n      }\n\n      next += base64VLQ.encode(mapping.generatedColumn\n                                 - previousGeneratedColumn);\n      previousGeneratedColumn = mapping.generatedColumn;\n\n      if (mapping.source != null) {\n        sourceIdx = this._sources.indexOf(mapping.source);\n        next += base64VLQ.encode(sourceIdx - previousSource);\n        previousSource = sourceIdx;\n\n        // lines are stored 0-based in SourceMap spec version 3\n        next += base64VLQ.encode(mapping.originalLine - 1\n                                   - previousOriginalLine);\n        previousOriginalLine = mapping.originalLine - 1;\n\n        next += base64VLQ.encode(mapping.originalColumn\n                                   - previousOriginalColumn);\n        previousOriginalColumn = mapping.originalColumn;\n\n        if (mapping.name != null) {\n          nameIdx = this._names.indexOf(mapping.name);\n          next += base64VLQ.encode(nameIdx - previousName);\n          previousName = nameIdx;\n        }\n      }\n\n      result += next;\n    }\n\n    return result;\n  };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n  function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n    return aSources.map(function (source) {\n      if (!this._sourcesContents) {\n        return null;\n      }\n      if (aSourceRoot != null) {\n        source = util.relative(aSourceRoot, source);\n      }\n      var key = util.toSetString(source);\n      return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n        ? this._sourcesContents[key]\n        : null;\n    }, this);\n  };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n  function SourceMapGenerator_toJSON() {\n    var map = {\n      version: this._version,\n      sources: this._sources.toArray(),\n      names: this._names.toArray(),\n      mappings: this._serializeMappings()\n    };\n    if (this._file != null) {\n      map.file = this._file;\n    }\n    if (this._sourceRoot != null) {\n      map.sourceRoot = this._sourceRoot;\n    }\n    if (this._sourcesContents) {\n      map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n    }\n\n    return map;\n  };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n  function SourceMapGenerator_toString() {\n    return JSON.stringify(this.toJSON());\n  };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n *     closest element that is smaller than or greater than the one we are\n *     searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n  // This function terminates when one of the following is true:\n  //\n  //   1. We find the exact element we are looking for.\n  //\n  //   2. We did not find the exact element, but we can return the index of\n  //      the next-closest element.\n  //\n  //   3. We did not find the exact element, and there is no next-closest\n  //      element than the one we are searching for, so we return -1.\n  var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n  var cmp = aCompare(aNeedle, aHaystack[mid], true);\n  if (cmp === 0) {\n    // Found the element we are looking for.\n    return mid;\n  }\n  else if (cmp > 0) {\n    // Our needle is greater than aHaystack[mid].\n    if (aHigh - mid > 1) {\n      // The element is in the upper half.\n      return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n    }\n\n    // The exact needle element was not found in this haystack. Determine if\n    // we are in termination case (3) or (2) and return the appropriate thing.\n    if (aBias == exports.LEAST_UPPER_BOUND) {\n      return aHigh < aHaystack.length ? aHigh : -1;\n    } else {\n      return mid;\n    }\n  }\n  else {\n    // Our needle is less than aHaystack[mid].\n    if (mid - aLow > 1) {\n      // The element is in the lower half.\n      return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n    }\n\n    // we are in termination case (3) or (2) and return the appropriate thing.\n    if (aBias == exports.LEAST_UPPER_BOUND) {\n      return mid;\n    } else {\n      return aLow < 0 ? -1 : aLow;\n    }\n  }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n *     array and returns -1, 0, or 1 depending on whether the needle is less\n *     than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n *     closest element that is smaller than or greater than the one we are\n *     searching for, respectively, if the exact element cannot be found.\n *     Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n  if (aHaystack.length === 0) {\n    return -1;\n  }\n\n  var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n                              aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n  if (index < 0) {\n    return -1;\n  }\n\n  // We have found either the exact element, or the next-closest element than\n  // the one we are searching for. However, there may be more than one such\n  // element. Make sure we always return the smallest of these.\n  while (index - 1 >= 0) {\n    if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n      break;\n    }\n    --index;\n  }\n\n  return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\nfunction SortTemplate(comparator) {\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n *        The array.\n * @param {Number} x\n *        The index of the first item.\n * @param {Number} y\n *        The index of the second item.\n */\nfunction swap(ary, x, y) {\n  var temp = ary[x];\n  ary[x] = ary[y];\n  ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n *        The lower bound on the range.\n * @param {Number} high\n *        The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n  return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n *        An array to sort.\n * @param {function} comparator\n *        Function to use to compare two items.\n * @param {Number} p\n *        Start index of the array\n * @param {Number} r\n *        End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n  // If our lower bound is less than our upper bound, we (1) partition the\n  // array into two pieces and (2) recurse on each half. If it is not, this is\n  // the empty array and our base case.\n\n  if (p < r) {\n    // (1) Partitioning.\n    //\n    // The partitioning chooses a pivot between `p` and `r` and moves all\n    // elements that are less than or equal to the pivot to the before it, and\n    // all the elements that are greater than it after it. The effect is that\n    // once partition is done, the pivot is in the exact place it will be when\n    // the array is put in sorted order, and it will not need to be moved\n    // again. This runs in O(n) time.\n\n    // Always choose a random pivot so that an input array which is reverse\n    // sorted does not cause O(n^2) running time.\n    var pivotIndex = randomIntInRange(p, r);\n    var i = p - 1;\n\n    swap(ary, pivotIndex, r);\n    var pivot = ary[r];\n\n    // Immediately after `j` is incremented in this loop, the following hold\n    // true:\n    //\n    //   * Every element in `ary[p .. i]` is less than or equal to the pivot.\n    //\n    //   * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n    for (var j = p; j < r; j++) {\n      if (comparator(ary[j], pivot, false) <= 0) {\n        i += 1;\n        swap(ary, i, j);\n      }\n    }\n\n    swap(ary, i + 1, j);\n    var q = i + 1;\n\n    // (2) Recurse on each half.\n\n    doQuickSort(ary, comparator, p, q - 1);\n    doQuickSort(ary, comparator, q + 1, r);\n  }\n}\n\n  return doQuickSort;\n}\n\nfunction cloneSort(comparator) {\n  let template = SortTemplate.toString();\n  let templateFn = new Function(`return ${template}`)();\n  return templateFn(comparator);\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n *        An array to sort.\n * @param {function} comparator\n *        Function to use to compare two items.\n */\n\nlet sortCache = new WeakMap();\nexports.quickSort = function (ary, comparator, start = 0) {\n  let doQuickSort = sortCache.get(comparator);\n  if (doQuickSort === void 0) {\n    doQuickSort = cloneSort(comparator);\n    sortCache.set(comparator, doQuickSort);\n  }\n  doQuickSort(ary, comparator, start, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n  var sourceMap = aSourceMap;\n  if (typeof aSourceMap === 'string') {\n    sourceMap = util.parseSourceMapInput(aSourceMap);\n  }\n\n  return sourceMap.sections != null\n    ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n    : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n  return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n//     {\n//       generatedLine: The line number in the generated code,\n//       generatedColumn: The column number in the generated code,\n//       source: The path to the original source file that generated this\n//               chunk of code,\n//       originalLine: The line number in the original source that\n//                     corresponds to this chunk of generated code,\n//       originalColumn: The column number in the original source that\n//                       corresponds to this chunk of generated code,\n//       name: The name of the original symbol which generated this chunk of\n//             code.\n//     }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n  configurable: true,\n  enumerable: true,\n  get: function () {\n    if (!this.__generatedMappings) {\n      this._parseMappings(this._mappings, this.sourceRoot);\n    }\n\n    return this.__generatedMappings;\n  }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n  configurable: true,\n  enumerable: true,\n  get: function () {\n    if (!this.__originalMappings) {\n      this._parseMappings(this._mappings, this.sourceRoot);\n    }\n\n    return this.__originalMappings;\n  }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n  function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n    var c = aStr.charAt(index);\n    return c === \";\" || c === \",\";\n  };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n    throw new Error(\"Subclasses must implement _parseMappings\");\n  };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n *        The function that is called with each mapping.\n * @param Object aContext\n *        Optional. If specified, this object will be the value of `this` every\n *        time that `aCallback` is called.\n * @param aOrder\n *        Either `SourceMapConsumer.GENERATED_ORDER` or\n *        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n *        iterate over the mappings sorted by the generated file's line/column\n *        order or the original's source/line/column order, respectively. Defaults to\n *        `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n  function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n    var context = aContext || null;\n    var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n    var mappings;\n    switch (order) {\n    case SourceMapConsumer.GENERATED_ORDER:\n      mappings = this._generatedMappings;\n      break;\n    case SourceMapConsumer.ORIGINAL_ORDER:\n      mappings = this._originalMappings;\n      break;\n    default:\n      throw new Error(\"Unknown order of iteration.\");\n    }\n\n    var sourceRoot = this.sourceRoot;\n    var boundCallback = aCallback.bind(context);\n    var names = this._names;\n    var sources = this._sources;\n    var sourceMapURL = this._sourceMapURL;\n\n    for (var i = 0, n = mappings.length; i < n; i++) {\n      var mapping = mappings[i];\n      var source = mapping.source === null ? null : sources.at(mapping.source);\n      if(source !== null) {\n        source = util.computeSourceURL(sourceRoot, source, sourceMapURL);\n      }\n      boundCallback({\n        source: source,\n        generatedLine: mapping.generatedLine,\n        generatedColumn: mapping.generatedColumn,\n        originalLine: mapping.originalLine,\n        originalColumn: mapping.originalColumn,\n        name: mapping.name === null ? null : names.at(mapping.name)\n      });\n    }\n  };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n *   - source: The filename of the original source.\n *   - line: The line number in the original source.  The line number is 1-based.\n *   - column: Optional. the column number in the original source.\n *    The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n *   - line: The line number in the generated source, or null.  The\n *    line number is 1-based.\n *   - column: The column number in the generated source, or null.\n *    The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n  function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n    var line = util.getArg(aArgs, 'line');\n\n    // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n    // returns the index of the closest mapping less than the needle. By\n    // setting needle.originalColumn to 0, we thus find the last mapping for\n    // the given line, provided such a mapping exists.\n    var needle = {\n      source: util.getArg(aArgs, 'source'),\n      originalLine: line,\n      originalColumn: util.getArg(aArgs, 'column', 0)\n    };\n\n    needle.source = this._findSourceIndex(needle.source);\n    if (needle.source < 0) {\n      return [];\n    }\n\n    var mappings = [];\n\n    var index = this._findMapping(needle,\n                                  this._originalMappings,\n                                  \"originalLine\",\n                                  \"originalColumn\",\n                                  util.compareByOriginalPositions,\n                                  binarySearch.LEAST_UPPER_BOUND);\n    if (index >= 0) {\n      var mapping = this._originalMappings[index];\n\n      if (aArgs.column === undefined) {\n        var originalLine = mapping.originalLine;\n\n        // Iterate until either we run out of mappings, or we run into\n        // a mapping for a different line than the one we found. Since\n        // mappings are sorted, this is guaranteed to find all mappings for\n        // the line we found.\n        while (mapping && mapping.originalLine === originalLine) {\n          mappings.push({\n            line: util.getArg(mapping, 'generatedLine', null),\n            column: util.getArg(mapping, 'generatedColumn', null),\n            lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n          });\n\n          mapping = this._originalMappings[++index];\n        }\n      } else {\n        var originalColumn = mapping.originalColumn;\n\n        // Iterate until either we run out of mappings, or we run into\n        // a mapping for a different line than the one we were searching for.\n        // Since mappings are sorted, this is guaranteed to find all mappings for\n        // the line we are searching for.\n        while (mapping &&\n               mapping.originalLine === line &&\n               mapping.originalColumn == originalColumn) {\n          mappings.push({\n            line: util.getArg(mapping, 'generatedLine', null),\n            column: util.getArg(mapping, 'generatedColumn', null),\n            lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n          });\n\n          mapping = this._originalMappings[++index];\n        }\n      }\n    }\n\n    return mappings;\n  };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n *   - version: Which version of the source map spec this map is following.\n *   - sources: An array of URLs to the original source files.\n *   - names: An array of identifiers which can be referrenced by individual mappings.\n *   - sourceRoot: Optional. The URL root from which all sources are relative.\n *   - sourcesContent: Optional. An array of contents of the original source files.\n *   - mappings: A string of base64 VLQs which contain the actual mappings.\n *   - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n *     {\n *       version : 3,\n *       file: \"out.js\",\n *       sourceRoot : \"\",\n *       sources: [\"foo.js\", \"bar.js\"],\n *       names: [\"src\", \"maps\", \"are\", \"fun\"],\n *       mappings: \"AA,AB;;ABCDE;\"\n *     }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found.  This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n  var sourceMap = aSourceMap;\n  if (typeof aSourceMap === 'string') {\n    sourceMap = util.parseSourceMapInput(aSourceMap);\n  }\n\n  var version = util.getArg(sourceMap, 'version');\n  var sources = util.getArg(sourceMap, 'sources');\n  // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n  // requires the array) to play nice here.\n  var names = util.getArg(sourceMap, 'names', []);\n  var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n  var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n  var mappings = util.getArg(sourceMap, 'mappings');\n  var file = util.getArg(sourceMap, 'file', null);\n\n  // Once again, Sass deviates from the spec and supplies the version as a\n  // string rather than a number, so we use loose equality checking here.\n  if (version != this._version) {\n    throw new Error('Unsupported version: ' + version);\n  }\n\n  if (sourceRoot) {\n    sourceRoot = util.normalize(sourceRoot);\n  }\n\n  sources = sources\n    .map(String)\n    // Some source maps produce relative source paths like \"./foo.js\" instead of\n    // \"foo.js\".  Normalize these first so that future comparisons will succeed.\n    // See bugzil.la/1090768.\n    .map(util.normalize)\n    // Always ensure that absolute sources are internally stored relative to\n    // the source root, if the source root is absolute. Not doing this would\n    // be particularly problematic when the source root is a prefix of the\n    // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n    .map(function (source) {\n      return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n        ? util.relative(sourceRoot, source)\n        : source;\n    });\n\n  // Pass `true` below to allow duplicate names and sources. While source maps\n  // are intended to be compressed and deduplicated, the TypeScript compiler\n  // sometimes generates source maps with duplicates in them. See Github issue\n  // #72 and bugzil.la/889492.\n  this._names = ArraySet.fromArray(names.map(String), true);\n  this._sources = ArraySet.fromArray(sources, true);\n\n  this._absoluteSources = this._sources.toArray().map(function (s) {\n    return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n  });\n\n  this.sourceRoot = sourceRoot;\n  this.sourcesContent = sourcesContent;\n  this._mappings = mappings;\n  this._sourceMapURL = aSourceMapURL;\n  this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source.  Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n  var relativeSource = aSource;\n  if (this.sourceRoot != null) {\n    relativeSource = util.relative(this.sourceRoot, relativeSource);\n  }\n\n  if (this._sources.has(relativeSource)) {\n    return this._sources.indexOf(relativeSource);\n  }\n\n  // Maybe aSource is an absolute URL as returned by |sources|.  In\n  // this case we can't simply undo the transform.\n  var i;\n  for (i = 0; i < this._absoluteSources.length; ++i) {\n    if (this._absoluteSources[i] == aSource) {\n      return i;\n    }\n  }\n\n  return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n *        The source map that will be consumed.\n * @param String aSourceMapURL\n *        The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n  function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n    var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n    var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n    var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n    smc.sourceRoot = aSourceMap._sourceRoot;\n    smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n                                                            smc.sourceRoot);\n    smc.file = aSourceMap._file;\n    smc._sourceMapURL = aSourceMapURL;\n    smc._absoluteSources = smc._sources.toArray().map(function (s) {\n      return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n    });\n\n    // Because we are modifying the entries (by converting string sources and\n    // names to indices into the sources and names ArraySets), we have to make\n    // a copy of the entry or else bad things happen. Shared mutable state\n    // strikes again! See github issue #191.\n\n    var generatedMappings = aSourceMap._mappings.toArray().slice();\n    var destGeneratedMappings = smc.__generatedMappings = [];\n    var destOriginalMappings = smc.__originalMappings = [];\n\n    for (var i = 0, length = generatedMappings.length; i < length; i++) {\n      var srcMapping = generatedMappings[i];\n      var destMapping = new Mapping;\n      destMapping.generatedLine = srcMapping.generatedLine;\n      destMapping.generatedColumn = srcMapping.generatedColumn;\n\n      if (srcMapping.source) {\n        destMapping.source = sources.indexOf(srcMapping.source);\n        destMapping.originalLine = srcMapping.originalLine;\n        destMapping.originalColumn = srcMapping.originalColumn;\n\n        if (srcMapping.name) {\n          destMapping.name = names.indexOf(srcMapping.name);\n        }\n\n        destOriginalMappings.push(destMapping);\n      }\n\n      destGeneratedMappings.push(destMapping);\n    }\n\n    quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n    return smc;\n  };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n  get: function () {\n    return this._absoluteSources.slice();\n  }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n  this.generatedLine = 0;\n  this.generatedColumn = 0;\n  this.source = null;\n  this.originalLine = null;\n  this.originalColumn = null;\n  this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\n\nconst compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;\nfunction sortGenerated(array, start) {\n  let l = array.length;\n  let n = array.length - start;\n  if (n <= 1) {\n    return;\n  } else if (n == 2) {\n    let a = array[start];\n    let b = array[start + 1];\n    if (compareGenerated(a, b) > 0) {\n      array[start] = b;\n      array[start + 1] = a;\n    }\n  } else if (n < 20) {\n    for (let i = start; i < l; i++) {\n      for (let j = i; j > start; j--) {\n        let a = array[j - 1];\n        let b = array[j];\n        if (compareGenerated(a, b) <= 0) {\n          break;\n        }\n        array[j - 1] = b;\n        array[j] = a;\n      }\n    }\n  } else {\n    quickSort(array, compareGenerated, start);\n  }\n}\nBasicSourceMapConsumer.prototype._parseMappings =\n  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n    var generatedLine = 1;\n    var previousGeneratedColumn = 0;\n    var previousOriginalLine = 0;\n    var previousOriginalColumn = 0;\n    var previousSource = 0;\n    var previousName = 0;\n    var length = aStr.length;\n    var index = 0;\n    var cachedSegments = {};\n    var temp = {};\n    var originalMappings = [];\n    var generatedMappings = [];\n    var mapping, str, segment, end, value;\n\n    let subarrayStart = 0;\n    while (index < length) {\n      if (aStr.charAt(index) === ';') {\n        generatedLine++;\n        index++;\n        previousGeneratedColumn = 0;\n\n        sortGenerated(generatedMappings, subarrayStart);\n        subarrayStart = generatedMappings.length;\n      }\n      else if (aStr.charAt(index) === ',') {\n        index++;\n      }\n      else {\n        mapping = new Mapping();\n        mapping.generatedLine = generatedLine;\n\n        for (end = index; end < length; end++) {\n          if (this._charIsMappingSeparator(aStr, end)) {\n            break;\n          }\n        }\n        str = aStr.slice(index, end);\n\n        segment = [];\n        while (index < end) {\n          base64VLQ.decode(aStr, index, temp);\n          value = temp.value;\n          index = temp.rest;\n          segment.push(value);\n        }\n\n        if (segment.length === 2) {\n          throw new Error('Found a source, but no line and column');\n        }\n\n        if (segment.length === 3) {\n          throw new Error('Found a source and line, but no column');\n        }\n\n        // Generated column.\n        mapping.generatedColumn = previousGeneratedColumn + segment[0];\n        previousGeneratedColumn = mapping.generatedColumn;\n\n        if (segment.length > 1) {\n          // Original source.\n          mapping.source = previousSource + segment[1];\n          previousSource += segment[1];\n\n          // Original line.\n          mapping.originalLine = previousOriginalLine + segment[2];\n          previousOriginalLine = mapping.originalLine;\n          // Lines are stored 0-based\n          mapping.originalLine += 1;\n\n          // Original column.\n          mapping.originalColumn = previousOriginalColumn + segment[3];\n          previousOriginalColumn = mapping.originalColumn;\n\n          if (segment.length > 4) {\n            // Original name.\n            mapping.name = previousName + segment[4];\n            previousName += segment[4];\n          }\n        }\n\n        generatedMappings.push(mapping);\n        if (typeof mapping.originalLine === 'number') {\n          let currentSource = mapping.source;\n          while (originalMappings.length <= currentSource) {\n            originalMappings.push(null);\n          }\n          if (originalMappings[currentSource] === null) {\n            originalMappings[currentSource] = [];\n          }\n          originalMappings[currentSource].push(mapping);\n        }\n      }\n    }\n\n    sortGenerated(generatedMappings, subarrayStart);\n    this.__generatedMappings = generatedMappings;\n\n    for (var i = 0; i < originalMappings.length; i++) {\n      if (originalMappings[i] != null) {\n        quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);\n      }\n    }\n    this.__originalMappings = [].concat(...originalMappings);\n  };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n  function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n                                         aColumnName, aComparator, aBias) {\n    // To return the position we are searching for, we must first find the\n    // mapping for the given position and then return the opposite position it\n    // points to. Because the mappings are sorted, we can use binary search to\n    // find the best mapping.\n\n    if (aNeedle[aLineName] <= 0) {\n      throw new TypeError('Line must be greater than or equal to 1, got '\n                          + aNeedle[aLineName]);\n    }\n    if (aNeedle[aColumnName] < 0) {\n      throw new TypeError('Column must be greater than or equal to 0, got '\n                          + aNeedle[aColumnName]);\n    }\n\n    return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n  };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n  function SourceMapConsumer_computeColumnSpans() {\n    for (var index = 0; index < this._generatedMappings.length; ++index) {\n      var mapping = this._generatedMappings[index];\n\n      // Mappings do not contain a field for the last generated columnt. We\n      // can come up with an optimistic estimate, however, by assuming that\n      // mappings are contiguous (i.e. given two consecutive mappings, the\n      // first mapping ends where the second one starts).\n      if (index + 1 < this._generatedMappings.length) {\n        var nextMapping = this._generatedMappings[index + 1];\n\n        if (mapping.generatedLine === nextMapping.generatedLine) {\n          mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n          continue;\n        }\n      }\n\n      // The last mapping for each line spans the entire line.\n      mapping.lastGeneratedColumn = Infinity;\n    }\n  };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n *   - line: The line number in the generated source.  The line number\n *     is 1-based.\n *   - column: The column number in the generated source.  The column\n *     number is 0-based.\n *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n *     closest element that is smaller than or greater than the one we are\n *     searching for, respectively, if the exact element cannot be found.\n *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n *   - source: The original source file, or null.\n *   - line: The line number in the original source, or null.  The\n *     line number is 1-based.\n *   - column: The column number in the original source, or null.  The\n *     column number is 0-based.\n *   - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n  function SourceMapConsumer_originalPositionFor(aArgs) {\n    var needle = {\n      generatedLine: util.getArg(aArgs, 'line'),\n      generatedColumn: util.getArg(aArgs, 'column')\n    };\n\n    var index = this._findMapping(\n      needle,\n      this._generatedMappings,\n      \"generatedLine\",\n      \"generatedColumn\",\n      util.compareByGeneratedPositionsDeflated,\n      util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n    );\n\n    if (index >= 0) {\n      var mapping = this._generatedMappings[index];\n\n      if (mapping.generatedLine === needle.generatedLine) {\n        var source = util.getArg(mapping, 'source', null);\n        if (source !== null) {\n          source = this._sources.at(source);\n          source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n        }\n        var name = util.getArg(mapping, 'name', null);\n        if (name !== null) {\n          name = this._names.at(name);\n        }\n        return {\n          source: source,\n          line: util.getArg(mapping, 'originalLine', null),\n          column: util.getArg(mapping, 'originalColumn', null),\n          name: name\n        };\n      }\n    }\n\n    return {\n      source: null,\n      line: null,\n      column: null,\n      name: null\n    };\n  };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n  function BasicSourceMapConsumer_hasContentsOfAllSources() {\n    if (!this.sourcesContent) {\n      return false;\n    }\n    return this.sourcesContent.length >= this._sources.size() &&\n      !this.sourcesContent.some(function (sc) { return sc == null; });\n  };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n  function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n    if (!this.sourcesContent) {\n      return null;\n    }\n\n    var index = this._findSourceIndex(aSource);\n    if (index >= 0) {\n      return this.sourcesContent[index];\n    }\n\n    var relativeSource = aSource;\n    if (this.sourceRoot != null) {\n      relativeSource = util.relative(this.sourceRoot, relativeSource);\n    }\n\n    var url;\n    if (this.sourceRoot != null\n        && (url = util.urlParse(this.sourceRoot))) {\n      // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n      // many users. We can help them out when they expect file:// URIs to\n      // behave like it would if they were running a local HTTP server. See\n      // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n      var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n      if (url.scheme == \"file\"\n          && this._sources.has(fileUriAbsPath)) {\n        return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n      }\n\n      if ((!url.path || url.path == \"/\")\n          && this._sources.has(\"/\" + relativeSource)) {\n        return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n      }\n    }\n\n    // This function is used recursively from\n    // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n    // don't want to throw if we can't find the source - we just want to\n    // return null, so we provide a flag to exit gracefully.\n    if (nullOnMissing) {\n      return null;\n    }\n    else {\n      throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n    }\n  };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n *   - source: The filename of the original source.\n *   - line: The line number in the original source.  The line number\n *     is 1-based.\n *   - column: The column number in the original source.  The column\n *     number is 0-based.\n *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n *     closest element that is smaller than or greater than the one we are\n *     searching for, respectively, if the exact element cannot be found.\n *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n *   - line: The line number in the generated source, or null.  The\n *     line number is 1-based.\n *   - column: The column number in the generated source, or null.\n *     The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n  function SourceMapConsumer_generatedPositionFor(aArgs) {\n    var source = util.getArg(aArgs, 'source');\n    source = this._findSourceIndex(source);\n    if (source < 0) {\n      return {\n        line: null,\n        column: null,\n        lastColumn: null\n      };\n    }\n\n    var needle = {\n      source: source,\n      originalLine: util.getArg(aArgs, 'line'),\n      originalColumn: util.getArg(aArgs, 'column')\n    };\n\n    var index = this._findMapping(\n      needle,\n      this._originalMappings,\n      \"originalLine\",\n      \"originalColumn\",\n      util.compareByOriginalPositions,\n      util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n    );\n\n    if (index >= 0) {\n      var mapping = this._originalMappings[index];\n\n      if (mapping.source === needle.source) {\n        return {\n          line: util.getArg(mapping, 'generatedLine', null),\n          column: util.getArg(mapping, 'generatedColumn', null),\n          lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n        };\n      }\n    }\n\n    return {\n      line: null,\n      column: null,\n      lastColumn: null\n    };\n  };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n *   - version: Which version of the source map spec this map is following.\n *   - file: Optional. The generated file this source map is associated with.\n *   - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n *   - offset: The offset into the original specified at which this section\n *       begins to apply, defined as an object with a \"line\" and \"column\"\n *       field.\n *   - map: A source map definition. This source map could also be indexed,\n *       but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n *  {\n *    version : 3,\n *    file: \"app.js\",\n *    sections: [{\n *      offset: {line:100, column:10},\n *      map: {\n *        version : 3,\n *        file: \"section.js\",\n *        sources: [\"foo.js\", \"bar.js\"],\n *        names: [\"src\", \"maps\", \"are\", \"fun\"],\n *        mappings: \"AAAA,E;;ABCDE;\"\n *      }\n *    }],\n *  }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found.  This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n  var sourceMap = aSourceMap;\n  if (typeof aSourceMap === 'string') {\n    sourceMap = util.parseSourceMapInput(aSourceMap);\n  }\n\n  var version = util.getArg(sourceMap, 'version');\n  var sections = util.getArg(sourceMap, 'sections');\n\n  if (version != this._version) {\n    throw new Error('Unsupported version: ' + version);\n  }\n\n  this._sources = new ArraySet();\n  this._names = new ArraySet();\n\n  var lastOffset = {\n    line: -1,\n    column: 0\n  };\n  this._sections = sections.map(function (s) {\n    if (s.url) {\n      // The url field will require support for asynchronicity.\n      // See https://github.com/mozilla/source-map/issues/16\n      throw new Error('Support for url field in sections not implemented.');\n    }\n    var offset = util.getArg(s, 'offset');\n    var offsetLine = util.getArg(offset, 'line');\n    var offsetColumn = util.getArg(offset, 'column');\n\n    if (offsetLine < lastOffset.line ||\n        (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n      throw new Error('Section offsets must be ordered and non-overlapping.');\n    }\n    lastOffset = offset;\n\n    return {\n      generatedOffset: {\n        // The offset fields are 0-based, but we use 1-based indices when\n        // encoding/decoding from VLQ.\n        generatedLine: offsetLine + 1,\n        generatedColumn: offsetColumn + 1\n      },\n      consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n    }\n  });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n  get: function () {\n    var sources = [];\n    for (var i = 0; i < this._sections.length; i++) {\n      for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n        sources.push(this._sections[i].consumer.sources[j]);\n      }\n    }\n    return sources;\n  }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n *   - line: The line number in the generated source.  The line number\n *     is 1-based.\n *   - column: The column number in the generated source.  The column\n *     number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n *   - source: The original source file, or null.\n *   - line: The line number in the original source, or null.  The\n *     line number is 1-based.\n *   - column: The column number in the original source, or null.  The\n *     column number is 0-based.\n *   - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n  function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n    var needle = {\n      generatedLine: util.getArg(aArgs, 'line'),\n      generatedColumn: util.getArg(aArgs, 'column')\n    };\n\n    // Find the section containing the generated position we're trying to map\n    // to an original position.\n    var sectionIndex = binarySearch.search(needle, this._sections,\n      function(needle, section) {\n        var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n        if (cmp) {\n          return cmp;\n        }\n\n        return (needle.generatedColumn -\n                section.generatedOffset.generatedColumn);\n      });\n    var section = this._sections[sectionIndex];\n\n    if (!section) {\n      return {\n        source: null,\n        line: null,\n        column: null,\n        name: null\n      };\n    }\n\n    return section.consumer.originalPositionFor({\n      line: needle.generatedLine -\n        (section.generatedOffset.generatedLine - 1),\n      column: needle.generatedColumn -\n        (section.generatedOffset.generatedLine === needle.generatedLine\n         ? section.generatedOffset.generatedColumn - 1\n         : 0),\n      bias: aArgs.bias\n    });\n  };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n  function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n    return this._sections.every(function (s) {\n      return s.consumer.hasContentsOfAllSources();\n    });\n  };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n  function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n    for (var i = 0; i < this._sections.length; i++) {\n      var section = this._sections[i];\n\n      var content = section.consumer.sourceContentFor(aSource, true);\n      if (content || content === '') {\n        return content;\n      }\n    }\n    if (nullOnMissing) {\n      return null;\n    }\n    else {\n      throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n    }\n  };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n *   - source: The filename of the original source.\n *   - line: The line number in the original source.  The line number\n *     is 1-based.\n *   - column: The column number in the original source.  The column\n *     number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n *   - line: The line number in the generated source, or null.  The\n *     line number is 1-based. \n *   - column: The column number in the generated source, or null.\n *     The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n  function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n    for (var i = 0; i < this._sections.length; i++) {\n      var section = this._sections[i];\n\n      // Only consider this section if the requested source is in the list of\n      // sources of the consumer.\n      if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n        continue;\n      }\n      var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n      if (generatedPosition) {\n        var ret = {\n          line: generatedPosition.line +\n            (section.generatedOffset.generatedLine - 1),\n          column: generatedPosition.column +\n            (section.generatedOffset.generatedLine === generatedPosition.line\n             ? section.generatedOffset.generatedColumn - 1\n             : 0)\n        };\n        return ret;\n      }\n    }\n\n    return {\n      line: null,\n      column: null\n    };\n  };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n  function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n    this.__generatedMappings = [];\n    this.__originalMappings = [];\n    for (var i = 0; i < this._sections.length; i++) {\n      var section = this._sections[i];\n      var sectionMappings = section.consumer._generatedMappings;\n      for (var j = 0; j < sectionMappings.length; j++) {\n        var mapping = sectionMappings[j];\n\n        var source = section.consumer._sources.at(mapping.source);\n        if(source !== null) {\n          source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n        }\n        this._sources.add(source);\n        source = this._sources.indexOf(source);\n\n        var name = null;\n        if (mapping.name) {\n          name = section.consumer._names.at(mapping.name);\n          this._names.add(name);\n          name = this._names.indexOf(name);\n        }\n\n        // The mappings coming from the consumer for the section have\n        // generated positions relative to the start of the section, so we\n        // need to offset them to be relative to the start of the concatenated\n        // generated file.\n        var adjustedMapping = {\n          source: source,\n          generatedLine: mapping.generatedLine +\n            (section.generatedOffset.generatedLine - 1),\n          generatedColumn: mapping.generatedColumn +\n            (section.generatedOffset.generatedLine === mapping.generatedLine\n            ? section.generatedOffset.generatedColumn - 1\n            : 0),\n          originalLine: mapping.originalLine,\n          originalColumn: mapping.originalColumn,\n          name: name\n        };\n\n        this.__generatedMappings.push(adjustedMapping);\n        if (typeof adjustedMapping.originalLine === 'number') {\n          this.__originalMappings.push(adjustedMapping);\n        }\n      }\n    }\n\n    quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n    quickSort(this.__originalMappings, util.compareByOriginalPositions);\n  };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n *        generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n  this.children = [];\n  this.sourceContents = {};\n  this.line = aLine == null ? null : aLine;\n  this.column = aColumn == null ? null : aColumn;\n  this.source = aSource == null ? null : aSource;\n  this.name = aName == null ? null : aName;\n  this[isSourceNode] = true;\n  if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n *        SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n  function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n    // The SourceNode we want to fill with the generated code\n    // and the SourceMap\n    var node = new SourceNode();\n\n    // All even indices of this array are one line of the generated code,\n    // while all odd indices are the newlines between two adjacent lines\n    // (since `REGEX_NEWLINE` captures its match).\n    // Processed fragments are accessed by calling `shiftNextLine`.\n    var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n    var remainingLinesIndex = 0;\n    var shiftNextLine = function() {\n      var lineContents = getNextLine();\n      // The last line of a file might not have a newline.\n      var newLine = getNextLine() || \"\";\n      return lineContents + newLine;\n\n      function getNextLine() {\n        return remainingLinesIndex < remainingLines.length ?\n            remainingLines[remainingLinesIndex++] : undefined;\n      }\n    };\n\n    // We need to remember the position of \"remainingLines\"\n    var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n    // The generate SourceNodes we need a code range.\n    // To extract it current and last mapping is used.\n    // Here we store the last mapping.\n    var lastMapping = null;\n\n    aSourceMapConsumer.eachMapping(function (mapping) {\n      if (lastMapping !== null) {\n        // We add the code from \"lastMapping\" to \"mapping\":\n        // First check if there is a new line in between.\n        if (lastGeneratedLine < mapping.generatedLine) {\n          // Associate first line with \"lastMapping\"\n          addMappingWithCode(lastMapping, shiftNextLine());\n          lastGeneratedLine++;\n          lastGeneratedColumn = 0;\n          // The remaining code is added without mapping\n        } else {\n          // There is no new line in between.\n          // Associate the code between \"lastGeneratedColumn\" and\n          // \"mapping.generatedColumn\" with \"lastMapping\"\n          var nextLine = remainingLines[remainingLinesIndex] || '';\n          var code = nextLine.substr(0, mapping.generatedColumn -\n                                        lastGeneratedColumn);\n          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n                                              lastGeneratedColumn);\n          lastGeneratedColumn = mapping.generatedColumn;\n          addMappingWithCode(lastMapping, code);\n          // No more remaining code, continue\n          lastMapping = mapping;\n          return;\n        }\n      }\n      // We add the generated code until the first mapping\n      // to the SourceNode without any mapping.\n      // Each line is added as separate string.\n      while (lastGeneratedLine < mapping.generatedLine) {\n        node.add(shiftNextLine());\n        lastGeneratedLine++;\n      }\n      if (lastGeneratedColumn < mapping.generatedColumn) {\n        var nextLine = remainingLines[remainingLinesIndex] || '';\n        node.add(nextLine.substr(0, mapping.generatedColumn));\n        remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n        lastGeneratedColumn = mapping.generatedColumn;\n      }\n      lastMapping = mapping;\n    }, this);\n    // We have processed all mappings.\n    if (remainingLinesIndex < remainingLines.length) {\n      if (lastMapping) {\n        // Associate the remaining code in the current line with \"lastMapping\"\n        addMappingWithCode(lastMapping, shiftNextLine());\n      }\n      // and add the remaining lines without any mapping\n      node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n    }\n\n    // Copy sourcesContent into SourceNode\n    aSourceMapConsumer.sources.forEach(function (sourceFile) {\n      var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n      if (content != null) {\n        if (aRelativePath != null) {\n          sourceFile = util.join(aRelativePath, sourceFile);\n        }\n        node.setSourceContent(sourceFile, content);\n      }\n    });\n\n    return node;\n\n    function addMappingWithCode(mapping, code) {\n      if (mapping === null || mapping.source === undefined) {\n        node.add(code);\n      } else {\n        var source = aRelativePath\n          ? util.join(aRelativePath, mapping.source)\n          : mapping.source;\n        node.add(new SourceNode(mapping.originalLine,\n                                mapping.originalColumn,\n                                source,\n                                code,\n                                mapping.name));\n      }\n    }\n  };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n *        SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n  if (Array.isArray(aChunk)) {\n    aChunk.forEach(function (chunk) {\n      this.add(chunk);\n    }, this);\n  }\n  else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n    if (aChunk) {\n      this.children.push(aChunk);\n    }\n  }\n  else {\n    throw new TypeError(\n      \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n    );\n  }\n  return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n *        SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n  if (Array.isArray(aChunk)) {\n    for (var i = aChunk.length-1; i >= 0; i--) {\n      this.prepend(aChunk[i]);\n    }\n  }\n  else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n    this.children.unshift(aChunk);\n  }\n  else {\n    throw new TypeError(\n      \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n    );\n  }\n  return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n  var chunk;\n  for (var i = 0, len = this.children.length; i < len; i++) {\n    chunk = this.children[i];\n    if (chunk[isSourceNode]) {\n      chunk.walk(aFn);\n    }\n    else {\n      if (chunk !== '') {\n        aFn(chunk, { source: this.source,\n                     line: this.line,\n                     column: this.column,\n                     name: this.name });\n      }\n    }\n  }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n  var newChildren;\n  var i;\n  var len = this.children.length;\n  if (len > 0) {\n    newChildren = [];\n    for (i = 0; i < len-1; i++) {\n      newChildren.push(this.children[i]);\n      newChildren.push(aSep);\n    }\n    newChildren.push(this.children[i]);\n    this.children = newChildren;\n  }\n  return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n  var lastChild = this.children[this.children.length - 1];\n  if (lastChild[isSourceNode]) {\n    lastChild.replaceRight(aPattern, aReplacement);\n  }\n  else if (typeof lastChild === 'string') {\n    this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n  }\n  else {\n    this.children.push(''.replace(aPattern, aReplacement));\n  }\n  return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n  function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n    this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n  };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n  function SourceNode_walkSourceContents(aFn) {\n    for (var i = 0, len = this.children.length; i < len; i++) {\n      if (this.children[i][isSourceNode]) {\n        this.children[i].walkSourceContents(aFn);\n      }\n    }\n\n    var sources = Object.keys(this.sourceContents);\n    for (var i = 0, len = sources.length; i < len; i++) {\n      aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n    }\n  };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n  var str = \"\";\n  this.walk(function (chunk) {\n    str += chunk;\n  });\n  return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n  var generated = {\n    code: \"\",\n    line: 1,\n    column: 0\n  };\n  var map = new SourceMapGenerator(aArgs);\n  var sourceMappingActive = false;\n  var lastOriginalSource = null;\n  var lastOriginalLine = null;\n  var lastOriginalColumn = null;\n  var lastOriginalName = null;\n  this.walk(function (chunk, original) {\n    generated.code += chunk;\n    if (original.source !== null\n        && original.line !== null\n        && original.column !== null) {\n      if(lastOriginalSource !== original.source\n         || lastOriginalLine !== original.line\n         || lastOriginalColumn !== original.column\n         || lastOriginalName !== original.name) {\n        map.addMapping({\n          source: original.source,\n          original: {\n            line: original.line,\n            column: original.column\n          },\n          generated: {\n            line: generated.line,\n            column: generated.column\n          },\n          name: original.name\n        });\n      }\n      lastOriginalSource = original.source;\n      lastOriginalLine = original.line;\n      lastOriginalColumn = original.column;\n      lastOriginalName = original.name;\n      sourceMappingActive = true;\n    } else if (sourceMappingActive) {\n      map.addMapping({\n        generated: {\n          line: generated.line,\n          column: generated.column\n        }\n      });\n      lastOriginalSource = null;\n      sourceMappingActive = false;\n    }\n    for (var idx = 0, length = chunk.length; idx < length; idx++) {\n      if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n        generated.line++;\n        generated.column = 0;\n        // Mappings end at eol\n        if (idx + 1 === length) {\n          lastOriginalSource = null;\n          sourceMappingActive = false;\n        } else if (sourceMappingActive) {\n          map.addMapping({\n            source: original.source,\n            original: {\n              line: original.line,\n              column: original.column\n            },\n            generated: {\n              line: generated.line,\n              column: generated.column\n            },\n            name: original.name\n          });\n        }\n      } else {\n        generated.column++;\n      }\n    }\n  });\n  this.walkSourceContents(function (sourceFile, sourceContent) {\n    map.setSourceContent(sourceFile, sourceContent);\n  });\n\n  return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","import { type RawSourceMap, SourceMapConsumer } from \"source-map-js\";\n\n// Cache by normalized URL (no query string — Vite adds ?t= for HMR but the map is stable).\n// Stored as a Promise so concurrent lookups for the same file share one in-flight fetch.\nconst consumerCache = new Map<string, Promise<SourceMapConsumer | null>>();\n\nasync function loadConsumer(fileUrl: string): Promise<SourceMapConsumer | null> {\n  try {\n    if (!fileUrl.startsWith(\"http://\") && !fileUrl.startsWith(\"https://\")) return null;\n\n    const resp = await fetch(fileUrl);\n    if (!resp.ok) return null;\n    const text = await resp.text();\n\n    const match = text.match(/\\/\\/[#@] sourceMappingURL=(\\S+)/);\n    if (match == null) return null;\n    const mapRef = match[1]!;\n\n    let mapJson: string;\n    if (mapRef.startsWith(\"data:\")) {\n      // Inline source map: data:application/json;charset=utf-8;base64,<payload>\n      const commaIdx = mapRef.indexOf(\",\");\n      if (commaIdx === -1) return null;\n      const header = mapRef.slice(5, commaIdx);\n      const payload = mapRef.slice(commaIdx + 1);\n      mapJson = header.includes(\"base64\") ? atob(payload) : decodeURIComponent(payload);\n    } else {\n      // External .map file — resolve relative to the source file URL\n      const mapUrl = new URL(mapRef, fileUrl).href;\n      const mapResp = await fetch(mapUrl);\n      if (!mapResp.ok) return null;\n      mapJson = await mapResp.text();\n    }\n\n    return new SourceMapConsumer(JSON.parse(mapJson) as RawSourceMap);\n  } catch {\n    return null;\n  }\n}\n\nfunction getConsumer(fileUrl: string): Promise<SourceMapConsumer | null> {\n  const key = fileUrl.split(\"?\")[0] ?? fileUrl;\n  if (!consumerCache.has(key)) {\n    consumerCache.set(key, loadConsumer(fileUrl));\n  }\n  return consumerCache.get(key)!;\n}\n\nexport interface IResolvedSourcePosition {\n  file: string;\n  line: number;\n  col: number;\n}\n\nexport async function resolveCompiledPosition(\n  fileUrl: string,\n  line: number,\n  col: number,\n): Promise<IResolvedSourcePosition | null> {\n  try {\n    const consumer = await getConsumer(fileUrl);\n    if (consumer == null) return null;\n\n    // source-map-js types MappedPosition as non-nullable but returns nulls when there's no mapping\n    const pos = consumer.originalPositionFor({ line, column: col }) as {\n      source: string | null;\n      line: number | null;\n      column: number | null;\n    };\n    if (pos.source == null || pos.line == null) return null;\n\n    return { file: pos.source, line: pos.line, col: pos.column ?? 0 };\n  } catch {\n    return null;\n  }\n}\n","import { NiceUiSectionLabel, token, tokenAlpha } from \"@nice-code/ui\";\nimport type { IRuntimeCoordinate, TRuntimeCoordinateEnvId } from \"@nice-code/wire\";\nimport { ExternalLink } from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n  DEVTOOL_STACK_FRAME_INTERNAL_FILE,\n  DEVTOOL_STACK_FRAME_INTERNAL_FOLDER,\n  DEVTOOL_STACK_FRAME_INTERNAL_FUNCTION,\n  DEVTOOL_STACK_FRAME_INTERNAL_LINE,\n  DEVTOOL_STACK_FRAME_INTERNAL_NUMBER,\n  DEVTOOL_STACK_FRAME_USER_FILE,\n  DEVTOOL_STACK_FRAME_USER_FOLDER,\n  DEVTOOL_STACK_FRAME_USER_FUNCTION,\n  DEVTOOL_STACK_FRAME_USER_LINE,\n  DEVTOOL_STACK_FRAME_USER_NUMBER,\n  DEVTOOL_STACK_TRACE_BACKGROUND,\n} from \"../../core/devtools_colors\";\nimport { devtools_storage } from \"../devtools_storage\";\nimport { resolveCompiledPosition } from \"./sourceMapResolver\";\n\ninterface IStackFrame {\n  fn?: string;\n  file?: string;\n  /** The file URL from the raw stack trace, before source-map resolution overwrites `file`. */\n  originalFile?: string;\n  line?: number;\n  col?: number;\n  raw: string;\n  isInternal: boolean;\n  internalProjectPath?: string;\n}\n\nconst INTERNAL_PATTERNS = [\n  \"/nice-action/\", // monorepo workspace paths: packages/nice-action/src/...\n  \"@nice-code/action\", // npm scoped package: webpack://@nice-code/action/..., /@nice-code/action/...\n  \"/nice-error/\",\n  \"@nice-code/error\",\n  \"node_modules/\",\n  \"native code\",\n  \"<anonymous>\",\n];\n\nfunction isInternalFrame(file: string): boolean {\n  return INTERNAL_PATTERNS.some((p) => file.includes(p));\n}\n\nfunction parseStackFrames(stack: string): IStackFrame[] {\n  return stack\n    .split(\"\\n\")\n    .slice(1)\n    .map((line): IStackFrame | null => {\n      const raw = line.trim();\n      if (raw === \"\") return null;\n      const matchFn = raw.match(/^at (.+?) \\((.+):(\\d+):(\\d+)\\)$/);\n      if (matchFn != null) {\n        const file = matchFn[2]!;\n        return {\n          fn: matchFn[1],\n          file,\n          line: parseInt(matchFn[3]!, 10),\n          col: parseInt(matchFn[4]!, 10),\n          raw,\n          isInternal: isInternalFrame(file),\n        };\n      }\n      const matchUrl = raw.match(/^at (.+):(\\d+):(\\d+)$/);\n      if (matchUrl != null) {\n        const file = matchUrl[1]!;\n        return {\n          file,\n          line: parseInt(matchUrl[2]!, 10),\n          col: parseInt(matchUrl[3]!, 10),\n          raw,\n          isInternal: isInternalFrame(file),\n        };\n      }\n      return { raw, isInternal: true };\n    })\n    .filter((f): f is IStackFrame => f != null);\n}\n\nasync function resolveSourceMapPositions(frames: IStackFrame[]): Promise<IStackFrame[]> {\n  return Promise.all(\n    frames.map(async (frame): Promise<IStackFrame> => {\n      if (frame.isInternal || frame.file == null || frame.line == null) return frame;\n      const resolved = await resolveCompiledPosition(frame.file, frame.line, frame.col ?? 0);\n      if (resolved == null) return frame;\n      return {\n        ...frame,\n        originalFile: frame.file,\n        file: resolved.file,\n        line: resolved.line,\n        col: resolved.col,\n      };\n    }),\n  );\n}\n\nfunction formatFrameFile(file: string | undefined): string {\n  if (file == null) return \"?\";\n  let path = file;\n  try {\n    const url = new URL(file);\n    path = url.pathname.split(\"?\")[0] ?? url.pathname;\n    // Vite serves files outside the project root under /@fs/<absolute-path>\n    if (path.startsWith(\"/@fs/\")) path = path.slice(4);\n  } catch {\n    /* not a URL, use as-is */\n  }\n  const parts = path.replace(/\\\\/g, \"/\").split(\"/\").filter(Boolean);\n  // Strip common Windows drive segment like \"c:\" at the front\n  const filtered = parts[0]?.match(/^[a-zA-Z]:$/) != null ? parts.slice(1) : parts;\n  // Show up to 4 segments (3 dirs + filename), enough to identify without overwhelming\n  const tail = filtered.slice(-4);\n  return tail.join(\"/\") || file;\n}\n\n// Returns the stack-origin HTTP URL for path extraction: prefers originalFile (pre-source-map)\n// over the post-resolution file, because Vite source maps often reduce the path to just a\n// basename (\"App.tsx\") which loses the root-relative path info the URL had (\"/src/App.tsx\").\nfunction getOriginUrl(frame: IStackFrame): string | null {\n  const candidate = frame.originalFile ?? frame.file;\n  if (candidate == null) return null;\n  try {\n    new URL(candidate);\n    return candidate;\n  } catch {\n    return null;\n  }\n}\n\n// True when the frame's origin URL is Vite root-relative (no /@fs/ embedded absolute path),\n// meaning we need a configured project root to build an absolute VS Code path.\nfunction frameNeedsProjectRoot(frame: IStackFrame): boolean {\n  if (frame.isInternal) return false;\n  const originUrl = getOriginUrl(frame);\n  if (originUrl == null) return false;\n  const path = new URL(originUrl).pathname.split(\"?\")[0] ?? \"\";\n  return !path.startsWith(\"/@fs/\");\n}\n\nfunction buildVscodeUrl(frame: IStackFrame, projectRoot: string | null): string | null {\n  if (frame.line == null) return null;\n\n  const originUrl = getOriginUrl(frame);\n  if (originUrl != null) {\n    let path = new URL(originUrl).pathname.split(\"?\")[0] ?? \"\";\n    if (path.startsWith(\"/@fs/\")) {\n      // Absolute path embedded by Vite (e.g. /@fs/C:/d/project/src/foo.ts)\n      path = path.slice(5);\n      if (/^\\/[a-zA-Z]:\\//.test(path)) path = path.slice(1);\n      return `vscode://file/${path}:${frame.line}:${frame.col ?? 1}`;\n    }\n    // Root-relative Vite path (e.g. /src/App.tsx) — needs project root\n    if (projectRoot == null) return null;\n    const normalRoot = projectRoot.replace(/[/\\\\]+$/, \"\").replace(/\\\\/g, \"/\");\n    return `vscode://file/${normalRoot}${path}:${frame.line}:${frame.col ?? 1}`;\n  }\n\n  // No HTTP URL available — use frame.file directly (post-source-map plain path)\n  const filePath = frame.file;\n  if (filePath == null) return null;\n  const normalPath = filePath.replace(/\\\\/g, \"/\");\n  // Windows absolute: C:/path\n  if (/^[a-zA-Z]:\\//.test(normalPath)) {\n    return `vscode://file/${normalPath}:${frame.line}:${frame.col ?? 1}`;\n  }\n  // Leading slash before Windows drive: /c:/path\n  if (/^\\/[a-zA-Z]:\\//.test(normalPath)) {\n    return `vscode://file/${normalPath.slice(1)}:${frame.line}:${frame.col ?? 1}`;\n  }\n  // Unix absolute or root-relative (e.g. /src/App.tsx, /home/user/project/src/foo.ts)\n  if (normalPath.startsWith(\"/\")) {\n    if (projectRoot == null) return null;\n    const normalRoot = projectRoot.replace(/[/\\\\]+$/, \"\").replace(/\\\\/g, \"/\");\n    return `vscode://file/${normalRoot}${normalPath}:${frame.line}:${frame.col ?? 1}`;\n  }\n  // Relative path (e.g. \"App.tsx\", \"../../src/App.tsx\")\n  if (projectRoot == null) return null;\n  const normalRoot = projectRoot.replace(/[/\\\\]+$/, \"\").replace(/\\\\/g, \"/\");\n  return `vscode://file/${normalRoot}/${normalPath}:${frame.line}:${frame.col ?? 1}`;\n}\n\n// ─── Project root setup modal ────────────────────────────────────────────────\n\nfunction ProjectRootSetupModal({\n  envId,\n  currentValue,\n  onSave,\n  onCancel,\n}: {\n  envId: string;\n  currentValue: string;\n  onSave: (path: string) => void;\n  onCancel: () => void;\n}) {\n  const [value, setValue] = useState(currentValue);\n  const inputRef = useRef<HTMLInputElement>(null);\n\n  useEffect(() => {\n    inputRef.current?.focus();\n    inputRef.current?.select();\n  }, []);\n\n  useEffect(() => {\n    const handler = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") onCancel();\n    };\n    window.addEventListener(\"keydown\", handler);\n    return () => window.removeEventListener(\"keydown\", handler);\n  }, [onCancel]);\n\n  const handleSubmit = (e: React.SyntheticEvent<HTMLFormElement>) => {\n    e.preventDefault();\n    const trimmed = value.trim();\n    if (trimmed !== \"\") onSave(trimmed);\n  };\n\n  return (\n    <div\n      style={{\n        position: \"fixed\",\n        inset: 0,\n        zIndex: 2147483647,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n      }}\n    >\n      <div\n        onClick={onCancel}\n        style={{ position: \"absolute\", inset: 0, background: \"rgba(0, 0, 0, 0.72)\" }}\n      />\n      <form\n        onSubmit={handleSubmit}\n        style={{\n          position: \"relative\",\n          background: token(\"tooltipBackground\"),\n          border: `1px solid ${token(\"tooltipBorder\")}`,\n          borderRadius: \"8px\",\n          width: \"420px\",\n          maxWidth: \"90vw\",\n          boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.8)\",\n          overflow: \"hidden\",\n          display: \"flex\",\n          flexDirection: \"column\",\n        }}\n      >\n        {/* Header */}\n        <div\n          style={{\n            background: token(\"tooltipTitleBackground\"),\n            borderBottom: `1px solid ${token(\"tooltipBorder\")}`,\n            padding: \"10px 14px\",\n          }}\n        >\n          <div\n            style={{\n              color: token(\"textEmphasis\"),\n              fontSize: \"12px\",\n              fontWeight: 600,\n              marginBottom: \"2px\",\n            }}\n          >\n            Set project root\n          </div>\n          <div style={{ color: token(\"textMuted\"), fontSize: \"10px\" }}>\n            Runtime:{\" \"}\n            <span\n              style={{\n                color: token(\"semanticSystem\"),\n                fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n              }}\n            >\n              {envId}\n            </span>\n          </div>\n        </div>\n\n        {/* Body */}\n        <div style={{ padding: \"14px\", display: \"flex\", flexDirection: \"column\", gap: \"8px\" }}>\n          <div style={{ color: token(\"textMuted\"), fontSize: \"10px\", lineHeight: 1.4 }}>\n            Provide the absolute path to this project's root so that root-relative source file paths\n            (e.g.{\" \"}\n            <span\n              style={{\n                fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n              }}\n            >\n              src/App.tsx\n            </span>\n            ) can be opened in VS Code.\n          </div>\n          <input\n            ref={inputRef}\n            value={value}\n            onChange={(e) => setValue(e.currentTarget.value)}\n            placeholder=\"e.g. C:/d/nice-code/packages/demo-frontend\"\n            style={{\n              background: DEVTOOL_STACK_TRACE_BACKGROUND,\n              border: `1px solid ${token(\"tooltipBorder\")}`,\n              borderRadius: \"4px\",\n              color: token(\"textSecondary\"),\n              fontSize: \"11px\",\n              fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n              padding: \"7px 9px\",\n              outline: \"none\",\n              width: \"100%\",\n              boxSizing: \"border-box\",\n            }}\n          />\n        </div>\n\n        {/* Footer */}\n        <div\n          style={{\n            display: \"flex\",\n            justifyContent: \"flex-end\",\n            gap: \"8px\",\n            padding: \"10px 14px\",\n            borderTop: `1px solid ${token(\"borderPanel\")}`,\n          }}\n        >\n          <button\n            type=\"button\"\n            onClick={onCancel}\n            style={{\n              background: \"transparent\",\n              border: `1px solid ${token(\"borderPanel\")}`,\n              borderRadius: \"4px\",\n              color: token(\"textMuted\"),\n              fontSize: \"11px\",\n              padding: \"5px 12px\",\n              cursor: \"pointer\",\n            }}\n          >\n            Cancel\n          </button>\n          <button\n            type=\"submit\"\n            disabled={value.trim() === \"\"}\n            style={{\n              background: tokenAlpha(\"semanticSystem\", 0.13),\n              border: `1px solid ${tokenAlpha(\"semanticSystem\", 0.4)}`,\n              borderRadius: \"4px\",\n              color: token(\"semanticSystem\"),\n              fontSize: \"11px\",\n              padding: \"5px 12px\",\n              cursor: value.trim() === \"\" ? \"not-allowed\" : \"pointer\",\n              opacity: value.trim() === \"\" ? 0.5 : 1,\n            }}\n          >\n            Save\n          </button>\n        </div>\n      </form>\n    </div>\n  );\n}\n\n// ─── Open-in-VS Code button ───────────────────────────────────────────────────\n\nfunction OpenInVscodeButton({\n  frame,\n  projectRoot,\n  onNeedSetup,\n}: {\n  frame: IStackFrame;\n  projectRoot: string | null;\n  onNeedSetup: () => void;\n}) {\n  const [hovered, setHovered] = useState(false);\n  const needsSetup = frameNeedsProjectRoot(frame) && projectRoot == null;\n  const url = buildVscodeUrl(frame, projectRoot);\n\n  if (frame.file == null || frame.line == null) return null;\n  if (!needsSetup && url == null) return null;\n\n  const baseStyle: React.CSSProperties = {\n    position: \"absolute\",\n    bottom: \"3px\",\n    right: \"4px\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    width: \"16px\",\n    height: \"16px\",\n    opacity: hovered ? 0.85 : 0.25,\n    transition: \"opacity 0.15s ease\",\n    cursor: \"pointer\",\n    flexShrink: 0,\n  };\n\n  if (needsSetup) {\n    return (\n      <button\n        onClick={(e) => {\n          e.stopPropagation();\n          onNeedSetup();\n        }}\n        onMouseEnter={() => setHovered(true)}\n        onMouseLeave={() => setHovered(false)}\n        title=\"Set project root to open in VS Code\"\n        style={{\n          ...baseStyle,\n          color: token(\"semanticWarning\"),\n          background: \"none\",\n          border: \"none\",\n          padding: 0,\n        }}\n      >\n        <ExternalLink size={10} strokeWidth={1.8} />\n      </button>\n    );\n  }\n\n  return (\n    <a\n      href={url!}\n      onClick={(e) => e.stopPropagation()}\n      onMouseEnter={() => setHovered(true)}\n      onMouseLeave={() => setHovered(false)}\n      title=\"Open in VS Code\"\n      style={{\n        ...baseStyle,\n        color: token(\"textSecondary\"),\n        textDecoration: \"none\",\n      }}\n    >\n      <ExternalLink size={10} strokeWidth={1.8} />\n    </a>\n  );\n}\n\n// ─── Exports ──────────────────────────────────────────────────────────────────\n\nexport function countUserFrames(_runtime: IRuntimeCoordinate, stack: string | undefined): number {\n  if (stack == null) return 0;\n  return parseStackFrames(stack).filter((f) => !f.isInternal).length;\n}\n\nexport function StackTraceSection({\n  label,\n  stack,\n  color = token(\"semanticSystem\"),\n  runtime,\n  minFrameCount,\n}: {\n  label: string;\n  stack: string | undefined;\n  runtime: IRuntimeCoordinate;\n  color?: string;\n  minFrameCount?: number;\n}) {\n  const [showAll, setShowAll] = useState(false);\n  const [resolvedFrames, setResolvedFrames] = useState<IStackFrame[] | null>(null);\n  const [projectRootMap, setProjectRootMap] = useState<Record<TRuntimeCoordinateEnvId, string>>({});\n  const [showSetupModal, setShowSetupModal] = useState(false);\n\n  useEffect(() => {\n    void devtools_storage\n      .getJsonOrDef(\"runtimeToProjectFilePath\", {})\n      .then((map) => setProjectRootMap(map));\n  }, []);\n\n  useEffect(() => {\n    if (stack == null) return;\n    setResolvedFrames(null);\n    const parsed = parseStackFrames(stack);\n    let cancelled = false;\n    resolveSourceMapPositions(parsed).then((frames) => {\n      if (!cancelled) setResolvedFrames(frames);\n    });\n    return () => {\n      cancelled = true;\n    };\n  }, [stack]);\n\n  if (stack == null) return null;\n\n  const allFrames = resolvedFrames ?? parseStackFrames(stack);\n  const userFrames = allFrames.filter((f) => !f.isInternal);\n  const hasInternalFrames = allFrames.length > userFrames.length;\n  const displayFrames = showAll ? allFrames : userFrames;\n  const phantomFrameCount = !showAll ? Math.max(0, (minFrameCount ?? 0) - displayFrames.length) : 0;\n\n  if (allFrames.length === 0) return null;\n\n  const runtimeKey = `envId[${runtime.envId}]` as TRuntimeCoordinateEnvId;\n  const projectRoot = projectRootMap[runtimeKey] ?? null;\n\n  const handleSaveProjectRoot = (path: string) => {\n    setProjectRootMap((prev) => ({ ...prev, [runtimeKey]: path }));\n    setShowSetupModal(false);\n    void devtools_storage.updateJsonWithDef(\"runtimeToProjectFilePath\", {}, (prev) => ({\n      ...prev,\n      [runtimeKey]: path,\n    }));\n  };\n\n  return (\n    <div>\n      <div\n        style={{\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"space-between\",\n          marginBottom: \"3px\",\n        }}\n      >\n        <NiceUiSectionLabel label={label} color={color} />\n        {hasInternalFrames && (\n          <span style={{ color: token(\"textMuted\"), fontSize: \"9px\" }}>\n            {!showAll ? \"user only\" : `all (${allFrames.length})`}\n          </span>\n        )}\n      </div>\n      <div\n        onClick={() => setShowAll((s) => !s)}\n        style={{\n          background: DEVTOOL_STACK_TRACE_BACKGROUND,\n          borderRadius: \"4px\",\n          padding: \"2px\",\n          overflow: \"hidden\",\n          cursor: \"pointer\",\n        }}\n      >\n        {displayFrames.length === 0 ? (\n          <div\n            style={{\n              padding: \"6px 10px\",\n              color: token(\"textMuted\"),\n              fontSize: \"10px\",\n              fontStyle: \"italic\",\n            }}\n          >\n            no user frames captured\n          </div>\n        ) : (\n          displayFrames.map((frame, idx) => {\n            const displayFile = formatFrameFile(frame.file);\n            const slashIdx = displayFile.lastIndexOf(\"/\");\n            const folderPrefix = slashIdx >= 0 ? displayFile.slice(0, slashIdx + 1) : \"\";\n            const bareFilename = slashIdx >= 0 ? displayFile.slice(slashIdx + 1) : displayFile;\n            const titleStr = frame.file != null ? frame.file : frame.raw;\n            const isUser = !frame.isInternal;\n            return (\n              <div\n                key={frame.raw}\n                title={titleStr}\n                style={{\n                  position: \"relative\",\n                  display: \"flex\",\n                  flexDirection: \"row\",\n                  gap: \"0.5em\",\n                  padding: \"4px\",\n                  paddingRight: \"22px\",\n                  borderBottom: `1px solid ${token(\"surfaceBase\")}`,\n                }}\n              >\n                <span\n                  style={{\n                    color: isUser\n                      ? DEVTOOL_STACK_FRAME_USER_NUMBER\n                      : DEVTOOL_STACK_FRAME_INTERNAL_NUMBER,\n                    fontSize: \"10px\",\n                    minWidth: \"10px\",\n                    textAlign: \"left\",\n                    flexShrink: 0,\n                    fontVariantNumeric: \"tabular-nums\",\n                  }}\n                >\n                  {idx + 1}\n                </span>\n                <div\n                  style={{\n                    display: \"flex\",\n                    flexDirection: \"column\",\n                    gap: \"0.15em\",\n                    lineHeight: 1.2,\n                  }}\n                >\n                  <div style={{ display: \"flex\", alignItems: \"center\" }}>\n                    <span\n                      style={{\n                        color: isUser\n                          ? DEVTOOL_STACK_FRAME_USER_FUNCTION\n                          : DEVTOOL_STACK_FRAME_INTERNAL_FUNCTION,\n                        fontSize: \"12px\",\n                        fontWeight: 500,\n                        overflow: \"hidden\",\n                        textOverflow: \"ellipsis\",\n                        whiteSpace: \"nowrap\",\n                      }}\n                    >\n                      {frame.fn ?? \"(anonymous)\"}\n                    </span>\n                  </div>\n                  <div style={{ display: \"flex\", alignItems: \"baseline\", overflow: \"hidden\" }}>\n                    {folderPrefix !== \"\" && (\n                      <span\n                        style={{\n                          color: isUser\n                            ? DEVTOOL_STACK_FRAME_USER_FOLDER\n                            : DEVTOOL_STACK_FRAME_INTERNAL_FOLDER,\n                          fontSize: \"10px\",\n                          overflow: \"hidden\",\n                          textOverflow: \"ellipsis\",\n                          whiteSpace: \"nowrap\",\n                          flexShrink: 1,\n                          minWidth: 0,\n                        }}\n                      >\n                        {folderPrefix}\n                      </span>\n                    )}\n                    <span\n                      style={{\n                        color: isUser\n                          ? DEVTOOL_STACK_FRAME_USER_FILE\n                          : DEVTOOL_STACK_FRAME_INTERNAL_FILE,\n                        fontSize: \"10px\",\n                        whiteSpace: \"nowrap\",\n                        flexShrink: 0,\n                      }}\n                    >\n                      {bareFilename}\n                    </span>\n                    {frame.line != null && (\n                      <span\n                        style={{\n                          color: isUser\n                            ? DEVTOOL_STACK_FRAME_USER_LINE\n                            : DEVTOOL_STACK_FRAME_INTERNAL_LINE,\n                          fontSize: \"10px\",\n                          whiteSpace: \"nowrap\",\n                          flexShrink: 0,\n                          fontVariantNumeric: \"tabular-nums\",\n                        }}\n                      >\n                        :{frame.line}\n                      </span>\n                    )}\n                  </div>\n                </div>\n                <OpenInVscodeButton\n                  frame={frame}\n                  projectRoot={projectRoot}\n                  onNeedSetup={() => setShowSetupModal(true)}\n                />\n              </div>\n            );\n          })\n        )}\n        {Array.from({ length: phantomFrameCount }, (_, i) => i).map((i) => (\n          <div\n            key={`phantom-${i}`}\n            aria-hidden=\"true\"\n            style={{\n              visibility: \"hidden\",\n              display: \"flex\",\n              flexDirection: \"row\",\n              gap: \"0.5em\",\n              padding: \"4px\",\n              borderBottom: `1px solid ${token(\"surfaceBase\")}`,\n            }}\n          >\n            <span style={{ fontSize: \"10px\", minWidth: \"10px\", flexShrink: 0 }}>0</span>\n            <div\n              style={{ display: \"flex\", flexDirection: \"column\", gap: \"0.15em\", lineHeight: 1.2 }}\n            >\n              <div style={{ fontSize: \"12px\" }}>placeholder</div>\n              <div style={{ fontSize: \"10px\" }}>placeholder/file.ts:1</div>\n            </div>\n          </div>\n        ))}\n      </div>\n\n      {showSetupModal && (\n        <ProjectRootSetupModal\n          envId={runtime.envId}\n          currentValue={projectRoot ?? \"\"}\n          onSave={handleSaveProjectRoot}\n          onCancel={() => setShowSetupModal(false)}\n        />\n      )}\n    </div>\n  );\n}\n","import { token } from \"@nice-code/ui\";\nimport type { IRuntimeCoordinate } from \"@nice-code/wire\";\nimport type { IDevtoolsActionEntry } from \"../../core/ActionDevtools.types\";\nimport { DetailSection } from \"./DetailSection\";\nimport { isNiceErrorJson, NiceErrorDisplay } from \"./NiceErrorDisplay\";\nimport { StackTraceSection } from \"./StackTraceSection\";\n\nconst MONO = \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\";\nconst SANS = \"ui-sans-serif, system-ui, -apple-system, sans-serif\";\n\nfunction FullErrorContent({\n  label,\n  error,\n  errorStack,\n  color,\n  runtime,\n}: {\n  label: string;\n  error: unknown;\n  errorStack: string | undefined;\n  color: string;\n  runtime: IRuntimeCoordinate;\n}) {\n  return (\n    <>\n      {isNiceErrorJson(error) ? (\n        <NiceErrorDisplay error={error} label={label} color={color} />\n      ) : (\n        <DetailSection label={label} value={error} color={color} />\n      )}\n      <StackTraceSection runtime={runtime} label=\"Error Stack\" stack={errorStack} color={color} />\n    </>\n  );\n}\n\nfunction CompactErrorContent({ value, color }: { value: unknown; color: string }) {\n  if (isNiceErrorJson(value)) {\n    return (\n      <div\n        style={{\n          display: \"flex\",\n          flexDirection: \"column\",\n          gap: \"1em\",\n          width: \"100%\",\n          minWidth: 0,\n        }}\n      >\n        <div\n          style={{\n            color,\n            fontFamily: SANS,\n            fontSize: \"12px\",\n            fontWeight: 600,\n            lineHeight: \"1.4\",\n            wordBreak: \"break-word\",\n            overflowWrap: \"anywhere\",\n            textAlign: \"left\",\n          }}\n        >\n          {value.message}\n        </div>\n        <div\n          style={{\n            display: \"flex\",\n            flexWrap: \"wrap\",\n            gap: \"6px\",\n            alignItems: \"center\",\n            minWidth: 0,\n          }}\n        >\n          {value.ids.map((id) => (\n            <span\n              key={id}\n              style={{\n                color,\n                fontFamily: MONO,\n                fontSize: \"10px\",\n                opacity: 0.8,\n                wordBreak: \"break-word\",\n                overflowWrap: \"anywhere\",\n              }}\n            >\n              {id}\n            </span>\n          ))}\n          <span\n            style={{\n              color: token(\"textMuted\"),\n              fontFamily: MONO,\n              fontSize: \"10px\",\n              wordBreak: \"break-word\",\n              overflowWrap: \"anywhere\",\n            }}\n          >\n            {value.def.domain}\n          </span>\n        </div>\n      </div>\n    );\n  }\n\n  const text = typeof value === \"string\" ? value : value != null ? String(value) : null;\n  if (text == null) return null;\n  return (\n    <div\n      style={{\n        color,\n        fontFamily: SANS,\n        fontSize: \"12px\",\n        lineHeight: \"1.4\",\n        wordBreak: \"break-word\",\n        overflowWrap: \"anywhere\",\n      }}\n    >\n      {text}\n    </div>\n  );\n}\n\n// ─── Public component ─────────────────────────────────────────────────────────\n\nexport function ActionErrorDisplay({\n  entry,\n  compact,\n}: {\n  entry: IDevtoolsActionEntry;\n  compact?: boolean;\n}) {\n  const { status, error, abortReason, errorStack } = entry;\n\n  if (status === \"action-error\") {\n    const color = token(\"semanticError\");\n    if (compact) return <CompactErrorContent value={error} color={color} />;\n    // Distinguish a declared (expected) error from an undeclared / unhandled one.\n    const label =\n      entry.expected === true\n        ? \"Expected Error (declared)\"\n        : entry.expected === false\n          ? \"Unexpected Error (undeclared / unhandled)\"\n          : \"Action Error\";\n    return (\n      <FullErrorContent\n        runtime={entry.meta.originClient}\n        label={label}\n        error={error}\n        errorStack={errorStack}\n        color={color}\n      />\n    );\n  }\n\n  if (status === \"failed\") {\n    const color = token(\"semanticError\");\n    if (compact) return <CompactErrorContent value={error} color={color} />;\n    return (\n      <FullErrorContent\n        runtime={entry.meta.originClient}\n        label=\"Error\"\n        error={error}\n        errorStack={errorStack}\n        color={color}\n      />\n    );\n  }\n\n  if (status === \"aborted\") {\n    const color = token(\"semanticMetadata\");\n    if (compact) return <CompactErrorContent value={abortReason} color={color} />;\n    return (\n      <>\n        {abortReason != null &&\n          (isNiceErrorJson(abortReason) ? (\n            <NiceErrorDisplay error={abortReason} label=\"Abort Reason\" color={color} />\n          ) : (\n            <DetailSection label=\"Abort Reason\" value={abortReason} color={color} />\n          ))}\n        <StackTraceSection\n          runtime={entry.meta.originClient}\n          label=\"Abort Stack\"\n          stack={errorStack}\n          color={color}\n        />\n      </>\n    );\n  }\n\n  return null;\n}\n","import { ESize, type INiceUiTooltipConfig, NiceUiChip } from \"@nice-code/ui\";\nimport type { ReactNode } from \"react\";\nimport { type ESemanticThing, SEMANTIC_COLORS } from \"../../core/devtools_colors\";\n\n// The generic chip now lives in nice-devtools-shared; this wrapper keeps the\n// action suite's semantic-token API (what a chip *means* is suite-specific —\n// the shared component only knows about resolved colours).\n\ninterface IChipProps {\n  color: ESemanticThing;\n  subtle?: boolean;\n  size?: ESize;\n  pill?: boolean;\n  tooltip?: INiceUiTooltipConfig;\n  children: ReactNode;\n}\n\nexport function Chip({ color, ...rest }: IChipProps) {\n  return <NiceUiChip colorEntry={SEMANTIC_COLORS[color]} {...rest} />;\n}\n","import { type INiceUiTooltipConfig, NiceUiTooltipSurface } from \"@nice-code/ui\";\nimport type { LucideIcon } from \"lucide-react\";\nimport type { CSSProperties } from \"react\";\nimport { useState } from \"react\";\nimport { type ESemanticThing, SEMANTIC_COLORS } from \"../../core/devtools_colors\";\nimport { ESize, getSizeValue } from \"../ui_util/size\";\n\ninterface IIconProps {\n  icon: LucideIcon | LucideIcon[];\n  color: ESemanticThing;\n  size?: ESize;\n  subtle?: boolean;\n  tooltip?: INiceUiTooltipConfig;\n  style?: CSSProperties;\n  noBackground?: boolean;\n}\n\nconst BASE_ICON_SIDE_LENGTH_EM = 1.6; // in em, based on visual tuning\nconst ICON_GAP_EM = 0.3; // gap between icons when multiple are shown, in em\n\nexport function Icon({\n  icon: IconComponent,\n  color,\n  size = ESize.md,\n  subtle = false,\n  tooltip,\n  style,\n  noBackground = false,\n}: IIconProps) {\n  const [anchor, setAnchor] = useState<DOMRect | null>(null);\n  const hasTooltip = tooltip != null;\n  const colorEntry = SEMANTIC_COLORS[color];\n  const resolvedColor = subtle ? (colorEntry.subtle?.color ?? colorEntry.color) : colorEntry.color;\n\n  const finalIcons = Array.isArray(IconComponent) ? IconComponent : [IconComponent];\n  const fullIconWidthEm =\n    (finalIcons.length - 1) * ICON_GAP_EM +\n    finalIcons.length * BASE_ICON_SIDE_LENGTH_EM * getSizeValue(size);\n\n  const iconSideLengthEm = `${BASE_ICON_SIDE_LENGTH_EM * getSizeValue(size)}em`;\n\n  return (\n    <>\n      <div\n        onMouseEnter={\n          hasTooltip ? (e) => setAnchor(e.currentTarget.getBoundingClientRect()) : undefined\n        }\n        onMouseLeave={hasTooltip ? () => setAnchor(null) : undefined}\n        style={{\n          borderRadius: \"0.4em\",\n          width: `${fullIconWidthEm}em`,\n          height: iconSideLengthEm,\n          padding: \"0.15em\",\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"center\",\n          background: noBackground ? \"none\" : \"rgba(0,0,0,0.4)\",\n          color: resolvedColor,\n          flexShrink: 0,\n          cursor: hasTooltip ? \"default\" : undefined,\n          ...style,\n        }}\n      >\n        <div style={{ display: \"flex\", alignItems: \"center\", gap: `${ICON_GAP_EM}em` }}>\n          {finalIcons.map((Comp, i) => (\n            <Comp key={`${Comp.name}-${i}`} size={iconSideLengthEm} strokeWidth={2.6} />\n          ))}\n        </div>\n      </div>\n      {anchor != null && hasTooltip && <NiceUiTooltipSurface anchor={anchor} config={tooltip} />}\n    </>\n  );\n}\n","import { token } from \"@nice-code/ui\";\nimport { Component } from \"lucide-react\";\nimport { HexMark } from \"nice-devtools-shared\";\nimport { ESemanticThing } from \"../../core/devtools_colors\";\nimport { ESize } from \"../ui_util/size\";\nimport { Chip } from \"./Chip\";\nimport { Icon } from \"./Icon\";\n\nfunction DomainHierarchyContent({ allDomains }: { allDomains: string[] }) {\n  return (\n    <>\n      {allDomains.map((d, i) => {\n        const isCurrent = i === allDomains.length - 1;\n        return (\n          <div\n            key={d}\n            style={{\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: \"0.3rem\",\n              paddingLeft: `${i * 10}px`,\n              paddingTop: i > 0 ? \"0.1rem\" : undefined,\n            }}\n          >\n            <span\n              style={{\n                fontSize: \"0.8rem\",\n                height: \"0.6em\",\n                width: \"0.6em\",\n                overflow: \"hidden\",\n                color: isCurrent ? token(\"semanticSystem\") : \"#3730a3\",\n                display: \"flex\",\n                alignItems: \"center\",\n                justifyContent: \"center\",\n              }}\n            >\n              <HexMark />\n            </span>\n            <span\n              style={{\n                color: isCurrent ? token(\"semanticSystem\") : \"#4b5563\",\n                fontSize: \"0.7rem\",\n                fontWeight: isCurrent ? 500 : undefined,\n              }}\n            >\n              {d}\n            </span>\n          </div>\n        );\n      })}\n    </>\n  );\n}\n\nexport function DomainChip({\n  compact = false,\n  subtle = false,\n  domain,\n  allDomains,\n  size,\n}: {\n  compact?: boolean;\n  subtle?: boolean;\n  domain: string;\n  allDomains: string[];\n  size?: ESize;\n}) {\n  if (compact) {\n    return (\n      <Icon\n        icon={Component}\n        color={ESemanticThing.domain}\n        tooltip={{\n          content: <DomainHierarchyContent allDomains={allDomains} />,\n          title: \"Action Domain\",\n          align: \"edge\",\n        }}\n      />\n    );\n  }\n  return (\n    <Chip\n      color={ESemanticThing.domain}\n      subtle={subtle}\n      size={size}\n      pill\n      tooltip={{\n        content: <DomainHierarchyContent allDomains={allDomains} />,\n        title: \"Action Domain\",\n        align: \"edge\",\n      }}\n      // style={{ display: \"flex\", alignItems: \"center\", gap: \"0.4em\" }}\n    >\n      <div style={{ display: \"flex\", alignItems: \"center\", gap: \"0.4em\" }}>\n        <span\n          style={{\n            height: \"1.2em\",\n            width: \"1.2em\",\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"center\",\n          }}\n        >\n          <Component height={\"1.2em\"} width={\"1.2em\"} />\n        </span>\n        <span>{domain}</span>\n      </div>\n    </Chip>\n  );\n}\n","import type { INiceUiTooltipConfig } from \"@nice-code/ui\";\nimport { token } from \"@nice-code/ui\";\nimport type { IDevtoolsActionEntry, IDevtoolsRouteItem } from \"../../core/ActionDevtools.types\";\nimport { ESemanticThing } from \"../../core/devtools_colors\";\nimport { ESize } from \"../ui_util/size\";\nimport { Chip } from \"./Chip\";\n\nexport function getExternalLabel(hop: IDevtoolsRouteItem): string | null {\n  if (hop.handlerType !== \"peer\") return null;\n  return hop.handlerClient != null\n    ? `${hop.transport ?? \"ext\"} -> ${hop.handlerClient.envId}`\n    : `-> ${hop.transport ?? \"ext\"}`;\n}\n\n/**\n * Extended transport details (request/WebSocket endpoint) for the external handler — shown on hover\n * only, so the chip/label itself stays short.\n */\nexport function getTransportTooltip(hop: IDevtoolsRouteItem): INiceUiTooltipConfig | undefined {\n  return getTransportTooltipForHops([hop]);\n}\n\n/**\n * Aggregate transport tooltip for a chip/label that represents one or more external hops (e.g. a\n * grouped child-dispatch chip that accumulates several transports for the same runtime).\n */\nexport function getTransportTooltipForHops(\n  hops: IDevtoolsRouteItem[],\n): INiceUiTooltipConfig | undefined {\n  const lines = hops\n    .filter((hop) => hop.handlerType === \"peer\")\n    .map((hop) => ({ summary: hop.transportSummary, url: hop.transportUrl }))\n    .filter((line) => line.summary != null || line.url != null);\n\n  if (lines.length === 0) return undefined;\n\n  return {\n    title: \"Transport\",\n    content: (\n      <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"6px\", fontSize: \"11px\" }}>\n        {lines.map((line) => (\n          <div\n            key={`${line.summary ?? \"\"}:${line.url ?? \"\"}`}\n            style={{ display: \"flex\", flexDirection: \"column\", gap: \"2px\" }}\n          >\n            {line.summary != null && <span>{line.summary}</span>}\n            {line.url != null && line.url !== line.summary && (\n              <span style={{ color: token(\"textMuted\"), wordBreak: \"break-all\" }}>{line.url}</span>\n            )}\n          </div>\n        ))}\n      </div>\n    ),\n  };\n}\n\ninterface IHandlerChipsProps {\n  entry: IDevtoolsActionEntry;\n  size: ESize;\n  subtle?: boolean;\n}\n\nexport function HandlerChips({ entry, size, subtle }: IHandlerChipsProps) {\n  const firstHop = entry.meta.routing[0];\n  const localEnvId = firstHop != null ? firstHop.runtime.envId : null;\n  const externalLabel = firstHop != null ? getExternalLabel(firstHop) : null;\n  const firstHopIsLocal = firstHop != null && firstHop.handlerType === \"local\";\n\n  return (\n    <>\n      {localEnvId != null && (firstHopIsLocal || externalLabel == null) && (\n        <Chip color={ESemanticThing.handler_local} size={size} subtle={subtle}>\n          {localEnvId}\n        </Chip>\n      )}\n      {externalLabel != null && (\n        <Chip\n          color={ESemanticThing.handler_external}\n          size={size}\n          subtle={subtle}\n          tooltip={firstHop != null ? getTransportTooltip(firstHop) : undefined}\n        >\n          {externalLabel}\n        </Chip>\n      )}\n    </>\n  );\n}\n","import { type INiceUiTooltipConfig, NiceUiTooltip } from \"@nice-code/ui\";\nimport type { CSSProperties, ReactNode } from \"react\";\n\n/**\n * `NiceUiTooltip` with the two conveniences these panels lean on: a nullable config (routing\n * metadata is often absent) and a styled, focusable trigger span.\n */\nexport function OptionalTooltip({\n  config,\n  style,\n  children,\n}: {\n  config?: INiceUiTooltipConfig;\n  style?: CSSProperties;\n  children: ReactNode;\n}): React.JSX.Element {\n  const body = (\n    <span style={style} tabIndex={config == null ? undefined : 0}>\n      {children}\n    </span>\n  );\n  return config != null ? <NiceUiTooltip config={config}>{body}</NiceUiTooltip> : body;\n}\n","import { token } from \"@nice-code/ui\";\nimport { Circle, CircleAlert, CircleCheck, CircleX, Loader2, type LucideIcon } from \"lucide-react\";\nimport type { IDevtoolsActionEntry, TDevtoolsActionStatus } from \"../../core/ActionDevtools.types\";\nimport { ESemanticThing } from \"../../core/devtools_colors\";\n\n// Re-exported from the shared devtools package so existing imports from this\n// module keep working.\nexport { formatRelativeAge, formatTimestamp, safeStringify } from \"nice-devtools-shared\";\n\n// CSS colour strings for inline styles — resolved from the 5 semantic tokens.\nexport const STATUS_COLOR: Record<TDevtoolsActionStatus, string> = {\n  running: token(\"semanticSystem\"),\n  success: token(\"semanticSuccess\"),\n  \"action-error\": token(\"semanticWarning\"),\n  failed: token(\"semanticError\"),\n  aborted: token(\"semanticMetadata\"),\n};\n\n// ESemanticThing values for Chip / Icon components that resolve via SEMANTIC_COLORS.\nexport const STATUS_THING: Record<TDevtoolsActionStatus, ESemanticThing> = {\n  running: ESemanticThing.running_action,\n  success: ESemanticThing.success,\n  \"action-error\": ESemanticThing.action_error,\n  failed: ESemanticThing.failed,\n  aborted: ESemanticThing.aborted,\n};\n\n// Text fallbacks — keep for tooltip prose only; prefer STATUS_ICON for visual indicators.\nexport const STATUS_SYMBOL: Record<TDevtoolsActionStatus, string> = {\n  running: \"•\",\n  success: \"✓\",\n  \"action-error\": \"!\",\n  failed: \"✗\",\n  aborted: \"·\",\n};\n\nexport const STATUS_ICON: Record<TDevtoolsActionStatus, LucideIcon> = {\n  running: Loader2,\n  success: CircleCheck,\n  \"action-error\": CircleAlert,\n  failed: CircleX,\n  aborted: Circle,\n};\n\n/**\n * The runtime an action *originated* on, when that differs from the runtime that handled it — i.e. an\n * inbound action received over a transport (a backend push, or an action relayed from another client),\n * rather than one dispatched locally. Returns `null` for locally-originated actions (where the origin\n * matches the handling runtime) and for actions with no known origin.\n */\nexport function getInboundOrigin(\n  entry: IDevtoolsActionEntry,\n): { envId: string; perId?: string; insId?: string } | null {\n  const origin = entry.meta.originClient;\n  if (origin == null || origin.envId === \"unknown\" || origin.envId === \"_unset_\") return null;\n\n  // The first routing hop's runtime is the one that received/handled the action locally.\n  const local = entry.meta.routing[0]?.runtime;\n  if (local == null) return null;\n\n  const sameRuntime =\n    origin.envId === local.envId &&\n    (origin.perId ?? null) === (local.perId ?? null) &&\n    (origin.insId ?? null) === (local.insId ?? null);\n\n  return sameRuntime ? null : origin;\n}\n\nexport function formatDuration(entry: IDevtoolsActionEntry): string | null {\n  return entry.endTime != null ? `${entry.endTime - entry.startTime}ms` : null;\n}\n","import { useEffect, useState } from \"react\";\nimport type { IDevtoolsActionEntry } from \"../../core/ActionDevtools.types\";\nimport { formatDuration } from \"./utils\";\n\nexport function RunningTimer({ startTime }: { startTime: number }) {\n  const [elapsed, setElapsed] = useState(() => Date.now() - startTime);\n\n  useEffect(() => {\n    const interval = setInterval(() => setElapsed(Date.now() - startTime), 100);\n    return () => clearInterval(interval);\n  }, [startTime]);\n\n  return <>{elapsed}ms</>;\n}\n\nexport function DurationDisplay({ entry }: { entry: IDevtoolsActionEntry }) {\n  const d = formatDuration(entry);\n  return <>{d ?? <RunningTimer startTime={entry.startTime} />}</>;\n}\n","import { token } from \"@nice-code/ui\";\nimport { ArrowMark } from \"nice-devtools-shared\";\nimport type { IDevtoolsActionEntry } from \"../../core/ActionDevtools.types\";\nimport {\n  DEVTOOL_COLOR_CALL_STACK_DIVIDER,\n  DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT,\n  DEVTOOL_COLOR_HANDLER_LOCAL_TEXT,\n} from \"../../core/devtools_colors\";\nimport { ESize } from \"../ui_util/size\";\nimport { DomainChip } from \"./DomainChip\";\nimport { getExternalLabel, getTransportTooltip } from \"./HandlerChips\";\nimport { OptionalTooltip } from \"./OptionalTooltip\";\nimport { DurationDisplay } from \"./RunningTimer\";\nimport { STATUS_COLOR, STATUS_ICON } from \"./utils\";\n\nfunction getCalledLabel(entry: IDevtoolsActionEntry): string {\n  const firstHop = entry.meta.routing[0];\n  if (firstHop == null) return \"call\";\n  if (firstHop.handlerType === \"local\") return \"local\";\n  const label = getExternalLabel(firstHop);\n  return label != null ? label : \"call\";\n}\n\nfunction getCalledColor(entry: IDevtoolsActionEntry): string {\n  const firstHop = entry.meta.routing[0];\n  if (firstHop == null) return token(\"semanticSystem\");\n  if (firstHop.handlerType === \"local\") return DEVTOOL_COLOR_HANDLER_LOCAL_TEXT;\n  return DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT;\n}\n\nfunction CallStackLink({\n  entry,\n  entryRole,\n  isFocused,\n  onClick,\n}: {\n  entry: IDevtoolsActionEntry;\n  entryRole: \"caller\" | \"called\";\n  isFocused: boolean;\n  onClick: () => void;\n}) {\n  const color = STATUS_COLOR[entry.status];\n  const StatusIconComponent = STATUS_ICON[entry.status];\n\n  const labelColor = entryRole === \"caller\" ? token(\"textSecondary\") : getCalledColor(entry);\n  const label = entryRole === \"caller\" ? \"from\" : getCalledLabel(entry);\n\n  const firstHop = entry.meta.routing[0];\n  const transportTooltip =\n    entryRole === \"called\" && firstHop != null ? getTransportTooltip(firstHop) : undefined;\n\n  return (\n    <div\n      onClick={onClick}\n      style={{\n        background: isFocused ? token(\"surfaceSection\") : token(\"surfaceDetailHeader\"),\n        borderBottom: `1px solid ${DEVTOOL_COLOR_CALL_STACK_DIVIDER}`,\n        borderLeft: isFocused ? `2px solid ${token(\"semanticSystem\")}` : \"2px solid transparent\",\n        padding: \"5px 12px 5px 10px\",\n        display: \"grid\",\n        gridTemplateColumns: \"1fr 1fr\",\n        alignItems: \"center\",\n        columnGap: \"6px\",\n        cursor: \"pointer\",\n      }}\n    >\n      {/* Status symbol + relationship hint */}\n      <span style={{ display: \"flex\", alignItems: \"center\", gap: \"1em\", flexShrink: 0 }}>\n        <span\n          style={{ color, fontSize: \"10px\", flexShrink: 0, display: \"flex\", alignItems: \"center\" }}\n        >\n          <StatusIconComponent size={10} strokeWidth={2} />\n        </span>\n        <OptionalTooltip config={transportTooltip} style={{ flexShrink: 0, display: \"flex\" }}>\n          <span style={{ color: labelColor, fontSize: \"9px\" }}>\n            <ArrowMark\n              kind={entryRole === \"caller\" ? \"up\" : \"branch\"}\n              style={{ marginRight: \"2px\" }}\n            />\n            {label}\n          </span>\n        </OptionalTooltip>\n        <span style={{ display: \"flex\", alignItems: \"center\", gap: \"5px\" }}>\n          <span\n            style={{\n              color: token(\"textSecondary\"),\n              fontSize: \"11px\",\n              overflow: \"hidden\",\n              textOverflow: \"ellipsis\",\n              whiteSpace: \"nowrap\",\n            }}\n          >\n            {entry.actionId}\n          </span>\n          <DomainChip domain={entry.domain} allDomains={entry.allDomains} size={ESize.sm} />\n        </span>\n      </span>\n\n      {/* Duration */}\n      <span\n        style={{\n          color: token(\"textFaint\"),\n          fontSize: \"10px\",\n          textAlign: \"right\",\n          whiteSpace: \"nowrap\",\n        }}\n      >\n        <DurationDisplay entry={entry} />\n      </span>\n    </div>\n  );\n}\n\nexport function CallStackSection({\n  parent,\n  childEntries,\n  focusedChildCuid,\n  onFocusChild,\n  onSelectParent,\n}: {\n  parent: IDevtoolsActionEntry | null;\n  childEntries: IDevtoolsActionEntry[];\n  focusedChildCuid: string | null;\n  onFocusChild: (cuid: string) => void;\n  onSelectParent: (cuid: string) => void;\n}) {\n  if (parent == null && childEntries.length === 0) return null;\n\n  return (\n    <div>\n      {parent != null && (\n        <CallStackLink\n          entry={parent}\n          entryRole=\"caller\"\n          isFocused={false}\n          onClick={() => onSelectParent(parent.cuid)}\n        />\n      )}\n      {childEntries.map((child) => (\n        <CallStackLink\n          key={child.cuid}\n          entry={child}\n          entryRole=\"called\"\n          isFocused={focusedChildCuid === child.cuid}\n          onClick={() => onFocusChild(child.cuid)}\n        />\n      ))}\n    </div>\n  );\n}\n","import type { IDevtoolsRouteItem } from \"../../core/ActionDevtools.types\";\nimport { ESemanticThing } from \"../../core/devtools_colors\";\nimport { ESize } from \"../ui_util/size\";\nimport { Chip } from \"./Chip\";\nimport { getTransportTooltipForHops } from \"./HandlerChips\";\n\nexport function ChildDispatchChips({\n  childRouteItems,\n  size = ESize.sm,\n}: {\n  childRouteItems?: IDevtoolsRouteItem[];\n  size?: ESize;\n}) {\n  if (childRouteItems == null || childRouteItems.length === 0) return null;\n\n  // Group by external runtime (handlerClient.envId), accumulating transports + their hops\n  const groups = new Map<\n    string,\n    { runtimeId: string; transports: string[]; hasClient: boolean; hops: IDevtoolsRouteItem[] }\n  >();\n  for (const item of childRouteItems) {\n    const runtimeId = item.handlerClient?.envId ?? item.transport ?? \"ext\";\n    const hasClient = item.handlerClient != null;\n    if (!groups.has(runtimeId)) {\n      groups.set(runtimeId, { runtimeId, transports: [], hasClient, hops: [] });\n    }\n    const group = groups.get(runtimeId)!;\n    group.hops.push(item);\n    const transport = item.transport;\n    if (transport != null && !group.transports.includes(transport)) {\n      group.transports.push(transport);\n    }\n  }\n\n  return (\n    <div style={{ display: \"flex\", alignItems: \"center\", gap: \"4px\", flexWrap: \"wrap\" }}>\n      {Array.from(groups.values()).map((group) => {\n        const transportStr = group.transports.length > 0 ? group.transports.join(\", \") : \"ext\";\n        const label = group.hasClient\n          ? `${transportStr} -> ${group.runtimeId}`\n          : `-> ${transportStr}`;\n        return (\n          <Chip\n            key={group.runtimeId}\n            color={ESemanticThing.handler_external}\n            size={size}\n            tooltip={getTransportTooltipForHops(group.hops)}\n          >\n            {label}\n          </Chip>\n        );\n      })}\n    </div>\n  );\n}\n","import { token } from \"@nice-code/ui\";\nimport { CaretMark } from \"nice-devtools-shared\";\nimport { useState } from \"react\";\nimport type { IDevtoolsActionEntry } from \"../../core/ActionDevtools.types\";\n\nfunction MetaChip({ label, value }: { label: string; value: string }) {\n  return (\n    <span style={{ whiteSpace: \"nowrap\" }}>\n      <span style={{ color: token(\"textMuted\") }}>{label} </span>\n      <span style={{ color: token(\"textSecondary\") }}>{value}</span>\n    </span>\n  );\n}\n\nexport function MetaSection({ entry }: { entry: IDevtoolsActionEntry }) {\n  const [expanded, setExpanded] = useState(false);\n  const { meta, cuid } = entry;\n\n  const expandedRows: { label: string; value: string }[] = [\n    { label: \"cuid\", value: cuid },\n    { label: \"runtime\", value: meta.originClient.envId },\n    ...(meta.originClient.perId != null\n      ? [{ label: \"perId\", value: meta.originClient.perId }]\n      : []),\n    ...(meta.originClient.insId != null\n      ? [{ label: \"insId\", value: meta.originClient.insId }]\n      : []),\n  ];\n\n  return (\n    <div>\n      <div\n        style={{\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"space-between\",\n          marginBottom: \"3px\",\n        }}\n      >\n        <div\n          style={{\n            color: token(\"semanticSystem\"),\n            fontSize: \"10px\",\n            textTransform: \"uppercase\",\n            letterSpacing: \"0.05em\",\n          }}\n        >\n          Meta\n        </div>\n        <span style={{ color: token(\"textFaint\"), fontSize: \"11px\" }}>\n          <CaretMark expanded={expanded} />\n        </span>\n      </div>\n      {expanded ? (\n        <div\n          onClick={() => setExpanded(false)}\n          style={{\n            background: token(\"surfaceSection\"),\n            borderRadius: \"4px\",\n            overflow: \"hidden\",\n            cursor: \"pointer\",\n          }}\n        >\n          {expandedRows.map(({ label, value }, i) => (\n            <div\n              key={label}\n              style={{\n                display: \"grid\",\n                gridTemplateColumns: \"52px 1fr\",\n                columnGap: \"8px\",\n                padding: \"4px 8px\",\n                borderBottom:\n                  i < expandedRows.length - 1 ? `1px solid ${token(\"surfaceBase\")}` : \"none\",\n                alignItems: \"start\",\n              }}\n            >\n              <span\n                style={{\n                  textAlign: \"left\",\n                  color: token(\"textMuted\"),\n                  fontSize: \"10px\",\n                  paddingTop: \"1px\",\n                }}\n              >\n                {label}\n              </span>\n              <span\n                style={{\n                  textAlign: \"left\",\n                  color: token(\"textSecondary\"),\n                  fontSize: \"11px\",\n                  wordBreak: \"break-all\",\n                }}\n              >\n                {value}\n              </span>\n            </div>\n          ))}\n        </div>\n      ) : (\n        <div\n          onClick={() => setExpanded(true)}\n          style={{\n            background: token(\"surfaceSection\"),\n            borderRadius: \"4px\",\n            padding: \"5px 8px\",\n            fontSize: \"11px\",\n            display: \"flex\",\n            gap: \"10px\",\n            rowGap: \"2px\",\n            flexWrap: \"wrap\",\n            cursor: \"pointer\",\n          }}\n        >\n          <MetaChip label=\"cuid\" value={`…${cuid.slice(-8)}`} />\n          <MetaChip label=\"runtime\" value={meta.originClient.envId} />\n          {meta.originClient.perId != null && (\n            <MetaChip\n              label=\"perId\"\n              value={\n                meta.originClient.perId.length > 10\n                  ? `${meta.originClient.perId.slice(0, 10)}…`\n                  : meta.originClient.perId\n              }\n            />\n          )}\n          {meta.originClient.insId != null && (\n            <MetaChip\n              label=\"insId\"\n              value={\n                meta.originClient.insId.length > 10\n                  ? `${meta.originClient.insId.slice(0, 10)}…`\n                  : meta.originClient.insId\n              }\n            />\n          )}\n        </div>\n      )}\n    </div>\n  );\n}\n","import { ArrowMark } from \"nice-devtools-shared\";\nimport { ESemanticThing } from \"../../core/devtools_colors\";\nimport { ESize } from \"../ui_util/size\";\nimport { Chip } from \"./Chip\";\n\n/**\n * Marks an action that was received from another runtime (a backend push, or an action relayed from\n * another client) rather than dispatched locally. The chip shows the origin's `envId`; the tooltip\n * carries the full coordinate. Render it only when {@link getInboundOrigin} returns a value.\n */\nexport function OriginChip({\n  origin,\n  size = ESize.md,\n  subtle,\n}: {\n  origin: { envId: string; perId?: string; insId?: string };\n  size?: ESize;\n  subtle?: boolean;\n}) {\n  return (\n    <Chip\n      color={ESemanticThing.origin}\n      size={size}\n      subtle={subtle}\n      tooltip={{\n        title: \"Received from\",\n        content: (\n          <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"2px\", fontSize: \"11px\" }}>\n            <span>env {origin.envId}</span>\n            {origin.perId != null && <span>perId {origin.perId}</span>}\n            {origin.insId != null && <span>insId {origin.insId}</span>}\n          </div>\n        ),\n      }}\n    >\n      {origin.envId} <ArrowMark kind=\"dashedRight\" />\n    </Chip>\n  );\n}\n","import { NiceUiSectionLabel, token } from \"@nice-code/ui\";\nimport { ArrowMark } from \"nice-devtools-shared\";\nimport type { IDevtoolsActionEntry } from \"../../core/ActionDevtools.types\";\nimport { getTransportTooltip } from \"./HandlerChips\";\nimport { OptionalTooltip } from \"./OptionalTooltip\";\n\nexport function RoutingSection({\n  entry,\n  minHopCount = 0,\n}: {\n  entry: IDevtoolsActionEntry;\n  minHopCount?: number;\n}) {\n  const { meta, startTime } = entry;\n  const hopCount = meta.routing.length;\n  const phantomCount = Math.max(0, minHopCount - hopCount);\n\n  if (hopCount === 0 && phantomCount === 0) return null;\n\n  return (\n    <div>\n      <NiceUiSectionLabel\n        label={hopCount > 0 ? `Routing · ${hopCount} hop${hopCount !== 1 ? \"s\" : \"\"}` : \"Routing\"}\n      />\n      <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"2px\" }}>\n        {meta.routing.map((hop, i) => {\n          const isLocal = hop.handlerType === \"local\";\n          const isLast = i === hopCount - 1 && phantomCount === 0;\n          const badgeColor = isLocal ? token(\"semanticSuccess\") : token(\"semanticWarning\");\n          const badgeText = isLocal\n            ? \"• exec\"\n            : `-> ${hop.transportSummary ?? hop.transport ?? \"ext\"}`;\n          const transportTooltip = isLocal ? undefined : getTransportTooltip(hop);\n          const runtimeTitle =\n            [hop.runtime.perId, hop.runtime.insId].filter(Boolean).join(\" · \") || undefined;\n\n          return (\n            <div\n              key={`${hop.time}-${hop.runtime.envId}`}\n              style={{\n                background: token(\"surfaceSection\"),\n                borderRadius: \"4px\",\n                overflow: \"hidden\",\n                display: \"grid\",\n                gridTemplateColumns: \"30% 1fr 30%\",\n                alignItems: \"center\",\n                columnGap: \"8px\",\n                borderBottom: isLast ? undefined : `1px solid ${token(\"surfaceBase\")}`,\n                padding: \"4px 8px\",\n              }}\n            >\n              <span\n                style={{ display: \"flex\", flexDirection: \"row\", alignItems: \"center\", gap: \"10px\" }}\n              >\n                <span\n                  style={{\n                    color: token(\"textFaint\"),\n                    fontSize: \"10px\",\n                    width: \"16px\",\n                    textAlign: \"right\",\n                  }}\n                >\n                  {i + 1}\n                </span>\n                <span\n                  title={runtimeTitle}\n                  style={{\n                    color: token(\"textSecondary\"),\n                    fontSize: \"11px\",\n                    overflow: \"hidden\",\n                    textOverflow: \"ellipsis\",\n                    whiteSpace: \"nowrap\",\n                    textAlign: \"center\",\n                  }}\n                >\n                  {hop.runtime.envId}\n                </span>\n              </span>\n              <OptionalTooltip\n                config={transportTooltip}\n                style={{ display: \"block\", minWidth: 0, overflow: \"hidden\" }}\n              >\n                <span\n                  style={{\n                    color: badgeColor,\n                    fontSize: \"10px\",\n                    whiteSpace: \"nowrap\",\n                    overflow: \"hidden\",\n                    textOverflow: \"ellipsis\",\n                    display: \"block\",\n                  }}\n                >\n                  {badgeText}\n                </span>\n              </OptionalTooltip>\n              <span\n                style={{\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  justifyContent: \"space-between\",\n                  paddingRight: \"8px\",\n                  overflow: \"hidden\",\n                }}\n              >\n                <span\n                  style={{\n                    color: token(\"textMuted\"),\n                    fontSize: \"10px\",\n                    whiteSpace: \"nowrap\",\n                    overflow: \"hidden\",\n                    textOverflow: \"ellipsis\",\n                  }}\n                >\n                  {hop.handlerClient != null ? (\n                    <>\n                      <ArrowMark kind=\"branch\" style={{ marginRight: \"2px\" }} />\n                      {hop.handlerClient.envId}\n                    </>\n                  ) : (\n                    \"\"\n                  )}\n                </span>\n                <span\n                  style={{\n                    color: token(\"textFaint\"),\n                    fontSize: \"10px\",\n                    flexShrink: 0,\n                    marginLeft: \"auto\",\n                  }}\n                >\n                  +{hop.time - startTime}ms\n                </span>\n              </span>\n            </div>\n          );\n        })}\n        {Array.from({ length: phantomCount }, (_, i) => `routing-phantom-${hopCount + i}`).map(\n          (key) => (\n            <div\n              key={key}\n              aria-hidden=\"true\"\n              style={{\n                visibility: \"hidden\",\n                background: token(\"surfaceSection\"),\n                borderRadius: \"4px\",\n                display: \"grid\",\n                gridTemplateColumns: \"30% 1fr 30%\",\n                alignItems: \"center\",\n                columnGap: \"8px\",\n                padding: \"4px 8px\",\n              }}\n            >\n              <span\n                style={{ display: \"flex\", flexDirection: \"row\", alignItems: \"center\", gap: \"10px\" }}\n              >\n                <span style={{ fontSize: \"10px\", width: \"16px\" }}>0</span>\n                <span style={{ fontSize: \"11px\" }}>placeholder</span>\n              </span>\n              <span style={{ fontSize: \"10px\" }}>placeholder</span>\n              <span />\n            </div>\n          ),\n        )}\n      </div>\n    </div>\n  );\n}\n","import { token } from \"@nice-code/ui\";\nimport { useMemo, useState } from \"react\";\nimport type {\n  IDevtoolsActionEntry,\n  IDevtoolsRouteItem,\n  TDevtoolsActionStatus,\n} from \"../../../core/ActionDevtools.types\";\nimport { ESize } from \"../../ui_util/size\";\nimport { ActionErrorDisplay } from \"../ActionErrorDisplay\";\nimport { CallStackSection } from \"../CallStackSection\";\nimport { ChildDispatchChips } from \"../ChildDispatchChips\";\nimport { DetailSection } from \"../DetailSection\";\nimport { DomainChip } from \"../DomainChip\";\nimport { HandlerChips } from \"../HandlerChips\";\nimport { MetaSection } from \"../MetaSection\";\nimport { OriginChip } from \"../OriginChip\";\nimport { RoutingSection } from \"../RoutingSection\";\nimport { DurationDisplay } from \"../RunningTimer\";\nimport { countUserFrames, StackTraceSection } from \"../StackTraceSection\";\nimport { formatTimestamp, getInboundOrigin, STATUS_COLOR, STATUS_ICON } from \"../utils\";\n\nconst STATUS_BADGE_LABEL: Record<TDevtoolsActionStatus, string> = {\n  running: \"RUNNING\",\n  success: \"SUCCESS\",\n  \"action-error\": \"ERROR\",\n  failed: \"FAILED\",\n  aborted: \"ABORTED\",\n};\n\n// Both action-error and failed are critical — use Error Red so the badge always\n// signals danger consistently, regardless of the underlying status sub-type.\nconst STATUS_BADGE_BG: Record<TDevtoolsActionStatus, string> = {\n  running: STATUS_COLOR.running,\n  success: STATUS_COLOR.success,\n  \"action-error\": token(\"semanticError\"),\n  failed: token(\"semanticError\"),\n  aborted: token(\"semanticMetadata\"),\n};\n\nconst STATUS_BADGE_TEXT_COLOR: Record<TDevtoolsActionStatus, string> = {\n  running: \"#0f172a\",\n  success: \"#0f172a\",\n  \"action-error\": \"#ffffff\",\n  failed: \"#ffffff\",\n  aborted: \"#0f172a\",\n};\n\nfunction DetailHeader({\n  entry,\n  isActive,\n  onClick,\n  childExternalRouteItems,\n}: {\n  entry: IDevtoolsActionEntry;\n  isActive: boolean;\n  onClick: () => void;\n  childExternalRouteItems?: IDevtoolsRouteItem[];\n}) {\n  const color = STATUS_COLOR[entry.status];\n  const StatusIconComponent = STATUS_ICON[entry.status];\n  const timestamp = formatTimestamp(entry.startTime);\n  const inboundOrigin = getInboundOrigin(entry);\n\n  return (\n    <div\n      onClick={!isActive ? onClick : undefined}\n      style={{\n        padding: \"0.5em 1em\",\n        background: isActive ? token(\"surfaceSection\") : token(\"surfaceDetailHeader\"),\n        borderBottom: `1px solid ${token(\"surfaceBase\")}`,\n        borderLeft: isActive ? `2px solid ${color}` : \"2px solid transparent\",\n        flexShrink: 0,\n        flexDirection: \"row\",\n        display: \"flex\",\n        alignItems: \"flex-start\",\n        gap: \"1em\",\n        cursor: isActive ? \"default\" : \"pointer\",\n      }}\n    >\n      <div style={{ flex: 1, minWidth: 0, display: \"flex\", flexDirection: \"column\", gap: \"0.5em\" }}>\n        <div style={{ display: \"flex\", alignItems: \"center\", minWidth: 0, gap: \"0.5em\" }}>\n          <span\n            style={{\n              color,\n              flexShrink: 0,\n              display: \"flex\",\n              alignItems: \"center\",\n              animation:\n                entry.status === \"running\"\n                  ? \"__nice-action-pulse 1.2s ease-in-out infinite\"\n                  : undefined,\n            }}\n          >\n            <StatusIconComponent size={20} strokeWidth={1.75} />\n          </span>\n          <span\n            style={{\n              color: token(\"textEmphasis\"),\n              fontSize: \"1.2em\",\n              fontWeight: \"600\",\n              fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n              overflow: \"hidden\",\n              textOverflow: \"ellipsis\",\n              whiteSpace: \"nowrap\",\n              flexShrink: 1,\n              minWidth: \"2.5em\",\n            }}\n          >\n            {entry.actionId}\n          </span>\n          {/* Status pill badge */}\n          <span\n            style={{\n              flexShrink: 0,\n              padding: \"2px 9px\",\n              borderRadius: \"999px\",\n              background: STATUS_BADGE_BG[entry.status],\n              color: STATUS_BADGE_TEXT_COLOR[entry.status],\n              fontSize: \"9px\",\n              fontWeight: \"700\",\n              letterSpacing: \"0.1em\",\n              textTransform: \"uppercase\",\n              fontFamily: \"ui-sans-serif, system-ui, sans-serif\",\n            }}\n          >\n            {STATUS_BADGE_LABEL[entry.status]}\n          </span>\n          <DomainChip domain={entry.domain} allDomains={entry.allDomains} size={ESize.md} />\n        </div>\n\n        {/* Handler chips | timestamp + duration */}\n        <div\n          style={{\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"space-between\",\n            gap: \"8px\",\n          }}\n        >\n          <div\n            style={{\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: \"6px\",\n              minWidth: 0,\n              overflow: \"hidden\",\n            }}\n          >\n            {inboundOrigin != null && <OriginChip origin={inboundOrigin} size={ESize.md} />}\n            <HandlerChips entry={entry} size={ESize.md} />\n            <ChildDispatchChips childRouteItems={childExternalRouteItems} size={ESize.md} />\n          </div>\n\n          <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\", flexShrink: 0 }}>\n            <span\n              style={{\n                color: token(\"semanticMetadata\"),\n                fontSize: \"10px\",\n                letterSpacing: \"0.02em\",\n                fontFamily: \"ui-sans-serif, system-ui, sans-serif\",\n              }}\n            >\n              {timestamp}\n            </span>\n            <span style={{ color, fontSize: \"12px\", fontWeight: \"500\" }}>\n              <DurationDisplay entry={entry} />\n            </span>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport function ActionDetailPanel({\n  entry,\n  parent,\n  childEntries,\n  onSelectEntry,\n}: {\n  entry: IDevtoolsActionEntry;\n  parent: IDevtoolsActionEntry | null;\n  childEntries: IDevtoolsActionEntry[];\n  onSelectEntry: (cuid: string) => void;\n}) {\n  const [focusedChildCuid, setFocusedChildCuid] = useState<string | null>(null);\n\n  const focusedEntry =\n    focusedChildCuid != null\n      ? (childEntries.find((e) => e.cuid === focusedChildCuid) ?? entry)\n      : entry;\n\n  const maxRoutingHops = Math.max(\n    entry.meta.routing.length,\n    ...childEntries.map((e) => e.meta.routing.length),\n    0,\n  );\n\n  const maxCallSiteFrames = Math.max(\n    countUserFrames(entry.meta.originClient, entry.callSite),\n    ...childEntries.map((e) => countUserFrames(e.meta.originClient, e.callSite)),\n    0,\n  );\n\n  const childExternalRouteItems = useMemo(() => {\n    const seen = new Set<string>();\n    const result: IDevtoolsRouteItem[] = [];\n    for (const child of childEntries) {\n      const firstHop = child.meta.routing[0];\n      if (firstHop == null || firstHop.handlerType !== \"peer\") continue;\n      const key = `${firstHop.handlerClient?.envId ?? \"\"}:${firstHop.transport ?? \"\"}`;\n      if (seen.has(key)) continue;\n      seen.add(key);\n      result.push(firstHop);\n    }\n    return result;\n  }, [childEntries]);\n\n  const handleFocusChild = (cuid: string) => {\n    setFocusedChildCuid((prev) => (prev === cuid ? null : cuid));\n  };\n\n  return (\n    <div\n      style={{\n        flex: 1,\n        display: \"flex\",\n        flexDirection: \"column\",\n        overflow: \"hidden\",\n        minHeight: 0,\n        background: token(\"surfaceDetail\"),\n      }}\n    >\n      <DetailHeader\n        entry={entry}\n        isActive={focusedChildCuid === null}\n        onClick={() => setFocusedChildCuid(null)}\n        childExternalRouteItems={childExternalRouteItems}\n      />\n      <CallStackSection\n        parent={parent}\n        childEntries={childEntries}\n        focusedChildCuid={focusedChildCuid}\n        onFocusChild={handleFocusChild}\n        onSelectParent={onSelectEntry}\n      />\n      <div\n        style={{\n          flex: 1,\n          overflowY: \"auto\",\n          minHeight: 0,\n          padding: \"10px 12px\",\n          display: \"flex\",\n          flexDirection: \"column\",\n          gap: \"8px\",\n        }}\n      >\n        {focusedEntry.input !== undefined ? (\n          <DetailSection label=\"Input\" value={focusedEntry.input} />\n        ) : (\n          <DetailSection label=\"Input\" value={\"No input required or given\"} />\n        )}\n        {focusedEntry.status === \"success\" && (\n          <DetailSection\n            label=\"Output\"\n            value={focusedEntry.output}\n            color={token(\"semanticSuccess\")}\n          />\n        )}\n        {(focusedEntry.status === \"action-error\" ||\n          focusedEntry.status === \"failed\" ||\n          focusedEntry.status === \"aborted\") && <ActionErrorDisplay entry={focusedEntry} />}\n        {focusedEntry.progressUpdates.length > 0 && (\n          <DetailSection\n            label={`Progress (${focusedEntry.progressUpdates.length})`}\n            value={focusedEntry.progressUpdates}\n          />\n        )}\n        <StackTraceSection\n          runtime={entry.meta.originClient}\n          label=\"Dispatch Site\"\n          stack={focusedEntry.callSite}\n          color={token(\"textSecondary\")}\n          minFrameCount={maxCallSiteFrames}\n        />\n        <RoutingSection entry={focusedEntry} minHopCount={maxRoutingHops} />\n        <MetaSection entry={focusedEntry} />\n      </div>\n    </div>\n  );\n}\n","import { renderColoredJson, safeStringify } from \"nice-devtools-shared\";\n\nfunction stripOuterBraces(json: string): string {\n  const lines = json.split(\"\\n\");\n  if (lines.length > 2 && lines[0] === \"{\" && lines[lines.length - 1] === \"}\") {\n    return lines\n      .slice(1, -1)\n      .map((l) => l.slice(2))\n      .join(\"\\n\");\n  }\n  return json;\n}\n\nexport function IoTooltipContent({ value }: { value: unknown }) {\n  const text = stripOuterBraces(safeStringify(value, 2));\n  return (\n    <div\n      style={{\n        fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n        fontSize: \"10px\",\n        whiteSpace: \"pre-wrap\",\n        wordBreak: \"break-all\",\n        lineHeight: \"1.5\",\n        textAlign: \"left\",\n      }}\n    >\n      {renderColoredJson(text)}\n    </div>\n  );\n}\n","import { NiceUiTooltipSurface, token } from \"@nice-code/ui\";\nimport { CircleX, PackageCheck, Sparkle, Variable } from \"lucide-react\";\nimport { ArrowMark } from \"nice-devtools-shared\";\nimport { useState } from \"react\";\nimport type { IDevtoolsActionEntry } from \"../../../core/ActionDevtools.types\";\nimport { ESemanticThing } from \"../../../core/devtools_colors\";\nimport { ESize, getSizeValue } from \"../../ui_util/size\";\nimport { ActionErrorDisplay } from \"../ActionErrorDisplay\";\nimport { Chip } from \"../Chip\";\nimport { getExternalLabel, getTransportTooltip } from \"../HandlerChips\";\nimport { Icon } from \"../Icon\";\nimport { EBreakGroupReason } from \"./action_list.types\";\nimport { IoTooltipContent } from \"./IoTooltipContent\";\n\ninterface IActionInputAndOutputChipProps {\n  entry: IDevtoolsActionEntry;\n  breakReasons: EBreakGroupReason[];\n  subtle?: boolean;\n  size?: ESize;\n}\n\nexport const ActionInputAndOutputChip = ({\n  entry,\n  breakReasons,\n  subtle,\n  size = ESize.md,\n}: IActionInputAndOutputChipProps) => {\n  const firstHop = entry.meta.routing[0];\n  const localEnvId = firstHop != null ? firstHop.runtime.envId : null;\n  const externalLabel = firstHop != null ? getExternalLabel(firstHop) : null;\n  const firstHopIsLocal = firstHop != null && firstHop.handlerType === \"local\";\n  const isLocal = localEnvId != null && (firstHopIsLocal || externalLabel == null);\n  const color = isLocal ? ESemanticThing.handler_local : ESemanticThing.handler_external;\n\n  const transportTooltip = firstHop != null ? getTransportTooltip(firstHop) : undefined;\n  const [labelAnchor, setLabelAnchor] = useState<DOMRect | null>(null);\n\n  const isNewInput = breakReasons.includes(EBreakGroupReason.new_input);\n  const isNewOutput = breakReasons.includes(EBreakGroupReason.new_output);\n  const hasError = entry.error != null || entry.abortReason != null;\n\n  const sizeNum = getSizeValue(size);\n  const newIconSizeEm = `${sizeNum * 0.9}em`; // visually tuned\n\n  const label = `${(isLocal ? localEnvId : externalLabel) ?? \"unknown\"}`;\n\n  const newSparkleComp = (\n    <div\n      style={{\n        opacity: 0.9,\n        alignSelf: \"start\",\n        marginLeft: \"-0.6em\",\n      }}\n    >\n      <Sparkle\n        strokeWidth={\"0.2em\"}\n        color={\"rgba(243, 250, 140, 1)\"}\n        width={newIconSizeEm}\n        height={newIconSizeEm}\n      />\n    </div>\n  );\n\n  return (\n    <Chip color={color} size={size} subtle={subtle}>\n      <div style={{ display: \"flex\", alignItems: \"center\", gap: \"0.4em\" }}>\n        <Icon\n          noBackground\n          icon={Variable}\n          color={color}\n          subtle={subtle || entry.input === undefined}\n          tooltip={{\n            content:\n              entry.input !== undefined ? (\n                <IoTooltipContent value={entry.input} />\n              ) : (\n                <span style={{ color: token(\"textMuted\"), fontSize: \"10px\" }}>\n                  No input required or given\n                </span>\n              ),\n            title: isNewInput ? \"New Input\" : \"Input\",\n          }}\n        />\n        {isNewInput && newSparkleComp}\n        <span style={{ opacity: 0.6 }} color={color}>\n          <ArrowMark kind=\"right\" />\n        </span>\n        <span\n          title={transportTooltip == null ? label : undefined}\n          style={{\n            opacity: 0.8,\n            cursor: transportTooltip != null ? \"default\" : undefined,\n            overflow: \"hidden\",\n            textOverflow: \"ellipsis\",\n            whiteSpace: \"nowrap\",\n            maxWidth: \"14ch\",\n          }}\n          onMouseEnter={\n            transportTooltip != null\n              ? (e) => setLabelAnchor(e.currentTarget.getBoundingClientRect())\n              : undefined\n          }\n          onMouseLeave={transportTooltip != null ? () => setLabelAnchor(null) : undefined}\n        >\n          {label}\n        </span>\n        {labelAnchor != null && transportTooltip != null && (\n          <NiceUiTooltipSurface anchor={labelAnchor} config={transportTooltip} />\n        )}\n        <span style={{ opacity: 0.6 }} color={color}>\n          <ArrowMark kind=\"right\" />\n        </span>\n        {entry.status === \"success\" && entry.output !== undefined && (\n          <Icon\n            noBackground\n            icon={PackageCheck}\n            color={!hasError ? color : ESemanticThing.default}\n            tooltip={{\n              content: <IoTooltipContent value={entry.output} />,\n              title: isNewOutput ? \"New Output\" : \"Output\",\n            }}\n          />\n        )}\n        {(entry.error != null || entry.abortReason != null) && (\n          <Icon\n            noBackground\n            icon={CircleX}\n            color={entry.status === \"aborted\" ? ESemanticThing.aborted : ESemanticThing.error}\n            tooltip={{\n              content: <ActionErrorDisplay entry={entry} compact />,\n              title: entry.status === \"aborted\" ? \"Aborted\" : \"Error\",\n              maxWidth: 340,\n            }}\n          />\n        )}\n        {isNewOutput && newSparkleComp}\n      </div>\n    </Chip>\n  );\n};\n","import { NiceUiTooltipSurface, token, tokenAlpha } from \"@nice-code/ui\";\nimport { CircleX, PackageCheck, Variable } from \"lucide-react\";\nimport { Fragment, useState } from \"react\";\nimport type {\n  IDevtoolsActionEntry,\n  TDevtoolsActionStatus,\n} from \"../../../core/ActionDevtools.types\";\nimport {\n  DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND,\n  ESemanticThing,\n} from \"../../../core/devtools_colors\";\nimport { ESize } from \"../../ui_util/size\";\nimport { ActionErrorDisplay } from \"../ActionErrorDisplay\";\nimport { Chip } from \"../Chip\";\nimport { HandlerChips } from \"../HandlerChips\";\nimport { Icon } from \"../Icon\";\nimport { OriginChip } from \"../OriginChip\";\nimport { DurationDisplay } from \"../RunningTimer\";\nimport {\n  formatRelativeAge,\n  formatTimestamp,\n  getInboundOrigin,\n  STATUS_COLOR,\n  STATUS_SYMBOL,\n} from \"../utils\";\nimport { ActionInputAndOutputChip } from \"./ActionInputAndOutputChip\";\nimport { EBreakGroupReason } from \"./action_list.types\";\nimport { IoTooltipContent } from \"./IoTooltipContent\";\n\n// Max group dots to render before collapsing the rest into a \"+ X\" indicator.\nconst MAX_GROUP_DOTS = 5;\n\nfunction getLatestChipColor(status: TDevtoolsActionStatus): ESemanticThing {\n  if (status === \"failed\") return ESemanticThing.failed;\n  if (status === \"action-error\") return ESemanticThing.action_error;\n  if (status === \"aborted\") return ESemanticThing.aborted;\n  return ESemanticThing.success;\n}\n\n// ─── Group dot + tooltip ──────────────────────────────────────────────────────\n\nfunction GroupDotTooltip({\n  entry,\n  index,\n  total,\n  refTime,\n  dotColor,\n  anchor,\n}: {\n  entry: IDevtoolsActionEntry;\n  index: number;\n  total: number;\n  refTime: number;\n  dotColor: string;\n  anchor: DOMRect;\n}) {\n  const symbol = STATUS_SYMBOL[entry.status];\n  const deltaMs = refTime - entry.startTime;\n  const relStr = index === 0 ? \"latest run\" : `−${formatRelativeAge(deltaMs)} from latest`;\n  const durationStr = entry.endTime != null ? `${entry.endTime - entry.startTime}ms` : \"running…\";\n\n  return (\n    <NiceUiTooltipSurface\n      anchor={anchor}\n      config={{\n        align: \"center\",\n        maxWidth: 240,\n        content: (\n          <>\n            <div style={{ color: dotColor, marginBottom: \"1px\" }}>\n              {symbol} run {index + 1} of {total}\n            </div>\n            <div style={{ color: token(\"textSecondary\") }}>{formatTimestamp(entry.startTime)}</div>\n            <div style={{ color: token(\"textMuted\") }}>{durationStr}</div>\n            {index > 0 && (\n              <div\n                style={{\n                  color: token(\"textMuted\"),\n                  marginTop: \"3px\",\n                  paddingTop: \"3px\",\n                  borderTop: `1px solid ${token(\"surfaceSection\")}`,\n                }}\n              >\n                {relStr}\n              </div>\n            )}\n          </>\n        ),\n      }}\n    />\n  );\n}\n\nfunction GroupDot({\n  entry,\n  index,\n  total,\n  refTime,\n  isActive,\n  onSelect,\n}: {\n  entry: IDevtoolsActionEntry;\n  index: number;\n  total: number;\n  refTime: number;\n  isActive: boolean;\n  onSelect: () => void;\n}) {\n  const [anchor, setAnchor] = useState<DOMRect | null>(null);\n  const dotColor = STATUS_COLOR[entry.status];\n  const hovered = anchor != null;\n\n  return (\n    <>\n      <button\n        data-cuid={entry.cuid}\n        onClick={(e) => {\n          e.stopPropagation();\n          onSelect();\n        }}\n        onMouseEnter={(e) => setAnchor(e.currentTarget.getBoundingClientRect())}\n        onMouseLeave={() => setAnchor(null)}\n        style={{\n          width: \"9px\",\n          height: \"9px\",\n          borderRadius: \"50%\",\n          border: isActive\n            ? `2px solid ${dotColor}`\n            : hovered\n              ? `1px solid ${dotColor}99`\n              : \"1px solid transparent\",\n          background: isActive ? \"transparent\" : dotColor,\n          cursor: \"pointer\",\n          padding: 0,\n          flexShrink: 0,\n          opacity: isActive ? 1 : hovered ? 0.8 : 0.35,\n          transform: hovered ? \"scale(1.55)\" : \"scale(1)\",\n          transition: \"transform 0.1s ease, opacity 0.1s ease, border-color 0.1s ease\",\n        }}\n      />\n      {hovered && anchor != null && (\n        <GroupDotTooltip\n          entry={entry}\n          index={index}\n          total={total}\n          refTime={refTime}\n          dotColor={dotColor}\n          anchor={anchor}\n        />\n      )}\n    </>\n  );\n}\n\n// ─── Main row ─────────────────────────────────────────────────────────────────\n\nexport function ActionEntryRow({\n  entry,\n  isSelected,\n  onClick,\n  isLatest = false,\n  latestTime,\n  childEntries,\n  breakReasons,\n  groupEntries,\n  selectedGroupCuid,\n  onSelectGroupEntry,\n}: {\n  entry: IDevtoolsActionEntry;\n  isSelected: boolean;\n  onClick: () => void;\n  isLatest?: boolean;\n  latestTime?: number;\n  childEntries?: IDevtoolsActionEntry[];\n  breakReasons: EBreakGroupReason[];\n  groupEntries?: IDevtoolsActionEntry[];\n  selectedGroupCuid?: string | null;\n  onSelectGroupEntry?: (cuid: string) => void;\n}) {\n  const timestamp = formatTimestamp(entry.startTime);\n  const hasGroup = groupEntries != null && groupEntries.length > 1;\n  const inboundOrigin = getInboundOrigin(entry);\n\n  // The bottom section surfaces cross-runtime usage only — child actions that were handled on a\n  // *different* runtime (external handlers with their transports). Children handled on the local\n  // runtime are intentionally omitted here; their local-runtime chip shows on the top section and in\n  // the detail panel instead.\n  const externalChildEntries =\n    childEntries?.filter((child) => child.meta.routing[0]?.handlerType === \"peer\") ?? [];\n\n  const nonIoBreakReasons =\n    breakReasons?.filter(\n      (r) => r !== EBreakGroupReason.new_input && r !== EBreakGroupReason.new_output,\n    ) ?? [];\n\n  const hasBottomError = entry.error != null || entry.abortReason != null;\n\n  const hasBottomContent = externalChildEntries.length > 0 || nonIoBreakReasons.length > 0;\n\n  return (\n    <div\n      data-cuid={entry.cuid}\n      onClick={onClick}\n      style={{\n        position: \"relative\",\n        display: \"flex\",\n        flexDirection: \"column\",\n        gap: \"5px\",\n        padding: \"0.5em 0.6em\",\n        cursor: \"pointer\",\n        background: isSelected ? DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND : \"transparent\",\n        border: `1px solid ${token(\"borderPanel\")}`,\n        borderLeft: isSelected\n          ? `2px solid ${STATUS_COLOR[entry.status]}`\n          : entry.status === \"failed\" || entry.status === \"action-error\"\n            ? `2px solid ${STATUS_COLOR[entry.status]}55`\n            : `2px solid ${token(\"borderPanel\")}`,\n        borderRadius: \"3px\",\n        margin: \"2px 4px\",\n      }}\n    >\n      {/* Timeline vertical line */}\n      <div\n        style={{\n          position: \"absolute\",\n          left: \"2em\",\n          top: 0,\n          bottom: 0,\n          width: \"1px\",\n          background: tokenAlpha(\"semanticMetadata\", 0.157),\n          pointerEvents: \"none\",\n          zIndex: 0,\n        }}\n      />\n\n      {/* Line 1 — identity: age chip + actionId (the hero, gets the full line) + duration.\n          actionId is never sacrificed to fit the routing/I-O detail, which now lives on line 2. */}\n      <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n        {/* Age chip + timestamp — chip sits on the timeline line; the timestamp is absolutely\n            positioned beneath it so it falls into the empty gutter alongside line 2 instead of\n            adding height to this row. */}\n        <div\n          style={{\n            position: \"relative\",\n            zIndex: 1,\n            flexShrink: 0,\n            minWidth: \"3.4em\",\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"flex-start\",\n          }}\n        >\n          {isLatest ? (\n            <Chip size={ESize.sm} color={getLatestChipColor(entry.status)}>\n              latest\n            </Chip>\n          ) : (\n            <Chip size={ESize.sm} color={getLatestChipColor(entry.status)}>\n              +{latestTime != null ? formatRelativeAge(latestTime - entry.startTime) : \"?\"}\n            </Chip>\n          )}\n          <span\n            style={{\n              position: \"absolute\",\n              top: \"100%\",\n              left: 0,\n              marginTop: \"5px\",\n              color: token(\"semanticMetadata\"),\n              fontSize: \"10px\",\n              lineHeight: \"1em\",\n              letterSpacing: \"0.02em\",\n              fontFamily: \"ui-sans-serif, system-ui, sans-serif\",\n              opacity: 0.7,\n              paddingLeft: \"0.1em\",\n              whiteSpace: \"nowrap\",\n            }}\n          >\n            {timestamp}\n          </span>\n        </div>\n\n        <span\n          title={entry.actionId}\n          style={{\n            flex: 1,\n            minWidth: 0,\n            color: token(\"textSecondary\"),\n            fontSize: \"1em\",\n            fontWeight: 400,\n            fontFamily: \"ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace\",\n            overflow: \"hidden\",\n            textOverflow: \"ellipsis\",\n            whiteSpace: \"nowrap\",\n          }}\n        >\n          {entry.actionId}\n        </span>\n\n        <span\n          style={{\n            color: token(\"semanticWarning\"),\n            lineHeight: \"1em\",\n            fontSize: \"11px\",\n            opacity: 0.9,\n            flexShrink: 0,\n            fontFamily: \"ui-sans-serif, system-ui, sans-serif\",\n          }}\n        >\n          <DurationDisplay entry={entry} />\n        </span>\n      </div>\n\n      {/* Line 2 — routing: origin + input→handler→output, aligned under the actionId. Giving this\n          its own line lets the handler/transport detail use the full panel width instead of squeezing\n          the action name on a single cramped row. */}\n      <div\n        style={{\n          display: \"flex\",\n          alignItems: \"center\",\n          gap: \"0.4em\",\n          paddingLeft: \"4.5em\",\n          minWidth: 0,\n        }}\n      >\n        {inboundOrigin != null && <OriginChip origin={inboundOrigin} size={ESize.sm} subtle />}\n        <ActionInputAndOutputChip breakReasons={breakReasons} entry={entry} size={ESize.sm} />\n        {entry.reliability != null && (\n          <Chip\n            size={ESize.sm}\n            color={ESemanticThing.domain}\n            subtle\n            tooltip={{\n              title: \"Reliable delivery\",\n              content: (\n                <span style={{ fontSize: \"10px\", color: token(\"textSecondary\") }}>\n                  {entry.reliability.tier === \"persisted\"\n                    ? \"Persisted tier — ordered, at-least-once dedup that survives a server restart.\"\n                    : \"Session tier — ordered, at-least-once, deduped for the life of the connection.\"}\n                  {entry.reliability.seq != null ? ` Frame seq ${entry.reliability.seq}.` : \"\"}\n                  {entry.reliability.acked === true ? \" Acked by the peer (delivered).\" : \"\"}\n                </span>\n              ),\n            }}\n          >\n            {entry.reliability.tier === \"persisted\" ? \"persisted\" : \"reliable\"}\n            {entry.reliability.seq != null ? ` · ${entry.reliability.seq}` : \"\"}\n            {entry.reliability.acked === true ? \" ✓\" : \"\"}\n          </Chip>\n        )}\n      </div>\n\n      {/* Bottom section: cross-runtime child action handlers — subtle, left-aligned to the timeline */}\n      {hasBottomContent && (\n        <div\n          style={{\n            display: \"flex\",\n            flexWrap: \"wrap\",\n            alignItems: \"center\",\n            gap: \"4px\",\n            paddingLeft: \"4.5em\",\n          }}\n        >\n          {externalChildEntries.map((child) => (\n            <Fragment key={child.actionId}>\n              <Icon\n                size={ESize.sm}\n                icon={Variable}\n                color={ESemanticThing.io_input}\n                subtle\n                tooltip={{\n                  content:\n                    child.input !== undefined ? (\n                      <IoTooltipContent value={child.input} />\n                    ) : (\n                      <span style={{ color: token(\"textMuted\"), fontSize: \"10px\" }}>\n                        No input required or given\n                      </span>\n                    ),\n                  title: `Input · ${child.actionId}`,\n                }}\n              />\n              <HandlerChips entry={child} size={ESize.sm} subtle />\n              {child.status === \"success\" && child.output !== undefined && (\n                <Icon\n                  size={ESize.sm}\n                  icon={PackageCheck}\n                  color={ESemanticThing.io_output}\n                  subtle\n                  tooltip={{\n                    content: <IoTooltipContent value={child.output} />,\n                    title: `Output · ${child.actionId}`,\n                  }}\n                />\n              )}\n            </Fragment>\n          ))}\n          {nonIoBreakReasons.map((reason) => (\n            <Chip key={reason} color={ESemanticThing.default} subtle>\n              {reason}\n            </Chip>\n          ))}\n          {externalChildEntries.length > 0 && hasBottomError && (\n            <Icon\n              size={ESize.sm}\n              icon={CircleX}\n              color={entry.status === \"aborted\" ? ESemanticThing.aborted : ESemanticThing.error}\n              subtle\n              tooltip={{\n                content: <ActionErrorDisplay entry={entry} compact />,\n                title: entry.status === \"aborted\" ? \"Aborted\" : \"Error\",\n                maxWidth: 340,\n              }}\n            />\n          )}\n        </div>\n      )}\n\n      {/* Group dots — same left alignment as bottom section */}\n      {hasGroup && (\n        <div\n          style={{\n            display: \"flex\",\n            flexWrap: \"wrap\",\n            alignItems: \"center\",\n            gap: \"5px\",\n            paddingLeft: \"4.6em\",\n            paddingBottom: \"2px\",\n          }}\n        >\n          {groupEntries!.slice(0, MAX_GROUP_DOTS).map((e, i) => (\n            <GroupDot\n              key={e.cuid}\n              entry={e}\n              index={i}\n              total={groupEntries!.length}\n              refTime={groupEntries![0]!.startTime}\n              isActive={selectedGroupCuid === e.cuid}\n              onSelect={() => onSelectGroupEntry?.(e.cuid)}\n            />\n          ))}\n          {groupEntries!.length > MAX_GROUP_DOTS && (\n            <span\n              style={{\n                fontSize: \"0.7em\",\n                opacity: 0.5,\n                flexShrink: 0,\n                lineHeight: 1,\n              }}\n            >\n              + {groupEntries!.length - MAX_GROUP_DOTS}\n            </span>\n          )}\n        </div>\n      )}\n    </div>\n  );\n}\n","import { NiceUiVirtualList, token } from \"@nice-code/ui\";\nimport { useMemo, useRef } from \"react\";\nimport { DEVTOOL_LIST_GROUP_DIVIDER } from \"../../../core/devtools_colors\";\nimport type { IDevtoolsActionEntry } from \"../../../server\";\nimport type { IEntryGroup } from \"../../NiceActionDevtools\";\nimport { safeStringify } from \"../utils\";\nimport { ActionEntryRow } from \"./ActionEntryRow\";\nimport { EBreakGroupReason } from \"./action_list.types\";\n\nfunction getBreakReasons(\n  current: IDevtoolsActionEntry,\n  previous: IDevtoolsActionEntry,\n): EBreakGroupReason[] {\n  const reasons: EBreakGroupReason[] = [];\n  const inputChanged =\n    current.inputHash != null && previous.inputHash != null\n      ? current.inputHash !== previous.inputHash\n      : safeStringify(current.input, 0) !== safeStringify(previous.input, 0);\n  if (inputChanged) reasons.push(EBreakGroupReason.new_input);\n  const outputChanged =\n    current.outputHash != null &&\n    previous.outputHash != null &&\n    current.outputHash !== previous.outputHash;\n  if (outputChanged) reasons.push(EBreakGroupReason.new_output);\n  return reasons;\n}\ntype TFlatItem = {\n  group: IEntryGroup;\n  groupIndex: number;\n  breakReasons: EBreakGroupReason[];\n};\n// Gather child entries for a group across all runs, deduped by actionId (representative's run wins).\nfunction getGroupChildEntries(\n  group: IEntryGroup,\n  childEntriesMap: Map<string, IDevtoolsActionEntry[]>,\n): IDevtoolsActionEntry[] | undefined {\n  const seen = new Set<string>();\n  const result: IDevtoolsActionEntry[] = [];\n  for (const e of [group.representative, ...group.rest]) {\n    for (const child of childEntriesMap.get(e.cuid) ?? []) {\n      if (!seen.has(child.actionId)) {\n        seen.add(child.actionId);\n        result.push(child);\n      }\n    }\n  }\n  return result.length > 0 ? result.sort((a, b) => a.startTime - b.startTime) : undefined;\n}\n// Stable React key — keyed on oldest cuid so prepending new entries never remounts the group DOM node.\nfunction getFlatItemKey(item: TFlatItem): string {\n  const oldestCuid =\n    item.group.rest[item.group.rest.length - 1]?.cuid ?? item.group.representative.cuid;\n  return `g:${oldestCuid}`;\n}\n\nexport function ActionList({\n  groups,\n  selectedCuid,\n  onGroupClick,\n  onSubClick,\n  childEntriesMap,\n  style,\n}: {\n  groups: IEntryGroup[];\n  selectedCuid: string | null;\n  onGroupClick: (group: IEntryGroup) => void;\n  onSubClick: (cuid: string, isSelected: boolean) => void;\n  childEntriesMap: Map<string, IDevtoolsActionEntry[]>;\n  style?: React.CSSProperties;\n}) {\n  const latestTime = groups[0]?.representative.startTime;\n\n  const flatItems = useMemo<TFlatItem[]>(() => {\n    return groups.map((group, gi) => {\n      const prevGroup = groups[gi + 1];\n      let breakReasons: EBreakGroupReason[] = [];\n      if (\n        prevGroup != null &&\n        prevGroup.representative.actionId === group.representative.actionId &&\n        prevGroup.representative.domain === group.representative.domain\n      ) {\n        const reasons = getBreakReasons(group.representative, prevGroup.representative);\n        if (reasons.length > 0) breakReasons = reasons;\n      }\n      return { group, groupIndex: gi, breakReasons };\n    });\n  }, [groups]);\n\n  // Only entries added since the previous render get the one-shot \"shine\" highlight.\n  // Keying on the representative cuid (which changes when a fresh run merges into a\n  // group) reproduces the old mount-driven behaviour, but driving it off a data diff\n  // instead of DOM mount means virtualization's mount/unmount on scroll never replays it.\n  const prevRepCuidsRef = useRef<Set<string> | null>(null);\n  const newRepCuids = useMemo<Set<string>>(() => {\n    const current = new Set(flatItems.map((i) => i.group.representative.cuid));\n    const prev = prevRepCuidsRef.current;\n    const result = new Set<string>();\n    if (prev != null) {\n      for (const c of current) if (!prev.has(c)) result.add(c);\n    }\n    prevRepCuidsRef.current = current;\n    return result;\n  }, [flatItems]);\n\n  // The selected row is identified by its enclosing group's stable key, since the\n  // selection may be a sub-entry inside the group rather than its representative.\n  const selectedAnchorKey = useMemo(() => {\n    if (selectedCuid == null) return null;\n    const item = flatItems.find(\n      (i) =>\n        i.group.representative.cuid === selectedCuid ||\n        i.group.rest.some((e) => e.cuid === selectedCuid),\n    );\n    return item != null ? getFlatItemKey(item) : null;\n  }, [flatItems, selectedCuid]);\n\n  return (\n    <NiceUiVirtualList<TFlatItem>\n      items={flatItems}\n      getItemKey={getFlatItemKey}\n      selectedKey={selectedAnchorKey}\n      estimateSize={64}\n      overscan={8}\n      style={style}\n      rowStyle={{ borderBottom: `1px solid ${DEVTOOL_LIST_GROUP_DIVIDER}`, overflow: \"hidden\" }}\n      empty={\n        <div style={style}>\n          <div style={{ padding: \"24px\", textAlign: \"center\", color: token(\"textMuted\") }}>\n            No actions recorded yet\n          </div>\n        </div>\n      }\n      footer={\n        <div style={{ padding: \"24px\", textAlign: \"center\", color: token(\"textMuted\") }}>\n          Start of action history\n        </div>\n      }\n      renderItem={(item) => {\n        const { group } = item;\n        const shine = newRepCuids.has(group.representative.cuid);\n        return (\n          <>\n            {shine && (\n              <div\n                style={{\n                  position: \"absolute\",\n                  inset: 0,\n                  pointerEvents: \"none\",\n                  background:\n                    \"linear-gradient(90deg, transparent 0%, rgba(148, 210, 255, 0.13) 50%, transparent 100%)\",\n                  animation: \"__nice-action-shine 0.65s ease-out forwards\",\n                }}\n              />\n            )}\n            <ActionEntryRow\n              entry={group.representative}\n              isSelected={\n                selectedCuid === group.representative.cuid ||\n                group.rest.some((e) => e.cuid === selectedCuid)\n              }\n              isLatest={item.groupIndex === 0}\n              latestTime={latestTime}\n              childEntries={getGroupChildEntries(group, childEntriesMap)}\n              breakReasons={item.breakReasons}\n              groupEntries={\n                group.rest.length > 0 ? [group.representative, ...group.rest] : undefined\n              }\n              selectedGroupCuid={selectedCuid}\n              onSelectGroupEntry={(cuid) => onSubClick(cuid, selectedCuid === cuid)}\n              onClick={() => onGroupClick(group)}\n            />\n          </>\n        );\n      }}\n    />\n  );\n}\n","import type { TrafficMetricsCore } from \"@nice-code/devtools-core\";\nimport { NiceUiListDetailSplit, NiceUiPanelShell, NiceUiSegmentedControl } from \"@nice-code/ui\";\nimport {\n  FollowLatestToggles,\n  type IDevtoolsBasePrefs,\n  TrafficPanel,\n  useDevtoolsPrefs,\n  useDevtoolsTheme,\n} from \"nice-devtools-shared\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport type { IActionDevtoolsSource, IDevtoolsActionEntry } from \"../core/ActionDevtools.types\";\nimport { ActionDetailPanel } from \"./components/action_detail/ActionDetailPanel\";\nimport { ActionList } from \"./components/action_list/ActionList\";\nimport { safeStringify } from \"./components/utils\";\n\nconst PANEL_DOM_ID = \"__nice-action-devtools-panel\";\n\n// Suite-specific keyframes, appended to the shared injected panel styles.\nconst PANEL_EXTRA_CSS = `\n    @keyframes __nice-action-pulse {\n      0%, 100% { opacity: 1; }\n      50% { opacity: 0.35; }\n    }\n    @keyframes __nice-action-shine {\n      0%   { transform: translateX(-100%); opacity: 0; }\n      15%  { opacity: 1; }\n      85%  { opacity: 1; }\n      100% { transform: translateX(200%); opacity: 0; }\n    }\n`;\n\nconst PREFS_KEY = \"__nice-action-devtools-prefs\";\nconst DETAIL_RATIO_DEFAULT = 0.5;\n\nexport interface INiceActionDevtoolsProps {\n  core: IActionDevtoolsSource;\n  /**\n   * Wire-traffic metrics for this app's connections — construct one\n   * `TrafficMetricsCore` and feed it from `connectChannel(…, { wireTap: traffic.wireTap })`.\n   * When present the panel grows a \"Traffic\" tab (counts + bytes per rolling window,\n   * per-lane breakdown, sparkline, largest frames).\n   */\n  traffic?: TrafficMetricsCore;\n  /**\n   * External \"select this\" nudge (event-log nav or cross-lane selection sync). Applied once per\n   * distinct `nonce`; the panel keeps owning its selection afterwards. Either an exact `cuid` (a\n   * specific entry) or a **logical** `domain`+`actionId` (select this lane's latest matching root\n   * entry — a miss leaves the selection unchanged).\n   */\n  selectRequest?: { cuid?: string; domain?: string; actionId?: string; nonce: number };\n  /**\n   * Fired when the USER selects an entry (not when a `selectRequest` is applied), reporting the\n   * entry's logical identity — the signal the window broadcasts to sync selection across lanes.\n   */\n  onSelect?: (selector: { domain: string; actionId: string }) => void;\n}\n\nexport interface IEntryGroup {\n  representative: IDevtoolsActionEntry;\n  rest: IDevtoolsActionEntry[];\n}\n\nfunction getHandlerKey(entry: IDevtoolsActionEntry): string {\n  const hop = entry.meta.routing[0];\n  if (hop == null) return \"none\";\n  if (hop.handlerType === \"local\") return \"local\";\n  return `ext:${hop.transport ?? \"ext\"}`;\n}\n\n/** Same logical call — used both for grouping and for deciding which running rows to show. */\nfunction entriesShareActionInput(a: IDevtoolsActionEntry, b: IDevtoolsActionEntry): boolean {\n  if (a.actionId !== b.actionId || a.domain !== b.domain) return false;\n  return a.inputHash != null && b.inputHash != null\n    ? a.inputHash === b.inputHash\n    : safeStringify(a.input, 0) === safeStringify(b.input, 0);\n}\n\nfunction canGroupWith(a: IDevtoolsActionEntry, b: IDevtoolsActionEntry): boolean {\n  if (!entriesShareActionInput(a, b)) return false;\n  const handlerA = getHandlerKey(a);\n  const handlerB = getHandlerKey(b);\n  // \"none\" means routing wasn't captured (e.g. aborted before dispatch recorded the hop, or a running\n  // entry whose transport hasn't been resolved yet). Only treat handlers as conflicting when both\n  // sides have a known, differing key.\n  const handlerConflict = handlerA !== \"none\" && handlerB !== \"none\" && handlerA !== handlerB;\n  if (handlerConflict) return false;\n  // A running entry has no final status/output yet. Fold it into a same-identity group (rendered with\n  // a live running indicator) instead of forcing a lone row that collapses into the group the instant\n  // it settles — the flash we want to avoid. Once both entries have settled the checks below separate\n  // them by final status + output.\n  if (a.status === \"running\" || b.status === \"running\") return true;\n  // Only enforce output equality when both entries have a hash (i.e. a result payload exists).\n  // Aborted actions won't have one, so they group purely on input + status.\n  const outputMatch =\n    a.outputHash != null && b.outputHash != null ? a.outputHash === b.outputHash : true;\n  return a.status === b.status && outputMatch;\n}\n\nfunction groupEntries(entries: readonly IDevtoolsActionEntry[]): IEntryGroup[] {\n  const groups: IEntryGroup[] = [];\n  for (const entry of entries) {\n    const last = groups[groups.length - 1];\n    if (last != null && canGroupWith(entry, last.representative)) {\n      last.rest.push(entry);\n    } else {\n      groups.push({ representative: entry, rest: [] });\n    }\n  }\n  return groups;\n}\n\ntype TActionPanelMode = \"actions\" | \"traffic\";\n\nexport function NiceActionDevtools({\n  core,\n  traffic,\n  selectRequest,\n  onSelect,\n}: INiceActionDevtoolsProps) {\n  useDevtoolsTheme();\n  const [mode, setMode] = useState<TActionPanelMode>(\"actions\");\n  const [prefs, setPrefs] = useDevtoolsPrefs<IDevtoolsBasePrefs>(PREFS_KEY, {\n    detailRatio: DETAIL_RATIO_DEFAULT,\n    stayOnLatest: true,\n    followLatestOnSelect: true,\n  });\n  const [entries, setEntries] = useState<readonly IDevtoolsActionEntry[]>([]);\n  const [paused, setPaused] = useState(core.paused);\n  const [selectedCuid, setSelectedCuid] = useState<string | null>(null);\n  useEffect(\n    () =>\n      core.subscribe((next) => {\n        setEntries(next);\n        setPaused(core.paused);\n      }),\n    [core],\n  );\n\n  // Apply an external \"select this\" nudge (event-log click or cross-lane sync) once per nonce; the\n  // user keeps control afterwards. An exact `cuid` selects that entry; a logical `domain`+`actionId`\n  // resolves to this lane's latest matching root entry (entries are newest-first) — a miss is a\n  // no-op so an unrelated lane keeps its selection.\n  // biome-ignore lint/correctness/useExhaustiveDependencies: fire only when the nonce changes.\n  useEffect(() => {\n    if (selectRequest == null) return;\n    if (selectRequest.cuid != null) {\n      setSelectedCuid(selectRequest.cuid);\n      setPrefs({ stayOnLatest: false });\n      return;\n    }\n    if (selectRequest.domain != null && selectRequest.actionId != null) {\n      const match = entries.find(\n        (entry) =>\n          entry.parentCuid == null &&\n          entry.domain === selectRequest.domain &&\n          entry.actionId === selectRequest.actionId,\n      );\n      if (match != null) {\n        setSelectedCuid(match.cuid);\n        setPrefs({ stayOnLatest: false });\n      }\n    }\n  }, [selectRequest?.nonce]);\n\n  const groups = useMemo(() => {\n    const byCuid = new Map(entries.map((e) => [e.cuid, e]));\n    // Children render nested under their parent group, never as their own root row. Running roots are\n    // kept (unlike the old behaviour that dropped every running entry): a long-lived action — e.g. one\n    // waiting for a WebSocket to connect + handshake before it can be sent — must be visible *while in\n    // flight*, not only once it finishes. `canGroupWith` folds a running entry into an adjacent\n    // identical group, so repeated fast calls still don't flash a lone row that immediately collapses.\n    const roots = entries.filter((e) => e.parentCuid == null || !byCuid.has(e.parentCuid));\n    return groupEntries(roots);\n  }, [entries]);\n\n  const childEntriesMap = useMemo(() => {\n    const map = new Map<string, IDevtoolsActionEntry[]>();\n    for (const entry of entries) {\n      if (entry.parentCuid == null) continue;\n      const existing = map.get(entry.parentCuid) ?? [];\n      map.set(entry.parentCuid, [...existing, entry]);\n    }\n    for (const arr of map.values()) {\n      arr.sort((a, b) => a.startTime - b.startTime);\n    }\n    return map;\n  }, [entries]);\n\n  const { detailRatio, stayOnLatest, followLatestOnSelect } = prefs;\n\n  // \"Follow latest\": whenever a new group lands at the head of the (newest-first)\n  // list, follow it so the detail pane always shows the latest action. The head\n  // group's representative is the newest root — now including a still-running one —\n  // so its cuid changes as new actions start or finish, which is exactly the signal\n  // to re-select.\n  const latestCuid = groups.length > 0 ? groups[0].representative.cuid : null;\n  useEffect(() => {\n    if (stayOnLatest && latestCuid != null) setSelectedCuid(latestCuid);\n  }, [stayOnLatest, latestCuid]);\n\n  // Apply a new selection and reconcile follow state, mirroring the timeline\n  // toggles: selecting the latest action means \"show me the latest\" (resume\n  // following when the sub-toggle allows it); any other selection is the user\n  // taking control, so following stops.\n  const applySelection = (next: string | null) => {\n    if (next != null && next === latestCuid && followLatestOnSelect) {\n      if (!stayOnLatest) setPrefs({ stayOnLatest: true });\n    } else if (stayOnLatest) {\n      setPrefs({ stayOnLatest: false });\n    }\n    setSelectedCuid(next);\n    // Report the user's pick (never a programmatic `selectRequest`, which sets `selectedCuid`\n    // directly) so the window can sync the same logical entry across lanes — echo-free.\n    if (next != null && onSelect != null) {\n      const entry = entries.find((candidate) => candidate.cuid === next);\n      if (entry != null) onSelect({ domain: entry.domain, actionId: entry.actionId });\n    }\n  };\n\n  const handleGroupRowClick = (group: IEntryGroup) => {\n    const repCuid = group.representative.cuid;\n    const allInGroup = [group.representative, ...group.rest];\n    const selectedInGroup = allInGroup.find((e) => e.cuid === selectedCuid) ?? null;\n    if (selectedInGroup != null && selectedCuid !== repCuid) {\n      applySelection(repCuid);\n    } else {\n      applySelection(selectedCuid === repCuid ? null : repCuid);\n    }\n  };\n\n  const selectedEntry = selectedCuid != null ? entries.find((e) => e.cuid === selectedCuid) : null;\n\n  const selectedEntryParent =\n    selectedEntry?.parentCuid != null\n      ? (entries.find((e) => e.cuid === selectedEntry.parentCuid) ?? null)\n      : null;\n  const selectedEntryChildren =\n    selectedEntry != null\n      ? [...entries]\n          .filter((e) => e.parentCuid === selectedEntry.cuid)\n          .sort((a, b) => a.startTime - b.startTime)\n      : [];\n\n  const virtualListProps = {\n    groups,\n    selectedCuid,\n    onGroupClick: handleGroupRowClick,\n    onSubClick: (cuid: string, isSelected: boolean) => {\n      applySelection(isSelected ? null : cuid);\n    },\n    childEntriesMap,\n  };\n\n  return (\n    <NiceUiPanelShell\n      panelDomId={PANEL_DOM_ID}\n      extraCss={PANEL_EXTRA_CSS}\n      title=\"⚡ action\"\n      onClear={\n        entries.length > 0\n          ? () => {\n              core.clear();\n              setSelectedCuid(null);\n            }\n          : undefined\n      }\n      paused={paused}\n      onTogglePause={() => core.togglePaused()}\n      headerChildren={\n        traffic != null ? (\n          <NiceUiSegmentedControl<TActionPanelMode>\n            options={[\n              { value: \"actions\", label: \"Actions\" },\n              { value: \"traffic\", label: \"Traffic\" },\n            ]}\n            value={mode}\n            onChange={setMode}\n          />\n        ) : undefined\n      }\n    >\n      {traffic != null && mode === \"traffic\" ? (\n        <TrafficPanel core={traffic} />\n      ) : (\n        <NiceUiListDetailSplit\n          detailRatio={detailRatio}\n          onDetailRatioChange={(ratio) => setPrefs({ detailRatio: ratio })}\n          list={\n            <>\n              <FollowLatestToggles\n                noun=\"action\"\n                stayOnLatest={stayOnLatest}\n                onStayOnLatestChange={(next) => setPrefs({ stayOnLatest: next })}\n                followLatestOnSelect={followLatestOnSelect}\n                onFollowLatestOnSelectChange={(next) => {\n                  // Enabling this while already sitting on the latest action is itself\n                  // a \"select the latest\" intent — start following so the view tracks\n                  // new actions, matching what a fresh click on the latest would do.\n                  if (next && latestCuid != null && selectedCuid === latestCuid && !stayOnLatest) {\n                    setPrefs({ followLatestOnSelect: next, stayOnLatest: true });\n                  } else {\n                    setPrefs({ followLatestOnSelect: next });\n                  }\n                }}\n              />\n              <ActionList\n                {...virtualListProps}\n                style={{ width: \"100%\", flex: 1, minHeight: 0, overflowY: \"auto\" }}\n              />\n            </>\n          }\n          detail={\n            selectedEntry != null ? (\n              <ActionDetailPanel\n                key={selectedEntry.cuid}\n                entry={selectedEntry}\n                parent={selectedEntryParent}\n                childEntries={selectedEntryChildren}\n                onSelectEntry={(cuid) => setSelectedCuid(cuid)}\n              />\n            ) : null\n          }\n        />\n      )}\n    </NiceUiPanelShell>\n  );\n}\n","import {\n  type DevtoolsWindowClient,\n  type IDevtoolsSnapshotScope,\n  summarizeShape,\n} from \"@nice-code/devtools-core\";\nimport type {\n  IActionDevtoolsSource,\n  IDevtoolsActionEntry,\n  TDevtoolsListener,\n} from \"../core/ActionDevtools.types\";\n\n/** The cloneable shape carried over the transport for the action scope. */\ninterface IActionTransportSnapshot {\n  entries: readonly IDevtoolsActionEntry[];\n  paused: boolean;\n}\n\ninterface IActionCommand {\n  type: \"clear\" | \"togglePaused\";\n}\n\n/**\n * Host-side scope wiring the live `ActionDevtoolsCore` (or anything satisfying\n * {@link IActionDevtoolsSource}) into a {@link DevtoolsBridge}: projects entries +\n * paused into a cloneable snapshot and routes clear/pause commands back.\n */\n/**\n * Redact an action entry's payload fields to their shape — for the data-minimized remote path\n * (PLAN-devtools-remote-deploy R4.3/R4.4). `input`/`output`/`error`/`abortReason` and each progress\n * value are where a call's contents live; each becomes its shape. Metadata (id, domain, status,\n * timings, `inputHash`/`outputHash`) survives — enough to answer \"what ran, how long, did it fail\",\n * never the values. Mirrors the server `actionDomainScope`'s `logPayloads:false` redaction.\n */\nfunction redactActionEntry(entry: IDevtoolsActionEntry): IDevtoolsActionEntry {\n  return {\n    ...entry,\n    input: summarizeShape(entry.input),\n    ...(entry.output !== undefined ? { output: summarizeShape(entry.output) } : {}),\n    ...(entry.error !== undefined ? { error: summarizeShape(entry.error) } : {}),\n    ...(entry.abortReason !== undefined ? { abortReason: summarizeShape(entry.abortReason) } : {}),\n    progressUpdates: entry.progressUpdates.map(\n      summarizeShape,\n    ) as IDevtoolsActionEntry[\"progressUpdates\"],\n  };\n}\n\nexport function actionBridgeScope(\n  core: IActionDevtoolsSource,\n  options: { scope?: string; redactValues?: boolean } | string = {},\n): IDevtoolsSnapshotScope {\n  // Back-compat: the old signature was `(core, scope?: string)`.\n  const resolved = typeof options === \"string\" ? { scope: options } : options;\n  const scope = resolved.scope ?? \"action\";\n  const projectEntries =\n    resolved.redactValues === true\n      ? (entries: readonly IDevtoolsActionEntry[]) => entries.map(redactActionEntry)\n      : (entries: readonly IDevtoolsActionEntry[]) => entries;\n  return {\n    scope,\n    getSnapshot: (): IActionTransportSnapshot => ({\n      entries: projectEntries(core.getEntries()),\n      paused: core.paused,\n    }),\n    subscribe: (onChange) => core.subscribe(() => onChange()),\n    applyCommand: (command) => {\n      const cmd = command as IActionCommand;\n      if (cmd.type === \"clear\") core.clear();\n      else if (cmd.type === \"togglePaused\") core.togglePaused();\n    },\n  };\n}\n\n/**\n * Window-side mirror of an `ActionDevtoolsCore`, fed by the host over a\n * {@link DevtoolsWindowClient}. Satisfies {@link IActionDevtoolsSource} so the\n * unchanged `<NiceActionDevtools>` panel renders it; interactive controls\n * (clear/pause) are forwarded to the host as commands.\n */\nexport class RemoteActionDevtoolsCore implements IActionDevtoolsSource {\n  private _entries: readonly IDevtoolsActionEntry[] = [];\n  private _paused = false;\n  private readonly _listeners = new Set<TDevtoolsListener>();\n  private readonly _client: DevtoolsWindowClient;\n  private readonly _clientId: string;\n  private readonly _scope: string;\n\n  constructor(client: DevtoolsWindowClient, clientId: string, scope = \"action\") {\n    this._client = client;\n    this._clientId = clientId;\n    this._scope = scope;\n    client.onSnapshot(clientId, scope, (raw) => {\n      const snapshot = raw as IActionTransportSnapshot;\n      this._entries = snapshot?.entries ?? [];\n      this._paused = snapshot?.paused ?? false;\n      for (const listener of [...this._listeners]) listener(this._entries);\n    });\n  }\n\n  get paused(): boolean {\n    return this._paused;\n  }\n\n  getEntries(): readonly IDevtoolsActionEntry[] {\n    return this._entries;\n  }\n\n  subscribe(listener: TDevtoolsListener): () => void {\n    this._listeners.add(listener);\n    listener(this._entries);\n    return () => {\n      this._listeners.delete(listener);\n    };\n  }\n\n  clear(): void {\n    this._client.sendCommand(this._clientId, this._scope, { type: \"clear\" });\n  }\n\n  togglePaused(): void {\n    this._client.sendCommand(this._clientId, this._scope, { type: \"togglePaused\" });\n  }\n}\n"],"x_google_ignoreList":[33,34,35,36,37,38,39,40,41,42,43],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAS,WAAW,OAAO;CAC1B,IAAI,OAAO,UAAU,UAAU,MAAM,QAAQ;AAC9C;AA41C0B,KAAK,UAAU,EAAE,GAAG,cAAc,CAAC;AAUjC,KAAK,UAAU,EAAE,GAAG,gBAAgB,CAAC;AAY7C,IAAI,YAAY;AAChB,IAAI,YAAY;;;;;;AAmNpC,MAAM,2BAA2B;;AAEjC,MAAM,qBAAqB;AAC3B,MAAM,+BAA+B;AACrC,MAAM,iCAAiC;AACvC,MAAM,oCAAoC;;AAE1C,MAAM,wBAAwB,OAAO;;AAGrC,MAAM,8BAA8B;CACnC;CACA;CACA;AACD;;AAEA,MAAM,4BAA4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