@thehammer/template-verification 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { ref as U, watch as ce, defineComponent as M, computed as v, openBlock as l, createElementBlock as s, normalizeClass as L, createElementVNode as n, toDisplayString as f, createCommentVNode as b, createBlock as W, unref as g, withCtx as X, createVNode as A, Fragment as V, renderList as T, createTextVNode as K, withDirectives as Z, vModelText as de, withKeys as ve, withModifiers as fe, renderSlot as pe, isRef as J, vModelCheckbox as me } from "vue";
2
- import { DanxDialog as ee, DanxIcon as _e, gearIcon as xe } from "@thehammer/danx-ui";
3
- const D = "tv-chrome", te = "template-verification:enabled";
4
- let P = null;
5
- function ye(e) {
1
+ import { ref as U, watch as me, defineComponent as P, computed as d, openBlock as l, createElementBlock as i, normalizeClass as I, createElementVNode as a, toDisplayString as p, createCommentVNode as h, Fragment as O, createVNode as D, unref as x, withCtx as j, createTextVNode as E, renderList as T, createBlock as F, withDirectives as le, vModelText as xe, withKeys as ge, withModifiers as ye, renderSlot as _e, isRef as te, vModelCheckbox as be } from "vue";
2
+ import { DanxDialog as G, DanxFile as he, DanxButton as Y, DanxFileViewer as we, DanxIcon as ke, gearIcon as Se } from "@thehammer/danx-ui";
3
+ const A = "tv-chrome", ae = "template-verification:enabled";
4
+ let R = null;
5
+ function $e(e) {
6
6
  var t;
7
7
  try {
8
8
  return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(e)) ?? null;
@@ -10,20 +10,20 @@ function ye(e) {
10
10
  return null;
11
11
  }
12
12
  }
13
- function ge(e, t) {
14
- var a;
13
+ function Ve(e, t) {
14
+ var n;
15
15
  try {
16
- (a = globalThis.localStorage) == null || a.setItem(e, t);
16
+ (n = globalThis.localStorage) == null || n.setItem(e, t);
17
17
  } catch {
18
18
  }
19
19
  }
20
- function he(e) {
21
- const t = ye(te);
20
+ function Ce(e) {
21
+ const t = $e(ae);
22
22
  return t === null ? e : t === "true";
23
23
  }
24
- function ae(e) {
25
- const t = U(he((e == null ? void 0 : e.defaultEnabled) ?? !1));
26
- return ce(t, (a) => ge(te, a ? "true" : "false")), {
24
+ function se(e) {
25
+ const t = U(Ce((e == null ? void 0 : e.defaultEnabled) ?? !1));
26
+ return me(t, (n) => Ve(ae, n ? "true" : "false")), {
27
27
  enabled: t,
28
28
  data: (e == null ? void 0 : e.data) ?? {},
29
29
  saveOverride: e == null ? void 0 : e.saveOverride,
@@ -31,14 +31,14 @@ function ae(e) {
31
31
  comparisonOpen: U(!1)
32
32
  };
33
33
  }
34
- function ne() {
35
- return P || (P = ae()), P;
34
+ function ie() {
35
+ return R || (R = se()), R;
36
36
  }
37
- function At(e) {
38
- P = ae(e);
37
+ function Bt(e) {
38
+ R = se(e);
39
39
  }
40
- function Y() {
41
- const e = ne();
40
+ function Q() {
41
+ const e = ie();
42
42
  return {
43
43
  enabled: e.enabled,
44
44
  data: e.data,
@@ -49,84 +49,84 @@ function Y() {
49
49
  }
50
50
  };
51
51
  }
52
- function be() {
53
- return ne().comparisonOpen;
52
+ function Oe() {
53
+ return ie().comparisonOpen;
54
54
  }
55
- function G(e) {
55
+ function W(e) {
56
56
  return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
57
57
  }
58
- const ke = {
59
- high: "text-green-600",
60
- medium: "text-yellow-500",
61
- low: "text-red-600",
62
- unverifiable: "text-gray-400"
63
- }, we = {
58
+ const Le = {
59
+ high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
60
+ medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
61
+ low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
62
+ unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20"
63
+ }, Ie = {
64
64
  high: "High",
65
65
  medium: "Medium",
66
66
  low: "Low",
67
67
  unverifiable: "Unverifiable"
68
- }, le = ["override", "extracted", "claim"];
69
- function H(e) {
70
- return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Se(e.candidates) : { value: null, source: "none" };
68
+ }, re = ["override", "extracted", "claim"];
69
+ function X(e) {
70
+ return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Ue(e.candidates) : { value: null, source: "none" };
71
71
  }
72
- function Se(e) {
72
+ function Ue(e) {
73
73
  if (e)
74
- for (const t of le) {
75
- const a = e[t];
76
- if (a != null)
77
- return { value: a.value, source: t };
74
+ for (const t of re) {
75
+ const n = e[t];
76
+ if (n != null)
77
+ return { value: n.value, source: t };
78
78
  }
79
79
  return { value: null, source: "none" };
80
80
  }
81
- function B(e) {
82
- var c, o;
83
- const t = (o = (c = e == null ? void 0 : e.candidates) == null ? void 0 : c.extracted) == null ? void 0 : o.reasoning;
81
+ function H(e) {
82
+ var f, r;
83
+ const t = (r = (f = e == null ? void 0 : e.candidates) == null ? void 0 : f.extracted) == null ? void 0 : r.reasoning;
84
84
  if (t == null) return null;
85
- const a = String(t).trim();
86
- return a === "" ? null : a;
85
+ const n = String(t).trim();
86
+ return n === "" ? null : n;
87
87
  }
88
- function F(e) {
89
- var c, o;
90
- const t = (o = (c = e == null ? void 0 : e.candidates) == null ? void 0 : c.extracted) == null ? void 0 : o.cited_text;
88
+ function q(e) {
89
+ var f, r;
90
+ const t = (r = (f = e == null ? void 0 : e.candidates) == null ? void 0 : f.extracted) == null ? void 0 : r.cited_text;
91
91
  if (t == null) return null;
92
- const a = String(t).trim();
93
- return a === "" ? null : a;
92
+ const n = String(t).trim();
93
+ return n === "" ? null : n;
94
94
  }
95
- function se(e) {
96
- return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : $e(e.candidates) : !1;
95
+ function oe(e) {
96
+ return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : De(e.candidates) : !1;
97
97
  }
98
- function $e(e) {
98
+ function De(e) {
99
99
  if (!e) return !1;
100
- const t = le.map((a) => e[a]).filter((a) => a != null).map((a) => Ce(a.value));
100
+ const t = re.map((n) => e[n]).filter((n) => n != null).map((n) => Ee(n.value));
101
101
  return t.length < 2 ? !1 : new Set(t).size > 1;
102
102
  }
103
- function Ce(e) {
103
+ function Ee(e) {
104
104
  return JSON.stringify(e ?? null);
105
105
  }
106
- function Ve(e, t, a) {
107
- var r;
108
- const c = (r = t.value) == null ? void 0 : r.anchor;
109
- if (!e.saveOverride || !c) return null;
110
- const o = e.saveOverride;
111
- return async (u, p) => {
112
- const _ = await o({
106
+ function Te(e, t, n) {
107
+ var o;
108
+ const f = (o = t.value) == null ? void 0 : o.anchor;
109
+ if (!e.saveOverride || !f) return null;
110
+ const r = e.saveOverride;
111
+ return async (c, g) => {
112
+ const b = await r({
113
113
  workflow_input_id: e.workflowInputId,
114
- object_ids: c.object_ids,
115
- field: c.field,
116
- field_path: c.field_path,
117
- value: u,
118
- source_choice: p
114
+ object_ids: f.object_ids,
115
+ field: f.field,
116
+ field_path: f.field_path,
117
+ value: c,
118
+ source_choice: g
119
119
  });
120
- return a(_), _;
120
+ return n(b), b;
121
121
  };
122
122
  }
123
- const Oe = ["data-status", "title"], Ie = {
123
+ const Ae = ["data-status", "title"], Ne = {
124
124
  class: "tv-confidence-glyph",
125
125
  "aria-hidden": "true"
126
- }, Le = {
126
+ }, je = {
127
127
  key: 0,
128
- class: "tv-confidence-label text-xs font-medium"
129
- }, j = /* @__PURE__ */ M({
128
+ class: "tv-confidence-label"
129
+ }, z = /* @__PURE__ */ P({
130
130
  __name: "ConfidenceIcon",
131
131
  props: {
132
132
  confidence: {},
@@ -134,9 +134,9 @@ const Oe = ["data-status", "title"], Ie = {
134
134
  showLabel: { type: Boolean }
135
135
  },
136
136
  setup(e) {
137
- const t = e, a = v(
138
- () => t.status ?? G(t.confidence)
139
- ), c = {
137
+ const t = e, n = d(
138
+ () => t.status ?? W(t.confidence)
139
+ ), f = {
140
140
  high: "✔",
141
141
  // check
142
142
  medium: "⚠",
@@ -144,53 +144,68 @@ const Oe = ["data-status", "title"], Ie = {
144
144
  low: "✕",
145
145
  // x
146
146
  unverifiable: "?"
147
- }, o = v(() => c[a.value]), r = v(() => ke[a.value]), u = v(() => we[a.value]);
148
- return (p, _) => (l(), s("span", {
149
- class: L(["tv-confidence-icon inline-flex items-center gap-1", r.value]),
150
- "data-status": a.value,
151
- title: u.value
147
+ }, r = d(() => f[n.value]), o = d(() => Le[n.value]), c = d(() => Ie[n.value]);
148
+ return (g, b) => (l(), i("span", {
149
+ class: I(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", o.value]),
150
+ "data-status": n.value,
151
+ title: c.value
152
152
  }, [
153
- n("span", Ie, f(o.value), 1),
154
- e.showLabel ? (l(), s("span", Le, f(u.value), 1)) : b("", !0)
155
- ], 10, Oe));
153
+ a("span", Ne, p(r.value), 1),
154
+ e.showLabel ? (l(), i("span", je, p(c.value), 1)) : h("", !0)
155
+ ], 10, Ae));
156
156
  }
157
157
  });
158
- function oe(e) {
158
+ function ue(e) {
159
159
  if (!e || e.length === 0) return [];
160
160
  const t = /* @__PURE__ */ new Map();
161
- for (const a of e) {
162
- const c = Ue(a);
163
- let o = t.get(c);
164
- o || (o = { fileLabel: Ee(a), fileUrl: a.file_url, sources: [] }, t.set(c, o)), !o.fileUrl && a.file_url && (o.fileUrl = a.file_url), o.sources.push(a);
161
+ for (const n of e) {
162
+ const f = Fe(n);
163
+ let r = t.get(f);
164
+ r || (r = {
165
+ fileLabel: Me(n),
166
+ fileUrl: n.file_url,
167
+ file: n.file,
168
+ sources: []
169
+ }, t.set(f, r)), !r.fileUrl && n.file_url && (r.fileUrl = n.file_url), !r.file && n.file && (r.file = n.file), r.sources.push(n);
165
170
  }
166
171
  return [...t.values()];
167
172
  }
168
- function Ue(e) {
173
+ function Fe(e) {
169
174
  const t = e.file_name ?? e.file_id ?? e.stored_file_id ?? e.source_id ?? e.id;
170
175
  return t != null ? String(t) : "__unknown__";
171
176
  }
172
- function Ee(e) {
173
- return e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
177
+ function Me(e) {
178
+ var t;
179
+ return (t = e.file) != null && t.name ? e.file.name : e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
174
180
  }
175
- function ie(e) {
181
+ function ce(e) {
176
182
  return e.page !== void 0 && e.page !== null ? `Page ${e.page}` : e.explanation ? String(e.explanation) : e.source_type ? String(e.source_type) : "Citation";
177
183
  }
178
- const Te = { class: "tv-modal flex flex-col gap-4 text-sm" }, Ae = { class: "tv-modal-resolved" }, De = { class: "flex items-center gap-2" }, Ne = { class: "tv-resolved-value font-semibold" }, Me = { class: "tv-resolved-source text-xs text-gray-500" }, Re = {
184
+ const Pe = { class: "tv-modal flex flex-col gap-5 p-4 text-sm text-gray-700" }, Re = { class: "tv-modal-resolved rounded-lg border border-gray-200 bg-gray-50 p-3" }, ze = { class: "mt-1.5 flex flex-wrap items-center gap-2" }, Be = { class: "tv-resolved-value text-lg font-semibold leading-tight text-gray-900" }, Ke = { class: "mt-1 font-mono text-[11px] text-gray-400" }, Ye = { class: "tv-resolved-source" }, Ge = {
179
185
  key: 0,
180
- class: "tv-discrepancy text-xs font-medium text-amber-600"
181
- }, Pe = { class: "tv-modal-candidates" }, je = { class: "w-full" }, Be = { class: "py-1 pr-2 font-medium" }, Fe = { class: "py-1 pr-2" }, ze = { class: "py-1 text-xs text-gray-500" }, Ke = {
186
+ class: "tv-discrepancy mt-2 inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20"
187
+ }, He = { class: "tv-modal-candidates" }, qe = { class: "mt-1.5 divide-y divide-gray-100 rounded-lg border border-gray-200" }, Je = { class: "w-20 shrink-0 text-xs font-medium text-gray-500" }, Qe = { class: "flex-1 truncate font-mono text-sm text-gray-800" }, We = { class: "shrink-0 text-[11px] text-gray-400" }, Xe = {
182
188
  key: 0,
183
- class: "tv-modal-provenance flex flex-col gap-1"
184
- }, Ye = { class: "tv-confidence-value" }, Ge = { class: "tv-reasoning whitespace-pre-line" }, He = { class: "tv-cited-text border-l-2 border-gray-200 pl-2 italic" }, qe = { class: "tv-modal-sources" }, Je = {
189
+ class: "tv-modal-provenance flex flex-col gap-2 rounded-lg border border-gray-200 p-3"
190
+ }, Ze = { class: "flex items-center justify-between" }, et = { class: "tv-confidence-value font-mono text-sm font-semibold text-gray-800" }, tt = { class: "tv-reasoning whitespace-pre-line text-sm leading-relaxed text-gray-600" }, nt = { class: "tv-cited-text rounded-md border-l-2 border-gray-300 bg-gray-50 py-1.5 pl-3 pr-2 text-sm italic leading-relaxed text-gray-600" }, lt = { class: "tv-modal-sources" }, at = {
185
191
  key: 0,
186
- class: "tv-no-source text-gray-400"
187
- }, Qe = { class: "font-medium" }, We = ["href"], Xe = {
192
+ class: "tv-no-source mt-1.5 text-sm text-gray-400"
193
+ }, st = {
188
194
  key: 1,
189
- class: "tv-source-name"
190
- }, Ze = { class: "ml-3 list-disc" }, et = {
195
+ class: "tv-source-grid mt-2 grid grid-cols-[repeat(auto-fill,minmax(4.5rem,1fr))] items-start gap-3"
196
+ }, it = { class: "relative" }, rt = ["href"], ot = {
197
+ key: 2,
198
+ class: "tv-source-name flex h-16 w-16 items-center justify-center rounded-md bg-gray-50 p-1 text-center text-[11px] leading-tight text-gray-500 ring-1 ring-gray-200"
199
+ }, ut = {
200
+ key: 3,
201
+ class: "tv-source-count pointer-events-none absolute -right-1.5 -top-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-gray-700 px-1 text-[9px] font-semibold text-white"
202
+ }, ct = ["title"], dt = {
203
+ key: 0,
204
+ class: "tv-source-citations flex flex-wrap justify-center gap-1"
205
+ }, ft = {
191
206
  key: 1,
192
- class: "tv-modal-resolution flex flex-col gap-2 border-t border-gray-200 pt-3"
193
- }, tt = { class: "flex flex-wrap gap-2" }, at = ["disabled"], nt = ["disabled"], lt = { class: "flex items-center gap-2" }, st = ["disabled"], ot = /* @__PURE__ */ M({
207
+ class: "tv-modal-resolution flex flex-col gap-2 border-t border-gray-200 pt-4"
208
+ }, vt = { class: "flex flex-wrap gap-2" }, pt = { class: "flex items-center gap-2" }, mt = /* @__PURE__ */ P({
194
209
  __name: "VerificationModal",
195
210
  props: {
196
211
  modelValue: { type: Boolean },
@@ -200,169 +215,255 @@ const Te = { class: "tv-modal flex flex-col gap-4 text-sm" }, Ae = { class: "tv-
200
215
  },
201
216
  emits: ["update:modelValue", "saved"],
202
217
  setup(e, { emit: t }) {
203
- const a = e, c = t, o = v({
204
- get: () => a.modelValue,
205
- set: (i) => c("update:modelValue", i)
206
- }), r = v(() => H(a.meta)), u = v(() => a.meta.candidates.extracted), p = v(() => a.meta.candidates.claim), _ = v(() => a.meta.candidates.override), k = v(() => {
207
- var i;
208
- return G((i = u.value) == null ? void 0 : i.confidence);
209
- }), m = v(() => B(a.meta)), d = v(() => F(a.meta)), $ = v(() => {
210
- var i;
211
- return oe((i = u.value) == null ? void 0 : i.sources);
212
- }), O = v(() => {
213
- const i = [];
214
- return _.value && i.push({ source: "Override", value: _.value.value, detail: _.value.source_choice ? `via ${_.value.source_choice}` : void 0 }), u.value && i.push({ source: "Extracted", value: u.value.value, detail: E(u.value.confidence) }), p.value && i.push({ source: "Claim", value: p.value.value, detail: p.value.claim_set_label ?? void 0 }), i;
215
- }), I = U(""), x = U(!1);
216
- function E(i) {
217
- return i == null ? "Unverifiable" : `${i}/5`;
218
+ const n = e, f = t, r = d({
219
+ get: () => n.modelValue,
220
+ set: (s) => f("update:modelValue", s)
221
+ }), o = d(() => X(n.meta)), c = d(() => n.meta.candidates.extracted), g = d(() => n.meta.candidates.claim), b = d(() => n.meta.candidates.override), w = d(
222
+ () => {
223
+ var s;
224
+ return W((s = c.value) == null ? void 0 : s.confidence);
225
+ }
226
+ ), y = d(() => H(n.meta)), v = d(() => q(n.meta)), $ = d(() => {
227
+ var s;
228
+ return ue((s = c.value) == null ? void 0 : s.sources);
229
+ }), L = d(
230
+ () => $.value.map((s) => s.file).filter((s) => !!s)
231
+ ), C = U(null), k = d({
232
+ get: () => C.value !== null,
233
+ set: (s) => {
234
+ s || (C.value = null);
235
+ }
236
+ });
237
+ function N(s) {
238
+ s.file && (C.value = s);
218
239
  }
219
- function R(i) {
220
- return i == null ? "" : String(i);
240
+ const B = d(() => {
241
+ const s = [];
242
+ return b.value && s.push({
243
+ source: "Override",
244
+ value: b.value.value,
245
+ detail: b.value.source_choice ? `via ${b.value.source_choice}` : void 0
246
+ }), c.value && s.push({
247
+ source: "Extracted",
248
+ value: c.value.value,
249
+ detail: S(c.value.confidence)
250
+ }), g.value && s.push({
251
+ source: "Claim",
252
+ value: g.value.value,
253
+ detail: g.value.claim_set_label ?? void 0
254
+ }), s;
255
+ }), M = U(""), _ = U(!1);
256
+ function S(s) {
257
+ return s == null ? "Unverifiable" : `${s}/5`;
221
258
  }
222
- async function N(i, y) {
223
- if (!(!a.save || x.value)) {
224
- x.value = !0;
259
+ function V(s) {
260
+ return s == null ? "" : String(s);
261
+ }
262
+ async function K(s, u) {
263
+ if (!(!n.save || _.value)) {
264
+ _.value = !0;
225
265
  try {
226
- const w = await a.save(i, y);
227
- c("saved", w);
266
+ const m = await n.save(s, u);
267
+ f("saved", m);
228
268
  } finally {
229
- x.value = !1;
269
+ _.value = !1;
230
270
  }
231
271
  }
232
272
  }
233
- const h = () => {
234
- var i;
235
- return N(q((i = u.value) == null ? void 0 : i.value), "extracted");
236
- }, S = () => {
237
- var i;
238
- return N(q((i = p.value) == null ? void 0 : i.value), "claim");
239
- }, C = () => N(I.value, "custom");
240
- function q(i) {
241
- return i == null ? null : String(i);
273
+ const de = () => {
274
+ var s;
275
+ return K(Z((s = c.value) == null ? void 0 : s.value), "extracted");
276
+ }, fe = () => {
277
+ var s;
278
+ return K(Z((s = g.value) == null ? void 0 : s.value), "claim");
279
+ }, ve = () => K(M.value, "custom");
280
+ function Z(s) {
281
+ return s == null ? null : String(s);
242
282
  }
243
- return (i, y) => (l(), W(g(ee), {
244
- modelValue: o.value,
245
- "onUpdate:modelValue": y[1] || (y[1] = (w) => o.value = w),
246
- title: e.label || "Verification detail",
247
- "close-x": "",
248
- class: L(g(D))
249
- }, {
250
- default: X(() => [
251
- n("div", Te, [
252
- n("section", Ae, [
253
- y[2] || (y[2] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Resolved value", -1)),
254
- n("div", De, [
255
- n("span", Ne, f(R(r.value.value)), 1),
256
- n("span", Me, "(" + f(r.value.source) + ")", 1),
257
- A(j, {
258
- status: k.value,
259
- "show-label": ""
260
- }, null, 8, ["status"])
283
+ return (s, u) => (l(), i(O, null, [
284
+ D(x(G), {
285
+ modelValue: r.value,
286
+ "onUpdate:modelValue": u[1] || (u[1] = (m) => r.value = m),
287
+ title: e.label || "Verification detail",
288
+ "close-x": "",
289
+ class: I(x(A))
290
+ }, {
291
+ default: j(() => [
292
+ a("div", Pe, [
293
+ a("section", Re, [
294
+ u[4] || (u[4] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
295
+ a("div", ze, [
296
+ a("span", Be, p(V(o.value.value) || "—"), 1),
297
+ D(z, {
298
+ status: w.value,
299
+ "show-label": ""
300
+ }, null, 8, ["status"])
301
+ ]),
302
+ a("div", Ke, [
303
+ u[3] || (u[3] = E(" source: ", -1)),
304
+ a("span", Ye, p(o.value.source), 1)
305
+ ]),
306
+ e.meta.discrepancy ? (l(), i("div", Ge, " ⚠ Sources disagree ")) : h("", !0)
261
307
  ]),
262
- e.meta.discrepancy ? (l(), s("div", Re, " ⚠ Sources disagree ")) : b("", !0)
263
- ]),
264
- n("section", Pe, [
265
- y[3] || (y[3] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Candidates", -1)),
266
- n("table", je, [
267
- n("tbody", null, [
268
- (l(!0), s(V, null, T(O.value, (w) => (l(), s("tr", {
269
- key: w.source,
270
- class: "tv-candidate-row border-t border-gray-100"
308
+ a("section", He, [
309
+ u[5] || (u[5] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Candidates ", -1)),
310
+ a("div", qe, [
311
+ (l(!0), i(O, null, T(B.value, (m) => (l(), i("div", {
312
+ key: m.source,
313
+ class: "tv-candidate-row flex items-center gap-3 px-3 py-2"
271
314
  }, [
272
- n("td", Be, f(w.source), 1),
273
- n("td", Fe, f(R(w.value)), 1),
274
- n("td", ze, f(w.detail), 1)
315
+ a("span", Je, p(m.source), 1),
316
+ a("span", Qe, p(V(m.value)), 1),
317
+ a("span", We, p(m.detail), 1)
275
318
  ]))), 128))
276
319
  ])
277
- ])
278
- ]),
279
- u.value ? (l(), s("section", Ke, [
280
- y[6] || (y[6] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Confidence", -1)),
281
- n("div", Ye, f(E(u.value.confidence)), 1),
282
- m.value ? (l(), s(V, { key: 0 }, [
283
- y[4] || (y[4] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Reasoning", -1)),
284
- n("p", Ge, f(m.value), 1)
285
- ], 64)) : b("", !0),
286
- d.value ? (l(), s(V, { key: 1 }, [
287
- y[5] || (y[5] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Cited text", -1)),
288
- n("blockquote", He, [
289
- K(f(d.value) + " ", 1),
290
- n("span", {
291
- class: L(["tv-cited-verified ml-1 text-xs", u.value.cited_text_verified ? "text-green-600" : "text-gray-400"])
292
- }, f(u.value.cited_text_verified ? "✔ verified" : "unverified"), 3)
293
- ])
294
- ], 64)) : b("", !0)
295
- ])) : b("", !0),
296
- n("section", qe, [
297
- y[7] || (y[7] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Sources", -1)),
298
- $.value.length === 0 ? (l(), s("div", Je, "No source recorded")) : b("", !0),
299
- (l(!0), s(V, null, T($.value, (w) => (l(), s("div", {
300
- key: w.fileLabel,
301
- class: "tv-source-group"
302
- }, [
303
- n("div", Qe, [
304
- w.fileUrl ? (l(), s("a", {
305
- key: 0,
306
- href: w.fileUrl,
307
- class: "tv-source-link text-blue-600 underline",
308
- target: "_blank",
309
- rel: "noopener"
310
- }, f(w.fileLabel), 9, We)) : (l(), s("span", Xe, f(w.fileLabel), 1))
320
+ ]),
321
+ c.value ? (l(), i("section", Xe, [
322
+ a("div", Ze, [
323
+ u[6] || (u[6] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Confidence ", -1)),
324
+ a("div", et, p(S(c.value.confidence)), 1)
311
325
  ]),
312
- n("ul", Ze, [
313
- (l(!0), s(V, null, T(w.sources, (re, ue) => (l(), s("li", {
314
- key: ue,
315
- class: "tv-source-row text-xs text-gray-600"
316
- }, f(g(ie)(re)), 1))), 128))
317
- ])
318
- ]))), 128))
319
- ]),
320
- e.save ? (l(), s("section", et, [
321
- y[8] || (y[8] = n("div", { class: "text-xs uppercase tracking-wide text-gray-500" }, "Resolve", -1)),
322
- n("div", tt, [
323
- u.value ? (l(), s("button", {
324
- key: 0,
325
- type: "button",
326
- class: "tv-accept-extracted rounded border px-2 py-1",
327
- disabled: x.value,
328
- onClick: h
329
- }, "Accept extracted", 8, at)) : b("", !0),
330
- p.value ? (l(), s("button", {
331
- key: 1,
332
- type: "button",
333
- class: "tv-accept-claim rounded border px-2 py-1",
334
- disabled: x.value,
335
- onClick: S
336
- }, "Accept claim", 8, nt)) : b("", !0)
326
+ y.value ? (l(), i(O, { key: 0 }, [
327
+ u[7] || (u[7] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
328
+ a("p", tt, p(y.value), 1)
329
+ ], 64)) : h("", !0),
330
+ v.value ? (l(), i(O, { key: 1 }, [
331
+ u[8] || (u[8] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Cited text ", -1)),
332
+ a("blockquote", nt, [
333
+ E(p(v.value) + " ", 1),
334
+ a("span", {
335
+ class: I([
336
+ "tv-cited-verified ml-1 not-italic text-[11px] font-medium",
337
+ c.value.cited_text_verified ? "text-green-600" : "text-gray-400"
338
+ ])
339
+ }, p(c.value.cited_text_verified ? "✔ verified" : "unverified"), 3)
340
+ ])
341
+ ], 64)) : h("", !0)
342
+ ])) : h("", !0),
343
+ a("section", lt, [
344
+ u[9] || (u[9] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Sources ", -1)),
345
+ $.value.length === 0 ? (l(), i("div", at, " No source recorded ")) : (l(), i("div", st, [
346
+ (l(!0), i(O, null, T($.value, (m) => (l(), i("div", {
347
+ key: m.fileLabel,
348
+ class: "tv-source-group flex flex-col items-center gap-1"
349
+ }, [
350
+ a("div", it, [
351
+ m.file ? (l(), F(x(he), {
352
+ key: 0,
353
+ file: m.file,
354
+ size: "sm",
355
+ class: "tv-source-thumb cursor-pointer rounded-md ring-1 ring-gray-200 transition duration-150 hover:-translate-y-0.5 hover:shadow-md hover:ring-gray-300",
356
+ onClick: (ee) => N(m)
357
+ }, null, 8, ["file", "onClick"])) : m.fileUrl ? (l(), i("a", {
358
+ key: 1,
359
+ href: m.fileUrl,
360
+ class: "tv-source-link flex h-16 w-16 items-center justify-center rounded-md bg-gray-50 p-1 text-center text-[11px] font-medium leading-tight text-blue-600 underline ring-1 ring-gray-200",
361
+ target: "_blank",
362
+ rel: "noopener"
363
+ }, p(m.fileLabel), 9, rt)) : (l(), i("span", ot, p(m.fileLabel), 1)),
364
+ m.sources.length > 1 ? (l(), i("span", ut, "×" + p(m.sources.length), 1)) : h("", !0)
365
+ ]),
366
+ a("span", {
367
+ class: "tv-source-file-label w-full truncate text-center text-[11px] text-gray-500",
368
+ title: m.fileLabel
369
+ }, p(m.fileLabel), 9, ct),
370
+ m.sources.length > 1 ? (l(), i("ul", dt, [
371
+ (l(!0), i(O, null, T(m.sources, (ee, pe) => (l(), i("li", {
372
+ key: pe,
373
+ class: "tv-source-row rounded bg-gray-100 px-1 py-0.5 font-mono text-[10px] text-gray-500"
374
+ }, p(x(ce)(ee)), 1))), 128))
375
+ ])) : h("", !0)
376
+ ]))), 128))
377
+ ]))
337
378
  ]),
338
- n("div", lt, [
339
- Z(n("input", {
340
- "onUpdate:modelValue": y[0] || (y[0] = (w) => I.value = w),
341
- type: "text",
342
- class: "tv-custom-input flex-1 rounded border px-2 py-1",
343
- placeholder: "Type a custom value"
344
- }, null, 512), [
345
- [de, I.value]
379
+ e.save ? (l(), i("section", ft, [
380
+ u[13] || (u[13] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolve ", -1)),
381
+ a("div", vt, [
382
+ c.value ? (l(), F(x(Y), {
383
+ key: 0,
384
+ variant: "info",
385
+ size: "sm",
386
+ class: "tv-accept-extracted",
387
+ disabled: _.value,
388
+ onClick: de
389
+ }, {
390
+ default: j(() => [...u[10] || (u[10] = [
391
+ E("Accept extracted", -1)
392
+ ])]),
393
+ _: 1
394
+ }, 8, ["disabled"])) : h("", !0),
395
+ g.value ? (l(), F(x(Y), {
396
+ key: 1,
397
+ variant: "muted",
398
+ size: "sm",
399
+ class: "tv-accept-claim",
400
+ disabled: _.value,
401
+ onClick: fe
402
+ }, {
403
+ default: j(() => [...u[11] || (u[11] = [
404
+ E("Accept claim", -1)
405
+ ])]),
406
+ _: 1
407
+ }, 8, ["disabled"])) : h("", !0)
346
408
  ]),
347
- n("button", {
348
- type: "button",
349
- class: "tv-accept-custom rounded border px-2 py-1",
350
- disabled: x.value,
351
- onClick: C
352
- }, "Type custom", 8, st)
353
- ])
354
- ])) : b("", !0)
355
- ])
356
- ]),
357
- _: 1
358
- }, 8, ["modelValue", "title", "class"]));
409
+ a("div", pt, [
410
+ le(a("input", {
411
+ "onUpdate:modelValue": u[0] || (u[0] = (m) => M.value = m),
412
+ type: "text",
413
+ class: "tv-custom-input flex-1 rounded-md border border-gray-300 px-2 py-1.5 text-sm text-gray-800 outline-none transition focus:border-gray-400 focus:ring-2 focus:ring-gray-200",
414
+ placeholder: "Type a custom value"
415
+ }, null, 512), [
416
+ [xe, M.value]
417
+ ]),
418
+ D(x(Y), {
419
+ variant: "success",
420
+ size: "sm",
421
+ class: "tv-accept-custom",
422
+ disabled: _.value,
423
+ onClick: ve
424
+ }, {
425
+ default: j(() => [...u[12] || (u[12] = [
426
+ E("Type custom", -1)
427
+ ])]),
428
+ _: 1
429
+ }, 8, ["disabled"])
430
+ ])
431
+ ])) : h("", !0)
432
+ ])
433
+ ]),
434
+ _: 1
435
+ }, 8, ["modelValue", "title", "class"]),
436
+ C.value ? (l(), F(x(G), {
437
+ key: 0,
438
+ modelValue: k.value,
439
+ "onUpdate:modelValue": u[2] || (u[2] = (m) => k.value = m),
440
+ width: 90,
441
+ height: 90,
442
+ "close-x": "",
443
+ class: I(x(A))
444
+ }, {
445
+ default: j(() => [
446
+ C.value.file ? (l(), F(x(we), {
447
+ key: 0,
448
+ file: C.value.file,
449
+ "related-files": L.value,
450
+ "children-label": "Pages",
451
+ continuous: "",
452
+ sidebar: "",
453
+ zoomable: "",
454
+ class: "h-full"
455
+ }, null, 8, ["file", "related-files"])) : h("", !0)
456
+ ]),
457
+ _: 1
458
+ }, 8, ["modelValue", "class"])) : h("", !0)
459
+ ], 64));
359
460
  }
360
- }), it = { class: "tv-field inline-flex items-center gap-1" }, rt = ["contenteditable", "data-editable"], ut = {
461
+ }), xt = { class: "tv-field inline-flex items-center gap-1" }, gt = ["contenteditable", "data-editable"], yt = {
361
462
  key: 0,
362
463
  class: "tv-discrepancy-indicator ml-0.5 text-amber-600",
363
464
  title: "Sources disagree",
364
465
  "aria-label": "discrepancy"
365
- }, Dt = /* @__PURE__ */ M({
466
+ }, Kt = /* @__PURE__ */ P({
366
467
  __name: "VerifiedField",
367
468
  props: {
368
469
  source: {},
@@ -371,251 +472,251 @@ const Te = { class: "tv-modal flex flex-col gap-4 text-sm" }, Ae = { class: "tv-
371
472
  format: { type: Function }
372
473
  },
373
474
  setup(e) {
374
- const t = e, a = Y(), c = v(() => a.enabled.value), o = U(null), r = v(() => {
375
- var h;
376
- return o.value ? o.value : t.source && t.field ? ((h = t.source.__meta) == null ? void 0 : h[t.field]) ?? null : null;
377
- }), u = v(() => H(r.value)), p = v(() => {
475
+ const t = e, n = Q(), f = d(() => n.enabled.value), r = U(null), o = d(() => {
476
+ var _;
477
+ return r.value ? r.value : t.source && t.field ? ((_ = t.source.__meta) == null ? void 0 : _[t.field]) ?? null : null;
478
+ }), c = d(() => X(o.value)), g = d(() => {
378
479
  if (t.original !== void 0 && t.original !== null) return t.original;
379
- if (r.value) return u.value.value;
480
+ if (o.value) return c.value.value;
380
481
  if (t.source && t.field) return t.source[t.field];
381
- }), _ = v(() => {
382
- const h = p.value;
383
- return h == null ? "" : t.format ? t.format(h) : String(h);
384
- }), k = v(() => {
385
- var h, S, C;
386
- return G((C = (S = (h = r.value) == null ? void 0 : h.candidates) == null ? void 0 : S.extracted) == null ? void 0 : C.confidence);
387
- }), m = v(() => se(r.value)), d = v(() => c.value && !!r.value);
388
- function $(h) {
482
+ }), b = d(() => {
483
+ const _ = g.value;
484
+ return _ == null ? "" : t.format ? t.format(_) : String(_);
485
+ }), w = d(() => {
486
+ var _, S, V;
487
+ return W((V = (S = (_ = o.value) == null ? void 0 : _.candidates) == null ? void 0 : S.extracted) == null ? void 0 : V.confidence);
488
+ }), y = d(() => oe(o.value)), v = d(() => f.value && !!o.value);
489
+ function $(_) {
389
490
  var S;
390
- o.value = h, (S = t.source) != null && S.__meta && t.field && (t.source.__meta[t.field] = h);
491
+ r.value = _, (S = t.source) != null && S.__meta && t.field && (t.source.__meta[t.field] = _);
391
492
  }
392
- const O = v(() => Ve(a, r, $)), I = v(() => !!O.value), x = U(!1), E = U(!1);
393
- function R() {
394
- r.value && (x.value = !0);
493
+ const L = d(() => Te(n, o, $)), C = d(() => !!L.value), k = U(!1), N = U(!1);
494
+ function B() {
495
+ o.value && (k.value = !0);
395
496
  }
396
- async function N(h) {
397
- E.value = !1;
398
- const C = (h.target.textContent ?? "").trim();
399
- !O.value || C === _.value || await O.value(C, "custom");
497
+ async function M(_) {
498
+ N.value = !1;
499
+ const V = (_.target.textContent ?? "").trim();
500
+ !L.value || V === b.value || await L.value(V, "custom");
400
501
  }
401
- return (h, S) => (l(), s("span", it, [
402
- n("span", {
502
+ return (_, S) => (l(), i("span", xt, [
503
+ a("span", {
403
504
  class: "tv-field-value",
404
- contenteditable: I.value,
405
- "data-editable": I.value ? "true" : "false",
406
- onFocus: S[0] || (S[0] = (C) => E.value = !0),
407
- onBlur: N,
408
- onKeydown: S[1] || (S[1] = ve(fe((C) => C.target.blur(), ["prevent"]), ["enter"]))
505
+ contenteditable: C.value,
506
+ "data-editable": C.value ? "true" : "false",
507
+ onFocus: S[0] || (S[0] = (V) => N.value = !0),
508
+ onBlur: M,
509
+ onKeydown: S[1] || (S[1] = ge(ye((V) => V.target.blur(), ["prevent"]), ["enter"]))
409
510
  }, [
410
- pe(h.$slots, "default", {
411
- value: p.value,
412
- formatted: _.value
511
+ _e(_.$slots, "default", {
512
+ value: g.value,
513
+ formatted: b.value
413
514
  }, () => [
414
- K(f(_.value), 1)
515
+ E(p(b.value), 1)
415
516
  ])
416
- ], 40, rt),
417
- d.value ? (l(), s("button", {
517
+ ], 40, gt),
518
+ v.value ? (l(), i("button", {
418
519
  key: 0,
419
520
  type: "button",
420
- class: L(["tv-overlay ml-1 inline-flex items-center", g(D)]),
521
+ class: I(["tv-overlay ml-1 inline-flex items-center", x(A)]),
421
522
  title: "View verification detail",
422
- onClick: R
523
+ onClick: B
423
524
  }, [
424
- A(j, { status: k.value }, null, 8, ["status"]),
425
- m.value ? (l(), s("span", ut, "⚠")) : b("", !0)
426
- ], 2)) : b("", !0),
427
- r.value ? (l(), W(ot, {
525
+ D(z, { status: w.value }, null, 8, ["status"]),
526
+ y.value ? (l(), i("span", yt, "⚠")) : h("", !0)
527
+ ], 2)) : h("", !0),
528
+ o.value ? (l(), F(mt, {
428
529
  key: 1,
429
- modelValue: x.value,
430
- "onUpdate:modelValue": S[2] || (S[2] = (C) => x.value = C),
431
- meta: r.value,
530
+ modelValue: k.value,
531
+ "onUpdate:modelValue": S[2] || (S[2] = (V) => k.value = V),
532
+ meta: o.value,
432
533
  label: e.field,
433
- save: O.value
434
- }, null, 8, ["modelValue", "meta", "label", "save"])) : b("", !0)
534
+ save: L.value
535
+ }, null, 8, ["modelValue", "meta", "label", "save"])) : h("", !0)
435
536
  ]));
436
537
  }
437
- }), ct = /* @__PURE__ */ new Set(["name", "type"]);
438
- function dt(e, t = "") {
439
- const a = [];
440
- return z(e, t, a), a;
538
+ }), _t = /* @__PURE__ */ new Set(["name", "type"]);
539
+ function bt(e, t = "") {
540
+ const n = [];
541
+ return J(e, t, n), n;
441
542
  }
442
- function z(e, t, a) {
543
+ function J(e, t, n) {
443
544
  if (Array.isArray(e)) {
444
- e.forEach((r, u) => z(r, `${t}[${u}]`, a));
545
+ e.forEach((o, c) => J(o, `${t}[${c}]`, n));
445
546
  return;
446
547
  }
447
- if (!Q(e)) return;
448
- const o = e.__meta ?? {};
449
- for (const [r, u] of Object.entries(e)) {
450
- if (r === "__meta") continue;
451
- const p = t ? `${t}.${r}` : r;
452
- if (Array.isArray(u) || Q(u)) {
453
- z(u, p, a);
548
+ if (!ne(e)) return;
549
+ const r = e.__meta ?? {};
550
+ for (const [o, c] of Object.entries(e)) {
551
+ if (o === "__meta") continue;
552
+ const g = t ? `${t}.${o}` : o;
553
+ if (Array.isArray(c) || ne(c)) {
554
+ J(c, g, n);
454
555
  continue;
455
556
  }
456
- const _ = o[r];
457
- !_ && ct.has(r) || a.push({
458
- path: p,
459
- label: r,
460
- meta: _ ?? null,
461
- value: u,
462
- unanchored: !_
557
+ const b = r[o];
558
+ !b && _t.has(o) || n.push({
559
+ path: g,
560
+ label: o,
561
+ meta: b ?? null,
562
+ value: c,
563
+ unanchored: !b
463
564
  });
464
565
  }
465
566
  }
466
- function Q(e) {
567
+ function ne(e) {
467
568
  return typeof e == "object" && e !== null && !Array.isArray(e);
468
569
  }
469
- const vt = { class: "tv-comparison-page flex flex-col gap-4" }, ft = {
570
+ const ht = { class: "tv-comparison-page flex flex-col gap-4" }, wt = {
470
571
  key: 0,
471
572
  class: "tv-comparison-empty text-gray-400"
472
- }, pt = {
573
+ }, kt = {
473
574
  key: 1,
474
575
  class: "tv-anchored-group flex flex-col gap-3"
475
- }, mt = { class: "flex items-center gap-2" }, _t = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, xt = { class: "tv-datapoint-resolved font-medium" }, yt = {
576
+ }, St = { class: "flex items-center gap-2" }, $t = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, Vt = { class: "tv-datapoint-resolved font-medium" }, Ct = {
476
577
  key: 0,
477
578
  class: "tv-datapoint-discrepancy text-xs font-medium text-amber-600"
478
- }, gt = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, ht = { class: "font-medium" }, bt = {
579
+ }, Ot = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, Lt = { class: "font-medium" }, It = {
479
580
  key: 0,
480
581
  class: "tv-datapoint-reasoning ml-4 text-xs italic text-gray-500"
481
- }, kt = {
582
+ }, Ut = {
482
583
  key: 1,
483
584
  class: "tv-datapoint-cited ml-4 text-xs text-gray-500"
484
- }, wt = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, St = ["href"], $t = { key: 1 }, Ct = { class: "ml-1" }, Vt = {
585
+ }, Dt = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, Et = ["href"], Tt = { key: 1 }, At = { class: "ml-1" }, Nt = {
485
586
  key: 2,
486
587
  class: "tv-unanchored-group flex flex-col gap-1"
487
- }, Ot = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, It = { class: "tv-datapoint-value" }, Lt = /* @__PURE__ */ M({
588
+ }, jt = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, Ft = { class: "tv-datapoint-value" }, Mt = /* @__PURE__ */ P({
488
589
  __name: "ComparisonPage",
489
590
  setup(e) {
490
- const t = Y(), a = v(() => dt(t.data)), c = v(() => a.value.filter((k) => !k.unanchored)), o = v(() => a.value.filter((k) => k.unanchored));
491
- function r(k) {
492
- const m = H(k).value;
493
- return m == null ? "" : String(m);
591
+ const t = Q(), n = d(() => bt(t.data)), f = d(() => n.value.filter((w) => !w.unanchored)), r = d(() => n.value.filter((w) => w.unanchored));
592
+ function o(w) {
593
+ const y = X(w).value;
594
+ return y == null ? "" : String(y);
494
595
  }
495
- function u(k) {
496
- return k == null ? "" : String(k);
596
+ function c(w) {
597
+ return w == null ? "" : String(w);
497
598
  }
498
- function p(k) {
499
- var m, d, $;
500
- return ($ = (d = (m = k.meta) == null ? void 0 : m.candidates) == null ? void 0 : d.extracted) == null ? void 0 : $.confidence;
599
+ function g(w) {
600
+ var y, v, $;
601
+ return ($ = (v = (y = w.meta) == null ? void 0 : y.candidates) == null ? void 0 : v.extracted) == null ? void 0 : $.confidence;
501
602
  }
502
- function _(k) {
603
+ function b(w) {
503
604
  var $;
504
- const m = ($ = k.meta) == null ? void 0 : $.candidates;
505
- if (!m) return [];
506
- const d = [];
507
- return m.override && d.push({ source: "override", value: m.override.value }), m.extracted && d.push({ source: "extracted", value: m.extracted.value }), m.claim && d.push({ source: "claim", value: m.claim.value }), d;
605
+ const y = ($ = w.meta) == null ? void 0 : $.candidates;
606
+ if (!y) return [];
607
+ const v = [];
608
+ return y.override && v.push({ source: "override", value: y.override.value }), y.extracted && v.push({ source: "extracted", value: y.extracted.value }), y.claim && v.push({ source: "claim", value: y.claim.value }), v;
508
609
  }
509
- return (k, m) => (l(), s("div", vt, [
510
- m[1] || (m[1] = n("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
511
- a.value.length === 0 ? (l(), s("p", ft, " No data points to compare. ")) : b("", !0),
512
- c.value.length ? (l(), s("section", pt, [
513
- (l(!0), s(V, null, T(c.value, (d) => {
514
- var $, O, I;
515
- return l(), s("div", {
516
- key: d.path,
610
+ return (w, y) => (l(), i("div", ht, [
611
+ y[1] || (y[1] = a("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
612
+ n.value.length === 0 ? (l(), i("p", wt, " No data points to compare. ")) : h("", !0),
613
+ f.value.length ? (l(), i("section", kt, [
614
+ (l(!0), i(O, null, T(f.value, (v) => {
615
+ var $, L, C;
616
+ return l(), i("div", {
617
+ key: v.path,
517
618
  class: "tv-datapoint border-t border-gray-100 pt-2"
518
619
  }, [
519
- n("div", mt, [
520
- n("span", _t, f(d.path), 1),
521
- n("span", xt, f(r(d.meta)), 1),
522
- A(j, {
523
- confidence: p(d),
620
+ a("div", St, [
621
+ a("span", $t, p(v.path), 1),
622
+ a("span", Vt, p(o(v.meta)), 1),
623
+ D(z, {
624
+ confidence: g(v),
524
625
  "show-label": ""
525
626
  }, null, 8, ["confidence"]),
526
- g(se)(d.meta) ? (l(), s("span", yt, "⚠ discrepancy")) : b("", !0)
627
+ x(oe)(v.meta) ? (l(), i("span", Ct, "⚠ discrepancy")) : h("", !0)
527
628
  ]),
528
- n("ul", gt, [
529
- (l(!0), s(V, null, T(_(d), (x) => (l(), s("li", {
530
- key: x.source,
629
+ a("ul", Ot, [
630
+ (l(!0), i(O, null, T(b(v), (k) => (l(), i("li", {
631
+ key: k.source,
531
632
  class: "tv-candidate"
532
633
  }, [
533
- n("span", ht, f(x.source) + ":", 1),
534
- K(" " + f(u(x.value)), 1)
634
+ a("span", Lt, p(k.source) + ":", 1),
635
+ E(" " + p(c(k.value)), 1)
535
636
  ]))), 128))
536
637
  ]),
537
- g(B)(d.meta) ? (l(), s("p", bt, f(g(B)(d.meta)), 1)) : b("", !0),
538
- g(F)(d.meta) ? (l(), s("p", kt, " “" + f(g(F)(d.meta)) + "” ", 1)) : b("", !0),
539
- n("ul", wt, [
540
- (l(!0), s(V, null, T(g(oe)((I = (O = ($ = d.meta) == null ? void 0 : $.candidates) == null ? void 0 : O.extracted) == null ? void 0 : I.sources), (x, E) => (l(), s("li", {
541
- key: E,
638
+ x(H)(v.meta) ? (l(), i("p", It, p(x(H)(v.meta)), 1)) : h("", !0),
639
+ x(q)(v.meta) ? (l(), i("p", Ut, " “" + p(x(q)(v.meta)) + "” ", 1)) : h("", !0),
640
+ a("ul", Dt, [
641
+ (l(!0), i(O, null, T(x(ue)((C = (L = ($ = v.meta) == null ? void 0 : $.candidates) == null ? void 0 : L.extracted) == null ? void 0 : C.sources), (k, N) => (l(), i("li", {
642
+ key: N,
542
643
  class: "tv-source-group"
543
644
  }, [
544
- x.fileUrl ? (l(), s("a", {
645
+ k.fileUrl ? (l(), i("a", {
545
646
  key: 0,
546
- href: x.fileUrl,
647
+ href: k.fileUrl,
547
648
  class: "tv-source-link text-blue-600 underline",
548
649
  target: "_blank",
549
650
  rel: "noopener"
550
- }, f(x.fileLabel), 9, St)) : (l(), s("span", $t, f(x.fileLabel), 1)),
551
- n("span", Ct, "(" + f(x.sources.map(g(ie)).join(", ")) + ")", 1)
651
+ }, p(k.fileLabel), 9, Et)) : (l(), i("span", Tt, p(k.fileLabel), 1)),
652
+ a("span", At, "(" + p(k.sources.map(x(ce)).join(", ")) + ")", 1)
552
653
  ]))), 128))
553
654
  ])
554
655
  ]);
555
656
  }), 128))
556
- ])) : b("", !0),
557
- o.value.length ? (l(), s("section", Vt, [
558
- m[0] || (m[0] = n("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
559
- (l(!0), s(V, null, T(o.value, (d) => (l(), s("div", {
560
- key: d.path,
657
+ ])) : h("", !0),
658
+ r.value.length ? (l(), i("section", Nt, [
659
+ y[0] || (y[0] = a("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
660
+ (l(!0), i(O, null, T(r.value, (v) => (l(), i("div", {
661
+ key: v.path,
561
662
  class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
562
663
  }, [
563
- n("span", Ot, f(d.path), 1),
564
- n("span", It, f(u(d.value)), 1),
565
- A(j, { status: "unverifiable" })
664
+ a("span", jt, p(v.path), 1),
665
+ a("span", Ft, p(c(v.value)), 1),
666
+ D(z, { status: "unverifiable" })
566
667
  ]))), 128))
567
- ])) : b("", !0)
668
+ ])) : h("", !0)
568
669
  ]));
569
670
  }
570
- }), Ut = { class: "tv-enable-toggle flex items-center justify-between text-sm" }, Nt = /* @__PURE__ */ M({
671
+ }), Pt = { class: "tv-enable-toggle flex items-center justify-between text-sm" }, Yt = /* @__PURE__ */ P({
571
672
  __name: "VerificationChrome",
572
673
  setup(e) {
573
- const { enabled: t, openComparison: a } = Y(), c = be(), o = U(!1);
574
- function r() {
575
- a(), o.value = !1;
674
+ const { enabled: t, openComparison: n } = Q(), f = Oe(), r = U(!1);
675
+ function o() {
676
+ n(), r.value = !1;
576
677
  }
577
- return (u, p) => (l(), s(V, null, [
578
- n("button", {
678
+ return (c, g) => (l(), i(O, null, [
679
+ a("button", {
579
680
  type: "button",
580
- class: L(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-10 w-10 items-center justify-center rounded-full bg-gray-800 text-white shadow-lg", g(D)]),
681
+ class: I(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-10 w-10 items-center justify-center rounded-full bg-gray-800 text-white shadow-lg", x(A)]),
581
682
  title: "Verification settings",
582
- onClick: p[0] || (p[0] = (_) => o.value = !o.value)
683
+ onClick: g[0] || (g[0] = (b) => r.value = !r.value)
583
684
  }, [
584
- A(g(_e), {
585
- icon: g(xe),
685
+ D(x(ke), {
686
+ icon: x(Se),
586
687
  class: "h-5 w-5"
587
688
  }, null, 8, ["icon"])
588
689
  ], 2),
589
- o.value ? (l(), s("div", {
690
+ r.value ? (l(), i("div", {
590
691
  key: 0,
591
- class: L(["tv-settings-panel fixed bottom-16 right-4 z-50 flex w-56 flex-col gap-3 rounded-lg bg-white p-4 shadow-xl ring-1 ring-gray-200", g(D)])
692
+ class: I(["tv-settings-panel fixed bottom-16 right-4 z-50 flex w-56 flex-col gap-3 rounded-lg bg-white p-4 shadow-xl ring-1 ring-gray-200", x(A)])
592
693
  }, [
593
- n("label", Ut, [
594
- p[3] || (p[3] = n("span", null, "Verification overlay", -1)),
595
- Z(n("input", {
596
- "onUpdate:modelValue": p[1] || (p[1] = (_) => J(t) ? t.value = _ : null),
694
+ a("label", Pt, [
695
+ g[3] || (g[3] = a("span", null, "Verification overlay", -1)),
696
+ le(a("input", {
697
+ "onUpdate:modelValue": g[1] || (g[1] = (b) => te(t) ? t.value = b : null),
597
698
  type: "checkbox",
598
699
  class: "tv-enable-checkbox"
599
700
  }, null, 512), [
600
- [me, g(t)]
701
+ [be, x(t)]
601
702
  ])
602
703
  ]),
603
- n("button", {
704
+ a("button", {
604
705
  type: "button",
605
- class: L(["tv-open-comparison rounded border px-2 py-1 text-sm", g(D)]),
606
- onClick: r
706
+ class: I(["tv-open-comparison rounded border px-2 py-1 text-sm", x(A)]),
707
+ onClick: o
607
708
  }, "Open comparison page", 2)
608
- ], 2)) : b("", !0),
609
- A(g(ee), {
610
- modelValue: g(c),
611
- "onUpdate:modelValue": p[2] || (p[2] = (_) => J(c) ? c.value = _ : null),
709
+ ], 2)) : h("", !0),
710
+ D(x(G), {
711
+ modelValue: x(f),
712
+ "onUpdate:modelValue": g[2] || (g[2] = (b) => te(f) ? f.value = b : null),
612
713
  title: "Verification comparison",
613
714
  width: 80,
614
715
  "close-x": "",
615
- class: L(g(D))
716
+ class: I(x(A))
616
717
  }, {
617
- default: X(() => [
618
- A(Lt)
718
+ default: j(() => [
719
+ D(Mt)
619
720
  ]),
620
721
  _: 1
621
722
  }, 8, ["modelValue", "class"])
@@ -623,26 +724,26 @@ const vt = { class: "tv-comparison-page flex flex-col gap-4" }, ft = {
623
724
  }
624
725
  });
625
726
  export {
626
- D as CHROME_CLASS,
627
- Lt as ComparisonPage,
628
- j as ConfidenceIcon,
629
- te as ENABLED_STORAGE_KEY,
630
- le as RESOLUTION_PRIORITY,
631
- ke as STATUS_COLORS,
632
- we as STATUS_LABELS,
633
- Nt as VerificationChrome,
634
- ot as VerificationModal,
635
- Dt as VerifiedField,
636
- G as bucketConfidence,
637
- $e as candidatesDisagree,
638
- F as citedTextOf,
639
- oe as groupSources,
640
- se as hasDiscrepancy,
641
- At as initVerification,
642
- B as reasoningOf,
643
- Se as resolveCandidates,
644
- H as resolveDataPoint,
645
- ie as sourceRowLabel,
646
- Y as useVerification,
647
- dt as walkDataPoints
727
+ A as CHROME_CLASS,
728
+ Mt as ComparisonPage,
729
+ z as ConfidenceIcon,
730
+ ae as ENABLED_STORAGE_KEY,
731
+ re as RESOLUTION_PRIORITY,
732
+ Le as STATUS_COLORS,
733
+ Ie as STATUS_LABELS,
734
+ Yt as VerificationChrome,
735
+ mt as VerificationModal,
736
+ Kt as VerifiedField,
737
+ W as bucketConfidence,
738
+ De as candidatesDisagree,
739
+ q as citedTextOf,
740
+ ue as groupSources,
741
+ oe as hasDiscrepancy,
742
+ Bt as initVerification,
743
+ H as reasoningOf,
744
+ Ue as resolveCandidates,
745
+ X as resolveDataPoint,
746
+ ce as sourceRowLabel,
747
+ Q as useVerification,
748
+ bt as walkDataPoints
648
749
  };