@actioneer/ads 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +1,46 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
- import * as h from "react";
2
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
3
+ import * as x from "react";
4
4
  import { cva as E } from "class-variance-authority";
5
5
  import { z as t } from "zod/v4";
6
- import { Alert as B, AlertTitle as L, AlertDescription as $ } from "./alert.js";
7
- import { Badge as g } from "./badge.js";
8
- import { Button as D } from "./button.js";
9
- import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.js";
10
- import { AreaChart as V, BarChart as _, LineChart as z } from "./chart.js";
6
+ import { Alert as L, AlertTitle as B, AlertDescription as $ } from "./alert.js";
7
+ import { Badge as b } from "./badge.js";
8
+ import { Button as O } from "./button.js";
9
+ import { FollowUpSuggestion as V } from "./assistant-ui/follow-up-suggestions.js";
10
+ import { AreaChart as _, BarChart as z, LineChart as M } from "./chart.js";
11
11
  import { Progress as P } from "./progress.js";
12
12
  import { cn as c } from "../lib/cn.js";
13
- const I = "render_answer", K = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", x = t.enum([
13
+ const I = "render_answer", K = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", u = t.enum([
14
14
  "default",
15
15
  "primary",
16
16
  "success",
17
17
  "warning",
18
18
  "danger",
19
19
  "info"
