@peasant-labs/fairtrade 0.0.39 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/THIRD_PARTY_NOTICES.md +14 -0
  2. package/dist/lib/{GraphLegend-DwLFq2JU.js → GraphLegend-CBKZsRta.js} +1401 -1488
  3. package/dist/lib/adapter-Dulh38C2.js +1214 -0
  4. package/dist/lib/analytics.css +1 -1
  5. package/dist/lib/analytics.js +289 -292
  6. package/dist/lib/commons.js +807 -805
  7. package/dist/lib/components.css +1 -1
  8. package/dist/lib/format-B3uT2wzU.js +41 -0
  9. package/dist/lib/graph.js +383 -381
  10. package/dist/lib/share-fonts/AtkinsonHyperlegible-Bold.ttf +0 -0
  11. package/dist/lib/share-fonts/AtkinsonHyperlegible-Regular.ttf +0 -0
  12. package/dist/lib/share-fonts/AtkinsonHyperlegibleMono-Bold.ttf +0 -0
  13. package/dist/lib/share-fonts/AtkinsonHyperlegibleMono-Regular.ttf +0 -0
  14. package/dist/lib/share-fonts/OFL-AtkinsonHyperlegible.txt +92 -0
  15. package/dist/lib/share-fonts/OFL-AtkinsonHyperlegibleMono.txt +93 -0
  16. package/dist/lib/share.js +1311 -0
  17. package/dist/lib/time-CpVBzcqQ.js +157 -0
  18. package/dist/lib/types/BrandMark.d.ts +2 -6
  19. package/dist/lib/types/CliOnboard.d.ts +11 -0
  20. package/dist/lib/types/DiffView.d.ts +5 -3
  21. package/dist/lib/types/Publish.d.ts +29 -7
  22. package/dist/lib/types/Switch.d.ts +8 -1
  23. package/dist/lib/types/analytics/format.d.ts +2 -1
  24. package/dist/lib/types/brand-geometry.d.ts +22 -0
  25. package/dist/lib/types/commons/providers.d.ts +1 -1
  26. package/dist/lib/types/format.d.ts +35 -4
  27. package/dist/lib/types/index.d.ts +1 -0
  28. package/dist/lib/types/share/ShareCard.d.ts +40 -0
  29. package/dist/lib/types/share/data.d.ts +54 -0
  30. package/dist/lib/types/share/fonts.d.ts +16 -0
  31. package/dist/lib/types/share/index.d.ts +5 -0
  32. package/dist/lib/types/share/marks.d.ts +23 -0
  33. package/dist/lib/types/share/metrics.d.ts +10 -0
  34. package/dist/lib/types/transcript/title.d.ts +21 -0
  35. package/dist/lib/types/ui/brand-geometry.d.ts +22 -0
  36. package/dist/lib/types/ui/format.d.ts +35 -0
  37. package/dist/lib/types/ui/provider-policy.d.ts +27 -0
  38. package/dist/lib/types/ui/transcript/adapter.d.ts +66 -0
  39. package/dist/lib/types/ui/transcript/adapter.parse.d.ts +103 -0
  40. package/dist/lib/types/ui/transcript/analytics.d.ts +213 -0
  41. package/dist/lib/types/ui/transcript/time.d.ts +47 -0
  42. package/dist/lib/types/ui/transcript/title.d.ts +84 -0
  43. package/dist/lib/types/ui/transcript/usage.d.ts +19 -0
  44. package/dist/lib/types/ui/transcript/view-model.d.ts +700 -0
  45. package/dist/lib/types/ui/transcript/wire-types.d.ts +63 -0
  46. package/dist/lib/{ui-CBsfaQMA.js → ui-Bhk29YuW.js} +4198 -5412
  47. package/dist/lib/ui.js +7 -4
  48. package/package.json +20 -6
@@ -1,63 +1,60 @@
1
- import { n as e, t } from "./ChartLine-MZVbpUu1.js";
2
- import { useMemo as n, useState as r } from "react";
3
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
- import { Activity as o, BarChart3 as s, ChevronDown as c, ChevronUp as l, ChevronsUpDown as u, CircleCheck as d, GitCommitHorizontal as f, Hash as p, PieChart as m, SlidersHorizontal as h, Timer as g, TrendingUp as ee, UserPlus as te, Users as _ } from "lucide-react";
1
+ import { r as e } from "./format-B3uT2wzU.js";
2
+ import { n as t, t as n } from "./ChartLine-MZVbpUu1.js";
3
+ import { useMemo as r, useState as i } from "react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { Activity as s, BarChart3 as c, ChevronDown as l, ChevronUp as u, ChevronsUpDown as d, CircleCheck as f, GitCommitHorizontal as p, Hash as m, PieChart as h, SlidersHorizontal as g, Timer as ee, TrendingUp as te, UserPlus as ne, Users as _ } from "lucide-react";
5
6
  //#region src/ui/analytics/ChartCard.jsx
