@luuthuong/devboard 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/.claude/skills/devboard/SKILL.md +111 -0
  2. package/bin/devboard.mjs +59 -0
  3. package/dist/assets/CardDetailView-BZE_MfjM.js +24 -0
  4. package/dist/assets/DiffPane-2WnoRvZ0.js +22 -0
  5. package/dist/assets/DiffPane-CpoDDQrA.css +1 -0
  6. package/dist/assets/KnowledgeView-C4WPFAUM.js +3 -0
  7. package/dist/assets/ListBoardView-DEE_eK4h.js +3 -0
  8. package/dist/assets/NewTaskDialog-D8cpc7Bc.js +1 -0
  9. package/dist/assets/OnboardingWizard-9ZkFPGvH.js +1 -0
  10. package/dist/assets/ProcessManagerView-DJOr44DY.js +1 -0
  11. package/dist/assets/ProposalCard-B8jqFtL8.js +1 -0
  12. package/dist/assets/SearchOverlay-qGxzmM_v.js +1 -0
  13. package/dist/assets/SettingsView-C3GkCbTz.js +1 -0
  14. package/dist/assets/SetupProjectView-CSx6ax5r.js +1 -0
  15. package/dist/assets/Surface-BQKeigoq.js +1 -0
  16. package/dist/assets/TaskDescriptionEditor-D0_b81zY.js +58 -0
  17. package/dist/assets/Terminal-BrP-ENHg.css +1 -0
  18. package/dist/assets/Terminal-yq90NOBX.js +80 -0
  19. package/dist/assets/deepEqual-BiJVGDfM.js +1 -0
  20. package/dist/assets/index-BtXUncAU.css +1 -0
  21. package/dist/assets/index-CQnL8JJ5.js +18 -0
  22. package/dist/assets/jsx-runtime-QmcfnBgR.js +1 -0
  23. package/dist/assets/plus-Cecrm8sZ.js +1 -0
  24. package/dist/assets/react-dom-DjtJUrx3.js +1 -0
  25. package/dist/assets/x-B6wVesqk.js +1 -0
  26. package/dist/index.html +22 -0
  27. package/package.json +81 -4
  28. package/server-dist/server/assets/remote-shell.sh +239 -0
  29. package/server-dist/server/board.js +486 -0
  30. package/server-dist/server/commands.js +390 -0
  31. package/server-dist/server/context.js +34 -0
  32. package/server-dist/server/coordination.js +442 -0
  33. package/server-dist/server/editor.js +101 -0
  34. package/server-dist/server/events.js +17 -0
  35. package/server-dist/server/fsBrowse.js +143 -0
  36. package/server-dist/server/git.js +258 -0
  37. package/server-dist/server/harness/config.js +90 -0
  38. package/server-dist/server/harness/entry.js +98 -0
  39. package/server-dist/server/harness/intents.js +268 -0
  40. package/server-dist/server/harness/kbIndex.js +291 -0
  41. package/server-dist/server/harness/kbStore.js +258 -0
  42. package/server-dist/server/harness/librarian.js +147 -0
  43. package/server-dist/server/harness/pack.js +182 -0
  44. package/server-dist/server/harness/proposals.js +113 -0
  45. package/server-dist/server/harness/repo.js +150 -0
  46. package/server-dist/server/harness/scrub.js +30 -0
  47. package/server-dist/server/harness/service.js +683 -0
  48. package/server-dist/server/harness/template/README.md +38 -0
  49. package/server-dist/server/harness/template/agents/code-reviewer.md +23 -0
  50. package/server-dist/server/harness/template/agents/security-reviewer.md +20 -0
  51. package/server-dist/server/harness/template/agents/test-writer.md +16 -0
  52. package/server-dist/server/harness/template/agents.yaml +41 -0
  53. package/server-dist/server/harness/template/harness.json +11 -0
  54. package/server-dist/server/harness/template/kb/team/README.md +4 -0
  55. package/server-dist/server/harness/template/skills/aidlc-design/SKILL.md +41 -0
  56. package/server-dist/server/harness/template/skills/aidlc-implement/SKILL.md +34 -0
  57. package/server-dist/server/harness/template/skills/aidlc-postmortem/SKILL.md +35 -0
  58. package/server-dist/server/harness/template/skills/aidlc-pr/SKILL.md +22 -0
  59. package/server-dist/server/harness/template/skills/aidlc-requirements/SKILL.md +40 -0
  60. package/server-dist/server/harness/template/skills/aidlc-units/SKILL.md +36 -0
  61. package/server-dist/server/harness/template/skills/project-kb/SKILL.md +41 -0
  62. package/server-dist/server/harness/usage.js +82 -0
  63. package/server-dist/server/hooks.js +222 -0
  64. package/server-dist/server/http.js +266 -0
  65. package/server-dist/server/index.js +77 -0
  66. package/server-dist/server/integrations.js +292 -0
  67. package/server-dist/server/pollers.js +332 -0
  68. package/server-dist/server/processes.js +123 -0
  69. package/server-dist/server/psmux.js +120 -0
  70. package/server-dist/server/pty.js +93 -0
  71. package/server-dist/server/remote.js +216 -0
  72. package/server-dist/server/sessionReaper.js +101 -0
  73. package/server-dist/server/sessions.js +315 -0
  74. package/server-dist/server/settings.js +125 -0
  75. package/server-dist/server/skill.js +29 -0
  76. package/server-dist/server/tmux.js +217 -0
  77. package/server-dist/server/transcripts.js +334 -0
  78. package/server-dist/server/util.js +286 -0
  79. package/server-dist/src/types/index.js +53 -0
  80. package/README.md +0 -3
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: devboard
3
+ description: Inspect cards, delegate work to subagents, orchestrate Claude sessions, and message other agents. Use whenever the user mentions DevBoard, asks you to spawn or fork a subagent, asks you to coordinate with another running Claude, or is working inside a card's tmux session and wants to use the `devboard` CLI. Covers subagents, DMs and handles.
4
+ ---
5
+
6
+ # DevBoard — Agent Skill
7
+
8
+ You're a Claude running inside a **DevBoard card's tmux session**. Every card has its own tmux session; you can see and message other cards via the `devboard` CLI.
9
+
10
+ ## Quick reference
11
+
12
+ ```
13
+ devboard list # all active cards
14
+ devboard show <card> # details for a card
15
+ devboard sessions # all live tmux sessions
16
+ devboard subagent spawn --handle x "goal" # delegate to a fresh child session
17
+ devboard subagent fork --handle y "goal" # delegate with a copy of your transcript
18
+ devboard subagent list # your children, with context usage + pane peek
19
+ devboard subagent model <card> opus # switch an owned child to another model
20
+ devboard parent dm "progress update" # report to the card that owns you
21
+ devboard send <card> "msg" --mode ... # steer (default) | queue | interrupt
22
+ devboard dm <handle> "message" # direct message another agent
23
+ devboard dm history <handle> # DM history with that handle
24
+ ```
25
+
26
+ All commands accept `-j/--json` for machine-readable output.
27
+
28
+ ## Identity
29
+
30
+ - You are auto-identified from your tmux session — the CLI looks up the card you're in and derives a handle from the card's display name (e.g. `Alice card` → `@alice_card`, truncated to 24 chars). Dashes you typed survive, so `alice-card` stays `@alice-card`.
31
+ - Handles disambiguate on collision (`@alice_card_2`, `@alice_card_3`…).
32
+ - You don't pick or register your handle — it's derived at send time.
33
+ - To see your handle, send a DM and look at the prefix the recipient gets.
34
+
35
+ ## Subagents
36
+
37
+ Subagents are ordinary DevBoard cards with their own tmux session, transcript, and
38
+ auto-compaction. Unlike Claude Code's built-in subagents they can compact themselves, so
39
+ they are the right tool for long delegated work. Run these from your own card's session.
40
+
41
+ ```
42
+ devboard subagent spawn --handle parser-bug "investigate the failing parser test"
43
+ devboard subagent fork --handle cache-path "same task, try the cache instead"
44
+ devboard subagent fork --from parser-bug --handle other-angle "retry from a different angle"
45
+ devboard subagent list # active + archived children, with a live pane peek
46
+ devboard subagent dm parser-bug "any progress?"
47
+ devboard subagent model parser-bug opus # switch it to another model
48
+ devboard subagent archive parser-bug
49
+ devboard subagent resume parser-bug # bring an archived child back
50
+ ```
51
+
52
+ - **`--handle` is required.** It becomes the child's card name and its `@handle`, so
53
+ DMs read `[DM from @parser-bug]` instead of a slug of your goal text.
54
+ - **`spawn` starts clean** (~30k context). **`fork` copies your transcript**, so the child
55
+ starts as expensive as you are. Prefer `spawn` unless the child genuinely needs your history.
56
+ - **`--from <card>`** forks one of your existing children instead of yourself. The copy
57
+ becomes that child's sibling, still owned by you, so it works at depth limit 1.
58
+ - **`--model sonnet`** picks the model. **`--context-threshold 250k`** sets a per-child
59
+ compaction schedule that escalates like the global one: a queued nudge at 250k, a
60
+ steered reminder at 350k, and an interrupt with `/compact` at 450k.
61
+ - **A child inherits your model** when you don't pass `--model`, so an Opus card does not
62
+ quietly hand its work to a cheaper model.
63
+ - **`devboard subagent model <card> <model>`** switches a running child. It
64
+ submits `/model <name>`, accepts the "Switch model?" confirmation for you, and records
65
+ the choice so a later `resume` keeps it. The child's pane comes back so you can see
66
+ what actually happened.
67
+ - **Depth is capped** (default 1). A child that tries to spawn its own child gets a clear error.
68
+ - **`devboard subagent send <card> "..." --mode steer|queue|interrupt`** delivers to a child
69
+ the same three ways `devboard send` does.
70
+ - Multi-line goals: `devboard subagent spawn --handle x - <<'EOF' … EOF`.
71
+
72
+ As a child, report with `devboard parent dm "<message>"`. Use
73
+ `devboard parent dm-and-self-archive "<result>"` **only when the goal is fully reached** — it
74
+ archives you. If the parent wants you to stay available for follow-ups, keep using plain `dm`.
75
+
76
+ Delivered DMs state the relationship, so `[DM from @coordinator (parent agent)]` is your
77
+ owner talking, and `[DM from @parser-bug (subagent)]` is one of your children reporting.
78
+
79
+ ## DM etiquette
80
+
81
+ 1. **DMs are private** — `devboard dm <handle> "..."` talks to one agent. There are no shared rooms.
82
+ 2. **Prefix convention is automatic** — when you send `hello`, the recipient gets `[DM from @your_handle]: hello`. You don't add the prefix yourself.
83
+ 3. **Messages arrive in your pane** — DMs are pasted straight into your prompt as `[DM from @…]: …`. Treat them like push notifications and reply with `devboard dm` if relevant.
84
+ 4. **Card must have a tmux session** — a card without a running session can't receive a DM (the message is still logged).
85
+ 5. **Read history on demand** — `devboard dm history <handle>` shows past messages; don't poll it.
86
+ 6. **Don't spam** — a DM interrupts the recipient's current turn. Keep it relevant.
87
+
88
+ ## Storage (for debugging)
89
+
90
+ ```
91
+ ~/.devboard/channels/
92
+ dm/<cardA>__<cardB>.jsonl # DM logs (cardIds alphabetically sorted)
93
+ images/<msgId>/ # attachments
94
+ ```
95
+
96
+ (The directory is still named `channels` so existing DM history keeps working.)
97
+
98
+ ## Related CLI features
99
+
100
+ - `devboard sessions` — all live tmux sessions with card associations. Useful for checking who's online before messaging.
101
+ - `devboard capture <card>` — peek at another card's tmux pane (without disturbing it).
102
+ - `devboard transcript <card> -n 5` — see last N turns of that card's Claude conversation.
103
+ - `devboard export [card] [--out file.md]`: the whole session as Markdown, the same text the app's "Copy conversation as Markdown" gives (user and assistant messages). No card means your own; also takes a `@handle` or a Claude session id. Prints to stdout unless `--out`.
104
+ - `devboard send <card> "msg"` — send a prompt directly to a card's tmux session (low-level; the agent won't see it as a DM). Prefer `devboard dm` for 1:1.
105
+ - `--mode steer` (default) pastes it now; the agent reads it between turns, so it lands mid-work but never cuts a turn short.
106
+ - `--mode queue` (or `enqueue`) puts it in the card's prompt queue, sent once the agent goes idle. Use it when the message is "next up", not "right now".
107
+ - `--mode interrupt` sends Escape first, so the agent stops what it is doing and reads the message immediately. Reserve it for genuine stop-work situations.
108
+ - The same three modes back the auto-compact thresholds in Settings → Self-Compact.
109
+ - `devboard relink <card> <session-id>` — point a card at a different transcript when it is stuck on a stale session. Never moves or deletes a `.jsonl`.
110
+ - `devboard self-compact - <<'EOF' … EOF` — compact your own session and hand yourself a post-compact continuation message. Always pass that handoff; without it you wake up with only the digest.
111
+ - Read `devboard --help` in full. Do not pipe it through `head` or `tail`; the command list continues past the first screen.
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ // `bunx @luuthuong/devboard` — starts the DevBoard server and serves the built UI.
3
+ //
4
+ // devboard [--port <n>] [--host <addr>] [--no-open]
5
+ //
6
+ // The published package ships the server compiled to JS (`server-dist/`). In a repo checkout that
7
+ // build doesn't exist, so fall back to the TypeScript sources through tsx, same as `bun run start`.
8
+ import { spawn } from "node:child_process";
9
+ import { existsSync } from "node:fs";
10
+
11
+ const args = process.argv.slice(2);
12
+ const flag = (name) => {
13
+ const i = args.indexOf(`--${name}`);
14
+ return i === -1 ? undefined : args[i + 1];
15
+ };
16
+
17
+ if (args.includes("--help") || args.includes("-h")) {
18
+ console.log(
19
+ "Usage: devboard [--port <n>] [--host <addr>] [--no-open]\nEnv: DEVBOARD_NO_OPEN, DEVBOARD_HOST, DEVBOARD_PORT, DEVBOARD_TOKEN, DEVBOARD_ALLOWED_HOSTS, DEVBOARD_DATA_DIR"
20
+ );
21
+ process.exit(0);
22
+ }
23
+
24
+ if (flag("port")) process.env.DEVBOARD_PORT = flag("port");
25
+ if (flag("host")) process.env.DEVBOARD_HOST = flag("host");
26
+
27
+ const host = process.env.DEVBOARD_HOST ?? "127.0.0.1";
28
+ const port = process.env.DEVBOARD_PORT ?? 1421;
29
+ const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
30
+ console.log(`DevBoard → ${url}`);
31
+
32
+ // Open the UI in the default browser (best effort; skipped with --no-open, DEVBOARD_NO_OPEN or CI).
33
+ function openBrowser() {
34
+ if (args.includes("--no-open") || process.env.DEVBOARD_NO_OPEN || process.env.CI) return;
35
+ const target = process.env.DEVBOARD_TOKEN ? `${url}/?token=${encodeURIComponent(process.env.DEVBOARD_TOKEN)}` : url;
36
+ const [cmd, cmdArgs] =
37
+ process.platform === "win32"
38
+ ? ["cmd", ["/c", "start", '""', target.replace(/&/g, "^&")]]
39
+ : process.platform === "darwin"
40
+ ? ["open", [target]]
41
+ : ["xdg-open", [target]];
42
+ try {
43
+ const child = spawn(cmd, cmdArgs, { stdio: "ignore", detached: true, windowsHide: true });
44
+ child.on("error", () => {});
45
+ child.unref();
46
+ } catch {
47
+ // no browser available; the URL is printed above
48
+ }
49
+ }
50
+
51
+ const compiled = new URL("../server-dist/server/index.js", import.meta.url);
52
+ if (existsSync(compiled)) {
53
+ await import(compiled.href);
54
+ } else {
55
+ const { register } = await import("tsx/esm/api");
56
+ register();
57
+ await import("../server/index.ts");
58
+ }
59
+ openBrowser();
@@ -0,0 +1,24 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Terminal-yq90NOBX.js","assets/jsx-runtime-QmcfnBgR.js","assets/index-CQnL8JJ5.js","assets/react-dom-DjtJUrx3.js","assets/Surface-BQKeigoq.js","assets/index-BtXUncAU.css","assets/Terminal-BrP-ENHg.css","assets/DiffPane-2WnoRvZ0.js","assets/TaskDescriptionEditor-D0_b81zY.js","assets/x-B6wVesqk.js","assets/DiffPane-CpoDDQrA.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,d as t,f as n,i as r,m as i,n as a,p as o,t as s,u as c}from"./jsx-runtime-QmcfnBgR.js";import{a as l,c as u,d,f,g as p,i as m,l as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./TaskDescriptionEditor-D0_b81zY.js";import{t as C}from"./x-B6wVesqk.js";import{a as w,b as T,o as E,p as D,t as O}from"./Surface-BQKeigoq.js";import{C as k,Ct as A,D as j,E as M,H as N,J as P,K as F,O as I,St as ee,T as te,U as ne,V as L,X as re,Y as R,_ as ie,at as z,b as ae,bt as B,d as V,et as H,ft as oe,h as se,ht as ce,i as le,it as U,lt as ue,m as de,mt as fe,nt as pe,p as me,pt as he,q as ge,rt as _e,st as ve,t as ye,tt as be,u as xe,v as Se,vt as Ce,x as we,xt as Te,y as Ee,z as De}from"./index-CQnL8JJ5.js";import{t as Oe}from"./deepEqual-BiJVGDfM.js";import{a as ke,i as Ae,t as je}from"./ProposalCard-B8jqFtL8.js";var Me={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Me.node;var Ne=A(Me),Pe={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Pe.node;var Fe=A(Pe),Ie={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ie.node;var Le=A(Ie),Re={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Re.node;var ze=A(Re),Be={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Be.node;var Ve=A(Be),He={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};He.node;var Ue=A(He),We={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};We.node;var Ge=A(We),Ke={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ke.node;var qe=A(Ke),Je={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Je.node;var Ye=A(Je),Xe={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Xe.node;var Ze=A(Xe),W=c(),G=i(t(),1),K=s(),Qe=e=>e.toLocaleString(`en-US`);function $e(e){let t=(0,W.c)(56),{sessionId:n}=e,[i,a]=(0,G.useState)(void 0),o,s;if(t[0]===n?(o=t[1],s=t[2]):(o=()=>{let e=!0,t=()=>r(`session_usage`,{sessionId:n}).then(t=>e&&a(t)).catch(()=>e&&a(tt));a(void 0),t();let i=setInterval(t,1e4);return()=>{e=!1,clearInterval(i)}},s=[n],t[0]=n,t[1]=o,t[2]=s),(0,G.useEffect)(o,s),i===void 0)return null;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsxs)(`div`,{className:`cdv-empty-copy bd-usage-empty`,children:[(0,K.jsx)(`h3`,{children:`No usage data yet`}),(0,K.jsx)(`p`,{children:`This session has no assistant responses to read usage from.`})]}),t[3]=e):e=t[3],e}let c=Math.min(100,Math.max(0,i.usedPercentage)),l=c>=85?`danger`:c>=65?`warning`:`ok`,u=i.model||`—`,d;t[4]===u?d=t[5]:(d={label:`Model`,value:u},t[4]=u,t[5]=d);let f;t[6]===i.inputTokens?f=t[7]:(f=Qe(i.inputTokens),t[6]=i.inputTokens,t[7]=f);let p;t[8]===f?p=t[9]:(p={label:`Input tokens`,value:f},t[8]=f,t[9]=p);let m;t[10]===i.outputTokens?m=t[11]:(m=Qe(i.outputTokens),t[10]=i.outputTokens,t[11]=m);let h;t[12]===m?h=t[13]:(h={label:`Output tokens`,value:m},t[12]=m,t[13]=h);let g;t[14]===i.costUsd?g=t[15]:(g=i.costUsd===null?`—`:`$${i.costUsd.toFixed(2)}`,t[14]=i.costUsd,t[15]=g);let _;t[16]===g?_=t[17]:(_={label:`Cost`,value:g},t[16]=g,t[17]=_);let v;t[18]!==_||t[19]!==d||t[20]!==p||t[21]!==h?(v=[d,p,h,_],t[18]=_,t[19]=d,t[20]=p,t[21]=h,t[22]=v):v=t[22];let y=v,b;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,K.jsx)(`span`,{children:`Context window`}),t[23]=b):b=t[23];let x;t[24]===c?x=t[25]:(x=Math.round(c),t[24]=c,t[25]=x);let S;t[26]===x?S=t[27]:(S=(0,K.jsxs)(`div`,{className:`bd-usage-head`,children:[b,(0,K.jsxs)(`b`,{children:[x,`%`]})]}),t[26]=x,t[27]=S);let C;t[28]===c?C=t[29]:(C=Math.round(c),t[28]=c,t[29]=C);let w=`${c}%`,T;t[30]===w?T=t[31]:(T=(0,K.jsx)(`i`,{style:{width:w}}),t[30]=w,t[31]=T);let E;t[32]!==C||t[33]!==T||t[34]!==l?(E=(0,K.jsx)(`div`,{className:`bd-usage-bar`,"data-tone":l,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C,children:T}),t[32]=C,t[33]=T,t[34]=l,t[35]=E):E=t[35];let D;t[36]===i.tokens?D=t[37]:(D=Qe(i.tokens),t[36]=i.tokens,t[37]=D);let O;t[38]===i.contextWindowSize?O=t[39]:(O=i.contextWindowSize>0&&` of ${Qe(i.contextWindowSize)}`,t[38]=i.contextWindowSize,t[39]=O);let k;t[40]!==D||t[41]!==O?(k=(0,K.jsxs)(`p`,{className:`bd-usage-sub`,children:[D,O,` tokens in context`]}),t[40]=D,t[41]=O,t[42]=k):k=t[42];let A;t[43]!==S||t[44]!==E||t[45]!==k?(A=(0,K.jsxs)(`section`,{className:`bd-usage-ctx`,"aria-label":`Context window`,children:[S,E,k]}),t[43]=S,t[44]=E,t[45]=k,t[46]=A):A=t[46];let j;t[47]===y?j=t[48]:(j=(0,K.jsx)(`dl`,{className:`bd-usage-grid`,children:y.map(et)}),t[47]=y,t[48]=j);let M;t[49]===i.estimated?M=t[50]:(M=i.estimated&&(0,K.jsx)(`p`,{className:`bd-usage-sub`,children:`Estimated from the session transcript: the window size is assumed and cost is unavailable. Install the Claude Code statusline in Settings → General for exact figures.`}),t[49]=i.estimated,t[50]=M);let N;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,K.jsx)(`p`,{className:`bd-usage-sub`,children:`Input and output are lifetime totals for the session, so they stay high after a compact; the context bar does not.`}),t[51]=N):N=t[51];let P;return t[52]!==A||t[53]!==j||t[54]!==M?(P=(0,K.jsxs)(`div`,{className:`bd-usage`,children:[A,j,M,N]}),t[52]=A,t[53]=j,t[54]=M,t[55]=P):P=t[55],P}function et(e){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:e.label}),(0,K.jsx)(`dd`,{children:e.value})]},e.label)}function tt(e){return e??null}function nt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var rt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,it=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,at={};function ot(e,t){return((t||at).jsx?it:rt).test(e)}var st=/[ \t\n\f\r]/g;function ct(e){return typeof e==`object`?e.type===`text`&&q(e.value):q(e)}function q(e){return e.replace(st,``)===``}var lt=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};lt.prototype.normal={},lt.prototype.property={},lt.prototype.space=void 0;function ut(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new lt(n,r,t)}function dt(e){return e.toLowerCase()}var ft=class{constructor(e,t){this.attribute=t,this.property=e}};ft.prototype.attribute=``,ft.prototype.booleanish=!1,ft.prototype.boolean=!1,ft.prototype.commaOrSpaceSeparated=!1,ft.prototype.commaSeparated=!1,ft.prototype.defined=!1,ft.prototype.mustUseProperty=!1,ft.prototype.number=!1,ft.prototype.overloadedBoolean=!1,ft.prototype.property=``,ft.prototype.spaceSeparated=!1,ft.prototype.space=void 0;var pt=o({boolean:()=>J,booleanish:()=>Y,commaOrSpaceSeparated:()=>$,commaSeparated:()=>Q,number:()=>X,overloadedBoolean:()=>ht,spaceSeparated:()=>Z}),mt=0,J=gt(),Y=gt(),ht=gt(),X=gt(),Z=gt(),Q=gt(),$=gt();function gt(){return 2**++mt}var _t=Object.keys(pt),vt=class extends ft{constructor(e,t,n,r){let i=-1;if(super(e,t),yt(this,`space`,r),typeof n==`number`)for(;++i<_t.length;){let e=_t[i];yt(this,_t[i],(n&pt[e])===pt[e])}}};vt.prototype.defined=!0;function yt(e,t,n){n&&(e[t]=n)}function bt(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new vt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[dt(r)]=r,n[dt(a.attribute)]=r}return new lt(t,n,e.space)}var xt=bt({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:Z,ariaCurrent:null,ariaDescribedBy:Z,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:Z,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:Z,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Z,ariaLevel:X,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:Z,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:Z,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:Y,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function St(e,t){return t in e?e[t]:t}function Ct(e,t){return St(e,t.toLowerCase())}var wt=bt({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Q,acceptCharset:Z,accessKey:Z,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alpha:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:Z,autoFocus:J,autoPlay:J,blocking:Z,capture:null,charSet:null,checked:J,cite:null,className:Z,closedBy:null,colorSpace:null,cols:X,colSpan:X,command:null,commandFor:null,content:null,contentEditable:Y,controls:J,controlsList:Z,coords:X|Q,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:ht,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:Z,height:X,hidden:ht,high:X,href:null,hrefLang:null,htmlFor:Z,httpEquiv:Z,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:Z,itemRef:Z,itemScope:J,itemType:Z,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:J,optimum:X,pattern:null,ping:Z,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:Z,required:J,reversed:J,rows:X,rowSpan:X,sandbox:Z,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootCustomElementRegistry:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shadowRootSerializable:J,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:Y,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Z,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:J,disablePictureInPicture:J,disableRemotePlayback:J,exportParts:Q,part:Z,prefix:null,property:null,results:X,security:null,unselectable:null},space:`html`,transform:Ct}),Tt=bt({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:$,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:Z,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Q,g2:Q,glyphName:Q,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:$,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Z,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$,rev:$,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$,requiredFeatures:$,requiredFonts:$,requiredFormats:$,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:$,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:St}),Et=bt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Dt=bt({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ct}),Ot=bt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),kt={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},At=/[A-Z]/g,jt=/-[a-z]/g,Mt=/^data[-\w.:]+$/i;function Nt(e,t){let n=dt(t),r=t,i=ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Mt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(jt,Ft);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!jt.test(e)){let n=e.replace(At,Pt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=vt}return new i(r,t)}function Pt(e){return`-`+e.toLowerCase()}function Ft(e){return e.charAt(1).toUpperCase()}var It=ut([xt,wt,Et,Dt,Ot],`html`),Lt=ut([xt,Tt,Et,Dt,Ot],`svg`);function Rt(e){return e.join(` `).trim()}var zt=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Bt=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(zt());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Vt=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ht=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Bt()),i=Vt();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Ut=Gt(`end`),Wt=Gt(`start`);function Gt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Kt(e){let t=Wt(e),n=Ut(e);if(t&&n)return{start:t,end:n}}var qt=i(Ht(),1),Jt={}.hasOwnProperty,Yt=new Map,Xt=/[A-Z]/g,Zt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Qt=new Set([`td`,`th`]),$t=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function en(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=fn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=dn(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Lt:It,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function tn(e,t,n){if(t.type===`element`)return nn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return rn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return on(e,t,n);if(t.type===`mdxjsEsm`)return an(e,t);if(t.type===`root`)return sn(e,t,n);if(t.type===`text`)return cn(e,t)}function nn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Lt,e.schema=i),e.ancestors.push(t);let a=vn(e,t.tagName,!1),o=pn(e,t),s=hn(e,t);return Zt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ct(e)})),ln(e,o,a,t),un(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rn(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}yn(e,t.position)}function an(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yn(e,t.position)}function on(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Lt,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:vn(e,t.name,!0),o=mn(e,t),s=hn(e,t);return ln(e,o,a,t),un(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sn(e,t,n){let r={};return un(r,hn(e,t)),e.create(t,e.Fragment,r,n)}function cn(e,t){return t.value}function ln(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function un(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function dn(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function fn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Wt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function pn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Jt.call(t.properties,i)){let a=gn(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Qt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function mn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else yn(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else yn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function hn(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=tn(e,a,o);s!==void 0&&n.push(s)}return n}function gn(e,t,n){let r=Nt(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nt(n):Rt(n)),r.property===`style`){let t=typeof n==`object`?n:_n(e,String(n));return e.stylePropertyNameCase===`css`&&(t=bn(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?kt[r.property]||r.property:r.attribute,n]}}function _n(e,t){try{return(0,qt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new v("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=$t+`#cannot-parse-style-attribute`,r}}function vn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ot(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ot(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Jt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);yn(e)}function yn(e,t){let n=new v("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=$t+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function bn(e){let t={},n;for(n in e)Jt.call(e,n)&&(t[xn(n)]=e[n]);return t}function xn(e){let t=e.replace(Xt,Sn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Sn(e){return`-`+e.toLowerCase()}var Cn={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function wn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&f(e.charCodeAt(n+1))&&f(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Tn(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function En(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
4
+ `}]}function Dn(e,t){let n=t.value?t.value+`
5
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function On(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kn(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function An(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=wn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function jn(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mn(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Nn(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Pn(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Nn(e,t);let i={src:wn(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Fn(e,t){let n={src:wn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function In(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ln(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Nn(e,t);let i={href:wn(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Rn(e,t){let n={href:wn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zn(e,t,n){let r=e.all(t),i=n?Bn(n):Vn(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
6
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
7
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Bn(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Vn(n[r])}return t}function Vn(e){return e.spread??e.children.length>1}function Hn(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Un(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wn(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Gn(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kn(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Wt(t.children[1]),o=Ut(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function qn(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Jn(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Yn=9,Xn=32;function Zn(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Qn(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Qn(t.slice(i),i>0,!1)),a.join(``)}function Qn(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Yn||t===Xn;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Yn||t===Xn;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function $n(e,t){let n={type:`text`,value:Zn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function er(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var tr={blockquote:Tn,break:En,code:Dn,delete:On,emphasis:kn,footnoteReference:An,heading:jn,html:Mn,imageReference:Pn,image:Fn,inlineCode:In,linkReference:Ln,link:Rn,listItem:zn,list:Hn,paragraph:Un,root:Wn,strong:Gn,table:Kn,tableCell:Jn,tableRow:qn,text:$n,thematicBreak:er,toml:nr,yaml:nr,definition:nr,footnoteDefinition:nr};function nr(){}var{defineProperty:rr}=Object,ir=typeof self==`object`?self:globalThis,ar=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ir[e](t)},or=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?rr(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ir[e]==`function`?ar(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(ar(a,o),i)};return r},sr=e=>or(new Map,e)(0),cr=``,{toString:lr}={},{keys:ur,is:dr}=Object,fr=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=lr.call(e).slice(8,-1);switch(n){case`Array`:return[1,cr];case`Object`:return[2,cr];case`Date`:return[3,cr];case`RegExp`:return[4,cr];case`Map`:return[5,cr];case`Set`:return[6,cr];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},pr=([e,t])=>e===0&&(t===`function`||t===`symbol`),mr=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=fr(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&dr(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of ur(o))(e||!pr(fr(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?cr:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(pr(fr(n))||pr(fr(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!pr(fr(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},hr=(e,{json:t,lossy:n}={})=>{let r=[];return mr(!(t||n),!!t,new Map,r)(e),r},gr=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?sr(hr(e,t)):structuredClone(e):(e,t)=>sr(hr(e,t));function _r(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function vr(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function yr(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||_r,r=e.options.footnoteBackLabel||vr,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=wn(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...gr(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
8
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
9
+ `}]}}var br={}.hasOwnProperty,xr={};function Sr(e,t){let n=t||xr,r=new Map,i=new Map,a={all:s,applyData:wr,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...tr,...n.handlers},one:o,options:n,patch:Cr,wrap:Er};return S(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(br.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=gr(n);return r.children=a.all(e),r}return gr(e)}return(a.options.unknownHandler||Tr)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Dr(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Dr(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Cr(e,t){e.position&&(t.position=Kt(e))}function wr(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,gr(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Tr(e,t){let n=t.data||{},r=`value`in t&&!(br.call(n,`hProperties`)||br.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Er(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
10
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
11
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
12
+ `}),n}function Dr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Or(e,t){let n=Sr(e,t),r=n.one(e,void 0),i=yr(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
13
+ `},i)),a}function kr(e,t){return e&&`run`in e?async function(n,r){let i=Or(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Or(n,{file:r,...e||t})}}var Ar=[],jr={allowDangerousHtml:!0},Mr=/^(https?|ircs?|mailto|xmpp)$/i,Nr=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Pr(e){let t=Fr(e),n=Ir(e);return Lr(t.runSync(t.parse(n),n),e)}function Fr(e){let t=e.rehypePlugins||Ar,n=e.remarkPlugins||Ar,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jr}:jr;return u().use(d).use(n).use(kr,r).use(t)}function Ir(e){let t=e.children||``,n=new h;return typeof t==`string`?n.value=t:``+t,n}function Lr(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Rr;for(let e of Nr)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return S(e,l),en(e,{Fragment:K.Fragment,components:i,ignoreInvalidStyle:!0,jsx:K.jsx,jsxs:K.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Cn)if(Object.hasOwn(Cn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Cn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Rr(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Mr.test(e.slice(0,t))?e:``}var zr=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function Br(e,t){return e.replace(/\[Image #(\d+)\]/g,(e,n)=>{let r=t[Number(n)-1];return r?`![Image #${n}](<${a(r)}>)`:e})}function Vr(e){let t=(0,W.c)(28),{card:n}=e,[r,i]=(0,G.useState)(!1),a=n.link.promptBody??``,o,s,c,u,d,f;if(t[0]!==a||t[1]!==n.link.promptImagePaths||t[2]!==r){let e=n.link.promptImagePaths??[],{text:p,files:m}=l(a),h;t[9]===a?h=t[10]:(h=async()=>{try{await navigator.clipboard.writeText(a),i(!0),window.setTimeout(()=>i(!1),1500)}catch{}},t[9]=a,t[10]=h);let g=h;d=`cdv-task`;let _;t[11]===r?_=t[12]:(_=r?(0,K.jsx)(ee,{size:14,"aria-hidden":!0}):(0,K.jsx)(Ne,{size:14,"aria-hidden":!0}),t[11]=r,t[12]=_);let v=r?`Copied`:`Copy`;t[13]!==g||t[14]!==_||t[15]!==v?(f=(0,K.jsx)(`header`,{className:`cdv-task-head`,children:(0,K.jsxs)(E,{size:`sm`,variant:`ghost`,onClick:g,"aria-live":`polite`,children:[_,v]})}),t[13]=g,t[14]=_,t[15]=v,t[16]=f):f=t[16],o=`hist-prose cdv-task-body`,s=!0;let y,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=[b],x={a:Ur},t[17]=y,t[18]=x):(y=t[17],x=t[18]),c=(0,K.jsx)(Pr,{remarkPlugins:y,components:x,children:Br(p,e)}),u=m.length>0&&(0,K.jsx)(`ul`,{className:`nt-attachments cdv-task-files`,"aria-label":`Attached files`,children:m.map(Hr)}),t[0]=a,t[1]=n.link.promptImagePaths,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=u,t[7]=d,t[8]=f}else o=t[3],s=t[4],c=t[5],u=t[6],d=t[7],f=t[8];let p;t[19]!==o||t[20]!==s||t[21]!==c||t[22]!==u?(p=(0,K.jsxs)(`div`,{className:o,"data-md":s,children:[c,u]}),t[19]=o,t[20]=s,t[21]=c,t[22]=u,t[23]=p):p=t[23];let m;return t[24]!==d||t[25]!==f||t[26]!==p?(m=(0,K.jsxs)(`section`,{className:d,children:[f,p]}),t[24]=d,t[25]=f,t[26]=p,t[27]=m):m=t[27],m}function Hr(e){return(0,K.jsxs)(`li`,{className:`nt-chip`,title:e.path,children:[(0,K.jsx)(B,{size:14,strokeWidth:2,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`nt-chip-name`,children:e.name})]},e.path)}function Ur(e){let{node:t,...n}=e;return(0,K.jsx)(`a`,{...n,target:`_blank`,rel:`noopener noreferrer`})}function Wr(e){let t=(0,W.c)(65),{card:n,onDone:r}=e,i=ce(Gr),[a,o]=(0,G.useState)(!1),s=n.link,c=s.promptBody??``,u;t[0]===s.promptImagePaths?u=t[1]:(u=s.promptImagePaths??[],t[0]=s.promptImagePaths,t[1]=u);let d=u,f=!!s.sessionLink,[p,m]=(0,G.useState)(s.name??``),h;t[2]===c?h=t[3]:(h=()=>l(c),t[2]=c,t[3]=h);let[g]=(0,G.useState)(h),[v,y]=(0,G.useState)(g.text),[b,S]=(0,G.useState)(d),[C,w]=(0,G.useState)(g.files),T;t[4]!==v||t[5]!==C?(T=()=>_(v,C),t[4]=v,t[5]=C,t[6]=T):T=t[6];let O=T,k;t[7]!==c||t[8]!==b||t[9]!==O||t[10]!==d||t[11]!==s.name||t[12]!==p?(k=p.trim()!==(s.name??``)||O()!==c.trim()||b.join(`
14
+ `)!==d.join(`
15
+ `),t[7]=c,t[8]=b,t[9]=O,t[10]=d,t[11]=s.name,t[12]=p,t[13]=k):k=t[13];let A=k,j;t[14]!==A||t[15]!==v||t[16]!==a?(j=!!v.trim()&&A&&!a,t[14]=A,t[15]=v,t[16]=a,t[17]=j):j=t[17];let M=j,N;t[18]!==M||t[19]!==n.id||t[20]!==b||t[21]!==O||t[22]!==r||t[23]!==p||t[24]!==i?(N=async()=>{if(!M)return;o(!0);let e=await i(n.id,{name:p,promptBody:O(),promptImagePaths:b});o(!1),e&&r()},t[18]=M,t[19]=n.id,t[20]=b,t[21]=O,t[22]=r,t[23]=p,t[24]=i,t[25]=N):N=t[25];let P=N,F;t[26]===P?F=t[27]:(F=e=>{e.preventDefault(),P()},t[26]=P,t[27]=F);let I;t[28]!==r||t[29]!==P||t[30]!==a?(I=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),P()):e.key===`Escape`&&!a&&(e.stopPropagation(),r())},t[28]=r,t[29]=P,t[30]=a,t[31]=I):I=t[31];let ee;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,K.jsx)(`h3`,{className:`cdv-edit-heading`,children:`Edit task`}),t[32]=ee):ee=t[32];let te;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,K.jsxs)(Ee,{htmlFor:`cdv-task-title`,children:[`Title `,(0,K.jsx)(`span`,{className:`tg-muted`,children:`(optional, defaults to the first line)`})]}),t[33]=te):te=t[33];let ne;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>m(e.target.value),t[34]=ne):ne=t[34];let L;t[35]===p?L=t[36]:(L=(0,K.jsxs)(`div`,{className:`cdv-task-field`,children:[te,(0,K.jsx)(Se,{id:`cdv-task-title`,value:p,onChange:ne,placeholder:`Short name shown on the board card`,autoComplete:`off`})]}),t[35]=p,t[36]=L);let re;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,K.jsx)(Ee,{children:`Description`}),t[37]=re):re=t[37];let R;t[38]!==b||t[39]!==C||t[40]!==g.text?(R=(0,K.jsx)(x,{initialValue:g.text,onChange:y,imagePaths:b,onImagePathsChange:S,files:C,onFilesChange:w,autoFocus:!0}),t[38]=b,t[39]=C,t[40]=g.text,t[41]=R):R=t[41];let z;t[42]===f?z=t[43]:(z=f&&(0,K.jsx)(ie,{children:`Claude already received the original prompt. Changes update this card and apply the next time it is launched from the card.`}),t[42]=f,t[43]=z);let ae;t[44]!==R||t[45]!==z?(ae=(0,K.jsxs)(`div`,{className:`cdv-task-field`,children:[re,R,z]}),t[44]=R,t[45]=z,t[46]=ae):ae=t[46];let B;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsxs)(`span`,{className:`nt-shortcut`,children:[(0,K.jsx)(D,{children:zr?`⌘`:`Ctrl`}),(0,K.jsx)(D,{children:`↵`}),(0,K.jsx)(`span`,{children:`to save`})]}),t[47]=B):B=t[47];let V;t[48]!==r||t[49]!==a?(V=(0,K.jsx)(E,{variant:`ghost`,onClick:r,disabled:a,children:`Cancel`}),t[48]=r,t[49]=a,t[50]=V):V=t[50];let H=!M,oe=a?`Saving...`:`Save changes`,se;t[51]!==H||t[52]!==oe?(se=(0,K.jsx)(E,{type:`submit`,variant:`solid`,disabled:H,children:oe}),t[51]=H,t[52]=oe,t[53]=se):se=t[53];let le;t[54]!==V||t[55]!==se?(le=(0,K.jsxs)(`footer`,{className:`cdv-task-foot`,children:[B,V,se]}),t[54]=V,t[55]=se,t[56]=le):le=t[56];let U;t[57]!==L||t[58]!==ae||t[59]!==le?(U=(0,K.jsxs)(`div`,{className:`cdv-task cdv-task--editing`,children:[ee,L,ae,le]}),t[57]=L,t[58]=ae,t[59]=le,t[60]=U):U=t[60];let ue;return t[61]!==U||t[62]!==F||t[63]!==I?(ue=(0,K.jsx)(`form`,{className:`cdv-pane cdv-scroll cdv-edit`,onSubmit:F,onKeyDown:I,children:U}),t[61]=U,t[62]=F,t[63]=I,t[64]=ue):ue=t[64],ue}function Gr(e){return e.updateCardTask}function Kr(e,t){return t?{exe:t.launcherPrefix?`${t.launcherPrefix} ${e}`:e,model:t.modelFlag??``,separator:t.needsSeparator?` --`:``}:{exe:e,model:``,separator:``}}function qr(e){let t=``;for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function Jr(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``).slice(0,32).replace(/-+$/,``)||`card`}var Yr=/^[A-Za-z0-9._:@/=,+-]+$/;function Xr(e){return`'${e.replace(/'/g,`'\\''`)}'`}function Zr(e){return Yr.test(e)?e:Xr(e)}function Qr(e){return Yr.test(e)?e:`"${e.replace(/"/g,`""`)}"`}function $r(e){let t=e.match(/^([A-Za-z]):[\\/]*(.*)$/);return t?`/mnt/${t[1].toLowerCase()}/${t[2].replace(/\\/g,`/`)}`:e}function ei(e,t){let n=e.model||e.cli.model,r=n?` --model ${t(n)}`:``,i=e.skipPermissions?` --dangerously-skip-permissions`:``;return`${r}${e.cli.separator}${i}`}function ti(e){let t=[...e.env.map(([e,t])=>`${e}=${Zr(t)}`),...e.userEnv].join(` `),n=t?`${t} `:``,r=e.cwd?`cd ${Xr($r(e.cwd))} && `:``,i=ei(e,Zr);return e.sessionId?`${r}${n}${e.cli.exe} --resume ${Zr(e.sessionId)}${i}`:`${r}${n}${e.cli.exe}${i} ${Xr(e.prompt)}`}var ni=6e3;function ri(e,{launcher:t,readable:n=!1}){let r=e.env.map(([e,t])=>`set "${e}=${t.replace(/"/g,``)}"&& `),i=e.userEnv.map(e=>`set ${e}&& `),a=[...r,...i].join(``),o=e.cwd?`cd /d "${e.cwd}" && `:``,s=ei(e,Qr);if(e.sessionId)return`${o}${a}${e.cli.exe} --resume ${Qr(e.sessionId)}${s}`;let c=qr(e.prompt);if(t&&!n&&c.length<=ni){let n=e=>`"${e.split(`\\`).join(`/`)}"`;return`${o}${a}${n(t.node)} ${n(t.script)} ${c} ${e.cli.exe}${s}`}return`${o}${a}${e.cli.exe}${s} "${e.prompt.replace(/"/g,`""`)}"`}function ii(e){if(e.usePsmux&&e.psmuxExe)return{shellCommand:[e.psmuxExe,...e.hasActiveWindow?[`select-window`,`-t`,`${e.tmuxSession}:${e.activeTermTab}`,`;`]:[],`attach-session`,`-t`,e.tmuxSession],terminalInput:``,external:{argv:[e.psmuxExe,`attach-session`,`-t`,e.tmuxSession]}};if(e.useTmux){let t=Xr(e.tmuxSession),n=`tmux new-session -A -d -s ${t} -- bash -lc "$(echo ${qr(`${e.innerBashCmd}; exec bash`)} | base64 -d)" 2>/dev/null; tmux select-window -t ${Xr(`${e.tmuxSession}:${e.activeTermTab}`)} 2>/dev/null; exec tmux attach-session -t ${t}`;return{shellCommand:[`wsl.exe`,`--`,`bash`,`-lc`,n],terminalInput:``,external:{wslScript:n}}}return e.isWsl?{shellCommand:[`wsl.exe`],terminalInput:`${e.innerBashCmd}\r`,external:{wslScript:`${e.innerBashCmd}; exec bash`}}:{shellCommand:[`cmd.exe`],terminalInput:`${e.innerCmdShellCmd}\r`,external:{cmdLine:e.innerCmdShellCmd}}}function ai(e){let t=(0,W.c)(57),{open:n,onClose:r,onSave:i,editBody:a,editSendAuto:o,editImagePaths:s}=e,[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(!0),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,G.useState)(f),h=(0,G.useRef)(null),_=a!==void 0,v;t[1]!==a||t[2]!==s||t[3]!==o||t[4]!==n?(v=()=>{n&&(l(a??``),d(o??!0),m(s??[]),setTimeout(()=>h.current?.focus(),50))},t[1]=a,t[2]=s,t[3]=o,t[4]=n,t[5]=v):v=t[5];let b;if(t[6]===n?b=t[7]:(b=[n],t[6]=n,t[7]=b),(0,G.useEffect)(v,b),!n)return null;let x;t[8]===c?x=t[9]:(x=c.trim(),t[8]=c,t[9]=x);let S=x.length>0,C;t[10]!==c||t[11]!==S||t[12]!==p||t[13]!==r||t[14]!==i||t[15]!==u?(C=()=>{S&&(i(c.trim(),u,p.length>0?p:void 0),r())},t[10]=c,t[11]=S,t[12]=p,t[13]=r,t[14]=i,t[15]=u,t[16]=C):C=t[16];let T=C,D;t[17]!==c||t[18]!==p?(D=async e=>{let t=Array.from(e.clipboardData.items).filter(oi);if(t.length===0)return;e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=[];for(let e of t){let t=e.getAsFile();if(!t)continue;let n=new Uint8Array(await t.arrayBuffer());try{a.push(await ue(n))}catch(e){let t=e;ce.setState({error:String(t)});return}}let o=p.length,s=a.map((e,t)=>g(o+t+1)).join(` `);l(c.slice(0,r)+s+c.slice(i)),m([...p,...a])},t[17]=c,t[18]=p,t[19]=D):D=t[19];let O=D,A;t[20]!==c||t[21]!==p?(A=e=>{let t=y(c,p,e);l(t.body),m(t.imagePaths)},t[20]=c,t[21]=p,t[22]=A):A=t[22];let j=A,M;t[23]===r?M=t[24]:(M=e=>!e&&r(),t[23]=r,t[24]=M);let N=_?`Edit Queued Prompt`:`Queue Prompt`,P=_?`Update the prompt text and settings.`:`Add a prompt to send to Claude later.`,F;t[25]===r?F=t[26]:(F=(0,K.jsx)(E,{variant:`ghost`,onClick:r,children:`Cancel`}),t[25]=r,t[26]=F);let I=!S,ee=_?`Save`:`Add`,ne;t[27]!==T||t[28]!==I||t[29]!==ee?(ne=(0,K.jsx)(E,{variant:`solid`,onClick:T,disabled:I,children:ee}),t[27]=T,t[28]=I,t[29]=ee,t[30]=ne):ne=t[30];let L;t[31]!==F||t[32]!==ne?(L=(0,K.jsxs)(K.Fragment,{children:[F,ne]}),t[31]=F,t[32]=ne,t[33]=L):L=t[33];let re;t[34]===T?re=t[35]:(re=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&T()},t[34]=T,t[35]=re);let R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>l(e.target.value),t[36]=R):R=t[36];let ie;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ie={minHeight:100,maxHeight:250},t[37]=ie):ie=t[37];let z;t[38]!==c||t[39]!==O?(z=(0,K.jsx)(k,{ref:h,value:c,onChange:R,onPaste:O,placeholder:`Enter your prompt...`,"aria-label":`Prompt`,className:`font-mono`,style:ie,"data-autofocus":!0}),t[38]=c,t[39]=O,t[40]=z):z=t[40];let ae;t[41]!==p||t[42]!==j?(ae=p.length>0&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:p.map((e,t)=>(0,K.jsxs)(w,{title:e,children:[`Image #`,t+1,(0,K.jsx)(`button`,{type:`button`,onClick:()=>j(t),"aria-label":`Remove image ${t+1}`,style:{display:`inline-flex`,background:`none`,border:0,padding:0,color:`inherit`,cursor:`pointer`},children:(0,K.jsx)(`svg`,{width:`12`,height:`12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,children:(0,K.jsx)(`path`,{d:`M6 18 18 6M6 6l12 12`})})})]},e))}),t[41]=p,t[42]=j,t[43]=ae):ae=t[43];let B;t[44]===u?B=t[45]:(B=(0,K.jsx)(se,{checked:u,onCheckedChange:d,label:`Send automatically when Claude finishes`}),t[44]=u,t[45]=B);let V;t[46]!==re||t[47]!==z||t[48]!==ae||t[49]!==B?(V=(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,onKeyDown:re,children:[z,ae,B]}),t[46]=re,t[47]=z,t[48]=ae,t[49]=B,t[50]=V):V=t[50];let H;return t[51]!==P||t[52]!==L||t[53]!==V||t[54]!==M||t[55]!==N?(H=(0,K.jsx)(te,{open:!0,onOpenChange:M,title:N,description:P,width:450,footer:L,children:V}),t[51]=P,t[52]=L,t[53]=V,t[54]=M,t[55]=N,t[56]=H):H=t[56],H}function oi(e){return e.kind===`file`&&e.type.startsWith(`image/`)}function si(e){let t=(0,W.c)(25),{prompts:n,onSendNow:r,onEdit:i,onRemove:a}=e,{theme:o}=N(),s;t[0]===o?s=t[1]:(s=L(o),t[0]=o,t[1]=s);let c=s;if(n.length===0)return null;let l=o===`dark`?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.03)`,u=`1px solid ${c.border}`,d;t[2]!==l||t[3]!==u?(d={background:l,border:u},t[2]=l,t[3]=u,t[4]=d):d=t[4];let f;if(t[5]!==c.border||t[6]!==c.hoverBg||t[7]!==c.textDim||t[8]!==c.textSecondary||t[9]!==i||t[10]!==a||t[11]!==r||t[12]!==n){let e;t[14]!==c.border||t[15]!==c.hoverBg||t[16]!==c.textDim||t[17]!==c.textSecondary||t[18]!==i||t[19]!==a||t[20]!==r?(e=(e,t)=>(0,K.jsxs)(`div`,{children:[t>0&&(0,K.jsx)(`div`,{style:{height:1,background:c.border}}),(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`shrink-0 mt-0.5 text-[13px]`,style:{color:e.sendAutomatically?`#d29922`:c.textDim},title:e.sendAutomatically?`Will send automatically when Claude finishes`:`Manual send only`,children:e.sendAutomatically?`⚡`:`⏸`}),(0,K.jsx)(`span`,{className:`flex-1 text-[12px] leading-[1.5] font-mono`,style:{color:c.textSecondary,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:e.body}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsx)(`button`,{onClick:()=>r(e.id),className:`px-2 py-0.5 rounded-md text-[11px] font-medium transition-all duration-150`,style:{color:`var(--ink)`,border:`1px solid rgba(79,142,247,0.3)`},onMouseEnter:ui,onMouseLeave:li,title:`Send this prompt now`,children:`Send`}),(0,K.jsx)(`button`,{onClick:()=>i(e),className:`p-1 rounded-md transition-all duration-150`,style:{color:c.textDim},onMouseEnter:e=>{e.currentTarget.style.color=c.textSecondary,e.currentTarget.style.background=c.hoverBg},onMouseLeave:e=>{e.currentTarget.style.color=c.textDim,e.currentTarget.style.background=``},title:`Edit`,children:(0,K.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Z`})})}),(0,K.jsx)(`button`,{onClick:()=>a(e.id),className:`p-1 rounded-md transition-all duration-150`,style:{color:c.textDim},onMouseEnter:ci,onMouseLeave:e=>{e.currentTarget.style.color=c.textDim,e.currentTarget.style.background=``},title:`Remove`,children:(0,K.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18 18 6M6 6l12 12`})})})]})]})]},e.id),t[14]=c.border,t[15]=c.hoverBg,t[16]=c.textDim,t[17]=c.textSecondary,t[18]=i,t[19]=a,t[20]=r,t[21]=e):e=t[21],f=n.map(e),t[5]=c.border,t[6]=c.hoverBg,t[7]=c.textDim,t[8]=c.textSecondary,t[9]=i,t[10]=a,t[11]=r,t[12]=n,t[13]=f}else f=t[13];let p;return t[22]!==d||t[23]!==f?(p=(0,K.jsx)(`div`,{className:`shrink-0 mx-2 mt-1 rounded-xl overflow-hidden`,style:d,children:f}),t[22]=d,t[23]=f,t[24]=p):p=t[24],p}function ci(e){e.currentTarget.style.color=`#f85149`,e.currentTarget.style.background=`rgba(248,81,73,0.06)`}function li(e){e.currentTarget.style.background=``}function ui(e){e.currentTarget.style.background=`rgba(79,142,247,0.1)`}function di({card:e}){let[t,n]=(0,G.useState)(``),[i,a]=(0,G.useState)(!1),{stage:o,gate:s}=e.link;if(!o)return null;if(s?.status!==`pending`)return(0,K.jsxs)(`div`,{className:`bd-gate-line`,children:[(0,K.jsxs)(w,{tone:`outline`,children:[`AI-DLC · `,o]}),s?.status===`rejected`&&(0,K.jsxs)(`span`,{children:[`sent back: `,s.note]})]});let c=async i=>{a(!0);try{await r(i,{cardId:e.id,note:t}),n(``)}catch(e){j({title:e instanceof Error?e.message:String(e),tone:`danger`})}finally{a(!1)}};return(0,K.jsx)(O,{tone:`warning`,title:`Review the ${o} stage`,description:s.note,action:(0,K.jsxs)(`div`,{className:`bd-kb-actions`,children:[(0,K.jsx)(Se,{"aria-label":`Note for the agent`,placeholder:`Note (required to send back)`,value:t,onChange:e=>n(e.target.value)}),(0,K.jsx)(E,{variant:`solid`,size:`sm`,loading:i,onClick:()=>c(`gate_approve`),children:`Approve`}),(0,K.jsx)(E,{size:`sm`,disabled:i||!t.trim(),onClick:()=>c(`gate_reject`),children:`Send back`})]})})}var fi=()=>{};function pi(e){let t=(0,W.c)(21),{card:n,data:r}=e,i,a,o,s,c;if(t[0]!==n||t[1]!==r.injected||t[2]!==r.proposals||t[3]!==r.review){let e=r.proposals.filter(_i),l=r.proposals.filter(gi);i=`cdv-kb`,t[9]!==n||t[10]!==r.review?(a=r.review.length>0&&(0,K.jsx)(vi,{title:`May be outdated`,hint:`Entries about files this task changed, written before the change.`,children:r.review.map(e=>(0,K.jsx)(yi,{hit:e,card:n,onChanged:fi},e.entry.id))}),t[9]=n,t[10]=r.review,t[11]=a):a=t[11],o=e.length>0&&(0,K.jsx)(vi,{title:`Proposed by this task`,hint:`Approving opens a pull request in the harness repository.`,children:e.map(hi)}),t[12]!==n||t[13]!==r.injected?(s=r.injected.length>0&&(0,K.jsx)(vi,{title:`Given to this task`,hint:`Injected when its session started.`,children:r.injected.map(e=>(0,K.jsx)(yi,{hit:e,card:n,onChanged:fi},e.entry.id))}),t[12]=n,t[13]=r.injected,t[14]=s):s=t[14],c=l.length>0&&(0,K.jsx)(vi,{title:`Decided`,children:l.map(mi)}),t[0]=n,t[1]=r.injected,t[2]=r.proposals,t[3]=r.review,t[4]=i,t[5]=a,t[6]=o,t[7]=s,t[8]=c}else i=t[4],a=t[5],o=t[6],s=t[7],c=t[8];let l;return t[15]!==i||t[16]!==a||t[17]!==o||t[18]!==s||t[19]!==c?(l=(0,K.jsxs)(`div`,{className:i,children:[a,o,s,c]}),t[15]=i,t[16]=a,t[17]=o,t[18]=s,t[19]=c,t[20]=l):l=t[20],l}function mi(e){return(0,K.jsx)(je,{proposal:e,onChanged:fi,showSourceCard:!1},e.id)}function hi(e){return(0,K.jsx)(je,{proposal:e,onChanged:fi,showSourceCard:!1},e.id)}function gi(e){return e.status!==`pending`}function _i(e){return e.status===`pending`}function vi(e){let t=(0,W.c)(17),{title:n,hint:r,children:i}=e,a;t[0]===i?a=t[1]:(a=G.Children.count(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,K.jsx)(`span`,{className:`cdv-kb-count`,children:a}),t[2]=a,t[3]=o);let s;t[4]!==o||t[5]!==n?(s=(0,K.jsxs)(`h3`,{className:`cdv-kb-title`,children:[n,o]}),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r&&(0,K.jsx)(`p`,{className:`cdv-kb-hint`,children:r}),t[7]=r,t[8]=c);let l;t[9]!==s||t[10]!==c?(l=(0,K.jsxs)(`header`,{className:`cdv-kb-head`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11];let u;t[12]===i?u=t[13]:(u=(0,K.jsx)(`div`,{className:`cdv-kb-group`,children:i}),t[12]=i,t[13]=u);let d;return t[14]!==l||t[15]!==u?(d=(0,K.jsxs)(`section`,{className:`cdv-kb-section`,children:[l,u]}),t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function yi(e){let t=(0,W.c)(42),{hit:n,card:r,onChanged:i}=e,a=n.entry,[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(!1),u=n.stale||void 0,d;t[0]===a.type?d=t[1]:(d=(0,K.jsx)(w,{children:a.type}),t[0]=a.type,t[1]=d);let f;t[2]===n.stale?f=t[3]:(f=n.stale&&(0,K.jsx)(w,{tone:`warning`,children:`may be outdated`}),t[2]=n.stale,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>s(Si),t[4]=p):p=t[4];let m=o?`Hide`:`Read`,h;t[5]!==o||t[6]!==m?(h=(0,K.jsx)(E,{variant:`ghost`,size:`sm`,onClick:p,"aria-expanded":o,children:m}),t[5]=o,t[6]=m,t[7]=h):h=t[7];let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>l(xi),t[8]=g):g=t[8];let _;t[9]===c?_=t[10]:(_=(0,K.jsx)(E,{variant:`ghost`,size:`sm`,onClick:g,"aria-expanded":c,children:`Propose correction`}),t[9]=c,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,K.jsxs)(`div`,{className:`kbe-actions`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==d||t[15]!==f||t[16]!==v?(y=(0,K.jsxs)(`div`,{className:`kbe-head`,children:[d,f,v]}),t[14]=d,t[15]=f,t[16]=v,t[17]=y):y=t[17];let b;t[18]===a.title?b=t[19]:(b=(0,K.jsx)(`h4`,{className:`kbe-title`,children:a.title}),t[18]=a.title,t[19]=b);let x;t[20]===a.summary?x=t[21]:(x=(0,K.jsx)(`p`,{className:`kbe-summary`,children:a.summary}),t[20]=a.summary,t[21]=x);let S;t[22]!==a.id||t[23]!==a.kbId||t[24]!==a.scope?(S=a.scope.length>0&&(0,K.jsx)(`ul`,{className:`kbe-scope`,"aria-label":`About`,title:`${a.kbId} · ${a.id}`,children:a.scope.map(bi)}),t[22]=a.id,t[23]=a.kbId,t[24]=a.scope,t[25]=S):S=t[25];let C;t[26]!==a.body||t[27]!==o?(C=o&&(0,K.jsx)(`pre`,{className:`kbe-body`,children:a.body}),t[26]=a.body,t[27]=o,t[28]=C):C=t[28];let T;t[29]!==r||t[30]!==a||t[31]!==c||t[32]!==i?(T=c&&(0,K.jsx)(Ci,{entry:a,cardId:r.id,onDone:()=>{l(!1),i()}}),t[29]=r,t[30]=a,t[31]=c,t[32]=i,t[33]=T):T=t[33];let D;return t[34]!==u||t[35]!==y||t[36]!==b||t[37]!==x||t[38]!==S||t[39]!==C||t[40]!==T?(D=(0,K.jsxs)(`article`,{className:`kbe`,"data-stale":u,children:[y,b,x,S,C,T]}),t[34]=u,t[35]=y,t[36]=b,t[37]=x,t[38]=S,t[39]=C,t[40]=T,t[41]=D):D=t[41],D}function bi(e){return(0,K.jsx)(`li`,{children:e},e)}function xi(e){return!e}function Si(e){return!e}function Ci({entry:e,cardId:t,onDone:n}){let i={title:e.title,summary:e.summary,body:e.body},[a,o]=(0,G.useState)(i),[s,c]=(0,G.useState)(!1);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ae,{id:`fix-${e.id}`,value:a,onChange:o}),(0,K.jsx)(`div`,{className:`bd-kb-actions`,children:(0,K.jsx)(E,{variant:`solid`,loading:s,disabled:ke(a,i),onClick:async()=>{c(!0);try{await r(`kb_propose`,{kbId:e.kbId,type:e.type,...a,scope:e.scope,supersedes:[e.id],source:{cardId:t},reason:`Corrects ${e.id}`}),j({title:`Correction proposed`,description:`It replaces the old entry once approved.`,tone:`success`}),n()}catch(e){j({title:e instanceof Error?e.message:String(e),tone:`danger`})}finally{c(!1)}},children:`Propose`})})]})}var wi=[{value:`normal`,label:`Normal`,hint:`Claude works on the description as written`},{value:`full`,label:`Full workflow`,hint:`Requirements, design, implementation, review and PR, each with its skill or reviewer`}],Ti="Run the full team workflow for this task. Invoke each skill or subagent by name; do not skip a stage.\n1. `aidlc-requirements`: turn the description into requirements and acceptance criteria.\n2. `aidlc-design`: write the design before any code.\n3. `aidlc-implement`: implement it with tests and run the project's checks.\n4. Run the `code-reviewer` subagent on the diff and fix what it finds. If the change touches auth, input parsing, file paths, process execution, network endpoints or secrets, also run `security-reviewer`.\n5. `aidlc-pr`: prepare the pull request. Do not push or open it until I confirm.\nStop and ask me whenever a stage leaves an open question.";function Ei(e,t){return t===`full`?`${e}\n\n---\n${Ti}`:e}var Di=[{value:``,label:`Default`,hint:`Whatever Claude Code or the API service picks`},{value:`opus`,label:`Opus`,hint:`Most capable — hardest tasks`},{value:`sonnet`,label:`Sonnet`,hint:`Balanced speed and quality`},{value:`haiku`,label:`Haiku`,hint:`Fastest and cheapest`},{value:`opusplan`,label:`Opus plan → Sonnet`,hint:`Opus plans, Sonnet implements`},{value:`__custom`,label:`Custom…`,hint:`A full model id`}],Oi=/^[\w.\-:/[\]]+$/,ki=/^[A-Z_][A-Z0-9_]*=/i,Ai=typeof navigator<`u`&&/Mac/i.test(navigator.platform);function ji(e){let t=(0,W.c)(173),{projectPath:n,initialPrompt:r,canCreateWorktree:i,initialSkipPermissions:a,buildCommand:o,onLaunch:s,onCancel:c,runtime:u,onRuntimeChange:d,windowsLabel:f}=e,p=f===void 0?`Windows`:f,m;t[0]===r?m=t[1]:(m=()=>l(r),t[0]=r,t[1]=m);let[h]=(0,G.useState)(m),[g,v]=(0,G.useState)(h.text),[y,b]=(0,G.useState)(h.files),[x,S]=(0,G.useState)(`normal`),w;t[2]!==y||t[3]!==x||t[4]!==g?(w=Ei(_(g,y),x),t[2]=y,t[3]=x,t[4]=g,t[5]=w):w=t[5];let T=w,[D,O]=(0,G.useState)(``),[A,j]=(0,G.useState)(a),[M,N]=(0,G.useState)(``),[P,F]=(0,G.useState)(``),[I,ee]=(0,G.useState)(``),[te,ne]=(0,G.useState)(!1),[L,re]=(0,G.useState)(!1),[R,ie]=(0,G.useState)(``),[z,H]=(0,G.useState)(!1),oe=(0,G.useRef)(null),se;t[6]===I?se=t[7]:(se=I.split(`
16
+ `).map(Ri).filter(Li),t[6]=I,t[7]=se);let ce=se,le;t[8]===ce?le=t[9]:(le=ce.filter(Ii),t[8]=ce,t[9]=le);let U=le,ue=ce.length-U.length,fe;t[10]!==P||t[11]!==M?(fe=M===`__custom`&&P.trim()!==``&&!Oi.test(P.trim()),t[10]=P,t[11]=M,t[12]=fe):fe=t[12];let pe=fe,he;t[13]!==pe||t[14]!==P||t[15]!==M?(he=M===`__custom`?pe?``:P.trim():M,t[13]=pe,t[14]=P,t[15]=M,t[16]=he):he=t[16];let ge=he,_e=i?D:``,ve;t[17]!==o||t[18]!==U||t[19]!==ge||t[20]!==T||t[21]!==A||t[22]!==_e?(ve=o({prompt:T,worktreeBranch:_e,dangerouslySkipPermissions:A,envPrefix:U,model:ge}),t[17]=o,t[18]=U,t[19]=ge,t[20]=T,t[21]=A,t[22]=_e,t[23]=ve):ve=t[23];let ye=ve,be,xe;t[24]!==z||t[25]!==ye?(be=()=>{z||ie(ye)},xe=[ye,z],t[24]=z,t[25]=ye,t[26]=be,t[27]=xe):(be=t[26],xe=t[27]),(0,G.useEffect)(be,xe);let Ee,De;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{oe.current?.focus()},De=[],t[28]=Ee,t[29]=De):(Ee=t[28],De=t[29]),(0,G.useEffect)(Ee,De);let Oe;t[30]===ye?Oe=t[31]:(Oe=e=>{ie(e),H(e!==ye)},t[30]=ye,t[31]=Oe);let ke=Oe,Ae;t[32]===ye?Ae=t[33]:(Ae=()=>{H(!1),ie(ye)},t[32]=ye,t[33]=Ae);let je=Ae,Me;t[34]!==R||t[35]!==pe||t[36]!==T?(Me=T.trim().length>0&&R.trim().length>0&&!pe,t[34]=R,t[35]=pe,t[36]=T,t[37]=Me):Me=t[37];let Ne=Me,Pe;t[38]!==Ne||t[39]!==z||t[40]!==R||t[41]!==U||t[42]!==ge||t[43]!==s||t[44]!==T||t[45]!==A||t[46]!==D?(Pe=()=>{Ne&&s({prompt:T.trim(),worktreeBranch:D.trim(),dangerouslySkipPermissions:A,envPrefix:U,model:ge,commandOverride:z?R:null})},t[38]=Ne,t[39]=z,t[40]=R,t[41]=U,t[42]=ge,t[43]=s,t[44]=T,t[45]=A,t[46]=D,t[47]=Pe):Pe=t[47];let Fe=Pe,Ie;t[48]!==c||t[49]!==Fe?(Ie=e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),Fe()):e.key===`Escape`&&(e.preventDefault(),c())},t[48]=c,t[49]=Fe,t[50]=Ie):Ie=t[50];let Le=Ie,Re;t[51]===x?Re=t[52]:(Re=wi.find(e=>e.value===x)?.hint,t[51]=x,t[52]=Re);let ze=Re,Be;t[53]===M?Be=t[54]:(Be=Di.find(e=>e.value===M)?.hint,t[53]=M,t[54]=Be);let Ve=Be,He;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(`label`,{htmlFor:`ls-prompt`,children:`Description`}),t[55]=He):He=t[55];let Ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,K.jsx)(Ce,{size:13,strokeWidth:2,"aria-hidden":!0}),t[56]=Ue):Ue=t[56];let We;t[57]===n?We=t[58]:(We=(0,K.jsx)(`span`,{children:n}),t[57]=n,t[58]=We);let Ge;t[59]!==n||t[60]!==We?(Ge=(0,K.jsxs)(`div`,{className:`ls-fieldhead`,children:[He,(0,K.jsxs)(`span`,{className:`ls-cwd`,title:n,children:[Ue,We]})]}),t[59]=n,t[60]=We,t[61]=Ge):Ge=t[61];let Ke;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=e=>v(e.target.value),t[62]=Ke):Ke=t[62];let qe;t[63]===g?qe=t[64]:(qe=(0,K.jsx)(k,{id:`ls-prompt`,ref:oe,className:`ls-prompt`,value:g,onChange:Ke,placeholder:`What should Claude work on?`,spellCheck:!1}),t[63]=g,t[64]=qe);let Je;t[65]===y?Je=t[66]:(Je=y.length>0&&(0,K.jsx)(`ul`,{className:`ls-files`,"aria-label":`Attached files`,children:y.map(e=>(0,K.jsxs)(`li`,{className:`ls-file`,title:e.path,children:[(0,K.jsx)(B,{size:14,strokeWidth:2,"aria-hidden":!0}),(0,K.jsx)(`span`,{children:e.name}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>b(t=>t.filter(t=>t.path!==e.path)),"aria-label":`Remove ${e.name}`,children:(0,K.jsx)(C,{size:12,strokeWidth:2.5,"aria-hidden":!0})})]},e.path))}),t[65]=y,t[66]=Je);let Ye;t[67]!==Ge||t[68]!==qe||t[69]!==Je?(Ye=(0,K.jsxs)(`section`,{className:`ls-field ls-main`,children:[Ge,qe,Je]}),t[67]=Ge,t[68]=qe,t[69]=Je,t[70]=Ye):Ye=t[70];let Xe;t[71]!==d||t[72]!==u||t[73]!==p?(Xe=u&&d&&(0,K.jsxs)(`div`,{className:`ls-set`,children:[(0,K.jsxs)(`div`,{className:`ls-set-text`,children:[(0,K.jsx)(`span`,{className:`ls-set-name`,id:`ls-runtime-label`,children:`Run in`}),(0,K.jsx)(`small`,{children:`Where the Claude process starts.`})]}),(0,K.jsx)(me,{className:`ls-seg`,value:u,onValueChange:e=>d(e),"aria-labelledby":`ls-runtime-label`,children:(0,K.jsxs)(de,{children:[(0,K.jsx)(V,{value:`windows`,children:p}),(0,K.jsx)(V,{value:`wsl`,children:`WSL`})]})})]}),t[71]=d,t[72]=u,t[73]=p,t[74]=Xe):Xe=t[74];let Ze;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,K.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-mode`,children:`Mode`}),t[75]=Ze):Ze=t[75];let Qe;t[76]===ze?Qe=t[77]:(Qe=(0,K.jsxs)(`div`,{className:`ls-set-text`,children:[Ze,(0,K.jsx)(`small`,{children:ze})]}),t[76]=ze,t[77]=Qe);let $e,et;t[78]===Symbol.for(`react.memo_cache_sentinel`)?($e=e=>S(e),et=wi.map(Fi),t[78]=$e,t[79]=et):($e=t[78],et=t[79]);let tt;t[80]===x?tt=t[81]:(tt=(0,K.jsx)(ae,{id:`ls-mode`,className:`ls-ctl`,value:x,onValueChange:$e,options:et}),t[80]=x,t[81]=tt);let nt;t[82]!==Qe||t[83]!==tt?(nt=(0,K.jsxs)(`div`,{className:`ls-set`,children:[Qe,tt]}),t[82]=Qe,t[83]=tt,t[84]=nt):nt=t[84];let rt;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,K.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-model`,children:`Model`}),t[85]=rt):rt=t[85];let it=M===`__custom`?`A full model id.`:Ve,at;t[86]===it?at=t[87]:(at=(0,K.jsxs)(`div`,{className:`ls-set-text`,children:[rt,(0,K.jsx)(`small`,{children:it})]}),t[86]=it,t[87]=at);let ot;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(ot=Di.map(Pi),t[88]=ot):ot=t[88];let st;t[89]===M?st=t[90]:(st=(0,K.jsx)(ae,{id:`ls-model`,className:`ls-ctl`,value:M,onValueChange:N,options:ot}),t[89]=M,t[90]=st);let ct;t[91]!==at||t[92]!==st?(ct=(0,K.jsxs)(`div`,{className:`ls-set`,children:[at,st]}),t[91]=at,t[92]=st,t[93]=ct):ct=t[93];let q;t[94]!==pe||t[95]!==P||t[96]!==M?(q=M===`__custom`&&(0,K.jsxs)(`div`,{className:`ls-sub`,children:[(0,K.jsx)(Se,{className:`ls-line`,value:P,onChange:e=>F(e.target.value),placeholder:`claude-opus-4-1`,"aria-label":`Custom model id`,"aria-invalid":pe||void 0,spellCheck:!1}),pe&&(0,K.jsx)(`small`,{"data-warn":!0,children:`Model ids can only use letters, digits and . - _ : / [ ]`})]}),t[94]=pe,t[95]=P,t[96]=M,t[97]=q):q=t[97];let lt;t[98]!==i||t[99]!==D?(lt=i&&(0,K.jsxs)(`div`,{className:`ls-set`,children:[(0,K.jsxs)(`div`,{className:`ls-set-text`,children:[(0,K.jsx)(`label`,{className:`ls-set-name`,htmlFor:`ls-branch`,children:`Worktree branch`}),(0,K.jsx)(`small`,{children:`Optional. Creates a git worktree.`})]}),(0,K.jsx)(Se,{id:`ls-branch`,className:`ls-line ls-ctl`,value:D,onChange:e=>O(e.target.value),placeholder:`feat/ksuid`,spellCheck:!1})]}),t[98]=i,t[99]=D,t[100]=lt):lt=t[100];let ut=A||void 0,dt;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,K.jsx)(`span`,{className:`ls-set-name`,children:`Skip permission prompts`}),t[101]=dt):dt=t[101];let ft=A?`Claude can edit files and run commands without asking.`:`Claude asks before editing files or running commands.`,pt;t[102]===ft?pt=t[103]:(pt=(0,K.jsxs)(`span`,{className:`ls-set-text`,children:[dt,(0,K.jsx)(`small`,{children:ft})]}),t[102]=ft,t[103]=pt);let mt;t[104]===A?mt=t[105]:(mt=(0,K.jsx)(we,{id:`ls-skip`,checked:A,onCheckedChange:j}),t[104]=A,t[105]=mt);let J;t[106]!==ut||t[107]!==pt||t[108]!==mt?(J=(0,K.jsxs)(`label`,{className:`ls-set ls-set--click`,htmlFor:`ls-skip`,"data-danger":ut,children:[pt,mt]}),t[106]=ut,t[107]=pt,t[108]=mt,t[109]=J):J=t[109];let Y=te||void 0,ht,X;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(ht=()=>ne(Ni),X=(0,K.jsx)(`span`,{className:`ls-set-name`,children:`Environment variables`}),t[110]=ht,t[111]=X):(ht=t[110],X=t[111]);let Z;t[112]===U.length?Z=t[113]:(Z=U.length>0&&(0,K.jsx)(`b`,{children:U.length}),t[112]=U.length,t[113]=Z);let Q;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,K.jsx)(Te,{size:14,strokeWidth:2.5,"aria-hidden":!0}),t[114]=Q):Q=t[114];let $;t[115]!==te||t[116]!==Z?($=(0,K.jsxs)(`button`,{type:`button`,className:`ls-foldhead`,"aria-expanded":te,onClick:ht,children:[X,Z,Q]}),t[115]=te,t[116]=Z,t[117]=$):$=t[117];let gt;t[118]!==ue||t[119]!==te||t[120]!==I?(gt=te&&(0,K.jsxs)(`div`,{className:`ls-foldbody`,children:[(0,K.jsx)(k,{className:`ls-env-input`,value:I,onChange:e=>ee(e.target.value),placeholder:`ANTHROPIC_API_KEY=sk-...`,"aria-label":`Environment variables, one KEY=value per line`,spellCheck:!1,autoFocus:!0}),(0,K.jsx)(`small`,{"data-warn":ue>0||void 0,children:ue>0?`${ue} line${ue===1?``:`s`} ignored — use KEY=value.`:`One KEY=value per line, set before claude starts.`})]}),t[118]=ue,t[119]=te,t[120]=I,t[121]=gt):gt=t[121];let _t;t[122]!==Y||t[123]!==$||t[124]!==gt?(_t=(0,K.jsxs)(`div`,{className:`ls-fold`,"data-open":Y,children:[$,gt]}),t[122]=Y,t[123]=$,t[124]=gt,t[125]=_t):_t=t[125];let vt=L||void 0,yt,bt;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>re(Mi),bt=(0,K.jsx)(`span`,{className:`ls-set-name`,children:`Command`}),t[126]=yt,t[127]=bt):(yt=t[126],bt=t[127]);let xt;t[128]===z?xt=t[129]:(xt=z&&(0,K.jsx)(`span`,{className:`ls-edited`,children:`Edited`}),t[128]=z,t[129]=xt);let St;t[130]!==L||t[131]!==R?(St=!L&&(0,K.jsx)(`code`,{className:`ls-cmdpeek`,children:R.replace(/\s+/g,` `)}),t[130]=L,t[131]=R,t[132]=St):St=t[132];let Ct;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,K.jsx)(Te,{size:14,strokeWidth:2.5,"aria-hidden":!0}),t[133]=Ct):Ct=t[133];let wt;t[134]!==L||t[135]!==xt||t[136]!==St?(wt=(0,K.jsxs)(`button`,{type:`button`,className:`ls-foldhead`,"aria-expanded":L,"aria-controls":`ls-cmd`,onClick:yt,children:[bt,xt,St,Ct]}),t[134]=L,t[135]=xt,t[136]=St,t[137]=wt):wt=t[137];let Tt;t[138]!==L||t[139]!==z||t[140]!==R||t[141]!==ke||t[142]!==je?(Tt=L&&(0,K.jsxs)(`div`,{className:`ls-foldbody`,children:[(0,K.jsxs)(`div`,{className:`ls-cmd`,"data-edited":z||void 0,children:[(0,K.jsx)(`span`,{"aria-hidden":!0,children:`$`}),(0,K.jsx)(`textarea`,{id:`ls-cmd`,className:`ls-cmd-input`,value:R,onChange:e=>ke(e.target.value),spellCheck:!1,rows:3,"aria-label":`Launch command`})]}),(0,K.jsxs)(`div`,{className:`ls-cmdfoot`,children:[(0,K.jsx)(`span`,{className:z?`ls-edited`:`ls-auto`,children:z?`Edited by hand — the options above no longer apply.`:`Follows the options above.`}),z&&(0,K.jsx)(`button`,{type:`button`,className:`ls-reset`,onClick:je,children:`Reset`})]})]}),t[138]=L,t[139]=z,t[140]=R,t[141]=ke,t[142]=je,t[143]=Tt):Tt=t[143];let Et;t[144]!==vt||t[145]!==wt||t[146]!==Tt?(Et=(0,K.jsxs)(`div`,{className:`ls-fold`,"data-open":vt,children:[wt,Tt]}),t[144]=vt,t[145]=wt,t[146]=Tt,t[147]=Et):Et=t[147];let Dt;t[148]!==Xe||t[149]!==nt||t[150]!==ct||t[151]!==q||t[152]!==lt||t[153]!==J||t[154]!==_t||t[155]!==Et?(Dt=(0,K.jsxs)(`div`,{className:`ls-list`,children:[Xe,nt,ct,q,lt,J,_t,Et]}),t[148]=Xe,t[149]=nt,t[150]=ct,t[151]=q,t[152]=lt,t[153]=J,t[154]=_t,t[155]=Et,t[156]=Dt):Dt=t[156];let Ot;t[157]!==Ye||t[158]!==Dt?(Ot=(0,K.jsx)(`div`,{className:`ls-scroll`,children:(0,K.jsxs)(`div`,{className:`ls-form`,children:[Ye,Dt]})}),t[157]=Ye,t[158]=Dt,t[159]=Ot):Ot=t[159];let kt;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,K.jsxs)(`span`,{className:`ls-hint`,children:[(0,K.jsx)(`kbd`,{children:Ai?`⌘`:`Ctrl`}),(0,K.jsx)(`kbd`,{children:`↵`}),` launch`]}),t[160]=kt):kt=t[160];let At;t[161]===c?At=t[162]:(At=(0,K.jsx)(E,{variant:`ghost`,onClick:c,children:`Cancel`}),t[161]=c,t[162]=At);let jt=!Ne,Mt;t[163]!==Fe||t[164]!==jt?(Mt=(0,K.jsx)(E,{variant:`solid`,onClick:Fe,disabled:jt,children:`Launch Claude`}),t[163]=Fe,t[164]=jt,t[165]=Mt):Mt=t[165];let Nt;t[166]!==At||t[167]!==Mt?(Nt=(0,K.jsxs)(`div`,{className:`ls-bar`,children:[kt,(0,K.jsxs)(`div`,{className:`ls-bar-actions`,children:[At,Mt]})]}),t[166]=At,t[167]=Mt,t[168]=Nt):Nt=t[168];let Pt;return t[169]!==Le||t[170]!==Ot||t[171]!==Nt?(Pt=(0,K.jsxs)(`div`,{className:`cdv-pane cdv-pane--fade ls`,onKeyDown:Le,children:[Ot,Nt]}),t[169]=Le,t[170]=Ot,t[171]=Nt,t[172]=Pt):Pt=t[172],Pt}function Mi(e){return!e}function Ni(e){return!e}function Pi(e){return{value:e.value,label:e.label}}function Fi(e){return{value:e.value,label:e.label}}function Ii(e){return ki.test(e)}function Li(e){return e.length>0}function Ri(e){return e.trim()}function zi({onInstalled:t}){let[n,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let t=!1;r(`psmux_status`).then(e=>{t||(i(e),o(e.installing))}).catch(()=>{});let n=e(`psmux-install-progress`,e=>{e.payload?.line&&c(e.payload.line)});return()=>{t=!0,n.then(e=>e())}},[]),!n||!n.supported||n.available?null:(0,K.jsxs)(`div`,{className:`cdv-psmux`,role:`status`,children:[(0,K.jsxs)(`div`,{className:`cdv-psmux-copy`,children:[(0,K.jsx)(`strong`,{children:`Keep this terminal alive`}),(0,K.jsxs)(`span`,{children:[`Install psmux so closing the card or reloading the page doesn't end the session.`,l&&(0,K.jsxs)(`span`,{className:`cdv-psmux-error`,children:[` `,l]})]}),a&&s&&(0,K.jsx)(`code`,{className:`cdv-psmux-log`,children:s})]}),n.canInstall?(0,K.jsxs)(E,{size:`sm`,variant:`solid`,disabled:a,onClick:async()=>{o(!0),u(null),c(``);try{let e=await r(`psmux_install`);i(e),j({title:`psmux installed`,description:e.version,tone:`success`}),t?.()}catch(e){u(e instanceof Error?e.message:String(e))}finally{o(!1)}},children:[a?(0,K.jsx)(T,{}):null,a?`Installing…`:`Install psmux`]}):(0,K.jsx)(`code`,{className:`cdv-psmux-log`,children:`winget install psmux`})]})}var Bi={a:({node:e,children:t,...n})=>(0,K.jsx)(`a`,{...n,target:`_blank`,rel:`noopener noreferrer`,children:t})},Vi=[b],Hi=(0,G.memo)(function(e){let t=(0,W.c)(2),{text:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(Pr,{remarkPlugins:Vi,components:Bi,children:n}),t[0]=n,t[1]=r),r}),Ui=new Set([`FAILURE`,`CANCELLED`,`TIMED_OUT`,`STARTUP_FAILURE`,`ACTION_REQUIRED`]),Wi=new Set([`PENDING`,`QUEUED`,`IN_PROGRESS`]),Gi={APPROVED:`success`,CHANGES_REQUESTED:`danger`,REVIEW_REQUIRED:`warning`},Ki={CLEAN:`success`,BLOCKED:`danger`,DIRTY:`danger`,UNSTABLE:`warning`,BEHIND:`warning`};function qi(e){let t=(0,W.c)(17),{meta:n}=e,r=n.checkRuns,i=0,a=0,o=0;for(let e of r){let t=e.conclusion??`PENDING`;Ui.has(t)?i++:Wi.has(t)?a++:t===`SUCCESS`&&o++}if(!n.reviewDecision&&!n.mergeStateStatus&&r.length===0&&n.approvalCount==null)return null;let s;t[0]!==n.approvalCount||t[1]!==n.reviewDecision?(s=n.reviewDecision&&(0,K.jsxs)(w,{tone:Gi[n.reviewDecision]??`default`,children:[n.reviewDecision.replace(/_/g,` `).toLowerCase(),n.approvalCount!=null&&n.approvalCount>0?` · ${n.approvalCount}✓`:``]}),t[0]=n.approvalCount,t[1]=n.reviewDecision,t[2]=s):s=t[2];let c;t[3]===n.mergeStateStatus?c=t[4]:(c=n.mergeStateStatus&&(0,K.jsxs)(w,{tone:Ki[n.mergeStateStatus]??`default`,children:[`merge: `,n.mergeStateStatus.toLowerCase()]}),t[3]=n.mergeStateStatus,t[4]=c);let l;t[5]===n.unresolvedThreads?l=t[6]:(l=n.unresolvedThreads!=null&&n.unresolvedThreads>0&&(0,K.jsxs)(w,{tone:`warning`,title:`Unresolved review threads`,children:[n.unresolvedThreads,` unresolved thread`,n.unresolvedThreads===1?``:`s`]}),t[5]=n.unresolvedThreads,t[6]=l);let u;t[7]!==r||t[8]!==i||t[9]!==o||t[10]!==a?(u=r.length>0&&(0,K.jsx)(w,{tone:i>0?`danger`:a>0?`warning`:`success`,title:r.map(Ji).join(`
17
+ `),children:i>0?`${i}/${r.length} failing`:a>0?`${a}/${r.length} running`:`${o}/${r.length} passing`}),t[7]=r,t[8]=i,t[9]=o,t[10]=a,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[s,c,l,u]}),t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Ji(e){return`${e.name}: ${e.conclusion??`pending`}`}function Yi(e){try{let{protocol:t}=new URL(e);return t===`https:`||t===`http:`}catch{return!1}}function Xi({title:e,body:t,url:n,onOpenInBrowser:r,mergeAction:i,prMeta:a}){let[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),f=async()=>{if(!(!i||o||u)&&await De(`Merge PR #${i.number}?\n\nThis runs the configured merge command.`,{title:`Merge pull request`,kind:`warning`,okLabel:`Merge`,cancelLabel:`Cancel`})){l(null),s(!0);try{let e=await i.onMerge();d(e||`Merged PR #${i.number}`)}catch(e){l(String(e))}finally{s(!1)}}},p=!!r||!!n&&Yi(n);return(0,K.jsxs)(`div`,{className:`p-5 flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsx)(`h3`,{className:`text-[15px] font-medium leading-snug`,style:{color:`var(--ink)`},children:e}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[i&&(0,K.jsxs)(E,{variant:`solid`,size:`sm`,onClick:f,loading:o,disabled:!!u,title:`Run the configured merge command for PR #${i.number}`,children:[(0,K.jsx)(Le,{size:14,"aria-hidden":!0}),o?`Merging…`:u?`Merged`:`Merge`]}),p&&(0,K.jsx)(M,{label:`Open in browser`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,size:`sm`,variant:`ghost`,"aria-label":`Open in browser`,onClick:()=>{r?r():n&&Yi(n)&&window.open(n,`_blank`,`noreferrer`)},children:(0,K.jsx)(Fe,{size:16,"aria-hidden":!0})})})]})]}),a&&(0,K.jsx)(qi,{meta:a}),u&&(0,K.jsx)(O,{tone:`success`,title:u}),c&&(0,K.jsx)(O,{tone:`danger`,title:`Merge failed`,description:c}),t?(0,K.jsx)(`div`,{className:`hist-prose text-[13px]`,"data-md":!0,children:(0,K.jsx)(Hi,{text:t})}):(0,K.jsx)(`p`,{className:`text-[13px]`,style:{color:`var(--ink-faint)`},children:`No description`})]})}var Zi=new Set([`Task`,`Agent`]),Qi=/^<(system-reminder|local-command-caveat|local-command-stdout|command-name|command-message|task-notification|user-prompt-submit-hook)\b/;function $i(e){let t=e.indexOf(`: `);return t===-1?{name:e,args:``}:{name:e.slice(0,t),args:e.slice(t+2)}}var ea={n:`
18
+ `,t:` `,r:`\r`,b:`\b`,f:`\f`};function ta(e){return e.replace(/\\(u[0-9a-fA-F]{4}|.)/g,(e,t)=>t.length===5?String.fromCharCode(parseInt(t.slice(1),16)):t in ea?ea[t]:t===`"`||t===`\\`||t===`/`?t:e)}function na(e,t){try{let n=JSON.parse(e)?.[t];if(typeof n==`string`)return n}catch{}let n=RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`).exec(e);return n?ta(n[1]):``}var ra=[`command`,`file_path`,`path`,`pattern`,`url`,`query`,`description`,`prompt`];function ia(e){let t=null;try{let n=JSON.parse(e);n&&typeof n==`object`&&(t=n)}catch{}for(let n of ra){let r=t?t[n]:na(e,n);if(typeof r==`string`&&r)return r.split(`
19
+ `)[0]}return e}function aa(e){let t=e.trim();if(t[0]!==`{`&&t[0]!==`[`)return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function oa(e){let t=Math.round(e/1e3);if(t<1)return``;if(t<60)return`+${t}s`;let n=Math.floor(t/60);return n<60?`+${n}m${t%60?` ${t%60}s`:``}`:`+${Math.floor(n/60)}h ${n%60}m`}function sa(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function ca(e){if(!e)return null;let t=new Date(e);if(Number.isNaN(t.getTime()))return null;let n=t.toDateString()===new Date().toDateString(),r=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});return{label:n?r:`${t.toLocaleDateString([],{month:`short`,day:`numeric`})}, ${r}`,full:t.toLocaleString()}}function la(e,t){let n=e.contentBlocks.filter(e=>e.kind===`text`&&e.text.trim()),r=e.contentBlocks.filter(e=>e.kind===`tool_use`).map(e=>$i(e.text)),i=e.contentBlocks.filter(e=>e.kind===`tool_result`),a=e.contentBlocks.length===0?e.textPreview||`(empty)`:null,o=e.role===`user`&&n.length===0&&a===null,s=e.role===`user`&&n.length>0&&n.every(e=>Qi.test(e.text.trimStart())),c=t?.timestamp?Date.parse(t.timestamp):NaN,l=e.timestamp?Date.parse(e.timestamp):NaN;return{turn:e,kind:o?`result`:s?`system`:e.role===`assistant`?`reply`:`prompt`,speaker:e.role===`assistant`?`Claude`:s?`System`:`You`,prose:n,calls:r,results:i,thinking:e.contentBlocks.some(e=>e.kind===`thinking`),fallback:a,gap:Number.isNaN(c)||Number.isNaN(l)?null:Math.max(0,l-c),spawns:r.filter(e=>Zi.has(e.name)).length}}function ua(e){let t=e.prose.reduce((e,t)=>e+Math.ceil(t.text.length/90)+(t.text.split(`
20
+ `).length-1),0);return 40+Math.min(t,14)*24+e.calls.length*28+e.results.length*40+(e.kind===`prompt`?14:0)}function da(e,t){switch(t){case`messages`:return e.kind!==`result`&&(e.prose.length>0||e.fallback!==null);case`tools`:return e.calls.length>0||e.results.length>0;case`agents`:return e.spawns>0;default:return!0}}function fa(e){let t=0,n=0,r=NaN,i=NaN;for(let a of e){t+=a.calls.length,n+=a.spawns;let e=a.turn.timestamp?Date.parse(a.turn.timestamp):NaN;Number.isNaN(e)||(Number.isNaN(r)&&(r=e),i=e)}return{calls:t,spawns:n,span:Number.isNaN(r)?null:i-r}}var pa={fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},ma=(0,G.memo)(function(e){let t=(0,W.c)(53),{step:n,first:r,filter:i,searchQuery:a,isSearchMatch:o,isCurrentMatch:s,onCheckpoint:c,ctrlHeld:l}=e,{turn:u}=n,d=!!c&&!!l,f;t[0]===u.timestamp?f=t[1]:(f=ca(u.timestamp),t[0]=u.timestamp,t[1]=f);let p=f,m=i!==`tools`&&i!==`agents`,h=i!==`messages`,g;t[2]===n.gap?g=t[3]:(g=n.gap?oa(n.gap):``,t[2]=n.gap,t[3]=g);let _=g,v=n.kind===`result`,y;t[4]!==i||t[5]!==n.calls?(y=i===`agents`?n.calls.filter(wa):n.calls,t[4]=i,t[5]=n.calls,t[6]=y):y=t[6];let b=y,x=r||void 0,S=n.spawns>0||void 0,C=o||void 0,w=s||void 0,T=d||void 0,E;t[7]!==d||t[8]!==l||t[9]!==c||t[10]!==u.index?(E=e=>{d&&(e.ctrlKey||l)&&(e.preventDefault(),e.stopPropagation(),c(u.index))},t[7]=d,t[8]=l,t[9]=c,t[10]=u.index,t[11]=E):E=t[11];let D;t[12]!==p||t[13]!==u.timestamp?(D=p&&(0,K.jsx)(`time`,{dateTime:u.timestamp,title:p.full,children:p.label}),t[12]=p,t[13]=u.timestamp,t[14]=D):D=t[14];let O;t[15]===_?O=t[16]:(O=_&&(0,K.jsx)(`span`,{className:`tr-gap`,children:_}),t[15]=_,t[16]=O);let k;t[17]!==D||t[18]!==O?(k=(0,K.jsxs)(`div`,{className:`tr-when`,children:[D,O]}),t[17]=D,t[18]=O,t[19]=k):k=t[19];let A;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(`div`,{className:`tr-rail`,"aria-hidden":!0,children:(0,K.jsx)(`span`,{className:`tr-node`})}),t[20]=A):A=t[20];let j;t[21]!==v||t[22]!==c||t[23]!==n.speaker||t[24]!==u.index?(j=!v&&(0,K.jsxs)(`header`,{className:`tr-head`,children:[(0,K.jsx)(`span`,{className:`tr-who`,children:n.speaker}),c&&(0,K.jsxs)(`button`,{type:`button`,className:`hist-ckpt`,onClick:e=>{e.stopPropagation(),c(u.index)},title:`Truncate the session to keep everything through turn ${u.index+1}. The original is backed up as <session>.jsonl.bkp.`,children:[(0,K.jsx)(`svg`,{className:`w-3 h-3`,strokeWidth:2,...pa,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM20 4 8.1 15.9M14.5 14.5 20 20M8.1 8.1 12 12`})}),`Checkpoint here`]})]}),t[21]=v,t[22]=c,t[23]=n.speaker,t[24]=u.index,t[25]=j):j=t[25];let M;t[26]!==a||t[27]!==m||t[28]!==n.fallback||t[29]!==n.prose?(M=m&&(n.fallback===null?n.prose.map((e,t)=>(0,K.jsx)(ha,{text:e.text.trim(),query:a},t)):(0,K.jsx)(ha,{text:n.fallback,query:a})),t[26]=a,t[27]=m,t[28]=n.fallback,t[29]=n.prose,t[30]=M):M=t[30];let N;t[31]!==b||t[32]!==i||t[33]!==o||t[34]!==a||t[35]!==h||t[36]!==n.results||t[37]!==n.thinking?(N=h&&(b.length>0||n.results.length>0||n.thinking)&&(0,K.jsxs)(`div`,{className:`tr-calls`,children:[n.thinking&&i===`all`&&(0,K.jsx)(`div`,{className:`hist-think`,children:`Thinking…`}),b.map((e,t)=>Zi.has(e.name)?(0,K.jsx)(va,{args:e.args,query:a},t):(0,K.jsx)(ga,{name:e.name,args:e.args,query:a,forceOpen:o},t)),n.results.map((e,t)=>(0,K.jsx)(ba,{text:e.text,query:a,forceOpen:o},t))]}),t[31]=b,t[32]=i,t[33]=o,t[34]=a,t[35]=h,t[36]=n.results,t[37]=n.thinking,t[38]=N):N=t[38];let P;t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,K.jsxs)(`div`,{className:`tr-body`,children:[j,M,N]}),t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;return t[43]!==n.kind||t[44]!==k||t[45]!==P||t[46]!==x||t[47]!==S||t[48]!==C||t[49]!==w||t[50]!==T||t[51]!==E?(F=(0,K.jsxs)(`article`,{className:`tr-step`,"data-kind":n.kind,"data-first":x,"data-spawn":S,"data-match":C,"data-current":w,"data-armed":T,onClick:E,children:[k,A,P]}),t[43]=n.kind,t[44]=k,t[45]=P,t[46]=x,t[47]=S,t[48]=C,t[49]=w,t[50]=T,t[51]=E,t[52]=F):F=t[52],F}),ha=(0,G.memo)(function(e){let t=(0,W.c)(19),{text:n,query:r}=e,i;t[0]===n?i=t[1]:(i=n.length>900||n.split(`
21
+ `).length>14,t[0]=n,t[1]=i);let a=i,[o,s]=(0,G.useState)(!1),c=a&&!o&&!r,l=!r||void 0,u=c||void 0,d;t[2]===c?d=t[3]:(d=c?{WebkitLineClamp:14}:void 0,t[2]=c,t[3]=d);let f;t[4]!==r||t[5]!==n?(f=r?(0,K.jsx)(Sa,{text:n,query:r}):(0,K.jsx)(Hi,{text:n}),t[4]=r,t[5]=n,t[6]=f):f=t[6];let p;t[7]!==l||t[8]!==u||t[9]!==d||t[10]!==f?(p=(0,K.jsx)(`div`,{className:`hist-prose`,"data-md":l,"data-clamped":u,style:d,children:f}),t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==o||t[13]!==a||t[14]!==r?(m=a&&!r&&(0,K.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>s(Ta),"aria-expanded":o,children:o?`Show less`:`Show more`}),t[12]=o,t[13]=a,t[14]=r,t[15]=m):m=t[15];let h;return t[16]!==p||t[17]!==m?(h=(0,K.jsxs)(K.Fragment,{children:[p,m]}),t[16]=p,t[17]=m,t[18]=h):h=t[18],h});function ga(e){let t=(0,W.c)(26),{name:n,args:r,query:i,forceOpen:a}=e,[o,s]=(0,G.useState)(!1),c=o||a,l;t[0]===r?l=t[1]:(l=ia(r),t[0]=r,t[1]=l);let u=l,d;t[2]!==r||t[3]!==c?(d=c?aa(r):``,t[2]=r,t[3]=c,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>s(_a),t[5]=p):p=t[5];let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(`svg`,{className:`w-3 h-3 hist-chev`,strokeWidth:2.5,...pa,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`m9 5 7 7-7 7`})}),t[6]=m):m=t[6];let h;t[7]!==n||t[8]!==i?(h=(0,K.jsx)(`span`,{className:`hist-tool-name`,children:(0,K.jsx)(Sa,{text:n,query:i})}),t[7]=n,t[8]=i,t[9]=h):h=t[9];let g;t[10]!==c||t[11]!==u?(g=!c&&u&&(0,K.jsx)(`span`,{className:`tr-call-sum`,children:u}),t[10]=c,t[11]=u,t[12]=g):g=t[12];let _;t[13]!==c||t[14]!==h||t[15]!==g?(_=(0,K.jsxs)(`button`,{type:`button`,className:`tr-call-head`,onClick:p,"aria-expanded":c,children:[m,h,g]}),t[13]=c,t[14]=h,t[15]=g,t[16]=_):_=t[16];let v;t[17]!==r||t[18]!==f||t[19]!==c||t[20]!==i?(v=c&&r&&(0,K.jsx)(`pre`,{className:`tr-call-args`,children:(0,K.jsx)(Sa,{text:f,query:i})}),t[17]=r,t[18]=f,t[19]=c,t[20]=i,t[21]=v):v=t[21];let y;return t[22]!==c||t[23]!==_||t[24]!==v?(y=(0,K.jsxs)(`div`,{className:`tr-call`,"data-open":c,children:[_,v]}),t[22]=c,t[23]=_,t[24]=v,t[25]=y):y=t[25],y}function _a(e){return!e}function va(e){let t=(0,W.c)(27),{args:n,query:r}=e,i;t[0]===n?i=t[1]:(i=na(n,`subagent_type`),t[0]=n,t[1]=i);let a;t[2]===n?a=t[3]:(a=na(n,`description`)||`Subagent`,t[2]=n,t[3]=a);let o;t[4]===n?o=t[5]:(o=na(n,`prompt`),t[4]=n,t[5]=o);let s;t[6]!==i||t[7]!==a||t[8]!==o?(s={kind:i,title:a,prompt:o},t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9];let{kind:c,title:l,prompt:u}=s,[d,f]=(0,G.useState)(!1),p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(`svg`,{className:`w-3.5 h-3.5 shrink-0`,strokeWidth:2,...pa,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9`})}),t[10]=p):p=t[10];let m;t[11]!==r||t[12]!==l?(m=(0,K.jsx)(`span`,{className:`tr-spawn-title`,children:(0,K.jsx)(Sa,{text:l,query:r})}),t[11]=r,t[12]=l,t[13]=m):m=t[13];let h;t[14]===c?h=t[15]:(h=c&&(0,K.jsx)(w,{children:c}),t[14]=c,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,K.jsxs)(`div`,{className:`tr-spawn-head`,children:[p,m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==d||t[20]!==u||t[21]!==r?(_=u&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`tr-spawn-prompt`,"data-open":d,children:(0,K.jsx)(Sa,{text:u,query:r})}),(0,K.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>f(ya),"aria-expanded":d,children:d?`Hide brief`:`Show brief`})]}),t[19]=d,t[20]=u,t[21]=r,t[22]=_):_=t[22];let v;return t[23]!==d||t[24]!==g||t[25]!==_?(v=(0,K.jsxs)(`div`,{className:`tr-spawn`,"data-open":d,children:[g,_]}),t[23]=d,t[24]=g,t[25]=_,t[26]=v):v=t[26],v}function ya(e){return!e}function ba(e){let t=(0,W.c)(15),{text:n,query:r,forceOpen:i}=e,[a,o]=(0,G.useState)(!1),s=a||i,c;t[0]===n?c=t[1]:(c=aa(n),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.length>160||l.includes(`
22
+ `),t[2]=l,t[3]=u);let d=u,f;t[4]!==r||t[5]!==l?(f=(0,K.jsx)(`div`,{className:`tr-result-text`,children:(0,K.jsx)(Sa,{text:l,query:r})}),t[4]=r,t[5]=l,t[6]=f):f=t[6];let p;t[7]!==s||t[8]!==d||t[9]!==r?(p=d&&!r&&(0,K.jsx)(`button`,{type:`button`,className:`hist-more`,onClick:()=>o(xa),"aria-expanded":s,children:s?`Collapse`:`Expand`}),t[7]=s,t[8]=d,t[9]=r,t[10]=p):p=t[10];let m;return t[11]!==s||t[12]!==f||t[13]!==p?(m=(0,K.jsxs)(`div`,{className:`tr-result`,"data-open":s,children:[f,p]}),t[11]=s,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function xa(e){return!e}function Sa(e){let t=(0,W.c)(14),{text:n,query:r}=e,i;bb0:{if(!r||r.length<2){i=null;break bb0}let e;if(t[0]!==r||t[1]!==n){let i=n.toLowerCase(),a=r.toLowerCase();e=[];let o=0,s=i.indexOf(a,0);for(;s!==-1;)s>o&&e.push({text:n.slice(o,s),highlight:!1}),e.push({text:n.slice(s,s+r.length),highlight:!0}),o=s+r.length,s=i.indexOf(a,o);if(o<n.length){let r;t[3]!==o||t[4]!==n?(r=n.slice(o),t[3]=o,t[4]=n,t[5]=r):r=t[5];let i;t[6]===r?i=t[7]:(i={text:r,highlight:!1},t[6]=r,t[7]=i),e.push(i)}t[0]=r,t[1]=n,t[2]=e}else e=t[2];i=e}let a=i;if(!a||a.length===0){let e;return t[8]===n?e=t[9]:(e=(0,K.jsx)(K.Fragment,{children:n}),t[8]=n,t[9]=e),e}let o;t[10]===a?o=t[11]:(o=a.map(Ca),t[10]=a,t[11]=o);let s;return t[12]===o?s=t[13]:(s=(0,K.jsx)(K.Fragment,{children:o}),t[12]=o,t[13]=s),s}function Ca(e,t){return e.highlight?(0,K.jsx)(`mark`,{children:e.text},t):(0,K.jsx)(`span`,{children:e.text},t)}function wa(e){return Zi.has(e.name)}function Ta(e){return!e}function Ea({turns:e,loading:t,fontSize:n,search:r,onCheckpoint:i}){let{text:a,matches:o,currentIdx:s}=r,c=(0,G.useRef)(i);(0,G.useEffect)(()=>{c.current=i},[i]);let l=!!i,u=(0,G.useMemo)(()=>l?e=>c.current?.(e):void 0,[l]),d=o.length>0?o[s]:-1,f=(0,G.useMemo)(()=>new Set(o),[o]),p=(0,G.useRef)(null),m=a.length>=2,[h,g]=(0,G.useState)(`all`),_=m?`all`:h,v=(0,G.useMemo)(()=>e.map((t,n)=>la(t,e[n-1])),[e]),y=(0,G.useMemo)(()=>fa(v),[v]),b=(0,G.useMemo)(()=>v.filter(e=>da(e,_)),[v,_]),[x,S]=(0,G.useState)(!1);(0,G.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Control`&&S(!0)},t=e=>{e.key===`Control`&&S(!1)},n=()=>S(!1);return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t),window.removeEventListener(`blur`,n)}},[l]);let C=le({count:b.length,getScrollElement:()=>p.current,estimateSize:e=>ua(b[e]),getItemKey:e=>b[e].turn.index,overscan:8}),{scrollToIndex:w}=C;return(0,G.useEffect)(()=>{if(d<0)return;let e=b.findIndex(e=>e.turn.index===d);e>=0&&w(e,{align:`center`})},[d]),(0,K.jsxs)(`div`,{className:`hist`,children:[(0,K.jsxs)(`div`,{className:`hist-bar`,children:[(0,K.jsxs)(`label`,{className:`hist-search`,children:[(0,K.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,strokeWidth:2,...pa,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`m21 21-4.35-4.35M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z`})}),(0,K.jsx)(`input`,{type:`text`,value:a,onChange:e=>r.onChange(e.target.value),placeholder:`Search this trace`,"aria-label":`Search this trace`,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.shiftKey?r.onPrev():r.onNext()):e.key===`Escape`&&a&&(e.stopPropagation(),r.onChange(``))}}),m&&(0,K.jsxs)(K.Fragment,{children:[r.isSearching?(0,K.jsx)(T,{className:`w-3.5 h-3.5`}):(0,K.jsx)(`span`,{className:`hist-count`,"aria-live":`polite`,children:o.length>0?`${s+1} of ${o.length}`:`No matches`}),(0,K.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:r.onPrev,disabled:o.length===0,title:`Previous match (Shift+Enter)`,"aria-label":`Previous match`,children:(0,K.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...pa,children:(0,K.jsx)(`path`,{d:`m5 15 7-7 7 7`})})}),(0,K.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:r.onNext,disabled:o.length===0,title:`Next match (Enter)`,"aria-label":`Next match`,children:(0,K.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...pa,children:(0,K.jsx)(`path`,{d:`m5 9 7 7 7-7`})})})]}),a&&(0,K.jsx)(`button`,{type:`button`,className:`hist-iconbtn`,onClick:()=>r.onChange(``),title:`Clear search (Esc)`,"aria-label":`Clear search`,children:(0,K.jsx)(`svg`,{className:`w-3.5 h-3.5`,strokeWidth:2.5,...pa,children:(0,K.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]}),(0,K.jsx)(me,{value:_,onValueChange:e=>g(e),children:(0,K.jsxs)(de,{"aria-label":`Trace filter`,children:[(0,K.jsx)(V,{value:`all`,children:`All`}),(0,K.jsx)(V,{value:`messages`,children:`Messages`}),(0,K.jsxs)(V,{value:`tools`,children:[`Tools`,y.calls>0&&(0,K.jsx)(`span`,{className:`tr-n`,children:y.calls})]}),(0,K.jsxs)(V,{value:`agents`,children:[`Agents`,y.spawns>0&&(0,K.jsx)(`span`,{className:`tr-n`,children:y.spawns})]})]})})]}),e.length>0&&(0,K.jsxs)(`div`,{className:`tr-summary`,"aria-label":`Trace summary`,children:[(0,K.jsxs)(`span`,{children:[e.length,` turns`]}),(0,K.jsxs)(`span`,{children:[y.calls,` tool `,y.calls===1?`call`:`calls`]}),(0,K.jsxs)(`span`,{children:[y.spawns,` `,y.spawns===1?`subagent`:`subagents`]}),y.span!==null&&y.span>0&&(0,K.jsxs)(`span`,{children:[`over `,sa(y.span)]})]}),t&&e.length===0?(0,K.jsx)(`div`,{className:`hist-empty`,children:(0,K.jsx)(T,{className:`w-5 h-5`})}):e.length===0?(0,K.jsxs)(`div`,{className:`hist-empty`,children:[(0,K.jsx)(`svg`,{className:`w-8 h-8`,strokeWidth:1.25,...pa,"aria-hidden":!0,children:(0,K.jsx)(`path`,{d:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9`})}),(0,K.jsx)(`span`,{children:`No trace yet`}),(0,K.jsx)(`small`,{children:`Steps appear here once the session has run.`})]}):b.length===0?(0,K.jsxs)(`div`,{className:`hist-empty`,children:[(0,K.jsx)(`span`,{children:`Nothing to show for this filter`}),(0,K.jsx)(`small`,{children:_===`agents`?`This session has not spawned a subagent.`:`Try another filter.`})]}):(0,K.jsx)(`div`,{ref:p,className:`hist-scroll tr-timeline`,style:{fontSize:`${n}px`},children:(0,K.jsx)(`div`,{style:{height:C.getTotalSize(),position:`relative`,width:`100%`},children:C.getVirtualItems().map(e=>{let t=b[e.index];return(0,K.jsx)(`div`,{"data-index":e.index,ref:C.measureElement,className:`tr-row`,"data-lead":t.kind===`prompt`||void 0,style:{transform:`translateY(${e.start}px)`},children:(0,K.jsx)(ma,{step:t,first:e.index===0,filter:_,searchQuery:m?a:``,isSearchMatch:f.has(t.turn.index),isCurrentMatch:t.turn.index===d,onCheckpoint:u,ctrlHeld:x})},e.key)})})})]})}function Da(e){let t=(0,W.c)(7),{d:n,size:r,sw:i}=e,a=r===void 0?16:r,o=i===void 0?2:i,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={flex:`none`},t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:n}),t[1]=n,t[2]=c);let l;return t[3]!==a||t[4]!==o||t[5]!==c?(l=(0,K.jsx)(`svg`,{width:a,height:a,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:o,"aria-hidden":`true`,style:s,children:c}),t[3]=a,t[4]=o,t[5]=c,t[6]=l):l=t[6],l}var Oa=`m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5`,ka=`M6 18 18 6M6 6l12 12`,Aa=`M3 5.5 10.5 4.5v7H3v-6Zm8.5-1.1L21 3v8.5h-9.5v-7.1ZM3 12.5h7.5v7L3 18.5v-6Zm8.5 0H21V21l-9.5-1.4v-7.1Z`;function ja(e){let t=(0,W.c)(24),{projectPath:n,psmuxExe:r,tmuxAvailable:i,paneStyle:a,onPick:o,onPsmuxInstalled:s}=e,c;t[0]===n?c=t[1]:(c=n?.startsWith(`/`),t[0]=n,t[1]=c);let l=c,u=r?`psmux · stays running`:`cmd.exe`,d;t[2]===u?d=t[3]:(d={id:`windows`,label:`Windows`,hint:u,d:Aa},t[2]=u,t[3]=d);let f=i?`wsl.exe + tmux · stays running`:`wsl.exe + bash`,p;t[4]===f?p=t[5]:(p={id:`wsl`,label:`WSL`,hint:f,d:Oa},t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=[d,p],t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=m,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsx)(`h3`,{children:`Where should Claude run?`}),t[9]=g):g=t[9];let _;t[10]!==n||t[11]!==l?(_=(0,K.jsxs)(`div`,{className:`cdv-empty-copy`,children:[g,(0,K.jsx)(`p`,{children:l?(0,K.jsxs)(K.Fragment,{children:[`This project lives under `,(0,K.jsx)(`code`,{children:`/`}),`, so WSL is the natural pick. Saved per card.`]}):n?(0,K.jsxs)(K.Fragment,{children:[`Windows suits projects under `,(0,K.jsx)(`code`,{children:`C:\\`}),`; WSL suits `,(0,K.jsx)(`code`,{children:`/home/`}),`. Saved per card.`]}):(0,K.jsx)(K.Fragment,{children:`Choose where Claude launches for this card. Saved per card.`})})]}),t[10]=n,t[11]=l,t[12]=_):_=t[12];let v;t[13]!==o||t[14]!==h||t[15]!==l?(v=(0,K.jsx)(`div`,{className:`cdv-runtimes`,children:h.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`cdv-runtime`,onClick:()=>o(e.id),children:[(0,K.jsx)(`span`,{className:`cdv-tile`,children:(0,K.jsx)(Da,{d:e.d,size:20,sw:1.75})}),(0,K.jsxs)(`span`,{className:`cdv-runtime-text`,children:[(0,K.jsx)(`strong`,{children:e.label}),(0,K.jsx)(`small`,{children:e.hint})]}),e.id===`wsl`&&l&&(0,K.jsx)(w,{children:`Suggested`})]},e.id))}),t[13]=o,t[14]=h,t[15]=l,t[16]=v):v=t[16];let y;t[17]===s?y=t[18]:(y=(0,K.jsx)(zi,{onInstalled:s}),t[17]=s,t[18]=y);let b;return t[19]!==a||t[20]!==y||t[21]!==_||t[22]!==v?(b=(0,K.jsxs)(`div`,{className:`cdv-pane cdv-empty`,style:a,children:[_,v,y]}),t[19]=a,t[20]=y,t[21]=_,t[22]=v,t[23]=b):b=t[23],b}function Ma(e){let t=(0,W.c)(15),{tabs:n,active:r,onSelect:i,onClose:a,onAdd:o}=e,s;if(t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n){let e;t[5]!==r||t[6]!==a||t[7]!==i?(e=e=>{let t=e.index===r,n=e.index===1,o=e.name||`tab ${e.index}`;return(0,K.jsxs)(`div`,{role:`presentation`,className:`cdv-termtab`,"data-active":t||void 0,children:[(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,className:`cdv-termtab-btn`,onClick:()=>i(e.index),title:e.name,children:n?`Claude`:o}),!n&&(0,K.jsx)(`button`,{type:`button`,className:`cdv-termtab-close`,onClick:()=>a(e.index),"aria-label":`Close ${o}`,title:`Close tab`,children:(0,K.jsx)(Da,{d:`M6 18 18 6M6 6l12 12`,size:11,sw:2.5})})]},e.index)},t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],s=n.map(e),t[0]=r,t[1]=a,t[2]=i,t[3]=n,t[4]=s}else s=t[4];let c;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(Da,{d:`M12 4.5v15m7.5-7.5h-15`,size:12,sw:2.5}),t[9]=c):c=t[9];let l;t[10]===o?l=t[11]:(l=(0,K.jsx)(`button`,{type:`button`,className:`cdv-termadd`,onClick:o,"aria-label":`New shell tab`,title:`New shell tab`,children:c}),t[10]=o,t[11]=l);let u;return t[12]!==s||t[13]!==l?(u=(0,K.jsxs)(`div`,{className:`cdv-termtabs`,role:`tablist`,"aria-label":`Terminal windows`,children:[s,l]}),t[12]=s,t[13]=l,t[14]=u):u=t[14],u}function Na(e){let t=(0,W.c)(11),{onRunAgain:n,onEditSetup:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`span`,{className:`cdv-exited-dot`,"aria-hidden":!0}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsxs)(`span`,{className:`cdv-exited-text`,children:[(0,K.jsx)(`strong`,{children:`Process exited`}),(0,K.jsx)(`span`,{children:`Run the same command again, or change the setup first.`})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(Ge,{size:14,strokeWidth:2.25,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,K.jsxs)(`button`,{type:`button`,className:`cdv-exited-btn`,onClick:n,children:[o,`Run again`]}),t[3]=n,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(qe,{size:14,strokeWidth:2.25,"aria-hidden":!0}),t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=(0,K.jsxs)(`button`,{type:`button`,className:`cdv-exited-btn`,"data-primary":!0,onClick:r,children:[c,`Edit setup`]}),t[6]=r,t[7]=l);let u;return t[8]!==s||t[9]!==l?(u=(0,K.jsxs)(`div`,{className:`cdv-exited`,role:`status`,children:[i,a,s,l]}),t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function Pa(e){let t=(0,W.c)(7),{loading:n,hasSession:r,paneStyle:i,onStart:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==a?(o=n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(T,{}),(0,K.jsxs)(`div`,{className:`cdv-empty-copy`,children:[(0,K.jsx)(`h3`,{children:`Restoring session`}),(0,K.jsx)(`p`,{children:`Reading the transcript so the terminal opens with its history.`})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`cdv-tile cdv-tile--lg`,children:(0,K.jsx)(Da,{d:Oa,size:24,sw:1.5})}),(0,K.jsxs)(`div`,{className:`cdv-empty-copy`,children:[(0,K.jsx)(`h3`,{children:r?`Session is paused`:`Not started yet`}),(0,K.jsx)(`p`,{children:r?`Resume to reattach to this Claude session.`:`Start to launch Claude with this card's prompt.`})]}),(0,K.jsx)(E,{variant:`solid`,onClick:a,children:r?`Resume session`:`Start session`})]}),t[0]=r,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;return t[4]!==i||t[5]!==o?(s=(0,K.jsx)(`div`,{className:`cdv-pane cdv-empty`,style:i,children:o}),t[4]=i,t[5]=o,t[6]=s):s=t[6],s}var Fa=`\x1B[0m`,Ia=`\x1B[2m`,La=`\x1B[36m`,Ra=`\x1B[35m`,za=e=>e.replace(/\r\n|\r|\n/g,`\r
23
+ `),Ba=(e,t)=>e.length>t?e.slice(0,t)+`…`:e;function Va(e){if(!e.length)return``;let t=[];for(let n of e){let e=n.timestamp?new Date(n.timestamp).toLocaleString():``,r=n.role===`user`?`${La}▶ user${Fa}`:`${Ra}◀ assistant${Fa}`;t.push(`${r}${e?` ${Ia}· ${e}${Fa}`:``}`);for(let e of n.contentBlocks)e.kind===`text`?t.push(za(e.text)):e.kind===`thinking`?t.push(`${Ia}[thinking] ${za(Ba(e.text,240))}${Fa}`):e.kind===`tool_use`?t.push(`${Ia}⚙ ${za(e.text)}${Fa}`):e.kind===`tool_result`&&t.push(`${Ia}↳ ${za(Ba(e.text,400))}${Fa}`);t.push(``)}return t.push(`${Ia}── session resumes below ──${Fa}`,``),t.join(`\r
24
+ `)}var Ha=200,Ua=180,Wa=`cubic-bezier(0.22, 1, 0.36, 1)`,Ga=[{opacity:0,transform:`translateY(16px) scale(0.97)`},{opacity:1,transform:`none`}],Ka=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;function qa(e,t){let n=(0,W.c)(17),r=(0,G.useRef)(null),[i,a]=(0,G.useState)(!1),o=(0,G.useRef)(null),s;n[0]!==t||n[1]!==e?(s=()=>{if(o.current)return;if(Ka()){t();return}a(!0);let n=Ua,i=r.current;e&&i&&(n=Ha,i.animate([...Ga].reverse(),{duration:Ha,easing:Wa,fill:`forwards`})),o.current=setTimeout(()=>{o.current=null,t()},n)},n[0]=t,n[1]=e,n[2]=s):s=n[2];let c=s,l,u;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>{o.current&&clearTimeout(o.current)},u=[],n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,G.useEffect)(l,u);let d,f;n[5]===c?(d=n[6],f=n[7]):(d=()=>(window.addEventListener(`cdv-close`,c),()=>window.removeEventListener(`cdv-close`,c)),f=[c],n[5]=c,n[6]=d,n[7]=f),(0,G.useEffect)(d,f);let p,m;n[8]===c?(p=n[9],m=n[10]):(p=()=>{let e=e=>{e.key!==`Escape`||e.defaultPrevented||document.activeElement&&document.activeElement!==document.body||document.querySelector(`[role="dialog"], [role="menu"]`)||c()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},m=[c],n[8]=c,n[9]=p,n[10]=m),(0,G.useEffect)(p,m);let h,g;n[11]===e?(h=n[12],g=n[13]):(h=()=>{let t=r.current;e&&t&&!Ka()&&t.animate(Ga,{duration:Ha,easing:Wa})},g=[e],n[11]=e,n[12]=h,n[13]=g),(0,G.useLayoutEffect)(h,g);let _;return n[14]!==i||n[15]!==c?(_={panelRef:r,closing:i,requestClose:c},n[14]=i,n[15]=c,n[16]=_):_=n[16],_}var Ja=340,Ya=1280;function Xa(e){let t=(0,W.c)(9),[n,r]=(0,G.useState)(e===void 0?720:e),[i,a]=(0,G.useState)(!1),o=(0,G.useRef)(n),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{o.current=n},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,G.useEffect)(s,c);let l=(0,G.useRef)(null),u,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>()=>l.current?.(),d=[],t[3]=u,t[4]=d):(u=t[3],d=t[4]),(0,G.useEffect)(u,d);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e.preventDefault();let t=e.clientX,n=o.current,i=e=>{r(Math.min(Math.max(n+t-e.clientX,Ja),Ya))},s=()=>{document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,s),document.body.style.cursor=``,document.body.style.userSelect=``,l.current=null,a(!1)};a(!0),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,s),l.current=s},t[5]=f):f=t[5];let p=f,m;return t[6]!==i||t[7]!==n?(m={width:n,resizing:i,onMouseDown:p,minWidth:Ja,maxWidth:Ya},t[6]=i,t[7]=n,t[8]=m):m=t[8],m}var Za=1e5;async function Qa(e,t,n){let r=[],i=t.length;for(;;){let a=await be(e,i,Za);if(n())return null;if(r.length===0&&t.length>0&&a.totalTurns<t.length)return Qa(e,[],n);if(r.push(...a.turns),!a.hasMore)break;i=a.nextOffset}return r.length>0?[...t,...r]:t}function $a(e,t,n){let[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(!e),l=(0,G.useRef)([]),u=(0,G.useRef)(!e),d=(0,G.useRef)(0),f=(0,G.useCallback)(async(t,n)=>{if(!e)return;let r=++d.current;t&&o(!0);try{let n=await Qa(e,t?[]:l.current,()=>r!==d.current);n&&r===d.current&&n!==l.current&&(l.current=n,i(n))}catch(e){n&&r===d.current&&ce.setState({error:String(e)})}finally{r===d.current&&o(!1)}},[e]);return(0,G.useEffect)(()=>{if(!e)return;let t=!0;return f(!0,!1).then(()=>{t&&(u.current=!0,c(!0))}),()=>{t=!1,d.current++}},[e,f]),(0,G.useEffect)(()=>{t&&u.current&&f(!1,!1)},[t,n,f]),{turns:r,loading:a,loaded:s,reload:(0,G.useCallback)(()=>f(!0,!0),[f])}}function eo(e){let[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(0),[s,c]=(0,G.useState)(!1);(0,G.useEffect)(()=>{let n=t.trim();if(!e||n.length<2){i([]),o(0),c(!1);return}let r=!1;c(!0);let a=setTimeout(async()=>{try{let t=await oe(e,n);if(r)return;i(t),o(0)}catch{r||i([])}finally{r||c(!1)}},300);return()=>{r=!0,clearTimeout(a)}},[t,e]);let l=(0,G.useCallback)(e=>{r.length!==0&&o(t=>(t+e+r.length)%r.length)},[r.length]);return{text:t,matches:r,currentIdx:a,isSearching:s,onChange:n,onNext:(0,G.useCallback)(()=>l(1),[l]),onPrev:(0,G.useCallback)(()=>l(-1),[l])}}var to=e=>ce.setState({error:String(e)}),no=1e3,ro=1100,io=62e3,ao=3e5;function oo(e){return e.imagePaths?.length?m(e.body,e.imagePaths):e.body}function so(t,n){let i=(0,W.c)(36),a=t.id,o=t.link.sessionLink?.sessionId,s;i[0]===t.link.queuedPrompts?s=i[1]:(s=t.link.queuedPrompts??[],i[0]=t.link.queuedPrompts,i[1]=s);let[c,l]=(0,G.useState)(s),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(null),m;i[2]===t.link.queuedPrompts?m=i[3]:(m=()=>{l(t.link.queuedPrompts??[])},i[2]=t.link.queuedPrompts,i[3]=m);let h;i[4]===t.link.updatedAt?h=i[5]:(h=[t.link.updatedAt],i[4]=t.link.updatedAt,i[5]=h),(0,G.useEffect)(m,h);let g=(0,G.useRef)(c),_,v;i[6]===c?(_=i[7],v=i[8]):(_=()=>{g.current=c},v=[c],i[6]=c,i[7]=_,i[8]=v),(0,G.useEffect)(_,v);let y=(0,G.useRef)(0),b;i[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=new Map,i[9]=b):b=i[9];let x=(0,G.useRef)(b),S;i[10]===a?S=i[11]:(S=async e=>{try{await ve(a,e),l(t=>t.filter(t=>t.id!==e))}catch(e){to(e)}},i[10]=a,i[11]=S);let C=S,w,T;i[12]!==a||i[13]!==C||i[14]!==o||i[15]!==n?(w=()=>{if(!o)return;let t=!1,i=null,s=async()=>{if(Date.now()-y.current<ro)return;let e=ce.getState().cards.find(e=>e.id===a)?.link.queuedPrompts??g.current,i=Date.now(),o=e.find(e=>e.sendAutomatically&&(x.current.get(e.id)??0)+io<i);if(!o||!n.current)return;if(o.selfCompactThresholdTokens!=null){let e;try{e=await r(`should_drop_self_compact_prompt`,{cardId:a,promptId:o.id})}catch{e=!1}if(t)return;if(e){await C(o.id);return}}let s=n.current;if(!t&&s){x.current.set(o.id,i);for(let[e,t]of x.current)i-t>ao&&x.current.delete(e);try{await ve(a,o.id)}catch(e){to(e);return}l(e=>e.filter(e=>e.id!==o.id)),s(oo(o)+`\r`)}},c=e(`hook-event`,e=>{let n=e.payload;!t&&n&&n.sessionId===o&&(n.eventName===`UserPromptSubmit`?y.current=Date.now():n.eventName===`Stop`&&(i&&clearTimeout(i),i=setTimeout(()=>void s(),no)))});return()=>{t=!0,i&&clearTimeout(i),c.then(lo).catch(co)}},T=[a,o,n,C],i[12]=a,i[13]=C,i[14]=o,i[15]=n,i[16]=w,i[17]=T):(w=i[16],T=i[17]),(0,G.useEffect)(w,T);let E;i[18]===a?E=i[19]:(E=async(e,t,n)=>{try{let r=await re(a,e,t,n);l(e=>[...e,r])}catch(e){to(e)}},i[18]=a,i[19]=E);let D=E,O;i[20]!==a||i[21]!==f?(O=async(e,t,n)=>{if(f)try{let r=n??[];await fe(a,f.id,e,t,r),l(n=>n.map(n=>n.id===f.id?{...n,body:e,sendAutomatically:t,imagePaths:r.length>0?r:void 0}:n))}catch(e){to(e)}},i[20]=a,i[21]=f,i[22]=O):O=i[22];let k=O,A;i[23]!==a||i[24]!==n?(A=async e=>{let t=g.current.find(t=>t.id===e),r=n.current;if(t&&r){try{await ve(a,e)}catch(e){to(e);return}l(t=>t.filter(t=>t.id!==e)),r(oo(t)+`\r`)}},i[23]=a,i[24]=n,i[25]=A):A=i[25];let j=A,M;i[26]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{p(null),d(!0)},i[26]=M):M=i[26];let N=M,P;i[27]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{p(e),d(!0)},i[27]=P):P=i[27];let F=P,I;i[28]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{d(!1),p(null)},i[28]=I):I=i[28];let ee=I,te=f?k:D,ne;return i[29]!==u||i[30]!==f||i[31]!==c||i[32]!==C||i[33]!==j||i[34]!==te?(ne={prompts:c,dialogOpen:u,editing:f,openAdd:N,openEdit:F,closeDialog:ee,save:te,remove:C,sendNow:j},i[29]=u,i[30]=f,i[31]=c,i[32]=C,i[33]=j,i[34]=te,i[35]=ne):ne=i[35],ne}function co(){}function lo(e){return e()}var uo=null,fo=null;function po(){return uo??=r(`tmux_available`).then(Boolean).catch(()=>(uo=null,!1)),uo}function mo(){return fo??=r(`launcher_info`).catch(()=>(fo=null,null)),fo}function ho(){return r(`psmux_status`).then(e=>e.available?e.path??null:null).catch(()=>null)}function go(){let e=(0,W.c)(14),[t,n]=(0,G.useState)(15),[r,i]=(0,G.useState)(12),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],e[0]=a):a=e[0];let[o,s]=(0,G.useState)(a),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={},e[1]=c):c=e[1];let[l,u]=(0,G.useState)(c),[d,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(null),y;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>ho().then(m),e[2]=y):y=e[2];let b=y,x,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{let e=!0;return H().then(t=>{e&&(n(t.terminalFontSize||15),i(t.sessionDetailFontSize||12),s(t.apiServices??[]),u(t.defaultAPIServiceIds??{}))}).catch(_o),mo().then(t=>e&&v(t)),Promise.all([po(),ho()]).then(t=>{let[n,r]=t;e&&(f(n),m(r),g(!0))}),()=>{e=!1}},S=[],e[3]=x,e[4]=S):(x=e[3],S=e[4]),(0,G.useEffect)(x,S);let C;return e[5]!==o||e[6]!==l||e[7]!==_||e[8]!==h||e[9]!==p||e[10]!==r||e[11]!==t||e[12]!==d?(C={terminalFontSize:t,sessionDetailFontSize:r,apiServices:o,defaultAPIServiceIds:l,tmuxAvailable:d,psmuxExe:p,muxProbed:h,launcher:_,refreshPsmux:b},e[5]=o,e[6]=l,e[7]=_,e[8]=h,e[9]=p,e[10]=r,e[11]=t,e[12]=d,e[13]=C):C=e[13],C}function _o(){}var vo=e=>ce.setState({error:String(e)});function yo(e){let t=(0,W.c)(41),{useTmux:n,usePsmux:i,terminalActive:a,tmuxSession:o,tmuxRuntime:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[0]=c):c=t[0];let[l,u]=(0,G.useState)(c),[d,f]=(0,G.useState)(1),[p,m]=(0,G.useState)(null),h=(0,G.useRef)(d),g=(0,G.useRef)(e),_;t[1]!==d||t[2]!==e?(_=()=>{h.current=d,g.current=e},t[1]=d,t[2]=e,t[3]=_):_=t[3],(0,G.useEffect)(_);let v;t[4]!==s||t[5]!==o||t[6]!==n?(v=async()=>{if(n)try{let e=await r(`tmux_list_windows`,{session:o,runtime:s});u(e),e.length>0&&!e.some(e=>e.index===h.current)&&f((e.find(xo)??e[0]).index)}catch{u([])}},t[4]=s,t[5]=o,t[6]=n,t[7]=v):v=t[7];let y=v,b,x;t[8]!==y||t[9]!==a||t[10]!==n?(b=()=>{if(!n||!a)return;let e=setTimeout(y,800);return()=>clearTimeout(e)},x=[n,a,y],t[8]=y,t[9]=a,t[10]=n,t[11]=b,t[12]=x):(b=t[11],x=t[12]),(0,G.useEffect)(b,x);let S,C;t[13]!==p||t[14]!==a||t[15]!==o||t[16]!==i?(S=()=>{if(!i||!a||p===o)return;let e=!1;return r(`tmux_ensure_session`,{name:o,cwdWindows:g.current.projectPath??``,command:g.current.ensureCommand,runtime:`windows`}).then(()=>{e||(f(bo),m(o))}).catch(vo),()=>{e=!0}},C=[i,a,o,p],t[13]=p,t[14]=a,t[15]=o,t[16]=i,t[17]=S,t[18]=C):(S=t[17],C=t[18]),(0,G.useEffect)(S,C);let w;t[19]!==y||t[20]!==s||t[21]!==o||t[22]!==n?(w=async()=>{if(n)try{let e=await r(`tmux_new_window`,{session:o,cwdWindows:g.current.projectPath??null,command:null,runtime:s});f(e),await y()}catch(e){vo(e)}},t[19]=y,t[20]=s,t[21]=o,t[22]=n,t[23]=w):w=t[23];let T=w,E;t[24]!==y||t[25]!==l||t[26]!==s||t[27]!==o||t[28]!==n?(E=async e=>{if(!n)return;let t=l[0]?.index??1;if(e!==t)try{await r(`tmux_kill_window`,{target:`${o}:${e}`,runtime:s}),h.current===e&&f(t),await y()}catch(e){vo(e)}},t[24]=y,t[25]=l,t[26]=s,t[27]=o,t[28]=n,t[29]=E):E=t[29];let D=E,O;t[30]!==s||t[31]!==o||t[32]!==n?(O=async()=>{if(!n)return!1;try{return(await r(`tmux_list_windows`,{session:o,runtime:s})).length>0}catch{return!1}},t[30]=s,t[31]=o,t[32]=n,t[33]=O):O=t[33];let k=O,A=!i||p===o,j;return t[34]!==d||t[35]!==T||t[36]!==D||t[37]!==k||t[38]!==A||t[39]!==l?(j={tabs:l,activeTab:d,setActiveTab:f,ready:A,addTab:T,closeTab:D,hasLiveSession:k},t[34]=d,t[35]=T,t[36]=D,t[37]=k,t[38]=A,t[39]=l,t[40]=j):j=t[40],j}function bo(e){return e===1?0:e}function xo(e){return e.active}var So=(0,G.lazy)(()=>ye(()=>import(`./Terminal-yq90NOBX.js`),__vite__mapDeps([0,1,2,3,4,5,6]))),Co=(0,G.lazy)(()=>ye(()=>import(`./DiffPane-2WnoRvZ0.js`),__vite__mapDeps([7,1,3,8,9,2,4,5,10]))),wo={terminal:`Terminal`,trace:`Trace`,usage:`Usage`,diff:`Diff`,issue:`Issue`,pr:`PR`,prompt:`Description`,knowledge:`Knowledge`},To=[`prompt`,`terminal`,`trace`,`usage`,`diff`,`issue`,`pr`,`knowledge`],Eo=[],Do=e=>ce.setState({error:String(e)});function Oo(e){return e.link.promptBody?`prompt`:e.link.sessionLink?.sessionId?`terminal`:`trace`}function ko(){let e=ce(e=>e.cards.find(t=>t.id===e.selectedCardId)??null),t=(0,G.useRef)(e);return Oe(t.current,e)||(t.current=e),t.current}function Ao(e){let t=(0,W.c)(3),{mode:n}=e,r=n===void 0?`popup`:n,i=ko();if(!i)return null;let a;return t[0]!==i||t[1]!==r?(a=(0,K.jsx)(jo,{mode:r,card:i},i.id),t[0]=i,t[1]=r,t[2]=a):a=t[2],a}var jo=(0,G.memo)(function({mode:e,card:t}){let n=e===`popup`,i=ce(e=>e.selectCard),a=ce(e=>e.renameCard),o=ce(e=>e.deleteCard),s=ce(e=>e.moveCard),{theme:c}=N(),l=L(c),u=t.link.sessionLink?.sessionId,d=t.link.projectPath??t.session?.projectPath,f=t.link.worktreeLink?.branch,h=t.link.prLinks.find(e=>(e.status??``).toUpperCase()===`OPEN`)??t.link.prLinks[0],g=t.link.worktreeLink?.path??d,_=t.link.issueLink,v=t.link.promptBody,y=!!u||!!v,b=t.link.cardRuntime??null,x=go(),{panelRef:S,closing:C,requestClose:D}=qa(n,(0,G.useCallback)(()=>i(null),[i])),O=Xa(),[k,A]=(0,G.useState)(()=>Oo(t)),j=(0,G.useRef)(k);(0,G.useEffect)(()=>{j.current=k},[k]);let ee=xe(t.id),te=ee?.proposals.filter(e=>e.status===`pending`).length??0,re=!!ee&&ee.proposals.length+ee.injected.length+ee.review.length>0,ie=To.filter(e=>{switch(e){case`terminal`:return y;case`trace`:case`usage`:return!!u;case`diff`:return!!g;case`issue`:return!!_;case`pr`:return!!h;case`prompt`:return!!v;case`knowledge`:return re}}),B=ie.includes(k)?k:ie[0]??k,[H,oe]=(0,G.useState)(!1),[se,le]=(0,G.useState)(!1),[ue,fe]=(0,G.useState)(``),ve=(0,G.useRef)(!1),ye=()=>{ve.current=!1,fe(t.displayTitle),le(!0)},be=()=>{if(ve.current)return;ve.current=!0;let e=ue.trim();e&&e!==t.displayTitle&&a(t.id,e),le(!1)},Se=()=>{ve.current=!0,le(!1)},Ce=$a(u,B===`trace`,t.link.updatedAt),we=eo(u),[Te,Ee]=(0,G.useState)(!1),[Oe,ke]=(0,G.useState)(!1),[Ae,je]=(0,G.useState)(0),[Me,Ne]=(0,G.useState)(!1),[Pe,Fe]=(0,G.useState)(null),Ie=(0,G.useRef)(null),Le=so(t,Ie),Re=b===`wsl`,Be=b===`windows`&&!!x.psmuxExe,He=Re&&x.tmuxAvailable||Be,We=Be?`windows`:`wsl`,Ge=`devboard-${t.id}`,Ke=t.link.assistantId??`claude`,qe=ne[Ke]??`claude`,Je=(0,G.useMemo)(()=>R({apiServices:x.apiServices,defaultAPIServiceIds:x.defaultAPIServiceIds},t.link.apiServiceId,Ke),[x.apiServices,x.defaultAPIServiceIds,t.link.apiServiceId,Ke]),Xe=(0,G.useMemo)(()=>Kr(qe,Je&&{launcherPrefix:Je.launcherPrefix,modelFlag:Je.modelFlag,needsSeparator:P(Je)}),[Je,qe]),W=Je?.baseURL,Qe=(0,G.useMemo)(()=>[[`DEVBOARD_CARD_ID`,t.id],[`DEVBOARD_HANDLE`,Jr(t.displayTitle)],...W?[[`ANTHROPIC_BASE_URL`,W]]:[]],[t.id,t.displayTitle,W]),et=Pe?.prompt??v??``,tt=t.link.promptImagePaths?.length?m(et,t.link.promptImagePaths):et,nt=Pe?.dangerouslySkipPermissions??!1,rt=Pe?.envPrefix??Eo,it=Pe?.model??``,at=Pe?.commandOverride??null,ot=(0,G.useCallback)((e,t,n,r,i)=>({cwd:d,sessionId:e,prompt:t,skipPermissions:n,model:i,env:Qe,userEnv:r,cli:Xe}),[d,Qe,Xe]),st=(0,G.useMemo)(()=>at??ti(ot(u??null,tt,nt,rt,it)),[at,ot,u,tt,nt,rt,it]),ct=(0,G.useMemo)(()=>at??ri(ot(u??null,tt,nt,rt,it),{launcher:x.launcher}),[at,ot,u,tt,nt,rt,it,x.launcher]),q=yo({useTmux:He,usePsmux:Be,terminalActive:Te,tmuxSession:Ge,tmuxRuntime:We,projectPath:d,ensureCommand:ct}),{shellCommand:lt,terminalInput:ut,external:dt}=(0,G.useMemo)(()=>ii({usePsmux:Be,psmuxExe:x.psmuxExe,useTmux:He,isWsl:Re,tmuxSession:Ge,activeTermTab:q.activeTab,hasActiveWindow:q.tabs.some(e=>e.index===q.activeTab),innerBashCmd:st,innerCmdShellCmd:ct}),[Be,x.psmuxExe,He,Re,Ge,q.activeTab,q.tabs,st,ct]),ft=(0,G.useMemo)(()=>Te&&u?Va(Ce.turns):void 0,[Te,u,Ce.turns]);(0,G.useEffect)(()=>{Ce.loaded&&u&&b&&Ee(!0)},[Ce.loaded,u,b]),(0,G.useEffect)(()=>{if(u||!v||Te||Me||Pe||!b||!x.muxProbed)return;A(`terminal`);let e=!1;return q.hasLiveSession().then(t=>{e||(t?Ee(!0):Ne(!0))}),()=>{e=!0}},[b,x.muxProbed]);let pt=async e=>{try{await r(`set_card_runtime`,{cardId:t.id,runtime:e}),await ce.getState().refresh()}catch(e){Do(e)}},mt=async()=>{let e=t.displayTitle||t.link.name||`this card`;await De(`Delete "${e}"?\n\n${Te?`The open terminal will be stopped. The Claude session .jsonl on disk is not deleted.`:`The Claude session .jsonl on disk is not deleted — you can still find it in All Sessions.`}`,{title:`Delete card`,kind:`warning`,okLabel:`Delete`,cancelLabel:`Cancel`})&&o(t.id)},J=async e=>{let n=t.link.sessionLink?.sessionPath;if(!n)return;let r=e+1;if(await De(`Checkpoint session to turn ${r}?\n\nEverything after this turn is removed from the .jsonl. The original is backed up next to it as <session>.jsonl.bkp.`,{title:`Checkpoint session`,kind:`warning`,okLabel:`Checkpoint`,cancelLabel:`Cancel`}))try{await he(n,r),await Ce.reload()}catch(e){Do(e)}},Y=async()=>{try{Be&&await r(`tmux_ensure_session`,{name:Ge,cwdWindows:d??``,command:ct,runtime:`windows`}),await r(`open_in_terminal`,dt)}catch(e){Do(e)}},ht=()=>{b?u?(Ee(!0),A(`terminal`)):(A(`terminal`),q.hasLiveSession().then(e=>{e?Ee(!0):Ne(!0)})):A(`terminal`)},X=()=>{ke(!1),Fe(null),Ee(!1),Ne(!0),A(`terminal`)},Z=ie.length>1,Q={"--cdv-dx":`${(To.indexOf(B)>=To.indexOf(j.current)?1:-1)*14}px`},$=(h?.status??``).toUpperCase(),gt=$===`MERGED`?`default`:$===`CLOSED`?`danger`:`success`,_t=Me&&!!d&&!Te,vt=B===`terminal`&&Te,yt=(0,K.jsxs)(`div`,{ref:S,className:`cdv`,"data-mode":n?`popup`:`drawer`,"data-closing":C||void 0,"data-resizing":O.resizing||void 0,style:n?{...l.mat.ultrathick,border:`1px solid ${l.border}`,borderRadius:28}:{width:O.width,minWidth:O.minWidth,maxWidth:O.maxWidth,...l.mat.ultrathick,borderLeft:`1px solid ${l.border}`,borderTopLeftRadius:34,borderBottomLeftRadius:34},children:[!n&&(0,K.jsx)(`div`,{onMouseDown:O.onMouseDown,className:`cdv-resize`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{className:`cdv-grip`})}),(0,K.jsxs)(`header`,{className:`cdv-head`,children:[(0,K.jsxs)(`div`,{className:`cdv-row cdv-rise`,style:{"--i":0},children:[se?(0,K.jsx)(`input`,{autoFocus:!0,className:`cdv-title-input`,value:ue,"aria-label":`Card title`,onChange:e=>fe(e.target.value),onBlur:be,onKeyDown:e=>{e.key===`Enter`&&be(),e.key===`Escape`&&(e.stopPropagation(),Se())}}):(0,K.jsx)(`h2`,{className:`cdv-title`,children:(0,K.jsx)(`button`,{type:`button`,onClick:ye,title:`Rename`,children:t.displayTitle})}),(0,K.jsxs)(`div`,{className:`cdv-tools`,children:[v&&(0,K.jsx)(E,{icon:!0,size:`sm`,variant:`ghost`,"aria-label":H?`Stop editing task`:`Edit task`,"aria-pressed":H,"data-active":H||void 0,onClick:()=>oe(e=>!e),title:`Edit task`,children:(0,K.jsx)(Ve,{size:16,strokeWidth:2,"aria-hidden":!0})}),(0,K.jsx)(E,{icon:!0,size:`sm`,variant:`ghost`,"aria-label":`Close`,onClick:D,title:`Close (Esc)`,children:(0,K.jsx)(Da,{d:ka,sw:2.25})})]})]}),(0,K.jsxs)(`div`,{className:`cdv-bar`,children:[(0,K.jsxs)(`div`,{className:`cdv-meta cdv-rise`,style:{"--i":1,...H?{display:`none`}:null},children:[(0,K.jsx)(ae,{"aria-label":`Status`,className:`cdv-status`,value:t.link.column,options:F.map(e=>{let n=e===`all_sessions`&&(t.link.manuallyArchived||t.link.column!==e);return{value:e,label:(0,K.jsxs)(`span`,{className:`cdv-st`,"data-st":n?`archived`:e,children:[(0,K.jsx)(`i`,{"aria-hidden":!0}),n?`Archived`:ge[e]]})}}),onValueChange:e=>{e!==t.link.column&&s(t.id,e)}}),t.projectName&&(0,K.jsx)(w,{title:d??``,className:`cdv-badge`,children:t.projectName}),f&&(0,K.jsxs)(w,{title:`Branch: ${f}`,className:`cdv-badge cdv-badge--branch`,children:[(0,K.jsx)(Da,{d:`M6 3v12m0 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm12-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 0a9 9 0 0 1-9 9`,size:12}),(0,K.jsx)(`span`,{children:f})]}),h&&(0,K.jsx)(`button`,{type:`button`,className:`cdv-chip`,onClick:()=>A(`pr`),title:h.title??``,children:(0,K.jsxs)(w,{tone:gt,children:[`PR #`,h.number]})}),_&&(0,K.jsx)(`button`,{type:`button`,className:`cdv-chip`,onClick:()=>A(`issue`),title:_.title??``,children:(0,K.jsxs)(w,{tone:`outline`,children:[`#`,_.number]})}),(0,K.jsx)(I,{sessionId:u})]}),(0,K.jsxs)(`div`,{className:`cdv-actions cdv-rise`,style:{"--i":2,...H?{display:`none`}:null},children:[y&&(0,K.jsxs)(E,{variant:`solid`,className:`cdv-primary`,onClick:ht,title:Te?`Switch to terminal view`:u?`Resume this session`:`Start Claude session`,children:[(0,K.jsx)(Da,{d:`m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5`,size:15,sw:2.5}),Te?`Terminal`:u?`Resume`:`Start`]}),y&&Te&&(0,K.jsx)(M,{label:`Queue a prompt to send to Claude later`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,"aria-label":`Queue prompt`,onClick:Le.openAdd,children:(0,K.jsx)(ze,{size:16})})}),y&&Te&&(0,K.jsx)(M,{label:`Set up and launch again`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,"aria-label":`Set up and launch again`,onClick:X,children:(0,K.jsx)(Ue,{size:16})})}),y&&b&&(0,K.jsx)(M,{label:`Open in external terminal`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,"aria-label":`Open in external terminal`,onClick:Y,children:(0,K.jsx)(Ye,{size:16})})}),d&&(0,K.jsx)(M,{label:`Open in editor`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,"aria-label":`Open in editor`,onClick:()=>z(d),children:(0,K.jsx)(p,{size:16})})}),(0,K.jsx)(M,{label:`Delete card`,side:`bottom`,children:(0,K.jsx)(E,{icon:!0,variant:`danger`,className:`cdv-delete`,"aria-label":`Delete card`,onClick:mt,children:(0,K.jsx)(Ze,{size:16})})})]})]})]}),Z&&(0,K.jsx)(`div`,{className:`cdv-tabs`,style:H?{display:`none`}:void 0,children:(0,K.jsx)(me,{value:B,onValueChange:e=>A(e),children:(0,K.jsx)(de,{"aria-label":`Card sections`,children:ie.map(e=>(0,K.jsxs)(V,{value:e,children:[wo[e],e===`knowledge`&&te>0&&(0,K.jsx)(`span`,{className:`tr-n`,children:te}),e===`terminal`&&Te&&(0,K.jsx)(`span`,{className:`cdv-live`,role:`img`,"aria-label":`Session running`})]},e))})})}),H&&v&&(0,K.jsx)(Wr,{card:t,onDone:()=>oe(!1)},t.id),(0,K.jsxs)(`div`,{className:`cdv-body`,"data-dark":vt||void 0,style:H?{display:`none`}:void 0,children:[B===`terminal`&&y&&!b&&(0,K.jsx)(ja,{projectPath:d,psmuxExe:x.psmuxExe,tmuxAvailable:x.tmuxAvailable,paneStyle:Q,onPick:pt,onPsmuxInstalled:x.refreshPsmux}),y&&b&&Te&&(0,K.jsxs)(`div`,{className:B===`terminal`?`cdv-pane cdv-pane--fade cdv-term`:`hidden`,style:Q,children:[b===`windows`&&(0,K.jsx)(zi,{onInstalled:x.refreshPsmux}),(0,K.jsx)(di,{card:t}),(0,K.jsx)(si,{prompts:Le.prompts,onSendNow:Le.sendNow,onEdit:Le.openEdit,onRemove:Le.remove}),He&&q.tabs.length>0&&(0,K.jsx)(Ma,{tabs:q.tabs,active:q.activeTab,onSelect:q.setActiveTab,onClose:q.closeTab,onAdd:q.addTab}),Oe&&(0,K.jsx)(Na,{onRunAgain:()=>{ke(!1),je(e=>e+1)},onEditSetup:X}),(0,K.jsx)(G.Suspense,{fallback:null,children:q.ready?(0,K.jsx)(So,{ptyId:`term-${t.id}-${q.activeTab}`,command:lt,initialInput:ut,onExit:()=>ke(!0),writeRef:Ie,fontSize:x.terminalFontSize,initialScrollback:ft},`${q.activeTab}-${Ae}`):(0,K.jsx)(T,{})})]}),B===`terminal`&&y&&b&&_t&&d&&(0,K.jsx)(ji,{projectPath:d,initialPrompt:v??``,canCreateWorktree:!1,runtime:b,onRuntimeChange:pt,windowsLabel:x.psmuxExe?`Windows (psmux)`:`Windows (cmd.exe)`,initialSkipPermissions:!1,buildCommand:e=>{let t=ot(u??null,e.prompt,e.dangerouslySkipPermissions,e.envPrefix,e.model);return Re?ti(t):ri(t,{launcher:x.launcher,readable:!0})},onLaunch:e=>{Fe(e),Ne(!1),Ee(!0)},onCancel:()=>Ne(!1)}),B===`terminal`&&y&&b&&!Te&&!_t&&(0,K.jsx)(Pa,{loading:Ce.loading,hasSession:!!u,paneStyle:Q,onStart:ht}),B===`trace`&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(Ea,{turns:Ce.turns,loading:Ce.loading,fontSize:x.sessionDetailFontSize,search:we,onCheckpoint:u?J:void 0})}),B===`usage`&&u&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)($e,{sessionId:u})}),B===`diff`&&g&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsxs)(`div`,{className:`cdv-diff-loading`,"aria-busy":`true`,children:[(0,K.jsx)(T,{}),(0,K.jsx)(`span`,{children:`Loading changes…`})]}),children:(0,K.jsx)(Co,{path:g,isWorktree:!!t.link.worktreeLink?.path})})}),B===`issue`&&_&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(Xi,{title:_.title??`Issue #${_.number}`,body:_.body,url:_.url,onOpenInBrowser:d?()=>_e(d,_.number).catch(Do):void 0})}),B===`pr`&&h&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(Xi,{title:h.title??`PR #${h.number}`,body:h.body,url:h.url,onOpenInBrowser:d?()=>U(d,h.number).catch(Do):void 0,mergeAction:d&&$===`OPEN`?{onMerge:()=>pe(d,h.number),number:h.number}:void 0,prMeta:{reviewDecision:h.reviewDecision,approvalCount:h.approvalCount,mergeStateStatus:h.mergeStateStatus,checkRuns:h.checkRuns??[],unresolvedThreads:h.unresolvedThreads}})}),B===`knowledge`&&ee&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(pi,{card:t,data:ee})}),B===`prompt`&&v&&(0,K.jsx)(`div`,{className:`cdv-pane cdv-scroll`,style:Q,children:(0,K.jsx)(Vr,{card:t},t.id)})]}),(0,K.jsx)(ai,{open:Le.dialogOpen,onClose:Le.closeDialog,onSave:Le.save,editBody:Le.editing?.body,editSendAuto:Le.editing?.sendAutomatically,editImagePaths:Le.editing?.imagePaths})]});return n?(0,K.jsxs)(`div`,{className:`cdv-pop`,children:[(0,K.jsx)(`div`,{className:`cdv-scrim`,"data-closing":C||void 0,onClick:D,"aria-hidden":`true`}),yt]}):yt});export{Ao as default};