20
- ]), M = t.object({
20
+ ]), W = t.object({
21
21
  id: t.string().min(1),
22
22
  label: t.string().min(1),
23
23
  prompt: t.string().min(1).optional()
24
- }), W = t.object({
24
+ }), F = t.object({
25
25
  id: t.string().min(1),
26
26
  label: t.string().min(1),
27
27
  description: t.string().optional()
28
- }), b = t.object({
28
+ }), p = t.object({
29
29
  label: t.string().optional(),
30
30
  text: t.string().min(1),
31
- tone: x.optional()
32
- }), p = {
31
+ tone: u.optional()
32
+ }), f = {
33
33
  eyebrow: t.string().optional(),
34
34
  headline: t.string().min(1),
35
35
  summary: t.string().optional(),
36
- followUps: t.array(M).max(3).optional(),
37
- sources: t.array(W).max(8).optional()
36
+ followUps: t.array(W).max(3).optional(),
37
+ sources: t.array(F).max(8).optional()
38
38
  }, A = t.object({
39
39
  value: t.string().min(1),
40
40
  detail: t.string().optional(),
41
- tone: x.optional()
42
- }), F = t.object({
43
- ...p,
41
+ tone: u.optional()
42
+ }), H = t.object({
43
+ ...f,
44
44
  kind: t.literal("comparison"),
45
45
  subjects: t.tuple([
46
46
  t.object({ label: t.string().min(1), description: t.string().optional() }),
@@ -49,27 +49,28 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
49
49
  rows: t.array(
50
50
  t.object({
51
51
  label: t.string().min(1),
52
+ description: t.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
52
53
  values: t.tuple([A, A]),
53
54
  delta: t.object({
54
55
  value: t.string().min(1),
55
- tone: x.optional()
56
+ tone: u.optional()
56
57
  }).optional()
57
58
  })
58
59
  ).min(1).max(8),
59
- takeaway: b.optional()
60
- }), v = t.enum([
60
+ takeaway: p.optional()
61
+ }), k = t.enum([
61
62
  "primary",
62
63
  "success",
63
64
  "warning",
64
65
  "danger",
65
66
  "info"
66
- ]), H = t.discriminatedUnion("kind", [
67
+ ]), q = t.discriminatedUnion("kind", [
67
68
  t.object({
68
69
  kind: t.literal("line"),
69
70
  value: t.union([t.number(), t.string()]),
70
71
  axis: t.enum(["x", "y"]).optional(),
71
72
  label: t.string().optional(),
72
- color: v.optional()
73
+ color: k.optional()
73
74
  }),
74
75
  t.object({
75
76
  kind: t.literal("band"),
@@ -77,7 +78,7 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
77
78
  to: t.union([t.number(), t.string()]),
78
79
  axis: t.enum(["x", "y"]).optional(),
79
80
  label: t.string().optional(),
80
- color: v.optional()
81
+ color: k.optional()
81
82
  }),
82
83
  t.object({
83
84
  kind: t.literal("point"),
@@ -85,38 +86,38 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
85
86
  y: t.number(),
86
87
  label: t.string().min(1),
87
88
  description: t.string().optional(),
88
- color: v.optional()
89
+ color: k.optional()
89
90
  })
90
- ]), q = t.record(
91
+ ]), G = t.record(
91
92
  t.string(),
92
93
  t.union([t.string(), t.number(), t.null()])
93
- ), G = t.object({
94
- ...p,
94
+ ), J = t.object({
95
+ ...f,
95
96
  kind: t.literal("trend"),
96
97
  metric: t.object({
97
98
  label: t.string().min(1),
98
99
  value: t.string().min(1),
99
100
  change: t.string().optional(),
100
- tone: x.optional()
101
+ tone: u.optional()
101
102
  }).optional(),
102
103
  chart: t.object({
103
104
  type: t.enum(["line", "area", "bar"]),
104
- data: t.array(q).min(1).max(100),
105
+ data: t.array(G).min(1).max(100),
105
106
  categoryKey: t.string().min(1),
106
107
  series: t.array(t.string().min(1)).min(1).max(4),
107
108
  seriesLabels: t.record(t.string(), t.string()).optional(),
108
109
  highlight: t.string().optional(),
109
110
  unit: t.string().optional(),
110
- annotations: t.array(H).max(8).optional()
111
+ annotations: t.array(q).max(8).optional()
111
112
  }),
112
- insight: b.optional()
113
- }), J = t.object({
114
- ...p,
113
+ insight: p.optional()
114
+ }), Q = t.object({
115
+ ...f,
115
116
  kind: t.literal("status"),
116
117
  overall: t.object({
117
118
  label: t.string().min(1),
118
119
  value: t.string().min(1),
119
- tone: x.optional()
120
+ tone: u.optional()
120
121
  }).optional(),
121
122
  items: t.array(
122
123
  t.object({
@@ -124,12 +125,12 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
124
125
  status: t.string().min(1),
125
126
  detail: t.string().optional(),
126
127
  meta: t.string().optional(),
127
- tone: x.optional()
128
+ tone: u.optional()
128
129
  })
129
130
  ).min(1).max(12),
130
- recommendation: b.optional()
131
- }), Q = t.object({
132
- ...p,
131
+ recommendation: p.optional()
132
+ }), X = t.object({
133
+ ...f,
133
134
  kind: t.literal("breakdown"),
134
135
  total: t.object({ label: t.string().min(1), value: t.string().min(1) }).optional(),
135
136
  items: t.array(
@@ -138,12 +139,12 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
138
139
  value: t.string().min(1),
139
140
  share: t.number().min(0).max(100),
140
141
  detail: t.string().optional(),
141
- tone: x.optional()
142
+ tone: u.optional()
142
143
  })
143
144
  ).min(1).max(12),
144
- insight: b.optional()
145
- }), X = t.object({
146
- ...p,
145
+ insight: p.optional()
146
+ }), Y = t.object({
147
+ ...f,
147
148
  kind: t.literal("explanation"),
148
149
  sections: t.array(
149
150
  t.object({
@@ -152,18 +153,18 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
152
153
  bullets: t.array(t.string().min(1)).max(5).optional()
153
154
  })
154
155
  ).min(1).max(6),
155
- takeaway: b.optional()
156
- }), Y = t.discriminatedUnion("kind", [
157
- F,
158
- G,
156
+ takeaway: p.optional()
157
+ }), Z = t.discriminatedUnion("kind", [
158
+ H,
159
159
  J,
160
160
  Q,
161
- X
162
- ]), ht = {
161
+ X,
162
+ Y
163
+ ]), xt = {
163
164
  name: I,
164
165
  description: K,
165
- inputSchema: Y
166
- }, N = E("font-semibold tabular-nums text-foreground", {
166
+ inputSchema: Z
167
+ }, v = E("font-semibold tabular-nums text-foreground", {
167
168
  variants: {
168
169
  tone: {
169
170
  default: "text-foreground",
@@ -175,32 +176,32 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
175
176
  }
176
177
  },
177
178
  defaultVariants: { tone: "default" }
178
- }), Z = new Intl.NumberFormat("en-US", {
179
+ }), U = new Intl.NumberFormat("en-US", {
179
180
  notation: "compact",
180
181
  maximumFractionDigits: 1
181
- }), U = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "default", tt = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "primary";
182
- function f({ spec: a }) {
182
+ }), tt = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "default", et = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "primary";
183
+ function y({ spec: e }) {
183
184
  return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
184
- a.eyebrow && /* @__PURE__ */ e("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: a.eyebrow }),
185
- /* @__PURE__ */ e("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: a.headline }),
186
- a.summary && /* @__PURE__ */ e("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: a.summary })
185
+ e.eyebrow && /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: e.eyebrow }),
186
+ /* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: e.headline }),
187
+ e.summary && /* @__PURE__ */ a("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: e.summary })
187
188
  ] });
