@thehammer/template-verification 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { DanxChip as K, CodeViewer as
|
|
3
|
-
const
|
|
1
|
+
import { ref as j, watch as ae, defineComponent as Q, computed as g, openBlock as a, createElementBlock as s, normalizeClass as A, createElementVNode as o, toDisplayString as i, createCommentVNode as p, createBlock as E, unref as u, withCtx as O, createTextVNode as I, createVNode as D, Fragment as U, renderList as F, renderSlot as me, onBeforeUnmount as Qe, withKeys as We, withModifiers as ve, withDirectives as Xe, isRef as Ie, vModelCheckbox as Ze } from "vue";
|
|
2
|
+
import { DanxChip as K, CodeViewer as De, DanxFile as et, DanxButton as ie, DanxDialog as be, DanxFileViewer as tt, DanxAlert as ge, DanxTooltip as we, useToast as Ae, DanxProgressBar as ze, DanxTabs as at, DanxInput as nt, DanxSkeleton as je, DanxIcon as lt, gearIcon as st, DanxBadge as ot, DanxToastContainer as it } from "@thehammer/danx-ui";
|
|
3
|
+
const W = "tv-chrome", Re = "template-verification:enabled";
|
|
4
4
|
let fe = null;
|
|
5
|
-
function
|
|
5
|
+
function rt(e) {
|
|
6
6
|
var t;
|
|
7
7
|
try {
|
|
8
8
|
return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(e)) ?? null;
|
|
@@ -10,22 +10,22 @@ function ut(e) {
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ut(e, t) {
|
|
14
14
|
var n;
|
|
15
15
|
try {
|
|
16
16
|
(n = globalThis.localStorage) == null || n.setItem(e, t);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
20
|
+
function dt(e) {
|
|
21
|
+
const t = rt(Re);
|
|
22
22
|
return t === null ? e : t === "true";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const t =
|
|
24
|
+
function Ue(e) {
|
|
25
|
+
const t = j(dt((e == null ? void 0 : e.defaultEnabled) ?? !1));
|
|
26
26
|
return ae(
|
|
27
27
|
t,
|
|
28
|
-
(n) =>
|
|
28
|
+
(n) => ut(Re, n ? "true" : "false")
|
|
29
29
|
), {
|
|
30
30
|
enabled: t,
|
|
31
31
|
data: (e == null ? void 0 : e.data) ?? {},
|
|
@@ -33,17 +33,17 @@ function je(e) {
|
|
|
33
33
|
workflowInputId: e == null ? void 0 : e.workflowInputId,
|
|
34
34
|
auditUrl: e == null ? void 0 : e.auditUrl,
|
|
35
35
|
loading: (e == null ? void 0 : e.loading) ?? !1,
|
|
36
|
-
comparisonOpen:
|
|
36
|
+
comparisonOpen: j(!1)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return fe || (fe =
|
|
39
|
+
function Be() {
|
|
40
|
+
return fe || (fe = Ue()), fe;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
fe =
|
|
42
|
+
function Un(e) {
|
|
43
|
+
fe = Ue(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const e =
|
|
45
|
+
function pe() {
|
|
46
|
+
const e = Be();
|
|
47
47
|
return {
|
|
48
48
|
enabled: e.enabled,
|
|
49
49
|
data: e.data,
|
|
@@ -56,13 +56,13 @@ function me() {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function ct() {
|
|
60
|
+
return Be().comparisonOpen;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _e(e) {
|
|
63
63
|
return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const vt = {
|
|
66
66
|
high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
|
|
67
67
|
medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
|
|
68
68
|
low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
|
|
@@ -76,67 +76,67 @@ const ft = {
|
|
|
76
76
|
low: "Low",
|
|
77
77
|
unverifiable: "Unverifiable",
|
|
78
78
|
failed: "Failed"
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved :
|
|
79
|
+
}, Me = ["override", "extracted", "claim"];
|
|
80
|
+
function ke(e) {
|
|
81
|
+
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : ft(e.candidates) : { value: null, source: "none" };
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ft(e) {
|
|
84
84
|
if (e)
|
|
85
|
-
for (const t of
|
|
85
|
+
for (const t of Me) {
|
|
86
86
|
const n = e[t];
|
|
87
87
|
if (n != null)
|
|
88
88
|
return { value: n.value, source: t };
|
|
89
89
|
}
|
|
90
90
|
return { value: null, source: "none" };
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
var
|
|
94
|
-
const t = (
|
|
92
|
+
function xe(e) {
|
|
93
|
+
var w, b;
|
|
94
|
+
const t = (b = (w = e == null ? void 0 : e.candidates) == null ? void 0 : w.extracted) == null ? void 0 : b.reasoning;
|
|
95
95
|
if (t == null) return null;
|
|
96
96
|
const n = String(t).trim();
|
|
97
97
|
return n === "" ? null : n;
|
|
98
98
|
}
|
|
99
99
|
function Fe(e) {
|
|
100
|
-
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy :
|
|
100
|
+
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : gt(e.candidates) : !1;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function gt(e) {
|
|
103
103
|
if (!e) return !1;
|
|
104
|
-
const t =
|
|
104
|
+
const t = Me.map((n) => e[n]).filter((n) => n != null).map((n) => pt(n.value));
|
|
105
105
|
return t.length < 2 ? !1 : new Set(t).size > 1;
|
|
106
106
|
}
|
|
107
107
|
function pt(e) {
|
|
108
108
|
return JSON.stringify(e ?? null);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
function
|
|
110
|
+
const mt = /* @__PURE__ */ new Set(["name", "type"]);
|
|
111
|
+
function $e(e, t = "") {
|
|
112
112
|
const n = [];
|
|
113
|
-
return
|
|
113
|
+
return he(e, t, n), n;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function he(e, t, n) {
|
|
116
116
|
if (Array.isArray(e)) {
|
|
117
|
-
e.forEach((
|
|
117
|
+
e.forEach((c, r) => he(c, `${t}[${r}]`, n));
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (!
|
|
121
|
-
const
|
|
122
|
-
for (const [
|
|
123
|
-
if (
|
|
124
|
-
const l = t ? `${t}.${
|
|
125
|
-
if (Array.isArray(
|
|
126
|
-
|
|
120
|
+
if (!Te(e)) return;
|
|
121
|
+
const b = e.__meta ?? {};
|
|
122
|
+
for (const [c, r] of Object.entries(e)) {
|
|
123
|
+
if (c === "__meta") continue;
|
|
124
|
+
const l = t ? `${t}.${c}` : c;
|
|
125
|
+
if (Array.isArray(r) || Te(r)) {
|
|
126
|
+
he(r, l, n);
|
|
127
127
|
continue;
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
!
|
|
129
|
+
const _ = b[c];
|
|
130
|
+
!_ && mt.has(c) || n.push({
|
|
131
131
|
path: l,
|
|
132
|
-
label:
|
|
133
|
-
meta:
|
|
134
|
-
value:
|
|
135
|
-
unanchored: !
|
|
132
|
+
label: c,
|
|
133
|
+
meta: _ ?? null,
|
|
134
|
+
value: r,
|
|
135
|
+
unanchored: !_
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Te(e) {
|
|
140
140
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
141
141
|
}
|
|
142
142
|
function Ye(e) {
|
|
@@ -145,49 +145,49 @@ function Ye(e) {
|
|
|
145
145
|
const t = (n = e.candidates.extracted) == null ? void 0 : n.confidence;
|
|
146
146
|
return e.discrepancy || t == null || t <= 2;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const t =
|
|
150
|
-
(
|
|
148
|
+
function xt(e) {
|
|
149
|
+
const t = $e(e).filter(
|
|
150
|
+
(c) => c.meta !== null
|
|
151
151
|
), n = t.length;
|
|
152
|
-
let
|
|
153
|
-
for (const
|
|
154
|
-
if (
|
|
155
|
-
|
|
152
|
+
let w = 0, b = 0;
|
|
153
|
+
for (const c of t) {
|
|
154
|
+
if (c.meta.candidates.override) {
|
|
155
|
+
w++;
|
|
156
156
|
continue;
|
|
157
157
|
}
|
|
158
|
-
Ye(
|
|
158
|
+
Ye(c.meta) && b++;
|
|
159
159
|
}
|
|
160
160
|
return {
|
|
161
161
|
total: n,
|
|
162
|
-
verified:
|
|
163
|
-
needsReview:
|
|
164
|
-
percent: n === 0 ? 100 : Math.round(
|
|
162
|
+
verified: w,
|
|
163
|
+
needsReview: b,
|
|
164
|
+
percent: n === 0 ? 100 : Math.round(w / n * 100)
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function ht(e, t, n) {
|
|
168
|
-
var
|
|
169
|
-
const
|
|
170
|
-
if (!e.saveOverride || !
|
|
171
|
-
const
|
|
172
|
-
return async (
|
|
173
|
-
const
|
|
168
|
+
var c;
|
|
169
|
+
const w = (c = t.value) == null ? void 0 : c.anchor;
|
|
170
|
+
if (!e.saveOverride || !w) return null;
|
|
171
|
+
const b = e.saveOverride;
|
|
172
|
+
return async (r, l) => {
|
|
173
|
+
const _ = await b({
|
|
174
174
|
workflow_input_id: e.workflowInputId,
|
|
175
|
-
object_ids:
|
|
176
|
-
field:
|
|
177
|
-
field_path:
|
|
178
|
-
value:
|
|
175
|
+
object_ids: w.object_ids,
|
|
176
|
+
field: w.field,
|
|
177
|
+
field_path: w.field_path,
|
|
178
|
+
value: r,
|
|
179
179
|
source_choice: l
|
|
180
180
|
});
|
|
181
|
-
return n(
|
|
181
|
+
return n(_), _;
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const yt = ["data-status", "title"], bt = {
|
|
185
185
|
class: "tv-confidence-glyph",
|
|
186
186
|
"aria-hidden": "true"
|
|
187
|
-
},
|
|
187
|
+
}, wt = {
|
|
188
188
|
key: 0,
|
|
189
189
|
class: "tv-confidence-label"
|
|
190
|
-
}, ye = /* @__PURE__ */
|
|
190
|
+
}, ye = /* @__PURE__ */ Q({
|
|
191
191
|
__name: "ConfidenceIcon",
|
|
192
192
|
props: {
|
|
193
193
|
confidence: {},
|
|
@@ -195,9 +195,9 @@ const bt = ["data-status", "title"], wt = {
|
|
|
195
195
|
showLabel: { type: Boolean }
|
|
196
196
|
},
|
|
197
197
|
setup(e) {
|
|
198
|
-
const t = e, n =
|
|
199
|
-
() => t.status ??
|
|
200
|
-
),
|
|
198
|
+
const t = e, n = g(
|
|
199
|
+
() => t.status ?? _e(t.confidence)
|
|
200
|
+
), w = {
|
|
201
201
|
high: "✔",
|
|
202
202
|
// check
|
|
203
203
|
medium: "⚠",
|
|
@@ -207,29 +207,29 @@ const bt = ["data-status", "title"], wt = {
|
|
|
207
207
|
unverifiable: "?",
|
|
208
208
|
failed: "⊗"
|
|
209
209
|
// circled x — distinct from low's plain x
|
|
210
|
-
},
|
|
211
|
-
return (l,
|
|
212
|
-
class:
|
|
210
|
+
}, b = g(() => w[n.value]), c = g(() => vt[n.value]), r = g(() => G[n.value]);
|
|
211
|
+
return (l, _) => (a(), s("span", {
|
|
212
|
+
class: A(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", c.value]),
|
|
213
213
|
"data-status": n.value,
|
|
214
|
-
title:
|
|
214
|
+
title: r.value
|
|
215
215
|
}, [
|
|
216
|
-
o("span",
|
|
217
|
-
e.showLabel ? (a(), s("span",
|
|
218
|
-
], 10,
|
|
216
|
+
o("span", bt, i(b.value), 1),
|
|
217
|
+
e.showLabel ? (a(), s("span", wt, i(r.value), 1)) : p("", !0)
|
|
218
|
+
], 10, yt));
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
-
async function
|
|
222
|
-
const n = t.object_ids.at(-1),
|
|
221
|
+
async function _t(e, t) {
|
|
222
|
+
const n = t.object_ids.at(-1), w = new URLSearchParams({
|
|
223
223
|
object_id: String(n),
|
|
224
224
|
field: t.field
|
|
225
|
-
}),
|
|
226
|
-
if (!
|
|
225
|
+
}), b = e.includes("?") ? "&" : "?", c = await fetch(`${e}${b}${w}`);
|
|
226
|
+
if (!c.ok)
|
|
227
227
|
throw new Error(
|
|
228
|
-
`data-point-audit ${
|
|
228
|
+
`data-point-audit ${c.status}: ${await c.text()}`
|
|
229
229
|
);
|
|
230
|
-
return (await
|
|
230
|
+
return (await c.json()).data ?? [];
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const kt = "api_log", $t = "user", Ct = "failed_file", St = {
|
|
233
233
|
pages: [],
|
|
234
234
|
documents: [],
|
|
235
235
|
apiLogIds: [],
|
|
@@ -239,19 +239,19 @@ const $t = "api_log", Ct = "user", St = "failed_file", Vt = {
|
|
|
239
239
|
isEmpty: !0
|
|
240
240
|
};
|
|
241
241
|
function oe(e) {
|
|
242
|
-
var
|
|
243
|
-
if (!e || e.length === 0) return { ...
|
|
244
|
-
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(),
|
|
242
|
+
var r;
|
|
243
|
+
if (!e || e.length === 0) return { ...St };
|
|
244
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), w = [], b = [];
|
|
245
245
|
for (const l of e) {
|
|
246
|
-
if (l.source_type ===
|
|
247
|
-
|
|
246
|
+
if (l.source_type === Ct) {
|
|
247
|
+
b.push(l);
|
|
248
248
|
continue;
|
|
249
249
|
}
|
|
250
|
-
if (l.api_log_id !== void 0 && l.api_log_id !== null && (
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
|
|
254
|
-
key:
|
|
250
|
+
if (l.api_log_id !== void 0 && l.api_log_id !== null && (w.includes(l.api_log_id) || w.push(l.api_log_id)), l.source_type === kt || l.source_type === $t || !Vt(l)) continue;
|
|
251
|
+
const _ = Nt(l);
|
|
252
|
+
let f = t.get(_);
|
|
253
|
+
f || (f = {
|
|
254
|
+
key: _,
|
|
255
255
|
pageNumber: re(l),
|
|
256
256
|
label: "",
|
|
257
257
|
documentName: null,
|
|
@@ -261,58 +261,58 @@ function oe(e) {
|
|
|
261
261
|
quotes: [],
|
|
262
262
|
explanations: [],
|
|
263
263
|
sourceIds: []
|
|
264
|
-
}, t.set(
|
|
265
|
-
for (const
|
|
266
|
-
const
|
|
267
|
-
|
|
264
|
+
}, t.set(_, f)), !f.file && l.file && (f.file = Ot(l)), f.url || (f.url = ((r = l.file) == null ? void 0 : r.url) ?? l.file_url ?? null), !f.document && l.original_file && (f.document = l.original_file), f.pageNumber === null && (f.pageNumber = re(l)), l.id !== void 0 && l.id !== null && f.sourceIds.push(l.id);
|
|
265
|
+
for (const V of l.texts ?? []) {
|
|
266
|
+
const $ = String(V).trim();
|
|
267
|
+
$ && !f.quotes.includes($) && f.quotes.push($);
|
|
268
268
|
}
|
|
269
269
|
if (l.explanation) {
|
|
270
|
-
const
|
|
271
|
-
|
|
270
|
+
const V = String(l.explanation).trim();
|
|
271
|
+
V && !f.explanations.includes(V) && f.explanations.push(V);
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
f.documentName || (f.documentName = qt(l)), l.original_file && n.set(String(l.original_file.id), l.original_file);
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
for (const l of
|
|
277
|
-
return
|
|
278
|
-
pages:
|
|
275
|
+
const c = [...t.values()];
|
|
276
|
+
for (const l of c) l.label = It(l);
|
|
277
|
+
return c.sort(Dt), {
|
|
278
|
+
pages: c,
|
|
279
279
|
documents: [...n.values()],
|
|
280
|
-
apiLogIds:
|
|
281
|
-
unresolved:
|
|
282
|
-
pageCount:
|
|
283
|
-
quoteCount:
|
|
284
|
-
isEmpty:
|
|
280
|
+
apiLogIds: w,
|
|
281
|
+
unresolved: b,
|
|
282
|
+
pageCount: c.length,
|
|
283
|
+
quoteCount: c.reduce((l, _) => l + _.quotes.length, 0),
|
|
284
|
+
isEmpty: c.length === 0 && b.length === 0
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Vt(e) {
|
|
288
288
|
var t;
|
|
289
289
|
return !!(e.file || e.file_url || e.file_name || e.file_id !== void 0 || e.stored_file_id !== void 0 || re(e) !== null || (((t = e.texts) == null ? void 0 : t.length) ?? 0) > 0);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
var
|
|
293
|
-
const t = ((
|
|
291
|
+
function Nt(e) {
|
|
292
|
+
var w;
|
|
293
|
+
const t = ((w = e.file) == null ? void 0 : w.id) ?? e.stored_file_id ?? e.file_id ?? e.file_name, n = re(e);
|
|
294
294
|
return t != null ? n === null ? String(t) : `${t}#${n}` : n !== null ? `page-${n}` : `source-${e.id ?? "unknown"}`;
|
|
295
295
|
}
|
|
296
296
|
function re(e) {
|
|
297
297
|
const t = e.page ?? e.page_number;
|
|
298
298
|
return t == null ? null : Number(t);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function qt(e) {
|
|
301
301
|
var t;
|
|
302
302
|
return ((t = e.original_file) == null ? void 0 : t.name) ?? e.file_name ?? null;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Ot(e) {
|
|
305
305
|
const t = e.file, n = re(e);
|
|
306
306
|
return n === null || t.page_number != null ? t : { ...t, page_number: n };
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function It(e) {
|
|
309
309
|
var t;
|
|
310
310
|
return e.pageNumber !== null ? `Page ${e.pageNumber}` : (t = e.file) != null && t.name ? e.file.name : e.documentName ? e.documentName : "Cited source";
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Dt(e, t) {
|
|
313
313
|
return e.pageNumber === null && t.pageNumber === null ? 0 : e.pageNumber === null ? 1 : t.pageNumber === null ? -1 : e.pageNumber - t.pageNumber;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Ce(e) {
|
|
316
316
|
if (e.isEmpty) return "No citations recorded";
|
|
317
317
|
const t = [
|
|
318
318
|
`${e.pageCount} ${e.pageCount === 1 ? "page" : "pages"}`
|
|
@@ -327,90 +327,90 @@ function Ee(e) {
|
|
|
327
327
|
"*"
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
|
-
const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" },
|
|
330
|
+
const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, Et = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, Lt = {
|
|
331
331
|
key: 3,
|
|
332
332
|
class: "font-mono text-[11px] text-gray-400"
|
|
333
333
|
}, Pt = {
|
|
334
334
|
key: 4,
|
|
335
335
|
class: "text-[11px] font-medium text-gray-500"
|
|
336
|
-
},
|
|
336
|
+
}, At = {
|
|
337
337
|
key: 5,
|
|
338
338
|
class: "text-[11px] text-gray-400"
|
|
339
|
-
},
|
|
339
|
+
}, zt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, jt = /* @__PURE__ */ Q({
|
|
340
340
|
__name: "AuditCallCard",
|
|
341
341
|
props: {
|
|
342
342
|
call: {}
|
|
343
343
|
},
|
|
344
344
|
setup(e) {
|
|
345
|
-
const t = e, n =
|
|
345
|
+
const t = e, n = g(() => {
|
|
346
346
|
const l = t.call.status_code;
|
|
347
347
|
return l == null ? "muted" : l >= 200 && l < 300 ? "success" : l >= 400 ? "danger" : "warning";
|
|
348
|
-
}),
|
|
348
|
+
}), w = g(() => {
|
|
349
349
|
const l = t.call.run_time_ms;
|
|
350
350
|
return l == null ? null : l >= 1e3 ? `${(l / 1e3).toFixed(1)}s` : `${l}ms`;
|
|
351
|
-
}),
|
|
351
|
+
}), b = g(() => {
|
|
352
352
|
if (!t.call.started_at) return null;
|
|
353
353
|
const l = new Date(t.call.started_at);
|
|
354
354
|
return Number.isNaN(l.getTime()) ? t.call.started_at : l.toLocaleString();
|
|
355
|
-
}),
|
|
355
|
+
}), c = g(
|
|
356
356
|
() => JSON.stringify(t.call.request ?? null, null, 2)
|
|
357
|
-
),
|
|
357
|
+
), r = g(
|
|
358
358
|
() => JSON.stringify(t.call.response ?? null, null, 2)
|
|
359
359
|
);
|
|
360
|
-
return (l,
|
|
361
|
-
o("div",
|
|
362
|
-
e.call.stage ? (a(),
|
|
360
|
+
return (l, _) => (a(), s("div", Tt, [
|
|
361
|
+
o("div", Et, [
|
|
362
|
+
e.call.stage ? (a(), E(u(K), {
|
|
363
363
|
key: 0,
|
|
364
364
|
variant: "muted",
|
|
365
365
|
size: "xxs",
|
|
366
366
|
class: "tv-audit-stage"
|
|
367
367
|
}, {
|
|
368
|
-
default:
|
|
369
|
-
|
|
368
|
+
default: O(() => [
|
|
369
|
+
I(i(e.call.stage), 1)
|
|
370
370
|
]),
|
|
371
371
|
_: 1
|
|
372
|
-
})) :
|
|
373
|
-
e.call.model ? (a(),
|
|
372
|
+
})) : p("", !0),
|
|
373
|
+
e.call.model ? (a(), E(u(K), {
|
|
374
374
|
key: 1,
|
|
375
375
|
variant: "info",
|
|
376
376
|
size: "xs",
|
|
377
377
|
class: "tv-audit-model"
|
|
378
378
|
}, {
|
|
379
|
-
default:
|
|
380
|
-
|
|
379
|
+
default: O(() => [
|
|
380
|
+
I(i(e.call.model), 1)
|
|
381
381
|
]),
|
|
382
382
|
_: 1
|
|
383
|
-
})) :
|
|
384
|
-
e.call.service ? (a(),
|
|
383
|
+
})) : p("", !0),
|
|
384
|
+
e.call.service ? (a(), E(u(K), {
|
|
385
385
|
key: 2,
|
|
386
386
|
variant: "muted",
|
|
387
387
|
size: "xxs"
|
|
388
388
|
}, {
|
|
389
|
-
default:
|
|
390
|
-
|
|
389
|
+
default: O(() => [
|
|
390
|
+
I(i(e.call.service), 1)
|
|
391
391
|
]),
|
|
392
392
|
_: 1
|
|
393
|
-
})) :
|
|
394
|
-
e.call.endpoint ? (a(), s("span",
|
|
395
|
-
|
|
396
|
-
D(
|
|
393
|
+
})) : p("", !0),
|
|
394
|
+
e.call.endpoint ? (a(), s("span", Lt, i(e.call.endpoint), 1)) : p("", !0),
|
|
395
|
+
_[0] || (_[0] = o("span", { class: "flex-1" }, null, -1)),
|
|
396
|
+
D(u(K), {
|
|
397
397
|
variant: n.value,
|
|
398
398
|
size: "xxs",
|
|
399
399
|
class: "tv-audit-status"
|
|
400
400
|
}, {
|
|
401
|
-
default:
|
|
402
|
-
|
|
401
|
+
default: O(() => [
|
|
402
|
+
I(i(e.call.status_code ?? "…"), 1)
|
|
403
403
|
]),
|
|
404
404
|
_: 1
|
|
405
405
|
}, 8, ["variant"]),
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
w.value ? (a(), s("span", Pt, i(w.value), 1)) : p("", !0),
|
|
407
|
+
b.value ? (a(), s("span", At, i(b.value), 1)) : p("", !0)
|
|
408
408
|
]),
|
|
409
|
-
o("div",
|
|
409
|
+
o("div", zt, [
|
|
410
410
|
o("div", null, [
|
|
411
|
-
|
|
412
|
-
D(
|
|
413
|
-
"model-value":
|
|
411
|
+
_[1] || (_[1] = o("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
|
|
412
|
+
D(u(De), {
|
|
413
|
+
"model-value": c.value,
|
|
414
414
|
format: "json",
|
|
415
415
|
collapsible: "",
|
|
416
416
|
"default-collapsed": "",
|
|
@@ -418,9 +418,9 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
418
418
|
}, null, 8, ["model-value"])
|
|
419
419
|
]),
|
|
420
420
|
o("div", null, [
|
|
421
|
-
|
|
422
|
-
D(
|
|
423
|
-
"model-value":
|
|
421
|
+
_[2] || (_[2] = o("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
|
|
422
|
+
D(u(De), {
|
|
423
|
+
"model-value": r.value,
|
|
424
424
|
format: "json",
|
|
425
425
|
collapsible: "",
|
|
426
426
|
"default-collapsed": "",
|
|
@@ -430,16 +430,16 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
430
430
|
])
|
|
431
431
|
]));
|
|
432
432
|
}
|
|
433
|
-
}),
|
|
433
|
+
}), Rt = {
|
|
434
434
|
key: 0,
|
|
435
435
|
class: "tv-citation-thumb shrink-0"
|
|
436
|
-
},
|
|
436
|
+
}, Ut = { class: "tv-citation-quotes flex min-w-0 flex-1 flex-col gap-2" }, Bt = {
|
|
437
437
|
key: 0,
|
|
438
438
|
class: "tv-quote-list flex flex-col gap-2"
|
|
439
|
-
},
|
|
439
|
+
}, Mt = { class: "tv-quote-index mr-1 not-italic text-[10px] font-semibold text-amber-600" }, Ft = {
|
|
440
440
|
key: 1,
|
|
441
441
|
class: "tv-quote-empty rounded-md border border-dashed border-gray-200 px-3 py-2 text-xs text-gray-400"
|
|
442
|
-
},
|
|
442
|
+
}, Yt = { class: "tv-citation-actions mt-1 flex flex-wrap items-center gap-2" }, Le = /* @__PURE__ */ Q({
|
|
443
443
|
__name: "CitationPage",
|
|
444
444
|
props: {
|
|
445
445
|
page: {},
|
|
@@ -448,78 +448,144 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
448
448
|
emits: ["view", "document"],
|
|
449
449
|
setup(e, { emit: t }) {
|
|
450
450
|
const n = t;
|
|
451
|
-
return (
|
|
452
|
-
class:
|
|
451
|
+
return (w, b) => (a(), s("div", {
|
|
452
|
+
class: A(["tv-citation-page flex gap-4", e.dense ? "tv-citation-page-dense" : ""])
|
|
453
453
|
}, [
|
|
454
|
-
e.page.file ? (a(), s("div",
|
|
455
|
-
D(
|
|
454
|
+
e.page.file ? (a(), s("div", Rt, [
|
|
455
|
+
D(u(et), {
|
|
456
456
|
file: e.page.file,
|
|
457
457
|
size: e.dense ? "md" : "lg",
|
|
458
458
|
fit: "cover",
|
|
459
459
|
downloadable: "",
|
|
460
460
|
class: "cursor-zoom-in",
|
|
461
|
-
onClick:
|
|
461
|
+
onClick: b[0] || (b[0] = (c) => n("view"))
|
|
462
462
|
}, null, 8, ["file", "size"])
|
|
463
|
-
])) :
|
|
464
|
-
o("div",
|
|
463
|
+
])) : p("", !0),
|
|
464
|
+
o("div", Ut, [
|
|
465
465
|
e.page.quotes.length ? (a(), s("ol", Bt, [
|
|
466
|
-
(a(!0), s(
|
|
467
|
-
key:
|
|
466
|
+
(a(!0), s(U, null, F(e.page.quotes, (c, r) => (a(), s("li", {
|
|
467
|
+
key: r,
|
|
468
468
|
class: "tv-quote rounded-r-md border-l-[3px] border-amber-300 bg-amber-50/60 py-1.5 pl-3 pr-3 text-sm italic leading-relaxed text-gray-700"
|
|
469
469
|
}, [
|
|
470
|
-
o("span",
|
|
471
|
-
|
|
470
|
+
o("span", Mt, i(r + 1), 1),
|
|
471
|
+
I("“" + i(c) + "” ", 1)
|
|
472
472
|
]))), 128))
|
|
473
|
-
])) : (a(), s("p",
|
|
474
|
-
(a(!0), s(
|
|
475
|
-
key: `x${
|
|
473
|
+
])) : (a(), s("p", Ft, " This page was cited without a verbatim quote — the value was read from the page as a whole. ")),
|
|
474
|
+
(a(!0), s(U, null, F(e.page.explanations, (c, r) => (a(), s("p", {
|
|
475
|
+
key: `x${r}`,
|
|
476
476
|
class: "tv-citation-explanation text-xs text-gray-500"
|
|
477
|
-
}, i(
|
|
478
|
-
o("div",
|
|
479
|
-
e.page.file ? (a(),
|
|
477
|
+
}, i(c), 1))), 128)),
|
|
478
|
+
o("div", Yt, [
|
|
479
|
+
e.page.file ? (a(), E(u(ie), {
|
|
480
480
|
key: 0,
|
|
481
481
|
size: "xs",
|
|
482
482
|
variant: "info",
|
|
483
483
|
class: "tv-view-page",
|
|
484
|
-
onClick:
|
|
484
|
+
onClick: b[1] || (b[1] = (c) => n("view"))
|
|
485
485
|
}, {
|
|
486
|
-
default:
|
|
487
|
-
|
|
486
|
+
default: O(() => [...b[3] || (b[3] = [
|
|
487
|
+
I("View page full screen", -1)
|
|
488
488
|
])]),
|
|
489
489
|
_: 1
|
|
490
|
-
})) :
|
|
491
|
-
e.page.document ? (a(),
|
|
490
|
+
})) : p("", !0),
|
|
491
|
+
e.page.document ? (a(), E(u(ie), {
|
|
492
492
|
key: 1,
|
|
493
493
|
size: "xs",
|
|
494
494
|
variant: "muted",
|
|
495
495
|
class: "tv-open-document",
|
|
496
|
-
onClick:
|
|
496
|
+
onClick: b[2] || (b[2] = (c) => n("document"))
|
|
497
497
|
}, {
|
|
498
|
-
default:
|
|
499
|
-
|
|
498
|
+
default: O(() => [
|
|
499
|
+
I("Open " + i(e.page.document.name), 1)
|
|
500
500
|
]),
|
|
501
501
|
_: 1
|
|
502
|
-
})) :
|
|
502
|
+
})) : p("", !0)
|
|
503
503
|
])
|
|
504
504
|
])
|
|
505
505
|
], 2));
|
|
506
506
|
}
|
|
507
|
-
}),
|
|
507
|
+
}), Kt = { class: "tv-disclosure divide-y divide-gray-200" }, Ht = ["id", "aria-expanded", "aria-controls", "onClick"], Jt = { class: "min-w-0 flex-1" }, Gt = ["id", "aria-labelledby"], Ke = /* @__PURE__ */ Q({
|
|
508
|
+
__name: "TvDisclosure",
|
|
509
|
+
props: {
|
|
510
|
+
items: {},
|
|
511
|
+
modelValue: {},
|
|
512
|
+
idPrefix: { default: "tv-disclosure" }
|
|
513
|
+
},
|
|
514
|
+
emits: ["update:modelValue"],
|
|
515
|
+
setup(e, { emit: t }) {
|
|
516
|
+
const n = e, w = t, b = g(() => new Set(n.modelValue)), c = (f) => b.value.has(f);
|
|
517
|
+
function r(f) {
|
|
518
|
+
const V = new Set(b.value);
|
|
519
|
+
V.has(f) ? V.delete(f) : V.add(f), w("update:modelValue", [...V]);
|
|
520
|
+
}
|
|
521
|
+
const l = (f) => `${n.idPrefix}-h-${f}`, _ = (f) => `${n.idPrefix}-p-${f}`;
|
|
522
|
+
return (f, V) => (a(), s("div", Kt, [
|
|
523
|
+
(a(!0), s(U, null, F(e.items, ($) => (a(), s("div", {
|
|
524
|
+
key: $.value,
|
|
525
|
+
class: A(["tv-disclosure__item", c($.value) ? "is-open" : ""])
|
|
526
|
+
}, [
|
|
527
|
+
o("button", {
|
|
528
|
+
id: l($.value),
|
|
529
|
+
type: "button",
|
|
530
|
+
class: "tv-disclosure__header flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-gray-50",
|
|
531
|
+
"aria-expanded": c($.value),
|
|
532
|
+
"aria-controls": _($.value),
|
|
533
|
+
onClick: (L) => r($.value)
|
|
534
|
+
}, [
|
|
535
|
+
o("span", Jt, [
|
|
536
|
+
me(f.$slots, "header", {
|
|
537
|
+
item: $,
|
|
538
|
+
isOpen: c($.value)
|
|
539
|
+
}, () => [
|
|
540
|
+
I(i($.label), 1)
|
|
541
|
+
])
|
|
542
|
+
]),
|
|
543
|
+
(a(), s("svg", {
|
|
544
|
+
class: A(["tv-disclosure__chevron h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", c($.value) ? "rotate-180" : ""]),
|
|
545
|
+
viewBox: "0 0 20 20",
|
|
546
|
+
fill: "none",
|
|
547
|
+
"aria-hidden": "true"
|
|
548
|
+
}, [...V[0] || (V[0] = [
|
|
549
|
+
o("path", {
|
|
550
|
+
d: "M5 7.5 10 12.5 15 7.5",
|
|
551
|
+
stroke: "currentColor",
|
|
552
|
+
"stroke-width": "1.75",
|
|
553
|
+
"stroke-linecap": "round",
|
|
554
|
+
"stroke-linejoin": "round"
|
|
555
|
+
}, null, -1)
|
|
556
|
+
])], 2))
|
|
557
|
+
], 8, Ht),
|
|
558
|
+
c($.value) ? (a(), s("div", {
|
|
559
|
+
key: 0,
|
|
560
|
+
id: _($.value),
|
|
561
|
+
role: "region",
|
|
562
|
+
"aria-labelledby": l($.value),
|
|
563
|
+
class: "tv-disclosure__panel border-t border-gray-100 bg-gray-50/40 px-3 py-3"
|
|
564
|
+
}, [
|
|
565
|
+
me(f.$slots, "panel", {
|
|
566
|
+
item: $,
|
|
567
|
+
isOpen: !0
|
|
568
|
+
})
|
|
569
|
+
], 8, Gt)) : p("", !0)
|
|
570
|
+
], 2))), 128))
|
|
571
|
+
]));
|
|
572
|
+
}
|
|
573
|
+
}), Qt = { class: "tv-citation-list flex flex-col gap-2" }, Wt = {
|
|
508
574
|
key: 0,
|
|
509
575
|
class: "tv-citation-list-controls flex justify-end"
|
|
510
|
-
},
|
|
576
|
+
}, Xt = { class: "tv-citation-header flex min-w-0 flex-1 items-center gap-3 text-left" }, Zt = ["src", "alt"], ea = { class: "flex min-w-0 flex-1 flex-col" }, ta = { class: "flex flex-wrap items-center gap-2" }, aa = { class: "tv-citation-page-label text-sm font-semibold text-gray-900" }, na = {
|
|
511
577
|
key: 0,
|
|
512
578
|
class: "tv-citation-document-name truncate text-xs text-gray-400"
|
|
513
|
-
},
|
|
579
|
+
}, la = {
|
|
514
580
|
key: 0,
|
|
515
581
|
class: "tv-citation-preview truncate text-xs italic text-gray-500"
|
|
516
|
-
},
|
|
582
|
+
}, sa = { class: "tv-citation-header mb-2 flex flex-wrap items-center gap-2" }, oa = { class: "tv-citation-page-label text-sm font-semibold text-gray-900" }, ia = {
|
|
517
583
|
key: 0,
|
|
518
584
|
class: "tv-citation-document-name text-xs text-gray-400"
|
|
519
|
-
},
|
|
585
|
+
}, ra = { class: "tv-page-dialog flex h-full min-h-0 flex-col gap-3 lg:flex-row" }, ua = {
|
|
520
586
|
key: 0,
|
|
521
587
|
class: "tv-page-dialog-quotes max-h-40 shrink-0 overflow-y-auto rounded-lg border border-gray-200 bg-gray-50 p-3 lg:max-h-none lg:w-80"
|
|
522
|
-
},
|
|
588
|
+
}, da = { class: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, ca = { class: "flex flex-col gap-1.5" }, va = /* @__PURE__ */ Q({
|
|
523
589
|
__name: "CitationPageList",
|
|
524
590
|
props: {
|
|
525
591
|
pages: {},
|
|
@@ -527,165 +593,165 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
527
593
|
dense: { type: Boolean, default: !1 }
|
|
528
594
|
},
|
|
529
595
|
setup(e) {
|
|
530
|
-
const t = e, n =
|
|
531
|
-
() => t.pages.map((
|
|
532
|
-
),
|
|
596
|
+
const t = e, n = g(
|
|
597
|
+
() => t.pages.map((k) => ({ value: k.key, label: k.label }))
|
|
598
|
+
), w = j([]);
|
|
533
599
|
ae(
|
|
534
600
|
() => t.pages,
|
|
535
|
-
(
|
|
536
|
-
|
|
601
|
+
(k) => {
|
|
602
|
+
w.value = k.length ? [k[0].key] : [];
|
|
537
603
|
},
|
|
538
604
|
{ immediate: !0 }
|
|
539
605
|
);
|
|
540
|
-
const
|
|
541
|
-
() => t.pages.length > 0 &&
|
|
606
|
+
const b = g(
|
|
607
|
+
() => t.pages.length > 0 && w.value.length === t.pages.length
|
|
542
608
|
);
|
|
543
|
-
function
|
|
544
|
-
|
|
609
|
+
function c() {
|
|
610
|
+
w.value = b.value ? [] : t.pages.map((k) => k.key);
|
|
545
611
|
}
|
|
546
|
-
const
|
|
547
|
-
() => new Map(t.pages.map((
|
|
612
|
+
const r = g(
|
|
613
|
+
() => new Map(t.pages.map((k) => [k.key, k]))
|
|
548
614
|
);
|
|
549
|
-
function l(
|
|
550
|
-
const
|
|
551
|
-
return
|
|
615
|
+
function l(k) {
|
|
616
|
+
const T = k.quotes[0];
|
|
617
|
+
return T ? T.length > 96 ? `${T.slice(0, 96)}…` : T : "";
|
|
552
618
|
}
|
|
553
|
-
const
|
|
554
|
-
() => t.pages.map((
|
|
555
|
-
),
|
|
556
|
-
get: () =>
|
|
557
|
-
set: (
|
|
558
|
-
|
|
619
|
+
const _ = g(
|
|
620
|
+
() => t.pages.map((k) => k.file).filter((k) => !!k)
|
|
621
|
+
), f = j(null), V = j(!1), $ = j(null), L = g({
|
|
622
|
+
get: () => f.value !== null,
|
|
623
|
+
set: (k) => {
|
|
624
|
+
k || (f.value = null, $.value = null, V.value = !1);
|
|
559
625
|
}
|
|
560
|
-
}),
|
|
561
|
-
() =>
|
|
562
|
-
), d =
|
|
563
|
-
if (
|
|
564
|
-
const
|
|
565
|
-
return
|
|
566
|
-
(
|
|
626
|
+
}), S = g(
|
|
627
|
+
() => V.value ? [] : _.value
|
|
628
|
+
), d = g(() => {
|
|
629
|
+
if (V.value) return null;
|
|
630
|
+
const k = $.value ?? f.value;
|
|
631
|
+
return k ? t.pages.find(
|
|
632
|
+
(T) => T.file && String(T.file.id) === String(k.id)
|
|
567
633
|
) ?? null : null;
|
|
568
|
-
}), m =
|
|
569
|
-
if (!
|
|
570
|
-
if (
|
|
571
|
-
const
|
|
572
|
-
return
|
|
634
|
+
}), m = g(() => {
|
|
635
|
+
if (!f.value) return "";
|
|
636
|
+
if (V.value) return f.value.name;
|
|
637
|
+
const k = d.value;
|
|
638
|
+
return k ? k.documentName ? `${k.label} · ${k.documentName}` : k.label : f.value.name;
|
|
573
639
|
});
|
|
574
|
-
function
|
|
575
|
-
|
|
640
|
+
function h(k) {
|
|
641
|
+
k.file && (V.value = !1, $.value = k.file, f.value = k.file);
|
|
576
642
|
}
|
|
577
|
-
function B(
|
|
578
|
-
|
|
643
|
+
function B(k) {
|
|
644
|
+
k.document && (V.value = !0, $.value = null, f.value = k.document);
|
|
579
645
|
}
|
|
580
|
-
return (
|
|
581
|
-
e.collapsible && e.pages.length > 1 ? (a(), s("div",
|
|
582
|
-
D(
|
|
646
|
+
return (k, T) => (a(), s("div", Qt, [
|
|
647
|
+
e.collapsible && e.pages.length > 1 ? (a(), s("div", Wt, [
|
|
648
|
+
D(u(ie), {
|
|
583
649
|
size: "xxs",
|
|
584
650
|
variant: "muted",
|
|
585
651
|
class: "tv-toggle-all-pages",
|
|
586
|
-
onClick:
|
|
652
|
+
onClick: c
|
|
587
653
|
}, {
|
|
588
|
-
default:
|
|
589
|
-
|
|
654
|
+
default: O(() => [
|
|
655
|
+
I(i(b.value ? "Collapse all" : "Expand all"), 1)
|
|
590
656
|
]),
|
|
591
657
|
_: 1
|
|
592
658
|
})
|
|
593
|
-
])) :
|
|
594
|
-
e.collapsible ? (a(),
|
|
659
|
+
])) : p("", !0),
|
|
660
|
+
e.collapsible ? (a(), E(Ke, {
|
|
595
661
|
key: 1,
|
|
596
|
-
modelValue:
|
|
597
|
-
"onUpdate:modelValue":
|
|
662
|
+
modelValue: w.value,
|
|
663
|
+
"onUpdate:modelValue": T[0] || (T[0] = (N) => w.value = N),
|
|
598
664
|
items: n.value,
|
|
599
|
-
|
|
600
|
-
class: "tv-citation-accordion rounded-lg border border-gray-200"
|
|
665
|
+
"id-prefix": "tv-citation",
|
|
666
|
+
class: "tv-citation-accordion overflow-hidden rounded-lg border border-gray-200"
|
|
601
667
|
}, {
|
|
602
|
-
header:
|
|
603
|
-
var
|
|
668
|
+
header: O(({ item: N, isOpen: M }) => {
|
|
669
|
+
var H, J, Y, X, y;
|
|
604
670
|
return [
|
|
605
|
-
o("span",
|
|
606
|
-
(
|
|
671
|
+
o("span", Xt, [
|
|
672
|
+
(J = (H = r.value.get(N.value)) == null ? void 0 : H.file) != null && J.url ? (a(), s("img", {
|
|
607
673
|
key: 0,
|
|
608
|
-
src:
|
|
609
|
-
alt:
|
|
674
|
+
src: r.value.get(N.value).file.url,
|
|
675
|
+
alt: r.value.get(N.value).label,
|
|
610
676
|
class: "tv-citation-header-thumb h-10 w-8 shrink-0 rounded border border-gray-200 object-cover",
|
|
611
677
|
loading: "lazy"
|
|
612
|
-
}, null, 8,
|
|
613
|
-
o("span",
|
|
614
|
-
o("span",
|
|
615
|
-
o("span",
|
|
616
|
-
(
|
|
617
|
-
D(
|
|
678
|
+
}, null, 8, Zt)) : p("", !0),
|
|
679
|
+
o("span", ea, [
|
|
680
|
+
o("span", ta, [
|
|
681
|
+
o("span", aa, i((Y = r.value.get(N.value)) == null ? void 0 : Y.label), 1),
|
|
682
|
+
(X = r.value.get(N.value)) != null && X.documentName ? (a(), s("span", na, i((y = r.value.get(N.value)) == null ? void 0 : y.documentName), 1)) : p("", !0),
|
|
683
|
+
D(u(K), {
|
|
618
684
|
variant: "warning",
|
|
619
685
|
size: "xxs",
|
|
620
686
|
class: "tv-citation-quote-count"
|
|
621
687
|
}, {
|
|
622
|
-
default:
|
|
623
|
-
var
|
|
688
|
+
default: O(() => {
|
|
689
|
+
var q, P;
|
|
624
690
|
return [
|
|
625
|
-
|
|
691
|
+
I(i((q = r.value.get(N.value)) == null ? void 0 : q.quotes.length) + " " + i(((P = r.value.get(N.value)) == null ? void 0 : P.quotes.length) === 1 ? "quote" : "quotes"), 1)
|
|
626
692
|
];
|
|
627
693
|
}),
|
|
628
694
|
_: 2
|
|
629
695
|
}, 1024)
|
|
630
696
|
]),
|
|
631
|
-
l(
|
|
697
|
+
!M && l(r.value.get(N.value)) ? (a(), s("span", la, "“" + i(l(r.value.get(N.value))) + "”", 1)) : p("", !0)
|
|
632
698
|
])
|
|
633
699
|
])
|
|
634
700
|
];
|
|
635
701
|
}),
|
|
636
|
-
panel:
|
|
637
|
-
D(
|
|
638
|
-
page:
|
|
702
|
+
panel: O(({ item: N }) => [
|
|
703
|
+
D(Le, {
|
|
704
|
+
page: r.value.get(N.value),
|
|
639
705
|
dense: e.dense,
|
|
640
|
-
onView: (
|
|
641
|
-
onDocument: (
|
|
706
|
+
onView: (M) => h(r.value.get(N.value)),
|
|
707
|
+
onDocument: (M) => B(r.value.get(N.value))
|
|
642
708
|
}, null, 8, ["page", "dense", "onView", "onDocument"])
|
|
643
709
|
]),
|
|
644
710
|
_: 1
|
|
645
|
-
}, 8, ["modelValue", "items"])) : (a(!0), s(
|
|
646
|
-
key:
|
|
711
|
+
}, 8, ["modelValue", "items"])) : (a(!0), s(U, { key: 2 }, F(e.pages, (N) => (a(), s("div", {
|
|
712
|
+
key: N.key,
|
|
647
713
|
class: "tv-citation-flat rounded-lg border border-gray-200 p-3"
|
|
648
714
|
}, [
|
|
649
|
-
o("div",
|
|
650
|
-
o("span",
|
|
651
|
-
|
|
652
|
-
D(
|
|
715
|
+
o("div", sa, [
|
|
716
|
+
o("span", oa, i(N.label), 1),
|
|
717
|
+
N.documentName ? (a(), s("span", ia, i(N.documentName), 1)) : p("", !0),
|
|
718
|
+
D(u(K), {
|
|
653
719
|
variant: "warning",
|
|
654
720
|
size: "xxs",
|
|
655
721
|
class: "tv-citation-quote-count"
|
|
656
722
|
}, {
|
|
657
|
-
default:
|
|
658
|
-
|
|
723
|
+
default: O(() => [
|
|
724
|
+
I(i(N.quotes.length) + " " + i(N.quotes.length === 1 ? "quote" : "quotes"), 1)
|
|
659
725
|
]),
|
|
660
726
|
_: 2
|
|
661
727
|
}, 1024)
|
|
662
728
|
]),
|
|
663
|
-
D(
|
|
664
|
-
page:
|
|
729
|
+
D(Le, {
|
|
730
|
+
page: N,
|
|
665
731
|
dense: e.dense,
|
|
666
|
-
onView: (
|
|
667
|
-
onDocument: (
|
|
732
|
+
onView: (M) => h(N),
|
|
733
|
+
onDocument: (M) => B(N)
|
|
668
734
|
}, null, 8, ["page", "dense", "onView", "onDocument"])
|
|
669
735
|
]))), 128)),
|
|
670
|
-
|
|
736
|
+
f.value ? (a(), E(u(be), {
|
|
671
737
|
key: 3,
|
|
672
738
|
modelValue: L.value,
|
|
673
|
-
"onUpdate:modelValue":
|
|
739
|
+
"onUpdate:modelValue": T[2] || (T[2] = (N) => L.value = N),
|
|
674
740
|
title: m.value,
|
|
675
741
|
width: 95,
|
|
676
742
|
height: 95,
|
|
677
743
|
"close-x": "",
|
|
678
|
-
class:
|
|
744
|
+
class: A(u(W))
|
|
679
745
|
}, {
|
|
680
|
-
default:
|
|
681
|
-
var
|
|
746
|
+
default: O(() => {
|
|
747
|
+
var N;
|
|
682
748
|
return [
|
|
683
|
-
o("div",
|
|
684
|
-
D(
|
|
685
|
-
file:
|
|
686
|
-
"file-in-preview":
|
|
687
|
-
"onUpdate:fileInPreview":
|
|
688
|
-
"related-files":
|
|
749
|
+
o("div", ra, [
|
|
750
|
+
D(u(tt), {
|
|
751
|
+
file: f.value,
|
|
752
|
+
"file-in-preview": $.value,
|
|
753
|
+
"onUpdate:fileInPreview": T[1] || (T[1] = (M) => $.value = M),
|
|
754
|
+
"related-files": S.value,
|
|
689
755
|
"layout-toggles": ["sidebar", "continuous"],
|
|
690
756
|
downloadable: "",
|
|
691
757
|
zoomable: "",
|
|
@@ -693,32 +759,32 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
693
759
|
"storage-key": "tv-page-viewer",
|
|
694
760
|
class: "tv-page-viewer min-h-[22rem] min-w-0 flex-1"
|
|
695
761
|
}, null, 8, ["file", "file-in-preview", "related-files"]),
|
|
696
|
-
(
|
|
697
|
-
o("div",
|
|
698
|
-
o("ol",
|
|
699
|
-
(a(!0), s(
|
|
762
|
+
(N = d.value) != null && N.quotes.length ? (a(), s("aside", ua, [
|
|
763
|
+
o("div", da, " Quoted from " + i(d.value.label), 1),
|
|
764
|
+
o("ol", ca, [
|
|
765
|
+
(a(!0), s(U, null, F(d.value.quotes, (M, H) => (a(), s("li", {
|
|
700
766
|
key: H,
|
|
701
767
|
class: "tv-quote rounded-r-md border-l-[3px] border-amber-300 bg-amber-50/70 py-1.5 pl-3 pr-2 text-sm italic leading-relaxed text-gray-700"
|
|
702
|
-
}, " “" + i(
|
|
768
|
+
}, " “" + i(M) + "” ", 1))), 128))
|
|
703
769
|
])
|
|
704
|
-
])) :
|
|
770
|
+
])) : p("", !0)
|
|
705
771
|
])
|
|
706
772
|
];
|
|
707
773
|
}),
|
|
708
774
|
_: 1
|
|
709
|
-
}, 8, ["modelValue", "title", "class"])) :
|
|
775
|
+
}, 8, ["modelValue", "title", "class"])) : p("", !0)
|
|
710
776
|
]));
|
|
711
777
|
}
|
|
712
|
-
}),
|
|
778
|
+
}), fa = { class: "tv-evidence flex flex-col gap-4" }, ga = {
|
|
713
779
|
key: 1,
|
|
714
780
|
class: "tv-reasoning-card rounded-lg border border-gray-200 bg-white p-3"
|
|
715
|
-
},
|
|
781
|
+
}, pa = { class: "mb-1 flex flex-wrap items-center justify-between gap-2" }, ma = { class: "tv-reasoning text-sm leading-relaxed text-gray-700" }, xa = { class: "tv-cited-sources flex min-w-0 flex-col gap-2" }, ha = { class: "flex flex-wrap items-baseline justify-between gap-2" }, ya = { class: "tv-citation-summary text-xs text-gray-500" }, ba = {
|
|
716
782
|
key: 1,
|
|
717
783
|
class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
718
|
-
},
|
|
784
|
+
}, wa = {
|
|
719
785
|
key: 2,
|
|
720
786
|
class: "tv-llm-provenance text-xs text-gray-400"
|
|
721
|
-
},
|
|
787
|
+
}, _a = { class: "tv-llm-call-ids font-medium text-gray-500" }, Pe = /* @__PURE__ */ Q({
|
|
722
788
|
__name: "CitationEvidence",
|
|
723
789
|
props: {
|
|
724
790
|
evidence: {},
|
|
@@ -729,112 +795,107 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
729
795
|
dense: { type: Boolean, default: !1 }
|
|
730
796
|
},
|
|
731
797
|
setup(e) {
|
|
732
|
-
return (t, n) => (a(), s("div",
|
|
733
|
-
e.failed && e.reasoning ? (a(),
|
|
798
|
+
return (t, n) => (a(), s("div", fa, [
|
|
799
|
+
e.failed && e.reasoning ? (a(), E(u(ge), {
|
|
734
800
|
key: 0,
|
|
735
801
|
variant: "danger",
|
|
736
802
|
class: "tv-evidence-failed"
|
|
737
803
|
}, {
|
|
738
|
-
default:
|
|
739
|
-
|
|
804
|
+
default: O(() => [
|
|
805
|
+
I(i(e.reasoning), 1)
|
|
740
806
|
]),
|
|
741
807
|
_: 1
|
|
742
|
-
})) : e.reasoning ? (a(), s("section",
|
|
743
|
-
o("div",
|
|
808
|
+
})) : e.reasoning ? (a(), s("section", ga, [
|
|
809
|
+
o("div", pa, [
|
|
744
810
|
n[0] || (n[0] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Why this value ", -1)),
|
|
745
|
-
e.basis ? (a(),
|
|
811
|
+
e.basis ? (a(), E(u(we), {
|
|
746
812
|
key: 0,
|
|
747
813
|
tooltip: e.basis === "inferred" ? "The value was derived from the quotes below — computed, reformatted, or reasoned — rather than appearing as-is." : "The stored value appears word-for-word inside the quotes below, checked against the source document at store time.",
|
|
748
814
|
placement: "top"
|
|
749
815
|
}, {
|
|
750
|
-
trigger:
|
|
751
|
-
D(
|
|
816
|
+
trigger: O(() => [
|
|
817
|
+
D(u(K), {
|
|
752
818
|
variant: e.basis === "inferred" ? "muted" : "success",
|
|
753
819
|
size: "xxs",
|
|
754
820
|
class: "tv-basis-chip"
|
|
755
821
|
}, {
|
|
756
|
-
default:
|
|
757
|
-
|
|
822
|
+
default: O(() => [
|
|
823
|
+
I(i(e.basis === "inferred" ? "inferred from quotes" : "✔ verbatim quote"), 1)
|
|
758
824
|
]),
|
|
759
825
|
_: 1
|
|
760
826
|
}, 8, ["variant"])
|
|
761
827
|
]),
|
|
762
828
|
_: 1
|
|
763
|
-
}, 8, ["tooltip"])) :
|
|
829
|
+
}, 8, ["tooltip"])) : p("", !0)
|
|
764
830
|
]),
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
class: "tv-reasoning"
|
|
770
|
-
}, null, 8, ["model-value"])
|
|
771
|
-
])) : f("", !0),
|
|
772
|
-
o("section", fa, [
|
|
773
|
-
o("div", ga, [
|
|
831
|
+
o("p", ma, i(e.reasoning), 1)
|
|
832
|
+
])) : p("", !0),
|
|
833
|
+
o("section", xa, [
|
|
834
|
+
o("div", ha, [
|
|
774
835
|
n[1] || (n[1] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Cited sources ", -1)),
|
|
775
|
-
o("div",
|
|
836
|
+
o("div", ya, i(u(Ce)(e.evidence)), 1)
|
|
776
837
|
]),
|
|
777
|
-
e.evidence.pages.length ? (a(),
|
|
838
|
+
e.evidence.pages.length ? (a(), E(va, {
|
|
778
839
|
key: 0,
|
|
779
840
|
pages: e.evidence.pages,
|
|
780
841
|
collapsible: e.collapsible,
|
|
781
842
|
dense: e.dense
|
|
782
|
-
}, null, 8, ["pages", "collapsible", "dense"])) : e.evidence.unresolved.length ?
|
|
783
|
-
e.evidence.unresolved.length ? (a(),
|
|
843
|
+
}, null, 8, ["pages", "collapsible", "dense"])) : e.evidence.unresolved.length ? p("", !0) : (a(), s("p", ba, " No source pages recorded for this data point ")),
|
|
844
|
+
e.evidence.unresolved.length ? (a(), E(u(ge), {
|
|
784
845
|
key: 2,
|
|
785
846
|
variant: "warning",
|
|
786
847
|
class: "tv-unresolved-citations"
|
|
787
848
|
}, {
|
|
788
|
-
default:
|
|
789
|
-
|
|
849
|
+
default: O(() => [
|
|
850
|
+
I(i(e.evidence.unresolved.length) + " " + i(e.evidence.unresolved.length === 1 ? "citation" : "citations") + " could not be matched to a page in the source documents. The value was kept, but this part of its provenance is unverified. ", 1)
|
|
790
851
|
]),
|
|
791
852
|
_: 1
|
|
792
|
-
})) :
|
|
853
|
+
})) : p("", !0)
|
|
793
854
|
]),
|
|
794
|
-
e.evidence.apiLogIds.length ? (a(), s("p",
|
|
795
|
-
|
|
796
|
-
o("span",
|
|
797
|
-
n[2] || (n[2] =
|
|
798
|
-
])) :
|
|
855
|
+
e.evidence.apiLogIds.length ? (a(), s("p", wa, [
|
|
856
|
+
I(" Produced by " + i(e.evidence.apiLogIds.length === 1 ? "LLM call" : "LLM calls") + " ", 1),
|
|
857
|
+
o("span", _a, "#" + i(e.evidence.apiLogIds.join(", #")), 1),
|
|
858
|
+
n[2] || (n[2] = I(" — open the Audit trail tab for the full request and response. ", -1))
|
|
859
|
+
])) : p("", !0)
|
|
799
860
|
]));
|
|
800
861
|
}
|
|
801
|
-
}),
|
|
862
|
+
}), ka = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, $a = { class: "tv-modal-resolved flex flex-col gap-3 rounded-xl border border-gray-200 bg-gradient-to-br from-gray-50 to-white p-4 shadow-sm" }, Ca = { class: "flex flex-wrap items-start justify-between gap-4" }, Sa = { class: "min-w-0 flex-1" }, Va = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, Na = { class: "mt-1 text-[11px] text-gray-400" }, qa = { class: "tv-resolved-source font-medium text-gray-500" }, Oa = { class: "tv-confidence-meter w-56 shrink-0" }, Ia = { class: "mt-2" }, Da = {
|
|
802
863
|
key: 1,
|
|
803
864
|
class: "tv-confidence-value text-sm text-gray-400"
|
|
804
|
-
},
|
|
865
|
+
}, Ta = {
|
|
805
866
|
key: 0,
|
|
806
867
|
class: "tv-tab-evidence flex min-h-0 flex-1 flex-col"
|
|
807
|
-
},
|
|
868
|
+
}, Ea = {
|
|
808
869
|
key: 1,
|
|
809
870
|
class: "tv-tab-candidates flex flex-col gap-3"
|
|
810
|
-
},
|
|
871
|
+
}, La = { class: "flex flex-wrap items-center justify-between gap-3" }, Pa = { class: "min-w-0 flex-1" }, Aa = { class: "flex items-center gap-2" }, za = { class: "mt-2 break-words font-mono text-base text-gray-900" }, ja = { class: "mt-1 text-xs text-gray-400" }, Ra = {
|
|
811
872
|
key: 0,
|
|
812
873
|
class: "tv-custom-entry flex items-center gap-2 rounded-lg border border-dashed border-gray-300 p-4"
|
|
813
|
-
},
|
|
874
|
+
}, Ua = {
|
|
814
875
|
key: 1,
|
|
815
876
|
class: "tv-read-only text-center text-xs text-gray-400"
|
|
816
|
-
},
|
|
877
|
+
}, Ba = {
|
|
817
878
|
key: 2,
|
|
818
879
|
class: "tv-tab-history flex flex-col gap-4"
|
|
819
|
-
},
|
|
880
|
+
}, Ma = { class: "tv-history-current flex flex-col gap-2 rounded-xl border border-green-200 bg-green-50/40 p-4" }, Fa = { class: "flex flex-wrap items-center justify-between gap-3" }, Ya = { class: "flex flex-wrap items-center gap-2" }, Ka = { class: "tv-history-current-value break-words font-mono text-base font-semibold text-gray-900" }, Ha = {
|
|
820
881
|
key: 0,
|
|
821
882
|
class: "tv-history-current-confidence text-xs font-medium text-gray-500"
|
|
822
|
-
},
|
|
883
|
+
}, Ja = {
|
|
823
884
|
key: 1,
|
|
824
885
|
class: "tv-history-current-confidence text-xs text-gray-400"
|
|
825
|
-
},
|
|
886
|
+
}, Ga = {
|
|
826
887
|
key: 0,
|
|
827
888
|
class: "tv-history-current-reasoning text-sm italic leading-relaxed text-gray-600"
|
|
828
|
-
},
|
|
889
|
+
}, Qa = { class: "tv-history-value min-w-0 break-words font-mono text-sm font-semibold text-gray-900" }, Wa = {
|
|
829
890
|
key: 2,
|
|
830
891
|
class: "tv-history-confidence text-xs text-gray-500"
|
|
831
|
-
},
|
|
892
|
+
}, Xa = { class: "tv-history-provenance text-xs text-gray-400" }, Za = { class: "tv-history-timestamp ml-auto text-xs text-gray-400" }, en = {
|
|
832
893
|
key: 3,
|
|
833
894
|
class: "tv-tab-audit flex flex-col gap-3"
|
|
834
|
-
},
|
|
895
|
+
}, tn = {
|
|
835
896
|
key: 2,
|
|
836
897
|
class: "tv-audit-empty rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
837
|
-
},
|
|
898
|
+
}, an = /* @__PURE__ */ Q({
|
|
838
899
|
__name: "VerificationModal",
|
|
839
900
|
props: {
|
|
840
901
|
modelValue: { type: Boolean },
|
|
@@ -844,34 +905,34 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
844
905
|
},
|
|
845
906
|
emits: ["update:modelValue", "saved"],
|
|
846
907
|
setup(e, { emit: t }) {
|
|
847
|
-
const n = e,
|
|
908
|
+
const n = e, w = t, b = pe(), c = Ae(), r = g({
|
|
848
909
|
get: () => n.modelValue,
|
|
849
|
-
set: (
|
|
850
|
-
}), l =
|
|
851
|
-
var
|
|
852
|
-
return ((
|
|
853
|
-
}), L =
|
|
854
|
-
var
|
|
855
|
-
return ((
|
|
856
|
-
}),
|
|
857
|
-
var
|
|
858
|
-
return oe((
|
|
859
|
-
}), m =
|
|
910
|
+
set: (v) => w("update:modelValue", v)
|
|
911
|
+
}), l = g(() => ke(n.meta)), _ = g(() => n.meta.candidates.extracted), f = g(() => n.meta.candidates.claim), V = g(() => n.meta.candidates.override), $ = g(() => {
|
|
912
|
+
var v;
|
|
913
|
+
return ((v = _.value) == null ? void 0 : v.confidence) ?? null;
|
|
914
|
+
}), L = g(() => {
|
|
915
|
+
var v;
|
|
916
|
+
return ((v = _.value) == null ? void 0 : v.state) === "failed" ? "failed" : _e($.value);
|
|
917
|
+
}), S = g(() => xe(n.meta)), d = g(() => {
|
|
918
|
+
var v;
|
|
919
|
+
return oe((v = _.value) == null ? void 0 : v.sources);
|
|
920
|
+
}), m = g(
|
|
860
921
|
() => {
|
|
861
|
-
var
|
|
862
|
-
return ((
|
|
922
|
+
var v;
|
|
923
|
+
return ((v = _.value) == null ? void 0 : v.history) ?? [];
|
|
863
924
|
}
|
|
864
|
-
),
|
|
865
|
-
(
|
|
866
|
-
).join(" › ")),
|
|
925
|
+
), h = g(() => m.value.length > 0), B = g(() => (n.meta.anchor.field_path || n.label || "Data point").split(".").map(
|
|
926
|
+
(x) => x.replace(/\[\d+\]/g, "").replace(/_/g, " ").replace(/^\w/, (z) => z.toUpperCase())
|
|
927
|
+
).join(" › ")), k = {
|
|
867
928
|
high: "success",
|
|
868
929
|
medium: "warning",
|
|
869
930
|
low: "danger",
|
|
870
931
|
unverifiable: "muted",
|
|
871
932
|
failed: "danger"
|
|
872
|
-
},
|
|
873
|
-
var
|
|
874
|
-
const
|
|
933
|
+
}, T = j("evidence"), N = g(() => !!b.auditUrl), M = g(() => {
|
|
934
|
+
var x;
|
|
935
|
+
const v = [
|
|
875
936
|
{
|
|
876
937
|
value: "evidence",
|
|
877
938
|
label: "Citations",
|
|
@@ -883,267 +944,267 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
883
944
|
count: H.value.length
|
|
884
945
|
}
|
|
885
946
|
];
|
|
886
|
-
return
|
|
947
|
+
return h.value && v.push({
|
|
887
948
|
value: "history",
|
|
888
949
|
label: "History",
|
|
889
950
|
count: m.value.length
|
|
890
|
-
}),
|
|
951
|
+
}), N.value && v.push({
|
|
891
952
|
value: "audit",
|
|
892
953
|
label: "Audit trail",
|
|
893
|
-
count: ((
|
|
894
|
-
}),
|
|
954
|
+
count: ((x = ee.value) == null ? void 0 : x.length) ?? void 0
|
|
955
|
+
}), v;
|
|
895
956
|
});
|
|
896
957
|
ae(
|
|
897
|
-
|
|
898
|
-
(
|
|
958
|
+
r,
|
|
959
|
+
(v) => Ee(v),
|
|
899
960
|
{ immediate: !0 }
|
|
900
|
-
),
|
|
901
|
-
const H =
|
|
902
|
-
const
|
|
903
|
-
return
|
|
961
|
+
), Qe(() => Ee(!1));
|
|
962
|
+
const H = g(() => {
|
|
963
|
+
const v = [];
|
|
964
|
+
return V.value && v.push({
|
|
904
965
|
key: "override",
|
|
905
966
|
title: "Human override",
|
|
906
967
|
variant: "success",
|
|
907
|
-
value:
|
|
968
|
+
value: V.value.value,
|
|
908
969
|
detail: [
|
|
909
|
-
|
|
910
|
-
|
|
970
|
+
V.value.source_choice ? `basis: ${V.value.source_choice}` : null,
|
|
971
|
+
V.value.set_at ? new Date(V.value.set_at).toLocaleString() : null
|
|
911
972
|
].filter(Boolean).join(" · "),
|
|
912
973
|
winner: l.value.source === "override"
|
|
913
|
-
}),
|
|
974
|
+
}), _.value && v.push({
|
|
914
975
|
key: "extracted",
|
|
915
976
|
title: "Extracted",
|
|
916
|
-
variant:
|
|
917
|
-
value:
|
|
918
|
-
detail: L.value === "failed" ?
|
|
977
|
+
variant: k[L.value],
|
|
978
|
+
value: _.value.value,
|
|
979
|
+
detail: L.value === "failed" ? _.value.reasoning ? `${G.failed}: ${_.value.reasoning}` : G.failed : $.value != null ? `Confidence ${$.value}/5 · ${G[L.value]}` : "No confidence recorded",
|
|
919
980
|
accept: n.save ? () => {
|
|
920
|
-
var
|
|
921
|
-
return X(
|
|
981
|
+
var x;
|
|
982
|
+
return X(q((x = _.value) == null ? void 0 : x.value), "extracted");
|
|
922
983
|
} : void 0,
|
|
923
984
|
winner: l.value.source === "extracted"
|
|
924
|
-
}),
|
|
985
|
+
}), f.value && v.push({
|
|
925
986
|
key: "claim",
|
|
926
987
|
title: "Claim",
|
|
927
988
|
variant: "info",
|
|
928
|
-
value:
|
|
929
|
-
detail:
|
|
989
|
+
value: f.value.value,
|
|
990
|
+
detail: f.value.claim_set_label ?? "Reference output",
|
|
930
991
|
accept: n.save ? () => {
|
|
931
|
-
var
|
|
932
|
-
return X(
|
|
992
|
+
var x;
|
|
993
|
+
return X(q((x = f.value) == null ? void 0 : x.value), "claim");
|
|
933
994
|
} : void 0,
|
|
934
995
|
winner: l.value.source === "claim"
|
|
935
|
-
}),
|
|
936
|
-
}), J =
|
|
937
|
-
async function X(
|
|
996
|
+
}), v;
|
|
997
|
+
}), J = j(""), Y = j(!1);
|
|
998
|
+
async function X(v, x) {
|
|
938
999
|
if (!(!n.save || Y.value)) {
|
|
939
1000
|
Y.value = !0;
|
|
940
1001
|
try {
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
} catch (
|
|
944
|
-
console.error("template-verification: save failed",
|
|
1002
|
+
const z = await n.save(v, x);
|
|
1003
|
+
w("saved", z), c.success(`Verified — ${B.value} locked in`);
|
|
1004
|
+
} catch (z) {
|
|
1005
|
+
console.error("template-verification: save failed", z), c.danger(`Could not save ${B.value} — try again`);
|
|
945
1006
|
} finally {
|
|
946
1007
|
Y.value = !1;
|
|
947
1008
|
}
|
|
948
1009
|
}
|
|
949
1010
|
}
|
|
950
1011
|
const y = () => X(J.value, "custom");
|
|
951
|
-
function
|
|
952
|
-
return
|
|
1012
|
+
function q(v) {
|
|
1013
|
+
return v == null ? null : String(v);
|
|
953
1014
|
}
|
|
954
|
-
function
|
|
955
|
-
return
|
|
1015
|
+
function P(v) {
|
|
1016
|
+
return v == null ? "—" : String(v);
|
|
956
1017
|
}
|
|
957
|
-
const Z = (
|
|
958
|
-
() => m.value.map((
|
|
959
|
-
value: Z(
|
|
960
|
-
label:
|
|
1018
|
+
const Z = (v, x) => String(v.id ?? `attempt-${x}`), ue = g(
|
|
1019
|
+
() => m.value.map((v, x) => ({
|
|
1020
|
+
value: Z(v, x),
|
|
1021
|
+
label: P(v.value)
|
|
961
1022
|
}))
|
|
962
|
-
), te =
|
|
1023
|
+
), te = j([]);
|
|
963
1024
|
ae(
|
|
964
1025
|
m,
|
|
965
|
-
(
|
|
966
|
-
const
|
|
967
|
-
te.value =
|
|
1026
|
+
(v) => {
|
|
1027
|
+
const x = v.findIndex((C) => C.is_chosen), z = x === -1 ? v.length - 1 : x;
|
|
1028
|
+
te.value = z >= 0 ? [Z(v[z], z)] : [];
|
|
968
1029
|
},
|
|
969
1030
|
{ immediate: !0 }
|
|
970
1031
|
);
|
|
971
|
-
const
|
|
1032
|
+
const R = g(
|
|
972
1033
|
() => new Map(
|
|
973
|
-
m.value.map((
|
|
1034
|
+
m.value.map((v, x) => [Z(v, x), v])
|
|
974
1035
|
)
|
|
975
1036
|
);
|
|
976
|
-
function
|
|
977
|
-
return
|
|
1037
|
+
function He(v) {
|
|
1038
|
+
return v.created_at ? new Date(v.created_at).toLocaleString() : "—";
|
|
978
1039
|
}
|
|
979
|
-
function
|
|
980
|
-
return
|
|
1040
|
+
function Je(v) {
|
|
1041
|
+
return Ce(oe(v.sources));
|
|
981
1042
|
}
|
|
982
|
-
function
|
|
983
|
-
return
|
|
1043
|
+
function Ge(v) {
|
|
1044
|
+
return v.is_chosen ? null : v.reasoning ?? null;
|
|
984
1045
|
}
|
|
985
|
-
const ee =
|
|
1046
|
+
const ee = j(null), de = j(!1), ce = j(null);
|
|
986
1047
|
return ae(
|
|
987
|
-
[
|
|
988
|
-
async ([
|
|
989
|
-
if (!(
|
|
1048
|
+
[T, r],
|
|
1049
|
+
async ([v, x]) => {
|
|
1050
|
+
if (!(v !== "audit" || !x || ee.value !== null || de.value) && b.auditUrl) {
|
|
990
1051
|
de.value = !0, ce.value = null;
|
|
991
1052
|
try {
|
|
992
|
-
ee.value = await
|
|
993
|
-
|
|
1053
|
+
ee.value = await _t(
|
|
1054
|
+
b.auditUrl,
|
|
994
1055
|
n.meta.anchor
|
|
995
1056
|
);
|
|
996
|
-
} catch (
|
|
997
|
-
ce.value =
|
|
1057
|
+
} catch (z) {
|
|
1058
|
+
ce.value = z instanceof Error ? z.message : String(z);
|
|
998
1059
|
} finally {
|
|
999
1060
|
de.value = !1;
|
|
1000
1061
|
}
|
|
1001
1062
|
}
|
|
1002
1063
|
},
|
|
1003
1064
|
{ immediate: !0 }
|
|
1004
|
-
), (
|
|
1005
|
-
modelValue:
|
|
1006
|
-
"onUpdate:modelValue":
|
|
1065
|
+
), (v, x) => (a(), E(u(be), {
|
|
1066
|
+
modelValue: r.value,
|
|
1067
|
+
"onUpdate:modelValue": x[3] || (x[3] = (z) => r.value = z),
|
|
1007
1068
|
title: B.value,
|
|
1008
1069
|
width: 90,
|
|
1009
1070
|
height: 90,
|
|
1010
1071
|
"close-x": "",
|
|
1011
|
-
class:
|
|
1072
|
+
class: A(u(W))
|
|
1012
1073
|
}, {
|
|
1013
|
-
default:
|
|
1014
|
-
var
|
|
1074
|
+
default: O(() => {
|
|
1075
|
+
var z;
|
|
1015
1076
|
return [
|
|
1016
|
-
o("div",
|
|
1017
|
-
o("section",
|
|
1018
|
-
o("div",
|
|
1019
|
-
o("div",
|
|
1020
|
-
|
|
1021
|
-
o("div",
|
|
1022
|
-
o("div",
|
|
1023
|
-
|
|
1024
|
-
o("span",
|
|
1077
|
+
o("div", ka, [
|
|
1078
|
+
o("section", $a, [
|
|
1079
|
+
o("div", Ca, [
|
|
1080
|
+
o("div", Sa, [
|
|
1081
|
+
x[5] || (x[5] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
|
|
1082
|
+
o("div", Va, i(P(l.value.value)), 1),
|
|
1083
|
+
o("div", Na, [
|
|
1084
|
+
x[4] || (x[4] = I(" source of truth: ", -1)),
|
|
1085
|
+
o("span", qa, i(l.value.source), 1)
|
|
1025
1086
|
])
|
|
1026
1087
|
]),
|
|
1027
|
-
o("div",
|
|
1028
|
-
D(
|
|
1088
|
+
o("div", Oa, [
|
|
1089
|
+
D(u(we), {
|
|
1029
1090
|
tooltip: "How certain the AI was when it extracted this value — not whether the quotes in the Citations tab were checked against the source (that tab's own badge says so).",
|
|
1030
1091
|
placement: "top"
|
|
1031
1092
|
}, {
|
|
1032
|
-
trigger:
|
|
1093
|
+
trigger: O(() => [...x[6] || (x[6] = [
|
|
1033
1094
|
o("div", { class: "w-fit text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)
|
|
1034
1095
|
])]),
|
|
1035
1096
|
_: 1
|
|
1036
1097
|
}),
|
|
1037
|
-
o("div",
|
|
1038
|
-
|
|
1098
|
+
o("div", Ia, [
|
|
1099
|
+
$.value != null ? (a(), E(u(ze), {
|
|
1039
1100
|
key: 0,
|
|
1040
|
-
value:
|
|
1101
|
+
value: $.value,
|
|
1041
1102
|
max: 5,
|
|
1042
1103
|
size: "md",
|
|
1043
|
-
variant:
|
|
1104
|
+
variant: k[L.value],
|
|
1044
1105
|
gradient: "",
|
|
1045
1106
|
shimmer: "",
|
|
1046
1107
|
"show-text": "",
|
|
1047
1108
|
"text-position": "beside",
|
|
1048
|
-
label: `${
|
|
1049
|
-
}, null, 8, ["value", "variant", "label"])) : (a(), s("div",
|
|
1109
|
+
label: `${$.value}/5`
|
|
1110
|
+
}, null, 8, ["value", "variant", "label"])) : (a(), s("div", Da, " No confidence recorded "))
|
|
1050
1111
|
]),
|
|
1051
1112
|
o("div", {
|
|
1052
|
-
class:
|
|
1113
|
+
class: A(["tv-confidence-label mt-1 text-right text-xs font-medium", {
|
|
1053
1114
|
"text-green-600": L.value === "high",
|
|
1054
1115
|
"text-yellow-600": L.value === "medium",
|
|
1055
1116
|
"text-red-600": L.value === "low",
|
|
1056
1117
|
"text-gray-400": L.value === "unverifiable",
|
|
1057
1118
|
"text-red-800": L.value === "failed"
|
|
1058
1119
|
}])
|
|
1059
|
-
}, i(
|
|
1120
|
+
}, i(u(G)[L.value]), 3)
|
|
1060
1121
|
])
|
|
1061
1122
|
]),
|
|
1062
|
-
e.meta.discrepancy ? (a(),
|
|
1123
|
+
e.meta.discrepancy ? (a(), E(u(ge), {
|
|
1063
1124
|
key: 0,
|
|
1064
1125
|
variant: "warning",
|
|
1065
1126
|
class: "tv-discrepancy"
|
|
1066
1127
|
}, {
|
|
1067
|
-
default:
|
|
1068
|
-
|
|
1128
|
+
default: O(() => [...x[7] || (x[7] = [
|
|
1129
|
+
I(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
|
|
1069
1130
|
])]),
|
|
1070
1131
|
_: 1
|
|
1071
|
-
})) :
|
|
1132
|
+
})) : p("", !0)
|
|
1072
1133
|
]),
|
|
1073
|
-
D(
|
|
1074
|
-
modelValue:
|
|
1075
|
-
"onUpdate:modelValue":
|
|
1076
|
-
tabs:
|
|
1134
|
+
D(u(at), {
|
|
1135
|
+
modelValue: T.value,
|
|
1136
|
+
"onUpdate:modelValue": x[0] || (x[0] = (C) => T.value = C),
|
|
1137
|
+
tabs: M.value,
|
|
1077
1138
|
class: "tv-modal-tabs"
|
|
1078
1139
|
}, null, 8, ["modelValue", "tabs"]),
|
|
1079
|
-
|
|
1080
|
-
D(
|
|
1140
|
+
T.value === "evidence" ? (a(), s("section", Ta, [
|
|
1141
|
+
D(Pe, {
|
|
1081
1142
|
evidence: d.value,
|
|
1082
|
-
reasoning:
|
|
1083
|
-
basis: (
|
|
1143
|
+
reasoning: S.value,
|
|
1144
|
+
basis: (z = _.value) == null ? void 0 : z.basis,
|
|
1084
1145
|
failed: L.value === "failed"
|
|
1085
1146
|
}, null, 8, ["evidence", "reasoning", "basis", "failed"])
|
|
1086
|
-
])) :
|
|
1087
|
-
|
|
1088
|
-
(a(!0), s(
|
|
1089
|
-
key:
|
|
1090
|
-
class:
|
|
1091
|
-
|
|
1092
|
-
e.meta.discrepancy &&
|
|
1147
|
+
])) : p("", !0),
|
|
1148
|
+
T.value === "candidates" ? (a(), s("section", Ea, [
|
|
1149
|
+
(a(!0), s(U, null, F(H.value, (C) => (a(), s("div", {
|
|
1150
|
+
key: C.key,
|
|
1151
|
+
class: A(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
|
|
1152
|
+
C.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
|
|
1153
|
+
e.meta.discrepancy && !C.winner ? "tv-candidate-disagrees border-amber-200" : ""
|
|
1093
1154
|
]])
|
|
1094
1155
|
}, [
|
|
1095
|
-
o("div",
|
|
1096
|
-
o("div",
|
|
1097
|
-
o("div",
|
|
1098
|
-
D(
|
|
1099
|
-
variant:
|
|
1156
|
+
o("div", La, [
|
|
1157
|
+
o("div", Pa, [
|
|
1158
|
+
o("div", Aa, [
|
|
1159
|
+
D(u(K), {
|
|
1160
|
+
variant: C.variant,
|
|
1100
1161
|
size: "xs"
|
|
1101
1162
|
}, {
|
|
1102
|
-
default:
|
|
1103
|
-
|
|
1163
|
+
default: O(() => [
|
|
1164
|
+
I(i(C.title), 1)
|
|
1104
1165
|
]),
|
|
1105
1166
|
_: 2
|
|
1106
1167
|
}, 1032, ["variant"]),
|
|
1107
|
-
|
|
1168
|
+
C.winner ? (a(), E(u(K), {
|
|
1108
1169
|
key: 0,
|
|
1109
1170
|
variant: "success",
|
|
1110
1171
|
size: "xxs",
|
|
1111
1172
|
class: "tv-winner-chip"
|
|
1112
1173
|
}, {
|
|
1113
|
-
default:
|
|
1114
|
-
|
|
1174
|
+
default: O(() => [...x[8] || (x[8] = [
|
|
1175
|
+
I("current value", -1)
|
|
1115
1176
|
])]),
|
|
1116
1177
|
_: 1
|
|
1117
|
-
})) :
|
|
1178
|
+
})) : p("", !0)
|
|
1118
1179
|
]),
|
|
1119
|
-
o("div",
|
|
1120
|
-
o("div",
|
|
1180
|
+
o("div", za, i(P(C.value)), 1),
|
|
1181
|
+
o("div", ja, i(C.detail), 1)
|
|
1121
1182
|
]),
|
|
1122
|
-
|
|
1183
|
+
C.accept && !C.winner ? (a(), E(u(ie), {
|
|
1123
1184
|
key: 0,
|
|
1124
1185
|
size: "sm",
|
|
1125
|
-
variant:
|
|
1186
|
+
variant: C.variant,
|
|
1126
1187
|
loading: Y.value,
|
|
1127
|
-
class:
|
|
1128
|
-
onClick:
|
|
1188
|
+
class: A(`tv-accept-${C.key}`),
|
|
1189
|
+
onClick: C.accept
|
|
1129
1190
|
}, {
|
|
1130
|
-
default:
|
|
1131
|
-
|
|
1191
|
+
default: O(() => [...x[9] || (x[9] = [
|
|
1192
|
+
I("Accept this value", -1)
|
|
1132
1193
|
])]),
|
|
1133
1194
|
_: 1
|
|
1134
|
-
}, 8, ["variant", "loading", "class", "onClick"])) :
|
|
1195
|
+
}, 8, ["variant", "loading", "class", "onClick"])) : p("", !0)
|
|
1135
1196
|
])
|
|
1136
1197
|
], 2))), 128)),
|
|
1137
|
-
e.save ? (a(), s("div",
|
|
1138
|
-
D(
|
|
1198
|
+
e.save ? (a(), s("div", Ra, [
|
|
1199
|
+
D(u(nt), {
|
|
1139
1200
|
modelValue: J.value,
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1201
|
+
"onUpdate:modelValue": x[1] || (x[1] = (C) => J.value = C),
|
|
1141
1202
|
size: "sm",
|
|
1142
1203
|
class: "tv-custom-input flex-1",
|
|
1143
1204
|
placeholder: "Type the correct value…",
|
|
1144
1205
|
disabled: Y.value
|
|
1145
1206
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1146
|
-
D(
|
|
1207
|
+
D(u(ie), {
|
|
1147
1208
|
variant: "success",
|
|
1148
1209
|
size: "sm",
|
|
1149
1210
|
class: "tv-accept-custom",
|
|
@@ -1151,96 +1212,96 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1151
1212
|
disabled: !J.value,
|
|
1152
1213
|
onClick: y
|
|
1153
1214
|
}, {
|
|
1154
|
-
default:
|
|
1155
|
-
|
|
1215
|
+
default: O(() => [...x[10] || (x[10] = [
|
|
1216
|
+
I("Save custom value", -1)
|
|
1156
1217
|
])]),
|
|
1157
1218
|
_: 1
|
|
1158
1219
|
}, 8, ["loading", "disabled"])
|
|
1159
|
-
])) : (a(), s("div",
|
|
1160
|
-
])) :
|
|
1161
|
-
|
|
1162
|
-
o("section",
|
|
1163
|
-
o("div",
|
|
1164
|
-
o("div",
|
|
1165
|
-
D(
|
|
1220
|
+
])) : (a(), s("div", Ua, " Read-only render — corrections are disabled here "))
|
|
1221
|
+
])) : p("", !0),
|
|
1222
|
+
T.value === "history" ? (a(), s("section", Ba, [
|
|
1223
|
+
o("section", Ma, [
|
|
1224
|
+
o("div", Fa, [
|
|
1225
|
+
o("div", Ya, [
|
|
1226
|
+
D(u(K), {
|
|
1166
1227
|
variant: "success",
|
|
1167
1228
|
size: "xxs"
|
|
1168
1229
|
}, {
|
|
1169
|
-
default:
|
|
1170
|
-
|
|
1230
|
+
default: O(() => [...x[11] || (x[11] = [
|
|
1231
|
+
I("current value", -1)
|
|
1171
1232
|
])]),
|
|
1172
1233
|
_: 1
|
|
1173
1234
|
}),
|
|
1174
|
-
o("span",
|
|
1235
|
+
o("span", Ka, i(P(l.value.value)), 1)
|
|
1175
1236
|
]),
|
|
1176
|
-
|
|
1237
|
+
$.value != null ? (a(), s("span", Ha, "Confidence " + i($.value) + "/5 · " + i(u(G)[L.value]), 1)) : (a(), s("span", Ja, i(u(G)[L.value]), 1))
|
|
1177
1238
|
]),
|
|
1178
|
-
|
|
1239
|
+
S.value ? (a(), s("p", Ga, i(S.value), 1)) : p("", !0)
|
|
1179
1240
|
]),
|
|
1180
|
-
|
|
1241
|
+
x[13] || (x[13] = o("div", { class: "flex flex-wrap items-baseline justify-between gap-2" }, [
|
|
1181
1242
|
o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Every recorded attempt "),
|
|
1182
1243
|
o("div", { class: "text-xs text-gray-400" }, "oldest first")
|
|
1183
1244
|
], -1)),
|
|
1184
|
-
D(
|
|
1245
|
+
D(Ke, {
|
|
1185
1246
|
modelValue: te.value,
|
|
1186
|
-
"onUpdate:modelValue":
|
|
1247
|
+
"onUpdate:modelValue": x[2] || (x[2] = (C) => te.value = C),
|
|
1187
1248
|
items: ue.value,
|
|
1188
|
-
|
|
1189
|
-
class: "tv-history-accordion rounded-lg border border-gray-200"
|
|
1249
|
+
"id-prefix": "tv-attempt",
|
|
1250
|
+
class: "tv-history-accordion overflow-hidden rounded-lg border border-gray-200"
|
|
1190
1251
|
}, {
|
|
1191
|
-
header:
|
|
1192
|
-
var ne, le, se,
|
|
1252
|
+
header: O(({ item: C }) => {
|
|
1253
|
+
var ne, le, se, Se, Ve, Ne, qe;
|
|
1193
1254
|
return [
|
|
1194
1255
|
o("span", {
|
|
1195
|
-
class:
|
|
1256
|
+
class: A([
|
|
1196
1257
|
"tv-history-row flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",
|
|
1197
|
-
(ne =
|
|
1258
|
+
(ne = R.value.get(C.value)) != null && ne.is_chosen ? "tv-history-chosen" : ""
|
|
1198
1259
|
])
|
|
1199
1260
|
}, [
|
|
1200
|
-
(le =
|
|
1261
|
+
(le = R.value.get(C.value)) != null && le.is_chosen ? (a(), E(u(K), {
|
|
1201
1262
|
key: 0,
|
|
1202
1263
|
variant: "success",
|
|
1203
1264
|
size: "xxs",
|
|
1204
1265
|
class: "tv-history-chosen-chip"
|
|
1205
1266
|
}, {
|
|
1206
|
-
default:
|
|
1207
|
-
|
|
1267
|
+
default: O(() => [...x[12] || (x[12] = [
|
|
1268
|
+
I("chosen", -1)
|
|
1208
1269
|
])]),
|
|
1209
1270
|
_: 1
|
|
1210
|
-
})) :
|
|
1211
|
-
o("span",
|
|
1212
|
-
(
|
|
1271
|
+
})) : p("", !0),
|
|
1272
|
+
o("span", Qa, i(P((se = R.value.get(C.value)) == null ? void 0 : se.value)), 1),
|
|
1273
|
+
(Se = R.value.get(C.value)) != null && Se.state ? (a(), E(u(K), {
|
|
1213
1274
|
key: 1,
|
|
1214
|
-
variant: ((
|
|
1275
|
+
variant: ((Ve = R.value.get(C.value)) == null ? void 0 : Ve.state) === "failed" ? "danger" : "muted",
|
|
1215
1276
|
size: "xxs",
|
|
1216
1277
|
class: "tv-history-state"
|
|
1217
1278
|
}, {
|
|
1218
|
-
default:
|
|
1219
|
-
var
|
|
1279
|
+
default: O(() => {
|
|
1280
|
+
var Oe;
|
|
1220
1281
|
return [
|
|
1221
|
-
|
|
1282
|
+
I(i((Oe = R.value.get(C.value)) == null ? void 0 : Oe.state), 1)
|
|
1222
1283
|
];
|
|
1223
1284
|
}),
|
|
1224
1285
|
_: 2
|
|
1225
|
-
}, 1032, ["variant"])) :
|
|
1226
|
-
((
|
|
1227
|
-
o("span",
|
|
1228
|
-
|
|
1286
|
+
}, 1032, ["variant"])) : p("", !0),
|
|
1287
|
+
((Ne = R.value.get(C.value)) == null ? void 0 : Ne.confidence) != null ? (a(), s("span", Wa, i((qe = R.value.get(C.value)) == null ? void 0 : qe.confidence) + "/5", 1)) : p("", !0),
|
|
1288
|
+
o("span", Xa, i(Je(
|
|
1289
|
+
R.value.get(C.value)
|
|
1229
1290
|
)), 1),
|
|
1230
|
-
o("span",
|
|
1291
|
+
o("span", Za, i(He(R.value.get(C.value))), 1)
|
|
1231
1292
|
], 2)
|
|
1232
1293
|
];
|
|
1233
1294
|
}),
|
|
1234
|
-
panel:
|
|
1295
|
+
panel: O(({ item: C }) => {
|
|
1235
1296
|
var ne, le, se;
|
|
1236
1297
|
return [
|
|
1237
|
-
D(
|
|
1238
|
-
evidence:
|
|
1239
|
-
(ne =
|
|
1298
|
+
D(Pe, {
|
|
1299
|
+
evidence: u(oe)(
|
|
1300
|
+
(ne = R.value.get(C.value)) == null ? void 0 : ne.sources
|
|
1240
1301
|
),
|
|
1241
|
-
reasoning:
|
|
1242
|
-
basis: (le =
|
|
1243
|
-
failed: ((se =
|
|
1302
|
+
reasoning: Ge(R.value.get(C.value)),
|
|
1303
|
+
basis: (le = R.value.get(C.value)) == null ? void 0 : le.basis,
|
|
1304
|
+
failed: ((se = R.value.get(C.value)) == null ? void 0 : se.state) === "failed",
|
|
1244
1305
|
collapsible: !1,
|
|
1245
1306
|
dense: ""
|
|
1246
1307
|
}, null, 8, ["evidence", "reasoning", "basis", "failed"])
|
|
@@ -1248,41 +1309,41 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1248
1309
|
}),
|
|
1249
1310
|
_: 1
|
|
1250
1311
|
}, 8, ["modelValue", "items"])
|
|
1251
|
-
])) :
|
|
1252
|
-
|
|
1253
|
-
de.value ? (a(), s(
|
|
1254
|
-
key:
|
|
1312
|
+
])) : p("", !0),
|
|
1313
|
+
T.value === "audit" ? (a(), s("section", en, [
|
|
1314
|
+
de.value ? (a(), s(U, { key: 0 }, F(2, (C) => D(u(je), {
|
|
1315
|
+
key: C,
|
|
1255
1316
|
shape: "rounded",
|
|
1256
1317
|
class: "tv-audit-skeleton h-24 w-full"
|
|
1257
|
-
})), 64)) : ce.value ? (a(),
|
|
1318
|
+
})), 64)) : ce.value ? (a(), E(u(ge), {
|
|
1258
1319
|
key: 1,
|
|
1259
1320
|
variant: "danger",
|
|
1260
1321
|
class: "tv-audit-error"
|
|
1261
1322
|
}, {
|
|
1262
|
-
default:
|
|
1263
|
-
|
|
1323
|
+
default: O(() => [
|
|
1324
|
+
I(" Could not load the audit trail: " + i(ce.value), 1)
|
|
1264
1325
|
]),
|
|
1265
1326
|
_: 1
|
|
1266
|
-
})) : ee.value && ee.value.length === 0 ? (a(), s("div",
|
|
1267
|
-
key: String(
|
|
1268
|
-
call:
|
|
1269
|
-
}, null, 8, ["call"]))), 128)) :
|
|
1270
|
-
])) :
|
|
1327
|
+
})) : ee.value && ee.value.length === 0 ? (a(), s("div", tn, " No LLM calls recorded for this data point ")) : ee.value ? (a(!0), s(U, { key: 3 }, F(ee.value, (C) => (a(), E(jt, {
|
|
1328
|
+
key: String(C.id),
|
|
1329
|
+
call: C
|
|
1330
|
+
}, null, 8, ["call"]))), 128)) : p("", !0)
|
|
1331
|
+
])) : p("", !0)
|
|
1271
1332
|
])
|
|
1272
1333
|
];
|
|
1273
1334
|
}),
|
|
1274
1335
|
_: 1
|
|
1275
1336
|
}, 8, ["modelValue", "title", "class"]));
|
|
1276
1337
|
}
|
|
1277
|
-
}),
|
|
1338
|
+
}), nn = ["contenteditable", "data-editable"], ln = {
|
|
1278
1339
|
key: 1,
|
|
1279
1340
|
class: "tv-verified-chip inline-flex items-center gap-1 rounded-full bg-green-600 px-2 py-0.5 text-[11px] font-semibold leading-none text-white",
|
|
1280
1341
|
"data-status": "verified"
|
|
1281
|
-
},
|
|
1342
|
+
}, sn = {
|
|
1282
1343
|
key: 2,
|
|
1283
1344
|
class: "tv-discrepancy-indicator ml-0.5 text-amber-500",
|
|
1284
1345
|
"aria-label": "discrepancy"
|
|
1285
|
-
},
|
|
1346
|
+
}, Bn = /* @__PURE__ */ Q({
|
|
1286
1347
|
__name: "VerifiedField",
|
|
1287
1348
|
props: {
|
|
1288
1349
|
source: {},
|
|
@@ -1291,301 +1352,301 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1291
1352
|
format: { type: Function }
|
|
1292
1353
|
},
|
|
1293
1354
|
setup(e) {
|
|
1294
|
-
const t = e, n =
|
|
1355
|
+
const t = e, n = pe(), w = g(() => n.enabled.value), b = g(() => n.loading), c = j(null), r = g(() => {
|
|
1295
1356
|
var y;
|
|
1296
|
-
return
|
|
1297
|
-
}), l =
|
|
1357
|
+
return c.value ? c.value : t.source && t.field ? ((y = t.source.__meta) == null ? void 0 : y[t.field]) ?? null : null;
|
|
1358
|
+
}), l = g(() => ke(r.value)), _ = g(() => {
|
|
1298
1359
|
if (t.original !== void 0 && t.original !== null)
|
|
1299
1360
|
return t.original;
|
|
1300
|
-
if (
|
|
1361
|
+
if (r.value && l.value.value !== null && l.value.value !== void 0)
|
|
1301
1362
|
return l.value.value;
|
|
1302
1363
|
if (t.source && t.field) return t.source[t.field];
|
|
1303
|
-
}),
|
|
1304
|
-
const y =
|
|
1364
|
+
}), f = g(() => {
|
|
1365
|
+
const y = _.value;
|
|
1305
1366
|
return y == null ? "" : typeof t.format == "function" ? t.format(y) : String(y);
|
|
1306
|
-
}),
|
|
1307
|
-
var
|
|
1308
|
-
const y = (
|
|
1309
|
-
return (y == null ? void 0 : y.state) === "failed" ? "failed" :
|
|
1310
|
-
}),
|
|
1311
|
-
var y,
|
|
1312
|
-
return !!((
|
|
1313
|
-
}),
|
|
1314
|
-
var
|
|
1315
|
-
const y = (
|
|
1367
|
+
}), V = g(() => {
|
|
1368
|
+
var q, P;
|
|
1369
|
+
const y = (P = (q = r.value) == null ? void 0 : q.candidates) == null ? void 0 : P.extracted;
|
|
1370
|
+
return (y == null ? void 0 : y.state) === "failed" ? "failed" : _e(y == null ? void 0 : y.confidence);
|
|
1371
|
+
}), $ = g(() => Fe(r.value)), L = g(() => {
|
|
1372
|
+
var y, q;
|
|
1373
|
+
return !!((q = (y = r.value) == null ? void 0 : y.candidates) != null && q.override);
|
|
1374
|
+
}), S = g(() => {
|
|
1375
|
+
var q;
|
|
1376
|
+
const y = (q = r.value) == null ? void 0 : q.candidates;
|
|
1316
1377
|
return !!(y != null && y.override || y != null && y.extracted || y != null && y.claim);
|
|
1317
|
-
}), d =
|
|
1318
|
-
const y =
|
|
1378
|
+
}), d = g(() => w.value), m = g(() => !!r.value), h = g(() => {
|
|
1379
|
+
const y = r.value;
|
|
1319
1380
|
return d.value && !!y && Ye(y);
|
|
1320
|
-
}), B =
|
|
1321
|
-
var ue, te,
|
|
1322
|
-
const y = (te = (ue =
|
|
1381
|
+
}), B = g(() => {
|
|
1382
|
+
var ue, te, R;
|
|
1383
|
+
const y = (te = (ue = r.value) == null ? void 0 : ue.candidates) == null ? void 0 : te.extracted;
|
|
1323
1384
|
if (!y) return "No verification data";
|
|
1324
|
-
if (
|
|
1385
|
+
if (V.value === "failed")
|
|
1325
1386
|
return y.reasoning ? `${G.failed}: ${y.reasoning}` : G.failed;
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
y.confidence != null ? `${
|
|
1387
|
+
const q = [], P = G[V.value];
|
|
1388
|
+
q.push(
|
|
1389
|
+
y.confidence != null ? `${P} (${y.confidence}/5)` : P
|
|
1329
1390
|
);
|
|
1330
|
-
const Z = ((
|
|
1331
|
-
return Z > 0 &&
|
|
1391
|
+
const Z = ((R = y.sources) == null ? void 0 : R.length) ?? 0;
|
|
1392
|
+
return Z > 0 && q.push(`${Z} source ${Z === 1 ? "page" : "pages"}`), $.value && q.push("sources disagree"), q.join(" · ");
|
|
1332
1393
|
});
|
|
1333
|
-
function
|
|
1334
|
-
var
|
|
1335
|
-
|
|
1394
|
+
function k(y) {
|
|
1395
|
+
var q;
|
|
1396
|
+
c.value = y, (q = t.source) != null && q.__meta && t.field && (t.source.__meta[t.field] = y);
|
|
1336
1397
|
}
|
|
1337
|
-
const
|
|
1398
|
+
const T = g(() => ht(n, r, k)), N = g(() => !!T.value), M = j(!1), H = j(!1);
|
|
1338
1399
|
function J() {
|
|
1339
|
-
|
|
1400
|
+
r.value && (M.value = !0);
|
|
1340
1401
|
}
|
|
1341
|
-
const Y =
|
|
1402
|
+
const Y = g(() => m.value);
|
|
1342
1403
|
async function X(y) {
|
|
1343
1404
|
H.value = !1;
|
|
1344
|
-
const
|
|
1345
|
-
!
|
|
1405
|
+
const P = (y.target.textContent ?? "").trim();
|
|
1406
|
+
!T.value || P === f.value || await T.value(P, "custom");
|
|
1346
1407
|
}
|
|
1347
|
-
return (y,
|
|
1348
|
-
class:
|
|
1408
|
+
return (y, q) => (a(), s("span", {
|
|
1409
|
+
class: A(["tv-field inline-flex items-baseline gap-1", h.value ? "tv-needs-review" : ""])
|
|
1349
1410
|
}, [
|
|
1350
|
-
|
|
1411
|
+
b.value ? (a(), E(u(je), {
|
|
1351
1412
|
key: 0,
|
|
1352
1413
|
shape: "rounded",
|
|
1353
1414
|
class: "tv-field-skeleton inline-block h-[1em] w-16 align-middle"
|
|
1354
|
-
})) : (a(), s(
|
|
1415
|
+
})) : (a(), s(U, { key: 1 }, [
|
|
1355
1416
|
o("span", {
|
|
1356
|
-
class:
|
|
1417
|
+
class: A([
|
|
1357
1418
|
"tv-field-value",
|
|
1358
|
-
d.value && !
|
|
1419
|
+
d.value && !S.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
|
|
1359
1420
|
]),
|
|
1360
|
-
contenteditable:
|
|
1361
|
-
"data-editable":
|
|
1362
|
-
onFocus:
|
|
1421
|
+
contenteditable: N.value,
|
|
1422
|
+
"data-editable": N.value ? "true" : "false",
|
|
1423
|
+
onFocus: q[0] || (q[0] = (P) => H.value = !0),
|
|
1363
1424
|
onBlur: X,
|
|
1364
|
-
onKeydown:
|
|
1365
|
-
onClick:
|
|
1425
|
+
onKeydown: q[1] || (q[1] = We(ve((P) => P.target.blur(), ["prevent"]), ["enter"])),
|
|
1426
|
+
onClick: q[2] || (q[2] = (P) => d.value && !S.value ? J() : void 0)
|
|
1366
1427
|
}, [
|
|
1367
|
-
|
|
1368
|
-
value:
|
|
1369
|
-
formatted:
|
|
1428
|
+
me(y.$slots, "default", {
|
|
1429
|
+
value: _.value,
|
|
1430
|
+
formatted: f.value
|
|
1370
1431
|
}, () => [
|
|
1371
|
-
|
|
1432
|
+
I(i(f.value), 1)
|
|
1372
1433
|
])
|
|
1373
|
-
], 42,
|
|
1374
|
-
d.value ? (a(),
|
|
1434
|
+
], 42, nn),
|
|
1435
|
+
d.value ? (a(), E(u(we), {
|
|
1375
1436
|
key: 0,
|
|
1376
1437
|
tooltip: B.value,
|
|
1377
1438
|
placement: "top"
|
|
1378
1439
|
}, {
|
|
1379
|
-
trigger:
|
|
1440
|
+
trigger: O(() => [
|
|
1380
1441
|
o("button", {
|
|
1381
1442
|
type: "button",
|
|
1382
|
-
class:
|
|
1383
|
-
onClick:
|
|
1443
|
+
class: A(["tv-overlay inline-flex items-center align-middle transition-transform duration-150", [u(W), Y.value ? "cursor-pointer hover:scale-110" : "cursor-default"]]),
|
|
1444
|
+
onClick: q[3] || (q[3] = (P) => Y.value ? J() : void 0)
|
|
1384
1445
|
}, [
|
|
1385
|
-
L.value ? (a(), s("span",
|
|
1446
|
+
L.value ? (a(), s("span", ln, "✔")) : (a(), E(ye, {
|
|
1386
1447
|
key: 0,
|
|
1387
|
-
status:
|
|
1448
|
+
status: V.value
|
|
1388
1449
|
}, null, 8, ["status"])),
|
|
1389
|
-
|
|
1450
|
+
$.value && !L.value ? (a(), s("span", sn, "⚠")) : p("", !0)
|
|
1390
1451
|
], 2)
|
|
1391
1452
|
]),
|
|
1392
1453
|
_: 1
|
|
1393
|
-
}, 8, ["tooltip"])) :
|
|
1394
|
-
|
|
1454
|
+
}, 8, ["tooltip"])) : p("", !0),
|
|
1455
|
+
r.value ? (a(), E(an, {
|
|
1395
1456
|
key: 1,
|
|
1396
|
-
modelValue:
|
|
1397
|
-
"onUpdate:modelValue":
|
|
1398
|
-
meta:
|
|
1457
|
+
modelValue: M.value,
|
|
1458
|
+
"onUpdate:modelValue": q[4] || (q[4] = (P) => M.value = P),
|
|
1459
|
+
meta: r.value,
|
|
1399
1460
|
label: e.field,
|
|
1400
|
-
save:
|
|
1401
|
-
}, null, 8, ["modelValue", "meta", "label", "save"])) :
|
|
1461
|
+
save: T.value
|
|
1462
|
+
}, null, 8, ["modelValue", "meta", "label", "save"])) : p("", !0)
|
|
1402
1463
|
], 64))
|
|
1403
1464
|
], 2));
|
|
1404
1465
|
}
|
|
1405
|
-
}),
|
|
1466
|
+
}), on = { class: "tv-comparison-page flex flex-col gap-4" }, rn = {
|
|
1406
1467
|
key: 0,
|
|
1407
1468
|
class: "tv-comparison-empty text-gray-400"
|
|
1408
|
-
},
|
|
1469
|
+
}, un = {
|
|
1409
1470
|
key: 1,
|
|
1410
1471
|
class: "tv-anchored-group flex flex-col gap-3"
|
|
1411
|
-
},
|
|
1472
|
+
}, dn = { class: "flex items-center gap-2" }, cn = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, vn = { class: "tv-datapoint-resolved font-medium" }, fn = {
|
|
1412
1473
|
key: 0,
|
|
1413
1474
|
class: "tv-datapoint-discrepancy text-xs font-medium text-amber-600"
|
|
1414
|
-
},
|
|
1475
|
+
}, gn = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, pn = { class: "font-medium" }, mn = {
|
|
1415
1476
|
key: 0,
|
|
1416
1477
|
class: "tv-datapoint-reasoning ml-4 text-xs italic text-gray-500"
|
|
1417
|
-
},
|
|
1478
|
+
}, xn = {
|
|
1418
1479
|
key: 1,
|
|
1419
1480
|
class: "tv-datapoint-sources ml-4 text-xs text-gray-500"
|
|
1420
|
-
},
|
|
1481
|
+
}, hn = { class: "tv-datapoint-cited text-gray-400" }, yn = ["href"], bn = {
|
|
1421
1482
|
key: 1,
|
|
1422
1483
|
class: "tv-source-page-label"
|
|
1423
|
-
},
|
|
1484
|
+
}, wn = {
|
|
1424
1485
|
key: 2,
|
|
1425
1486
|
class: "ml-1 text-gray-400"
|
|
1426
|
-
},
|
|
1487
|
+
}, _n = { class: "tv-source-quotes ml-4" }, kn = {
|
|
1427
1488
|
key: 2,
|
|
1428
1489
|
class: "tv-datapoint-history ml-4 mt-1 text-xs text-gray-500"
|
|
1429
|
-
},
|
|
1490
|
+
}, $n = {
|
|
1430
1491
|
key: 0,
|
|
1431
1492
|
class: "tv-history-chosen-mark"
|
|
1432
|
-
},
|
|
1493
|
+
}, Cn = { class: "tv-history-entry-value" }, Sn = {
|
|
1433
1494
|
key: 1,
|
|
1434
1495
|
class: "ml-1"
|
|
1435
|
-
},
|
|
1496
|
+
}, Vn = {
|
|
1436
1497
|
key: 2,
|
|
1437
1498
|
class: "ml-1"
|
|
1438
|
-
},
|
|
1499
|
+
}, Nn = {
|
|
1439
1500
|
key: 3,
|
|
1440
1501
|
class: "ml-1"
|
|
1441
|
-
},
|
|
1502
|
+
}, qn = {
|
|
1442
1503
|
key: 4,
|
|
1443
1504
|
class: "ml-1 text-gray-400"
|
|
1444
|
-
},
|
|
1505
|
+
}, On = {
|
|
1445
1506
|
key: 2,
|
|
1446
1507
|
class: "tv-unanchored-group flex flex-col gap-1"
|
|
1447
|
-
},
|
|
1508
|
+
}, In = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, Dn = { class: "tv-datapoint-value" }, Tn = /* @__PURE__ */ Q({
|
|
1448
1509
|
__name: "ComparisonPage",
|
|
1449
1510
|
setup(e) {
|
|
1450
|
-
const t =
|
|
1451
|
-
function
|
|
1452
|
-
const d =
|
|
1511
|
+
const t = pe(), n = g(() => $e(t.data)), w = g(() => n.value.filter((S) => !S.unanchored)), b = g(() => n.value.filter((S) => S.unanchored));
|
|
1512
|
+
function c(S) {
|
|
1513
|
+
const d = ke(S).value;
|
|
1453
1514
|
return d == null ? "" : String(d);
|
|
1454
1515
|
}
|
|
1455
|
-
function
|
|
1456
|
-
return
|
|
1516
|
+
function r(S) {
|
|
1517
|
+
return S == null ? "" : String(S);
|
|
1457
1518
|
}
|
|
1458
|
-
function l(
|
|
1459
|
-
var d, m,
|
|
1460
|
-
return (
|
|
1519
|
+
function l(S) {
|
|
1520
|
+
var d, m, h;
|
|
1521
|
+
return (h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.confidence;
|
|
1461
1522
|
}
|
|
1462
|
-
function
|
|
1463
|
-
var
|
|
1464
|
-
const d = (
|
|
1523
|
+
function _(S) {
|
|
1524
|
+
var h;
|
|
1525
|
+
const d = (h = S.meta) == null ? void 0 : h.candidates;
|
|
1465
1526
|
if (!d) return [];
|
|
1466
1527
|
const m = [];
|
|
1467
1528
|
return d.override && m.push({ source: "override", value: d.override.value }), d.extracted && m.push({ source: "extracted", value: d.extracted.value }), d.claim && m.push({ source: "claim", value: d.claim.value }), m;
|
|
1468
1529
|
}
|
|
1469
|
-
function
|
|
1470
|
-
var d, m,
|
|
1471
|
-
return ((
|
|
1530
|
+
function f(S) {
|
|
1531
|
+
var d, m, h;
|
|
1532
|
+
return ((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.history) ?? [];
|
|
1472
1533
|
}
|
|
1473
|
-
function
|
|
1474
|
-
return
|
|
1534
|
+
function V(S) {
|
|
1535
|
+
return S.created_at ? new Date(S.created_at).toLocaleString() : "";
|
|
1475
1536
|
}
|
|
1476
|
-
function
|
|
1477
|
-
var d, m,
|
|
1478
|
-
return oe((
|
|
1537
|
+
function $(S) {
|
|
1538
|
+
var d, m, h;
|
|
1539
|
+
return oe((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.sources).pages;
|
|
1479
1540
|
}
|
|
1480
|
-
function L(
|
|
1481
|
-
var d, m,
|
|
1482
|
-
return
|
|
1541
|
+
function L(S) {
|
|
1542
|
+
var d, m, h;
|
|
1543
|
+
return Ce(oe((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.sources));
|
|
1483
1544
|
}
|
|
1484
|
-
return (
|
|
1545
|
+
return (S, d) => (a(), s("div", on, [
|
|
1485
1546
|
d[1] || (d[1] = o("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
|
|
1486
|
-
n.value.length === 0 ? (a(), s("p",
|
|
1487
|
-
|
|
1488
|
-
(a(!0), s(
|
|
1547
|
+
n.value.length === 0 ? (a(), s("p", rn, " No data points to compare. ")) : p("", !0),
|
|
1548
|
+
w.value.length ? (a(), s("section", un, [
|
|
1549
|
+
(a(!0), s(U, null, F(w.value, (m) => (a(), s("div", {
|
|
1489
1550
|
key: m.path,
|
|
1490
1551
|
class: "tv-datapoint border-t border-gray-100 pt-2"
|
|
1491
1552
|
}, [
|
|
1492
|
-
o("div",
|
|
1493
|
-
o("span",
|
|
1494
|
-
o("span",
|
|
1553
|
+
o("div", dn, [
|
|
1554
|
+
o("span", cn, i(m.path), 1),
|
|
1555
|
+
o("span", vn, i(c(m.meta)), 1),
|
|
1495
1556
|
D(ye, {
|
|
1496
1557
|
confidence: l(m),
|
|
1497
1558
|
"show-label": ""
|
|
1498
1559
|
}, null, 8, ["confidence"]),
|
|
1499
|
-
|
|
1560
|
+
u(Fe)(m.meta) ? (a(), s("span", fn, "⚠ discrepancy")) : p("", !0)
|
|
1500
1561
|
]),
|
|
1501
|
-
o("ul",
|
|
1502
|
-
(a(!0), s(
|
|
1503
|
-
key:
|
|
1562
|
+
o("ul", gn, [
|
|
1563
|
+
(a(!0), s(U, null, F(_(m), (h) => (a(), s("li", {
|
|
1564
|
+
key: h.source,
|
|
1504
1565
|
class: "tv-candidate"
|
|
1505
1566
|
}, [
|
|
1506
|
-
o("span",
|
|
1507
|
-
|
|
1567
|
+
o("span", pn, i(h.source) + ":", 1),
|
|
1568
|
+
I(" " + i(r(h.value)), 1)
|
|
1508
1569
|
]))), 128))
|
|
1509
1570
|
]),
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
o("li",
|
|
1513
|
-
(a(!0), s(
|
|
1514
|
-
key:
|
|
1571
|
+
u(xe)(m.meta) ? (a(), s("p", mn, i(u(xe)(m.meta)), 1)) : p("", !0),
|
|
1572
|
+
$(m).length ? (a(), s("ul", xn, [
|
|
1573
|
+
o("li", hn, i(L(m)), 1),
|
|
1574
|
+
(a(!0), s(U, null, F($(m), (h) => (a(), s("li", {
|
|
1575
|
+
key: h.key,
|
|
1515
1576
|
class: "tv-source-page"
|
|
1516
1577
|
}, [
|
|
1517
|
-
|
|
1578
|
+
h.url ? (a(), s("a", {
|
|
1518
1579
|
key: 0,
|
|
1519
|
-
href:
|
|
1580
|
+
href: h.url,
|
|
1520
1581
|
class: "tv-source-link text-blue-600 underline",
|
|
1521
1582
|
target: "_blank",
|
|
1522
1583
|
rel: "noopener"
|
|
1523
|
-
}, i(
|
|
1524
|
-
|
|
1525
|
-
o("ul",
|
|
1526
|
-
(a(!0), s(
|
|
1527
|
-
key:
|
|
1584
|
+
}, i(h.label), 9, yn)) : (a(), s("span", bn, i(h.label), 1)),
|
|
1585
|
+
h.documentName ? (a(), s("span", wn, "· " + i(h.documentName), 1)) : p("", !0),
|
|
1586
|
+
o("ul", _n, [
|
|
1587
|
+
(a(!0), s(U, null, F(h.quotes, (B, k) => (a(), s("li", {
|
|
1588
|
+
key: k,
|
|
1528
1589
|
class: "tv-source-quote italic"
|
|
1529
1590
|
}, "“" + i(B) + "”", 1))), 128))
|
|
1530
1591
|
])
|
|
1531
1592
|
]))), 128))
|
|
1532
|
-
])) :
|
|
1533
|
-
|
|
1534
|
-
(a(!0), s(
|
|
1535
|
-
key:
|
|
1536
|
-
class:
|
|
1593
|
+
])) : p("", !0),
|
|
1594
|
+
f(m).length ? (a(), s("ul", kn, [
|
|
1595
|
+
(a(!0), s(U, null, F(f(m), (h, B) => (a(), s("li", {
|
|
1596
|
+
key: h.id ?? B,
|
|
1597
|
+
class: A(["tv-history-entry", h.is_chosen ? "tv-history-entry-chosen font-medium text-green-700" : ""])
|
|
1537
1598
|
}, [
|
|
1538
|
-
|
|
1539
|
-
o("span",
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1599
|
+
h.is_chosen ? (a(), s("span", $n, "✔ chosen · ")) : p("", !0),
|
|
1600
|
+
o("span", Cn, i(r(h.value)), 1),
|
|
1601
|
+
h.state ? (a(), s("span", Sn, "[" + i(h.state) + "]", 1)) : p("", !0),
|
|
1602
|
+
h.confidence != null ? (a(), s("span", Vn, "· " + i(h.confidence) + "/5", 1)) : p("", !0),
|
|
1603
|
+
h.page != null ? (a(), s("span", Nn, "· p" + i(h.page), 1)) : p("", !0),
|
|
1604
|
+
V(h) ? (a(), s("span", qn, "· " + i(V(h)), 1)) : p("", !0)
|
|
1544
1605
|
], 2))), 128))
|
|
1545
|
-
])) :
|
|
1606
|
+
])) : p("", !0)
|
|
1546
1607
|
]))), 128))
|
|
1547
|
-
])) :
|
|
1548
|
-
|
|
1608
|
+
])) : p("", !0),
|
|
1609
|
+
b.value.length ? (a(), s("section", On, [
|
|
1549
1610
|
d[0] || (d[0] = o("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
|
|
1550
|
-
(a(!0), s(
|
|
1611
|
+
(a(!0), s(U, null, F(b.value, (m) => (a(), s("div", {
|
|
1551
1612
|
key: m.path,
|
|
1552
1613
|
class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
|
|
1553
1614
|
}, [
|
|
1554
|
-
o("span",
|
|
1555
|
-
o("span",
|
|
1615
|
+
o("span", In, i(m.path), 1),
|
|
1616
|
+
o("span", Dn, i(r(m.value)), 1),
|
|
1556
1617
|
D(ye, { status: "unverifiable" })
|
|
1557
1618
|
]))), 128))
|
|
1558
|
-
])) :
|
|
1619
|
+
])) : p("", !0)
|
|
1559
1620
|
]));
|
|
1560
1621
|
}
|
|
1561
|
-
}),
|
|
1622
|
+
}), En = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, Ln = { class: "tv-progress-block" }, Pn = { class: "mb-1 flex items-baseline justify-between" }, An = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, zn = {
|
|
1562
1623
|
key: 0,
|
|
1563
1624
|
class: "tv-attempts-recorded mt-1 text-[11px] text-gray-400"
|
|
1564
|
-
},
|
|
1625
|
+
}, Mn = /* @__PURE__ */ Q({
|
|
1565
1626
|
__name: "VerificationChrome",
|
|
1566
1627
|
setup(e) {
|
|
1567
|
-
const t =
|
|
1568
|
-
() =>
|
|
1569
|
-
(
|
|
1570
|
-
var m,
|
|
1571
|
-
return
|
|
1628
|
+
const t = pe(), { enabled: n, openComparison: w } = t, b = ct(), c = Ae(), r = j(!1), l = g(() => xt(t.data)), _ = g(
|
|
1629
|
+
() => $e(t.data).reduce(
|
|
1630
|
+
(S, d) => {
|
|
1631
|
+
var m, h, B, k;
|
|
1632
|
+
return S + (((k = (B = (h = (m = d.meta) == null ? void 0 : m.candidates) == null ? void 0 : h.extracted) == null ? void 0 : B.history) == null ? void 0 : k.length) ?? 0);
|
|
1572
1633
|
},
|
|
1573
1634
|
0
|
|
1574
1635
|
)
|
|
1575
|
-
),
|
|
1636
|
+
), f = j(!1);
|
|
1576
1637
|
ae(
|
|
1577
1638
|
() => l.value.percent,
|
|
1578
|
-
(
|
|
1579
|
-
|
|
1639
|
+
(S) => {
|
|
1640
|
+
S === 100 && l.value.total > 0 && !f.value && (f.value = !0, c.success("All data points verified 🎯"));
|
|
1580
1641
|
}
|
|
1581
1642
|
);
|
|
1582
|
-
let
|
|
1583
|
-
function
|
|
1584
|
-
const
|
|
1585
|
-
if (!
|
|
1586
|
-
|
|
1587
|
-
const d =
|
|
1588
|
-
|
|
1643
|
+
let V = 0;
|
|
1644
|
+
function $() {
|
|
1645
|
+
const S = document.querySelectorAll(".tv-needs-review");
|
|
1646
|
+
if (!S.length) return;
|
|
1647
|
+
V = V % S.length;
|
|
1648
|
+
const d = S[V];
|
|
1649
|
+
V++, d.scrollIntoView({ behavior: "smooth", block: "center" }), d.animate(
|
|
1589
1650
|
[
|
|
1590
1651
|
{ boxShadow: "0 0 0 0 rgba(245, 158, 11, 0.8)" },
|
|
1591
1652
|
{ boxShadow: "0 0 0 12px rgba(245, 158, 11, 0)" }
|
|
@@ -1594,47 +1655,47 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1594
1655
|
);
|
|
1595
1656
|
}
|
|
1596
1657
|
function L() {
|
|
1597
|
-
|
|
1658
|
+
w(), r.value = !1;
|
|
1598
1659
|
}
|
|
1599
|
-
return (
|
|
1660
|
+
return (S, d) => (a(), s(U, null, [
|
|
1600
1661
|
o("button", {
|
|
1601
1662
|
type: "button",
|
|
1602
|
-
class:
|
|
1663
|
+
class: A(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-11 w-11 items-center justify-center rounded-full bg-gray-900 text-white shadow-lg transition-transform hover:scale-105", u(W)]),
|
|
1603
1664
|
title: "Verification",
|
|
1604
|
-
onClick: d[0] || (d[0] = ve((m) =>
|
|
1665
|
+
onClick: d[0] || (d[0] = ve((m) => r.value = !r.value, ["stop"]))
|
|
1605
1666
|
}, [
|
|
1606
|
-
D(
|
|
1607
|
-
icon:
|
|
1667
|
+
D(u(lt), {
|
|
1668
|
+
icon: u(st),
|
|
1608
1669
|
class: "h-5 w-5"
|
|
1609
1670
|
}, null, 8, ["icon"]),
|
|
1610
|
-
|
|
1671
|
+
u(n) && l.value.needsReview > 0 ? (a(), E(u(ot), {
|
|
1611
1672
|
key: 0,
|
|
1612
1673
|
value: l.value.needsReview,
|
|
1613
1674
|
variant: "warning",
|
|
1614
1675
|
class: "tv-needs-review-badge absolute -right-1 -top-1"
|
|
1615
|
-
}, null, 8, ["value"])) :
|
|
1676
|
+
}, null, 8, ["value"])) : p("", !0)
|
|
1616
1677
|
], 2),
|
|
1617
|
-
|
|
1678
|
+
r.value ? (a(), s("div", {
|
|
1618
1679
|
key: 0,
|
|
1619
|
-
class:
|
|
1680
|
+
class: A(["tv-settings-panel fixed bottom-20 right-4 z-50 flex w-72 flex-col gap-4 rounded-xl bg-white p-4 shadow-2xl ring-1 ring-gray-200", u(W)])
|
|
1620
1681
|
}, [
|
|
1621
|
-
o("label",
|
|
1682
|
+
o("label", En, [
|
|
1622
1683
|
d[3] || (d[3] = o("span", null, "Verification overlay", -1)),
|
|
1623
1684
|
Xe(o("input", {
|
|
1624
|
-
"onUpdate:modelValue": d[1] || (d[1] = (m) =>
|
|
1685
|
+
"onUpdate:modelValue": d[1] || (d[1] = (m) => Ie(n) ? n.value = m : null),
|
|
1625
1686
|
type: "checkbox",
|
|
1626
1687
|
class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
|
|
1627
1688
|
}, null, 512), [
|
|
1628
|
-
[Ze,
|
|
1689
|
+
[Ze, u(n)]
|
|
1629
1690
|
])
|
|
1630
1691
|
]),
|
|
1631
|
-
|
|
1632
|
-
o("div",
|
|
1633
|
-
o("div",
|
|
1692
|
+
u(n) && l.value.total > 0 ? (a(), s(U, { key: 0 }, [
|
|
1693
|
+
o("div", Ln, [
|
|
1694
|
+
o("div", Pn, [
|
|
1634
1695
|
d[4] || (d[4] = o("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
|
|
1635
|
-
o("span",
|
|
1696
|
+
o("span", An, i(l.value.verified) + " / " + i(l.value.total), 1)
|
|
1636
1697
|
]),
|
|
1637
|
-
D(
|
|
1698
|
+
D(u(ze), {
|
|
1638
1699
|
value: l.value.verified,
|
|
1639
1700
|
max: l.value.total,
|
|
1640
1701
|
size: "md",
|
|
@@ -1644,68 +1705,68 @@ const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1644
1705
|
glow: l.value.percent === 100,
|
|
1645
1706
|
gradient: ""
|
|
1646
1707
|
}, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"]),
|
|
1647
|
-
|
|
1708
|
+
_.value > 0 ? (a(), s("div", zn, i(_.value) + " extraction attempt" + i(_.value === 1 ? "" : "s") + " recorded ", 1)) : p("", !0)
|
|
1648
1709
|
]),
|
|
1649
1710
|
l.value.needsReview > 0 ? (a(), s("button", {
|
|
1650
1711
|
key: 0,
|
|
1651
1712
|
type: "button",
|
|
1652
|
-
class:
|
|
1653
|
-
onClick: ve(
|
|
1713
|
+
class: A(["tv-next-flagged flex items-center justify-between rounded-lg bg-amber-50 px-3 py-2 text-left text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 transition hover:bg-amber-100", u(W)]),
|
|
1714
|
+
onClick: ve($, ["stop"])
|
|
1654
1715
|
}, [
|
|
1655
1716
|
o("span", null, i(l.value.needsReview) + " need" + i(l.value.needsReview === 1 ? "s" : "") + " review", 1),
|
|
1656
1717
|
d[5] || (d[5] = o("span", { "aria-hidden": "true" }, "→", -1))
|
|
1657
|
-
], 2)) :
|
|
1658
|
-
], 64)) :
|
|
1718
|
+
], 2)) : p("", !0)
|
|
1719
|
+
], 64)) : p("", !0),
|
|
1659
1720
|
o("button", {
|
|
1660
1721
|
type: "button",
|
|
1661
|
-
class:
|
|
1722
|
+
class: A(["tv-open-comparison rounded-lg border border-gray-200 px-3 py-2 text-sm font-medium text-gray-600 transition hover:bg-gray-50", u(W)]),
|
|
1662
1723
|
onClick: ve(L, ["stop"])
|
|
1663
1724
|
}, " Open comparison page ", 2)
|
|
1664
|
-
], 2)) :
|
|
1665
|
-
D(
|
|
1666
|
-
modelValue:
|
|
1667
|
-
"onUpdate:modelValue": d[2] || (d[2] = (m) =>
|
|
1725
|
+
], 2)) : p("", !0),
|
|
1726
|
+
D(u(be), {
|
|
1727
|
+
modelValue: u(b),
|
|
1728
|
+
"onUpdate:modelValue": d[2] || (d[2] = (m) => Ie(b) ? b.value = m : null),
|
|
1668
1729
|
title: "Verification comparison",
|
|
1669
1730
|
width: 80,
|
|
1670
1731
|
"close-x": "",
|
|
1671
|
-
class:
|
|
1732
|
+
class: A(u(W))
|
|
1672
1733
|
}, {
|
|
1673
|
-
default:
|
|
1674
|
-
D(
|
|
1734
|
+
default: O(() => [
|
|
1735
|
+
D(Tn)
|
|
1675
1736
|
]),
|
|
1676
1737
|
_: 1
|
|
1677
1738
|
}, 8, ["modelValue", "class"]),
|
|
1678
|
-
D(
|
|
1679
|
-
class:
|
|
1739
|
+
D(u(it), {
|
|
1740
|
+
class: A(u(W))
|
|
1680
1741
|
}, null, 8, ["class"])
|
|
1681
1742
|
], 64));
|
|
1682
1743
|
}
|
|
1683
1744
|
});
|
|
1684
1745
|
export {
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1746
|
+
W as CHROME_CLASS,
|
|
1747
|
+
Pe as CitationEvidence,
|
|
1748
|
+
Le as CitationPage,
|
|
1749
|
+
va as CitationPageList,
|
|
1750
|
+
Tn as ComparisonPage,
|
|
1690
1751
|
ye as ConfidenceIcon,
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1752
|
+
Re as ENABLED_STORAGE_KEY,
|
|
1753
|
+
Me as RESOLUTION_PRIORITY,
|
|
1754
|
+
vt as STATUS_COLORS,
|
|
1694
1755
|
G as STATUS_LABELS,
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1756
|
+
Mn as VerificationChrome,
|
|
1757
|
+
an as VerificationModal,
|
|
1758
|
+
Bn as VerifiedField,
|
|
1759
|
+
_e as bucketConfidence,
|
|
1760
|
+
gt as candidatesDisagree,
|
|
1700
1761
|
oe as citationEvidence,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1762
|
+
Ce as citationSummary,
|
|
1763
|
+
xt as computeProgress,
|
|
1764
|
+
_t as fetchDataPointAudit,
|
|
1704
1765
|
Fe as hasDiscrepancy,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1766
|
+
Un as initVerification,
|
|
1767
|
+
xe as reasoningOf,
|
|
1768
|
+
ft as resolveCandidates,
|
|
1769
|
+
ke as resolveDataPoint,
|
|
1770
|
+
pe as useVerification,
|
|
1771
|
+
$e as walkDataPoints
|
|
1711
1772
|
};
|