6
- function v({ title: e, icon: t, subtitle: n, aside: r, children: o, className: s }) {
7
- return /* @__PURE__ */ a("section", {
7
+ function v({ title: e, icon: t, subtitle: n, aside: r, children: i, className: s }) {
8
+ return /* @__PURE__ */ o("section", {
8
9
  className: ["gan-card", s].filter(Boolean).join(" "),
9
- children: [/* @__PURE__ */ a("div", {
10
+ children: [/* @__PURE__ */ o("div", {
10
11
  className: "gan-card-head",
11
- children: [/* @__PURE__ */ a("div", {
12
+ children: [/* @__PURE__ */ o("div", {
12
13
  className: "gan-card-titles",
13
- children: [/* @__PURE__ */ a("h3", {
14
+ children: [/* @__PURE__ */ o("h3", {
14
15
  className: "gan-card-title",
15
- children: [t == null ? null : /* @__PURE__ */ i(t, {
16
+ children: [t == null ? null : /* @__PURE__ */ a(t, {
16
17
  className: "lucide",
17
18
  "aria-hidden": "true"
18
19
  }), e]
19
- }), n == null ? null : /* @__PURE__ */ i("span", {
20
+ }), n == null ? null : /* @__PURE__ */ a("span", {
20
21
  className: "gan-card-sub",
21
22
  children: n
22
23
  })]
23
- }), r == null ? null : typeof r == "string" ? /* @__PURE__ */ i("span", {
24
+ }), r == null ? null : typeof r == "string" ? /* @__PURE__ */ a("span", {
24
25
  className: "gan-card-figure tnum",
25
26
  children: r
26
27
  }) : r]
27
- }), /* @__PURE__ */ i("div", {
28
+ }), /* @__PURE__ */ a("div", {
28
29
  className: "gan-card-body",
29
- children: o
30
+ children: i
30
31
  })]
31
32
  });
32
33
  }
33
34
  //#endregion
34
35
  //#region src/ui/analytics/format.js
35
- function y(e) {
36
- let t = Math.round(e * 10) / 10;
37
- return Number.isInteger(t) ? String(t) : t.toFixed(1);
36
+ function y(t) {
37
+ return t == null || !Number.isFinite(t) || t < 0 ? "—" : e(t);
38
38
  }
39
39
  function b(e) {
40
- return e == null || !Number.isFinite(e) || e < 0 ? "—" : e < 1e3 ? String(Math.round(e)) : e < 1e6 ? `${y(e / 1e3)}k` : `${(e / 1e6).toFixed(2)}M`;
41
- }
42
- function x(e) {
43
40
  if (e == null || !Number.isFinite(e)) return "—";
44
41
  let t = Math.round(e * 10) / 10;
45
42
  return Number.isInteger(t) ? String(t) : t.toFixed(1);
46
43
  }
47
- function S(e) {
44
+ function x(e) {
48
45
  return e == null || !Number.isFinite(e) ? "—" : `${Math.round(e * 100)}%`;
49
46
  }
50
- function C(e) {
47
+ function S(e) {
51
48
  if (e == null || !Number.isFinite(e) || e < 0) return "—";
52
49
  let t = Math.round(e);
53
50
  if (t < 60) return `${t}m`;
54
51
  let n = Math.floor(t / 60), r = t % 60;
55
52
  return r === 0 ? `${n}h` : `${n}h ${r}m`;
56
53
  }
57
- function w(e) {
54
+ function C(e) {
58
55
  return e.length >= 10 ? e.slice(5) : e;
59
56
  }
60
- function T(e, t) {
57
+ function w(e, t) {
61
58
  let n = [];
62
59
  for (let r of [e, t]) typeof r == "number" && Number.isFinite(r) && n.push(r);
63
60
  let r = n.some((e) => !Number.isInteger(Math.round(e * 10) / 10)), i = (e) => {
@@ -67,40 +64,40 @@ function T(e, t) {
67
64
  };
68
65
  return [i(e), i(t)];
69
66
  }
70
- function E(e, t) {
67
+ function T(e, t) {
71
68
  let n = [];
72
69
  for (let r of [e, t]) typeof r == "number" && Number.isFinite(r) && r >= 0 && n.push(r);
73
70
  if (n.length === 0) return ["—", "—"];
74
- let r = Math.max(...n), [i, a] = r >= 1e6 ? [1e6, "M"] : r >= 1e3 ? [1e3, "k"] : [1, ""], o = i === 1e6 ? 2 : +!!n.some((e) => !Number.isInteger(Math.round(e / i * 10) / 10)), s = (e) => e == null || !Number.isFinite(e) || e < 0 ? "—" : `${(e / i).toFixed(o)}${a}`;
71
+ let r = Math.max(...n), [i, a] = r >= 0xe8d4a51000 ? [0xe8d4a51000, "T"] : r >= 1e9 ? [1e9, "B"] : r >= 1e6 ? [1e6, "M"] : r >= 1e3 ? [1e3, "k"] : [1, ""], o = +!!n.some((e) => !Number.isInteger(Math.round(e / i * 10) / 10)), s = (e) => e == null || !Number.isFinite(e) || e < 0 ? "—" : `${(e / i).toFixed(o)}${a}`;
75
72
  return [s(e), s(t)];
76
73
  }
77
74
  //#endregion
78
75
  //#region src/ui/analytics/time.js
79
- function D(e) {
76
+ function E(e) {
80
77
  let t = Date.parse(e);
81
78
  return Number.isNaN(t) ? null : t;
82
79
  }
83
- var O = 864e5;
84
- function k(e) {
85
- let t = D(e);
80
+ var D = 864e5;
81
+ function O(e) {
82
+ let t = E(e);
86
83
  if (t === null) return null;
87
84
  let n = new Date(t), r = (n.getUTCDay() + 6) % 7;
88
- return j(/* @__PURE__ */ new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()) - r * O));
85
+ return A(/* @__PURE__ */ new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()) - r * D));
89
86
  }
90
- function A(e) {
91
- let t = D(e);
92
- return t === null ? null : j(new Date(t));
87
+ function k(e) {
88
+ let t = E(e);
89
+ return t === null ? null : A(new Date(t));
93
90
  }
94
- function j(e) {
91
+ function A(e) {
95
92
  return `${e.getUTCFullYear().toString().padStart(4, "0")}-${(e.getUTCMonth() + 1).toString().padStart(2, "0")}-${e.getUTCDate().toString().padStart(2, "0")}`;
96
93
  }
97
- function M(e, t) {
94
+ function j(e, t) {
98
95
  let n = Date.parse(`${e}T00:00:00Z`), r = Date.parse(`${t}T00:00:00Z`);
99
- return Number.isNaN(n) || Number.isNaN(r) ? NaN : Math.round((r - n) / O);
96
+ return Number.isNaN(n) || Number.isNaN(r) ? NaN : Math.round((r - n) / D);
100
97
  }
101
98
  //#endregion
102
99
  //#region src/ui/analytics/stats.js
103
- function N(e, t) {
100
+ function M(e, t) {
104
101
  let n = e.filter((e) => Number.isFinite(e)).sort((e, t) => e - t);
105
102
  if (n.length === 0) return null;
106
103
  if (n.length === 1) return n[0];
@@ -109,26 +106,26 @@ function N(e, t) {
109
106
  let o = r - i;
110
107
  return n[i] + (n[a] - n[i]) * o;
111
108
  }
112
- function P(e) {
113
- return N(e, .5);
109
+ function N(e) {
110
+ return M(e, .5);
114
111
  }
115
- function F(e) {
112
+ function P(e) {
116
113
  let t = e.filter((e) => Number.isFinite(e));
117
114
  return {
118
115
  count: t.length,
119
- median: P(t),
120
- p90: N(t, .9)
116
+ median: N(t),
117
+ p90: M(t, .9)
121
118
  };
122
119
  }
123
120
  //#endregion
124
121
  //#region src/ui/analytics/metrics.js
125
- function I(e) {
122
+ function F(e) {
126
123
  return typeof e.commitCount == "number" ? e.commitCount > 0 : e.hasCommit === !0;
127
124
  }
128
- function L(e) {
125
+ function I(e) {
129
126
  let t = /* @__PURE__ */ new Map();
130
127
  for (let n of e) {
131
- let e = k(n.startTime);
128
+ let e = O(n.startTime);
132
129
  e !== null && t.set(e, (t.get(e) ?? 0) + 1);
133
130
  }
134
131
  return [...t.entries()].map(([e, t]) => ({
@@ -136,11 +133,11 @@ function L(e) {
136
133
  count: t
137
134
  })).sort((e, t) => e.week.localeCompare(t.week));
138
135
  }
139
- function R(e) {
136
+ function L(e) {
140
137
  let t = /* @__PURE__ */ new Map();
141
138
  for (let n of e) {
142
139
  if (!n.contributorId) continue;
143
- let e = k(n.startTime);
140
+ let e = O(n.startTime);
144
141
  if (e === null) continue;
145
142
  let r = t.get(e);
146
143
  r || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n.contributorId);
@@ -150,11 +147,11 @@ function R(e) {
150
147
  contributors: t.size
151
148
  })).sort((e, t) => e.week.localeCompare(t.week));
152
149
  }
153
- function z(e) {
150
+ function R(e) {
154
151
  let t = /* @__PURE__ */ new Map();
155
152
  for (let n of e) {
156
153
  if (!n.contributorId) continue;
157
- let e = k(n.startTime);
154
+ let e = O(n.startTime);
158
155
  if (e === null) continue;
159
156
  let r = t.get(n.contributorId);
160
157
  r || (r = /* @__PURE__ */ new Set(), t.set(n.contributorId, r)), r.add(e);
@@ -167,11 +164,11 @@ function z(e) {
167
164
  rate: n === 0 ? 0 : r / n
168
165
  };
169
166
  }
170
- var ne = 7 * 864e5;
171
- function B(e) {
167
+ var re = 7 * 864e5;
168
+ function z(e) {
172
169
  let t = /* @__PURE__ */ new Set();
173
170
  for (let n of e) {
174
- let e = k(n.startTime);
171
+ let e = O(n.startTime);
175
172
  e !== null && t.add(e);
176
173
  }
177
174
  let n = [...t].sort((e, t) => e.localeCompare(t));
@@ -183,7 +180,7 @@ function B(e) {
183
180
  let r = 1, i = n[0], a = n[0], o = 1, s = n[0];
184
181
  for (let e = 1; e < n.length; e++) {
185
182
  let t = Date.parse(`${n[e - 1]}T00:00:00Z`);
186
- Date.parse(`${n[e]}T00:00:00Z`) - t === ne ? o += 1 : (o = 1, s = n[e]), o > r && (r = o, i = s, a = n[e]);
183
+ Date.parse(`${n[e]}T00:00:00Z`) - t === re ? o += 1 : (o = 1, s = n[e]), o > r && (r = o, i = s, a = n[e]);
187
184
  }
188
185
  return {
189
186
  weeks: r,
@@ -191,18 +188,18 @@ function B(e) {
191
188
  endWeek: a
192
189
  };
193
190
  }
194
- function V(e) {
191
+ function B(e) {
195
192
  let t = /* @__PURE__ */ new Map();
196
193
  for (let n of e) {
197
194
  if (!n.contributorId) continue;
198
- let e = A(n.startTime);
195
+ let e = k(n.startTime);
199
196
  if (e === null) continue;
200
197
  let r = t.get(n.contributorId);
201
198
  (r === void 0 || e < r) && t.set(n.contributorId, e);
202
199
  }
203
200
  let n = /* @__PURE__ */ new Map();
204
201
  for (let e of t.values()) {
205
- let t = k(`${e}T00:00:00Z`);
202
+ let t = O(`${e}T00:00:00Z`);
206
203
  t !== null && n.set(t, (n.get(t) ?? 0) + 1);
207
204
  }
208
205
  return [...n.entries()].map(([e, t]) => ({
@@ -210,19 +207,19 @@ function V(e) {
210
207
  newContributors: t
211
208
  })).sort((e, t) => e.week.localeCompare(t.week));
212
209
  }
213
- function re(e) {
210
+ function ie(e) {
214
211
  let t = e.length, n = 0;
215
- for (let t of e) I(t) && (n += 1);
212
+ for (let t of e) F(t) && (n += 1);
216
213
  return {
217
214
  total: t,
218
215
  withCommit: n,
219
216
  rate: t === 0 ? 0 : n / t
220
217
  };
221
218
  }
222
- function ie(e) {
219
+ function ae(e) {
223
220
  let t = /* @__PURE__ */ new Map();
224
221
  for (let n of e) {
225
- let e = k(n.startTime);
222
+ let e = O(n.startTime);
226
223
  if (e === null || !Number.isFinite(n.durationMins)) continue;
227
224
  let r = t.get(e) ?? {
228
225
  sum: 0,
@@ -236,7 +233,7 @@ function ie(e) {
236
233
  sessions: n
237
234
  })).sort((e, t) => e.week.localeCompare(t.week));
238
235
  }
239
- function ae(e) {
236
+ function oe(e) {
240
237
  let t = {
241
238
  resolved: 0,
242
239
  partial: 0,
@@ -258,7 +255,7 @@ function ae(e) {
258
255
  }
259
256
  return t;
260
257
  }
261
- function oe(e) {
258
+ function se(e) {
262
259
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
263
260
  for (let r of e) {
264
261
  if (!r.contributorId) continue;
@@ -282,7 +279,7 @@ function oe(e) {
282
279
  },
283
280
  firstSeen: null,
284
281
  lastSeen: null
285
- }, i = /* @__PURE__ */ new Set(), t.set(r.contributorId, e), n.set(r.contributorId, i)), e.sessions += 1, e.outcomes.total += 1, Number.isFinite(r.totalTokens) && (e.totalTokens += r.totalTokens), Number.isFinite(r.durationMins) && (e.totalDurationMins += r.durationMins), Number.isFinite(r.turnCount) && (e.totalTurns += r.turnCount), Number.isFinite(r.toolCallCount) && (e.totalToolCalls += r.toolCallCount), I(r) && (e.sessionsWithCommit += 1), typeof r.commitCount == "number" && Number.isFinite(r.commitCount) ? e.totalCommits += Math.max(0, r.commitCount) : r.hasCommit === !0 && (e.totalCommits += 1), r.outcome) {
282
+ }, i = /* @__PURE__ */ new Set(), t.set(r.contributorId, e), n.set(r.contributorId, i)), e.sessions += 1, e.outcomes.total += 1, Number.isFinite(r.totalTokens) && (e.totalTokens += r.totalTokens), Number.isFinite(r.durationMins) && (e.totalDurationMins += r.durationMins), Number.isFinite(r.turnCount) && (e.totalTurns += r.turnCount), Number.isFinite(r.toolCallCount) && (e.totalToolCalls += r.toolCallCount), F(r) && (e.sessionsWithCommit += 1), typeof r.commitCount == "number" && Number.isFinite(r.commitCount) ? e.totalCommits += Math.max(0, r.commitCount) : r.hasCommit === !0 && (e.totalCommits += 1), r.outcome) {
286
283
  case "resolved":
287
284
  e.outcomes.resolved += 1;
288
285
  break;
@@ -294,9 +291,9 @@ function oe(e) {
294
291
  break;
295
292
  default: e.outcomes.unknown += 1;
296
293
  }
297
- let a = k(r.startTime);
294
+ let a = O(r.startTime);
298
295
  a !== null && i.add(a);
299
- let o = A(r.startTime);
296
+ let o = k(r.startTime);
300
297
  o !== null && ((e.firstSeen === null || o < e.firstSeen) && (e.firstSeen = o), (e.lastSeen === null || o > e.lastSeen) && (e.lastSeen = o));
301
298
  }
302
299
  return [...t.values()].map((e) => ({
@@ -304,16 +301,16 @@ function oe(e) {
304
301
  activeWeeks: n.get(e.contributorId)?.size ?? 0
305
302
  })).sort((e, t) => t.sessions - e.sessions || e.contributorId.localeCompare(t.contributorId));
306
303
  }
307
- function H(e) {
304
+ function V(e) {
308
305
  let t = e.total - e.unknown;
309
306
  return t <= 0 ? null : e.resolved / t;
310
307
  }
311
- function se(e) {
308
+ function H(e) {
312
309
  return {
313
- durationMins: F(e.map((e) => e.durationMins)),
314
- totalTokens: F(e.map((e) => e.totalTokens)),
315
- turnCount: F(e.map((e) => e.turnCount)),
316
- toolCallCount: F(e.map((e) => e.toolCallCount))
310
+ durationMins: P(e.map((e) => e.durationMins)),
311
+ totalTokens: P(e.map((e) => e.totalTokens)),
312
+ turnCount: P(e.map((e) => e.turnCount)),
313
+ toolCallCount: P(e.map((e) => e.toolCallCount))
317
314
  };
318
315
  }
319
316
  function U(e) {
@@ -323,16 +320,16 @@ function U(e) {
323
320
  totalSessions: e.length,
324
321
  totalContributors: t.size,
325
322
  totalProjects: n.size,
326
- sessionsPerWeek: L(e),
327
- weeklyActiveContributors: R(e),
328
- returningContributorRate: z(e),
329
- longestStreak: B(e),
330
- newContributorVelocity: V(e),
331
- sessionToCommitRate: re(e),
332
- avgDurationPerActiveWeek: ie(e),
333
- outcomeDistribution: ae(e),
334
- sessionStats: se(e),
335
- perContributorBreakdown: oe(e)
323
+ sessionsPerWeek: I(e),
324
+ weeklyActiveContributors: L(e),
325
+ returningContributorRate: R(e),
326
+ longestStreak: z(e),
327
+ newContributorVelocity: B(e),
328
+ sessionToCommitRate: ie(e),
329
+ avgDurationPerActiveWeek: ae(e),
330
+ outcomeDistribution: oe(e),
331
+ sessionStats: H(e),
332
+ perContributorBreakdown: se(e)
336
333
  };
337
334
  }
338
335
  //#endregion
@@ -378,104 +375,104 @@ var W = [
378
375
  key: "resolved",
379
376
  label: "resolved",
380
377
  numeric: !0,
381
- value: (e) => H(e.outcomes) ?? -1
378
+ value: (e) => V(e.outcomes) ?? -1
382
379
  }
383
380
  ];
384
- function G({ rows: e, renderContributor: t, limit: o, className: s }) {
385
- let [d, f] = r("sessions"), [p, m] = r("desc"), h = n(() => {
386
- let t = W.find((e) => e.key === d) ?? W[1], n = [...e].sort((e, n) => {
381
+ function G({ rows: e, renderContributor: t, limit: n, className: s }) {
382
+ let [c, f] = i("sessions"), [p, m] = i("desc"), h = r(() => {
383
+ let t = W.find((e) => e.key === c) ?? W[1], r = [...e].sort((e, n) => {
387
384
  let r = t.value(e), i = t.value(n), a = typeof r == "number" && typeof i == "number" ? r - i : String(r).localeCompare(String(i));
388
385
  return a === 0 ? e.contributorId.localeCompare(n.contributorId) : p === "desc" ? -a : a;
389
386
  });
390
- return typeof o == "number" ? n.slice(0, o) : n;
387
+ return typeof n == "number" ? r.slice(0, n) : r;
391
388
  }, [
392
389
  e,
393
- d,
390
+ c,
394
391
  p,
395
- o
392
+ n
396
393
  ]), g = (e) => {
397
- e === d ? m((e) => e === "desc" ? "asc" : "desc") : (f(e), m(e === "contributor" ? "asc" : "desc"));
394
+ e === c ? m((e) => e === "desc" ? "asc" : "desc") : (f(e), m(e === "contributor" ? "asc" : "desc"));
398
395
  };
399
- return /* @__PURE__ */ i("div", {
396
+ return /* @__PURE__ */ a("div", {
400
397
  className: ["tbl-wrap", s].filter(Boolean).join(" "),
401
- children: /* @__PURE__ */ a("table", {
398
+ children: /* @__PURE__ */ o("table", {
402
399
  className: "tbl",
403
- children: [/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: W.map((e) => {
404
- let t = d === e.key, n = t ? p === "desc" ? c : l : u;
405
- return /* @__PURE__ */ i("th", {
400
+ children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: W.map((e) => {
401
+ let t = c === e.key, n = t ? p === "desc" ? l : u : d;
402
+ return /* @__PURE__ */ a("th", {
406
403
  className: ["tbl-th", e.numeric && "tbl-right"].filter(Boolean).join(" "),
407
404
  "aria-sort": t ? p === "desc" ? "descending" : "ascending" : "none",
408
- children: /* @__PURE__ */ a("button", {
405
+ children: /* @__PURE__ */ o("button", {
409
406
  type: "button",
410
407
  className: ["tbl-sort", t && "is-sorted"].filter(Boolean).join(" "),
411
408
  onClick: () => g(e.key),
412
- children: [/* @__PURE__ */ i("span", {
409
+ children: [/* @__PURE__ */ a("span", {
413
410
  className: "tbl-th-label",
414
411
  children: e.label
415
- }), /* @__PURE__ */ i(n, {
412
+ }), /* @__PURE__ */ a(n, {
416
413
  className: "tbl-sort-ic lucide",
417
414
  "aria-hidden": "true"
418
415
  })]
419
416
  })
420
417
  }, e.key);
421
- }) }) }), /* @__PURE__ */ a("tbody", { children: [h.map((e) => /* @__PURE__ */ a("tr", {
418
+ }) }) }), /* @__PURE__ */ o("tbody", { children: [h.map((e) => /* @__PURE__ */ o("tr", {
422
419
  className: "tbl-row",
423
420
  children: [
424
- /* @__PURE__ */ i("td", {
421
+ /* @__PURE__ */ a("td", {
425
422
  className: "tbl-td",
426
- children: t ? t(e) : /* @__PURE__ */ a("span", {
423
+ children: t ? t(e) : /* @__PURE__ */ o("span", {
427
424
  className: "gan-contrib",
428
- children: [/* @__PURE__ */ i("span", {
425
+ children: [/* @__PURE__ */ a("span", {
429
426
  className: "avatar",
430
427
  "aria-hidden": "true",
431
428
  children: e.contributorId.slice(0, 1).toUpperCase()
432
429
  }), e.contributorId]
433
430
  })
434
431
  }),
435
- /* @__PURE__ */ i("td", {
432
+ /* @__PURE__ */ a("td", {
436
433
  className: "tbl-td tbl-right",
437
- children: /* @__PURE__ */ i("span", {
434
+ children: /* @__PURE__ */ a("span", {
438
435
  className: "tnum",
439
436
  children: e.sessions
440
437
  })
441
438
  }),
442
- /* @__PURE__ */ i("td", {
439
+ /* @__PURE__ */ a("td", {
443
440
  className: "tbl-td tbl-right",
444
- children: /* @__PURE__ */ i("span", {
441
+ children: /* @__PURE__ */ a("span", {
445
442
  className: "tnum",
446
443
  children: e.activeWeeks
447
444
  })
448
445
  }),
449
- /* @__PURE__ */ i("td", {
446
+ /* @__PURE__ */ a("td", {
450
447
  className: "tbl-td tbl-right",
451
- children: /* @__PURE__ */ i("span", {
448
+ children: /* @__PURE__ */ a("span", {
452
449
  className: "tnum",
453
- children: b(e.totalTokens)
450
+ children: y(e.totalTokens)
454
451
  })
455
452
  }),
456
- /* @__PURE__ */ i("td", {
453
+ /* @__PURE__ */ a("td", {
457
454
  className: "tbl-td tbl-right",
458
- children: /* @__PURE__ */ i("span", {
455
+ children: /* @__PURE__ */ a("span", {
459
456
  className: "tnum",
460
- children: C(e.totalDurationMins)
457
+ children: S(e.totalDurationMins)
461
458
  })
462
459
  }),
463
- /* @__PURE__ */ i("td", {
460
+ /* @__PURE__ */ a("td", {
464
461
  className: "tbl-td tbl-right",
465
- children: /* @__PURE__ */ i("span", {
462
+ children: /* @__PURE__ */ a("span", {
466
463
  className: "tnum",
467
464
  children: e.totalCommits
468
465
  })
469
466
  }),
470
- /* @__PURE__ */ i("td", {
467
+ /* @__PURE__ */ a("td", {
471
468
  className: "tbl-td tbl-right",
472
- children: /* @__PURE__ */ i("span", {
469
+ children: /* @__PURE__ */ a("span", {
473
470
  className: "tnum",
474
- children: H(e.outcomes) == null ? "—" : S(H(e.outcomes))
471
+ children: V(e.outcomes) == null ? "—" : x(V(e.outcomes))
475
472
  })
476
473
  })
477
474
  ]
478
- }, e.contributorId)), h.length === 0 && /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i("td", {
475
+ }, e.contributorId)), h.length === 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", {
479
476
  className: "tbl-empty",
480
477
  colSpan: W.length,
481
478
  children: "no contributor data."
@@ -544,116 +541,116 @@ var ce = Object.freeze([
544
541
  token: "var(--ink-3)"
545
542
  }
546
543
  ], de = [];
547
- function fe({ payload: c, title: l, subtitle: u, sections: h, showSectionToggle: y = !0, contributorLimit: w, renderContributor: T, chartHeight: E = 200, footnote: D, className: O }) {
548
- let k = c?.sessions ?? de, A = c?.analytics, [j, M] = r(() => le), [N, P] = r("active"), F = n(() => ({
544
+ function fe({ payload: e, title: l, subtitle: u, sections: d, showSectionToggle: g = !0, contributorLimit: C, renderContributor: w, chartHeight: T = 200, footnote: E, className: D }) {
545
+ let O = e?.sessions ?? de, k = e?.analytics, [A, j] = i(() => le), [M, N] = i("active"), P = r(() => ({
549
546
  ...le,
550
- ...h
551
- }), [h]), I = n(() => Object.fromEntries(q.map((e) => [e, F[e] && j[e]])), [F, j]), L = n(() => A ?? U(k), [A, k]), R = n(() => _e(k, L), [L, k]), z = u ?? R, ne = L.outcomeDistribution.total, B = L.perContributorBreakdown.reduce((e, t) => e + t.totalCommits, 0), V = I.newContributorVelocity ? N : "active";
552
- return /* @__PURE__ */ a("div", {
553
- className: ["gan-root", O].filter(Boolean).join(" "),
554
- children: [l != null || z != null || y ? /* @__PURE__ */ a("div", {
547
+ ...d
548
+ }), [d]), F = r(() => Object.fromEntries(q.map((e) => [e, P[e] && A[e]])), [P, A]), I = r(() => k ?? U(O), [k, O]), L = r(() => _e(O, I), [I, O]), R = u ?? L, re = I.outcomeDistribution.total, z = I.perContributorBreakdown.reduce((e, t) => e + t.totalCommits, 0), B = F.newContributorVelocity ? M : "active";
549
+ return /* @__PURE__ */ o("div", {
550
+ className: ["gan-root", D].filter(Boolean).join(" "),
551
+ children: [l != null || R != null || g ? /* @__PURE__ */ o("div", {
555
552
  className: "gan-head",
556
- children: [/* @__PURE__ */ a("div", {
553
+ children: [/* @__PURE__ */ o("div", {
557
554
  className: "gan-head-titles",
558
- children: [l == null ? null : /* @__PURE__ */ i("h2", {
555
+ children: [l == null ? null : /* @__PURE__ */ a("h2", {
559
556
  className: "gan-h2",
560
557
  children: l
561
- }), z == null ? null : /* @__PURE__ */ i("div", {
558
+ }), R == null ? null : /* @__PURE__ */ a("div", {
562
559
  className: "gan-sub",
563
- children: z
560
+ children: R
564
561
  })]
565
- }), y ? /* @__PURE__ */ i(pe, {
566
- baseSections: F,
567
- sections: I,
568
- userSections: j,
562
+ }), g ? /* @__PURE__ */ a(pe, {
563
+ baseSections: P,
564
+ sections: F,
565
+ userSections: A,
569
566
  onToggle: (e) => {
570
- M((t) => ({
567
+ j((t) => ({
571
568
  ...t,
572
569
  [e]: !t[e]
573
570
  }));
574
571
  }
575
572
  }) : null]
576
- }) : null, /* @__PURE__ */ a("div", {
573
+ }) : null, /* @__PURE__ */ o("div", {
577
574
  className: "gan-scroll",
578
575
  children: [
579
- I.summary ? /* @__PURE__ */ a("div", {
576
+ F.summary ? /* @__PURE__ */ o("div", {
580
577
  className: "gan-kpis",
581
578
  role: "list",
582
579
  "aria-label": "headline metrics",
583
580
  children: [
584
- /* @__PURE__ */ i(J, {
585
- icon: o,
581
+ /* @__PURE__ */ a(J, {
582
+ icon: s,
586
583
  label: "new sessions",
587
- value: x(L.totalSessions),
584
+ value: b(I.totalSessions),
588
585
  hint: "recorded",
589
- detail: L.sessionsPerWeek.map((e) => `${e.week}: ${x(e.count)} sessions`).join("\n") || "no recorded weeks"
586
+ detail: I.sessionsPerWeek.map((e) => `${e.week}: ${b(e.count)} sessions`).join("\n") || "no recorded weeks"
590
587
  }),
591
- /* @__PURE__ */ i(J, {
588
+ /* @__PURE__ */ a(J, {
592
589
  icon: _,
593
590
  label: "contributors",
594
- value: x(L.totalContributors),
595
- hint: ye(L.perContributorBreakdown),
596
- detail: L.perContributorBreakdown.map((e) => `${e.contributorId}: ${x(e.sessions)} sessions`).join("\n") || "no recorded contributors"
591
+ value: b(I.totalContributors),
592
+ hint: ye(I.perContributorBreakdown),
593
+ detail: I.perContributorBreakdown.map((e) => `${e.contributorId}: ${b(e.sessions)} sessions`).join("\n") || "no recorded contributors"
597
594
  }),
598
- /* @__PURE__ */ i(J, {
599
- icon: ee,
595
+ /* @__PURE__ */ a(J, {
596
+ icon: te,
600
597
  label: "contributors in multiple weeks",
601
- value: S(L.returningContributorRate.rate),
602
- hint: `${x(L.returningContributorRate.returning)} of ${x(L.returningContributorRate.total)}`,
603
- detail: `${x(L.returningContributorRate.returning)} returning contributors active in two or more weeks; ${x(L.returningContributorRate.total)} contributors with dated sessions.`
598
+ value: x(I.returningContributorRate.rate),
599
+ hint: `${b(I.returningContributorRate.returning)} of ${b(I.returningContributorRate.total)}`,
600
+ detail: `${b(I.returningContributorRate.returning)} returning contributors active in two or more weeks; ${b(I.returningContributorRate.total)} contributors with dated sessions.`
604
601
  }),
605
- /* @__PURE__ */ i(J, {
606
- icon: f,
602
+ /* @__PURE__ */ a(J, {
603
+ icon: p,
607
604
  label: "sessions linked to commits",
608
- value: S(L.sessionToCommitRate.rate),
609
- hint: `${x(L.sessionToCommitRate.withCommit)} of ${x(L.sessionToCommitRate.total)}`,
610
- detail: `${x(L.sessionToCommitRate.withCommit)} sessions linked to a commit; ${x(L.sessionToCommitRate.total - L.sessionToCommitRate.withCommit)} without a linked commit.`
605
+ value: x(I.sessionToCommitRate.rate),
606
+ hint: `${b(I.sessionToCommitRate.withCommit)} of ${b(I.sessionToCommitRate.total)}`,
607
+ detail: `${b(I.sessionToCommitRate.withCommit)} sessions linked to a commit; ${b(I.sessionToCommitRate.total - I.sessionToCommitRate.withCommit)} without a linked commit.`
611
608
  }),
612
- /* @__PURE__ */ i(J, {
613
- icon: d,
609
+ /* @__PURE__ */ a(J, {
610
+ icon: f,
614
611
  label: "weeks with sessions",
615
- detail: L.sessionsPerWeek.filter((e) => e.count > 0).map((e) => e.week).join("\n") || "no weeks with sessions",
616
- value: `${x(L.sessionsPerWeek.filter((e) => e.count > 0).length)} wk`
612
+ detail: I.sessionsPerWeek.filter((e) => e.count > 0).map((e) => e.week).join("\n") || "no weeks with sessions",
613
+ value: `${b(I.sessionsPerWeek.filter((e) => e.count > 0).length)} wk`
617
614
  }),
618
- /* @__PURE__ */ i(J, {
619
- icon: p,
615
+ /* @__PURE__ */ a(J, {
616
+ icon: m,
620
617
  label: "projects",
621
- value: x(L.totalProjects),
622
- hint: ve(k, L.totalProjects),
623
- detail: [...new Set(k.map((e) => e.project).filter(Boolean))].join("\n") || `${x(L.totalProjects)} projects in the supplied summary.`
618
+ value: b(I.totalProjects),
619
+ hint: ve(O, I.totalProjects),
620
+ detail: [...new Set(O.map((e) => e.project).filter(Boolean))].join("\n") || `${b(I.totalProjects)} projects in the supplied summary.`
624
621
  })
625
622
  ]
626
623
  }) : null,
627
- /* @__PURE__ */ a("div", {
624
+ /* @__PURE__ */ o("div", {
628
625
  className: "gan-grid",
629
626
  children: [
630
- I.sessionsPerWeek ? /* @__PURE__ */ i(v, {
631
- icon: s,
627
+ F.sessionsPerWeek ? /* @__PURE__ */ a(v, {
628
+ icon: c,
632
629
  title: "sessions per week",
633
- aside: `${x(L.totalSessions)} total`,
634
- children: /* @__PURE__ */ i(e, {
635
- data: Y(Q(L.sessionsPerWeek, "count")),
630
+ aside: `${b(I.totalSessions)} total`,
631
+ children: /* @__PURE__ */ a(t, {
632
+ data: Y(Q(I.sessionsPerWeek, "count")),
636
633
  xKey: "label",
637
634
  series: [{
638
635
  key: "value",
639
636
  name: "sessions",
640
637
  color: "amber"
641
638
  }],
642
- height: E,
643
- valueFormatter: x
639
+ height: T,
640
+ valueFormatter: b
644
641
  })
645
642
  }) : null,
646
- I.weeklyActiveContributors ? /* @__PURE__ */ i(v, {
643
+ F.weeklyActiveContributors ? /* @__PURE__ */ a(v, {
647
644
  icon: _,
648
645
  title: "weekly active contributors",
649
- subtitle: V === "new" ? `${x($(Q(L.newContributorVelocity, "newContributors")))} new` : `${x($(Q(L.weeklyActiveContributors, "contributors")))} active`,
650
- aside: /* @__PURE__ */ i(me, {
651
- view: V,
652
- canShowNew: !!I.newContributorVelocity,
653
- onChange: P
646
+ subtitle: B === "new" ? `${b($(Q(I.newContributorVelocity, "newContributors")))} new` : `${b($(Q(I.weeklyActiveContributors, "contributors")))} active`,
647
+ aside: /* @__PURE__ */ a(me, {
648
+ view: B,
649
+ canShowNew: !!F.newContributorVelocity,
650
+ onChange: N
654
651
  }),
655
- children: V === "new" ? /* @__PURE__ */ i(t, {
656
- data: Y(Q(L.newContributorVelocity, "newContributors")),
652
+ children: B === "new" ? /* @__PURE__ */ a(n, {
653
+ data: Y(Q(I.newContributorVelocity, "newContributors")),
657
654
  xKey: "label",
658
655
  series: [{
659
656
  key: "value",
@@ -661,10 +658,10 @@ function fe({ payload: c, title: l, subtitle: u, sections: h, showSectionToggle:
661
658
  color: "olive",
662
659
  area: !0
663
660
  }],
664
- height: E,
665
- valueFormatter: x
666
- }) : /* @__PURE__ */ i(t, {
667
- data: Y(Q(L.weeklyActiveContributors, "contributors")),
661
+ height: T,
662
+ valueFormatter: b
663
+ }) : /* @__PURE__ */ a(n, {
664
+ data: Y(Q(I.weeklyActiveContributors, "contributors")),
668
665
  xKey: "label",
669
666
  series: [{
670
667
  key: "value",
@@ -672,141 +669,141 @@ function fe({ payload: c, title: l, subtitle: u, sections: h, showSectionToggle:
672
669
  color: "teal",
673
670
  area: !0
674
671
  }],
675
- height: E,
676
- valueFormatter: x
672
+ height: T,
673
+ valueFormatter: b
677
674
  })
678
675
  }) : null,
679
- I.newContributorVelocity ? /* @__PURE__ */ i(v, {
680
- icon: te,
676
+ F.newContributorVelocity ? /* @__PURE__ */ a(v, {
677
+ icon: ne,
681
678
  title: "new contributors per week",
682
- aside: `${x($(Q(L.newContributorVelocity, "newContributors")))} new`,
683
- children: /* @__PURE__ */ i(e, {
684
- data: Y(Q(L.newContributorVelocity, "newContributors")),
679
+ aside: `${b($(Q(I.newContributorVelocity, "newContributors")))} new`,
680
+ children: /* @__PURE__ */ a(t, {
681
+ data: Y(Q(I.newContributorVelocity, "newContributors")),
685
682
  xKey: "label",
686
683
  series: [{
687
684
  key: "value",
688
685
  name: "new contributors",
689
686
  color: "olive"
690
687
  }],
691
- height: E,
692
- valueFormatter: x
688
+ height: T,
689
+ valueFormatter: b
693
690
  })
694
691
  }) : null,
695
- I.avgDurationPerActiveWeek ? /* @__PURE__ */ i(v, {
696
- icon: g,
692
+ F.avgDurationPerActiveWeek ? /* @__PURE__ */ a(v, {
693
+ icon: ee,
697
694
  title: "avg duration per active week",
698
695
  subtitle: "minutes",
699
- aside: `${C(xe(Q(L.avgDurationPerActiveWeek, "avgDurationMins")))} avg`,
700
- children: /* @__PURE__ */ i(t, {
701
- data: Y(Q(L.avgDurationPerActiveWeek, "avgDurationMins")),
696
+ aside: `${S(xe(Q(I.avgDurationPerActiveWeek, "avgDurationMins")))} avg`,
697
+ children: /* @__PURE__ */ a(n, {
698
+ data: Y(Q(I.avgDurationPerActiveWeek, "avgDurationMins")),
702
699
  xKey: "label",
703
700
  series: [{
704
701
  key: "value",
705
702
  name: "minutes",
706
703
  color: "amber"
707
704
  }],
708
- height: E,
709
- valueFormatter: x
705
+ height: T,
706
+ valueFormatter: b
710
707
  })
711
708
  }) : null,
712
- I.outcomeDistribution ? /* @__PURE__ */ i(v, {
713
- icon: m,
709
+ F.outcomeDistribution ? /* @__PURE__ */ a(v, {
710
+ icon: h,
714
711
  title: "outcome distribution",
715
- aside: `${x(ne)} total`,
716
- children: /* @__PURE__ */ i(he, { data: L.outcomeDistribution })
712
+ aside: `${b(re)} total`,
713
+ children: /* @__PURE__ */ a(he, { data: I.outcomeDistribution })
717
714
  }) : null,
718
- I.sessionStats ? /* @__PURE__ */ i(v, {
719
- icon: o,
715
+ F.sessionStats ? /* @__PURE__ */ a(v, {
716
+ icon: s,
720
717
  title: "typical vs. tail",
721
718
  subtitle: "median, p90",
722
719
  aside: "per session",
723
- children: /* @__PURE__ */ i(ge, { data: L.sessionStats })
720
+ children: /* @__PURE__ */ a(ge, { data: I.sessionStats })
724
721
  }) : null
725
722
  ]
726
723
  }),
727
- I.contributorTable ? /* @__PURE__ */ a(v, {
724
+ F.contributorTable ? /* @__PURE__ */ o(v, {
728
725
  icon: _,
729
726
  title: "contributors",
730
- aside: `${x(L.perContributorBreakdown.length)} ${Z(L.perContributorBreakdown.length, "person", "people")}`,
727
+ aside: `${b(I.perContributorBreakdown.length)} ${Z(I.perContributorBreakdown.length, "person", "people")}`,
731
728
  className: "gan-tablecard",
732
- children: [/* @__PURE__ */ i(G, {
733
- rows: L.perContributorBreakdown,
734
- limit: w,
735
- renderContributor: T
736
- }), /* @__PURE__ */ a("div", {
729
+ children: [/* @__PURE__ */ a(G, {
730
+ rows: I.perContributorBreakdown,
731
+ limit: C,
732
+ renderContributor: w
733
+ }), /* @__PURE__ */ o("div", {
737
734
  className: "gan-table-foot",
738
735
  children: [
739
- /* @__PURE__ */ a("span", {
736
+ /* @__PURE__ */ o("span", {
740
737
  className: "metaitem",
741
738
  children: [
742
- /* @__PURE__ */ i(p, { "aria-hidden": "true" }),
739
+ /* @__PURE__ */ a(m, { "aria-hidden": "true" }),
743
740
  " totals ",
744
- /* @__PURE__ */ i("b", { children: x(L.totalSessions) }),
741
+ /* @__PURE__ */ a("b", { children: b(I.totalSessions) }),
745
742
  " sessions"
746
743
  ]
747
744
  }),
748
- /* @__PURE__ */ a("span", {
745
+ /* @__PURE__ */ o("span", {
749
746
  className: "metaitem",
750
747
  children: [
751
- /* @__PURE__ */ i(p, { "aria-hidden": "true" }),
748
+ /* @__PURE__ */ a(m, { "aria-hidden": "true" }),
752
749
  " ",
753
- /* @__PURE__ */ i("b", { children: b(Se(L.perContributorBreakdown)) }),
750
+ /* @__PURE__ */ a("b", { children: y(Se(I.perContributorBreakdown)) }),
754
751
  " tokens"
755
752
  ]
756
753
  }),
757
- /* @__PURE__ */ a("span", {
754
+ /* @__PURE__ */ o("span", {
758
755
  className: "metaitem",
759
756
  children: [
760
- /* @__PURE__ */ i(f, { "aria-hidden": "true" }),
757
+ /* @__PURE__ */ a(p, { "aria-hidden": "true" }),
761
758
  " ",
762
- /* @__PURE__ */ i("b", { children: x(B) }),
759
+ /* @__PURE__ */ a("b", { children: b(z) }),
763
760
  " commits"
764
761
  ]
765
762
  })
766
763
  ]
767
764
  })]
768
765
  }) : null,
769
- D == null ? null : /* @__PURE__ */ i("p", {
766
+ E == null ? null : /* @__PURE__ */ a("p", {
770
767
  className: "gan-foot",
771
- children: D
768
+ children: E
772
769
  })
773
770
  ]
774
771
  })]
775
772
  });
776
773
  }
777
774
  function pe({ baseSections: e, sections: t, userSections: n, onToggle: r }) {
778
- let o = K.filter((e) => t[e.key]).length;
779
- return /* @__PURE__ */ a("div", {
775
+ let i = K.filter((e) => t[e.key]).length;
776
+ return /* @__PURE__ */ o("div", {
780
777
  className: "gan-toggle",
781
778
  role: "group",
782
779
  "aria-label": "visible sections",
783
- children: [/* @__PURE__ */ a("span", {
780
+ children: [/* @__PURE__ */ o("span", {
784
781
  className: "gan-toggle-lab",
785
782
  children: [
786
- /* @__PURE__ */ i(h, {
783
+ /* @__PURE__ */ a(g, {
787
784
  className: "lucide",
788
785
  "aria-hidden": "true"
789
786
  }),
790
787
  " sections",
791
- /* @__PURE__ */ a("b", {
788
+ /* @__PURE__ */ o("b", {
792
789
  className: "tnum",
793
790
  children: [
794
- o,
791
+ i,
795
792
  "/",
796
793
  K.length
797
794
  ]
798
795
  })
799
796
  ]
800
- }), /* @__PURE__ */ i("div", {
801
- className: "gan-toggle-chips",
797
+ }), /* @__PURE__ */ a("div", {
798
+ className: "gan-toggle-chips gan-section-chips",
802
799
  children: K.map((t) => {
803
- let a = e[t.key], o = a && n[t.key];
804
- return /* @__PURE__ */ i("button", {
800
+ let i = e[t.key], o = i && n[t.key];
801
+ return /* @__PURE__ */ a("button", {
805
802
  type: "button",
806
803
  className: ["gan-seg", o && "is-on"].filter(Boolean).join(" "),
807
804
  "aria-label": `${t.label} section`,
808
805
  "aria-pressed": o,
809
- disabled: !a,
806
+ disabled: !i,
810
807
  onClick: () => r(t.key),
811
808
  children: t.label
812
809
  }, t.key);
@@ -815,17 +812,17 @@ function pe({ baseSections: e, sections: t, userSections: n, onToggle: r }) {
815
812
  });
816
813
  }
817
814
  function me({ view: e, canShowNew: t, onChange: n }) {
818
- return /* @__PURE__ */ a("div", {
815
+ return /* @__PURE__ */ o("div", {
819
816
  className: "gan-toggle-chips",
820
817
  role: "group",
821
818
  "aria-label": "series",
822
- children: [/* @__PURE__ */ i("button", {
819
+ children: [/* @__PURE__ */ a("button", {
823
820
  type: "button",
824
821
  className: ["gan-seg", e === "active" && "is-on"].filter(Boolean).join(" "),
825
822
  "aria-pressed": e === "active",
826
823
  onClick: () => n("active"),
827
824
  children: "active"
828
- }), /* @__PURE__ */ i("button", {
825
+ }), /* @__PURE__ */ a("button", {
829
826
  type: "button",
830
827
  className: ["gan-seg", e === "new" && "is-on"].filter(Boolean).join(" "),
831
828
  "aria-pressed": e === "new",
@@ -835,15 +832,15 @@ function me({ view: e, canShowNew: t, onChange: n }) {
835
832
  })]
836
833
  });
837
834
  }
838
- function J({ icon: e, label: t, value: n, hint: r, detail: o }) {
839
- return /* @__PURE__ */ i("div", {
835
+ function J({ icon: e, label: t, value: n, hint: r, detail: i }) {
836
+ return /* @__PURE__ */ a("div", {
840
837
  className: "gan-tile",
841
838
  role: "listitem",
842
- children: /* @__PURE__ */ a("details", { children: [/* @__PURE__ */ a("summary", { children: [
843
- /* @__PURE__ */ a("span", {
839
+ children: /* @__PURE__ */ o("details", { children: [/* @__PURE__ */ o("summary", { children: [
840
+ /* @__PURE__ */ o("span", {
844
841
  className: "gan-tile-lab",
845
842
  children: [
846
- /* @__PURE__ */ i(e, {
843
+ /* @__PURE__ */ a(e, {
847
844
  className: "lucide",
848
845
  "aria-hidden": "true"
849
846
  }),
@@ -851,17 +848,17 @@ function J({ icon: e, label: t, value: n, hint: r, detail: o }) {
851
848
  t
852
849
  ]
853
850
  }),
854
- /* @__PURE__ */ i("span", {
851
+ /* @__PURE__ */ a("span", {
855
852
  className: "gan-tile-val tnum",
856
853
  children: n
857
854
  }),
858
- r == null ? null : /* @__PURE__ */ i("span", {
855
+ r == null ? null : /* @__PURE__ */ a("span", {
859
856
  className: "gan-tile-hint",
860
857
  children: r
861
858
  })
862
- ] }), /* @__PURE__ */ i("p", {
859
+ ] }), /* @__PURE__ */ a("p", {
863
860
  className: "gan-tile-detail",
864
- children: o
861
+ children: i
865
862
  })] })
866
863
  });
867
864
  }
@@ -872,8 +869,8 @@ function Y(e) {
872
869
  }));
873
870
  }
874
871
  function he({ data: e }) {
875
- let [t, n] = r(null), o = e.total;
876
- if (o === 0) return /* @__PURE__ */ i("div", {
872
+ let [t, n] = i(null), r = e.total;
873
+ if (r === 0) return /* @__PURE__ */ a("div", {
877
874
  className: "gan-donut-empty",
878
875
  children: "no outcome data."
879
876
  });
@@ -881,24 +878,24 @@ function he({ data: e }) {
881
878
  ...t,
882
879
  value: e[t.key]
883
880
  })).filter((e) => e.value > 0), c = .045, l = -Math.PI / 2, u = s.map((e) => {
884
- let t = e.value / o, n = l + c / 2, r = l + t * Math.PI * 2 - c / 2;
881
+ let t = e.value / r, n = l + c / 2, i = l + t * Math.PI * 2 - c / 2;
885
882
  l += t * Math.PI * 2;
886
- let i = +(r - n > Math.PI), a = (e, t) => [90 + e * Math.cos(t), 90 + e * Math.sin(t)], [s, u] = a(78, n), [d, f] = a(78, r), [p, m] = a(49, r), [h, g] = a(49, n), ee = `M${s} ${u} A78 78 0 ${i} 1 ${d} ${f} L${p} ${m} A49 49 0 ${i} 0 ${h} ${g} Z`;
883
+ let a = +(i - n > Math.PI), o = (e, t) => [90 + e * Math.cos(t), 90 + e * Math.sin(t)], [s, u] = o(78, n), [d, f] = o(78, i), [p, m] = o(49, i), [h, g] = o(49, n), ee = `M${s} ${u} A78 78 0 ${a} 1 ${d} ${f} L${p} ${m} A49 49 0 ${a} 0 ${h} ${g} Z`;
887
884
  return {
888
885
  ...e,
889
886
  d: ee,
890
887
  frac: t
891
888
  };
892
889
  });
893
- return /* @__PURE__ */ a("div", {
890
+ return /* @__PURE__ */ o("div", {
894
891
  className: "gan-donut",
895
- children: [/* @__PURE__ */ a("svg", {
892
+ children: [/* @__PURE__ */ o("svg", {
896
893
  className: "gan-donut-svg",
897
894
  viewBox: "0 0 180 180",
898
895
  role: "img",
899
- "aria-label": `outcome distribution across ${x(o)} sessions`,
896
+ "aria-label": `outcome distribution across ${b(r)} sessions`,
900
897
  children: [
901
- u.map((e, r) => /* @__PURE__ */ i("path", {
898
+ u.map((e, r) => /* @__PURE__ */ a("path", {
902
899
  d: e.d,
903
900
  fill: e.token,
904
901
  stroke: "var(--surface)",
@@ -907,20 +904,20 @@ function he({ data: e }) {
907
904
  className: "gan-slice",
908
905
  tabIndex: 0,
909
906
  role: "img",
910
- "aria-label": `${e.label}, ${x(e.value)} sessions, ${S(e.frac)}`,
907
+ "aria-label": `${e.label}, ${b(e.value)} sessions, ${x(e.frac)}`,
911
908
  onMouseEnter: () => n(r),
912
909
  onMouseLeave: () => n((e) => e === r ? null : e),
913
910
  onFocus: () => n(r),
914
911
  onBlur: () => n((e) => e === r ? null : e)
915
912
  }, e.key)),
916
- /* @__PURE__ */ i("text", {
913
+ /* @__PURE__ */ a("text", {
917
914
  x: "90",
918
915
  y: "84",
919
916
  className: "gan-donut-num tnum",
920
917
  textAnchor: "middle",
921
- children: x(t == null ? o : s[t].value)
918
+ children: b(t == null ? r : s[t].value)
922
919
  }),
923
- /* @__PURE__ */ i("text", {
920
+ /* @__PURE__ */ a("text", {
924
921
  x: "90",
925
922
  y: "104",
926
923
  className: "gan-donut-lab",
@@ -928,59 +925,59 @@ function he({ data: e }) {
928
925
  children: t == null ? "sessions" : s[t].label
929
926
  })
930
927
  ]
931
- }), /* @__PURE__ */ i("ul", {
928
+ }), /* @__PURE__ */ a("ul", {
932
929
  className: "gan-legend",
933
- children: ue.map((r) => {
934
- let c = e[r.key], l = o === 0 ? 0 : c / o, u = s.findIndex((e) => e.key === r.key);
935
- return /* @__PURE__ */ a("li", {
930
+ children: ue.map((i) => {
931
+ let c = e[i.key], l = r === 0 ? 0 : c / r, u = s.findIndex((e) => e.key === i.key);
932
+ return /* @__PURE__ */ o("li", {
936
933
  className: ["gan-legend-row", t === u && u >= 0 && "is-hot"].filter(Boolean).join(" "),
937
934
  onMouseEnter: () => u >= 0 && n(u),
938
935
  onMouseLeave: () => n(null),
939
936
  children: [
940
- /* @__PURE__ */ i("span", {
937
+ /* @__PURE__ */ a("span", {
941
938
  className: "gan-legend-sw",
942
- style: { background: r.token },
939
+ style: { background: i.token },
943
940
  "aria-hidden": "true"
944
941
  }),
945
- /* @__PURE__ */ i("span", {
942
+ /* @__PURE__ */ a("span", {
946
943
  className: "gan-legend-nm",
947
- children: r.label
944
+ children: i.label
948
945
  }),
949
- /* @__PURE__ */ i("span", {
946
+ /* @__PURE__ */ a("span", {
950
947
  className: "gan-legend-v tnum",
951
- children: x(c)
948
+ children: b(c)
952
949
  }),
953
- /* @__PURE__ */ i("span", {
950
+ /* @__PURE__ */ a("span", {
954
951
  className: "gan-legend-pct tnum",
955
- children: S(l)
952
+ children: x(l)
956
953
  })
957
954
  ]
958
- }, r.key);
955
+ }, i.key);
959
956
  })
960
957
  })]
961
958
  });
962
959
  }
963
960
  function ge({ data: e }) {
964
- let [t, n] = E(e.totalTokens.median, e.totalTokens.p90), [r, o] = T(e.turnCount.median, e.turnCount.p90), [s, c] = T(e.toolCallCount.median, e.toolCallCount.p90);
965
- return /* @__PURE__ */ a("div", {
961
+ let [t, n] = T(e.totalTokens.median, e.totalTokens.p90), [r, i] = w(e.turnCount.median, e.turnCount.p90), [s, c] = w(e.toolCallCount.median, e.toolCallCount.p90);
962
+ return /* @__PURE__ */ o("div", {
966
963
  className: "gan-typical",
967
964
  children: [
968
- /* @__PURE__ */ i(X, {
965
+ /* @__PURE__ */ a(X, {
969
966
  label: "duration",
970
- median: C(e.durationMins.median),
971
- p90: C(e.durationMins.p90)
967
+ median: S(e.durationMins.median),
968
+ p90: S(e.durationMins.p90)
972
969
  }),
973
- /* @__PURE__ */ i(X, {
970
+ /* @__PURE__ */ a(X, {
974
971
  label: "tokens",
975
972
  median: t,
976
973
  p90: n
977
974
  }),
978
- /* @__PURE__ */ i(X, {
975
+ /* @__PURE__ */ a(X, {
979
976
  label: "turns",
980
977
  median: r,
981
- p90: o
978
+ p90: i
982
979
  }),
983
- /* @__PURE__ */ i(X, {
980
+ /* @__PURE__ */ a(X, {
984
981
  label: "tool calls",
985
982
  median: s,
986
983
  p90: c
@@ -989,20 +986,20 @@ function ge({ data: e }) {
989
986
  });
990
987
  }
991
988
  function X({ label: e, median: t, p90: n }) {
992
- return /* @__PURE__ */ a("div", {
989
+ return /* @__PURE__ */ o("div", {
993
990
  className: "gan-typrow",
994
- children: [/* @__PURE__ */ i("span", {
991
+ children: [/* @__PURE__ */ a("span", {
995
992
  className: "gan-typlab",
996
993
  children: e
997
- }), /* @__PURE__ */ a("span", {
994
+ }), /* @__PURE__ */ o("span", {
998
995
  className: "gan-typvals",
999
- children: [/* @__PURE__ */ a("span", {
996
+ children: [/* @__PURE__ */ o("span", {
1000
997
  className: "gan-typmed tnum",
1001
- children: [t, /* @__PURE__ */ i("span", {
998
+ children: [t, /* @__PURE__ */ a("span", {
1002
999
  className: "gan-typsep",
1003
1000
  children: ","
1004
1001
  })]
1005
- }), /* @__PURE__ */ i("span", {
1002
+ }), /* @__PURE__ */ a("span", {
1006
1003
  className: "gan-typp90 tnum",
1007
1004
  children: n
1008
1005
  })]
@@ -1012,13 +1009,13 @@ function X({ label: e, median: t, p90: n }) {
1012
1009
  function _e(e, t) {
1013
1010
  return [
1014
1011
  ve(e, t.totalProjects),
1015
- `${x(t.totalContributors)} ${Z(t.totalContributors, "contributor", "contributors")}`,
1016
- `${x(t.totalSessions)} ${Z(t.totalSessions, "session", "sessions")} across ${x(t.sessionsPerWeek.length)} ${Z(t.sessionsPerWeek.length, "week", "weeks")}`
1012
+ `${b(t.totalContributors)} ${Z(t.totalContributors, "contributor", "contributors")}`,
1013
+ `${b(t.totalSessions)} ${Z(t.totalSessions, "session", "sessions")} across ${b(t.sessionsPerWeek.length)} ${Z(t.sessionsPerWeek.length, "week", "weeks")}`
1017
1014
  ].join(", ");
1018
1015
  }
1019
1016
  function ve(e, t) {
1020
1017
  let n = [...new Set(e.map((e) => e.projectKey).filter(Boolean))].sort();
1021
- return n.length === 0 ? t === 0 ? "no projects" : `${x(t)} ${Z(t, "project", "projects")}` : n.length === 1 ? n[0] : n.length <= 3 ? n.join(", ") : `${x(n.length)} projects`;
1018
+ return n.length === 0 ? t === 0 ? "no projects" : `${b(t)} ${Z(t, "project", "projects")}` : n.length === 1 ? n[0] : n.length <= 3 ? n.join(", ") : `${b(n.length)} projects`;
1022
1019
  }
1023
1020
  function ye(e) {
1024
1021
  if (e.length === 0) return "none";
@@ -1031,7 +1028,7 @@ function Z(e, t, n) {
1031
1028
  function Q(e, t) {
1032
1029
  return e.map((e) => ({
1033
1030
  key: e.week,
1034
- label: w(e.week),
1031
+ label: C(e.week),
1035
1032
  value: be(e[t])
1036
1033
  }));
1037
1034
  }
@@ -1048,4 +1045,4 @@ function Se(e) {
1048
1045
  return e.reduce((e, t) => e + t.totalTokens, 0);
1049
1046
  }
1050
1047
  //#endregion
1051
- export { ce as ANALYTICS_SESSION_OUTCOMES, v as ChartCard, G as ContributorTable, K as PROJECT_OVERVIEW_SECTION_DEFS, q as PROJECT_OVERVIEW_SECTION_KEYS, fe as ProjectOverview, ie as avgDurationPerActiveWeek, U as computeProjectAnalytics, A as dayKey, M as daysBetween, j as isoDate, B as longestStreak, P as median, F as medianAndP90, V as newContributorVelocity, ae as outcomeDistribution, D as parseTime, oe as perContributorBreakdown, N as percentile, H as resolvedRate, z as returningContributorRate, I as sessionHasCommit, se as sessionStats, re as sessionToCommitRate, L as sessionsPerWeek, k as weekKey, R as weeklyActiveContributors };
1048
+ export { ce as ANALYTICS_SESSION_OUTCOMES, v as ChartCard, G as ContributorTable, K as PROJECT_OVERVIEW_SECTION_DEFS, q as PROJECT_OVERVIEW_SECTION_KEYS, fe as ProjectOverview, ae as avgDurationPerActiveWeek, U as computeProjectAnalytics, k as dayKey, j as daysBetween, A as isoDate, z as longestStreak, N as median, P as medianAndP90, B as newContributorVelocity, oe as outcomeDistribution, E as parseTime, se as perContributorBreakdown, M as percentile, V as resolvedRate, R as returningContributorRate, F as sessionHasCommit, H as sessionStats, ie as sessionToCommitRate, I as sessionsPerWeek, O as weekKey, L as weeklyActiveContributors };