188
189
  }
189
- function y({ signal: a }) {
190
- return /* @__PURE__ */ i(B, { variant: U(a.tone), children: [
191
- /* @__PURE__ */ e(L, { children: a.label ?? "Takeaway" }),
192
- /* @__PURE__ */ e($, { children: a.text })
190
+ function w({ signal: e }) {
191
+ return /* @__PURE__ */ i(L, { variant: tt(e.tone), children: [
192
+ /* @__PURE__ */ a(B, { children: e.label ?? "Takeaway" }),
193
+ /* @__PURE__ */ a($, { children: e.text })
193
194
  ] });
194
195
  }
195
- function w({
196
- followUps: a,
196
+ function N({
197
+ followUps: e,
197
198
  sources: r,
198
199
  onFollowUp: s,
199
200
  onSourceSelect: o
200
201
  }) {
201
- return !(a != null && a.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
202
- !!(a != null && a.length) && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((l) => /* @__PURE__ */ e(
203
- O,
202
+ return !(e != null && e.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
203
+ !!(e != null && e.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: e.map((l) => /* @__PURE__ */ a(
204
+ V,
204
205
  {
205
206
  type: "button",
206
207
  disabled: !s,
@@ -210,10 +211,10 @@ function w({
210
211
  l.id
211
212
  )) }),
212
213
  !!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
213
- /* @__PURE__ */ e("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
214
+ /* @__PURE__ */ a("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
214
215
  r.map(
215
- (l) => o ? /* @__PURE__ */ e(
216
- D,
216
+ (l) => o ? /* @__PURE__ */ a(
217
+ O,
217
218
  {
218
219
  type: "button",
219
220
  size: "xs",
@@ -224,64 +225,102 @@ function w({
224
225
  children: l.label
225
226
  },
226
227
  l.id
227
- ) : /* @__PURE__ */ e(g, { variant: "soft", title: l.description, children: l.label }, l.id)
228
+ ) : /* @__PURE__ */ a(b, { variant: "soft", title: l.description, children: l.label }, l.id)
228
229
  )
229
230
  ] })
230
231
  ] });
231
232
  }
232
- const j = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
233
+ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
233
234
  "div",
234
235
  {
235
- ref: d,
236
- "data-answer-kind": a.kind,
236
+ ref: m,
237
+ "data-answer-kind": e.kind,
237
238
  className: c("w-full max-w-2xl space-y-5", o),
238
239
  ...l,
239
240
  children: [
240
- /* @__PURE__ */ e(f, { spec: a }),
241
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
242
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
243
- /* @__PURE__ */ e("th", { className: "w-2/5 px-3 py-2 text-xs font-medium text-tertiary", children: "Measure" }),
244
- a.subjects.map((n) => /* @__PURE__ */ i("th", { className: "px-3 py-2 align-bottom", children: [
245
- /* @__PURE__ */ e("span", { className: "block text-sm font-semibold text-foreground", children: n.label }),
246
- n.description && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: n.description })
247
- ] }, n.label))
241
+ /* @__PURE__ */ a(y, { spec: e }),
242
+ /* @__PURE__ */ a("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
243
+ /* @__PURE__ */ a("caption", { className: "sr-only", children: e.headline }),
244
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ i("tr", { children: [
245
+ /* @__PURE__ */ a(
246
+ "th",
247
+ {
248
+ scope: "col",
249
+ className: "w-1/3 px-3 py-2 text-xs font-medium text-tertiary",
250
+ children: "Measure"
251
+ }
252
+ ),
253
+ e.subjects.map((n) => /* @__PURE__ */ i(
254
+ "th",
255
+ {
256
+ scope: "col",
257
+ className: "px-3 py-2 align-bottom",
258
+ children: [
259
+ /* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: n.label }),
260
+ n.description && /* @__PURE__ */ a("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: n.description })
261
+ ]
262
+ },
263
+ n.label
264
+ )),
265
+ /* @__PURE__ */ i("th", { scope: "col", className: "px-3 py-2 align-bottom", children: [
266
+ /* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: "Difference" }),
267
+ /* @__PURE__ */ i("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: [
268
+ e.subjects[1].label,
269
+ " − ",
270
+ e.subjects[0].label
271
+ ] })
272
+ ] })
248
273
  ] }) }),
249
- /* @__PURE__ */ e("tbody", { children: a.rows.map((n) => /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
250
- /* @__PURE__ */ i("th", { className: "rounded-l-xl px-3 py-3 text-xs font-medium text-secondary", children: [
251
- /* @__PURE__ */ e("span", { children: n.label }),
252
- n.delta && /* @__PURE__ */ e(
274
+ /* @__PURE__ */ a("tbody", { children: e.rows.map((n) => {
275
+ const d = n.values[0].detail === n.values[1].detail ? n.values[0].detail : void 0, h = n.description ?? d;
276
+ return /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
277
+ /* @__PURE__ */ i(
278
+ "th",
279
+ {
280
+ scope: "row",
281
+ className: "rounded-l-xl px-3 py-3 align-top text-left",
282
+ children: [
283
+ /* @__PURE__ */ a("span", { className: "block text-sm font-medium text-secondary", children: n.label }),
284
+ h && /* @__PURE__ */ a("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: h })
285
+ ]
286
+ }
287
+ ),
288
+ n.values.map((g, D) => /* @__PURE__ */ a(
289
+ "td",
290
+ {
291
+ className: "px-3 py-3 align-top",
292
+ children: /* @__PURE__ */ a(
293
+ "span",
294
+ {
295
+ className: c(
296
+ v({ tone: g.tone }),
297
+ "block text-sm"
298
+ ),
299
+ children: g.value
300
+ }
301
+ )
302
+ },
303
+ `${n.label}-${e.subjects[D].label}`
304
+ )),
305
+ /* @__PURE__ */ a("td", { className: "rounded-r-xl px-3 py-3 align-top", children: n.delta ? /* @__PURE__ */ a(
253
306
  "span",
254
307
  {
255
308
  className: c(
256
- N({ tone: n.delta.tone }),
257
- "ml-2 text-xs"
309
+ v({ tone: n.delta.tone }),
310
+ "block text-sm"
258
311
  ),
259
312
  children: n.delta.value
260
313
  }
261
- )
262
- ] }),
263
- n.values.map((m, u) => /* @__PURE__ */ i(
264
- "td",
265
- {
266
- className: c(
267
- "px-3 py-3 align-top last:rounded-r-xl",
268
- N({ tone: m.tone })
269
- ),
270
- children: [
271
- /* @__PURE__ */ e("span", { className: "block text-sm", children: m.value }),
272
- m.detail && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: m.detail })
273
- ]
274
- },
275
- `${n.label}-${a.subjects[u].label}`
276
- ))
277
- ] }, n.label)) })
314
+ ) : /* @__PURE__ */ a("span", { "aria-label": "Not provided", className: "text-sm text-tertiary", children: "—" }) })
315
+ ] }, n.label);
316
+ }) })
278
317
  ] }) }),
