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