@icanbwell/baileyai-chat-ui 1.1.2 → 1.2.1

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.
@@ -6,9 +6,9 @@ import * as h from "@radix-ui/react-dropdown-menu";
6
6
  import * as g from "@radix-ui/react-tooltip";
7
7
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
8
8
  // src/utils/pseudoToolCalls.ts
9
- var b = "search_tools|call_tool|function_calls|function_result", x = RegExp(`<(${b})>([\\s\\S]*?)<\\/\\1>`, "g"), S = RegExp(`<(?:${b})>[\\s\\S]*$`), C = /<name>([\s\S]*?)<\/name>/, ee = /<arguments>([\s\S]*?)<\/arguments>/, w = /<invoke\s+name="([^"]*)"\s*>([\s\S]*?)<\/invoke>/g, T = /<parameter\s+name="([^"]*)"\s*>([\s\S]*?)<\/parameter>/g;
9
+ var b = "search_tools|call_tool|function_calls|function_result", x = RegExp(`<(${b})>([\\s\\S]*?)<\\/\\1>`, "g"), ee = RegExp(`<(?:${b})>[\\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
10
  function E(e) {
11
- let t = C.exec(e)?.[1]?.trim() || "unknown_tool", n = ee.exec(e)?.[1]?.trim();
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
@@ -38,7 +38,7 @@ function O(e, t = {}) {
38
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(S, "") : i;
41
+ }), "")), a = n ? i.replace(ee, "") : i;
42
42
  return r.length === 0 && a === i ? {
43
43
  cleanedText: i,
44
44
  matches: r
@@ -132,7 +132,7 @@ var ne = (e) => te(e), M = class extends Error {
132
132
  too_long: !0,
133
133
  other: !0
134
134
  }, P = (e) => Object.hasOwn(N, e) ? e : "other";
135
- function re(e) {
135
+ function F(e) {
136
136
  if (!e || e.rating !== "up" && e.rating !== "down") return;
137
137
  let t = (e.reasonCodes ?? []).map(P);
138
138
  return {
@@ -141,11 +141,11 @@ function re(e) {
141
141
  ...e.comment ? { comment: e.comment } : {}
142
142
  };
143
143
  }
144
- function F(e) {
144
+ function re(e) {
145
145
  let t = [];
146
146
  return e.messages.forEach((e, n) => {
147
147
  if (e.hidden || e.role !== "user" && e.role !== "assistant") return;
148
- let r = Date.parse(e.createdAt), i = Number.isNaN(r) ? void 0 : r, a = e.messageId || `loaded-${n}-${e.role}-${i ?? 0}`, o = e.role === "assistant" ? re(e.feedback) : void 0;
148
+ let r = Date.parse(e.createdAt), i = Number.isNaN(r) ? void 0 : r, a = e.messageId || `loaded-${n}-${e.role}-${i ?? 0}`, o = e.role === "assistant" ? F(e.feedback) : void 0;
149
149
  t.push({
150
150
  id: a,
151
151
  role: e.role,
@@ -158,19 +158,19 @@ function F(e) {
158
158
  }), t;
159
159
  }
160
160
  var I = (e) => e.serverMessageId ?? e.id;
161
- function ie(e) {
161
+ function L(e) {
162
162
  let t = new Set(e.current.map(I)), n = e.earlier.filter((e) => !t.has(I(e)));
163
163
  return n.length === 0 ? e.current : [...n, ...e.current];
164
164
  }
165
165
  // src/logic/conversationId.ts
166
- function L(e) {
166
+ function R(e) {
167
167
  let t = e.sub.trim();
168
168
  if (!t) return !1;
169
169
  let n = `${t}:`;
170
170
  return e.conversationId.startsWith(n) && e.conversationId.length > n.length;
171
171
  }
172
172
  // src/client/feedbackHandlers.ts
173
- function ae(e) {
173
+ function ie(e) {
174
174
  let { client: t, getConversationId: n } = e, r = () => {
175
175
  let e = n();
176
176
  if (!e) throw Error("no conversation id");
@@ -197,15 +197,15 @@ function ae(e) {
197
197
  };
198
198
  }
199
199
  // src/logic/conversationStorage.ts
200
- var oe = "baileyai-chat-ui:conversation";
201
- function se() {
200
+ var ae = "baileyai-chat-ui:conversation";
201
+ function oe() {
202
202
  return {
203
203
  get: (e) => window.sessionStorage.getItem(e),
204
204
  set: (e, t) => window.sessionStorage.setItem(e, t),
205
205
  remove: (e) => window.sessionStorage.removeItem(e)
206
206
  };
207
207
  }
208
- function ce() {
208
+ function se() {
209
209
  let e = /* @__PURE__ */ new Map();
210
210
  return {
211
211
  get: (t) => e.get(t) ?? null,
@@ -214,12 +214,12 @@ function ce() {
214
214
  };
215
215
  }
216
216
  // src/logic/useBaileyChat.ts
217
- var R = 200, le = 100, ue = [503, 405], de = 15e4, z = "bailey", fe = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e, t, n, r) => {
217
+ var ce = 200, le = 100, ue = [503, 405], de = 15e4, fe = "bailey", pe = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e, t, n, r) => {
218
218
  if (t === 401 || t === 403) return `${e} isn't reachable with your current login.`;
219
219
  let i = `${e} request failed (status ${t ?? "network error"}).`, a = (r || n || "").trim();
220
- return a ? `${i} ${a.length > R ? `${a.slice(0, R)}…` : a}` : i;
220
+ return a ? `${i} ${a.length > ce ? `${a.slice(0, ce)}…` : a}` : i;
221
221
  };
222
- function B(e, t, n) {
222
+ function z(e, t, n) {
223
223
  if (e) try {
224
224
  return e.get(t) || void 0;
225
225
  } catch (e) {
@@ -227,10 +227,10 @@ function B(e, t, n) {
227
227
  return;
228
228
  }
229
229
  }
230
- function me(e, t) {
230
+ function he(e, t) {
231
231
  t.signal.aborted || typeof e != "string" || (t.historyStatus = e);
232
232
  }
233
- function he(e, t, n, r) {
233
+ function B(e, t, n, r) {
234
234
  try {
235
235
  e?.set(t, n);
236
236
  } catch (e) {
@@ -247,28 +247,28 @@ function ge(e, t, n) {
247
247
  var _e = (e, t) => t ? `${e}:${t}` : e;
248
248
  function ve(e) {
249
249
  let { seed: t, sub: n, storage: r, key: i, report: a } = e;
250
- if (!n) return t || B(r, i, a);
251
- if (t && L({
250
+ if (!n) return t || z(r, i, a);
251
+ if (t && R({
252
252
  conversationId: t,
253
253
  sub: n
254
254
  })) return t;
255
- let o = B(r, i, a);
255
+ let o = z(r, i, a);
256
256
  if (o) {
257
- if (L({
257
+ if (R({
258
258
  conversationId: o,
259
259
  sub: n
260
260
  })) return o;
261
261
  ge(r, i, a);
262
262
  }
263
263
  }
264
- var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools: i = [], toolChoice: o, firstUserMessagePrefix: c, onAssistantMessageComplete: l, idleTimeoutMs: p = de, client: m, conversationId: h, sub: g, storage: _, storageKey: v = oe, sendFullTranscript: y = !1, onStorageError: b, onContextLoss: x }) => {
265
- let [S, C] = f([]), [ee, w] = f([]), [T, E] = f(null), [D, k] = f("idle"), [ne, M] = f(null), N = g !== void 0 && g.trim() === "", P = N ? void 0 : g?.trim() || void 0, re = u(() => se(), []), I = N ? null : _ === void 0 ? re : _ || null, ce = d(b), R = d(x);
264
+ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = fe, tools: i = [], toolChoice: o, firstUserMessagePrefix: c, onAssistantMessageComplete: l, idleTimeoutMs: p = de, client: m, conversationId: h, sub: g, storage: _, storageKey: v = ae, sendFullTranscript: y = !1, onStorageError: b, onContextLoss: x }) => {
265
+ let [ee, S] = f([]), [C, w] = f([]), [T, E] = f(null), [D, k] = f("idle"), [ne, M] = f(null), N = g !== void 0 && g.trim() === "", P = N ? void 0 : g?.trim() || void 0, F = u(() => oe(), []), I = N ? null : _ === void 0 ? F : _ || null, se = d(b), ce = d(x);
266
266
  s(() => {
267
- ce.current = b, R.current = x;
267
+ se.current = b, ce.current = x;
268
268
  }, [b, x]);
269
- let B = a((e, t) => {
269
+ let z = a((e, t) => {
270
270
  try {
271
- ce.current?.(e, t);
271
+ se.current?.(e, t);
272
272
  } catch {}
273
273
  }, []), ye = (e) => ve({
274
274
  seed: h,
@@ -285,22 +285,22 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
285
285
  })),
286
286
  errors: e
287
287
  };
288
- }), [V, H] = f(be.id), [xe, U] = f(be.errors.length > 0), W = a((e, t) => {
289
- U(!0), B(e, t);
290
- }, [B]);
288
+ }), [xe, V] = f(be.id), [Se, Ce] = f(be.errors.length > 0), H = a((e, t) => {
289
+ Ce(!0), z(e, t);
290
+ }, [z]);
291
291
  s(() => {
292
- be.errors.forEach(({ error: e, operation: t }) => B(e, t));
293
- }, [be, B]), s(() => {
294
- N && B(/* @__PURE__ */ Error("sub is blank"), "key");
295
- }, [N, B]);
296
- let G = d(V), K = d({
292
+ be.errors.forEach(({ error: e, operation: t }) => z(e, t));
293
+ }, [be, z]), s(() => {
294
+ N && z(/* @__PURE__ */ Error("sub is blank"), "key");
295
+ }, [N, z]);
296
+ let U = d(xe), W = d({
297
297
  storage: I,
298
298
  key: _e(v, P),
299
299
  sub: P,
300
300
  sendFullTranscript: y
301
301
  });
302
302
  s(() => {
303
- K.current = {
303
+ W.current = {
304
304
  storage: I,
305
305
  key: _e(v, P),
306
306
  sub: P,
@@ -312,54 +312,54 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
312
312
  P,
313
313
  y
314
314
  ]);
315
- let Se = _ === !1 ? "off" : xe || N ? "degraded" : "ok", [Ce, we] = f(!1), [Te, q] = f("idle"), [Ee, De] = f(!1), J = d(0), Y = d(null), X = d(null), Oe = d(!1), Z = a(() => {
316
- J.current += 1, Y.current?.abort(), Y.current = null, X.current = null, Oe.current = !1, De(!1), q("idle");
317
- }, []), ke = d(m);
315
+ let we = _ === !1 ? "off" : Se || N ? "degraded" : "ok", [Te, Ee] = f(!1), [De, Oe] = f("idle"), [ke, Ae] = f(!1), G = d(0), K = d(null), q = d(null), je = d(!1), J = a(() => {
316
+ G.current += 1, K.current?.abort(), K.current = null, q.current = null, je.current = !1, Ae(!1), Oe("idle");
317
+ }, []), Me = d(m);
318
318
  s(() => {
319
- ke.current = m;
320
- }, [m]), s(() => () => Y.current?.abort(), []);
321
- let Ae = d(null), je = d(""), Q = d(0), Me = d([]);
319
+ Me.current = m;
320
+ }, [m]), s(() => () => K.current?.abort(), []);
321
+ let Ne = d(null), Y = d(""), X = d(0), Pe = d([]);
322
322
  s(() => {
323
- Me.current = S;
324
- }, [S]);
325
- let $ = d([]), Ne = d(/* @__PURE__ */ new Map()), Pe = d(/* @__PURE__ */ new Map()), Fe = d(null), Ie = a(() => {
326
- Fe.current !== null && (clearTimeout(Fe.current), Fe.current = null);
323
+ Pe.current = ee;
324
+ }, [ee]);
325
+ let Z = d([]), Fe = d(/* @__PURE__ */ new Map()), Q = d(/* @__PURE__ */ new Map()), $ = d(null), Ie = a(() => {
326
+ $.current !== null && (clearTimeout($.current), $.current = null);
327
327
  }, []), Le = a((e) => {
328
- Ie(), Fe.current = setTimeout(() => {
328
+ Ie(), $.current = setTimeout(() => {
329
329
  e.abort(new DOMException("The assistant took too long to respond. Please try again.", "TimeoutError"));
330
330
  }, p);
331
331
  }, [Ie, p]);
332
332
  s(() => () => {
333
- Ae.current?.abort(), Ie();
333
+ Ne.current?.abort(), Ie();
334
334
  }, [Ie]);
335
335
  let Re = a(({ reportedId: e, source: t, turn: n }) => {
336
336
  if (n.signal.aborted || typeof e != "string" || !e) return;
337
337
  if (t === "event") n.reportedId = e, n.reportedFromEvent = !0;
338
338
  else if (!n.reportedFromEvent) n.reportedId = e;
339
339
  else return;
340
- if (n.heldId || e === G.current) return;
341
- let { sub: r, storage: i, key: a } = K.current;
342
- (!r || L({
340
+ if (n.heldId || e === U.current) return;
341
+ let { sub: r, storage: i, key: a } = W.current;
342
+ (!r || R({
343
343
  conversationId: e,
344
344
  sub: r
345
- })) && (G.current = e, H(e), he(i, a, e, W));
346
- }, [W]), ze = a((e, t, n, r) => {
345
+ })) && (U.current = e, V(e), B(i, a, e, H));
346
+ }, [H]), ze = a((e, t, n, r) => {
347
347
  let i = (e) => {
348
348
  n.push(e), w((t) => [...t, e]);
349
349
  };
350
350
  if (t.type === "response.output_text.delta") {
351
351
  if (!t.delta) return !1;
352
- let n = Ne.current.get(e) ?? {
352
+ let n = Fe.current.get(e) ?? {
353
353
  raw: "",
354
354
  emittedCount: 0
355
355
  };
356
356
  n.raw += t.delta;
357
357
  let { cleanedText: r, matches: a } = O(n.raw), o = r.trim(), s = a.slice(n.emittedCount);
358
- if (n.emittedCount = a.length, Ne.current.set(e, n), Pe.current.set(e, o), C((t) => t.map((t) => t.id === e ? {
358
+ if (n.emittedCount = a.length, Fe.current.set(e, n), Q.current.set(e, o), S((t) => t.map((t) => t.id === e ? {
359
359
  ...t,
360
360
  content: o
361
361
  } : t)), s.length > 0) {
362
- let e = Date.now(), t = Q.current;
362
+ let e = Date.now(), t = X.current;
363
363
  s.forEach((n) => i({
364
364
  kind: "pseudo_tool_call",
365
365
  name: n.name,
@@ -372,7 +372,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
372
372
  }
373
373
  if (t.type === "response.output_item.added" || t.type === "response.output_item.done") {
374
374
  let n = t.item;
375
- if (n.type === "output_image") return n.image_url && C((t) => t.map((t) => t.id === e ? {
375
+ if (n.type === "output_image") return n.image_url && S((t) => t.map((t) => t.id === e ? {
376
376
  ...t,
377
377
  parts: [...t.parts ?? [], {
378
378
  type: "image",
@@ -380,7 +380,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
380
380
  }]
381
381
  } : t)), !0;
382
382
  if (n.type === "function_call" || n.type === "mcp_call") {
383
- let e = Date.now(), r = Q.current, a = n.name || "unknown_tool";
383
+ let e = Date.now(), r = X.current, a = n.name || "unknown_tool";
384
384
  return i(t.type === "response.output_item.added" ? {
385
385
  kind: "tool_start",
386
386
  name: a,
@@ -404,7 +404,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
404
404
  }), !0;
405
405
  }
406
406
  if (n.type === "llm_call") {
407
- let e = Date.now(), r = Q.current;
407
+ let e = Date.now(), r = X.current;
408
408
  return i(t.type === "response.output_item.added" ? {
409
409
  kind: "llm_call_start",
410
410
  request: n.request ?? [],
@@ -424,29 +424,29 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
424
424
  status: t.status,
425
425
  message: t.message,
426
426
  at: Date.now(),
427
- turnSentAt: Q.current
427
+ turnSentAt: X.current
428
428
  }), !0;
429
429
  if (t.type === "response.output_text.done") return !1;
430
430
  if (t.type === "response.created") return Re({
431
431
  reportedId: t.response?.conversation?.id,
432
432
  source: "event",
433
433
  turn: r
434
- }), me(t.response?.conversation?.history_status, r), !1;
434
+ }), he(t.response?.conversation?.history_status, r), !1;
435
435
  if (t.type === "response.completed") {
436
436
  Re({
437
437
  reportedId: t.response?.conversation?.id,
438
438
  source: "event",
439
439
  turn: r
440
- }), me(t.response?.conversation?.history_status, r);
440
+ }), he(t.response?.conversation?.history_status, r);
441
441
  let n = typeof t.message_id == "string" && t.message_id ? t.message_id : void 0;
442
- n && C((t) => t.map((t) => t.id === e ? {
442
+ n && S((t) => t.map((t) => t.id === e ? {
443
443
  ...t,
444
444
  serverMessageId: n
445
445
  } : t));
446
- let i = Ne.current.get(e);
446
+ let i = Fe.current.get(e);
447
447
  if (i) {
448
448
  let { cleanedText: t } = O(i.raw, { hideOpenBlock: !1 }), n = t.trim();
449
- n !== Pe.current.get(e) && (Pe.current.set(e, n), C((t) => t.map((t) => t.id === e ? {
449
+ n !== Q.current.get(e) && (Q.current.set(e, n), S((t) => t.map((t) => t.id === e ? {
450
450
  ...t,
451
451
  content: n
452
452
  } : t)));
@@ -457,7 +457,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
457
457
  kind: "info",
458
458
  message: t.message,
459
459
  at: Date.now(),
460
- turnSentAt: Q.current
460
+ turnSentAt: X.current
461
461
  }), !0;
462
462
  if (t.type === "mcp_app") {
463
463
  let n = t.resourceUri;
@@ -466,10 +466,10 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
466
466
  eventType: t.type,
467
467
  raw: JSON.stringify(t),
468
468
  at: Date.now(),
469
- turnSentAt: Q.current
469
+ turnSentAt: X.current
470
470
  }), !0;
471
471
  let { html: r, title: a, csp: o, permissions: s, prefersBorder: c, displayMode: l } = t;
472
- return C((t) => t.map((t) => t.id === e ? {
472
+ return S((t) => t.map((t) => t.id === e ? {
473
473
  ...t,
474
474
  parts: [...t.parts ?? [], {
475
475
  type: "mcp_app",
@@ -488,20 +488,20 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
488
488
  eventType: t.type,
489
489
  raw: JSON.stringify(t),
490
490
  at: Date.now(),
491
- turnSentAt: Q.current
491
+ turnSentAt: X.current
492
492
  }), !0;
493
493
  }, [Re]), Be = a(async (a) => {
494
- k("streaming"), M(null), we(!1);
494
+ k("streaming"), M(null), Ee(!1);
495
495
  let s = Date.now();
496
- Q.current = s;
497
- let u = fe(), d = {
496
+ X.current = s;
497
+ let u = pe(), d = {
498
498
  id: u,
499
499
  role: "assistant",
500
500
  content: "",
501
501
  streaming: !0,
502
502
  createdAt: s
503
503
  };
504
- C((e) => [...e, d]), $.current = [...a, d];
504
+ S((e) => [...e, d]), Z.current = [...a, d];
505
505
  let f = a.findIndex((e) => e.role === "user" && !e.hidden), p = a.map((e, t) => t === f && c ? {
506
506
  role: e.role,
507
507
  content: `${c}${e.content}`,
@@ -512,7 +512,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
512
512
  content: e.content,
513
513
  hidden: e.hidden,
514
514
  titleHint: e.titleHint
515
- }), { sendFullTranscript: m } = K.current, h = m ? void 0 : G.current, g = h ? p.slice(-1) : p;
515
+ }), { sendFullTranscript: m } = W.current, h = m ? void 0 : U.current, g = h ? p.slice(-1) : p;
516
516
  E({
517
517
  model: t,
518
518
  systemPrompt: n,
@@ -528,11 +528,11 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
528
528
  }
529
529
  });
530
530
  let _ = new AbortController();
531
- Ae.current = _, Le(_);
531
+ Ne.current = _, Le(_);
532
532
  let v = {
533
533
  signal: _.signal,
534
534
  heldId: h
535
- }, y = "", b = null, x = !1, S = !1, ee = !1, T = [], D = (e, t) => {
535
+ }, y = "", b = null, x = !1, ee = !1, C = !1, T = [], D = (e, t) => {
536
536
  k("error"), M(e);
537
537
  let n = {
538
538
  kind: "error",
@@ -553,8 +553,8 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
553
553
  turnSentAt: s
554
554
  };
555
555
  T.push(t), w((e) => [...e, t]);
556
- } else e.type === "response.output_text.delta" && e.delta && (ee = !0), ze(u, e, T, v) && (S = !0);
557
- }), t && (x = !0, C((e) => e.map((e) => e.id === u ? {
556
+ } else e.type === "response.output_text.delta" && e.delta && (C = !0), ze(u, e, T, v) && (ee = !0);
557
+ }), t && (x = !0, S((e) => e.map((e) => e.id === u ? {
558
558
  ...e,
559
559
  streaming: !1
560
560
  } : e)));
@@ -594,7 +594,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
594
594
  } : t);
595
595
  },
596
596
  onMessageId: (e) => {
597
- typeof e == "string" && e && C((t) => t.map((t) => t.id === u ? {
597
+ typeof e == "string" && e && S((t) => t.map((t) => t.id === u ? {
598
598
  ...t,
599
599
  serverMessageId: e
600
600
  } : t));
@@ -617,7 +617,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
617
617
  return;
618
618
  }
619
619
  if (a === void 0 || a >= 400) {
620
- D(pe(r, a, c, d), {
620
+ D(me(r, a, c, d), {
621
621
  httpStatus: a,
622
622
  rawBody: c || void 0
623
623
  });
@@ -625,25 +625,25 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
625
625
  }
626
626
  let m = v.reportedId, w = m !== h, j = v.historyStatus === "failed" || v.historyStatus === "empty";
627
627
  if (h && !v.signal.aborted && (w || j)) {
628
- G.current = void 0, H(void 0), ge(K.current.storage, K.current.key, W), Z(), we(!0);
628
+ U.current = void 0, V(void 0), ge(W.current.storage, W.current.key, H), J(), Ee(!0);
629
629
  try {
630
- R.current?.({
630
+ ce.current?.({
631
631
  sentId: h,
632
632
  ...m ? { reportedId: m } : {},
633
633
  reason: w ? "id" : "history"
634
634
  });
635
635
  } catch {}
636
636
  }
637
- if (!S) {
637
+ if (!ee) {
638
638
  D(`${r} returned an empty response.`);
639
639
  return;
640
640
  }
641
- if (!ee) {
641
+ if (!C) {
642
642
  D(`${r} ran some tools but didn't return an answer. Try asking again.`);
643
643
  return;
644
644
  }
645
645
  k("idle");
646
- let te = Pe.current.get(u) ?? "";
646
+ let te = Q.current.get(u) ?? "";
647
647
  E((e) => e && e.sentAt === s ? {
648
648
  ...e,
649
649
  response: { content: te }
@@ -666,13 +666,13 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
666
666
  D(t instanceof j ? te(t, r) : t?.message || `${r} request failed.`);
667
667
  } finally {
668
668
  Ie();
669
- let e = Pe.current.get(u) ?? "";
670
- Ne.current.delete(u), Pe.current.delete(u);
669
+ let e = Q.current.get(u) ?? "";
670
+ Fe.current.delete(u), Q.current.delete(u);
671
671
  let t = T.some((e) => e.kind === "tool_start" || e.kind === "tool_end");
672
- C((e) => e.flatMap((e) => e.id === u ? e.content || t ? [{
672
+ S((e) => e.flatMap((e) => e.id === u ? e.content || t ? [{
673
673
  ...e,
674
674
  streaming: !1
675
- }] : [] : [e])), $.current = $.current.flatMap((t) => t.id === u ? e ? [{
675
+ }] : [] : [e])), Z.current = Z.current.flatMap((t) => t.id === u ? e ? [{
676
676
  ...t,
677
677
  content: e,
678
678
  streaming: !1
@@ -691,43 +691,43 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
691
691
  Re,
692
692
  Le,
693
693
  Ie,
694
- W,
695
- Z
694
+ H,
695
+ J
696
696
  ]), Ve = a((e) => {
697
- Me.current = e, C(e);
697
+ Pe.current = e, S(e);
698
698
  }, []), He = a((e) => {
699
699
  let t = e.trim();
700
700
  if (!t) return;
701
- je.current = t;
701
+ Y.current = t;
702
702
  let n = {
703
- id: fe(),
703
+ id: pe(),
704
704
  role: "user",
705
705
  content: t,
706
706
  createdAt: Date.now()
707
- }, r = [...$.current, n];
708
- $.current = r, Ve([...Me.current, n]), Be(r);
707
+ }, r = [...Z.current, n];
708
+ Z.current = r, Ve([...Pe.current, n]), Be(r);
709
709
  }, [Be, Ve]), Ue = a((e, t) => {
710
710
  if (D === "streaming") return;
711
711
  let n = e.trim();
712
712
  if (!n) return;
713
- je.current = n;
713
+ Y.current = n;
714
714
  let r = t?.trim(), i = {
715
- id: fe(),
715
+ id: pe(),
716
716
  role: "user",
717
717
  content: n,
718
718
  createdAt: Date.now(),
719
719
  hidden: !0,
720
720
  ...r ? { titleHint: r } : {}
721
- }, a = [...$.current, i];
722
- $.current = a, Be(a);
721
+ }, a = [...Z.current, i];
722
+ Z.current = a, Be(a);
723
723
  }, [Be, D]), We = a(() => {
724
- Ae.current?.abort();
724
+ Ne.current?.abort();
725
725
  }, []), Ge = a(() => {
726
- if (D === "streaming" || !je.current) return;
727
- let e = Me.current, t = e[e.length - 1], n = t && t.role === "assistant" ? e.slice(0, -1) : e;
726
+ if (D === "streaming" || !Y.current) return;
727
+ let e = Pe.current, t = e[e.length - 1], n = t && t.role === "assistant" ? e.slice(0, -1) : e;
728
728
  Ve(n);
729
- let r = $.current, i = r[r.length - 1], a = i && i.role === "assistant" ? r.slice(0, -1) : r;
730
- $.current = a, Be(a);
729
+ let r = Z.current, i = r[r.length - 1], a = i && i.role === "assistant" ? r.slice(0, -1) : r;
730
+ Z.current = a, Be(a);
731
731
  }, [
732
732
  Be,
733
733
  Ve,
@@ -735,62 +735,62 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
735
735
  ]), Ke = a(() => w([]), []), qe = a(() => {
736
736
  M(null), k((e) => e === "error" ? "idle" : e);
737
737
  }, []), Je = a(() => {
738
- Ae.current?.abort(), Z(), we(!1), Ve([]), $.current = [], w([]), E(null), k("idle"), M(null), je.current = "";
739
- }, [Z, Ve]), Ye = a(() => {
740
- Je(), G.current = void 0, H(void 0), ge(K.current.storage, K.current.key, W);
741
- }, [Je, W]), Xe = d(P);
738
+ Ne.current?.abort(), J(), Ee(!1), Ve([]), Z.current = [], w([]), E(null), k("idle"), M(null), Y.current = "";
739
+ }, [J, Ve]), Ye = a(() => {
740
+ Je(), U.current = void 0, V(void 0), ge(W.current.storage, W.current.key, H);
741
+ }, [Je, H]), Xe = d(P);
742
742
  s(() => {
743
743
  let e = Xe.current;
744
744
  if (e === P) return;
745
745
  Xe.current = P, e !== void 0 && Je();
746
- let t = ye(W);
747
- G.current = t, H(t);
746
+ let t = ye(H);
747
+ U.current = t, V(t);
748
748
  }, [P]);
749
749
  let Ze = a((e) => {
750
- Ae.current?.abort();
750
+ Ne.current?.abort();
751
751
  let t = e.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
752
752
  ...e,
753
753
  streaming: !1
754
754
  }));
755
- Ve(t.filter((e) => !e.hidden)), $.current = t, w([]), E(null), k("idle"), M(null), je.current = "";
755
+ Ve(t.filter((e) => !e.hidden)), Z.current = t, w([]), E(null), k("idle"), M(null), Y.current = "";
756
756
  }, [Ve]), Qe = a((e) => {
757
- Z(), Ze(e);
758
- }, [Z, Ze]), $e = a((e) => {
759
- G.current = e, H(e), he(K.current.storage, K.current.key, e, W), we(!1);
760
- }, [W]), et = a((e) => {
757
+ J(), Ze(e);
758
+ }, [J, Ze]), $e = a((e) => {
759
+ U.current = e, V(e), B(W.current.storage, W.current.key, e, H), Ee(!1);
760
+ }, [H]), et = a((e) => {
761
761
  let t = e.hasMoreBefore && e.nextBeforeAbsoluteIndex !== null;
762
- X.current = t ? e.nextBeforeAbsoluteIndex : null, De(t);
762
+ q.current = t ? e.nextBeforeAbsoluteIndex : null, Ae(t);
763
763
  }, []), tt = a(async ({ conversationId: e }) => {
764
- let t = ke.current, { sub: n } = K.current, r = !!e && (!n || L({
764
+ let t = Me.current, { sub: n } = W.current, r = !!e && (!n || R({
765
765
  conversationId: e,
766
766
  sub: n
767
767
  }));
768
- if (!t || !r) throw q("error"), Error(t ? "invalid conversation id" : "no client");
769
- Ae.current?.abort(), Z();
770
- let i = J.current, a = new AbortController();
771
- Y.current = a, q("loading");
768
+ if (!t || !r) throw Oe("error"), Error(t ? "invalid conversation id" : "no client");
769
+ Ne.current?.abort(), J();
770
+ let i = G.current, a = new AbortController();
771
+ K.current = a, Oe("loading");
772
772
  try {
773
773
  let n = await t.getConversation({
774
774
  conversationId: e,
775
775
  limit: le,
776
776
  signal: a.signal
777
777
  });
778
- if (i !== J.current) return;
779
- Ze(F({ messages: n.messages })), $e(e), et(n), q("idle");
778
+ if (i !== G.current) return;
779
+ Ze(re({ messages: n.messages })), $e(e), et(n), Oe("idle");
780
780
  } catch (e) {
781
- if (i !== J.current) return;
782
- throw q("error"), e;
781
+ if (i !== G.current) return;
782
+ throw Oe("error"), e;
783
783
  }
784
784
  }, [
785
785
  et,
786
- Z,
786
+ J,
787
787
  $e,
788
788
  Ze
789
789
  ]), nt = a(async () => {
790
- let e = ke.current, t = G.current, n = X.current;
791
- if (!e || !t || n === null || Oe.current) return;
792
- let r = J.current, i = new AbortController();
793
- Y.current = i, Oe.current = !0, q("loading");
790
+ let e = Me.current, t = U.current, n = q.current;
791
+ if (!e || !t || n === null || je.current) return;
792
+ let r = G.current, i = new AbortController();
793
+ K.current = i, je.current = !0, Oe("loading");
794
794
  try {
795
795
  let a = await e.getConversation({
796
796
  conversationId: t,
@@ -798,31 +798,31 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
798
798
  beforeAbsoluteIndex: n,
799
799
  signal: i.signal
800
800
  });
801
- if (r !== J.current) return;
802
- let o = F({ messages: a.messages });
803
- $.current = ie({
804
- current: $.current,
801
+ if (r !== G.current) return;
802
+ let o = re({ messages: a.messages });
803
+ Z.current = L({
804
+ current: Z.current,
805
805
  earlier: o
806
- }), C((e) => {
807
- let t = ie({
806
+ }), S((e) => {
807
+ let t = L({
808
808
  current: e,
809
809
  earlier: o
810
810
  });
811
- return Me.current = t, t;
812
- }), et(a), q("idle");
811
+ return Pe.current = t, t;
812
+ }), et(a), Oe("idle");
813
813
  } catch (e) {
814
- if (r !== J.current) return;
815
- throw q("error"), e;
814
+ if (r !== G.current) return;
815
+ throw Oe("error"), e;
816
816
  } finally {
817
- r === J.current && (Oe.current = !1);
817
+ r === G.current && (je.current = !1);
818
818
  }
819
819
  }, [et]), [rt, it] = f();
820
820
  return {
821
- conversationId: V,
822
- persistence: Se,
823
- contextLost: Ce,
824
- messages: S,
825
- traceEvents: ee,
821
+ conversationId: xe,
822
+ persistence: we,
823
+ contextLost: Te,
824
+ messages: ee,
825
+ traceEvents: C,
826
826
  lastRequest: T,
827
827
  status: D,
828
828
  error: ne,
@@ -836,20 +836,20 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
836
836
  loadMessages: Qe,
837
837
  loadConversation: tt,
838
838
  loadEarlier: nt,
839
- hasEarlier: Ee,
840
- historyStatus: Te,
839
+ hasEarlier: ke,
840
+ historyStatus: De,
841
841
  feedback: u(() => {
842
842
  if (!m || rt === m) return;
843
- let e = ae({
843
+ let e = ie({
844
844
  client: m,
845
- getConversationId: () => V
845
+ getConversationId: () => xe
846
846
  }), t = async (e) => {
847
847
  try {
848
848
  await e();
849
849
  } catch (e) {
850
850
  throw e instanceof j && ue.includes(e.status) && it(m), e;
851
851
  }
852
- }, n = (e, t) => C((n) => n.map((n) => n.serverMessageId === e ? {
852
+ }, n = (e, t) => S((n) => n.map((n) => n.serverMessageId === e ? {
853
853
  ...n,
854
854
  feedback: t
855
855
  } : n));
@@ -869,7 +869,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
869
869
  };
870
870
  }, [
871
871
  m,
872
- V,
872
+ xe,
873
873
  rt
874
874
  ])
875
875
  };
@@ -877,7 +877,7 @@ var ye = ({ transport: e, model: t, instructions: n, assistantName: r = z, tools
877
877
  status: 0,
878
878
  kind: "network"
879
879
  });
880
- function V(e) {
880
+ function xe(e) {
881
881
  let { pageSize: t, enabled: n = !0 } = e, [r, i] = f([]), [o, c] = f(n ? "loading" : "idle"), [l, u] = f(null), [p, m] = f(null), h = d(e.client), g = d([]);
882
882
  s(() => {
883
883
  h.current = e.client, g.current = r;
@@ -908,7 +908,7 @@ function V(e) {
908
908
  }, [n, y]);
909
909
  let b = a(() => y("replace"), [y]), x = a(async () => {
910
910
  _.current !== null && await y("append");
911
- }, [y]), S = a(async ({ conversationId: e }) => {
911
+ }, [y]), ee = a(async ({ conversationId: e }) => {
912
912
  let t = g.current.findIndex((t) => t.conversationId === e), n = t === -1 ? void 0 : {
913
913
  row: g.current[t],
914
914
  index: t
@@ -933,41 +933,41 @@ function V(e) {
933
933
  hasMore: p !== null,
934
934
  refresh: b,
935
935
  loadMore: x,
936
- remove: S
936
+ remove: ee
937
937
  };
938
938
  }
939
939
  // src/client/routes.ts
940
- function H(e) {
940
+ function V(e) {
941
941
  return e.replace(/\/+$/, "");
942
942
  }
943
- function xe(e, t) {
943
+ function Se(e, t) {
944
944
  let n = new URLSearchParams();
945
945
  for (let [e, r] of Object.entries(t)) r !== void 0 && n.set(e, String(r));
946
946
  let r = n.toString();
947
947
  return r ? `${e}?${r}` : e;
948
948
  }
949
- var U = {
949
+ var Ce = {
950
950
  responses(e) {
951
- return `${H(e)}/responses`;
951
+ return `${V(e)}/responses`;
952
952
  },
953
953
  conversations(e, t) {
954
- return xe(`${H(e)}/conversations`, {
954
+ return Se(`${V(e)}/conversations`, {
955
955
  limit: t.limit,
956
956
  cursor: t.cursor
957
957
  });
958
958
  },
959
959
  conversation(e, t, n) {
960
- return xe(`${H(e)}/conversations/${encodeURIComponent(t)}`, {
960
+ return Se(`${V(e)}/conversations/${encodeURIComponent(t)}`, {
961
961
  limit: n.limit,
962
962
  before_absolute_index: n.beforeAbsoluteIndex
963
963
  });
964
964
  },
965
965
  feedback(e, t, n) {
966
- return `${H(e)}/conversations/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}/feedback`;
966
+ return `${V(e)}/conversations/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}/feedback`;
967
967
  }
968
968
  };
969
969
  // src/client/createBaileyClient.ts
970
- function W(e) {
970
+ function H(e) {
971
971
  return {
972
972
  status: void 0,
973
973
  text: "",
@@ -976,51 +976,51 @@ function W(e) {
976
976
  ...e ? { errorCause: e.cause } : {}
977
977
  };
978
978
  }
979
- var G = "The assistant took too long to respond. Please try again.";
980
- function K(e) {
979
+ var U = "The assistant took too long to respond. Please try again.";
980
+ function W(e) {
981
981
  return {
982
982
  status: e.status,
983
983
  text: "",
984
- errorMessage: G,
984
+ errorMessage: U,
985
985
  errorKind: "timeout",
986
986
  errorCause: e.cause,
987
987
  ...e.status === void 0 ? {} : { interrupted: !0 }
988
988
  };
989
989
  }
990
- var Se = 3e4, Ce = 155e3, we = "x-chat-id", Te = "header", q = "body", Ee = "x-request-id", De = "x-conversation-id", J = "x-message-id", Y = (e) => e && typeof e == "object" ? e : {}, X = (e, t = "") => typeof e == "string" ? e : t, Oe = (e, t = 0) => typeof e == "number" ? e : t;
991
- function Z(e) {
992
- let t = Y(e);
990
+ var we = 3e4, Te = 155e3, Ee = "x-chat-id", De = "header", Oe = "body", ke = "x-request-id", Ae = "x-conversation-id", G = "x-message-id", K = (e) => e && typeof e == "object" ? e : {}, q = (e, t = "") => typeof e == "string" ? e : t, je = (e, t = 0) => typeof e == "number" ? e : t;
991
+ function J(e) {
992
+ let t = K(e);
993
993
  return {
994
- conversationId: X(t.conversation_id),
994
+ conversationId: q(t.conversation_id),
995
995
  title: typeof t.title == "string" ? t.title : null,
996
- status: X(t.status),
997
- messageCount: Oe(t.message_count),
998
- createdAt: X(t.created_at),
999
- updatedAt: X(t.updated_at)
996
+ status: q(t.status),
997
+ messageCount: je(t.message_count),
998
+ createdAt: q(t.created_at),
999
+ updatedAt: q(t.updated_at)
1000
1000
  };
1001
1001
  }
1002
- function ke(e) {
1002
+ function Me(e) {
1003
1003
  if (!e || typeof e != "object") return null;
1004
- let t = Y(e);
1004
+ let t = K(e);
1005
1005
  return {
1006
- rating: X(t.rating),
1006
+ rating: q(t.rating),
1007
1007
  reasonCodes: Array.isArray(t.reason_codes) ? t.reason_codes.filter((e) => typeof e == "string") : [],
1008
1008
  comment: typeof t.comment == "string" ? t.comment : null,
1009
1009
  ...typeof t.updated_at == "string" ? { updatedAt: t.updated_at } : {}
1010
1010
  };
1011
1011
  }
1012
- function Ae(e) {
1013
- let t = Y(e);
1012
+ function Ne(e) {
1013
+ let t = K(e);
1014
1014
  return {
1015
- messageId: X(t.message_id),
1016
- role: X(t.role),
1017
- content: X(t.content),
1015
+ messageId: q(t.message_id),
1016
+ role: q(t.role),
1017
+ content: q(t.content),
1018
1018
  hidden: t.hidden === !0,
1019
- createdAt: X(t.created_at),
1020
- feedback: ke(t.feedback)
1019
+ createdAt: q(t.created_at),
1020
+ feedback: Me(t.feedback)
1021
1021
  };
1022
1022
  }
1023
- function je(e) {
1023
+ function Y(e) {
1024
1024
  let t = new AbortController(), n = !1, r = setTimeout(() => {
1025
1025
  n = !0, t.abort();
1026
1026
  }, e.timeoutMs), i = () => t.abort(e.caller?.reason);
@@ -1032,7 +1032,7 @@ function je(e) {
1032
1032
  }
1033
1033
  };
1034
1034
  }
1035
- function Q(e) {
1035
+ function X(e) {
1036
1036
  return e.timedOut() ? new j({
1037
1037
  status: 0,
1038
1038
  kind: "timeout",
@@ -1042,9 +1042,9 @@ function Q(e) {
1042
1042
  kind: "aborted"
1043
1043
  });
1044
1044
  }
1045
- function Me(e) {
1046
- let { baseUrl: t, getHeaders: n, onAuthError: r, refreshAuth: i } = e, a = e.requestTimeoutMs ?? Se, o = e.idleTimeoutMs ?? Ce, s = e.conversationVia ?? Te;
1047
- if (s !== Te && s !== q) throw TypeError("createBaileyClient: conversationVia must be 'header' or 'body'");
1045
+ function Pe(e) {
1046
+ let { baseUrl: t, getHeaders: n, onAuthError: r, refreshAuth: i } = e, a = e.requestTimeoutMs ?? we, o = e.idleTimeoutMs ?? Te, s = e.conversationVia ?? De;
1047
+ if (s !== De && s !== Oe) throw TypeError("createBaileyClient: conversationVia must be 'header' or 'body'");
1048
1048
  let c = e.fetch ?? ((e, t) => globalThis.fetch(e, t));
1049
1049
  function l(t) {
1050
1050
  try {
@@ -1064,7 +1064,7 @@ function Me(e) {
1064
1064
  return e.body?.cancel().catch(() => l("cancel-response-body")), !0;
1065
1065
  }
1066
1066
  async function f(e) {
1067
- let t = je({
1067
+ let t = Y({
1068
1068
  caller: e.signal,
1069
1069
  timeoutMs: a
1070
1070
  });
@@ -1082,7 +1082,7 @@ function Me(e) {
1082
1082
  kind: "network"
1083
1083
  });
1084
1084
  }
1085
- if (t.signal.aborted) throw Q(t);
1085
+ if (t.signal.aborted) throw X(t);
1086
1086
  e.body !== void 0 && (r["Content-Type"] = "application/json");
1087
1087
  try {
1088
1088
  return await c(e.url, {
@@ -1092,7 +1092,7 @@ function Me(e) {
1092
1092
  signal: t.signal
1093
1093
  });
1094
1094
  } catch (e) {
1095
- throw t.signal.aborted ? Q(t) : new j({
1095
+ throw t.signal.aborted ? X(t) : new j({
1096
1096
  status: 0,
1097
1097
  kind: "network",
1098
1098
  cause: e
@@ -1119,7 +1119,7 @@ function Me(e) {
1119
1119
  return t;
1120
1120
  } catch (n) {
1121
1121
  if (n instanceof j) throw n;
1122
- if (t.timedOut() || t.signal.aborted) throw Q(t);
1122
+ if (t.timedOut() || t.signal.aborted) throw X(t);
1123
1123
  if (e.requireJsonBody) throw new j({
1124
1124
  status: i.status,
1125
1125
  kind: "invalid-response"
@@ -1138,10 +1138,10 @@ function Me(e) {
1138
1138
  e.signal.aborted ? i() : e.signal.addEventListener("abort", i, { once: !0 });
1139
1139
  let a, f, p = () => {
1140
1140
  clearTimeout(a), a = setTimeout(() => {
1141
- f = new DOMException(G, "TimeoutError"), r.abort(f);
1141
+ f = new DOMException(U, "TimeoutError"), r.abort(f);
1142
1142
  }, o);
1143
1143
  }, m = (t) => {
1144
- if (f && !e.signal.aborted) return K({
1144
+ if (f && !e.signal.aborted) return W({
1145
1145
  cause: f,
1146
1146
  status: t
1147
1147
  });
@@ -1162,7 +1162,7 @@ function Me(e) {
1162
1162
  stream: !0,
1163
1163
  ...Object.keys(a).length > 0 ? { metadata: a } : {}
1164
1164
  };
1165
- e.conversationId && s === q && (o.conversation = e.conversationId), e.tools.length > 0 && (o.tools = e.tools), e.toolChoice && (o.tool_choice = e.toolChoice);
1165
+ e.conversationId && s === Oe && (o.conversation = e.conversationId), e.tools.length > 0 && (o.tools = e.tools), e.toolChoice && (o.tool_choice = e.toolChoice);
1166
1166
  let f;
1167
1167
  for (let i = !1;; i = !0) {
1168
1168
  let a;
@@ -1172,25 +1172,25 @@ function Me(e) {
1172
1172
  ...await n()
1173
1173
  };
1174
1174
  } catch {
1175
- return W();
1175
+ return H();
1176
1176
  }
1177
1177
  if (r.signal.aborted) return m();
1178
- a["Content-Type"] = "application/json", e.conversationId && s === Te && (a[we] = e.conversationId);
1178
+ a["Content-Type"] = "application/json", e.conversationId && s === De && (a[Ee] = e.conversationId);
1179
1179
  try {
1180
- f = await c(U.responses(t), {
1180
+ f = await c(Ce.responses(t), {
1181
1181
  method: "POST",
1182
1182
  headers: a,
1183
1183
  body: JSON.stringify(o),
1184
1184
  signal: r.signal
1185
1185
  });
1186
1186
  } catch (e) {
1187
- return r.signal.aborted ? m() : W({ cause: e });
1187
+ return r.signal.aborted ? m() : H({ cause: e });
1188
1188
  }
1189
1189
  if (i || !await d(f)) break;
1190
1190
  }
1191
- let h = f.headers.get(Ee);
1191
+ let h = f.headers.get(ke);
1192
1192
  h && e.onRequestId?.(h);
1193
- let g = f.headers.get(J);
1193
+ let g = f.headers.get(G);
1194
1194
  if (g && e.onMessageId?.(g), !f.ok) {
1195
1195
  u(new j({
1196
1196
  status: f.status,
@@ -1202,7 +1202,7 @@ function Me(e) {
1202
1202
  text: e
1203
1203
  };
1204
1204
  }
1205
- let _ = f.headers.get(De);
1205
+ let _ = f.headers.get(Ae);
1206
1206
  if (_ && e.onConversationId?.(_), !f.body) return {
1207
1207
  status: f.status,
1208
1208
  text: ""
@@ -1239,21 +1239,21 @@ function Me(e) {
1239
1239
  }
1240
1240
  },
1241
1241
  async listConversations(e = {}) {
1242
- let n = Y(await f({
1242
+ let n = K(await f({
1243
1243
  method: "GET",
1244
- url: U.conversations(t, e),
1244
+ url: Ce.conversations(t, e),
1245
1245
  signal: e.signal,
1246
1246
  requireJsonBody: !0
1247
1247
  }));
1248
1248
  return {
1249
- conversations: Array.isArray(n.conversations) ? n.conversations.map(Z).filter((e) => e.conversationId !== "") : [],
1249
+ conversations: Array.isArray(n.conversations) ? n.conversations.map(J).filter((e) => e.conversationId !== "") : [],
1250
1250
  nextCursor: typeof n.next_cursor == "string" ? n.next_cursor : null
1251
1251
  };
1252
1252
  },
1253
1253
  async getConversation(e) {
1254
- let n = Y(await f({
1254
+ let n = K(await f({
1255
1255
  method: "GET",
1256
- url: U.conversation(t, e.conversationId, e),
1256
+ url: Ce.conversation(t, e.conversationId, e),
1257
1257
  signal: e.signal,
1258
1258
  requireJsonBody: !0
1259
1259
  }));
@@ -1262,8 +1262,8 @@ function Me(e) {
1262
1262
  kind: "invalid-response"
1263
1263
  });
1264
1264
  return {
1265
- conversation: Z(n.conversation),
1266
- messages: Array.isArray(n.messages) ? n.messages.map(Ae) : [],
1265
+ conversation: J(n.conversation),
1266
+ messages: Array.isArray(n.messages) ? n.messages.map(Ne) : [],
1267
1267
  hasMoreBefore: n.has_more_before === !0,
1268
1268
  nextBeforeAbsoluteIndex: typeof n.next_before_absolute_index == "number" ? n.next_before_absolute_index : null
1269
1269
  };
@@ -1271,14 +1271,14 @@ function Me(e) {
1271
1271
  async deleteConversation(e) {
1272
1272
  await f({
1273
1273
  method: "DELETE",
1274
- url: U.conversation(t, e.conversationId, {}),
1274
+ url: Ce.conversation(t, e.conversationId, {}),
1275
1275
  signal: e.signal
1276
1276
  });
1277
1277
  },
1278
1278
  async submitFeedback(e) {
1279
1279
  await f({
1280
1280
  method: "PUT",
1281
- url: U.feedback(t, e.conversationId, e.messageId),
1281
+ url: Ce.feedback(t, e.conversationId, e.messageId),
1282
1282
  body: {
1283
1283
  rating: e.rating,
1284
1284
  ...e.reasonCodes ? { reason_codes: e.reasonCodes } : {},
@@ -1290,21 +1290,21 @@ function Me(e) {
1290
1290
  async clearFeedback(e) {
1291
1291
  await f({
1292
1292
  method: "DELETE",
1293
- url: U.feedback(t, e.conversationId, e.messageId),
1293
+ url: Ce.feedback(t, e.conversationId, e.messageId),
1294
1294
  signal: e.signal
1295
1295
  });
1296
1296
  }
1297
1297
  };
1298
1298
  }
1299
1299
  // src/utils/prompt.ts
1300
- function $(...e) {
1300
+ function Z(...e) {
1301
1301
  return e.filter((e) => !!(e && e.trim())).join("\n\n");
1302
1302
  }
1303
1303
  // src/utils/toolCalls.ts
1304
- var Ne = "call_tool", Pe = "a tool";
1305
- function Fe(e, t) {
1304
+ var Fe = "call_tool", Q = "a tool";
1305
+ function $(e, t) {
1306
1306
  let n = {
1307
- name: e === Ne ? Pe : e,
1307
+ name: e === Fe ? Q : e,
1308
1308
  args: null,
1309
1309
  viaCallTool: !1
1310
1310
  };
@@ -1317,7 +1317,7 @@ function Fe(e, t) {
1317
1317
  }
1318
1318
  if (typeof r != "object" || !r) return n;
1319
1319
  let i = r;
1320
- if (e === Ne) {
1320
+ if (e === Fe) {
1321
1321
  let e = typeof i.name == "string" ? i.name : void 0;
1322
1322
  if (!e) return n;
1323
1323
  let t = i.arguments;
@@ -1409,7 +1409,7 @@ var Ie = 5, Le = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).m
1409
1409
  raw: "Raw event"
1410
1410
  };
1411
1411
  function $e(e) {
1412
- return e.kind !== "tool_start" && e.kind !== "tool_end" ? null : Fe(e.name, e.args);
1412
+ return e.kind !== "tool_start" && e.kind !== "tool_end" ? null : $(e.name, e.args);
1413
1413
  }
1414
1414
  function et(e, t = $e(e)) {
1415
1415
  return e.kind === "pseudo_tool_call" ? e.name : t?.name ?? null;
@@ -1441,9 +1441,9 @@ function at(e) {
1441
1441
  }
1442
1442
  function ot(e) {
1443
1443
  switch (e.kind) {
1444
- case "tool_start": return `Calling ${Fe(e.name, e.args).name}...`;
1444
+ case "tool_start": return `Calling ${$(e.name, e.args).name}...`;
1445
1445
  case "tool_end": {
1446
- let t = Fe(e.name, e.args).name;
1446
+ let t = $(e.name, e.args).name;
1447
1447
  return e.isError ? `${t} failed` : `${t} returned`;
1448
1448
  }
1449
1449
  case "pseudo_tool_call": return `${e.name} (written as text, not called)`;
@@ -1521,7 +1521,7 @@ function mt(e, t) {
1521
1521
  let n = [];
1522
1522
  for (let r of e) if (r.turnSentAt === t) {
1523
1523
  if (r.kind === "tool_start") {
1524
- let e = Fe(r.name, r.args).name;
1524
+ let e = $(r.name, r.args).name;
1525
1525
  n.push({
1526
1526
  key: `step-${n.length}`,
1527
1527
  callId: r.callId,
@@ -1531,7 +1531,7 @@ function mt(e, t) {
1531
1531
  startOffsetMs: r.at - t
1532
1532
  });
1533
1533
  } else if (r.kind === "tool_end") {
1534
- let e = Fe(r.name, r.args).name, i = r.isError ? "failed" : "done", a = n.find((t) => t.status === "running" && t.callId === r.callId && t.toolName === e);
1534
+ let e = $(r.name, r.args).name, i = r.isError ? "failed" : "done", a = n.find((t) => t.status === "running" && t.callId === r.callId && t.toolName === e);
1535
1535
  a ? (a.status = i, a.runtimeSeconds = r.runtimeSeconds, a.label = r.displayName || a.label) : n.push({
1536
1536
  key: `step-${n.length}`,
1537
1537
  callId: r.callId,
@@ -1546,7 +1546,7 @@ function mt(e, t) {
1546
1546
  return n;
1547
1547
  }
1548
1548
  // src/styles.css?inline
1549
- var ht = "/*! 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-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-leading:initial;--tw-space-y-reverse:0;--tw-outline-style:solid}}}@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-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--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-xl:.75rem;--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;position:relative}.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{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);font-style:italic;display:flex}.bailey-streaming-hint{margin-top: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);font-style:italic;display:flex}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);flex-wrap:wrap;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-chat-transcript[data-suggestions-align=end]{flex-direction:column;display:flex}.bailey-suggestions[data-align=end]{align-items:flex-end;margin-top:auto}.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);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));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-card{border:var(--bailey-suggestion-border,none);border-radius:var(--bailey-suggestion-radius,1rem);font-weight:var(--bailey-suggestion-font-weight,normal)}.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-start{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.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);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-width:1px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input-row{border-radius:var(--bailey-input-radius,9999px);border-color:var(--bailey-input-border-color,var(--color-bailey-border))}.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(--bailey-send-fg,var(--color-bailey-heart));background-color:var(--bailey-send-bg,transparent);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:var(--bailey-send-bg-hover,#16a34a1a)}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:var(--bailey-send-bg-hover,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(--bailey-stop-fg,var(--color-bailey-error));background-color:var(--bailey-stop-bg,transparent);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:var(--bailey-stop-bg-hover,#d32f2f1a)}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:var(--bailey-stop-bg-hover,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)}.bailey-feedback{align-items:center;gap:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);flex-wrap:wrap;display:flex}.bailey-message-actions>.bailey-feedback{display:contents}.bailey-feedback-thumbs{margin-left:var(--spacing);align-items:center;gap:calc(var(--spacing) * .5);border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 2);display:flex}.bailey-feedback-thumb{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-feedback-thumb:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-feedback-thumb:hover{color:var(--color-bailey-text)}}.bailey-feedback-thumb:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-thumb:disabled{cursor:default;opacity:.5}.bailey-feedback-thumb[aria-pressed=true]{background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-thumb[aria-pressed=true]{color:var(--color-bailey-accent)}.bailey-feedback-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-feedback-status{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:inline-flex}.bailey-feedback-status:empty{display:none}.bailey-feedback-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);animation:var(--animate-spin);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;display:inline-block}.bailey-feedback-link{cursor:pointer;appearance:none;--tw-border-style:none;padding-inline:var(--spacing);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}.bailey-feedback-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback-form{margin-top:calc(var(--spacing) * 2);box-sizing:border-box;border-radius:var(--radius-xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding:calc(var(--spacing) * 3);flex-basis:100%}.bailey-feedback-reasons{margin:0;margin-bottom:calc(var(--spacing) * 2);--tw-border-style:none;border-style:none;min-width:0;padding:0}.bailey-feedback-legend{margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text);padding:0;display:block}.bailey-feedback-chips{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex}.bailey-feedback-chip{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);padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text);border-radius:2147483647px}.bailey-feedback-chip:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-chip:disabled{cursor:default;opacity:.5}.bailey-feedback-chip[aria-pressed=true]{border-color:var(--color-bailey-accent);background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-chip[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-chip[aria-pressed=true]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-feedback-textarea{box-sizing:border-box;min-height:calc(var(--spacing) * 18);resize:vertical;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 2);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);display:block}.bailey-feedback-textarea:disabled{opacity:.5}.bailey-feedback-meta{margin-top:calc(var(--spacing) * 1.5);justify-content:space-between;align-items:flex-start;gap:calc(var(--spacing) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-feedback-buttons{margin-top:calc(var(--spacing) * 2.5);justify-content:flex-end;gap:calc(var(--spacing) * 2);display:flex}.bailey-feedback-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-feedback-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-button:disabled{cursor:default;opacity:.5}.bailey-feedback-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-load-earlier{align-items:center;gap:var(--spacing);padding-bottom:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-load-earlier-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-load-earlier-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-load-earlier-button:disabled{cursor:default;opacity:.5}.bailey-load-earlier-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-history-drawer{z-index:10;background-color:var(--color-bailey-surface);font-family:var(--font-sans);color:var(--color-bailey-text);border-radius:14px;flex-direction:column;display:flex;position:absolute;inset:0;overflow:hidden;container-type:inline-size}.bailey-history-header{align-items:center;gap:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);display:flex}.bailey-history-heading{text-overflow:ellipsis;white-space:nowrap;--tw-font-weight:var(--font-weight-semibold);min-width:0;font-size:15px;font-weight:var(--font-weight-semibold);--tw-outline-style:none;outline-style:none;flex:1;margin:0;overflow:hidden}.bailey-history-icon-button{height:calc(var(--spacing) * 11);width:calc(var(--spacing) * 11);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;flex:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-history-icon-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-history-icon-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-history-icon-button:hover{color:var(--color-bailey-text)}}.bailey-history-icon-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-icon-button:disabled{cursor:default;opacity:.5}.bailey-history-icon{width:18px;height:18px}.bailey-history-icon-small{height:calc(var(--spacing) * 3.5);width:calc(var(--spacing) * 3.5);flex:none}.bailey-history-button{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 1.5);white-space:nowrap;color:var(--color-bailey-text);font-size:13px;display:inline-flex}.bailey-history-button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-button:disabled{cursor:default;opacity:.5}.bailey-history-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-danger{border-color:var(--color-bailey-error);background-color:var(--color-bailey-error);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-history-body{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);flex:1;overflow-y:auto}.bailey-history-list{margin:0;padding:0;list-style-type:none}.bailey-history-row{border-radius:10px;flex-wrap:wrap;align-items:center;display:flex;position:relative}.bailey-history-row+.bailey-history-row{margin-top:calc(var(--spacing) * .5)}.bailey-history-row:not(.bailey-history-row-active):hover{background-color:var(--color-gray-100)}.bailey-history-row-active{box-shadow:inset 3px 0 0 var(--color-bailey-accent,#4f46e5);background-color:#4f46e514}.bailey-history-select{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;gap:calc(var(--spacing) * .5);--tw-border-style:none;min-width:0;padding-block:calc(var(--spacing) * 2.5);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);text-align:left;color:var(--color-bailey-text);background-color:#0000;border-style:none;border-radius:10px;flex-direction:column;flex:1;font-family:inherit;display:flex}.bailey-history-select:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-select:disabled{cursor:default;opacity:.6}.bailey-history-row-title{text-overflow:ellipsis;white-space:nowrap;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);overflow:hidden}.bailey-history-meta{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-meta>span+.bailey-history-count:before{content:\"·\";margin-right:.375rem}.bailey-history-current{--tw-font-weight:var(--font-weight-semibold);font-size:11px;font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-history-delete{margin-right:var(--spacing)}.bailey-history-row-confirming{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:var(--color-red-50)}.bailey-history-confirm{align-items:center;gap:calc(var(--spacing) * 2);min-width:0;padding-block:calc(var(--spacing) * 2);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);flex-wrap:wrap;flex:1;display:flex}.bailey-history-confirm-question{--tw-font-weight:var(--font-weight-semibold);min-width:7.5rem;font-size:13px;font-weight:var(--font-weight-semibold);flex:1}.bailey-history-confirm-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);flex-basis:100%;overflow:hidden}.bailey-history-row-failed{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:#fff7f7}.bailey-history-row-error{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-bottom:calc(var(--spacing) * 2.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;flex-basis:100%;display:flex}.bailey-history-state{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 6);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-bailey-text-secondary);flex-direction:column;font-size:13px;display:flex}.bailey-history-state strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-history-state-icon{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);color:var(--color-gray-400)}.bailey-history-state-error .bailey-history-state-icon{color:var(--color-bailey-error)}.bailey-history-more{padding-top:calc(var(--spacing) * 2.5);padding-bottom:calc(var(--spacing) * 1.5);justify-content:center;display:flex}.bailey-history-inline-error{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;display:flex}.bailey-history-status{min-height:calc(var(--spacing) * 9);align-items:center;gap:calc(var(--spacing) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3.5);padding-block: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-history-skeleton{margin-inline:var(--spacing);margin-bottom:calc(var(--spacing) * 1.5);background:linear-gradient(90deg,#f1f1f4 25%,#e6e6ec 50%,#f1f1f4 75%) 0 0/200% 100%;border-radius:10px;height:52px;animation:1.3s infinite bailey-history-shimmer}.bailey-history-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,#4f46e5);border-radius:2147483647px;animation:.8s linear infinite bailey-history-rotate;display:inline-block}@keyframes bailey-history-shimmer{to{background-position:-200% 0}}@keyframes bailey-history-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bailey-history-skeleton,.bailey-history-spinner{animation:none}}@container (width<=340px){.bailey-history-new-chat{width:calc(var(--spacing) * 11);padding-inline:0}.bailey-history-new-chat-text,.bailey-history-count{display:none}}@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-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}", gt = r(void 0), _t = /:root\s*,\s*:host\s*\{([^}]*)\}/, vt = ".bailey-chat-panel,.bailey-menu-content,.bailey-tooltip-content", yt = /^\s*--color-bailey-([\w-]+)\s*:\s*(.+?)\s*$/, bt = /^(\s*--font-sans\s*:\s*)(.+?)\s*$/, xt = /var\(--color-bailey-([\w-]+)\)/g;
1549
+ var ht = "/*! 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-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-space-y-reverse:0;--tw-outline-style:solid}}}@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-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--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-xl:.75rem;--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;position:relative}.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{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);font-style:italic;display:flex}.bailey-streaming-hint{margin-top: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);font-style:italic;display:flex}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);flex-wrap:wrap;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-chat-transcript[data-suggestions-align=end]{flex-direction:column;display:flex}.bailey-suggestions[data-align=end]{align-items:flex-end;margin-top:auto}.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);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));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-card{border:var(--bailey-suggestion-border,none);border-radius:var(--bailey-suggestion-radius,1rem);font-weight:var(--bailey-suggestion-font-weight,normal)}.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-start{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.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);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-width:1px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input-row{border-radius:var(--bailey-input-radius,9999px);border-color:var(--bailey-input-border-color,var(--color-bailey-border))}.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(--bailey-send-fg,var(--color-bailey-heart));background-color:var(--bailey-send-bg,transparent);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:var(--bailey-send-bg-hover,#16a34a1a)}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:var(--bailey-send-bg-hover,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(--bailey-stop-fg,var(--color-bailey-error));background-color:var(--bailey-stop-bg,transparent);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:var(--bailey-stop-bg-hover,#d32f2f1a)}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:var(--bailey-stop-bg-hover,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(--bailey-markdown-font-size,var(--text-sm));line-height:var(--bailey-markdown-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:var(--bailey-markdown-paragraph-gap,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)}.bailey-feedback{align-items:center;gap:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);flex-wrap:wrap;display:flex}.bailey-message-actions>.bailey-feedback{display:contents}.bailey-feedback-thumbs{margin-left:var(--spacing);align-items:center;gap:calc(var(--spacing) * .5);border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 2);display:flex}.bailey-feedback-thumb{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-feedback-thumb:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-feedback-thumb:hover{color:var(--color-bailey-text)}}.bailey-feedback-thumb:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-thumb:disabled{cursor:default;opacity:.5}.bailey-feedback-thumb[aria-pressed=true]{background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-thumb[aria-pressed=true]{color:var(--color-bailey-accent)}.bailey-feedback-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-feedback-status{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:inline-flex}.bailey-feedback-status:empty{display:none}.bailey-feedback-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);animation:var(--animate-spin);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;display:inline-block}.bailey-feedback-link{cursor:pointer;appearance:none;--tw-border-style:none;padding-inline:var(--spacing);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}.bailey-feedback-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback-form{margin-top:calc(var(--spacing) * 2);box-sizing:border-box;border-radius:var(--radius-xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding:calc(var(--spacing) * 3);flex-basis:100%}.bailey-feedback-reasons{margin:0;margin-bottom:calc(var(--spacing) * 2);--tw-border-style:none;border-style:none;min-width:0;padding:0}.bailey-feedback-legend{margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text);padding:0;display:block}.bailey-feedback-chips{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex}.bailey-feedback-chip{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);padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text);border-radius:2147483647px}.bailey-feedback-chip:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-chip:disabled{cursor:default;opacity:.5}.bailey-feedback-chip[aria-pressed=true]{border-color:var(--color-bailey-accent);background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-chip[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-chip[aria-pressed=true]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-feedback-textarea{box-sizing:border-box;min-height:calc(var(--spacing) * 18);resize:vertical;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 2);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);display:block}.bailey-feedback-textarea:disabled{opacity:.5}.bailey-feedback-meta{margin-top:calc(var(--spacing) * 1.5);justify-content:space-between;align-items:flex-start;gap:calc(var(--spacing) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-feedback-buttons{margin-top:calc(var(--spacing) * 2.5);justify-content:flex-end;gap:calc(var(--spacing) * 2);display:flex}.bailey-feedback-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-feedback-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-button:disabled{cursor:default;opacity:.5}.bailey-feedback-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-load-earlier{align-items:center;gap:var(--spacing);padding-bottom:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-load-earlier-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-load-earlier-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-load-earlier-button:disabled{cursor:default;opacity:.5}.bailey-load-earlier-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-history-drawer{z-index:10;background-color:var(--color-bailey-surface);font-family:var(--font-sans);color:var(--color-bailey-text);border-radius:14px;flex-direction:column;display:flex;position:absolute;inset:0;overflow:hidden;container-type:inline-size}.bailey-history-header{align-items:center;gap:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);display:flex}.bailey-history-heading{text-overflow:ellipsis;white-space:nowrap;--tw-font-weight:var(--font-weight-semibold);min-width:0;font-size:15px;font-weight:var(--font-weight-semibold);--tw-outline-style:none;outline-style:none;flex:1;margin:0;overflow:hidden}.bailey-history-icon-button{height:calc(var(--spacing) * 11);width:calc(var(--spacing) * 11);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;flex:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-history-icon-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-history-icon-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-history-icon-button:hover{color:var(--color-bailey-text)}}.bailey-history-icon-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-icon-button:disabled{cursor:default;opacity:.5}.bailey-history-icon{width:18px;height:18px}.bailey-history-icon-small{height:calc(var(--spacing) * 3.5);width:calc(var(--spacing) * 3.5);flex:none}.bailey-history-button{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 1.5);white-space:nowrap;color:var(--color-bailey-text);font-size:13px;display:inline-flex}.bailey-history-button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-button:disabled{cursor:default;opacity:.5}.bailey-history-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-danger{border-color:var(--color-bailey-error);background-color:var(--color-bailey-error);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-history-body{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);flex:1;overflow-y:auto}.bailey-history-list{margin:0;padding:0;list-style-type:none}.bailey-history-row{border-radius:10px;flex-wrap:wrap;align-items:center;display:flex;position:relative}.bailey-history-row+.bailey-history-row{margin-top:calc(var(--spacing) * .5)}.bailey-history-row:not(.bailey-history-row-active):hover{background-color:var(--color-gray-100)}.bailey-history-row-active{box-shadow:inset 3px 0 0 var(--color-bailey-accent,#4f46e5);background-color:#4f46e514}.bailey-history-select{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;gap:calc(var(--spacing) * .5);--tw-border-style:none;min-width:0;padding-block:calc(var(--spacing) * 2.5);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);text-align:left;color:var(--color-bailey-text);background-color:#0000;border-style:none;border-radius:10px;flex-direction:column;flex:1;font-family:inherit;display:flex}.bailey-history-select:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-select:disabled{cursor:default;opacity:.6}.bailey-history-row-title{text-overflow:ellipsis;white-space:nowrap;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);overflow:hidden}.bailey-history-meta{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-meta>span+.bailey-history-count:before{content:\"·\";margin-right:.375rem}.bailey-history-current{--tw-font-weight:var(--font-weight-semibold);font-size:11px;font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-history-delete{margin-right:var(--spacing)}.bailey-history-row-confirming{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:var(--color-red-50)}.bailey-history-confirm{align-items:center;gap:calc(var(--spacing) * 2);min-width:0;padding-block:calc(var(--spacing) * 2);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);flex-wrap:wrap;flex:1;display:flex}.bailey-history-confirm-question{--tw-font-weight:var(--font-weight-semibold);min-width:7.5rem;font-size:13px;font-weight:var(--font-weight-semibold);flex:1}.bailey-history-confirm-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);flex-basis:100%;overflow:hidden}.bailey-history-row-failed{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:#fff7f7}.bailey-history-row-error{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-bottom:calc(var(--spacing) * 2.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;flex-basis:100%;display:flex}.bailey-history-state{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 6);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-bailey-text-secondary);flex-direction:column;font-size:13px;display:flex}.bailey-history-state strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-history-state-icon{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);color:var(--color-gray-400)}.bailey-history-state-error .bailey-history-state-icon{color:var(--color-bailey-error)}.bailey-history-more{padding-top:calc(var(--spacing) * 2.5);padding-bottom:calc(var(--spacing) * 1.5);justify-content:center;display:flex}.bailey-history-inline-error{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;display:flex}.bailey-history-status{min-height:calc(var(--spacing) * 9);align-items:center;gap:calc(var(--spacing) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3.5);padding-block: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-history-skeleton{margin-inline:var(--spacing);margin-bottom:calc(var(--spacing) * 1.5);background:linear-gradient(90deg,#f1f1f4 25%,#e6e6ec 50%,#f1f1f4 75%) 0 0/200% 100%;border-radius:10px;height:52px;animation:1.3s infinite bailey-history-shimmer}.bailey-history-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,#4f46e5);border-radius:2147483647px;animation:.8s linear infinite bailey-history-rotate;display:inline-block}@keyframes bailey-history-shimmer{to{background-position:-200% 0}}@keyframes bailey-history-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bailey-history-skeleton,.bailey-history-spinner{animation:none}}@container (width<=340px){.bailey-history-new-chat{width:calc(var(--spacing) * 11);padding-inline:0}.bailey-history-new-chat-text,.bailey-history-count{display:none}}@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-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}", gt = r(void 0), _t = /:root\s*,\s*:host\s*\{([^}]*)\}/, vt = ".bailey-chat-panel,.bailey-menu-content,.bailey-tooltip-content", yt = /^\s*--color-bailey-([\w-]+)\s*:\s*(.+?)\s*$/, bt = /^(\s*--font-sans\s*:\s*)(.+?)\s*$/, xt = /var\(--color-bailey-([\w-]+)\)/g;
1550
1550
  function St(e) {
1551
1551
  let t = e.match(new RegExp(_t, "g"))?.length ?? 0;
1552
1552
  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.`);
@@ -2214,7 +2214,7 @@ function Tn(e) {
2214
2214
  }
2215
2215
  // src/ui/BaileyHistoryDrawer.tsx
2216
2216
  function En({ client: e, pageSize: t, chat: n, labels: r, locale: i, onClose: o }) {
2217
- let s = V({
2217
+ let s = xe({
2218
2218
  client: e,
2219
2219
  pageSize: t
2220
2220
  }), { loadConversation: c, newChat: l } = n, u = a((e) => c ? c(e) : Promise.reject(/* @__PURE__ */ Error("no loadConversation")), [c]), d = a(() => {
@@ -2234,7 +2234,7 @@ function En({ client: e, pageSize: t, chat: n, labels: r, locale: i, onClose: o
2234
2234
  }
2235
2235
  var Dn = (e, t) => Object.entries(t).reduce((e, [t, n]) => e.split(`{${t}}`).join(String(n)), e), On = (e) => !e || e.kind !== "http" ? !1 : e.status === 401 || e.status === 403;
2236
2236
  function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSelect: r, onActiveDeleted: i, onNewChat: a, onClose: o, labels: l, locale: u, now: p }) {
2237
- let { conversations: m, status: h, error: g, hasMore: b, refresh: x, loadMore: S, remove: C } = e, ee = c(), w = c(), T = d(null), E = d(null), D = d(null), O = d(/* @__PURE__ */ new Map()), k = d(/* @__PURE__ */ new Map()), A = d(null), j = d(null), [te, ne] = f(null), [M, N] = f(null), [P, re] = f(0), [F, I] = f(!1), [ie, L] = f(!1), [ae, oe] = f(!1), se = u ?? (typeof navigator < "u" ? navigator.language : void 0);
2237
+ let { conversations: m, status: h, error: g, hasMore: b, refresh: x, loadMore: ee, remove: S } = e, C = c(), w = c(), T = d(null), E = d(null), D = d(null), O = d(/* @__PURE__ */ new Map()), k = d(/* @__PURE__ */ new Map()), A = d(null), j = d(null), [te, ne] = f(null), [M, N] = f(null), [P, F] = f(0), [re, I] = f(!1), [L, R] = f(!1), [ie, ae] = f(!1), oe = u ?? (typeof navigator < "u" ? navigator.language : void 0);
2238
2238
  s(() => {
2239
2239
  T.current?.focus();
2240
2240
  }, []), s(() => {
@@ -2253,50 +2253,50 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2253
2253
  b,
2254
2254
  m
2255
2255
  ]);
2256
- let ce = () => {
2257
- j.current = m.length, S();
2258
- }, R = (e) => {
2256
+ let se = () => {
2257
+ j.current = m.length, ee();
2258
+ }, ce = (e) => {
2259
2259
  A.current = {
2260
2260
  kind: "delete",
2261
2261
  id: e
2262
2262
  }, ne(null);
2263
2263
  }, le = (e) => {
2264
- e.key === "Escape" && (e.stopPropagation(), te ? R(te) : o({ restoreFocusTo: "menu" }));
2264
+ e.key === "Escape" && (e.stopPropagation(), te ? ce(te) : o({ restoreFocusTo: "menu" }));
2265
2265
  }, ue = async (e) => {
2266
- if (oe(!1), e === t) o({ restoreFocusTo: "input" });
2266
+ if (ae(!1), e === t) o({ restoreFocusTo: "input" });
2267
2267
  else {
2268
- L(!0);
2268
+ R(!0);
2269
2269
  try {
2270
2270
  await r({ conversationId: e });
2271
2271
  } catch {
2272
2272
  A.current = {
2273
2273
  kind: "select",
2274
2274
  id: e
2275
- }, oe(!0), L(!1);
2275
+ }, ae(!0), R(!1);
2276
2276
  return;
2277
2277
  }
2278
- L(!1), o({ restoreFocusTo: "input" });
2278
+ R(!1), o({ restoreFocusTo: "input" });
2279
2279
  }
2280
2280
  }, de = async (e) => {
2281
2281
  let n = m.findIndex((t) => t.conversationId === e), r = m[n + 1] ?? m[n - 1];
2282
2282
  A.current = r ? {
2283
2283
  kind: "select",
2284
2284
  id: r.conversationId
2285
- } : { kind: "newChat" }, ne(null), N(null), I(!1), re((e) => e + 1);
2285
+ } : { kind: "newChat" }, ne(null), N(null), I(!1), F((e) => e + 1);
2286
2286
  try {
2287
- await C({ conversationId: e }), I(!0), e === t && i?.();
2287
+ await S({ conversationId: e }), I(!0), e === t && i?.();
2288
2288
  } catch {
2289
2289
  A.current = {
2290
2290
  kind: "delete",
2291
2291
  id: e
2292
2292
  }, N(e);
2293
2293
  } finally {
2294
- re((e) => e - 1);
2294
+ F((e) => e - 1);
2295
2295
  }
2296
- }, z = h === "loading" && m.length === 0, fe = h === "error" && m.length === 0, pe = h === "error" && m.length > 0 && b, B = h === "loading" && m.length > 0, me = ie || n === "loading", he = z ? l.historyLoadingText : P > 0 ? l.historyDeletingText : F ? l.historyDeletedText : m.length > 0 ? Dn(m.length === 1 ? l.historyCountTextOne : l.historyCountTextMany, { count: m.length }) : "", ge = z || P > 0;
2296
+ }, fe = h === "loading" && m.length === 0, pe = h === "error" && m.length === 0, me = h === "error" && m.length > 0 && b, z = h === "loading" && m.length > 0, he = L || n === "loading", B = fe ? l.historyLoadingText : P > 0 ? l.historyDeletingText : re ? l.historyDeletedText : m.length > 0 ? Dn(m.length === 1 ? l.historyCountTextOne : l.historyCountTextMany, { count: m.length }) : "", ge = fe || P > 0;
2297
2297
  return /* @__PURE__ */ y("section", {
2298
2298
  role: "region",
2299
- "aria-labelledby": ee,
2299
+ "aria-labelledby": C,
2300
2300
  className: "bailey-history-drawer",
2301
2301
  onKeyDown: le,
2302
2302
  children: [
@@ -2311,7 +2311,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2311
2311
  children: /* @__PURE__ */ v(Kt, { className: "bailey-history-icon" })
2312
2312
  }),
2313
2313
  /* @__PURE__ */ v("h3", {
2314
- id: ee,
2314
+ id: C,
2315
2315
  ref: T,
2316
2316
  tabIndex: -1,
2317
2317
  className: "bailey-history-heading",
@@ -2322,7 +2322,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2322
2322
  type: "button",
2323
2323
  className: "bailey-history-button bailey-history-new-chat",
2324
2324
  "aria-label": l.newChatButtonText,
2325
- disabled: z,
2325
+ disabled: fe,
2326
2326
  onClick: a,
2327
2327
  children: [/* @__PURE__ */ v(Vt, { className: "bailey-history-icon-small" }), /* @__PURE__ */ v("span", {
2328
2328
  className: "bailey-history-new-chat-text",
@@ -2333,9 +2333,9 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2333
2333
  }),
2334
2334
  /* @__PURE__ */ y("div", {
2335
2335
  className: "bailey-history-body",
2336
- "aria-busy": z || void 0,
2336
+ "aria-busy": fe || void 0,
2337
2337
  children: [
2338
- z && /* @__PURE__ */ y("div", {
2338
+ fe && /* @__PURE__ */ y("div", {
2339
2339
  "aria-hidden": "true",
2340
2340
  children: [
2341
2341
  /* @__PURE__ */ v("div", { className: "bailey-history-skeleton" }),
@@ -2344,7 +2344,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2344
2344
  /* @__PURE__ */ v("div", { className: "bailey-history-skeleton" })
2345
2345
  ]
2346
2346
  }),
2347
- fe && /* @__PURE__ */ y("div", {
2347
+ pe && /* @__PURE__ */ y("div", {
2348
2348
  role: "alert",
2349
2349
  className: "bailey-history-state bailey-history-state-error",
2350
2350
  children: [
@@ -2359,7 +2359,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2359
2359
  })
2360
2360
  ]
2361
2361
  }),
2362
- !z && !fe && m.length === 0 && /* @__PURE__ */ y("div", {
2362
+ !fe && !pe && m.length === 0 && /* @__PURE__ */ y("div", {
2363
2363
  className: "bailey-history-state",
2364
2364
  children: [
2365
2365
  /* @__PURE__ */ v(Rt, { className: "bailey-history-state-icon" }),
@@ -2403,7 +2403,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2403
2403
  ref: D,
2404
2404
  type: "button",
2405
2405
  className: "bailey-history-button",
2406
- onClick: () => R(n),
2406
+ onClick: () => ce(n),
2407
2407
  children: l.historyDeleteCancelText
2408
2408
  })
2409
2409
  ]
@@ -2411,7 +2411,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2411
2411
  }, n);
2412
2412
  let a = Tn({
2413
2413
  iso: e.updatedAt,
2414
- locale: se,
2414
+ locale: oe,
2415
2415
  now: p?.(),
2416
2416
  justNowText: l.historyJustNowText
2417
2417
  }), o = Dn(e.messageCount === 1 ? l.historyMessageCountOne : l.historyMessageCountMany, { count: e.messageCount }), s = M === n;
@@ -2425,9 +2425,9 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2425
2425
  },
2426
2426
  className: "bailey-history-select",
2427
2427
  "aria-current": i ? "true" : void 0,
2428
- "aria-disabled": me || void 0,
2428
+ "aria-disabled": he || void 0,
2429
2429
  onClick: () => {
2430
- me || ue(n);
2430
+ he || ue(n);
2431
2431
  },
2432
2432
  children: [/* @__PURE__ */ v("span", {
2433
2433
  className: "bailey-history-row-title",
@@ -2486,31 +2486,31 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2486
2486
  }, n);
2487
2487
  })
2488
2488
  }),
2489
- ae && /* @__PURE__ */ v("div", {
2489
+ ie && /* @__PURE__ */ v("div", {
2490
2490
  role: "alert",
2491
2491
  className: "bailey-history-inline-error",
2492
2492
  children: l.historySelectErrorText
2493
2493
  }),
2494
2494
  b && m.length > 0 && /* @__PURE__ */ v("div", {
2495
2495
  className: "bailey-history-more",
2496
- children: pe ? /* @__PURE__ */ y("div", {
2496
+ children: me ? /* @__PURE__ */ y("div", {
2497
2497
  role: "alert",
2498
2498
  className: "bailey-history-inline-error",
2499
2499
  children: [/* @__PURE__ */ v("span", { children: l.historyLoadMoreErrorText }), /* @__PURE__ */ v("button", {
2500
2500
  type: "button",
2501
2501
  className: "bailey-history-button",
2502
- onClick: ce,
2502
+ onClick: se,
2503
2503
  children: l.retryButtonText
2504
2504
  })]
2505
2505
  }) : /* @__PURE__ */ y("button", {
2506
2506
  type: "button",
2507
2507
  className: "bailey-history-button",
2508
- disabled: B,
2509
- onClick: ce,
2510
- children: [B && /* @__PURE__ */ v("span", {
2508
+ disabled: z,
2509
+ onClick: se,
2510
+ children: [z && /* @__PURE__ */ v("span", {
2511
2511
  className: "bailey-history-spinner",
2512
2512
  "aria-hidden": "true"
2513
- }), B ? l.historyLoadingMoreText : l.historyLoadMoreText]
2513
+ }), z ? l.historyLoadingMoreText : l.historyLoadMoreText]
2514
2514
  })
2515
2515
  })
2516
2516
  ]
@@ -2522,7 +2522,7 @@ function kn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
2522
2522
  children: [ge && /* @__PURE__ */ v("span", {
2523
2523
  className: "bailey-history-spinner",
2524
2524
  "aria-hidden": "true"
2525
- }), he]
2525
+ }), B]
2526
2526
  })
2527
2527
  ]
2528
2528
  });
@@ -2614,15 +2614,15 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2614
2614
  ...jn,
2615
2615
  feedbackCommentPlaceholder: `What should ${l} have said or done differently?`,
2616
2616
  ...o
2617
- }, m = In(i), h = Ln(a), b = r ? { rating: r } : null, [x, S] = f(b), [C, ee] = f(r ?? null), [w, T] = f(!1), [E, D] = f("down"), [O, k] = f([]), [A, j] = f(""), [te, ne] = f(!1), [M, N] = f(!1), [P, re] = f(!1), [F, I] = f(!1), ie = d(b), L = d(null), ae = d(0), oe = d(!1), se = d(!0), ce = d(null), R = d(null), le = d(null), ue = d(null), de = d(null), z = At(R), fe = c(), pe = `${fe}-comment`, B = `${fe}-counter`, me = `${fe}-privacy`;
2618
- s(() => (se.current = !0, () => {
2619
- se.current = !1;
2617
+ }, m = In(i), h = Ln(a), b = r ? { rating: r } : null, [x, ee] = f(b), [S, C] = f(r ?? null), [w, T] = f(!1), [E, D] = f("down"), [O, k] = f([]), [A, j] = f(""), [te, ne] = f(!1), [M, N] = f(!1), [P, F] = f(!1), [re, I] = f(!1), L = d(b), R = d(null), ie = d(0), ae = d(!1), oe = d(!0), se = d(null), ce = d(null), le = d(null), ue = d(null), de = d(null), fe = At(ce), pe = c(), me = `${pe}-comment`, z = `${pe}-counter`, he = `${pe}-privacy`;
2618
+ s(() => (oe.current = !0, () => {
2619
+ oe.current = !1;
2620
2620
  }), []), s(() => {
2621
2621
  w && de.current?.focus();
2622
2622
  }, [w]), s(() => {
2623
- ce.current && !P && !w && ((ce.current === "up" ? le : ue).current?.focus(), ce.current = null);
2623
+ se.current && !P && !w && ((se.current === "up" ? le : ue).current?.focus(), se.current = null);
2624
2624
  });
2625
- let he = () => {
2625
+ let B = () => {
2626
2626
  k([]), j("");
2627
2627
  }, ge = async (r) => {
2628
2628
  try {
@@ -2634,54 +2634,54 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2634
2634
  return !1;
2635
2635
  }
2636
2636
  }, _e = async () => {
2637
- if (!oe.current) {
2638
- oe.current = !0, N(!0);
2637
+ if (!ae.current) {
2638
+ ae.current = !0, N(!0);
2639
2639
  try {
2640
- for (; L.current && se.current;) {
2641
- let e = L.current, t = e.kind === "clear" ? null : e.snapshot, n = !(e.kind === "submit" && e.formSubmit) && Rn(t, ie.current) || await ge(e);
2642
- if (!se.current) return;
2643
- let r = L.current?.version !== e.version;
2644
- (n || !r) && (n ? (ie.current = t, S(t)) : (ee(ie.current?.rating ?? null), I(!0)), r || (L.current = null, re(!1), n && e.kind === "submit" && e.formSubmit && (T(!1), ne(!0), ce.current = e.snapshot.rating)));
2640
+ for (; R.current && oe.current;) {
2641
+ let e = R.current, t = e.kind === "clear" ? null : e.snapshot, n = !(e.kind === "submit" && e.formSubmit) && Rn(t, L.current) || await ge(e);
2642
+ if (!oe.current) return;
2643
+ let r = R.current?.version !== e.version;
2644
+ (n || !r) && (n ? (L.current = t, ee(t)) : (C(L.current?.rating ?? null), I(!0)), r || (R.current = null, F(!1), n && e.kind === "submit" && e.formSubmit && (T(!1), ne(!0), se.current = e.snapshot.rating)));
2645
2645
  }
2646
2646
  } finally {
2647
- oe.current = !1, se.current && N(!1);
2647
+ ae.current = !1, oe.current && N(!1);
2648
2648
  }
2649
2649
  }
2650
2650
  }, ve = (e) => {
2651
- ae.current += 1, L.current = {
2651
+ ie.current += 1, R.current = {
2652
2652
  ...e,
2653
- version: ae.current
2653
+ version: ie.current
2654
2654
  }, I(!1), _e();
2655
2655
  }, ye = () => {
2656
- ee(null), T(!1), ne(!1), he(), ve({ kind: "clear" });
2656
+ C(null), T(!1), ne(!1), B(), ve({ kind: "clear" });
2657
2657
  }, be = (e) => {
2658
- P || (C === e ? ye() : (ee(e), ne(!1), he(), e === "down" ? (D("down"), T(!0)) : T(!1), ve({
2658
+ P || (S === e ? ye() : (C(e), ne(!1), B(), e === "down" ? (D("down"), T(!0)) : T(!1), ve({
2659
2659
  kind: "submit",
2660
2660
  snapshot: { rating: e },
2661
2661
  formSubmit: !1
2662
2662
  })));
2663
- }, V = (e) => {
2664
- C !== null && (D(C), k((e?.reasonCodes ?? []).map(Fn)), j(e?.comment ?? ""), I(!1), T(!0));
2665
- }, H = () => {
2666
- P || (T(!1), I(!1), he(), ce.current = E);
2667
- }, xe = () => {
2663
+ }, xe = (e) => {
2664
+ S !== null && (D(S), k((e?.reasonCodes ?? []).map(Fn)), j(e?.comment ?? ""), I(!1), T(!0));
2665
+ }, V = () => {
2666
+ P || (T(!1), I(!1), B(), se.current = E);
2667
+ }, Se = () => {
2668
2668
  if (P) return;
2669
2669
  let e = A.trim(), t = m.filter((e) => O.includes(e)), n = {
2670
2670
  rating: E,
2671
2671
  ...t.length > 0 ? { reasonCodes: t } : {},
2672
2672
  ...e ? { comment: e } : {}
2673
2673
  };
2674
- re(!0), ee(E), ve({
2674
+ F(!0), C(E), ve({
2675
2675
  kind: "submit",
2676
2676
  snapshot: n,
2677
2677
  formSubmit: !0
2678
2678
  });
2679
- }, U = (e) => {
2679
+ }, Ce = (e) => {
2680
2680
  k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
2681
- }, W = (e) => {
2682
- e.key === "Escape" && (e.stopPropagation(), H());
2683
- }, G = C !== null && x?.rating === C && !M && !w, K = !!x && (!!x.comment || (x.reasonCodes?.length ?? 0) > 0), Se = M ? p.feedbackSavingText : G ? p.feedbackThanksText : "", Ce = (e) => {
2684
- let t = C === e, n = e === "up" ? p.feedbackThumbsUpAriaLabel : p.feedbackThumbsDownAriaLabel, r = e === "up" ? Wt : Gt;
2681
+ }, H = (e) => {
2682
+ e.key === "Escape" && (e.stopPropagation(), V());
2683
+ }, U = S !== null && x?.rating === S && !M && !w, W = !!x && (!!x.comment || (x.reasonCodes?.length ?? 0) > 0), we = M ? p.feedbackSavingText : U ? p.feedbackThanksText : "", Te = (e) => {
2684
+ let t = S === e, n = e === "up" ? p.feedbackThumbsUpAriaLabel : p.feedbackThumbsDownAriaLabel, r = e === "up" ? Wt : Gt;
2685
2685
  return /* @__PURE__ */ y(g.Root, { children: [/* @__PURE__ */ v(g.Trigger, {
2686
2686
  asChild: !0,
2687
2687
  children: /* @__PURE__ */ v("button", {
@@ -2699,7 +2699,7 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2699
2699
  })
2700
2700
  })
2701
2701
  }), /* @__PURE__ */ v(g.Portal, {
2702
- container: z instanceof ShadowRoot ? z : void 0,
2702
+ container: fe instanceof ShadowRoot ? fe : void 0,
2703
2703
  children: /* @__PURE__ */ y(g.Content, {
2704
2704
  side: "top",
2705
2705
  className: "bailey-tooltip-content",
@@ -2708,7 +2708,7 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2708
2708
  })] });
2709
2709
  };
2710
2710
  return /* @__PURE__ */ y("div", {
2711
- ref: R,
2711
+ ref: ce,
2712
2712
  className: `bailey-feedback${u ? ` ${u}` : ""}`,
2713
2713
  children: [
2714
2714
  /* @__PURE__ */ v(g.Provider, {
@@ -2718,7 +2718,7 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2718
2718
  "aria-label": p.feedbackGroupLabel,
2719
2719
  "aria-busy": M ? !0 : void 0,
2720
2720
  className: "bailey-feedback-thumbs",
2721
- children: [Ce("up"), Ce("down")]
2721
+ children: [Te("up"), Te("down")]
2722
2722
  })
2723
2723
  }),
2724
2724
  /* @__PURE__ */ y("span", {
@@ -2727,27 +2727,27 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2727
2727
  children: [M && /* @__PURE__ */ v("span", {
2728
2728
  className: "bailey-feedback-spinner",
2729
2729
  "aria-hidden": "true"
2730
- }), Se]
2730
+ }), we]
2731
2731
  }),
2732
- G && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
2732
+ U && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
2733
2733
  type: "button",
2734
2734
  className: "bailey-feedback-link",
2735
- onClick: () => V(x),
2736
- children: te || K ? p.feedbackEditText : p.feedbackAddCommentText
2735
+ onClick: () => xe(x),
2736
+ children: te || W ? p.feedbackEditText : p.feedbackAddCommentText
2737
2737
  }), /* @__PURE__ */ v("button", {
2738
2738
  type: "button",
2739
2739
  className: "bailey-feedback-link",
2740
2740
  onClick: ye,
2741
2741
  children: p.feedbackUndoText
2742
2742
  })] }),
2743
- F && /* @__PURE__ */ v("span", {
2743
+ re && /* @__PURE__ */ v("span", {
2744
2744
  role: "alert",
2745
2745
  className: "bailey-feedback-error",
2746
2746
  children: p.feedbackErrorText
2747
2747
  }),
2748
2748
  w && /* @__PURE__ */ y("div", {
2749
2749
  className: "bailey-feedback-form",
2750
- onKeyDown: W,
2750
+ onKeyDown: H,
2751
2751
  children: [
2752
2752
  m.length > 0 && /* @__PURE__ */ y("fieldset", {
2753
2753
  className: "bailey-feedback-reasons",
@@ -2764,18 +2764,18 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2764
2764
  className: "bailey-feedback-chip",
2765
2765
  "aria-pressed": O.includes(e),
2766
2766
  disabled: P,
2767
- onClick: () => U(e),
2767
+ onClick: () => Ce(e),
2768
2768
  children: p[Pn[e]]
2769
2769
  }, e))
2770
2770
  })]
2771
2771
  }),
2772
2772
  /* @__PURE__ */ v("label", {
2773
- htmlFor: pe,
2773
+ htmlFor: me,
2774
2774
  className: "bailey-feedback-legend",
2775
2775
  children: p.feedbackCommentLabel
2776
2776
  }),
2777
2777
  /* @__PURE__ */ v("textarea", {
2778
- id: pe,
2778
+ id: me,
2779
2779
  ref: m.length === 0 ? (e) => {
2780
2780
  de.current = e;
2781
2781
  } : void 0,
@@ -2783,18 +2783,18 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2783
2783
  value: A,
2784
2784
  maxLength: h,
2785
2785
  placeholder: p.feedbackCommentPlaceholder,
2786
- "aria-describedby": `${B} ${me}`,
2786
+ "aria-describedby": `${z} ${he}`,
2787
2787
  disabled: P,
2788
2788
  onChange: (e) => j(e.target.value.slice(0, h))
2789
2789
  }),
2790
2790
  /* @__PURE__ */ y("div", {
2791
2791
  className: "bailey-feedback-meta",
2792
2792
  children: [/* @__PURE__ */ v("span", {
2793
- id: me,
2793
+ id: he,
2794
2794
  className: "bailey-feedback-privacy",
2795
2795
  children: p.feedbackPrivacyNote
2796
2796
  }), /* @__PURE__ */ v("span", {
2797
- id: B,
2797
+ id: z,
2798
2798
  className: "bailey-feedback-counter",
2799
2799
  children: `${A.length} / ${h}`
2800
2800
  })]
@@ -2805,13 +2805,13 @@ function Bn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
2805
2805
  type: "button",
2806
2806
  className: "bailey-feedback-button",
2807
2807
  disabled: P,
2808
- onClick: H,
2808
+ onClick: V,
2809
2809
  children: p.feedbackCancelText
2810
2810
  }), /* @__PURE__ */ v("button", {
2811
2811
  type: "button",
2812
2812
  className: "bailey-feedback-button bailey-feedback-button-primary",
2813
2813
  disabled: P,
2814
- onClick: xe,
2814
+ onClick: Se,
2815
2815
  children: P ? p.feedbackSavingText : p.feedbackSubmitText
2816
2816
  })]
2817
2817
  })
@@ -2877,91 +2877,95 @@ function Jn(e) {
2877
2877
  });
2878
2878
  return n ? `Today ${r}` : `${t.toLocaleDateString()} ${r}`;
2879
2879
  }
2880
- function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i, assistantName: o = Vn, suggestions: c, suggestionsAlign: l = "start", hideMenuButton: m = !1, onHistoryClick: _, history: b, locale: x, privacyNote: S, resolveActivityIcon: C, sendIcon: ee, className: w, height: T, width: E, hideDeveloperDetails: D = !1, renderMessageActions: O, feedback: k, renderTable: A, renderChart: j, renderMcpApp: te, labels: ne, formatMessageTime: M }) {
2881
- let { messages: N, traceEvents: P, lastRequest: re, status: F, error: I, send: ie, stop: L, retryLast: ae, clearTrace: oe, clearError: se, newChat: ce } = e, [R, le] = f(""), [ue, de] = f(/* @__PURE__ */ new Map()), z = a((e) => {
2882
- let t = (t) => de((n) => {
2880
+ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i, assistantName: o = Vn, suggestions: c, suggestionsAlign: l = "start", hideMenuButton: m = !1, onHistoryClick: _, history: b, historyOpen: x, onHistoryOpenChange: ee, locale: S, privacyNote: C, resolveActivityIcon: w, sendIcon: T, className: E, height: D, width: O, hideDeveloperDetails: k = !1, renderMessageActions: A, feedback: j, renderTable: te, renderChart: ne, renderMcpApp: M, labels: N, formatMessageTime: P }) {
2881
+ let { messages: F, traceEvents: re, lastRequest: I, status: L, error: R, send: ie, stop: ae, retryLast: oe, clearTrace: se, clearError: ce, newChat: le } = e, [ue, de] = f(""), [fe, pe] = f(/* @__PURE__ */ new Map()), me = a((e) => {
2882
+ let t = (t) => pe((n) => {
2883
2883
  let r = new Map(n), i = (r.get(e) ?? 0) + t;
2884
2884
  return i > 0 ? r.set(e, i) : r.delete(e), r;
2885
2885
  });
2886
2886
  return t(1), () => t(-1);
2887
- }, []), fe = u(() => ({
2887
+ }, []), z = u(() => ({
2888
2888
  builtIn: !1,
2889
- claim: z
2890
- }), [z]), pe = u(() => ({
2889
+ claim: me
2890
+ }), [me]), he = u(() => ({
2891
2891
  builtIn: !0,
2892
- claim: z
2893
- }), [z]), B = {
2892
+ claim: me
2893
+ }), [me]), B = {
2894
2894
  ...Hn,
2895
2895
  emptyStateMessage: `Ask ${o} a question to get started.`,
2896
- ...ne
2897
- }, me = M ?? Jn, he = d(null), ge = d(null), _e = d(null), ve = d(null), [ye, be] = f(!1), V = d(null), H = d(!1), xe = !!_ || !!b, U = kt(he), W = d(null), G = d(null), K = d(!0), Se = u(() => Mt({
2898
- renderTable: A,
2899
- renderChart: j
2900
- }), [A, j]), Ce = u(() => Kn(F, P, re), [
2901
- F,
2902
- P,
2903
- re
2904
- ]), we = qn(Ce), Te = Ce?.kind === "tool_end" ? Ce.at : void 0, q = N[N.length - 1]?.content.length ?? 0, [Ee, De] = f(null), J = Ee;
2905
- Te !== void 0 && Ee?.at !== Te && (J = {
2906
- at: Te,
2907
- length: q
2908
- }, De(J));
2909
- let Y = Te !== void 0 && J?.at === Te && q <= J.length, X = we ?? (Y ? B.thinkingHint : void 0), Oe = N.length === 0, Z = t ?? (Oe ? i ?? `How can ${o} AI help you today?` : r ?? `Reply to ${o} AI`);
2896
+ ...N
2897
+ }, ge = P ?? Jn, _e = d(null), ve = d(null), ye = d(null), be = d(null), [xe, V] = f(!1), Se = x !== void 0, Ce = x ?? xe, H = d(null), U = d(!1), W = !!_ || !!b, we = kt(_e), Te = d(null), Ee = d(null), De = d(!0), Oe = u(() => Mt({
2898
+ renderTable: te,
2899
+ renderChart: ne
2900
+ }), [te, ne]), ke = u(() => Kn(L, re, I), [
2901
+ L,
2902
+ re,
2903
+ I
2904
+ ]), Ae = qn(ke), G = ke?.kind === "tool_end" ? ke.at : void 0, K = F[F.length - 1]?.content.length ?? 0, [q, je] = f(null), J = q;
2905
+ G !== void 0 && q?.at !== G && (J = {
2906
+ at: G,
2907
+ length: K
2908
+ }, je(J));
2909
+ let Me = G !== void 0 && J?.at === G && K <= J.length, Ne = Ae ?? (Me ? B.thinkingHint : void 0), Y = F.length === 0, X = t ?? (Y ? i ?? `How can ${o} AI help you today?` : r ?? `Reply to ${o} AI`);
2910
2910
  s(() => {
2911
- let e = G.current;
2911
+ let e = Ee.current;
2912
2912
  if (!e) return;
2913
2913
  let t = () => {
2914
2914
  let t = e.scrollHeight - e.scrollTop - e.clientHeight;
2915
- K.current = t < 60;
2915
+ De.current = t < 60;
2916
2916
  };
2917
2917
  return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
2918
2918
  }, []), s(() => {
2919
- K.current && W.current?.scrollIntoView({
2920
- behavior: F === "streaming" ? "auto" : "smooth",
2919
+ De.current && Te.current?.scrollIntoView({
2920
+ behavior: L === "streaming" ? "auto" : "smooth",
2921
2921
  block: "nearest"
2922
2922
  });
2923
- }, [N, F]);
2924
- let ke = (e) => {
2925
- K.current = !0, ie(e);
2926
- }, Ae = d(null), je = () => {
2927
- let t = G.current;
2928
- K.current = !1, Ae.current = t ? {
2923
+ }, [F, L]);
2924
+ let Pe = (e) => {
2925
+ De.current = !0, ie(e);
2926
+ }, Z = d(null), Fe = () => {
2927
+ let t = Ee.current;
2928
+ De.current = !1, Z.current = t ? {
2929
2929
  height: t.scrollHeight,
2930
2930
  top: t.scrollTop
2931
2931
  } : null, e.loadEarlier?.().catch(() => {
2932
- Ae.current = null;
2932
+ Z.current = null;
2933
2933
  });
2934
2934
  };
2935
2935
  s(() => {
2936
- let e = Ae.current, t = G.current;
2937
- e && t && t.scrollHeight !== e.height && (t.scrollTop = e.top + (t.scrollHeight - e.height), Ae.current = null);
2938
- }, [N]), s(() => {
2939
- ge.current?.toggleAttribute("inert", ye);
2940
- }, [ye]), s(() => {
2941
- !ye && V.current && ((V.current === "input" ? _e.current : ve.current)?.focus(), V.current = null);
2942
- }, [ye]);
2943
- let Q = a((e) => {
2944
- V.current = e.restoreFocusTo, be(!1);
2945
- }, []);
2936
+ let e = Z.current, t = Ee.current;
2937
+ e && t && t.scrollHeight !== e.height && (t.scrollTop = e.top + (t.scrollHeight - e.height), Z.current = null);
2938
+ }, [F]);
2939
+ let Q = Ce && !!b && !_;
2940
+ s(() => {
2941
+ ve.current?.toggleAttribute("inert", Q);
2942
+ }, [Q]), s(() => {
2943
+ !Q && H.current && (((H.current === "menu" ? be.current : null) ?? ye.current)?.focus(), H.current = null);
2944
+ }, [Q]);
2945
+ let $ = a((e) => {
2946
+ Se || V(e), ee?.(e);
2947
+ }, [Se, ee]), Ie = a((e) => {
2948
+ H.current = e.restoreFocusTo, $(!1);
2949
+ }, [$]);
2946
2950
  return /* @__PURE__ */ v(gt.Provider, {
2947
- value: U,
2951
+ value: we,
2948
2952
  children: /* @__PURE__ */ v(jt.Provider, {
2949
- value: fe,
2953
+ value: z,
2950
2954
  children: /* @__PURE__ */ y("div", {
2951
- ref: he,
2952
- className: `bailey-chat-panel${w ? ` ${w}` : ""}`,
2953
- style: T !== void 0 || E !== void 0 ? {
2954
- height: T,
2955
- width: E
2955
+ ref: _e,
2956
+ className: `bailey-chat-panel${E ? ` ${E}` : ""}`,
2957
+ style: D !== void 0 || O !== void 0 ? {
2958
+ height: D,
2959
+ width: O
2956
2960
  } : void 0,
2957
2961
  children: [/* @__PURE__ */ y("div", {
2958
2962
  className: "bailey-chat-panel-inner",
2959
- ref: ge,
2963
+ ref: ve,
2960
2964
  children: [
2961
2965
  /* @__PURE__ */ y("div", {
2962
2966
  className: "bailey-chat-transcript",
2963
- ref: G,
2964
- "data-suggestions-align": Oe && c && c.length > 0 ? l : void 0,
2967
+ ref: Ee,
2968
+ "data-suggestions-align": Y && c && c.length > 0 ? l : void 0,
2965
2969
  children: [
2966
2970
  e.hasEarlier && e.loadEarlier && /* @__PURE__ */ y("div", {
2967
2971
  className: "bailey-load-earlier",
@@ -2969,7 +2973,7 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
2969
2973
  type: "button",
2970
2974
  className: "bailey-load-earlier-button",
2971
2975
  disabled: e.historyStatus === "loading",
2972
- onClick: je,
2976
+ onClick: Fe,
2973
2977
  children: B.loadEarlierButtonText
2974
2978
  }), e.historyStatus === "error" && /* @__PURE__ */ v("div", {
2975
2979
  role: "alert",
@@ -2977,7 +2981,7 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
2977
2981
  children: B.loadEarlierErrorText
2978
2982
  })]
2979
2983
  }),
2980
- Oe && (c && c.length > 0 ? /* @__PURE__ */ y("div", {
2984
+ Y && (c && c.length > 0 ? /* @__PURE__ */ y("div", {
2981
2985
  className: "bailey-suggestions",
2982
2986
  "data-align": l,
2983
2987
  children: [B.suggestionsTitle && /* @__PURE__ */ v("div", {
@@ -2985,7 +2989,7 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
2985
2989
  children: B.suggestionsTitle
2986
2990
  }), c.map((e, t) => /* @__PURE__ */ y("button", {
2987
2991
  type: "button",
2988
- onClick: () => ke(e.value ?? e.label),
2992
+ onClick: () => Pe(e.value ?? e.label),
2989
2993
  className: "bailey-suggestion-card",
2990
2994
  children: [/* @__PURE__ */ v("span", { children: e.label }), e.icon ?? /* @__PURE__ */ v(Ft, { className: "bailey-suggestion-icon" })]
2991
2995
  }, `${e.label}-${t}`))]
@@ -2993,8 +2997,8 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
2993
2997
  className: "bailey-empty-state",
2994
2998
  children: B.emptyStateMessage
2995
2999
  })),
2996
- N.map((t, r) => {
2997
- let i = t.role === "assistant" && r === N.length - 1, a = F === "streaming" && i && t.content === "", s = t.role === "assistant" ? mt(P, t.createdAt) : [], c = s.some((e) => e.status === "running");
3000
+ F.map((t, r) => {
3001
+ let i = t.role === "assistant" && r === F.length - 1, a = L === "streaming" && i && t.content === "", s = t.role === "assistant" ? mt(re, t.createdAt) : [], c = s.some((e) => e.status === "running");
2998
3002
  return /* @__PURE__ */ v("div", {
2999
3003
  className: t.role === "user" ? "bailey-message-row bailey-message-row-user" : "bailey-message-row",
3000
3004
  children: t.role === "user" ? /* @__PURE__ */ y("div", {
@@ -3004,17 +3008,17 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3004
3008
  children: [/* @__PURE__ */ v("span", {
3005
3009
  className: "bailey-message-meta-name",
3006
3010
  children: B.youLabel
3007
- }), t.createdAt !== void 0 && /* @__PURE__ */ v("span", { children: me(t.createdAt) })]
3011
+ }), t.createdAt !== void 0 && /* @__PURE__ */ v("span", { children: ge(t.createdAt) })]
3008
3012
  }), /* @__PURE__ */ v("div", {
3009
3013
  className: "bailey-user-bubble",
3010
3014
  children: t.content
3011
3015
  })]
3012
3016
  }) : a ? c ? /* @__PURE__ */ v(_n, {
3013
3017
  steps: s,
3014
- resolveActivityIcon: C
3018
+ resolveActivityIcon: w
3015
3019
  }) : /* @__PURE__ */ y("div", {
3016
3020
  className: "bailey-thinking-hint",
3017
- children: [/* @__PURE__ */ v("span", { children: we ?? B.thinkingHint }), /* @__PURE__ */ v("span", {
3021
+ children: [/* @__PURE__ */ v("span", { children: Ae ?? B.thinkingHint }), /* @__PURE__ */ v("span", {
3018
3022
  className: "bailey-step-spinner",
3019
3023
  "aria-hidden": "true"
3020
3024
  })]
@@ -3024,26 +3028,26 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3024
3028
  !t.streaming && /* @__PURE__ */ v(vn, {
3025
3029
  steps: s,
3026
3030
  labels: B,
3027
- resolveActivityIcon: C
3031
+ resolveActivityIcon: w
3028
3032
  }),
3029
3033
  /* @__PURE__ */ v(Gn, {
3030
3034
  content: t.content,
3031
- components: Se
3035
+ components: Oe
3032
3036
  }),
3033
3037
  t.parts?.map((e, t) => e.type === "image" ? /* @__PURE__ */ v(sn, {
3034
3038
  src: e.src,
3035
3039
  alt: e.alt
3036
- }, t) : e.type === "mcp_app" ? /* @__PURE__ */ v(n, { children: te ? te(e) : /* @__PURE__ */ v(mn, {
3040
+ }, t) : e.type === "mcp_app" ? /* @__PURE__ */ v(n, { children: M ? M(e) : /* @__PURE__ */ v(mn, {
3037
3041
  ...e,
3038
3042
  title: e.title ?? B.mcpAppDefaultTitle
3039
3043
  }) }, t) : null),
3040
3044
  t.streaming && /* @__PURE__ */ v(_n, {
3041
3045
  steps: s,
3042
- resolveActivityIcon: C
3046
+ resolveActivityIcon: w
3043
3047
  }),
3044
- t.streaming && X && !c && /* @__PURE__ */ y("div", {
3048
+ t.streaming && Ne && !c && /* @__PURE__ */ y("div", {
3045
3049
  className: "bailey-streaming-hint",
3046
- children: [/* @__PURE__ */ v("span", { children: X }), /* @__PURE__ */ v("span", {
3050
+ children: [/* @__PURE__ */ v("span", { children: Ne }), /* @__PURE__ */ v("span", {
3047
3051
  className: "bailey-step-spinner",
3048
3052
  "aria-hidden": "true"
3049
3053
  })]
@@ -3057,10 +3061,10 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3057
3061
  tooltipDefaultText: B.copyButtonTooltipDefault,
3058
3062
  tooltipCopiedText: B.copyButtonTooltipCopied
3059
3063
  }),
3060
- k !== !1 && e.feedback && e.conversationId && t.serverMessageId && !ue.has(t.serverMessageId) && /* @__PURE__ */ v(jt.Provider, {
3061
- value: pe,
3064
+ j !== !1 && e.feedback && e.conversationId && t.serverMessageId && !fe.has(t.serverMessageId) && /* @__PURE__ */ v(jt.Provider, {
3065
+ value: he,
3062
3066
  children: /* @__PURE__ */ v(zn, {
3063
- ...k,
3067
+ ...j,
3064
3068
  assistantName: o,
3065
3069
  messageId: t.serverMessageId,
3066
3070
  initialRating: t.feedback?.rating,
@@ -3068,69 +3072,69 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3068
3072
  onClear: e.feedback.onClear
3069
3073
  })
3070
3074
  }),
3071
- O?.(t)
3075
+ A?.(t)
3072
3076
  ]
3073
3077
  })
3074
3078
  ]
3075
3079
  })
3076
3080
  }, t.id);
3077
3081
  }),
3078
- /* @__PURE__ */ v("div", { ref: W })
3082
+ /* @__PURE__ */ v("div", { ref: Te })
3079
3083
  ]
3080
3084
  }),
3081
- I && /* @__PURE__ */ y("div", {
3085
+ R && /* @__PURE__ */ y("div", {
3082
3086
  className: "bailey-error-banner",
3083
3087
  role: "alert",
3084
- children: [/* @__PURE__ */ v("span", { children: I }), /* @__PURE__ */ y("div", {
3088
+ children: [/* @__PURE__ */ v("span", { children: R }), /* @__PURE__ */ y("div", {
3085
3089
  className: "bailey-error-actions",
3086
3090
  children: [/* @__PURE__ */ v("button", {
3087
3091
  type: "button",
3088
- onClick: ae,
3092
+ onClick: oe,
3089
3093
  className: "bailey-retry-button",
3090
3094
  children: B.retryButtonText
3091
3095
  }), /* @__PURE__ */ v("button", {
3092
3096
  type: "button",
3093
- onClick: se,
3097
+ onClick: ce,
3094
3098
  "aria-label": B.dismissErrorAriaLabel,
3095
3099
  className: "bailey-dismiss-button",
3096
3100
  children: "✕"
3097
3101
  })]
3098
3102
  })]
3099
3103
  }),
3100
- !D && /* @__PURE__ */ v(on, {
3101
- events: P,
3102
- lastRequest: re,
3103
- onClear: oe
3104
+ !k && /* @__PURE__ */ v(on, {
3105
+ events: re,
3106
+ lastRequest: I,
3107
+ onClear: se
3104
3108
  }),
3105
3109
  /* @__PURE__ */ y("div", {
3106
3110
  className: "bailey-input-area",
3107
3111
  children: [/* @__PURE__ */ y("form", {
3108
3112
  onSubmit: (e) => {
3109
- e.preventDefault(), R.trim() && F !== "streaming" && (ke(R), le(""));
3113
+ e.preventDefault(), ue.trim() && L !== "streaming" && (Pe(ue), de(""));
3110
3114
  },
3111
3115
  className: "bailey-input-row",
3112
3116
  children: [/* @__PURE__ */ v("input", {
3113
- ref: _e,
3117
+ ref: ye,
3114
3118
  type: "text",
3115
- placeholder: Z,
3116
- "aria-label": Z,
3117
- value: R,
3118
- onChange: (e) => le(e.target.value),
3119
- disabled: F === "streaming",
3119
+ placeholder: X,
3120
+ "aria-label": X,
3121
+ value: ue,
3122
+ onChange: (e) => de(e.target.value),
3123
+ disabled: L === "streaming",
3120
3124
  className: "bailey-input"
3121
- }), F === "streaming" ? /* @__PURE__ */ v(g.Provider, {
3125
+ }), L === "streaming" ? /* @__PURE__ */ v(g.Provider, {
3122
3126
  delayDuration: 200,
3123
3127
  children: /* @__PURE__ */ y(g.Root, { children: [/* @__PURE__ */ v(g.Trigger, {
3124
3128
  asChild: !0,
3125
3129
  children: /* @__PURE__ */ v("button", {
3126
3130
  type: "button",
3127
- onClick: L,
3131
+ onClick: ae,
3128
3132
  "aria-label": B.stopAriaLabel,
3129
3133
  className: "bailey-stop-button",
3130
3134
  children: /* @__PURE__ */ v(Pt, { className: "bailey-stop-icon" })
3131
3135
  })
3132
3136
  }), /* @__PURE__ */ v(g.Portal, {
3133
- container: U instanceof ShadowRoot ? U : void 0,
3137
+ container: we instanceof ShadowRoot ? we : void 0,
3134
3138
  children: /* @__PURE__ */ y(g.Content, {
3135
3139
  side: "top",
3136
3140
  className: "bailey-tooltip-content",
@@ -3140,36 +3144,36 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3140
3144
  }) : /* @__PURE__ */ v("button", {
3141
3145
  type: "submit",
3142
3146
  "aria-label": B.sendAriaLabel,
3143
- disabled: !R.trim(),
3147
+ disabled: !ue.trim(),
3144
3148
  className: "bailey-send-button",
3145
- children: ee ?? /* @__PURE__ */ v(Nt, { className: "bailey-send-icon" })
3149
+ children: T ?? /* @__PURE__ */ v(Nt, { className: "bailey-send-icon" })
3146
3150
  })]
3147
- }), !m && (!Oe || xe) && /* @__PURE__ */ y(h.Root, { children: [/* @__PURE__ */ v(h.Trigger, {
3151
+ }), !m && (!Y || W) && /* @__PURE__ */ y(h.Root, { children: [/* @__PURE__ */ v(h.Trigger, {
3148
3152
  asChild: !0,
3149
3153
  children: /* @__PURE__ */ v("button", {
3150
3154
  type: "button",
3151
- ref: ve,
3155
+ ref: be,
3152
3156
  "aria-label": B.menuAriaLabel,
3153
3157
  className: "bailey-menu-button",
3154
3158
  children: /* @__PURE__ */ v(Bt, { className: "bailey-menu-icon" })
3155
3159
  })
3156
3160
  }), /* @__PURE__ */ v(h.Portal, {
3157
- container: U instanceof ShadowRoot ? U : void 0,
3161
+ container: we instanceof ShadowRoot ? we : void 0,
3158
3162
  children: /* @__PURE__ */ y(h.Content, {
3159
3163
  side: "top",
3160
3164
  align: "end",
3161
3165
  sideOffset: 8,
3162
3166
  className: "bailey-menu-content",
3163
3167
  onCloseAutoFocus: (e) => {
3164
- H.current &&= (e.preventDefault(), !1);
3168
+ U.current &&= (e.preventDefault(), !1);
3165
3169
  },
3166
- children: [!Oe && /* @__PURE__ */ y(h.Item, {
3167
- onSelect: () => ce(),
3170
+ children: [!Y && /* @__PURE__ */ y(h.Item, {
3171
+ onSelect: () => le(),
3168
3172
  className: "bailey-menu-item",
3169
3173
  children: [/* @__PURE__ */ v(Vt, { className: "bailey-menu-item-icon" }), B.newChatButtonText]
3170
- }), xe && /* @__PURE__ */ y(h.Item, {
3174
+ }), W && /* @__PURE__ */ y(h.Item, {
3171
3175
  onSelect: () => {
3172
- _ ? _() : (H.current = !0, be(!0));
3176
+ _ ? _() : (U.current = !0, $(!0));
3173
3177
  },
3174
3178
  className: "bailey-menu-item",
3175
3179
  children: [/* @__PURE__ */ v(Rt, { className: "bailey-menu-item-icon" }), B.historyMenuItemText]
@@ -3177,23 +3181,23 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3177
3181
  })
3178
3182
  })] })]
3179
3183
  }),
3180
- (Oe || S?.alwaysVisible) && S && /* @__PURE__ */ v("div", {
3184
+ (Y || C?.alwaysVisible) && C && /* @__PURE__ */ v("div", {
3181
3185
  className: "bailey-privacy-note",
3182
3186
  children: /* @__PURE__ */ v(p, {
3183
3187
  remarkPlugins: Un,
3184
3188
  components: Wn,
3185
3189
  skipHtml: !0,
3186
- children: S.markdown
3190
+ children: C.markdown
3187
3191
  })
3188
3192
  })
3189
3193
  ]
3190
- }), ye && b && !_ && /* @__PURE__ */ v(En, {
3194
+ }), Q && /* @__PURE__ */ v(En, {
3191
3195
  client: b.client,
3192
3196
  pageSize: b.pageSize,
3193
3197
  chat: e,
3194
3198
  labels: B,
3195
- locale: x,
3196
- onClose: Q
3199
+ locale: S,
3200
+ onClose: Ie
3197
3201
  })]
3198
3202
  })
3199
3203
  })
@@ -3201,4 +3205,4 @@ function Yn({ chat: e, placeholder: t, replyPlaceholder: r, emptyPlaceholder: i,
3201
3205
  }
3202
3206
  // src/index.ts
3203
3207
  var Xn = "0.3.1-pre.2";
3204
- export { zt as ActivityIcon, Ft as ArrowUpRightIcon, Xn as BAILEYAI_CHAT_UI_VERSION, We as BAILEY_CHART_PROMPT_FRAGMENT, Ie as BAILEY_TABLE_GRID_ROW_THRESHOLD, j as BaileyApiError, Yn as BaileyChatPanel, M as BaileyCleanupError, zn as BaileyFeedbackButtons, En as BaileyHistoryDrawer, on as BaileyTracePanel, Xt as CopyMarkdownButton, oe as DEFAULT_CONVERSATION_STORAGE_KEY, Nt as HeartIcon, Qe as TRACE_KIND_LABEL, Gt as ThumbDownIcon, Wt as ThumbUpIcon, Me as createBaileyClient, ae as createBaileyFeedbackHandlers, Mt as createBaileyMarkdownComponents, ce as createMemoryConversationStorage, se as createSessionConversationStorage, O as extractPseudoToolCalls, He as extractTableData, Tn as formatRelativeTime, ct as formatTraceGap, st as formatTraceTime, ft as hasTraceFailure, L as isConversationIdForSub, e as isSafeMarkdownUrl, $ as joinInstructions, F as mapTranscript, ie as mergeEarlierPage, Ze as parseBaileyChartSpec, A as parseSseFrames, Fe as resolveToolCall, Ue as shouldUseGrid, pt as toActivityLines, mt as toToolSteps, lt as toTraceRows, dt as toTraceSegments, nt as traceEventArgsDetail, ot as traceEventHint, rt as traceEventOutputDetail, at as traceEventRawDetail, tt as traceEventSummary, et as traceEventToolName, ut as traceSummaryLine, ye as useBaileyChat, V as useBaileyConversations };
3208
+ export { zt as ActivityIcon, Ft as ArrowUpRightIcon, Xn as BAILEYAI_CHAT_UI_VERSION, We as BAILEY_CHART_PROMPT_FRAGMENT, Ie as BAILEY_TABLE_GRID_ROW_THRESHOLD, j as BaileyApiError, Yn as BaileyChatPanel, M as BaileyCleanupError, zn as BaileyFeedbackButtons, En as BaileyHistoryDrawer, on as BaileyTracePanel, Xt as CopyMarkdownButton, ae as DEFAULT_CONVERSATION_STORAGE_KEY, Nt as HeartIcon, Qe as TRACE_KIND_LABEL, Gt as ThumbDownIcon, Wt as ThumbUpIcon, Pe as createBaileyClient, ie as createBaileyFeedbackHandlers, Mt as createBaileyMarkdownComponents, se as createMemoryConversationStorage, oe as createSessionConversationStorage, O as extractPseudoToolCalls, He as extractTableData, Tn as formatRelativeTime, ct as formatTraceGap, st as formatTraceTime, ft as hasTraceFailure, R as isConversationIdForSub, e as isSafeMarkdownUrl, Z as joinInstructions, re as mapTranscript, L as mergeEarlierPage, Ze as parseBaileyChartSpec, A as parseSseFrames, $ as resolveToolCall, Ue as shouldUseGrid, pt as toActivityLines, mt as toToolSteps, lt as toTraceRows, dt as toTraceSegments, nt as traceEventArgsDetail, ot as traceEventHint, rt as traceEventOutputDetail, at as traceEventRawDetail, tt as traceEventSummary, et as traceEventToolName, ut as traceSummaryLine, ye as useBaileyChat, xe as useBaileyConversations };