279
- a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
280
- /* @__PURE__ */ e(
281
- w,
318
+ e.takeaway && /* @__PURE__ */ a(w, { signal: e.takeaway }),
319
+ /* @__PURE__ */ a(
320
+ N,
282
321
  {
283
- followUps: a.followUps,
284
- sources: a.sources,
322
+ followUps: e.followUps,
323
+ sources: e.sources,
285
324
  onFollowUp: r,
286
325
  onSourceSelect: s
287
326
  }
@@ -290,53 +329,53 @@ const j = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
290
329
  }
291
330
  ));
292
331
  j.displayName = "ComparisonAnswer";
293
- const S = h.forwardRef(
294
- ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => {
295
- const n = h.useMemo(
296
- () => a.chart.unit ? (u) => `${Z.format(u)}${a.chart.unit}` : void 0,
297
- [a.chart.unit]
298
- ), m = {
299
- data: a.chart.data,
300
- categoryKey: a.chart.categoryKey,
301
- series: a.chart.series,
302
- seriesLabels: a.chart.seriesLabels,
303
- highlight: a.chart.highlight,
304
- annotations: a.chart.annotations,
332
+ const S = x.forwardRef(
333
+ ({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => {
334
+ const n = x.useMemo(
335
+ () => e.chart.unit ? (h) => `${U.format(h)}${e.chart.unit}` : void 0,
336
+ [e.chart.unit]
337
+ ), d = {
338
+ data: e.chart.data,
339
+ categoryKey: e.chart.categoryKey,
340
+ series: e.chart.series,
341
+ seriesLabels: e.chart.seriesLabels,
342
+ highlight: e.chart.highlight,
343
+ annotations: e.chart.annotations,
305
344
  formatValue: n,
306
345
  height: 224
307
346
  };
308
347
  return /* @__PURE__ */ i(
309
348
  "div",
310
349
  {
311
- ref: d,
312
- "data-answer-kind": a.kind,
350
+ ref: m,
351
+ "data-answer-kind": e.kind,
313
352
  className: c("w-full max-w-2xl space-y-5", o),
314
353
  ...l,
315
354
  children: [
316
355
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
317
- /* @__PURE__ */ e(f, { spec: a }),
318
- a.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 sm:text-right", children: [
319
- /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.metric.label }),
320
- /* @__PURE__ */ e(
356
+ /* @__PURE__ */ a(y, { spec: e }),
357
+ e.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 sm:text-right", children: [
358
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: e.metric.label }),
359
+ /* @__PURE__ */ a(
321
360
  "p",
322
361
  {
323
362
  className: c(
324
- N({ tone: a.metric.tone }),
363
+ v({ tone: e.metric.tone }),
325
364
  "mt-1 text-2xl tracking-tight"
326
365
  ),
327
- children: a.metric.value
366
+ children: e.metric.value
328
367
  }
329
368
  ),
330
- a.metric.change && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-secondary", children: a.metric.change })
369
+ e.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: e.metric.change })
331
370
  ] })
332
371
  ] }),
