summaryrefslogtreecommitdiff
path: root/web/assets
diff options
context:
space:
mode:
Diffstat (limited to 'web/assets')
-rw-r--r--web/assets/app.js461
-rw-r--r--web/assets/bash.scm21
-rw-r--r--web/assets/bemtevi.svg31
-rw-r--r--web/assets/c.scm36
-rw-r--r--web/assets/cpp.scm25
-rw-r--r--web/assets/go.scm34
-rw-r--r--web/assets/htmx.min.js2
-rw-r--r--web/assets/javascript-params.scm12
-rw-r--r--web/assets/javascript.scm52
-rw-r--r--web/assets/json.scm13
-rw-r--r--web/assets/jsx.scm16
-rw-r--r--web/assets/one.json112
-rw-r--r--web/assets/python.scm50
-rw-r--r--web/assets/rust.scm48
-rw-r--r--web/assets/style.css.tmpl592
-rw-r--r--web/assets/typescript.scm15
-rw-r--r--web/assets/zig.scm65
17 files changed, 1585 insertions, 0 deletions
diff --git a/web/assets/app.js b/web/assets/app.js
new file mode 100644
index 0000000..5dd6ca0
--- /dev/null
+++ b/web/assets/app.js
@@ -0,0 +1,461 @@
+// app.js — the client half of notevi web. Everything here works in the static
+// export too; htmx only takes over the parts that need a server (filters,
+// comments, live activity, jj queries).
+"use strict";
+
+const root = document.documentElement;
+const live = root.dataset.live === "1";
+
+// ── focus: trace or notes, never both ─────────────────────────────────────
+// Coverage and notes want the same pixels (line background, gutter color,
+// tree markers), so the whole UI switches between them instead of layering.
+function setMode(m) {
+ root.dataset.mode = m;
+ localStorage.setItem("notevi-mode", m);
+ for (const b of document.querySelectorAll(".mode"))
+ b.setAttribute("aria-pressed", String(b.dataset.mode === m));
+}
+for (const b of document.querySelectorAll(".mode"))
+ b.addEventListener("click", () => setMode(b.dataset.mode));
+setMode(root.dataset.mode || "trace");
+
+const typing = e =>
+ /^(INPUT|TEXTAREA|SELECT)$/.test(e.target.tagName) || e.target.isContentEditable;
+
+// The project hub is fully server-derived; filtering is deliberately local so
+// choosing a project does not create another piece of server state.
+const projectFind = document.getElementById("projectfind");
+if (projectFind) {
+ const apply = () => {
+ const q = projectFind.value.trim().toLowerCase();
+ for (const card of document.querySelectorAll(".project-card"))
+ card.hidden = !!q && !(card.dataset.project || "").toLowerCase().includes(q);
+ };
+ projectFind.addEventListener("input", apply);
+ projectFind.addEventListener("search", apply);
+ projectFind.addEventListener("keydown", e => {
+ if (e.key === "Escape") { projectFind.value = ""; apply(); projectFind.blur(); }
+ if (e.key === "Enter") {
+ const first = document.querySelector(".project-card:not([hidden]) a.project-action");
+ if (first) first.click();
+ }
+ });
+}
+
+document.addEventListener("keydown", e => {
+ if (e.metaKey || e.ctrlKey || e.altKey || typing(e)) return;
+ if (e.key === "t") setMode(root.dataset.mode === "notes" ? "trace" : "notes");
+ if (e.key === "/") {
+ const f = document.getElementById("filefind");
+ if (f) { e.preventDefault(); f.focus(); f.select(); }
+ }
+});
+
+// ── theme ─────────────────────────────────────────────────────────────────
+// Every theme this machine has is a :root block in themes.css, so wearing one
+// is a single attribute — and the menu can therefore preview as it moves.
+// Arrow through it or hover and the page changes under you; enter keeps what
+// you are wearing, escape puts back the one you came with.
+//
+// themes.css and themes.js are fetched the first time the menu opens (the
+// stylesheet earlier than that, from the head, when a theme is already
+// chosen), so a reader who never switches pays nothing for them.
+const pick = document.getElementById("themepick");
+if (pick) {
+ const btn = document.getElementById("themebtn"),
+ menu = document.getElementById("thememenu"),
+ find = document.getElementById("themefind"),
+ list = document.getElementById("themelist");
+ const builtin = [
+ {id: "system", name: "system", src: "follows the browser"},
+ {id: "dark", name: pick.dataset.dark, src: "built with · dark"},
+ {id: "light", name: pick.dataset.light, src: "built with · light"},
+ ];
+ let cur = localStorage.getItem("notevi-theme") || "system";
+ let active = null, filled = false, pending = null;
+
+ const wear = id => {
+ if (id === "system") delete root.dataset.theme;
+ else root.dataset.theme = id;
+ };
+ // the name of a theme we may not have the menu for yet: kept beside the id
+ // so the button says something true before themes.js has loaded
+ const label = id => {
+ const b = builtin.find(t => t.id === id);
+ if (b) return b.name;
+ const t = (window.VRSITE_THEMES || []).find(t => t.id === id);
+ return t ? t.name : localStorage.getItem("notevi-theme-name") ||
+ id.replace(/^[^/]*\//, "").replace(/[-_]/g, " ");
+ };
+ btn.textContent = label(cur);
+
+ // themes.css is a link and themes.js a script, not a fetch: the static
+ // export is opened from the filesystem, where fetch() is not allowed
+ const ensure = () => {
+ if (!document.getElementById("themescss")) {
+ const l = document.createElement("link");
+ l.rel = "stylesheet"; l.id = "themescss"; l.href = pick.dataset.css;
+ document.head.append(l);
+ }
+ if (window.VRSITE_THEMES) return Promise.resolve();
+ if (!pending) pending = new Promise(done => {
+ const s = document.createElement("script");
+ s.src = pick.dataset.js;
+ s.onload = s.onerror = done;
+ document.head.append(s);
+ });
+ return pending;
+ };
+
+ const row = t => {
+ const li = document.createElement("li");
+ li.setAttribute("role", "option");
+ li.id = "themeopt-" + list.children.length;
+ li.dataset.id = t.id;
+ li.dataset.q = (t.name + " " + t.src + " " + t.id).toLowerCase();
+ const sw = document.createElement("span");
+ sw.className = t.sw ? "sw" : "sw none"; // empty, but the names still line up
+ for (const c of t.sw || []) {
+ const chip = document.createElement("i");
+ chip.style.background = c;
+ sw.append(chip);
+ }
+ li.append(sw);
+ const nm = document.createElement("span");
+ nm.className = "nm";
+ nm.textContent = t.name;
+ const src = document.createElement("span");
+ src.className = "src";
+ src.textContent = t.src;
+ li.append(nm, src);
+ return li;
+ };
+
+ const fill = () => {
+ if (filled) return;
+ filled = true;
+ // the two the site was built with are usually in the menu as well, so the
+ // rows for them can wear the same swatch — and "system", both at once
+ const all = window.VRSITE_THEMES || [];
+ const swOf = id => (all.find(t => t.id === id) || {}).sw;
+ const dsw = swOf(pick.dataset.darkid), lsw = swOf(pick.dataset.lightid);
+ builtin[0].sw = dsw && lsw && [...dsw.slice(0, 3), ...lsw.slice(0, 3)];
+ builtin[1].sw = dsw;
+ builtin[2].sw = lsw;
+ for (const t of builtin) list.append(row(t));
+ for (const t of window.VRSITE_THEMES || [])
+ list.append(row({...t, src: t.src + (t.dark ? " · dark" : " · light")}));
+ if (list.children.length === builtin.length) {
+ const p = document.createElement("li");
+ p.className = "meta";
+ p.textContent = "no zed or helix themes found on this machine";
+ list.append(p);
+ }
+ };
+
+ const setActive = (li, preview = true) => {
+ if (!li || li === active) return;
+ if (active) {
+ active.classList.remove("on");
+ active.removeAttribute("aria-selected");
+ }
+ active = li;
+ li.classList.add("on");
+ li.setAttribute("aria-selected", "true");
+ find.setAttribute("aria-activedescendant", li.id);
+ li.scrollIntoView({block: "nearest"});
+ if (preview) wear(li.dataset.id);
+ };
+
+ const rows = () => [...list.querySelectorAll("li[data-id]:not([hidden])")];
+ const rowFor = id => list.querySelector('li[data-id="' + CSS.escape(id) + '"]');
+
+ const filter = () => {
+ const q = find.value.trim().toLowerCase();
+ for (const li of list.children)
+ li.hidden = !!q && !(li.dataset.q || "").includes(q);
+ if (!active || active.hidden) setActive(rows()[0]);
+ };
+ find.addEventListener("input", filter);
+
+ const open = () => {
+ if (!menu.hidden) return;
+ menu.hidden = false;
+ btn.setAttribute("aria-expanded", "true");
+ find.value = "";
+ find.focus();
+ ensure().then(() => {
+ fill();
+ filter();
+ for (const li of list.querySelectorAll("li.cur")) li.classList.remove("cur");
+ const here = rowFor(cur);
+ if (here) here.classList.add("cur");
+ setActive(here || rows()[0], false);
+ });
+ };
+
+ // leaving the menu either keeps what is on screen or puts back what was
+ // there before it opened — nothing is stored until it is kept
+ const close = keep => {
+ if (menu.hidden) return;
+ if (keep && active) {
+ cur = active.dataset.id;
+ localStorage.setItem("notevi-theme", cur);
+ localStorage.setItem("notevi-theme-name", label(cur));
+ btn.textContent = label(cur);
+ for (const li of list.querySelectorAll("li.cur")) li.classList.remove("cur");
+ active.classList.add("cur");
+ }
+ wear(cur);
+ menu.hidden = true;
+ btn.setAttribute("aria-expanded", "false");
+ };
+
+ btn.addEventListener("click", () => (menu.hidden ? open() : close(false)));
+ // mousemove, not mouseover: arrowing scrolls rows under a still pointer,
+ // and the pointer must not then take the selection back
+ list.addEventListener("mousemove", e => {
+ const li = e.target.closest("li[data-id]");
+ if (li) setActive(li);
+ });
+ list.addEventListener("click", e => {
+ const li = e.target.closest("li[data-id]");
+ if (li) { setActive(li); close(true); }
+ });
+ find.addEventListener("keydown", e => {
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
+ e.preventDefault();
+ const all = rows();
+ if (!all.length) return;
+ const i = all.indexOf(active), step = e.key === "ArrowDown" ? 1 : -1;
+ setActive(all[(i + step + all.length) % all.length]);
+ } else if (e.key === "Enter") {
+ e.preventDefault();
+ close(true);
+ btn.focus();
+ } else if (e.key === "Escape") {
+ e.preventDefault();
+ close(false);
+ btn.focus();
+ }
+ });
+ document.addEventListener("click", e => {
+ if (!menu.hidden && !pick.contains(e.target)) close(false);
+ });
+ document.addEventListener("keydown", e => {
+ if (e.key === "Escape") close(false);
+ if (e.key === "T" && !e.metaKey && !e.ctrlKey && !e.altKey && !typing(e)) {
+ e.preventDefault(); // or the T lands in the filter we just focused
+ open();
+ }
+ });
+}
+
+// ── nav tree ──────────────────────────────────────────────────────────────
+const nav = document.getElementById("nav");
+const tree = document.getElementById("tree");
+const state = JSON.parse(localStorage.getItem("notevi-tree") || "{}");
+
+// The file tree can get out of the way without losing repository context or
+// the navigation footer. Keep the choice across page loads in this browser.
+const fileList = document.getElementById("filelist");
+const fileToggle = document.getElementById("filetoggle");
+if (fileList && fileToggle) {
+ const setFilesHidden = hidden => {
+ root.dataset.files = hidden ? "hidden" : "shown";
+ fileToggle.setAttribute("aria-expanded", String(!hidden));
+ fileToggle.textContent = hidden ? "show files" : "hide files";
+ localStorage.setItem("notevi-files-hidden", hidden ? "1" : "0");
+ };
+ setFilesHidden(localStorage.getItem("notevi-files-hidden") === "1");
+ fileToggle.addEventListener("click", () => setFilesHidden(root.dataset.files !== "hidden"));
+}
+
+if (nav && tree) {
+ const base = nav.dataset.root, cur = nav.dataset.current;
+ fetch(nav.dataset.tree).then(r => r.text()).then(t => {
+ tree.innerHTML = t.replaceAll('href="@@', 'href="' + base);
+ for (const d of tree.querySelectorAll("details"))
+ if (d.dataset.path in state) d.open = !!state[d.dataset.path];
+ if (cur)
+ for (const a of tree.querySelectorAll("a.file"))
+ if (a.dataset.path === cur) {
+ a.setAttribute("aria-current", "page");
+ for (let e = a.parentElement; e && e !== tree; e = e.parentElement)
+ if (e.tagName === "DETAILS") e.open = true;
+ a.scrollIntoView({block: "center"});
+ break;
+ }
+ tree.addEventListener("toggle", e => {
+ if (tree.classList.contains("filtering")) return; // filter drives open state
+ state[e.target.dataset.path] = e.target.open ? 1 : 0;
+ localStorage.setItem("notevi-tree", JSON.stringify(state));
+ }, true);
+ }).catch(() => {
+ tree.innerHTML = '<p class="meta">tree needs http — use the <a href="' +
+ base + 'files.html">file index</a></p>';
+ });
+}
+
+// ── find a file ───────────────────────────────────────────────────────────
+const find = document.getElementById("filefind");
+if (find && tree) {
+ const apply = () => {
+ const q = find.value.trim().toLowerCase();
+ tree.classList.toggle("filtering", q !== "");
+ for (const a of tree.querySelectorAll("a.file")) {
+ const hit = !q || a.dataset.path.toLowerCase().includes(q);
+ a.closest("li").hidden = !hit;
+ a.classList.toggle("hit", !!q && hit);
+ }
+ for (const d of tree.querySelectorAll("details")) {
+ const any = d.querySelector("li:not([hidden])");
+ d.hidden = !!q && !any;
+ d.open = q ? !!any : !!state[d.dataset.path];
+ }
+ };
+ find.addEventListener("input", apply);
+ find.addEventListener("search", apply);
+ find.addEventListener("keydown", e => {
+ if (e.key === "Escape") { find.value = ""; apply(); find.blur(); }
+ if (e.key === "Enter") {
+ const first = tree.querySelector("li:not([hidden]) a.file");
+ if (first) first.click();
+ }
+ });
+}
+
+// ── code lines: jump to a note, pick a range to comment on ────────────────
+const codeLines = document.querySelectorAll("ol.code li");
+const nstart = document.getElementById("nstart"), nend = document.getElementById("nend");
+let anchor = 0;
+
+function lineNo(li) { return parseInt(li.id.slice(1), 10) || 0; }
+
+function markSelection(a, b) {
+ const lo = Math.min(a, b), hi = Math.max(a, b);
+ for (const li of codeLines) {
+ const n = lineNo(li);
+ li.classList.toggle("sel", n >= lo && n <= hi);
+ }
+ if (nstart) nstart.value = lo;
+ if (nend) nend.value = hi > lo ? hi : "";
+}
+
+for (const li of codeLines) {
+ li.addEventListener("click", e => {
+ const note = li.dataset.note && document.getElementById(li.dataset.note);
+ if (note && root.dataset.mode === "notes") {
+ note.scrollIntoView({behavior: "smooth", block: "center"});
+ note.classList.remove("flash"); void note.offsetWidth; note.classList.add("flash");
+ }
+ if (!live || root.dataset.mode !== "notes") return;
+ const n = lineNo(li);
+ if (e.shiftKey && anchor) markSelection(anchor, n);
+ else { anchor = n; markSelection(n, n); }
+ });
+}
+
+// ⌘/ctrl+enter posts the note form from inside the textarea
+for (const ta of document.querySelectorAll(".notform textarea"))
+ ta.addEventListener("keydown", e => {
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) ta.form.requestSubmit();
+ });
+
+// ── conversation ──────────────────────────────────────────────────────────
+// A session page opened from a note lands on that note, flashed the same way
+// clicking a noted line flashes it.
+const conv = document.querySelector(".conv[data-anchor]");
+if (conv && conv.dataset.anchor) {
+ const here = document.getElementById(conv.dataset.anchor);
+ if (here) {
+ here.scrollIntoView({block: "start"});
+ here.classList.remove("flash"); void here.offsetWidth; here.classList.add("flash");
+ }
+}
+
+// The trip back: a note in a conversation opens the code it was written
+// about. The card is the target, so aim anywhere on it — except at the links
+// it already carries.
+const goTo = w => { location.href = w.dataset.href; };
+for (const w of document.querySelectorAll(".notewrap[data-href]")) {
+ w.addEventListener("click", e => { if (!e.target.closest("a")) goTo(w); });
+ w.addEventListener("keydown", e => {
+ if (e.key === "Enter" || e.key === " ") { e.preventDefault(); goTo(w); }
+ });
+}
+
+// ── arriving at a note ────────────────────────────────────────────────────
+// ?note=N means someone followed a note here rather than opening the file:
+// show what they came for — notes focus (coverage hides the note), the card
+// flashed in the pane, the lines it covers marked.
+// A permalink is the same arrival with nothing to scroll to: the page is the
+// note, so it only needs the focus that shows notes at all.
+if (document.body.dataset.kind === "note") setMode("notes");
+
+const want = new URLSearchParams(location.search).get("note");
+if (want && document.body.dataset.kind === "file" && /^\d+$/.test(want)) {
+ setMode("notes");
+ const card = document.getElementById("note-" + want);
+ if (card) {
+ // the card's own range, not the lines' data-note: a line belongs to the
+ // first note that claimed it, so overlapping notes would mark nothing
+ const from = +card.dataset.start, to = +card.dataset.end || +card.dataset.start;
+ let first = null;
+ for (let n = from; n > 0 && n <= to; n++) {
+ const li = document.getElementById("L" + n);
+ if (!li) continue;
+ li.classList.add("focus");
+ first = first || li;
+ }
+ // after the browser has had its own go at the #L anchor
+ if (first) requestAnimationFrame(() => first.scrollIntoView({block: "center"}));
+ card.scrollIntoView({block: "nearest"});
+ card.classList.remove("flash"); void card.offsetWidth; card.classList.add("flash");
+ }
+}
+
+// ── note filters ──────────────────────────────────────────────────────────
+// Live pages let the server filter (htmx); the static export filters the
+// rendered list in place, so the same form works either way.
+const filters = document.getElementById("notefilters");
+if (filters) {
+ const count = document.getElementById("notecount");
+ const val = n => (filters.elements[n] ? filters.elements[n].value.trim().toLowerCase() : "");
+ const applyLocal = () => {
+ const text = val("text"), file = val("file"), agent = val("agent"),
+ model = val("model"), session = val("session"), kind = val("kind"),
+ from = val("from"), to = val("to");
+ let shown = 0;
+ for (const art of document.querySelectorAll("#notelist .note")) {
+ // the whole rendered body, not its first <p>: a note is markdown, so it
+ // may open with a list or a code fence and run to several blocks
+ const d = art.dataset, el = art.querySelector(".body");
+ const body = (el ? el.textContent : "").toLowerCase();
+ const ok =
+ (!text || body.includes(text)) &&
+ (!file || (d.file || "").toLowerCase().includes(file)) &&
+ (!agent || d.agent === filters.elements.agent.value) &&
+ (!model || d.model === filters.elements.model.value) &&
+ (!session || d.session === filters.elements.session.value) &&
+ (!kind || d.kind === filters.elements.kind.value) &&
+ (!from || (d.date && d.date >= from)) &&
+ (!to || (d.date && d.date <= to));
+ art.hidden = !ok;
+ if (ok) shown++;
+ }
+ if (count) count.textContent = shown;
+ };
+ if (!live) {
+ filters.addEventListener("input", applyLocal);
+ filters.addEventListener("change", applyLocal);
+ filters.addEventListener("submit", e => { e.preventDefault(); applyLocal(); });
+ }
+ const clear = document.getElementById("clearfilters");
+ if (clear) clear.addEventListener("click", () => {
+ filters.reset();
+ for (const el of filters.elements) if (el.name) el.value = "";
+ if (live) window.htmx && htmx.trigger(filters, "change");
+ else applyLocal();
+ });
+}
diff --git a/web/assets/bash.scm b/web/assets/bash.scm
new file mode 100644
index 0000000..4c7926a
--- /dev/null
+++ b/web/assets/bash.scm
@@ -0,0 +1,21 @@
+; Bash highlights, from tree-sitter/tree-sitter-bash v0.25.1
+; queries/highlights.scm (MIT). Reordered so expansions stay visible inside the
+; strings that contain them, and capture names mapped onto zed syntax keys.
+; Upstream's @embedded captures are dropped: zed paints `embedded` as plain
+; foreground, so they only cost query time.
+
+["$" "&&" "||" ">" ">>" "<" "|" ";" "=" "!"] @operator
+
+["case" "do" "done" "elif" "else" "esac" "export" "fi" "for" "function" "if"
+ "in" "local" "readonly" "select" "then" "unset" "until" "while"] @keyword
+
+[(string) (raw_string) (heredoc_body) (heredoc_start)] @string
+(variable_name) @property
+(file_descriptor) @number
+
+(command_name) @function
+(function_definition name: (word) @function)
+((command (_) @constant)
+ (#match? @constant "^-"))
+
+(comment) @comment
diff --git a/web/assets/bemtevi.svg b/web/assets/bemtevi.svg
new file mode 100644
index 0000000..e8f7367
--- /dev/null
+++ b/web/assets/bemtevi.svg
@@ -0,0 +1,31 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="bem-te-vi">
+ <title>bem-te-vi</title>
+ <!--
+ Placeholder mark: a stylized bem-te-vi (great kiskadee). Transparent
+ background, no external references, legible down to 16px. The orange sliver
+ at the crown is the patch the bird keeps hidden under its black cap — the
+ same joke the tool's name makes about its notes.
+ -->
+ <defs>
+ <path id="nv-body" d="M18 32C18 24 27 20 35 21 43 22 49 30 50 39L62 51 60 57 46 49C39 54 23 53 18 42Z"/>
+ <clipPath id="nv-bodyclip"><use href="#nv-body"/></clipPath>
+ <clipPath id="nv-headclip"><circle cx="21" cy="24" r="12"/></clipPath>
+ </defs>
+
+ <use href="#nv-body" fill="#8A5A34"/>
+ <g clip-path="url(#nv-bodyclip)">
+ <ellipse cx="24" cy="46" rx="21" ry="16" fill="#F5C518"/>
+ <ellipse cx="41" cy="39" rx="10" ry="5.5" transform="rotate(24 41 39)" fill="#7A4E2C"/>
+ </g>
+
+ <circle cx="21" cy="24" r="12" fill="#F4F1E8"/>
+ <g clip-path="url(#nv-headclip)">
+ <rect x="7" y="10" width="30" height="8" fill="#23201C"/>
+ <ellipse cx="21" cy="13.2" rx="5" ry="1.9" fill="#F08B1D"/>
+ <rect x="7" y="18" width="30" height="4" fill="#F4F1E8"/>
+ <rect x="7" y="22" width="30" height="6" fill="#23201C"/>
+ </g>
+ <circle cx="16" cy="24.5" r="2.4" fill="#F4F1E8"/>
+ <circle cx="16" cy="24.5" r="1.3" fill="#23201C"/>
+ <path d="M12 23.5.5 28 12 32.5Z" fill="#23201C"/>
+</svg>
diff --git a/web/assets/c.scm b/web/assets/c.scm
new file mode 100644
index 0000000..789bf93
--- /dev/null
+++ b/web/assets/c.scm
@@ -0,0 +1,36 @@
+; C highlights, from tree-sitter/tree-sitter-c v0.24.2 queries/highlights.scm
+; (MIT). Reordered for later-patterns-win, capture names mapped onto zed syntax
+; keys (preprocessor directives get @preproc rather than upstream's @keyword,
+; which zed themes colour separately). Also loaded ahead of cpp.scm, the way
+; upstream composes the C++ highlights.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+[";" "," "."] @punctuation.delimiter
+["--" "-" "-=" "->" "=" "!=" "*" "&" "&&" "+" "++" "+=" "<" "==" ">"
+ "||"] @operator
+
+["break" "case" "const" "continue" "default" "do" "else" "enum" "extern"
+ "for" "if" "inline" "return" "sizeof" "static" "struct" "switch" "typedef"
+ "union" "volatile" "while"] @keyword
+
+["#define" "#elif" "#else" "#endif" "#if" "#ifdef" "#ifndef"
+ "#include"] @preproc
+(preproc_directive) @preproc
+
+[(type_identifier) (primitive_type) (sized_type_specifier)] @type
+(field_identifier) @property
+(statement_identifier) @label
+((identifier) @constant
+ (#match? @constant "^[A-Z][A-Z0-9_]*$"))
+
+(call_expression function: (identifier) @function)
+(call_expression function: (field_expression
+ field: (field_identifier) @function.method))
+(function_declarator declarator: (identifier) @function)
+(preproc_function_def name: (identifier) @function)
+
+(number_literal) @number
+(null) @constant
+[(string_literal) (char_literal) (system_lib_string)] @string
+(escape_sequence) @string.escape
+(comment) @comment
diff --git a/web/assets/cpp.scm b/web/assets/cpp.scm
new file mode 100644
index 0000000..e939a7a
--- /dev/null
+++ b/web/assets/cpp.scm
@@ -0,0 +1,25 @@
+; C++ highlights, from tree-sitter/tree-sitter-cpp v0.23.4
+; queries/highlights.scm (MIT). A supplement loaded after c.scm, as upstream
+; composes it, so these patterns win. Capture names mapped onto zed syntax
+; keys; `this` gets @variable.special to match what rust.scm does for `self`.
+
+["catch" "class" "co_await" "co_return" "co_yield" "constexpr" "constinit"
+ "consteval" "delete" "explicit" "final" "friend" "mutable" "namespace"
+ "noexcept" "new" "override" "private" "protected" "public" "template"
+ "throw" "try" "typename" "using" "concept" "requires" "virtual"] @keyword
+
+(auto) @type
+((namespace_identifier) @type
+ (#match? @type "^[A-Z]"))
+
+(call_expression function: (qualified_identifier
+ name: (identifier) @function))
+(template_function name: (identifier) @function)
+(template_method name: (field_identifier) @function.method)
+(function_declarator declarator: (qualified_identifier
+ name: (identifier) @function))
+(function_declarator declarator: (field_identifier) @function.method)
+
+(raw_string_literal) @string
+(this) @variable.special
+(null "nullptr" @constant)
diff --git a/web/assets/go.scm b/web/assets/go.scm
new file mode 100644
index 0000000..56f676c
--- /dev/null
+++ b/web/assets/go.scm
@@ -0,0 +1,34 @@
+; Go highlights, from tree-sitter/tree-sitter-go v0.25.0 queries/highlights.scm
+; (MIT). Reordered — upstream is written first-pattern-wins, this engine paints
+; later patterns over earlier ones — capture names mapped onto zed syntax keys,
+; and the builtin-function #match? turned into #any-of?, which needs no regex.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+[";" "," "." ":"] @punctuation.delimiter
+["--" "-" "-=" ":=" "!" "!=" "..." "*" "*=" "/" "/=" "&" "&&" "&=" "%" "%="
+ "^" "^=" "+" "++" "+=" "<-" "<" "<<" "<<=" "<=" "=" "==" ">" ">=" ">>" ">>="
+ "|" "|=" "||" "~"] @operator
+
+["break" "case" "chan" "const" "continue" "default" "defer" "else"
+ "fallthrough" "for" "func" "go" "goto" "if" "import" "interface" "map"
+ "package" "range" "return" "select" "struct" "switch" "type" "var"] @keyword
+
+(type_identifier) @type
+(field_identifier) @property
+(label_name) @label
+
+(function_declaration name: (identifier) @function)
+(method_declaration name: (field_identifier) @function.method)
+(call_expression function: (identifier) @function)
+(call_expression function: (selector_expression
+ field: (field_identifier) @function.method))
+((call_expression function: (identifier) @function.builtin)
+ (#any-of? @function.builtin "append" "cap" "clear" "close" "complex" "copy"
+ "delete" "imag" "len" "make" "max" "min" "new" "panic" "print" "println"
+ "real" "recover"))
+
+[(int_literal) (float_literal) (imaginary_literal)] @number
+[(true) (false) (nil) (iota)] @constant
+[(interpreted_string_literal) (raw_string_literal) (rune_literal)] @string
+(escape_sequence) @string.escape
+(comment) @comment
diff --git a/web/assets/htmx.min.js b/web/assets/htmx.min.js
new file mode 100644
index 0000000..c62505f
--- /dev/null
+++ b/web/assets/htmx.min.js
@@ -0,0 +1,2 @@
+/* htmx 2.0.4 — https://htmx.org — Zero-Clause BSD — vendored so the app has no network deps */
+var htmx=function(){"use strict";const Q={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=cn(e,t||"post");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,allowScriptTags:true,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:"204",swap:false},{code:"[23]..",swap:true},{code:"[45]..",swap:false,error:true}],allowNestedOobSwaps:true},parseInterval:null,_:null,version:"2.0.4"};Q.onLoad=j;Q.process=kt;Q.on=ye;Q.off=be;Q.trigger=he;Q.ajax=Rn;Q.find=u;Q.findAll=x;Q.closest=g;Q.remove=z;Q.addClass=K;Q.removeClass=G;Q.toggleClass=W;Q.takeClass=Z;Q.swap=$e;Q.defineExtension=Fn;Q.removeExtension=Bn;Q.logAll=V;Q.logNone=_;Q.parseInterval=d;Q._=e;const n={addTriggerHandler:St,bodyContains:le,canAccessLocalStorage:B,findThisElement:Se,filterValues:hn,swap:$e,hasAttribute:s,getAttributeValue:te,getClosestAttributeValue:re,getClosestMatch:o,getExpressionVars:En,getHeaders:fn,getInputValues:cn,getInternalData:ie,getSwapSpecification:gn,getTriggerSpecs:st,getTarget:Ee,makeFragment:P,mergeObjects:ce,makeSettleInfo:xn,oobSwap:He,querySelectorExt:ae,settleImmediately:Kt,shouldCancel:ht,triggerEvent:he,triggerErrorEvent:fe,withExtensions:Ft};const r=["get","post","put","delete","patch"];const H=r.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)=="ms"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)=="s"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)=="m"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function te(e,t){return ee(e,t)||ee(e,"data-"+t)}function c(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function ne(){return document}function m(e,t){return e.getRootNode?e.getRootNode({composed:t}):ne()}function o(e,t){while(e&&!t(e)){e=c(e)}return e||null}function i(e,t,n){const r=te(t,n);const o=te(t,"hx-disinherit");var i=te(t,"hx-inherit");if(e!==t){if(Q.config.disableInheritance){if(i&&(i==="*"||i.split(" ").indexOf(n)>=0)){return r}else{return null}}if(o&&(o==="*"||o.split(" ").indexOf(n)>=0)){return"unset"}}return r}function re(t,n){let r=null;o(t,function(e){return!!(r=i(t,ue(e),n))});if(r!=="unset"){return r}}function h(e,t){const n=e instanceof Element&&(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function T(e){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return""}}function q(e){const t=new DOMParser;return t.parseFromString(e,"text/html")}function L(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function A(e){const t=ne().createElement("script");se(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}return t}function N(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function I(e){Array.from(e.querySelectorAll("script")).forEach(e=>{if(N(e)){const t=A(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){O(e)}finally{e.remove()}}})}function P(e){const t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,"");const n=T(t);let r;if(n==="html"){r=new DocumentFragment;const i=q(e);L(r,i.body);r.title=i.title}else if(n==="body"){r=new DocumentFragment;const i=q(t);L(r,i.body);r.title=i.title}else{const i=q('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=i.querySelector("template").content;r.title=i.title;var o=r.querySelector("title");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){if(Q.config.allowScriptTags){I(r)}else{r.querySelectorAll("script").forEach(e=>e.remove())}}return r}function oe(e){if(e){e()}}function t(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function k(e){return typeof e==="function"}function D(e){return t(e,"Object")}function ie(e){const t="htmx-internal-data";let n=e[t];if(!n){n=e[t]={}}return n}function M(t){const n=[];if(t){for(let e=0;e<t.length;e++){n.push(t[e])}}return n}function se(t,n){if(t){for(let e=0;e<t.length;e++){n(t[e])}}}function X(e){const t=e.getBoundingClientRect();const n=t.top;const r=t.bottom;return n<window.innerHeight&&r>=0}function le(e){return e.getRootNode({composed:true})===document}function F(e){return e.trim().split(/\s+/)}function ce(e,t){for(const n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function S(e){try{return JSON.parse(e)}catch(e){O(e);return null}}function B(){const e="htmx:localStorageTest";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function U(t){try{const e=new URL(t);if(e){t=e.pathname+e.search}if(!/^\/$/.test(t)){t=t.replace(/\/+$/,"")}return t}catch(e){return t}}function e(e){return vn(ne().body,function(){return eval(e)})}function j(t){const e=Q.on("htmx:load",function(e){t(e.detail.elt)});return e}function V(){Q.logger=function(e,t,n){if(console){console.log(t,e,n)}}}function _(){Q.logger=null}function u(e,t){if(typeof e!=="string"){return e.querySelector(t)}else{return u(ne(),e)}}function x(e,t){if(typeof e!=="string"){return e.querySelectorAll(t)}else{return x(ne(),e)}}function E(){return window}function z(e,t){e=y(e);if(t){E().setTimeout(function(){z(e);e=null},t)}else{c(e).removeChild(e)}}function ue(e){return e instanceof Element?e:null}function $(e){return e instanceof HTMLElement?e:null}function J(e){return typeof e==="string"?e:null}function f(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function K(e,t,n){e=ue(y(e));if(!e){return}if(n){E().setTimeout(function(){K(e,t);e=null},n)}else{e.classList&&e.classList.add(t)}}function G(e,t,n){let r=ue(y(e));if(!r){return}if(n){E().setTimeout(function(){G(r,t);r=null},n)}else{if(r.classList){r.classList.remove(t);if(r.classList.length===0){r.removeAttribute("class")}}}}function W(e,t){e=y(e);e.classList.toggle(t)}function Z(e,t){e=y(e);se(e.parentElement.children,function(e){G(e,t)});K(ue(e),t)}function g(e,t){e=ue(y(e));if(e&&e.closest){return e.closest(t)}else{do{if(e==null||h(e,t)){return e}}while(e=e&&ue(c(e)));return null}}function l(e,t){return e.substring(0,t.length)===t}function Y(e,t){return e.substring(e.length-t.length)===t}function ge(e){const t=e.trim();if(l(t,"<")&&Y(t,"/>")){return t.substring(1,t.length-2)}else{return t}}function p(t,r,n){if(r.indexOf("global ")===0){return p(t,r.slice(7),true)}t=y(t);const o=[];{let t=0;let n=0;for(let e=0;e<r.length;e++){const l=r[e];if(l===","&&t===0){o.push(r.substring(n,e));n=e+1;continue}if(l==="<"){t++}else if(l==="/"&&e<r.length-1&&r[e+1]===">"){t--}}if(n<r.length){o.push(r.substring(n))}}const i=[];const s=[];while(o.length>0){const r=ge(o.shift());let e;if(r.indexOf("closest ")===0){e=g(ue(t),ge(r.substr(8)))}else if(r.indexOf("find ")===0){e=u(f(t),ge(r.substr(5)))}else if(r==="next"||r==="nextElementSibling"){e=ue(t).nextElementSibling}else if(r.indexOf("next ")===0){e=pe(t,ge(r.substr(5)),!!n)}else if(r==="previous"||r==="previousElementSibling"){e=ue(t).previousElementSibling}else if(r.indexOf("previous ")===0){e=me(t,ge(r.substr(9)),!!n)}else if(r==="document"){e=document}else if(r==="window"){e=window}else if(r==="body"){e=document.body}else if(r==="root"){e=m(t,!!n)}else if(r==="host"){e=t.getRootNode().host}else{s.push(r)}if(e){i.push(e)}}if(s.length>0){const e=s.join(",");const c=f(m(t,!!n));i.push(...M(c.querySelectorAll(e)))}return i}var pe=function(t,e,n){const r=f(m(t,n)).querySelectorAll(e);for(let e=0;e<r.length;e++){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING){return o}}};var me=function(t,e,n){const r=f(m(t,n)).querySelectorAll(e);for(let e=r.length-1;e>=0;e--){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}};function ae(e,t){if(typeof e!=="string"){return p(e,t)[0]}else{return p(ne().body,e)[0]}}function y(e,t){if(typeof e==="string"){return u(f(t)||document,e)}else{return e}}function xe(e,t,n,r){if(k(t)){return{target:ne().body,event:J(e),listener:t,options:n}}else{return{target:y(e),event:J(t),listener:n,options:r}}}function ye(t,n,r,o){Vn(function(){const e=xe(t,n,r,o);e.target.addEventListener(e.event,e.listener,e.options)});const e=k(n);return e?n:r}function be(t,n,r){Vn(function(){const e=xe(t,n,r);e.target.removeEventListener(e.event,e.listener)});return k(n)?n:r}const ve=ne().createElement("output");function we(e,t){const n=re(e,t);if(n){if(n==="this"){return[Se(e,t)]}else{const r=p(e,n);if(r.length===0){O('The selector "'+n+'" on '+t+" returned no matches!");return[ve]}else{return r}}}}function Se(e,t){return ue(o(e,function(e){return te(ue(e),t)!=null}))}function Ee(e){const t=re(e,"hx-target");if(t){if(t==="this"){return Se(e,"hx-target")}else{return ae(e,t)}}else{const n=ie(e);if(n.boosted){return ne().body}else{return e}}}function Ce(t){const n=Q.config.attributesToSettle;for(let e=0;e<n.length;e++){if(t===n[e]){return true}}return false}function Oe(t,n){se(t.attributes,function(e){if(!n.hasAttribute(e.name)&&Ce(e.name)){t.removeAttribute(e.name)}});se(n.attributes,function(e){if(Ce(e.name)){t.setAttribute(e.name,e.value)}})}function Re(t,e){const n=Un(e);for(let e=0;e<n.length;e++){const r=n[e];try{if(r.isInlineSwap(t)){return true}}catch(e){O(e)}}return t==="outerHTML"}function He(e,o,i,t){t=t||ne();let n="#"+ee(o,"id");let s="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){s=e.substring(0,e.indexOf(":"));n=e.substring(e.indexOf(":")+1)}else{s=e}o.removeAttribute("hx-swap-oob");o.removeAttribute("data-hx-swap-oob");const r=p(t,n,false);if(r){se(r,function(e){let t;const n=o.cloneNode(true);t=ne().createDocumentFragment();t.appendChild(n);if(!Re(s,e)){t=f(n)}const r={shouldSwap:true,target:e,fragment:t};if(!he(e,"htmx:oobBeforeSwap",r))return;e=r.target;if(r.shouldSwap){qe(t);_e(s,e,e,t,i);Te()}se(i.elts,function(e){he(e,"htmx:oobAfterSwap",r)})});o.parentNode.removeChild(o)}else{o.parentNode.removeChild(o);fe(ne().body,"htmx:oobErrorNoTarget",{content:o})}return e}function Te(){const e=u("#--htmx-preserve-pantry--");if(e){for(const t of[...e.children]){const n=u("#"+t.id);n.parentNode.moveBefore(t,n);n.remove()}e.remove()}}function qe(e){se(x(e,"[hx-preserve], [data-hx-preserve]"),function(e){const t=te(e,"id");const n=ne().getElementById(t);if(n!=null){if(e.moveBefore){let e=u("#--htmx-preserve-pantry--");if(e==null){ne().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>");e=u("#--htmx-preserve-pantry--")}e.moveBefore(n,null)}else{e.parentNode.replaceChild(n,e)}}})}function Le(l,e,c){se(e.querySelectorAll("[id]"),function(t){const n=ee(t,"id");if(n&&n.length>0){const r=n.replace("'","\\'");const o=t.tagName.replace(":","\\:");const e=f(l);const i=e&&e.querySelector(o+"[id='"+r+"']");if(i&&i!==e){const s=t.cloneNode();Oe(t,i);c.tasks.push(function(){Oe(t,s)})}}})}function Ae(e){return function(){G(e,Q.config.addedClass);kt(ue(e));Ne(f(e));he(e,"htmx:load")}}function Ne(e){const t="[autofocus]";const n=$(h(e,t)?e:e.querySelector(t));if(n!=null){n.focus()}}function a(e,t,n,r){Le(e,n,r);while(n.childNodes.length>0){const o=n.firstChild;K(ue(o),Q.config.addedClass);e.insertBefore(o,t);if(o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE){r.tasks.push(Ae(o))}}}function Ie(e,t){let n=0;while(n<e.length){t=(t<<5)-t+e.charCodeAt(n++)|0}return t}function Pe(t){let n=0;if(t.attributes){for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e];if(r.value){n=Ie(r.name,n);n=Ie(r.value,n)}}}return n}function ke(t){const n=ie(t);if(n.onHandlers){for(let e=0;e<n.onHandlers.length;e++){const r=n.onHandlers[e];be(t,r.event,r.listener)}delete n.onHandlers}}function De(e){const t=ie(e);if(t.timeout){clearTimeout(t.timeout)}if(t.listenerInfos){se(t.listenerInfos,function(e){if(e.on){be(e.on,e.trigger,e.listener)}})}ke(e);se(Object.keys(t),function(e){if(e!=="firstInitCompleted")delete t[e]})}function b(e){he(e,"htmx:beforeCleanupElement");De(e);if(e.children){se(e.children,function(e){b(e)})}}function Me(t,e,n){if(t instanceof Element&&t.tagName==="BODY"){return Ve(t,e,n)}let r;const o=t.previousSibling;const i=c(t);if(!i){return}a(i,t,e,n);if(o==null){r=i.firstChild}else{r=o.nextSibling}n.elts=n.elts.filter(function(e){return e!==t});while(r&&r!==t){if(r instanceof Element){n.elts.push(r)}r=r.nextSibling}b(t);if(t instanceof Element){t.remove()}else{t.parentNode.removeChild(t)}}function Xe(e,t,n){return a(e,e.firstChild,t,n)}function Fe(e,t,n){return a(c(e),e,t,n)}function Be(e,t,n){return a(e,null,t,n)}function Ue(e,t,n){return a(c(e),e.nextSibling,t,n)}function je(e){b(e);const t=c(e);if(t){return t.removeChild(e)}}function Ve(e,t,n){const r=e.firstChild;a(e,r,t,n);if(r){while(r.nextSibling){b(r.nextSibling);e.removeChild(r.nextSibling)}b(r);e.removeChild(r)}}function _e(t,e,n,r,o){switch(t){case"none":return;case"outerHTML":Me(n,r,o);return;case"afterbegin":Xe(n,r,o);return;case"beforebegin":Fe(n,r,o);return;case"beforeend":Be(n,r,o);return;case"afterend":Ue(n,r,o);return;case"delete":je(n);return;default:var i=Un(e);for(let e=0;e<i.length;e++){const s=i[e];try{const l=s.handleSwap(t,n,r,o);if(l){if(Array.isArray(l)){for(let e=0;e<l.length;e++){const c=l[e];if(c.nodeType!==Node.TEXT_NODE&&c.nodeType!==Node.COMMENT_NODE){o.tasks.push(Ae(c))}}}return}}catch(e){O(e)}}if(t==="innerHTML"){Ve(n,r,o)}else{_e(Q.config.defaultSwapStyle,e,n,r,o)}}}function ze(e,n,r){var t=x(e,"[hx-swap-oob], [data-hx-swap-oob]");se(t,function(e){if(Q.config.allowNestedOobSwaps||e.parentElement===null){const t=te(e,"hx-swap-oob");if(t!=null){He(t,e,n,r)}}else{e.removeAttribute("hx-swap-oob");e.removeAttribute("data-hx-swap-oob")}});return t.length>0}function $e(e,t,r,o){if(!o){o={}}e=y(e);const i=o.contextElement?m(o.contextElement,false):ne();const n=document.activeElement;let s={};try{s={elt:n,start:n?n.selectionStart:null,end:n?n.selectionEnd:null}}catch(e){}const l=xn(e);if(r.swapStyle==="textContent"){e.textContent=t}else{let n=P(t);l.title=n.title;if(o.selectOOB){const u=o.selectOOB.split(",");for(let t=0;t<u.length;t++){const a=u[t].split(":",2);let e=a[0].trim();if(e.indexOf("#")===0){e=e.substring(1)}const f=a[1]||"true";const h=n.querySelector("#"+e);if(h){He(f,h,l,i)}}}ze(n,l,i);se(x(n,"template"),function(e){if(e.content&&ze(e.content,l,i)){e.remove()}});if(o.select){const d=ne().createDocumentFragment();se(n.querySelectorAll(o.select),function(e){d.appendChild(e)});n=d}qe(n);_e(r.swapStyle,o.contextElement,e,n,l);Te()}if(s.elt&&!le(s.elt)&&ee(s.elt,"id")){const g=document.getElementById(ee(s.elt,"id"));const p={preventScroll:r.focusScroll!==undefined?!r.focusScroll:!Q.config.defaultFocusScroll};if(g){if(s.start&&g.setSelectionRange){try{g.setSelectionRange(s.start,s.end)}catch(e){}}g.focus(p)}}e.classList.remove(Q.config.swappingClass);se(l.elts,function(e){if(e.classList){e.classList.add(Q.config.settlingClass)}he(e,"htmx:afterSwap",o.eventInfo)});if(o.afterSwapCallback){o.afterSwapCallback()}if(!r.ignoreTitle){kn(l.title)}const c=function(){se(l.tasks,function(e){e.call()});se(l.elts,function(e){if(e.classList){e.classList.remove(Q.config.settlingClass)}he(e,"htmx:afterSettle",o.eventInfo)});if(o.anchor){const e=ue(y("#"+o.anchor));if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}yn(l.elts,r);if(o.afterSettleCallback){o.afterSettleCallback()}};if(r.settleDelay>0){E().setTimeout(c,r.settleDelay)}else{c()}}function Je(e,t,n){const r=e.getResponseHeader(t);if(r.indexOf("{")===0){const o=S(r);for(const i in o){if(o.hasOwnProperty(i)){let e=o[i];if(D(e)){n=e.target!==undefined?e.target:n}else{e={value:e}}he(n,i,e)}}}else{const s=r.split(",");for(let e=0;e<s.length;e++){he(n,s[e].trim(),[])}}}const Ke=/\s/;const v=/[\s,]/;const Ge=/[_$a-zA-Z]/;const We=/[_$a-zA-Z0-9]/;const Ze=['"',"'","/"];const w=/[^\s]/;const Ye=/[{(]/;const Qe=/[})]/;function et(e){const t=[];let n=0;while(n<e.length){if(Ge.exec(e.charAt(n))){var r=n;while(We.exec(e.charAt(n+1))){n++}t.push(e.substring(r,n+1))}else if(Ze.indexOf(e.charAt(n))!==-1){const o=e.charAt(n);var r=n;n++;while(n<e.length&&e.charAt(n)!==o){if(e.charAt(n)==="\\"){n++}n++}t.push(e.substring(r,n+1))}else{const i=e.charAt(n);t.push(i)}n++}return t}function tt(e,t,n){return Ge.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==n&&t!=="."}function nt(r,o,i){if(o[0]==="["){o.shift();let e=1;let t=" return (function("+i+"){ return (";let n=null;while(o.length>0){const s=o[0];if(s==="]"){e--;if(e===0){if(n===null){t=t+"true"}o.shift();t+=")})";try{const l=vn(r,function(){return Function(t)()},function(){return true});l.source=t;return l}catch(e){fe(ne().body,"htmx:syntax:error",{error:e,source:t});return null}}}else if(s==="["){e++}if(tt(s,n,i)){t+="(("+i+"."+s+") ? ("+i+"."+s+") : (window."+s+"))"}else{t=t+s}n=o.shift()}}}function C(e,t){let n="";while(e.length>0&&!t.test(e[0])){n+=e.shift()}return n}function rt(e){let t;if(e.length>0&&Ye.test(e[0])){e.shift();t=C(e,Qe).trim();e.shift()}else{t=C(e,v)}return t}const ot="input, textarea, select";function it(e,t,n){const r=[];const o=et(t);do{C(o,w);const l=o.length;const c=C(o,/[,\[\s]/);if(c!==""){if(c==="every"){const u={trigger:"every"};C(o,w);u.pollInterval=d(C(o,/[,\[\s]/));C(o,w);var i=nt(e,o,"event");if(i){u.eventFilter=i}r.push(u)}else{const a={trigger:c};var i=nt(e,o,"event");if(i){a.eventFilter=i}C(o,w);while(o.length>0&&o[0]!==","){const f=o.shift();if(f==="changed"){a.changed=true}else if(f==="once"){a.once=true}else if(f==="consume"){a.consume=true}else if(f==="delay"&&o[0]===":"){o.shift();a.delay=d(C(o,v))}else if(f==="from"&&o[0]===":"){o.shift();if(Ye.test(o[0])){var s=rt(o)}else{var s=C(o,v);if(s==="closest"||s==="find"||s==="next"||s==="previous"){o.shift();const h=rt(o);if(h.length>0){s+=" "+h}}}a.from=s}else if(f==="target"&&o[0]===":"){o.shift();a.target=rt(o)}else if(f==="throttle"&&o[0]===":"){o.shift();a.throttle=d(C(o,v))}else if(f==="queue"&&o[0]===":"){o.shift();a.queue=C(o,v)}else if(f==="root"&&o[0]===":"){o.shift();a[f]=rt(o)}else if(f==="threshold"&&o[0]===":"){o.shift();a[f]=C(o,v)}else{fe(e,"htmx:syntax:error",{token:o.shift()})}C(o,w)}r.push(a)}}if(o.length===l){fe(e,"htmx:syntax:error",{token:o.shift()})}C(o,w)}while(o[0]===","&&o.shift());if(n){n[t]=r}return r}function st(e){const t=te(e,"hx-trigger");let n=[];if(t){const r=Q.config.triggerSpecsCache;n=r&&r[t]||it(e,t,r)}if(n.length>0){return n}else if(h(e,"form")){return[{trigger:"submit"}]}else if(h(e,'input[type="button"], input[type="submit"]')){return[{trigger:"click"}]}else if(h(e,ot)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function lt(e){ie(e).cancelled=true}function ct(e,t,n){const r=ie(e);r.timeout=E().setTimeout(function(){if(le(e)&&r.cancelled!==true){if(!gt(n,e,Mt("hx:poll:trigger",{triggerSpec:n,target:e}))){t(e)}ct(e,t,n)}},n.pollInterval)}function ut(e){return location.hostname===e.hostname&&ee(e,"href")&&ee(e,"href").indexOf("#")!==0}function at(e){return g(e,Q.config.disableSelector)}function ft(t,n,e){if(t instanceof HTMLAnchorElement&&ut(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"&&String(ee(t,"method")).toLowerCase()!=="dialog"){n.boosted=true;let r,o;if(t.tagName==="A"){r="get";o=ee(t,"href")}else{const i=ee(t,"method");r=i?i.toLowerCase():"get";o=ee(t,"action");if(o==null||o===""){o=ne().location.href}if(r==="get"&&o.includes("?")){o=o.replace(/\?[^#]+/,"")}}e.forEach(function(e){pt(t,function(e,t){const n=ue(e);if(at(n)){b(n);return}de(r,o,n,t)},n,e,true)})}}function ht(e,t){const n=ue(t);if(!n){return false}if(e.type==="submit"||e.type==="click"){if(n.tagName==="FORM"){return true}if(h(n,'input[type="submit"], button')&&(h(n,"[form]")||g(n,"form")!==null)){return true}if(n instanceof HTMLAnchorElement&&n.href&&(n.getAttribute("href")==="#"||n.getAttribute("href").indexOf("#")!==0)){return true}}return false}function dt(e,t){return ie(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function gt(e,t,n){const r=e.eventFilter;if(r){try{return r.call(t,n)!==true}catch(e){const o=r.source;fe(ne().body,"htmx:eventFilter:error",{error:e,source:o});return true}}return false}function pt(l,c,e,u,a){const f=ie(l);let t;if(u.from){t=p(l,u.from)}else{t=[l]}if(u.changed){if(!("lastValue"in f)){f.lastValue=new WeakMap}t.forEach(function(e){if(!f.lastValue.has(u)){f.lastValue.set(u,new WeakMap)}f.lastValue.get(u).set(e,e.value)})}se(t,function(i){const s=function(e){if(!le(l)){i.removeEventListener(u.trigger,s);return}if(dt(l,e)){return}if(a||ht(e,l)){e.preventDefault()}if(gt(u,l,e)){return}const t=ie(e);t.triggerSpec=u;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(l)<0){t.handledFor.push(l);if(u.consume){e.stopPropagation()}if(u.target&&e.target){if(!h(ue(e.target),u.target)){return}}if(u.once){if(f.triggeredOnce){return}else{f.triggeredOnce=true}}if(u.changed){const n=event.target;const r=n.value;const o=f.lastValue.get(u);if(o.has(n)&&o.get(n)===r){return}o.set(n,r)}if(f.delayed){clearTimeout(f.delayed)}if(f.throttle){return}if(u.throttle>0){if(!f.throttle){he(l,"htmx:trigger");c(l,e);f.throttle=E().setTimeout(function(){f.throttle=null},u.throttle)}}else if(u.delay>0){f.delayed=E().setTimeout(function(){he(l,"htmx:trigger");c(l,e)},u.delay)}else{he(l,"htmx:trigger");c(l,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:u.trigger,listener:s,on:i});i.addEventListener(u.trigger,s)})}let mt=false;let xt=null;function yt(){if(!xt){xt=function(){mt=true};window.addEventListener("scroll",xt);window.addEventListener("resize",xt);setInterval(function(){if(mt){mt=false;se(ne().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){bt(e)})}},200)}}function bt(e){if(!s(e,"data-hx-revealed")&&X(e)){e.setAttribute("data-hx-revealed","true");const t=ie(e);if(t.initHash){he(e,"revealed")}else{e.addEventListener("htmx:afterProcessNode",function(){he(e,"revealed")},{once:true})}}}function vt(e,t,n,r){const o=function(){if(!n.loaded){n.loaded=true;he(e,"htmx:trigger");t(e)}};if(r>0){E().setTimeout(o,r)}else{o()}}function wt(t,n,e){let i=false;se(r,function(r){if(s(t,"hx-"+r)){const o=te(t,"hx-"+r);i=true;n.path=o;n.verb=r;e.forEach(function(e){St(t,e,n,function(e,t){const n=ue(e);if(g(n,Q.config.disableSelector)){b(n);return}de(r,o,n,t)})})}});return i}function St(r,e,t,n){if(e.trigger==="revealed"){yt();pt(r,n,t,e);bt(ue(r))}else if(e.trigger==="intersect"){const o={};if(e.root){o.root=ae(r,e.root)}if(e.threshold){o.threshold=parseFloat(e.threshold)}const i=new IntersectionObserver(function(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.isIntersecting){he(r,"intersect");break}}},o);i.observe(ue(r));pt(ue(r),n,t,e)}else if(!t.firstInitCompleted&&e.trigger==="load"){if(!gt(e,r,Mt("load",{elt:r}))){vt(ue(r),n,t,e.delay)}}else if(e.pollInterval>0){t.polling=true;ct(ue(r),n,e)}else{pt(r,n,t,e)}}function Et(e){const t=ue(e);if(!t){return false}const n=t.attributes;for(let e=0;e<n.length;e++){const r=n[e].name;if(l(r,"hx-on:")||l(r,"data-hx-on:")||l(r,"hx-on-")||l(r,"data-hx-on-")){return true}}return false}const Ct=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or'+' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function Ot(e,t){if(Et(e)){t.push(ue(e))}const n=Ct.evaluate(e);let r=null;while(r=n.iterateNext())t.push(ue(r))}function Rt(e){const t=[];if(e instanceof DocumentFragment){for(const n of e.childNodes){Ot(n,t)}}else{Ot(e,t)}return t}function Ht(e){if(e.querySelectorAll){const n=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]";const r=[];for(const i in Mn){const s=Mn[i];if(s.getSelectors){var t=s.getSelectors();if(t){r.push(t)}}}const o=e.querySelectorAll(H+n+", form, [type='submit'],"+" [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+r.flat().map(e=>", "+e).join(""));return o}else{return[]}}function Tt(e){const t=g(ue(e.target),"button, input[type='submit']");const n=Lt(e);if(n){n.lastButtonClicked=t}}function qt(e){const t=Lt(e);if(t){t.lastButtonClicked=null}}function Lt(e){const t=g(ue(e.target),"button, input[type='submit']");if(!t){return}const n=y("#"+ee(t,"form"),t.getRootNode())||g(t,"form");if(!n){return}return ie(n)}function At(e){e.addEventListener("click",Tt);e.addEventListener("focusin",Tt);e.addEventListener("focusout",qt)}function Nt(t,e,n){const r=ie(t);if(!Array.isArray(r.onHandlers)){r.onHandlers=[]}let o;const i=function(e){vn(t,function(){if(at(t)){return}if(!o){o=new Function("event",n)}o.call(t,e)})};t.addEventListener(e,i);r.onHandlers.push({event:e,listener:i})}function It(t){ke(t);for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;const r=t.attributes[e].value;if(l(n,"hx-on")||l(n,"data-hx-on")){const o=n.indexOf("-on")+3;const i=n.slice(o,o+1);if(i==="-"||i===":"){let e=n.slice(o+1);if(l(e,":")){e="htmx"+e}else if(l(e,"-")){e="htmx:"+e.slice(1)}else if(l(e,"htmx-")){e="htmx:"+e.slice(5)}Nt(t,e,r)}}}}function Pt(t){if(g(t,Q.config.disableSelector)){b(t);return}const n=ie(t);const e=Pe(t);if(n.initHash!==e){De(t);n.initHash=e;he(t,"htmx:beforeProcessNode");const r=st(t);const o=wt(t,n,r);if(!o){if(re(t,"hx-boost")==="true"){ft(t,n,r)}else if(s(t,"hx-trigger")){r.forEach(function(e){St(t,e,n,function(){})})}}if(t.tagName==="FORM"||ee(t,"type")==="submit"&&s(t,"form")){At(t)}n.firstInitCompleted=true;he(t,"htmx:afterProcessNode")}}function kt(e){e=y(e);if(g(e,Q.config.disableSelector)){b(e);return}Pt(e);se(Ht(e),function(e){Pt(e)});se(Rt(e),It)}function Dt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Mt(e,t){let n;if(window.CustomEvent&&typeof window.CustomEvent==="function"){n=new CustomEvent(e,{bubbles:true,cancelable:true,composed:true,detail:t})}else{n=ne().createEvent("CustomEvent");n.initCustomEvent(e,true,true,t)}return n}function fe(e,t,n){he(e,t,ce({error:t},n))}function Xt(e){return e==="htmx:afterProcessNode"}function Ft(e,t){se(Un(e),function(e){try{t(e)}catch(e){O(e)}})}function O(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function he(e,t,n){e=y(e);if(n==null){n={}}n.elt=e;const r=Mt(t,n);if(Q.logger&&!Xt(t)){Q.logger(e,t,n)}if(n.error){O(n.error);he(e,"htmx:error",{errorInfo:n})}let o=e.dispatchEvent(r);const i=Dt(t);if(o&&i!==t){const s=Mt(i,r.detail);o=o&&e.dispatchEvent(s)}Ft(ue(e),function(e){o=o&&(e.onEvent(t,r)!==false&&!r.defaultPrevented)});return o}let Bt=location.pathname+location.search;function Ut(){const e=ne().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||ne().body}function jt(t,e){if(!B()){return}const n=_t(e);const r=ne().title;const o=window.scrollY;if(Q.config.historyCacheSize<=0){localStorage.removeItem("htmx-history-cache");return}t=U(t);const i=S(localStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<i.length;e++){if(i[e].url===t){i.splice(e,1);break}}const s={url:t,content:n,title:r,scroll:o};he(ne().body,"htmx:historyItemCreated",{item:s,cache:i});i.push(s);while(i.length>Q.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){fe(ne().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Vt(t){if(!B()){return null}t=U(t);const n=S(localStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<n.length;e++){if(n[e].url===t){return n[e]}}return null}function _t(e){const t=Q.config.requestClass;const n=e.cloneNode(true);se(x(n,"."+t),function(e){G(e,t)});se(x(n,"[data-disabled-by-htmx]"),function(e){e.removeAttribute("disabled")});return n.innerHTML}function zt(){const e=Ut();const t=Bt||location.pathname+location.search;let n;try{n=ne().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(e){n=ne().querySelector('[hx-history="false"],[data-hx-history="false"]')}if(!n){he(ne().body,"htmx:beforeHistorySave",{path:t,historyElt:e});jt(t,e)}if(Q.config.historyEnabled)history.replaceState({htmx:true},ne().title,window.location.href)}function $t(e){if(Q.config.getCacheBusterParam){e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,"");if(Y(e,"&")||Y(e,"?")){e=e.slice(0,-1)}}if(Q.config.historyEnabled){history.pushState({htmx:true},"",e)}Bt=e}function Jt(e){if(Q.config.historyEnabled)history.replaceState({htmx:true},"",e);Bt=e}function Kt(e){se(e,function(e){e.call(undefined)})}function Gt(o){const e=new XMLHttpRequest;const i={path:o,xhr:e};he(ne().body,"htmx:historyCacheMiss",i);e.open("GET",o,true);e.setRequestHeader("HX-Request","true");e.setRequestHeader("HX-History-Restore-Request","true");e.setRequestHeader("HX-Current-URL",ne().location.href);e.onload=function(){if(this.status>=200&&this.status<400){he(ne().body,"htmx:historyCacheMissLoad",i);const e=P(this.response);const t=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;const n=Ut();const r=xn(n);kn(e.title);qe(e);Ve(n,t,r);Te();Kt(r.tasks);Bt=o;he(ne().body,"htmx:historyRestore",{path:o,cacheMiss:true,serverResponse:this.response})}else{fe(ne().body,"htmx:historyCacheMissLoadError",i)}};e.send()}function Wt(e){zt();e=e||location.pathname+location.search;const t=Vt(e);if(t){const n=P(t.content);const r=Ut();const o=xn(r);kn(t.title);qe(n);Ve(r,n,o);Te();Kt(o.tasks);E().setTimeout(function(){window.scrollTo(0,t.scroll)},0);Bt=e;he(ne().body,"htmx:historyRestore",{path:e,item:t})}else{if(Q.config.refreshOnHistoryMiss){window.location.reload(true)}else{Gt(e)}}}function Zt(e){let t=we(e,"hx-indicator");if(t==null){t=[e]}se(t,function(e){const t=ie(e);t.requestCount=(t.requestCount||0)+1;e.classList.add.call(e.classList,Q.config.requestClass)});return t}function Yt(e){let t=we(e,"hx-disabled-elt");if(t==null){t=[]}se(t,function(e){const t=ie(e);t.requestCount=(t.requestCount||0)+1;e.setAttribute("disabled","");e.setAttribute("data-disabled-by-htmx","")});return t}function Qt(e,t){se(e.concat(t),function(e){const t=ie(e);t.requestCount=(t.requestCount||1)-1});se(e,function(e){const t=ie(e);if(t.requestCount===0){e.classList.remove.call(e.classList,Q.config.requestClass)}});se(t,function(e){const t=ie(e);if(t.requestCount===0){e.removeAttribute("disabled");e.removeAttribute("data-disabled-by-htmx")}})}function en(t,n){for(let e=0;e<t.length;e++){const r=t[e];if(r.isSameNode(n)){return true}}return false}function tn(e){const t=e;if(t.name===""||t.name==null||t.disabled||g(t,"fieldset[disabled]")){return false}if(t.type==="button"||t.type==="submit"||t.tagName==="image"||t.tagName==="reset"||t.tagName==="file"){return false}if(t.type==="checkbox"||t.type==="radio"){return t.checked}return true}function nn(t,e,n){if(t!=null&&e!=null){if(Array.isArray(e)){e.forEach(function(e){n.append(t,e)})}else{n.append(t,e)}}}function rn(t,n,r){if(t!=null&&n!=null){let e=r.getAll(t);if(Array.isArray(n)){e=e.filter(e=>n.indexOf(e)<0)}else{e=e.filter(e=>e!==n)}r.delete(t);se(e,e=>r.append(t,e))}}function on(t,n,r,o,i){if(o==null||en(t,o)){return}else{t.push(o)}if(tn(o)){const s=ee(o,"name");let e=o.value;if(o instanceof HTMLSelectElement&&o.multiple){e=M(o.querySelectorAll("option:checked")).map(function(e){return e.value})}if(o instanceof HTMLInputElement&&o.files){e=M(o.files)}nn(s,e,n);if(i){sn(o,r)}}if(o instanceof HTMLFormElement){se(o.elements,function(e){if(t.indexOf(e)>=0){rn(e.name,e.value,n)}else{t.push(e)}if(i){sn(e,r)}});new FormData(o).forEach(function(e,t){if(e instanceof File&&e.name===""){return}nn(t,e,n)})}}function sn(e,t){const n=e;if(n.willValidate){he(n,"htmx:validation:validate");if(!n.checkValidity()){t.push({elt:n,message:n.validationMessage,validity:n.validity});he(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})}}}function ln(n,e){for(const t of e.keys()){n.delete(t)}e.forEach(function(e,t){n.append(t,e)});return n}function cn(e,t){const n=[];const r=new FormData;const o=new FormData;const i=[];const s=ie(e);if(s.lastButtonClicked&&!le(s.lastButtonClicked)){s.lastButtonClicked=null}let l=e instanceof HTMLFormElement&&e.noValidate!==true||te(e,"hx-validate")==="true";if(s.lastButtonClicked){l=l&&s.lastButtonClicked.formNoValidate!==true}if(t!=="get"){on(n,o,i,g(e,"form"),l)}on(n,r,i,e,l);if(s.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&ee(e,"type")==="submit"){const u=s.lastButtonClicked||e;const a=ee(u,"name");nn(a,u.value,o)}const c=we(e,"hx-include");se(c,function(e){on(n,r,i,ue(e),l);if(!h(e,"form")){se(f(e).querySelectorAll(ot),function(e){on(n,r,i,e,l)})}});ln(r,o);return{errors:i,formData:r,values:An(r)}}function un(e,t,n){if(e!==""){e+="&"}if(String(n)==="[object Object]"){n=JSON.stringify(n)}const r=encodeURIComponent(n);e+=encodeURIComponent(t)+"="+r;return e}function an(e){e=qn(e);let n="";e.forEach(function(e,t){n=un(n,t,e)});return n}function fn(e,t,n){const r={"HX-Request":"true","HX-Trigger":ee(e,"id"),"HX-Trigger-Name":ee(e,"name"),"HX-Target":te(t,"id"),"HX-Current-URL":ne().location.href};bn(e,"hx-headers",false,r);if(n!==undefined){r["HX-Prompt"]=n}if(ie(e).boosted){r["HX-Boosted"]="true"}return r}function hn(n,e){const t=re(e,"hx-params");if(t){if(t==="none"){return new FormData}else if(t==="*"){return n}else if(t.indexOf("not ")===0){se(t.slice(4).split(","),function(e){e=e.trim();n.delete(e)});return n}else{const r=new FormData;se(t.split(","),function(t){t=t.trim();if(n.has(t)){n.getAll(t).forEach(function(e){r.append(t,e)})}});return r}}else{return n}}function dn(e){return!!ee(e,"href")&&ee(e,"href").indexOf("#")>=0}function gn(e,t){const n=t||re(e,"hx-swap");const r={swapStyle:ie(e).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&ie(e).boosted&&!dn(e)){r.show="top"}if(n){const s=F(n);if(s.length>0){for(let e=0;e<s.length;e++){const l=s[e];if(l.indexOf("swap:")===0){r.swapDelay=d(l.slice(5))}else if(l.indexOf("settle:")===0){r.settleDelay=d(l.slice(7))}else if(l.indexOf("transition:")===0){r.transition=l.slice(11)==="true"}else if(l.indexOf("ignoreTitle:")===0){r.ignoreTitle=l.slice(12)==="true"}else if(l.indexOf("scroll:")===0){const c=l.slice(7);var o=c.split(":");const u=o.pop();var i=o.length>0?o.join(":"):null;r.scroll=u;r.scrollTarget=i}else if(l.indexOf("show:")===0){const a=l.slice(5);var o=a.split(":");const f=o.pop();var i=o.length>0?o.join(":"):null;r.show=f;r.showTarget=i}else if(l.indexOf("focus-scroll:")===0){const h=l.slice("focus-scroll:".length);r.focusScroll=h=="true"}else if(e==0){r.swapStyle=l}else{O("Unknown modifier in hx-swap: "+l)}}}}return r}function pn(e){return re(e,"hx-encoding")==="multipart/form-data"||h(e,"form")&&ee(e,"enctype")==="multipart/form-data"}function mn(t,n,r){let o=null;Ft(n,function(e){if(o==null){o=e.encodeParameters(t,r,n)}});if(o!=null){return o}else{if(pn(n)){return ln(new FormData,qn(r))}else{return an(r)}}}function xn(e){return{tasks:[],elts:[e]}}function yn(e,t){const n=e[0];const r=e[e.length-1];if(t.scroll){var o=null;if(t.scrollTarget){o=ue(ae(n,t.scrollTarget))}if(t.scroll==="top"&&(n||o)){o=o||n;o.scrollTop=0}if(t.scroll==="bottom"&&(r||o)){o=o||r;o.scrollTop=o.scrollHeight}}if(t.show){var o=null;if(t.showTarget){let e=t.showTarget;if(t.showTarget==="window"){e="body"}o=ue(ae(n,e))}if(t.show==="top"&&(n||o)){o=o||n;o.scrollIntoView({block:"start",behavior:Q.config.scrollBehavior})}if(t.show==="bottom"&&(r||o)){o=o||r;o.scrollIntoView({block:"end",behavior:Q.config.scrollBehavior})}}}function bn(r,e,o,i){if(i==null){i={}}if(r==null){return i}const s=te(r,e);if(s){let e=s.trim();let t=o;if(e==="unset"){return null}if(e.indexOf("javascript:")===0){e=e.slice(11);t=true}else if(e.indexOf("js:")===0){e=e.slice(3);t=true}if(e.indexOf("{")!==0){e="{"+e+"}"}let n;if(t){n=vn(r,function(){return Function("return ("+e+")")()},{})}else{n=S(e)}for(const l in n){if(n.hasOwnProperty(l)){if(i[l]==null){i[l]=n[l]}}}}return bn(ue(c(r)),e,o,i)}function vn(e,t,n){if(Q.config.allowEval){return t()}else{fe(e,"htmx:evalDisallowedError");return n}}function wn(e,t){return bn(e,"hx-vars",true,t)}function Sn(e,t){return bn(e,"hx-vals",false,t)}function En(e){return ce(wn(e),Sn(e))}function Cn(t,n,r){if(r!==null){try{t.setRequestHeader(n,r)}catch(e){t.setRequestHeader(n,encodeURIComponent(r));t.setRequestHeader(n+"-URI-AutoEncoded","true")}}}function On(t){if(t.responseURL&&typeof URL!=="undefined"){try{const e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(ne().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function R(e,t){return t.test(e.getAllResponseHeaders())}function Rn(t,n,r){t=t.toLowerCase();if(r){if(r instanceof Element||typeof r==="string"){return de(t,n,null,null,{targetOverride:y(r)||ve,returnPromise:true})}else{let e=y(r.target);if(r.target&&!e||r.source&&!e&&!y(r.source)){e=ve}return de(t,n,y(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:e,swapOverride:r.swap,select:r.select,returnPromise:true})}}else{return de(t,n,null,null,{returnPromise:true})}}function Hn(e){const t=[];while(e){t.push(e);e=e.parentElement}return t}function Tn(e,t,n){let r;let o;if(typeof URL==="function"){o=new URL(t,document.location.href);const i=document.location.origin;r=i===o.origin}else{o=t;r=l(t,document.location.origin)}if(Q.config.selfRequestsOnly){if(!r){return false}}return he(e,"htmx:validateUrl",ce({url:o,sameHost:r},n))}function qn(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e){if(e.hasOwnProperty(n)){if(e[n]&&typeof e[n].forEach==="function"){e[n].forEach(function(e){t.append(n,e)})}else if(typeof e[n]==="object"&&!(e[n]instanceof Blob)){t.append(n,JSON.stringify(e[n]))}else{t.append(n,e[n])}}}return t}function Ln(r,o,e){return new Proxy(e,{get:function(t,e){if(typeof e==="number")return t[e];if(e==="length")return t.length;if(e==="push"){return function(e){t.push(e);r.append(o,e)}}if(typeof t[e]==="function"){return function(){t[e].apply(t,arguments);r.delete(o);t.forEach(function(e){r.append(o,e)})}}if(t[e]&&t[e].length===1){return t[e][0]}else{return t[e]}},set:function(e,t,n){e[t]=n;r.delete(o);e.forEach(function(e){r.append(o,e)});return true}})}function An(o){return new Proxy(o,{get:function(e,t){if(typeof t==="symbol"){const r=Reflect.get(e,t);if(typeof r==="function"){return function(){return r.apply(o,arguments)}}else{return r}}if(t==="toJSON"){return()=>Object.fromEntries(o)}if(t in e){if(typeof e[t]==="function"){return function(){return o[t].apply(o,arguments)}}else{return e[t]}}const n=o.getAll(t);if(n.length===0){return undefined}else if(n.length===1){return n[0]}else{return Ln(e,t,n)}},set:function(t,n,e){if(typeof n!=="string"){return false}t.delete(n);if(e&&typeof e.forEach==="function"){e.forEach(function(e){t.append(n,e)})}else if(typeof e==="object"&&!(e instanceof Blob)){t.append(n,JSON.stringify(e))}else{t.append(n,e)}return true},deleteProperty:function(e,t){if(typeof t==="string"){e.delete(t)}return true},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function de(t,n,r,o,i,D){let s=null;let l=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var e=new Promise(function(e,t){s=e;l=t})}if(r==null){r=ne().body}const M=i.handler||Dn;const X=i.select||null;if(!le(r)){oe(s);return e}const c=i.targetOverride||ue(Ee(r));if(c==null||c==ve){fe(r,"htmx:targetError",{target:te(r,"hx-target")});oe(l);return e}let u=ie(r);const a=u.lastButtonClicked;if(a){const L=ee(a,"formaction");if(L!=null){n=L}const A=ee(a,"formmethod");if(A!=null){if(A.toLowerCase()!=="dialog"){t=A}}}const f=re(r,"hx-confirm");if(D===undefined){const K=function(e){return de(t,n,r,o,i,!!e)};const G={target:c,elt:r,path:n,verb:t,triggeringEvent:o,etc:i,issueRequest:K,question:f};if(he(r,"htmx:confirm",G)===false){oe(s);return e}}let h=r;let d=re(r,"hx-sync");let g=null;let F=false;if(d){const N=d.split(":");const I=N[0].trim();if(I==="this"){h=Se(r,"hx-sync")}else{h=ue(ae(r,I))}d=(N[1]||"drop").trim();u=ie(h);if(d==="drop"&&u.xhr&&u.abortable!==true){oe(s);return e}else if(d==="abort"){if(u.xhr){oe(s);return e}else{F=true}}else if(d==="replace"){he(h,"htmx:abort")}else if(d.indexOf("queue")===0){const W=d.split(" ");g=(W[1]||"last").trim()}}if(u.xhr){if(u.abortable){he(h,"htmx:abort")}else{if(g==null){if(o){const P=ie(o);if(P&&P.triggerSpec&&P.triggerSpec.queue){g=P.triggerSpec.queue}}if(g==null){g="last"}}if(u.queuedRequests==null){u.queuedRequests=[]}if(g==="first"&&u.queuedRequests.length===0){u.queuedRequests.push(function(){de(t,n,r,o,i)})}else if(g==="all"){u.queuedRequests.push(function(){de(t,n,r,o,i)})}else if(g==="last"){u.queuedRequests=[];u.queuedRequests.push(function(){de(t,n,r,o,i)})}oe(s);return e}}const p=new XMLHttpRequest;u.xhr=p;u.abortable=F;const m=function(){u.xhr=null;u.abortable=false;if(u.queuedRequests!=null&&u.queuedRequests.length>0){const e=u.queuedRequests.shift();e()}};const B=re(r,"hx-prompt");if(B){var x=prompt(B);if(x===null||!he(r,"htmx:prompt",{prompt:x,target:c})){oe(s);m();return e}}if(f&&!D){if(!confirm(f)){oe(s);m();return e}}let y=fn(r,c,x);if(t!=="get"&&!pn(r)){y["Content-Type"]="application/x-www-form-urlencoded"}if(i.headers){y=ce(y,i.headers)}const U=cn(r,t);let b=U.errors;const j=U.formData;if(i.values){ln(j,qn(i.values))}const V=qn(En(r));const v=ln(j,V);let w=hn(v,r);if(Q.config.getCacheBusterParam&&t==="get"){w.set("org.htmx.cache-buster",ee(c,"id")||"true")}if(n==null||n===""){n=ne().location.href}const S=bn(r,"hx-request");const _=ie(r).boosted;let E=Q.config.methodsThatUseUrlParams.indexOf(t)>=0;const C={boosted:_,useUrlParams:E,formData:w,parameters:An(w),unfilteredFormData:v,unfilteredParameters:An(v),headers:y,target:c,verb:t,errors:b,withCredentials:i.credentials||S.credentials||Q.config.withCredentials,timeout:i.timeout||S.timeout||Q.config.timeout,path:n,triggeringEvent:o};if(!he(r,"htmx:configRequest",C)){oe(s);m();return e}n=C.path;t=C.verb;y=C.headers;w=qn(C.parameters);b=C.errors;E=C.useUrlParams;if(b&&b.length>0){he(r,"htmx:validation:halted",C);oe(s);m();return e}const z=n.split("#");const $=z[0];const O=z[1];let R=n;if(E){R=$;const Z=!w.keys().next().done;if(Z){if(R.indexOf("?")<0){R+="?"}else{R+="&"}R+=an(w);if(O){R+="#"+O}}}if(!Tn(r,R,C)){fe(r,"htmx:invalidPath",C);oe(l);return e}p.open(t.toUpperCase(),R,true);p.overrideMimeType("text/html");p.withCredentials=C.withCredentials;p.timeout=C.timeout;if(S.noHeaders){}else{for(const k in y){if(y.hasOwnProperty(k)){const Y=y[k];Cn(p,k,Y)}}}const H={xhr:p,target:c,requestConfig:C,etc:i,boosted:_,select:X,pathInfo:{requestPath:n,finalRequestPath:R,responsePath:null,anchor:O}};p.onload=function(){try{const t=Hn(r);H.pathInfo.responsePath=On(p);M(r,H);if(H.keepIndicators!==true){Qt(T,q)}he(r,"htmx:afterRequest",H);he(r,"htmx:afterOnLoad",H);if(!le(r)){let e=null;while(t.length>0&&e==null){const n=t.shift();if(le(n)){e=n}}if(e){he(e,"htmx:afterRequest",H);he(e,"htmx:afterOnLoad",H)}}oe(s);m()}catch(e){fe(r,"htmx:onLoadError",ce({error:e},H));throw e}};p.onerror=function(){Qt(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:sendError",H);oe(l);m()};p.onabort=function(){Qt(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:sendAbort",H);oe(l);m()};p.ontimeout=function(){Qt(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:timeout",H);oe(l);m()};if(!he(r,"htmx:beforeRequest",H)){oe(s);m();return e}var T=Zt(r);var q=Yt(r);se(["loadstart","loadend","progress","abort"],function(t){se([p,p.upload],function(e){e.addEventListener(t,function(e){he(r,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});he(r,"htmx:beforeSend",H);const J=E?null:mn(p,r,w);p.send(J);return e}function Nn(e,t){const n=t.xhr;let r=null;let o=null;if(R(n,/HX-Push:/i)){r=n.getResponseHeader("HX-Push");o="push"}else if(R(n,/HX-Push-Url:/i)){r=n.getResponseHeader("HX-Push-Url");o="push"}else if(R(n,/HX-Replace-Url:/i)){r=n.getResponseHeader("HX-Replace-Url");o="replace"}if(r){if(r==="false"){return{}}else{return{type:o,path:r}}}const i=t.pathInfo.finalRequestPath;const s=t.pathInfo.responsePath;const l=re(e,"hx-push-url");const c=re(e,"hx-replace-url");const u=ie(e).boosted;let a=null;let f=null;if(l){a="push";f=l}else if(c){a="replace";f=c}else if(u){a="push";f=s||i}if(f){if(f==="false"){return{}}if(f==="true"){f=s||i}if(t.pathInfo.anchor&&f.indexOf("#")===-1){f=f+"#"+t.pathInfo.anchor}return{type:a,path:f}}else{return{}}}function In(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function Pn(e){for(var t=0;t<Q.config.responseHandling.length;t++){var n=Q.config.responseHandling[t];if(In(n,e.status)){return n}}return{swap:false}}function kn(e){if(e){const t=u("title");if(t){t.innerHTML=e}else{window.document.title=e}}}function Dn(o,i){const s=i.xhr;let l=i.target;const e=i.etc;const c=i.select;if(!he(o,"htmx:beforeOnLoad",i))return;if(R(s,/HX-Trigger:/i)){Je(s,"HX-Trigger",o)}if(R(s,/HX-Location:/i)){zt();let e=s.getResponseHeader("HX-Location");var t;if(e.indexOf("{")===0){t=S(e);e=t.path;delete t.path}Rn("get",e,t).then(function(){$t(e)});return}const n=R(s,/HX-Refresh:/i)&&s.getResponseHeader("HX-Refresh")==="true";if(R(s,/HX-Redirect:/i)){i.keepIndicators=true;location.href=s.getResponseHeader("HX-Redirect");n&&location.reload();return}if(n){i.keepIndicators=true;location.reload();return}if(R(s,/HX-Retarget:/i)){if(s.getResponseHeader("HX-Retarget")==="this"){i.target=o}else{i.target=ue(ae(o,s.getResponseHeader("HX-Retarget")))}}const u=Nn(o,i);const r=Pn(s);const a=r.swap;let f=!!r.error;let h=Q.config.ignoreTitle||r.ignoreTitle;let d=r.select;if(r.target){i.target=ue(ae(o,r.target))}var g=e.swapOverride;if(g==null&&r.swapOverride){g=r.swapOverride}if(R(s,/HX-Retarget:/i)){if(s.getResponseHeader("HX-Retarget")==="this"){i.target=o}else{i.target=ue(ae(o,s.getResponseHeader("HX-Retarget")))}}if(R(s,/HX-Reswap:/i)){g=s.getResponseHeader("HX-Reswap")}var p=s.response;var m=ce({shouldSwap:a,serverResponse:p,isError:f,ignoreTitle:h,selectOverride:d,swapOverride:g},i);if(r.event&&!he(l,r.event,m))return;if(!he(l,"htmx:beforeSwap",m))return;l=m.target;p=m.serverResponse;f=m.isError;h=m.ignoreTitle;d=m.selectOverride;g=m.swapOverride;i.target=l;i.failed=f;i.successful=!f;if(m.shouldSwap){if(s.status===286){lt(o)}Ft(o,function(e){p=e.transformResponse(p,s,o)});if(u.type){zt()}var x=gn(o,g);if(!x.hasOwnProperty("ignoreTitle")){x.ignoreTitle=h}l.classList.add(Q.config.swappingClass);let n=null;let r=null;if(c){d=c}if(R(s,/HX-Reselect:/i)){d=s.getResponseHeader("HX-Reselect")}const y=re(o,"hx-select-oob");const b=re(o,"hx-select");let e=function(){try{if(u.type){he(ne().body,"htmx:beforeHistoryUpdate",ce({history:u},i));if(u.type==="push"){$t(u.path);he(ne().body,"htmx:pushedIntoHistory",{path:u.path})}else{Jt(u.path);he(ne().body,"htmx:replacedInHistory",{path:u.path})}}$e(l,p,x,{select:d||b,selectOOB:y,eventInfo:i,anchor:i.pathInfo.anchor,contextElement:o,afterSwapCallback:function(){if(R(s,/HX-Trigger-After-Swap:/i)){let e=o;if(!le(o)){e=ne().body}Je(s,"HX-Trigger-After-Swap",e)}},afterSettleCallback:function(){if(R(s,/HX-Trigger-After-Settle:/i)){let e=o;if(!le(o)){e=ne().body}Je(s,"HX-Trigger-After-Settle",e)}oe(n)}})}catch(e){fe(o,"htmx:swapError",i);oe(r);throw e}};let t=Q.config.globalViewTransitions;if(x.hasOwnProperty("transition")){t=x.transition}if(t&&he(o,"htmx:beforeTransition",i)&&typeof Promise!=="undefined"&&document.startViewTransition){const v=new Promise(function(e,t){n=e;r=t});const w=e;e=function(){document.startViewTransition(function(){w();return v})}}if(x.swapDelay>0){E().setTimeout(e,x.swapDelay)}else{e()}}if(f){fe(o,"htmx:responseError",ce({error:"Response Status Error Code "+s.status+" from "+i.pathInfo.requestPath},i))}}const Mn={};function Xn(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,n,r){return false},encodeParameters:function(e,t,n){return null}}}function Fn(e,t){if(t.init){t.init(n)}Mn[e]=ce(Xn(),t)}function Bn(e){delete Mn[e]}function Un(e,n,r){if(n==undefined){n=[]}if(e==undefined){return n}if(r==undefined){r=[]}const t=te(e,"hx-ext");if(t){se(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){r.push(e.slice(7));return}if(r.indexOf(e)<0){const t=Mn[e];if(t&&n.indexOf(t)<0){n.push(t)}}})}return Un(ue(c(e)),n,r)}var jn=false;ne().addEventListener("DOMContentLoaded",function(){jn=true});function Vn(e){if(jn||ne().readyState==="complete"){e()}else{ne().addEventListener("DOMContentLoaded",e)}}function _n(){if(Q.config.includeIndicatorStyles!==false){const e=Q.config.inlineStyleNonce?` nonce="${Q.config.inlineStyleNonce}"`:"";ne().head.insertAdjacentHTML("beforeend","<style"+e+"> ."+Q.config.indicatorClass+"{opacity:0} ."+Q.config.requestClass+" ."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+Q.config.requestClass+"."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} </style>")}}function zn(){const e=ne().querySelector('meta[name="htmx-config"]');if(e){return S(e.content)}else{return null}}function $n(){const e=zn();if(e){Q.config=ce(Q.config,e)}}Vn(function(){$n();_n();let e=ne().body;kt(e);const t=ne().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){const t=e.target;const n=ie(t);if(n&&n.xhr){n.xhr.abort()}});const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){Wt();se(t,function(e){he(e,"htmx:restored",{document:ne(),triggerEvent:he})})}else{if(n){n(e)}}};E().setTimeout(function(){he(e,"htmx:load",{});e=null},0)});return Q}(); \ No newline at end of file
diff --git a/web/assets/javascript-params.scm b/web/assets/javascript-params.scm
new file mode 100644
index 0000000..db300e3
--- /dev/null
+++ b/web/assets/javascript-params.scm
@@ -0,0 +1,12 @@
+; JavaScript parameters, from tree-sitter/tree-sitter-javascript v0.25.0
+; queries/highlights-params.scm (MIT), verbatim. Its own file because upstream
+; keeps it out of the TypeScript composition: there a formal_parameters child
+; is always a required_parameter or optional_parameter, so these patterns are
+; not merely dead but rejected by the query compiler as impossible.
+
+(formal_parameters [
+ (identifier) @variable.parameter
+ (array_pattern (identifier) @variable.parameter)
+ (object_pattern [
+ (pair_pattern value: (identifier) @variable.parameter)
+ (shorthand_property_identifier_pattern) @variable.parameter])])
diff --git a/web/assets/javascript.scm b/web/assets/javascript.scm
new file mode 100644
index 0000000..a5c8f01
--- /dev/null
+++ b/web/assets/javascript.scm
@@ -0,0 +1,52 @@
+; JavaScript highlights, from tree-sitter/tree-sitter-javascript v0.25.0
+; queries/highlights.scm (MIT). Reordered for later-patterns-win and capture
+; names mapped onto zed syntax keys. Upstream's @variable.builtin and require()
+; patterns are gone: they lean on (#is-not? local), which no query engine
+; outside nvim evaluates. Also loaded ahead of typescript.scm, the way upstream
+; composes the TypeScript highlights.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+[";" (optional_chain) "." ","] @punctuation.delimiter
+["-" "--" "-=" "+" "++" "+=" "*" "*=" "**" "**=" "/" "/=" "%" "%=" "<" "<="
+ "<<" "<<=" "=" "==" "===" "!" "!=" "!==" "=>" ">" ">=" ">>" ">>=" ">>>"
+ ">>>=" "~" "^" "&" "|" "^=" "&=" "|=" "&&" "||" "??" "&&=" "||="
+ "??="] @operator
+
+["as" "async" "await" "break" "case" "catch" "class" "const" "continue"
+ "debugger" "default" "delete" "do" "else" "export" "extends" "finally" "for"
+ "from" "function" "get" "if" "import" "in" "instanceof" "let" "new" "of"
+ "return" "set" "static" "switch" "target" "throw" "try" "typeof" "var"
+ "void" "while" "with" "yield"] @keyword
+
+[(property_identifier) (shorthand_property_identifier)] @property
+
+((identifier) @constructor
+ (#match? @constructor "^[A-Z]"))
+([(identifier) (shorthand_property_identifier)
+ (shorthand_property_identifier_pattern)] @constant
+ (#match? @constant "^[A-Z_][A-Z0-9_]+$"))
+
+(function_expression name: (identifier) @function)
+(function_declaration name: (identifier) @function)
+(method_definition name: (property_identifier) @function.method)
+(pair key: (property_identifier) @function.method
+ value: [(function_expression) (arrow_function)])
+(assignment_expression
+ left: (member_expression property: (property_identifier) @function.method)
+ right: [(function_expression) (arrow_function)])
+(variable_declarator name: (identifier) @function
+ value: [(function_expression) (arrow_function)])
+(assignment_expression left: (identifier) @function
+ right: [(function_expression) (arrow_function)])
+(call_expression function: (identifier) @function)
+(call_expression function: (member_expression
+ property: (property_identifier) @function.method))
+
+[(this) (super)] @variable.special
+(number) @number
+[(true) (false) (null) (undefined)] @constant
+[(string) (template_string)] @string
+(escape_sequence) @string.escape
+(regex) @string.regex
+(template_substitution "${" @punctuation.special "}" @punctuation.special)
+(comment) @comment
diff --git a/web/assets/json.scm b/web/assets/json.scm
new file mode 100644
index 0000000..e82e125
--- /dev/null
+++ b/web/assets/json.scm
@@ -0,0 +1,13 @@
+; JSON highlights, from tree-sitter/tree-sitter-json v0.24.8
+; queries/highlights.scm (MIT). Reordered so object keys repaint the string
+; they are; capture names are already zed syntax keys but for @escape.
+
+["{" "}" "[" "]"] @punctuation.bracket
+[":" ","] @punctuation.delimiter
+
+(number) @number
+[(null) (true) (false)] @constant
+(string) @string
+(pair key: (string) @string.special.key)
+(escape_sequence) @string.escape
+(comment) @comment
diff --git a/web/assets/jsx.scm b/web/assets/jsx.scm
new file mode 100644
index 0000000..708eba2
--- /dev/null
+++ b/web/assets/jsx.scm
@@ -0,0 +1,16 @@
+; JSX highlights, from tree-sitter/tree-sitter-javascript v0.25.0
+; queries/highlights-jsx.scm (MIT), verbatim but for the capture rename.
+; Loaded last for .jsx and .tsx; the plain typescript grammar has no JSX nodes,
+; so .ts must not get this file.
+
+(jsx_opening_element ["<" ">"] @punctuation.bracket)
+(jsx_closing_element ["</" ">"] @punctuation.bracket)
+(jsx_self_closing_element ["<" "/>"] @punctuation.bracket)
+
+(jsx_attribute (property_identifier) @attribute)
+
+; lowercase names are html elements, capitalized ones are components and keep
+; the @constructor javascript.scm gave them
+((jsx_opening_element (identifier) @tag) (#match? @tag "^[a-z][^.]*$"))
+((jsx_closing_element (identifier) @tag) (#match? @tag "^[a-z][^.]*$"))
+((jsx_self_closing_element (identifier) @tag) (#match? @tag "^[a-z][^.]*$"))
diff --git a/web/assets/one.json b/web/assets/one.json
new file mode 100644
index 0000000..cb4ca24
--- /dev/null
+++ b/web/assets/one.json
@@ -0,0 +1,112 @@
+{
+ "name": "One",
+ "author": "Zed Industries (vendored subset for notevi fallback)",
+ "themes": [
+ {
+ "name": "One Dark",
+ "appearance": "dark",
+ "style": {
+ "editor.background": "#282c33ff",
+ "editor.foreground": "#acb2beff",
+ "background": "#3b414dff",
+ "panel.background": "#2f343eff",
+ "surface.background": "#2f343eff",
+ "border": "#464b57ff",
+ "editor.line_number": "#4e5a5f",
+ "text": "#dce0e5ff",
+ "text.muted": "#a9afbcff",
+ "text.accent": "#74ade8ff",
+ "warning": "#dec184ff",
+ "element.hover": "#363c46ff",
+ "players": [
+ {"cursor": "#74ade8ff"}, {"cursor": "#be5046ff"}, {"cursor": "#bf956aff"},
+ {"cursor": "#b477cfff"}, {"cursor": "#6eb4bfff"}, {"cursor": "#d07277ff"},
+ {"cursor": "#dec184ff"}, {"cursor": "#a1c181ff"}
+ ],
+ "syntax": {
+ "attribute": {"color": "#74ade8ff"},
+ "boolean": {"color": "#bf956aff"},
+ "comment": {"color": "#5d636fff"},
+ "comment.doc": {"color": "#878e98ff"},
+ "constant": {"color": "#dfc184ff"},
+ "constructor": {"color": "#73ade9ff"},
+ "embedded": {"color": "#dce0e5ff"},
+ "enum": {"color": "#6eb4bfff"},
+ "function": {"color": "#73ade9ff"},
+ "keyword": {"color": "#b477cfff"},
+ "label": {"color": "#74ade8ff"},
+ "number": {"color": "#bf956aff"},
+ "operator": {"color": "#6eb4bfff"},
+ "preproc": {"color": "#b477cfff"},
+ "primary": {"color": "#acb2beff"},
+ "property": {"color": "#d07277ff"},
+ "punctuation": {"color": "#acb2beff"},
+ "punctuation.bracket": {"color": "#b2b9c6ff"},
+ "punctuation.delimiter": {"color": "#b2b9c6ff"},
+ "punctuation.special": {"color": "#b1574bff"},
+ "string": {"color": "#a1c181ff"},
+ "string.escape": {"color": "#878e98ff"},
+ "string.regex": {"color": "#bf956aff"},
+ "string.special": {"color": "#bf956aff"},
+ "type": {"color": "#6eb4bfff"},
+ "variable": {"color": "#acb2beff"},
+ "variable.parameter": {"color": "#d07277ff"},
+ "variable.special": {"color": "#bf956aff"}
+ }
+ }
+ },
+ {
+ "name": "One Light",
+ "appearance": "light",
+ "style": {
+ "editor.background": "#fafafaff",
+ "editor.foreground": "#242529ff",
+ "background": "#dcdcddff",
+ "panel.background": "#ebebecff",
+ "surface.background": "#ebebecff",
+ "border": "#c9c9caff",
+ "editor.line_number": "#b4b4bb",
+ "text": "#242529ff",
+ "text.muted": "#58585aff",
+ "text.accent": "#5c78e2ff",
+ "warning": "#a48819ff",
+ "element.hover": "#dfdfe0ff",
+ "players": [
+ {"cursor": "#5c78e2ff"}, {"cursor": "#984ea5ff"}, {"cursor": "#ad6e26ff"},
+ {"cursor": "#a349abff"}, {"cursor": "#3a82b7ff"}, {"cursor": "#d36151ff"},
+ {"cursor": "#a48819ff"}, {"cursor": "#669f59ff"}
+ ],
+ "syntax": {
+ "attribute": {"color": "#5c78e2ff"},
+ "boolean": {"color": "#ad6e25ff"},
+ "comment": {"color": "#a2a3a7ff"},
+ "comment.doc": {"color": "#7c7e86ff"},
+ "constant": {"color": "#c18401ff"},
+ "constructor": {"color": "#5c78e2ff"},
+ "embedded": {"color": "#242529ff"},
+ "enum": {"color": "#3882b7ff"},
+ "function": {"color": "#5b79e3ff"},
+ "keyword": {"color": "#a449abff"},
+ "label": {"color": "#5c78e2ff"},
+ "number": {"color": "#ad6e25ff"},
+ "operator": {"color": "#3882b7ff"},
+ "preproc": {"color": "#a449abff"},
+ "primary": {"color": "#242529ff"},
+ "property": {"color": "#d3604fff"},
+ "punctuation": {"color": "#242529ff"},
+ "punctuation.bracket": {"color": "#4d4f52ff"},
+ "punctuation.delimiter": {"color": "#4d4f52ff"},
+ "punctuation.special": {"color": "#b92b46ff"},
+ "string": {"color": "#649f57ff"},
+ "string.escape": {"color": "#7c7e86ff"},
+ "string.regex": {"color": "#ad6e26ff"},
+ "string.special": {"color": "#ad6e26ff"},
+ "type": {"color": "#3882b7ff"},
+ "variable": {"color": "#242529ff"},
+ "variable.parameter": {"color": "#d3604fff"},
+ "variable.special": {"color": "#ad6e25ff"}
+ }
+ }
+ }
+ ]
+}
diff --git a/web/assets/python.scm b/web/assets/python.scm
new file mode 100644
index 0000000..f64e673
--- /dev/null
+++ b/web/assets/python.scm
@@ -0,0 +1,50 @@
+; Python highlights, from tree-sitter/tree-sitter-python v0.25.0
+; queries/highlights.scm (MIT). Reordered for later-patterns-win, capture names
+; mapped onto zed syntax keys, and the builtin-function #match? turned into
+; #any-of?. The two casing heuristics stay regexes: nothing else can express
+; "CONST_CASE" and "ClassName" over bare identifiers.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+[";" "," "." ":"] @punctuation.delimiter
+["-" "-=" "!=" "*" "**" "**=" "*=" "/" "//" "//=" "/=" "&" "&=" "%" "%="
+ "^" "^=" "+" "->" "+=" "<" "<<" "<<=" "<=" "<>" "=" ":=" "==" ">" ">="
+ ">>" ">>=" "|" "|=" "~" "@=" "and" "in" "is" "not" "or" "is not"
+ "not in"] @operator
+
+["as" "assert" "async" "await" "break" "class" "continue" "def" "del" "elif"
+ "else" "except" "exec" "finally" "for" "from" "global" "if" "import" "lambda"
+ "nonlocal" "pass" "print" "raise" "return" "try" "while" "with" "yield"
+ "match" "case"] @keyword
+
+((identifier) @constructor
+ (#match? @constructor "^[A-Z]"))
+((identifier) @constant
+ (#match? @constant "^[A-Z][A-Z_0-9]*$"))
+((identifier) @variable.special
+ (#any-of? @variable.special "self" "cls"))
+
+(type (identifier) @type)
+(attribute attribute: (identifier) @property)
+(function_definition name: (identifier) @function)
+(call function: (identifier) @function)
+(call function: (attribute attribute: (identifier) @function.method))
+((call function: (identifier) @function.builtin)
+ (#any-of? @function.builtin "abs" "all" "any" "ascii" "bin" "bool"
+ "breakpoint" "bytearray" "bytes" "callable" "chr" "classmethod" "compile"
+ "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" "filter"
+ "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help"
+ "hex" "id" "input" "int" "isinstance" "issubclass" "iter" "len" "list"
+ "locals" "map" "max" "memoryview" "min" "next" "object" "oct" "open" "ord"
+ "pow" "print" "property" "range" "repr" "reversed" "round" "set" "setattr"
+ "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" "vars"
+ "zip" "__import__"))
+
+[(integer) (float)] @number
+[(none) (true) (false)] @constant
+(string) @string
+(escape_sequence) @string.escape
+(interpolation "{" @punctuation.special "}" @punctuation.special)
+
+(decorator "@" @attribute)
+(decorator [(identifier) (attribute)] @attribute)
+(comment) @comment
diff --git a/web/assets/rust.scm b/web/assets/rust.scm
new file mode 100644
index 0000000..d23fa2c
--- /dev/null
+++ b/web/assets/rust.scm
@@ -0,0 +1,48 @@
+; Minimal rust highlights. Capture names double as zed syntax theme keys.
+; Order matters: later patterns paint over earlier ones.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+[";" "," "." ":" "::"] @punctuation.delimiter
+["=" "==" "!=" "<" ">" "<=" ">=" "+" "-" "*" "/" "%" "&" "|" "^" "!" "&&" "||"
+ "->" "=>" ".." "..=" "+=" "-=" "*=" "/=" "?" "@" "<<" ">>"] @operator
+
+["as" "async" "await" "break" "const" "continue" "dyn" "else" "enum"
+ "extern" "fn" "for" "if" "impl" "in" "let" "loop" "match" "mod" "move"
+ "pub" "ref" "return" "static" "struct" "trait" "type" "union"
+ "unsafe" "use" "where" "while"] @keyword
+(crate) @keyword
+(super) @keyword
+(mutable_specifier) @keyword
+
+(type_identifier) @type
+(primitive_type) @type
+(field_identifier) @property
+(shorthand_field_initializer (identifier) @property)
+(enum_variant name: (identifier) @constructor)
+(const_item name: (identifier) @constant)
+(static_item name: (identifier) @constant)
+(boolean_literal) @constant
+
+(function_item name: (identifier) @function)
+(function_signature_item name: (identifier) @function)
+(call_expression function: (identifier) @function)
+(call_expression function: (scoped_identifier name: (identifier) @function))
+(call_expression function: (field_expression field: (field_identifier) @function))
+(generic_function function: (identifier) @function)
+(generic_function function: (scoped_identifier name: (identifier) @function))
+(macro_invocation macro: (identifier) @function)
+(macro_invocation macro: (scoped_identifier name: (identifier) @function))
+
+(integer_literal) @number
+(float_literal) @number
+(char_literal) @string
+(string_literal) @string
+(raw_string_literal) @string
+(escape_sequence) @string.escape
+(lifetime) @label
+(self) @variable.special
+
+(attribute_item) @attribute
+(inner_attribute_item) @attribute
+(line_comment) @comment
+(block_comment) @comment
diff --git a/web/assets/style.css.tmpl b/web/assets/style.css.tmpl
new file mode 100644
index 0000000..d555950
--- /dev/null
+++ b/web/assets/style.css.tmpl
@@ -0,0 +1,592 @@
+/* generated from zed themes "{{.DarkName}}" (dark) + "{{.LightName}}" (light) */
+:root {
+{{range .DarkVars}} {{.K}}: {{.V}};
+{{end}} color-scheme: dark;
+ --note-bg: color-mix(in srgb, var(--note) 4%, transparent);
+}
+@media (prefers-color-scheme: light) {
+ :root:not([data-theme="dark"]) {
+{{range .LightVars}} {{.K}}: {{.V}};
+{{end}} color-scheme: light;
+ }
+}
+:root[data-theme="light"] {
+{{range .LightVars}} {{.K}}: {{.V}};
+{{end}} color-scheme: light;
+}
+
+* { box-sizing: border-box; }
+body {
+ margin: 0;
+ display: grid;
+ grid-template-columns: 280px minmax(0, 1fr);
+ background: var(--bg);
+ color: var(--fg);
+ font: 15px/1.5 ui-sans-serif, system-ui, sans-serif;
+}
+:root[data-mode="notes"] body.with-aside,
+body.with-aside { grid-template-columns: 280px minmax(0, 1fr) 380px; }
+:root[data-mode="trace"] body.with-aside { grid-template-columns: 280px minmax(0, 1fr); }
+
+/* ── focus: trace or notes ─────────────────────────────────────
+ The two views compete for the same pixels — line background, gutter
+ color, tree markers — so the interface shows one at a time. */
+:root[data-mode="trace"] .notes-only { display: none !important; }
+:root[data-mode="notes"] .trace-only { display: none !important; }
+:root[data-mode="notes"] ol.code li.cov { box-shadow: none; }
+:root[data-mode="notes"] ol.code li.cov::before { color: var(--ln); font-weight: 400; }
+:root[data-mode="notes"] nav a.file::after,
+:root[data-mode="notes"] .filetree a.file::after { display: none; }
+:root[data-mode="trace"] ol.code li.noted { background: none; cursor: default; }
+:root[data-mode="trace"] ol.code li.noted::before { color: var(--ln); }
+:root[data-mode="trace"] nav a.file.has-notes::before,
+:root[data-mode="trace"] .filetree a.file.has-notes::before { content: none; }
+:root[data-mode="notes"] nav a.file { color: var(--muted); }
+:root[data-mode="notes"] nav a.file.has-notes { color: var(--fg); }
+
+.modes { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
+.modes .mode {
+ background: none; border: 0; color: var(--muted);
+ font: inherit; font-size: 11px; padding: 2px 8px; cursor: pointer;
+}
+.modes .mode:hover { background: var(--hover); color: var(--fg); }
+.modes .mode[aria-pressed="true"] { background: var(--hover); color: var(--fg); font-weight: 600; }
+
+a { color: var(--accent); text-decoration: none; }
+a:hover { text-decoration: underline; }
+code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
+h1 { font-size: 1.1rem; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
+h2 { font-size: 0.95rem; margin: 1.4em 0 0.5em; }
+
+/* ── left tree ─────────────────────────────────────────────── */
+nav {
+ border-right: 1px solid var(--border);
+ background: var(--panel);
+ padding: 10px 8px;
+ position: sticky; top: 0;
+ height: 100vh; overflow: auto;
+ font-size: 13px;
+}
+nav > header {
+ font-weight: 600; margin-bottom: 10px;
+ display: flex; align-items: center; justify-content: space-between; gap: 8px;
+}
+nav > header a { color: var(--fg); }
+nav .brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+/* the bem-te-vi; inline so the brand keeps ellipsing its title */
+nav .brand .mark { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 0.4em; }
+#filetoggle {
+ display: block; margin: 0 0 6px auto;
+ background: none; color: var(--muted); border: 0;
+ font: inherit; font-size: 11px; padding: 1px 3px; cursor: pointer;
+}
+#filetoggle:hover { color: var(--fg); }
+:root[data-files="hidden"] #filelist { display: none; }
+
+/* ── the current change ────────────────────────────────────────
+ Everything on screen is read at one change: the tree, the code, the
+ coverage, the notes, and anything you write. It says so, always. */
+.changebar {
+ margin-bottom: 10px; padding: 7px 8px;
+ border: 1px solid var(--border); border-left: 3px solid var(--accent);
+ border-radius: 6px; background: var(--bg);
+}
+.changebar.away { border-left-color: var(--note); }
+.changebar .cid { display: flex; align-items: baseline; gap: 6px; }
+.changebar .lbl { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
+.changebar .cid code { font-size: 13px; font-weight: 600; color: var(--fg); }
+.changebar .cid a code { color: var(--accent); }
+.changebar .flags { color: var(--note); font-size: 10px; font-style: italic; margin-left: auto; }
+.changebar .desc {
+ margin: 3px 0 0; font-size: 11.5px; color: var(--muted);
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+}
+.changebar .counts { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
+.changebar .counts b { color: var(--fg); font-weight: 600; }
+.changebar .away { color: var(--note); }
+.changebar .scope { display: flex; gap: 0; margin-top: 7px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
+.changebar .scope a {
+ flex: 1; text-align: center; padding: 2px 4px;
+ font-size: 11px; color: var(--muted); text-decoration: none;
+}
+.changebar .scope a:hover { background: var(--hover); color: var(--fg); }
+.changebar .scope a.on { background: var(--hover); color: var(--fg); font-weight: 600; }
+.changebar .revjump { margin-top: 6px; }
+.changebar .revjump input { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
+.changebar .back { margin: 6px 0 0; font-size: 11px; }
+
+/* a note written at another change: it pins to line numbers that have moved */
+.note.away { border-style: dashed; opacity: 0.82; }
+.note.away:hover { opacity: 1; }
+.atchg.away { color: var(--note); }
+.atchg.away code { color: inherit; }
+.find, .filters input, .filters select, .notform input, .notform textarea, .jjform input, .thememenu input {
+ background: var(--bg); color: var(--fg);
+ border: 1px solid var(--border); border-radius: 5px;
+ font: inherit; font-size: 12px; padding: 3px 6px;
+}
+.find { width: 100%; margin-bottom: 6px; }
+.find:focus, .filters input:focus, .notform textarea:focus, .jjform input:focus {
+ outline: 1px solid var(--accent); border-color: var(--accent);
+}
+#tree.filtering a.file.hit { background: color-mix(in srgb, var(--accent) 14%, transparent); }
+nav details { padding-left: 10px; }
+nav summary { cursor: pointer; color: var(--muted); user-select: none; }
+nav summary:hover { color: var(--fg); }
+nav ul { list-style: none; margin: 0; padding-left: 10px; }
+nav a.file {
+ display: block; position: relative;
+ padding: 1px 6px 3px; border-radius: 4px;
+ color: var(--fg);
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
+}
+nav a.file:hover { background: var(--hover); text-decoration: none; }
+nav a.file[aria-current] { background: var(--hover); }
+nav a.file::after {
+ content: ""; position: absolute; left: 6px; bottom: 1px; height: 2px;
+ width: calc(var(--pct) - 12px); max-width: calc(100% - 12px);
+ background: var(--cov); border-radius: 1px;
+}
+nav a.file.has-notes::before { content: "◆ "; color: var(--note); font-size: 9px; vertical-align: 2px; }
+nav a.file.plain { color: var(--muted); }
+nav a.file.plain::after { display: none; }
+#tree { margin-top: 8px; }
+#tree > details { padding-left: 0; }
+summary .dot {
+ display: inline-block; width: 7px; height: 7px; border-radius: 99px;
+ background: var(--cov); margin-left: 6px;
+}
+summary .nmark { color: var(--note); font-size: 9px; margin-left: 4px; vertical-align: 1px; }
+nav details.t > summary, .filetree details.t > summary { color: var(--fg); }
+nav > footer {
+ margin-top: 14px; border-top: 1px solid var(--border); padding-top: 8px;
+ display: flex; justify-content: space-between; align-items: center; gap: 8px;
+}
+
+/* ── the theme picker ──────────────────────────────────────────
+ Every theme on the machine, previewed as you move through it. The
+ menu is fixed rather than absolute so the scrolling tree above it
+ cannot clip it. */
+#themebtn {
+ background: var(--panel); color: var(--muted);
+ border: 1px solid var(--border); border-radius: 4px;
+ font: inherit; font-size: 11px; padding: 1px 6px; cursor: pointer;
+ max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+}
+#themebtn:hover, #themebtn[aria-expanded="true"] { color: var(--fg); background: var(--hover); }
+.thememenu {
+ position: fixed; left: 8px; bottom: 8px; z-index: 20;
+ width: 264px; max-height: min(60vh, 520px);
+ display: flex; flex-direction: column; gap: 6px;
+ background: var(--panel); border: 1px solid var(--border);
+ border-radius: 7px; padding: 8px;
+ box-shadow: 0 8px 30px rgb(0 0 0 / 0.35);
+}
+.thememenu input { width: 100%; }
+.thememenu ul { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
+.thememenu li {
+ display: flex; align-items: center; gap: 7px;
+ padding: 3px 5px; border-radius: 4px; cursor: pointer;
+ font-size: 12px; color: var(--fg);
+}
+/* the menu is hidden until it is opened and the filter hides rows: both are
+ the hidden attribute, which a display of our own would otherwise outrank */
+.thememenu[hidden], .thememenu li[hidden] { display: none; }
+.thememenu li.on { background: var(--hover); }
+.thememenu li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.thememenu li .src { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
+.thememenu li.cur .nm::after { content: " ✓"; color: var(--accent); }
+.thememenu .sw { display: flex; flex: none; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
+.thememenu .sw i { display: block; width: 7px; height: 14px; }
+.thememenu .sw.none { width: 42px; border-color: transparent; }
+.thememenu .hint { margin: 0; font-size: 10px; }
+
+/* files.html full tree */
+.filetree { font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; padding-bottom: 40vh; }
+.filetree details { padding-left: 18px; }
+.filetree summary { cursor: pointer; color: var(--muted); }
+.filetree summary:hover { color: var(--fg); }
+.filetree ul { list-style: none; margin: 0; padding-left: 18px; }
+.filetree a.file { display: inline-block; position: relative; padding: 0 6px 2px; border-radius: 4px; color: var(--fg); }
+.filetree a.file.plain { color: var(--muted); }
+.filetree a.file:not(.plain)::after {
+ content: ""; position: absolute; left: 6px; bottom: 0; height: 2px;
+ width: calc(var(--pct) - 12px); max-width: calc(100% - 12px);
+ background: var(--cov); border-radius: 1px;
+}
+.filetree a.file.has-notes::before { content: "◆ "; color: var(--note); font-size: 9px; vertical-align: 2px; }
+.stub { padding: 24px 16px; }
+
+/* ── main ──────────────────────────────────────────────────── */
+main { min-width: 0; }
+.filehead {
+ position: sticky; top: 0; z-index: 2;
+ background: color-mix(in srgb, var(--bg) 88%, transparent);
+ backdrop-filter: blur(6px);
+ border-bottom: 1px solid var(--border);
+ padding: 10px 16px;
+}
+.meta { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
+.meta code { color: var(--fg); }
+.greps code { margin-right: 8px; }
+.chip {
+ display: inline-block; padding: 0 8px; border-radius: 99px;
+ background: color-mix(in srgb, var(--cov) 22%, transparent);
+ border: 1px solid var(--cov); color: var(--fg); font-size: 12px;
+}
+main > section, .notegroup { padding: 0 16px; max-width: 1100px; }
+table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
+th { text-align: left; color: var(--muted); font-weight: 500; }
+th, td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--border); }
+data.bar {
+ display: inline-block; min-width: 140px; padding-left: 4px;
+ font-size: 12px; color: var(--muted);
+ background: linear-gradient(90deg, color-mix(in srgb, var(--cov) 35%, transparent) var(--pct), transparent var(--pct));
+ border-radius: 3px;
+}
+
+/* ── code view ─────────────────────────────────────────────── */
+.codewrap { overflow-x: auto; }
+ol.code {
+ list-style: none; margin: 0; padding: 0;
+ font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
+ counter-reset: ln;
+ tab-size: 4;
+ content-visibility: auto;
+ contain-intrinsic-size: auto var(--h, auto);
+}
+ol.code:first-of-type { padding-top: 8px; }
+ol.code:last-of-type { padding-bottom: 40vh; }
+ol.code li {
+ counter-increment: ln;
+ white-space: pre;
+ min-height: 1lh;
+ padding-right: 16px;
+ /* a #L42 jump must clear the sticky header, or the line lands under it */
+ scroll-margin-top: 76px;
+}
+ol.code li::before {
+ content: counter(ln);
+ display: inline-block; width: 5ch; margin-right: 1.5ch;
+ text-align: right; color: var(--ln);
+ user-select: none;
+}
+ol.code li.cov { box-shadow: inset 3px 0 var(--cov); }
+ol.code li.cov::before { color: var(--cov); font-weight: 700; }
+ol.code li.noted { background: var(--note-bg); cursor: pointer; }
+ol.code li.noted::before { color: color-mix(in srgb, var(--note) 55%, var(--ln)); }
+ol.code li:target { background: color-mix(in srgb, var(--accent) 18%, transparent); }
+
+/* ── notes ─────────────────────────────────────────────────── */
+aside {
+ border-left: 1px solid var(--border);
+ background: var(--panel);
+ position: sticky; top: 0; height: 100vh; overflow: auto;
+ padding: 10px 12px; font-size: 13px;
+}
+aside summary { cursor: pointer; color: var(--muted); }
+.note {
+ border: 1px solid var(--border);
+ border-left: 3px solid var(--cov);
+ border-radius: 6px;
+ padding: 8px 10px; margin: 10px 0;
+ background: var(--bg);
+}
+.note header { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
+.note header a { font-family: ui-monospace, Menlo, monospace; }
+.note header em { color: var(--note); font-style: normal; border: 1px solid var(--note); border-radius: 3px; padding: 0 4px; font-size: 11px; }
+.note header b { margin-left: auto; color: var(--cov); font-weight: 600; }
+.note p { margin: 6px 0 0; line-height: 1.45; }
+.note.flash { animation: flash 1.2s ease-out; }
+
+/* A note body is markdown. It is prose about code inside a card that is
+ itself only ~320px wide in the columns, so every block here is tuned down
+ from document scale: headings barely outrank the text, rules and quotes are
+ hairlines, and nothing may push the card wider than its column. The
+ selectors carry .body so they outrank .turn p in the conversation view,
+ where notes are cards too. */
+.note .body > :first-child { margin-top: 6px; }
+.note .body p,
+.note .body ul, .note .body ol, .note .body blockquote,
+.note .body pre, .note .body table { margin: 6px 0 0; }
+.note .body p { line-height: 1.45; white-space: normal; }
+.note .body :is(h1, h2, h3, h4, h5, h6) {
+ margin: 10px 0 0; font-size: 1em; font-weight: 600; line-height: 1.3;
+}
+.note .body h1, .note .body h2 { color: var(--fg); font-size: 1.05em; }
+.note .body ul, .note .body ol { padding-left: 1.3em; }
+.note .body li { margin: 2px 0; line-height: 1.45; }
+.note .body li > p { margin: 0; }
+.note .body li::marker { color: var(--muted); }
+.note .body blockquote {
+ border-left: 2px solid var(--border); padding-left: 8px; color: var(--muted);
+}
+.note .body hr { border: none; border-top: 1px solid var(--border); margin: 10px 0 0; }
+.note .body code { background: var(--hover); border-radius: 3px; padding: 0 3px; }
+.note .body a { overflow-wrap: anywhere; }
+.note .body img { max-width: 100%; height: auto; }
+/* a fenced block: the code view's spans without its line-number scaffolding */
+.note .body pre.mdcode {
+ background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
+ padding: 6px 8px; overflow-x: auto;
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
+ line-height: 1.4; tab-size: 4;
+}
+.note .body pre.mdcode code { background: none; padding: 0; font-size: inherit; }
+.note .body table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.95em; }
+.note .body :is(th, td) { border: 1px solid var(--border); padding: 2px 6px; text-align: left; }
+.note .body th { color: var(--muted); font-weight: 600; }
+.note .body input[type="checkbox"] { margin-right: 4px; vertical-align: -1px; }
+@keyframes flash { 0% { background: color-mix(in srgb, var(--cov) 30%, var(--bg)); } 100% { background: var(--bg); } }
+
+.note footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 11px; }
+.note footer code { color: var(--muted); }
+.note .model { opacity: 0.85; }
+.note .conv { margin-left: auto; }
+.note .parent { color: var(--muted); }
+.note .relations {
+ color: var(--note); text-decoration: none;
+ background: var(--note-bg); border-radius: 3px; padding: 0 4px;
+}
+.note .relations:hover { color: var(--accent); text-decoration: underline; }
+.notecols { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 14px; }
+
+/* the permalink: the one link on a card that names nothing but the note, so
+ it is the one to hand someone else. Quiet until wanted. */
+.note .perma { color: var(--ln); font-variant-numeric: tabular-nums; text-decoration: none; }
+.note .perma:hover { color: var(--accent); text-decoration: underline; }
+.note .perma.self { color: var(--muted); }
+
+/* ── one note, on its own page ─────────────────────────────────
+ What a shared link opens: the note, then the lines it is about. Wider
+ than a card in a list — nothing is competing for the room here. */
+.notepage { padding-bottom: 30vh; }
+.notepage .onenote .note { margin: 0 0 14px; max-width: 760px; }
+.notepage .exhead { margin: 0 0 6px; }
+.notepage .excerpt { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
+.notepage .excerpt ol.code { padding: 6px 0; }
+.notepage .excerpt ol.code:last-of-type { padding-bottom: 6px; }
+.notepage .more { margin-top: 20px; }
+.filehead h1 .lns { color: var(--muted); font-weight: 400; }
+.filehead .kind { color: var(--note); font-style: normal; border: 1px solid var(--note); border-radius: 3px; padding: 0 4px; font-size: 11px; }
+.filehead .ago { color: var(--muted); }
+/* the excerpt exists to show what the note is about, so its lines stay
+ marked in either focus — the toggle is about reading a whole file */
+:root[data-mode="trace"] .excerpt ol.code li.noted { background: var(--note-bg); cursor: default; }
+:root[data-mode="trace"] .excerpt ol.code li.noted::before { color: color-mix(in srgb, var(--note) 55%, var(--ln)); }
+
+/* Incoming reply and mention edges share one recursively nested discussion.
+ The narrow rail is intentionally HN-like: enough hierarchy to scan without
+ turning the existing cards into a second design system. */
+.discussion { max-width: 820px; margin-top: 24px; scroll-margin-top: 16px; }
+.discussion h2 { margin-bottom: 6px; }
+.discussion h2 .meta { font-size: 11px; font-weight: 400; margin-left: 6px; }
+.threadnode {
+ display: grid; grid-template-columns: 20px minmax(0, 1fr);
+ align-items: stretch;
+}
+.threadedge { position: relative; color: var(--muted); text-align: center; font-size: 11px; }
+.threadedge::after {
+ content: ""; position: absolute; top: 20px; bottom: 0; left: 50%;
+ border-left: 1px solid var(--border);
+}
+.threadedge span { position: relative; z-index: 1; background: var(--bg); }
+.via-mention > .threadedge { color: var(--note); }
+.via-mention > .threadedge::after { border-left-style: dashed; border-left-color: var(--note); }
+.threadcontent { min-width: 0; }
+.threadcontent > .note { margin: 7px 0; }
+.threadchildren { min-width: 0; }
+.threadref {
+ margin: 8px 0; padding: 5px 8px; border: 1px dashed var(--border);
+ border-radius: 5px; background: var(--panel);
+}
+.replybox { max-width: 760px; margin: 4px 0 10px; }
+.replybox > summary { cursor: pointer; color: var(--muted); font-size: 11px; }
+.replybox[open] > summary { color: var(--accent); }
+.replyform { margin: 5px 0 10px; padding-left: 8px; border-left: 2px solid var(--border); }
+.replyform textarea { width: 100%; box-sizing: border-box; }
+.threadnode .replybox { margin-left: 1px; }
+
+/* ── conversation ──────────────────────────────────────────── */
+.convpage { padding: 0 16px 40vh; max-width: 1100px; }
+.turn {
+ display: grid; grid-template-columns: 12ch 8ch minmax(0, 1fr);
+ gap: 0 10px; align-items: baseline;
+ padding: 2px 0 2px 8px; border-left: 2px solid transparent;
+}
+.turn .role {
+ color: var(--muted); font-size: 11px; text-align: right;
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+}
+.turn time { color: var(--ln); font-size: 11px; font-variant-numeric: tabular-nums; }
+.turn p { margin: 0; line-height: 1.5; white-space: pre-wrap; }
+.turn .what {
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+}
+.t-say { padding: 8px 0 8px 8px; }
+.t-user { border-left-color: var(--accent); }
+.t-user .role, .t-user p { color: var(--fg); }
+.t-assistant .role { color: var(--cov); }
+.t-thinking p { color: var(--muted); font-style: italic; }
+.t-tool .role { color: var(--note); }
+.t-result .what { color: var(--muted); }
+.t-result.bad .what { color: var(--note); }
+.t-notevi { border-left-color: var(--cov); background: color-mix(in srgb, var(--cov) 7%, transparent); }
+.t-notevi .role { color: var(--cov); font-weight: 600; }
+/* A note is what you came to the conversation to find, so it breaks the run
+ of log lines: the note color's rail, a tinted band, a card instead of a
+ line. scroll-margin clears the sticky header — the anchored one is
+ scrolled to on load. */
+.t-note {
+ padding: 8px 0 8px 8px;
+ border-left-color: var(--note);
+ background: color-mix(in srgb, var(--note) 7%, transparent);
+}
+.t-note .role { color: var(--note); font-weight: 600; }
+.t-note .role::before { content: "◆ "; font-size: 9px; vertical-align: 1px; }
+.t-note .note { max-width: 640px; margin: 0; scroll-margin-top: 96px; }
+.t-note.here { background: color-mix(in srgb, var(--accent) 12%, transparent); }
+.t-note.here .note { border-color: var(--accent); border-left-color: var(--accent); }
+/* the whole card is the way back to the code; the links inside still work */
+.notewrap { cursor: pointer; }
+.notewrap:hover .note, .notewrap:focus-visible .note {
+ border-color: var(--accent); background: var(--hover);
+}
+.notewrap:focus-visible { outline: none; }
+.notewrap[data-href] .note::after {
+ content: "open in source →"; display: block;
+ margin-top: 6px; color: var(--accent); font-size: 11px; opacity: 0;
+}
+.notewrap:hover .note::after, .notewrap:focus-visible .note::after { opacity: 1; }
+
+/* ── live activity ─────────────────────────────────────────── */
+.activity { margin-bottom: 10px; }
+.actlist { display: flex; flex-direction: column; gap: 3px; }
+.act {
+ display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
+ gap: 6px; align-items: baseline; font-size: 11px; color: var(--muted);
+ opacity: 0.55;
+}
+.act.on { opacity: 1; }
+.act .what, .acttable .what {
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+ font-family: ui-monospace, Menlo, monospace;
+}
+.acttable tr.on td { color: var(--fg); }
+.acttable .pulse { color: var(--accent); font-size: 9px; margin-left: 5px; animation: pulse 2s ease-in-out infinite; }
+@keyframes pulse { 50% { opacity: 0.25; } }
+.acttable .dir { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+
+/* ── filters / forms ───────────────────────────────────────── */
+.filters {
+ display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
+ padding: 10px 0; position: sticky; top: 0; z-index: 1;
+ background: var(--bg);
+}
+.filters input[type="search"] { min-width: 15ch; flex: 1 1 18ch; }
+.filters .dates { display: flex; gap: 6px; align-items: center; }
+.filters .datef { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
+.filters button, .jjform button, .notform button {
+ background: var(--panel); color: var(--fg);
+ border: 1px solid var(--border); border-radius: 5px;
+ font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer;
+}
+.filters button:hover, .jjform button:hover, .notform button:hover { background: var(--hover); }
+.count { margin: 0 0 8px; }
+.busy { visibility: hidden; color: var(--accent); margin-right: 6px; }
+.busy.htmx-request { visibility: visible; animation: pulse 1s linear infinite; }
+.notespage, .jjpage { padding: 0 16px 40vh; max-width: 1100px; }
+.err {
+ margin: 12px 16px; padding: 8px 10px; border-radius: 6px;
+ border: 1px solid var(--note); color: var(--note);
+ font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; white-space: pre-wrap;
+}
+
+/* ── add a note ────────────────────────────────────────────── */
+.addnote { margin: 10px 0; }
+.addnote > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
+.notform { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
+.notform .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
+.notform .row.end { justify-content: space-between; }
+.notform input[type="number"] { width: 8ch; }
+.notform textarea { resize: vertical; font-family: inherit; }
+.notform .on code { color: var(--fg); }
+.asidehead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
+aside .meta { font-size: 11px; }
+
+/* lines picked to comment on, and lines you arrived at from a note */
+ol.code li.sel, ol.code li.focus { background: color-mix(in srgb, var(--accent) 16%, transparent); }
+ol.code li.sel::before, ol.code li.focus::before { color: var(--accent); }
+ol.code li.focus { box-shadow: inset 3px 0 var(--accent); }
+
+/* ── jj ────────────────────────────────────────────────────── */
+.jjform { display: flex; gap: 6px; align-items: center; padding: 10px 0; }
+.jjform input[type="search"] { flex: 1; font-family: ui-monospace, Menlo, monospace; }
+.jjform input[type="number"] { width: 8ch; }
+.jjlog { font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
+.jjrow { display: flex; gap: 8px; align-items: baseline; white-space: pre; }
+.jjrow:hover { background: var(--hover); }
+.jjrow .graph { color: var(--muted); white-space: pre; }
+.jjrow .id { font-weight: 600; }
+.jjrow .commit { color: var(--muted); }
+.jjrow .when, .jjrow .who { color: var(--muted); }
+.jjrow .refs { color: var(--note); }
+.jjrow .flags { color: var(--note); font-style: italic; }
+.jjrow .desc { color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
+.jjrow.blank { color: var(--muted); }
+pre.desc {
+ margin: 0 0 12px; padding: 10px 12px; border-radius: 6px;
+ border: 1px solid var(--border); background: var(--panel);
+ font: 12.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap;
+}
+table.changed { width: auto; }
+table.changed td { border: none; padding: 1px 12px 1px 0; }
+table.changed .st { color: var(--muted); font-size: 11px; width: 7ch; }
+table.changed .st-added { color: var(--accent); }
+table.changed .st-deleted { color: var(--note); }
+
+/* ── project hub ───────────────────────────────────────────── */
+.projects-main { padding-bottom: 20vh; }
+.projects-main > section { max-width: 1200px; }
+.project-refresh { margin: 10px 0; }
+.project-refresh button, .project-card button, .project-action {
+ display: inline-block; background: var(--panel); color: var(--fg);
+ border: 1px solid var(--border); border-radius: 5px;
+ font: inherit; font-size: 12px; padding: 5px 10px; cursor: pointer;
+}
+.project-refresh button:hover, .project-card button:hover, .project-action:hover {
+ background: var(--hover); text-decoration: none;
+}
+.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
+.project-card { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); }
+.project-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
+.project-card h3 { min-width: 0; margin: 0; font: 600 14px/1.3 ui-monospace, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; }
+.project-path { margin: 8px 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.project-state { flex: none; padding: 1px 6px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
+.project-state.active { border-color: var(--accent); color: var(--accent); }
+.project-state.git { color: var(--note); }
+.project-card form, .project-card .project-action { margin-top: 10px; }
+.project-message { max-width: 1168px; }
+.ok { margin: 12px 16px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); }
+.project-card[hidden] { display: none; }
+
+/* ── agent coverage colors ──────────────────────────────────
+ A bitmask is its agents' colors averaged. The blend is left to the
+ browser so these rules hold for any theme: a theme only has to name
+ --ag0..7, which every theme in themes.css does. */
+{{range .Masks}}.am{{.Mask}} { --cov: {{.Mix}}; }
+{{end}}
+/* ── syntax (theme colors, italics and weights are vars too, so
+ switching theme switches those with the colors) ─────────── */
+{{range .Syntax}}.s-{{.Class}} { color: var(--s-{{.Class}}, inherit); font-style: var(--s-{{.Class}}-fs, inherit); font-weight: var(--s-{{.Class}}-fw, inherit); }
+{{end}}
+@media (max-width: 1100px) {
+ body, body.with-aside { grid-template-columns: 1fr; }
+ nav, aside { position: static; height: auto; border: none; border-bottom: 1px solid var(--border); }
+}
+@media (max-width: 620px) {
+ .threadnode { grid-template-columns: 14px minmax(0, 1fr); }
+ .discussion h2 .meta { display: block; margin: 2px 0 0; }
+ .replyform { padding-left: 5px; }
+}
diff --git a/web/assets/typescript.scm b/web/assets/typescript.scm
new file mode 100644
index 0000000..96cf9c3
--- /dev/null
+++ b/web/assets/typescript.scm
@@ -0,0 +1,15 @@
+; TypeScript highlights, from tree-sitter/tree-sitter-typescript v0.23.2
+; queries/highlights.scm (MIT). A supplement loaded after javascript.scm, as
+; upstream composes it, so these patterns win. Upstream's
+; ((identifier) @type (#match? "^[A-Z]")) is dropped: javascript.scm already
+; paints capitalized identifiers as @constructor, and repainting every one of
+; them as a type costs a second regex per identifier for a worse answer.
+
+["abstract" "declare" "enum" "implements" "interface" "keyof" "namespace"
+ "private" "protected" "public" "type" "readonly" "override"
+ "satisfies"] @keyword
+
+[(type_identifier) (predefined_type)] @type
+(type_arguments "<" @punctuation.bracket ">" @punctuation.bracket)
+(required_parameter (identifier) @variable.parameter)
+(optional_parameter (identifier) @variable.parameter)
diff --git a/web/assets/zig.scm b/web/assets/zig.scm
new file mode 100644
index 0000000..a85383a
--- /dev/null
+++ b/web/assets/zig.scm
@@ -0,0 +1,65 @@
+; Zig highlights, from tree-sitter-grammars/tree-sitter-zig v1.1.2
+; queries/highlights.scm (MIT). Reordered for later-patterns-win, capture names
+; mapped onto zed syntax keys — upstream's keyword.* split collapses to
+; @keyword, which zed themes colour as one — and the #lua-match? identifier
+; heuristics rewritten as #match?, which this engine evaluates.
+
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+(payload "|" @punctuation.bracket)
+[";" "," "." ":" "=>" "->"] @punctuation.delimiter
+["=" "==" "!=" "<" ">" "<=" ">=" "+" "+%" "+|" "-" "-%" "-|" "*" "*%" "*|"
+ "**" "/" "%" "&" "|" "^" "~" "!" "||" "<<" "<<|" ">>" ".." ".*" ".?" "?"
+ "+=" "+%=" "+|=" "-=" "-%=" "-|=" "*=" "*%=" "*|=" "/=" "%=" "&=" "|=" "^="
+ "<<=" "<<|=" ">>="] @operator
+
+["addrspace" "align" "allowzero" "and" "asm" "async" "await" "break"
+ "callconv" "catch" "comptime" "const" "continue" "defer" "else" "enum"
+ "errdefer" "error" "export" "extern" "fn" "for" "if" "inline" "linksection"
+ "noalias" "noinline" "nosuspend" "opaque" "or" "orelse" "packed" "pub"
+ "resume" "return" "struct" "suspend" "switch" "test" "threadlocal" "try"
+ "union" "usingnamespace" "var" "volatile" "while"] @keyword
+
+(builtin_type) @type
+["anyframe" "anytype"] @type
+(parameter type: (identifier) @type)
+(variable_declaration (identifier) @type "="
+ [(struct_declaration) (enum_declaration) (union_declaration)
+ (opaque_declaration)])
+
+["null" "undefined" "unreachable"] @constant
+(boolean) @constant
+; an enum literal — .ok — is a member with nothing to its left
+(field_expression . member: (identifier) @constant)
+(enum_declaration (container_field type: (identifier) @constant))
+
+(container_field name: (identifier) @property)
+(field_initializer . (identifier) @property)
+(field_expression (_) member: (identifier) @property)
+; .x = 1 inside a Point{...} is a field, not the enum literal above
+(initializer_list
+ (assignment_expression
+ left: (field_expression . member: (identifier) @property)))
+(parameter name: (identifier) @variable.parameter)
+(block_label (identifier) @label)
+(break_label (identifier) @label)
+
+(function_declaration name: (identifier) @function)
+(call_expression function: (identifier) @function)
+(call_expression function: (field_expression member: (identifier) @function.method))
+(builtin_identifier) @function.builtin
+
+; Zig has no type-identifier node, only the TitleCase convention, and these
+; land after the call patterns so that the convention wins the way upstream's
+; first-pattern-wins order has it: std.ArrayList(u8) is a type, not a call.
+((identifier) @type
+ (#match? @type "^[A-Z][a-zA-Z0-9_]*$"))
+((identifier) @constant
+ (#match? @constant "^[A-Z][A-Z0-9_]+$"))
+
+[(integer) (float)] @number
+[(string) (multiline_string) (character)] @string
+(escape_sequence) @string.escape
+
+(comment) @comment
+((comment) @comment.doc
+ (#match? @comment.doc "^//[/!]"))