@peasant-labs/fairtrade 0.0.39 → 0.0.40
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-DwLFq2JU.js → GraphLegend-nwqBLEcI.js} +1390 -1337
- package/dist/lib/analytics.css +1 -1
- package/dist/lib/analytics.js +289 -292
- package/dist/lib/commons.js +789 -788
- package/dist/lib/components.css +1 -1
- package/dist/lib/format-B3uT2wzU.js +41 -0
- package/dist/lib/graph.js +509 -508
- package/dist/lib/types/CliOnboard.d.ts +11 -0
- package/dist/lib/types/DiffView.d.ts +5 -3
- package/dist/lib/types/Publish.d.ts +29 -7
- package/dist/lib/types/Switch.d.ts +8 -1
- package/dist/lib/types/analytics/format.d.ts +2 -1
- package/dist/lib/types/format.d.ts +35 -4
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/{ui-CBsfaQMA.js → ui-DMUCYaeU.js} +4417 -4435
- package/dist/lib/ui.js +5 -4
- package/package.json +7 -3
package/dist/lib/analytics.js
CHANGED
|
@@ -1,63 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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:
|
|
7
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
10
|
+
children: [/* @__PURE__ */ o("div", {
|
|
10
11
|
className: "gan-card-head",
|
|
11
|
-
children: [/* @__PURE__ */
|
|
12
|
+
children: [/* @__PURE__ */ o("div", {
|
|
12
13
|
className: "gan-card-titles",
|
|
13
|
-
children: [/* @__PURE__ */
|
|
14
|
+
children: [/* @__PURE__ */ o("h3", {
|
|
14
15
|
className: "gan-card-title",
|
|
15
|
-
children: [t == null ? null : /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
28
|
+
}), /* @__PURE__ */ a("div", {
|
|
28
29
|
className: "gan-card-body",
|
|
29
|
-
children:
|
|
30
|
+
children: i
|
|
30
31
|
})]
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region src/ui/analytics/format.js
|
|
35
|
-
function y(
|
|
36
|
-
|
|
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
|
|
44
|
+
function x(e) {
|
|
48
45
|
return e == null || !Number.isFinite(e) ? "—" : `${Math.round(e * 100)}%`;
|
|
49
46
|
}
|
|
50
|
-
function
|
|
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
|
|
54
|
+
function C(e) {
|
|
58
55
|
return e.length >= 10 ? e.slice(5) : e;
|
|
59
56
|
}
|
|
60
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
76
|
+
function E(e) {
|
|
80
77
|
let t = Date.parse(e);
|
|
81
78
|
return Number.isNaN(t) ? null : t;
|
|
82
79
|
}
|
|
83
|
-
var
|
|
84
|
-
function
|
|
85
|
-
let t =
|
|
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
|
|
85
|
+
return A(/* @__PURE__ */ new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()) - r * D));
|
|
89
86
|
}
|
|
90
|
-
function
|
|
91
|
-
let t =
|
|
92
|
-
return t === null ? null :
|
|
87
|
+
function k(e) {
|
|
88
|
+
let t = E(e);
|
|
89
|
+
return t === null ? null : A(new Date(t));
|
|
93
90
|
}
|
|
94
|
-
function
|
|
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
|
|
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) /
|
|
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
|
|
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
|
|
113
|
-
return
|
|
109
|
+
function N(e) {
|
|
110
|
+
return M(e, .5);
|
|
114
111
|
}
|
|
115
|
-
function
|
|
112
|
+
function P(e) {
|
|
116
113
|
let t = e.filter((e) => Number.isFinite(e));
|
|
117
114
|
return {
|
|
118
115
|
count: t.length,
|
|
119
|
-
median:
|
|
120
|
-
p90:
|
|
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
|
|
122
|
+
function F(e) {
|
|
126
123
|
return typeof e.commitCount == "number" ? e.commitCount > 0 : e.hasCommit === !0;
|
|
127
124
|
}
|
|
128
|
-
function
|
|
125
|
+
function I(e) {
|
|
129
126
|
let t = /* @__PURE__ */ new Map();
|
|
130
127
|
for (let n of e) {
|
|
131
|
-
let e =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
171
|
-
function
|
|
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 =
|
|
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 ===
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
210
|
+
function ie(e) {
|
|
214
211
|
let t = e.length, n = 0;
|
|
215
|
-
for (let t of e)
|
|
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
|
|
219
|
+
function ae(e) {
|
|
223
220
|
let t = /* @__PURE__ */ new Map();
|
|
224
221
|
for (let n of e) {
|
|
225
|
-
let e =
|
|
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
|
|
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
|
|
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),
|
|
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 =
|
|
294
|
+
let a = O(r.startTime);
|
|
298
295
|
a !== null && i.add(a);
|
|
299
|
-
let o =
|
|
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
|
|
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
|
|
308
|
+
function H(e) {
|
|
312
309
|
return {
|
|
313
|
-
durationMins:
|
|
314
|
-
totalTokens:
|
|
315
|
-
turnCount:
|
|
316
|
-
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:
|
|
327
|
-
weeklyActiveContributors:
|
|
328
|
-
returningContributorRate:
|
|
329
|
-
longestStreak:
|
|
330
|
-
newContributorVelocity:
|
|
331
|
-
sessionToCommitRate:
|
|
332
|
-
avgDurationPerActiveWeek:
|
|
333
|
-
outcomeDistribution:
|
|
334
|
-
sessionStats:
|
|
335
|
-
perContributorBreakdown:
|
|
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) =>
|
|
378
|
+
value: (e) => V(e.outcomes) ?? -1
|
|
382
379
|
}
|
|
383
380
|
];
|
|
384
|
-
function G({ rows: e, renderContributor: t, limit:
|
|
385
|
-
let [
|
|
386
|
-
let t = W.find((e) => e.key ===
|
|
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
|
|
387
|
+
return typeof n == "number" ? r.slice(0, n) : r;
|
|
391
388
|
}, [
|
|
392
389
|
e,
|
|
393
|
-
|
|
390
|
+
c,
|
|
394
391
|
p,
|
|
395
|
-
|
|
392
|
+
n
|
|
396
393
|
]), g = (e) => {
|
|
397
|
-
e ===
|
|
394
|
+
e === c ? m((e) => e === "desc" ? "asc" : "desc") : (f(e), m(e === "contributor" ? "asc" : "desc"));
|
|
398
395
|
};
|
|
399
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ a("div", {
|
|
400
397
|
className: ["tbl-wrap", s].filter(Boolean).join(" "),
|
|
401
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ o("table", {
|
|
402
399
|
className: "tbl",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
404
|
-
let t =
|
|
405
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
409
|
+
children: [/* @__PURE__ */ a("span", {
|
|
413
410
|
className: "tbl-th-label",
|
|
414
411
|
children: e.label
|
|
415
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
418
|
+
}) }) }), /* @__PURE__ */ o("tbody", { children: [h.map((e) => /* @__PURE__ */ o("tr", {
|
|
422
419
|
className: "tbl-row",
|
|
423
420
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ a("td", {
|
|
425
422
|
className: "tbl-td",
|
|
426
|
-
children: t ? t(e) : /* @__PURE__ */
|
|
423
|
+
children: t ? t(e) : /* @__PURE__ */ o("span", {
|
|
427
424
|
className: "gan-contrib",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
432
|
+
/* @__PURE__ */ a("td", {
|
|
436
433
|
className: "tbl-td tbl-right",
|
|
437
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ a("span", {
|
|
438
435
|
className: "tnum",
|
|
439
436
|
children: e.sessions
|
|
440
437
|
})
|
|
441
438
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ a("td", {
|
|
443
440
|
className: "tbl-td tbl-right",
|
|
444
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ a("span", {
|
|
445
442
|
className: "tnum",
|
|
446
443
|
children: e.activeWeeks
|
|
447
444
|
})
|
|
448
445
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ a("td", {
|
|
450
447
|
className: "tbl-td tbl-right",
|
|
451
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ a("span", {
|
|
452
449
|
className: "tnum",
|
|
453
|
-
children:
|
|
450
|
+
children: y(e.totalTokens)
|
|
454
451
|
})
|
|
455
452
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ a("td", {
|
|
457
454
|
className: "tbl-td tbl-right",
|
|
458
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ a("span", {
|
|
459
456
|
className: "tnum",
|
|
460
|
-
children:
|
|
457
|
+
children: S(e.totalDurationMins)
|
|
461
458
|
})
|
|
462
459
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ a("td", {
|
|
464
461
|
className: "tbl-td tbl-right",
|
|
465
|
-
children: /* @__PURE__ */
|
|
462
|
+
children: /* @__PURE__ */ a("span", {
|
|
466
463
|
className: "tnum",
|
|
467
464
|
children: e.totalCommits
|
|
468
465
|
})
|
|
469
466
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ a("td", {
|
|
471
468
|
className: "tbl-td tbl-right",
|
|
472
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ a("span", {
|
|
473
470
|
className: "tnum",
|
|
474
|
-
children:
|
|
471
|
+
children: V(e.outcomes) == null ? "—" : x(V(e.outcomes))
|
|
475
472
|
})
|
|
476
473
|
})
|
|
477
474
|
]
|
|
478
|
-
}, e.contributorId)), h.length === 0 && /* @__PURE__ */
|
|
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:
|
|
548
|
-
let
|
|
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
|
-
...
|
|
551
|
-
}), [
|
|
552
|
-
return /* @__PURE__ */
|
|
553
|
-
className: ["gan-root",
|
|
554
|
-
children: [l != null ||
|
|
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__ */
|
|
553
|
+
children: [/* @__PURE__ */ o("div", {
|
|
557
554
|
className: "gan-head-titles",
|
|
558
|
-
children: [l == null ? null : /* @__PURE__ */
|
|
555
|
+
children: [l == null ? null : /* @__PURE__ */ a("h2", {
|
|
559
556
|
className: "gan-h2",
|
|
560
557
|
children: l
|
|
561
|
-
}),
|
|
558
|
+
}), R == null ? null : /* @__PURE__ */ a("div", {
|
|
562
559
|
className: "gan-sub",
|
|
563
|
-
children:
|
|
560
|
+
children: R
|
|
564
561
|
})]
|
|
565
|
-
}),
|
|
566
|
-
baseSections:
|
|
567
|
-
sections:
|
|
568
|
-
userSections:
|
|
562
|
+
}), g ? /* @__PURE__ */ a(pe, {
|
|
563
|
+
baseSections: P,
|
|
564
|
+
sections: F,
|
|
565
|
+
userSections: A,
|
|
569
566
|
onToggle: (e) => {
|
|
570
|
-
|
|
567
|
+
j((t) => ({
|
|
571
568
|
...t,
|
|
572
569
|
[e]: !t[e]
|
|
573
570
|
}));
|
|
574
571
|
}
|
|
575
572
|
}) : null]
|
|
576
|
-
}) : null, /* @__PURE__ */
|
|
573
|
+
}) : null, /* @__PURE__ */ o("div", {
|
|
577
574
|
className: "gan-scroll",
|
|
578
575
|
children: [
|
|
579
|
-
|
|
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__ */
|
|
585
|
-
icon:
|
|
581
|
+
/* @__PURE__ */ a(J, {
|
|
582
|
+
icon: s,
|
|
586
583
|
label: "new sessions",
|
|
587
|
-
value:
|
|
584
|
+
value: b(I.totalSessions),
|
|
588
585
|
hint: "recorded",
|
|
589
|
-
detail:
|
|
586
|
+
detail: I.sessionsPerWeek.map((e) => `${e.week}: ${b(e.count)} sessions`).join("\n") || "no recorded weeks"
|
|
590
587
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ a(J, {
|
|
592
589
|
icon: _,
|
|
593
590
|
label: "contributors",
|
|
594
|
-
value:
|
|
595
|
-
hint: ye(
|
|
596
|
-
detail:
|
|
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__ */
|
|
599
|
-
icon:
|
|
595
|
+
/* @__PURE__ */ a(J, {
|
|
596
|
+
icon: te,
|
|
600
597
|
label: "contributors in multiple weeks",
|
|
601
|
-
value:
|
|
602
|
-
hint: `${
|
|
603
|
-
detail: `${
|
|
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__ */
|
|
606
|
-
icon:
|
|
602
|
+
/* @__PURE__ */ a(J, {
|
|
603
|
+
icon: p,
|
|
607
604
|
label: "sessions linked to commits",
|
|
608
|
-
value:
|
|
609
|
-
hint: `${
|
|
610
|
-
detail: `${
|
|
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__ */
|
|
613
|
-
icon:
|
|
609
|
+
/* @__PURE__ */ a(J, {
|
|
610
|
+
icon: f,
|
|
614
611
|
label: "weeks with sessions",
|
|
615
|
-
detail:
|
|
616
|
-
value: `${
|
|
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__ */
|
|
619
|
-
icon:
|
|
615
|
+
/* @__PURE__ */ a(J, {
|
|
616
|
+
icon: m,
|
|
620
617
|
label: "projects",
|
|
621
|
-
value:
|
|
622
|
-
hint: ve(
|
|
623
|
-
detail: [...new Set(
|
|
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__ */
|
|
624
|
+
/* @__PURE__ */ o("div", {
|
|
628
625
|
className: "gan-grid",
|
|
629
626
|
children: [
|
|
630
|
-
|
|
631
|
-
icon:
|
|
627
|
+
F.sessionsPerWeek ? /* @__PURE__ */ a(v, {
|
|
628
|
+
icon: c,
|
|
632
629
|
title: "sessions per week",
|
|
633
|
-
aside: `${
|
|
634
|
-
children: /* @__PURE__ */
|
|
635
|
-
data: Y(Q(
|
|
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:
|
|
643
|
-
valueFormatter:
|
|
639
|
+
height: T,
|
|
640
|
+
valueFormatter: b
|
|
644
641
|
})
|
|
645
642
|
}) : null,
|
|
646
|
-
|
|
643
|
+
F.weeklyActiveContributors ? /* @__PURE__ */ a(v, {
|
|
647
644
|
icon: _,
|
|
648
645
|
title: "weekly active contributors",
|
|
649
|
-
subtitle:
|
|
650
|
-
aside: /* @__PURE__ */
|
|
651
|
-
view:
|
|
652
|
-
canShowNew: !!
|
|
653
|
-
onChange:
|
|
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:
|
|
656
|
-
data: Y(Q(
|
|
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:
|
|
665
|
-
valueFormatter:
|
|
666
|
-
}) : /* @__PURE__ */
|
|
667
|
-
data: Y(Q(
|
|
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:
|
|
676
|
-
valueFormatter:
|
|
672
|
+
height: T,
|
|
673
|
+
valueFormatter: b
|
|
677
674
|
})
|
|
678
675
|
}) : null,
|
|
679
|
-
|
|
680
|
-
icon:
|
|
676
|
+
F.newContributorVelocity ? /* @__PURE__ */ a(v, {
|
|
677
|
+
icon: ne,
|
|
681
678
|
title: "new contributors per week",
|
|
682
|
-
aside: `${
|
|
683
|
-
children: /* @__PURE__ */
|
|
684
|
-
data: Y(Q(
|
|
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:
|
|
692
|
-
valueFormatter:
|
|
688
|
+
height: T,
|
|
689
|
+
valueFormatter: b
|
|
693
690
|
})
|
|
694
691
|
}) : null,
|
|
695
|
-
|
|
696
|
-
icon:
|
|
692
|
+
F.avgDurationPerActiveWeek ? /* @__PURE__ */ a(v, {
|
|
693
|
+
icon: ee,
|
|
697
694
|
title: "avg duration per active week",
|
|
698
695
|
subtitle: "minutes",
|
|
699
|
-
aside: `${
|
|
700
|
-
children: /* @__PURE__ */
|
|
701
|
-
data: Y(Q(
|
|
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:
|
|
709
|
-
valueFormatter:
|
|
705
|
+
height: T,
|
|
706
|
+
valueFormatter: b
|
|
710
707
|
})
|
|
711
708
|
}) : null,
|
|
712
|
-
|
|
713
|
-
icon:
|
|
709
|
+
F.outcomeDistribution ? /* @__PURE__ */ a(v, {
|
|
710
|
+
icon: h,
|
|
714
711
|
title: "outcome distribution",
|
|
715
|
-
aside: `${
|
|
716
|
-
children: /* @__PURE__ */
|
|
712
|
+
aside: `${b(re)} total`,
|
|
713
|
+
children: /* @__PURE__ */ a(he, { data: I.outcomeDistribution })
|
|
717
714
|
}) : null,
|
|
718
|
-
|
|
719
|
-
icon:
|
|
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__ */
|
|
720
|
+
children: /* @__PURE__ */ a(ge, { data: I.sessionStats })
|
|
724
721
|
}) : null
|
|
725
722
|
]
|
|
726
723
|
}),
|
|
727
|
-
|
|
724
|
+
F.contributorTable ? /* @__PURE__ */ o(v, {
|
|
728
725
|
icon: _,
|
|
729
726
|
title: "contributors",
|
|
730
|
-
aside: `${
|
|
727
|
+
aside: `${b(I.perContributorBreakdown.length)} ${Z(I.perContributorBreakdown.length, "person", "people")}`,
|
|
731
728
|
className: "gan-tablecard",
|
|
732
|
-
children: [/* @__PURE__ */
|
|
733
|
-
rows:
|
|
734
|
-
limit:
|
|
735
|
-
renderContributor:
|
|
736
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
736
|
+
/* @__PURE__ */ o("span", {
|
|
740
737
|
className: "metaitem",
|
|
741
738
|
children: [
|
|
742
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ a(m, { "aria-hidden": "true" }),
|
|
743
740
|
" totals ",
|
|
744
|
-
/* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ a("b", { children: b(I.totalSessions) }),
|
|
745
742
|
" sessions"
|
|
746
743
|
]
|
|
747
744
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ o("span", {
|
|
749
746
|
className: "metaitem",
|
|
750
747
|
children: [
|
|
751
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ a(m, { "aria-hidden": "true" }),
|
|
752
749
|
" ",
|
|
753
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ a("b", { children: y(Se(I.perContributorBreakdown)) }),
|
|
754
751
|
" tokens"
|
|
755
752
|
]
|
|
756
753
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ o("span", {
|
|
758
755
|
className: "metaitem",
|
|
759
756
|
children: [
|
|
760
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ a(p, { "aria-hidden": "true" }),
|
|
761
758
|
" ",
|
|
762
|
-
/* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ a("b", { children: b(z) }),
|
|
763
760
|
" commits"
|
|
764
761
|
]
|
|
765
762
|
})
|
|
766
763
|
]
|
|
767
764
|
})]
|
|
768
765
|
}) : null,
|
|
769
|
-
|
|
766
|
+
E == null ? null : /* @__PURE__ */ a("p", {
|
|
770
767
|
className: "gan-foot",
|
|
771
|
-
children:
|
|
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
|
|
779
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
780
|
+
children: [/* @__PURE__ */ o("span", {
|
|
784
781
|
className: "gan-toggle-lab",
|
|
785
782
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ a(g, {
|
|
787
784
|
className: "lucide",
|
|
788
785
|
"aria-hidden": "true"
|
|
789
786
|
}),
|
|
790
787
|
" sections",
|
|
791
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ o("b", {
|
|
792
789
|
className: "tnum",
|
|
793
790
|
children: [
|
|
794
|
-
|
|
791
|
+
i,
|
|
795
792
|
"/",
|
|
796
793
|
K.length
|
|
797
794
|
]
|
|
798
795
|
})
|
|
799
796
|
]
|
|
800
|
-
}), /* @__PURE__ */
|
|
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
|
|
804
|
-
return /* @__PURE__ */
|
|
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: !
|
|
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__ */
|
|
815
|
+
return /* @__PURE__ */ o("div", {
|
|
819
816
|
className: "gan-toggle-chips",
|
|
820
817
|
role: "group",
|
|
821
818
|
"aria-label": "series",
|
|
822
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
839
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
843
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
851
|
+
/* @__PURE__ */ a("span", {
|
|
855
852
|
className: "gan-tile-val tnum",
|
|
856
853
|
children: n
|
|
857
854
|
}),
|
|
858
|
-
r == null ? null : /* @__PURE__ */
|
|
855
|
+
r == null ? null : /* @__PURE__ */ a("span", {
|
|
859
856
|
className: "gan-tile-hint",
|
|
860
857
|
children: r
|
|
861
858
|
})
|
|
862
|
-
] }), /* @__PURE__ */
|
|
859
|
+
] }), /* @__PURE__ */ a("p", {
|
|
863
860
|
className: "gan-tile-detail",
|
|
864
|
-
children:
|
|
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] =
|
|
876
|
-
if (
|
|
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 /
|
|
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
|
|
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__ */
|
|
890
|
+
return /* @__PURE__ */ o("div", {
|
|
894
891
|
className: "gan-donut",
|
|
895
|
-
children: [/* @__PURE__ */
|
|
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 ${
|
|
896
|
+
"aria-label": `outcome distribution across ${b(r)} sessions`,
|
|
900
897
|
children: [
|
|
901
|
-
u.map((e, r) => /* @__PURE__ */
|
|
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}, ${
|
|
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__ */
|
|
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:
|
|
918
|
+
children: b(t == null ? r : s[t].value)
|
|
922
919
|
}),
|
|
923
|
-
/* @__PURE__ */
|
|
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__ */
|
|
928
|
+
}), /* @__PURE__ */ a("ul", {
|
|
932
929
|
className: "gan-legend",
|
|
933
|
-
children: ue.map((
|
|
934
|
-
let c = e[
|
|
935
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
937
|
+
/* @__PURE__ */ a("span", {
|
|
941
938
|
className: "gan-legend-sw",
|
|
942
|
-
style: { background:
|
|
939
|
+
style: { background: i.token },
|
|
943
940
|
"aria-hidden": "true"
|
|
944
941
|
}),
|
|
945
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ a("span", {
|
|
946
943
|
className: "gan-legend-nm",
|
|
947
|
-
children:
|
|
944
|
+
children: i.label
|
|
948
945
|
}),
|
|
949
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ a("span", {
|
|
950
947
|
className: "gan-legend-v tnum",
|
|
951
|
-
children:
|
|
948
|
+
children: b(c)
|
|
952
949
|
}),
|
|
953
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ a("span", {
|
|
954
951
|
className: "gan-legend-pct tnum",
|
|
955
|
-
children:
|
|
952
|
+
children: x(l)
|
|
956
953
|
})
|
|
957
954
|
]
|
|
958
|
-
},
|
|
955
|
+
}, i.key);
|
|
959
956
|
})
|
|
960
957
|
})]
|
|
961
958
|
});
|
|
962
959
|
}
|
|
963
960
|
function ge({ data: e }) {
|
|
964
|
-
let [t, n] =
|
|
965
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
965
|
+
/* @__PURE__ */ a(X, {
|
|
969
966
|
label: "duration",
|
|
970
|
-
median:
|
|
971
|
-
p90:
|
|
967
|
+
median: S(e.durationMins.median),
|
|
968
|
+
p90: S(e.durationMins.p90)
|
|
972
969
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ a(X, {
|
|
974
971
|
label: "tokens",
|
|
975
972
|
median: t,
|
|
976
973
|
p90: n
|
|
977
974
|
}),
|
|
978
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ a(X, {
|
|
979
976
|
label: "turns",
|
|
980
977
|
median: r,
|
|
981
|
-
p90:
|
|
978
|
+
p90: i
|
|
982
979
|
}),
|
|
983
|
-
/* @__PURE__ */
|
|
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__ */
|
|
989
|
+
return /* @__PURE__ */ o("div", {
|
|
993
990
|
className: "gan-typrow",
|
|
994
|
-
children: [/* @__PURE__ */
|
|
991
|
+
children: [/* @__PURE__ */ a("span", {
|
|
995
992
|
className: "gan-typlab",
|
|
996
993
|
children: e
|
|
997
|
-
}), /* @__PURE__ */
|
|
994
|
+
}), /* @__PURE__ */ o("span", {
|
|
998
995
|
className: "gan-typvals",
|
|
999
|
-
children: [/* @__PURE__ */
|
|
996
|
+
children: [/* @__PURE__ */ o("span", {
|
|
1000
997
|
className: "gan-typmed tnum",
|
|
1001
|
-
children: [t, /* @__PURE__ */
|
|
998
|
+
children: [t, /* @__PURE__ */ a("span", {
|
|
1002
999
|
className: "gan-typsep",
|
|
1003
1000
|
children: ","
|
|
1004
1001
|
})]
|
|
1005
|
-
}), /* @__PURE__ */
|
|
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
|
-
`${
|
|
1016
|
-
`${
|
|
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" : `${
|
|
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:
|
|
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,
|
|
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 };
|