@peasant-labs/fairtrade 0.0.25 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{GraphLegend-sgixmPER.js → GraphLegend-kO2WP4yM.js} +1248 -1162
- package/dist/lib/analytics.css +1 -1
- package/dist/lib/analytics.js +29 -21
- package/dist/lib/base.css +4 -2
- package/dist/lib/commons.js +827 -841
- package/dist/lib/components.css +1 -1
- package/dist/lib/fonts.css +19 -21
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +418 -420
- package/dist/lib/tokens.css +7 -4
- package/dist/lib/tokens.json +20 -7
- package/dist/lib/types/BrandMark.d.ts +2 -2
- package/dist/lib/types/ConnectionState.d.ts +2 -2
- package/dist/lib/types/DataTable.d.ts +74 -10
- package/dist/lib/types/DiffView.d.ts +1 -1
- package/dist/lib/types/GroupedMultiSelect.d.ts +1 -1
- package/dist/lib/types/HelperGroup.d.ts +3 -3
- package/dist/lib/types/Publish.d.ts +10 -8
- package/dist/lib/types/Redaction.d.ts +12 -10
- package/dist/lib/types/Settings.d.ts +6 -0
- package/dist/lib/types/Timeline.d.ts +5 -5
- package/dist/lib/types/analytics/format.d.ts +5 -5
- package/dist/lib/types/format.d.ts +4 -0
- package/dist/lib/types/index.d.ts +2 -1
- package/dist/lib/types/redaction-categories.d.ts +2 -0
- package/dist/lib/types/transcript/TurnCard.d.ts +3 -1
- package/dist/lib/types/transcript/scroll-position.d.ts +10 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +1 -1
- package/dist/lib/types/transcript/title.d.ts +1 -1
- package/dist/lib/types/transcript/view-model.d.ts +2 -2
- package/dist/lib/ui-Cb4c1qQR.js +14087 -0
- package/dist/lib/ui.js +4 -4
- package/package.json +20 -12
- package/dist/lib/ui-C2WXsEFz.js +0 -23542
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { Check as
|
|
4
|
-
import { AllChangeBindings as
|
|
1
|
+
import { Fragment as e, cloneElement as t, isValidElement as n, useCallback as r, useEffect as i, useId as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
2
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
3
|
+
import { Check as p, ChevronDown as m, ChevronLeft as h, ChevronRight as g, Eye as _, EyeOff as v, FileCode as y, Folder as b, GitMerge as x, Maximize as S, Minus as ee, Plus as te, ScrollText as ne, Search as re, Star as ie, TriangleAlert as ae, Users as oe, Waypoints as C } from "lucide-react";
|
|
4
|
+
import { AllChangeBindings as se, AllDiffLineKinds as ce, AllEdgeViolationKinds as le, AllFileChangeStatuses as ue, AllInsightKinds as w, AllInsightProvenances as T, AllMapNodeKinds as E, AllReadAttributionStates as D, AllReadStateGrades as O, Harness as de, isChangeBinding as k, isDiffLineKind as fe, isEdgeViolationKind as pe, isFileChangeStatus as me, isHarness as he, isInsightKind as ge, isInsightProvenance as _e, isMapNodeKind as ve, isReadAttributionState as ye, isReadStateGrade as A } from "@peasant-labs/schema";
|
|
5
5
|
//#region src/ui/BrandMark.jsx
|
|
6
|
-
var
|
|
6
|
+
var be = {
|
|
7
|
+
github: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.807 1.305 3.492.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.4 3-.405 1.02.005 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",
|
|
7
8
|
claude: "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",
|
|
8
9
|
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
10
|
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",
|
|
@@ -11,10 +12,10 @@ var ve = {
|
|
|
11
12
|
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
13
|
strike: "M18.5 6L11 17.5h5.2L13.5 26 21 14.5h-5.2L18.5 6z",
|
|
13
14
|
pi: "M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z M517.36 400 H634.72 V634.72 H517.36 Z"
|
|
14
|
-
},
|
|
15
|
+
}, xe = {
|
|
15
16
|
strike: "6 6 20 20",
|
|
16
17
|
pi: "0 0 800 800"
|
|
17
|
-
},
|
|
18
|
+
}, Se = {
|
|
18
19
|
anthropic: "claude",
|
|
19
20
|
"claude-code": "claude",
|
|
20
21
|
google: "gemini",
|
|
@@ -24,7 +25,8 @@ var ve = {
|
|
|
24
25
|
"codex-cli": "openai",
|
|
25
26
|
chatgpt: "openai",
|
|
26
27
|
gpt: "openai"
|
|
27
|
-
},
|
|
28
|
+
}, Ce = {
|
|
29
|
+
github: "GitHub",
|
|
28
30
|
claude: "Claude",
|
|
29
31
|
gemini: "Gemini",
|
|
30
32
|
openai: "OpenAI",
|
|
@@ -33,13 +35,13 @@ var ve = {
|
|
|
33
35
|
strike: "Strike",
|
|
34
36
|
pi: "Pi"
|
|
35
37
|
};
|
|
36
|
-
function
|
|
38
|
+
function we(e) {
|
|
37
39
|
if (!e) return null;
|
|
38
|
-
let t = String(e).toLowerCase().trim(), n =
|
|
39
|
-
return
|
|
40
|
+
let t = String(e).toLowerCase().trim(), n = Se[t] || t;
|
|
41
|
+
return be[n] ? n : null;
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
let a =
|
|
43
|
+
function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
44
|
+
let a = we(e);
|
|
43
45
|
if (!a) return null;
|
|
44
46
|
let o = ["brand", r].filter(Boolean).join(" "), s = t == null ? {} : {
|
|
45
47
|
width: t,
|
|
@@ -50,28 +52,107 @@ function Se({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
|
50
52
|
}
|
|
51
53
|
}, c = n ? {
|
|
52
54
|
role: "img",
|
|
53
|
-
"aria-label": n === !0 ?
|
|
55
|
+
"aria-label": n === !0 ? Ce[a] : n,
|
|
54
56
|
focusable: "false"
|
|
55
57
|
} : {
|
|
56
58
|
"aria-hidden": "true",
|
|
57
59
|
focusable: "false"
|
|
58
60
|
};
|
|
59
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ d("svg", {
|
|
60
62
|
className: o,
|
|
61
|
-
viewBox:
|
|
63
|
+
viewBox: xe[a] ?? "0 0 24 24",
|
|
62
64
|
...s,
|
|
63
65
|
...c,
|
|
64
66
|
...i,
|
|
65
67
|
"data-brand": a,
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
d:
|
|
68
|
+
children: /* @__PURE__ */ d("path", {
|
|
69
|
+
d: be[a],
|
|
68
70
|
fillRule: a === "pi" ? "evenodd" : void 0
|
|
69
71
|
})
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
//#endregion
|
|
75
|
+
//#region src/ui/Tooltip.jsx
|
|
76
|
+
function Ee({ content: e, children: t, id: n }) {
|
|
77
|
+
let r = a(), i = n || `tip-${r}`, [o, s] = l(!1), c = () => s(!0), u = () => s(!1);
|
|
78
|
+
return /* @__PURE__ */ f("span", {
|
|
79
|
+
className: "tip-anchor",
|
|
80
|
+
onMouseEnter: c,
|
|
81
|
+
onMouseLeave: u,
|
|
82
|
+
onFocusCapture: c,
|
|
83
|
+
onBlurCapture: u,
|
|
84
|
+
onKeyDown: (e) => {
|
|
85
|
+
e.key === "Escape" && o && s(!1);
|
|
86
|
+
},
|
|
87
|
+
children: [/* @__PURE__ */ d(De, {
|
|
88
|
+
describedById: i,
|
|
89
|
+
children: t
|
|
90
|
+
}), o && /* @__PURE__ */ d("span", {
|
|
91
|
+
className: "tip-bubble",
|
|
92
|
+
role: "tooltip",
|
|
93
|
+
id: i,
|
|
94
|
+
children: e
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function De({ children: e, describedById: r }) {
|
|
99
|
+
if (n(e)) {
|
|
100
|
+
let n = e.props["aria-describedby"];
|
|
101
|
+
return t(e, { "aria-describedby": n ? `${n} ${r}` : r });
|
|
102
|
+
}
|
|
103
|
+
return e;
|
|
104
|
+
}
|
|
105
|
+
function Oe({ children: e, label: t, title: n, icon: r, content: o, footer: s, triggerClassName: u = "btn btn-secondary btn-sm", id: p }) {
|
|
106
|
+
let m = a(), h = p || `pop-${m}`, [g, _] = l(!1), v = c(null), y = c(null);
|
|
107
|
+
return i(() => {
|
|
108
|
+
if (!g) return;
|
|
109
|
+
let e = (e) => {
|
|
110
|
+
v.current && !v.current.contains(e.target) && _(!1);
|
|
111
|
+
}, t = (e) => {
|
|
112
|
+
e.key === "Escape" && (_(!1), y.current?.focus());
|
|
113
|
+
};
|
|
114
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
115
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
116
|
+
};
|
|
117
|
+
}, [g]), /* @__PURE__ */ f("span", {
|
|
118
|
+
className: "tip-anchor",
|
|
119
|
+
ref: v,
|
|
120
|
+
children: [/* @__PURE__ */ d("button", {
|
|
121
|
+
ref: y,
|
|
122
|
+
type: "button",
|
|
123
|
+
className: u,
|
|
124
|
+
"aria-expanded": g,
|
|
125
|
+
"aria-controls": h,
|
|
126
|
+
onClick: () => _((e) => !e),
|
|
127
|
+
children: e
|
|
128
|
+
}), g && /* @__PURE__ */ f("div", {
|
|
129
|
+
className: "pop-card",
|
|
130
|
+
role: "dialog",
|
|
131
|
+
"aria-label": t,
|
|
132
|
+
id: h,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ f("div", {
|
|
135
|
+
className: "pop-head",
|
|
136
|
+
children: [r && /* @__PURE__ */ d(r, { "aria-hidden": "true" }), /* @__PURE__ */ d("span", {
|
|
137
|
+
className: "pop-title",
|
|
138
|
+
children: n ?? t
|
|
139
|
+
})]
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ d("div", {
|
|
142
|
+
className: "pop-body",
|
|
143
|
+
children: o
|
|
144
|
+
}),
|
|
145
|
+
s && /* @__PURE__ */ d("div", {
|
|
146
|
+
className: "pop-foot",
|
|
147
|
+
children: s
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
73
154
|
//#region src/ui/provider-policy.js
|
|
74
|
-
var
|
|
155
|
+
var j = Object.freeze(Object.values(de)), M = Object.freeze({
|
|
75
156
|
"claude-code": "Claude Code",
|
|
76
157
|
"gemini-cli": "Gemini CLI",
|
|
77
158
|
codex: "Codex",
|
|
@@ -80,7 +161,7 @@ var Ce = Object.freeze(Object.values(O)), we = Object.freeze({
|
|
|
80
161
|
antigravity: "Google Antigravity",
|
|
81
162
|
strike: "Strike",
|
|
82
163
|
pi: "Pi"
|
|
83
|
-
}),
|
|
164
|
+
}), N = Object.freeze({
|
|
84
165
|
"claude-code": "claude",
|
|
85
166
|
"gemini-cli": "gemini",
|
|
86
167
|
codex: "openai",
|
|
@@ -89,7 +170,7 @@ var Ce = Object.freeze(Object.values(O)), we = Object.freeze({
|
|
|
89
170
|
antigravity: "gemini",
|
|
90
171
|
strike: "strike",
|
|
91
172
|
pi: "pi"
|
|
92
|
-
}),
|
|
173
|
+
}), ke = Object.freeze({
|
|
93
174
|
"claude-code": "amber",
|
|
94
175
|
"gemini-cli": "teal",
|
|
95
176
|
codex: "olive",
|
|
@@ -99,77 +180,77 @@ var Ce = Object.freeze(Object.values(O)), we = Object.freeze({
|
|
|
99
180
|
strike: "clay",
|
|
100
181
|
pi: "mauve"
|
|
101
182
|
});
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
183
|
+
function Ae(e, t) {
|
|
184
|
+
if (he(e)) return;
|
|
104
185
|
let n;
|
|
105
186
|
try {
|
|
106
187
|
n = JSON.stringify(e);
|
|
107
188
|
} catch {
|
|
108
189
|
n = String(e);
|
|
109
190
|
}
|
|
110
|
-
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 ${
|
|
191
|
+
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 ${j.join(", ")}.`);
|
|
111
192
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
193
|
+
function je(e) {
|
|
194
|
+
return Ae(e, "provider display-name resolution"), M[e];
|
|
114
195
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
196
|
+
function Me(e) {
|
|
197
|
+
return Ae(e, "provider brand resolution"), N[e];
|
|
117
198
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
199
|
+
function Ne(e) {
|
|
200
|
+
return Ae(e, "provider accent resolution"), ke[e];
|
|
120
201
|
}
|
|
121
202
|
//#endregion
|
|
122
203
|
//#region src/ui/Intensity.jsx
|
|
123
|
-
function
|
|
204
|
+
function Pe(e) {
|
|
124
205
|
let t = Math.round(Number(e) || 0);
|
|
125
206
|
return Math.max(0, Math.min(4, t));
|
|
126
207
|
}
|
|
127
|
-
function
|
|
208
|
+
function P(e, t) {
|
|
128
209
|
if (!t || t <= 0 || e <= 0) return 0;
|
|
129
210
|
let n = Math.min(e / t, 1);
|
|
130
211
|
return n < .25 ? 1 : n < .5 ? 2 : n < .9 ? 3 : 4;
|
|
131
212
|
}
|
|
132
|
-
function
|
|
213
|
+
function Fe(e) {
|
|
133
214
|
if (!e || e <= 0) return 0;
|
|
134
215
|
let t = Math.min(e, 1);
|
|
135
216
|
return t <= .25 ? 1 : t <= .5 ? 2 : t <= .75 ? 3 : 4;
|
|
136
217
|
}
|
|
137
|
-
function
|
|
218
|
+
function Ie(e, t) {
|
|
138
219
|
if (e <= 0 || t <= 0) return 0;
|
|
139
220
|
let n = Math.min(e / t, 1);
|
|
140
221
|
return n <= .25 ? 1 : n <= .5 ? 2 : n <= .75 ? 3 : 4;
|
|
141
222
|
}
|
|
142
|
-
function
|
|
223
|
+
function Le(e) {
|
|
143
224
|
let t = Number(e) || 0;
|
|
144
225
|
return t < 60 ? "xs" : t < 200 ? "sm" : t < 600 ? "md" : t < 1500 ? "lg" : "xl";
|
|
145
226
|
}
|
|
146
|
-
var
|
|
227
|
+
var Re = [
|
|
147
228
|
"none",
|
|
148
229
|
"low",
|
|
149
230
|
"some",
|
|
150
231
|
"most",
|
|
151
232
|
"full"
|
|
152
233
|
];
|
|
153
|
-
function
|
|
154
|
-
let o =
|
|
155
|
-
return /* @__PURE__ */
|
|
234
|
+
function ze({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...a }) {
|
|
235
|
+
let o = Pe(e);
|
|
236
|
+
return /* @__PURE__ */ d("span", {
|
|
156
237
|
className: `ir-swatch${n === "lg" ? " ir-swatch--lg" : ""}${i ? ` ${i}` : ""}`,
|
|
157
238
|
"data-level": o,
|
|
158
239
|
"data-accent": t || void 0,
|
|
159
240
|
role: "img",
|
|
160
|
-
"aria-label": r || `intensity ${o} of 4 (${
|
|
241
|
+
"aria-label": r || `intensity ${o} of 4 (${Re[o]})`,
|
|
161
242
|
...a
|
|
162
243
|
});
|
|
163
244
|
}
|
|
164
|
-
function
|
|
165
|
-
return /* @__PURE__ */
|
|
245
|
+
function F({ title: e = "coverage", words: t = Re, className: n = "" }) {
|
|
246
|
+
return /* @__PURE__ */ f("div", {
|
|
166
247
|
className: `ir-scope ir-legend${n ? ` ${n}` : ""}`,
|
|
167
248
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ d("span", {
|
|
169
250
|
className: "ir-legend__title",
|
|
170
251
|
children: e
|
|
171
252
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ d("div", {
|
|
173
254
|
className: "ir-legend__steps",
|
|
174
255
|
children: [
|
|
175
256
|
0,
|
|
@@ -177,87 +258,87 @@ function Pe({ title: e = "coverage", words: t = Me, className: n = "" }) {
|
|
|
177
258
|
2,
|
|
178
259
|
3,
|
|
179
260
|
4
|
|
180
|
-
].map((e) => /* @__PURE__ */
|
|
261
|
+
].map((e) => /* @__PURE__ */ f("div", {
|
|
181
262
|
className: "ir-legend__step",
|
|
182
263
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ d("span", {
|
|
184
265
|
className: "ir-legend__cell",
|
|
185
266
|
"data-level": e,
|
|
186
267
|
"aria-hidden": "true"
|
|
187
268
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ d("span", {
|
|
189
270
|
className: "ir-legend__num",
|
|
190
271
|
children: e
|
|
191
272
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ d("span", {
|
|
193
274
|
className: "ir-legend__label",
|
|
194
275
|
children: t[e]
|
|
195
276
|
})
|
|
196
277
|
]
|
|
197
278
|
}, e))
|
|
198
279
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ f("div", {
|
|
200
281
|
className: "ir-legend__ends",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ d("span", { children: "none" }), /* @__PURE__ */ d("span", { children: "full" })]
|
|
202
283
|
})
|
|
203
284
|
]
|
|
204
285
|
});
|
|
205
286
|
}
|
|
206
|
-
function
|
|
207
|
-
let o = t ? t.map(
|
|
208
|
-
return /* @__PURE__ */
|
|
287
|
+
function I({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity heatmap", className: a = "" }) {
|
|
288
|
+
let o = t ? t.map(Pe) : (e || []).map((t) => Ie(t, n ?? Math.max(1, ...e || [1])));
|
|
289
|
+
return /* @__PURE__ */ d("div", {
|
|
209
290
|
className: `ir-scope ir-heatmap${a ? ` ${a}` : ""}`,
|
|
210
291
|
role: "img",
|
|
211
292
|
"aria-label": i,
|
|
212
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
293
|
+
children: o.map((e, t) => /* @__PURE__ */ d("span", {
|
|
213
294
|
className: "ir-heatmap__cell",
|
|
214
295
|
"data-level": e,
|
|
215
|
-
title: `${r?.[t] ?? `cell ${t + 1}`}: ${
|
|
296
|
+
title: `${r?.[t] ?? `cell ${t + 1}`}: ${Re[e]} (${e}/4)`
|
|
216
297
|
}, t))
|
|
217
298
|
});
|
|
218
299
|
}
|
|
219
|
-
function
|
|
220
|
-
let g = i == null ?
|
|
300
|
+
function L({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected: a = !1, violation: o = 0, effortPct: s, size: c, as: l = "button", onClick: u, className: m = "", ...h }) {
|
|
301
|
+
let g = i == null ? Pe(n) : P(r ?? 0, i), _ = c || Le(t), v = Math.max(0, Math.round(Number(o) || 0)), y = s != null && s > 0, b = y ? Fe(s > 1 ? s / 100 : s) : 0, x = [
|
|
221
302
|
e,
|
|
222
303
|
i == null ? `coverage ${g} of 4` : `${r ?? 0} of ${i} recorded`,
|
|
223
304
|
t == null ? null : `${t} loc`,
|
|
224
305
|
v > 0 ? `${v} violation${v === 1 ? "" : "s"}` : null,
|
|
225
306
|
a ? "selected" : null
|
|
226
|
-
].filter(Boolean).join("
|
|
227
|
-
return /* @__PURE__ */
|
|
307
|
+
].filter(Boolean).join(", "), S = l, ee = S === "button";
|
|
308
|
+
return /* @__PURE__ */ f(S, {
|
|
228
309
|
className: `ir-node ir-node--${_}${m ? ` ${m}` : ""}`,
|
|
229
310
|
"data-coverage": g,
|
|
230
311
|
"data-selected": a ? "true" : void 0,
|
|
231
|
-
type:
|
|
232
|
-
"aria-pressed":
|
|
312
|
+
type: ee ? "button" : void 0,
|
|
313
|
+
"aria-pressed": ee ? a : void 0,
|
|
233
314
|
"aria-label": x,
|
|
234
|
-
onClick:
|
|
315
|
+
onClick: u,
|
|
235
316
|
...h,
|
|
236
317
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ f("span", {
|
|
238
319
|
className: "ir-node__head",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ d("span", {
|
|
240
321
|
className: "ir-node__label",
|
|
241
322
|
children: e
|
|
242
|
-
}), v > 0 && /* @__PURE__ */
|
|
323
|
+
}), v > 0 && /* @__PURE__ */ f("span", {
|
|
243
324
|
className: "ir-node__badge",
|
|
244
325
|
"aria-hidden": "true",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ d(ae, { "aria-hidden": "true" }), /* @__PURE__ */ d("span", {
|
|
246
327
|
className: "tnum",
|
|
247
328
|
children: v
|
|
248
329
|
})]
|
|
249
330
|
})]
|
|
250
331
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ f("span", {
|
|
252
333
|
className: "ir-node__count",
|
|
253
|
-
children: [i == null ? `cov ${g}/4` : `${r ?? 0}/${i}`, t == null ? "" :
|
|
334
|
+
children: [i == null ? `cov ${g}/4` : `${r ?? 0}/${i}`, t == null ? "" : `, ${t} loc`]
|
|
254
335
|
}),
|
|
255
|
-
a && /* @__PURE__ */
|
|
336
|
+
a && /* @__PURE__ */ d("span", {
|
|
256
337
|
className: "ir-node__mark",
|
|
257
338
|
"aria-hidden": "true",
|
|
258
|
-
children: /* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ d(p, { "aria-hidden": "true" })
|
|
259
340
|
}),
|
|
260
|
-
y && /* @__PURE__ */
|
|
341
|
+
y && /* @__PURE__ */ d("span", {
|
|
261
342
|
className: "ir-node__effort",
|
|
262
343
|
"data-level": b,
|
|
263
344
|
"aria-hidden": "true"
|
|
@@ -265,8 +346,8 @@ function Ie({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
|
|
|
265
346
|
]
|
|
266
347
|
});
|
|
267
348
|
}
|
|
268
|
-
function
|
|
269
|
-
return /* @__PURE__ */
|
|
349
|
+
function Be({ children: e, className: t = "", ...n }) {
|
|
350
|
+
return /* @__PURE__ */ d("div", {
|
|
270
351
|
className: `ir-scope${t ? ` ${t}` : ""}`,
|
|
271
352
|
...n,
|
|
272
353
|
children: e
|
|
@@ -274,72 +355,72 @@ function Le({ children: e, className: t = "", ...n }) {
|
|
|
274
355
|
}
|
|
275
356
|
//#endregion
|
|
276
357
|
//#region src/ui/ProviderIcon.jsx
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return `var(--${
|
|
280
|
-
}
|
|
281
|
-
function
|
|
282
|
-
|
|
283
|
-
let o =
|
|
284
|
-
return /* @__PURE__ */
|
|
358
|
+
var R = j, z = ke;
|
|
359
|
+
function Ve(e) {
|
|
360
|
+
return `var(--${Ne(e)})`;
|
|
361
|
+
}
|
|
362
|
+
function B({ harness: e, size: t, accent: n = !1, label: r, className: i = "", ...a }) {
|
|
363
|
+
Ae(e, "ProviderIcon render in src/ui/ProviderIcon.jsx");
|
|
364
|
+
let o = Me(e), s = ["pv-icon", i].filter(Boolean).join(" "), c = n ? { color: Ve(e) } : void 0, l = r === !0 ? je(e) : r;
|
|
365
|
+
return /* @__PURE__ */ d("span", {
|
|
285
366
|
className: s,
|
|
286
367
|
style: c,
|
|
287
368
|
...a,
|
|
288
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ d(Te, {
|
|
289
370
|
name: o,
|
|
290
371
|
size: t,
|
|
291
|
-
label:
|
|
372
|
+
label: l
|
|
292
373
|
})
|
|
293
374
|
});
|
|
294
375
|
}
|
|
295
|
-
function
|
|
296
|
-
return
|
|
376
|
+
function V({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
377
|
+
return Ae(e, "ProviderTag render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ f("span", {
|
|
297
378
|
className: ["pv-tag", n].filter(Boolean).join(" "),
|
|
298
379
|
...r,
|
|
299
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ d(B, {
|
|
300
381
|
harness: e,
|
|
301
382
|
accent: t
|
|
302
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ d("span", {
|
|
303
384
|
className: "pv-tag-label",
|
|
304
385
|
children: e
|
|
305
386
|
})]
|
|
306
387
|
});
|
|
307
388
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
389
|
+
function He({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
390
|
+
return Ae(e, "ProviderName render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ f("span", {
|
|
310
391
|
className: ["pv-name", n].filter(Boolean).join(" "),
|
|
311
|
-
style: t ? { color:
|
|
392
|
+
style: t ? { color: Ve(e) } : void 0,
|
|
312
393
|
...r,
|
|
313
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ d(B, { harness: e }), /* @__PURE__ */ d("span", {
|
|
314
395
|
className: "pv-name-label",
|
|
315
396
|
children: e
|
|
316
397
|
})]
|
|
317
398
|
});
|
|
318
399
|
}
|
|
319
|
-
function
|
|
320
|
-
return /* @__PURE__ */
|
|
400
|
+
function H({ className: e = "", ...t }) {
|
|
401
|
+
return /* @__PURE__ */ d("ul", {
|
|
321
402
|
className: ["pv-legend", e].filter(Boolean).join(" "),
|
|
322
403
|
...t,
|
|
323
|
-
children:
|
|
324
|
-
let t =
|
|
325
|
-
return /* @__PURE__ */
|
|
404
|
+
children: R.map((e) => {
|
|
405
|
+
let t = Ne(e);
|
|
406
|
+
return /* @__PURE__ */ f("li", {
|
|
326
407
|
className: "pv-legend-row",
|
|
327
408
|
children: [
|
|
328
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ d(B, {
|
|
329
410
|
harness: e,
|
|
330
411
|
accent: !0,
|
|
331
412
|
className: "pv-legend-mark"
|
|
332
413
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ d("span", {
|
|
334
415
|
className: "pv-legend-name",
|
|
335
416
|
children: e
|
|
336
417
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ d("span", {
|
|
338
419
|
className: "pv-swatch",
|
|
339
420
|
style: { background: `var(--${t})` },
|
|
340
421
|
"aria-hidden": "true"
|
|
341
422
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ d("span", {
|
|
343
424
|
className: "pv-legend-token",
|
|
344
425
|
children: t
|
|
345
426
|
})
|
|
@@ -349,8 +430,25 @@ function B({ className: e = "", ...t }) {
|
|
|
349
430
|
});
|
|
350
431
|
}
|
|
351
432
|
//#endregion
|
|
433
|
+
//#region src/ui/format.js
|
|
434
|
+
function U(e) {
|
|
435
|
+
return new Intl.NumberFormat("en-US", {
|
|
436
|
+
notation: "compact",
|
|
437
|
+
maximumFractionDigits: 1
|
|
438
|
+
}).format(e).toLowerCase();
|
|
439
|
+
}
|
|
440
|
+
function W(e) {
|
|
441
|
+
let t = new Date(e);
|
|
442
|
+
return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
|
|
443
|
+
month: "short",
|
|
444
|
+
day: "numeric",
|
|
445
|
+
year: "numeric",
|
|
446
|
+
timeZone: "UTC"
|
|
447
|
+
}).toLowerCase();
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
352
450
|
//#region src/ui/graph/GhostCommitNode.jsx
|
|
353
|
-
var
|
|
451
|
+
var G = Object.freeze({
|
|
354
452
|
hash: "matched by hash",
|
|
355
453
|
patch_id: "matched by patch content",
|
|
356
454
|
author_identity: "matched by author and time",
|
|
@@ -358,72 +456,66 @@ var Be = Object.freeze({
|
|
|
358
456
|
temporal: "matched by nearby time only",
|
|
359
457
|
none: "no match found"
|
|
360
458
|
});
|
|
361
|
-
function
|
|
362
|
-
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
459
|
+
function Ue({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i, className: a = "", ...o }) {
|
|
460
|
+
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${G[r] ?? r}, ${i} confidence`;
|
|
461
|
+
return /* @__PURE__ */ d(Ee, {
|
|
462
|
+
content: s,
|
|
463
|
+
children: /* @__PURE__ */ d("span", {
|
|
464
|
+
className: `tlp-ghost-node tlp-terminal-${i}${a ? ` ${a}` : ""}`,
|
|
465
|
+
role: "img",
|
|
466
|
+
"aria-label": `rewritten commit ${e.slice(0, 8)}${t ? `: ${t}` : ""}: ${s}`,
|
|
467
|
+
tabIndex: 0,
|
|
468
|
+
...o,
|
|
469
|
+
children: /* @__PURE__ */ d("svg", {
|
|
470
|
+
className: "tlp-ghost-diamond",
|
|
471
|
+
viewBox: "0 0 9 9",
|
|
472
|
+
width: "9",
|
|
473
|
+
height: "9",
|
|
474
|
+
"aria-hidden": "true",
|
|
475
|
+
children: /* @__PURE__ */ d("rect", {
|
|
476
|
+
x: "1.3",
|
|
477
|
+
y: "1.3",
|
|
478
|
+
width: "6.4",
|
|
479
|
+
height: "6.4",
|
|
480
|
+
transform: "rotate(45 4.5 4.5)"
|
|
481
|
+
})
|
|
381
482
|
})
|
|
382
483
|
})
|
|
383
484
|
});
|
|
384
485
|
}
|
|
385
486
|
//#endregion
|
|
386
487
|
//#region src/ui/graph/SessionLane.jsx
|
|
387
|
-
function
|
|
388
|
-
let
|
|
488
|
+
function We({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i = !1, onHover: a, onSelect: o, unresolvedGhosts: s = [], className: c = "", ...l }) {
|
|
489
|
+
let u = [
|
|
389
490
|
"tlp-session-lane",
|
|
390
491
|
r && "tlp-session-lane-hover",
|
|
391
492
|
i && "tlp-session-lane-sel",
|
|
392
493
|
c
|
|
393
|
-
].filter(Boolean).join(" "), p = t || e
|
|
394
|
-
return /* @__PURE__ */
|
|
494
|
+
].filter(Boolean).join(" "), p = t || e;
|
|
495
|
+
return /* @__PURE__ */ f("span", {
|
|
395
496
|
className: "tlp-session-lane-group",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ f("button", {
|
|
397
498
|
type: "button",
|
|
398
|
-
className:
|
|
499
|
+
className: u,
|
|
399
500
|
"aria-pressed": i,
|
|
400
501
|
onMouseEnter: () => a?.(e),
|
|
401
502
|
onMouseLeave: () => a?.(null),
|
|
402
503
|
onFocus: () => a?.(e),
|
|
403
504
|
onBlur: () => a?.(null),
|
|
404
505
|
onClick: () => o?.(e),
|
|
405
|
-
...
|
|
406
|
-
children: [
|
|
407
|
-
n
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}),
|
|
415
|
-
/* @__PURE__ */ l("span", {
|
|
416
|
-
className: "tlp-sr",
|
|
417
|
-
role: "status",
|
|
418
|
-
"aria-live": "polite",
|
|
419
|
-
children: m
|
|
420
|
-
})
|
|
421
|
-
]
|
|
422
|
-
}), s.length > 0 && /* @__PURE__ */ l("span", {
|
|
506
|
+
...l,
|
|
507
|
+
children: [n && /* @__PURE__ */ d(B, {
|
|
508
|
+
harness: n,
|
|
509
|
+
label: !0
|
|
510
|
+
}), /* @__PURE__ */ d("span", {
|
|
511
|
+
className: "tlp-session-lane-title",
|
|
512
|
+
children: p
|
|
513
|
+
})]
|
|
514
|
+
}), s.length > 0 && /* @__PURE__ */ d("span", {
|
|
423
515
|
className: "tlp-session-lane-ghosts",
|
|
424
516
|
role: "group",
|
|
425
517
|
"aria-label": "session-era commits with no recorded mapping",
|
|
426
|
-
children: s.map((e) => /* @__PURE__ */
|
|
518
|
+
children: s.map((e) => /* @__PURE__ */ d(Ue, {
|
|
427
519
|
ghostHash: e.ghostHash,
|
|
428
520
|
subject: e.subject,
|
|
429
521
|
resolution: e.resolution,
|
|
@@ -435,30 +527,30 @@ function V({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
435
527
|
}
|
|
436
528
|
//#endregion
|
|
437
529
|
//#region src/ui/graph/GhostGroup.jsx
|
|
438
|
-
function
|
|
530
|
+
function Ge({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i = "", ...a }) {
|
|
439
531
|
let o = `${t.length} session-era commit${t.length === 1 ? "" : "s"}`;
|
|
440
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ f("div", {
|
|
441
533
|
className: `tlp-ghost-group${i ? ` ${i}` : ""}`,
|
|
442
534
|
...a,
|
|
443
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ f("button", {
|
|
444
536
|
type: "button",
|
|
445
537
|
className: "tlp-ghost-group-toggle",
|
|
446
538
|
"aria-expanded": n,
|
|
447
539
|
"aria-label": `${o}, mapped to ${e.slice(0, 8)}`,
|
|
448
540
|
onClick: () => r(e),
|
|
449
541
|
children: [
|
|
450
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ d(g, {
|
|
451
543
|
className: `tlp-ghost-group-chevron${n ? " tlp-ghost-group-chevron-open" : ""}`,
|
|
452
544
|
"aria-hidden": "true"
|
|
453
545
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ d("span", {
|
|
455
547
|
className: "tlp-ghost-group-stack",
|
|
456
548
|
"aria-hidden": "true",
|
|
457
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ d("svg", {
|
|
458
550
|
viewBox: "0 0 9 9",
|
|
459
551
|
width: "9",
|
|
460
552
|
height: "9",
|
|
461
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ d("rect", {
|
|
462
554
|
x: "1.3",
|
|
463
555
|
y: "1.3",
|
|
464
556
|
width: "6.4",
|
|
@@ -467,30 +559,24 @@ function He({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
467
559
|
})
|
|
468
560
|
})
|
|
469
561
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ d("span", {
|
|
471
563
|
className: "tnum tlp-ghost-group-count",
|
|
472
564
|
children: t.length
|
|
473
565
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ d("span", {
|
|
475
567
|
className: "tlp-ghost-group-label",
|
|
476
568
|
children: o
|
|
477
|
-
}),
|
|
478
|
-
/* @__PURE__ */ l("span", {
|
|
479
|
-
className: "tlp-sr",
|
|
480
|
-
role: "status",
|
|
481
|
-
"aria-live": "polite",
|
|
482
|
-
children: n ? `${o} expanded` : `${o} collapsed`
|
|
483
569
|
})
|
|
484
570
|
]
|
|
485
|
-
}), n && /* @__PURE__ */
|
|
571
|
+
}), n && /* @__PURE__ */ d("ul", {
|
|
486
572
|
className: "tlp-ghost-group-list",
|
|
487
|
-
children: t.map((e) => /* @__PURE__ */
|
|
573
|
+
children: t.map((e) => /* @__PURE__ */ f("li", { children: [/* @__PURE__ */ d(Ue, {
|
|
488
574
|
ghostHash: e.ghostHash,
|
|
489
575
|
subject: e.subject,
|
|
490
576
|
resolution: e.resolution,
|
|
491
577
|
method: e.method,
|
|
492
578
|
confidence: e.confidence
|
|
493
|
-
}), e.subject && /* @__PURE__ */
|
|
579
|
+
}), e.subject && /* @__PURE__ */ d("span", {
|
|
494
580
|
className: "tlp-ghost-subject",
|
|
495
581
|
children: e.subject
|
|
496
582
|
})] }, e.ghostHash))
|
|
@@ -499,54 +585,50 @@ function He({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
499
585
|
}
|
|
500
586
|
//#endregion
|
|
501
587
|
//#region src/ui/graph/SessionOverflowDisclosure.jsx
|
|
502
|
-
function
|
|
503
|
-
|
|
588
|
+
function Ke({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i, itemLabel: a = "sessions", className: o = "", ...s }) {
|
|
589
|
+
if (t.length === 0) return null;
|
|
590
|
+
let c = t.length === 1 ? {
|
|
591
|
+
sessions: "session",
|
|
592
|
+
files: "file"
|
|
593
|
+
}[a] ?? a : a;
|
|
594
|
+
return /* @__PURE__ */ f("span", {
|
|
504
595
|
className: `tlp-overflow${o ? ` ${o}` : ""}`,
|
|
505
596
|
...s,
|
|
506
|
-
children: [
|
|
507
|
-
|
|
597
|
+
children: [/* @__PURE__ */ f("button", {
|
|
598
|
+
type: "button",
|
|
599
|
+
className: "tlp-overflow-toggle",
|
|
600
|
+
"aria-expanded": n,
|
|
601
|
+
"aria-label": `${t.length} more ${c}`,
|
|
602
|
+
onClick: () => r(e),
|
|
603
|
+
children: [
|
|
604
|
+
/* @__PURE__ */ f("span", {
|
|
605
|
+
className: "tnum",
|
|
606
|
+
children: ["+", t.length]
|
|
607
|
+
}),
|
|
608
|
+
" more ",
|
|
609
|
+
c
|
|
610
|
+
]
|
|
611
|
+
}), n && /* @__PURE__ */ d("span", {
|
|
612
|
+
className: "tlp-overflow-list",
|
|
613
|
+
role: "group",
|
|
614
|
+
"aria-label": `all ${a}`,
|
|
615
|
+
children: t.map((e) => /* @__PURE__ */ f("button", {
|
|
508
616
|
type: "button",
|
|
509
|
-
className: "tlp-overflow-
|
|
510
|
-
"
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
" more ",
|
|
519
|
-
a
|
|
520
|
-
]
|
|
521
|
-
}),
|
|
522
|
-
/* @__PURE__ */ l("span", {
|
|
523
|
-
className: "tlp-sr",
|
|
524
|
-
role: "status",
|
|
525
|
-
"aria-live": "polite",
|
|
526
|
-
children: n ? `${t.length} more ${a} expanded` : ""
|
|
527
|
-
}),
|
|
528
|
-
n && /* @__PURE__ */ l("span", {
|
|
529
|
-
className: "tlp-overflow-list",
|
|
530
|
-
role: "group",
|
|
531
|
-
"aria-label": `all ${a}`,
|
|
532
|
-
children: t.map((e) => /* @__PURE__ */ u("button", {
|
|
533
|
-
type: "button",
|
|
534
|
-
className: "tlp-overflow-item",
|
|
535
|
-
"data-session-id": e.sessionId,
|
|
536
|
-
onClick: () => i?.(e.sessionId),
|
|
537
|
-
children: [e.harness && /* @__PURE__ */ l(R, {
|
|
538
|
-
harness: e.harness,
|
|
539
|
-
label: !0
|
|
540
|
-
}), e.title || e.sessionId]
|
|
541
|
-
}, e.sessionId))
|
|
542
|
-
})
|
|
543
|
-
]
|
|
617
|
+
className: "tlp-overflow-item",
|
|
618
|
+
"data-session-id": e.sessionId,
|
|
619
|
+
onClick: () => i?.(e.sessionId),
|
|
620
|
+
children: [e.harness && /* @__PURE__ */ d(B, {
|
|
621
|
+
harness: e.harness,
|
|
622
|
+
label: !0
|
|
623
|
+
}), e.title || e.sessionId]
|
|
624
|
+
}, e.sessionId))
|
|
625
|
+
})]
|
|
544
626
|
});
|
|
545
627
|
}
|
|
546
628
|
//#endregion
|
|
547
629
|
//#region src/ui/graph/HighlightEdge.jsx
|
|
548
|
-
function
|
|
549
|
-
return /* @__PURE__ */
|
|
630
|
+
function qe({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
631
|
+
return /* @__PURE__ */ d("line", {
|
|
550
632
|
className: [
|
|
551
633
|
"tlp-highlight-edge",
|
|
552
634
|
`tlp-highlight-edge-${e}`,
|
|
@@ -562,23 +644,23 @@ function U({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
|
562
644
|
}
|
|
563
645
|
//#endregion
|
|
564
646
|
//#region src/ui/graph/TouchedFileCluster.jsx
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
let s = t.slice(0,
|
|
647
|
+
var Je = 8;
|
|
648
|
+
function Ye({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, className: a = "", ...o }) {
|
|
649
|
+
let s = t.slice(0, Je), c = t.slice(Je).map((e) => ({
|
|
568
650
|
sessionId: e,
|
|
569
651
|
title: e
|
|
570
652
|
}));
|
|
571
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ f("div", {
|
|
572
654
|
className: `tlp-file-cluster${a ? ` ${a}` : ""}`,
|
|
573
655
|
role: "group",
|
|
574
656
|
"aria-label": "touched files",
|
|
575
657
|
...o,
|
|
576
|
-
children: [s.map((e) => /* @__PURE__ */
|
|
658
|
+
children: [s.map((e) => /* @__PURE__ */ d("button", {
|
|
577
659
|
type: "button",
|
|
578
660
|
className: "tlp-file-cluster-item",
|
|
579
661
|
onClick: () => i?.(e),
|
|
580
662
|
children: e
|
|
581
|
-
}, e)), /* @__PURE__ */
|
|
663
|
+
}, e)), /* @__PURE__ */ d(Ke, {
|
|
582
664
|
commitHash: e,
|
|
583
665
|
overflow: c,
|
|
584
666
|
expanded: n,
|
|
@@ -590,9 +672,9 @@ function G({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
|
|
|
590
672
|
}
|
|
591
673
|
//#endregion
|
|
592
674
|
//#region src/ui/CommitGraph.jsx
|
|
593
|
-
var
|
|
594
|
-
function
|
|
595
|
-
let
|
|
675
|
+
var Xe = 22, K = 13, Ze = 13, Qe = 9, $e = "3 3", q = (e) => K + e * Xe, et = (e) => q(Math.max(e - 1, 0)) + Ze;
|
|
676
|
+
function tt({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpenSession: i, hasMore: a = !1, onShowOlder: u, label: p = "commit history", className: h = "", sessionLanes: g, hoveredSessionId: _ = null, selectedSessionId: v = null, onHoverSession: y, onSelectSession: b, highlightSelected: x, highlightHovered: S, ghostGroupsByCommit: ee, expandedGhostGroups: te, onToggleGhostGroup: ne, expandedCommitSessions: re, onToggleCommitSessions: ie, touchedFilesByCommit: ae, onOpenTouchedFile: oe, ...C }) {
|
|
677
|
+
let se = s(() => new Set(te ?? []), [te]), ce = s(() => new Set(re ?? []), [re]), le = s(() => /* @__PURE__ */ new Set([...x?.commitHashes ?? [], ...x?.ghostHashes ?? []]), [x]), ue = s(() => /* @__PURE__ */ new Set([...S?.commitHashes ?? [], ...S?.ghostHashes ?? []]), [S]), w = s(() => e.reduce((e, t) => Math.max(e, (t.lane ?? 0) + 1), 1), [e]), T = s(() => {
|
|
596
678
|
let t = new Map(e.map((e) => [e.id, e.lane ?? 0])), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
597
679
|
return e.forEach((e, t) => {
|
|
598
680
|
let i = e.lane ?? 0;
|
|
@@ -613,8 +695,8 @@ function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
613
695
|
laneDown: i < c
|
|
614
696
|
};
|
|
615
697
|
});
|
|
616
|
-
}, [e]),
|
|
617
|
-
let e = new Set(
|
|
698
|
+
}, [e]), E = s(() => {
|
|
699
|
+
let e = new Set(T.map((e) => e.commit.id)), t = new Set((g ?? []).map((e) => e.sessionId)), n = [...(x?.edges ?? []).map((e) => ({
|
|
618
700
|
...e,
|
|
619
701
|
weight: "primary"
|
|
620
702
|
})), ...(S?.edges ?? []).map((e) => ({
|
|
@@ -631,22 +713,22 @@ function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
631
713
|
}]);
|
|
632
714
|
});
|
|
633
715
|
}, [
|
|
634
|
-
|
|
716
|
+
T,
|
|
635
717
|
g,
|
|
636
718
|
x,
|
|
637
719
|
S
|
|
638
|
-
]),
|
|
639
|
-
|
|
640
|
-
let e =
|
|
641
|
-
if (!e ||
|
|
642
|
-
|
|
720
|
+
]), D = c(null), [O, de] = l([]);
|
|
721
|
+
o(() => {
|
|
722
|
+
let e = D.current;
|
|
723
|
+
if (!e || E.length === 0) {
|
|
724
|
+
de([]);
|
|
643
725
|
return;
|
|
644
726
|
}
|
|
645
727
|
let t = () => {
|
|
646
728
|
let t = e.querySelector(".cg-history");
|
|
647
729
|
if (!t) return;
|
|
648
730
|
let n = t.getBoundingClientRect(), r = new Map([...e.querySelectorAll("[data-timeline-session-id]")].map((e) => [e.getAttribute("data-timeline-session-id"), e])), i = new Map([...e.querySelectorAll(".cg-history-row[data-commit-hash]")].map((e) => [e.getAttribute("data-commit-hash"), e]));
|
|
649
|
-
|
|
731
|
+
de(E.flatMap((e) => {
|
|
650
732
|
let t = r.get(e.sessionId)?.getBoundingClientRect(), a = i.get(e.commitHash)?.querySelector(".cg-dot")?.getBoundingClientRect();
|
|
651
733
|
return !t || !a ? [] : [{
|
|
652
734
|
...e,
|
|
@@ -662,28 +744,28 @@ function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
662
744
|
if (t(), typeof ResizeObserver > "u") return;
|
|
663
745
|
let n = new ResizeObserver(t);
|
|
664
746
|
return n.observe(e), () => n.disconnect();
|
|
665
|
-
}, [
|
|
666
|
-
let
|
|
667
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
668
|
-
className:
|
|
669
|
-
...
|
|
670
|
-
children: /* @__PURE__ */
|
|
747
|
+
}, [E]);
|
|
748
|
+
let k = et(w), fe = ["cg", h].filter(Boolean).join(" ");
|
|
749
|
+
return e.length === 0 ? /* @__PURE__ */ d("div", {
|
|
750
|
+
className: fe,
|
|
751
|
+
...C,
|
|
752
|
+
children: /* @__PURE__ */ d("p", {
|
|
671
753
|
className: "cg-empty",
|
|
672
754
|
children: "no commits to show."
|
|
673
755
|
})
|
|
674
|
-
}) : /* @__PURE__ */
|
|
675
|
-
ref:
|
|
676
|
-
className:
|
|
756
|
+
}) : /* @__PURE__ */ f("div", {
|
|
757
|
+
ref: D,
|
|
758
|
+
className: fe,
|
|
677
759
|
role: "list",
|
|
678
|
-
"aria-label":
|
|
679
|
-
...
|
|
760
|
+
"aria-label": p,
|
|
761
|
+
...C,
|
|
680
762
|
children: [
|
|
681
|
-
g && g.length > 0 && /* @__PURE__ */
|
|
763
|
+
g && g.length > 0 && /* @__PURE__ */ d("div", {
|
|
682
764
|
className: "cg-session-spine",
|
|
683
|
-
role: "
|
|
765
|
+
role: "listitem",
|
|
684
766
|
"aria-label": "recorded sessions",
|
|
685
767
|
style: { gridTemplateColumns: `repeat(${g.length}, minmax(0, 1fr))` },
|
|
686
|
-
children: g.map((e) => /* @__PURE__ */
|
|
768
|
+
children: g.map((e) => /* @__PURE__ */ d(We, {
|
|
687
769
|
sessionId: e.sessionId,
|
|
688
770
|
title: e.title,
|
|
689
771
|
harness: e.harness,
|
|
@@ -695,72 +777,74 @@ function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
695
777
|
"data-timeline-session-id": e.sessionId
|
|
696
778
|
}, e.sessionId))
|
|
697
779
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ f("div", {
|
|
699
781
|
className: "cg-history",
|
|
700
|
-
children: [
|
|
782
|
+
children: [O.length > 0 && /* @__PURE__ */ d("svg", {
|
|
701
783
|
className: "cg-highlight-layer",
|
|
702
784
|
"aria-hidden": "true",
|
|
703
|
-
children:
|
|
785
|
+
children: O.map((e) => /* @__PURE__ */ d(qe, {
|
|
704
786
|
weight: e.weight,
|
|
705
787
|
geometry: e.geometry,
|
|
706
788
|
"data-session-id": e.sessionId,
|
|
707
789
|
"data-commit-hash": e.commitHash
|
|
708
790
|
}, e.key))
|
|
709
|
-
}),
|
|
791
|
+
}), T.map((e) => /* @__PURE__ */ f("div", {
|
|
710
792
|
className: "cg-history-row",
|
|
793
|
+
role: "listitem",
|
|
711
794
|
"data-commit-hash": e.commit.id,
|
|
712
|
-
children: [/* @__PURE__ */
|
|
795
|
+
children: [/* @__PURE__ */ d(nt, {
|
|
713
796
|
row: e,
|
|
714
|
-
width:
|
|
797
|
+
width: k,
|
|
715
798
|
selected: e.commit.id === t,
|
|
716
799
|
onNavigate: n,
|
|
717
800
|
onSelect: r,
|
|
718
|
-
onOpenSession:
|
|
719
|
-
highlightWeight:
|
|
720
|
-
expandedSessions:
|
|
721
|
-
onToggleSessions:
|
|
722
|
-
touchedFiles:
|
|
723
|
-
expandedFiles:
|
|
724
|
-
onOpenTouchedFile:
|
|
725
|
-
}),
|
|
801
|
+
onOpenSession: i,
|
|
802
|
+
highlightWeight: le.has(e.commit.id) ? "primary" : ue.has(e.commit.id) ? "secondary" : null,
|
|
803
|
+
expandedSessions: ce.has(e.commit.id),
|
|
804
|
+
onToggleSessions: ie,
|
|
805
|
+
touchedFiles: ae?.[e.commit.id] ?? [],
|
|
806
|
+
expandedFiles: ce.has(`files:${e.commit.id}`),
|
|
807
|
+
onOpenTouchedFile: oe
|
|
808
|
+
}), ee?.[e.commit.id] && /* @__PURE__ */ d("div", {
|
|
726
809
|
className: "cg-ghost-row",
|
|
727
|
-
style: { marginLeft:
|
|
728
|
-
children: /* @__PURE__ */
|
|
810
|
+
style: { marginLeft: k },
|
|
811
|
+
children: /* @__PURE__ */ d(Ge, {
|
|
729
812
|
successorHash: e.commit.id,
|
|
730
|
-
ghosts:
|
|
731
|
-
expanded:
|
|
732
|
-
onToggle:
|
|
813
|
+
ghosts: ee[e.commit.id],
|
|
814
|
+
expanded: se.has(e.commit.id),
|
|
815
|
+
onToggle: ne
|
|
733
816
|
})
|
|
734
817
|
})]
|
|
735
818
|
}, e.commit.id))]
|
|
736
819
|
}),
|
|
737
|
-
|
|
820
|
+
a && /* @__PURE__ */ f("div", {
|
|
738
821
|
className: "cg-older-band",
|
|
739
|
-
|
|
822
|
+
role: "listitem",
|
|
823
|
+
children: [/* @__PURE__ */ d("span", {
|
|
740
824
|
className: "cg-gutter cg-gutter-older",
|
|
741
|
-
style: { width:
|
|
825
|
+
style: { width: k },
|
|
742
826
|
"aria-hidden": "true",
|
|
743
|
-
children: /* @__PURE__ */
|
|
827
|
+
children: /* @__PURE__ */ d("svg", {
|
|
744
828
|
className: "cg-svg",
|
|
745
|
-
width:
|
|
829
|
+
width: k,
|
|
746
830
|
height: "100%",
|
|
747
831
|
preserveAspectRatio: "none",
|
|
748
|
-
children: /* @__PURE__ */
|
|
832
|
+
children: /* @__PURE__ */ d("line", {
|
|
749
833
|
className: "cg-stroke-lane0",
|
|
750
|
-
x1:
|
|
834
|
+
x1: q(0),
|
|
751
835
|
y1: "0",
|
|
752
|
-
x2:
|
|
836
|
+
x2: q(0),
|
|
753
837
|
y2: "60%",
|
|
754
|
-
strokeDasharray:
|
|
838
|
+
strokeDasharray: $e
|
|
755
839
|
})
|
|
756
840
|
})
|
|
757
|
-
}), /* @__PURE__ */
|
|
841
|
+
}), /* @__PURE__ */ f("button", {
|
|
758
842
|
type: "button",
|
|
759
843
|
className: "cg-older",
|
|
760
844
|
onClick: () => {
|
|
761
|
-
n ? n({ type: "show-older" }) :
|
|
845
|
+
n ? n({ type: "show-older" }) : u?.();
|
|
762
846
|
},
|
|
763
|
-
children: [/* @__PURE__ */
|
|
847
|
+
children: [/* @__PURE__ */ d(m, {
|
|
764
848
|
className: "cg-older-ic",
|
|
765
849
|
"aria-hidden": "true"
|
|
766
850
|
}), "show older"]
|
|
@@ -769,85 +853,86 @@ function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
769
853
|
]
|
|
770
854
|
});
|
|
771
855
|
}
|
|
772
|
-
function
|
|
773
|
-
let { commit: m, lane: h, joins: g, passLanes: _, laneUp: v, laneDown:
|
|
856
|
+
function nt({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSession: a, highlightWeight: o = null, expandedSessions: s = !1, onToggleSessions: c, touchedFiles: l = [], expandedFiles: u = !1, onOpenTouchedFile: p }) {
|
|
857
|
+
let { commit: m, lane: h, joins: g, passLanes: _, laneUp: v, laneDown: y } = e, b = !!m.session, S = [
|
|
774
858
|
"cg-dot",
|
|
775
|
-
|
|
859
|
+
b ? "cg-dot-filled" : "cg-dot-hollow",
|
|
776
860
|
n && "cg-dot-sel",
|
|
777
861
|
o && `cg-dot-highlight-${o}`
|
|
778
|
-
].filter(Boolean).join(" "),
|
|
779
|
-
return /* @__PURE__ */
|
|
862
|
+
].filter(Boolean).join(" "), ee = m.sessionRefs?.slice(0, 2) ?? [], te = m.sessionRefs?.slice(2) ?? [], ne = ["cg-row", n && "cg-row-sel"].filter(Boolean).join(" ");
|
|
863
|
+
return /* @__PURE__ */ f("div", {
|
|
780
864
|
className: "cg-band",
|
|
781
|
-
|
|
782
|
-
children: [/* @__PURE__ */ u("span", {
|
|
865
|
+
children: [/* @__PURE__ */ f("span", {
|
|
783
866
|
className: "cg-gutter",
|
|
784
867
|
style: { width: t },
|
|
785
868
|
"aria-hidden": "true",
|
|
786
869
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ f("svg", {
|
|
788
871
|
className: "cg-svg",
|
|
789
872
|
width: t,
|
|
790
873
|
height: "100%",
|
|
791
874
|
preserveAspectRatio: "none",
|
|
792
875
|
children: [
|
|
793
|
-
v && /* @__PURE__ */
|
|
876
|
+
v && /* @__PURE__ */ d("line", {
|
|
794
877
|
className: "cg-stroke-self",
|
|
795
|
-
x1:
|
|
878
|
+
x1: q(h),
|
|
796
879
|
y1: "0",
|
|
797
|
-
x2:
|
|
880
|
+
x2: q(h),
|
|
798
881
|
y2: "50%"
|
|
799
882
|
}),
|
|
800
|
-
|
|
883
|
+
y && /* @__PURE__ */ d("line", {
|
|
801
884
|
className: "cg-stroke-self",
|
|
802
|
-
x1:
|
|
885
|
+
x1: q(h),
|
|
803
886
|
y1: "50%",
|
|
804
|
-
x2:
|
|
887
|
+
x2: q(h),
|
|
805
888
|
y2: "100%"
|
|
806
889
|
}),
|
|
807
|
-
_.map((e) => /* @__PURE__ */
|
|
890
|
+
_.map((e) => /* @__PURE__ */ d("line", {
|
|
808
891
|
className: e === 0 ? "cg-stroke-lane0" : "cg-stroke-branch",
|
|
809
|
-
x1:
|
|
892
|
+
x1: q(e),
|
|
810
893
|
y1: "0",
|
|
811
|
-
x2:
|
|
894
|
+
x2: q(e),
|
|
812
895
|
y2: "100%"
|
|
813
896
|
}, e)),
|
|
814
|
-
g.map((e, t) => /* @__PURE__ */
|
|
897
|
+
g.map((e, t) => /* @__PURE__ */ f("g", {
|
|
815
898
|
className: "cg-elbow",
|
|
816
|
-
children: [/* @__PURE__ */
|
|
899
|
+
children: [/* @__PURE__ */ d("line", {
|
|
817
900
|
className: "cg-stroke-branch",
|
|
818
|
-
x1:
|
|
901
|
+
x1: q(e.to),
|
|
819
902
|
y1: "50%",
|
|
820
|
-
x2:
|
|
903
|
+
x2: q(e.to),
|
|
821
904
|
y2: "100%"
|
|
822
|
-
}), /* @__PURE__ */
|
|
905
|
+
}), /* @__PURE__ */ d("line", {
|
|
823
906
|
className: "cg-stroke-branch",
|
|
824
|
-
x1:
|
|
907
|
+
x1: q(e.to),
|
|
825
908
|
y1: "50%",
|
|
826
|
-
x2:
|
|
909
|
+
x2: q(e.from),
|
|
827
910
|
y2: "50%"
|
|
828
911
|
})]
|
|
829
912
|
}, t))
|
|
830
913
|
]
|
|
831
914
|
}),
|
|
832
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ d("span", {
|
|
833
916
|
className: S,
|
|
834
917
|
style: {
|
|
835
|
-
left:
|
|
836
|
-
|
|
837
|
-
|
|
918
|
+
left: q(h),
|
|
919
|
+
...b ? null : {
|
|
920
|
+
width: Qe,
|
|
921
|
+
height: Qe
|
|
922
|
+
}
|
|
838
923
|
},
|
|
839
|
-
"data-has-session":
|
|
924
|
+
"data-has-session": b || void 0
|
|
840
925
|
}),
|
|
841
|
-
|
|
926
|
+
b && /* @__PURE__ */ d(ie, {
|
|
842
927
|
className: "cg-spark",
|
|
843
|
-
style: { left:
|
|
928
|
+
style: { left: q(h) },
|
|
844
929
|
"aria-hidden": "true"
|
|
845
930
|
})
|
|
846
931
|
]
|
|
847
|
-
}), /* @__PURE__ */
|
|
932
|
+
}), /* @__PURE__ */ f("div", {
|
|
848
933
|
className: "cg-content",
|
|
849
934
|
children: [
|
|
850
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ f("button", {
|
|
851
936
|
type: "button",
|
|
852
937
|
className: ne,
|
|
853
938
|
onClick: () => {
|
|
@@ -859,44 +944,44 @@ function q({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
859
944
|
}
|
|
860
945
|
}) : i?.(m);
|
|
861
946
|
},
|
|
862
|
-
children: [/* @__PURE__ */
|
|
947
|
+
children: [/* @__PURE__ */ d("span", {
|
|
863
948
|
className: "cg-msg",
|
|
864
949
|
title: m.message,
|
|
865
950
|
children: m.message
|
|
866
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ f("span", {
|
|
867
952
|
className: "cg-meta",
|
|
868
953
|
children: [
|
|
869
|
-
m.merged && /* @__PURE__ */
|
|
954
|
+
m.merged && /* @__PURE__ */ f("span", {
|
|
870
955
|
className: "cg-merged",
|
|
871
|
-
children: [/* @__PURE__ */
|
|
956
|
+
children: [/* @__PURE__ */ d(x, {
|
|
872
957
|
className: "cg-merged-ic",
|
|
873
958
|
"aria-hidden": "true"
|
|
874
959
|
}), "merged"]
|
|
875
960
|
}),
|
|
876
|
-
m.tip && /* @__PURE__ */
|
|
961
|
+
m.tip && /* @__PURE__ */ d("span", {
|
|
877
962
|
className: "cg-tip",
|
|
878
963
|
children: "tip"
|
|
879
964
|
}),
|
|
880
|
-
m.branch && /* @__PURE__ */
|
|
965
|
+
m.branch && /* @__PURE__ */ d("span", {
|
|
881
966
|
className: "cg-branch",
|
|
882
967
|
children: m.branch
|
|
883
968
|
}),
|
|
884
|
-
|
|
969
|
+
b && /* @__PURE__ */ d("span", {
|
|
885
970
|
className: "cg-sr",
|
|
886
971
|
children: "session"
|
|
887
972
|
}),
|
|
888
|
-
m.time && /* @__PURE__ */
|
|
973
|
+
m.time && /* @__PURE__ */ d("span", {
|
|
889
974
|
className: "cg-time tnum",
|
|
890
975
|
children: m.time
|
|
891
976
|
})
|
|
892
977
|
]
|
|
893
978
|
})]
|
|
894
979
|
}),
|
|
895
|
-
m.sessionRefs?.length > 0 && /* @__PURE__ */
|
|
980
|
+
m.sessionRefs?.length > 0 && /* @__PURE__ */ f("div", {
|
|
896
981
|
className: "cg-sessions",
|
|
897
982
|
role: "group",
|
|
898
983
|
"aria-label": `sessions linked to ${m.message}`,
|
|
899
|
-
children: [
|
|
984
|
+
children: [ee.map((e) => /* @__PURE__ */ f("button", {
|
|
900
985
|
type: "button",
|
|
901
986
|
className: "cg-session",
|
|
902
987
|
onClick: () => {
|
|
@@ -913,23 +998,20 @@ function q({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
913
998
|
}) : a?.(e.sessionId);
|
|
914
999
|
},
|
|
915
1000
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ d(He, { harness: e.harness }),
|
|
1002
|
+
/* @__PURE__ */ d("span", {
|
|
918
1003
|
className: "cg-session-title",
|
|
919
1004
|
children: e.title || e.sessionId
|
|
920
1005
|
}),
|
|
921
|
-
e.startMs != null && /* @__PURE__ */
|
|
1006
|
+
e.startMs != null && /* @__PURE__ */ d("time", {
|
|
922
1007
|
className: "cg-session-time tnum",
|
|
923
1008
|
dateTime: new Date(e.startMs).toISOString(),
|
|
924
|
-
children:
|
|
925
|
-
month: "short",
|
|
926
|
-
day: "numeric"
|
|
927
|
-
}).toLowerCase()
|
|
1009
|
+
children: W(e.startMs)
|
|
928
1010
|
})
|
|
929
1011
|
]
|
|
930
|
-
}, e.sessionId)),
|
|
1012
|
+
}, e.sessionId)), te.length > 0 && /* @__PURE__ */ d(Ke, {
|
|
931
1013
|
commitHash: m.id,
|
|
932
|
-
overflow:
|
|
1014
|
+
overflow: te,
|
|
933
1015
|
expanded: s,
|
|
934
1016
|
onToggle: c ?? (() => {}),
|
|
935
1017
|
onSelect: (e) => {
|
|
@@ -947,12 +1029,12 @@ function q({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
947
1029
|
}
|
|
948
1030
|
})]
|
|
949
1031
|
}),
|
|
950
|
-
|
|
1032
|
+
l.length > 0 && /* @__PURE__ */ d("div", {
|
|
951
1033
|
className: "cg-touched-files",
|
|
952
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ d(Ye, {
|
|
953
1035
|
commitHash: `files:${m.id}`,
|
|
954
|
-
files:
|
|
955
|
-
expanded:
|
|
1036
|
+
files: l,
|
|
1037
|
+
expanded: u,
|
|
956
1038
|
onToggle: c ?? (() => {}),
|
|
957
1039
|
onOpenDiff: p
|
|
958
1040
|
})
|
|
@@ -963,7 +1045,7 @@ function q({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
963
1045
|
}
|
|
964
1046
|
//#endregion
|
|
965
1047
|
//#region src/ui/DiffView.jsx
|
|
966
|
-
function
|
|
1048
|
+
function rt(e) {
|
|
967
1049
|
let t = 0, n = 0;
|
|
968
1050
|
for (let r of e) for (let e of r.lines) e.type === "add" ? t++ : e.type === "del" && n++;
|
|
969
1051
|
return {
|
|
@@ -971,36 +1053,36 @@ function Xe(e) {
|
|
|
971
1053
|
dels: n
|
|
972
1054
|
};
|
|
973
1055
|
}
|
|
974
|
-
function
|
|
975
|
-
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ?
|
|
976
|
-
return /* @__PURE__ */
|
|
1056
|
+
function it({ line: e }) {
|
|
1057
|
+
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ? te : t === "del" ? ee : null;
|
|
1058
|
+
return /* @__PURE__ */ f("div", {
|
|
977
1059
|
className: `dv-line dv-${t}`,
|
|
978
1060
|
role: "row",
|
|
979
1061
|
children: [
|
|
980
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ d("span", {
|
|
981
1063
|
className: "dv-rail",
|
|
982
1064
|
"aria-hidden": "true"
|
|
983
1065
|
}),
|
|
984
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ d("span", {
|
|
985
1067
|
className: "dv-num dv-num-old tnum",
|
|
986
1068
|
role: "cell",
|
|
987
1069
|
children: n ?? ""
|
|
988
1070
|
}),
|
|
989
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ d("span", {
|
|
990
1072
|
className: "dv-num dv-num-new tnum",
|
|
991
1073
|
role: "cell",
|
|
992
1074
|
children: r ?? ""
|
|
993
1075
|
}),
|
|
994
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ d("span", {
|
|
995
1077
|
className: "dv-sign",
|
|
996
1078
|
role: "cell",
|
|
997
1079
|
"aria-hidden": "true",
|
|
998
|
-
children: a ? /* @__PURE__ */
|
|
1080
|
+
children: a ? /* @__PURE__ */ d(a, { "aria-hidden": "true" }) : null
|
|
999
1081
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ f("span", {
|
|
1001
1083
|
className: "dv-text",
|
|
1002
1084
|
role: "cell",
|
|
1003
|
-
children: [/* @__PURE__ */
|
|
1085
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1004
1086
|
className: "dv-sr",
|
|
1005
1087
|
children: t === "add" ? "added: " : t === "del" ? "removed: " : ""
|
|
1006
1088
|
}), i || "\xA0"]
|
|
@@ -1008,108 +1090,108 @@ function Ze({ line: e }) {
|
|
|
1008
1090
|
]
|
|
1009
1091
|
});
|
|
1010
1092
|
}
|
|
1011
|
-
function
|
|
1012
|
-
let { category: t, confidence: n, original: r, replacement: i, oldNo: a, newNo: o } = e, [
|
|
1013
|
-
return /* @__PURE__ */
|
|
1014
|
-
className: `dv-match${
|
|
1015
|
-
children: [/* @__PURE__ */
|
|
1093
|
+
function at({ match: e }) {
|
|
1094
|
+
let { category: t, confidence: n, original: r, replacement: i, oldNo: a, newNo: o } = e, [s, c] = l(!1), u = n < .7, p = n.toFixed(2);
|
|
1095
|
+
return /* @__PURE__ */ f("div", {
|
|
1096
|
+
className: `dv-match${s ? " dv-match-kept" : ""}`,
|
|
1097
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1016
1098
|
className: "dv-match-head",
|
|
1017
1099
|
children: [
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
className: `dv-badge${
|
|
1100
|
+
/* @__PURE__ */ f("span", {
|
|
1101
|
+
className: `dv-badge${u ? " dv-badge-low" : ""}`,
|
|
1020
1102
|
children: [
|
|
1021
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ d("span", {
|
|
1022
1104
|
className: "dv-badge-cat",
|
|
1023
1105
|
children: t
|
|
1024
1106
|
}),
|
|
1025
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ d("span", {
|
|
1026
1108
|
className: "dv-badge-dot",
|
|
1027
1109
|
"aria-hidden": "true",
|
|
1028
|
-
children: "
|
|
1110
|
+
children: ","
|
|
1029
1111
|
}),
|
|
1030
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ d("span", {
|
|
1031
1113
|
className: "dv-badge-conf tnum",
|
|
1032
1114
|
children: p
|
|
1033
1115
|
})
|
|
1034
1116
|
]
|
|
1035
1117
|
}),
|
|
1036
|
-
|
|
1118
|
+
s && /* @__PURE__ */ f("span", {
|
|
1037
1119
|
className: "dv-kept-flag",
|
|
1038
|
-
children: [/* @__PURE__ */
|
|
1120
|
+
children: [/* @__PURE__ */ d(v, { "aria-hidden": "true" }), "un-redacted"]
|
|
1039
1121
|
}),
|
|
1040
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ f("button", {
|
|
1041
1123
|
type: "button",
|
|
1042
1124
|
className: "dv-keep",
|
|
1043
|
-
"aria-pressed":
|
|
1044
|
-
onClick: () =>
|
|
1045
|
-
children: [
|
|
1125
|
+
"aria-pressed": s,
|
|
1126
|
+
onClick: () => c((e) => !e),
|
|
1127
|
+
children: [d(s ? _ : v, { "aria-hidden": "true" }), s ? "revert" : "keep"]
|
|
1046
1128
|
})
|
|
1047
1129
|
]
|
|
1048
|
-
}), /* @__PURE__ */
|
|
1130
|
+
}), /* @__PURE__ */ f("div", {
|
|
1049
1131
|
className: "dv-match-pair",
|
|
1050
1132
|
role: "rowgroup",
|
|
1051
|
-
children: [/* @__PURE__ */
|
|
1052
|
-
className: `dv-line dv-del${
|
|
1133
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1134
|
+
className: `dv-line dv-del${s ? " dv-line-muted" : ""}`,
|
|
1053
1135
|
role: "row",
|
|
1054
1136
|
children: [
|
|
1055
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ d("span", {
|
|
1056
1138
|
className: "dv-rail",
|
|
1057
1139
|
"aria-hidden": "true"
|
|
1058
1140
|
}),
|
|
1059
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ d("span", {
|
|
1060
1142
|
className: "dv-num dv-num-old tnum",
|
|
1061
1143
|
role: "cell",
|
|
1062
1144
|
children: a ?? ""
|
|
1063
1145
|
}),
|
|
1064
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ d("span", {
|
|
1065
1147
|
className: "dv-num dv-num-new tnum",
|
|
1066
1148
|
role: "cell"
|
|
1067
1149
|
}),
|
|
1068
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ d("span", {
|
|
1069
1151
|
className: "dv-sign",
|
|
1070
1152
|
role: "cell",
|
|
1071
1153
|
"aria-hidden": "true",
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1154
|
+
children: /* @__PURE__ */ d(ee, { "aria-hidden": "true" })
|
|
1073
1155
|
}),
|
|
1074
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ f("span", {
|
|
1075
1157
|
className: "dv-text",
|
|
1076
1158
|
role: "cell",
|
|
1077
|
-
children: [/* @__PURE__ */
|
|
1159
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1078
1160
|
className: "dv-sr",
|
|
1079
1161
|
children: "original: "
|
|
1080
|
-
}), /* @__PURE__ */
|
|
1162
|
+
}), /* @__PURE__ */ d("span", {
|
|
1081
1163
|
className: "dv-strike",
|
|
1082
1164
|
children: r
|
|
1083
1165
|
})]
|
|
1084
1166
|
})
|
|
1085
1167
|
]
|
|
1086
|
-
}), /* @__PURE__ */
|
|
1087
|
-
className: `dv-line dv-add${
|
|
1168
|
+
}), /* @__PURE__ */ f("div", {
|
|
1169
|
+
className: `dv-line dv-add${s ? " dv-line-muted" : ""}`,
|
|
1088
1170
|
role: "row",
|
|
1089
1171
|
children: [
|
|
1090
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ d("span", {
|
|
1091
1173
|
className: "dv-rail",
|
|
1092
1174
|
"aria-hidden": "true"
|
|
1093
1175
|
}),
|
|
1094
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ d("span", {
|
|
1095
1177
|
className: "dv-num dv-num-old tnum",
|
|
1096
1178
|
role: "cell"
|
|
1097
1179
|
}),
|
|
1098
|
-
/* @__PURE__ */
|
|
1180
|
+
/* @__PURE__ */ d("span", {
|
|
1099
1181
|
className: "dv-num dv-num-new tnum",
|
|
1100
1182
|
role: "cell",
|
|
1101
1183
|
children: o ?? ""
|
|
1102
1184
|
}),
|
|
1103
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ d("span", {
|
|
1104
1186
|
className: "dv-sign",
|
|
1105
1187
|
role: "cell",
|
|
1106
1188
|
"aria-hidden": "true",
|
|
1107
|
-
children: /* @__PURE__ */
|
|
1189
|
+
children: /* @__PURE__ */ d(te, { "aria-hidden": "true" })
|
|
1108
1190
|
}),
|
|
1109
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ f("span", {
|
|
1110
1192
|
className: "dv-text",
|
|
1111
1193
|
role: "cell",
|
|
1112
|
-
children: [/* @__PURE__ */
|
|
1194
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1113
1195
|
className: "dv-sr",
|
|
1114
1196
|
children: "redacted to: "
|
|
1115
1197
|
}), i]
|
|
@@ -1119,78 +1201,78 @@ function Qe({ match: e }) {
|
|
|
1119
1201
|
})]
|
|
1120
1202
|
});
|
|
1121
1203
|
}
|
|
1122
|
-
function
|
|
1123
|
-
let o = r === "redaction", s = o ? null :
|
|
1124
|
-
return /* @__PURE__ */
|
|
1204
|
+
function ot({ file: e, hunks: t = [], matches: n = [], variant: r = "default", className: i = "", ...a }) {
|
|
1205
|
+
let o = r === "redaction", s = o ? null : rt(t);
|
|
1206
|
+
return /* @__PURE__ */ f("figure", {
|
|
1125
1207
|
className: [
|
|
1126
1208
|
"dv",
|
|
1127
1209
|
o && "dv-redaction",
|
|
1128
1210
|
i
|
|
1129
1211
|
].filter(Boolean).join(" "),
|
|
1130
1212
|
...a,
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1213
|
+
children: [/* @__PURE__ */ f("figcaption", {
|
|
1132
1214
|
className: "dv-head",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1215
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1134
1216
|
className: "dv-file",
|
|
1135
1217
|
children: e
|
|
1136
|
-
}), o ? /* @__PURE__ */
|
|
1218
|
+
}), o ? /* @__PURE__ */ f("span", {
|
|
1137
1219
|
className: "dv-churn",
|
|
1138
|
-
children: [/* @__PURE__ */
|
|
1220
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1139
1221
|
className: "dv-churn-r tnum",
|
|
1140
1222
|
children: n.length
|
|
1141
|
-
}), /* @__PURE__ */
|
|
1223
|
+
}), /* @__PURE__ */ d("span", {
|
|
1142
1224
|
className: "dv-churn-label",
|
|
1143
1225
|
children: "redacted"
|
|
1144
1226
|
})]
|
|
1145
|
-
}) : /* @__PURE__ */
|
|
1227
|
+
}) : /* @__PURE__ */ f("span", {
|
|
1146
1228
|
className: "dv-churn",
|
|
1147
|
-
children: [/* @__PURE__ */
|
|
1229
|
+
children: [/* @__PURE__ */ f("span", {
|
|
1148
1230
|
className: "dv-churn-add tnum",
|
|
1149
1231
|
children: ["+", s.adds]
|
|
1150
|
-
}), /* @__PURE__ */
|
|
1232
|
+
}), /* @__PURE__ */ f("span", {
|
|
1151
1233
|
className: "dv-churn-del tnum",
|
|
1152
1234
|
children: ["−", s.dels]
|
|
1153
1235
|
})]
|
|
1154
1236
|
})]
|
|
1155
|
-
}), o ? /* @__PURE__ */
|
|
1237
|
+
}), o ? /* @__PURE__ */ d("div", {
|
|
1156
1238
|
className: "dv-body dv-matches",
|
|
1157
1239
|
role: "table",
|
|
1158
1240
|
"aria-label": `redactions in ${e}`,
|
|
1159
|
-
children: n.length === 0 ? /* @__PURE__ */
|
|
1241
|
+
children: n.length === 0 ? /* @__PURE__ */ d("p", {
|
|
1160
1242
|
className: "dv-empty",
|
|
1161
1243
|
children: "no sensitive content detected. safe to share as-is."
|
|
1162
|
-
}) : n.map((e, t) => /* @__PURE__ */
|
|
1163
|
-
}) : /* @__PURE__ */
|
|
1244
|
+
}) : n.map((e, t) => /* @__PURE__ */ d(at, { match: e }, e.id ?? t))
|
|
1245
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1164
1246
|
className: "dv-body",
|
|
1165
1247
|
role: "table",
|
|
1166
1248
|
"aria-label": `diff of ${e}`,
|
|
1167
|
-
children: t.length === 0 ? /* @__PURE__ */
|
|
1249
|
+
children: t.length === 0 ? /* @__PURE__ */ d("p", {
|
|
1168
1250
|
className: "dv-empty",
|
|
1169
1251
|
children: "no line changes."
|
|
1170
|
-
}) : t.map((e, t) => /* @__PURE__ */
|
|
1252
|
+
}) : t.map((e, t) => /* @__PURE__ */ f("div", {
|
|
1171
1253
|
className: "dv-hunk",
|
|
1172
|
-
children: [/* @__PURE__ */
|
|
1254
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1173
1255
|
className: "dv-hunk-head",
|
|
1174
1256
|
children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ d("span", {
|
|
1176
1258
|
className: "dv-hunk-at",
|
|
1177
1259
|
"aria-hidden": "true",
|
|
1178
1260
|
children: "@@"
|
|
1179
1261
|
}),
|
|
1180
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ d("span", {
|
|
1181
1263
|
className: "dv-hunk-range tnum",
|
|
1182
1264
|
children: e.header
|
|
1183
1265
|
}),
|
|
1184
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ d("span", {
|
|
1185
1267
|
className: "dv-hunk-at",
|
|
1186
1268
|
"aria-hidden": "true",
|
|
1187
1269
|
children: "@@"
|
|
1188
1270
|
})
|
|
1189
1271
|
]
|
|
1190
|
-
}), /* @__PURE__ */
|
|
1272
|
+
}), /* @__PURE__ */ d("div", {
|
|
1191
1273
|
className: "dv-hunk-pair",
|
|
1192
1274
|
role: "rowgroup",
|
|
1193
|
-
children: e.lines.map((e, t) => /* @__PURE__ */
|
|
1275
|
+
children: e.lines.map((e, t) => /* @__PURE__ */ d(it, { line: e }, t))
|
|
1194
1276
|
})]
|
|
1195
1277
|
}, t))
|
|
1196
1278
|
})]
|
|
@@ -1198,8 +1280,8 @@ function $e({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1198
1280
|
}
|
|
1199
1281
|
//#endregion
|
|
1200
1282
|
//#region src/ui/graph/types.js
|
|
1201
|
-
var
|
|
1202
|
-
function
|
|
1283
|
+
var st = E, ct = se, lt = le, ut = ue, dt = ce;
|
|
1284
|
+
function J(e, t, n, r, i) {
|
|
1203
1285
|
if (e(t)) return;
|
|
1204
1286
|
let a;
|
|
1205
1287
|
try {
|
|
@@ -1209,62 +1291,62 @@ function at(e, t, n, r, i) {
|
|
|
1209
1291
|
}
|
|
1210
1292
|
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.`);
|
|
1211
1293
|
}
|
|
1212
|
-
function
|
|
1213
|
-
for (let [t, n] of e.nodes.entries())
|
|
1214
|
-
for (let [t, n] of e.violations.entries())
|
|
1294
|
+
function ft(e) {
|
|
1295
|
+
for (let [t, n] of e.nodes.entries()) J(ve, n.kind, `nodes[${t}].kind`, "code-map payload rendering", E);
|
|
1296
|
+
for (let [t, n] of e.violations.entries()) J(pe, n.kind, `violations[${t}].kind`, "code-map payload rendering", le);
|
|
1215
1297
|
}
|
|
1216
|
-
function
|
|
1217
|
-
for (let [t, n] of e.files.entries())
|
|
1218
|
-
for (let [t, n] of e.work.entries())
|
|
1219
|
-
for (let [t, n] of e.slice.nodes.entries())
|
|
1220
|
-
for (let [t, n] of e.violations.entries())
|
|
1298
|
+
function pt(e) {
|
|
1299
|
+
for (let [t, n] of e.files.entries()) J(me, n.status, `files[${t}].status`, "change-detail payload rendering", ue);
|
|
1300
|
+
for (let [t, n] of e.work.entries()) J(k, n.binding, `work[${t}].binding`, "change-detail payload rendering", se);
|
|
1301
|
+
for (let [t, n] of e.slice.nodes.entries()) J(ve, n.kind, `slice.nodes[${t}].kind`, "change-detail payload rendering", E);
|
|
1302
|
+
for (let [t, n] of e.violations.entries()) J(pe, n.kind, `violations[${t}].kind`, "change-detail payload rendering", le);
|
|
1221
1303
|
}
|
|
1222
|
-
function
|
|
1223
|
-
|
|
1224
|
-
for (let [t, n] of e.hunks.entries()) for (let [e, r] of n.lines.entries())
|
|
1304
|
+
function mt(e) {
|
|
1305
|
+
J(me, e.status, "status", "change-diff payload rendering", ue);
|
|
1306
|
+
for (let [t, n] of e.hunks.entries()) for (let [e, r] of n.lines.entries()) J(fe, r.kind, `hunks[${t}].lines[${e}].kind`, "change-diff payload rendering", ce);
|
|
1225
1307
|
}
|
|
1226
1308
|
//#endregion
|
|
1227
1309
|
//#region src/ui/graph/graphContractPolicy.js
|
|
1228
|
-
var
|
|
1310
|
+
var ht = Object.freeze({
|
|
1229
1311
|
decision: "decisions",
|
|
1230
1312
|
friction: "friction",
|
|
1231
1313
|
unusual: "unusual signals",
|
|
1232
1314
|
retry_loop: "retry loops"
|
|
1233
|
-
}),
|
|
1315
|
+
}), gt = Object.freeze({
|
|
1234
1316
|
mechanical: Object.freeze({ markerClass: "tlp-insight-provenance-mechanical" }),
|
|
1235
1317
|
mined: Object.freeze({ markerClass: "tlp-insight-provenance-mined" })
|
|
1236
1318
|
});
|
|
1237
|
-
|
|
1238
|
-
function
|
|
1239
|
-
let t = e.findIndex((e) => !
|
|
1240
|
-
if (t !== -1) throw
|
|
1241
|
-
}
|
|
1242
|
-
function
|
|
1243
|
-
let t = e.findIndex((e) => !
|
|
1244
|
-
if (t !== -1) throw
|
|
1245
|
-
}
|
|
1246
|
-
function
|
|
1247
|
-
let e = Object.keys(
|
|
1248
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1249
|
-
}
|
|
1250
|
-
function
|
|
1251
|
-
let e = Object.keys(
|
|
1252
|
-
let t =
|
|
1319
|
+
yt(), bt();
|
|
1320
|
+
function _t(e) {
|
|
1321
|
+
let t = e.findIndex((e) => !ge(e.kind) || !_e(e.provenance));
|
|
1322
|
+
if (t !== -1) throw xt("validate insight values", `insights[${t}]`, `the insight kind or provenance is outside the canonical @peasant-labs/schema value domain (kinds: ${w.join(", ")}; provenances: ${T.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before rendering");
|
|
1323
|
+
}
|
|
1324
|
+
function vt(e) {
|
|
1325
|
+
let t = e.findIndex((e) => !ye(e.readAttribution) || !A(e.readState));
|
|
1326
|
+
if (t !== -1) throw xt("validate ranking values", `nodes[${t}]`, `the read-attribution state or read-state grade is outside the canonical @peasant-labs/schema value domain (attribution states: ${D.join(", ")}; read-state grades: ${O.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before ranking");
|
|
1327
|
+
}
|
|
1328
|
+
function yt() {
|
|
1329
|
+
let e = Object.keys(ht), t = w.filter((e) => typeof ht[e] != "string" || ht[e].trim() === ""), n = e.filter((e) => !ge(e));
|
|
1330
|
+
if (!(t.length === 0 && n.length === 0 && e.length === w.length)) throw xt("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");
|
|
1331
|
+
}
|
|
1332
|
+
function bt() {
|
|
1333
|
+
let e = Object.keys(gt), t = T.filter((e) => {
|
|
1334
|
+
let t = gt[e];
|
|
1253
1335
|
return !t || typeof t.markerClass != "string" || t.markerClass.trim() === "";
|
|
1254
|
-
}), n = e.filter((e) => !
|
|
1255
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1336
|
+
}), n = e.filter((e) => !_e(e));
|
|
1337
|
+
if (!(t.length === 0 && n.length === 0 && e.length === T.length)) throw xt("validate insight provenance presentations", "INSIGHT_PROVENANCE_PRESENTATIONS", `the Fairtrade provenance presentation map does not exactly cover the canonical @peasant-labs/schema insight provenances (missing: ${t.join(", ") || "none"}; unknown: ${n.join(", ") || "none"})`, "add one explicit Fairtrade marker class for each published insight provenance and remove presentations that are no longer in the schema contract");
|
|
1256
1338
|
}
|
|
1257
|
-
function
|
|
1339
|
+
function xt(e, t, n, r) {
|
|
1258
1340
|
return /* @__PURE__ */ Error(`Fairtrade graph contract ${e} failed: what went wrong: invalid ${t}; why: ${n}; where: src/ui/graph/graphContractPolicy.js ${t}; when: ${e}; what it means: Fairtrade cannot render the graph value without guessing; how to fix: ${r}.`);
|
|
1259
1341
|
}
|
|
1260
1342
|
//#endregion
|
|
1261
1343
|
//#region src/ui/graph/ranking.js
|
|
1262
|
-
var
|
|
1344
|
+
var St = Object.freeze({
|
|
1263
1345
|
touch: .35,
|
|
1264
1346
|
effortDensity: .25,
|
|
1265
1347
|
debt: .25,
|
|
1266
1348
|
recency: .15
|
|
1267
|
-
}),
|
|
1349
|
+
}), Ct = .5, wt = .9, Tt = 14, Et = 5, Dt = 25, Ot = Object.freeze([
|
|
1268
1350
|
"agent wrote: no recorded read",
|
|
1269
1351
|
"agent wrote: viewed, not reviewed",
|
|
1270
1352
|
"agent wrote: read state unknown",
|
|
@@ -1272,38 +1354,38 @@ var ht = Object.freeze({
|
|
|
1272
1354
|
"edited this session",
|
|
1273
1355
|
"high effort density",
|
|
1274
1356
|
"near your focus"
|
|
1275
|
-
]),
|
|
1357
|
+
]), kt = .75, At = .75, jt = 1, Mt = /* @__PURE__ */ new Set([
|
|
1276
1358
|
"relevance",
|
|
1277
1359
|
"debt",
|
|
1278
1360
|
"churn"
|
|
1279
|
-
]),
|
|
1280
|
-
function
|
|
1361
|
+
]), Nt = "Use this as a prompt to inspect recorded evidence, not as a verdict about the reader.";
|
|
1362
|
+
function Pt(e) {
|
|
1281
1363
|
if (e.agentEditedCount === 0) return "none";
|
|
1282
1364
|
if (e.readAttribution === "unavailable") return "unknown";
|
|
1283
1365
|
let t = e.changedRegionCount > e.attributedRegionCount, n = e.attributedRegionCount > 0 ? e.reviewedRegionCount / e.attributedRegionCount : 0, r = e.attributedRegionCount > 0 && n === 1 && !t;
|
|
1284
1366
|
return e.readState === "reviewed" || e.readState === "reviewed_in_detail" || r ? "reviewed" : e.attributedRegionCount > 0 && e.reviewedRegionCount > 0 ? "partial-read" : e.readState === "viewed" ? "viewed" : e.readCount === 0 ? "no-recorded-read" : "partial-read";
|
|
1285
1367
|
}
|
|
1286
|
-
function
|
|
1368
|
+
function Ft(e, t) {
|
|
1287
1369
|
if (t === "no-recorded-read") return 1;
|
|
1288
1370
|
if (t === "partial-read") {
|
|
1289
1371
|
if (e.attributedRegionCount > 0) {
|
|
1290
|
-
let t =
|
|
1291
|
-
return
|
|
1372
|
+
let t = It(e), n = e.agentEditedCount > 0 ? e.readCount / e.agentEditedCount : 0;
|
|
1373
|
+
return Gt(1 - Math.max(t, n));
|
|
1292
1374
|
}
|
|
1293
|
-
return
|
|
1375
|
+
return Gt(1 - (e.agentEditedCount > 0 ? e.readCount / e.agentEditedCount : 0));
|
|
1294
1376
|
}
|
|
1295
|
-
return t === "viewed" ?
|
|
1377
|
+
return t === "viewed" ? Ct : 0;
|
|
1296
1378
|
}
|
|
1297
|
-
function
|
|
1379
|
+
function It(e) {
|
|
1298
1380
|
let t = e.changedRegionCount > e.attributedRegionCount, n = e.attributedRegionCount > 0 ? e.reviewedRegionCount / e.attributedRegionCount : 0;
|
|
1299
|
-
return
|
|
1381
|
+
return Gt(t ? Math.min(n, wt) : n);
|
|
1300
1382
|
}
|
|
1301
|
-
function
|
|
1383
|
+
function Lt(e) {
|
|
1302
1384
|
let t = e.changedRegionCount > e.attributedRegionCount, n = e.attributedRegionCount > 0 ? e.reviewedRegionCount / e.attributedRegionCount : 0;
|
|
1303
1385
|
return e.attributedRegionCount > 0 && n === 1 && !t;
|
|
1304
1386
|
}
|
|
1305
|
-
function
|
|
1306
|
-
if (
|
|
1387
|
+
function Rt(e) {
|
|
1388
|
+
if (Pt(e) !== "partial-read") return null;
|
|
1307
1389
|
let t = e.attributedRegionCount;
|
|
1308
1390
|
if (t > 0 && e.reviewedRegionCount > 0) {
|
|
1309
1391
|
let n = e.reviewedRegionCount, r = t;
|
|
@@ -1311,80 +1393,80 @@ function jt(e) {
|
|
|
1311
1393
|
}
|
|
1312
1394
|
return "some sessions that edited this file were read; per-region coverage is not available";
|
|
1313
1395
|
}
|
|
1314
|
-
function
|
|
1315
|
-
if (t === "no-recorded-read") return `No read evidence was recorded for sessions that edited this file. ${
|
|
1316
|
-
if (t === "viewed") return `A view was recorded, but no explicit review was recorded. ${
|
|
1317
|
-
if (t === "unknown") return `No read events were recorded for the sessions that edited this file, so its read state is unknown. ${
|
|
1396
|
+
function zt(e, t) {
|
|
1397
|
+
if (t === "no-recorded-read") return `No read evidence was recorded for sessions that edited this file. ${Nt}`;
|
|
1398
|
+
if (t === "viewed") return `A view was recorded, but no explicit review was recorded. ${Nt}`;
|
|
1399
|
+
if (t === "unknown") return `No read events were recorded for the sessions that edited this file, so its read state is unknown. ${Nt}`;
|
|
1318
1400
|
if (t === "partial-read") {
|
|
1319
|
-
let t =
|
|
1320
|
-
return t ? `${t}. ${
|
|
1401
|
+
let t = Rt(e);
|
|
1402
|
+
return t ? `${t}. ${Nt}` : Nt;
|
|
1321
1403
|
}
|
|
1322
1404
|
return null;
|
|
1323
1405
|
}
|
|
1324
|
-
function
|
|
1406
|
+
function Bt(e, t, n = {}) {
|
|
1325
1407
|
let r = [];
|
|
1326
|
-
if (t === "no-recorded-read" ? r.push("agent wrote: no recorded read") : t === "unknown" ? r.push("agent wrote: read state unknown") : (t === "viewed" || t === "partial-read") && r.push("agent wrote: viewed, not reviewed"), n.hoveredOrSelectedSessionId && e.recentSessionId === n.hoveredOrSelectedSessionId && r.length < 2 && r.push("edited this session"), n.maxTouch && n.maxTouch > 0 && e.touchCount / n.maxTouch >=
|
|
1327
|
-
let t = n.distanceToFocus === void 0 ?
|
|
1328
|
-
t !== null && t <=
|
|
1408
|
+
if (t === "no-recorded-read" ? r.push("agent wrote: no recorded read") : t === "unknown" ? r.push("agent wrote: read state unknown") : (t === "viewed" || t === "partial-read") && r.push("agent wrote: viewed, not reviewed"), n.hoveredOrSelectedSessionId && e.recentSessionId === n.hoveredOrSelectedSessionId && r.length < 2 && r.push("edited this session"), n.maxTouch && n.maxTouch > 0 && e.touchCount / n.maxTouch >= kt && r.length < 2 && r.push("heavy churn"), e.effortDensity >= At && r.length < 2 && r.push("high effort density"), n.focusId && n.parentOf) {
|
|
1409
|
+
let t = n.distanceToFocus === void 0 ? Vt(e.id, n.focusId, n.parentOf) : n.distanceToFocus;
|
|
1410
|
+
t !== null && t <= jt && r.length < 2 && r.push("near your focus");
|
|
1329
1411
|
}
|
|
1330
1412
|
return r.slice(0, 2);
|
|
1331
1413
|
}
|
|
1332
|
-
function
|
|
1414
|
+
function Vt(e, t, n) {
|
|
1333
1415
|
if (e === t) return 0;
|
|
1334
|
-
let r =
|
|
1416
|
+
let r = Ht(e, n), i = Ht(t, n), a = new Map(r.map((e, t) => [e, t]));
|
|
1335
1417
|
for (let [e, t] of i.entries()) if (a.has(t)) return (a.get(t) ?? 0) + e;
|
|
1336
1418
|
return null;
|
|
1337
1419
|
}
|
|
1338
|
-
function
|
|
1420
|
+
function Ht(e, t) {
|
|
1339
1421
|
let n = [e], r = t.get(e) ?? null, i = 0;
|
|
1340
1422
|
for (; r && i < 1e4;) n.push(r), r = t.get(r) ?? null, i += 1;
|
|
1341
1423
|
return n;
|
|
1342
1424
|
}
|
|
1343
|
-
function
|
|
1425
|
+
function Ut(e) {
|
|
1344
1426
|
let t = Math.min(...e), n = Math.max(...e);
|
|
1345
1427
|
return !Number.isFinite(t) || !Number.isFinite(n) || n === t ? e.map(() => 0) : e.map((e) => (e - t) / (n - t));
|
|
1346
1428
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return e.lastTouchMs == null || !Number.isFinite(t) ? 0 :
|
|
1429
|
+
function Wt(e, t) {
|
|
1430
|
+
return e.lastTouchMs == null || !Number.isFinite(t) ? 0 : Gt(.5 ** (Math.max(0, t - e.lastTouchMs) / (336 * 60 * 60 * 1e3)));
|
|
1349
1431
|
}
|
|
1350
|
-
function
|
|
1432
|
+
function Gt(e) {
|
|
1351
1433
|
return Math.round(Math.max(0, Math.min(1, e)) * 1e9) / 1e9;
|
|
1352
1434
|
}
|
|
1353
|
-
function
|
|
1354
|
-
if (e === "relevance") return
|
|
1355
|
-
let t = e === "debt" ? "debt" : "touch", n = Object.keys(
|
|
1356
|
-
for (let e of n) a[e] =
|
|
1435
|
+
function Kt(e) {
|
|
1436
|
+
if (e === "relevance") return St;
|
|
1437
|
+
let t = e === "debt" ? "debt" : "touch", n = Object.keys(St).filter((e) => e !== t), r = n.reduce((e, t) => e + St[t], 0), i = r > 0 ? .3 / r : 0, a = { [t]: .7 };
|
|
1438
|
+
for (let e of n) a[e] = St[e] * i;
|
|
1357
1439
|
return a;
|
|
1358
1440
|
}
|
|
1359
|
-
function
|
|
1441
|
+
function qt(e) {
|
|
1360
1442
|
return e === "no-recorded-read" || e === "partial-read" || e === "viewed" ? 0 : e === "unknown" ? 1 : 2;
|
|
1361
1443
|
}
|
|
1362
|
-
function
|
|
1444
|
+
function Jt(e, t = {}) {
|
|
1363
1445
|
let n = t.rankMode ?? "relevance";
|
|
1364
|
-
if (!
|
|
1365
|
-
|
|
1366
|
-
let r = t.nowMs ?? Date.now(), i =
|
|
1446
|
+
if (!Mt.has(n)) throw $t("compute intrinsic ranking", "rankMode", `value ${JSON.stringify(n)} is unsupported`, "use relevance, debt, or churn");
|
|
1447
|
+
vt(e);
|
|
1448
|
+
let r = t.nowMs ?? Date.now(), i = Kt(n), a = new Map(e.map((e) => [e.id, e.parent ?? null])), o = e.reduce((e, t) => Math.max(e, t.touchCount), 0), s = Ut(e.map((e) => Math.log1p(Math.max(0, e.touchCount))));
|
|
1367
1449
|
return {
|
|
1368
1450
|
rankMode: n,
|
|
1369
1451
|
rows: e.map((e, t) => {
|
|
1370
|
-
let n =
|
|
1452
|
+
let n = Pt(e), a = Ft(e, n);
|
|
1371
1453
|
return {
|
|
1372
1454
|
node: e,
|
|
1373
|
-
intrinsic: i.touch * s[t] + i.effortDensity *
|
|
1455
|
+
intrinsic: i.touch * s[t] + i.effortDensity * Gt(e.effortDensity) + i.debt * a + i.recency * Wt(e, r),
|
|
1374
1456
|
debtState: n,
|
|
1375
1457
|
debt: a,
|
|
1376
|
-
coverage:
|
|
1377
|
-
hunkClears:
|
|
1378
|
-
hoverText:
|
|
1458
|
+
coverage: It(e),
|
|
1459
|
+
hunkClears: Lt(e),
|
|
1460
|
+
hoverText: zt(e, n)
|
|
1379
1461
|
};
|
|
1380
1462
|
}),
|
|
1381
1463
|
parentOf: a,
|
|
1382
1464
|
maxTouch: o
|
|
1383
1465
|
};
|
|
1384
1466
|
}
|
|
1385
|
-
function
|
|
1386
|
-
if (t.scentFilter != null && !
|
|
1387
|
-
let { rankMode: n, parentOf: r, maxTouch: i } = e, a = t.focusId ?
|
|
1467
|
+
function Yt(e, t = {}) {
|
|
1468
|
+
if (t.scentFilter != null && !Ot.includes(t.scentFilter)) throw $t("derive ranked rows", "scentFilter", `value ${JSON.stringify(t.scentFilter)} is unsupported`, `use null or one of ${Ot.join(", ")}`);
|
|
1469
|
+
let { rankMode: n, parentOf: r, maxTouch: i } = e, a = t.focusId ? Xt(t.focusId, r) : null, o = e.rows.map((e) => {
|
|
1388
1470
|
let { node: n } = e, o = 0;
|
|
1389
1471
|
if (t.focusId) {
|
|
1390
1472
|
let e = a?.get(n.id) ?? null;
|
|
@@ -1393,12 +1475,12 @@ function Ht(e, t = {}) {
|
|
|
1393
1475
|
return {
|
|
1394
1476
|
id: n.id,
|
|
1395
1477
|
name: n.name,
|
|
1396
|
-
doi:
|
|
1478
|
+
doi: Gt(e.intrinsic - o),
|
|
1397
1479
|
debtState: e.debtState,
|
|
1398
1480
|
debt: e.debt,
|
|
1399
1481
|
coverage: e.coverage,
|
|
1400
1482
|
hunkClears: e.hunkClears,
|
|
1401
|
-
scentTags:
|
|
1483
|
+
scentTags: Bt(n, e.debtState, {
|
|
1402
1484
|
focusId: t.focusId,
|
|
1403
1485
|
parentOf: r,
|
|
1404
1486
|
distanceToFocus: a?.get(n.id) ?? null,
|
|
@@ -1410,7 +1492,7 @@ function Ht(e, t = {}) {
|
|
|
1410
1492
|
});
|
|
1411
1493
|
o.sort((e, t) => {
|
|
1412
1494
|
if (n === "debt") {
|
|
1413
|
-
let n =
|
|
1495
|
+
let n = qt(e.debtState) - qt(t.debtState);
|
|
1414
1496
|
if (n !== 0) return n;
|
|
1415
1497
|
}
|
|
1416
1498
|
return t.doi - e.doi || (e.id < t.id ? -1 : +(e.id > t.id));
|
|
@@ -1418,7 +1500,7 @@ function Ht(e, t = {}) {
|
|
|
1418
1500
|
let s = t.scentFilter;
|
|
1419
1501
|
return s ? o.filter((e) => e.scentTags.includes(s)) : o;
|
|
1420
1502
|
}
|
|
1421
|
-
function
|
|
1503
|
+
function Xt(e, t) {
|
|
1422
1504
|
let n = /* @__PURE__ */ new Map();
|
|
1423
1505
|
for (let [e, r] of t) {
|
|
1424
1506
|
if (n.has(e) || n.set(e, []), !r) continue;
|
|
@@ -1435,11 +1517,11 @@ function Ut(e, t) {
|
|
|
1435
1517
|
}
|
|
1436
1518
|
return r;
|
|
1437
1519
|
}
|
|
1438
|
-
function
|
|
1439
|
-
return
|
|
1520
|
+
function Zt(e, t = {}) {
|
|
1521
|
+
return Yt(Jt(e, t), t);
|
|
1440
1522
|
}
|
|
1441
|
-
function
|
|
1442
|
-
let n = e.reduce((e, t) => Math.max(e, t.doi), 0), r = Math.max(.25, .5 * n), i = new Set(e.filter((e) => e.doi >= r).map((e) => e.id)), a = t.rankMode === "debt" ? new Set(e.filter((e) =>
|
|
1523
|
+
function Qt(e, t = {}) {
|
|
1524
|
+
let n = e.reduce((e, t) => Math.max(e, t.doi), 0), r = Math.max(.25, .5 * n), i = new Set(e.filter((e) => e.doi >= r).map((e) => e.id)), a = t.rankMode === "debt" ? new Set(e.filter((e) => qt(e.debtState) === 0).map((e) => e.id)) : /* @__PURE__ */ new Set(), o = e.filter((e) => i.has(e.id) || a.has(e.id));
|
|
1443
1525
|
o.length < 5 && (o = e.slice(0, Math.min(5, e.length)));
|
|
1444
1526
|
let s = o.slice(0, 25);
|
|
1445
1527
|
return {
|
|
@@ -1448,19 +1530,19 @@ function Gt(e, t = {}) {
|
|
|
1448
1530
|
overflowCount: t.expanded ? 0 : Math.max(0, e.length - s.length)
|
|
1449
1531
|
};
|
|
1450
1532
|
}
|
|
1451
|
-
function
|
|
1533
|
+
function $t(e, t, n, r) {
|
|
1452
1534
|
return /* @__PURE__ */ Error(`Code map ranking ${e} failed: what went wrong: invalid ${t}; why: ${n}; where: src/ui/graph/ranking.js ${t}; when: ${e}; what it means: the ranked list cannot be derived safely; how to fix: ${r}.`);
|
|
1453
1535
|
}
|
|
1454
1536
|
//#endregion
|
|
1455
1537
|
//#region src/ui/graph/codeMapState.js
|
|
1456
|
-
var
|
|
1538
|
+
var en = 1, Y = Object.freeze({
|
|
1457
1539
|
min: .35,
|
|
1458
1540
|
max: 2.4
|
|
1459
1541
|
});
|
|
1460
|
-
function
|
|
1542
|
+
function tn(e) {
|
|
1461
1543
|
return typeof e == "number" && Number.isFinite(e) && e >= Y.min && e <= Y.max;
|
|
1462
1544
|
}
|
|
1463
|
-
var
|
|
1545
|
+
var nn = Object.freeze({
|
|
1464
1546
|
version: 1,
|
|
1465
1547
|
presentation: "navigator",
|
|
1466
1548
|
selectedId: null,
|
|
@@ -1475,19 +1557,19 @@ var Yt = Object.freeze({
|
|
|
1475
1557
|
expandedGhostGroups: Object.freeze([]),
|
|
1476
1558
|
rankMode: "relevance",
|
|
1477
1559
|
scentFilter: null
|
|
1478
|
-
}),
|
|
1560
|
+
}), rn = /* @__PURE__ */ new Set(["navigator", "canvas"]), an = /* @__PURE__ */ new Set([
|
|
1479
1561
|
"project",
|
|
1480
1562
|
"package",
|
|
1481
1563
|
"file"
|
|
1482
|
-
]),
|
|
1564
|
+
]), on = /* @__PURE__ */ new Set([
|
|
1483
1565
|
"relevance",
|
|
1484
1566
|
"debt",
|
|
1485
1567
|
"churn"
|
|
1486
|
-
]),
|
|
1568
|
+
]), sn = new Set(Ot), cn = Object.freeze({
|
|
1487
1569
|
project: 0,
|
|
1488
1570
|
package: 1,
|
|
1489
1571
|
file: 1
|
|
1490
|
-
}),
|
|
1572
|
+
}), ln = cn, un = Object.freeze([
|
|
1491
1573
|
"version",
|
|
1492
1574
|
"presentation",
|
|
1493
1575
|
"selectedId",
|
|
@@ -1502,7 +1584,7 @@ var Yt = Object.freeze({
|
|
|
1502
1584
|
"expandedGhostGroups",
|
|
1503
1585
|
"rankMode",
|
|
1504
1586
|
"scentFilter"
|
|
1505
|
-
]),
|
|
1587
|
+
]), dn = Object.freeze({
|
|
1506
1588
|
replace: ["type", "state"],
|
|
1507
1589
|
hydrate: ["type", "state"],
|
|
1508
1590
|
"set-presentation": ["type", "presentation"],
|
|
@@ -1530,41 +1612,41 @@ var Yt = Object.freeze({
|
|
|
1530
1612
|
"set-rank-expanded": ["type", "expanded"]
|
|
1531
1613
|
});
|
|
1532
1614
|
function X(e = null) {
|
|
1533
|
-
if (e !== null && !
|
|
1615
|
+
if (e !== null && !bn(e)) throw Z("create state", "seed", "the seed is not an object", "pass an object or omit the seed");
|
|
1534
1616
|
let t = e ?? {};
|
|
1535
|
-
if (
|
|
1617
|
+
if (xn(t, un, "create state", "seed"), t.version !== void 0 && t.version !== 1) throw Z("create state", "version", `version ${String(t.version)} is unsupported`, "use version 1");
|
|
1536
1618
|
return {
|
|
1537
1619
|
version: 1,
|
|
1538
|
-
presentation:
|
|
1539
|
-
selectedId:
|
|
1540
|
-
grain:
|
|
1541
|
-
expandedIds:
|
|
1542
|
-
navigatorFilter:
|
|
1543
|
-
navigatorFocusedId:
|
|
1544
|
-
viewport:
|
|
1545
|
-
hoveredSessionId:
|
|
1546
|
-
selectedSessionId:
|
|
1547
|
-
expandedCommitSessions:
|
|
1548
|
-
expandedGhostGroups:
|
|
1549
|
-
rankMode:
|
|
1550
|
-
scentFilter:
|
|
1620
|
+
presentation: Mn(t.presentation, rn, nn.presentation, "presentation"),
|
|
1621
|
+
selectedId: Tn(t.selectedId, "selectedId"),
|
|
1622
|
+
grain: Mn(t.grain, an, nn.grain, "grain"),
|
|
1623
|
+
expandedIds: En(t.expandedIds, "expandedIds"),
|
|
1624
|
+
navigatorFilter: An(t.navigatorFilter, "", "navigatorFilter"),
|
|
1625
|
+
navigatorFocusedId: Tn(t.navigatorFocusedId, "navigatorFocusedId"),
|
|
1626
|
+
viewport: Pn(t.viewport),
|
|
1627
|
+
hoveredSessionId: Tn(t.hoveredSessionId, "hoveredSessionId"),
|
|
1628
|
+
selectedSessionId: Tn(t.selectedSessionId, "selectedSessionId"),
|
|
1629
|
+
expandedCommitSessions: En(t.expandedCommitSessions, "expandedCommitSessions"),
|
|
1630
|
+
expandedGhostGroups: En(t.expandedGhostGroups, "expandedGhostGroups"),
|
|
1631
|
+
rankMode: Mn(t.rankMode, on, nn.rankMode, "rankMode"),
|
|
1632
|
+
scentFilter: Ln(t.scentFilter)
|
|
1551
1633
|
};
|
|
1552
1634
|
}
|
|
1553
|
-
function
|
|
1635
|
+
function fn(e, t) {
|
|
1554
1636
|
let n = X(e), r = X(t);
|
|
1555
|
-
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 &&
|
|
1637
|
+
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 && In(n.viewport, r.viewport) && n.hoveredSessionId === r.hoveredSessionId && n.selectedSessionId === r.selectedSessionId && pn(n.expandedCommitSessions, r.expandedCommitSessions) && pn(n.expandedGhostGroups, r.expandedGhostGroups) && n.rankMode === r.rankMode && n.scentFilter === r.scentFilter;
|
|
1556
1638
|
}
|
|
1557
|
-
function
|
|
1639
|
+
function pn(e, t) {
|
|
1558
1640
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
1559
1641
|
}
|
|
1560
|
-
function
|
|
1642
|
+
function mn(e, t) {
|
|
1561
1643
|
let n = X(e);
|
|
1562
|
-
switch (
|
|
1644
|
+
switch (yn(t), t.type) {
|
|
1563
1645
|
case "replace":
|
|
1564
1646
|
case "hydrate": return X(t.state);
|
|
1565
1647
|
case "set-presentation": return X({
|
|
1566
1648
|
...n,
|
|
1567
|
-
presentation:
|
|
1649
|
+
presentation: Nn(t.presentation, rn, "presentation")
|
|
1568
1650
|
});
|
|
1569
1651
|
case "select": return X({
|
|
1570
1652
|
...n,
|
|
@@ -1577,15 +1659,15 @@ function sn(e, t) {
|
|
|
1577
1659
|
});
|
|
1578
1660
|
case "focus": return X({
|
|
1579
1661
|
...n,
|
|
1580
|
-
navigatorFocusedId:
|
|
1662
|
+
navigatorFocusedId: Tn(t.id, "id")
|
|
1581
1663
|
});
|
|
1582
1664
|
case "set-filter": return X({
|
|
1583
1665
|
...n,
|
|
1584
|
-
navigatorFilter:
|
|
1666
|
+
navigatorFilter: An(t.filter, "", "filter")
|
|
1585
1667
|
});
|
|
1586
1668
|
case "set-expanded": return X({
|
|
1587
1669
|
...n,
|
|
1588
|
-
expandedIds:
|
|
1670
|
+
expandedIds: En(t.ids, "ids")
|
|
1589
1671
|
});
|
|
1590
1672
|
case "toggle-expanded": {
|
|
1591
1673
|
let e = Q(t.id, "id"), r = new Set(n.expandedIds);
|
|
@@ -1596,12 +1678,12 @@ function sn(e, t) {
|
|
|
1596
1678
|
}
|
|
1597
1679
|
case "set-grain": return X({
|
|
1598
1680
|
...n,
|
|
1599
|
-
grain:
|
|
1681
|
+
grain: Nn(t.grain, an, "grain"),
|
|
1600
1682
|
expandedIds: []
|
|
1601
1683
|
});
|
|
1602
1684
|
case "set-viewport": return X({
|
|
1603
1685
|
...n,
|
|
1604
|
-
viewport:
|
|
1686
|
+
viewport: Pn(t.viewport)
|
|
1605
1687
|
});
|
|
1606
1688
|
case "open-in-map": {
|
|
1607
1689
|
let e = Q(t.id, "id");
|
|
@@ -1616,19 +1698,19 @@ function sn(e, t) {
|
|
|
1616
1698
|
let e = Q(t.id, "id");
|
|
1617
1699
|
return X({
|
|
1618
1700
|
...n,
|
|
1619
|
-
grain:
|
|
1620
|
-
expandedIds:
|
|
1701
|
+
grain: Nn(t.grain, an, "grain"),
|
|
1702
|
+
expandedIds: En(t.expandedIds, "expandedIds"),
|
|
1621
1703
|
selectedId: e,
|
|
1622
1704
|
navigatorFocusedId: e
|
|
1623
1705
|
});
|
|
1624
1706
|
}
|
|
1625
1707
|
case "hover-session": return X({
|
|
1626
1708
|
...n,
|
|
1627
|
-
hoveredSessionId:
|
|
1709
|
+
hoveredSessionId: wn(t.sessionId, "sessionId")
|
|
1628
1710
|
});
|
|
1629
1711
|
case "select-session": return X({
|
|
1630
1712
|
...n,
|
|
1631
|
-
selectedSessionId:
|
|
1713
|
+
selectedSessionId: wn(t.sessionId, "sessionId")
|
|
1632
1714
|
});
|
|
1633
1715
|
case "toggle-commit-sessions": {
|
|
1634
1716
|
let e = Q(t.commitHash, "commitHash"), r = new Set(n.expandedCommitSessions);
|
|
@@ -1646,14 +1728,14 @@ function sn(e, t) {
|
|
|
1646
1728
|
}
|
|
1647
1729
|
case "set-rank-mode": return X({
|
|
1648
1730
|
...n,
|
|
1649
|
-
rankMode:
|
|
1731
|
+
rankMode: Nn(t.rankMode, on, "rankMode")
|
|
1650
1732
|
});
|
|
1651
1733
|
case "set-scent-filter": return X({
|
|
1652
1734
|
...n,
|
|
1653
|
-
scentFilter:
|
|
1735
|
+
scentFilter: Rn(t.scentFilter, "scentFilter")
|
|
1654
1736
|
});
|
|
1655
1737
|
case "set-rank-expanded": {
|
|
1656
|
-
let e =
|
|
1738
|
+
let e = jn(t.expanded, "expanded"), r = new Set(n.expandedCommitSessions);
|
|
1657
1739
|
return e ? r.add("ranked:all") : r.delete("ranked:all"), X({
|
|
1658
1740
|
...n,
|
|
1659
1741
|
expandedCommitSessions: [...r]
|
|
@@ -1662,8 +1744,8 @@ function sn(e, t) {
|
|
|
1662
1744
|
default: throw Z("reduce state", "action.type", "the action is unsupported", "use a documented CodeMapAction");
|
|
1663
1745
|
}
|
|
1664
1746
|
}
|
|
1665
|
-
function
|
|
1666
|
-
let n = X(t), r =
|
|
1747
|
+
function hn(e, t) {
|
|
1748
|
+
let n = X(t), r = _n(e), i = (e) => {
|
|
1667
1749
|
if (!e) return {
|
|
1668
1750
|
sessionId: null,
|
|
1669
1751
|
commitHashes: [],
|
|
@@ -1673,8 +1755,8 @@ function cn(e, t) {
|
|
|
1673
1755
|
let t = r.filter((t) => t.sessionId === e);
|
|
1674
1756
|
return {
|
|
1675
1757
|
sessionId: e,
|
|
1676
|
-
commitHashes: [...new Set(t.filter((e) => !e.ghost).map((e) => e.commitHash))].sort(
|
|
1677
|
-
ghostHashes: [...new Set(t.filter((e) => e.ghost).map((e) => e.commitHash))].sort(
|
|
1758
|
+
commitHashes: [...new Set(t.filter((e) => !e.ghost).map((e) => e.commitHash))].sort(Cn),
|
|
1759
|
+
ghostHashes: [...new Set(t.filter((e) => e.ghost).map((e) => e.commitHash))].sort(Cn),
|
|
1678
1760
|
edges: t.map((e) => ({ ...e }))
|
|
1679
1761
|
};
|
|
1680
1762
|
};
|
|
@@ -1683,7 +1765,7 @@ function cn(e, t) {
|
|
|
1683
1765
|
hovered: i(n.hoveredSessionId)
|
|
1684
1766
|
};
|
|
1685
1767
|
}
|
|
1686
|
-
function
|
|
1768
|
+
function gn(e) {
|
|
1687
1769
|
let t = X(e);
|
|
1688
1770
|
return t.hoveredSessionId === null ? t.selectedSessionId === null ? null : {
|
|
1689
1771
|
type: "select-session",
|
|
@@ -1693,11 +1775,11 @@ function ln(e) {
|
|
|
1693
1775
|
sessionId: null
|
|
1694
1776
|
};
|
|
1695
1777
|
}
|
|
1696
|
-
function
|
|
1778
|
+
function _n(e) {
|
|
1697
1779
|
let t = e?.edges ?? [];
|
|
1698
1780
|
if (!Array.isArray(t)) throw Z("derive timeline highlight", "payload.edges", "edges is not an array", "provide a payload with an edges array");
|
|
1699
1781
|
return t.map((e, t) => {
|
|
1700
|
-
if (!
|
|
1782
|
+
if (!bn(e)) throw Z("derive timeline highlight", `payload.edges[${t}]`, "the edge is not an object", "provide an edge object");
|
|
1701
1783
|
return {
|
|
1702
1784
|
sessionId: Q(e.sessionId, `payload.edges[${t}].sessionId`),
|
|
1703
1785
|
commitHash: Q(e.commitHash, `payload.edges[${t}].commitHash`),
|
|
@@ -1705,13 +1787,13 @@ function un(e) {
|
|
|
1705
1787
|
};
|
|
1706
1788
|
});
|
|
1707
1789
|
}
|
|
1708
|
-
function
|
|
1709
|
-
e &&
|
|
1790
|
+
function vn(e, t) {
|
|
1791
|
+
e && ft(e);
|
|
1710
1792
|
let n = X(t), r = e?.nodes ?? [];
|
|
1711
1793
|
if (!Array.isArray(r)) throw Z("derive view", "payload.nodes", "nodes is not an array", "provide a CodeMapPayload with a nodes array");
|
|
1712
1794
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
1713
1795
|
r.forEach((e, t) => {
|
|
1714
|
-
if (!
|
|
1796
|
+
if (!bn(e)) throw Z("derive view", `payload.nodes[${t}]`, "the node is not an object", "provide a node object");
|
|
1715
1797
|
let n = Q(e.id, `payload.nodes[${t}].id`);
|
|
1716
1798
|
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");
|
|
1717
1799
|
let r = {
|
|
@@ -1726,7 +1808,7 @@ function dn(e, t) {
|
|
|
1726
1808
|
let t = o.get(e.parent) ?? [];
|
|
1727
1809
|
t.push(e), o.set(e.parent, t);
|
|
1728
1810
|
} else s.push(e);
|
|
1729
|
-
let c = (e, t) => (Number.isFinite(e.order) ? Number(e.order) : a.get(e.id) ?? 0) - (Number.isFinite(t.order) ? Number(t.order) : a.get(t.id) ?? 0) ||
|
|
1811
|
+
let c = (e, t) => (Number.isFinite(e.order) ? Number(e.order) : a.get(e.id) ?? 0) - (Number.isFinite(t.order) ? Number(t.order) : a.get(t.id) ?? 0) || Cn(e.id, t.id);
|
|
1730
1812
|
s.sort(c);
|
|
1731
1813
|
for (let e of o.values()) e.sort(c);
|
|
1732
1814
|
let l = /* @__PURE__ */ new Map(), u = [], d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
|
|
@@ -1749,7 +1831,7 @@ function dn(e, t) {
|
|
|
1749
1831
|
let t = e;
|
|
1750
1832
|
for (; t;) g.add(t.id), t = t.parent ? i.get(t.parent) : null;
|
|
1751
1833
|
}
|
|
1752
|
-
let _ =
|
|
1834
|
+
let _ = cn[n.grain], v = [];
|
|
1753
1835
|
function y(e, t, n = null) {
|
|
1754
1836
|
if (h && !g.has(e.id)) return;
|
|
1755
1837
|
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;
|
|
@@ -1772,11 +1854,11 @@ function dn(e, t) {
|
|
|
1772
1854
|
else b.push({ ...e });
|
|
1773
1855
|
}
|
|
1774
1856
|
for (let e of s) x(e, 0);
|
|
1775
|
-
let S = n.selectedId ? i.get(n.selectedId) ?? null : null,
|
|
1857
|
+
let S = n.selectedId ? i.get(n.selectedId) ?? null : null, ee = new Set(v.map((e) => e.node.id));
|
|
1776
1858
|
return {
|
|
1777
1859
|
state: n,
|
|
1778
1860
|
rows: v,
|
|
1779
|
-
focusedId: n.navigatorFocusedId &&
|
|
1861
|
+
focusedId: n.navigatorFocusedId && ee.has(n.navigatorFocusedId) ? n.navigatorFocusedId : v[0]?.node.id ?? null,
|
|
1780
1862
|
selected: S ? { ...S } : null,
|
|
1781
1863
|
staleSelectedId: n.selectedId && !S ? n.selectedId : null,
|
|
1782
1864
|
canvas: {
|
|
@@ -1785,7 +1867,7 @@ function dn(e, t) {
|
|
|
1785
1867
|
visibleIds: b.map((e) => e.id),
|
|
1786
1868
|
selectedId: S?.id ?? null,
|
|
1787
1869
|
grain: n.grain,
|
|
1788
|
-
expandedIds: [...m].sort(
|
|
1870
|
+
expandedIds: [...m].sort(Cn),
|
|
1789
1871
|
viewport: n.viewport ? { ...n.viewport } : null,
|
|
1790
1872
|
hierarchy: {
|
|
1791
1873
|
orderedIds: u,
|
|
@@ -1796,17 +1878,17 @@ function dn(e, t) {
|
|
|
1796
1878
|
}
|
|
1797
1879
|
};
|
|
1798
1880
|
}
|
|
1799
|
-
function
|
|
1800
|
-
if (!
|
|
1801
|
-
let t =
|
|
1802
|
-
if (!t) throw Z("reduce state", "action.type", `action ${JSON.stringify(e.type)} is not supported`, `use one of ${Object.keys(
|
|
1803
|
-
switch (
|
|
1881
|
+
function yn(e) {
|
|
1882
|
+
if (!bn(e) || typeof e.type != "string") throw Z("reduce state", "action.type", "the action has no string type", "pass a supported action object");
|
|
1883
|
+
let t = dn[e.type];
|
|
1884
|
+
if (!t) throw Z("reduce state", "action.type", `action ${JSON.stringify(e.type)} is not supported`, `use one of ${Object.keys(dn).join(", ")}`);
|
|
1885
|
+
switch (Sn(e, t, "reduce state", `action ${e.type}`), e.type) {
|
|
1804
1886
|
case "replace":
|
|
1805
1887
|
case "hydrate":
|
|
1806
|
-
|
|
1888
|
+
On(e.state, "state");
|
|
1807
1889
|
break;
|
|
1808
1890
|
case "set-presentation":
|
|
1809
|
-
|
|
1891
|
+
Nn(e.presentation, rn, "presentation");
|
|
1810
1892
|
break;
|
|
1811
1893
|
case "select":
|
|
1812
1894
|
case "toggle-expanded":
|
|
@@ -1814,27 +1896,27 @@ function fn(e) {
|
|
|
1814
1896
|
Q(e.id, "id");
|
|
1815
1897
|
break;
|
|
1816
1898
|
case "focus":
|
|
1817
|
-
|
|
1899
|
+
wn(e.id, "id");
|
|
1818
1900
|
break;
|
|
1819
1901
|
case "set-filter":
|
|
1820
|
-
|
|
1902
|
+
kn(e.filter, "filter");
|
|
1821
1903
|
break;
|
|
1822
1904
|
case "set-expanded":
|
|
1823
|
-
|
|
1905
|
+
Dn(e.ids, "ids");
|
|
1824
1906
|
break;
|
|
1825
1907
|
case "set-grain":
|
|
1826
|
-
|
|
1908
|
+
Nn(e.grain, an, "grain");
|
|
1827
1909
|
break;
|
|
1828
1910
|
case "set-viewport":
|
|
1829
|
-
|
|
1911
|
+
Fn(e.viewport, "viewport");
|
|
1830
1912
|
break;
|
|
1831
1913
|
case "reveal":
|
|
1832
|
-
Q(e.id, "id"),
|
|
1914
|
+
Q(e.id, "id"), Nn(e.grain, an, "grain"), Dn(e.expandedIds, "expandedIds");
|
|
1833
1915
|
break;
|
|
1834
1916
|
case "clear-selection": break;
|
|
1835
1917
|
case "hover-session":
|
|
1836
1918
|
case "select-session":
|
|
1837
|
-
|
|
1919
|
+
wn(e.sessionId, "sessionId");
|
|
1838
1920
|
break;
|
|
1839
1921
|
case "toggle-commit-sessions":
|
|
1840
1922
|
Q(e.commitHash, "commitHash");
|
|
@@ -1843,113 +1925,113 @@ function fn(e) {
|
|
|
1843
1925
|
Q(e.successorHash, "successorHash");
|
|
1844
1926
|
break;
|
|
1845
1927
|
case "set-rank-mode":
|
|
1846
|
-
|
|
1928
|
+
Nn(e.rankMode, on, "rankMode");
|
|
1847
1929
|
break;
|
|
1848
1930
|
case "set-scent-filter":
|
|
1849
|
-
|
|
1931
|
+
Rn(e.scentFilter, "scentFilter");
|
|
1850
1932
|
break;
|
|
1851
1933
|
case "set-rank-expanded":
|
|
1852
|
-
|
|
1934
|
+
jn(e.expanded, "expanded");
|
|
1853
1935
|
break;
|
|
1854
1936
|
}
|
|
1855
1937
|
}
|
|
1856
1938
|
function Z(e, t, n, r) {
|
|
1857
1939
|
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}.`);
|
|
1858
1940
|
}
|
|
1859
|
-
function
|
|
1941
|
+
function bn(e) {
|
|
1860
1942
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1861
1943
|
}
|
|
1862
|
-
function
|
|
1944
|
+
function xn(e, t, n, r) {
|
|
1863
1945
|
let i = new Set(t), a = Object.keys(e).find((e) => !i.has(e));
|
|
1864
1946
|
if (a) throw Z(n, `${r}.${a}`, `field ${JSON.stringify(a)} is not allowed`, `remove ${JSON.stringify(a)} and use only ${t.join(", ")}`);
|
|
1865
1947
|
}
|
|
1866
|
-
function
|
|
1867
|
-
|
|
1948
|
+
function Sn(e, t, n, r) {
|
|
1949
|
+
xn(e, t, n, r);
|
|
1868
1950
|
let i = t.find((t) => !(t in e));
|
|
1869
1951
|
if (i) throw Z(n, `${r}.${i}`, `required field ${JSON.stringify(i)} is missing`, `provide ${JSON.stringify(i)} for this action`);
|
|
1870
1952
|
}
|
|
1871
|
-
function
|
|
1953
|
+
function Cn(e, t) {
|
|
1872
1954
|
return e < t ? -1 : +(e > t);
|
|
1873
1955
|
}
|
|
1874
1956
|
function Q(e, t) {
|
|
1875
1957
|
if (typeof e != "string" || e.length === 0) throw Z("normalize state", t, "the id is not a nonempty string", "provide a nonempty string id");
|
|
1876
1958
|
return e;
|
|
1877
1959
|
}
|
|
1878
|
-
function
|
|
1960
|
+
function wn(e, t) {
|
|
1879
1961
|
return e === null ? null : Q(e, t);
|
|
1880
1962
|
}
|
|
1881
|
-
function
|
|
1963
|
+
function Tn(e, t) {
|
|
1882
1964
|
return e == null ? null : Q(e, t);
|
|
1883
1965
|
}
|
|
1884
|
-
function
|
|
1966
|
+
function En(e, t) {
|
|
1885
1967
|
if (e === void 0) return [];
|
|
1886
1968
|
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");
|
|
1887
1969
|
let n = [...e];
|
|
1888
|
-
return [...new Set(n.map((e, n) => Q(e, `${t}[${n}]`)))].sort(
|
|
1970
|
+
return [...new Set(n.map((e, n) => Q(e, `${t}[${n}]`)))].sort(Cn);
|
|
1889
1971
|
}
|
|
1890
|
-
function
|
|
1972
|
+
function Dn(e, t) {
|
|
1891
1973
|
if (e === void 0) throw Z("normalize action", t, "the required id iterable is undefined", "provide a non-string iterable of nonempty ids");
|
|
1892
|
-
return
|
|
1974
|
+
return En(e, t);
|
|
1893
1975
|
}
|
|
1894
|
-
function
|
|
1895
|
-
if (!
|
|
1976
|
+
function On(e, t) {
|
|
1977
|
+
if (!bn(e)) throw Z("normalize action", t, "the required value is not an object", "provide an object");
|
|
1896
1978
|
return e;
|
|
1897
1979
|
}
|
|
1898
|
-
function
|
|
1980
|
+
function kn(e, t) {
|
|
1899
1981
|
if (typeof e != "string") throw Z("normalize action", t, "the required value is not a string", "provide a string");
|
|
1900
1982
|
return e;
|
|
1901
1983
|
}
|
|
1902
|
-
function
|
|
1984
|
+
function An(e, t, n) {
|
|
1903
1985
|
if (e === void 0) return t;
|
|
1904
1986
|
if (typeof e != "string") throw Z("normalize state", n, "the value is not a string", "provide a string");
|
|
1905
1987
|
return e;
|
|
1906
1988
|
}
|
|
1907
|
-
function
|
|
1989
|
+
function jn(e, t) {
|
|
1908
1990
|
if (typeof e != "boolean") throw Z("normalize state", t, "the value is not a boolean", "provide true or false");
|
|
1909
1991
|
return e;
|
|
1910
1992
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return e === void 0 ? n :
|
|
1993
|
+
function Mn(e, t, n, r) {
|
|
1994
|
+
return e === void 0 ? n : Nn(e, t, r);
|
|
1913
1995
|
}
|
|
1914
|
-
function
|
|
1996
|
+
function Nn(e, t, n) {
|
|
1915
1997
|
if (typeof e != "string" || !t.has(e)) throw Z("normalize state", n, `value ${JSON.stringify(e)} is unsupported`, `use one of ${[...t].join(", ")}`);
|
|
1916
1998
|
return e;
|
|
1917
1999
|
}
|
|
1918
|
-
function
|
|
2000
|
+
function Pn(e) {
|
|
1919
2001
|
if (e == null) return null;
|
|
1920
|
-
if (!
|
|
2002
|
+
if (!bn(e)) throw Z("normalize state", "viewport", "the viewport is not an object or null", "provide {scale, panX, panY} or null");
|
|
1921
2003
|
let { scale: t, panX: n, panY: r } = e;
|
|
1922
|
-
if (!
|
|
2004
|
+
if (!tn(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}`);
|
|
1923
2005
|
return {
|
|
1924
2006
|
scale: t,
|
|
1925
2007
|
panX: n,
|
|
1926
2008
|
panY: r
|
|
1927
2009
|
};
|
|
1928
2010
|
}
|
|
1929
|
-
function
|
|
2011
|
+
function Fn(e, t) {
|
|
1930
2012
|
if (e === null) return null;
|
|
1931
2013
|
if (e === void 0) throw Z("normalize action", t, "the required viewport is undefined", "provide null or a bounded viewport object");
|
|
1932
|
-
return
|
|
2014
|
+
return Pn(e);
|
|
1933
2015
|
}
|
|
1934
|
-
function
|
|
2016
|
+
function In(e, t) {
|
|
1935
2017
|
return e === null || t === null ? e === t : e.scale === t.scale && e.panX === t.panX && e.panY === t.panY;
|
|
1936
2018
|
}
|
|
1937
|
-
function
|
|
2019
|
+
function Ln(e) {
|
|
1938
2020
|
if (e == null) return null;
|
|
1939
|
-
if (typeof e != "string" ||
|
|
2021
|
+
if (typeof e != "string" || !sn.has(e)) throw Z("normalize state", "scentFilter", `value ${JSON.stringify(e)} is unsupported`, `use null or one of ${[...sn].join(", ")}`);
|
|
1940
2022
|
return e;
|
|
1941
2023
|
}
|
|
1942
|
-
function
|
|
2024
|
+
function Rn(e, t) {
|
|
1943
2025
|
if (e === void 0) throw Z("normalize action", t, "the required scent filter is undefined", "provide null or a SCENT_TAGS member");
|
|
1944
|
-
return
|
|
2026
|
+
return Ln(e);
|
|
1945
2027
|
}
|
|
1946
2028
|
//#endregion
|
|
1947
2029
|
//#region src/ui/MapCanvas.jsx
|
|
1948
|
-
var
|
|
2030
|
+
var zn = 56, Bn = 104, Vn = 248, Hn = 132, Un = 28, Wn = 48, Gn = 1200, Kn = 1.25, qn = {
|
|
1949
2031
|
overview: "project",
|
|
1950
2032
|
folders: "package",
|
|
1951
2033
|
files: "file"
|
|
1952
|
-
},
|
|
2034
|
+
}, Jn = Object.fromEntries(Object.entries(qn).map(([e, t]) => [e, ln[t]])), Yn = [
|
|
1953
2035
|
{
|
|
1954
2036
|
id: "overview",
|
|
1955
2037
|
label: "overview"
|
|
@@ -1962,19 +2044,19 @@ var Mn = 56, Nn = 104, Pn = 248, Fn = 132, In = 28, Ln = 48, Rn = 1200, zn = 1.2
|
|
|
1962
2044
|
id: "files",
|
|
1963
2045
|
label: "files"
|
|
1964
2046
|
}
|
|
1965
|
-
],
|
|
1966
|
-
function
|
|
2047
|
+
], Xn = 500, Zn = 1e4, Qn = 3;
|
|
2048
|
+
function $n(e) {
|
|
1967
2049
|
let t = Math.round(Number(e) || 0);
|
|
1968
2050
|
return t < 0 ? 0 : t > 4 ? 4 : t;
|
|
1969
2051
|
}
|
|
1970
|
-
function
|
|
2052
|
+
function er(e) {
|
|
1971
2053
|
let t = String(e ?? ""), n = t.lastIndexOf("/");
|
|
1972
2054
|
return n >= 0 ? t.slice(n + 1) : t;
|
|
1973
2055
|
}
|
|
1974
|
-
function
|
|
2056
|
+
function tr(e, t) {
|
|
1975
2057
|
return e._order === t._order ? e.id < t.id ? -1 : +(e.id > t.id) : e._order - t._order;
|
|
1976
2058
|
}
|
|
1977
|
-
function
|
|
2059
|
+
function nr(e) {
|
|
1978
2060
|
let t = /* @__PURE__ */ new Map();
|
|
1979
2061
|
e.forEach((e, n) => {
|
|
1980
2062
|
let r = Number.isFinite(e.order) ? e.order : n;
|
|
@@ -1992,8 +2074,8 @@ function Yn(e) {
|
|
|
1992
2074
|
t ? t.push(e) : n.set(a, [e]);
|
|
1993
2075
|
} else i.push(e);
|
|
1994
2076
|
}
|
|
1995
|
-
for (let e of n.values()) e.sort(
|
|
1996
|
-
i.sort(
|
|
2077
|
+
for (let e of n.values()) e.sort(tr);
|
|
2078
|
+
i.sort(tr);
|
|
1997
2079
|
let a = /* @__PURE__ */ new Map(), o = [], s = (e, t) => {
|
|
1998
2080
|
a.set(e.id, t), o.push(e.id);
|
|
1999
2081
|
for (let r of n.get(e.id) ?? []) s(r, t + 1);
|
|
@@ -2009,7 +2091,7 @@ function Yn(e) {
|
|
|
2009
2091
|
canonical: !1
|
|
2010
2092
|
};
|
|
2011
2093
|
}
|
|
2012
|
-
function
|
|
2094
|
+
function rr(e, t) {
|
|
2013
2095
|
let n = new Map(t.orderedIds.map((e, t) => [e, t])), r = new Map(e.map((e) => [e.id, {
|
|
2014
2096
|
...e,
|
|
2015
2097
|
_order: n.get(e.id) ?? 2 ** 53 - 1
|
|
@@ -2028,10 +2110,10 @@ function Xn(e, t) {
|
|
|
2028
2110
|
canonical: !0
|
|
2029
2111
|
};
|
|
2030
2112
|
}
|
|
2031
|
-
function
|
|
2113
|
+
function ir(e, t) {
|
|
2032
2114
|
return t.canonical ? t.depthById.get(e.id) ?? 0 : Number.isFinite(e.layer) ? e.layer : t.depthById.get(e.id) ?? 0;
|
|
2033
2115
|
}
|
|
2034
|
-
function
|
|
2116
|
+
function ar(e, t, n) {
|
|
2035
2117
|
let { children: r, roots: i } = e, a = [], o = (e, i) => {
|
|
2036
2118
|
let s = r.get(e.id);
|
|
2037
2119
|
if (s && s.length > 0 && (i < t || n.has(e.id))) for (let e of s) o(e, i + 1);
|
|
@@ -2040,7 +2122,7 @@ function Qn(e, t, n) {
|
|
|
2040
2122
|
for (let e of i) o(e, 0);
|
|
2041
2123
|
return a;
|
|
2042
2124
|
}
|
|
2043
|
-
function
|
|
2125
|
+
function or(e, t) {
|
|
2044
2126
|
if (e.length === 0) return {
|
|
2045
2127
|
positioned: [],
|
|
2046
2128
|
width: 0,
|
|
@@ -2049,21 +2131,21 @@ function $n(e, t) {
|
|
|
2049
2131
|
let n = 0;
|
|
2050
2132
|
for (let t of e) n = Math.max(n, Math.max(0, Number(t.loc) || 0));
|
|
2051
2133
|
let r = (e) => {
|
|
2052
|
-
if (n <= 0) return
|
|
2134
|
+
if (n <= 0) return Bn;
|
|
2053
2135
|
let t = Math.max(0, Number(e.loc) || 0) / n;
|
|
2054
|
-
return Math.round(
|
|
2136
|
+
return Math.round(Bn + t * (Vn - Bn));
|
|
2055
2137
|
}, i = /* @__PURE__ */ new Map();
|
|
2056
2138
|
for (let n of e) {
|
|
2057
|
-
let e =
|
|
2139
|
+
let e = ir(n, t), r = i.get(e);
|
|
2058
2140
|
r ? r.push(n) : i.set(e, [n]);
|
|
2059
2141
|
}
|
|
2060
2142
|
let a = Array.from(i.keys()).sort((e, t) => e - t);
|
|
2061
|
-
for (let e of a) i.get(e).sort(
|
|
2062
|
-
let o = (e) => e.reduce((e, t) => e + r(t), 0) +
|
|
2143
|
+
for (let e of a) i.get(e).sort(tr);
|
|
2144
|
+
let o = (e) => e.reduce((e, t) => e + r(t), 0) + Un * (e.length - 1), s = (e) => {
|
|
2063
2145
|
let t = [], n = [], i = 0;
|
|
2064
2146
|
for (let a of e) {
|
|
2065
|
-
let e = r(a), o = n.length === 0 ? e : e +
|
|
2066
|
-
n.length > 0 && i + o >
|
|
2147
|
+
let e = r(a), o = n.length === 0 ? e : e + Un;
|
|
2148
|
+
n.length > 0 && i + o > Gn ? (t.push(n), n = [a], i = e) : (n.push(a), i += o);
|
|
2067
2149
|
}
|
|
2068
2150
|
return n.length > 0 && t.push(n), t;
|
|
2069
2151
|
}, c = /* @__PURE__ */ new Map();
|
|
@@ -2072,7 +2154,7 @@ function $n(e, t) {
|
|
|
2072
2154
|
for (let e of a) for (let t of c.get(e)) l = Math.max(l, o(t));
|
|
2073
2155
|
let u = [], d = 0;
|
|
2074
2156
|
for (let e of a) for (let t of c.get(e)) {
|
|
2075
|
-
let e =
|
|
2157
|
+
let e = Wn + (l - o(t)) / 2, n = Wn + d * Hn;
|
|
2076
2158
|
for (let i of t) {
|
|
2077
2159
|
let t = r(i);
|
|
2078
2160
|
u.push({
|
|
@@ -2080,18 +2162,18 @@ function $n(e, t) {
|
|
|
2080
2162
|
x: e,
|
|
2081
2163
|
y: n,
|
|
2082
2164
|
w: t,
|
|
2083
|
-
h:
|
|
2084
|
-
}), e += t +
|
|
2165
|
+
h: zn
|
|
2166
|
+
}), e += t + Un;
|
|
2085
2167
|
}
|
|
2086
2168
|
d += 1;
|
|
2087
2169
|
}
|
|
2088
2170
|
return {
|
|
2089
2171
|
positioned: u,
|
|
2090
|
-
width: l +
|
|
2091
|
-
height: (d - 1) *
|
|
2172
|
+
width: l + Wn * 2,
|
|
2173
|
+
height: (d - 1) * Hn + zn + Wn * 2
|
|
2092
2174
|
};
|
|
2093
2175
|
}
|
|
2094
|
-
function
|
|
2176
|
+
function sr(e, t) {
|
|
2095
2177
|
let n = /* @__PURE__ */ new Map();
|
|
2096
2178
|
return (r) => {
|
|
2097
2179
|
if (n.has(r)) return n.get(r);
|
|
@@ -2100,8 +2182,8 @@ function er(e, t) {
|
|
|
2100
2182
|
return n.set(r, i ?? null), i ?? null;
|
|
2101
2183
|
};
|
|
2102
2184
|
}
|
|
2103
|
-
function
|
|
2104
|
-
let r =
|
|
2185
|
+
function cr(e, t, n) {
|
|
2186
|
+
let r = sr(t, n), i = /* @__PURE__ */ new Map();
|
|
2105
2187
|
for (let t of e) {
|
|
2106
2188
|
let e = r(t.from), n = r(t.to);
|
|
2107
2189
|
if (!e || !n || e === n) continue;
|
|
@@ -2115,8 +2197,8 @@ function tr(e, t, n) {
|
|
|
2115
2197
|
}
|
|
2116
2198
|
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);
|
|
2117
2199
|
}
|
|
2118
|
-
function
|
|
2119
|
-
let r =
|
|
2200
|
+
function lr(e, t, n) {
|
|
2201
|
+
let r = sr(t, n), i = /* @__PURE__ */ new Map();
|
|
2120
2202
|
for (let t of e) {
|
|
2121
2203
|
let e = Math.max(0, Number(t.violations) || 0);
|
|
2122
2204
|
if (e <= 0) continue;
|
|
@@ -2125,16 +2207,16 @@ function nr(e, t, n) {
|
|
|
2125
2207
|
}
|
|
2126
2208
|
return i;
|
|
2127
2209
|
}
|
|
2128
|
-
function
|
|
2210
|
+
function ur(e) {
|
|
2129
2211
|
let t;
|
|
2130
2212
|
for (let n of e) (!t || n.y < t.y || n.y === t.y && n.x < t.x) && (t = n);
|
|
2131
2213
|
return t;
|
|
2132
2214
|
}
|
|
2133
|
-
function
|
|
2215
|
+
function dr(e, t, n) {
|
|
2134
2216
|
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);
|
|
2135
2217
|
if (i !== -1) return r[i + n];
|
|
2136
2218
|
}
|
|
2137
|
-
function
|
|
2219
|
+
function fr(e, t, n) {
|
|
2138
2220
|
let r;
|
|
2139
2221
|
for (let i of e) (i.y - t.y) * n <= 0 || (r === void 0 || (i.y - r) * n < 0) && (r = i.y);
|
|
2140
2222
|
if (r === void 0) return;
|
|
@@ -2148,167 +2230,167 @@ function ar(e, t, n) {
|
|
|
2148
2230
|
}
|
|
2149
2231
|
return a;
|
|
2150
2232
|
}
|
|
2151
|
-
function
|
|
2233
|
+
function pr({ data: t = {
|
|
2152
2234
|
nodes: [],
|
|
2153
2235
|
edges: []
|
|
2154
|
-
}, grain:
|
|
2155
|
-
let
|
|
2156
|
-
x: $(
|
|
2157
|
-
y: $(
|
|
2158
|
-
})), [
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
]),
|
|
2163
|
-
x:
|
|
2164
|
-
y:
|
|
2165
|
-
} :
|
|
2166
|
-
x: $(
|
|
2167
|
-
y: $(
|
|
2168
|
-
} :
|
|
2169
|
-
|
|
2170
|
-
if (
|
|
2171
|
-
if (
|
|
2172
|
-
|
|
2236
|
+
}, grain: n = "folders", expandedIds: o, visibleIds: m, hierarchy: h, selectedId: _, highlightedIds: v, nodeDeltas: x = {}, edgeDeltas: ne = {}, onSelect: ie, onGrainChange: oe, onExpandedIdsChange: C, onExpand: se, height: ce = 520, ariaLabel: le = "code map", className: ue = "", viewport: w, onViewportChange: T, onStateAction: E, canonicalControlled: D = !1 }) {
|
|
2237
|
+
let O = t?.nodes ?? [], de = t?.edges ?? [], k = a().replace(/[:]/g, ""), fe = `${k}-live`, pe = `${k}-list`, [me, he] = l(Jn[n] === void 0 ? "folders" : n), [ge, _e] = l(() => hr(o)), [ve, ye] = l(_ ?? null), [A, be] = l(null), [xe, Se] = l(() => gr(w?.scale) ? w.scale : 1), [Ce, we] = l(() => ({
|
|
2238
|
+
x: $(w?.panX, 0),
|
|
2239
|
+
y: $(w?.panY, 0)
|
|
2240
|
+
})), [Te, Ee] = l(""), [De, Oe] = l(!1), j = c(null), M = c(null), [N, ke] = l(null), Ae = c(null), je = c(!1), Me = c(w != null), Ne = w && gr(w.scale) ? `${w.scale}|${$(w.panX, 0)}|${$(w.panY, 0)}` : "", Pe = c(Ne), P = c(Ne), Fe = c(!1), Ie = c(n), Le = c(_), Re = _r(o), ze = _r(v), F = D ? Jn[n] === void 0 ? "folders" : n : me, I = s(() => D ? hr(o) : ge, [
|
|
2241
|
+
D,
|
|
2242
|
+
Re,
|
|
2243
|
+
ge
|
|
2244
|
+
]), L = D ? _ ?? null : ve, Be = D && w != null && gr(w.scale), R = N ? N.scale : Be ? w.scale : xe, z = N ? {
|
|
2245
|
+
x: N.panX,
|
|
2246
|
+
y: N.panY
|
|
2247
|
+
} : Be ? {
|
|
2248
|
+
x: $(w.panX, 0),
|
|
2249
|
+
y: $(w.panY, 0)
|
|
2250
|
+
} : Ce, Ve = c(R), B = c(z);
|
|
2251
|
+
Ve.current = R, B.current = z, i(() => {
|
|
2252
|
+
if (N && !M.current) {
|
|
2253
|
+
if (Be && w.scale === N.scale && $(w.panX, 0) === N.panX && $(w.panY, 0) === N.panY) {
|
|
2254
|
+
ke(null);
|
|
2173
2255
|
return;
|
|
2174
2256
|
}
|
|
2175
|
-
return
|
|
2257
|
+
return Ae.current = setTimeout(() => ke(null), Xn), () => clearTimeout(Ae.current);
|
|
2176
2258
|
}
|
|
2177
2259
|
}, [
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
]),
|
|
2184
|
-
|
|
2185
|
-
}, [
|
|
2186
|
-
!
|
|
2187
|
-
}, [
|
|
2188
|
-
|
|
2189
|
-
}, [
|
|
2190
|
-
if (
|
|
2191
|
-
if (!
|
|
2260
|
+
N,
|
|
2261
|
+
Be,
|
|
2262
|
+
w?.scale,
|
|
2263
|
+
w?.panX,
|
|
2264
|
+
w?.panY
|
|
2265
|
+
]), i(() => {
|
|
2266
|
+
D || n !== Ie.current && (Ie.current = n, Jn[n] !== void 0 && he(n));
|
|
2267
|
+
}, [D, n]), i(() => {
|
|
2268
|
+
!D && o !== void 0 && _e(hr(o));
|
|
2269
|
+
}, [D, Re]), i(() => {
|
|
2270
|
+
D || _ !== Le.current && (Le.current = _, _ !== void 0 && ye(_));
|
|
2271
|
+
}, [D, _]), i(() => {
|
|
2272
|
+
if (D) {
|
|
2273
|
+
if (!w && P.current !== "") P.current = "", Me.current = !1, je.current = !1, Se(1), we({
|
|
2192
2274
|
x: 0,
|
|
2193
2275
|
y: 0
|
|
2194
2276
|
});
|
|
2195
|
-
else if (
|
|
2196
|
-
let e = `${
|
|
2197
|
-
e !==
|
|
2277
|
+
else if (w && gr(w.scale)) {
|
|
2278
|
+
let e = `${w.scale}|${$(w.panX, 0)}|${$(w.panY, 0)}`;
|
|
2279
|
+
e !== P.current && (P.current = e, Me.current = !0);
|
|
2198
2280
|
}
|
|
2199
2281
|
return;
|
|
2200
2282
|
}
|
|
2201
|
-
if (!
|
|
2202
|
-
if (
|
|
2203
|
-
|
|
2283
|
+
if (!w) {
|
|
2284
|
+
if (P.current === "") return;
|
|
2285
|
+
P.current = "", Pe.current = "1|0|0", Me.current = !1, Se(1), we({
|
|
2204
2286
|
x: 0,
|
|
2205
2287
|
y: 0
|
|
2206
2288
|
});
|
|
2207
2289
|
return;
|
|
2208
2290
|
}
|
|
2209
|
-
if (!
|
|
2210
|
-
let e = `${
|
|
2211
|
-
e !==
|
|
2212
|
-
x: $(
|
|
2213
|
-
y: $(
|
|
2291
|
+
if (!gr(w.scale)) return;
|
|
2292
|
+
let e = `${w.scale}|${$(w.panX, 0)}|${$(w.panY, 0)}`;
|
|
2293
|
+
e !== P.current && (P.current = e, Me.current = !0, Pe.current = e, Se(w.scale), we({
|
|
2294
|
+
x: $(w.panX, 0),
|
|
2295
|
+
y: $(w.panY, 0)
|
|
2214
2296
|
}));
|
|
2215
2297
|
}, [
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
]),
|
|
2222
|
-
if (
|
|
2223
|
-
let e = `${
|
|
2224
|
-
|
|
2225
|
-
scale:
|
|
2226
|
-
panX:
|
|
2227
|
-
panY:
|
|
2228
|
-
}),
|
|
2298
|
+
D,
|
|
2299
|
+
w,
|
|
2300
|
+
w?.scale,
|
|
2301
|
+
w?.panX,
|
|
2302
|
+
w?.panY
|
|
2303
|
+
]), i(() => {
|
|
2304
|
+
if (D || !T && !E) return;
|
|
2305
|
+
let e = `${R}|${z.x}|${z.y}`;
|
|
2306
|
+
Pe.current !== e && (Pe.current = e, T?.({
|
|
2307
|
+
scale: R,
|
|
2308
|
+
panX: z.x,
|
|
2309
|
+
panY: z.y
|
|
2310
|
+
}), Fe.current && (Fe.current = !1, E?.({
|
|
2229
2311
|
type: "set-viewport",
|
|
2230
2312
|
viewport: {
|
|
2231
|
-
scale:
|
|
2232
|
-
panX:
|
|
2233
|
-
panY:
|
|
2313
|
+
scale: R,
|
|
2314
|
+
panX: z.x,
|
|
2315
|
+
panY: z.y
|
|
2234
2316
|
}
|
|
2235
2317
|
})));
|
|
2236
2318
|
}, [
|
|
2237
|
-
O,
|
|
2238
2319
|
D,
|
|
2239
2320
|
E,
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
z
|
|
2321
|
+
T,
|
|
2322
|
+
z.x,
|
|
2323
|
+
z.y,
|
|
2324
|
+
R
|
|
2243
2325
|
]);
|
|
2244
|
-
let V =
|
|
2326
|
+
let V = s(() => h ? rr(O, h) : nr(O), [O, h]), He = s(() => m === void 0 ? ar(V, Jn[F], I) : Array.from(m, (e) => V.byId.get(e)).filter(Boolean), [
|
|
2245
2327
|
V,
|
|
2328
|
+
F,
|
|
2246
2329
|
I,
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
]), H = a(() => new Set(He.map((e) => e.id)), [He]), { positioned: U, width: W, height: G } = a(() => $n(He, V), [He, V]), Ue = a(() => {
|
|
2330
|
+
_r(m)
|
|
2331
|
+
]), H = s(() => new Set(He.map((e) => e.id)), [He]), { positioned: U, width: W, height: G } = s(() => or(He, V), [He, V]), Ue = s(() => {
|
|
2250
2332
|
let e = /* @__PURE__ */ new Map();
|
|
2251
2333
|
for (let t of U) e.set(t.node.id, t);
|
|
2252
2334
|
return e;
|
|
2253
|
-
}, [U]), We =
|
|
2335
|
+
}, [U]), We = s(() => {
|
|
2254
2336
|
let e = /* @__PURE__ */ new Map();
|
|
2255
2337
|
for (let [t, n] of V.children) e.set(t, n.length);
|
|
2256
2338
|
return e;
|
|
2257
|
-
}, [V]), Ge =
|
|
2258
|
-
|
|
2339
|
+
}, [V]), Ge = s(() => cr(de, V.parentIdByChild, H), [
|
|
2340
|
+
de,
|
|
2259
2341
|
V.parentIdByChild,
|
|
2260
2342
|
H
|
|
2261
|
-
]), Ke =
|
|
2262
|
-
|
|
2343
|
+
]), Ke = s(() => Ge.reduce((e, t) => Math.max(e, t.weight), 1), [Ge]), qe = s(() => lr(O, V.parentIdByChild, H), [
|
|
2344
|
+
O,
|
|
2263
2345
|
V.parentIdByChild,
|
|
2264
2346
|
H
|
|
2265
|
-
]),
|
|
2266
|
-
let e =
|
|
2347
|
+
]), Je = s(() => {
|
|
2348
|
+
let e = hr(v);
|
|
2267
2349
|
if (e.size === 0) return e;
|
|
2268
|
-
let t =
|
|
2350
|
+
let t = sr(V.parentIdByChild, H), n = /* @__PURE__ */ new Set();
|
|
2269
2351
|
for (let r of e) {
|
|
2270
2352
|
let e = t(r);
|
|
2271
2353
|
e && n.add(e);
|
|
2272
2354
|
}
|
|
2273
2355
|
return n;
|
|
2274
2356
|
}, [
|
|
2275
|
-
|
|
2357
|
+
ze,
|
|
2276
2358
|
V.parentIdByChild,
|
|
2277
2359
|
H
|
|
2278
|
-
]),
|
|
2279
|
-
let e =
|
|
2280
|
-
return e ?
|
|
2281
|
-
}, [
|
|
2282
|
-
|
|
2360
|
+
]), Ye = s(() => {
|
|
2361
|
+
let e = Te.trim().toLowerCase();
|
|
2362
|
+
return e ? O.filter((t) => t.id.toLowerCase().includes(e) || (t.label || "").toLowerCase().includes(e)).slice(0, 8) : [];
|
|
2363
|
+
}, [O, Te]), Xe = r((e) => {
|
|
2364
|
+
T?.(e), E?.({
|
|
2283
2365
|
type: "set-viewport",
|
|
2284
2366
|
viewport: e
|
|
2285
2367
|
});
|
|
2286
|
-
}, [
|
|
2287
|
-
if (
|
|
2288
|
-
|
|
2368
|
+
}, [E, T]), K = r((e, t) => {
|
|
2369
|
+
if (D && t) {
|
|
2370
|
+
Xe(e);
|
|
2289
2371
|
return;
|
|
2290
2372
|
}
|
|
2291
|
-
t && (
|
|
2373
|
+
t && (Fe.current = !0), Se(e.scale), we({
|
|
2292
2374
|
x: e.panX,
|
|
2293
2375
|
y: e.panY
|
|
2294
2376
|
});
|
|
2295
|
-
}, [
|
|
2296
|
-
let t =
|
|
2377
|
+
}, [D, Xe]), Ze = r((e = !1) => {
|
|
2378
|
+
let t = j.current;
|
|
2297
2379
|
if (!t || W <= 0 || G <= 0) return;
|
|
2298
2380
|
let n = t.clientWidth, r = t.clientHeight;
|
|
2299
2381
|
if (n <= 0 || r <= 0) return;
|
|
2300
2382
|
let i = Math.min(n / W, r / G), a = Math.max(Y.min, Math.min(Y.max, i));
|
|
2301
|
-
|
|
2383
|
+
K({
|
|
2302
2384
|
scale: a,
|
|
2303
2385
|
panX: (n - W * a) / 2,
|
|
2304
2386
|
panY: (r - G * a) / 2
|
|
2305
2387
|
}, e);
|
|
2306
2388
|
}, [
|
|
2307
|
-
|
|
2389
|
+
K,
|
|
2308
2390
|
W,
|
|
2309
2391
|
G
|
|
2310
|
-
]),
|
|
2311
|
-
let n =
|
|
2392
|
+
]), Qe = r((e, t = !1) => {
|
|
2393
|
+
let n = j.current;
|
|
2312
2394
|
if (!n) return !1;
|
|
2313
2395
|
let r = n.clientWidth, i = n.clientHeight;
|
|
2314
2396
|
if (r <= 0 || i <= 0) return !1;
|
|
@@ -2317,30 +2399,30 @@ function or({ data: i = {
|
|
|
2317
2399
|
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;
|
|
2318
2400
|
if (u <= 0 || d <= 0) return !1;
|
|
2319
2401
|
let f = Math.min(r / u, i / d), p = Math.max(Y.min, Math.min(Y.max, f));
|
|
2320
|
-
return
|
|
2402
|
+
return K({
|
|
2321
2403
|
scale: p,
|
|
2322
2404
|
panX: r / 2 - (o + u / 2) * p,
|
|
2323
2405
|
panY: i / 2 - (s + d / 2) * p
|
|
2324
2406
|
}, t), !0;
|
|
2325
|
-
}, [
|
|
2326
|
-
|
|
2327
|
-
if (
|
|
2328
|
-
let e = window.setTimeout(() =>
|
|
2407
|
+
}, [K, U]), [$e, q] = l(!1);
|
|
2408
|
+
i(() => {
|
|
2409
|
+
if (!$e) return;
|
|
2410
|
+
let e = window.setTimeout(() => q(!1), 200);
|
|
2329
2411
|
return () => window.clearTimeout(e);
|
|
2330
|
-
}, [
|
|
2331
|
-
let et =
|
|
2332
|
-
|
|
2412
|
+
}, [$e]);
|
|
2413
|
+
let et = s(() => U.map((e) => e.node.id).join("|"), [U]), tt = Be ? `canonical|${w.scale}|${$(w.panX, 0)}|${$(w.panY, 0)}` : D ? "canonical|auto-fit" : "legacy", nt = c(I);
|
|
2414
|
+
i(() => {
|
|
2333
2415
|
let e = nt.current;
|
|
2334
|
-
if (nt.current =
|
|
2335
|
-
|
|
2416
|
+
if (nt.current = I, Me.current) {
|
|
2417
|
+
Me.current = !1, je.current = !0;
|
|
2336
2418
|
return;
|
|
2337
2419
|
}
|
|
2338
|
-
if (!
|
|
2339
|
-
|
|
2420
|
+
if (!je.current) {
|
|
2421
|
+
je.current = !0, Ze(Be);
|
|
2340
2422
|
return;
|
|
2341
2423
|
}
|
|
2342
2424
|
let t = null;
|
|
2343
|
-
for (let n of
|
|
2425
|
+
for (let n of I) if (!e.has(n)) {
|
|
2344
2426
|
t = n;
|
|
2345
2427
|
break;
|
|
2346
2428
|
}
|
|
@@ -2351,161 +2433,161 @@ function or({ data: i = {
|
|
|
2351
2433
|
for (let r of V.children.get(t) ?? []) e.add(r.id), n.push(r.id);
|
|
2352
2434
|
}
|
|
2353
2435
|
let r = [...e].filter((e) => H.has(e));
|
|
2354
|
-
if (
|
|
2436
|
+
if (q(!0), r.length > 0 && Qe(new Set(r), !0)) return;
|
|
2355
2437
|
}
|
|
2356
|
-
|
|
2438
|
+
Ze(Be);
|
|
2357
2439
|
}, [et, tt]);
|
|
2358
|
-
let rt =
|
|
2359
|
-
let t =
|
|
2440
|
+
let rt = r((e) => {
|
|
2441
|
+
let t = j.current, n = t ? t.clientWidth / 2 : 0, r = t ? t.clientHeight / 2 : 0, i = Ve.current, a = Math.max(Y.min, Math.min(Y.max, i * e));
|
|
2360
2442
|
if (a === i) return;
|
|
2361
|
-
let o =
|
|
2362
|
-
|
|
2443
|
+
let o = B.current;
|
|
2444
|
+
K({
|
|
2363
2445
|
scale: a,
|
|
2364
2446
|
panX: n - (n - o.x) / i * a,
|
|
2365
2447
|
panY: r - (r - o.y) / i * a
|
|
2366
2448
|
}, !0);
|
|
2367
|
-
}, [
|
|
2449
|
+
}, [K]), it = r((e) => {
|
|
2368
2450
|
if (!(e.ctrlKey || e.metaKey)) return;
|
|
2369
2451
|
e.preventDefault();
|
|
2370
|
-
let t =
|
|
2452
|
+
let t = j.current;
|
|
2371
2453
|
if (!t) return;
|
|
2372
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a =
|
|
2454
|
+
let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = Ve.current, o = Math.exp(-e.deltaY * .01), s = Math.max(1 / Kn, Math.min(Kn, o)), c = Math.max(Y.min, Math.min(Y.max, a * s));
|
|
2373
2455
|
if (c === a) return;
|
|
2374
|
-
let l =
|
|
2375
|
-
|
|
2456
|
+
let l = B.current;
|
|
2457
|
+
K({
|
|
2376
2458
|
scale: c,
|
|
2377
2459
|
panX: r - (r - l.x) / a * c,
|
|
2378
2460
|
panY: i - (i - l.y) / a * c
|
|
2379
2461
|
}, !0);
|
|
2380
|
-
}, [
|
|
2381
|
-
|
|
2382
|
-
let e =
|
|
2462
|
+
}, [K]);
|
|
2463
|
+
i(() => {
|
|
2464
|
+
let e = j.current;
|
|
2383
2465
|
if (e) return e.addEventListener("wheel", it, { passive: !1 }), () => e.removeEventListener("wheel", it);
|
|
2384
2466
|
}, [it]);
|
|
2385
|
-
let at =
|
|
2386
|
-
let t = Ue.get(e), n =
|
|
2467
|
+
let at = r((e) => {
|
|
2468
|
+
let t = Ue.get(e), n = j.current;
|
|
2387
2469
|
if (!t || !n) return;
|
|
2388
|
-
let r = Math.max(
|
|
2389
|
-
|
|
2470
|
+
let r = Math.max(R, 1);
|
|
2471
|
+
K({
|
|
2390
2472
|
scale: r,
|
|
2391
2473
|
panX: n.clientWidth / 2 - (t.x + t.w / 2) * r,
|
|
2392
2474
|
panY: n.clientHeight / 2 - (t.y + t.h / 2) * r
|
|
2393
2475
|
}, !0);
|
|
2394
2476
|
}, [
|
|
2395
|
-
|
|
2477
|
+
K,
|
|
2396
2478
|
Ue,
|
|
2397
|
-
|
|
2398
|
-
]),
|
|
2399
|
-
if (
|
|
2400
|
-
|
|
2479
|
+
R
|
|
2480
|
+
]), ot = r((e) => {
|
|
2481
|
+
if (D && e === L) return;
|
|
2482
|
+
D || ye(e), E?.(e ? {
|
|
2401
2483
|
type: "select",
|
|
2402
2484
|
id: e
|
|
2403
2485
|
} : { type: "clear-selection" });
|
|
2404
2486
|
let t = e ? V.byId.get(e) : null;
|
|
2405
|
-
ie?.(e, t ?
|
|
2487
|
+
ie?.(e, t ? mr(t) : null);
|
|
2406
2488
|
}, [
|
|
2407
|
-
O,
|
|
2408
|
-
ie,
|
|
2409
2489
|
D,
|
|
2410
|
-
|
|
2490
|
+
ie,
|
|
2491
|
+
E,
|
|
2492
|
+
L,
|
|
2411
2493
|
V.byId
|
|
2412
|
-
]),
|
|
2413
|
-
|
|
2494
|
+
]), st = r((e) => {
|
|
2495
|
+
D || (he(e), _e(/* @__PURE__ */ new Set())), E?.({
|
|
2414
2496
|
type: "set-grain",
|
|
2415
|
-
grain:
|
|
2416
|
-
}),
|
|
2497
|
+
grain: qn[e]
|
|
2498
|
+
}), oe?.(e), D || C?.([]);
|
|
2417
2499
|
}, [
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
]), [
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
}, [
|
|
2426
|
-
let
|
|
2500
|
+
D,
|
|
2501
|
+
C,
|
|
2502
|
+
oe,
|
|
2503
|
+
E
|
|
2504
|
+
]), [ct, lt] = l(null), [ut, dt] = l("");
|
|
2505
|
+
i(() => {
|
|
2506
|
+
ct && !I.has(ct) && lt(null);
|
|
2507
|
+
}, [ct, I]);
|
|
2508
|
+
let J = r((e) => {
|
|
2427
2509
|
if ((We.get(e) || 0) === 0) return;
|
|
2428
|
-
let t = V.byId.get(e), n = new Set(
|
|
2429
|
-
if (n.has(e)) n.delete(e),
|
|
2510
|
+
let t = V.byId.get(e), n = new Set(I);
|
|
2511
|
+
if (n.has(e)) n.delete(e), lt((t) => {
|
|
2430
2512
|
if (t !== e) return t;
|
|
2431
2513
|
let r = V.parentIdByChild.get(e) ?? null;
|
|
2432
2514
|
return r && n.has(r) ? r : null;
|
|
2433
|
-
}),
|
|
2515
|
+
}), dt(`closed ${er(t?.label || e)}`);
|
|
2434
2516
|
else {
|
|
2435
|
-
n.add(e),
|
|
2517
|
+
n.add(e), se?.(e), lt(e);
|
|
2436
2518
|
let r = We.get(e) || 0;
|
|
2437
|
-
|
|
2519
|
+
dt(`opened ${er(t?.label || e)}, showing ${r} item${r === 1 ? "" : "s"}`);
|
|
2438
2520
|
}
|
|
2439
|
-
|
|
2521
|
+
D || _e(n), E?.({
|
|
2440
2522
|
type: "set-expanded",
|
|
2441
2523
|
ids: Array.from(n)
|
|
2442
|
-
}),
|
|
2524
|
+
}), C?.(Array.from(n));
|
|
2443
2525
|
}, [
|
|
2444
|
-
O,
|
|
2445
|
-
We,
|
|
2446
|
-
L,
|
|
2447
|
-
oe,
|
|
2448
|
-
w,
|
|
2449
2526
|
D,
|
|
2527
|
+
We,
|
|
2528
|
+
I,
|
|
2529
|
+
se,
|
|
2530
|
+
C,
|
|
2531
|
+
E,
|
|
2450
2532
|
V.byId,
|
|
2451
2533
|
V.parentIdByChild
|
|
2452
|
-
]), ft =
|
|
2453
|
-
if (!
|
|
2454
|
-
let e = [], t =
|
|
2534
|
+
]), ft = s(() => {
|
|
2535
|
+
if (!ct) return [];
|
|
2536
|
+
let e = [], t = ct;
|
|
2455
2537
|
for (; t;) {
|
|
2456
2538
|
let n = V.byId.get(t);
|
|
2457
2539
|
if (!n) break;
|
|
2458
2540
|
e.unshift(n), t = V.parentIdByChild.get(t) ?? null;
|
|
2459
2541
|
}
|
|
2460
2542
|
return e;
|
|
2461
|
-
}, [
|
|
2462
|
-
|
|
2543
|
+
}, [ct, V]), pt = r(() => {
|
|
2544
|
+
D || _e(/* @__PURE__ */ new Set()), E?.({
|
|
2463
2545
|
type: "set-expanded",
|
|
2464
2546
|
ids: []
|
|
2465
|
-
}),
|
|
2547
|
+
}), C?.([]), lt(null), dt("back to the top level");
|
|
2466
2548
|
}, [
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
]), mt =
|
|
2549
|
+
D,
|
|
2550
|
+
C,
|
|
2551
|
+
E
|
|
2552
|
+
]), mt = r((e) => {
|
|
2471
2553
|
let t = ft.slice(0, e + 1), n = t.map((e) => e.id), r = new Set(n);
|
|
2472
|
-
|
|
2554
|
+
D || _e(r), E?.({
|
|
2473
2555
|
type: "set-expanded",
|
|
2474
2556
|
ids: n
|
|
2475
|
-
}),
|
|
2557
|
+
}), C?.(n);
|
|
2476
2558
|
let i = t[t.length - 1] ?? null;
|
|
2477
|
-
|
|
2559
|
+
lt(i?.id ?? null), dt(i ? `back to ${er(i.label || i.id)}` : "back to the top level");
|
|
2478
2560
|
}, [
|
|
2479
2561
|
ft,
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
]), ht =
|
|
2562
|
+
D,
|
|
2563
|
+
C,
|
|
2564
|
+
E
|
|
2565
|
+
]), ht = r((e) => {
|
|
2484
2566
|
let t = e.key;
|
|
2485
2567
|
if (t === "+" || t === "=") {
|
|
2486
|
-
e.preventDefault(), rt(
|
|
2568
|
+
e.preventDefault(), rt(Kn);
|
|
2487
2569
|
return;
|
|
2488
2570
|
}
|
|
2489
2571
|
if (t === "-" || t === "_") {
|
|
2490
|
-
e.preventDefault(), rt(1 /
|
|
2572
|
+
e.preventDefault(), rt(1 / Kn);
|
|
2491
2573
|
return;
|
|
2492
2574
|
}
|
|
2493
2575
|
if (t === "0") {
|
|
2494
|
-
e.preventDefault(),
|
|
2576
|
+
e.preventDefault(), Ze(!0);
|
|
2495
2577
|
return;
|
|
2496
2578
|
}
|
|
2497
2579
|
if (t === "ArrowLeft" || t === "ArrowRight" || t === "ArrowUp" || t === "ArrowDown") {
|
|
2498
2580
|
e.preventDefault();
|
|
2499
|
-
let n =
|
|
2581
|
+
let n = A ? Ue.get(A) : void 0;
|
|
2500
2582
|
if (!n) {
|
|
2501
|
-
let e =
|
|
2502
|
-
e &&
|
|
2583
|
+
let e = ur(U);
|
|
2584
|
+
e && be(e.node.id);
|
|
2503
2585
|
return;
|
|
2504
2586
|
}
|
|
2505
2587
|
let r;
|
|
2506
|
-
r = t === "ArrowLeft" ?
|
|
2507
|
-
|
|
2508
|
-
scale:
|
|
2588
|
+
r = t === "ArrowLeft" ? dr(U, n, -1) : t === "ArrowRight" ? dr(U, n, 1) : t === "ArrowUp" ? fr(U, n, -1) : fr(U, n, 1), r && (be(r.node.id), xr(r, j.current, R, z, (e) => {
|
|
2589
|
+
K({
|
|
2590
|
+
scale: R,
|
|
2509
2591
|
panX: e.x,
|
|
2510
2592
|
panY: e.y
|
|
2511
2593
|
}, !0);
|
|
@@ -2513,191 +2595,201 @@ function or({ data: i = {
|
|
|
2513
2595
|
return;
|
|
2514
2596
|
}
|
|
2515
2597
|
if (t === "Enter") {
|
|
2516
|
-
if (!
|
|
2517
|
-
e.preventDefault(), e.shiftKey ?
|
|
2598
|
+
if (!A) return;
|
|
2599
|
+
e.preventDefault(), e.shiftKey ? J(A) : D ? L !== A && ot(A) : ot(L === A ? null : A);
|
|
2518
2600
|
return;
|
|
2519
2601
|
}
|
|
2520
2602
|
if (t === "e" || t === "E") {
|
|
2521
|
-
if (!
|
|
2522
|
-
e.preventDefault(),
|
|
2603
|
+
if (!A) return;
|
|
2604
|
+
e.preventDefault(), J(A);
|
|
2523
2605
|
return;
|
|
2524
2606
|
}
|
|
2525
|
-
t === "Escape" &&
|
|
2607
|
+
t === "Escape" && L && (e.preventDefault(), ot(null));
|
|
2526
2608
|
}, [
|
|
2527
|
-
|
|
2609
|
+
A,
|
|
2528
2610
|
U,
|
|
2529
2611
|
Ue,
|
|
2612
|
+
L,
|
|
2530
2613
|
R,
|
|
2531
2614
|
z,
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
q,
|
|
2615
|
+
D,
|
|
2616
|
+
K,
|
|
2535
2617
|
rt,
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
]), gt =
|
|
2540
|
-
let t =
|
|
2618
|
+
Ze,
|
|
2619
|
+
J,
|
|
2620
|
+
ot
|
|
2621
|
+
]), gt = r((e) => {
|
|
2622
|
+
let t = M.current;
|
|
2541
2623
|
if (!t || e !== t.pointerId) return;
|
|
2542
|
-
|
|
2543
|
-
let n =
|
|
2624
|
+
M.current = null;
|
|
2625
|
+
let n = j.current;
|
|
2544
2626
|
try {
|
|
2545
2627
|
n?.releasePointerCapture?.(e);
|
|
2546
2628
|
} catch {}
|
|
2547
|
-
|
|
2548
|
-
}, [
|
|
2629
|
+
D && ke(null);
|
|
2630
|
+
}, [D]), _t = r((e) => {
|
|
2549
2631
|
if (e.button !== 0 || e.target instanceof Element && e.target.closest("button, a, input, select, textarea")) return;
|
|
2550
|
-
if (
|
|
2551
|
-
if (Date.now() -
|
|
2552
|
-
gt(
|
|
2632
|
+
if (M.current) {
|
|
2633
|
+
if (Date.now() - M.current.startedAt < Zn) return;
|
|
2634
|
+
gt(M.current.pointerId);
|
|
2553
2635
|
}
|
|
2554
|
-
let t =
|
|
2555
|
-
t && t.setPointerCapture?.(e.pointerId),
|
|
2636
|
+
let t = j.current;
|
|
2637
|
+
t && t.setPointerCapture?.(e.pointerId), M.current = {
|
|
2556
2638
|
pointerId: e.pointerId,
|
|
2557
2639
|
startX: e.clientX,
|
|
2558
2640
|
startY: e.clientY,
|
|
2559
|
-
panX:
|
|
2560
|
-
panY:
|
|
2641
|
+
panX: z.x,
|
|
2642
|
+
panY: z.y,
|
|
2561
2643
|
moved: !1,
|
|
2562
2644
|
nextPan: null,
|
|
2563
2645
|
startedAt: Date.now()
|
|
2564
2646
|
};
|
|
2565
|
-
}, [
|
|
2566
|
-
let t =
|
|
2647
|
+
}, [z, gt]), vt = r((e) => {
|
|
2648
|
+
let t = M.current;
|
|
2567
2649
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2568
2650
|
let n = e.clientX - t.startX, r = e.clientY - t.startY;
|
|
2569
2651
|
!t.moved && Math.abs(n) + Math.abs(r) > 3 && (t.moved = !0), t.moved && (t.nextPan = {
|
|
2570
|
-
scale:
|
|
2652
|
+
scale: Ve.current,
|
|
2571
2653
|
panX: t.panX + n,
|
|
2572
2654
|
panY: t.panY + r
|
|
2573
|
-
},
|
|
2574
|
-
}, [
|
|
2575
|
-
let t =
|
|
2655
|
+
}, D ? ke(t.nextPan) : K(t.nextPan, !0));
|
|
2656
|
+
}, [K, D]), yt = r((e) => {
|
|
2657
|
+
let t = M.current;
|
|
2576
2658
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2577
|
-
|
|
2578
|
-
let n =
|
|
2659
|
+
M.current = null;
|
|
2660
|
+
let n = j.current;
|
|
2579
2661
|
try {
|
|
2580
2662
|
n?.releasePointerCapture?.(e.pointerId);
|
|
2581
2663
|
} catch {}
|
|
2582
|
-
t.moved &&
|
|
2664
|
+
t.moved && D && t.nextPan && (K(t.nextPan, !0), ke({ ...t.nextPan })), !t.moved && e.target === e.currentTarget && ot(null);
|
|
2583
2665
|
}, [
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
]), bt =
|
|
2588
|
-
if (!
|
|
2589
|
-
let e = V.byId.get(
|
|
2590
|
-
return e ?
|
|
2591
|
-
selected:
|
|
2592
|
-
expanded:
|
|
2593
|
-
violations: qe.get(
|
|
2666
|
+
K,
|
|
2667
|
+
D,
|
|
2668
|
+
ot
|
|
2669
|
+
]), bt = r((e) => gt(e.pointerId), [gt]), xt = r((e) => gt(e.pointerId), [gt]), St = s(() => {
|
|
2670
|
+
if (!A) return "";
|
|
2671
|
+
let e = V.byId.get(A);
|
|
2672
|
+
return e ? br(e, {
|
|
2673
|
+
selected: L === A,
|
|
2674
|
+
expanded: I.has(A),
|
|
2675
|
+
violations: qe.get(A) || 0
|
|
2594
2676
|
}) : "";
|
|
2595
2677
|
}, [
|
|
2596
|
-
|
|
2678
|
+
A,
|
|
2597
2679
|
V.byId,
|
|
2598
|
-
R,
|
|
2599
2680
|
L,
|
|
2681
|
+
I,
|
|
2600
2682
|
qe
|
|
2601
|
-
]), Ct =
|
|
2602
|
-
let e =
|
|
2683
|
+
]), Ct = s(() => {
|
|
2684
|
+
let e = j.current;
|
|
2603
2685
|
if (!e || W <= 0 || G <= 0) return null;
|
|
2604
2686
|
let t = e.clientWidth, n = e.clientHeight;
|
|
2605
2687
|
return {
|
|
2606
2688
|
graphW: W,
|
|
2607
2689
|
graphH: G,
|
|
2608
|
-
viewX: -
|
|
2609
|
-
viewY: -
|
|
2610
|
-
viewW: t /
|
|
2611
|
-
viewH: n /
|
|
2690
|
+
viewX: -z.x / R,
|
|
2691
|
+
viewY: -z.y / R,
|
|
2692
|
+
viewW: t / R,
|
|
2693
|
+
viewH: n / R
|
|
2612
2694
|
};
|
|
2613
2695
|
}, [
|
|
2614
|
-
B,
|
|
2615
2696
|
z,
|
|
2697
|
+
R,
|
|
2616
2698
|
W,
|
|
2617
2699
|
G
|
|
2618
|
-
]), wt = U.length === 0, Tt = (e) => `${
|
|
2619
|
-
return /* @__PURE__ */
|
|
2620
|
-
className: ["mc",
|
|
2621
|
-
style: { height:
|
|
2700
|
+
]), wt = U.length === 0, Tt = (e) => `${k}-grain-${e}`;
|
|
2701
|
+
return /* @__PURE__ */ f("div", {
|
|
2702
|
+
className: ["mc", ue].filter(Boolean).join(" "),
|
|
2703
|
+
style: { height: ce },
|
|
2622
2704
|
role: "application",
|
|
2623
|
-
"aria-label":
|
|
2705
|
+
"aria-label": le,
|
|
2624
2706
|
"aria-roledescription": "code structure map",
|
|
2625
2707
|
children: [
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
id:
|
|
2708
|
+
/* @__PURE__ */ f("div", {
|
|
2709
|
+
id: fe,
|
|
2628
2710
|
className: "mc-sr",
|
|
2629
2711
|
role: "status",
|
|
2630
2712
|
"aria-live": "polite",
|
|
2631
|
-
children:
|
|
2713
|
+
children: [
|
|
2714
|
+
/* @__PURE__ */ d("span", {
|
|
2715
|
+
"data-focus-announcement": !0,
|
|
2716
|
+
children: St
|
|
2717
|
+
}),
|
|
2718
|
+
" ",
|
|
2719
|
+
/* @__PURE__ */ d("span", {
|
|
2720
|
+
"data-descent-announcement": !0,
|
|
2721
|
+
children: ut
|
|
2722
|
+
})
|
|
2723
|
+
]
|
|
2632
2724
|
}),
|
|
2633
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ f("div", {
|
|
2634
2726
|
className: "mc-toolbar",
|
|
2635
|
-
children: [/* @__PURE__ */
|
|
2727
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2636
2728
|
className: "mc-seg",
|
|
2637
2729
|
role: "radiogroup",
|
|
2638
2730
|
"aria-label": "detail grain",
|
|
2639
|
-
children:
|
|
2731
|
+
children: Yn.map((e) => /* @__PURE__ */ f("button", {
|
|
2640
2732
|
id: Tt(e.id),
|
|
2641
2733
|
type: "button",
|
|
2642
2734
|
role: "radio",
|
|
2643
|
-
"aria-checked":
|
|
2735
|
+
"aria-checked": F === e.id,
|
|
2644
2736
|
className: "mc-seg-btn mono",
|
|
2645
|
-
"data-active":
|
|
2646
|
-
onClick: () =>
|
|
2647
|
-
children: [
|
|
2737
|
+
"data-active": F === e.id ? "true" : void 0,
|
|
2738
|
+
onClick: () => st(e.id),
|
|
2739
|
+
children: [F === e.id && /* @__PURE__ */ d(p, {
|
|
2648
2740
|
className: "lucide",
|
|
2649
2741
|
"aria-hidden": "true"
|
|
2650
2742
|
}), e.label]
|
|
2651
2743
|
}, e.id))
|
|
2652
|
-
}), /* @__PURE__ */
|
|
2744
|
+
}), /* @__PURE__ */ f("div", {
|
|
2653
2745
|
className: "mc-search",
|
|
2654
2746
|
role: "combobox",
|
|
2655
|
-
"aria-expanded":
|
|
2747
|
+
"aria-expanded": De && Ye.length > 0,
|
|
2656
2748
|
"aria-haspopup": "listbox",
|
|
2657
|
-
"aria-owns":
|
|
2749
|
+
"aria-owns": pe,
|
|
2658
2750
|
children: [
|
|
2659
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ d(re, {
|
|
2660
2752
|
className: "lucide mc-search-ico",
|
|
2661
2753
|
"aria-hidden": "true"
|
|
2662
2754
|
}),
|
|
2663
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ d("input", {
|
|
2664
2756
|
className: "mc-search-input mono",
|
|
2665
2757
|
type: "text",
|
|
2666
2758
|
placeholder: "find a node",
|
|
2667
2759
|
"aria-label": "find a node",
|
|
2668
|
-
"aria-controls":
|
|
2760
|
+
"aria-controls": pe,
|
|
2669
2761
|
"aria-autocomplete": "list",
|
|
2670
|
-
value:
|
|
2762
|
+
value: Te,
|
|
2671
2763
|
onChange: (e) => {
|
|
2672
|
-
|
|
2764
|
+
Ee(e.target.value), Oe(!0);
|
|
2673
2765
|
},
|
|
2674
|
-
onFocus: () =>
|
|
2766
|
+
onFocus: () => Oe(!0),
|
|
2675
2767
|
onBlur: () => {
|
|
2676
|
-
window.setTimeout(() =>
|
|
2768
|
+
window.setTimeout(() => Oe(!1), 120);
|
|
2677
2769
|
},
|
|
2678
2770
|
onKeyDown: (e) => {
|
|
2679
|
-
e.key === "Enter" &&
|
|
2771
|
+
e.key === "Enter" && Ye[0] ? (e.preventDefault(), Et(Ye[0])) : e.key === "Escape" && Oe(!1);
|
|
2680
2772
|
}
|
|
2681
2773
|
}),
|
|
2682
|
-
|
|
2774
|
+
De && Ye.length > 0 && /* @__PURE__ */ d("ul", {
|
|
2683
2775
|
className: "mc-results",
|
|
2684
|
-
id:
|
|
2776
|
+
id: pe,
|
|
2685
2777
|
role: "listbox",
|
|
2686
2778
|
"aria-label": "search results",
|
|
2687
|
-
children:
|
|
2779
|
+
children: Ye.map((e) => /* @__PURE__ */ f("li", {
|
|
2688
2780
|
role: "option",
|
|
2689
|
-
"aria-selected": e.id ===
|
|
2781
|
+
"aria-selected": e.id === L,
|
|
2690
2782
|
className: "mc-result mono",
|
|
2691
2783
|
onMouseDown: (t) => {
|
|
2692
2784
|
t.preventDefault(), Et(e);
|
|
2693
2785
|
},
|
|
2694
|
-
children: [e.kind === "folder" ? /* @__PURE__ */
|
|
2786
|
+
children: [e.kind === "folder" ? /* @__PURE__ */ d(b, {
|
|
2695
2787
|
className: "lucide",
|
|
2696
2788
|
"aria-hidden": "true"
|
|
2697
|
-
}) : /* @__PURE__ */
|
|
2789
|
+
}) : /* @__PURE__ */ d(y, {
|
|
2698
2790
|
className: "lucide",
|
|
2699
2791
|
"aria-hidden": "true"
|
|
2700
|
-
}), /* @__PURE__ */
|
|
2792
|
+
}), /* @__PURE__ */ d("span", {
|
|
2701
2793
|
className: "mc-result-path",
|
|
2702
2794
|
children: e.id
|
|
2703
2795
|
})]
|
|
@@ -2706,59 +2798,53 @@ function or({ data: i = {
|
|
|
2706
2798
|
]
|
|
2707
2799
|
})]
|
|
2708
2800
|
}),
|
|
2709
|
-
/* @__PURE__ */
|
|
2710
|
-
className: "mc-sr",
|
|
2711
|
-
role: "status",
|
|
2712
|
-
"aria-live": "polite",
|
|
2713
|
-
children: lt
|
|
2714
|
-
}),
|
|
2715
|
-
ft.length > 0 && /* @__PURE__ */ u("nav", {
|
|
2801
|
+
ft.length > 0 && /* @__PURE__ */ f("nav", {
|
|
2716
2802
|
className: "mc-breadcrumb mono",
|
|
2717
2803
|
"aria-label": "folder path",
|
|
2718
|
-
children: [/* @__PURE__ */
|
|
2804
|
+
children: [/* @__PURE__ */ d("button", {
|
|
2719
2805
|
type: "button",
|
|
2720
2806
|
className: "mc-breadcrumb-crumb",
|
|
2721
2807
|
onClick: pt,
|
|
2722
2808
|
children: "top level"
|
|
2723
|
-
}), ft.map((t, n) => /* @__PURE__ */
|
|
2809
|
+
}), ft.map((t, n) => /* @__PURE__ */ f(e, { children: [/* @__PURE__ */ d(g, {
|
|
2724
2810
|
className: "lucide mc-breadcrumb-sep",
|
|
2725
2811
|
"aria-hidden": "true"
|
|
2726
|
-
}), n === ft.length - 1 ? /* @__PURE__ */
|
|
2812
|
+
}), n === ft.length - 1 ? /* @__PURE__ */ d("span", {
|
|
2727
2813
|
className: "mc-breadcrumb-crumb mc-breadcrumb-current",
|
|
2728
2814
|
"aria-current": "location",
|
|
2729
|
-
children:
|
|
2730
|
-
}) : /* @__PURE__ */
|
|
2815
|
+
children: er(t.label || t.id)
|
|
2816
|
+
}) : /* @__PURE__ */ d("button", {
|
|
2731
2817
|
type: "button",
|
|
2732
2818
|
className: "mc-breadcrumb-crumb",
|
|
2733
2819
|
onClick: () => mt(n),
|
|
2734
|
-
children:
|
|
2820
|
+
children: er(t.label || t.id)
|
|
2735
2821
|
})] }, t.id))]
|
|
2736
2822
|
}),
|
|
2737
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ d("div", {
|
|
2738
2824
|
className: "mc-viewport",
|
|
2739
|
-
ref:
|
|
2825
|
+
ref: j,
|
|
2740
2826
|
tabIndex: 0,
|
|
2741
2827
|
role: "group",
|
|
2742
2828
|
"aria-label": "map canvas: arrow keys move focus, enter selects, plus and minus zoom, ctrl or cmd plus wheel to zoom",
|
|
2743
|
-
"aria-activedescendant":
|
|
2829
|
+
"aria-activedescendant": A && H.has(A) ? `${k}-node-${yr(A)}` : void 0,
|
|
2744
2830
|
onKeyDown: ht,
|
|
2745
2831
|
onPointerDown: _t,
|
|
2746
2832
|
onPointerMove: vt,
|
|
2747
2833
|
onPointerUp: yt,
|
|
2748
2834
|
onPointerCancel: bt,
|
|
2749
2835
|
onLostPointerCapture: xt,
|
|
2750
|
-
children: wt ? /* @__PURE__ */
|
|
2836
|
+
children: wt ? /* @__PURE__ */ d("p", {
|
|
2751
2837
|
className: "mc-empty mono",
|
|
2752
2838
|
children: "no nodes to map"
|
|
2753
|
-
}) : /* @__PURE__ */ u
|
|
2754
|
-
/* @__PURE__ */
|
|
2755
|
-
className: ["mc-stage",
|
|
2839
|
+
}) : /* @__PURE__ */ f(u, { children: [
|
|
2840
|
+
/* @__PURE__ */ f("div", {
|
|
2841
|
+
className: ["mc-stage", $e ? "mc-stage--auto-fit" : ""].filter(Boolean).join(" "),
|
|
2756
2842
|
style: {
|
|
2757
|
-
transform: `translate(${
|
|
2843
|
+
transform: `translate(${z.x}px, ${z.y}px) scale(${R})`,
|
|
2758
2844
|
width: W,
|
|
2759
2845
|
height: G
|
|
2760
2846
|
},
|
|
2761
|
-
children: [/* @__PURE__ */
|
|
2847
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
2762
2848
|
className: "mc-edges",
|
|
2763
2849
|
width: W,
|
|
2764
2850
|
height: G,
|
|
@@ -2767,8 +2853,8 @@ function or({ data: i = {
|
|
|
2767
2853
|
children: Ge.map((e) => {
|
|
2768
2854
|
let t = Ue.get(e.from), n = Ue.get(e.to);
|
|
2769
2855
|
if (!t || !n) return null;
|
|
2770
|
-
let r =
|
|
2771
|
-
return /* @__PURE__ */
|
|
2856
|
+
let r = ne[vr(e.from, e.to)] ?? ne[vr(e.from, e.to, "arrow")];
|
|
2857
|
+
return /* @__PURE__ */ d(Cr, {
|
|
2772
2858
|
a: t,
|
|
2773
2859
|
b: n,
|
|
2774
2860
|
kind: e.kind,
|
|
@@ -2778,27 +2864,27 @@ function or({ data: i = {
|
|
|
2778
2864
|
}, `${e.kind}:${e.from}->${e.to}`);
|
|
2779
2865
|
})
|
|
2780
2866
|
}), U.map((t) => {
|
|
2781
|
-
let n = (We.get(t.node.id) || 0) > 0, r =
|
|
2782
|
-
return /* @__PURE__ */
|
|
2783
|
-
domId: `${
|
|
2867
|
+
let n = (We.get(t.node.id) || 0) > 0, r = I.has(t.node.id);
|
|
2868
|
+
return /* @__PURE__ */ f(e, { children: [/* @__PURE__ */ d(Sr, {
|
|
2869
|
+
domId: `${k}-node-${yr(t.node.id)}`,
|
|
2784
2870
|
p: t,
|
|
2785
|
-
selected:
|
|
2786
|
-
focused:
|
|
2787
|
-
highlighted:
|
|
2788
|
-
delta:
|
|
2871
|
+
selected: L === t.node.id,
|
|
2872
|
+
focused: A === t.node.id,
|
|
2873
|
+
highlighted: Je.has(t.node.id),
|
|
2874
|
+
delta: x[t.node.id],
|
|
2789
2875
|
expandable: n,
|
|
2790
2876
|
expanded: r,
|
|
2791
2877
|
violations: qe.get(t.node.id) || 0,
|
|
2792
2878
|
onClick: (e) => {
|
|
2793
|
-
e >= 2 || (
|
|
2879
|
+
e >= 2 || (be(t.node.id), D ? L !== t.node.id && ot(t.node.id) : ot(L === t.node.id ? null : t.node.id));
|
|
2794
2880
|
},
|
|
2795
2881
|
onDoubleClick: () => {
|
|
2796
|
-
n &&
|
|
2882
|
+
n && J(t.node.id);
|
|
2797
2883
|
}
|
|
2798
|
-
}), n ? /* @__PURE__ */
|
|
2884
|
+
}), n ? /* @__PURE__ */ d("button", {
|
|
2799
2885
|
type: "button",
|
|
2800
2886
|
className: "mc-node-disclosure",
|
|
2801
|
-
"aria-label": `${r ? "hide" : "show"} children for ${
|
|
2887
|
+
"aria-label": `${r ? "hide" : "show"} children for ${er(t.node.label || t.node.id)}`,
|
|
2802
2888
|
"aria-expanded": r,
|
|
2803
2889
|
style: {
|
|
2804
2890
|
left: t.x + t.w,
|
|
@@ -2807,64 +2893,64 @@ function or({ data: i = {
|
|
|
2807
2893
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2808
2894
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2809
2895
|
onClick: (e) => {
|
|
2810
|
-
e.stopPropagation(),
|
|
2896
|
+
e.stopPropagation(), J(t.node.id);
|
|
2811
2897
|
},
|
|
2812
|
-
children: /* @__PURE__ */
|
|
2898
|
+
children: /* @__PURE__ */ d(g, { "aria-hidden": "true" })
|
|
2813
2899
|
}) : null] }, t.node.id);
|
|
2814
2900
|
})]
|
|
2815
2901
|
}),
|
|
2816
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ f("div", {
|
|
2817
2903
|
className: "mc-zoom",
|
|
2818
2904
|
role: "group",
|
|
2819
2905
|
"aria-label": "map zoom",
|
|
2820
2906
|
children: [
|
|
2821
|
-
/* @__PURE__ */
|
|
2907
|
+
/* @__PURE__ */ d("button", {
|
|
2822
2908
|
type: "button",
|
|
2823
2909
|
className: "mc-zoom-btn",
|
|
2824
2910
|
"aria-label": "zoom in",
|
|
2825
|
-
onClick: () => rt(
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2911
|
+
onClick: () => rt(Kn),
|
|
2912
|
+
children: /* @__PURE__ */ d(te, {
|
|
2827
2913
|
className: "lucide",
|
|
2828
2914
|
"aria-hidden": "true"
|
|
2829
2915
|
})
|
|
2830
2916
|
}),
|
|
2831
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ d("button", {
|
|
2832
2918
|
type: "button",
|
|
2833
2919
|
className: "mc-zoom-btn",
|
|
2834
2920
|
"aria-label": "zoom out",
|
|
2835
|
-
onClick: () => rt(1 /
|
|
2836
|
-
children: /* @__PURE__ */
|
|
2921
|
+
onClick: () => rt(1 / Kn),
|
|
2922
|
+
children: /* @__PURE__ */ d(ee, {
|
|
2837
2923
|
className: "lucide",
|
|
2838
2924
|
"aria-hidden": "true"
|
|
2839
2925
|
})
|
|
2840
2926
|
}),
|
|
2841
|
-
/* @__PURE__ */
|
|
2927
|
+
/* @__PURE__ */ d("button", {
|
|
2842
2928
|
type: "button",
|
|
2843
2929
|
className: "mc-zoom-btn",
|
|
2844
2930
|
"aria-label": "fit map to view",
|
|
2845
|
-
onClick: () =>
|
|
2846
|
-
children: /* @__PURE__ */
|
|
2931
|
+
onClick: () => Ze(!0),
|
|
2932
|
+
children: /* @__PURE__ */ d(S, {
|
|
2847
2933
|
className: "lucide",
|
|
2848
2934
|
"aria-hidden": "true"
|
|
2849
2935
|
})
|
|
2850
2936
|
})
|
|
2851
2937
|
]
|
|
2852
2938
|
}),
|
|
2853
|
-
Ct && /* @__PURE__ */
|
|
2939
|
+
Ct && /* @__PURE__ */ d("div", {
|
|
2854
2940
|
className: "mc-minimap",
|
|
2855
2941
|
"aria-hidden": "true",
|
|
2856
|
-
children: /* @__PURE__ */
|
|
2942
|
+
children: /* @__PURE__ */ f("svg", {
|
|
2857
2943
|
className: "mc-minimap-svg",
|
|
2858
2944
|
viewBox: `0 0 ${Ct.graphW} ${Ct.graphH}`,
|
|
2859
2945
|
preserveAspectRatio: "xMidYMid meet",
|
|
2860
|
-
children: [U.map((e) => /* @__PURE__ */
|
|
2946
|
+
children: [U.map((e) => /* @__PURE__ */ d("rect", {
|
|
2861
2947
|
className: "mc-mini-node",
|
|
2862
|
-
"data-cov":
|
|
2948
|
+
"data-cov": $n(e.node.coverage),
|
|
2863
2949
|
x: e.x,
|
|
2864
2950
|
y: e.y,
|
|
2865
2951
|
width: e.w,
|
|
2866
2952
|
height: e.h
|
|
2867
|
-
}, e.node.id)), /* @__PURE__ */
|
|
2953
|
+
}, e.node.id)), /* @__PURE__ */ d("rect", {
|
|
2868
2954
|
className: "mc-mini-view",
|
|
2869
2955
|
x: Ct.viewX,
|
|
2870
2956
|
y: Ct.viewY,
|
|
@@ -2873,47 +2959,47 @@ function or({ data: i = {
|
|
|
2873
2959
|
})]
|
|
2874
2960
|
})
|
|
2875
2961
|
}),
|
|
2876
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ f("div", {
|
|
2877
2963
|
className: "mc-legend mono",
|
|
2878
2964
|
"aria-hidden": "true",
|
|
2879
2965
|
children: [
|
|
2880
|
-
/* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ f("span", {
|
|
2881
2967
|
className: "mc-legend-item",
|
|
2882
|
-
children: [/* @__PURE__ */
|
|
2968
|
+
children: [/* @__PURE__ */ d(b, { className: "lucide" }), " folder"]
|
|
2883
2969
|
}),
|
|
2884
|
-
/* @__PURE__ */
|
|
2970
|
+
/* @__PURE__ */ f("span", {
|
|
2885
2971
|
className: "mc-legend-item",
|
|
2886
|
-
children: [/* @__PURE__ */
|
|
2972
|
+
children: [/* @__PURE__ */ d(y, { className: "lucide" }), " file"]
|
|
2887
2973
|
}),
|
|
2888
|
-
/* @__PURE__ */
|
|
2974
|
+
/* @__PURE__ */ f("span", {
|
|
2889
2975
|
className: "mc-legend-item mc-legend-ramp",
|
|
2890
2976
|
children: [
|
|
2891
|
-
/* @__PURE__ */
|
|
2977
|
+
/* @__PURE__ */ d("span", {
|
|
2892
2978
|
className: "mc-ramp-sw",
|
|
2893
2979
|
"data-cov": "0"
|
|
2894
2980
|
}),
|
|
2895
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ d("span", {
|
|
2896
2982
|
className: "mc-ramp-sw",
|
|
2897
2983
|
"data-cov": "1"
|
|
2898
2984
|
}),
|
|
2899
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ d("span", {
|
|
2900
2986
|
className: "mc-ramp-sw",
|
|
2901
2987
|
"data-cov": "2"
|
|
2902
2988
|
}),
|
|
2903
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ d("span", {
|
|
2904
2990
|
className: "mc-ramp-sw",
|
|
2905
2991
|
"data-cov": "3"
|
|
2906
2992
|
}),
|
|
2907
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ d("span", {
|
|
2908
2994
|
className: "mc-ramp-sw",
|
|
2909
2995
|
"data-cov": "4"
|
|
2910
2996
|
}),
|
|
2911
2997
|
"coverage"
|
|
2912
2998
|
]
|
|
2913
2999
|
}),
|
|
2914
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ f("span", {
|
|
2915
3001
|
className: "mc-legend-item mc-legend-viol",
|
|
2916
|
-
children: [/* @__PURE__ */
|
|
3002
|
+
children: [/* @__PURE__ */ d(ae, { className: "lucide" }), " violation"]
|
|
2917
3003
|
})
|
|
2918
3004
|
]
|
|
2919
3005
|
})
|
|
@@ -2922,46 +3008,46 @@ function or({ data: i = {
|
|
|
2922
3008
|
]
|
|
2923
3009
|
});
|
|
2924
3010
|
function Et(e) {
|
|
2925
|
-
let t = e.kind === "file" &&
|
|
2926
|
-
for (; r && V.byId.has(r);) n.has(r) || (n.add(r),
|
|
3011
|
+
let t = e.kind === "file" && F !== "files" ? "files" : F, n = new Set(t === F ? I : []), r = V.parentIdByChild.get(e.id);
|
|
3012
|
+
for (; r && V.byId.has(r);) n.has(r) || (n.add(r), se?.(r)), r = V.parentIdByChild.get(r);
|
|
2927
3013
|
let i = Array.from(n);
|
|
2928
|
-
|
|
3014
|
+
D || (he(t), _e(n)), E?.({
|
|
2929
3015
|
type: "reveal",
|
|
2930
3016
|
id: e.id,
|
|
2931
|
-
grain:
|
|
3017
|
+
grain: qn[t],
|
|
2932
3018
|
expandedIds: i
|
|
2933
|
-
}), t !==
|
|
3019
|
+
}), t !== F && oe?.(t), C?.(i), Ee(""), Oe(!1), be(e.id), D || ye(e.id), ie?.(e.id, mr(e)), window.requestAnimationFrame(() => {
|
|
2934
3020
|
window.requestAnimationFrame(() => at(e.id));
|
|
2935
3021
|
});
|
|
2936
3022
|
}
|
|
2937
3023
|
}
|
|
2938
|
-
function
|
|
3024
|
+
function mr(e) {
|
|
2939
3025
|
let { _order: t, ...n } = e;
|
|
2940
3026
|
return n;
|
|
2941
3027
|
}
|
|
2942
|
-
function
|
|
3028
|
+
function hr(e) {
|
|
2943
3029
|
return e ? e instanceof Set ? new Set(e) : new Set(Array.from(e)) : /* @__PURE__ */ new Set();
|
|
2944
3030
|
}
|
|
2945
|
-
function
|
|
2946
|
-
return
|
|
3031
|
+
function gr(e) {
|
|
3032
|
+
return tn(e);
|
|
2947
3033
|
}
|
|
2948
3034
|
function $(e, t) {
|
|
2949
3035
|
return Number.isFinite(e) ? e : t;
|
|
2950
3036
|
}
|
|
2951
|
-
function
|
|
3037
|
+
function _r(e) {
|
|
2952
3038
|
return e ? Array.from(e).map(String).sort().join("\0") : "";
|
|
2953
3039
|
}
|
|
2954
|
-
function
|
|
3040
|
+
function vr(e, t, n = "plain") {
|
|
2955
3041
|
return n === "arrow" ? `${e}->${t}` : `${e}→${t}`;
|
|
2956
3042
|
}
|
|
2957
|
-
function
|
|
3043
|
+
function yr(e) {
|
|
2958
3044
|
return String(e).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
2959
3045
|
}
|
|
2960
|
-
function
|
|
2961
|
-
let { selected: n, expanded: r, violations: i = 0 } = t, a =
|
|
2962
|
-
return e.loc && (o +=
|
|
3046
|
+
function br(e, t = {}) {
|
|
3047
|
+
let { selected: n, expanded: r, violations: i = 0 } = t, a = $n(e.coverage), o = `${er(e.label || e.id)}: ${e.kind}, coverage ${a} of 4`;
|
|
3048
|
+
return e.loc && (o += `, ${e.loc} loc`), i > 0 && (o += `, ${i} violation${i === 1 ? "" : "s"}`), n && (o += ", selected"), r && (o += ", expanded"), o;
|
|
2963
3049
|
}
|
|
2964
|
-
function
|
|
3050
|
+
function xr(e, t, n, r, i) {
|
|
2965
3051
|
if (!t) return;
|
|
2966
3052
|
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;
|
|
2967
3053
|
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({
|
|
@@ -2969,9 +3055,9 @@ function mr(e, t, n, r, i) {
|
|
|
2969
3055
|
y: r.y + u
|
|
2970
3056
|
});
|
|
2971
3057
|
}
|
|
2972
|
-
function
|
|
2973
|
-
let p = t.node, m =
|
|
2974
|
-
return /* @__PURE__ */
|
|
3058
|
+
function Sr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a, expandable: o, expanded: s, violations: c, onClick: l, onDoubleClick: u }) {
|
|
3059
|
+
let p = t.node, m = $n(p.coverage);
|
|
3060
|
+
return /* @__PURE__ */ f("button", {
|
|
2975
3061
|
id: e,
|
|
2976
3062
|
type: "button",
|
|
2977
3063
|
className: "mc-node",
|
|
@@ -2980,8 +3066,8 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
2980
3066
|
"data-focused": r ? "true" : void 0,
|
|
2981
3067
|
"data-highlighted": i ? "true" : void 0,
|
|
2982
3068
|
"data-delta": a || void 0,
|
|
2983
|
-
"data-ink-flip": m >=
|
|
2984
|
-
"aria-label":
|
|
3069
|
+
"data-ink-flip": m >= Qn ? "true" : void 0,
|
|
3070
|
+
"aria-label": br(p, {
|
|
2985
3071
|
selected: n,
|
|
2986
3072
|
expanded: s,
|
|
2987
3073
|
violations: c
|
|
@@ -2996,220 +3082,220 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
2996
3082
|
},
|
|
2997
3083
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2998
3084
|
onClick: (e) => {
|
|
2999
|
-
e.stopPropagation(),
|
|
3085
|
+
e.stopPropagation(), l(e.detail);
|
|
3000
3086
|
},
|
|
3001
3087
|
onDoubleClick: (e) => {
|
|
3002
|
-
e.stopPropagation(),
|
|
3088
|
+
e.stopPropagation(), u();
|
|
3003
3089
|
},
|
|
3004
3090
|
children: [
|
|
3005
|
-
n && /* @__PURE__ */
|
|
3091
|
+
n && /* @__PURE__ */ d("span", {
|
|
3006
3092
|
className: "mc-node-marker",
|
|
3007
3093
|
"aria-hidden": "true"
|
|
3008
3094
|
}),
|
|
3009
|
-
/* @__PURE__ */
|
|
3095
|
+
/* @__PURE__ */ f("span", {
|
|
3010
3096
|
className: "mc-node-head",
|
|
3011
3097
|
children: [
|
|
3012
|
-
p.kind === "folder" ? /* @__PURE__ */
|
|
3098
|
+
p.kind === "folder" ? /* @__PURE__ */ d(b, {
|
|
3013
3099
|
className: "lucide mc-node-ico",
|
|
3014
3100
|
"aria-hidden": "true"
|
|
3015
|
-
}) : /* @__PURE__ */
|
|
3101
|
+
}) : /* @__PURE__ */ d(y, {
|
|
3016
3102
|
className: "lucide mc-node-ico",
|
|
3017
3103
|
"aria-hidden": "true"
|
|
3018
3104
|
}),
|
|
3019
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ d("span", {
|
|
3020
3106
|
className: "mc-node-name mono",
|
|
3021
|
-
children:
|
|
3107
|
+
children: er(p.label || p.id)
|
|
3022
3108
|
}),
|
|
3023
|
-
c > 0 && /* @__PURE__ */
|
|
3109
|
+
c > 0 && /* @__PURE__ */ f("span", {
|
|
3024
3110
|
className: "mc-node-viol mono tnum",
|
|
3025
3111
|
"aria-hidden": "true",
|
|
3026
|
-
children: [/* @__PURE__ */
|
|
3112
|
+
children: [/* @__PURE__ */ d(ae, {
|
|
3027
3113
|
className: "lucide",
|
|
3028
3114
|
"aria-hidden": "true"
|
|
3029
3115
|
}), c]
|
|
3030
3116
|
})
|
|
3031
3117
|
]
|
|
3032
3118
|
}),
|
|
3033
|
-
/* @__PURE__ */
|
|
3119
|
+
/* @__PURE__ */ f("span", {
|
|
3034
3120
|
className: "mc-node-meta mono tnum",
|
|
3035
3121
|
children: [
|
|
3036
3122
|
p.kind === "folder" && o ? s ? "open" : "folder" : "file",
|
|
3037
|
-
p.loc ?
|
|
3038
|
-
|
|
3123
|
+
p.loc ? `, ${p.loc} loc` : "",
|
|
3124
|
+
`, cov ${m}/4`
|
|
3039
3125
|
]
|
|
3040
3126
|
})
|
|
3041
3127
|
]
|
|
3042
3128
|
});
|
|
3043
3129
|
}
|
|
3044
|
-
function
|
|
3045
|
-
let o = e.x + e.w / 2, s = e.y + e.h, c = t.x + t.w / 2,
|
|
3046
|
-
return /* @__PURE__ */
|
|
3130
|
+
function Cr({ a: e, b: t, kind: n, weight: r, maxWeight: i, delta: a }) {
|
|
3131
|
+
let o = e.x + e.w / 2, s = e.y + e.h, c = t.x + t.w / 2, l = t.y, u = (s + l) / 2, p = `M ${o} ${s} L ${o} ${u} L ${c} ${u} L ${c} ${l}`, m = 1 + Math.min(r, i) / i * 2;
|
|
3132
|
+
return /* @__PURE__ */ f("g", {
|
|
3047
3133
|
className: "mc-edge",
|
|
3048
3134
|
"data-kind": n,
|
|
3049
3135
|
"data-delta": a || void 0,
|
|
3050
|
-
children: [/* @__PURE__ */
|
|
3136
|
+
children: [/* @__PURE__ */ d("path", {
|
|
3051
3137
|
className: "mc-edge-path",
|
|
3052
3138
|
d: p,
|
|
3053
3139
|
style: { strokeWidth: m }
|
|
3054
|
-
}), n === "structure" && /* @__PURE__ */
|
|
3140
|
+
}), n === "structure" && /* @__PURE__ */ d("path", {
|
|
3055
3141
|
className: "mc-edge-head",
|
|
3056
|
-
d: `M ${c - 4} ${
|
|
3142
|
+
d: `M ${c - 4} ${l - 6} L ${c + 4} ${l - 6} L ${c} ${l} Z`
|
|
3057
3143
|
})]
|
|
3058
3144
|
});
|
|
3059
3145
|
}
|
|
3060
3146
|
//#endregion
|
|
3061
3147
|
//#region src/ui/RailShell.jsx
|
|
3062
|
-
function
|
|
3063
|
-
let [
|
|
3064
|
-
return /* @__PURE__ */
|
|
3065
|
-
className: `rs rs--${
|
|
3066
|
-
"data-sheet-open":
|
|
3067
|
-
children: [/* @__PURE__ */
|
|
3148
|
+
function wr({ toolbar: e, children: t, rail: n, railSide: r = "right", sheetTitle: i = "details", sheetMeta: o, className: s = "" }) {
|
|
3149
|
+
let [c, u] = l(!1), p = `rs-sheet-${a()}`;
|
|
3150
|
+
return /* @__PURE__ */ f("div", {
|
|
3151
|
+
className: `rs rs--${r}${s ? ` ${s}` : ""}`,
|
|
3152
|
+
"data-sheet-open": c ? "true" : "false",
|
|
3153
|
+
children: [/* @__PURE__ */ f("div", {
|
|
3068
3154
|
className: "rs-frame",
|
|
3069
|
-
children: [/* @__PURE__ */
|
|
3155
|
+
children: [/* @__PURE__ */ f("div", {
|
|
3070
3156
|
className: "rs-main",
|
|
3071
|
-
children: [e && /* @__PURE__ */
|
|
3157
|
+
children: [e && /* @__PURE__ */ d("div", {
|
|
3072
3158
|
className: "rs-toolbar",
|
|
3073
3159
|
children: e
|
|
3074
|
-
}), /* @__PURE__ */
|
|
3160
|
+
}), /* @__PURE__ */ d("div", {
|
|
3075
3161
|
className: "rs-canvas",
|
|
3076
3162
|
children: t
|
|
3077
3163
|
})]
|
|
3078
|
-
}), /* @__PURE__ */
|
|
3164
|
+
}), /* @__PURE__ */ d("aside", {
|
|
3079
3165
|
className: "rs-rail",
|
|
3080
|
-
"aria-label":
|
|
3081
|
-
children: /* @__PURE__ */
|
|
3166
|
+
"aria-label": i,
|
|
3167
|
+
children: /* @__PURE__ */ d("div", {
|
|
3082
3168
|
className: "rs-rail-card",
|
|
3083
3169
|
children: n
|
|
3084
3170
|
})
|
|
3085
3171
|
})]
|
|
3086
|
-
}), /* @__PURE__ */
|
|
3172
|
+
}), /* @__PURE__ */ f("div", {
|
|
3087
3173
|
className: "rs-sheet",
|
|
3088
|
-
"aria-label":
|
|
3089
|
-
children: [/* @__PURE__ */
|
|
3174
|
+
"aria-label": i,
|
|
3175
|
+
children: [/* @__PURE__ */ f("button", {
|
|
3090
3176
|
type: "button",
|
|
3091
3177
|
className: "rs-sheet-toggle",
|
|
3092
|
-
"aria-expanded":
|
|
3093
|
-
"aria-controls":
|
|
3094
|
-
onClick: () =>
|
|
3095
|
-
children: [/* @__PURE__ */
|
|
3178
|
+
"aria-expanded": c,
|
|
3179
|
+
"aria-controls": p,
|
|
3180
|
+
onClick: () => u((e) => !e),
|
|
3181
|
+
children: [/* @__PURE__ */ d("span", {
|
|
3096
3182
|
className: "rs-sheet-grip",
|
|
3097
3183
|
"aria-hidden": "true"
|
|
3098
|
-
}), /* @__PURE__ */
|
|
3184
|
+
}), /* @__PURE__ */ f("span", {
|
|
3099
3185
|
className: "rs-sheet-row",
|
|
3100
|
-
children: [/* @__PURE__ */
|
|
3186
|
+
children: [/* @__PURE__ */ d("span", {
|
|
3101
3187
|
className: "rs-sheet-title",
|
|
3102
|
-
children:
|
|
3103
|
-
}), /* @__PURE__ */
|
|
3188
|
+
children: i
|
|
3189
|
+
}), /* @__PURE__ */ f("span", {
|
|
3104
3190
|
className: "rs-sheet-end",
|
|
3105
|
-
children: [o && /* @__PURE__ */
|
|
3191
|
+
children: [o && /* @__PURE__ */ d("span", {
|
|
3106
3192
|
className: "rs-sheet-meta",
|
|
3107
3193
|
children: o
|
|
3108
|
-
}), /* @__PURE__ */
|
|
3194
|
+
}), /* @__PURE__ */ d(m, {
|
|
3109
3195
|
className: "rs-sheet-chevron lucide",
|
|
3110
3196
|
"aria-hidden": "true"
|
|
3111
3197
|
})]
|
|
3112
3198
|
})]
|
|
3113
3199
|
})]
|
|
3114
|
-
}), /* @__PURE__ */
|
|
3115
|
-
id:
|
|
3200
|
+
}), /* @__PURE__ */ d("div", {
|
|
3201
|
+
id: p,
|
|
3116
3202
|
role: "region",
|
|
3117
|
-
"aria-label":
|
|
3203
|
+
"aria-label": i,
|
|
3118
3204
|
className: "rs-sheet-body",
|
|
3119
|
-
hidden: !
|
|
3205
|
+
hidden: !c,
|
|
3120
3206
|
children: n
|
|
3121
3207
|
})]
|
|
3122
3208
|
})]
|
|
3123
3209
|
});
|
|
3124
3210
|
}
|
|
3125
|
-
function
|
|
3126
|
-
let [
|
|
3127
|
-
t && /* @__PURE__ */
|
|
3211
|
+
function Tr({ title: e, icon: t, meta: n, children: r, collapsible: i = !1, defaultOpen: o = !0, className: s = "" }) {
|
|
3212
|
+
let [c, p] = l(o), m = `rs-sec-${a()}`, h = /* @__PURE__ */ f(u, { children: [
|
|
3213
|
+
t && /* @__PURE__ */ d(t, {
|
|
3128
3214
|
className: "rs-sec-icon lucide",
|
|
3129
3215
|
"aria-hidden": "true"
|
|
3130
3216
|
}),
|
|
3131
|
-
e && /* @__PURE__ */
|
|
3217
|
+
e && /* @__PURE__ */ d("span", {
|
|
3132
3218
|
className: "rs-sec-title",
|
|
3133
3219
|
children: e
|
|
3134
3220
|
}),
|
|
3135
|
-
/* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ f("span", {
|
|
3136
3222
|
className: "rs-sec-end",
|
|
3137
|
-
children: [n && /* @__PURE__ */
|
|
3223
|
+
children: [n && /* @__PURE__ */ d("span", {
|
|
3138
3224
|
className: "rs-sec-meta",
|
|
3139
3225
|
children: n
|
|
3140
|
-
}),
|
|
3226
|
+
}), i && /* @__PURE__ */ d(g, {
|
|
3141
3227
|
className: "rs-sec-chevron lucide",
|
|
3142
3228
|
"aria-hidden": "true"
|
|
3143
3229
|
})]
|
|
3144
3230
|
})
|
|
3145
3231
|
] });
|
|
3146
|
-
return /* @__PURE__ */
|
|
3147
|
-
className: `rs-sec${
|
|
3148
|
-
children: [
|
|
3232
|
+
return /* @__PURE__ */ f("section", {
|
|
3233
|
+
className: `rs-sec${i ? " rs-sec--collapsible" : ""}${c ? " is-open" : ""}${s ? ` ${s}` : ""}`,
|
|
3234
|
+
children: [i ? /* @__PURE__ */ d("button", {
|
|
3149
3235
|
type: "button",
|
|
3150
3236
|
className: "rs-sec-head rs-sec-head--button",
|
|
3151
|
-
"aria-expanded":
|
|
3152
|
-
"aria-controls":
|
|
3237
|
+
"aria-expanded": c,
|
|
3238
|
+
"aria-controls": m,
|
|
3153
3239
|
onClick: () => p((e) => !e),
|
|
3154
|
-
children:
|
|
3155
|
-
}) : /* @__PURE__ */
|
|
3240
|
+
children: h
|
|
3241
|
+
}) : /* @__PURE__ */ d("div", {
|
|
3156
3242
|
className: "rs-sec-head",
|
|
3157
|
-
children:
|
|
3158
|
-
}), /* @__PURE__ */
|
|
3159
|
-
id:
|
|
3243
|
+
children: h
|
|
3244
|
+
}), /* @__PURE__ */ d("div", {
|
|
3245
|
+
id: i ? m : void 0,
|
|
3160
3246
|
className: "rs-sec-body",
|
|
3161
|
-
hidden:
|
|
3162
|
-
children:
|
|
3247
|
+
hidden: i ? !c : void 0,
|
|
3248
|
+
children: r
|
|
3163
3249
|
})]
|
|
3164
3250
|
});
|
|
3165
3251
|
}
|
|
3166
|
-
function
|
|
3167
|
-
let [o,
|
|
3168
|
-
return /* @__PURE__ */
|
|
3252
|
+
function Er({ title: e, icon: t, meta: n, children: r, defaultOpen: i = !0 }) {
|
|
3253
|
+
let [o, s] = l(i), c = `rs-split-${a()}`;
|
|
3254
|
+
return /* @__PURE__ */ f("section", {
|
|
3169
3255
|
className: `rs-split-panel${o ? " is-open" : ""}`,
|
|
3170
|
-
children: [/* @__PURE__ */
|
|
3256
|
+
children: [/* @__PURE__ */ f("button", {
|
|
3171
3257
|
type: "button",
|
|
3172
3258
|
className: "rs-split-head",
|
|
3173
3259
|
"aria-expanded": o,
|
|
3174
|
-
"aria-controls":
|
|
3175
|
-
onClick: () =>
|
|
3260
|
+
"aria-controls": c,
|
|
3261
|
+
onClick: () => s((e) => !e),
|
|
3176
3262
|
children: [
|
|
3177
|
-
t && /* @__PURE__ */
|
|
3263
|
+
t && /* @__PURE__ */ d(t, {
|
|
3178
3264
|
className: "rs-sec-icon lucide",
|
|
3179
3265
|
"aria-hidden": "true"
|
|
3180
3266
|
}),
|
|
3181
|
-
e && /* @__PURE__ */
|
|
3267
|
+
e && /* @__PURE__ */ d("span", {
|
|
3182
3268
|
className: "rs-sec-title",
|
|
3183
3269
|
children: e
|
|
3184
3270
|
}),
|
|
3185
|
-
/* @__PURE__ */
|
|
3271
|
+
/* @__PURE__ */ f("span", {
|
|
3186
3272
|
className: "rs-sec-end",
|
|
3187
|
-
children: [n && /* @__PURE__ */
|
|
3273
|
+
children: [n && /* @__PURE__ */ d("span", {
|
|
3188
3274
|
className: "rs-sec-meta",
|
|
3189
3275
|
children: n
|
|
3190
|
-
}), /* @__PURE__ */
|
|
3276
|
+
}), /* @__PURE__ */ d(g, {
|
|
3191
3277
|
className: "rs-sec-chevron lucide",
|
|
3192
3278
|
"aria-hidden": "true"
|
|
3193
3279
|
})]
|
|
3194
3280
|
})
|
|
3195
3281
|
]
|
|
3196
|
-
}), /* @__PURE__ */
|
|
3197
|
-
id:
|
|
3282
|
+
}), /* @__PURE__ */ d("div", {
|
|
3283
|
+
id: c,
|
|
3198
3284
|
className: "rs-split-body",
|
|
3199
3285
|
hidden: !o,
|
|
3200
|
-
children:
|
|
3286
|
+
children: r
|
|
3201
3287
|
})]
|
|
3202
3288
|
});
|
|
3203
3289
|
}
|
|
3204
|
-
function
|
|
3205
|
-
return /* @__PURE__ */
|
|
3290
|
+
function Dr({ left: e, right: t, leftTitle: n = "outline", rightTitle: r = "filters", leftIcon: i, rightIcon: a, leftMeta: o, rightMeta: s, className: c = "" }) {
|
|
3291
|
+
return /* @__PURE__ */ f("div", {
|
|
3206
3292
|
className: `rs-split${c ? ` ${c}` : ""}`,
|
|
3207
|
-
children: [/* @__PURE__ */
|
|
3293
|
+
children: [/* @__PURE__ */ d(Er, {
|
|
3208
3294
|
title: n,
|
|
3209
3295
|
icon: i,
|
|
3210
3296
|
meta: o,
|
|
3211
3297
|
children: e
|
|
3212
|
-
}), /* @__PURE__ */
|
|
3298
|
+
}), /* @__PURE__ */ d(Er, {
|
|
3213
3299
|
title: r,
|
|
3214
3300
|
icon: a,
|
|
3215
3301
|
meta: s,
|
|
@@ -3219,23 +3305,23 @@ function br({ left: e, right: t, leftTitle: n = "outline", rightTitle: r = "filt
|
|
|
3219
3305
|
}
|
|
3220
3306
|
//#endregion
|
|
3221
3307
|
//#region src/ui/inuse/InUseShell.jsx
|
|
3222
|
-
var
|
|
3308
|
+
var Or = Object.freeze([
|
|
3223
3309
|
{
|
|
3224
3310
|
id: "transcript",
|
|
3225
3311
|
mark: "transcript-browser",
|
|
3226
|
-
icon:
|
|
3312
|
+
icon: ne
|
|
3227
3313
|
},
|
|
3228
3314
|
{
|
|
3229
3315
|
id: "commons",
|
|
3230
3316
|
mark: "village",
|
|
3231
|
-
icon:
|
|
3317
|
+
icon: oe
|
|
3232
3318
|
},
|
|
3233
3319
|
{
|
|
3234
3320
|
id: "graph",
|
|
3235
3321
|
mark: "peasant",
|
|
3236
|
-
icon:
|
|
3322
|
+
icon: C
|
|
3237
3323
|
}
|
|
3238
|
-
]),
|
|
3324
|
+
]), kr = Object.freeze([
|
|
3239
3325
|
Object.freeze({
|
|
3240
3326
|
id: "home",
|
|
3241
3327
|
label: "home",
|
|
@@ -3261,7 +3347,7 @@ var xr = Object.freeze([
|
|
|
3261
3347
|
label: "code map",
|
|
3262
3348
|
inNav: !1
|
|
3263
3349
|
})
|
|
3264
|
-
]),
|
|
3350
|
+
]), Ar = Object.freeze([
|
|
3265
3351
|
{
|
|
3266
3352
|
id: "analytics",
|
|
3267
3353
|
label: "analytics"
|
|
@@ -3275,22 +3361,22 @@ var xr = Object.freeze([
|
|
|
3275
3361
|
label: "code map"
|
|
3276
3362
|
}
|
|
3277
3363
|
]);
|
|
3278
|
-
function
|
|
3364
|
+
function jr(e) {
|
|
3279
3365
|
return e.filter((e) => e.inNav !== !1);
|
|
3280
3366
|
}
|
|
3281
|
-
function
|
|
3367
|
+
function Mr(e) {
|
|
3282
3368
|
return e && (/(INPUT|TEXTAREA|SELECT)/.test(e.tagName) || e.isContentEditable);
|
|
3283
3369
|
}
|
|
3284
|
-
function
|
|
3285
|
-
let [
|
|
3286
|
-
n === void 0 &&
|
|
3370
|
+
function Nr({ apps: e = Or, defaultApp: t, activeApp: n, onAppChange: r, renderApp: i, brand: a = "fairtrade", ariaLabel: o = "the design system in use" }) {
|
|
3371
|
+
let [s, u] = l(t ?? e[0]?.id), p = n ?? s, m = c({}), h = (e) => {
|
|
3372
|
+
n === void 0 && u(e), r?.(e);
|
|
3287
3373
|
}, g = e.find((e) => e.id === p) ?? e[0];
|
|
3288
|
-
return /* @__PURE__ */
|
|
3374
|
+
return /* @__PURE__ */ f("section", {
|
|
3289
3375
|
className: "iu",
|
|
3290
3376
|
id: "inuse",
|
|
3291
|
-
"aria-label":
|
|
3377
|
+
"aria-label": o,
|
|
3292
3378
|
onKeyDown: (t) => {
|
|
3293
|
-
if (
|
|
3379
|
+
if (Mr(t.target)) return;
|
|
3294
3380
|
let n = {
|
|
3295
3381
|
1: 0,
|
|
3296
3382
|
2: 1,
|
|
@@ -3298,19 +3384,19 @@ function Er({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
|
|
|
3298
3384
|
}[t.key];
|
|
3299
3385
|
n != null && e[n] && (t.preventDefault(), h(e[n].id));
|
|
3300
3386
|
},
|
|
3301
|
-
children: [/* @__PURE__ */
|
|
3387
|
+
children: [/* @__PURE__ */ f("div", {
|
|
3302
3388
|
className: "iu-bar",
|
|
3303
|
-
children: [/* @__PURE__ */
|
|
3389
|
+
children: [/* @__PURE__ */ f("div", {
|
|
3304
3390
|
className: "iu-bar-brand",
|
|
3305
|
-
children: [/* @__PURE__ */
|
|
3391
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
3306
3392
|
className: "logo",
|
|
3307
3393
|
width: "18",
|
|
3308
3394
|
height: "18",
|
|
3309
3395
|
viewBox: "0 0 32 32",
|
|
3310
3396
|
"aria-hidden": "true",
|
|
3311
|
-
children: /* @__PURE__ */
|
|
3312
|
-
}), /* @__PURE__ */
|
|
3313
|
-
}), /* @__PURE__ */
|
|
3397
|
+
children: /* @__PURE__ */ d("use", { href: "#logo" })
|
|
3398
|
+
}), /* @__PURE__ */ d("span", { children: a })]
|
|
3399
|
+
}), /* @__PURE__ */ d("div", {
|
|
3314
3400
|
className: "iu-switch",
|
|
3315
3401
|
role: "tablist",
|
|
3316
3402
|
"aria-label": "apps",
|
|
@@ -3328,7 +3414,7 @@ function Er({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
|
|
|
3328
3414
|
},
|
|
3329
3415
|
children: e.map((e, t) => {
|
|
3330
3416
|
let n = e.icon, r = e.id === g?.id;
|
|
3331
|
-
return /* @__PURE__ */
|
|
3417
|
+
return /* @__PURE__ */ f("button", {
|
|
3332
3418
|
type: "button",
|
|
3333
3419
|
role: "tab",
|
|
3334
3420
|
id: "iu-tab-" + e.id,
|
|
@@ -3341,18 +3427,18 @@ function Er({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
|
|
|
3341
3427
|
className: "iu-opt" + (r ? " iu-opt-on" : ""),
|
|
3342
3428
|
onClick: () => h(e.id),
|
|
3343
3429
|
children: [
|
|
3344
|
-
n ? /* @__PURE__ */
|
|
3430
|
+
n ? /* @__PURE__ */ d("span", {
|
|
3345
3431
|
className: "iu-opt-ico",
|
|
3346
|
-
children: /* @__PURE__ */
|
|
3432
|
+
children: /* @__PURE__ */ d(n, {
|
|
3347
3433
|
size: 16,
|
|
3348
3434
|
"aria-hidden": "true"
|
|
3349
3435
|
})
|
|
3350
3436
|
}) : null,
|
|
3351
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ d("span", {
|
|
3352
3438
|
className: "iu-opt-label",
|
|
3353
3439
|
children: e.mark
|
|
3354
3440
|
}),
|
|
3355
|
-
/* @__PURE__ */
|
|
3441
|
+
/* @__PURE__ */ d("span", {
|
|
3356
3442
|
className: "iu-opt-key",
|
|
3357
3443
|
"aria-hidden": "true",
|
|
3358
3444
|
children: t + 1
|
|
@@ -3361,72 +3447,72 @@ function Er({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
|
|
|
3361
3447
|
}, e.id);
|
|
3362
3448
|
})
|
|
3363
3449
|
})]
|
|
3364
|
-
}), /* @__PURE__ */
|
|
3450
|
+
}), /* @__PURE__ */ d("div", {
|
|
3365
3451
|
className: "iu-stage",
|
|
3366
3452
|
id: "inuse-stage",
|
|
3367
3453
|
role: "tabpanel",
|
|
3368
3454
|
"aria-labelledby": "iu-tab-" + g?.id,
|
|
3369
3455
|
tabIndex: -1,
|
|
3370
|
-
children: /* @__PURE__ */
|
|
3456
|
+
children: /* @__PURE__ */ d("div", {
|
|
3371
3457
|
className: "iu-screen",
|
|
3372
3458
|
children: g ? i?.(g.id) : null
|
|
3373
3459
|
}, g?.id)
|
|
3374
3460
|
})]
|
|
3375
3461
|
});
|
|
3376
3462
|
}
|
|
3377
|
-
function
|
|
3378
|
-
let
|
|
3379
|
-
return /* @__PURE__ */
|
|
3463
|
+
function Pr({ sections: e = kr, activeId: t, activePrimaryId: n, onSectionChange: r, backTo: i, onBack: a, notice: o = null, children: s, ariaLabel: c = "peasant sections" }) {
|
|
3464
|
+
let l = n ?? t;
|
|
3465
|
+
return /* @__PURE__ */ f("div", {
|
|
3380
3466
|
className: "iu-app-root",
|
|
3381
3467
|
children: [
|
|
3382
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ f("nav", {
|
|
3383
3469
|
className: "iu-subnav",
|
|
3384
3470
|
"aria-label": c,
|
|
3385
|
-
children: [i ? /* @__PURE__ */
|
|
3471
|
+
children: [i ? /* @__PURE__ */ f("button", {
|
|
3386
3472
|
type: "button",
|
|
3387
3473
|
className: "iu-subnav-back",
|
|
3388
3474
|
onClick: () => a ? a(i) : r?.(i),
|
|
3389
|
-
children: [/* @__PURE__ */
|
|
3475
|
+
children: [/* @__PURE__ */ d(h, {
|
|
3390
3476
|
size: 14,
|
|
3391
3477
|
"aria-hidden": "true"
|
|
3392
3478
|
}), " back"]
|
|
3393
|
-
}) : null,
|
|
3479
|
+
}) : null, jr(e).map((e) => /* @__PURE__ */ d("button", {
|
|
3394
3480
|
type: "button",
|
|
3395
|
-
className: "iu-subnav-item" + (
|
|
3481
|
+
className: "iu-subnav-item" + (l === e.id ? " active" : ""),
|
|
3396
3482
|
"aria-current": t === e.id ? "page" : void 0,
|
|
3397
3483
|
onClick: () => r?.(e.id),
|
|
3398
3484
|
children: e.label
|
|
3399
3485
|
}, e.id))]
|
|
3400
3486
|
}),
|
|
3401
3487
|
o,
|
|
3402
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ d("div", {
|
|
3403
3489
|
className: "iu-view",
|
|
3404
3490
|
children: s
|
|
3405
3491
|
})
|
|
3406
3492
|
]
|
|
3407
3493
|
});
|
|
3408
3494
|
}
|
|
3409
|
-
function
|
|
3410
|
-
return /* @__PURE__ */
|
|
3495
|
+
function Fr({ sections: e = kr, 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: c = null, ariaLabel: l = "peasant sections" }) {
|
|
3496
|
+
return /* @__PURE__ */ d("nav", {
|
|
3411
3497
|
className: a,
|
|
3412
|
-
"aria-label":
|
|
3413
|
-
children:
|
|
3414
|
-
let a = t === e.id,
|
|
3415
|
-
return m && r ? /* @__PURE__ */
|
|
3498
|
+
"aria-label": l,
|
|
3499
|
+
children: jr(e).map((e) => {
|
|
3500
|
+
let a = t === e.id, l = o + (a && s ? " " + s : ""), p = /* @__PURE__ */ f(u, { children: [e.label, a ? c : null] }), m = n?.(e);
|
|
3501
|
+
return m && r ? /* @__PURE__ */ d(r, {
|
|
3416
3502
|
href: m,
|
|
3417
|
-
className:
|
|
3503
|
+
className: l,
|
|
3418
3504
|
"aria-current": a ? "page" : void 0,
|
|
3419
3505
|
title: e.title,
|
|
3420
3506
|
children: p
|
|
3421
|
-
}, e.id) : m ? /* @__PURE__ */
|
|
3507
|
+
}, e.id) : m ? /* @__PURE__ */ d("a", {
|
|
3422
3508
|
href: m,
|
|
3423
|
-
className:
|
|
3509
|
+
className: l,
|
|
3424
3510
|
"aria-current": a ? "page" : void 0,
|
|
3425
3511
|
title: e.title,
|
|
3426
3512
|
children: p
|
|
3427
|
-
}, e.id) : /* @__PURE__ */
|
|
3513
|
+
}, e.id) : /* @__PURE__ */ d("button", {
|
|
3428
3514
|
type: "button",
|
|
3429
|
-
className:
|
|
3515
|
+
className: l,
|
|
3430
3516
|
"aria-current": a ? "page" : void 0,
|
|
3431
3517
|
onClick: () => i?.(e.id),
|
|
3432
3518
|
children: p
|
|
@@ -3436,23 +3522,23 @@ function Or({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkC
|
|
|
3436
3522
|
}
|
|
3437
3523
|
//#endregion
|
|
3438
3524
|
//#region src/ui/transcript/graph/GraphTurnNode.jsx
|
|
3439
|
-
function
|
|
3525
|
+
function Ir(e) {
|
|
3440
3526
|
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
|
|
3441
3527
|
}
|
|
3442
|
-
function
|
|
3528
|
+
function Lr(e, t) {
|
|
3443
3529
|
return e === "user" ? "you" : t ? "subagent" : e === "assistant" ? "assistant" : e;
|
|
3444
3530
|
}
|
|
3445
|
-
function
|
|
3446
|
-
return r ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? n === void 0 ? "amber" :
|
|
3531
|
+
function Rr({ role: e, agentName: t, provider: n, hasError: r }) {
|
|
3532
|
+
return r ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? n === void 0 ? "amber" : Ne(n) : null;
|
|
3447
3533
|
}
|
|
3448
|
-
function
|
|
3449
|
-
let v =
|
|
3534
|
+
function zr({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: l = !1, hasRevert: u = !1, isSearchMatch: p = !1, isFilteredOut: m = !1, isSelected: h = !1, provider: g, className: _ = "" }) {
|
|
3535
|
+
let v = Rr({
|
|
3450
3536
|
role: e,
|
|
3451
3537
|
agentName: t,
|
|
3452
3538
|
provider: g,
|
|
3453
3539
|
hasError: c
|
|
3454
|
-
}), y =
|
|
3455
|
-
return /* @__PURE__ */
|
|
3540
|
+
}), y = Lr(e, t), b = c ? "error" : l ? "retry" : u ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in, ${s ?? 0} out` : void 0;
|
|
3541
|
+
return /* @__PURE__ */ f("div", {
|
|
3456
3542
|
className: [
|
|
3457
3543
|
"ft-gnode",
|
|
3458
3544
|
"ft-gnode-turn",
|
|
@@ -3467,44 +3553,44 @@ function Mr({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
|
|
|
3467
3553
|
"data-role": y,
|
|
3468
3554
|
"data-turn": n,
|
|
3469
3555
|
children: [
|
|
3470
|
-
/* @__PURE__ */
|
|
3556
|
+
/* @__PURE__ */ f("header", {
|
|
3471
3557
|
className: "ft-gnode-head",
|
|
3472
3558
|
children: [
|
|
3473
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ d("span", {
|
|
3474
3560
|
className: "ft-gnode-role",
|
|
3475
3561
|
children: y
|
|
3476
3562
|
}),
|
|
3477
|
-
t && /* @__PURE__ */
|
|
3563
|
+
t && /* @__PURE__ */ f("span", {
|
|
3478
3564
|
className: "ft-gnode-agent",
|
|
3479
|
-
children: ["
|
|
3565
|
+
children: [", ", t]
|
|
3480
3566
|
}),
|
|
3481
|
-
/* @__PURE__ */
|
|
3567
|
+
/* @__PURE__ */ f("span", {
|
|
3482
3568
|
className: "ft-gnode-num",
|
|
3483
3569
|
children: ["#", n]
|
|
3484
3570
|
}),
|
|
3485
|
-
b && /* @__PURE__ */
|
|
3571
|
+
b && /* @__PURE__ */ d("span", {
|
|
3486
3572
|
className: `ft-gnode-flag ft-gnode-flag-${c ? "err" : "warn"}`,
|
|
3487
3573
|
children: b
|
|
3488
3574
|
})
|
|
3489
3575
|
]
|
|
3490
3576
|
}),
|
|
3491
|
-
r && /* @__PURE__ */
|
|
3577
|
+
r && /* @__PURE__ */ d("div", {
|
|
3492
3578
|
className: `ft-gnode-prev${e === "user" ? " ft-gnode-prev-user" : ""}`,
|
|
3493
3579
|
children: r
|
|
3494
3580
|
}),
|
|
3495
|
-
/* @__PURE__ */
|
|
3581
|
+
/* @__PURE__ */ f("footer", {
|
|
3496
3582
|
className: "ft-gnode-meta",
|
|
3497
|
-
children: [i > 0 && /* @__PURE__ */
|
|
3583
|
+
children: [i > 0 && /* @__PURE__ */ f("span", {
|
|
3498
3584
|
className: "ft-gnode-meta-tools",
|
|
3499
3585
|
children: [
|
|
3500
3586
|
i,
|
|
3501
3587
|
" ",
|
|
3502
3588
|
i === 1 ? "tool" : "tools"
|
|
3503
3589
|
]
|
|
3504
|
-
}), a > 0 && /* @__PURE__ */
|
|
3590
|
+
}), a > 0 && /* @__PURE__ */ d("span", {
|
|
3505
3591
|
className: "ft-gnode-meta-tokens",
|
|
3506
3592
|
title: x,
|
|
3507
|
-
children:
|
|
3593
|
+
children: Ir(a)
|
|
3508
3594
|
})]
|
|
3509
3595
|
})
|
|
3510
3596
|
]
|
|
@@ -3512,20 +3598,20 @@ function Mr({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
|
|
|
3512
3598
|
}
|
|
3513
3599
|
//#endregion
|
|
3514
3600
|
//#region src/ui/transcript/graph/GraphToolNode.jsx
|
|
3515
|
-
function
|
|
3601
|
+
function Br(e) {
|
|
3516
3602
|
return e == null || e <= 0 ? "" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1).replace(/\.0$/, "")}s`;
|
|
3517
3603
|
}
|
|
3518
|
-
function
|
|
3604
|
+
function Vr(e) {
|
|
3519
3605
|
if (!e) return "";
|
|
3520
3606
|
let t = e.split("/");
|
|
3521
3607
|
return t[t.length - 1] || e;
|
|
3522
3608
|
}
|
|
3523
|
-
function
|
|
3609
|
+
function Hr(e) {
|
|
3524
3610
|
return !!e.isError || e.exitCode != null && e.exitCode !== 0;
|
|
3525
3611
|
}
|
|
3526
|
-
function
|
|
3527
|
-
let o = e.slice(0, i), s = e.length - o.length, c =
|
|
3528
|
-
return /* @__PURE__ */
|
|
3612
|
+
function Ur({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
|
|
3613
|
+
let o = e.slice(0, i), s = e.length - o.length, c = Br(t), l = e.length;
|
|
3614
|
+
return /* @__PURE__ */ f("div", {
|
|
3529
3615
|
className: [
|
|
3530
3616
|
"ft-gnode",
|
|
3531
3617
|
"ft-gnode-tools",
|
|
@@ -3533,37 +3619,37 @@ function Ir({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
|
|
|
3533
3619
|
r && "ft-gnode-dimmed",
|
|
3534
3620
|
a
|
|
3535
3621
|
].filter(Boolean).join(" "),
|
|
3536
|
-
children: [/* @__PURE__ */
|
|
3622
|
+
children: [/* @__PURE__ */ f("header", {
|
|
3537
3623
|
className: "ft-gnode-tools-head",
|
|
3538
|
-
children: [/* @__PURE__ */
|
|
3624
|
+
children: [/* @__PURE__ */ d("span", {
|
|
3539
3625
|
className: "ft-gnode-tools-count",
|
|
3540
|
-
children:
|
|
3541
|
-
}), c && /* @__PURE__ */
|
|
3626
|
+
children: l === 1 ? "tool call" : `${l} tool calls`
|
|
3627
|
+
}), c && /* @__PURE__ */ d("span", {
|
|
3542
3628
|
className: "ft-gnode-tools-dur",
|
|
3543
3629
|
children: c
|
|
3544
3630
|
})]
|
|
3545
|
-
}), /* @__PURE__ */
|
|
3631
|
+
}), /* @__PURE__ */ f("ul", {
|
|
3546
3632
|
className: "ft-gnode-tools-list",
|
|
3547
3633
|
children: [o.map((e) => {
|
|
3548
|
-
let t =
|
|
3549
|
-
return /* @__PURE__ */
|
|
3634
|
+
let t = Hr(e), n = e.preview || Vr(e.filePath);
|
|
3635
|
+
return /* @__PURE__ */ f("li", {
|
|
3550
3636
|
className: `ft-gnode-tools-row${t ? " ft-gnode-tools-row-failed" : ""}`,
|
|
3551
3637
|
children: [
|
|
3552
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ d("span", {
|
|
3553
3639
|
className: "ft-gnode-tools-name",
|
|
3554
3640
|
children: e.name
|
|
3555
3641
|
}),
|
|
3556
|
-
n && /* @__PURE__ */
|
|
3642
|
+
n && /* @__PURE__ */ d("span", {
|
|
3557
3643
|
className: "ft-gnode-tools-arg",
|
|
3558
3644
|
children: n
|
|
3559
3645
|
}),
|
|
3560
|
-
t && /* @__PURE__ */
|
|
3646
|
+
t && /* @__PURE__ */ d("span", {
|
|
3561
3647
|
className: "ft-gnode-tools-err",
|
|
3562
3648
|
children: "error"
|
|
3563
3649
|
})
|
|
3564
3650
|
]
|
|
3565
3651
|
}, e.id);
|
|
3566
|
-
}), s > 0 && /* @__PURE__ */
|
|
3652
|
+
}), s > 0 && /* @__PURE__ */ f("li", {
|
|
3567
3653
|
className: "ft-gnode-tools-more",
|
|
3568
3654
|
children: [
|
|
3569
3655
|
"+ ",
|
|
@@ -3576,19 +3662,19 @@ function Ir({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
|
|
|
3576
3662
|
}
|
|
3577
3663
|
//#endregion
|
|
3578
3664
|
//#region src/ui/transcript/graph/GraphSubagentBranch.jsx
|
|
3579
|
-
function
|
|
3580
|
-
return /* @__PURE__ */
|
|
3665
|
+
function Wr({ agentName: e, depth: t, className: n = "" }) {
|
|
3666
|
+
return /* @__PURE__ */ f("div", {
|
|
3581
3667
|
className: ["ft-gnode-lane", n].filter(Boolean).join(" "),
|
|
3582
3668
|
children: [
|
|
3583
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ d("span", {
|
|
3584
3670
|
className: "ft-gnode-lane-eyebrow",
|
|
3585
3671
|
children: "subagent"
|
|
3586
3672
|
}),
|
|
3587
|
-
/* @__PURE__ */
|
|
3673
|
+
/* @__PURE__ */ d("span", {
|
|
3588
3674
|
className: "ft-gnode-lane-name",
|
|
3589
3675
|
children: e
|
|
3590
3676
|
}),
|
|
3591
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ f("span", {
|
|
3592
3678
|
className: "ft-gnode-lane-depth",
|
|
3593
3679
|
children: ["d", t]
|
|
3594
3680
|
})
|
|
@@ -3597,7 +3683,7 @@ function Lr({ agentName: e, depth: t, className: n = "" }) {
|
|
|
3597
3683
|
}
|
|
3598
3684
|
//#endregion
|
|
3599
3685
|
//#region src/ui/transcript/graph/GraphLegend.jsx
|
|
3600
|
-
var
|
|
3686
|
+
var Gr = Object.freeze([
|
|
3601
3687
|
{
|
|
3602
3688
|
kind: "user",
|
|
3603
3689
|
label: "you"
|
|
@@ -3619,31 +3705,31 @@ var Rr = Object.freeze([
|
|
|
3619
3705
|
label: "error"
|
|
3620
3706
|
}
|
|
3621
3707
|
]);
|
|
3622
|
-
function
|
|
3708
|
+
function Kr({ kind: e, provider: t }) {
|
|
3623
3709
|
switch (e) {
|
|
3624
3710
|
case "user": return "teal";
|
|
3625
|
-
case "assistant": return t === void 0 ? "amber" :
|
|
3711
|
+
case "assistant": return t === void 0 ? "amber" : Ne(t);
|
|
3626
3712
|
case "subagent": return "mauve";
|
|
3627
3713
|
case "error": return "clay";
|
|
3628
3714
|
default: return null;
|
|
3629
3715
|
}
|
|
3630
3716
|
}
|
|
3631
|
-
function
|
|
3632
|
-
return /* @__PURE__ */
|
|
3717
|
+
function qr({ items: e = Gr, className: t = "" }) {
|
|
3718
|
+
return /* @__PURE__ */ d("div", {
|
|
3633
3719
|
className: ["ft-graph-legend", t].filter(Boolean).join(" "),
|
|
3634
3720
|
children: e.map((e) => {
|
|
3635
|
-
let t =
|
|
3636
|
-
return /* @__PURE__ */
|
|
3721
|
+
let t = Kr(e), n = t ? { background: `var(--${t})` } : void 0;
|
|
3722
|
+
return /* @__PURE__ */ f("span", {
|
|
3637
3723
|
className: "ft-graph-legend-item",
|
|
3638
|
-
children: [/* @__PURE__ */
|
|
3724
|
+
children: [/* @__PURE__ */ d("span", {
|
|
3639
3725
|
className: "ft-graph-legend-glyph",
|
|
3640
3726
|
"data-kind": e.kind,
|
|
3641
3727
|
style: n,
|
|
3642
3728
|
"aria-hidden": "true"
|
|
3643
|
-
}), /* @__PURE__ */
|
|
3729
|
+
}), /* @__PURE__ */ d("span", { children: e.label })]
|
|
3644
3730
|
}, e.kind + ":" + e.label);
|
|
3645
3731
|
})
|
|
3646
3732
|
});
|
|
3647
3733
|
}
|
|
3648
3734
|
//#endregion
|
|
3649
|
-
export {
|
|
3735
|
+
export { ft as $, Tt as A, Zt as B, mn as C, Ne as Ct, St as D, Te as Dt, Ct as E, Ee as Et, Pt as F, _t as G, Bt as H, Yt as I, lt as J, ct as K, Qt as L, It as M, Ft as N, Dt as O, we as Ot, zt as P, mt as Q, Lt as R, tn as S, Le as St, wt as T, Oe as Tt, ht as U, Jt as V, gt as W, st as X, ut as Y, pt as Z, Y as _, ze as _t, zr as a, Ge as at, vn as b, P as bt, Fr as c, U as ct, kr as d, z as dt, ot as et, Tr as f, B as ft, en as g, Be as gt, pr as h, I as ht, Ur as i, Ke as it, Ot as j, Et as k, Or as l, W as lt, Dr as m, V as mt, qr as n, Ye as nt, Ar as o, We as ot, wr as p, He as pt, dt as q, Wr as r, qe as rt, Pr as s, Ue as st, Gr as t, tt, Nr as u, H as ut, fn as v, L as vt, gn as w, je as wt, hn as x, Fe as xt, X as y, F as yt, Rt as z };
|