333
- /* @__PURE__ */ e("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: a.chart.type === "area" ? /* @__PURE__ */ e(V, { ...m }) : a.chart.type === "bar" ? /* @__PURE__ */ e(_, { ...m }) : /* @__PURE__ */ e(z, { ...m }) }),
334
- a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
335
- /* @__PURE__ */ e(
336
- w,
372
+ /* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: e.chart.type === "area" ? /* @__PURE__ */ a(_, { ...d }) : e.chart.type === "bar" ? /* @__PURE__ */ a(z, { ...d }) : /* @__PURE__ */ a(M, { ...d }) }),
373
+ e.insight && /* @__PURE__ */ a(w, { signal: e.insight }),
374
+ /* @__PURE__ */ a(
375
+ N,
337
376
  {
338
- followUps: a.followUps,
339
- sources: a.sources,
377
+ followUps: e.followUps,
378
+ sources: e.sources,
340
379
  onFollowUp: r,
341
380
  onSourceSelect: s
342
381
  }
@@ -347,54 +386,54 @@ const S = h.forwardRef(
347
386
  }
348
387
  );
349
388
  S.displayName = "TrendAnswer";
350
- const C = h.forwardRef(
351
- ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
389
+ const C = x.forwardRef(
390
+ ({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
352
391
  "div",
353
392
  {
354
- ref: d,
355
- "data-answer-kind": a.kind,
393
+ ref: m,
394
+ "data-answer-kind": e.kind,
356
395
  className: c("w-full max-w-2xl space-y-5", o),
357
396
  ...l,
358
397
  children: [
359
398
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
360
- /* @__PURE__ */ e(f, { spec: a }),
361
- a.overall && /* @__PURE__ */ i(
362
- g,
399
+ /* @__PURE__ */ a(y, { spec: e }),
400
+ e.overall && /* @__PURE__ */ i(
401
+ b,
363
402
  {
364
403
  variant: "soft",
365
- color: a.overall.tone ?? "default",
404
+ color: e.overall.tone ?? "default",
366
405
  className: "self-start",
367
406
  children: [
368
- a.overall.label,
407
+ e.overall.label,
369
408
  " · ",
370
- a.overall.value
409
+ e.overall.value
371
410
  ]
372
411
  }
373
412
  )
374
413
  ] }),
375
- /* @__PURE__ */ e("ul", { className: "space-y-2", children: a.items.map((n) => /* @__PURE__ */ i(
414
+ /* @__PURE__ */ a("ul", { className: "space-y-2", children: e.items.map((n) => /* @__PURE__ */ i(
376
415
  "li",
377
416
  {
378
417
  className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
379
418
  children: [
380
419
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
381
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
382
- n.detail && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
420
+ /* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
421
+ n.detail && /* @__PURE__ */ a("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
383
422
  ] }),
384
423
  /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
385
- /* @__PURE__ */ e(g, { variant: "dot", color: n.tone ?? "default", children: n.status }),
386
- n.meta && /* @__PURE__ */ e("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
424
+ /* @__PURE__ */ a(b, { variant: "dot", color: n.tone ?? "default", children: n.status }),
425
+ n.meta && /* @__PURE__ */ a("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
387
426
  ] })
388
427
  ]
389
428
  },
390
429
  n.label
391
430
  )) }),
392
- a.recommendation && /* @__PURE__ */ e(y, { signal: a.recommendation }),
393
- /* @__PURE__ */ e(
394
- w,
431
+ e.recommendation && /* @__PURE__ */ a(w, { signal: e.recommendation }),
432
+ /* @__PURE__ */ a(
433
+ N,
395
434
  {
396
- followUps: a.followUps,
397
- sources: a.sources,
435
+ followUps: e.followUps,
436
+ sources: e.sources,
398
437
  onFollowUp: r,
399
438
  onSourceSelect: s
400
439
  }
@@ -404,54 +443,54 @@ const C = h.forwardRef(
404
443
  )
405
444
  );
406
445
  C.displayName = "StatusAnswer";
407
- const R = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
446
+ const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
408
447
  "div",
409
448
  {
410
- ref: d,
411
- "data-answer-kind": a.kind,
449
+ ref: m,
450
+ "data-answer-kind": e.kind,
412
451
  className: c("w-full max-w-2xl space-y-5", o),
413
452
  ...l,
414
453
  children: [
415
454
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
416
- /* @__PURE__ */ e(f, { spec: a }),
417
- a.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
418
- /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.total.label }),
419
- /* @__PURE__ */ e("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: a.total.value })
455
+ /* @__PURE__ */ a(y, { spec: e }),
456
+ e.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
457
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: e.total.label }),
458
+ /* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: e.total.value })
420
459
  ] })
421
460
  ] }),
422
- /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.items.map((n, m) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
461
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: e.items.map((n, d) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
423
462
  /* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
424
463
  /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
425
- /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 tabular-nums", children: m + 1 }),
464
+ /* @__PURE__ */ a(b, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
426
465
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
427
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
428
- n.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
466
+ /* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
467
+ n.detail && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
429
468
  ] })
430
469
  ] }),
431
470
  /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
432
- /* @__PURE__ */ e("p", { className: c(N({ tone: n.tone }), "text-sm"), children: n.value }),
471
+ /* @__PURE__ */ a("p", { className: c(v({ tone: n.tone }), "text-sm"), children: n.value }),
433
472
  /* @__PURE__ */ i("p", { className: "mt-0.5 text-xs tabular-nums text-tertiary", children: [
434
473
  n.share,
435
474
  "%"
436
475
  ] })
437
476
  ] })
438
477
  ] }),
