@peasant-labs/fairtrade 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { Fragment as e, useCallback as t, useEffect as n, useId as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
2
2
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
- import { Check as d, ChevronDown as f, ChevronLeft as p, ChevronRight as m, Eye as h, EyeOff as g, FileCode as _, Folder as v, GitMerge as y, Maximize as ee, Minus as b, Plus as x, ScrollText as te, Search as ne, Star as re, TriangleAlert as ie, Users as ae, Waypoints as oe } from "lucide-react";
3
+ import { Check as d, ChevronDown as f, ChevronLeft as p, ChevronRight as m, Eye as h, EyeOff as g, FileCode as ee, Folder as _, GitMerge as v, Maximize as te, Minus as y, Plus as b, ScrollText as x, Search as ne, Star as re, TriangleAlert as ie, Users as ae, Waypoints as oe } from "lucide-react";
4
4
  import { AllChangeBindings as se, AllDiffLineKinds as S, AllEdgeViolationKinds as ce, AllFileChangeStatuses as le, AllInsightKinds as ue, AllInsightProvenances as de, AllMapNodeKinds as C, AllReadAttributionStates as fe, AllReadStateGrades as w, Harness as T, isChangeBinding as E, isDiffLineKind as pe, isEdgeViolationKind as D, isFileChangeStatus as me, isHarness as he, isInsightKind as ge, isInsightProvenance as _e, isMapNodeKind as ve, isReadAttributionState as ye, isReadStateGrade as be } from "@peasant-labs/schema";
5
5
  //#region src/ui/BrandMark.jsx
6
6
  var xe = {
@@ -8,8 +8,9 @@ var xe = {
8
8
  gemini: "M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",
9
9
  openai: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",
10
10
  opencode: "M22 24H2V0h20zM17 4.8H7v14.4h10z",
11
- cursor: "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"
12
- }, O = {
11
+ cursor: "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",
12
+ strike: "M18.5 6L11 17.5h5.2L13.5 26 21 14.5h-5.2L18.5 6z"
13
+ }, O = { strike: "6 6 20 20" }, Se = {
13
14
  anthropic: "claude",
14
15
  "claude-code": "claude",
15
16
  google: "gemini",
@@ -19,20 +20,21 @@ var xe = {
19
20
  "codex-cli": "openai",
20
21
  chatgpt: "openai",
21
22
  gpt: "openai"
22
- }, Se = {
23
+ }, Ce = {
23
24
  claude: "Claude",
24
25
  gemini: "Gemini",
25
26
  openai: "OpenAI",
26
27
  cursor: "Cursor",
27
- opencode: "opencode"
28
+ opencode: "opencode",
29
+ strike: "Strike"
28
30
  };
29
- function Ce(e) {
31
+ function we(e) {
30
32
  if (!e) return null;
31
- let t = String(e).toLowerCase().trim(), n = O[t] || t;
33
+ let t = String(e).toLowerCase().trim(), n = Se[t] || t;
32
34
  return xe[n] ? n : null;
33
35
  }
34
- function we({ name: e, size: t, label: n, className: r = "", ...i }) {
35
- let a = Ce(e);
36
+ function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
37
+ let a = we(e);
36
38
  if (!a) return null;
37
39
  let o = ["brand", r].filter(Boolean).join(" "), s = t == null ? {} : {
38
40
  width: t,
@@ -43,7 +45,7 @@ function we({ name: e, size: t, label: n, className: r = "", ...i }) {
43
45
  }
44
46
  }, c = n ? {
45
47
  role: "img",
46
- "aria-label": n === !0 ? Se[a] : n,
48
+ "aria-label": n === !0 ? Ce[a] : n,
47
49
  focusable: "false"
48
50
  } : {
49
51
  "aria-hidden": "true",
@@ -51,38 +53,42 @@ function we({ name: e, size: t, label: n, className: r = "", ...i }) {
51
53
  };
52
54
  return /* @__PURE__ */ l("svg", {
53
55
  className: o,
54
- viewBox: "0 0 24 24",
56
+ viewBox: O[a] ?? "0 0 24 24",
55
57
  ...s,
56
58
  ...c,
57
59
  ...i,
60
+ "data-brand": a,
58
61
  children: /* @__PURE__ */ l("path", { d: xe[a] })
59
62
  });
60
63
  }
61
64
  //#endregion
62
65
  //#region src/ui/provider-policy.js
63
- var Te = Object.freeze(Object.values(T)), Ee = Object.freeze({
66
+ var Ee = Object.freeze(Object.values(T)), De = Object.freeze({
64
67
  "claude-code": "Claude Code",
65
68
  "gemini-cli": "Gemini CLI",
66
69
  codex: "Codex",
67
70
  opencode: "opencode",
68
71
  cursor: "Cursor",
69
- antigravity: "Google Antigravity"
70
- }), De = Object.freeze({
72
+ antigravity: "Google Antigravity",
73
+ strike: "Strike"
74
+ }), Oe = Object.freeze({
71
75
  "claude-code": "claude",
72
76
  "gemini-cli": "gemini",
73
77
  codex: "openai",
74
78
  opencode: "opencode",
75
79
  cursor: "cursor",
76
- antigravity: "gemini"
77
- }), Oe = Object.freeze({
80
+ antigravity: "gemini",
81
+ strike: "strike"
82
+ }), ke = Object.freeze({
78
83
  "claude-code": "amber",
79
84
  "gemini-cli": "teal",
80
85
  codex: "olive",
81
86
  opencode: "mauve",
82
87
  cursor: "clay",
83
- antigravity: "teal"
88
+ antigravity: "teal",
89
+ strike: "clay"
84
90
  });
85
- function ke(e, t) {
91
+ function k(e, t) {
86
92
  if (he(e)) return;
87
93
  let n;
88
94
  try {
@@ -90,20 +96,20 @@ function ke(e, t) {
90
96
  } catch {
91
97
  n = String(e);
92
98
  }
93
- throw TypeError(`Provider harness validation failed for ${n} at src/ui/provider-policy.js during ${t}: the value is outside the canonical @peasant-labs/schema Harness, so Fairtrade cannot select a trustworthy provider identity; the caller must validate its wire boundary and pass one of ${Te.join(", ")}.`);
99
+ throw TypeError(`Provider harness validation failed for ${n} at src/ui/provider-policy.js during ${t}: the value is outside the canonical @peasant-labs/schema Harness, so Fairtrade cannot select a trustworthy provider identity; the caller must validate its wire boundary and pass one of ${Ee.join(", ")}.`);
94
100
  }
95
- function Ae(e) {
96
- return ke(e, "provider display-name resolution"), Ee[e];
101
+ function A(e) {
102
+ return k(e, "provider display-name resolution"), De[e];
97
103
  }
98
- function k(e) {
99
- return ke(e, "provider brand resolution"), De[e];
104
+ function j(e) {
105
+ return k(e, "provider brand resolution"), Oe[e];
100
106
  }
101
- function A(e) {
102
- return ke(e, "provider accent resolution"), Oe[e];
107
+ function M(e) {
108
+ return k(e, "provider accent resolution"), ke[e];
103
109
  }
104
110
  //#endregion
105
111
  //#region src/ui/Intensity.jsx
106
- function j(e) {
112
+ function Ae(e) {
107
113
  let t = Math.round(Number(e) || 0);
108
114
  return Math.max(0, Math.min(4, t));
109
115
  }
@@ -133,8 +139,8 @@ var Fe = [
133
139
  "most",
134
140
  "full"
135
141
  ];
136
- function Ie({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...a }) {
137
- let o = j(e);
142
+ function N({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...a }) {
143
+ let o = Ae(e);
138
144
  return /* @__PURE__ */ l("span", {
139
145
  className: `ir-swatch${n === "lg" ? " ir-swatch--lg" : ""}${i ? ` ${i}` : ""}`,
140
146
  "data-level": o,
@@ -144,7 +150,7 @@ function Ie({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...
144
150
  ...a
145
151
  });
146
152
  }
147
- function M({ title: e = "coverage", words: t = Fe, className: n = "" }) {
153
+ function Ie({ title: e = "coverage", words: t = Fe, className: n = "" }) {
148
154
  return /* @__PURE__ */ u("div", {
149
155
  className: `ir-scope ir-legend${n ? ` ${n}` : ""}`,
150
156
  children: [
@@ -187,7 +193,7 @@ function M({ title: e = "coverage", words: t = Fe, className: n = "" }) {
187
193
  });
188
194
  }
189
195
  function Le({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity heatmap", className: a = "" }) {
190
- let o = t ? t.map(j) : (e || []).map((t) => Ne(t, n ?? Math.max(1, ...e || [1])));
196
+ let o = t ? t.map(Ae) : (e || []).map((t) => Ne(t, n ?? Math.max(1, ...e || [1])));
191
197
  return /* @__PURE__ */ l("div", {
192
198
  className: `ir-scope ir-heatmap${a ? ` ${a}` : ""}`,
193
199
  role: "img",
@@ -200,20 +206,20 @@ function Le({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity
200
206
  });
201
207
  }
202
208
  function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected: a = !1, violation: o = 0, effortPct: s, size: c, as: f = "button", onClick: p, className: m = "", ...h }) {
203
- let g = i == null ? j(n) : je(r ?? 0, i), _ = c || Pe(t), v = Math.max(0, Math.round(Number(o) || 0)), y = s != null && s > 0, ee = y ? Me(s > 1 ? s / 100 : s) : 0, b = [
209
+ let g = i == null ? Ae(n) : je(r ?? 0, i), ee = c || Pe(t), _ = Math.max(0, Math.round(Number(o) || 0)), v = s != null && s > 0, te = v ? Me(s > 1 ? s / 100 : s) : 0, y = [
204
210
  e,
205
211
  i == null ? `coverage ${g} of 4` : `${r ?? 0} of ${i} recorded`,
206
212
  t == null ? null : `${t} loc`,
207
- v > 0 ? `${v} violation${v === 1 ? "" : "s"}` : null,
213
+ _ > 0 ? `${_} violation${_ === 1 ? "" : "s"}` : null,
208
214
  a ? "selected" : null
209
- ].filter(Boolean).join(" · "), x = f, te = x === "button";
210
- return /* @__PURE__ */ u(x, {
211
- className: `ir-node ir-node--${_}${m ? ` ${m}` : ""}`,
215
+ ].filter(Boolean).join(" · "), b = f, x = b === "button";
216
+ return /* @__PURE__ */ u(b, {
217
+ className: `ir-node ir-node--${ee}${m ? ` ${m}` : ""}`,
212
218
  "data-coverage": g,
213
219
  "data-selected": a ? "true" : void 0,
214
- type: te ? "button" : void 0,
215
- "aria-pressed": te ? a : void 0,
216
- "aria-label": b,
220
+ type: x ? "button" : void 0,
221
+ "aria-pressed": x ? a : void 0,
222
+ "aria-label": y,
217
223
  onClick: p,
218
224
  ...h,
219
225
  children: [
@@ -222,12 +228,12 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
222
228
  children: [/* @__PURE__ */ l("span", {
223
229
  className: "ir-node__label",
224
230
  children: e
225
- }), v > 0 && /* @__PURE__ */ u("span", {
231
+ }), _ > 0 && /* @__PURE__ */ u("span", {
226
232
  className: "ir-node__badge",
227
233
  "aria-hidden": "true",
228
234
  children: [/* @__PURE__ */ l(ie, { "aria-hidden": "true" }), /* @__PURE__ */ l("span", {
229
235
  className: "tnum",
230
- children: v
236
+ children: _
231
237
  })]
232
238
  })]
233
239
  }),
@@ -240,9 +246,9 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
240
246
  "aria-hidden": "true",
241
247
  children: /* @__PURE__ */ l(d, { "aria-hidden": "true" })
242
248
  }),
243
- y && /* @__PURE__ */ l("span", {
249
+ v && /* @__PURE__ */ l("span", {
244
250
  className: "ir-node__effort",
245
- "data-level": ee,
251
+ "data-level": te,
246
252
  "aria-hidden": "true"
247
253
  })
248
254
  ]
@@ -257,29 +263,29 @@ function ze({ children: e, className: t = "", ...n }) {
257
263
  }
258
264
  //#endregion
259
265
  //#region src/ui/ProviderIcon.jsx
260
- var Be = Te, Ve = Oe;
261
- function N(e) {
262
- return `var(--${A(e)})`;
266
+ var Be = Ee, P = ke;
267
+ function F(e) {
268
+ return `var(--${M(e)})`;
263
269
  }
264
- function P({ harness: e, size: t, accent: n = !1, label: r, className: i = "", ...a }) {
265
- ke(e, "ProviderIcon render in src/ui/ProviderIcon.jsx");
266
- let o = k(e), s = ["pv-icon", i].filter(Boolean).join(" "), c = n ? { color: N(e) } : void 0, u = r === !0 ? Ae(e) : r;
270
+ function I({ harness: e, size: t, accent: n = !1, label: r, className: i = "", ...a }) {
271
+ k(e, "ProviderIcon render in src/ui/ProviderIcon.jsx");
272
+ let o = j(e), s = ["pv-icon", i].filter(Boolean).join(" "), c = n ? { color: F(e) } : void 0, u = r === !0 ? A(e) : r;
267
273
  return /* @__PURE__ */ l("span", {
268
274
  className: s,
269
275
  style: c,
270
276
  ...a,
271
- children: /* @__PURE__ */ l(we, {
277
+ children: /* @__PURE__ */ l(Te, {
272
278
  name: o,
273
279
  size: t,
274
280
  label: u
275
281
  })
276
282
  });
277
283
  }
278
- function F({ harness: e, accent: t = !1, className: n = "", ...r }) {
279
- return ke(e, "ProviderTag render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
284
+ function Ve({ harness: e, accent: t = !1, className: n = "", ...r }) {
285
+ return k(e, "ProviderTag render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
280
286
  className: ["pv-tag", n].filter(Boolean).join(" "),
281
287
  ...r,
282
- children: [/* @__PURE__ */ l(P, {
288
+ children: [/* @__PURE__ */ l(I, {
283
289
  harness: e,
284
290
  accent: t
285
291
  }), /* @__PURE__ */ l("span", {
@@ -288,27 +294,27 @@ function F({ harness: e, accent: t = !1, className: n = "", ...r }) {
288
294
  })]
289
295
  });
290
296
  }
291
- function I({ harness: e, accent: t = !1, className: n = "", ...r }) {
292
- return ke(e, "ProviderName render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
297
+ function L({ harness: e, accent: t = !1, className: n = "", ...r }) {
298
+ return k(e, "ProviderName render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
293
299
  className: ["pv-name", n].filter(Boolean).join(" "),
294
- style: t ? { color: N(e) } : void 0,
300
+ style: t ? { color: F(e) } : void 0,
295
301
  ...r,
296
- children: [/* @__PURE__ */ l(P, { harness: e }), /* @__PURE__ */ l("span", {
302
+ children: [/* @__PURE__ */ l(I, { harness: e }), /* @__PURE__ */ l("span", {
297
303
  className: "pv-name-label",
298
304
  children: e
299
305
  })]
300
306
  });
301
307
  }
302
- function L({ className: e = "", ...t }) {
308
+ function R({ className: e = "", ...t }) {
303
309
  return /* @__PURE__ */ l("ul", {
304
310
  className: ["pv-legend", e].filter(Boolean).join(" "),
305
311
  ...t,
306
312
  children: Be.map((e) => {
307
- let t = A(e);
313
+ let t = M(e);
308
314
  return /* @__PURE__ */ u("li", {
309
315
  className: "pv-legend-row",
310
316
  children: [
311
- /* @__PURE__ */ l(P, {
317
+ /* @__PURE__ */ l(I, {
312
318
  harness: e,
313
319
  accent: !0,
314
320
  className: "pv-legend-mark"
@@ -333,7 +339,7 @@ function L({ className: e = "", ...t }) {
333
339
  }
334
340
  //#endregion
335
341
  //#region src/ui/graph/GhostCommitNode.jsx
336
- var R = Object.freeze({
342
+ var He = Object.freeze({
337
343
  hash: "matched by hash",
338
344
  patch_id: "matched by patch content",
339
345
  author_identity: "matched by author and time",
@@ -341,8 +347,8 @@ var R = Object.freeze({
341
347
  temporal: "matched by nearby time only",
342
348
  none: "no match found"
343
349
  });
344
- function He({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i, className: a = "", ...o }) {
345
- let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${R[r] ?? r}, ${i} confidence`;
350
+ function Ue({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i, className: a = "", ...o }) {
351
+ let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${He[r] ?? r}, ${i} confidence`;
346
352
  return /* @__PURE__ */ l("span", {
347
353
  className: `tlp-ghost-node tlp-terminal-${i}${a ? ` ${a}` : ""}`,
348
354
  role: "img",
@@ -367,7 +373,7 @@ function He({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i,
367
373
  }
368
374
  //#endregion
369
375
  //#region src/ui/graph/SessionLane.jsx
370
- function Ue({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i = !1, onHover: a, onSelect: o, unresolvedGhosts: s = [], className: c = "", ...d }) {
376
+ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i = !1, onHover: a, onSelect: o, unresolvedGhosts: s = [], className: c = "", ...d }) {
371
377
  let f = [
372
378
  "tlp-session-lane",
373
379
  r && "tlp-session-lane-hover",
@@ -387,7 +393,7 @@ function Ue({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
387
393
  onClick: () => o?.(e),
388
394
  ...d,
389
395
  children: [
390
- n && /* @__PURE__ */ l(P, {
396
+ n && /* @__PURE__ */ l(I, {
391
397
  harness: n,
392
398
  label: !0
393
399
  }),
@@ -406,7 +412,7 @@ function Ue({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
406
412
  className: "tlp-session-lane-ghosts",
407
413
  role: "group",
408
414
  "aria-label": "session-era commits with no recorded mapping",
409
- children: s.map((e) => /* @__PURE__ */ l(He, {
415
+ children: s.map((e) => /* @__PURE__ */ l(Ue, {
410
416
  ghostHash: e.ghostHash,
411
417
  subject: e.subject,
412
418
  resolution: e.resolution,
@@ -418,7 +424,7 @@ function Ue({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
418
424
  }
419
425
  //#endregion
420
426
  //#region src/ui/graph/GhostGroup.jsx
421
- function z({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i = "", ...a }) {
427
+ function We({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i = "", ...a }) {
422
428
  let o = `${t.length} session-era commit${t.length === 1 ? "" : "s"}`;
423
429
  return /* @__PURE__ */ u("div", {
424
430
  className: `tlp-ghost-group${i ? ` ${i}` : ""}`,
@@ -467,7 +473,7 @@ function z({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i
467
473
  ]
468
474
  }), n && /* @__PURE__ */ l("ul", {
469
475
  className: "tlp-ghost-group-list",
470
- children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(He, {
476
+ children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(Ue, {
471
477
  ghostHash: e.ghostHash,
472
478
  subject: e.subject,
473
479
  resolution: e.resolution,
@@ -482,7 +488,7 @@ function z({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i
482
488
  }
483
489
  //#endregion
484
490
  //#region src/ui/graph/SessionOverflowDisclosure.jsx
485
- function We({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i, itemLabel: a = "sessions", className: o = "", ...s }) {
491
+ function B({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i, itemLabel: a = "sessions", className: o = "", ...s }) {
486
492
  return t.length === 0 ? null : /* @__PURE__ */ u("span", {
487
493
  className: `tlp-overflow${o ? ` ${o}` : ""}`,
488
494
  ...s,
@@ -517,7 +523,7 @@ function We({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
517
523
  className: "tlp-overflow-item",
518
524
  "data-session-id": e.sessionId,
519
525
  onClick: () => i?.(e.sessionId),
520
- children: [e.harness && /* @__PURE__ */ l(P, {
526
+ children: [e.harness && /* @__PURE__ */ l(I, {
521
527
  harness: e.harness,
522
528
  label: !0
523
529
  }), e.title || e.sessionId]
@@ -528,7 +534,7 @@ function We({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
528
534
  }
529
535
  //#endregion
530
536
  //#region src/ui/graph/HighlightEdge.jsx
531
- function B({ weight: e, geometry: t, className: n = "", ...r }) {
537
+ function V({ weight: e, geometry: t, className: n = "", ...r }) {
532
538
  return /* @__PURE__ */ l("line", {
533
539
  className: [
534
540
  "tlp-highlight-edge",
@@ -545,9 +551,9 @@ function B({ weight: e, geometry: t, className: n = "", ...r }) {
545
551
  }
546
552
  //#endregion
547
553
  //#region src/ui/graph/TouchedFileCluster.jsx
548
- var V = 8;
549
- function H({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, className: a = "", ...o }) {
550
- let s = t.slice(0, V), c = t.slice(V).map((e) => ({
554
+ var H = 8;
555
+ function U({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, className: a = "", ...o }) {
556
+ let s = t.slice(0, H), c = t.slice(H).map((e) => ({
551
557
  sessionId: e,
552
558
  title: e
553
559
  }));
@@ -561,7 +567,7 @@ function H({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
561
567
  className: "tlp-file-cluster-item",
562
568
  onClick: () => i?.(e),
563
569
  children: e
564
- }, e)), /* @__PURE__ */ l(We, {
570
+ }, e)), /* @__PURE__ */ l(B, {
565
571
  commitHash: e,
566
572
  overflow: c,
567
573
  expanded: n,
@@ -573,9 +579,9 @@ function H({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
573
579
  }
574
580
  //#endregion
575
581
  //#region src/ui/CommitGraph.jsx
576
- var U = 14, Ge = 9, Ke = 7, qe = 9, Je = "3 3", W = (e) => Ge + e * U, Ye = (e) => W(Math.max(e - 1, 0)) + Ke;
577
- function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpenSession: c, hasMore: d = !1, onShowOlder: p, label: m = "commit history", className: h = "", sessionLanes: g, hoveredSessionId: _ = null, selectedSessionId: v = null, onHoverSession: y, onSelectSession: ee, highlightSelected: b, highlightHovered: x, ghostGroupsByCommit: te, expandedGhostGroups: ne, onToggleGhostGroup: re, expandedCommitSessions: ie, onToggleCommitSessions: ae, touchedFilesByCommit: oe, onOpenTouchedFile: se, ...S }) {
578
- let ce = a(() => new Set(ne ?? []), [ne]), le = a(() => new Set(ie ?? []), [ie]), ue = a(() => /* @__PURE__ */ new Set([...b?.commitHashes ?? [], ...b?.ghostHashes ?? []]), [b]), de = a(() => /* @__PURE__ */ new Set([...x?.commitHashes ?? [], ...x?.ghostHashes ?? []]), [x]), C = a(() => e.reduce((e, t) => Math.max(e, (t.lane ?? 0) + 1), 1), [e]), fe = a(() => {
582
+ var Ge = 14, Ke = 9, qe = 7, Je = 9, Ye = "3 3", W = (e) => Ke + e * Ge, Xe = (e) => W(Math.max(e - 1, 0)) + qe;
583
+ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpenSession: c, hasMore: d = !1, onShowOlder: p, label: m = "commit history", className: h = "", sessionLanes: g, hoveredSessionId: ee = null, selectedSessionId: _ = null, onHoverSession: v, onSelectSession: te, highlightSelected: y, highlightHovered: b, ghostGroupsByCommit: x, expandedGhostGroups: ne, onToggleGhostGroup: re, expandedCommitSessions: ie, onToggleCommitSessions: ae, touchedFilesByCommit: oe, onOpenTouchedFile: se, ...S }) {
584
+ let ce = a(() => new Set(ne ?? []), [ne]), le = a(() => new Set(ie ?? []), [ie]), ue = a(() => /* @__PURE__ */ new Set([...y?.commitHashes ?? [], ...y?.ghostHashes ?? []]), [y]), de = a(() => /* @__PURE__ */ new Set([...b?.commitHashes ?? [], ...b?.ghostHashes ?? []]), [b]), C = a(() => e.reduce((e, t) => Math.max(e, (t.lane ?? 0) + 1), 1), [e]), fe = a(() => {
579
585
  let t = new Map(e.map((e) => [e.id, e.lane ?? 0])), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
580
586
  return e.forEach((e, t) => {
581
587
  let i = e.lane ?? 0;
@@ -597,10 +603,10 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
597
603
  };
598
604
  });
599
605
  }, [e]), w = a(() => {
600
- let e = new Set(fe.map((e) => e.commit.id)), t = new Set((g ?? []).map((e) => e.sessionId)), n = [...(b?.edges ?? []).map((e) => ({
606
+ let e = new Set(fe.map((e) => e.commit.id)), t = new Set((g ?? []).map((e) => e.sessionId)), n = [...(y?.edges ?? []).map((e) => ({
601
607
  ...e,
602
608
  weight: "primary"
603
- })), ...(x?.edges ?? []).map((e) => ({
609
+ })), ...(b?.edges ?? []).map((e) => ({
604
610
  ...e,
605
611
  weight: "secondary"
606
612
  }))], r = /* @__PURE__ */ new Set();
@@ -616,8 +622,8 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
616
622
  }, [
617
623
  fe,
618
624
  g,
619
- b,
620
- x
625
+ y,
626
+ b
621
627
  ]), T = o(null), [E, pe] = s([]);
622
628
  i(() => {
623
629
  let e = T.current;
@@ -646,7 +652,7 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
646
652
  let n = new ResizeObserver(t);
647
653
  return n.observe(e), () => n.disconnect();
648
654
  }, [w]);
649
- let D = Ye(C), me = ["cg", h].filter(Boolean).join(" ");
655
+ let D = Xe(C), me = ["cg", h].filter(Boolean).join(" ");
650
656
  return e.length === 0 ? /* @__PURE__ */ l("div", {
651
657
  className: me,
652
658
  ...S,
@@ -666,14 +672,14 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
666
672
  role: "group",
667
673
  "aria-label": "recorded sessions",
668
674
  style: { gridTemplateColumns: `repeat(${g.length}, minmax(0, 1fr))` },
669
- children: g.map((e) => /* @__PURE__ */ l(Ue, {
675
+ children: g.map((e) => /* @__PURE__ */ l(z, {
670
676
  sessionId: e.sessionId,
671
677
  title: e.title,
672
678
  harness: e.harness,
673
- hovered: _ === e.sessionId,
674
- selected: v === e.sessionId,
675
- onHover: y,
676
- onSelect: ee,
679
+ hovered: ee === e.sessionId,
680
+ selected: _ === e.sessionId,
681
+ onHover: v,
682
+ onSelect: te,
677
683
  unresolvedGhosts: e.unresolvedGhosts,
678
684
  "data-timeline-session-id": e.sessionId
679
685
  }, e.sessionId))
@@ -683,7 +689,7 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
683
689
  children: [E.length > 0 && /* @__PURE__ */ l("svg", {
684
690
  className: "cg-highlight-layer",
685
691
  "aria-hidden": "true",
686
- children: E.map((e) => /* @__PURE__ */ l(B, {
692
+ children: E.map((e) => /* @__PURE__ */ l(V, {
687
693
  weight: e.weight,
688
694
  geometry: e.geometry,
689
695
  "data-session-id": e.sessionId,
@@ -692,7 +698,7 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
692
698
  }), fe.map((e) => /* @__PURE__ */ u("div", {
693
699
  className: "cg-history-row",
694
700
  "data-commit-hash": e.commit.id,
695
- children: [/* @__PURE__ */ l(Ze, {
701
+ children: [/* @__PURE__ */ l(G, {
696
702
  row: e,
697
703
  width: D,
698
704
  selected: e.commit.id === t,
@@ -705,12 +711,12 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
705
711
  touchedFiles: oe?.[e.commit.id] ?? [],
706
712
  expandedFiles: le.has(`files:${e.commit.id}`),
707
713
  onOpenTouchedFile: se
708
- }), te?.[e.commit.id] && /* @__PURE__ */ l("div", {
714
+ }), x?.[e.commit.id] && /* @__PURE__ */ l("div", {
709
715
  className: "cg-ghost-row",
710
716
  style: { marginLeft: D },
711
- children: /* @__PURE__ */ l(z, {
717
+ children: /* @__PURE__ */ l(We, {
712
718
  successorHash: e.commit.id,
713
- ghosts: te[e.commit.id],
719
+ ghosts: x[e.commit.id],
714
720
  expanded: ce.has(e.commit.id),
715
721
  onToggle: re
716
722
  })
@@ -734,7 +740,7 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
734
740
  y1: "0",
735
741
  x2: W(0),
736
742
  y2: "60%",
737
- strokeDasharray: Je
743
+ strokeDasharray: Ye
738
744
  })
739
745
  })
740
746
  }), /* @__PURE__ */ u("button", {
@@ -752,13 +758,13 @@ function Xe({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
752
758
  ]
753
759
  });
754
760
  }
755
- function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSession: a, highlightWeight: o = null, expandedSessions: s = !1, onToggleSessions: c, touchedFiles: d = [], expandedFiles: f = !1, onOpenTouchedFile: p }) {
756
- let { commit: m, lane: h, joins: g, passLanes: _, laneUp: v, laneDown: ee } = e, b = !!m.session, x = [
761
+ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSession: a, highlightWeight: o = null, expandedSessions: s = !1, onToggleSessions: c, touchedFiles: d = [], expandedFiles: f = !1, onOpenTouchedFile: p }) {
762
+ let { commit: m, lane: h, joins: g, passLanes: ee, laneUp: _, laneDown: te } = e, y = !!m.session, b = [
757
763
  "cg-dot",
758
- b ? "cg-dot-filled" : "cg-dot-hollow",
764
+ y ? "cg-dot-filled" : "cg-dot-hollow",
759
765
  n && "cg-dot-sel",
760
766
  o && `cg-dot-highlight-${o}`
761
- ].filter(Boolean).join(" "), te = m.sessionRefs?.slice(0, 2) ?? [], ne = m.sessionRefs?.slice(2) ?? [], ie = ["cg-row", n && "cg-row-sel"].filter(Boolean).join(" ");
767
+ ].filter(Boolean).join(" "), x = m.sessionRefs?.slice(0, 2) ?? [], ne = m.sessionRefs?.slice(2) ?? [], ie = ["cg-row", n && "cg-row-sel"].filter(Boolean).join(" ");
762
768
  return /* @__PURE__ */ u("div", {
763
769
  className: "cg-band",
764
770
  role: "listitem",
@@ -773,21 +779,21 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
773
779
  height: "100%",
774
780
  preserveAspectRatio: "none",
775
781
  children: [
776
- v && /* @__PURE__ */ l("line", {
782
+ _ && /* @__PURE__ */ l("line", {
777
783
  className: "cg-stroke-self",
778
784
  x1: W(h),
779
785
  y1: "0",
780
786
  x2: W(h),
781
787
  y2: "50%"
782
788
  }),
783
- ee && /* @__PURE__ */ l("line", {
789
+ te && /* @__PURE__ */ l("line", {
784
790
  className: "cg-stroke-self",
785
791
  x1: W(h),
786
792
  y1: "50%",
787
793
  x2: W(h),
788
794
  y2: "100%"
789
795
  }),
790
- _.map((e) => /* @__PURE__ */ l("line", {
796
+ ee.map((e) => /* @__PURE__ */ l("line", {
791
797
  className: e === 0 ? "cg-stroke-lane0" : "cg-stroke-branch",
792
798
  x1: W(e),
793
799
  y1: "0",
@@ -813,15 +819,15 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
813
819
  ]
814
820
  }),
815
821
  /* @__PURE__ */ l("span", {
816
- className: x,
822
+ className: b,
817
823
  style: {
818
824
  left: W(h),
819
- width: qe,
820
- height: qe
825
+ width: Je,
826
+ height: Je
821
827
  },
822
- "data-has-session": b || void 0
828
+ "data-has-session": y || void 0
823
829
  }),
824
- b && /* @__PURE__ */ l(re, {
830
+ y && /* @__PURE__ */ l(re, {
825
831
  className: "cg-spark",
826
832
  style: { left: W(h) },
827
833
  "aria-hidden": "true"
@@ -851,7 +857,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
851
857
  children: [
852
858
  m.merged && /* @__PURE__ */ u("span", {
853
859
  className: "cg-merged",
854
- children: [/* @__PURE__ */ l(y, {
860
+ children: [/* @__PURE__ */ l(v, {
855
861
  className: "cg-merged-ic",
856
862
  "aria-hidden": "true"
857
863
  }), "merged"]
@@ -864,7 +870,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
864
870
  className: "cg-branch",
865
871
  children: m.branch
866
872
  }),
867
- b && /* @__PURE__ */ l("span", {
873
+ y && /* @__PURE__ */ l("span", {
868
874
  className: "cg-sr",
869
875
  children: "session"
870
876
  }),
@@ -879,7 +885,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
879
885
  className: "cg-sessions",
880
886
  role: "group",
881
887
  "aria-label": `sessions linked to ${m.message}`,
882
- children: [te.map((e) => /* @__PURE__ */ u("button", {
888
+ children: [x.map((e) => /* @__PURE__ */ u("button", {
883
889
  type: "button",
884
890
  className: "cg-session",
885
891
  onClick: () => {
@@ -896,7 +902,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
896
902
  }) : a?.(e.sessionId);
897
903
  },
898
904
  children: [
899
- /* @__PURE__ */ l(I, { harness: e.harness }),
905
+ /* @__PURE__ */ l(L, { harness: e.harness }),
900
906
  /* @__PURE__ */ l("span", {
901
907
  className: "cg-session-title",
902
908
  children: e.title || e.sessionId
@@ -910,7 +916,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
910
916
  }).toLowerCase()
911
917
  })
912
918
  ]
913
- }, e.sessionId)), ne.length > 0 && /* @__PURE__ */ l(We, {
919
+ }, e.sessionId)), ne.length > 0 && /* @__PURE__ */ l(B, {
914
920
  commitHash: m.id,
915
921
  overflow: ne,
916
922
  expanded: s,
@@ -932,7 +938,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
932
938
  }),
933
939
  d.length > 0 && /* @__PURE__ */ l("div", {
934
940
  className: "cg-touched-files",
935
- children: /* @__PURE__ */ l(H, {
941
+ children: /* @__PURE__ */ l(U, {
936
942
  commitHash: `files:${m.id}`,
937
943
  files: d,
938
944
  expanded: f,
@@ -946,7 +952,7 @@ function Ze({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenS
946
952
  }
947
953
  //#endregion
948
954
  //#region src/ui/DiffView.jsx
949
- function G(e) {
955
+ function Qe(e) {
950
956
  let t = 0, n = 0;
951
957
  for (let r of e) for (let e of r.lines) e.type === "add" ? t++ : e.type === "del" && n++;
952
958
  return {
@@ -954,8 +960,8 @@ function G(e) {
954
960
  dels: n
955
961
  };
956
962
  }
957
- function Qe({ line: e }) {
958
- let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ? x : t === "del" ? b : null;
963
+ function $e({ line: e }) {
964
+ let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ? b : t === "del" ? y : null;
959
965
  return /* @__PURE__ */ u("div", {
960
966
  className: `dv-line dv-${t}`,
961
967
  role: "row",
@@ -991,7 +997,7 @@ function Qe({ line: e }) {
991
997
  ]
992
998
  });
993
999
  }
994
- function $e({ match: e }) {
1000
+ function et({ match: e }) {
995
1001
  let { category: t, confidence: n, original: r, replacement: i, oldNo: a, newNo: o } = e, [c, d] = s(!1), f = n < .7, p = n.toFixed(2);
996
1002
  return /* @__PURE__ */ u("div", {
997
1003
  className: `dv-match${c ? " dv-match-kept" : ""}`,
@@ -1052,7 +1058,7 @@ function $e({ match: e }) {
1052
1058
  className: "dv-sign",
1053
1059
  role: "cell",
1054
1060
  "aria-hidden": "true",
1055
- children: /* @__PURE__ */ l(b, { "aria-hidden": "true" })
1061
+ children: /* @__PURE__ */ l(y, { "aria-hidden": "true" })
1056
1062
  }),
1057
1063
  /* @__PURE__ */ u("span", {
1058
1064
  className: "dv-text",
@@ -1087,7 +1093,7 @@ function $e({ match: e }) {
1087
1093
  className: "dv-sign",
1088
1094
  role: "cell",
1089
1095
  "aria-hidden": "true",
1090
- children: /* @__PURE__ */ l(x, { "aria-hidden": "true" })
1096
+ children: /* @__PURE__ */ l(b, { "aria-hidden": "true" })
1091
1097
  }),
1092
1098
  /* @__PURE__ */ u("span", {
1093
1099
  className: "dv-text",
@@ -1102,8 +1108,8 @@ function $e({ match: e }) {
1102
1108
  })]
1103
1109
  });
1104
1110
  }
1105
- function et({ file: e, hunks: t = [], matches: n = [], variant: r = "default", className: i = "", ...a }) {
1106
- let o = r === "redaction", s = o ? null : G(t);
1111
+ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", className: i = "", ...a }) {
1112
+ let o = r === "redaction", s = o ? null : Qe(t);
1107
1113
  return /* @__PURE__ */ u("figure", {
1108
1114
  className: [
1109
1115
  "dv",
@@ -1142,7 +1148,7 @@ function et({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
1142
1148
  children: n.length === 0 ? /* @__PURE__ */ l("p", {
1143
1149
  className: "dv-empty",
1144
1150
  children: "no sensitive content detected. safe to share as-is."
1145
- }) : n.map((e, t) => /* @__PURE__ */ l($e, { match: e }, e.id ?? t))
1151
+ }) : n.map((e, t) => /* @__PURE__ */ l(et, { match: e }, e.id ?? t))
1146
1152
  }) : /* @__PURE__ */ l("div", {
1147
1153
  className: "dv-body",
1148
1154
  role: "table",
@@ -1173,7 +1179,7 @@ function et({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
1173
1179
  }), /* @__PURE__ */ l("div", {
1174
1180
  className: "dv-hunk-pair",
1175
1181
  role: "rowgroup",
1176
- children: e.lines.map((e, t) => /* @__PURE__ */ l(Qe, { line: e }, t))
1182
+ children: e.lines.map((e, t) => /* @__PURE__ */ l($e, { line: e }, t))
1177
1183
  })]
1178
1184
  }, t))
1179
1185
  })]
@@ -1181,7 +1187,7 @@ function et({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
1181
1187
  }
1182
1188
  //#endregion
1183
1189
  //#region src/ui/graph/types.js
1184
- var tt = C, nt = se, rt = ce, it = le, at = S;
1190
+ var nt = C, rt = se, it = ce, at = le, ot = S;
1185
1191
  function K(e, t, n, r, i) {
1186
1192
  if (e(t)) return;
1187
1193
  let a;
@@ -1192,7 +1198,7 @@ function K(e, t, n, r, i) {
1192
1198
  }
1193
1199
  throw TypeError(`Graph contract validation failed for ${a} at src/ui/graph/types.js during ${r}: ${n} is outside the canonical @peasant-labs/schema value domain (${i.join(", ")}), so Fairtrade cannot safely render this graph payload; the caller must validate and normalize the local API response before passing it to the cooked graph surface.`);
1194
1200
  }
1195
- function ot(e) {
1201
+ function q(e) {
1196
1202
  for (let [t, n] of e.nodes.entries()) K(ve, n.kind, `nodes[${t}].kind`, "code-map payload rendering", C);
1197
1203
  for (let [t, n] of e.violations.entries()) K(D, n.kind, `violations[${t}].kind`, "code-map payload rendering", ce);
1198
1204
  }
@@ -1208,7 +1214,7 @@ function ct(e) {
1208
1214
  }
1209
1215
  //#endregion
1210
1216
  //#region src/ui/graph/graphContractPolicy.js
1211
- var q = Object.freeze({
1217
+ var J = Object.freeze({
1212
1218
  decision: "decisions",
1213
1219
  friction: "friction",
1214
1220
  unusual: "unusual signals",
@@ -1227,7 +1233,7 @@ function dt(e) {
1227
1233
  if (t !== -1) throw mt("validate ranking values", `nodes[${t}]`, `the read-attribution state or read-state grade is outside the canonical @peasant-labs/schema value domain (attribution states: ${fe.join(", ")}; read-state grades: ${w.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before ranking");
1228
1234
  }
1229
1235
  function ft() {
1230
- let e = Object.keys(q), t = ue.filter((e) => typeof q[e] != "string" || q[e].trim() === ""), n = e.filter((e) => !ge(e));
1236
+ let e = Object.keys(J), t = ue.filter((e) => typeof J[e] != "string" || J[e].trim() === ""), n = e.filter((e) => !ge(e));
1231
1237
  if (!(t.length === 0 && n.length === 0 && e.length === ue.length)) throw mt("validate insight labels", "INSIGHT_KIND_LABELS", `the Fairtrade label map does not exactly cover the canonical @peasant-labs/schema insight kinds (missing: ${t.join(", ") || "none"}; unknown: ${n.join(", ") || "none"})`, "add one non-empty Fairtrade UI label for each published insight kind and remove labels that are no longer in the schema contract");
1232
1238
  }
1233
1239
  function pt() {
@@ -1436,12 +1442,12 @@ function Kt(e, t, n, r) {
1436
1442
  }
1437
1443
  //#endregion
1438
1444
  //#region src/ui/graph/codeMapState.js
1439
- var qt = 1, J = Object.freeze({
1445
+ var qt = 1, Y = Object.freeze({
1440
1446
  min: .35,
1441
1447
  max: 2.4
1442
1448
  });
1443
1449
  function Jt(e) {
1444
- return typeof e == "number" && Number.isFinite(e) && e >= J.min && e <= J.max;
1450
+ return typeof e == "number" && Number.isFinite(e) && e >= Y.min && e <= Y.max;
1445
1451
  }
1446
1452
  var Yt = Object.freeze({
1447
1453
  version: 1,
@@ -1512,10 +1518,10 @@ var Yt = Object.freeze({
1512
1518
  "set-scent-filter": ["type", "scentFilter"],
1513
1519
  "set-rank-expanded": ["type", "expanded"]
1514
1520
  });
1515
- function Y(e = null) {
1516
- if (e !== null && !pn(e)) throw X("create state", "seed", "the seed is not an object", "pass an object or omit the seed");
1521
+ function X(e = null) {
1522
+ if (e !== null && !pn(e)) throw Z("create state", "seed", "the seed is not an object", "pass an object or omit the seed");
1517
1523
  let t = e ?? {};
1518
- if (mn(t, nn, "create state", "seed"), t.version !== void 0 && t.version !== 1) throw X("create state", "version", `version ${String(t.version)} is unsupported`, "use version 1");
1524
+ if (mn(t, nn, "create state", "seed"), t.version !== void 0 && t.version !== 1) throw Z("create state", "version", `version ${String(t.version)} is unsupported`, "use version 1");
1519
1525
  return {
1520
1526
  version: 1,
1521
1527
  presentation: Tn(t.presentation, Xt, Yt.presentation, "presentation"),
@@ -1524,71 +1530,71 @@ function Y(e = null) {
1524
1530
  expandedIds: yn(t.expandedIds, "expandedIds"),
1525
1531
  navigatorFilter: Cn(t.navigatorFilter, "", "navigatorFilter"),
1526
1532
  navigatorFocusedId: vn(t.navigatorFocusedId, "navigatorFocusedId"),
1527
- viewport: En(t.viewport),
1533
+ viewport: Dn(t.viewport),
1528
1534
  hoveredSessionId: vn(t.hoveredSessionId, "hoveredSessionId"),
1529
1535
  selectedSessionId: vn(t.selectedSessionId, "selectedSessionId"),
1530
1536
  expandedCommitSessions: yn(t.expandedCommitSessions, "expandedCommitSessions"),
1531
1537
  expandedGhostGroups: yn(t.expandedGhostGroups, "expandedGhostGroups"),
1532
1538
  rankMode: Tn(t.rankMode, Qt, Yt.rankMode, "rankMode"),
1533
- scentFilter: kn(t.scentFilter)
1539
+ scentFilter: An(t.scentFilter)
1534
1540
  };
1535
1541
  }
1536
1542
  function an(e, t) {
1537
- let n = Y(e), r = Y(t);
1538
- return n.version === r.version && n.presentation === r.presentation && n.selectedId === r.selectedId && n.grain === r.grain && n.expandedIds.length === r.expandedIds.length && n.expandedIds.every((e, t) => e === r.expandedIds[t]) && n.navigatorFilter === r.navigatorFilter && n.navigatorFocusedId === r.navigatorFocusedId && On(n.viewport, r.viewport) && n.hoveredSessionId === r.hoveredSessionId && n.selectedSessionId === r.selectedSessionId && on(n.expandedCommitSessions, r.expandedCommitSessions) && on(n.expandedGhostGroups, r.expandedGhostGroups) && n.rankMode === r.rankMode && n.scentFilter === r.scentFilter;
1543
+ let n = X(e), r = X(t);
1544
+ return n.version === r.version && n.presentation === r.presentation && n.selectedId === r.selectedId && n.grain === r.grain && n.expandedIds.length === r.expandedIds.length && n.expandedIds.every((e, t) => e === r.expandedIds[t]) && n.navigatorFilter === r.navigatorFilter && n.navigatorFocusedId === r.navigatorFocusedId && kn(n.viewport, r.viewport) && n.hoveredSessionId === r.hoveredSessionId && n.selectedSessionId === r.selectedSessionId && on(n.expandedCommitSessions, r.expandedCommitSessions) && on(n.expandedGhostGroups, r.expandedGhostGroups) && n.rankMode === r.rankMode && n.scentFilter === r.scentFilter;
1539
1545
  }
1540
1546
  function on(e, t) {
1541
1547
  return e.length === t.length && e.every((e, n) => e === t[n]);
1542
1548
  }
1543
1549
  function sn(e, t) {
1544
- let n = Y(e);
1550
+ let n = X(e);
1545
1551
  switch (fn(t), t.type) {
1546
1552
  case "replace":
1547
- case "hydrate": return Y(t.state);
1548
- case "set-presentation": return Y({
1553
+ case "hydrate": return X(t.state);
1554
+ case "set-presentation": return X({
1549
1555
  ...n,
1550
- presentation: Q(t.presentation, Xt, "presentation")
1556
+ presentation: En(t.presentation, Xt, "presentation")
1551
1557
  });
1552
- case "select": return Y({
1558
+ case "select": return X({
1553
1559
  ...n,
1554
- selectedId: Z(t.id, "id"),
1555
- navigatorFocusedId: Z(t.id, "id")
1560
+ selectedId: Q(t.id, "id"),
1561
+ navigatorFocusedId: Q(t.id, "id")
1556
1562
  });
1557
- case "clear-selection": return Y({
1563
+ case "clear-selection": return X({
1558
1564
  ...n,
1559
1565
  selectedId: null
1560
1566
  });
1561
- case "focus": return Y({
1567
+ case "focus": return X({
1562
1568
  ...n,
1563
1569
  navigatorFocusedId: vn(t.id, "id")
1564
1570
  });
1565
- case "set-filter": return Y({
1571
+ case "set-filter": return X({
1566
1572
  ...n,
1567
1573
  navigatorFilter: Cn(t.filter, "", "filter")
1568
1574
  });
1569
- case "set-expanded": return Y({
1575
+ case "set-expanded": return X({
1570
1576
  ...n,
1571
1577
  expandedIds: yn(t.ids, "ids")
1572
1578
  });
1573
1579
  case "toggle-expanded": {
1574
- let e = Z(t.id, "id"), r = new Set(n.expandedIds);
1575
- return r.has(e) ? r.delete(e) : r.add(e), Y({
1580
+ let e = Q(t.id, "id"), r = new Set(n.expandedIds);
1581
+ return r.has(e) ? r.delete(e) : r.add(e), X({
1576
1582
  ...n,
1577
1583
  expandedIds: [...r]
1578
1584
  });
1579
1585
  }
1580
- case "set-grain": return Y({
1586
+ case "set-grain": return X({
1581
1587
  ...n,
1582
- grain: Q(t.grain, Zt, "grain"),
1588
+ grain: En(t.grain, Zt, "grain"),
1583
1589
  expandedIds: []
1584
1590
  });
1585
- case "set-viewport": return Y({
1591
+ case "set-viewport": return X({
1586
1592
  ...n,
1587
- viewport: En(t.viewport)
1593
+ viewport: Dn(t.viewport)
1588
1594
  });
1589
1595
  case "open-in-map": {
1590
- let e = Z(t.id, "id");
1591
- return Y({
1596
+ let e = Q(t.id, "id");
1597
+ return X({
1592
1598
  ...n,
1593
1599
  presentation: "canvas",
1594
1600
  selectedId: e,
@@ -1596,57 +1602,57 @@ function sn(e, t) {
1596
1602
  });
1597
1603
  }
1598
1604
  case "reveal": {
1599
- let e = Z(t.id, "id");
1600
- return Y({
1605
+ let e = Q(t.id, "id");
1606
+ return X({
1601
1607
  ...n,
1602
- grain: Q(t.grain, Zt, "grain"),
1608
+ grain: En(t.grain, Zt, "grain"),
1603
1609
  expandedIds: yn(t.expandedIds, "expandedIds"),
1604
1610
  selectedId: e,
1605
1611
  navigatorFocusedId: e
1606
1612
  });
1607
1613
  }
1608
- case "hover-session": return Y({
1614
+ case "hover-session": return X({
1609
1615
  ...n,
1610
1616
  hoveredSessionId: _n(t.sessionId, "sessionId")
1611
1617
  });
1612
- case "select-session": return Y({
1618
+ case "select-session": return X({
1613
1619
  ...n,
1614
1620
  selectedSessionId: _n(t.sessionId, "sessionId")
1615
1621
  });
1616
1622
  case "toggle-commit-sessions": {
1617
- let e = Z(t.commitHash, "commitHash"), r = new Set(n.expandedCommitSessions);
1618
- return r.has(e) ? r.delete(e) : r.add(e), Y({
1623
+ let e = Q(t.commitHash, "commitHash"), r = new Set(n.expandedCommitSessions);
1624
+ return r.has(e) ? r.delete(e) : r.add(e), X({
1619
1625
  ...n,
1620
1626
  expandedCommitSessions: [...r]
1621
1627
  });
1622
1628
  }
1623
1629
  case "toggle-ghost-group": {
1624
- let e = Z(t.successorHash, "successorHash"), r = new Set(n.expandedGhostGroups);
1625
- return r.has(e) ? r.delete(e) : r.add(e), Y({
1630
+ let e = Q(t.successorHash, "successorHash"), r = new Set(n.expandedGhostGroups);
1631
+ return r.has(e) ? r.delete(e) : r.add(e), X({
1626
1632
  ...n,
1627
1633
  expandedGhostGroups: [...r]
1628
1634
  });
1629
1635
  }
1630
- case "set-rank-mode": return Y({
1636
+ case "set-rank-mode": return X({
1631
1637
  ...n,
1632
- rankMode: Q(t.rankMode, Qt, "rankMode")
1638
+ rankMode: En(t.rankMode, Qt, "rankMode")
1633
1639
  });
1634
- case "set-scent-filter": return Y({
1640
+ case "set-scent-filter": return X({
1635
1641
  ...n,
1636
- scentFilter: An(t.scentFilter, "scentFilter")
1642
+ scentFilter: jn(t.scentFilter, "scentFilter")
1637
1643
  });
1638
1644
  case "set-rank-expanded": {
1639
1645
  let e = wn(t.expanded, "expanded"), r = new Set(n.expandedCommitSessions);
1640
- return e ? r.add("ranked:all") : r.delete("ranked:all"), Y({
1646
+ return e ? r.add("ranked:all") : r.delete("ranked:all"), X({
1641
1647
  ...n,
1642
1648
  expandedCommitSessions: [...r]
1643
1649
  });
1644
1650
  }
1645
- default: throw X("reduce state", "action.type", "the action is unsupported", "use a documented CodeMapAction");
1651
+ default: throw Z("reduce state", "action.type", "the action is unsupported", "use a documented CodeMapAction");
1646
1652
  }
1647
1653
  }
1648
1654
  function cn(e, t) {
1649
- let n = Y(t), r = un(e), i = (e) => {
1655
+ let n = X(t), r = un(e), i = (e) => {
1650
1656
  if (!e) return {
1651
1657
  sessionId: null,
1652
1658
  commitHashes: [],
@@ -1667,7 +1673,7 @@ function cn(e, t) {
1667
1673
  };
1668
1674
  }
1669
1675
  function ln(e) {
1670
- let t = Y(e);
1676
+ let t = X(e);
1671
1677
  return t.hoveredSessionId === null ? t.selectedSessionId === null ? null : {
1672
1678
  type: "select-session",
1673
1679
  sessionId: null
@@ -1678,32 +1684,32 @@ function ln(e) {
1678
1684
  }
1679
1685
  function un(e) {
1680
1686
  let t = e?.edges ?? [];
1681
- if (!Array.isArray(t)) throw X("derive timeline highlight", "payload.edges", "edges is not an array", "provide a payload with an edges array");
1687
+ if (!Array.isArray(t)) throw Z("derive timeline highlight", "payload.edges", "edges is not an array", "provide a payload with an edges array");
1682
1688
  return t.map((e, t) => {
1683
- if (!pn(e)) throw X("derive timeline highlight", `payload.edges[${t}]`, "the edge is not an object", "provide an edge object");
1689
+ if (!pn(e)) throw Z("derive timeline highlight", `payload.edges[${t}]`, "the edge is not an object", "provide an edge object");
1684
1690
  return {
1685
- sessionId: Z(e.sessionId, `payload.edges[${t}].sessionId`),
1686
- commitHash: Z(e.commitHash, `payload.edges[${t}].commitHash`),
1691
+ sessionId: Q(e.sessionId, `payload.edges[${t}].sessionId`),
1692
+ commitHash: Q(e.commitHash, `payload.edges[${t}].commitHash`),
1687
1693
  ghost: e.ghost === !0
1688
1694
  };
1689
1695
  });
1690
1696
  }
1691
1697
  function dn(e, t) {
1692
- e && ot(e);
1693
- let n = Y(t), r = e?.nodes ?? [];
1694
- if (!Array.isArray(r)) throw X("derive view", "payload.nodes", "nodes is not an array", "provide a CodeMapPayload with a nodes array");
1698
+ e && q(e);
1699
+ let n = X(t), r = e?.nodes ?? [];
1700
+ if (!Array.isArray(r)) throw Z("derive view", "payload.nodes", "nodes is not an array", "provide a CodeMapPayload with a nodes array");
1695
1701
  let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
1696
1702
  r.forEach((e, t) => {
1697
- if (!pn(e)) throw X("derive view", `payload.nodes[${t}]`, "the node is not an object", "provide a node object");
1698
- let n = Z(e.id, `payload.nodes[${t}].id`);
1699
- if (i.has(n)) throw X("derive view", `payload.nodes[${t}].id`, `duplicate node id ${JSON.stringify(n)}`, "give every node one unique nonempty id");
1703
+ if (!pn(e)) throw Z("derive view", `payload.nodes[${t}]`, "the node is not an object", "provide a node object");
1704
+ let n = Q(e.id, `payload.nodes[${t}].id`);
1705
+ if (i.has(n)) throw Z("derive view", `payload.nodes[${t}].id`, `duplicate node id ${JSON.stringify(n)}`, "give every node one unique nonempty id");
1700
1706
  let r = {
1701
1707
  ...e,
1702
1708
  id: n
1703
1709
  };
1704
- r.parent !== void 0 && r.parent !== null && r.parent !== "" ? r.parent = Z(r.parent, `payload.nodes[${t}].parent`) : delete r.parent, i.set(n, r), a.set(n, t);
1710
+ r.parent !== void 0 && r.parent !== null && r.parent !== "" ? r.parent = Q(r.parent, `payload.nodes[${t}].parent`) : delete r.parent, i.set(n, r), a.set(n, t);
1705
1711
  });
1706
- for (let e of i.values()) if (e.parent && !i.has(e.parent)) throw X("derive view", `node ${JSON.stringify(e.id)} parent`, `parent ${JSON.stringify(e.parent)} does not exist`, "add the parent node or remove the parent reference to make this node a root");
1712
+ for (let e of i.values()) if (e.parent && !i.has(e.parent)) throw Z("derive view", `node ${JSON.stringify(e.id)} parent`, `parent ${JSON.stringify(e.parent)} does not exist`, "add the parent node or remove the parent reference to make this node a root");
1707
1713
  let o = /* @__PURE__ */ new Map(), s = [];
1708
1714
  for (let e of i.values()) if (e.parent) {
1709
1715
  let t = o.get(e.parent) ?? [];
@@ -1714,7 +1720,7 @@ function dn(e, t) {
1714
1720
  for (let e of o.values()) e.sort(c);
1715
1721
  let l = /* @__PURE__ */ new Map(), u = [], d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
1716
1722
  function p(e, t) {
1717
- if (d.has(e.id)) throw X("derive view", `node ${JSON.stringify(e.id)}`, "the parent graph contains a cycle", "remove the cyclic parent reference");
1723
+ if (d.has(e.id)) throw Z("derive view", `node ${JSON.stringify(e.id)}`, "the parent graph contains a cycle", "remove the cyclic parent reference");
1718
1724
  if (!f.has(e.id)) {
1719
1725
  d.add(e.id), u.push(e.id), l.set(e.id, t);
1720
1726
  for (let n of o.get(e.id) ?? []) p(n, t + 1);
@@ -1732,11 +1738,11 @@ function dn(e, t) {
1732
1738
  let t = e;
1733
1739
  for (; t;) g.add(t.id), t = t.parent ? i.get(t.parent) : null;
1734
1740
  }
1735
- let _ = en[n.grain], v = [];
1736
- function y(e, t, n = null) {
1741
+ let ee = en[n.grain], _ = [];
1742
+ function v(e, t, n = null) {
1737
1743
  if (h && !g.has(e.id)) return;
1738
- let r = o.get(e.id) ?? [], i = r.filter((e) => !h || g.has(e.id)).map((e) => e.id), a = r.length > 0, s = a && (t < _ || m.has(e.id)), c = !!h && i.length > 0;
1739
- if (v.push({
1744
+ let r = o.get(e.id) ?? [], i = r.filter((e) => !h || g.has(e.id)).map((e) => e.id), a = r.length > 0, s = a && (t < ee || m.has(e.id)), c = !!h && i.length > 0;
1745
+ if (_.push({
1740
1746
  node: { ...e },
1741
1747
  depth: t,
1742
1748
  parentId: n,
@@ -1745,28 +1751,28 @@ function dn(e, t) {
1745
1751
  canExpand: s,
1746
1752
  forcedOpen: c,
1747
1753
  expanded: c || s && m.has(e.id)
1748
- }), h || t < _ || m.has(e.id)) for (let n of r) y(n, t + 1, e.id);
1754
+ }), h || t < ee || m.has(e.id)) for (let n of r) v(n, t + 1, e.id);
1749
1755
  }
1750
- for (let e of s) y(e, 0);
1751
- let ee = [];
1752
- function b(e, t) {
1756
+ for (let e of s) v(e, 0);
1757
+ let te = [];
1758
+ function y(e, t) {
1753
1759
  let n = o.get(e.id) ?? [];
1754
- if (n.length > 0 && (t < _ || m.has(e.id))) for (let e of n) b(e, t + 1);
1755
- else ee.push({ ...e });
1760
+ if (n.length > 0 && (t < ee || m.has(e.id))) for (let e of n) y(e, t + 1);
1761
+ else te.push({ ...e });
1756
1762
  }
1757
- for (let e of s) b(e, 0);
1758
- let x = n.selectedId ? i.get(n.selectedId) ?? null : null, te = new Set(v.map((e) => e.node.id));
1763
+ for (let e of s) y(e, 0);
1764
+ let b = n.selectedId ? i.get(n.selectedId) ?? null : null, x = new Set(_.map((e) => e.node.id));
1759
1765
  return {
1760
1766
  state: n,
1761
- rows: v,
1762
- focusedId: n.navigatorFocusedId && te.has(n.navigatorFocusedId) ? n.navigatorFocusedId : v[0]?.node.id ?? null,
1763
- selected: x ? { ...x } : null,
1764
- staleSelectedId: n.selectedId && !x ? n.selectedId : null,
1767
+ rows: _,
1768
+ focusedId: n.navigatorFocusedId && x.has(n.navigatorFocusedId) ? n.navigatorFocusedId : _[0]?.node.id ?? null,
1769
+ selected: b ? { ...b } : null,
1770
+ staleSelectedId: n.selectedId && !b ? n.selectedId : null,
1765
1771
  canvas: {
1766
1772
  allNodes: [...i.values()].map((e) => ({ ...e })),
1767
- nodes: ee,
1768
- visibleIds: ee.map((e) => e.id),
1769
- selectedId: x?.id ?? null,
1773
+ nodes: te,
1774
+ visibleIds: te.map((e) => e.id),
1775
+ selectedId: b?.id ?? null,
1770
1776
  grain: n.grain,
1771
1777
  expandedIds: [...m].sort(gn),
1772
1778
  viewport: n.viewport ? { ...n.viewport } : null,
@@ -1780,21 +1786,21 @@ function dn(e, t) {
1780
1786
  };
1781
1787
  }
1782
1788
  function fn(e) {
1783
- if (!pn(e) || typeof e.type != "string") throw X("reduce state", "action.type", "the action has no string type", "pass a supported action object");
1789
+ if (!pn(e) || typeof e.type != "string") throw Z("reduce state", "action.type", "the action has no string type", "pass a supported action object");
1784
1790
  let t = rn[e.type];
1785
- if (!t) throw X("reduce state", "action.type", `action ${JSON.stringify(e.type)} is not supported`, `use one of ${Object.keys(rn).join(", ")}`);
1791
+ if (!t) throw Z("reduce state", "action.type", `action ${JSON.stringify(e.type)} is not supported`, `use one of ${Object.keys(rn).join(", ")}`);
1786
1792
  switch (hn(e, t, "reduce state", `action ${e.type}`), e.type) {
1787
1793
  case "replace":
1788
1794
  case "hydrate":
1789
1795
  xn(e.state, "state");
1790
1796
  break;
1791
1797
  case "set-presentation":
1792
- Q(e.presentation, Xt, "presentation");
1798
+ En(e.presentation, Xt, "presentation");
1793
1799
  break;
1794
1800
  case "select":
1795
1801
  case "toggle-expanded":
1796
1802
  case "open-in-map":
1797
- Z(e.id, "id");
1803
+ Q(e.id, "id");
1798
1804
  break;
1799
1805
  case "focus":
1800
1806
  _n(e.id, "id");
@@ -1806,13 +1812,13 @@ function fn(e) {
1806
1812
  bn(e.ids, "ids");
1807
1813
  break;
1808
1814
  case "set-grain":
1809
- Q(e.grain, Zt, "grain");
1815
+ En(e.grain, Zt, "grain");
1810
1816
  break;
1811
1817
  case "set-viewport":
1812
- Dn(e.viewport, "viewport");
1818
+ On(e.viewport, "viewport");
1813
1819
  break;
1814
1820
  case "reveal":
1815
- Z(e.id, "id"), Q(e.grain, Zt, "grain"), bn(e.expandedIds, "expandedIds");
1821
+ Q(e.id, "id"), En(e.grain, Zt, "grain"), bn(e.expandedIds, "expandedIds");
1816
1822
  break;
1817
1823
  case "clear-selection": break;
1818
1824
  case "hover-session":
@@ -1820,23 +1826,23 @@ function fn(e) {
1820
1826
  _n(e.sessionId, "sessionId");
1821
1827
  break;
1822
1828
  case "toggle-commit-sessions":
1823
- Z(e.commitHash, "commitHash");
1829
+ Q(e.commitHash, "commitHash");
1824
1830
  break;
1825
1831
  case "toggle-ghost-group":
1826
- Z(e.successorHash, "successorHash");
1832
+ Q(e.successorHash, "successorHash");
1827
1833
  break;
1828
1834
  case "set-rank-mode":
1829
- Q(e.rankMode, Qt, "rankMode");
1835
+ En(e.rankMode, Qt, "rankMode");
1830
1836
  break;
1831
1837
  case "set-scent-filter":
1832
- An(e.scentFilter, "scentFilter");
1838
+ jn(e.scentFilter, "scentFilter");
1833
1839
  break;
1834
1840
  case "set-rank-expanded":
1835
1841
  wn(e.expanded, "expanded");
1836
1842
  break;
1837
1843
  }
1838
1844
  }
1839
- function X(e, t, n, r) {
1845
+ function Z(e, t, n, r) {
1840
1846
  return /* @__PURE__ */ Error(`Code map ${e} failed: what went wrong: invalid ${t}; why: ${n}; where: @peasant-labs/fairtrade/graph ${t}; when: ${e}; what it means: the requested code-map state cannot be used safely; how to fix: ${r}.`);
1841
1847
  }
1842
1848
  function pn(e) {
@@ -1844,95 +1850,95 @@ function pn(e) {
1844
1850
  }
1845
1851
  function mn(e, t, n, r) {
1846
1852
  let i = new Set(t), a = Object.keys(e).find((e) => !i.has(e));
1847
- if (a) throw X(n, `${r}.${a}`, `field ${JSON.stringify(a)} is not allowed`, `remove ${JSON.stringify(a)} and use only ${t.join(", ")}`);
1853
+ if (a) throw Z(n, `${r}.${a}`, `field ${JSON.stringify(a)} is not allowed`, `remove ${JSON.stringify(a)} and use only ${t.join(", ")}`);
1848
1854
  }
1849
1855
  function hn(e, t, n, r) {
1850
1856
  mn(e, t, n, r);
1851
1857
  let i = t.find((t) => !(t in e));
1852
- if (i) throw X(n, `${r}.${i}`, `required field ${JSON.stringify(i)} is missing`, `provide ${JSON.stringify(i)} for this action`);
1858
+ if (i) throw Z(n, `${r}.${i}`, `required field ${JSON.stringify(i)} is missing`, `provide ${JSON.stringify(i)} for this action`);
1853
1859
  }
1854
1860
  function gn(e, t) {
1855
1861
  return e < t ? -1 : +(e > t);
1856
1862
  }
1857
- function Z(e, t) {
1858
- if (typeof e != "string" || e.length === 0) throw X("normalize state", t, "the id is not a nonempty string", "provide a nonempty string id");
1863
+ function Q(e, t) {
1864
+ if (typeof e != "string" || e.length === 0) throw Z("normalize state", t, "the id is not a nonempty string", "provide a nonempty string id");
1859
1865
  return e;
1860
1866
  }
1861
1867
  function _n(e, t) {
1862
- return e === null ? null : Z(e, t);
1868
+ return e === null ? null : Q(e, t);
1863
1869
  }
1864
1870
  function vn(e, t) {
1865
- return e == null ? null : Z(e, t);
1871
+ return e == null ? null : Q(e, t);
1866
1872
  }
1867
1873
  function yn(e, t) {
1868
1874
  if (e === void 0) return [];
1869
- if (e === null || typeof e == "string" || typeof e[Symbol.iterator] != "function") throw X("normalize state", t, "the value is not an iterable of ids", "provide an array or other iterable of nonempty string ids");
1875
+ if (e === null || typeof e == "string" || typeof e[Symbol.iterator] != "function") throw Z("normalize state", t, "the value is not an iterable of ids", "provide an array or other iterable of nonempty string ids");
1870
1876
  let n = [...e];
1871
- return [...new Set(n.map((e, n) => Z(e, `${t}[${n}]`)))].sort(gn);
1877
+ return [...new Set(n.map((e, n) => Q(e, `${t}[${n}]`)))].sort(gn);
1872
1878
  }
1873
1879
  function bn(e, t) {
1874
- if (e === void 0) throw X("normalize action", t, "the required id iterable is undefined", "provide a non-string iterable of nonempty ids");
1880
+ if (e === void 0) throw Z("normalize action", t, "the required id iterable is undefined", "provide a non-string iterable of nonempty ids");
1875
1881
  return yn(e, t);
1876
1882
  }
1877
1883
  function xn(e, t) {
1878
- if (!pn(e)) throw X("normalize action", t, "the required value is not an object", "provide an object");
1884
+ if (!pn(e)) throw Z("normalize action", t, "the required value is not an object", "provide an object");
1879
1885
  return e;
1880
1886
  }
1881
1887
  function Sn(e, t) {
1882
- if (typeof e != "string") throw X("normalize action", t, "the required value is not a string", "provide a string");
1888
+ if (typeof e != "string") throw Z("normalize action", t, "the required value is not a string", "provide a string");
1883
1889
  return e;
1884
1890
  }
1885
1891
  function Cn(e, t, n) {
1886
1892
  if (e === void 0) return t;
1887
- if (typeof e != "string") throw X("normalize state", n, "the value is not a string", "provide a string");
1893
+ if (typeof e != "string") throw Z("normalize state", n, "the value is not a string", "provide a string");
1888
1894
  return e;
1889
1895
  }
1890
1896
  function wn(e, t) {
1891
- if (typeof e != "boolean") throw X("normalize state", t, "the value is not a boolean", "provide true or false");
1897
+ if (typeof e != "boolean") throw Z("normalize state", t, "the value is not a boolean", "provide true or false");
1892
1898
  return e;
1893
1899
  }
1894
1900
  function Tn(e, t, n, r) {
1895
- return e === void 0 ? n : Q(e, t, r);
1901
+ return e === void 0 ? n : En(e, t, r);
1896
1902
  }
1897
- function Q(e, t, n) {
1898
- if (typeof e != "string" || !t.has(e)) throw X("normalize state", n, `value ${JSON.stringify(e)} is unsupported`, `use one of ${[...t].join(", ")}`);
1903
+ function En(e, t, n) {
1904
+ if (typeof e != "string" || !t.has(e)) throw Z("normalize state", n, `value ${JSON.stringify(e)} is unsupported`, `use one of ${[...t].join(", ")}`);
1899
1905
  return e;
1900
1906
  }
1901
- function En(e) {
1907
+ function Dn(e) {
1902
1908
  if (e == null) return null;
1903
- if (!pn(e)) throw X("normalize state", "viewport", "the viewport is not an object or null", "provide {scale, panX, panY} or null");
1909
+ if (!pn(e)) throw Z("normalize state", "viewport", "the viewport is not an object or null", "provide {scale, panX, panY} or null");
1904
1910
  let { scale: t, panX: n, panY: r } = e;
1905
- if (!Jt(t) || typeof n != "number" || typeof r != "number" || !Number.isFinite(n) || !Number.isFinite(r)) throw X("normalize state", "viewport", `scale must be within ${J.min}..${J.max} and pan values must be finite`, `provide finite panX and panY values and a scale within ${J.min}..${J.max}`);
1911
+ if (!Jt(t) || typeof n != "number" || typeof r != "number" || !Number.isFinite(n) || !Number.isFinite(r)) throw Z("normalize state", "viewport", `scale must be within ${Y.min}..${Y.max} and pan values must be finite`, `provide finite panX and panY values and a scale within ${Y.min}..${Y.max}`);
1906
1912
  return {
1907
1913
  scale: t,
1908
1914
  panX: n,
1909
1915
  panY: r
1910
1916
  };
1911
1917
  }
1912
- function Dn(e, t) {
1918
+ function On(e, t) {
1913
1919
  if (e === null) return null;
1914
- if (e === void 0) throw X("normalize action", t, "the required viewport is undefined", "provide null or a bounded viewport object");
1915
- return En(e);
1920
+ if (e === void 0) throw Z("normalize action", t, "the required viewport is undefined", "provide null or a bounded viewport object");
1921
+ return Dn(e);
1916
1922
  }
1917
- function On(e, t) {
1923
+ function kn(e, t) {
1918
1924
  return e === null || t === null ? e === t : e.scale === t.scale && e.panX === t.panX && e.panY === t.panY;
1919
1925
  }
1920
- function kn(e) {
1926
+ function An(e) {
1921
1927
  if (e == null) return null;
1922
- if (typeof e != "string" || !$t.has(e)) throw X("normalize state", "scentFilter", `value ${JSON.stringify(e)} is unsupported`, `use null or one of ${[...$t].join(", ")}`);
1928
+ if (typeof e != "string" || !$t.has(e)) throw Z("normalize state", "scentFilter", `value ${JSON.stringify(e)} is unsupported`, `use null or one of ${[...$t].join(", ")}`);
1923
1929
  return e;
1924
1930
  }
1925
- function An(e, t) {
1926
- if (e === void 0) throw X("normalize action", t, "the required scent filter is undefined", "provide null or a SCENT_TAGS member");
1927
- return kn(e);
1931
+ function jn(e, t) {
1932
+ if (e === void 0) throw Z("normalize action", t, "the required scent filter is undefined", "provide null or a SCENT_TAGS member");
1933
+ return An(e);
1928
1934
  }
1929
1935
  //#endregion
1930
1936
  //#region src/ui/MapCanvas.jsx
1931
- var jn = 56, Mn = 104, Nn = 248, Pn = 132, Fn = 28, In = 48, Ln = 1200, Rn = 1.25, zn = {
1937
+ var Mn = 56, Nn = 104, Pn = 248, Fn = 132, In = 28, Ln = 48, Rn = 1200, zn = 1.25, Bn = {
1932
1938
  overview: "project",
1933
1939
  folders: "package",
1934
1940
  files: "file"
1935
- }, Bn = Object.fromEntries(Object.entries(zn).map(([e, t]) => [e, tn[t]])), Vn = [
1941
+ }, Vn = Object.fromEntries(Object.entries(Bn).map(([e, t]) => [e, tn[t]])), Hn = [
1936
1942
  {
1937
1943
  id: "overview",
1938
1944
  label: "overview"
@@ -1945,19 +1951,19 @@ var jn = 56, Mn = 104, Nn = 248, Pn = 132, Fn = 28, In = 48, Ln = 1200, Rn = 1.2
1945
1951
  id: "files",
1946
1952
  label: "files"
1947
1953
  }
1948
- ], Hn = 500, Un = 1e4, Wn = 3;
1949
- function Gn(e) {
1954
+ ], Un = 500, Wn = 1e4, Gn = 3;
1955
+ function Kn(e) {
1950
1956
  let t = Math.round(Number(e) || 0);
1951
1957
  return t < 0 ? 0 : t > 4 ? 4 : t;
1952
1958
  }
1953
- function Kn(e) {
1959
+ function qn(e) {
1954
1960
  let t = String(e ?? ""), n = t.lastIndexOf("/");
1955
1961
  return n >= 0 ? t.slice(n + 1) : t;
1956
1962
  }
1957
- function qn(e, t) {
1963
+ function Jn(e, t) {
1958
1964
  return e._order === t._order ? e.id < t.id ? -1 : +(e.id > t.id) : e._order - t._order;
1959
1965
  }
1960
- function Jn(e) {
1966
+ function Yn(e) {
1961
1967
  let t = /* @__PURE__ */ new Map();
1962
1968
  e.forEach((e, n) => {
1963
1969
  let r = Number.isFinite(e.order) ? e.order : n;
@@ -1975,8 +1981,8 @@ function Jn(e) {
1975
1981
  t ? t.push(e) : n.set(a, [e]);
1976
1982
  } else i.push(e);
1977
1983
  }
1978
- for (let e of n.values()) e.sort(qn);
1979
- i.sort(qn);
1984
+ for (let e of n.values()) e.sort(Jn);
1985
+ i.sort(Jn);
1980
1986
  let a = /* @__PURE__ */ new Map(), o = [], s = (e, t) => {
1981
1987
  a.set(e.id, t), o.push(e.id);
1982
1988
  for (let r of n.get(e.id) ?? []) s(r, t + 1);
@@ -1992,7 +1998,7 @@ function Jn(e) {
1992
1998
  canonical: !1
1993
1999
  };
1994
2000
  }
1995
- function Yn(e, t) {
2001
+ function Xn(e, t) {
1996
2002
  let n = new Map(t.orderedIds.map((e, t) => [e, t])), r = new Map(e.map((e) => [e.id, {
1997
2003
  ...e,
1998
2004
  _order: n.get(e.id) ?? 2 ** 53 - 1
@@ -2011,10 +2017,10 @@ function Yn(e, t) {
2011
2017
  canonical: !0
2012
2018
  };
2013
2019
  }
2014
- function Xn(e, t) {
2020
+ function Zn(e, t) {
2015
2021
  return t.canonical ? t.depthById.get(e.id) ?? 0 : Number.isFinite(e.layer) ? e.layer : t.depthById.get(e.id) ?? 0;
2016
2022
  }
2017
- function Zn(e, t, n) {
2023
+ function Qn(e, t, n) {
2018
2024
  let { children: r, roots: i } = e, a = [], o = (e, i) => {
2019
2025
  let s = r.get(e.id);
2020
2026
  if (s && s.length > 0 && (i < t || n.has(e.id))) for (let e of s) o(e, i + 1);
@@ -2023,7 +2029,7 @@ function Zn(e, t, n) {
2023
2029
  for (let e of i) o(e, 0);
2024
2030
  return a;
2025
2031
  }
2026
- function Qn(e, t) {
2032
+ function $n(e, t) {
2027
2033
  if (e.length === 0) return {
2028
2034
  positioned: [],
2029
2035
  width: 0,
@@ -2032,21 +2038,21 @@ function Qn(e, t) {
2032
2038
  let n = 0;
2033
2039
  for (let t of e) n = Math.max(n, Math.max(0, Number(t.loc) || 0));
2034
2040
  let r = (e) => {
2035
- if (n <= 0) return Mn;
2041
+ if (n <= 0) return Nn;
2036
2042
  let t = Math.max(0, Number(e.loc) || 0) / n;
2037
- return Math.round(Mn + t * (Nn - Mn));
2043
+ return Math.round(Nn + t * (Pn - Nn));
2038
2044
  }, i = /* @__PURE__ */ new Map();
2039
2045
  for (let n of e) {
2040
- let e = Xn(n, t), r = i.get(e);
2046
+ let e = Zn(n, t), r = i.get(e);
2041
2047
  r ? r.push(n) : i.set(e, [n]);
2042
2048
  }
2043
2049
  let a = Array.from(i.keys()).sort((e, t) => e - t);
2044
- for (let e of a) i.get(e).sort(qn);
2045
- let o = (e) => e.reduce((e, t) => e + r(t), 0) + Fn * (e.length - 1), s = (e) => {
2050
+ for (let e of a) i.get(e).sort(Jn);
2051
+ let o = (e) => e.reduce((e, t) => e + r(t), 0) + In * (e.length - 1), s = (e) => {
2046
2052
  let t = [], n = [], i = 0;
2047
2053
  for (let a of e) {
2048
- let e = r(a), o = n.length === 0 ? e : e + Fn;
2049
- n.length > 0 && i + o > Ln ? (t.push(n), n = [a], i = e) : (n.push(a), i += o);
2054
+ let e = r(a), o = n.length === 0 ? e : e + In;
2055
+ n.length > 0 && i + o > Rn ? (t.push(n), n = [a], i = e) : (n.push(a), i += o);
2050
2056
  }
2051
2057
  return n.length > 0 && t.push(n), t;
2052
2058
  }, c = /* @__PURE__ */ new Map();
@@ -2055,7 +2061,7 @@ function Qn(e, t) {
2055
2061
  for (let e of a) for (let t of c.get(e)) l = Math.max(l, o(t));
2056
2062
  let u = [], d = 0;
2057
2063
  for (let e of a) for (let t of c.get(e)) {
2058
- let e = In + (l - o(t)) / 2, n = In + d * Pn;
2064
+ let e = Ln + (l - o(t)) / 2, n = Ln + d * Fn;
2059
2065
  for (let i of t) {
2060
2066
  let t = r(i);
2061
2067
  u.push({
@@ -2063,18 +2069,18 @@ function Qn(e, t) {
2063
2069
  x: e,
2064
2070
  y: n,
2065
2071
  w: t,
2066
- h: jn
2067
- }), e += t + Fn;
2072
+ h: Mn
2073
+ }), e += t + In;
2068
2074
  }
2069
2075
  d += 1;
2070
2076
  }
2071
2077
  return {
2072
2078
  positioned: u,
2073
- width: l + In * 2,
2074
- height: (d - 1) * Pn + jn + In * 2
2079
+ width: l + Ln * 2,
2080
+ height: (d - 1) * Fn + Mn + Ln * 2
2075
2081
  };
2076
2082
  }
2077
- function $n(e, t) {
2083
+ function er(e, t) {
2078
2084
  let n = /* @__PURE__ */ new Map();
2079
2085
  return (r) => {
2080
2086
  if (n.has(r)) return n.get(r);
@@ -2083,8 +2089,8 @@ function $n(e, t) {
2083
2089
  return n.set(r, i ?? null), i ?? null;
2084
2090
  };
2085
2091
  }
2086
- function er(e, t, n) {
2087
- let r = $n(t, n), i = /* @__PURE__ */ new Map();
2092
+ function tr(e, t, n) {
2093
+ let r = er(t, n), i = /* @__PURE__ */ new Map();
2088
2094
  for (let t of e) {
2089
2095
  let e = r(t.from), n = r(t.to);
2090
2096
  if (!e || !n || e === n) continue;
@@ -2098,8 +2104,8 @@ function er(e, t, n) {
2098
2104
  }
2099
2105
  return Array.from(i.values()).sort((e, t) => e.from === t.from ? e.to < t.to ? -1 : +(e.to > t.to) : e.from < t.from ? -1 : 1);
2100
2106
  }
2101
- function tr(e, t, n) {
2102
- let r = $n(t, n), i = /* @__PURE__ */ new Map();
2107
+ function nr(e, t, n) {
2108
+ let r = er(t, n), i = /* @__PURE__ */ new Map();
2103
2109
  for (let t of e) {
2104
2110
  let e = Math.max(0, Number(t.violations) || 0);
2105
2111
  if (e <= 0) continue;
@@ -2108,16 +2114,16 @@ function tr(e, t, n) {
2108
2114
  }
2109
2115
  return i;
2110
2116
  }
2111
- function nr(e) {
2117
+ function rr(e) {
2112
2118
  let t;
2113
2119
  for (let n of e) (!t || n.y < t.y || n.y === t.y && n.x < t.x) && (t = n);
2114
2120
  return t;
2115
2121
  }
2116
- function rr(e, t, n) {
2122
+ function ir(e, t, n) {
2117
2123
  let r = e.filter((e) => e.y === t.y).sort((e, t) => e.x - t.x), i = r.findIndex((e) => e.node.id === t.node.id);
2118
2124
  if (i !== -1) return r[i + n];
2119
2125
  }
2120
- function ir(e, t, n) {
2126
+ function ar(e, t, n) {
2121
2127
  let r;
2122
2128
  for (let i of e) (i.y - t.y) * n <= 0 || (r === void 0 || (i.y - r) * n < 0) && (r = i.y);
2123
2129
  if (r === void 0) return;
@@ -2131,67 +2137,67 @@ function ir(e, t, n) {
2131
2137
  }
2132
2138
  return a;
2133
2139
  }
2134
- function ar({ data: i = {
2140
+ function or({ data: i = {
2135
2141
  nodes: [],
2136
2142
  edges: []
2137
- }, grain: f = "folders", expandedIds: p, visibleIds: h, hierarchy: g, selectedId: y, highlightedIds: te, nodeDeltas: re = {}, edgeDeltas: ae = {}, onSelect: oe, onGrainChange: se, onExpandedIdsChange: S, onExpand: ce, height: le = 520, ariaLabel: ue = "code map", className: de = "", viewport: C, onViewportChange: fe, onStateAction: w, canonicalControlled: T = !1 }) {
2138
- let E = i?.nodes ?? [], pe = i?.edges ?? [], D = r().replace(/[:]/g, ""), me = `${D}-live`, he = `${D}-list`, [ge, _e] = s(Bn[f] === void 0 ? "folders" : f), [ve, ye] = s(() => sr(p)), [be, xe] = s(y ?? null), [O, Se] = s(null), [Ce, we] = s(() => cr(C?.scale) ? C.scale : 1), [Te, Ee] = s(() => ({
2143
+ }, grain: f = "folders", expandedIds: p, visibleIds: h, hierarchy: g, selectedId: v, highlightedIds: x, nodeDeltas: re = {}, edgeDeltas: ae = {}, onSelect: oe, onGrainChange: se, onExpandedIdsChange: S, onExpand: ce, height: le = 520, ariaLabel: ue = "code map", className: de = "", viewport: C, onViewportChange: fe, onStateAction: w, canonicalControlled: T = !1 }) {
2144
+ let E = i?.nodes ?? [], pe = i?.edges ?? [], D = r().replace(/[:]/g, ""), me = `${D}-live`, he = `${D}-list`, [ge, _e] = s(Vn[f] === void 0 ? "folders" : f), [ve, ye] = s(() => cr(p)), [be, xe] = s(v ?? null), [O, Se] = s(null), [Ce, we] = s(() => lr(C?.scale) ? C.scale : 1), [Te, Ee] = s(() => ({
2139
2145
  x: $(C?.panX, 0),
2140
2146
  y: $(C?.panY, 0)
2141
- })), [De, Oe] = s(""), [ke, Ae] = s(!1), k = o(null), A = o(null), [j, je] = s(null), Me = o(null), Ne = o(!1), Pe = o(C != null), Fe = C && cr(C.scale) ? `${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}` : "", Ie = o(Fe), M = o(Fe), Le = o(!1), Re = o(f), ze = o(y), Be = lr(p), Ve = lr(te), N = T ? Bn[f] === void 0 ? "folders" : f : ge, P = a(() => T ? sr(p) : ve, [
2147
+ })), [De, Oe] = s(""), [ke, k] = s(!1), A = o(null), j = o(null), [M, Ae] = s(null), je = o(null), Me = o(!1), Ne = o(C != null), Pe = C && lr(C.scale) ? `${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}` : "", Fe = o(Pe), N = o(Pe), Ie = o(!1), Le = o(f), Re = o(v), ze = ur(p), Be = ur(x), P = T ? Vn[f] === void 0 ? "folders" : f : ge, F = a(() => T ? cr(p) : ve, [
2142
2148
  T,
2143
- Be,
2149
+ ze,
2144
2150
  ve
2145
- ]), F = T ? y ?? null : be, I = T && C != null && cr(C.scale), L = j ? j.scale : I ? C.scale : Ce, R = j ? {
2146
- x: j.panX,
2147
- y: j.panY
2148
- } : I ? {
2151
+ ]), I = T ? v ?? null : be, Ve = T && C != null && lr(C.scale), L = M ? M.scale : Ve ? C.scale : Ce, R = M ? {
2152
+ x: M.panX,
2153
+ y: M.panY
2154
+ } : Ve ? {
2149
2155
  x: $(C.panX, 0),
2150
2156
  y: $(C.panY, 0)
2151
2157
  } : Te, He = o(L), Ue = o(R);
2152
2158
  He.current = L, Ue.current = R, n(() => {
2153
- if (j && !A.current) {
2154
- if (I && C.scale === j.scale && $(C.panX, 0) === j.panX && $(C.panY, 0) === j.panY) {
2155
- je(null);
2159
+ if (M && !j.current) {
2160
+ if (Ve && C.scale === M.scale && $(C.panX, 0) === M.panX && $(C.panY, 0) === M.panY) {
2161
+ Ae(null);
2156
2162
  return;
2157
2163
  }
2158
- return Me.current = setTimeout(() => je(null), Hn), () => clearTimeout(Me.current);
2164
+ return je.current = setTimeout(() => Ae(null), Un), () => clearTimeout(je.current);
2159
2165
  }
2160
2166
  }, [
2161
- j,
2162
- I,
2167
+ M,
2168
+ Ve,
2163
2169
  C?.scale,
2164
2170
  C?.panX,
2165
2171
  C?.panY
2166
2172
  ]), n(() => {
2167
- T || f !== Re.current && (Re.current = f, Bn[f] !== void 0 && _e(f));
2173
+ T || f !== Le.current && (Le.current = f, Vn[f] !== void 0 && _e(f));
2168
2174
  }, [T, f]), n(() => {
2169
- !T && p !== void 0 && ye(sr(p));
2170
- }, [T, Be]), n(() => {
2171
- T || y !== ze.current && (ze.current = y, y !== void 0 && xe(y));
2172
- }, [T, y]), n(() => {
2175
+ !T && p !== void 0 && ye(cr(p));
2176
+ }, [T, ze]), n(() => {
2177
+ T || v !== Re.current && (Re.current = v, v !== void 0 && xe(v));
2178
+ }, [T, v]), n(() => {
2173
2179
  if (T) {
2174
- if (!C && M.current !== "") M.current = "", Pe.current = !1, Ne.current = !1, we(1), Ee({
2180
+ if (!C && N.current !== "") N.current = "", Ne.current = !1, Me.current = !1, we(1), Ee({
2175
2181
  x: 0,
2176
2182
  y: 0
2177
2183
  });
2178
- else if (C && cr(C.scale)) {
2184
+ else if (C && lr(C.scale)) {
2179
2185
  let e = `${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}`;
2180
- e !== M.current && (M.current = e, Pe.current = !0);
2186
+ e !== N.current && (N.current = e, Ne.current = !0);
2181
2187
  }
2182
2188
  return;
2183
2189
  }
2184
2190
  if (!C) {
2185
- if (M.current === "") return;
2186
- M.current = "", Ie.current = "1|0|0", Pe.current = !1, we(1), Ee({
2191
+ if (N.current === "") return;
2192
+ N.current = "", Fe.current = "1|0|0", Ne.current = !1, we(1), Ee({
2187
2193
  x: 0,
2188
2194
  y: 0
2189
2195
  });
2190
2196
  return;
2191
2197
  }
2192
- if (!cr(C.scale)) return;
2198
+ if (!lr(C.scale)) return;
2193
2199
  let e = `${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}`;
2194
- e !== M.current && (M.current = e, Pe.current = !0, Ie.current = e, we(C.scale), Ee({
2200
+ e !== N.current && (N.current = e, Ne.current = !0, Fe.current = e, we(C.scale), Ee({
2195
2201
  x: $(C.panX, 0),
2196
2202
  y: $(C.panY, 0)
2197
2203
  }));
@@ -2204,11 +2210,11 @@ function ar({ data: i = {
2204
2210
  ]), n(() => {
2205
2211
  if (T || !fe && !w) return;
2206
2212
  let e = `${L}|${R.x}|${R.y}`;
2207
- Ie.current !== e && (Ie.current = e, fe?.({
2213
+ Fe.current !== e && (Fe.current = e, fe?.({
2208
2214
  scale: L,
2209
2215
  panX: R.x,
2210
2216
  panY: R.y
2211
- }), Le.current && (Le.current = !1, w?.({
2217
+ }), Ie.current && (Ie.current = !1, w?.({
2212
2218
  type: "set-viewport",
2213
2219
  viewport: {
2214
2220
  scale: L,
@@ -2224,12 +2230,12 @@ function ar({ data: i = {
2224
2230
  R.y,
2225
2231
  L
2226
2232
  ]);
2227
- let z = a(() => g ? Yn(E, g) : Jn(E), [E, g]), We = a(() => h === void 0 ? Zn(z, Bn[N], P) : Array.from(h, (e) => z.byId.get(e)).filter(Boolean), [
2233
+ let z = a(() => g ? Xn(E, g) : Yn(E), [E, g]), We = a(() => h === void 0 ? Qn(z, Vn[P], F) : Array.from(h, (e) => z.byId.get(e)).filter(Boolean), [
2228
2234
  z,
2229
- N,
2230
2235
  P,
2231
- lr(h)
2232
- ]), B = a(() => new Set(We.map((e) => e.id)), [We]), { positioned: V, width: H, height: U } = a(() => Qn(We, z), [We, z]), Ge = a(() => {
2236
+ F,
2237
+ ur(h)
2238
+ ]), B = a(() => new Set(We.map((e) => e.id)), [We]), { positioned: V, width: H, height: U } = a(() => $n(We, z), [We, z]), Ge = a(() => {
2233
2239
  let e = /* @__PURE__ */ new Map();
2234
2240
  for (let t of V) e.set(t.node.id, t);
2235
2241
  return e;
@@ -2237,25 +2243,25 @@ function ar({ data: i = {
2237
2243
  let e = /* @__PURE__ */ new Map();
2238
2244
  for (let [t, n] of z.children) e.set(t, n.length);
2239
2245
  return e;
2240
- }, [z]), qe = a(() => er(pe, z.parentIdByChild, B), [
2246
+ }, [z]), qe = a(() => tr(pe, z.parentIdByChild, B), [
2241
2247
  pe,
2242
2248
  z.parentIdByChild,
2243
2249
  B
2244
- ]), Je = a(() => qe.reduce((e, t) => Math.max(e, t.weight), 1), [qe]), W = a(() => tr(E, z.parentIdByChild, B), [
2250
+ ]), Je = a(() => qe.reduce((e, t) => Math.max(e, t.weight), 1), [qe]), Ye = a(() => nr(E, z.parentIdByChild, B), [
2245
2251
  E,
2246
2252
  z.parentIdByChild,
2247
2253
  B
2248
- ]), Ye = a(() => {
2249
- let e = sr(te);
2254
+ ]), W = a(() => {
2255
+ let e = cr(x);
2250
2256
  if (e.size === 0) return e;
2251
- let t = $n(z.parentIdByChild, B), n = /* @__PURE__ */ new Set();
2257
+ let t = er(z.parentIdByChild, B), n = /* @__PURE__ */ new Set();
2252
2258
  for (let r of e) {
2253
2259
  let e = t(r);
2254
2260
  e && n.add(e);
2255
2261
  }
2256
2262
  return n;
2257
2263
  }, [
2258
- Ve,
2264
+ Be,
2259
2265
  z.parentIdByChild,
2260
2266
  B
2261
2267
  ]), Xe = a(() => {
@@ -2271,16 +2277,16 @@ function ar({ data: i = {
2271
2277
  Ze(e);
2272
2278
  return;
2273
2279
  }
2274
- t && (Le.current = !0), we(e.scale), Ee({
2280
+ t && (Ie.current = !0), we(e.scale), Ee({
2275
2281
  x: e.panX,
2276
2282
  y: e.panY
2277
2283
  });
2278
2284
  }, [T, Ze]), Qe = t((e = !1) => {
2279
- let t = k.current;
2285
+ let t = A.current;
2280
2286
  if (!t || H <= 0 || U <= 0) return;
2281
2287
  let n = t.clientWidth, r = t.clientHeight;
2282
2288
  if (n <= 0 || r <= 0) return;
2283
- let i = Math.min(n / H, r / U), a = Math.max(J.min, Math.min(J.max, i));
2289
+ let i = Math.min(n / H, r / U), a = Math.max(Y.min, Math.min(Y.max, i));
2284
2290
  G({
2285
2291
  scale: a,
2286
2292
  panX: (n - H * a) / 2,
@@ -2291,7 +2297,7 @@ function ar({ data: i = {
2291
2297
  H,
2292
2298
  U
2293
2299
  ]), $e = t((e, t = !1) => {
2294
- let n = k.current;
2300
+ let n = A.current;
2295
2301
  if (!n) return !1;
2296
2302
  let r = n.clientWidth, i = n.clientHeight;
2297
2303
  if (r <= 0 || i <= 0) return !1;
@@ -2299,7 +2305,7 @@ function ar({ data: i = {
2299
2305
  if (a.length === 0) return !1;
2300
2306
  let o = Math.min(...a.map((e) => e.x)), s = Math.min(...a.map((e) => e.y)), c = Math.max(...a.map((e) => e.x + e.w)), l = Math.max(...a.map((e) => e.y + e.h)), u = c - o, d = l - s;
2301
2307
  if (u <= 0 || d <= 0) return !1;
2302
- let f = Math.min(r / u, i / d), p = Math.max(J.min, Math.min(J.max, f));
2308
+ let f = Math.min(r / u, i / d), p = Math.max(Y.min, Math.min(Y.max, f));
2303
2309
  return G({
2304
2310
  scale: p,
2305
2311
  panX: r / 2 - (o + u / 2) * p,
@@ -2311,19 +2317,19 @@ function ar({ data: i = {
2311
2317
  let e = window.setTimeout(() => tt(!1), 200);
2312
2318
  return () => window.clearTimeout(e);
2313
2319
  }, [et]);
2314
- let nt = a(() => V.map((e) => e.node.id).join("|"), [V]), rt = I ? `canonical|${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}` : T ? "canonical|auto-fit" : "legacy", it = o(P);
2320
+ let nt = a(() => V.map((e) => e.node.id).join("|"), [V]), rt = Ve ? `canonical|${C.scale}|${$(C.panX, 0)}|${$(C.panY, 0)}` : T ? "canonical|auto-fit" : "legacy", it = o(F);
2315
2321
  n(() => {
2316
2322
  let e = it.current;
2317
- if (it.current = P, Pe.current) {
2318
- Pe.current = !1, Ne.current = !0;
2323
+ if (it.current = F, Ne.current) {
2324
+ Ne.current = !1, Me.current = !0;
2319
2325
  return;
2320
2326
  }
2321
- if (!Ne.current) {
2322
- Ne.current = !0, Qe(I);
2327
+ if (!Me.current) {
2328
+ Me.current = !0, Qe(Ve);
2323
2329
  return;
2324
2330
  }
2325
2331
  let t = null;
2326
- for (let n of P) if (!e.has(n)) {
2332
+ for (let n of F) if (!e.has(n)) {
2327
2333
  t = n;
2328
2334
  break;
2329
2335
  }
@@ -2336,10 +2342,10 @@ function ar({ data: i = {
2336
2342
  let r = [...e].filter((e) => B.has(e));
2337
2343
  if (tt(!0), r.length > 0 && $e(new Set(r), !0)) return;
2338
2344
  }
2339
- Qe(I);
2345
+ Qe(Ve);
2340
2346
  }, [nt, rt]);
2341
2347
  let at = t((e) => {
2342
- let t = k.current, n = t ? t.clientWidth / 2 : 0, r = t ? t.clientHeight / 2 : 0, i = He.current, a = Math.max(J.min, Math.min(J.max, i * e));
2348
+ let t = A.current, n = t ? t.clientWidth / 2 : 0, r = t ? t.clientHeight / 2 : 0, i = He.current, a = Math.max(Y.min, Math.min(Y.max, i * e));
2343
2349
  if (a === i) return;
2344
2350
  let o = Ue.current;
2345
2351
  G({
@@ -2347,12 +2353,12 @@ function ar({ data: i = {
2347
2353
  panX: n - (n - o.x) / i * a,
2348
2354
  panY: r - (r - o.y) / i * a
2349
2355
  }, !0);
2350
- }, [G]), K = t((e) => {
2356
+ }, [G]), ot = t((e) => {
2351
2357
  if (!(e.ctrlKey || e.metaKey)) return;
2352
2358
  e.preventDefault();
2353
- let t = k.current;
2359
+ let t = A.current;
2354
2360
  if (!t) return;
2355
- let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = He.current, o = Math.exp(-e.deltaY * .01), s = Math.max(1 / Rn, Math.min(Rn, o)), c = Math.max(J.min, Math.min(J.max, a * s));
2361
+ let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = He.current, o = Math.exp(-e.deltaY * .01), s = Math.max(1 / zn, Math.min(zn, o)), c = Math.max(Y.min, Math.min(Y.max, a * s));
2356
2362
  if (c === a) return;
2357
2363
  let l = Ue.current;
2358
2364
  G({
@@ -2362,11 +2368,11 @@ function ar({ data: i = {
2362
2368
  }, !0);
2363
2369
  }, [G]);
2364
2370
  n(() => {
2365
- let e = k.current;
2366
- if (e) return e.addEventListener("wheel", K, { passive: !1 }), () => e.removeEventListener("wheel", K);
2367
- }, [K]);
2368
- let ot = t((e) => {
2369
- let t = Ge.get(e), n = k.current;
2371
+ let e = A.current;
2372
+ if (e) return e.addEventListener("wheel", ot, { passive: !1 }), () => e.removeEventListener("wheel", ot);
2373
+ }, [ot]);
2374
+ let K = t((e) => {
2375
+ let t = Ge.get(e), n = A.current;
2370
2376
  if (!t || !n) return;
2371
2377
  let r = Math.max(L, 1);
2372
2378
  G({
@@ -2378,46 +2384,46 @@ function ar({ data: i = {
2378
2384
  G,
2379
2385
  Ge,
2380
2386
  L
2381
- ]), st = t((e) => {
2382
- if (T && e === F) return;
2387
+ ]), q = t((e) => {
2388
+ if (T && e === I) return;
2383
2389
  T || xe(e), w?.(e ? {
2384
2390
  type: "select",
2385
2391
  id: e
2386
2392
  } : { type: "clear-selection" });
2387
2393
  let t = e ? z.byId.get(e) : null;
2388
- oe?.(e, t ? or(t) : null);
2394
+ oe?.(e, t ? sr(t) : null);
2389
2395
  }, [
2390
2396
  T,
2391
2397
  oe,
2392
2398
  w,
2393
- F,
2399
+ I,
2394
2400
  z.byId
2395
- ]), ct = t((e) => {
2401
+ ]), st = t((e) => {
2396
2402
  T || (_e(e), ye(/* @__PURE__ */ new Set())), w?.({
2397
2403
  type: "set-grain",
2398
- grain: zn[e]
2404
+ grain: Bn[e]
2399
2405
  }), se?.(e), T || S?.([]);
2400
2406
  }, [
2401
2407
  T,
2402
2408
  S,
2403
2409
  se,
2404
2410
  w
2405
- ]), [q, lt] = s(null), [ut, dt] = s("");
2411
+ ]), [ct, J] = s(null), [lt, ut] = s("");
2406
2412
  n(() => {
2407
- q && !P.has(q) && lt(null);
2408
- }, [q, P]);
2409
- let ft = t((e) => {
2413
+ ct && !F.has(ct) && J(null);
2414
+ }, [ct, F]);
2415
+ let dt = t((e) => {
2410
2416
  if ((Ke.get(e) || 0) === 0) return;
2411
- let t = z.byId.get(e), n = new Set(P);
2412
- if (n.has(e)) n.delete(e), lt((t) => {
2417
+ let t = z.byId.get(e), n = new Set(F);
2418
+ if (n.has(e)) n.delete(e), J((t) => {
2413
2419
  if (t !== e) return t;
2414
2420
  let r = z.parentIdByChild.get(e) ?? null;
2415
2421
  return r && n.has(r) ? r : null;
2416
- }), dt(`closed ${Kn(t?.label || e)}`);
2422
+ }), ut(`closed ${qn(t?.label || e)}`);
2417
2423
  else {
2418
- n.add(e), ce?.(e), lt(e);
2424
+ n.add(e), ce?.(e), J(e);
2419
2425
  let r = Ke.get(e) || 0;
2420
- dt(`opened ${Kn(t?.label || e)}, showing ${r} item${r === 1 ? "" : "s"}`);
2426
+ ut(`opened ${qn(t?.label || e)}, showing ${r} item${r === 1 ? "" : "s"}`);
2421
2427
  }
2422
2428
  T || ye(n), w?.({
2423
2429
  type: "set-expanded",
@@ -2426,51 +2432,51 @@ function ar({ data: i = {
2426
2432
  }, [
2427
2433
  T,
2428
2434
  Ke,
2429
- P,
2435
+ F,
2430
2436
  ce,
2431
2437
  S,
2432
2438
  w,
2433
2439
  z.byId,
2434
2440
  z.parentIdByChild
2435
- ]), pt = a(() => {
2436
- if (!q) return [];
2437
- let e = [], t = q;
2441
+ ]), ft = a(() => {
2442
+ if (!ct) return [];
2443
+ let e = [], t = ct;
2438
2444
  for (; t;) {
2439
2445
  let n = z.byId.get(t);
2440
2446
  if (!n) break;
2441
2447
  e.unshift(n), t = z.parentIdByChild.get(t) ?? null;
2442
2448
  }
2443
2449
  return e;
2444
- }, [q, z]), mt = t(() => {
2450
+ }, [ct, z]), pt = t(() => {
2445
2451
  T || ye(/* @__PURE__ */ new Set()), w?.({
2446
2452
  type: "set-expanded",
2447
2453
  ids: []
2448
- }), S?.([]), lt(null), dt("back to the top level");
2454
+ }), S?.([]), J(null), ut("back to the top level");
2449
2455
  }, [
2450
2456
  T,
2451
2457
  S,
2452
2458
  w
2453
- ]), ht = t((e) => {
2454
- let t = pt.slice(0, e + 1), n = t.map((e) => e.id), r = new Set(n);
2459
+ ]), mt = t((e) => {
2460
+ let t = ft.slice(0, e + 1), n = t.map((e) => e.id), r = new Set(n);
2455
2461
  T || ye(r), w?.({
2456
2462
  type: "set-expanded",
2457
2463
  ids: n
2458
2464
  }), S?.(n);
2459
2465
  let i = t[t.length - 1] ?? null;
2460
- lt(i?.id ?? null), dt(i ? `back to ${Kn(i.label || i.id)}` : "back to the top level");
2466
+ J(i?.id ?? null), ut(i ? `back to ${qn(i.label || i.id)}` : "back to the top level");
2461
2467
  }, [
2462
- pt,
2468
+ ft,
2463
2469
  T,
2464
2470
  S,
2465
2471
  w
2466
- ]), gt = t((e) => {
2472
+ ]), ht = t((e) => {
2467
2473
  let t = e.key;
2468
2474
  if (t === "+" || t === "=") {
2469
- e.preventDefault(), at(Rn);
2475
+ e.preventDefault(), at(zn);
2470
2476
  return;
2471
2477
  }
2472
2478
  if (t === "-" || t === "_") {
2473
- e.preventDefault(), at(1 / Rn);
2479
+ e.preventDefault(), at(1 / zn);
2474
2480
  return;
2475
2481
  }
2476
2482
  if (t === "0") {
@@ -2481,12 +2487,12 @@ function ar({ data: i = {
2481
2487
  e.preventDefault();
2482
2488
  let n = O ? Ge.get(O) : void 0;
2483
2489
  if (!n) {
2484
- let e = nr(V);
2490
+ let e = rr(V);
2485
2491
  e && Se(e.node.id);
2486
2492
  return;
2487
2493
  }
2488
2494
  let r;
2489
- r = t === "ArrowLeft" ? rr(V, n, -1) : t === "ArrowRight" ? rr(V, n, 1) : t === "ArrowUp" ? ir(V, n, -1) : ir(V, n, 1), r && (Se(r.node.id), pr(r, k.current, L, R, (e) => {
2495
+ r = t === "ArrowLeft" ? ir(V, n, -1) : t === "ArrowRight" ? ir(V, n, 1) : t === "ArrowUp" ? ar(V, n, -1) : ar(V, n, 1), r && (Se(r.node.id), mr(r, A.current, L, R, (e) => {
2490
2496
  G({
2491
2497
  scale: L,
2492
2498
  panX: e.x,
@@ -2497,45 +2503,45 @@ function ar({ data: i = {
2497
2503
  }
2498
2504
  if (t === "Enter") {
2499
2505
  if (!O) return;
2500
- e.preventDefault(), e.shiftKey ? ft(O) : T ? F !== O && st(O) : st(F === O ? null : O);
2506
+ e.preventDefault(), e.shiftKey ? dt(O) : T ? I !== O && q(O) : q(I === O ? null : O);
2501
2507
  return;
2502
2508
  }
2503
2509
  if (t === "e" || t === "E") {
2504
2510
  if (!O) return;
2505
- e.preventDefault(), ft(O);
2511
+ e.preventDefault(), dt(O);
2506
2512
  return;
2507
2513
  }
2508
- t === "Escape" && F && (e.preventDefault(), st(null));
2514
+ t === "Escape" && I && (e.preventDefault(), q(null));
2509
2515
  }, [
2510
2516
  O,
2511
2517
  V,
2512
2518
  Ge,
2513
- F,
2519
+ I,
2514
2520
  L,
2515
2521
  R,
2516
2522
  T,
2517
2523
  G,
2518
2524
  at,
2519
2525
  Qe,
2520
- ft,
2521
- st
2522
- ]), _t = t((e) => {
2523
- let t = A.current;
2526
+ dt,
2527
+ q
2528
+ ]), gt = t((e) => {
2529
+ let t = j.current;
2524
2530
  if (!t || e !== t.pointerId) return;
2525
- A.current = null;
2526
- let n = k.current;
2531
+ j.current = null;
2532
+ let n = A.current;
2527
2533
  try {
2528
2534
  n?.releasePointerCapture?.(e);
2529
2535
  } catch {}
2530
- T && je(null);
2531
- }, [T]), vt = t((e) => {
2536
+ T && Ae(null);
2537
+ }, [T]), _t = t((e) => {
2532
2538
  if (e.button !== 0 || e.target instanceof Element && e.target.closest("button, a, input, select, textarea")) return;
2533
- if (A.current) {
2534
- if (Date.now() - A.current.startedAt < Un) return;
2535
- _t(A.current.pointerId);
2539
+ if (j.current) {
2540
+ if (Date.now() - j.current.startedAt < Wn) return;
2541
+ gt(j.current.pointerId);
2536
2542
  }
2537
- let t = k.current;
2538
- t && t.setPointerCapture?.(e.pointerId), A.current = {
2543
+ let t = A.current;
2544
+ t && t.setPointerCapture?.(e.pointerId), j.current = {
2539
2545
  pointerId: e.pointerId,
2540
2546
  startX: e.clientX,
2541
2547
  startY: e.clientY,
@@ -2545,44 +2551,44 @@ function ar({ data: i = {
2545
2551
  nextPan: null,
2546
2552
  startedAt: Date.now()
2547
2553
  };
2548
- }, [R, _t]), yt = t((e) => {
2549
- let t = A.current;
2554
+ }, [R, gt]), vt = t((e) => {
2555
+ let t = j.current;
2550
2556
  if (!t || e.pointerId !== t.pointerId) return;
2551
2557
  let n = e.clientX - t.startX, r = e.clientY - t.startY;
2552
2558
  !t.moved && Math.abs(n) + Math.abs(r) > 3 && (t.moved = !0), t.moved && (t.nextPan = {
2553
2559
  scale: He.current,
2554
2560
  panX: t.panX + n,
2555
2561
  panY: t.panY + r
2556
- }, T ? je(t.nextPan) : G(t.nextPan, !0));
2557
- }, [G, T]), bt = t((e) => {
2558
- let t = A.current;
2562
+ }, T ? Ae(t.nextPan) : G(t.nextPan, !0));
2563
+ }, [G, T]), yt = t((e) => {
2564
+ let t = j.current;
2559
2565
  if (!t || e.pointerId !== t.pointerId) return;
2560
- A.current = null;
2561
- let n = k.current;
2566
+ j.current = null;
2567
+ let n = A.current;
2562
2568
  try {
2563
2569
  n?.releasePointerCapture?.(e.pointerId);
2564
2570
  } catch {}
2565
- t.moved && T && t.nextPan && (G(t.nextPan, !0), je({ ...t.nextPan })), !t.moved && e.target === e.currentTarget && st(null);
2571
+ t.moved && T && t.nextPan && (G(t.nextPan, !0), Ae({ ...t.nextPan })), !t.moved && e.target === e.currentTarget && q(null);
2566
2572
  }, [
2567
2573
  G,
2568
2574
  T,
2569
- st
2570
- ]), xt = t((e) => _t(e.pointerId), [_t]), St = t((e) => _t(e.pointerId), [_t]), Ct = a(() => {
2575
+ q
2576
+ ]), bt = t((e) => gt(e.pointerId), [gt]), xt = t((e) => gt(e.pointerId), [gt]), St = a(() => {
2571
2577
  if (!O) return "";
2572
2578
  let e = z.byId.get(O);
2573
- return e ? fr(e, {
2574
- selected: F === O,
2575
- expanded: P.has(O),
2576
- violations: W.get(O) || 0
2579
+ return e ? pr(e, {
2580
+ selected: I === O,
2581
+ expanded: F.has(O),
2582
+ violations: Ye.get(O) || 0
2577
2583
  }) : "";
2578
2584
  }, [
2579
2585
  O,
2580
2586
  z.byId,
2587
+ I,
2581
2588
  F,
2582
- P,
2583
- W
2584
- ]), wt = a(() => {
2585
- let e = k.current;
2589
+ Ye
2590
+ ]), Ct = a(() => {
2591
+ let e = A.current;
2586
2592
  if (!e || H <= 0 || U <= 0) return null;
2587
2593
  let t = e.clientWidth, n = e.clientHeight;
2588
2594
  return {
@@ -2598,7 +2604,7 @@ function ar({ data: i = {
2598
2604
  L,
2599
2605
  H,
2600
2606
  U
2601
- ]), Tt = V.length === 0, Et = (e) => `${D}-grain-${e}`;
2607
+ ]), wt = V.length === 0, Tt = (e) => `${D}-grain-${e}`;
2602
2608
  return /* @__PURE__ */ u("div", {
2603
2609
  className: ["mc", de].filter(Boolean).join(" "),
2604
2610
  style: { height: le },
@@ -2611,7 +2617,7 @@ function ar({ data: i = {
2611
2617
  className: "mc-sr",
2612
2618
  role: "status",
2613
2619
  "aria-live": "polite",
2614
- children: Ct
2620
+ children: St
2615
2621
  }),
2616
2622
  /* @__PURE__ */ u("div", {
2617
2623
  className: "mc-toolbar",
@@ -2619,15 +2625,15 @@ function ar({ data: i = {
2619
2625
  className: "mc-seg",
2620
2626
  role: "radiogroup",
2621
2627
  "aria-label": "detail grain",
2622
- children: Vn.map((e) => /* @__PURE__ */ u("button", {
2623
- id: Et(e.id),
2628
+ children: Hn.map((e) => /* @__PURE__ */ u("button", {
2629
+ id: Tt(e.id),
2624
2630
  type: "button",
2625
2631
  role: "radio",
2626
- "aria-checked": N === e.id,
2632
+ "aria-checked": P === e.id,
2627
2633
  className: "mc-seg-btn mono",
2628
- "data-active": N === e.id ? "true" : void 0,
2629
- onClick: () => ct(e.id),
2630
- children: [N === e.id && /* @__PURE__ */ l(d, {
2634
+ "data-active": P === e.id ? "true" : void 0,
2635
+ onClick: () => st(e.id),
2636
+ children: [P === e.id && /* @__PURE__ */ l(d, {
2631
2637
  className: "lucide",
2632
2638
  "aria-hidden": "true"
2633
2639
  }), e.label]
@@ -2652,14 +2658,14 @@ function ar({ data: i = {
2652
2658
  "aria-autocomplete": "list",
2653
2659
  value: De,
2654
2660
  onChange: (e) => {
2655
- Oe(e.target.value), Ae(!0);
2661
+ Oe(e.target.value), k(!0);
2656
2662
  },
2657
- onFocus: () => Ae(!0),
2663
+ onFocus: () => k(!0),
2658
2664
  onBlur: () => {
2659
- window.setTimeout(() => Ae(!1), 120);
2665
+ window.setTimeout(() => k(!1), 120);
2660
2666
  },
2661
2667
  onKeyDown: (e) => {
2662
- e.key === "Enter" && Xe[0] ? (e.preventDefault(), Dt(Xe[0])) : e.key === "Escape" && Ae(!1);
2668
+ e.key === "Enter" && Xe[0] ? (e.preventDefault(), Et(Xe[0])) : e.key === "Escape" && k(!1);
2663
2669
  }
2664
2670
  }),
2665
2671
  ke && Xe.length > 0 && /* @__PURE__ */ l("ul", {
@@ -2669,15 +2675,15 @@ function ar({ data: i = {
2669
2675
  "aria-label": "search results",
2670
2676
  children: Xe.map((e) => /* @__PURE__ */ u("li", {
2671
2677
  role: "option",
2672
- "aria-selected": e.id === F,
2678
+ "aria-selected": e.id === I,
2673
2679
  className: "mc-result mono",
2674
2680
  onMouseDown: (t) => {
2675
- t.preventDefault(), Dt(e);
2681
+ t.preventDefault(), Et(e);
2676
2682
  },
2677
- children: [e.kind === "folder" ? /* @__PURE__ */ l(v, {
2683
+ children: [e.kind === "folder" ? /* @__PURE__ */ l(_, {
2678
2684
  className: "lucide",
2679
2685
  "aria-hidden": "true"
2680
- }) : /* @__PURE__ */ l(_, {
2686
+ }) : /* @__PURE__ */ l(ee, {
2681
2687
  className: "lucide",
2682
2688
  "aria-hidden": "true"
2683
2689
  }), /* @__PURE__ */ l("span", {
@@ -2693,44 +2699,44 @@ function ar({ data: i = {
2693
2699
  className: "mc-sr",
2694
2700
  role: "status",
2695
2701
  "aria-live": "polite",
2696
- children: ut
2702
+ children: lt
2697
2703
  }),
2698
- pt.length > 0 && /* @__PURE__ */ u("nav", {
2704
+ ft.length > 0 && /* @__PURE__ */ u("nav", {
2699
2705
  className: "mc-breadcrumb mono",
2700
2706
  "aria-label": "folder path",
2701
2707
  children: [/* @__PURE__ */ l("button", {
2702
2708
  type: "button",
2703
2709
  className: "mc-breadcrumb-crumb",
2704
- onClick: mt,
2710
+ onClick: pt,
2705
2711
  children: "top level"
2706
- }), pt.map((t, n) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(m, {
2712
+ }), ft.map((t, n) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(m, {
2707
2713
  className: "lucide mc-breadcrumb-sep",
2708
2714
  "aria-hidden": "true"
2709
- }), n === pt.length - 1 ? /* @__PURE__ */ l("span", {
2715
+ }), n === ft.length - 1 ? /* @__PURE__ */ l("span", {
2710
2716
  className: "mc-breadcrumb-crumb mc-breadcrumb-current",
2711
2717
  "aria-current": "location",
2712
- children: Kn(t.label || t.id)
2718
+ children: qn(t.label || t.id)
2713
2719
  }) : /* @__PURE__ */ l("button", {
2714
2720
  type: "button",
2715
2721
  className: "mc-breadcrumb-crumb",
2716
- onClick: () => ht(n),
2717
- children: Kn(t.label || t.id)
2722
+ onClick: () => mt(n),
2723
+ children: qn(t.label || t.id)
2718
2724
  })] }, t.id))]
2719
2725
  }),
2720
2726
  /* @__PURE__ */ l("div", {
2721
2727
  className: "mc-viewport",
2722
- ref: k,
2728
+ ref: A,
2723
2729
  tabIndex: 0,
2724
2730
  role: "group",
2725
2731
  "aria-label": "map canvas: arrow keys move focus, enter selects, plus and minus zoom, ctrl or cmd plus wheel to zoom",
2726
- "aria-activedescendant": O && B.has(O) ? `${D}-node-${dr(O)}` : void 0,
2727
- onKeyDown: gt,
2728
- onPointerDown: vt,
2729
- onPointerMove: yt,
2730
- onPointerUp: bt,
2731
- onPointerCancel: xt,
2732
- onLostPointerCapture: St,
2733
- children: Tt ? /* @__PURE__ */ l("p", {
2732
+ "aria-activedescendant": O && B.has(O) ? `${D}-node-${fr(O)}` : void 0,
2733
+ onKeyDown: ht,
2734
+ onPointerDown: _t,
2735
+ onPointerMove: vt,
2736
+ onPointerUp: yt,
2737
+ onPointerCancel: bt,
2738
+ onLostPointerCapture: xt,
2739
+ children: wt ? /* @__PURE__ */ l("p", {
2734
2740
  className: "mc-empty mono",
2735
2741
  children: "no nodes to map"
2736
2742
  }) : /* @__PURE__ */ u(c, { children: [
@@ -2750,8 +2756,8 @@ function ar({ data: i = {
2750
2756
  children: qe.map((e) => {
2751
2757
  let t = Ge.get(e.from), n = Ge.get(e.to);
2752
2758
  if (!t || !n) return null;
2753
- let r = ae[ur(e.from, e.to)] ?? ae[ur(e.from, e.to, "arrow")];
2754
- return /* @__PURE__ */ l(hr, {
2759
+ let r = ae[dr(e.from, e.to)] ?? ae[dr(e.from, e.to, "arrow")];
2760
+ return /* @__PURE__ */ l(gr, {
2755
2761
  a: t,
2756
2762
  b: n,
2757
2763
  kind: e.kind,
@@ -2761,27 +2767,27 @@ function ar({ data: i = {
2761
2767
  }, `${e.kind}:${e.from}->${e.to}`);
2762
2768
  })
2763
2769
  }), V.map((t) => {
2764
- let n = (Ke.get(t.node.id) || 0) > 0, r = P.has(t.node.id);
2765
- return /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(mr, {
2766
- domId: `${D}-node-${dr(t.node.id)}`,
2770
+ let n = (Ke.get(t.node.id) || 0) > 0, r = F.has(t.node.id);
2771
+ return /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(hr, {
2772
+ domId: `${D}-node-${fr(t.node.id)}`,
2767
2773
  p: t,
2768
- selected: F === t.node.id,
2774
+ selected: I === t.node.id,
2769
2775
  focused: O === t.node.id,
2770
- highlighted: Ye.has(t.node.id),
2776
+ highlighted: W.has(t.node.id),
2771
2777
  delta: re[t.node.id],
2772
2778
  expandable: n,
2773
2779
  expanded: r,
2774
- violations: W.get(t.node.id) || 0,
2780
+ violations: Ye.get(t.node.id) || 0,
2775
2781
  onClick: (e) => {
2776
- e >= 2 || (Se(t.node.id), T ? F !== t.node.id && st(t.node.id) : st(F === t.node.id ? null : t.node.id));
2782
+ e >= 2 || (Se(t.node.id), T ? I !== t.node.id && q(t.node.id) : q(I === t.node.id ? null : t.node.id));
2777
2783
  },
2778
2784
  onDoubleClick: () => {
2779
- n && ft(t.node.id);
2785
+ n && dt(t.node.id);
2780
2786
  }
2781
2787
  }), n ? /* @__PURE__ */ l("button", {
2782
2788
  type: "button",
2783
2789
  className: "mc-node-disclosure",
2784
- "aria-label": `${r ? "hide" : "show"} children for ${Kn(t.node.label || t.node.id)}`,
2790
+ "aria-label": `${r ? "hide" : "show"} children for ${qn(t.node.label || t.node.id)}`,
2785
2791
  "aria-expanded": r,
2786
2792
  style: {
2787
2793
  left: t.x + t.w,
@@ -2790,7 +2796,7 @@ function ar({ data: i = {
2790
2796
  onPointerDown: (e) => e.stopPropagation(),
2791
2797
  onKeyDown: (e) => e.stopPropagation(),
2792
2798
  onClick: (e) => {
2793
- e.stopPropagation(), ft(t.node.id);
2799
+ e.stopPropagation(), dt(t.node.id);
2794
2800
  },
2795
2801
  children: /* @__PURE__ */ l(m, { "aria-hidden": "true" })
2796
2802
  }) : null] }, t.node.id);
@@ -2805,8 +2811,8 @@ function ar({ data: i = {
2805
2811
  type: "button",
2806
2812
  className: "mc-zoom-btn",
2807
2813
  "aria-label": "zoom in",
2808
- onClick: () => at(Rn),
2809
- children: /* @__PURE__ */ l(x, {
2814
+ onClick: () => at(zn),
2815
+ children: /* @__PURE__ */ l(b, {
2810
2816
  className: "lucide",
2811
2817
  "aria-hidden": "true"
2812
2818
  })
@@ -2815,8 +2821,8 @@ function ar({ data: i = {
2815
2821
  type: "button",
2816
2822
  className: "mc-zoom-btn",
2817
2823
  "aria-label": "zoom out",
2818
- onClick: () => at(1 / Rn),
2819
- children: /* @__PURE__ */ l(b, {
2824
+ onClick: () => at(1 / zn),
2825
+ children: /* @__PURE__ */ l(y, {
2820
2826
  className: "lucide",
2821
2827
  "aria-hidden": "true"
2822
2828
  })
@@ -2826,33 +2832,33 @@ function ar({ data: i = {
2826
2832
  className: "mc-zoom-btn",
2827
2833
  "aria-label": "fit map to view",
2828
2834
  onClick: () => Qe(!0),
2829
- children: /* @__PURE__ */ l(ee, {
2835
+ children: /* @__PURE__ */ l(te, {
2830
2836
  className: "lucide",
2831
2837
  "aria-hidden": "true"
2832
2838
  })
2833
2839
  })
2834
2840
  ]
2835
2841
  }),
2836
- wt && /* @__PURE__ */ l("div", {
2842
+ Ct && /* @__PURE__ */ l("div", {
2837
2843
  className: "mc-minimap",
2838
2844
  "aria-hidden": "true",
2839
2845
  children: /* @__PURE__ */ u("svg", {
2840
2846
  className: "mc-minimap-svg",
2841
- viewBox: `0 0 ${wt.graphW} ${wt.graphH}`,
2847
+ viewBox: `0 0 ${Ct.graphW} ${Ct.graphH}`,
2842
2848
  preserveAspectRatio: "xMidYMid meet",
2843
2849
  children: [V.map((e) => /* @__PURE__ */ l("rect", {
2844
2850
  className: "mc-mini-node",
2845
- "data-cov": Gn(e.node.coverage),
2851
+ "data-cov": Kn(e.node.coverage),
2846
2852
  x: e.x,
2847
2853
  y: e.y,
2848
2854
  width: e.w,
2849
2855
  height: e.h
2850
2856
  }, e.node.id)), /* @__PURE__ */ l("rect", {
2851
2857
  className: "mc-mini-view",
2852
- x: wt.viewX,
2853
- y: wt.viewY,
2854
- width: wt.viewW,
2855
- height: wt.viewH
2858
+ x: Ct.viewX,
2859
+ y: Ct.viewY,
2860
+ width: Ct.viewW,
2861
+ height: Ct.viewH
2856
2862
  })]
2857
2863
  })
2858
2864
  }),
@@ -2862,11 +2868,11 @@ function ar({ data: i = {
2862
2868
  children: [
2863
2869
  /* @__PURE__ */ u("span", {
2864
2870
  className: "mc-legend-item",
2865
- children: [/* @__PURE__ */ l(v, { className: "lucide" }), " folder"]
2871
+ children: [/* @__PURE__ */ l(_, { className: "lucide" }), " folder"]
2866
2872
  }),
2867
2873
  /* @__PURE__ */ u("span", {
2868
2874
  className: "mc-legend-item",
2869
- children: [/* @__PURE__ */ l(_, { className: "lucide" }), " file"]
2875
+ children: [/* @__PURE__ */ l(ee, { className: "lucide" }), " file"]
2870
2876
  }),
2871
2877
  /* @__PURE__ */ u("span", {
2872
2878
  className: "mc-legend-item mc-legend-ramp",
@@ -2904,47 +2910,47 @@ function ar({ data: i = {
2904
2910
  })
2905
2911
  ]
2906
2912
  });
2907
- function Dt(e) {
2908
- let t = e.kind === "file" && N !== "files" ? "files" : N, n = new Set(t === N ? P : []), r = z.parentIdByChild.get(e.id);
2913
+ function Et(e) {
2914
+ let t = e.kind === "file" && P !== "files" ? "files" : P, n = new Set(t === P ? F : []), r = z.parentIdByChild.get(e.id);
2909
2915
  for (; r && z.byId.has(r);) n.has(r) || (n.add(r), ce?.(r)), r = z.parentIdByChild.get(r);
2910
2916
  let i = Array.from(n);
2911
2917
  T || (_e(t), ye(n)), w?.({
2912
2918
  type: "reveal",
2913
2919
  id: e.id,
2914
- grain: zn[t],
2920
+ grain: Bn[t],
2915
2921
  expandedIds: i
2916
- }), t !== N && se?.(t), S?.(i), Oe(""), Ae(!1), Se(e.id), T || xe(e.id), oe?.(e.id, or(e)), window.requestAnimationFrame(() => {
2917
- window.requestAnimationFrame(() => ot(e.id));
2922
+ }), t !== P && se?.(t), S?.(i), Oe(""), k(!1), Se(e.id), T || xe(e.id), oe?.(e.id, sr(e)), window.requestAnimationFrame(() => {
2923
+ window.requestAnimationFrame(() => K(e.id));
2918
2924
  });
2919
2925
  }
2920
2926
  }
2921
- function or(e) {
2927
+ function sr(e) {
2922
2928
  let { _order: t, ...n } = e;
2923
2929
  return n;
2924
2930
  }
2925
- function sr(e) {
2931
+ function cr(e) {
2926
2932
  return e ? e instanceof Set ? new Set(e) : new Set(Array.from(e)) : /* @__PURE__ */ new Set();
2927
2933
  }
2928
- function cr(e) {
2934
+ function lr(e) {
2929
2935
  return Jt(e);
2930
2936
  }
2931
2937
  function $(e, t) {
2932
2938
  return Number.isFinite(e) ? e : t;
2933
2939
  }
2934
- function lr(e) {
2940
+ function ur(e) {
2935
2941
  return e ? Array.from(e).map(String).sort().join("\0") : "";
2936
2942
  }
2937
- function ur(e, t, n = "plain") {
2943
+ function dr(e, t, n = "plain") {
2938
2944
  return n === "arrow" ? `${e}->${t}` : `${e}→${t}`;
2939
2945
  }
2940
- function dr(e) {
2946
+ function fr(e) {
2941
2947
  return String(e).replace(/[^a-zA-Z0-9_-]/g, "_");
2942
2948
  }
2943
- function fr(e, t = {}) {
2944
- let { selected: n, expanded: r, violations: i = 0 } = t, a = Gn(e.coverage), o = `${Kn(e.label || e.id)}: ${e.kind} · coverage ${a} of 4`;
2949
+ function pr(e, t = {}) {
2950
+ let { selected: n, expanded: r, violations: i = 0 } = t, a = Kn(e.coverage), o = `${qn(e.label || e.id)}: ${e.kind} · coverage ${a} of 4`;
2945
2951
  return e.loc && (o += ` · ${e.loc} loc`), i > 0 && (o += ` · ${i} violation${i === 1 ? "" : "s"}`), n && (o += " · selected"), r && (o += " · expanded"), o;
2946
2952
  }
2947
- function pr(e, t, n, r, i) {
2953
+ function mr(e, t, n, r, i) {
2948
2954
  if (!t) return;
2949
2955
  let a = e.x * n + r.x, o = e.y * n + r.y, s = (e.x + e.w) * n + r.x, c = (e.y + e.h) * n + r.y, l = 0, u = 0;
2950
2956
  a < 24 ? l = 24 - a : s > t.clientWidth - 24 && (l = t.clientWidth - 24 - s), o < 24 ? u = 24 - o : c > t.clientHeight - 24 && (u = t.clientHeight - 24 - c), (l !== 0 || u !== 0) && i({
@@ -2952,8 +2958,8 @@ function pr(e, t, n, r, i) {
2952
2958
  y: r.y + u
2953
2959
  });
2954
2960
  }
2955
- function mr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a, expandable: o, expanded: s, violations: c, onClick: d, onDoubleClick: f }) {
2956
- let p = t.node, m = Gn(p.coverage);
2961
+ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a, expandable: o, expanded: s, violations: c, onClick: d, onDoubleClick: f }) {
2962
+ let p = t.node, m = Kn(p.coverage);
2957
2963
  return /* @__PURE__ */ u("button", {
2958
2964
  id: e,
2959
2965
  type: "button",
@@ -2963,8 +2969,8 @@ function mr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
2963
2969
  "data-focused": r ? "true" : void 0,
2964
2970
  "data-highlighted": i ? "true" : void 0,
2965
2971
  "data-delta": a || void 0,
2966
- "data-ink-flip": m >= Wn ? "true" : void 0,
2967
- "aria-label": fr(p, {
2972
+ "data-ink-flip": m >= Gn ? "true" : void 0,
2973
+ "aria-label": pr(p, {
2968
2974
  selected: n,
2969
2975
  expanded: s,
2970
2976
  violations: c
@@ -2992,16 +2998,16 @@ function mr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
2992
2998
  /* @__PURE__ */ u("span", {
2993
2999
  className: "mc-node-head",
2994
3000
  children: [
2995
- p.kind === "folder" ? /* @__PURE__ */ l(v, {
3001
+ p.kind === "folder" ? /* @__PURE__ */ l(_, {
2996
3002
  className: "lucide mc-node-ico",
2997
3003
  "aria-hidden": "true"
2998
- }) : /* @__PURE__ */ l(_, {
3004
+ }) : /* @__PURE__ */ l(ee, {
2999
3005
  className: "lucide mc-node-ico",
3000
3006
  "aria-hidden": "true"
3001
3007
  }),
3002
3008
  /* @__PURE__ */ l("span", {
3003
3009
  className: "mc-node-name mono",
3004
- children: Kn(p.label || p.id)
3010
+ children: qn(p.label || p.id)
3005
3011
  }),
3006
3012
  c > 0 && /* @__PURE__ */ u("span", {
3007
3013
  className: "mc-node-viol mono tnum",
@@ -3024,7 +3030,7 @@ function mr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
3024
3030
  ]
3025
3031
  });
3026
3032
  }
3027
- function hr({ a: e, b: t, kind: n, weight: r, maxWeight: i, delta: a }) {
3033
+ function gr({ a: e, b: t, kind: n, weight: r, maxWeight: i, delta: a }) {
3028
3034
  let o = e.x + e.w / 2, s = e.y + e.h, c = t.x + t.w / 2, d = t.y, f = (s + d) / 2, p = `M ${o} ${s} L ${o} ${f} L ${c} ${f} L ${c} ${d}`, m = 1 + Math.min(r, i) / i * 2;
3029
3035
  return /* @__PURE__ */ u("g", {
3030
3036
  className: "mc-edge",
@@ -3042,7 +3048,7 @@ function hr({ a: e, b: t, kind: n, weight: r, maxWeight: i, delta: a }) {
3042
3048
  }
3043
3049
  //#endregion
3044
3050
  //#region src/ui/RailShell.jsx
3045
- function gr({ toolbar: e, children: t, rail: n, railSide: i = "right", sheetTitle: a = "details", sheetMeta: o, className: c = "" }) {
3051
+ function _r({ toolbar: e, children: t, rail: n, railSide: i = "right", sheetTitle: a = "details", sheetMeta: o, className: c = "" }) {
3046
3052
  let [d, p] = s(!1), m = `rs-sheet-${r()}`;
3047
3053
  return /* @__PURE__ */ u("div", {
3048
3054
  className: `rs rs--${i}${c ? ` ${c}` : ""}`,
@@ -3105,7 +3111,7 @@ function gr({ toolbar: e, children: t, rail: n, railSide: i = "right", sheetTitl
3105
3111
  })]
3106
3112
  });
3107
3113
  }
3108
- function _r({ title: e, icon: t, meta: n, children: i, collapsible: a = !1, defaultOpen: o = !0, className: d = "" }) {
3114
+ function vr({ title: e, icon: t, meta: n, children: i, collapsible: a = !1, defaultOpen: o = !0, className: d = "" }) {
3109
3115
  let [f, p] = s(o), h = `rs-sec-${r()}`, g = /* @__PURE__ */ u(c, { children: [
3110
3116
  t && /* @__PURE__ */ l(t, {
3111
3117
  className: "rs-sec-icon lucide",
@@ -3146,7 +3152,7 @@ function _r({ title: e, icon: t, meta: n, children: i, collapsible: a = !1, defa
3146
3152
  })]
3147
3153
  });
3148
3154
  }
3149
- function vr({ title: e, icon: t, meta: n, children: i, defaultOpen: a = !0 }) {
3155
+ function yr({ title: e, icon: t, meta: n, children: i, defaultOpen: a = !0 }) {
3150
3156
  let [o, c] = s(a), d = `rs-split-${r()}`;
3151
3157
  return /* @__PURE__ */ u("section", {
3152
3158
  className: `rs-split-panel${o ? " is-open" : ""}`,
@@ -3184,15 +3190,15 @@ function vr({ title: e, icon: t, meta: n, children: i, defaultOpen: a = !0 }) {
3184
3190
  })]
3185
3191
  });
3186
3192
  }
3187
- function yr({ left: e, right: t, leftTitle: n = "outline", rightTitle: r = "filters", leftIcon: i, rightIcon: a, leftMeta: o, rightMeta: s, className: c = "" }) {
3193
+ function br({ left: e, right: t, leftTitle: n = "outline", rightTitle: r = "filters", leftIcon: i, rightIcon: a, leftMeta: o, rightMeta: s, className: c = "" }) {
3188
3194
  return /* @__PURE__ */ u("div", {
3189
3195
  className: `rs-split${c ? ` ${c}` : ""}`,
3190
- children: [/* @__PURE__ */ l(vr, {
3196
+ children: [/* @__PURE__ */ l(yr, {
3191
3197
  title: n,
3192
3198
  icon: i,
3193
3199
  meta: o,
3194
3200
  children: e
3195
- }), /* @__PURE__ */ l(vr, {
3201
+ }), /* @__PURE__ */ l(yr, {
3196
3202
  title: r,
3197
3203
  icon: a,
3198
3204
  meta: s,
@@ -3202,11 +3208,11 @@ function yr({ left: e, right: t, leftTitle: n = "outline", rightTitle: r = "filt
3202
3208
  }
3203
3209
  //#endregion
3204
3210
  //#region src/ui/inuse/InUseShell.jsx
3205
- var br = Object.freeze([
3211
+ var xr = Object.freeze([
3206
3212
  {
3207
3213
  id: "transcript",
3208
3214
  mark: "transcript-browser",
3209
- icon: te
3215
+ icon: x
3210
3216
  },
3211
3217
  {
3212
3218
  id: "commons",
@@ -3218,7 +3224,7 @@ var br = Object.freeze([
3218
3224
  mark: "peasant",
3219
3225
  icon: oe
3220
3226
  }
3221
- ]), xr = Object.freeze([
3227
+ ]), Sr = Object.freeze([
3222
3228
  {
3223
3229
  id: "analytics",
3224
3230
  label: "analytics"
@@ -3232,10 +3238,10 @@ var br = Object.freeze([
3232
3238
  label: "code map"
3233
3239
  }
3234
3240
  ]);
3235
- function Sr(e) {
3241
+ function Cr(e) {
3236
3242
  return e && (/(INPUT|TEXTAREA|SELECT)/.test(e.tagName) || e.isContentEditable);
3237
3243
  }
3238
- function Cr({ apps: e = br, defaultApp: t, activeApp: n, onAppChange: r, renderApp: i, brand: a = "fairtrade", ariaLabel: c = "the design system in use" }) {
3244
+ function wr({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderApp: i, brand: a = "fairtrade", ariaLabel: c = "the design system in use" }) {
3239
3245
  let [d, f] = s(t ?? e[0]?.id), p = n ?? d, m = o({}), h = (e) => {
3240
3246
  n === void 0 && f(e), r?.(e);
3241
3247
  }, g = e.find((e) => e.id === p) ?? e[0];
@@ -3244,7 +3250,7 @@ function Cr({ apps: e = br, defaultApp: t, activeApp: n, onAppChange: r, renderA
3244
3250
  id: "inuse",
3245
3251
  "aria-label": c,
3246
3252
  onKeyDown: (t) => {
3247
- if (Sr(t.target)) return;
3253
+ if (Cr(t.target)) return;
3248
3254
  let n = {
3249
3255
  1: 0,
3250
3256
  2: 1,
@@ -3328,7 +3334,7 @@ function Cr({ apps: e = br, defaultApp: t, activeApp: n, onAppChange: r, renderA
3328
3334
  })]
3329
3335
  });
3330
3336
  }
3331
- function wr({ sections: e = xr, activeId: t, activePrimaryId: n, onSectionChange: r, backTo: i, onBack: a, children: o, ariaLabel: s = "peasant sections" }) {
3337
+ function Tr({ sections: e = Sr, activeId: t, activePrimaryId: n, onSectionChange: r, backTo: i, onBack: a, children: o, ariaLabel: s = "peasant sections" }) {
3332
3338
  let c = n ?? t;
3333
3339
  return /* @__PURE__ */ u("div", {
3334
3340
  className: "iu-app-root",
@@ -3356,7 +3362,7 @@ function wr({ sections: e = xr, activeId: t, activePrimaryId: n, onSectionChange
3356
3362
  })]
3357
3363
  });
3358
3364
  }
3359
- function Tr({ sections: e = xr, activeId: t = void 0, hrefFor: n = void 0, LinkComponent: r = void 0, onSectionChange: i = void 0, className: a = "iu-subnav", itemClassName: o = "iu-subnav-item", activeItemClassName: s = "active", activeMarker: d = null, ariaLabel: f = "peasant sections" }) {
3365
+ function Er({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkComponent: r = void 0, onSectionChange: i = void 0, className: a = "iu-subnav", itemClassName: o = "iu-subnav-item", activeItemClassName: s = "active", activeMarker: d = null, ariaLabel: f = "peasant sections" }) {
3360
3366
  return /* @__PURE__ */ l("nav", {
3361
3367
  className: a,
3362
3368
  "aria-label": f,
@@ -3385,4 +3391,4 @@ function Tr({ sections: e = xr, activeId: t = void 0, hrefFor: n = void 0, LinkC
3385
3391
  });
3386
3392
  }
3387
3393
  //#endregion
3388
- export { z as $, Ht as A, nt as B, yt as C, Ot as D, kt as E, Vt as F, st as G, rt as H, Nt as I, et as J, ct as K, q as L, At as M, jt as N, Mt as O, Wt as P, We as Q, lt as R, bt as S, xt as T, it as U, at as V, tt as W, H as X, Xe as Y, B as Z, sn as _, we as _t, Cr as a, I as at, gt as b, yr as c, ze as ct, J as d, M as dt, Ue as et, an as f, je as ft, Jt as g, Ae as gt, cn as h, A as ht, br as i, P as it, Gt as j, Dt as k, ar as l, Ie as lt, dn as m, Pe as mt, wr as n, L as nt, _r as o, F as ot, Y as p, Me as pt, ot as q, Tr as r, Ve as rt, gr as s, Le as st, xr as t, He as tt, qt as u, Re as ut, ln as v, Ce as vt, vt as w, ht as x, _t as y, ut as z };
3394
+ export { We as $, Ht as A, rt as B, yt as C, Ot as D, kt as E, Vt as F, st as G, it as H, Nt as I, tt as J, ct as K, J as L, At as M, jt as N, Mt as O, Wt as P, B as Q, lt as R, bt as S, xt as T, at as U, ot as V, nt as W, U as X, Ze as Y, V as Z, sn as _, Te as _t, wr as a, L as at, gt as b, br as c, ze as ct, Y as d, Ie as dt, z as et, an as f, je as ft, Jt as g, A as gt, cn as h, M as ht, xr as i, I as it, Gt as j, Dt as k, or as l, N as lt, dn as m, Pe as mt, Tr as n, R as nt, vr as o, Ve as ot, X as p, Me as pt, q, Er as r, P as rt, _r as s, Le as st, Sr as t, Ue as tt, qt as u, Re as ut, ln as v, we as vt, vt as w, ht as x, _t as y, ut as z };