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