439
- /* @__PURE__ */ e(
478
+ /* @__PURE__ */ a(
440
479
  P,
441
480
  {
442
481
  value: n.share,
443
482
  size: "sm",
444
- color: tt(n.tone),
483
+ color: et(n.tone),
445
484
  label: `${n.label}: ${n.share}%`
446
485
  }
447
486
  )
448
487
  ] }, n.label)) }),
449
- a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
450
- /* @__PURE__ */ e(
451
- w,
488
+ e.insight && /* @__PURE__ */ a(w, { signal: e.insight }),
489
+ /* @__PURE__ */ a(
490
+ N,
452
491
  {
453
- followUps: a.followUps,
454
- sources: a.sources,
492
+ followUps: e.followUps,
493
+ sources: e.sources,
455
494
  onFollowUp: r,
456
495
  onSourceSelect: s
457
496
  }
@@ -460,41 +499,41 @@ const R = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
460
499
  }
461
500
  ));
462
501
  R.displayName = "BreakdownAnswer";
463
- const T = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
502
+ const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
464
503
  "div",
465
504
  {
466
- ref: d,
467
- "data-answer-kind": a.kind,
505
+ ref: m,
506
+ "data-answer-kind": e.kind,
468
507
  className: c("w-full max-w-2xl space-y-5", o),
469
508
  ...l,
470
509
  children: [
471
- /* @__PURE__ */ e(f, { spec: a }),
472
- /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.sections.map((n, m) => {
473
- var u;
510
+ /* @__PURE__ */ a(y, { spec: e }),
511
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: e.sections.map((n, d) => {
512
+ var h;
474
513
  return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
475
- /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: m + 1 }),
514
+ /* @__PURE__ */ a(b, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
476
515
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
477
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
478
- n.body && /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
479
- !!((u = n.bullets) != null && u.length) && /* @__PURE__ */ e("ul", { className: "mt-2 space-y-1.5", children: n.bullets.map((k) => /* @__PURE__ */ i("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
480
- /* @__PURE__ */ e(
516
+ /* @__PURE__ */ a("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
517
+ n.body && /* @__PURE__ */ a("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
518
+ !!((h = n.bullets) != null && h.length) && /* @__PURE__ */ a("ul", { className: "mt-2 space-y-1.5", children: n.bullets.map((g) => /* @__PURE__ */ i("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
519
+ /* @__PURE__ */ a(
481
520
  "span",
482
521
  {
483
522
  "aria-hidden": !0,
484
523
  className: "mt-2 size-1 shrink-0 rounded-dot bg-muted-foreground"
485
524
  }
486
525
  ),
487
- /* @__PURE__ */ e("span", { children: k })
488
- ] }, k)) })
526
+ /* @__PURE__ */ a("span", { children: g })
527
+ ] }, g)) })
489
528
  ] })
490
529
  ] }, n.title);
