@thehammer/template-verification 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/audit.d.ts +7 -0
- package/dist/lib/progress.d.ts +13 -0
- package/dist/style.css +1 -1
- package/dist/template-verification.js +527 -510
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as U, watch as
|
|
2
|
-
import { DanxChip as J, CodeViewer as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
1
|
+
import { ref as U, watch as ve, defineComponent as H, computed as d, openBlock as l, createElementBlock as o, normalizeClass as R, createElementVNode as i, toDisplayString as m, createCommentVNode as b, createBlock as N, unref as r, withCtx as I, createTextVNode as T, createVNode as D, Fragment as L, renderList as P, withKeys as Ne, withModifiers as te, renderSlot as Re, withDirectives as Ae, isRef as xe, vModelCheckbox as Le } from "vue";
|
|
2
|
+
import { DanxChip as J, CodeViewer as ye, useToast as we, DanxDialog as ie, DanxProgressBar as ke, DanxAlert as be, DanxTabs as je, MarkdownEditor as Ee, DanxFileViewer as he, DanxButton as re, DanxInput as ze, DanxSkeleton as Pe, DanxTooltip as Me, DanxIcon as Be, gearIcon as Fe, DanxBadge as qe, DanxToastContainer as Ye } from "@thehammer/danx-ui";
|
|
3
|
+
const z = "tv-chrome", $e = "template-verification:enabled";
|
|
4
|
+
let ae = null;
|
|
5
|
+
function Je(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 Ye(e) {
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ke(e, t) {
|
|
14
14
|
var a;
|
|
15
15
|
try {
|
|
16
16
|
(a = globalThis.localStorage) == null || a.setItem(e, t);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
20
|
+
function He(e) {
|
|
21
|
+
const t = Je($e);
|
|
22
22
|
return t === null ? e : t === "true";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const t = U(
|
|
26
|
-
return
|
|
24
|
+
function Se(e) {
|
|
25
|
+
const t = U(He((e == null ? void 0 : e.defaultEnabled) ?? !1));
|
|
26
|
+
return ve(
|
|
27
27
|
t,
|
|
28
|
-
(a) =>
|
|
28
|
+
(a) => Ke($e, a ? "true" : "false")
|
|
29
29
|
), {
|
|
30
30
|
enabled: t,
|
|
31
31
|
data: (e == null ? void 0 : e.data) ?? {},
|
|
@@ -35,14 +35,14 @@ function $e(e) {
|
|
|
35
35
|
comparisonOpen: U(!1)
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function Ce() {
|
|
39
|
+
return ae || (ae = Se()), ae;
|
|
40
40
|
}
|
|
41
41
|
function ha(e) {
|
|
42
|
-
|
|
42
|
+
ae = Se(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const e =
|
|
44
|
+
function ne() {
|
|
45
|
+
const e = Ce();
|
|
46
46
|
return {
|
|
47
47
|
enabled: e.enabled,
|
|
48
48
|
data: e.data,
|
|
@@ -54,84 +54,141 @@ function le() {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
57
|
+
function Ge() {
|
|
58
|
+
return Ce().comparisonOpen;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function fe(e) {
|
|
61
61
|
return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const Qe = {
|
|
64
64
|
high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
|
|
65
65
|
medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
|
|
66
66
|
low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
|
|
67
67
|
unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20"
|
|
68
|
-
},
|
|
68
|
+
}, le = {
|
|
69
69
|
high: "High",
|
|
70
70
|
medium: "Medium",
|
|
71
71
|
low: "Low",
|
|
72
72
|
unverifiable: "Unverifiable"
|
|
73
|
-
},
|
|
74
|
-
function
|
|
75
|
-
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved :
|
|
73
|
+
}, Ve = ["override", "extracted", "claim"];
|
|
74
|
+
function pe(e) {
|
|
75
|
+
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : We(e.candidates) : { value: null, source: "none" };
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function We(e) {
|
|
78
78
|
if (e)
|
|
79
|
-
for (const t of
|
|
79
|
+
for (const t of Ve) {
|
|
80
80
|
const a = e[t];
|
|
81
81
|
if (a != null)
|
|
82
82
|
return { value: a.value, source: t };
|
|
83
83
|
}
|
|
84
84
|
return { value: null, source: "none" };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
var g,
|
|
88
|
-
const t = (
|
|
86
|
+
function oe(e) {
|
|
87
|
+
var g, p;
|
|
88
|
+
const t = (p = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : p.reasoning;
|
|
89
89
|
if (t == null) return null;
|
|
90
90
|
const a = String(t).trim();
|
|
91
91
|
return a === "" ? null : a;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
var g,
|
|
95
|
-
const t = (
|
|
93
|
+
function ue(e) {
|
|
94
|
+
var g, p;
|
|
95
|
+
const t = (p = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : p.cited_text;
|
|
96
96
|
if (t == null) return null;
|
|
97
97
|
const a = String(t).trim();
|
|
98
98
|
return a === "" ? null : a;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy :
|
|
100
|
+
function De(e) {
|
|
101
|
+
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : Xe(e.candidates) : !1;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Xe(e) {
|
|
104
104
|
if (!e) return !1;
|
|
105
|
-
const t =
|
|
105
|
+
const t = Ve.map((a) => e[a]).filter((a) => a != null).map((a) => Ze(a.value));
|
|
106
106
|
return t.length < 2 ? !1 : new Set(t).size > 1;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Ze(e) {
|
|
109
109
|
return JSON.stringify(e ?? null);
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
111
|
+
const et = /* @__PURE__ */ new Set(["name", "type"]);
|
|
112
|
+
function Oe(e, t = "") {
|
|
113
|
+
const a = [];
|
|
114
|
+
return de(e, t, a), a;
|
|
115
|
+
}
|
|
116
|
+
function de(e, t, a) {
|
|
117
|
+
if (Array.isArray(e)) {
|
|
118
|
+
e.forEach((n, y) => de(n, `${t}[${y}]`, a));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (!_e(e)) return;
|
|
122
|
+
const p = e.__meta ?? {};
|
|
123
|
+
for (const [n, y] of Object.entries(e)) {
|
|
124
|
+
if (n === "__meta") continue;
|
|
125
|
+
const s = t ? `${t}.${n}` : n;
|
|
126
|
+
if (Array.isArray(y) || _e(y)) {
|
|
127
|
+
de(y, s, a);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const h = p[n];
|
|
131
|
+
!h && et.has(n) || a.push({
|
|
132
|
+
path: s,
|
|
133
|
+
label: n,
|
|
134
|
+
meta: h ?? null,
|
|
135
|
+
value: y,
|
|
136
|
+
unanchored: !h
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function _e(e) {
|
|
141
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
142
|
+
}
|
|
143
|
+
function Ie(e) {
|
|
144
|
+
var a;
|
|
145
|
+
if (e.candidates.override) return !1;
|
|
146
|
+
const t = (a = e.candidates.extracted) == null ? void 0 : a.confidence;
|
|
147
|
+
return e.discrepancy || t == null || t <= 2;
|
|
148
|
+
}
|
|
149
|
+
function tt(e) {
|
|
150
|
+
const t = Oe(e).filter(
|
|
151
|
+
(n) => n.meta !== null
|
|
152
|
+
), a = t.length;
|
|
153
|
+
let g = 0, p = 0;
|
|
154
|
+
for (const n of t) {
|
|
155
|
+
if (n.meta.candidates.override) {
|
|
156
|
+
g++;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
Ie(n.meta) && p++;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
total: a,
|
|
163
|
+
verified: g,
|
|
164
|
+
needsReview: p,
|
|
165
|
+
percent: a === 0 ? 100 : Math.round(g / a * 100)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function at(e, t, a) {
|
|
169
|
+
var n;
|
|
170
|
+
const g = (n = t.value) == null ? void 0 : n.anchor;
|
|
114
171
|
if (!e.saveOverride || !g) return null;
|
|
115
|
-
const
|
|
116
|
-
return async (
|
|
117
|
-
const
|
|
172
|
+
const p = e.saveOverride;
|
|
173
|
+
return async (y, s) => {
|
|
174
|
+
const h = await p({
|
|
118
175
|
workflow_input_id: e.workflowInputId,
|
|
119
176
|
object_ids: g.object_ids,
|
|
120
177
|
field: g.field,
|
|
121
178
|
field_path: g.field_path,
|
|
122
|
-
value:
|
|
123
|
-
source_choice:
|
|
179
|
+
value: y,
|
|
180
|
+
source_choice: s
|
|
124
181
|
});
|
|
125
|
-
return a(
|
|
182
|
+
return a(h), h;
|
|
126
183
|
};
|
|
127
184
|
}
|
|
128
|
-
const
|
|
185
|
+
const lt = ["data-status", "title"], nt = {
|
|
129
186
|
class: "tv-confidence-glyph",
|
|
130
187
|
"aria-hidden": "true"
|
|
131
|
-
},
|
|
188
|
+
}, st = {
|
|
132
189
|
key: 0,
|
|
133
190
|
class: "tv-confidence-label"
|
|
134
|
-
},
|
|
191
|
+
}, ce = /* @__PURE__ */ H({
|
|
135
192
|
__name: "ConfidenceIcon",
|
|
136
193
|
props: {
|
|
137
194
|
confidence: {},
|
|
@@ -140,7 +197,7 @@ const et = ["data-status", "title"], tt = {
|
|
|
140
197
|
},
|
|
141
198
|
setup(e) {
|
|
142
199
|
const t = e, a = d(
|
|
143
|
-
() => t.status ??
|
|
200
|
+
() => t.status ?? fe(t.confidence)
|
|
144
201
|
), g = {
|
|
145
202
|
high: "✔",
|
|
146
203
|
// check
|
|
@@ -149,139 +206,150 @@ const et = ["data-status", "title"], tt = {
|
|
|
149
206
|
low: "✕",
|
|
150
207
|
// x
|
|
151
208
|
unverifiable: "?"
|
|
152
|
-
},
|
|
153
|
-
return (
|
|
154
|
-
class:
|
|
209
|
+
}, p = d(() => g[a.value]), n = d(() => Qe[a.value]), y = d(() => le[a.value]);
|
|
210
|
+
return (s, h) => (l(), o("span", {
|
|
211
|
+
class: R(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", n.value]),
|
|
155
212
|
"data-status": a.value,
|
|
156
|
-
title:
|
|
213
|
+
title: y.value
|
|
157
214
|
}, [
|
|
158
|
-
|
|
159
|
-
e.showLabel ? (l(), o("span",
|
|
160
|
-
], 10,
|
|
215
|
+
i("span", nt, m(p.value), 1),
|
|
216
|
+
e.showLabel ? (l(), o("span", st, m(y.value), 1)) : b("", !0)
|
|
217
|
+
], 10, lt));
|
|
161
218
|
}
|
|
162
219
|
});
|
|
163
|
-
async function
|
|
220
|
+
async function rt(e, t) {
|
|
164
221
|
const a = t.object_ids.at(-1), g = new URLSearchParams({
|
|
165
222
|
object_id: String(a),
|
|
166
223
|
field: t.field
|
|
167
|
-
}),
|
|
168
|
-
if (!
|
|
224
|
+
}), p = e.includes("?") ? "&" : "?", n = await fetch(`${e}${p}${g}`);
|
|
225
|
+
if (!n.ok)
|
|
169
226
|
throw new Error(
|
|
170
|
-
`data-point-audit ${
|
|
227
|
+
`data-point-audit ${n.status}: ${await n.text()}`
|
|
171
228
|
);
|
|
172
|
-
return (await
|
|
229
|
+
return (await n.json()).data ?? [];
|
|
173
230
|
}
|
|
174
|
-
function
|
|
175
|
-
var a, g,
|
|
231
|
+
function Te(e) {
|
|
232
|
+
var a, g, p;
|
|
176
233
|
if (!e || e.length === 0) return [];
|
|
177
234
|
const t = /* @__PURE__ */ new Map();
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
180
|
-
let
|
|
181
|
-
|
|
182
|
-
fileLabel:
|
|
183
|
-
fileUrl:
|
|
184
|
-
file:
|
|
235
|
+
for (const n of e) {
|
|
236
|
+
const y = it(n);
|
|
237
|
+
let s = t.get(y);
|
|
238
|
+
s || (s = {
|
|
239
|
+
fileLabel: ot(n),
|
|
240
|
+
fileUrl: n.file_url ?? ((a = n.file) == null ? void 0 : a.url),
|
|
241
|
+
file: n.file,
|
|
185
242
|
sources: []
|
|
186
|
-
}, t.set(
|
|
243
|
+
}, t.set(y, s)), !s.fileUrl && (n.file_url ?? ((g = n.file) == null ? void 0 : g.url)) && (s.fileUrl = n.file_url ?? ((p = n.file) == null ? void 0 : p.url)), !s.file && n.file && (s.file = n.file), s.sources.push(n);
|
|
187
244
|
}
|
|
188
245
|
return [...t.values()];
|
|
189
246
|
}
|
|
190
|
-
function
|
|
247
|
+
function it(e) {
|
|
191
248
|
const t = e.file_name ?? e.file_id ?? e.stored_file_id ?? e.source_id ?? e.id;
|
|
192
249
|
return t != null ? String(t) : "__unknown__";
|
|
193
250
|
}
|
|
194
|
-
function
|
|
251
|
+
function ot(e) {
|
|
195
252
|
var t;
|
|
196
253
|
return (t = e.file) != null && t.name ? e.file.name : e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
|
|
197
254
|
}
|
|
198
|
-
function
|
|
255
|
+
function ut(e) {
|
|
199
256
|
const t = e.page ?? e.page_number;
|
|
200
257
|
return t != null ? `Page ${t}` : e.explanation ? String(e.explanation) : e.source_type ? String(e.source_type) : "Citation";
|
|
201
258
|
}
|
|
202
|
-
const
|
|
203
|
-
key: 2,
|
|
204
|
-
class: "font-mono text-[11px] text-gray-400"
|
|
205
|
-
}, dt = {
|
|
259
|
+
const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, ct = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, vt = {
|
|
206
260
|
key: 3,
|
|
207
|
-
class: "text-[11px]
|
|
208
|
-
},
|
|
261
|
+
class: "font-mono text-[11px] text-gray-400"
|
|
262
|
+
}, ft = {
|
|
209
263
|
key: 4,
|
|
264
|
+
class: "text-[11px] font-medium text-gray-500"
|
|
265
|
+
}, pt = {
|
|
266
|
+
key: 5,
|
|
210
267
|
class: "text-[11px] text-gray-400"
|
|
211
|
-
},
|
|
268
|
+
}, mt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, gt = /* @__PURE__ */ H({
|
|
212
269
|
__name: "AuditCallCard",
|
|
213
270
|
props: {
|
|
214
271
|
call: {}
|
|
215
272
|
},
|
|
216
273
|
setup(e) {
|
|
217
274
|
const t = e, a = d(() => {
|
|
218
|
-
const
|
|
219
|
-
return
|
|
275
|
+
const s = t.call.status_code;
|
|
276
|
+
return s == null ? "muted" : s >= 200 && s < 300 ? "success" : s >= 400 ? "danger" : "warning";
|
|
220
277
|
}), g = d(() => {
|
|
221
|
-
const
|
|
222
|
-
return
|
|
223
|
-
}),
|
|
278
|
+
const s = t.call.run_time_ms;
|
|
279
|
+
return s == null ? null : s >= 1e3 ? `${(s / 1e3).toFixed(1)}s` : `${s}ms`;
|
|
280
|
+
}), p = d(() => {
|
|
224
281
|
if (!t.call.started_at) return null;
|
|
225
|
-
const
|
|
226
|
-
return Number.isNaN(
|
|
227
|
-
}),
|
|
282
|
+
const s = new Date(t.call.started_at);
|
|
283
|
+
return Number.isNaN(s.getTime()) ? t.call.started_at : s.toLocaleString();
|
|
284
|
+
}), n = d(
|
|
228
285
|
() => JSON.stringify(t.call.request ?? null, null, 2)
|
|
229
|
-
),
|
|
286
|
+
), y = d(
|
|
230
287
|
() => JSON.stringify(t.call.response ?? null, null, 2)
|
|
231
288
|
);
|
|
232
|
-
return (
|
|
233
|
-
|
|
234
|
-
e.call.
|
|
289
|
+
return (s, h) => (l(), o("div", dt, [
|
|
290
|
+
i("div", ct, [
|
|
291
|
+
e.call.stage ? (l(), N(r(J), {
|
|
235
292
|
key: 0,
|
|
293
|
+
variant: "muted",
|
|
294
|
+
size: "xxs",
|
|
295
|
+
class: "tv-audit-stage"
|
|
296
|
+
}, {
|
|
297
|
+
default: I(() => [
|
|
298
|
+
T(m(e.call.stage), 1)
|
|
299
|
+
]),
|
|
300
|
+
_: 1
|
|
301
|
+
})) : b("", !0),
|
|
302
|
+
e.call.model ? (l(), N(r(J), {
|
|
303
|
+
key: 1,
|
|
236
304
|
variant: "info",
|
|
237
305
|
size: "xs",
|
|
238
306
|
class: "tv-audit-model"
|
|
239
307
|
}, {
|
|
240
308
|
default: I(() => [
|
|
241
|
-
T(
|
|
309
|
+
T(m(e.call.model), 1)
|
|
242
310
|
]),
|
|
243
311
|
_: 1
|
|
244
|
-
})) :
|
|
245
|
-
e.call.service ? (l(), N(
|
|
246
|
-
key:
|
|
312
|
+
})) : b("", !0),
|
|
313
|
+
e.call.service ? (l(), N(r(J), {
|
|
314
|
+
key: 2,
|
|
247
315
|
variant: "muted",
|
|
248
316
|
size: "xxs"
|
|
249
317
|
}, {
|
|
250
318
|
default: I(() => [
|
|
251
|
-
T(
|
|
319
|
+
T(m(e.call.service), 1)
|
|
252
320
|
]),
|
|
253
321
|
_: 1
|
|
254
|
-
})) :
|
|
255
|
-
e.call.endpoint ? (l(), o("span",
|
|
256
|
-
|
|
257
|
-
|
|
322
|
+
})) : b("", !0),
|
|
323
|
+
e.call.endpoint ? (l(), o("span", vt, m(e.call.endpoint), 1)) : b("", !0),
|
|
324
|
+
h[0] || (h[0] = i("span", { class: "flex-1" }, null, -1)),
|
|
325
|
+
D(r(J), {
|
|
258
326
|
variant: a.value,
|
|
259
327
|
size: "xxs",
|
|
260
328
|
class: "tv-audit-status"
|
|
261
329
|
}, {
|
|
262
330
|
default: I(() => [
|
|
263
|
-
T(
|
|
331
|
+
T(m(e.call.status_code ?? "…"), 1)
|
|
264
332
|
]),
|
|
265
333
|
_: 1
|
|
266
334
|
}, 8, ["variant"]),
|
|
267
|
-
g.value ? (l(), o("span",
|
|
268
|
-
|
|
335
|
+
g.value ? (l(), o("span", ft, m(g.value), 1)) : b("", !0),
|
|
336
|
+
p.value ? (l(), o("span", pt, m(p.value), 1)) : b("", !0)
|
|
269
337
|
]),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"model-value":
|
|
338
|
+
i("div", mt, [
|
|
339
|
+
i("div", null, [
|
|
340
|
+
h[1] || (h[1] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
|
|
341
|
+
D(r(ye), {
|
|
342
|
+
"model-value": n.value,
|
|
275
343
|
format: "json",
|
|
276
344
|
collapsible: "",
|
|
277
345
|
"default-collapsed": "",
|
|
278
346
|
class: "tv-audit-request"
|
|
279
347
|
}, null, 8, ["model-value"])
|
|
280
348
|
]),
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"model-value":
|
|
349
|
+
i("div", null, [
|
|
350
|
+
h[2] || (h[2] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
|
|
351
|
+
D(r(ye), {
|
|
352
|
+
"model-value": y.value,
|
|
285
353
|
format: "json",
|
|
286
354
|
collapsible: "",
|
|
287
355
|
"default-collapsed": "",
|
|
@@ -291,46 +359,46 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
291
359
|
])
|
|
292
360
|
]));
|
|
293
361
|
}
|
|
294
|
-
}),
|
|
362
|
+
}), xt = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, yt = { 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" }, bt = { class: "flex flex-wrap items-start justify-between gap-4" }, ht = { class: "min-w-0 flex-1" }, _t = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, wt = { class: "mt-1 text-[11px] text-gray-400" }, kt = { class: "tv-resolved-source font-medium text-gray-500" }, $t = { class: "tv-confidence-meter w-56 shrink-0" }, St = { class: "mt-2" }, Ct = {
|
|
295
363
|
key: 1,
|
|
296
364
|
class: "tv-confidence-value text-sm text-gray-400"
|
|
297
|
-
},
|
|
365
|
+
}, Vt = {
|
|
298
366
|
key: 0,
|
|
299
367
|
class: "tv-tab-evidence flex min-h-0 flex-1 flex-col gap-4"
|
|
300
|
-
},
|
|
368
|
+
}, Dt = {
|
|
301
369
|
key: 0,
|
|
302
370
|
class: "tv-reasoning-card rounded-lg border border-gray-200 p-3"
|
|
303
|
-
},
|
|
371
|
+
}, Ot = {
|
|
304
372
|
key: 1,
|
|
305
373
|
class: "tv-cited-text rounded-lg border-l-4 border-blue-200 bg-blue-50/50 px-4 py-3 text-sm italic leading-relaxed text-gray-700"
|
|
306
|
-
},
|
|
374
|
+
}, It = {
|
|
307
375
|
key: 2,
|
|
308
376
|
class: "tv-evidence-viewer flex min-h-[24rem] flex-1 flex-col overflow-hidden rounded-lg border border-gray-200"
|
|
309
|
-
},
|
|
377
|
+
}, Tt = {
|
|
310
378
|
key: 0,
|
|
311
379
|
class: "tv-page-context border-t border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500"
|
|
312
|
-
},
|
|
380
|
+
}, Ut = {
|
|
313
381
|
key: 3,
|
|
314
382
|
class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
315
|
-
},
|
|
383
|
+
}, Nt = {
|
|
316
384
|
key: 4,
|
|
317
385
|
class: "tv-full-documents flex flex-wrap items-center gap-2"
|
|
318
|
-
},
|
|
386
|
+
}, Rt = {
|
|
319
387
|
key: 1,
|
|
320
388
|
class: "tv-tab-candidates flex flex-col gap-3"
|
|
321
|
-
},
|
|
389
|
+
}, At = { class: "flex flex-wrap items-center justify-between gap-3" }, Lt = { class: "min-w-0 flex-1" }, jt = { class: "flex items-center gap-2" }, Et = { class: "mt-2 break-words font-mono text-base text-gray-900" }, zt = { class: "mt-1 text-xs text-gray-400" }, Pt = {
|
|
322
390
|
key: 0,
|
|
323
391
|
class: "tv-custom-entry flex items-center gap-2 rounded-lg border border-dashed border-gray-300 p-4"
|
|
324
|
-
},
|
|
392
|
+
}, Mt = {
|
|
325
393
|
key: 1,
|
|
326
394
|
class: "tv-read-only text-center text-xs text-gray-400"
|
|
327
|
-
},
|
|
395
|
+
}, Bt = {
|
|
328
396
|
key: 2,
|
|
329
397
|
class: "tv-tab-audit flex flex-col gap-3"
|
|
330
|
-
},
|
|
398
|
+
}, Ft = {
|
|
331
399
|
key: 2,
|
|
332
400
|
class: "tv-audit-empty rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
333
|
-
},
|
|
401
|
+
}, qt = /* @__PURE__ */ H({
|
|
334
402
|
__name: "VerificationModal",
|
|
335
403
|
props: {
|
|
336
404
|
modelValue: { type: Boolean },
|
|
@@ -340,23 +408,23 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
340
408
|
},
|
|
341
409
|
emits: ["update:modelValue", "saved"],
|
|
342
410
|
setup(e, { emit: t }) {
|
|
343
|
-
const a = e, g = t,
|
|
411
|
+
const a = e, g = t, p = ne(), n = we(), y = d({
|
|
344
412
|
get: () => a.modelValue,
|
|
345
413
|
set: (v) => g("update:modelValue", v)
|
|
346
|
-
}),
|
|
414
|
+
}), s = d(() => pe(a.meta)), h = d(() => a.meta.candidates.extracted), $ = d(() => a.meta.candidates.claim), _ = d(() => a.meta.candidates.override), x = d(() => {
|
|
347
415
|
var v;
|
|
348
|
-
return ((v =
|
|
349
|
-
}), k = d(() =>
|
|
416
|
+
return ((v = h.value) == null ? void 0 : v.confidence) ?? null;
|
|
417
|
+
}), k = d(() => fe(x.value)), S = d(() => oe(a.meta)), A = d(() => ue(a.meta)), O = d(() => {
|
|
350
418
|
var v;
|
|
351
|
-
return
|
|
352
|
-
}),
|
|
419
|
+
return Te((v = h.value) == null ? void 0 : v.sources);
|
|
420
|
+
}), M = d(() => (a.meta.anchor.field_path || a.label || "Data point").split(".").map(
|
|
353
421
|
(u) => u.replace(/\[\d+\]/g, "").replace(/_/g, " ").replace(/^\w/, (C) => C.toUpperCase())
|
|
354
|
-
).join(" › ")),
|
|
422
|
+
).join(" › ")), B = {
|
|
355
423
|
high: "success",
|
|
356
424
|
medium: "warning",
|
|
357
425
|
low: "danger",
|
|
358
426
|
unverifiable: "muted"
|
|
359
|
-
},
|
|
427
|
+
}, j = U("evidence"), G = d(() => !!p.auditUrl), X = d(() => {
|
|
360
428
|
var u;
|
|
361
429
|
const v = [
|
|
362
430
|
{
|
|
@@ -367,18 +435,18 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
367
435
|
{
|
|
368
436
|
value: "candidates",
|
|
369
437
|
label: "Candidates",
|
|
370
|
-
count:
|
|
438
|
+
count: W.value.length
|
|
371
439
|
}
|
|
372
440
|
];
|
|
373
|
-
return
|
|
441
|
+
return G.value && v.push({
|
|
374
442
|
value: "audit",
|
|
375
443
|
label: "Audit trail",
|
|
376
|
-
count: ((u =
|
|
444
|
+
count: ((u = Y.value) == null ? void 0 : u.length) ?? void 0
|
|
377
445
|
}), v;
|
|
378
|
-
}),
|
|
446
|
+
}), F = d(
|
|
379
447
|
() => O.value.map((v) => v.file).filter((v) => !!v)
|
|
380
|
-
),
|
|
381
|
-
const v =
|
|
448
|
+
), Q = U(null), f = d(() => {
|
|
449
|
+
const v = Q.value ?? F.value[0];
|
|
382
450
|
if (!v) return null;
|
|
383
451
|
const u = O.value.find(
|
|
384
452
|
(c) => c.file && String(c.file.id) === String(v.id)
|
|
@@ -386,7 +454,7 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
386
454
|
if (!u) return null;
|
|
387
455
|
const C = u.sources.find((c) => c.explanation);
|
|
388
456
|
return (C == null ? void 0 : C.explanation) ?? null;
|
|
389
|
-
}),
|
|
457
|
+
}), w = d(() => {
|
|
390
458
|
const v = /* @__PURE__ */ new Map();
|
|
391
459
|
for (const u of O.value)
|
|
392
460
|
for (const C of u.sources) {
|
|
@@ -394,34 +462,34 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
394
462
|
c && !v.has(String(c.id)) && v.set(String(c.id), c);
|
|
395
463
|
}
|
|
396
464
|
return [...v.values()];
|
|
397
|
-
}),
|
|
398
|
-
get: () =>
|
|
465
|
+
}), V = U(null), K = d({
|
|
466
|
+
get: () => V.value !== null,
|
|
399
467
|
set: (v) => {
|
|
400
|
-
v || (
|
|
468
|
+
v || (V.value = null);
|
|
401
469
|
}
|
|
402
|
-
}),
|
|
470
|
+
}), W = d(() => {
|
|
403
471
|
const v = [];
|
|
404
|
-
return
|
|
472
|
+
return _.value && v.push({
|
|
405
473
|
key: "override",
|
|
406
474
|
title: "Human override",
|
|
407
475
|
variant: "success",
|
|
408
|
-
value:
|
|
476
|
+
value: _.value.value,
|
|
409
477
|
detail: [
|
|
410
|
-
|
|
411
|
-
|
|
478
|
+
_.value.source_choice ? `basis: ${_.value.source_choice}` : null,
|
|
479
|
+
_.value.set_at ? new Date(_.value.set_at).toLocaleString() : null
|
|
412
480
|
].filter(Boolean).join(" · "),
|
|
413
|
-
winner:
|
|
414
|
-
}),
|
|
481
|
+
winner: s.value.source === "override"
|
|
482
|
+
}), h.value && v.push({
|
|
415
483
|
key: "extracted",
|
|
416
484
|
title: "Extracted",
|
|
417
|
-
variant:
|
|
418
|
-
value:
|
|
419
|
-
detail: x.value != null ? `Confidence ${x.value}/5 · ${
|
|
485
|
+
variant: B[k.value],
|
|
486
|
+
value: h.value.value,
|
|
487
|
+
detail: x.value != null ? `Confidence ${x.value}/5 · ${le[k.value]}` : "No confidence recorded",
|
|
420
488
|
accept: a.save ? () => {
|
|
421
489
|
var u;
|
|
422
|
-
return
|
|
490
|
+
return se(me((u = h.value) == null ? void 0 : u.value), "extracted");
|
|
423
491
|
} : void 0,
|
|
424
|
-
winner:
|
|
492
|
+
winner: s.value.source === "extracted"
|
|
425
493
|
}), $.value && v.push({
|
|
426
494
|
key: "claim",
|
|
427
495
|
title: "Claim",
|
|
@@ -430,40 +498,40 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
430
498
|
detail: $.value.claim_set_label ?? "Reference output",
|
|
431
499
|
accept: a.save ? () => {
|
|
432
500
|
var u;
|
|
433
|
-
return
|
|
501
|
+
return se(me((u = $.value) == null ? void 0 : u.value), "claim");
|
|
434
502
|
} : void 0,
|
|
435
|
-
winner:
|
|
503
|
+
winner: s.value.source === "claim"
|
|
436
504
|
}), v;
|
|
437
|
-
}),
|
|
438
|
-
async function
|
|
439
|
-
if (!(!a.save ||
|
|
440
|
-
|
|
505
|
+
}), q = U(""), E = U(!1);
|
|
506
|
+
async function se(v, u) {
|
|
507
|
+
if (!(!a.save || E.value)) {
|
|
508
|
+
E.value = !0;
|
|
441
509
|
try {
|
|
442
510
|
const C = await a.save(v, u);
|
|
443
|
-
g("saved", C),
|
|
444
|
-
} catch {
|
|
445
|
-
|
|
511
|
+
g("saved", C), n.success(`Verified — ${M.value} locked in`);
|
|
512
|
+
} catch (C) {
|
|
513
|
+
console.error("template-verification: save failed", C), n.danger(`Could not save ${M.value} — try again`);
|
|
446
514
|
} finally {
|
|
447
|
-
|
|
515
|
+
E.value = !1;
|
|
448
516
|
}
|
|
449
517
|
}
|
|
450
518
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
519
|
+
const Ue = () => se(q.value, "custom");
|
|
520
|
+
function me(v) {
|
|
453
521
|
return v == null ? null : String(v);
|
|
454
522
|
}
|
|
455
|
-
function
|
|
523
|
+
function ge(v) {
|
|
456
524
|
return v == null ? "—" : String(v);
|
|
457
525
|
}
|
|
458
|
-
const
|
|
459
|
-
return
|
|
460
|
-
[
|
|
526
|
+
const Y = U(null), Z = U(!1), ee = U(null);
|
|
527
|
+
return ve(
|
|
528
|
+
[j, y],
|
|
461
529
|
async ([v, u]) => {
|
|
462
|
-
if (!(v !== "audit" || !u ||
|
|
530
|
+
if (!(v !== "audit" || !u || Y.value !== null || Z.value) && p.auditUrl) {
|
|
463
531
|
Z.value = !0, ee.value = null;
|
|
464
532
|
try {
|
|
465
|
-
|
|
466
|
-
|
|
533
|
+
Y.value = await rt(
|
|
534
|
+
p.auditUrl,
|
|
467
535
|
a.meta.anchor
|
|
468
536
|
);
|
|
469
537
|
} catch (C) {
|
|
@@ -475,56 +543,56 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
475
543
|
},
|
|
476
544
|
{ immediate: !0 }
|
|
477
545
|
), (v, u) => (l(), o(L, null, [
|
|
478
|
-
|
|
479
|
-
modelValue:
|
|
480
|
-
"onUpdate:modelValue": u[3] || (u[3] = (C) =>
|
|
481
|
-
title:
|
|
546
|
+
D(r(ie), {
|
|
547
|
+
modelValue: y.value,
|
|
548
|
+
"onUpdate:modelValue": u[3] || (u[3] = (C) => y.value = C),
|
|
549
|
+
title: M.value,
|
|
482
550
|
width: 90,
|
|
483
551
|
height: 90,
|
|
484
552
|
"close-x": "",
|
|
485
|
-
class:
|
|
553
|
+
class: R(r(z))
|
|
486
554
|
}, {
|
|
487
555
|
default: I(() => {
|
|
488
556
|
var C;
|
|
489
557
|
return [
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
u[6] || (u[6] =
|
|
495
|
-
|
|
496
|
-
|
|
558
|
+
i("div", xt, [
|
|
559
|
+
i("section", yt, [
|
|
560
|
+
i("div", bt, [
|
|
561
|
+
i("div", ht, [
|
|
562
|
+
u[6] || (u[6] = i("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
|
|
563
|
+
i("div", _t, m(ge(s.value.value)), 1),
|
|
564
|
+
i("div", wt, [
|
|
497
565
|
u[5] || (u[5] = T(" source of truth: ", -1)),
|
|
498
|
-
|
|
566
|
+
i("span", kt, m(s.value.source), 1)
|
|
499
567
|
])
|
|
500
568
|
]),
|
|
501
|
-
|
|
502
|
-
u[7] || (u[7] =
|
|
503
|
-
|
|
504
|
-
x.value != null ? (l(), N(
|
|
569
|
+
i("div", $t, [
|
|
570
|
+
u[7] || (u[7] = i("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)),
|
|
571
|
+
i("div", St, [
|
|
572
|
+
x.value != null ? (l(), N(r(ke), {
|
|
505
573
|
key: 0,
|
|
506
574
|
value: x.value,
|
|
507
575
|
max: 5,
|
|
508
576
|
size: "md",
|
|
509
|
-
variant:
|
|
577
|
+
variant: B[k.value],
|
|
510
578
|
gradient: "",
|
|
511
579
|
shimmer: "",
|
|
512
580
|
"show-text": "",
|
|
513
581
|
"text-position": "beside",
|
|
514
582
|
label: `${x.value}/5`
|
|
515
|
-
}, null, 8, ["value", "variant", "label"])) : (l(), o("div",
|
|
583
|
+
}, null, 8, ["value", "variant", "label"])) : (l(), o("div", Ct, " No confidence recorded "))
|
|
516
584
|
]),
|
|
517
|
-
|
|
518
|
-
class:
|
|
585
|
+
i("div", {
|
|
586
|
+
class: R(["tv-confidence-label mt-1 text-right text-xs font-medium", {
|
|
519
587
|
"text-green-600": k.value === "high",
|
|
520
588
|
"text-yellow-600": k.value === "medium",
|
|
521
589
|
"text-red-600": k.value === "low",
|
|
522
590
|
"text-gray-400": k.value === "unverifiable"
|
|
523
591
|
}])
|
|
524
|
-
},
|
|
592
|
+
}, m(r(le)[k.value]), 3)
|
|
525
593
|
])
|
|
526
594
|
]),
|
|
527
|
-
e.meta.discrepancy ? (l(), N(
|
|
595
|
+
e.meta.discrepancy ? (l(), N(r(be), {
|
|
528
596
|
key: 0,
|
|
529
597
|
variant: "warning",
|
|
530
598
|
class: "tv-discrepancy"
|
|
@@ -533,90 +601,90 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
533
601
|
T(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
|
|
534
602
|
])]),
|
|
535
603
|
_: 1
|
|
536
|
-
})) :
|
|
604
|
+
})) : b("", !0)
|
|
537
605
|
]),
|
|
538
|
-
|
|
539
|
-
modelValue:
|
|
540
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
606
|
+
D(r(je), {
|
|
607
|
+
modelValue: j.value,
|
|
608
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => j.value = c),
|
|
541
609
|
tabs: X.value,
|
|
542
610
|
class: "tv-modal-tabs"
|
|
543
611
|
}, null, 8, ["modelValue", "tabs"]),
|
|
544
|
-
|
|
545
|
-
S.value ? (l(), o("div",
|
|
546
|
-
u[9] || (u[9] =
|
|
547
|
-
|
|
612
|
+
j.value === "evidence" ? (l(), o("section", Vt, [
|
|
613
|
+
S.value ? (l(), o("div", Dt, [
|
|
614
|
+
u[9] || (u[9] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
|
|
615
|
+
D(r(Ee), {
|
|
548
616
|
"model-value": S.value,
|
|
549
617
|
readonly: "",
|
|
550
618
|
class: "tv-reasoning"
|
|
551
619
|
}, null, 8, ["model-value"])
|
|
552
|
-
])) :
|
|
553
|
-
|
|
554
|
-
T(" “" +
|
|
555
|
-
|
|
556
|
-
variant: (C =
|
|
620
|
+
])) : b("", !0),
|
|
621
|
+
A.value ? (l(), o("blockquote", Ot, [
|
|
622
|
+
T(" “" + m(A.value) + "” ", 1),
|
|
623
|
+
D(r(J), {
|
|
624
|
+
variant: (C = h.value) != null && C.cited_text_verified ? "success" : "muted",
|
|
557
625
|
size: "xxs",
|
|
558
626
|
class: "tv-cited-verified ml-2 not-italic"
|
|
559
627
|
}, {
|
|
560
628
|
default: I(() => {
|
|
561
629
|
var c;
|
|
562
630
|
return [
|
|
563
|
-
T(
|
|
631
|
+
T(m((c = h.value) != null && c.cited_text_verified ? "✔ verified in source" : "unverified"), 1)
|
|
564
632
|
];
|
|
565
633
|
}),
|
|
566
634
|
_: 1
|
|
567
635
|
}, 8, ["variant"])
|
|
568
|
-
])) :
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
file:
|
|
572
|
-
"file-in-preview":
|
|
573
|
-
"onUpdate:fileInPreview": u[1] || (u[1] = (c) =>
|
|
574
|
-
"related-files":
|
|
636
|
+
])) : b("", !0),
|
|
637
|
+
F.value.length ? (l(), o("div", It, [
|
|
638
|
+
D(r(he), {
|
|
639
|
+
file: F.value[0],
|
|
640
|
+
"file-in-preview": Q.value,
|
|
641
|
+
"onUpdate:fileInPreview": u[1] || (u[1] = (c) => Q.value = c),
|
|
642
|
+
"related-files": F.value,
|
|
575
643
|
"layout-toggles": ["sidebar", "continuous"],
|
|
576
644
|
"default-sidebar": "",
|
|
577
645
|
zoomable: "",
|
|
578
646
|
"storage-key": "tv-evidence-viewer",
|
|
579
647
|
class: "h-full min-h-0 flex-1"
|
|
580
648
|
}, null, 8, ["file", "file-in-preview", "related-files"]),
|
|
581
|
-
|
|
582
|
-
])) : (l(), o("div",
|
|
583
|
-
|
|
584
|
-
u[10] || (u[10] =
|
|
585
|
-
(l(!0), o(L, null,
|
|
649
|
+
f.value ? (l(), o("div", Tt, m(f.value), 1)) : b("", !0)
|
|
650
|
+
])) : (l(), o("div", Ut, " No source pages recorded for this data point ")),
|
|
651
|
+
w.value.length ? (l(), o("div", Nt, [
|
|
652
|
+
u[10] || (u[10] = i("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Full documents:", -1)),
|
|
653
|
+
(l(!0), o(L, null, P(w.value, (c) => (l(), N(r(re), {
|
|
586
654
|
key: String(c.id),
|
|
587
655
|
size: "sm",
|
|
588
656
|
variant: "info",
|
|
589
657
|
class: "tv-open-document",
|
|
590
|
-
onClick: (xa) =>
|
|
658
|
+
onClick: (xa) => V.value = c
|
|
591
659
|
}, {
|
|
592
660
|
default: I(() => [
|
|
593
|
-
T(
|
|
661
|
+
T(m(c.name), 1)
|
|
594
662
|
]),
|
|
595
663
|
_: 2
|
|
596
664
|
}, 1032, ["onClick"]))), 128))
|
|
597
|
-
])) :
|
|
598
|
-
])) :
|
|
599
|
-
|
|
600
|
-
(l(!0), o(L, null,
|
|
665
|
+
])) : b("", !0)
|
|
666
|
+
])) : b("", !0),
|
|
667
|
+
j.value === "candidates" ? (l(), o("section", Rt, [
|
|
668
|
+
(l(!0), o(L, null, P(W.value, (c) => (l(), o("div", {
|
|
601
669
|
key: c.key,
|
|
602
|
-
class:
|
|
670
|
+
class: R(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
|
|
603
671
|
c.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
|
|
604
672
|
e.meta.discrepancy && !c.winner ? "tv-candidate-disagrees border-amber-200" : ""
|
|
605
673
|
]])
|
|
606
674
|
}, [
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
675
|
+
i("div", At, [
|
|
676
|
+
i("div", Lt, [
|
|
677
|
+
i("div", jt, [
|
|
678
|
+
D(r(J), {
|
|
611
679
|
variant: c.variant,
|
|
612
680
|
size: "xs"
|
|
613
681
|
}, {
|
|
614
682
|
default: I(() => [
|
|
615
|
-
T(
|
|
683
|
+
T(m(c.title), 1)
|
|
616
684
|
]),
|
|
617
685
|
_: 2
|
|
618
686
|
}, 1032, ["variant"]),
|
|
619
|
-
c.winner ? (l(), N(
|
|
687
|
+
c.winner ? (l(), N(r(J), {
|
|
620
688
|
key: 0,
|
|
621
689
|
variant: "success",
|
|
622
690
|
size: "xxs",
|
|
@@ -626,105 +694,105 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
626
694
|
T("current value", -1)
|
|
627
695
|
])]),
|
|
628
696
|
_: 1
|
|
629
|
-
})) :
|
|
697
|
+
})) : b("", !0)
|
|
630
698
|
]),
|
|
631
|
-
|
|
632
|
-
|
|
699
|
+
i("div", Et, m(ge(c.value)), 1),
|
|
700
|
+
i("div", zt, m(c.detail), 1)
|
|
633
701
|
]),
|
|
634
|
-
c.accept && !c.winner ? (l(), N(
|
|
702
|
+
c.accept && !c.winner ? (l(), N(r(re), {
|
|
635
703
|
key: 0,
|
|
636
704
|
size: "sm",
|
|
637
705
|
variant: c.variant,
|
|
638
|
-
loading:
|
|
639
|
-
class:
|
|
706
|
+
loading: E.value,
|
|
707
|
+
class: R(`tv-accept-${c.key}`),
|
|
640
708
|
onClick: c.accept
|
|
641
709
|
}, {
|
|
642
710
|
default: I(() => [...u[12] || (u[12] = [
|
|
643
711
|
T("Accept this value", -1)
|
|
644
712
|
])]),
|
|
645
713
|
_: 1
|
|
646
|
-
}, 8, ["variant", "loading", "class", "onClick"])) :
|
|
714
|
+
}, 8, ["variant", "loading", "class", "onClick"])) : b("", !0)
|
|
647
715
|
])
|
|
648
716
|
], 2))), 128)),
|
|
649
|
-
e.save ? (l(), o("div",
|
|
650
|
-
|
|
651
|
-
modelValue:
|
|
652
|
-
"onUpdate:modelValue": u[2] || (u[2] = (c) =>
|
|
717
|
+
e.save ? (l(), o("div", Pt, [
|
|
718
|
+
D(r(ze), {
|
|
719
|
+
modelValue: q.value,
|
|
720
|
+
"onUpdate:modelValue": u[2] || (u[2] = (c) => q.value = c),
|
|
653
721
|
size: "sm",
|
|
654
722
|
class: "tv-custom-input flex-1",
|
|
655
723
|
placeholder: "Type the correct value…",
|
|
656
|
-
disabled:
|
|
724
|
+
disabled: E.value
|
|
657
725
|
}, null, 8, ["modelValue", "disabled"]),
|
|
658
|
-
|
|
726
|
+
D(r(re), {
|
|
659
727
|
variant: "success",
|
|
660
728
|
size: "sm",
|
|
661
729
|
class: "tv-accept-custom",
|
|
662
|
-
loading:
|
|
663
|
-
disabled: !
|
|
664
|
-
onClick:
|
|
730
|
+
loading: E.value,
|
|
731
|
+
disabled: !q.value,
|
|
732
|
+
onClick: Ue
|
|
665
733
|
}, {
|
|
666
734
|
default: I(() => [...u[13] || (u[13] = [
|
|
667
735
|
T("Save custom value", -1)
|
|
668
736
|
])]),
|
|
669
737
|
_: 1
|
|
670
738
|
}, 8, ["loading", "disabled"])
|
|
671
|
-
])) : (l(), o("div",
|
|
672
|
-
])) :
|
|
673
|
-
|
|
674
|
-
Z.value ? (l(), o(L, { key: 0 },
|
|
739
|
+
])) : (l(), o("div", Mt, " Read-only render — corrections are disabled here "))
|
|
740
|
+
])) : b("", !0),
|
|
741
|
+
j.value === "audit" ? (l(), o("section", Bt, [
|
|
742
|
+
Z.value ? (l(), o(L, { key: 0 }, P(2, (c) => D(r(Pe), {
|
|
675
743
|
key: c,
|
|
676
744
|
shape: "rounded",
|
|
677
745
|
class: "tv-audit-skeleton h-24 w-full"
|
|
678
|
-
})), 64)) : ee.value ? (l(), N(
|
|
746
|
+
})), 64)) : ee.value ? (l(), N(r(be), {
|
|
679
747
|
key: 1,
|
|
680
748
|
variant: "danger",
|
|
681
749
|
class: "tv-audit-error"
|
|
682
750
|
}, {
|
|
683
751
|
default: I(() => [
|
|
684
|
-
T(" Could not load the audit trail: " +
|
|
752
|
+
T(" Could not load the audit trail: " + m(ee.value), 1)
|
|
685
753
|
]),
|
|
686
754
|
_: 1
|
|
687
|
-
})) :
|
|
755
|
+
})) : Y.value && Y.value.length === 0 ? (l(), o("div", Ft, " No LLM calls recorded for this data point ")) : Y.value ? (l(!0), o(L, { key: 3 }, P(Y.value, (c) => (l(), N(gt, {
|
|
688
756
|
key: String(c.id),
|
|
689
757
|
call: c
|
|
690
|
-
}, null, 8, ["call"]))), 128)) :
|
|
691
|
-
])) :
|
|
758
|
+
}, null, 8, ["call"]))), 128)) : b("", !0)
|
|
759
|
+
])) : b("", !0)
|
|
692
760
|
])
|
|
693
761
|
];
|
|
694
762
|
}),
|
|
695
763
|
_: 1
|
|
696
764
|
}, 8, ["modelValue", "title", "class"]),
|
|
697
|
-
|
|
765
|
+
V.value ? (l(), N(r(ie), {
|
|
698
766
|
key: 0,
|
|
699
|
-
modelValue:
|
|
700
|
-
"onUpdate:modelValue": u[4] || (u[4] = (C) =>
|
|
701
|
-
title:
|
|
767
|
+
modelValue: K.value,
|
|
768
|
+
"onUpdate:modelValue": u[4] || (u[4] = (C) => K.value = C),
|
|
769
|
+
title: V.value.name,
|
|
702
770
|
width: 90,
|
|
703
771
|
height: 90,
|
|
704
772
|
"close-x": "",
|
|
705
|
-
class:
|
|
773
|
+
class: R(r(z))
|
|
706
774
|
}, {
|
|
707
775
|
default: I(() => [
|
|
708
|
-
|
|
709
|
-
file:
|
|
776
|
+
D(r(he), {
|
|
777
|
+
file: V.value,
|
|
710
778
|
downloadable: "",
|
|
711
779
|
zoomable: "",
|
|
712
780
|
class: "tv-document-viewer h-full"
|
|
713
781
|
}, null, 8, ["file"])
|
|
714
782
|
]),
|
|
715
783
|
_: 1
|
|
716
|
-
}, 8, ["modelValue", "title", "class"])) :
|
|
784
|
+
}, 8, ["modelValue", "title", "class"])) : b("", !0)
|
|
717
785
|
], 64));
|
|
718
786
|
}
|
|
719
|
-
}),
|
|
787
|
+
}), Yt = ["contenteditable", "data-editable"], Jt = {
|
|
720
788
|
key: 1,
|
|
721
789
|
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",
|
|
722
790
|
"data-status": "verified"
|
|
723
|
-
},
|
|
791
|
+
}, Kt = {
|
|
724
792
|
key: 2,
|
|
725
793
|
class: "tv-discrepancy-indicator ml-0.5 text-amber-500",
|
|
726
794
|
"aria-label": "discrepancy"
|
|
727
|
-
}, _a = /* @__PURE__ */
|
|
795
|
+
}, _a = /* @__PURE__ */ H({
|
|
728
796
|
__name: "VerifiedField",
|
|
729
797
|
props: {
|
|
730
798
|
source: {},
|
|
@@ -733,158 +801,109 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
733
801
|
format: { type: Function }
|
|
734
802
|
},
|
|
735
803
|
setup(e) {
|
|
736
|
-
const t = e, a =
|
|
737
|
-
var
|
|
738
|
-
return
|
|
739
|
-
}),
|
|
804
|
+
const t = e, a = ne(), g = d(() => a.enabled.value), p = U(null), n = d(() => {
|
|
805
|
+
var f;
|
|
806
|
+
return p.value ? p.value : t.source && t.field ? ((f = t.source.__meta) == null ? void 0 : f[t.field]) ?? null : null;
|
|
807
|
+
}), y = d(() => pe(n.value)), s = d(() => {
|
|
740
808
|
if (t.original !== void 0 && t.original !== null)
|
|
741
809
|
return t.original;
|
|
742
|
-
if (
|
|
743
|
-
return
|
|
810
|
+
if (n.value && y.value.value !== null && y.value.value !== void 0)
|
|
811
|
+
return y.value.value;
|
|
744
812
|
if (t.source && t.field) return t.source[t.field];
|
|
745
|
-
}),
|
|
746
|
-
const
|
|
747
|
-
return
|
|
813
|
+
}), h = d(() => {
|
|
814
|
+
const f = s.value;
|
|
815
|
+
return f == null ? "" : typeof t.format == "function" ? t.format(f) : String(f);
|
|
748
816
|
}), $ = d(
|
|
749
817
|
() => {
|
|
750
|
-
var
|
|
751
|
-
return
|
|
818
|
+
var f, w, V;
|
|
819
|
+
return fe((V = (w = (f = n.value) == null ? void 0 : f.candidates) == null ? void 0 : w.extracted) == null ? void 0 : V.confidence);
|
|
752
820
|
}
|
|
753
|
-
),
|
|
754
|
-
var
|
|
755
|
-
return !!((w = (
|
|
821
|
+
), _ = d(() => De(n.value)), x = d(() => {
|
|
822
|
+
var f, w;
|
|
823
|
+
return !!((w = (f = n.value) == null ? void 0 : f.candidates) != null && w.override);
|
|
756
824
|
}), k = d(() => {
|
|
757
825
|
var w;
|
|
758
|
-
const
|
|
759
|
-
return !!(
|
|
760
|
-
}), S = d(() => g.value && !!
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const
|
|
826
|
+
const f = (w = n.value) == null ? void 0 : w.candidates;
|
|
827
|
+
return !!(f != null && f.override || f != null && f.extracted || f != null && f.claim);
|
|
828
|
+
}), S = d(() => g.value && !!n.value), A = d(
|
|
829
|
+
() => S.value && !!n.value && Ie(n.value)
|
|
830
|
+
), O = d(() => {
|
|
831
|
+
var W, q, E;
|
|
832
|
+
const f = (q = (W = n.value) == null ? void 0 : W.candidates) == null ? void 0 : q.extracted;
|
|
833
|
+
if (!f) return "No verification data";
|
|
834
|
+
const w = [], V = le[$.value];
|
|
765
835
|
w.push(
|
|
766
|
-
|
|
836
|
+
f.confidence != null ? `${V} (${f.confidence}/5)` : V
|
|
767
837
|
);
|
|
768
|
-
const
|
|
769
|
-
return
|
|
838
|
+
const K = ((E = f.sources) == null ? void 0 : E.length) ?? 0;
|
|
839
|
+
return K > 0 && w.push(`${K} source ${K === 1 ? "page" : "pages"}`), _.value && w.push("sources disagree"), w.join(" · ");
|
|
770
840
|
});
|
|
771
|
-
function
|
|
841
|
+
function M(f) {
|
|
772
842
|
var w;
|
|
773
|
-
|
|
843
|
+
p.value = f, (w = t.source) != null && w.__meta && t.field && (t.source.__meta[t.field] = f);
|
|
774
844
|
}
|
|
775
|
-
const
|
|
776
|
-
function
|
|
777
|
-
|
|
845
|
+
const B = d(() => at(a, n, M)), j = d(() => !!B.value), G = U(!1), X = U(!1);
|
|
846
|
+
function F() {
|
|
847
|
+
n.value && (G.value = !0);
|
|
778
848
|
}
|
|
779
|
-
async function
|
|
780
|
-
|
|
781
|
-
const
|
|
782
|
-
!
|
|
849
|
+
async function Q(f) {
|
|
850
|
+
X.value = !1;
|
|
851
|
+
const V = (f.target.textContent ?? "").trim();
|
|
852
|
+
!B.value || V === h.value || await B.value(V, "custom");
|
|
783
853
|
}
|
|
784
|
-
return (
|
|
785
|
-
|
|
786
|
-
|
|
854
|
+
return (f, w) => (l(), o("span", {
|
|
855
|
+
class: R(["tv-field inline-flex items-baseline gap-1", A.value ? "tv-needs-review" : ""])
|
|
856
|
+
}, [
|
|
857
|
+
i("span", {
|
|
858
|
+
class: R([
|
|
787
859
|
"tv-field-value",
|
|
788
860
|
S.value && !k.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
|
|
789
861
|
]),
|
|
790
|
-
contenteditable:
|
|
791
|
-
"data-editable":
|
|
792
|
-
onFocus: w[0] || (w[0] = (
|
|
793
|
-
onBlur:
|
|
794
|
-
onKeydown: w[1] || (w[1] =
|
|
795
|
-
onClick: w[2] || (w[2] = (
|
|
862
|
+
contenteditable: j.value,
|
|
863
|
+
"data-editable": j.value ? "true" : "false",
|
|
864
|
+
onFocus: w[0] || (w[0] = (V) => X.value = !0),
|
|
865
|
+
onBlur: Q,
|
|
866
|
+
onKeydown: w[1] || (w[1] = Ne(te((V) => V.target.blur(), ["prevent"]), ["enter"])),
|
|
867
|
+
onClick: w[2] || (w[2] = (V) => S.value && !k.value ? F() : void 0)
|
|
796
868
|
}, [
|
|
797
|
-
|
|
798
|
-
value:
|
|
799
|
-
formatted:
|
|
869
|
+
Re(f.$slots, "default", {
|
|
870
|
+
value: s.value,
|
|
871
|
+
formatted: h.value
|
|
800
872
|
}, () => [
|
|
801
|
-
T(
|
|
873
|
+
T(m(h.value), 1)
|
|
802
874
|
])
|
|
803
|
-
], 42,
|
|
804
|
-
S.value && k.value ? (l(), N(
|
|
875
|
+
], 42, Yt),
|
|
876
|
+
S.value && k.value ? (l(), N(r(Me), {
|
|
805
877
|
key: 0,
|
|
806
|
-
tooltip:
|
|
878
|
+
tooltip: O.value,
|
|
807
879
|
placement: "top"
|
|
808
880
|
}, {
|
|
809
881
|
trigger: I(() => [
|
|
810
|
-
|
|
882
|
+
i("button", {
|
|
811
883
|
type: "button",
|
|
812
|
-
class:
|
|
813
|
-
onClick:
|
|
884
|
+
class: R(["tv-overlay inline-flex cursor-pointer items-center align-middle transition-transform duration-150 hover:scale-110", r(z)]),
|
|
885
|
+
onClick: F
|
|
814
886
|
}, [
|
|
815
|
-
x.value ? (l(), o("span",
|
|
887
|
+
x.value ? (l(), o("span", Jt, "✔")) : (l(), N(ce, {
|
|
816
888
|
key: 0,
|
|
817
889
|
status: $.value
|
|
818
890
|
}, null, 8, ["status"])),
|
|
819
|
-
|
|
891
|
+
_.value && !x.value ? (l(), o("span", Kt, "⚠")) : b("", !0)
|
|
820
892
|
], 2)
|
|
821
893
|
]),
|
|
822
894
|
_: 1
|
|
823
|
-
}, 8, ["tooltip"])) :
|
|
824
|
-
|
|
895
|
+
}, 8, ["tooltip"])) : b("", !0),
|
|
896
|
+
n.value ? (l(), N(qt, {
|
|
825
897
|
key: 1,
|
|
826
|
-
modelValue:
|
|
827
|
-
"onUpdate:modelValue": w[3] || (w[3] = (
|
|
828
|
-
meta:
|
|
898
|
+
modelValue: G.value,
|
|
899
|
+
"onUpdate:modelValue": w[3] || (w[3] = (V) => G.value = V),
|
|
900
|
+
meta: n.value,
|
|
829
901
|
label: e.field,
|
|
830
|
-
save:
|
|
831
|
-
}, null, 8, ["modelValue", "meta", "label", "save"])) :
|
|
832
|
-
]));
|
|
902
|
+
save: B.value
|
|
903
|
+
}, null, 8, ["modelValue", "meta", "label", "save"])) : b("", !0)
|
|
904
|
+
], 2));
|
|
833
905
|
}
|
|
834
|
-
}),
|
|
835
|
-
function Oe(e, t = "") {
|
|
836
|
-
const a = [];
|
|
837
|
-
return de(e, t, a), a;
|
|
838
|
-
}
|
|
839
|
-
function de(e, t, a) {
|
|
840
|
-
if (Array.isArray(e)) {
|
|
841
|
-
e.forEach((s, f) => de(s, `${t}[${f}]`, a));
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
|
-
if (!he(e)) return;
|
|
845
|
-
const m = e.__meta ?? {};
|
|
846
|
-
for (const [s, f] of Object.entries(e)) {
|
|
847
|
-
if (s === "__meta") continue;
|
|
848
|
-
const n = t ? `${t}.${s}` : s;
|
|
849
|
-
if (Array.isArray(f) || he(f)) {
|
|
850
|
-
de(f, n, a);
|
|
851
|
-
continue;
|
|
852
|
-
}
|
|
853
|
-
const b = m[s];
|
|
854
|
-
!b && Jt.has(s) || a.push({
|
|
855
|
-
path: n,
|
|
856
|
-
label: s,
|
|
857
|
-
meta: b ?? null,
|
|
858
|
-
value: f,
|
|
859
|
-
unanchored: !b
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
function he(e) {
|
|
864
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
865
|
-
}
|
|
866
|
-
function Kt(e) {
|
|
867
|
-
var s;
|
|
868
|
-
const t = Oe(e).filter(
|
|
869
|
-
(f) => f.meta !== null
|
|
870
|
-
), a = t.length;
|
|
871
|
-
let g = 0, m = 0;
|
|
872
|
-
for (const f of t) {
|
|
873
|
-
if (f.meta.candidates.override) {
|
|
874
|
-
g++;
|
|
875
|
-
continue;
|
|
876
|
-
}
|
|
877
|
-
const n = (s = f.meta.candidates.extracted) == null ? void 0 : s.confidence;
|
|
878
|
-
(f.meta.discrepancy || n == null || n <= 2) && m++;
|
|
879
|
-
}
|
|
880
|
-
return {
|
|
881
|
-
total: a,
|
|
882
|
-
verified: g,
|
|
883
|
-
needsReview: m,
|
|
884
|
-
percent: a === 0 ? 100 : Math.round(g / a * 100)
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
|
|
906
|
+
}), Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
|
|
888
907
|
key: 0,
|
|
889
908
|
class: "tv-comparison-empty text-gray-400"
|
|
890
909
|
}, Qt = {
|
|
@@ -902,61 +921,61 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
|
|
|
902
921
|
}, sa = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, ra = ["href"], ia = { key: 1 }, oa = { class: "ml-1" }, ua = {
|
|
903
922
|
key: 2,
|
|
904
923
|
class: "tv-unanchored-group flex flex-col gap-1"
|
|
905
|
-
}, da = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ca = { class: "tv-datapoint-value" }, va = /* @__PURE__ */
|
|
924
|
+
}, da = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ca = { class: "tv-datapoint-value" }, va = /* @__PURE__ */ H({
|
|
906
925
|
__name: "ComparisonPage",
|
|
907
926
|
setup(e) {
|
|
908
|
-
const t =
|
|
909
|
-
function
|
|
910
|
-
const
|
|
911
|
-
return
|
|
927
|
+
const t = ne(), a = d(() => Oe(t.data)), g = d(() => a.value.filter(($) => !$.unanchored)), p = d(() => a.value.filter(($) => $.unanchored));
|
|
928
|
+
function n($) {
|
|
929
|
+
const _ = pe($).value;
|
|
930
|
+
return _ == null ? "" : String(_);
|
|
912
931
|
}
|
|
913
|
-
function
|
|
932
|
+
function y($) {
|
|
914
933
|
return $ == null ? "" : String($);
|
|
915
934
|
}
|
|
916
|
-
function
|
|
917
|
-
var
|
|
918
|
-
return (k = (x = (
|
|
935
|
+
function s($) {
|
|
936
|
+
var _, x, k;
|
|
937
|
+
return (k = (x = (_ = $.meta) == null ? void 0 : _.candidates) == null ? void 0 : x.extracted) == null ? void 0 : k.confidence;
|
|
919
938
|
}
|
|
920
|
-
function
|
|
939
|
+
function h($) {
|
|
921
940
|
var k;
|
|
922
|
-
const
|
|
923
|
-
if (!
|
|
941
|
+
const _ = (k = $.meta) == null ? void 0 : k.candidates;
|
|
942
|
+
if (!_) return [];
|
|
924
943
|
const x = [];
|
|
925
|
-
return
|
|
944
|
+
return _.override && x.push({ source: "override", value: _.override.value }), _.extracted && x.push({ source: "extracted", value: _.extracted.value }), _.claim && x.push({ source: "claim", value: _.claim.value }), x;
|
|
926
945
|
}
|
|
927
|
-
return ($,
|
|
928
|
-
|
|
929
|
-
a.value.length === 0 ? (l(), o("p", Gt, " No data points to compare. ")) :
|
|
946
|
+
return ($, _) => (l(), o("div", Ht, [
|
|
947
|
+
_[1] || (_[1] = i("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
|
|
948
|
+
a.value.length === 0 ? (l(), o("p", Gt, " No data points to compare. ")) : b("", !0),
|
|
930
949
|
g.value.length ? (l(), o("section", Qt, [
|
|
931
|
-
(l(!0), o(L, null,
|
|
932
|
-
var k, S,
|
|
950
|
+
(l(!0), o(L, null, P(g.value, (x) => {
|
|
951
|
+
var k, S, A;
|
|
933
952
|
return l(), o("div", {
|
|
934
953
|
key: x.path,
|
|
935
954
|
class: "tv-datapoint border-t border-gray-100 pt-2"
|
|
936
955
|
}, [
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
confidence:
|
|
956
|
+
i("div", Wt, [
|
|
957
|
+
i("span", Xt, m(x.path), 1),
|
|
958
|
+
i("span", Zt, m(n(x.meta)), 1),
|
|
959
|
+
D(ce, {
|
|
960
|
+
confidence: s(x),
|
|
942
961
|
"show-label": ""
|
|
943
962
|
}, null, 8, ["confidence"]),
|
|
944
|
-
|
|
963
|
+
r(De)(x.meta) ? (l(), o("span", ea, "⚠ discrepancy")) : b("", !0)
|
|
945
964
|
]),
|
|
946
|
-
|
|
947
|
-
(l(!0), o(L, null,
|
|
965
|
+
i("ul", ta, [
|
|
966
|
+
(l(!0), o(L, null, P(h(x), (O) => (l(), o("li", {
|
|
948
967
|
key: O.source,
|
|
949
968
|
class: "tv-candidate"
|
|
950
969
|
}, [
|
|
951
|
-
|
|
952
|
-
T(" " + y(
|
|
970
|
+
i("span", aa, m(O.source) + ":", 1),
|
|
971
|
+
T(" " + m(y(O.value)), 1)
|
|
953
972
|
]))), 128))
|
|
954
973
|
]),
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
(l(!0), o(L, null,
|
|
959
|
-
key:
|
|
974
|
+
r(oe)(x.meta) ? (l(), o("p", la, m(r(oe)(x.meta)), 1)) : b("", !0),
|
|
975
|
+
r(ue)(x.meta) ? (l(), o("p", na, " “" + m(r(ue)(x.meta)) + "” ", 1)) : b("", !0),
|
|
976
|
+
i("ul", sa, [
|
|
977
|
+
(l(!0), o(L, null, P(r(Te)((A = (S = (k = x.meta) == null ? void 0 : k.candidates) == null ? void 0 : S.extracted) == null ? void 0 : A.sources), (O, M) => (l(), o("li", {
|
|
978
|
+
key: M,
|
|
960
979
|
class: "tv-source-group"
|
|
961
980
|
}, [
|
|
962
981
|
O.fileUrl ? (l(), o("a", {
|
|
@@ -965,41 +984,39 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
|
|
|
965
984
|
class: "tv-source-link text-blue-600 underline",
|
|
966
985
|
target: "_blank",
|
|
967
986
|
rel: "noopener"
|
|
968
|
-
},
|
|
969
|
-
|
|
987
|
+
}, m(O.fileLabel), 9, ra)) : (l(), o("span", ia, m(O.fileLabel), 1)),
|
|
988
|
+
i("span", oa, "(" + m(O.sources.map(r(ut)).join(", ")) + ")", 1)
|
|
970
989
|
]))), 128))
|
|
971
990
|
])
|
|
972
991
|
]);
|
|
973
992
|
}), 128))
|
|
974
|
-
])) :
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
(l(!0), o(L, null,
|
|
993
|
+
])) : b("", !0),
|
|
994
|
+
p.value.length ? (l(), o("section", ua, [
|
|
995
|
+
_[0] || (_[0] = i("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
|
|
996
|
+
(l(!0), o(L, null, P(p.value, (x) => (l(), o("div", {
|
|
978
997
|
key: x.path,
|
|
979
998
|
class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
|
|
980
999
|
}, [
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1000
|
+
i("span", da, m(x.path), 1),
|
|
1001
|
+
i("span", ca, m(y(x.value)), 1),
|
|
1002
|
+
D(ce, { status: "unverifiable" })
|
|
984
1003
|
]))), 128))
|
|
985
|
-
])) :
|
|
1004
|
+
])) : b("", !0)
|
|
986
1005
|
]));
|
|
987
1006
|
}
|
|
988
|
-
}), fa = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, pa = { class: "tv-progress-block" }, ma = { class: "mb-1 flex items-baseline justify-between" }, ga = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, wa = /* @__PURE__ */
|
|
1007
|
+
}), fa = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, pa = { class: "tv-progress-block" }, ma = { class: "mb-1 flex items-baseline justify-between" }, ga = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, wa = /* @__PURE__ */ H({
|
|
989
1008
|
__name: "VerificationChrome",
|
|
990
1009
|
setup(e) {
|
|
991
|
-
const t =
|
|
992
|
-
|
|
993
|
-
() =>
|
|
1010
|
+
const t = ne(), { enabled: a, openComparison: g } = t, p = Ge(), n = we(), y = U(!1), s = d(() => tt(t.data)), h = U(!1);
|
|
1011
|
+
ve(
|
|
1012
|
+
() => s.value.percent,
|
|
994
1013
|
(k) => {
|
|
995
|
-
k === 100 &&
|
|
1014
|
+
k === 100 && s.value.total > 0 && !h.value && (h.value = !0, n.success("All data points verified 🎯"));
|
|
996
1015
|
}
|
|
997
1016
|
);
|
|
998
1017
|
let $ = 0;
|
|
999
|
-
function
|
|
1000
|
-
const k = document.querySelectorAll(
|
|
1001
|
-
".tv-discrepancy-indicator, .tv-confidence-icon[data-status='low'], .tv-confidence-icon[data-status='unverifiable']"
|
|
1002
|
-
);
|
|
1018
|
+
function _() {
|
|
1019
|
+
const k = document.querySelectorAll(".tv-needs-review");
|
|
1003
1020
|
if (!k.length) return;
|
|
1004
1021
|
$ = $ % k.length;
|
|
1005
1022
|
const S = k[$];
|
|
@@ -1012,115 +1029,115 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
|
|
|
1012
1029
|
);
|
|
1013
1030
|
}
|
|
1014
1031
|
function x() {
|
|
1015
|
-
g(),
|
|
1032
|
+
g(), y.value = !1;
|
|
1016
1033
|
}
|
|
1017
1034
|
return (k, S) => (l(), o(L, null, [
|
|
1018
|
-
|
|
1035
|
+
i("button", {
|
|
1019
1036
|
type: "button",
|
|
1020
|
-
class:
|
|
1037
|
+
class: R(["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", r(z)]),
|
|
1021
1038
|
title: "Verification",
|
|
1022
|
-
onClick: S[0] || (S[0] = (
|
|
1039
|
+
onClick: S[0] || (S[0] = te((A) => y.value = !y.value, ["stop"]))
|
|
1023
1040
|
}, [
|
|
1024
|
-
|
|
1025
|
-
icon:
|
|
1041
|
+
D(r(Be), {
|
|
1042
|
+
icon: r(Fe),
|
|
1026
1043
|
class: "h-5 w-5"
|
|
1027
1044
|
}, null, 8, ["icon"]),
|
|
1028
|
-
|
|
1045
|
+
r(a) && s.value.needsReview > 0 ? (l(), N(r(qe), {
|
|
1029
1046
|
key: 0,
|
|
1030
|
-
value:
|
|
1047
|
+
value: s.value.needsReview,
|
|
1031
1048
|
variant: "warning",
|
|
1032
1049
|
class: "tv-needs-review-badge absolute -right-1 -top-1"
|
|
1033
|
-
}, null, 8, ["value"])) :
|
|
1050
|
+
}, null, 8, ["value"])) : b("", !0)
|
|
1034
1051
|
], 2),
|
|
1035
|
-
|
|
1052
|
+
y.value ? (l(), o("div", {
|
|
1036
1053
|
key: 0,
|
|
1037
|
-
class:
|
|
1054
|
+
class: R(["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", r(z)])
|
|
1038
1055
|
}, [
|
|
1039
|
-
|
|
1040
|
-
S[3] || (S[3] =
|
|
1041
|
-
Ae(
|
|
1042
|
-
"onUpdate:modelValue": S[1] || (S[1] = (
|
|
1056
|
+
i("label", fa, [
|
|
1057
|
+
S[3] || (S[3] = i("span", null, "Verification overlay", -1)),
|
|
1058
|
+
Ae(i("input", {
|
|
1059
|
+
"onUpdate:modelValue": S[1] || (S[1] = (A) => xe(a) ? a.value = A : null),
|
|
1043
1060
|
type: "checkbox",
|
|
1044
1061
|
class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
|
|
1045
1062
|
}, null, 512), [
|
|
1046
|
-
[
|
|
1063
|
+
[Le, r(a)]
|
|
1047
1064
|
])
|
|
1048
1065
|
]),
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
S[4] || (S[4] =
|
|
1053
|
-
|
|
1066
|
+
r(a) && s.value.total > 0 ? (l(), o(L, { key: 0 }, [
|
|
1067
|
+
i("div", pa, [
|
|
1068
|
+
i("div", ma, [
|
|
1069
|
+
S[4] || (S[4] = i("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
|
|
1070
|
+
i("span", ga, m(s.value.verified) + " / " + m(s.value.total), 1)
|
|
1054
1071
|
]),
|
|
1055
|
-
|
|
1056
|
-
value:
|
|
1057
|
-
max:
|
|
1072
|
+
D(r(ke), {
|
|
1073
|
+
value: s.value.verified,
|
|
1074
|
+
max: s.value.total,
|
|
1058
1075
|
size: "md",
|
|
1059
|
-
variant:
|
|
1060
|
-
striped:
|
|
1061
|
-
"animate-stripes":
|
|
1062
|
-
glow:
|
|
1076
|
+
variant: s.value.percent === 100 ? "success" : "info",
|
|
1077
|
+
striped: s.value.percent < 100,
|
|
1078
|
+
"animate-stripes": s.value.percent < 100,
|
|
1079
|
+
glow: s.value.percent === 100,
|
|
1063
1080
|
gradient: ""
|
|
1064
1081
|
}, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"])
|
|
1065
1082
|
]),
|
|
1066
|
-
|
|
1083
|
+
s.value.needsReview > 0 ? (l(), o("button", {
|
|
1067
1084
|
key: 0,
|
|
1068
1085
|
type: "button",
|
|
1069
|
-
class:
|
|
1070
|
-
onClick:
|
|
1086
|
+
class: R(["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", r(z)]),
|
|
1087
|
+
onClick: te(_, ["stop"])
|
|
1071
1088
|
}, [
|
|
1072
|
-
|
|
1073
|
-
S[5] || (S[5] =
|
|
1074
|
-
], 2)) :
|
|
1075
|
-
], 64)) :
|
|
1076
|
-
|
|
1089
|
+
i("span", null, m(s.value.needsReview) + " need" + m(s.value.needsReview === 1 ? "s" : "") + " review", 1),
|
|
1090
|
+
S[5] || (S[5] = i("span", { "aria-hidden": "true" }, "→", -1))
|
|
1091
|
+
], 2)) : b("", !0)
|
|
1092
|
+
], 64)) : b("", !0),
|
|
1093
|
+
i("button", {
|
|
1077
1094
|
type: "button",
|
|
1078
|
-
class:
|
|
1079
|
-
onClick: x
|
|
1095
|
+
class: R(["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", r(z)]),
|
|
1096
|
+
onClick: te(x, ["stop"])
|
|
1080
1097
|
}, " Open comparison page ", 2)
|
|
1081
|
-
], 2)) :
|
|
1082
|
-
|
|
1083
|
-
modelValue:
|
|
1084
|
-
"onUpdate:modelValue": S[2] || (S[2] = (
|
|
1098
|
+
], 2)) : b("", !0),
|
|
1099
|
+
D(r(ie), {
|
|
1100
|
+
modelValue: r(p),
|
|
1101
|
+
"onUpdate:modelValue": S[2] || (S[2] = (A) => xe(p) ? p.value = A : null),
|
|
1085
1102
|
title: "Verification comparison",
|
|
1086
1103
|
width: 80,
|
|
1087
1104
|
"close-x": "",
|
|
1088
|
-
class:
|
|
1105
|
+
class: R(r(z))
|
|
1089
1106
|
}, {
|
|
1090
1107
|
default: I(() => [
|
|
1091
|
-
|
|
1108
|
+
D(va)
|
|
1092
1109
|
]),
|
|
1093
1110
|
_: 1
|
|
1094
1111
|
}, 8, ["modelValue", "class"]),
|
|
1095
|
-
|
|
1096
|
-
class:
|
|
1112
|
+
D(r(Ye), {
|
|
1113
|
+
class: R(r(z))
|
|
1097
1114
|
}, null, 8, ["class"])
|
|
1098
1115
|
], 64));
|
|
1099
1116
|
}
|
|
1100
1117
|
});
|
|
1101
1118
|
export {
|
|
1102
|
-
|
|
1119
|
+
z as CHROME_CLASS,
|
|
1103
1120
|
va as ComparisonPage,
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1121
|
+
ce as ConfidenceIcon,
|
|
1122
|
+
$e as ENABLED_STORAGE_KEY,
|
|
1123
|
+
Ve as RESOLUTION_PRIORITY,
|
|
1124
|
+
Qe as STATUS_COLORS,
|
|
1125
|
+
le as STATUS_LABELS,
|
|
1109
1126
|
wa as VerificationChrome,
|
|
1110
|
-
|
|
1127
|
+
qt as VerificationModal,
|
|
1111
1128
|
_a as VerifiedField,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1129
|
+
fe as bucketConfidence,
|
|
1130
|
+
Xe as candidatesDisagree,
|
|
1131
|
+
ue as citedTextOf,
|
|
1132
|
+
tt as computeProgress,
|
|
1133
|
+
rt as fetchDataPointAudit,
|
|
1134
|
+
Te as groupSources,
|
|
1135
|
+
De as hasDiscrepancy,
|
|
1119
1136
|
ha as initVerification,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1137
|
+
oe as reasoningOf,
|
|
1138
|
+
We as resolveCandidates,
|
|
1139
|
+
pe as resolveDataPoint,
|
|
1140
|
+
ut as sourceRowLabel,
|
|
1141
|
+
ne as useVerification,
|
|
1125
1142
|
Oe as walkDataPoints
|
|
1126
1143
|
};
|