@icanbwell/baileyai-chat-ui 1.0.12 → 1.0.15

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,28 +1,28 @@
1
1
  import { n as e, t } from "./safeMarkdownUrl-Bqv6Q4u1.js";
2
- import { createContext as n, memo as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
3
- import d from "react-markdown";
4
- import f from "remark-gfm";
5
- import * as p from "@radix-ui/react-dropdown-menu";
6
- import * as m from "@radix-ui/react-tooltip";
7
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
2
+ import { Fragment as n, createContext as r, memo as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ import f from "react-markdown";
4
+ import p from "remark-gfm";
5
+ import * as m from "@radix-ui/react-dropdown-menu";
6
+ import * as h from "@radix-ui/react-tooltip";
7
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
8
8
  //#region src/utils/pseudoToolCalls.ts
9
- var v = "search_tools|call_tool|function_calls|function_result", y = RegExp(`<(${v})>([\\s\\S]*?)<\\/\\1>`, "g"), b = RegExp(`<(?:${v})>[\\s\\S]*$`), x = /<name>([\s\S]*?)<\/name>/, S = /<arguments>([\s\S]*?)<\/arguments>/, C = /<invoke\s+name="([^"]*)"\s*>([\s\S]*?)<\/invoke>/g, w = /<parameter\s+name="([^"]*)"\s*>([\s\S]*?)<\/parameter>/g;
10
- function T(e) {
11
- let t = x.exec(e)?.[1]?.trim() || "unknown_tool", n = S.exec(e)?.[1]?.trim();
9
+ var y = "search_tools|call_tool|function_calls|function_result", b = RegExp(`<(${y})>([\\s\\S]*?)<\\/\\1>`, "g"), x = RegExp(`<(?:${y})>[\\s\\S]*$`), S = /<name>([\s\S]*?)<\/name>/, C = /<arguments>([\s\S]*?)<\/arguments>/, w = /<invoke\s+name="([^"]*)"\s*>([\s\S]*?)<\/invoke>/g, T = /<parameter\s+name="([^"]*)"\s*>([\s\S]*?)<\/parameter>/g;
10
+ function E(e) {
11
+ let t = S.exec(e)?.[1]?.trim() || "unknown_tool", n = C.exec(e)?.[1]?.trim();
12
12
  return n ? {
13
13
  name: t,
14
14
  args: n
15
15
  } : { name: t };
16
16
  }
17
- function E(e) {
17
+ function D(e) {
18
18
  let t = [];
19
- C.lastIndex = 0;
19
+ w.lastIndex = 0;
20
20
  let n;
21
- for (; (n = C.exec(e)) !== null;) {
21
+ for (; (n = w.exec(e)) !== null;) {
22
22
  let [, e, r] = n, i = {};
23
- w.lastIndex = 0;
23
+ T.lastIndex = 0;
24
24
  let a;
25
- for (; (a = w.exec(r)) !== null;) i[a[1]] = a[2].trim();
25
+ for (; (a = T.exec(r)) !== null;) i[a[1]] = a[2].trim();
26
26
  let o = e.trim() || "unknown_tool";
27
27
  t.push(Object.keys(i).length > 0 ? {
28
28
  name: o,
@@ -31,14 +31,14 @@ function E(e) {
31
31
  }
32
32
  return t;
33
33
  }
34
- function D(e, t = {}) {
35
- let { hideOpenBlock: n = !0 } = t, r = [], i = e.replace(y, (e, t, n) => (t === "call_tool" ? r.push(T(n)) : t === "search_tools" ? r.push({
34
+ function O(e, t = {}) {
35
+ let { hideOpenBlock: n = !0 } = t, r = [], i = e.replace(b, (e, t, n) => (t === "call_tool" ? r.push(E(n)) : t === "search_tools" ? r.push({
36
36
  name: "search_tools",
37
37
  args: n.trim()
38
- }) : t === "function_calls" ? r.push(...E(n)) : r.push({
38
+ }) : t === "function_calls" ? r.push(...D(n)) : r.push({
39
39
  name: "function_result",
40
40
  args: n.trim()
41
- }), "")), a = n ? i.replace(b, "") : i;
41
+ }), "")), a = n ? i.replace(x, "") : i;
42
42
  return r.length === 0 && a === i ? {
43
43
  cleanedText: i,
44
44
  matches: r
@@ -49,7 +49,7 @@ function D(e, t = {}) {
49
49
  }
50
50
  //#endregion
51
51
  //#region src/logic/sse.ts
52
- function O(e) {
52
+ function k(e) {
53
53
  if (!e.startsWith("data: ")) return e;
54
54
  let t = "";
55
55
  for (let n of e.split("\n")) {
@@ -63,7 +63,7 @@ function O(e) {
63
63
  }
64
64
  return t || null;
65
65
  }
66
- function k(e) {
66
+ function A(e) {
67
67
  let t = e.replace(/\r\n/g, "\n").split("\n\n"), n = t.pop() ?? "", r = [], i = !1;
68
68
  for (let e of t) {
69
69
  let t = e.split("\n").filter((e) => e.length > 0), n = "message", a = [];
@@ -88,7 +88,7 @@ function k(e) {
88
88
  message: e
89
89
  });
90
90
  } else if (c?.type === "response.output_text.delta" && typeof c.delta == "string") {
91
- let e = O(c.delta);
91
+ let e = k(c.delta);
92
92
  e && r.push({
93
93
  type: "response.output_text.delta",
94
94
  delta: e
@@ -106,38 +106,38 @@ function k(e) {
106
106
  }
107
107
  //#endregion
108
108
  //#region src/logic/useBaileyChat.ts
109
- var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, ee = (e, t, n) => {
109
+ var j = 200, M = 15e4, N = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, ee = (e, t, n) => {
110
110
  if (e === 401 || e === 403) return "Bailey isn't reachable with your current login.";
111
111
  let r = `Bailey request failed (status ${e ?? "network error"}).`, i = (n || t || "").trim();
112
- return i ? `${r} ${i.length > A ? `${i.slice(0, A)}…` : i}` : r;
113
- }, N = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: a, firstUserMessagePrefix: s, onAssistantMessageComplete: c, idleTimeoutMs: d = j }) => {
114
- let [f, p] = u([]), [m, h] = u([]), [g, _] = u(null), [v, y] = u("idle"), [b, x] = u(null), S = l(null), C = l(""), w = l(0), T = l([]);
115
- o(() => {
112
+ return i ? `${r} ${i.length > j ? `${i.slice(0, j)}…` : i}` : r;
113
+ }, P = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i, firstUserMessagePrefix: o, onAssistantMessageComplete: c, idleTimeoutMs: l = M }) => {
114
+ let [f, p] = d([]), [m, h] = d([]), [g, _] = d(null), [v, y] = d("idle"), [b, x] = d(null), S = u(null), C = u(""), w = u(0), T = u([]);
115
+ s(() => {
116
116
  T.current = f;
117
117
  }, [f]);
118
- let E = l([]), O = l(/* @__PURE__ */ new Map()), A = l(/* @__PURE__ */ new Map()), N = l(null), P = i(() => {
119
- N.current !== null && (clearTimeout(N.current), N.current = null);
120
- }, []), F = i((e) => {
121
- P(), N.current = setTimeout(() => {
118
+ let E = u([]), D = u(/* @__PURE__ */ new Map()), k = u(/* @__PURE__ */ new Map()), j = u(null), P = a(() => {
119
+ j.current !== null && (clearTimeout(j.current), j.current = null);
120
+ }, []), F = a((e) => {
121
+ P(), j.current = setTimeout(() => {
122
122
  e.abort(new DOMException("The assistant took too long to respond. Please try again.", "TimeoutError"));
123
- }, d);
124
- }, [P, d]);
125
- o(() => () => {
123
+ }, l);
124
+ }, [P, l]);
125
+ s(() => () => {
126
126
  S.current?.abort(), P();
127
127
  }, [P]);
128
- let I = i((e, t, n) => {
128
+ let I = a((e, t, n) => {
129
129
  let r = (e) => {
130
130
  n.push(e), h((t) => [...t, e]);
131
131
  };
132
132
  if (t.type === "response.output_text.delta") {
133
133
  if (!t.delta) return !1;
134
- let n = O.current.get(e) ?? {
134
+ let n = D.current.get(e) ?? {
135
135
  raw: "",
136
136
  emittedCount: 0
137
137
  };
138
138
  n.raw += t.delta;
139
- let { cleanedText: i, matches: a } = D(n.raw), o = i.trim(), s = a.slice(n.emittedCount);
140
- if (n.emittedCount = a.length, O.current.set(e, n), A.current.set(e, o), p((t) => t.map((t) => t.id === e ? {
139
+ let { cleanedText: i, matches: a } = O(n.raw), o = i.trim(), s = a.slice(n.emittedCount);
140
+ if (n.emittedCount = a.length, D.current.set(e, n), k.current.set(e, o), p((t) => t.map((t) => t.id === e ? {
141
141
  ...t,
142
142
  content: o
143
143
  } : t)), s.length > 0) {
@@ -168,13 +168,17 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
168
168
  name: a,
169
169
  args: n.arguments,
170
170
  at: e,
171
- turnSentAt: i
171
+ turnSentAt: i,
172
+ callId: n.call_id,
173
+ displayName: n.display_name
172
174
  } : {
173
175
  kind: "tool_end",
174
176
  name: a,
175
177
  args: n.arguments,
176
178
  at: e,
177
179
  turnSentAt: i,
180
+ callId: n.call_id,
181
+ displayName: n.display_name,
178
182
  output: n.output,
179
183
  isError: n.is_error,
180
184
  runtimeSeconds: n.runtime_seconds,
@@ -206,43 +210,68 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
206
210
  }), !0;
207
211
  if (t.type === "response.output_text.done" || t.type === "response.created") return !1;
208
212
  if (t.type === "response.completed") {
209
- let t = O.current.get(e);
213
+ let t = D.current.get(e);
210
214
  if (t) {
211
- let { cleanedText: n } = D(t.raw, { hideOpenBlock: !1 }), r = n.trim();
212
- r !== A.current.get(e) && (A.current.set(e, r), p((t) => t.map((t) => t.id === e ? {
215
+ let { cleanedText: n } = O(t.raw, { hideOpenBlock: !1 }), r = n.trim();
216
+ r !== k.current.get(e) && (k.current.set(e, r), p((t) => t.map((t) => t.id === e ? {
213
217
  ...t,
214
218
  content: r
215
219
  } : t)));
216
220
  }
217
221
  return !1;
218
222
  }
219
- return t.type === "info" ? (r({
223
+ if (t.type === "info") return r({
220
224
  kind: "info",
221
225
  message: t.message,
222
226
  at: Date.now(),
223
227
  turnSentAt: w.current
224
- }), !0) : (r({
228
+ }), !0;
229
+ if (t.type === "mcp_app") {
230
+ let n = t.resourceUri;
231
+ if (!n) return r({
232
+ kind: "raw",
233
+ eventType: t.type,
234
+ raw: JSON.stringify(t),
235
+ at: Date.now(),
236
+ turnSentAt: w.current
237
+ }), !0;
238
+ let { html: i, title: a, csp: o, permissions: s, prefersBorder: c, displayMode: l } = t;
239
+ return p((t) => t.map((t) => t.id === e ? {
240
+ ...t,
241
+ parts: [...t.parts ?? [], {
242
+ type: "mcp_app",
243
+ html: i,
244
+ title: a,
245
+ resourceUri: n,
246
+ csp: o,
247
+ permissions: s,
248
+ prefersBorder: c,
249
+ displayMode: l
250
+ }]
251
+ } : t)), !0;
252
+ }
253
+ return r({
225
254
  kind: "raw",
226
255
  eventType: t.type,
227
256
  raw: JSON.stringify(t),
228
257
  at: Date.now(),
229
258
  turnSentAt: w.current
230
- }), !0);
231
- }, []), L = i(async (i) => {
259
+ }), !0;
260
+ }, []), L = a(async (a) => {
232
261
  y("streaming"), x(null);
233
- let o = Date.now();
234
- w.current = o;
235
- let l = M(), u = {
262
+ let s = Date.now();
263
+ w.current = s;
264
+ let l = N(), u = {
236
265
  id: l,
237
266
  role: "assistant",
238
267
  content: "",
239
268
  streaming: !0,
240
- createdAt: o
269
+ createdAt: s
241
270
  };
242
- p((e) => [...e, u]), E.current = [...i, u];
243
- let d = i.findIndex((e) => e.role === "user" && !e.hidden), f = i.map((e, t) => t === d && s ? {
271
+ p((e) => [...e, u]), E.current = [...a, u];
272
+ let d = a.findIndex((e) => e.role === "user" && !e.hidden), f = a.map((e, t) => t === d && o ? {
244
273
  role: e.role,
245
- content: `${s}${e.content}`,
274
+ content: `${o}${e.content}`,
246
275
  hidden: e.hidden,
247
276
  titleHint: e.titleHint
248
277
  } : {
@@ -256,9 +285,9 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
256
285
  systemPrompt: n,
257
286
  messages: f,
258
287
  tools: r,
259
- toolChoice: a,
288
+ toolChoice: i,
260
289
  stream: !0,
261
- sentAt: o,
290
+ sentAt: s,
262
291
  streamStats: {
263
292
  chunkCount: 0,
264
293
  firstChunkAt: null,
@@ -267,13 +296,13 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
267
296
  });
268
297
  let m = new AbortController();
269
298
  S.current = m, F(m);
270
- let g = "", v = null, b = !1, C = !1, T = [], D = (e, t) => {
299
+ let g = "", v = null, b = !1, C = !1, T = [], O = (e, t) => {
271
300
  y("error"), x(e);
272
301
  let n = {
273
302
  kind: "error",
274
303
  message: e,
275
304
  at: Date.now(),
276
- turnSentAt: o,
305
+ turnSentAt: s,
277
306
  ...t
278
307
  };
279
308
  T.push(n), h((e) => [...e, n]);
@@ -285,7 +314,7 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
285
314
  kind: "error",
286
315
  message: e.message,
287
316
  at: Date.now(),
288
- turnSentAt: o
317
+ turnSentAt: s
289
318
  };
290
319
  T.push(t), h((e) => [...e, t]);
291
320
  return;
@@ -297,19 +326,19 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
297
326
  } : e));
298
327
  };
299
328
  try {
300
- let { status: i, text: s, errorMessage: u } = await e.streamChat({
329
+ let { status: a, text: o, errorMessage: u } = await e.streamChat({
301
330
  model: t,
302
331
  instructions: n,
303
332
  input: f,
304
333
  tools: r,
305
- toolChoice: a,
334
+ toolChoice: i,
306
335
  signal: m.signal,
307
336
  onChunk: (e) => {
308
337
  F(m), g += e;
309
- let { events: t, remainder: n, done: r } = k(g);
338
+ let { events: t, remainder: n, done: r } = A(g);
310
339
  g = n, j(t, r);
311
340
  let i = Date.now();
312
- _((e) => e && e.sentAt === o ? {
341
+ _((e) => e && e.sentAt === s ? {
313
342
  ...e,
314
343
  streamStats: {
315
344
  chunkCount: e.streamStats.chunkCount + 1,
@@ -319,38 +348,38 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
319
348
  } : e);
320
349
  },
321
350
  onRequestId: (e) => {
322
- _((t) => t && t.sentAt === o ? {
351
+ _((t) => t && t.sentAt === s ? {
323
352
  ...t,
324
353
  requestId: e
325
354
  } : t);
326
355
  }
327
356
  });
328
357
  if (g.trim()) {
329
- let { events: e, done: t } = k(`${g}\n\n`);
358
+ let { events: e, done: t } = A(`${g}\n\n`);
330
359
  g = "", j(e, t);
331
360
  }
332
361
  if (v) {
333
362
  y("error"), x(v);
334
363
  return;
335
364
  }
336
- if (i === void 0 || i >= 400) {
337
- D(ee(i, s, u), {
338
- httpStatus: i,
339
- rawBody: s || void 0
365
+ if (a === void 0 || a >= 400) {
366
+ O(ee(a, o, u), {
367
+ httpStatus: a,
368
+ rawBody: o || void 0
340
369
  });
341
370
  return;
342
371
  }
343
372
  if (!b) {
344
- D("Bailey returned an empty response.");
373
+ O("Bailey returned an empty response.");
345
374
  return;
346
375
  }
347
376
  if (!C) {
348
- D("Bailey ran some tools but didn't return an answer. Try asking again.");
377
+ O("Bailey ran some tools but didn't return an answer. Try asking again.");
349
378
  return;
350
379
  }
351
380
  y("idle");
352
- let d = A.current.get(l) ?? "";
353
- _((e) => e && e.sentAt === o ? {
381
+ let d = k.current.get(l) ?? "";
382
+ _((e) => e && e.sentAt === s ? {
354
383
  ...e,
355
384
  response: { content: d }
356
385
  } : e), c && await c({
@@ -362,18 +391,20 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
362
391
  } catch (e) {
363
392
  let t = e;
364
393
  if (t?.name === "TimeoutError") {
365
- D(t.message, { source: "client-timeout" });
394
+ O(t.message, { source: "client-timeout" });
366
395
  return;
367
396
  }
368
397
  if (t?.name === "AbortError") {
369
398
  y("idle");
370
399
  return;
371
400
  }
372
- D(t?.message || "Bailey request failed.");
401
+ O(t?.message || "Bailey request failed.");
373
402
  } finally {
374
403
  P();
375
- let e = A.current.get(l) ?? "";
376
- O.current.delete(l), A.current.delete(l), p((e) => e.flatMap((e) => e.id === l ? e.content ? [{
404
+ let e = k.current.get(l) ?? "";
405
+ D.current.delete(l), k.current.delete(l);
406
+ let t = T.some((e) => e.kind === "tool_start" || e.kind === "tool_end");
407
+ p((e) => e.flatMap((e) => e.id === l ? e.content || t ? [{
377
408
  ...e,
378
409
  streaming: !1
379
410
  }] : [] : [e])), E.current = E.current.flatMap((t) => t.id === l ? e ? [{
@@ -387,13 +418,13 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
387
418
  t,
388
419
  n,
389
420
  r,
390
- a,
391
- s,
421
+ i,
422
+ o,
392
423
  c,
393
424
  I,
394
425
  F,
395
426
  P
396
- ]), R = i((e) => {
427
+ ]), R = a((e) => {
397
428
  T.current = e, p(e);
398
429
  }, []);
399
430
  return {
@@ -402,25 +433,25 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
402
433
  lastRequest: g,
403
434
  status: v,
404
435
  error: b,
405
- send: i((e) => {
436
+ send: a((e) => {
406
437
  let t = e.trim();
407
438
  if (!t) return;
408
439
  C.current = t;
409
440
  let n = {
410
- id: M(),
441
+ id: N(),
411
442
  role: "user",
412
443
  content: t,
413
444
  createdAt: Date.now()
414
445
  }, r = [...E.current, n];
415
446
  E.current = r, R([...T.current, n]), L(r);
416
447
  }, [L, R]),
417
- sendHidden: i((e, t) => {
448
+ sendHidden: a((e, t) => {
418
449
  if (v === "streaming") return;
419
450
  let n = e.trim();
420
451
  if (!n) return;
421
452
  C.current = n;
422
453
  let r = t?.trim(), i = {
423
- id: M(),
454
+ id: N(),
424
455
  role: "user",
425
456
  content: n,
426
457
  createdAt: Date.now(),
@@ -429,10 +460,10 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
429
460
  }, a = [...E.current, i];
430
461
  E.current = a, L(a);
431
462
  }, [L, v]),
432
- stop: i(() => {
463
+ stop: a(() => {
433
464
  S.current?.abort();
434
465
  }, []),
435
- retryLast: i(() => {
466
+ retryLast: a(() => {
436
467
  if (v === "streaming" || !C.current) return;
437
468
  let e = T.current, t = e[e.length - 1], n = t && t.role === "assistant" ? e.slice(0, -1) : e;
438
469
  R(n);
@@ -443,14 +474,14 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
443
474
  R,
444
475
  v
445
476
  ]),
446
- clearTrace: i(() => h([]), []),
447
- clearError: i(() => {
477
+ clearTrace: a(() => h([]), []),
478
+ clearError: a(() => {
448
479
  x(null), y((e) => e === "error" ? "idle" : e);
449
480
  }, []),
450
- newChat: i(() => {
481
+ newChat: a(() => {
451
482
  S.current?.abort(), R([]), E.current = [], h([]), _(null), y("idle"), x(null), C.current = "";
452
483
  }, [R]),
453
- loadMessages: i((e) => {
484
+ loadMessages: a((e) => {
454
485
  S.current?.abort();
455
486
  let t = e.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
456
487
  ...e,
@@ -462,15 +493,15 @@ var A = 200, j = 15e4, M = () => typeof crypto < "u" && typeof crypto.randomUUID
462
493
  };
463
494
  //#endregion
464
495
  //#region src/utils/prompt.ts
465
- function P(...e) {
496
+ function F(...e) {
466
497
  return e.filter((e) => !!(e && e.trim())).join("\n\n");
467
498
  }
468
499
  //#endregion
469
500
  //#region src/utils/toolCalls.ts
470
- var F = "call_tool", I = "a tool";
471
- function L(e, t) {
501
+ var I = "call_tool", L = "a tool";
502
+ function R(e, t) {
472
503
  let n = {
473
- name: e === F ? I : e,
504
+ name: e === I ? L : e,
474
505
  args: null,
475
506
  viaCallTool: !1
476
507
  };
@@ -483,7 +514,7 @@ function L(e, t) {
483
514
  }
484
515
  if (typeof r != "object" || !r) return n;
485
516
  let i = r;
486
- if (e === F) {
517
+ if (e === I) {
487
518
  let e = typeof i.name == "string" ? i.name : void 0;
488
519
  if (!e) return n;
489
520
  let t = i.arguments;
@@ -501,32 +532,32 @@ function L(e, t) {
501
532
  }
502
533
  //#endregion
503
534
  //#region src/utils/table.ts
504
- var R = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map(z).join(""), B = (e) => {
535
+ var te = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map(z).join(""), ne = (e) => {
505
536
  if (e.tagName === "a" && e.properties?.href) return e.properties.href;
506
537
  for (let t of e.children ?? []) {
507
- let e = B(t);
538
+ let e = ne(t);
508
539
  if (e) return e;
509
540
  }
510
- }, V = (e, t) => (e.children ?? []).find((e) => e.tagName === t), te = (e) => {
511
- let t = z(e), n = B(e);
541
+ }, B = (e, t) => (e.children ?? []).find((e) => e.tagName === t), V = (e) => {
542
+ let t = z(e), n = ne(e);
512
543
  return n ? {
513
544
  text: t,
514
545
  href: n
515
546
  } : { text: t };
516
- }, H = (e) => (e.children ?? []).filter((e) => e.type === "element").map(te), U = (e) => {
547
+ }, H = (e) => (e.children ?? []).filter((e) => e.type === "element").map(V), U = (e) => {
517
548
  if (e.tagName !== "table") return null;
518
- let t = V(e, "thead"), n = t && V(t, "tr");
549
+ let t = B(e, "thead"), n = t && B(t, "tr");
519
550
  return {
520
551
  headers: n ? H(n).map((e) => e.text) : [],
521
- rows: (V(e, "tbody")?.children ?? []).filter((e) => e.tagName === "tr").map(H)
552
+ rows: (B(e, "tbody")?.children ?? []).filter((e) => e.tagName === "tr").map(H)
522
553
  };
523
- }, W = (e) => e.length > 5, G = "When a chart would help answer a question (e.g. plotting a trend over time), include a fenced code block tagged `chartjs` containing a JSON object with this exact shape: {\"type\": \"bar\" | \"line\" | \"pie\" | \"doughnut\" | \"scatter\", \"title\"?: string, \"data\": {\"labels\": string[], \"datasets\": [{\"label\": string, \"data\": number[]}]}}. For \"scatter\" charts, omit \"labels\" and give each dataset \"data\" as an array of {\"x\": number, \"y\": number} points instead of a number array. \"pie\" and \"doughnut\" charts must have exactly one dataset. Do not include any other fields (no \"options\", no colors) — the app handles styling. Example:\n```chartjs\n{\"type\": \"line\", \"title\": \"BP readings\", \"data\": {\"labels\": [\"Jul 14\", \"Jul 21\", \"Jul 28\"], \"datasets\": [{\"label\": \"Systolic\", \"data\": [120, 118, 122]}]}}\n```", K = [
554
+ }, W = (e) => e.length > 5, re = "When a chart would help answer a question (e.g. plotting a trend over time), include a fenced code block tagged `chartjs` containing a JSON object with this exact shape: {\"type\": \"bar\" | \"line\" | \"pie\" | \"doughnut\" | \"scatter\", \"title\"?: string, \"data\": {\"labels\": string[], \"datasets\": [{\"label\": string, \"data\": number[]}]}}. For \"scatter\" charts, omit \"labels\" and give each dataset \"data\" as an array of {\"x\": number, \"y\": number} points instead of a number array. \"pie\" and \"doughnut\" charts must have exactly one dataset. Do not include any other fields (no \"options\", no colors) — the app handles styling. Example:\n```chartjs\n{\"type\": \"line\", \"title\": \"BP readings\", \"data\": {\"labels\": [\"Jul 14\", \"Jul 21\", \"Jul 28\"], \"datasets\": [{\"label\": \"Systolic\", \"data\": [120, 118, 122]}]}}\n```", G = [
524
555
  "bar",
525
556
  "line",
526
557
  "pie",
527
558
  "doughnut",
528
559
  "scatter"
529
- ], q = 8, ne = 50, re = 8, ie = 500, ae = (e) => typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number", oe = (e) => {
560
+ ], ie = 8, K = 50, ae = 8, oe = 500, se = (e) => typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number", q = (e) => {
530
561
  let t;
531
562
  try {
532
563
  t = JSON.parse(e);
@@ -535,17 +566,17 @@ var R = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
535
566
  }
536
567
  if (typeof t != "object" || !t) return null;
537
568
  let n = t;
538
- if (typeof n.type != "string" || !K.includes(n.type)) return null;
569
+ if (typeof n.type != "string" || !G.includes(n.type)) return null;
539
570
  let r = n.type;
540
571
  if (n.title !== void 0 && typeof n.title != "string") return null;
541
572
  let i = n.title;
542
573
  if (typeof n.data != "object" || n.data === null) return null;
543
574
  let a = n.data;
544
- if (!Array.isArray(a.datasets) || a.datasets.length < 1 || a.datasets.length > q || (r === "pie" || r === "doughnut") && a.datasets.length !== 1) return null;
575
+ if (!Array.isArray(a.datasets) || a.datasets.length < 1 || a.datasets.length > ie || (r === "pie" || r === "doughnut") && a.datasets.length !== 1) return null;
545
576
  for (let e of a.datasets) if (typeof e != "object" || !e || typeof e.label != "string" || !Array.isArray(e.data)) return null;
546
577
  let o = a.datasets;
547
578
  if (r === "scatter") {
548
- for (let e of o) if (e.data.length < 1 || e.data.length > ie || !e.data.every(ae)) return null;
579
+ for (let e of o) if (e.data.length < 1 || e.data.length > oe || !e.data.every(se)) return null;
549
580
  return {
550
581
  type: r,
551
582
  title: i,
@@ -553,7 +584,7 @@ var R = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
553
584
  };
554
585
  }
555
586
  if (!Array.isArray(a.labels) || !a.labels.every((e) => typeof e == "string")) return null;
556
- let s = a.labels, c = r === "pie" || r === "doughnut" ? re : ne;
587
+ let s = a.labels, c = r === "pie" || r === "doughnut" ? ae : K;
557
588
  if (s.length < 1 || s.length > c) return null;
558
589
  for (let e of o) if (e.data.length !== s.length || !e.data.every((e) => typeof e == "number")) return null;
559
590
  return {
@@ -564,7 +595,7 @@ var R = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
564
595
  datasets: o
565
596
  }
566
597
  };
567
- }, se = {
598
+ }, ce = {
568
599
  tool_start: "Tool start",
569
600
  tool_end: "Tool end",
570
601
  pseudo_tool_call: "Narrated tool call",
@@ -576,12 +607,12 @@ var R = 5, z = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
576
607
  raw: "Raw event"
577
608
  };
578
609
  function J(e) {
579
- return e.kind !== "tool_start" && e.kind !== "tool_end" ? null : L(e.name, e.args);
610
+ return e.kind !== "tool_start" && e.kind !== "tool_end" ? null : R(e.name, e.args);
580
611
  }
581
612
  function Y(e, t = J(e)) {
582
613
  return e.kind === "pseudo_tool_call" ? e.name : t?.name ?? null;
583
614
  }
584
- function ce(e, t = J(e)) {
615
+ function X(e, t = J(e)) {
585
616
  switch (e.kind) {
586
617
  case "tool_start": return t.viaCallTool ? `${t.name} (via call_tool)` : t.name;
587
618
  case "tool_end": return `${t.viaCallTool ? `${t.name} (via call_tool)` : t.name}${e.runtimeSeconds === void 0 ? "" : ` — ${e.runtimeSeconds.toFixed(2)}s`}${e.isError ? " — failed" : ""}`;
@@ -594,23 +625,23 @@ function ce(e, t = J(e)) {
594
625
  case "raw": return `Unrecognized event: ${e.eventType}`;
595
626
  }
596
627
  }
597
- function le(e, t = J(e)) {
628
+ function Z(e, t = J(e)) {
598
629
  return e.kind === "tool_start" || e.kind === "tool_end" ? t.args ? JSON.stringify(t.args, null, 2) : e.args ?? null : e.kind === "pseudo_tool_call" ? e.args ?? null : e.kind === "llm_call_start" ? JSON.stringify(e.request, null, 2) : null;
599
630
  }
600
- function ue(e) {
631
+ function le(e) {
601
632
  return e.kind === "tool_end" ? e.output ?? null : e.kind === "llm_call_end" ? e.response ?? null : null;
602
633
  }
603
- function de(e) {
634
+ function ue(e) {
604
635
  return e.kind === "tool_end" && e.structuredOutput ? JSON.stringify(e.structuredOutput, null, 2) : null;
605
636
  }
606
- function fe(e) {
637
+ function de(e) {
607
638
  return e.kind === "raw" ? e.raw : e.kind === "error" ? e.rawBody ?? null : null;
608
639
  }
609
- function X(e) {
640
+ function fe(e) {
610
641
  switch (e.kind) {
611
- case "tool_start": return `Calling ${L(e.name, e.args).name}...`;
642
+ case "tool_start": return `Calling ${R(e.name, e.args).name}...`;
612
643
  case "tool_end": {
613
- let t = L(e.name, e.args).name;
644
+ let t = R(e.name, e.args).name;
614
645
  return e.isError ? `${t} failed` : `${t} returned`;
615
646
  }
616
647
  case "pseudo_tool_call": return `${e.name} (written as text, not called)`;
@@ -645,12 +676,12 @@ function he(e) {
645
676
  failed: t.kind === "tool_end" && t.isError === !0,
646
677
  time: pe(t.at),
647
678
  gapMs: t.at - i,
648
- label: t.kind === "tool_end" && t.isError === !0 ? "Tool failed" : se[t.kind],
649
- summary: ce(t, r),
650
- argsDetail: le(t, r),
651
- outputDetail: ue(t),
652
- structuredOutputDetail: de(t),
653
- rawDetail: fe(t)
679
+ label: t.kind === "tool_end" && t.isError === !0 ? "Tool failed" : ce[t.kind],
680
+ summary: X(t, r),
681
+ argsDetail: Z(t, r),
682
+ outputDetail: le(t),
683
+ structuredOutputDetail: ue(t),
684
+ rawDetail: de(t)
654
685
  };
655
686
  });
656
687
  }
@@ -683,53 +714,80 @@ function ve(e) {
683
714
  function ye(e, t) {
684
715
  return t === void 0 ? [] : e.filter((e) => e.turnSentAt === t && (e.kind === "tool_end" || e.kind === "pseudo_tool_call" || e.kind === "progress")).map((e, t) => ({
685
716
  key: `${e.at}-${t}`,
686
- text: X(e),
717
+ text: fe(e),
687
718
  toolName: Y(e)
688
719
  }));
689
720
  }
721
+ function be(e, t) {
722
+ if (t === void 0) return [];
723
+ let n = [];
724
+ for (let r of e) if (r.turnSentAt === t) {
725
+ if (r.kind === "tool_start") {
726
+ let e = R(r.name, r.args).name;
727
+ n.push({
728
+ key: `step-${n.length}`,
729
+ callId: r.callId,
730
+ toolName: e,
731
+ label: r.displayName || e,
732
+ status: "running"
733
+ });
734
+ } else if (r.kind === "tool_end") {
735
+ let e = R(r.name, r.args).name, t = r.isError ? "failed" : "done", i = n.find((t) => t.status === "running" && t.callId === r.callId && t.toolName === e);
736
+ i ? (i.status = t, i.runtimeSeconds = r.runtimeSeconds, i.label = r.displayName || i.label) : n.push({
737
+ key: `step-${n.length}`,
738
+ callId: r.callId,
739
+ toolName: e,
740
+ label: r.displayName || e,
741
+ status: t,
742
+ runtimeSeconds: r.runtimeSeconds
743
+ });
744
+ }
745
+ }
746
+ return n;
747
+ }
690
748
  //#endregion
691
749
  //#region src/styles.css?inline
692
- var be = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-leading:initial;--tw-space-y-reverse:0}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-tool-result-image{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);max-width:100%;height:auto;display:block}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-activity-line{margin-bottom:calc(var(--spacing) * 2);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-area{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);min-width:0;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-menu-button{height:calc(var(--spacing) * 13);width:calc(var(--spacing) * 13);cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-menu-button:hover{background-color:var(--color-gray-50)}}.bailey-menu-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-menu-content{z-index:50;min-width:calc(var(--spacing) * 44);border-radius:var(--radius-2xl);background-color:var(--color-white);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-black);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);font-family:var(--font-sans,\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif)}.bailey-menu-item{cursor:pointer;align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none;display:flex}.bailey-menu-item[data-highlighted]{background-color:var(--color-gray-100)}.bailey-menu-item-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-gray-600)}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}", xe = n(void 0), Se = /:root\s*,\s*:host\s*\{/, Ce = ".bailey-chat-panel{";
693
- function we(e) {
694
- let t = e.match(new RegExp(Se, "g"))?.length ?? 0;
750
+ var xe = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-leading:initial;--tw-space-y-reverse:0}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-tool-result-image{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);max-width:100%;height:auto;display:block}.bailey-mcp-app-frame{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:0;width:100%;height:480px;display:block}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-tool-steps-live{margin-top:calc(var(--spacing) * 2);gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-activity-line{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-step-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent);border-radius:2147483647px;flex-shrink:0}@media (prefers-reduced-motion:no-preference){.bailey-step-spinner{animation:var(--animate-spin)}}.bailey-tool-steps-summary{margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary)}.bailey-tool-steps-summary>summary{cursor:pointer;-webkit-user-select:none;user-select:none}.bailey-tool-steps-list{margin:0;margin-top:var(--spacing);gap:var(--spacing);flex-direction:column;padding:0;list-style-type:none;display:flex}.bailey-tool-step{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-tool-step-failed{color:var(--color-bailey-error)}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-area{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);min-width:0;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-menu-button{height:calc(var(--spacing) * 13);width:calc(var(--spacing) * 13);cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-menu-button:hover{background-color:var(--color-gray-50)}}.bailey-menu-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-menu-content{z-index:50;min-width:calc(var(--spacing) * 44);border-radius:var(--radius-2xl);background-color:var(--color-white);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-black);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);font-family:var(--font-sans,\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif)}.bailey-menu-item{cursor:pointer;align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none;display:flex}.bailey-menu-item[data-highlighted]{background-color:var(--color-gray-100)}.bailey-menu-item-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-gray-600)}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}", Se = r(void 0), Ce = /:root\s*,\s*:host\s*\{/, we = ".bailey-chat-panel{";
751
+ function Te(e) {
752
+ let t = e.match(new RegExp(Ce, "g"))?.length ?? 0;
695
753
  if (t !== 1) throw Error(`Expected exactly one ":root, :host {" rule in the compiled styles.css, found ${t}. Tailwind likely changed how @theme compiles — update this rewrite (and its sibling, scripts/scope-theme-vars.js) before shipping.`);
696
- return e.replace(Se, Ce);
754
+ return e.replace(Ce, we);
697
755
  }
698
- var Te = we(be), Z = "data-source", Ee = "baileyai-chat-ui", Q = /* @__PURE__ */ new WeakMap();
699
- function De(e) {
756
+ var Ee = Te(xe), De = "data-source", Oe = "baileyai-chat-ui", Q = /* @__PURE__ */ new WeakMap();
757
+ function ke(e) {
700
758
  let t = e.getRootNode();
701
759
  return t instanceof ShadowRoot ? t : document;
702
760
  }
703
- function Oe(e) {
761
+ function Ae(e) {
704
762
  let t = e instanceof ShadowRoot ? e : document.head, n = Q.get(e) ?? 0;
705
- if (n === 0 && !t.querySelector(`style[${Z}="${Ee}"]`)) {
763
+ if (n === 0 && !t.querySelector(`style[${De}="${Oe}"]`)) {
706
764
  let e = document.createElement("style");
707
- e.setAttribute(Z, Ee), e.textContent = Te, t.appendChild(e);
765
+ e.setAttribute(De, Oe), e.textContent = Ee, t.appendChild(e);
708
766
  }
709
767
  return Q.set(e, n + 1), () => {
710
768
  let n = (Q.get(e) ?? 1) - 1;
711
- n <= 0 ? (Q.delete(e), t.querySelector(`style[${Z}="${Ee}"]`)?.remove()) : Q.set(e, n);
769
+ n <= 0 ? (Q.delete(e), t.querySelector(`style[${De}="${Oe}"]`)?.remove()) : Q.set(e, n);
712
770
  };
713
771
  }
714
- function ke(e, t = !1) {
715
- let [n, r] = u(null);
716
- return s(() => {
772
+ function je(e, t = !1) {
773
+ let [n, r] = d(null);
774
+ return c(() => {
717
775
  if (t) return;
718
776
  let n = e.current;
719
777
  if (!n) return;
720
- let i = De(n);
721
- return r(i), Oe(i);
778
+ let i = ke(n);
779
+ return r(i), Ae(i);
722
780
  }, [t, e]), n;
723
781
  }
724
- function Ae(e) {
725
- let t = a(xe), n = t !== void 0, r = ke(e, n);
782
+ function Me(e) {
783
+ let t = o(Se), n = t !== void 0, r = je(e, n);
726
784
  return n ? t : r;
727
785
  }
728
786
  //#endregion
729
787
  //#region src/ui/markdown.tsx
730
- function je({ renderTable: t, renderChart: n } = {}) {
788
+ function Ne({ renderTable: t, renderChart: n } = {}) {
731
789
  return {
732
- a: ({ href: t, children: n }) => !t || !e(t) ? /* @__PURE__ */ g(h, { children: n }) : /* @__PURE__ */ g("a", {
790
+ a: ({ href: t, children: n }) => !t || !e(t) ? /* @__PURE__ */ _(g, { children: n }) : /* @__PURE__ */ _("a", {
733
791
  href: t,
734
792
  target: "_blank",
735
793
  rel: "noopener noreferrer",
@@ -739,41 +797,41 @@ function je({ renderTable: t, renderChart: n } = {}) {
739
797
  let i = n && U(n);
740
798
  if (i && W(i.rows) && t) {
741
799
  let n = i.rows.map((t) => t.map((t) => t.href && !e(t.href) ? { text: t.text } : t));
742
- return /* @__PURE__ */ g(h, { children: t({
800
+ return /* @__PURE__ */ _(g, { children: t({
743
801
  headers: i.headers,
744
802
  rows: n
745
803
  }) });
746
804
  }
747
- return /* @__PURE__ */ g("table", { children: r });
805
+ return /* @__PURE__ */ _("table", { children: r });
748
806
  },
749
807
  pre: ({ children: e }) => {
750
808
  let t = (Array.isArray(e) ? e[0] : e)?.props;
751
809
  if ((t?.className?.split(" ") ?? []).includes("language-chartjs") && n) {
752
- let e = t?.children, r = oe(Array.isArray(e) ? e.join("") : String(e ?? ""));
753
- if (r) return /* @__PURE__ */ g(h, { children: n(r) });
810
+ let e = t?.children, r = q(Array.isArray(e) ? e.join("") : String(e ?? ""));
811
+ if (r) return /* @__PURE__ */ _(g, { children: n(r) });
754
812
  }
755
- return /* @__PURE__ */ g("pre", { children: e });
813
+ return /* @__PURE__ */ _("pre", { children: e });
756
814
  }
757
815
  };
758
816
  }
759
817
  //#endregion
760
818
  //#region src/ui/icons.tsx
761
- function Me({ className: e }) {
762
- return /* @__PURE__ */ g("svg", {
819
+ function Pe({ className: e }) {
820
+ return /* @__PURE__ */ _("svg", {
763
821
  viewBox: "0 0 24 24",
764
822
  fill: "currentColor",
765
823
  className: e,
766
824
  "aria-hidden": "true",
767
- children: /* @__PURE__ */ g("path", { d: "M12 20.3s-7.6-4.7-10-9.4C.4 7.7 1.7 4 5.2 3.1c2.2-.6 4.4.4 5.5 2.2 1.2-1.8 3.4-2.8 5.6-2.2 3.5.9 4.8 4.6 3.2 7.8-2.4 4.7-10 9.4-10 9.4z" })
825
+ children: /* @__PURE__ */ _("path", { d: "M12 20.3s-7.6-4.7-10-9.4C.4 7.7 1.7 4 5.2 3.1c2.2-.6 4.4.4 5.5 2.2 1.2-1.8 3.4-2.8 5.6-2.2 3.5.9 4.8 4.6 3.2 7.8-2.4 4.7-10 9.4-10 9.4z" })
768
826
  });
769
827
  }
770
- function Ne({ className: e }) {
771
- return /* @__PURE__ */ g("svg", {
828
+ function Fe({ className: e }) {
829
+ return /* @__PURE__ */ _("svg", {
772
830
  viewBox: "0 0 24 24",
773
831
  fill: "currentColor",
774
832
  className: e,
775
833
  "aria-hidden": "true",
776
- children: /* @__PURE__ */ g("rect", {
834
+ children: /* @__PURE__ */ _("rect", {
777
835
  x: "6",
778
836
  y: "6",
779
837
  width: "12",
@@ -782,8 +840,8 @@ function Ne({ className: e }) {
782
840
  })
783
841
  });
784
842
  }
785
- function Pe({ className: e }) {
786
- return /* @__PURE__ */ _("svg", {
843
+ function Ie({ className: e }) {
844
+ return /* @__PURE__ */ v("svg", {
787
845
  viewBox: "0 0 24 24",
788
846
  fill: "none",
789
847
  stroke: "currentColor",
@@ -792,11 +850,11 @@ function Pe({ className: e }) {
792
850
  strokeLinejoin: "round",
793
851
  className: e,
794
852
  "aria-hidden": "true",
795
- children: [/* @__PURE__ */ g("path", { d: "M7 17 17 7" }), /* @__PURE__ */ g("path", { d: "M9 7h8v8" })]
853
+ children: [/* @__PURE__ */ _("path", { d: "M7 17 17 7" }), /* @__PURE__ */ _("path", { d: "M9 7h8v8" })]
796
854
  });
797
855
  }
798
- function Fe({ className: e }) {
799
- return /* @__PURE__ */ _("svg", {
856
+ function Le({ className: e }) {
857
+ return /* @__PURE__ */ v("svg", {
800
858
  viewBox: "0 0 24 24",
801
859
  fill: "none",
802
860
  stroke: "currentColor",
@@ -805,17 +863,17 @@ function Fe({ className: e }) {
805
863
  strokeLinejoin: "round",
806
864
  className: e,
807
865
  "aria-hidden": "true",
808
- children: [/* @__PURE__ */ g("rect", {
866
+ children: [/* @__PURE__ */ _("rect", {
809
867
  x: "8",
810
868
  y: "8",
811
869
  width: "12",
812
870
  height: "12",
813
871
  rx: "2"
814
- }), /* @__PURE__ */ g("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })]
872
+ }), /* @__PURE__ */ _("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })]
815
873
  });
816
874
  }
817
- function Ie({ className: e }) {
818
- return /* @__PURE__ */ g("svg", {
875
+ function Re({ className: e }) {
876
+ return /* @__PURE__ */ _("svg", {
819
877
  viewBox: "0 0 24 24",
820
878
  fill: "none",
821
879
  stroke: "currentColor",
@@ -824,11 +882,11 @@ function Ie({ className: e }) {
824
882
  strokeLinejoin: "round",
825
883
  className: e,
826
884
  "aria-hidden": "true",
827
- children: /* @__PURE__ */ g("path", { d: "M5 12.5 9.5 17 19 7" })
885
+ children: /* @__PURE__ */ _("path", { d: "M5 12.5 9.5 17 19 7" })
828
886
  });
829
887
  }
830
- function Le({ className: e }) {
831
- return /* @__PURE__ */ g("svg", {
888
+ function ze({ className: e }) {
889
+ return /* @__PURE__ */ _("svg", {
832
890
  viewBox: "0 0 24 24",
833
891
  fill: "none",
834
892
  stroke: "currentColor",
@@ -837,11 +895,11 @@ function Le({ className: e }) {
837
895
  strokeLinejoin: "round",
838
896
  className: e,
839
897
  "aria-hidden": "true",
840
- children: /* @__PURE__ */ g("path", { d: "m22.7 13.5-2-2-2 2M21 12a9 9 0 1 1-1.245-4.57M12 7v5l3 2" })
898
+ children: /* @__PURE__ */ _("path", { d: "m22.7 13.5-2-2-2 2M21 12a9 9 0 1 1-1.245-4.57M12 7v5l3 2" })
841
899
  });
842
900
  }
843
- function Re({ className: e }) {
844
- return /* @__PURE__ */ _("svg", {
901
+ function Be({ className: e }) {
902
+ return /* @__PURE__ */ v("svg", {
845
903
  viewBox: "0 0 24 24",
846
904
  fill: "none",
847
905
  stroke: "currentColor",
@@ -850,31 +908,31 @@ function Re({ className: e }) {
850
908
  strokeLinejoin: "round",
851
909
  className: e,
852
910
  "aria-hidden": "true",
853
- children: [/* @__PURE__ */ g("circle", {
911
+ children: [/* @__PURE__ */ _("circle", {
854
912
  cx: "12",
855
913
  cy: "12",
856
914
  r: "9"
857
- }), /* @__PURE__ */ g("path", { d: "M8.5 12.5 11 15l4.5-5.5" })]
915
+ }), /* @__PURE__ */ _("path", { d: "M8.5 12.5 11 15l4.5-5.5" })]
858
916
  });
859
917
  }
860
- function ze({ className: e }) {
861
- return /* @__PURE__ */ _("svg", {
918
+ function Ve({ className: e }) {
919
+ return /* @__PURE__ */ v("svg", {
862
920
  viewBox: "0 0 24 24",
863
921
  fill: "currentColor",
864
922
  className: e,
865
923
  "aria-hidden": "true",
866
924
  children: [
867
- /* @__PURE__ */ g("circle", {
925
+ /* @__PURE__ */ _("circle", {
868
926
  cx: "5",
869
927
  cy: "12",
870
928
  r: "1.75"
871
929
  }),
872
- /* @__PURE__ */ g("circle", {
930
+ /* @__PURE__ */ _("circle", {
873
931
  cx: "12",
874
932
  cy: "12",
875
933
  r: "1.75"
876
934
  }),
877
- /* @__PURE__ */ g("circle", {
935
+ /* @__PURE__ */ _("circle", {
878
936
  cx: "19",
879
937
  cy: "12",
880
938
  r: "1.75"
@@ -882,8 +940,8 @@ function ze({ className: e }) {
882
940
  ]
883
941
  });
884
942
  }
885
- function Be({ className: e }) {
886
- return /* @__PURE__ */ g("svg", {
943
+ function He({ className: e }) {
944
+ return /* @__PURE__ */ _("svg", {
887
945
  viewBox: "0 0 24 24",
888
946
  fill: "none",
889
947
  stroke: "currentColor",
@@ -892,24 +950,24 @@ function Be({ className: e }) {
892
950
  strokeLinejoin: "round",
893
951
  className: e,
894
952
  "aria-hidden": "true",
895
- children: /* @__PURE__ */ g("path", { d: "M12 5v14M5 12h14" })
953
+ children: /* @__PURE__ */ _("path", { d: "M12 5v14M5 12h14" })
896
954
  });
897
955
  }
898
956
  //#endregion
899
957
  //#region src/ui/CopyMarkdownButton.tsx
900
- var Ve = 1500;
901
- function He({ markdown: e, className: t, ariaLabel: n = "copy response as markdown", tooltipDefaultText: r = "Copy as markdown", tooltipCopiedText: i = "Copied!" }) {
902
- let [a, s] = u(!1), [c, d] = u(!1), f = l(null), p = l(null), h = Ae(p);
903
- return o(() => () => {
958
+ var Ue = 1500;
959
+ function We({ markdown: e, className: t, ariaLabel: n = "copy response as markdown", tooltipDefaultText: r = "Copy as markdown", tooltipCopiedText: i = "Copied!" }) {
960
+ let [a, o] = d(!1), [c, l] = d(!1), f = u(null), p = u(null), m = Me(p);
961
+ return s(() => () => {
904
962
  f.current !== null && clearTimeout(f.current);
905
- }, []), /* @__PURE__ */ g(m.Provider, {
963
+ }, []), /* @__PURE__ */ _(h.Provider, {
906
964
  delayDuration: 200,
907
- children: /* @__PURE__ */ _(m.Root, {
965
+ children: /* @__PURE__ */ v(h.Root, {
908
966
  open: a || c,
909
- onOpenChange: d,
910
- children: [/* @__PURE__ */ g(m.Trigger, {
967
+ onOpenChange: l,
968
+ children: [/* @__PURE__ */ _(h.Trigger, {
911
969
  asChild: !0,
912
- children: /* @__PURE__ */ g("button", {
970
+ children: /* @__PURE__ */ _("button", {
913
971
  ref: p,
914
972
  type: "button",
915
973
  onClick: async () => {
@@ -918,18 +976,18 @@ function He({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
918
976
  } catch {
919
977
  return;
920
978
  }
921
- s(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => s(!1), Ve);
979
+ o(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => o(!1), Ue);
922
980
  },
923
981
  "aria-label": n,
924
982
  className: `bailey-copy-button${t ? ` ${t}` : ""}`,
925
- children: g(a ? Ie : Fe, { className: "bailey-copy-icon" })
983
+ children: _(a ? Re : Le, { className: "bailey-copy-icon" })
926
984
  })
927
- }), /* @__PURE__ */ g(m.Portal, {
928
- container: h instanceof ShadowRoot ? h : void 0,
929
- children: /* @__PURE__ */ _(m.Content, {
985
+ }), /* @__PURE__ */ _(h.Portal, {
986
+ container: m instanceof ShadowRoot ? m : void 0,
987
+ children: /* @__PURE__ */ v(h.Content, {
930
988
  side: "top",
931
989
  className: "bailey-tooltip-content",
932
- children: [a ? i : r, /* @__PURE__ */ g(m.Arrow, { className: "bailey-tooltip-arrow" })]
990
+ children: [a ? i : r, /* @__PURE__ */ _(h.Arrow, { className: "bailey-tooltip-arrow" })]
933
991
  })
934
992
  })]
935
993
  })
@@ -937,20 +995,20 @@ function He({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
937
995
  }
938
996
  //#endregion
939
997
  //#region src/ui/BaileyTracePanel.tsx
940
- async function Ue(e) {
998
+ async function Ge(e) {
941
999
  try {
942
1000
  await navigator.clipboard.writeText(e);
943
1001
  } catch {}
944
1002
  }
945
- function We({ text: e, label: t = "Copy" }) {
946
- return /* @__PURE__ */ g("button", {
1003
+ function Ke({ text: e, label: t = "Copy" }) {
1004
+ return /* @__PURE__ */ _("button", {
947
1005
  type: "button",
948
- onClick: () => Ue(e),
1006
+ onClick: () => Ge(e),
949
1007
  className: "bailey-trace-copy-button",
950
1008
  children: t
951
1009
  });
952
1010
  }
953
- function Ge(e) {
1011
+ function qe(e) {
954
1012
  if (e.failed || e.kind === "error") return "bailey-trace-chip bailey-trace-chip-error";
955
1013
  switch (e.kind) {
956
1014
  case "tool_start":
@@ -962,77 +1020,77 @@ function Ge(e) {
962
1020
  }
963
1021
  }
964
1022
  function $({ label: e, content: t, copyable: n }) {
965
- return /* @__PURE__ */ _("details", {
1023
+ return /* @__PURE__ */ v("details", {
966
1024
  className: "bailey-trace-disclosure",
967
1025
  children: [
968
- /* @__PURE__ */ g("summary", {
1026
+ /* @__PURE__ */ _("summary", {
969
1027
  className: "bailey-trace-disclosure-summary",
970
1028
  children: e
971
1029
  }),
972
- n && /* @__PURE__ */ g("div", {
1030
+ n && /* @__PURE__ */ _("div", {
973
1031
  className: "bailey-trace-disclosure-actions",
974
- children: /* @__PURE__ */ g(We, { text: t })
1032
+ children: /* @__PURE__ */ _(Ke, { text: t })
975
1033
  }),
976
- /* @__PURE__ */ g("pre", {
1034
+ /* @__PURE__ */ _("pre", {
977
1035
  className: "bailey-trace-disclosure-content",
978
1036
  children: t
979
1037
  })
980
1038
  ]
981
1039
  });
982
1040
  }
983
- function Ke({ row: e }) {
984
- return /* @__PURE__ */ _("div", {
1041
+ function Je({ row: e }) {
1042
+ return /* @__PURE__ */ v("div", {
985
1043
  className: "bailey-trace-row",
986
1044
  children: [
987
- /* @__PURE__ */ _("div", {
1045
+ /* @__PURE__ */ v("div", {
988
1046
  className: "bailey-trace-row-header",
989
1047
  children: [
990
- /* @__PURE__ */ g("span", {
1048
+ /* @__PURE__ */ _("span", {
991
1049
  className: "bailey-trace-row-time",
992
1050
  children: e.time
993
1051
  }),
994
- /* @__PURE__ */ g("span", {
1052
+ /* @__PURE__ */ _("span", {
995
1053
  className: "bailey-trace-row-gap",
996
1054
  title: "Time since the previous event",
997
1055
  children: me(e.gapMs)
998
1056
  }),
999
- /* @__PURE__ */ g("span", {
1000
- className: Ge(e),
1057
+ /* @__PURE__ */ _("span", {
1058
+ className: qe(e),
1001
1059
  children: e.label
1002
1060
  }),
1003
- /* @__PURE__ */ g("span", {
1061
+ /* @__PURE__ */ _("span", {
1004
1062
  className: "bailey-trace-row-summary",
1005
1063
  children: e.summary
1006
1064
  })
1007
1065
  ]
1008
1066
  }),
1009
- e.argsDetail && /* @__PURE__ */ g($, {
1067
+ e.argsDetail && /* @__PURE__ */ _($, {
1010
1068
  label: e.kind === "llm_call_start" ? "request" : "args",
1011
1069
  content: e.argsDetail
1012
1070
  }),
1013
- e.outputDetail && /* @__PURE__ */ g($, {
1071
+ e.outputDetail && /* @__PURE__ */ _($, {
1014
1072
  label: e.kind === "llm_call_end" ? "response" : "output",
1015
1073
  content: e.outputDetail
1016
1074
  }),
1017
- e.structuredOutputDetail && /* @__PURE__ */ g($, {
1075
+ e.structuredOutputDetail && /* @__PURE__ */ _($, {
1018
1076
  label: "structured output",
1019
1077
  content: e.structuredOutputDetail
1020
1078
  }),
1021
- e.rawDetail && /* @__PURE__ */ g($, {
1079
+ e.rawDetail && /* @__PURE__ */ _($, {
1022
1080
  label: "raw",
1023
1081
  content: e.rawDetail
1024
1082
  })
1025
1083
  ]
1026
1084
  });
1027
1085
  }
1028
- function qe(e, t) {
1086
+ function Ye(e, t) {
1029
1087
  if (e.chunkCount === 0) return "Streamed: no chunks received";
1030
1088
  if (e.chunkCount === 1 || e.firstChunkAt === null) return "Streamed: 1 chunk (not incremental)";
1031
1089
  let n = e.firstChunkAt - t, r = (e.lastChunkAt ?? e.firstChunkAt) - e.firstChunkAt;
1032
1090
  return `Streamed: ${e.chunkCount} chunks · first chunk after ${n}ms · spread over ${(r / 1e3).toFixed(1)}s`;
1033
1091
  }
1034
- function Je({ request: e }) {
1035
- let t = c(() => JSON.stringify({
1092
+ function Xe({ request: e }) {
1093
+ let t = l(() => JSON.stringify({
1036
1094
  model: e.model,
1037
1095
  instructions: e.systemPrompt,
1038
1096
  input: e.messages,
@@ -1040,10 +1098,10 @@ function Je({ request: e }) {
1040
1098
  tools: e.tools,
1041
1099
  toolChoice: e.toolChoice
1042
1100
  }, null, 2), [e]);
1043
- return /* @__PURE__ */ _("div", {
1101
+ return /* @__PURE__ */ v("div", {
1044
1102
  className: "bailey-trace-request-details",
1045
1103
  children: [
1046
- /* @__PURE__ */ _("span", {
1104
+ /* @__PURE__ */ v("span", {
1047
1105
  className: "bailey-trace-request-meta",
1048
1106
  children: [
1049
1107
  "Last request — ",
@@ -1053,26 +1111,26 @@ function Je({ request: e }) {
1053
1111
  e.requestId ? ` · ${e.requestId}` : ""
1054
1112
  ]
1055
1113
  }),
1056
- /* @__PURE__ */ g("span", {
1114
+ /* @__PURE__ */ _("span", {
1057
1115
  className: "bailey-trace-request-meta",
1058
- children: qe(e.streamStats, e.sentAt)
1116
+ children: Ye(e.streamStats, e.sentAt)
1059
1117
  }),
1060
- /* @__PURE__ */ g($, {
1118
+ /* @__PURE__ */ _($, {
1061
1119
  label: `System prompt (${e.systemPrompt.length.toLocaleString()} chars)`,
1062
1120
  content: e.systemPrompt,
1063
1121
  copyable: !0
1064
1122
  }),
1065
- /* @__PURE__ */ g($, {
1123
+ /* @__PURE__ */ _($, {
1066
1124
  label: `Messages (${e.messages.length})`,
1067
1125
  content: JSON.stringify(e.messages, null, 2),
1068
1126
  copyable: !0
1069
1127
  }),
1070
- e.response && /* @__PURE__ */ g($, {
1128
+ e.response && /* @__PURE__ */ _($, {
1071
1129
  label: `Response (${e.response.content.length.toLocaleString()} chars)`,
1072
1130
  content: e.response.content,
1073
1131
  copyable: !0
1074
1132
  }),
1075
- /* @__PURE__ */ g($, {
1133
+ /* @__PURE__ */ _($, {
1076
1134
  label: "Full payload (JSON)",
1077
1135
  content: t,
1078
1136
  copyable: !0
@@ -1080,43 +1138,43 @@ function Je({ request: e }) {
1080
1138
  ]
1081
1139
  });
1082
1140
  }
1083
- function Ye({ events: e, lastRequest: t, onClear: n }) {
1084
- let r = c(() => he(e), [e]), i = c(() => _e(r), [r]), a = c(() => JSON.stringify(e, null, 2), [e]);
1085
- return /* @__PURE__ */ _("div", {
1141
+ function Ze({ events: e, lastRequest: t, onClear: n }) {
1142
+ let r = l(() => he(e), [e]), i = l(() => _e(r), [r]), a = l(() => JSON.stringify(e, null, 2), [e]);
1143
+ return /* @__PURE__ */ v("div", {
1086
1144
  className: "bailey-trace-body",
1087
1145
  children: [
1088
- /* @__PURE__ */ _("div", {
1146
+ /* @__PURE__ */ v("div", {
1089
1147
  className: "bailey-trace-actions-row",
1090
- children: [e.length > 0 && /* @__PURE__ */ g(We, {
1148
+ children: [e.length > 0 && /* @__PURE__ */ _(Ke, {
1091
1149
  text: a,
1092
1150
  label: "Copy trace as JSON"
1093
- }), /* @__PURE__ */ g("button", {
1151
+ }), /* @__PURE__ */ _("button", {
1094
1152
  type: "button",
1095
1153
  onClick: n,
1096
1154
  className: "bailey-trace-copy-button",
1097
1155
  children: "Clear"
1098
1156
  })]
1099
1157
  }),
1100
- t && /* @__PURE__ */ g(Je, { request: t }),
1101
- /* @__PURE__ */ g("div", {
1158
+ t && /* @__PURE__ */ _(Xe, { request: t }),
1159
+ /* @__PURE__ */ _("div", {
1102
1160
  className: "bailey-trace-rows",
1103
1161
  children: i.map((e, t) => {
1104
- if (e.type === "single") return /* @__PURE__ */ g(Ke, { row: e.row }, e.row.key);
1162
+ if (e.type === "single") return /* @__PURE__ */ _(Je, { row: e.row }, e.row.key);
1105
1163
  let n = e.rows.filter((e) => e.isToolStart).length;
1106
- if (n <= 1) return /* @__PURE__ */ g("div", {
1164
+ if (n <= 1) return /* @__PURE__ */ _("div", {
1107
1165
  className: "bailey-trace-rows",
1108
- children: e.rows.map((e) => /* @__PURE__ */ g(Ke, { row: e }, e.key))
1166
+ children: e.rows.map((e) => /* @__PURE__ */ _(Je, { row: e }, e.key))
1109
1167
  }, `group-${t}`);
1110
1168
  let r = e.rows.filter((e) => e.failed).length;
1111
- return /* @__PURE__ */ _("details", {
1169
+ return /* @__PURE__ */ v("details", {
1112
1170
  className: "bailey-trace-group",
1113
- children: [/* @__PURE__ */ _("summary", {
1171
+ children: [/* @__PURE__ */ v("summary", {
1114
1172
  className: "bailey-trace-group-summary",
1115
1173
  children: [
1116
- /* @__PURE__ */ g("strong", { children: e.toolName }),
1174
+ /* @__PURE__ */ _("strong", { children: e.toolName }),
1117
1175
  " × ",
1118
1176
  n,
1119
- r > 0 && /* @__PURE__ */ _("span", {
1177
+ r > 0 && /* @__PURE__ */ v("span", {
1120
1178
  className: "bailey-trace-group-failed",
1121
1179
  children: [
1122
1180
  " ",
@@ -1125,9 +1183,9 @@ function Ye({ events: e, lastRequest: t, onClear: n }) {
1125
1183
  ]
1126
1184
  })
1127
1185
  ]
1128
- }), /* @__PURE__ */ g("div", {
1186
+ }), /* @__PURE__ */ _("div", {
1129
1187
  className: "bailey-trace-rows",
1130
- children: e.rows.map((e) => /* @__PURE__ */ g(Ke, { row: e }, e.key))
1188
+ children: e.rows.map((e) => /* @__PURE__ */ _(Je, { row: e }, e.key))
1131
1189
  })]
1132
1190
  }, `group-${t}`);
1133
1191
  })
@@ -1135,13 +1193,13 @@ function Ye({ events: e, lastRequest: t, onClear: n }) {
1135
1193
  ]
1136
1194
  });
1137
1195
  }
1138
- function Xe({ events: e, lastRequest: t, onClear: n }) {
1139
- let [r, i] = u(!1), a = c(() => ve(e), [e]), o = c(() => ge(e), [e]);
1140
- return e.length === 0 && !t ? null : /* @__PURE__ */ _("div", {
1196
+ function Qe({ events: e, lastRequest: t, onClear: n }) {
1197
+ let [r, i] = d(!1), a = l(() => ve(e), [e]), o = l(() => ge(e), [e]);
1198
+ return e.length === 0 && !t ? null : /* @__PURE__ */ v("div", {
1141
1199
  className: "bailey-trace-panel",
1142
- children: [/* @__PURE__ */ _("div", {
1200
+ children: [/* @__PURE__ */ v("div", {
1143
1201
  className: "bailey-trace-toggle-row",
1144
- children: [/* @__PURE__ */ _("button", {
1202
+ children: [/* @__PURE__ */ v("button", {
1145
1203
  type: "button",
1146
1204
  onClick: () => i((e) => !e),
1147
1205
  "aria-expanded": r,
@@ -1153,11 +1211,11 @@ function Xe({ events: e, lastRequest: t, onClear: n }) {
1153
1211
  e.length,
1154
1212
  ")"
1155
1213
  ]
1156
- }), o && /* @__PURE__ */ g("span", {
1214
+ }), o && /* @__PURE__ */ _("span", {
1157
1215
  className: a ? "bailey-trace-summary bailey-trace-summary-error" : "bailey-trace-summary",
1158
1216
  children: o
1159
1217
  })]
1160
- }), r && /* @__PURE__ */ g(Ye, {
1218
+ }), r && /* @__PURE__ */ _(Ze, {
1161
1219
  events: e,
1162
1220
  lastRequest: t,
1163
1221
  onClear: n
@@ -1166,8 +1224,8 @@ function Xe({ events: e, lastRequest: t, onClear: n }) {
1166
1224
  }
1167
1225
  //#endregion
1168
1226
  //#region src/ui/ToolResultImage.tsx
1169
- function Ze({ src: e, alt: n, className: r }) {
1170
- return t(e) ? /* @__PURE__ */ g("img", {
1227
+ function $e({ src: e, alt: n, className: r }) {
1228
+ return t(e) ? /* @__PURE__ */ _("img", {
1171
1229
  src: e,
1172
1230
  alt: n ?? "",
1173
1231
  className: `bailey-tool-result-image${r ? ` ${r}` : ""}`,
@@ -1175,8 +1233,94 @@ function Ze({ src: e, alt: n, className: r }) {
1175
1233
  }) : null;
1176
1234
  }
1177
1235
  //#endregion
1236
+ //#region src/utils/safeMcpAppResource.ts
1237
+ var et = /^ui:\/\//, tt = 2097152, nt = /* @__PURE__ */ new Set([
1238
+ "connectDomains",
1239
+ "resourceDomains",
1240
+ "frameDomains",
1241
+ "baseUriDomains"
1242
+ ]), rt = /* @__PURE__ */ new Set([
1243
+ "camera",
1244
+ "microphone",
1245
+ "geolocation",
1246
+ "clipboardWrite"
1247
+ ]), it = (e, t) => e === void 0 ? !0 : typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.keys(e).every((e) => t.has(e)), at = (e) => !(!et.test(e.resourceUri) || typeof e.html != "string" || e.html.length === 0 || e.html.length > tt || !it(e.csp, nt) || !it(e.permissions, rt));
1248
+ //#endregion
1249
+ //#region src/ui/McpAppFrame.tsx
1250
+ function ot({ html: e, title: t, resourceUri: n, csp: r, permissions: i, className: a }) {
1251
+ return at({
1252
+ html: e,
1253
+ resourceUri: n,
1254
+ csp: r,
1255
+ permissions: i
1256
+ }) ? /* @__PURE__ */ _("iframe", {
1257
+ title: t ?? "MCP App",
1258
+ srcDoc: e,
1259
+ sandbox: "allow-scripts",
1260
+ referrerPolicy: "no-referrer",
1261
+ className: `bailey-mcp-app-frame${a ? ` ${a}` : ""}`
1262
+ }) : null;
1263
+ }
1264
+ //#endregion
1265
+ //#region src/ui/BaileyToolSteps.tsx
1266
+ function st({ toolName: e, resolveActivityIcon: t }) {
1267
+ let n = t?.(e);
1268
+ return n ? /* @__PURE__ */ _("span", {
1269
+ className: "bailey-activity-icon",
1270
+ children: n
1271
+ }) : null;
1272
+ }
1273
+ function ct({ steps: e, resolveActivityIcon: t }) {
1274
+ let n = e.filter((e) => e.status === "running");
1275
+ return n.length === 0 ? null : /* @__PURE__ */ _("div", {
1276
+ className: "bailey-tool-steps-live",
1277
+ role: "status",
1278
+ "aria-live": "polite",
1279
+ children: n.map((e) => /* @__PURE__ */ v("div", {
1280
+ className: "bailey-activity-line",
1281
+ children: [
1282
+ /* @__PURE__ */ _(st, {
1283
+ toolName: e.toolName,
1284
+ resolveActivityIcon: t
1285
+ }),
1286
+ /* @__PURE__ */ _("span", { children: e.label }),
1287
+ /* @__PURE__ */ _("span", {
1288
+ className: "bailey-step-spinner",
1289
+ "aria-hidden": "true"
1290
+ })
1291
+ ]
1292
+ }, e.key))
1293
+ });
1294
+ }
1295
+ function lt({ steps: e, labels: t, resolveActivityIcon: n }) {
1296
+ if (e.length === 0) return null;
1297
+ let r = e.filter((e) => e.status === "failed").length, i = e.length === 1 ? t.toolStepsSummaryOne : t.toolStepsSummaryMany.replace("{count}", String(e.length)), a = r > 0 ? `${i}${t.toolStepsFailedSuffix.replace("{failed}", String(r))}` : i;
1298
+ return /* @__PURE__ */ v("details", {
1299
+ className: "bailey-tool-steps-summary",
1300
+ children: [/* @__PURE__ */ _("summary", { children: a }), /* @__PURE__ */ _("ul", {
1301
+ className: "bailey-tool-steps-list",
1302
+ children: e.map((e) => /* @__PURE__ */ v("li", {
1303
+ className: "bailey-tool-step",
1304
+ children: [
1305
+ /* @__PURE__ */ _(st, {
1306
+ toolName: e.toolName,
1307
+ resolveActivityIcon: n
1308
+ }),
1309
+ /* @__PURE__ */ _("span", { children: e.label }),
1310
+ e.runtimeSeconds !== void 0 && /* @__PURE__ */ _("span", { children: `${e.runtimeSeconds.toFixed(1)}s` }),
1311
+ e.status === "failed" && /* @__PURE__ */ _("span", {
1312
+ className: "bailey-tool-step-failed",
1313
+ children: t.toolStepFailedText
1314
+ }),
1315
+ e.status === "running" && /* @__PURE__ */ _("span", { children: t.toolStepStoppedText })
1316
+ ]
1317
+ }, e.key))
1318
+ })]
1319
+ });
1320
+ }
1321
+ //#endregion
1178
1322
  //#region src/ui/BaileyChatPanel.tsx
1179
- var Qe = "How can bailey AI help you today?", $e = "Reply to bailey AI", et = {
1323
+ var ut = "How can bailey AI help you today?", dt = "Reply to bailey AI", ft = {
1180
1324
  newChatButtonText: "New chat",
1181
1325
  newChatAriaLabel: "new chat",
1182
1326
  historyAriaLabel: "conversation history",
@@ -1193,249 +1337,271 @@ var Qe = "How can bailey AI help you today?", $e = "Reply to bailey AI", et = {
1193
1337
  stopAriaLabel: "stop",
1194
1338
  copyButtonAriaLabel: "copy response as markdown",
1195
1339
  copyButtonTooltipDefault: "Copy as markdown",
1196
- copyButtonTooltipCopied: "Copied!"
1197
- }, tt = [f], nt = {
1198
- ...je(),
1199
- p: ({ children: e }) => /* @__PURE__ */ g(h, { children: e })
1200
- }, rt = r(function({ content: e, components: t }) {
1201
- return /* @__PURE__ */ g("div", {
1340
+ copyButtonTooltipCopied: "Copied!",
1341
+ toolStepsSummaryOne: "Used 1 tool",
1342
+ toolStepsSummaryMany: "Used {count} tools",
1343
+ toolStepsFailedSuffix: ", {failed} failed",
1344
+ toolStepFailedText: "failed",
1345
+ toolStepStoppedText: "stopped",
1346
+ mcpAppDefaultTitle: "MCP App"
1347
+ }, pt = [p], mt = {
1348
+ ...Ne(),
1349
+ p: ({ children: e }) => /* @__PURE__ */ _(g, { children: e })
1350
+ }, ht = i(function({ content: e, components: t }) {
1351
+ return /* @__PURE__ */ _("div", {
1202
1352
  className: "bailey-markdown-content",
1203
- children: /* @__PURE__ */ g(d, {
1204
- remarkPlugins: tt,
1353
+ children: /* @__PURE__ */ _(f, {
1354
+ remarkPlugins: pt,
1205
1355
  components: t,
1206
1356
  skipHtml: !0,
1207
1357
  children: e
1208
1358
  })
1209
1359
  });
1210
1360
  });
1211
- function it(e, t, n) {
1361
+ function gt(e, t, n) {
1212
1362
  if (e !== "streaming") return;
1213
1363
  let r = t.filter((e) => e.turnSentAt === n?.sentAt);
1214
- if (r.length !== 0) return X(r[r.length - 1]);
1364
+ return r[r.length - 1];
1365
+ }
1366
+ function _t(e) {
1367
+ if (!(!e || e.kind === "tool_end")) return fe(e);
1215
1368
  }
1216
- function at(e) {
1369
+ function vt(e) {
1217
1370
  let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), r = t.toLocaleTimeString([], {
1218
1371
  hour: "numeric",
1219
1372
  minute: "2-digit"
1220
1373
  });
1221
1374
  return n ? `Today ${r}` : `${t.toLocaleDateString()} ${r}`;
1222
1375
  }
1223
- function ot({ chat: e, placeholder: t, replyPlaceholder: n = $e, emptyPlaceholder: r, suggestions: i, onHistoryClick: a, privacyNote: s, resolveActivityIcon: f, className: h, height: v, width: y, hideDeveloperDetails: b = !1, renderMessageActions: x, renderTable: S, renderChart: C, labels: w, formatMessageTime: T }) {
1224
- let { messages: E, traceEvents: D, lastRequest: O, status: k, error: A, send: j, stop: M, retryLast: ee, clearTrace: N, clearError: P, newChat: F } = e, [I, L] = u(""), R = {
1225
- ...et,
1226
- ...w
1227
- }, z = T ?? at, B = l(null), V = ke(B), te = l(null), H = l(null), U = l(!0), W = c(() => je({
1228
- renderTable: S,
1229
- renderChart: C
1230
- }), [S, C]), G = c(() => it(k, D, O), [
1376
+ function yt({ chat: e, placeholder: t, replyPlaceholder: r = dt, emptyPlaceholder: i, suggestions: a, onHistoryClick: o, privacyNote: c, resolveActivityIcon: p, className: g, height: y, width: b, hideDeveloperDetails: x = !1, renderMessageActions: S, renderTable: C, renderChart: w, renderMcpApp: T, labels: E, formatMessageTime: D }) {
1377
+ let { messages: O, traceEvents: k, lastRequest: A, status: j, error: M, send: N, stop: ee, retryLast: P, clearTrace: F, clearError: I, newChat: L } = e, [R, te] = d(""), z = {
1378
+ ...ft,
1379
+ ...E
1380
+ }, ne = D ?? vt, B = u(null), V = je(B), H = u(null), U = u(null), W = u(!0), re = l(() => Ne({
1381
+ renderTable: C,
1382
+ renderChart: w
1383
+ }), [C, w]), G = l(() => gt(j, k, A), [
1384
+ j,
1231
1385
  k,
1232
- D,
1233
- O
1234
- ]), K = E.length === 0, q = t ?? (K ? r ?? Qe : n);
1235
- o(() => {
1236
- let e = H.current;
1386
+ A
1387
+ ]), ie = _t(G), K = G?.kind === "tool_end" ? G.at : void 0, ae = O[O.length - 1]?.content.length ?? 0, [oe, se] = d(null), q = oe;
1388
+ K !== void 0 && oe?.at !== K && (q = {
1389
+ at: K,
1390
+ length: ae
1391
+ }, se(q));
1392
+ let ce = K !== void 0 && q?.at === K && ae <= q.length, J = ie ?? (ce ? z.thinkingHint : void 0), Y = O.length === 0, X = t ?? (Y ? i ?? ut : r);
1393
+ s(() => {
1394
+ let e = U.current;
1237
1395
  if (!e) return;
1238
1396
  let t = () => {
1239
1397
  let t = e.scrollHeight - e.scrollTop - e.clientHeight;
1240
- U.current = t < 60;
1398
+ W.current = t < 60;
1241
1399
  };
1242
1400
  return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
1243
- }, []), o(() => {
1244
- U.current && te.current?.scrollIntoView({
1245
- behavior: k === "streaming" ? "auto" : "smooth",
1401
+ }, []), s(() => {
1402
+ W.current && H.current?.scrollIntoView({
1403
+ behavior: j === "streaming" ? "auto" : "smooth",
1246
1404
  block: "nearest"
1247
1405
  });
1248
- }, [E, k]);
1249
- let ne = (e) => {
1250
- U.current = !0, j(e);
1406
+ }, [O, j]);
1407
+ let Z = (e) => {
1408
+ W.current = !0, N(e);
1251
1409
  };
1252
- return /* @__PURE__ */ g(xe.Provider, {
1410
+ return /* @__PURE__ */ _(Se.Provider, {
1253
1411
  value: V,
1254
- children: /* @__PURE__ */ g("div", {
1412
+ children: /* @__PURE__ */ _("div", {
1255
1413
  ref: B,
1256
- className: `bailey-chat-panel${h ? ` ${h}` : ""}`,
1257
- style: v !== void 0 || y !== void 0 ? {
1258
- height: v,
1259
- width: y
1414
+ className: `bailey-chat-panel${g ? ` ${g}` : ""}`,
1415
+ style: y !== void 0 || b !== void 0 ? {
1416
+ height: y,
1417
+ width: b
1260
1418
  } : void 0,
1261
- children: /* @__PURE__ */ _("div", {
1419
+ children: /* @__PURE__ */ v("div", {
1262
1420
  className: "bailey-chat-panel-inner",
1263
1421
  children: [
1264
- /* @__PURE__ */ _("div", {
1422
+ /* @__PURE__ */ v("div", {
1265
1423
  className: "bailey-chat-transcript",
1266
- ref: H,
1424
+ ref: U,
1267
1425
  children: [
1268
- K && (i && i.length > 0 ? /* @__PURE__ */ _("div", {
1426
+ Y && (a && a.length > 0 ? /* @__PURE__ */ v("div", {
1269
1427
  className: "bailey-suggestions",
1270
- children: [/* @__PURE__ */ g("div", {
1428
+ children: [/* @__PURE__ */ _("div", {
1271
1429
  className: "bailey-suggestions-title",
1272
- children: R.suggestionsTitle
1273
- }), i.map((e, t) => /* @__PURE__ */ _("button", {
1430
+ children: z.suggestionsTitle
1431
+ }), a.map((e, t) => /* @__PURE__ */ v("button", {
1274
1432
  type: "button",
1275
- onClick: () => ne(e.value ?? e.label),
1433
+ onClick: () => Z(e.value ?? e.label),
1276
1434
  className: "bailey-suggestion-card",
1277
- children: [/* @__PURE__ */ g("span", { children: e.label }), /* @__PURE__ */ g(Pe, { className: "bailey-suggestion-icon" })]
1435
+ children: [/* @__PURE__ */ _("span", { children: e.label }), /* @__PURE__ */ _(Ie, { className: "bailey-suggestion-icon" })]
1278
1436
  }, `${e.label}-${t}`))]
1279
- }) : /* @__PURE__ */ g("div", {
1437
+ }) : /* @__PURE__ */ _("div", {
1280
1438
  className: "bailey-empty-state",
1281
- children: R.emptyStateMessage
1439
+ children: z.emptyStateMessage
1282
1440
  })),
1283
- E.map((e, t) => {
1284
- let n = e.role === "assistant" && t === E.length - 1, r = k === "streaming" && n && e.content === "", i = e.role === "assistant" && !r ? ye(D, e.createdAt) : [], a = i[i.length - 1];
1285
- return /* @__PURE__ */ g("div", {
1441
+ O.map((e, t) => {
1442
+ let r = e.role === "assistant" && t === O.length - 1, i = j === "streaming" && r && e.content === "", a = e.role === "assistant" ? be(k, e.createdAt) : [], o = a.some((e) => e.status === "running");
1443
+ return /* @__PURE__ */ _("div", {
1286
1444
  className: e.role === "user" ? "bailey-message-row bailey-message-row-user" : "bailey-message-row",
1287
- children: e.role === "user" ? /* @__PURE__ */ _("div", {
1445
+ children: e.role === "user" ? /* @__PURE__ */ v("div", {
1288
1446
  className: "bailey-user-message",
1289
- children: [/* @__PURE__ */ _("div", {
1447
+ children: [/* @__PURE__ */ v("div", {
1290
1448
  className: "bailey-message-meta",
1291
- children: [/* @__PURE__ */ g("span", {
1449
+ children: [/* @__PURE__ */ _("span", {
1292
1450
  className: "bailey-message-meta-name",
1293
- children: R.youLabel
1294
- }), e.createdAt !== void 0 && /* @__PURE__ */ g("span", { children: z(e.createdAt) })]
1295
- }), /* @__PURE__ */ g("div", {
1451
+ children: z.youLabel
1452
+ }), e.createdAt !== void 0 && /* @__PURE__ */ _("span", { children: ne(e.createdAt) })]
1453
+ }), /* @__PURE__ */ _("div", {
1296
1454
  className: "bailey-user-bubble",
1297
1455
  children: e.content
1298
1456
  })]
1299
- }) : r ? /* @__PURE__ */ g("div", {
1300
- className: "bailey-thinking-hint",
1301
- children: G ?? R.thinkingHint
1457
+ }) : i ? o ? /* @__PURE__ */ _(ct, {
1458
+ steps: a,
1459
+ resolveActivityIcon: p
1302
1460
  }) : /* @__PURE__ */ _("div", {
1461
+ className: "bailey-thinking-hint",
1462
+ children: ie ?? z.thinkingHint
1463
+ }) : /* @__PURE__ */ v("div", {
1303
1464
  className: "bailey-assistant-message",
1304
1465
  children: [
1305
- a && /* @__PURE__ */ _("div", {
1306
- className: "bailey-activity-line",
1307
- children: [/* @__PURE__ */ g("span", {
1308
- className: "bailey-activity-icon",
1309
- children: f?.(a.toolName) ?? /* @__PURE__ */ g(Re, {})
1310
- }), /* @__PURE__ */ g("span", { children: a.text })]
1466
+ !e.streaming && /* @__PURE__ */ _(lt, {
1467
+ steps: a,
1468
+ labels: z,
1469
+ resolveActivityIcon: p
1311
1470
  }),
1312
- /* @__PURE__ */ g(rt, {
1471
+ /* @__PURE__ */ _(ht, {
1313
1472
  content: e.content,
1314
- components: W
1473
+ components: re
1315
1474
  }),
1316
- e.parts?.map((e, t) => e.type === "image" ? /* @__PURE__ */ g(Ze, {
1475
+ e.parts?.map((e, t) => e.type === "image" ? /* @__PURE__ */ _($e, {
1317
1476
  src: e.src,
1318
1477
  alt: e.alt
1319
- }, t) : null),
1320
- e.streaming && G && /* @__PURE__ */ g("div", {
1478
+ }, t) : e.type === "mcp_app" ? /* @__PURE__ */ _(n, { children: T ? T(e) : /* @__PURE__ */ _(ot, {
1479
+ ...e,
1480
+ title: e.title ?? z.mcpAppDefaultTitle
1481
+ }) }, t) : null),
1482
+ e.streaming && /* @__PURE__ */ _(ct, {
1483
+ steps: a,
1484
+ resolveActivityIcon: p
1485
+ }),
1486
+ e.streaming && J && !o && /* @__PURE__ */ _("div", {
1321
1487
  className: "bailey-streaming-hint",
1322
- children: G
1488
+ children: J
1323
1489
  }),
1324
- !e.streaming && /* @__PURE__ */ _("div", {
1490
+ !e.streaming && /* @__PURE__ */ v("div", {
1325
1491
  className: "bailey-message-actions",
1326
- children: [/* @__PURE__ */ g(He, {
1492
+ children: [/* @__PURE__ */ _(We, {
1327
1493
  markdown: e.content,
1328
- ariaLabel: R.copyButtonAriaLabel,
1329
- tooltipDefaultText: R.copyButtonTooltipDefault,
1330
- tooltipCopiedText: R.copyButtonTooltipCopied
1331
- }), x?.(e)]
1494
+ ariaLabel: z.copyButtonAriaLabel,
1495
+ tooltipDefaultText: z.copyButtonTooltipDefault,
1496
+ tooltipCopiedText: z.copyButtonTooltipCopied
1497
+ }), S?.(e)]
1332
1498
  })
1333
1499
  ]
1334
1500
  })
1335
1501
  }, e.id);
1336
1502
  }),
1337
- /* @__PURE__ */ g("div", { ref: te })
1503
+ /* @__PURE__ */ _("div", { ref: H })
1338
1504
  ]
1339
1505
  }),
1340
- A && /* @__PURE__ */ _("div", {
1506
+ M && /* @__PURE__ */ v("div", {
1341
1507
  className: "bailey-error-banner",
1342
1508
  role: "alert",
1343
- children: [/* @__PURE__ */ g("span", { children: A }), /* @__PURE__ */ _("div", {
1509
+ children: [/* @__PURE__ */ _("span", { children: M }), /* @__PURE__ */ v("div", {
1344
1510
  className: "bailey-error-actions",
1345
- children: [/* @__PURE__ */ g("button", {
1511
+ children: [/* @__PURE__ */ _("button", {
1346
1512
  type: "button",
1347
- onClick: ee,
1513
+ onClick: P,
1348
1514
  className: "bailey-retry-button",
1349
- children: R.retryButtonText
1350
- }), /* @__PURE__ */ g("button", {
1515
+ children: z.retryButtonText
1516
+ }), /* @__PURE__ */ _("button", {
1351
1517
  type: "button",
1352
- onClick: P,
1353
- "aria-label": R.dismissErrorAriaLabel,
1518
+ onClick: I,
1519
+ "aria-label": z.dismissErrorAriaLabel,
1354
1520
  className: "bailey-dismiss-button",
1355
1521
  children: "✕"
1356
1522
  })]
1357
1523
  })]
1358
1524
  }),
1359
- !b && /* @__PURE__ */ g(Xe, {
1360
- events: D,
1361
- lastRequest: O,
1362
- onClear: N
1525
+ !x && /* @__PURE__ */ _(Qe, {
1526
+ events: k,
1527
+ lastRequest: A,
1528
+ onClear: F
1363
1529
  }),
1364
- /* @__PURE__ */ _("div", {
1530
+ /* @__PURE__ */ v("div", {
1365
1531
  className: "bailey-input-area",
1366
- children: [/* @__PURE__ */ _("form", {
1532
+ children: [/* @__PURE__ */ v("form", {
1367
1533
  onSubmit: (e) => {
1368
- e.preventDefault(), !(!I.trim() || k === "streaming") && (ne(I), L(""));
1534
+ e.preventDefault(), !(!R.trim() || j === "streaming") && (Z(R), te(""));
1369
1535
  },
1370
1536
  className: "bailey-input-row",
1371
- children: [/* @__PURE__ */ g("input", {
1537
+ children: [/* @__PURE__ */ _("input", {
1372
1538
  type: "text",
1373
- placeholder: q,
1374
- "aria-label": q,
1375
- value: I,
1376
- onChange: (e) => L(e.target.value),
1377
- disabled: k === "streaming",
1539
+ placeholder: X,
1540
+ "aria-label": X,
1541
+ value: R,
1542
+ onChange: (e) => te(e.target.value),
1543
+ disabled: j === "streaming",
1378
1544
  className: "bailey-input"
1379
- }), k === "streaming" ? /* @__PURE__ */ g(m.Provider, {
1545
+ }), j === "streaming" ? /* @__PURE__ */ _(h.Provider, {
1380
1546
  delayDuration: 200,
1381
- children: /* @__PURE__ */ _(m.Root, { children: [/* @__PURE__ */ g(m.Trigger, {
1547
+ children: /* @__PURE__ */ v(h.Root, { children: [/* @__PURE__ */ _(h.Trigger, {
1382
1548
  asChild: !0,
1383
- children: /* @__PURE__ */ g("button", {
1549
+ children: /* @__PURE__ */ _("button", {
1384
1550
  type: "button",
1385
- onClick: M,
1386
- "aria-label": R.stopAriaLabel,
1551
+ onClick: ee,
1552
+ "aria-label": z.stopAriaLabel,
1387
1553
  className: "bailey-stop-button",
1388
- children: /* @__PURE__ */ g(Ne, { className: "bailey-stop-icon" })
1554
+ children: /* @__PURE__ */ _(Fe, { className: "bailey-stop-icon" })
1389
1555
  })
1390
- }), /* @__PURE__ */ g(m.Portal, {
1556
+ }), /* @__PURE__ */ _(h.Portal, {
1391
1557
  container: V instanceof ShadowRoot ? V : void 0,
1392
- children: /* @__PURE__ */ _(m.Content, {
1558
+ children: /* @__PURE__ */ v(h.Content, {
1393
1559
  side: "top",
1394
1560
  className: "bailey-tooltip-content",
1395
- children: [R.stopButtonText, /* @__PURE__ */ g(m.Arrow, { className: "bailey-tooltip-arrow" })]
1561
+ children: [z.stopButtonText, /* @__PURE__ */ _(h.Arrow, { className: "bailey-tooltip-arrow" })]
1396
1562
  })
1397
1563
  })] })
1398
- }) : /* @__PURE__ */ g("button", {
1564
+ }) : /* @__PURE__ */ _("button", {
1399
1565
  type: "submit",
1400
- "aria-label": R.sendAriaLabel,
1401
- disabled: !I.trim(),
1566
+ "aria-label": z.sendAriaLabel,
1567
+ disabled: !R.trim(),
1402
1568
  className: "bailey-send-button",
1403
- children: /* @__PURE__ */ g(Me, { className: "bailey-send-icon" })
1569
+ children: /* @__PURE__ */ _(Pe, { className: "bailey-send-icon" })
1404
1570
  })]
1405
- }), (!K || a) && /* @__PURE__ */ _(p.Root, { children: [/* @__PURE__ */ g(p.Trigger, {
1571
+ }), (!Y || o) && /* @__PURE__ */ v(m.Root, { children: [/* @__PURE__ */ _(m.Trigger, {
1406
1572
  asChild: !0,
1407
- children: /* @__PURE__ */ g("button", {
1573
+ children: /* @__PURE__ */ _("button", {
1408
1574
  type: "button",
1409
- "aria-label": R.menuAriaLabel,
1575
+ "aria-label": z.menuAriaLabel,
1410
1576
  className: "bailey-menu-button",
1411
- children: /* @__PURE__ */ g(ze, { className: "bailey-menu-icon" })
1577
+ children: /* @__PURE__ */ _(Ve, { className: "bailey-menu-icon" })
1412
1578
  })
1413
- }), /* @__PURE__ */ g(p.Portal, {
1579
+ }), /* @__PURE__ */ _(m.Portal, {
1414
1580
  container: V instanceof ShadowRoot ? V : void 0,
1415
- children: /* @__PURE__ */ _(p.Content, {
1581
+ children: /* @__PURE__ */ v(m.Content, {
1416
1582
  side: "top",
1417
1583
  align: "end",
1418
1584
  sideOffset: 8,
1419
1585
  className: "bailey-menu-content",
1420
- children: [!K && /* @__PURE__ */ _(p.Item, {
1421
- onSelect: () => F(),
1586
+ children: [!Y && /* @__PURE__ */ v(m.Item, {
1587
+ onSelect: () => L(),
1422
1588
  className: "bailey-menu-item",
1423
- children: [/* @__PURE__ */ g(Be, { className: "bailey-menu-item-icon" }), R.newChatButtonText]
1424
- }), a && /* @__PURE__ */ _(p.Item, {
1425
- onSelect: () => a(),
1589
+ children: [/* @__PURE__ */ _(He, { className: "bailey-menu-item-icon" }), z.newChatButtonText]
1590
+ }), o && /* @__PURE__ */ v(m.Item, {
1591
+ onSelect: () => o(),
1426
1592
  className: "bailey-menu-item",
1427
- children: [/* @__PURE__ */ g(Le, { className: "bailey-menu-item-icon" }), R.historyMenuItemText]
1593
+ children: [/* @__PURE__ */ _(ze, { className: "bailey-menu-item-icon" }), z.historyMenuItemText]
1428
1594
  })]
1429
1595
  })
1430
1596
  })] })]
1431
1597
  }),
1432
- (K || s?.alwaysVisible) && s && /* @__PURE__ */ g("div", {
1598
+ (Y || c?.alwaysVisible) && c && /* @__PURE__ */ _("div", {
1433
1599
  className: "bailey-privacy-note",
1434
- children: /* @__PURE__ */ g(d, {
1435
- remarkPlugins: tt,
1436
- components: nt,
1600
+ children: /* @__PURE__ */ _(f, {
1601
+ remarkPlugins: pt,
1602
+ components: mt,
1437
1603
  skipHtml: !0,
1438
- children: s.markdown
1604
+ children: c.markdown
1439
1605
  })
1440
1606
  })
1441
1607
  ]
@@ -1445,6 +1611,6 @@ function ot({ chat: e, placeholder: t, replyPlaceholder: n = $e, emptyPlaceholde
1445
1611
  }
1446
1612
  //#endregion
1447
1613
  //#region src/index.ts
1448
- var st = "0.3.1-pre.2";
1614
+ var bt = "0.3.1-pre.2";
1449
1615
  //#endregion
1450
- export { Re as ActivityIcon, Pe as ArrowUpRightIcon, st as BAILEYAI_CHAT_UI_VERSION, G as BAILEY_CHART_PROMPT_FRAGMENT, R as BAILEY_TABLE_GRID_ROW_THRESHOLD, ot as BaileyChatPanel, Xe as BaileyTracePanel, He as CopyMarkdownButton, Me as HeartIcon, se as TRACE_KIND_LABEL, je as createBaileyMarkdownComponents, D as extractPseudoToolCalls, U as extractTableData, me as formatTraceGap, pe as formatTraceTime, ve as hasTraceFailure, e as isSafeMarkdownUrl, P as joinInstructions, oe as parseBaileyChartSpec, k as parseSseFrames, L as resolveToolCall, W as shouldUseGrid, ye as toActivityLines, he as toTraceRows, _e as toTraceSegments, le as traceEventArgsDetail, X as traceEventHint, ue as traceEventOutputDetail, fe as traceEventRawDetail, ce as traceEventSummary, Y as traceEventToolName, ge as traceSummaryLine, N as useBaileyChat };
1616
+ export { Be as ActivityIcon, Ie as ArrowUpRightIcon, bt as BAILEYAI_CHAT_UI_VERSION, re as BAILEY_CHART_PROMPT_FRAGMENT, te as BAILEY_TABLE_GRID_ROW_THRESHOLD, yt as BaileyChatPanel, Qe as BaileyTracePanel, We as CopyMarkdownButton, Pe as HeartIcon, ce as TRACE_KIND_LABEL, Ne as createBaileyMarkdownComponents, O as extractPseudoToolCalls, U as extractTableData, me as formatTraceGap, pe as formatTraceTime, ve as hasTraceFailure, e as isSafeMarkdownUrl, F as joinInstructions, q as parseBaileyChartSpec, A as parseSseFrames, R as resolveToolCall, W as shouldUseGrid, ye as toActivityLines, be as toToolSteps, he as toTraceRows, _e as toTraceSegments, Z as traceEventArgsDetail, fe as traceEventHint, le as traceEventOutputDetail, de as traceEventRawDetail, X as traceEventSummary, Y as traceEventToolName, ge as traceSummaryLine, P as useBaileyChat };