491
530
  }) }),
492
- a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
493
- /* @__PURE__ */ e(
494
- w,
531
+ e.takeaway && /* @__PURE__ */ a(w, { signal: e.takeaway }),
532
+ /* @__PURE__ */ a(
533
+ N,
495
534
  {
496
- followUps: a.followUps,
497
- sources: a.sources,
535
+ followUps: e.followUps,
536
+ sources: e.sources,
498
537
  onFollowUp: r,
499
538
  onSourceSelect: s
500
539
  }
@@ -503,19 +542,19 @@ const T = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className:
503
542
  }
504
543
  ));
505
544
  T.displayName = "ExplanationAnswer";
506
- const at = h.forwardRef(
507
- ({ spec: a, ...r }, s) => {
508
- switch (a.kind) {
545
+ const at = x.forwardRef(
546
+ ({ spec: e, ...r }, s) => {
547
+ switch (e.kind) {
509
548
  case "comparison":
510
- return /* @__PURE__ */ e(j, { ref: s, spec: a, ...r });
549
+ return /* @__PURE__ */ a(j, { ref: s, spec: e, ...r });
511
550
  case "trend":
512
- return /* @__PURE__ */ e(S, { ref: s, spec: a, ...r });
551
+ return /* @__PURE__ */ a(S, { ref: s, spec: e, ...r });
513
552
  case "status":
514
- return /* @__PURE__ */ e(C, { ref: s, spec: a, ...r });
553
+ return /* @__PURE__ */ a(C, { ref: s, spec: e, ...r });
515
554
  case "breakdown":
516
- return /* @__PURE__ */ e(R, { ref: s, spec: a, ...r });
555
+ return /* @__PURE__ */ a(R, { ref: s, spec: e, ...r });
517
556
  case "explanation":
518
- return /* @__PURE__ */ e(T, { ref: s, spec: a, ...r });
557
+ return /* @__PURE__ */ a(T, { ref: s, spec: e, ...r });
519
558
  }
520
559
  }
521
560
  );
@@ -523,21 +562,21 @@ at.displayName = "AnswerRenderer";
523
562
  export {
524
563
  K as ANSWER_TOOL_DESCRIPTION,
525
564
  I as ANSWER_TOOL_NAME,
526
- M as AnswerFollowUpSchema,
565
+ W as AnswerFollowUpSchema,
527
566
  at as AnswerRenderer,
528
- b as AnswerSignalSchema,
529
- W as AnswerSourceSchema,
530
- Y as AnswerSpecSchema,
531
- x as AnswerToneSchema,
567
+ p as AnswerSignalSchema,
568
+ F as AnswerSourceSchema,
569
+ Z as AnswerSpecSchema,
570
+ u as AnswerToneSchema,
532
571
  R as BreakdownAnswer,
533
- Q as BreakdownAnswerSchema,
572
+ X as BreakdownAnswerSchema,
534
573
  j as ComparisonAnswer,
535
- F as ComparisonAnswerSchema,
574
+ H as ComparisonAnswerSchema,
536
575
  T as ExplanationAnswer,
537
- X as ExplanationAnswerSchema,
576
+ Y as ExplanationAnswerSchema,
538
577
  C as StatusAnswer,
539
- J as StatusAnswerSchema,
578
+ Q as StatusAnswerSchema,
540
579
  S as TrendAnswer,
541
- G as TrendAnswerSchema,
542
- ht as answerTool
580
+ J as TrendAnswerSchema,
581
+ xt as answerTool
543
582
  };